-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add pagination, filtering and sort to more API endpoints #12186
Commits on Mar 3, 2022
-
api: split paginator components
As more endpoints started using the API response paginator, new patterns started to emerge that required either more flexible configuration or a lot of re-used code. This commit splits the paginator into three logical components: - The Paginator is reponsible for splitting the values of an iterator into chunks of the requested size. - The Tokenizer returns a page token that is used to uniquely identify elements of the iterator. - The Filter is used to decide if a given element should be added to the page or skipped altogether. The Paginator implementation has returned, more or less, to its initial clean design and implementation. Additional logic and flow customization can be provided by implementing the Tokenizer and Filter interfaces. One Tokenizer implementation is provided (StructsTokenizer) which can be configured to emit tokens using common fields found in structs, such as ID, Namespace, and CreateIndex. The go-bexpr Evaluator implements the Filter interface, so it can be used directly. Another implementation provided is the NamespaceFilter, which can be used to apply filtering logic based on the namespaces the ACL token used for the request is allowed to access.
Configuration menu - View commit details
-
Copy full SHA for 1a5d07c - Browse repository at this point
Copy the full SHA 1a5d07cView commit details -
Configuration menu - View commit details
-
Copy full SHA for d5a0d7f - Browse repository at this point
Copy the full SHA d5a0d7fView commit details -
api: add filter and pagination to /v1/volumes
It's currently not possible to provide consistent sorting by CreateIndex to this endpoint because it requires a Namespace and ID to be able to uniquely identify a volume. This reduces the type of go-memdb indexes that can be created where the raft CreateIndex would be in a position that would allow sorting with prefix match.
Configuration menu - View commit details
-
Copy full SHA for 7069e67 - Browse repository at this point
Copy the full SHA 7069e67View commit details -
api: add filter and pagination to /v1/jobs
It's currently not possible to provide consistent sorting by CreateIndex to this endpoint because it requires a Namespace and ID to be able to uniquely identify a job. This reduces the type of go-memdb indexes that can be created where the raft CreateIndex would be in a position that would allow sorting with prefix match.
Configuration menu - View commit details
-
Copy full SHA for b624798 - Browse repository at this point
Copy the full SHA b624798View commit details -
api: add filter, pagination, and sorting to /v1/allocations
Co-authored-by: Seth Hoenig <seth.a.hoenig@gmail.com>
Configuration menu - View commit details
-
Copy full SHA for ef098d7 - Browse repository at this point
Copy the full SHA ef098d7View commit details -
api: refactor allocations list endpoint
Refactor the allocations list endpoint to merge the listAllNamespaces special case into the normal List function. Co-authored-by: Seth Hoenig <seth.a.hoenig@gmail.com>
Configuration menu - View commit details
-
Copy full SHA for 194c407 - Browse repository at this point
Copy the full SHA 194c407View commit details -
api: refactor jobs list endpoint
Refactor the jobs list endpoint to merge the listAllNamespaces special case into the normal List function.
Configuration menu - View commit details
-
Copy full SHA for cac9ec4 - Browse repository at this point
Copy the full SHA cac9ec4View commit details -
api: rename ascending query param to reverse
Using reverse provides a more generic intention that the results should be returned in the reverse of the default order instead of assuming any particular order.
Configuration menu - View commit details
-
Copy full SHA for 8582efb - Browse repository at this point
Copy the full SHA 8582efbView commit details -
Configuration menu - View commit details
-
Copy full SHA for e181fd6 - Browse repository at this point
Copy the full SHA e181fd6View commit details
Commits on Mar 7, 2022
-
Configuration menu - View commit details
-
Copy full SHA for e79ecf8 - Browse repository at this point
Copy the full SHA e79ecf8View commit details -
Configuration menu - View commit details
-
Copy full SHA for 837884c - Browse repository at this point
Copy the full SHA 837884cView commit details
Commits on Mar 8, 2022
-
Configuration menu - View commit details
-
Copy full SHA for f7392b8 - Browse repository at this point
Copy the full SHA f7392b8View commit details -
Configuration menu - View commit details
-
Copy full SHA for cb8c6d0 - Browse repository at this point
Copy the full SHA cb8c6d0View commit details