feat(cli): add support for -o name in ado get #794
Merged
Conversation
Signed-off-by: Alessandro Pomponio <alessandro.pomponio1@ibm.com>
Signed-off-by: Alessandro Pomponio <alessandro.pomponio1@ibm.com>
Signed-off-by: Alessandro Pomponio <alessandro.pomponio1@ibm.com>
Signed-off-by: Alessandro Pomponio <alessandro.pomponio1@ibm.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This pull request adds support for the
nameoutput format to theado getcommand, which outputs only resource identifiers (similar tokubectl get -o name). This new format provides a lightweight way to list resource names without fetching full resource details, improving performance and usability for scripting scenarios.Resolves #793
Files Changed
📄
orchestrator/cli/commands/get.pyUpdated the help text for the
-o/--outputoption to document the newnameformat, explaining that it outputs only resource identifiers similar to kubectl's behavior.📄
orchestrator/cli/models/types.pyAdded the
NAMEconstant and enum value toAdoGetSupportedOutputFormatsto register the new output format option.📄
orchestrator/cli/resources/actuator/get.pyImplemented
nameformat support for actuators. Added early validation to restrict actuators to onlydefaultandnameformats. When usingnameformat, outputs either a single actuator identifier (if specified) or all available actuator identifiers (one per line).📄
orchestrator/cli/resources/context/get.pyAdded
nameformat support for contexts. When using this format, outputs all available context identifiers in sorted order, one per line.📄
orchestrator/cli/resources/operator/get.pyImplemented
nameformat support for operators. Updated validation to allow bothdefaultandnameformats. When usingnameformat, verifies operator existence (if a specific operator is requested) and outputs either a single operator name or all operator names in sorted order.📄
orchestrator/cli/utils/resources/handlers.pyAdded generic
nameformat handling in the common resource handler. Implements efficient identifier-only queries usinggetResourceIdentifiersOfKindfor multiple resources, or validates existence and outputs the identifier for single resources. This provides the foundation fornameformat support across all standard resource types.