Skip to content

feat(cli): add support for -o name in ado get #794

Merged
AlessandroPomponio merged 4 commits into
mainfrom
ap_793_add_output_name_to_ado_get
Apr 7, 2026
Merged

feat(cli): add support for -o name in ado get #794
AlessandroPomponio merged 4 commits into
mainfrom
ap_793_add_output_name_to_ado_get

Conversation

@AlessandroPomponio
Copy link
Copy Markdown
Member

@AlessandroPomponio AlessandroPomponio commented Apr 7, 2026

Summary

This pull request adds support for the name output format to the ado get command, which outputs only resource identifiers (similar to kubectl 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.py

Updated the help text for the -o/--output option to document the new name format, explaining that it outputs only resource identifiers similar to kubectl's behavior.

📄 orchestrator/cli/models/types.py

Added the NAME constant and enum value to AdoGetSupportedOutputFormats to register the new output format option.

📄 orchestrator/cli/resources/actuator/get.py

Implemented name format support for actuators. Added early validation to restrict actuators to only default and name formats. When using name format, outputs either a single actuator identifier (if specified) or all available actuator identifiers (one per line).

📄 orchestrator/cli/resources/context/get.py

Added name format support for contexts. When using this format, outputs all available context identifiers in sorted order, one per line.

📄 orchestrator/cli/resources/operator/get.py

Implemented name format support for operators. Updated validation to allow both default and name formats. When using name format, 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.py

Added generic name format handling in the common resource handler. Implements efficient identifier-only queries using getResourceIdentifiersOfKind for multiple resources, or validates existence and outputs the identifier for single resources. This provides the foundation for name format support across all standard resource types.

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>
Copy link
Copy Markdown
Member

@michael-johnston michael-johnston left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@AlessandroPomponio AlessandroPomponio added this pull request to the merge queue Apr 7, 2026
Merged via the queue into main with commit 924651a Apr 7, 2026
19 checks passed
@AlessandroPomponio AlessandroPomponio deleted the ap_793_add_output_name_to_ado_get branch April 7, 2026 19:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(cli): add -o name output to ado get commands

2 participants