-
-
Notifications
You must be signed in to change notification settings - Fork 782
Description
There is already mechanism to set optional parameter in alias:
formats:
- "google {{query=StackStorm}}"Problem
But what if we want to add simple hardcoded chatops command and hide unneeded logic behind the default/immutable action parameters?
I think that good ChatOps commands could be simple and easy to remember, without MANY optional parameters. Example case:
To do that, we need to create additional action with default parameters, which will trigger another action. I do this way almost everywhere (bad way): https://github.com/armab/st2-chatops-aliases/tree/master/actions
Proposal
The proposal is to allow setting from alias default/immutable action parameters.
Here is an example how it could look:
---
name: chatops.deploy
action_ref: packs.install
description: Deploy ChatOps pack from `armab/st2-ansible-chatops` GitHub repo
formats:
- "deploy chatops"
# these lines were added
# naming/structure is doubtful, but you got the idea
action_parameters:
packs: "st2-ansible-chatops"
repo_url: "armab/st2-ansible-chatops"Here you can see that behind simple and immutable/hardcoded ChatOps command:
!deploy chatops
stands:
st2 run packs.install packs=st2-ansible-chatops repo_url=armab/st2-ansible-chatopsThis simplifies things a lot, making existing actions more reusable by aliases.
