ekuiper icon indicating copy to clipboard operation
ekuiper copied to clipboard

Add JSON output option to `cli` command

Open dcmartin opened this issue 5 years ago • 3 comments
trafficstars

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).

dcmartin avatar Mar 25 '20 19:03 dcmartin

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).

There is a RESTful API in place, check https://github.com/emqx/kuiper/tree/master/docs/en_US/restapi

ngjaying avatar Mar 26 '20 00:03 ngjaying

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 avatar Mar 26 '20 22:03 dcmartin

@dcmartin Are you interested in developing feature CLI also provide the option to produce JSON output ? :-)

jinfahua avatar Mar 27 '20 02:03 jinfahua

@ngjaying Added a PR to close this, linked above

jerempy avatar Oct 05 '23 17:10 jerempy