I have a bash script that I currently use to upload individual key-value pairs to consul using a PUT request to the /v1/kv
endpoint. Since many of these are nested under the same key path, I want to reduce the amount of calls made to the API. Is it possible to post a JSON blob with nested keys to the /txn
endpoint to achieve the same effect?
Example of the current requests:
curl --request PUT --data ‘60’ $CONSUL_KV_URL/cluster/system/config/server/host_config_value
curl --request PUT --data ‘60’ $CONSUL_KV_URL/cluster/system/config/server/user_config_value
curl --request PUT --data ‘60’ $CONSUL_KV_URL/cluster/system/config/server/some_final_key
curl --request PUT --data ‘60’ $CONSUL_KV_URL/cluster/system/config/server/another_key
curl --request PUT --data ‘60’ $CONSUL_KV_URL/cluster/system/config/server/storage/final_key_ttl