Skip to content

Commit

Permalink
handlers/session_recordings: add pagination support
Browse files Browse the repository at this point in the history
  • Loading branch information
johanbrandhorst committed Dec 18, 2023
1 parent 91e4578 commit 6260815
Show file tree
Hide file tree
Showing 5 changed files with 277 additions and 102 deletions.
1 change: 1 addition & 0 deletions internal/daemon/controller/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,7 @@ func (c *Controller) registerGrpcServices(s *grpc.Server) error {
c.IamRepoFn,
c.workerStatusGracePeriod,
c.kms,
c.conf.RawConfig.Controller.MaxPageSize,
c.ControllerExtension)
if err != nil {
return fmt.Errorf("failed to create session recording handler service: %w", err)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ var NewServiceFn = func(ctx context.Context,
iamRepoFn common.IamRepoFactory,
workerStatusGracePeriod *atomic.Int64,
kms *kms.Kms,
maxPageSize uint,
controllerExt intglobals.ControllerExtension,
) (pbs.SessionRecordingServiceServer, error) {
return Service{}, nil
Expand Down
45 changes: 44 additions & 1 deletion internal/gen/controller.swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -2881,6 +2881,21 @@
"in": "query",
"required": false,
"type": "boolean"
},
{
"name": "list_token",
"description": "An opaque token used to continue an existing iteration or\nrequest updated items. If not specified, pagination\nwill start from the beginning.",
"in": "query",
"required": false,
"type": "string"
},
{
"name": "page_size",
"description": "The maximum size of a page in this iteration.\nIf unset, the default page size configured will be used.\nIf the page_size is greater than the max page size configured,\nthe page size will be truncated to this number.",
"in": "query",
"required": false,
"type": "integer",
"format": "int64"
}
],
"tags": [
Expand Down Expand Up @@ -7895,7 +7910,35 @@
"type": "object",
"$ref": "#/definitions/controller.api.resources.sessionrecordings.v1.SessionRecording"
},
"description": "All Session recordings, ordered by start_time descending (most recently started first)."
"description": "The items returned in this page."
},
"response_type": {
"type": "string",
"description": "The type of response, either \"delta\" or \"complete\".\nDelta signifies that this is part of a paginated result\nor an update to a previously completed pagination.\nComplete signifies that it is the last page."
},
"list_token": {
"type": "string",
"description": "An opaque token used to continue an existing pagination or\nrequest updated items. Use this token in the next list request\nto request the next page."
},
"sort_by": {
"type": "string",
"description": "The name of the field which the items are sorted by."
},
"sort_dir": {
"type": "string",
"description": "The direction of the sort, either \"asc\" or \"desc\"."
},
"removed_ids": {
"type": "array",
"items": {
"type": "string"
},
"description": "A list of item IDs that have been removed since they were returned\nas part of a pagination. They should be dropped from any client cache.\nThis may contain items that are not known to the cache, if they were\ncreated and deleted between listings."
},
"est_item_count": {
"type": "integer",
"format": "int64",
"description": "An estimate at the total items available. This may change during pagination."
}
}
},
Expand Down
Loading

0 comments on commit 6260815

Please sign in to comment.