diff --git a/.changelog/11648.txt b/.changelog/11648.txt new file mode 100644 index 00000000000..ce58748aa83 --- /dev/null +++ b/.changelog/11648.txt @@ -0,0 +1,3 @@ +```release-note:improvement +api: Add pagination and filtering to Evaluations List API +``` diff --git a/website/content/api-docs/evaluations.mdx b/website/content/api-docs/evaluations.mdx index 4f5ece72a68..9711140edd1 100644 --- a/website/content/api-docs/evaluations.mdx +++ b/website/content/api-docs/evaluations.mdx @@ -31,6 +31,24 @@ The table below shows this endpoint's support for even number of hexadecimal characters (0-9a-f). This is specified as a query string parameter. +- `next_token` `(string: "")` - This endpoint supports paging. The + `next_token` parameter accepts a string which is the `ID` field of + the next expected evaluation. This value can be obtained from the + `X-Nomad-NextToken` header from the previous response. + +- `per_page` `(int: 0)` - Specifies a maximum number of evaluations to + return for this request. If omitted, the response is not + paginated. The `ID` of the last evaluation in the response can be + used as the `last_token` of the next request to fetch additional + pages. + +- `job` `(string: "")` - Filter the list of evaluations to a specific + job ID. + +- `status` `(string: "")` - Filter the list of evaluations to a + specific evaluation status (one of `blocked`, `pending`, `complete`, + `failed`, or `canceled`). + ### Sample Request ```shell-session