spring-cloud / spring-cloud-consul

Spring Cloud Consul
http://cloud.spring.io/spring-cloud-consul/
Apache License 2.0
812 stars 541 forks source link

Bulk upload key-value props under a prefix #640

Closed sudiptasish closed 4 years ago

sudiptasish commented 4 years ago

Is your feature request related to a problem? Please describe. Today the conventional consul http PUT endpoint takes a single value and upload it against a key. It would be nice to have a bulk upload API.

Describe the solution you'd like To give you an example, I am looking something like below: Here is my config file, tmp.props :

[
   {
     "key": "thread/pool/size",
     "value": "20"
   },
   {
     "key": "thread/pool/name",
     "value": "core_pool"
   },
   {
     "key": "thread/pool/group",
     "value": "group_1"
   }
]

The below command should create the the new keys underneath the prefix "ecm". curl -X PUT http://localhost:8500/v1/kv/ecm --data-binary @./tmp.props

However, today it is storing the complete file as a blob. Which is fine as it serves my other use case, where I want my (json) file to be stored as a blob. However, for files in above format (simple key-value pair), it would be nice to provide an option, so that instead of storing the entire file content as a blob, it can actually create complete key hierarchy.

Something like: curl -X PUT http://localhost:8500/v1/kv/ecm?**recurse** --data-binary @./tmp.props

spencergibb commented 4 years ago

This is not the right repo for the consul api