Skip to content
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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

output jsonpath #3626

Open
Codelax opened this issue Jan 29, 2024 · 0 comments
Open

output jsonpath #3626

Codelax opened this issue Jan 29, 2024 · 0 comments

Comments

@Codelax
Copy link
Member

Codelax commented Jan 29, 2024

Community Note

  • Please vote on this issue by adding a 馃憤 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Description

Currently we can output using Go templates: scw instance server get <id> -otemplate="{{ .ID }}".
This can be complicated to use with advanced features like arrays, scw instance server get <id> -otemplate="{{ index 0 .PublicIPs }}".

We should investigate the usage of jsonpath like in kubectl to have an easier interface for output configuration.

How I imagine scw could expose this functionality

scw instance server get <id> -ojsonpath="{ .PublicIPs[0] }"

References

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant