Skip to content

feat(resources): add get-meta command and label selector support#252

Open
moustafab wants to merge 3 commits intomainfrom
moustafab/get-list-improvements
Open

feat(resources): add get-meta command and label selector support#252
moustafab wants to merge 3 commits intomainfrom
moustafab/get-list-improvements

Conversation

@moustafab
Copy link
Copy Markdown

@moustafab moustafab commented Mar 30, 2026

Summary

  • add a new grafanactl resources get-meta command to fetch partial object metadata for Grafana resources without retrieving full objects
  • add -l / --selector label selector support to the resource retrieval flow so get and other list-based fetches can filter results server-side
  • wire the new command into the resources command tree and add text/wide metadata output for partial object metadata lists

Test plan

  • go test ./cmd/grafanactl/resources ./internal/resources/...

This uses a metadata client to get only the metadata of resources which is a bit faster than fetching the full resources especially with big lists.
…e resources

This adds support for label selectors to the `get` `get-meta` and `fetch` commands, allowing users to filter resources based on labels. The label selector can be specified using the `-l` or `--selector` flag, following the format used in Kubernetes (e.g., `-l key=value,other=value`). This enhancement improves the usability of these commands by enabling more targeted retrieval of resources based on their labels.
@moustafab moustafab changed the title feat(resources): add PartialMetadataList and label selector support feat(resources): add get-meta command and label selector support Mar 30, 2026
@moustafab moustafab marked this pull request as ready for review March 30, 2026 22:34
@moustafab moustafab requested a review from a team as a code owner March 30, 2026 22:34
@moustafab moustafab requested review from K-Phoen and spinillos March 30, 2026 22:34
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.

1 participant