I have application configuration in a json with upto 80 key/value pairs per app, which are to be stored in Consul KV Store. Generally they are java keyvalue properties, I have a simple shell script, which does encode value and convert it into import compatible for consul import command. I am trying to automate the consul KV import for the new apps that on-board (apps that start using consul for KV Store).
So far we are manually running the consul kv import @app_config.json however, I would like to call HTTP api rather importing through consul KV import. Any suggestions please?
example for app config in json format.
[
        {
                "key": "asia",
                "flags": 0,
                "value": "NDQzNg=="
        },
        {
                "key": "asia/india",
                "flags": 0,
                "value": "MTMyNA=="
        },
        {
                "key": "europe",
                "flags": 0,
                "value": "NzQzLjE="
        },
        {
                "key": "europe/france",
                "flags": 0,
                "value": "NjYuOQ=="
        },
        {
                "key": "europe/germany",
                "flags": 0,
                "value": "ODIuNjc="
        }
]