-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
api: Add rule group pagination to list rules api (#14017)
* Add paginated feature to list rules api Signed-off-by: Yijie Qin <[email protected]> * Refactor to simplify code: * Reduce number of variables * Reduce type convesion Signed-off-by: Raphael Silva <[email protected]> * Simplify paginated implementation * Remove maxAlerts parameter. * Reuse existing API responses by using omitempty in some fields Signed-off-by: Raphael Silva <[email protected]> * Simplify pagination implementation * Eliminate the need to sort the rule groups. Signed-off-by: Raphael Silva <[email protected]> * Fix linting error Signed-off-by: Raphael Silva <[email protected]> * Add more unit tests Signed-off-by: Raphael Silva <[email protected]> * Update pagination parameters to be consistent with existing parameters Signed-off-by: Raphael Silva <[email protected]> * Rename max_rule_groups to max_groups Signed-off-by: Raphael Silva <[email protected]> * Refactor to simplify code Signed-off-by: Raphael Silva <[email protected]> * Refactor to simplify the calculation of next token Signed-off-by: Raphael Silva <[email protected]> * Handle corner case in pagination request Signed-off-by: Raphael Silva <[email protected]> * Handle corner cases for pagination of list rules Signed-off-by: Raphael Silva <[email protected]> * Update documentation for list rules parameters Signed-off-by: Raphael Silva <[email protected]> * Refactor comments Signed-off-by: Raphael Silva <[email protected]> * Simplify pagination implementation * Eliminate need for extra structs to store pagination parameters Signed-off-by: Raphael Silva <[email protected]> * Update docs/querying/api.md Co-authored-by: Julius Volz <[email protected]> Signed-off-by: Raphael Philipe Mendes da Silva <[email protected]> * Update web/api/v1/api.go Co-authored-by: Bartlomiej Plotka <[email protected]> Signed-off-by: Raphael Philipe Mendes da Silva <[email protected]> * Update comment describing the need for next token Signed-off-by: Raphael Silva <[email protected]> --------- Signed-off-by: Yijie Qin <[email protected]> Signed-off-by: Raphael Silva <[email protected]> Signed-off-by: Raphael Philipe Mendes da Silva <[email protected]> Co-authored-by: Raphael Silva <[email protected]> Co-authored-by: Julius Volz <[email protected]> Co-authored-by: Bartlomiej Plotka <[email protected]>
- Loading branch information
1 parent
70e2d23
commit d2802c6
Showing
3 changed files
with
291 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters