Skip to content

Commit

Permalink
Merge branch 'support-bundle-bg-task' into support-bundle-wire-up-htt…
Browse files Browse the repository at this point in the history
…p-endpoints
  • Loading branch information
smklein committed Nov 28, 2024
2 parents 03af36d + 4f6d2d2 commit 07be0de
Show file tree
Hide file tree
Showing 3 changed files with 154 additions and 17 deletions.
1 change: 1 addition & 0 deletions nexus/external-api/output/nexus_tags.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ probe_view GET /experimental/v1/probes/{probe
support_bundle_create POST /experimental/v1/system/support-bundles
support_bundle_delete DELETE /experimental/v1/system/support-bundles/{support_bundle}
support_bundle_download GET /experimental/v1/system/support-bundles/{support_bundle}/download
support_bundle_head HEAD /experimental/v1/system/support-bundles/{support_bundle}/download
support_bundle_list GET /experimental/v1/system/support-bundles
support_bundle_view GET /experimental/v1/system/support-bundles/{support_bundle}

Expand Down
25 changes: 25 additions & 0 deletions nexus/src/external_api/http_entrypoints.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6071,6 +6071,31 @@ impl NexusExternalApi for NexusExternalApiImpl {
rqctx: RequestContext<Self::Context>,
path_params: Path<params::SupportBundlePath>,
body: TypedBody<SupportBundleGetQueryParams>,
) -> Result<Response<Body>, HttpError> {
let apictx = rqctx.context();
let handler = async {
let nexus = &apictx.context.nexus;

let opctx =
crate::context::op_context_for_external_api(&rqctx).await?;

Err(nexus
.unimplemented_todo(&opctx, crate::app::Unimpl::Public)
.await
.into())
};
apictx
.context
.external_latencies
.instrument_dropshot_handler(&rqctx, handler)
.await
}

async fn support_bundle_head(
rqctx: RequestContext<Self::Context>,
_path_params: Path<params::SupportBundlePath>,
_body: TypedBody<SupportBundleGetQueryParams>,
>>>>>>> 4f6d2d277229bd23b8e46d0e30639770edb47afb
) -> Result<Response<Body>, HttpError> {
let apictx = rqctx.context();
let handler = async {
Expand Down
145 changes: 128 additions & 17 deletions openapi/nexus.json
Original file line number Diff line number Diff line change
Expand Up @@ -366,8 +366,8 @@
"summary": "Create a new support bundle",
"operationId": "support_bundle_create",
"responses": {
"200": {
"description": "successful operation",
"201": {
"description": "successful creation",
"content": {
"application/json": {
"schema": {
Expand Down Expand Up @@ -396,10 +396,11 @@
{
"in": "path",
"name": "support_bundle",
"description": "Name or ID of the support bundle",
"description": "ID of the support bundle",
"required": true,
"schema": {
"$ref": "#/components/schemas/NameOrId"
"type": "string",
"format": "uuid"
}
}
],
Expand Down Expand Up @@ -433,23 +434,17 @@
{
"in": "path",
"name": "support_bundle",
"description": "Name or ID of the support bundle",
"description": "ID of the support bundle",
"required": true,
"schema": {
"$ref": "#/components/schemas/NameOrId"
"type": "string",
"format": "uuid"
}
}
],
"responses": {
"200": {
"description": "successful operation",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/SupportBundleInfo"
}
}
}
"204": {
"description": "successful deletion"
},
"4XX": {
"$ref": "#/components/responses/Error"
Expand All @@ -471,13 +466,63 @@
{
"in": "path",
"name": "support_bundle",
"description": "Name or ID of the support bundle",
"description": "ID of the support bundle",
"required": true,
"schema": {
"$ref": "#/components/schemas/NameOrId"
"type": "string",
"format": "uuid"
}
}
],
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/SupportBundleGetQueryParams"
}
}
},
"required": true
},
"responses": {
"default": {
"description": "",
"content": {
"*/*": {
"schema": {}
}
}
}
}
},
"head": {
"tags": [
"hidden"
],
"summary": "Download the metadata of a single support bundle",
"operationId": "support_bundle_head",
"parameters": [
{
"in": "path",
"name": "support_bundle",
"description": "ID of the support bundle",
"required": true,
"schema": {
"type": "string",
"format": "uuid"
}
}
],
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/SupportBundleGetQueryParams"
}
}
},
"required": true
},
"responses": {
"default": {
"description": "",
Expand Down Expand Up @@ -20199,6 +20244,18 @@
"items"
]
},
"SupportBundleGetQueryParams": {
"description": "Query parameters for reading the support bundle",
"type": "object",
"properties": {
"query_type": {
"$ref": "#/components/schemas/SupportBundleQueryType"
}
},
"required": [
"query_type"
]
},
"SupportBundleInfo": {
"type": "object",
"properties": {
Expand Down Expand Up @@ -20248,6 +20305,60 @@
"items"
]
},
"SupportBundleQueryType": {
"description": "Describes the type of access to the support bundle",
"oneOf": [
{
"description": "Access the whole support bundle",
"type": "object",
"properties": {
"type": {
"type": "string",
"enum": [
"whole"
]
}
},
"required": [
"type"
]
},
{
"description": "Access the names of all files within the support bundle",
"type": "object",
"properties": {
"type": {
"type": "string",
"enum": [
"index"
]
}
},
"required": [
"type"
]
},
{
"description": "Access a specific file within the support bundle",
"type": "object",
"properties": {
"file_path": {
"type": "string"
},
"type": {
"type": "string",
"enum": [
"path"
]
}
},
"required": [
"file_path",
"type"
]
}
]
},
"SupportBundleState": {
"oneOf": [
{
Expand Down

0 comments on commit 07be0de

Please sign in to comment.