Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign up[WIP] [RFC] Allow user to retrieve more than one resource using "st2 resource get" CLI command #4912
Conversation
CLI command.
This pull request addresses one of my biggest minor annoyances with StackStorm CLI.
A lot of times when I'm debugging / troubleshooting things, I need to view multiple resources at once to see what is going on.
This means that currently I need to run more than one command to achieve that.
For example:
This slows things down and means more typing (yes, I can use a bash alias or function, but that's not ideal and it's not available out of the box).
With this change, user can now view more than one resource using the get command.
The same pattern is already available with
st2 execution cancelcommand (I added it a while ago).For example:
Example output:
Open Questions / To Decide
Currently when a single source id is provided, the command behaves exactly in the same manner as it did before - it's fully backward compatible.
When retrieving multiple resources, if one of the provided resources is not found, we simply print that, but we don't immediately exit with non-zero status code and print other resources which were found.
As far as using the existing command name goes - I think that's better than adding yet another command (e.g.
st2 <resource> get-moreor similar) - the whole idea is that it's simple and it works out of the box so any other change which would make it less simple (e.g. new argument or filter to list command, etc.) is a no go.TODO