metadata cli: support JSON-formatted output
See original GitHub issueSome CLIs (docker comes to mind) support optional JSON-formatted output to allow for programatic result processing to automate certain tasks, such as testing, migration etc. It would be nice if elyra-metadata
would support a flag (for example) that the user can specify to have the results returned as a JSON document, which can be easily parsed using jq
.
Example of current output:
$ elyra-metadata list code-snippets
Available metadata instances for code-snippets (includes invalid):
Schema Instance Resource
------ -------- --------
code-snippet a /Users/patti/Library/Jupyter/metadata/code-snippets/a.json
code-snippet aaa /Users/patti/Library/Jupyter/metadata/code-snippets/aaa.json
code-snippet b /Users/patti/Library/Jupyter/metadata/code-snippets/b.json
code-snippet c /Users/patti/Library/Jupyter/metadata/code-snippets/c.json
code-snippet copyright /Users/patti/Library/Jupyter/metadata/code-snippets/copyright.json
code-snippet s /Users/patti/Library/Jupyter/metadata/code-snippets/s.json
vs
$ elyra-metadata list code-snippets --format JSON
[
{
...
},
{
...
}
]
Issue Analytics
- State:
- Created 3 years ago
- Comments:8 (8 by maintainers)
Top Results From Across the Web
Setting the AWS CLI output format - AWS Documentation
The AWS CLI supports the following output formats: json – The output is formatted as a JSON string. yaml – The output is...
Read more >put-metadata — AWS CLI 2.9.1 Command Reference
The JSON string follows the format provided by --generate-cli-skeleton . If other arguments are provided on the command line, those values will override...
Read more >source Commands | Salesforce CLI Command Reference
sfdx force:source:convert: [ --json ]: [ --loglevel LOGLEVEL]: [ -r ROOTDIR] ... Output directory to store the Metadata API–formatted files in.
Read more >Setting Vault CLI output format - Hashicorp Support
table (Default): The output is presented in a "human-friendly" format. · json: The output is formatted as a JSON string. · yaml: The...
Read more >Setting up JSON metadata for an output file - 8.0
Available in... Open Studio for Big Data Open Studio for Data Integration Open Studio for ESB This section describes how to define JSON...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
No worries - the option has been there since the tool existed.
I’m in favor of changing the functionality of
--json
so that it ONLY displays JSON (as array elements) and tolerates being piped to JSON-aware tools.@lresende - are you okay with that?
A programming language agnostic approach would be more user friendly.