The datastore value is a fix value, & need a method to update the value once the rule is
run.
Below are the outputs of rule-enforcement list , rule-tester, trigger-instance list &
execution list
root@ip-10-12-4-78:~# st2 rule-enforcement list --rule=swarm.on_pending_scaleup_aws
±-------------------------±---------------------------±-------------------------±-------------------------±---------------------------+
| id | rule.ref | trigger_instance_id | execution_id | enforced_at |
±-------------------------±---------------------------±-------------------------±-------------------------±---------------------------+
| 5c422c746614957f7cae56c3 | swarm.on_pending_scaleup_a | 5c422c746614957f7cae56bf |
5c422c746614957f7cae56c2 | 2019-01-18T19:43:48.461298 |
| | ws | | | Z |
| 5c41cc1a6614957f7cae56af | swarm.on_pending_scaleup_a | 5c41cc1a6614957f7cae56ab |
5c41cc1a6614957f7cae56ae | 2019-01-18T12:52:42.577356 |
| | ws | | | Z |
| 5c41c9ba6614957f7cae5699 | swarm.on_pending_scaleup_a | 5c41c9ba6614957f7cae5695 |
5c41c9ba6614957f7cae5698 | 2019-01-18T12:42:34.763958 |
| | ws | | | Z |
| 5c41c8486614957f7cae567d | swarm.on_pending_scaleup_a | 5c41c8486614957f7cae5679 |
5c41c8486614957f7cae567c | 2019-01-18T12:36:24.470565 |
| | ws | | | Z |
| 5c41c7126614957f7cae5661 | swarm.on_pending_scaleup_a | 5c41c7126614957f7cae565d |
5c41c7126614957f7cae5660 | 2019-01-18T12:31:14.186136 |
| | ws | | | Z |
| 5c41c5aa6614957f7cae564d | swarm.on_pending_scaleup_a | 5c41c5a96614957f7cae5649 |
5c41c5aa6614957f7cae564c | 2019-01-18T12:25:13.935784 |
| | ws | | | Z |
| 5c41c3bb6614957f7cae563d | swarm.on_pending_scaleup_a | 5c41c3ba6614957f7cae5639 |
5c41c3bb6614957f7cae563c | 2019-01-18T12:16:58.843185 |
| | ws | | | Z |
| 5c41c32e6614957f7cae562d | swarm.on_pending_scaleup_a | 5c41c32e6614957f7cae5629 |
5c41c32e6614957f7cae562c | 2019-01-18T12:14:38.386350 |
| | ws | | | Z |
±-------------------------±---------------------------±-------------------------±-------------------------±---------------------------+
root@ip-10-12-4-78:~# st2-rule-tester --trigger-instance-id=5c422c746614957f7cae56bf
--rule-ref=swarm.on_pending_scaleup_aws
2019-01-18 19:53:08,631 INFO [-] Connecting to database “st2” @ “127.0.0.1:27017” as user
“None”.
2019-01-18 19:53:08,634 INFO [-] Successfully connected to database “st2” @ “127.0.0.1:27017”
as user “None”.
2019-01-18 19:53:08,781 INFO [-] Validating rule swarm.on_pending_scaleup_aws for
pending_tasks.
2019-01-18 19:53:08,804 INFO [-] 1 rule(s) found to enforce for pending_tasks.
2019-01-18 19:53:08,808 INFO [-] Failed to retrieve config for pack <Mock name=‘mock.pack’
id=‘140359798560976’> and user stanley: ‘Mock’ object is not iterable
2019-01-18 19:53:08,816 INFO [-] Action parameters resolved to:
2019-01-18 19:53:08,816 INFO [-] AutoScalingGroupName: swarm-workers-tf
2019-01-18 19:53:08,816 INFO [-] DesiredCapacity: 3
2019-01-18 19:53:08,817 INFO [-] === RULE MATCHES ===
oot@ip-10-12-4-78:~# st2 trigger-instance list --trigger=swarm.pending_tasks
±-------------------------±--------------------±------------------------------±----------+
| id | trigger | occurrence_time | status |
±-------------------------±--------------------±------------------------------±----------+
| 5c41c32e6614957f7cae5629 | swarm.pending_tasks | Fri, 18 Jan 2019 12:14:38 UTC | processed
|
| 5c41c3926614957f7cae5633 | swarm.pending_tasks | Fri, 18 Jan 2019 12:16:18 UTC | processed
|
| 5c41c3ba6614957f7cae5639 | swarm.pending_tasks | Fri, 18 Jan 2019 12:16:58 UTC | processed
|
| 5c41c41e6614957f7cae5643 | swarm.pending_tasks | Fri, 18 Jan 2019 12:18:38 UTC | processed
|
| 5c41c5a96614957f7cae5649 | swarm.pending_tasks | Fri, 18 Jan 2019 12:25:13 UTC | processed
|
| 5c41c6c26614957f7cae5657 | swarm.pending_tasks | Fri, 18 Jan 2019 12:29:54 UTC | processed
|
| 5c41c7126614957f7cae565d | swarm.pending_tasks | Fri, 18 Jan 2019 12:31:14 UTC | processed
|
| 5c41c83e6614957f7cae5673 | swarm.pending_tasks | Fri, 18 Jan 2019 12:36:14 UTC | processed
|
| 5c41c8486614957f7cae5679 | swarm.pending_tasks | Fri, 18 Jan 2019 12:36:24 UTC | processed
|
| 5c41c9ab6614957f7cae568f | swarm.pending_tasks | Fri, 18 Jan 2019 12:42:19 UTC | processed
|
| 5c41c9ba6614957f7cae5695 | swarm.pending_tasks | Fri, 18 Jan 2019 12:42:34 UTC | processed
|
| 5c41ca056614957f7cae569f | swarm.pending_tasks | Fri, 18 Jan 2019 12:43:49 UTC | processed
|
| 5c41cc1a6614957f7cae56ab | swarm.pending_tasks | Fri, 18 Jan 2019 12:52:42 UTC | processed
|
| 5c422c746614957f7cae56bf | swarm.pending_tasks | Fri, 18 Jan 2019 19:43:48 UTC | processed
|
±-------------------------±--------------------±------------------------------±----------+
root@ip-10-12-4-78:~# st2 execution list
±-------------------------±-----------------------±-------------±------------------------±-----------------------±---------------------+
| id | action.ref | context.user | status | start_timestamp | end_timestamp |
±-------------------------±-----------------------±-------------±------------------------±-----------------------±---------------------+
| 5c40a6df6614950198562476 | aws.autoscaling_update | testu | succeeded (1s elapsed) | Thu,
17 Jan 2019 | Thu, 17 Jan 2019 |
| | _auto_scaling_group | | | 16:01:34 UTC | 16:01:35 UTC |
| 5c40a7406614950198562479 | aws.autoscaling_update | testu | succeeded (1s elapsed) | Thu,
17 Jan 2019 | Thu, 17 Jan 2019 |
| | _auto_scaling_group | | | 16:03:12 UTC | 16:03:13 UTC |
| 5c40a7c1661495019856247c | aws.autoscaling_update | testu | succeeded (1s elapsed) | Thu,
17 Jan 2019 | Thu, 17 Jan 2019 |
| | _auto_scaling_group | | | 16:05:21 UTC | 16:05:22 UTC |
| 5c40bbb5661495019856247f | swarm.pending_queue | testu | succeeded (0s elapsed) | Thu, 17
Jan 2019 | Thu, 17 Jan 2019 |
| | | | | 17:30:29 UTC | 17:30:29 UTC |
| 5c40bbd56614950198562482 | swarm.pending_queue | testu | succeeded (1s elapsed) | Thu, 17
Jan 2019 | Thu, 17 Jan 2019 |
| | | | | 17:31:01 UTC | 17:31:02 UTC |
| 5c40bc126614950198562485 | swarm.pending_queue | testu | succeeded (1s elapsed) | Thu, 17
Jan 2019 | Thu, 17 Jan 2019 |
| | | | | 17:32:02 UTC | 17:32:03 UTC |
| 5c40bcaf6614950198562488 | aws.autoscaling_update | testu | succeeded (2s elapsed) | Thu,
17 Jan 2019 | Thu, 17 Jan 2019 |
| | _auto_scaling_group | | | 17:34:39 UTC | 17:34:41 UTC |
| 5c40bf8c661495019856248b | aws.autoscaling_update | testu | succeeded (1s elapsed) | Thu,
17 Jan 2019 | Thu, 17 Jan 2019 |
| | _auto_scaling_group | | | 17:46:52 UTC | 17:46:53 UTC |
| 5c40c115661495019856248e | packs.install | testu | succeeded (18s elapsed) | Thu, 17 Jan
2019 | Thu, 17 Jan 2019 |
| | | | | 17:53:25 UTC | 17:53:43 UTC |
| 5c40c19b6614950198562525 | packs.uninstall | testu | succeeded (4s elapsed) | Thu, 17 Jan
2019 | Thu, 17 Jan 2019 |
| | | | | 17:55:39 UTC | 17:55:43 UTC |
| 5c40c4306614950198562528 | swarm.pending_queue | testu | succeeded (1s elapsed) | Thu, 17
Jan 2019 | Thu, 17 Jan 2019 |
| | | | | 18:06:40 UTC | 18:06:41 UTC |
| 5c40d7b3661495019856252b | swarm.node_count | testu | succeeded (1s elapsed) | Thu, 17 Jan
2019 | Thu, 17 Jan 2019 |
| | | | | 19:29:55 UTC | 19:29:56 UTC |
| 5c40dce4661495019856252f | core.local | testu | succeeded (0s elapsed) | Thu, 17 Jan 2019
| Thu, 17 Jan 2019 |
| | | | | 19:52:04 UTC | 19:52:04 UTC |
| 5c40dcef6614950198562532 | core.local | testu | succeeded (0s elapsed) | Thu, 17 Jan 2019
| Thu, 17 Jan 2019 |
| | | | | 19:52:15 UTC | 19:52:15 UTC |
| 5c40e1a36614950198562535 | core.local | testu | succeeded (0s elapsed) | Thu, 17 Jan 2019
| Thu, 17 Jan 2019 |
| | | | | 20:12:19 UTC | 20:12:19 UTC |
| 5c40e1aa6614950198562538 | core.local | testu | succeeded (0s elapsed) | Thu, 17 Jan 2019
| Thu, 17 Jan 2019 |
| | | | | 20:12:26 UTC | 20:12:26 UTC |
| 5c40e1b0661495019856253b | core.local | testu | succeeded (0s elapsed) | Thu, 17 Jan 2019
| Thu, 17 Jan 2019 |
| | | | | 20:12:32 UTC | 20:12:32 UTC |
| 5c40e1fc661495019856253e | core.local | testu | failed (0s elapsed) | Thu, 17 Jan 2019 |
Thu, 17 Jan 2019 |
| | | | | 20:13:48 UTC | 20:13:48 UTC |
| 5c40e2026614950198562541 | core.local | testu | succeeded (0s elapsed) | Thu, 17 Jan 2019
| Thu, 17 Jan 2019 |
| | | | | 20:13:54 UTC | 20:13:54 UTC |
| 5c40e2486614950198562544 | swarm.node_count | testu | succeeded (0s elapsed) | Thu, 17 Jan
2019 | Thu, 17 Jan 2019 |
| | | | | 20:15:04 UTC | 20:15:04 UTC |
| 5c40e2856614950198562547 | core.local | testu | failed (0s elapsed) | Thu, 17 Jan 2019 |
Thu, 17 Jan 2019 |
| | | | | 20:16:05 UTC | 20:16:05 UTC |
| 5c40e6bf661495019856254a | core.local | testu | succeeded (0s elapsed) | Thu, 17 Jan 2019
| Thu, 17 Jan 2019 |
| | | | | 20:34:07 UTC | 20:34:07 UTC |
| 5c40e6ca661495019856254d | core.local | testu | succeeded (0s elapsed) | Thu, 17 Jan 2019
| Thu, 17 Jan 2019 |
| | | | | 20:34:18 UTC | 20:34:18 UTC |
| 5c40e7a46614950198562550 | core.local | testu | succeeded (0s elapsed) | Thu, 17 Jan 2019
| Thu, 17 Jan 2019 |
| | | | | 20:37:56 UTC | 20:37:56 UTC |
| 5c40e9226614950198562553 | core.local | testu | succeeded (0s elapsed) | Thu, 17 Jan 2019
| Thu, 17 Jan 2019 |
| | | | | 20:44:18 UTC | 20:44:18 UTC |
| 5c40ea696614950198562556 | core.local | testu | succeeded (0s elapsed) | Thu, 17 Jan 2019
| Thu, 17 Jan 2019 |
| | | | | 20:49:45 UTC | 20:49:45 UTC |
| 5c40ec086614950198562559 | swarm.pending_queue | testu | succeeded (0s elapsed) | Thu, 17
Jan 2019 | Thu, 17 Jan 2019 |
| | | | | 20:56:40 UTC | 20:56:40 UTC |
| 5c40ec59661495019856255c | aws.autoscaling_update | testu | succeeded (1s elapsed) | Thu,
17 Jan 2019 | Thu, 17 Jan 2019 |
| | _auto_scaling_group | | | 20:58:01 UTC | 20:58:02 UTC |
| 5c41c32e6614957f7cae562c | aws.autoscaling_update | stanley | succeeded (2s elapsed) |
Fri, 18 Jan 2019 | Fri, 18 Jan 2019 |
| | _auto_scaling_group | | | 12:14:38 UTC | 12:14:40 UTC |
| 5c41c32e6614957f7cae562f | core.local | stanley | succeeded (1s elapsed) | Fri, 18 Jan
2019 | Fri, 18 Jan 2019 |
| | | | | 12:14:38 UTC | 12:14:39 UTC |
| 5c41c3926614957f7cae5636 | core.local | stanley | succeeded (0s elapsed) | Fri, 18 Jan
2019 | Fri, 18 Jan 2019 |
| | | | | 12:16:18 UTC | 12:16:18 UTC |
| 5c41c3bb6614957f7cae563c | aws.autoscaling_update | stanley | succeeded (3s elapsed) |
Fri, 18 Jan 2019 | Fri, 18 Jan 2019 |
| | _auto_scaling_group | | | 12:16:58 UTC | 12:17:01 UTC |
| 5c41c3bb6614957f7cae563f | core.local | stanley | succeeded (1s elapsed) | Fri, 18 Jan
2019 | Fri, 18 Jan 2019 |
| | | | | 12:16:59 UTC | 12:17:00 UTC |
| 5c41c41e6614957f7cae5646 | core.local | stanley | succeeded (0s elapsed) | Fri, 18 Jan
2019 | Fri, 18 Jan 2019 |
| | | | | 12:18:38 UTC | 12:18:38 UTC |
| 5c41c5aa6614957f7cae564c | aws.autoscaling_update | stanley | succeeded (2s elapsed) |
Fri, 18 Jan 2019 | Fri, 18 Jan 2019 |
| | _auto_scaling_group | | | 12:25:13 UTC | 12:25:15 UTC |
| 5c41c5aa6614957f7cae564f | core.local | stanley | succeeded (0s elapsed) | Fri, 18 Jan
2019 | Fri, 18 Jan 2019 |
| | | | | 12:25:14 UTC | 12:25:14 UTC |
| 5c41c6c26614957f7cae565a | core.local | stanley | succeeded (0s elapsed) | Fri, 18 Jan
2019 | Fri, 18 Jan 2019 |
| | | | | 12:29:54 UTC | 12:29:54 UTC |
| 5c41c7126614957f7cae5660 | aws.autoscaling_update | stanley | succeeded (2s elapsed) |
Fri, 18 Jan 2019 | Fri, 18 Jan 2019 |
| | _auto_scaling_group | | | 12:31:14 UTC | 12:31:16 UTC |
| 5c41c7126614957f7cae5663 | core.local | stanley | succeeded (1s elapsed) | Fri, 18 Jan
2019 | Fri, 18 Jan 2019 |
| | | | | 12:31:14 UTC | 12:31:15 UTC |
| 5c41c83e6614957f7cae5676 | core.local | stanley | succeeded (0s elapsed) | Fri, 18 Jan
2019 | Fri, 18 Jan 2019 |
| | | | | 12:36:14 UTC | 12:36:14 UTC |
| 5c41c8486614957f7cae567c | aws.autoscaling_update | stanley | succeeded (1s elapsed) |
Fri, 18 Jan 2019 | Fri, 18 Jan 2019 |
| | _auto_scaling_group | | | 12:36:24 UTC | 12:36:25 UTC |
| 5c41c8486614957f7cae567f | core.local | stanley | succeeded (1s elapsed) | Fri, 18 Jan
2019 | Fri, 18 Jan 2019 |
| | | | | 12:36:24 UTC | 12:36:25 UTC |
| 5c41c9ab6614957f7cae5692 | core.local | stanley | succeeded (1s elapsed) | Fri, 18 Jan
2019 | Fri, 18 Jan 2019 |
| | | | | 12:42:19 UTC | 12:42:20 UTC |
| 5c41c9ba6614957f7cae5698 | aws.autoscaling_update | stanley | succeeded (1s elapsed) |
Fri, 18 Jan 2019 | Fri, 18 Jan 2019 |
| | _auto_scaling_group | | | 12:42:34 UTC | 12:42:35 UTC |
| 5c41c9ba6614957f7cae569b | core.local | stanley | succeeded (1s elapsed) | Fri, 18 Jan
2019 | Fri, 18 Jan 2019 |
| | | | | 12:42:34 UTC | 12:42:35 UTC |
| 5c41ca056614957f7cae56a2 | core.local | stanley | succeeded (1s elapsed) | Fri, 18 Jan
2019 | Fri, 18 Jan 2019 |
| | | | | 12:43:49 UTC | 12:43:50 UTC |
| 5c41cc1a6614957f7cae56ae | aws.autoscaling_update | stanley | succeeded (2s elapsed) |
Fri, 18 Jan 2019 | Fri, 18 Jan 2019 |
| | _auto_scaling_group | | | 12:52:42 UTC | 12:52:44 UTC |
| 5c41cc1a6614957f7cae56b1 | core.local | stanley | succeeded (1s elapsed) | Fri, 18 Jan
2019 | Fri, 18 Jan 2019 |
| | | | | 12:52:42 UTC | 12:52:43 UTC |
| 5c422c746614957f7cae56c2 | aws.autoscaling_update | stanley | succeeded (2s elapsed) |
Fri, 18 Jan 2019 | Fri, 18 Jan 2019 |
| | _auto_scaling_group | | | 19:43:48 UTC | 19:43:50 UTC |
| 5c422c746614957f7cae56c5 | core.local | stanley | succeeded (1s elapsed) | Fri, 18 Jan
2019 | Fri, 18 Jan 2019 |
| | | | | 19:43:48 UTC | 19:43:49 UTC |
±-------------------------±-----------------------±-------------±------------------------±-----------------------±---------------------+
±-------------------------------------------------------------------------------------------------------------------------------------------+
| Note: Only first 50 action executions are displayed. Use -n/–last flag for more results. |
±-------------------------------------------------------------------------------------------------------------------------------------------+