ekuiper
ekuiper copied to clipboard
Add JSON output option to `cli` command
Provide option for cli command to output JSON rather than human-readable-text (HRT). For example, currently the output for docker exec -it kuiper bin/cli describe stream motion where motion is one defined stream, results in:
Fields
--------------------------------------------------------------------------------
device string
camera string
count bigint
DATASOURCE: +/+/+/event/end/+
FORMAT: JSON
A structured result in JSON would be much more efficient for automating interactions with the CLI in scripts, as well as to provide a simple ReSTful API (which I am about to do).
Provide option for
clicommand to output JSON rather than human-readable-text (HRT). For example, currently the output fordocker exec -it kuiper bin/cli describe stream motionwheremotionis one defined stream, results in:Fields -------------------------------------------------------------------------------- device string camera string count bigint DATASOURCE: +/+/+/event/end/+ FORMAT: JSONA structured result in JSON would be much more efficient for automating interactions with the CLI in scripts, as well as to provide a simple ReSTful API (which I am about to do).
There is a RESTful API in place, check https://github.com/emqx/kuiper/tree/master/docs/en_US/restapi
Excellent! +1 on the REST API. I will make use of it. Nonetheless, I think it would be great to have the CLI also provide the option to produce JSON output.
@dcmartin Are you interested in developing feature CLI also provide the option to produce JSON output ? :-)
@ngjaying Added a PR to close this, linked above