-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Description
Feature Description
Extend the Consul KV rest api with additional blocking query options:
$ curl \
https://consul.rocks/v1/kv/my-key?meta=true&filter=true&index=X
The meta=true option would result in returning keys and metadata but no values
The filter=true would only include keys whose modify indices were > X
$ curl \
https://consul.rocks/v1/kv/my-key?recurse=true&filter=true&index=X
The filter=true option would only return key/value/metadata for keys whose modify indices were > X
Use Case(s)
There are two use cases of interest:
-
Support clients doing blocking query of a key prefix in order to detect keys being added/removed. Currently the blocking query returns the complete set of keys, so the client needs to maintain state and do set difference operations in order to detect added/removed keys.
-
Support clients doing blocking query of a key prefix in order to detect values being modified. Right now this has to be done via a blocking query returning values for all keys.
As suggested in this thread (https://groups.google.com/forum/#!msg/consul-tool/Axow65BtSuY/TCLD5AFmCgAJ;context-place=forum/consul-tool) it would be great if there was an option for Consul to filter and return just the keys with a X-Consul-Index > the index specified in the query