StackStorm rules can be deployed through its UI, a CLI, or APIs. In this recipe, we will use the rule we defined previously and deploy it using the following steps:
- Create the rule using the YAML file we created in theĀ Defining a rule recipe:
$ kubectl exec -it ${ST2CLIENT} -n stackstorm -- st2 rule create first_rule.yaml
- List the rules and confirm that the new rule has been created. You should see theĀ examples.sample_rule_with_webhook rule on the list, as follows:
$ kubectl exec -it ${ST2CLIENT} -n stackstorm -- st2 rule list
+------------------+----------+-------------------------+---------+
| ref | pack | description | enabled |
+------------------+----------+-------------------------+---------+
| chatops.notify | chatops | Notification rule to | True |
| | | send results of action | |
| | | executions to stream | |
| | | for chatops | |
| examples.sample | examples | Sample rule dumping | True |
| rule_with_webhook| | webhook payload to a | |
| | | file. | |
+------------------+----------+-------------------------+---------+
With the new rule we created here, the webhook has started to listen on https://{host}/api/v1/webhooks/sample.