Closed vanyasvl closed 2 years ago
JSON output already implemented in clickhouse-backup server
mode
unfortunately, currently is not so easy to add JSON to any output in CLI mode
@Slach but this one not actually JSON response, these are strings with JSON objects. Is it possible to implement real JSON API?
[1] 10:45:21 $ curl -s localhost:7171/backup/list
{"name":"2022-07-03T10-24-02","created":"2022-07-03 10:24:04","size":503688895,"location":"local","required":"","desc":""}
{"name":"2022-07-03T10-43-06","created":"2022-07-03 10:43:07","size":503672129,"location":"local","required":"","desc":""}
@k0t3n this is JSONEachRow format actually, this format was choose for easy integration with clickhouse itself
you can setup
api:
create_intergation_tables: true
and use clickhouse-client
SELECT * FROM system.backup_list FORMAT JSON;
INSERT INTO system.backup_actions(command) VALUES ('create_remote new_backup_name');
SELECT * FROM system.backup_actions FORMAT JSON;
It'll be great to add json output support for programmatically parse tool output.
Thanks.