mantl / consul-cli

Command line interface to Consul HTTP API
Apache License 2.0
251 stars 67 forks source link

"kv bulkload" should support the same JSON format as is output by "kv read" #29

Closed agperson closed 8 years ago

agperson commented 8 years ago

Dumping KV contents using kv read results in outputs like the following (when using the json/prettyjson format):

[
  {
    "Key": "foo",
    "CreateIndex": 8988,
    "ModifyIndex": 8988,
    "LockIndex": 0,
    "Flags": 0,
    "Value": "bar",
    "Session": ""
  }
]

However, the KV bulkload input format expects this:

{
  "foo": "bar"
}

Ideally there should be a way to either a) dump in the format expected or; b) accept the format that is dumped.

agperson commented 8 years ago

I have updated the wiki with documentation of the format for bulkload and example of using JQ to transform between the formats. I withdraw this request.