-
-
Notifications
You must be signed in to change notification settings - Fork 777
Allow user to retrieve more than one resource using "st2 resource get" CLI command #4912
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Thanks for contributing to this issue. As it has been 90 days since the last activity, we are automatically marking is as stale. If this issue is not relevant or applicable anymore (problem has been fixed in a new version or similar), please close the issue or let us know so we can close it. On the contrary, if the issue is still relevant, there is nothing you need to do, but if you have any additional details or context which would help us when working on this issue, please include it as a comment to this issue. |
|
I've pushed a change which adds this support for all the "resource get" commands. In addition to that, while working on this change, I cleaned up the code a bit - removed some overriden duplicated methods in sub-classes which are the same as in parent classes, made sure we don't re-hrow |
|
I tried to also add some end to end tests, but sadly I don't have many hours to deal with and wait on end to end tests. So I added some more unit tests which verify this new notation works for all the commands - 986989f. |
Manually resolving merge conflicts was too painful due to black changes.
369f217 to
62050e1
Compare
|
OK, this is now synced with latest master. Resolving merge conflicts was too painful due to black changes, so I just manually re-applied my old changes on top of latest master. |
which would sometimes cause test failures.
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