Skip to content

Commit

Permalink
Fix fake pagination for sled_list_uninitialized (#4720)
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewjstone authored Dec 19, 2023
1 parent 3382a33 commit 6783a5a
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
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": []
}
}
},
Expand Down

0 comments on commit 6783a5a

Please sign in to comment.