Skip to content
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

evaluations list pagination and filtering #11648

Merged
merged 6 commits into from
Dec 10, 2021
Merged

Commits on Dec 9, 2021

  1. api: add pagination token to QueryMeta

    API queries can request pagination using the `NextToken` and `PerPage`
    fields of `QueryOptions`, when supported by the underlying API.
    
    Add a `NextToken` field to the `structs.QueryMeta` so that we have a
    common field across RPCs to tell the caller where to resume paging
    from on their next API call. Include this field on the `api.QueryMeta`
    as well so that it's available for future versions of List HTTP APIs
    that wrap the response with `QueryMeta` rather than returning a simple
    list of structs. In the meantime callers can get the `X-Nomad-NextToken`.
    tgross committed Dec 9, 2021
    Configuration menu
    Copy the full SHA
    64cb8da View commit details
    Browse the repository at this point in the history
  2. pagination and filtering for Eval.List RPC

    Add pagination to the `Eval.List` RPC by checking for pagination token
    and page size in `QueryOptions`. This will allow resuming from the
    last ID seen so long as the query parameters and the state store
    itself are unchanged between requests.
    
    Add filtering by job ID or evaluation status over the results we get
    out of the state store.
    tgross committed Dec 9, 2021
    Configuration menu
    Copy the full SHA
    3aa05db View commit details
    Browse the repository at this point in the history
  3. pagination and filtering for Eval.List HTTP endpoint

    Parse the query parameters of the `Eval.List` API into the arguments
    expected for filtering in the RPC call.
    tgross committed Dec 9, 2021
    Configuration menu
    Copy the full SHA
    bf2ed52 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    8560246 View commit details
    Browse the repository at this point in the history

Commits on Dec 10, 2021

  1. Configuration menu
    Copy the full SHA
    921ddce View commit details
    Browse the repository at this point in the history
  2. move pagination control loop into Paginator

    Refactor to expose only a Page method that populates the result set by
    repeatedly calling an append function over the paged iterator.
    tgross committed Dec 10, 2021
    Configuration menu
    Copy the full SHA
    f641060 View commit details
    Browse the repository at this point in the history