Skip to content

Commit

Permalink
Additional query parameters in the compliance events API (#106)
Browse files Browse the repository at this point in the history
* Add the pages metadata field

Signed-off-by: mprahl <[email protected]>

* Add query parameters for sorting

Signed-off-by: mprahl <[email protected]>

---------

Signed-off-by: mprahl <[email protected]>
  • Loading branch information
mprahl authored Jan 9, 2024
1 parent fa2f6dc commit 3e65b30
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,10 @@ The following optional query parameters would be accepted on this HTTP endpoint:
- after - an ISO-8601 timestamp to indicate only compliance events after this time should be shown.
- page - the page number in the query. This defaults to 1.
- per_page - the number of compliance events returned per page. This defaults to 20 and maxes out at 100.
- sort - the field to sort by. This defaults to `event.timestamp`. All fields except `policy.spec` and `event.metadata`
are sortable by using dot notation. To specify multiple sort options, use commas such as
`?sort=policy.name,policy.namespace`.
- direction - the direction to sort by. This defaults to `desc`. It can be `asc` or `desc`.

The output would look as follows and be sorted by timestamps in descending order. The content would be filtered based on
the user's access as described above:
Expand Down Expand Up @@ -308,6 +312,7 @@ the user's access as described above:
],
"metadata": {
"page": 1,
"pages": 7,
"per_page": 20,
"total": 123
}
Expand Down

0 comments on commit 3e65b30

Please sign in to comment.