hashicorp / hashicorp/consul

Implement general-purpose pagination functionality in KV API

Open
#2,168 6 comments 9 reactions 0 assignees View on GitHub
theme/api theme/kv type/enhancement
Dominant language
Go
Stars
30.1k
Forks
4.6k
Avg merge
2d 6h
Merged PRs (30d)
43

Description

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

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.