consul icon indicating copy to clipboard operation
consul copied to clipboard

Implement general-purpose pagination functionality in KV API

Open josiahhaswell opened this issue 8 years ago • 6 comments

Key hierarchies can grow to be quite large,and this introduces unnecessary and undesirable latencies during retrieval. It would be very nice if the KV API supported pagination. This could be done in a backwards-compatible fashion via query params (possibly something along the lines of)

/v1/kv/sample-key?start=0&end=10

Ordering would also generally be useful; adding

/v1/kv/sample-key?start=0&end=10&order=desc|asc

would sort the results by the lexicographical ordering of the keys under sample-key.

This could also be integrated consistently with recurse by performing a depth-first traversal of the keys in range [start, end] under the provided sort criterion and returning that set.

Thanks! Josiah

josiahhaswell avatar Jul 06 '16 18:07 josiahhaswell