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

Fix fake pagination for sled_list_uninitialized #4720

Merged
merged 2 commits into from
Dec 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions nexus/src/external_api/http_entrypoints.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4659,8 +4659,16 @@ async fn rack_view(
}]
async fn sled_list_uninitialized(
rqctx: RequestContext<Arc<ServerContext>>,
query: Query<PaginationParams<EmptyScanParams, String>>,
) -> Result<HttpResponseOk<ResultsPage<UninitializedSled>>, HttpError> {
let apictx = rqctx.context();
// We don't actually support real pagination
let pag_params = query.into_inner();
if let dropshot::WhichPage::Next(last_seen) = &pag_params.page {
return Err(
Error::invalid_value(last_seen.clone(), "bad page token").into()
);
}
let handler = async {
let nexus = &apictx.nexus;
let opctx = crate::context::op_context_for_external_api(&rqctx).await?;
Expand Down
25 changes: 25 additions & 0 deletions openapi/nexus.json
Original file line number Diff line number Diff line change
Expand Up @@ -4022,6 +4022,28 @@
],
"summary": "List uninitialized sleds in a given rack",
"operationId": "sled_list_uninitialized",
"parameters": [
{
"in": "query",
"name": "limit",
"description": "Maximum number of items returned by a single call",
"schema": {
"nullable": true,
"type": "integer",
"format": "uint32",
"minimum": 1
}
},
{
"in": "query",
"name": "page_token",
"description": "Token returned by previous call to retrieve the subsequent page",
"schema": {
"nullable": true,
"type": "string"
}
}
],
"responses": {
"200": {
"description": "successful operation",
Expand All @@ -4039,6 +4061,9 @@
"5XX": {
"$ref": "#/components/responses/Error"
}
},
"x-dropshot-pagination": {
"required": []
Comment on lines +4065 to +4066
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice

}
}
},
Expand Down
Loading