Skip to content

Support bundle download endpoints could distinguish success and failure status codes in OpenAPI #7346

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

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
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
6 changes: 3 additions & 3 deletions nexus/external-api/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use std::collections::BTreeMap;

use anyhow::anyhow;
use dropshot::Body;
use dropshot::{Body, FreeformBody};
use dropshot::{
EmptyScanParams, EndpointTagPolicy, HttpError, HttpResponseAccepted,
HttpResponseCreated, HttpResponseDeleted, HttpResponseFound,
Expand Down Expand Up @@ -2824,7 +2824,7 @@ pub trait NexusExternalApi {
async fn support_bundle_download(
rqctx: RequestContext<Self::Context>,
path_params: Path<params::SupportBundlePath>,
) -> Result<Response<Body>, HttpError>;
) -> Result<HttpResponseOk<FreeformBody>, HttpError>;

/// Download a file within a support bundle
#[endpoint {
Expand All @@ -2835,7 +2835,7 @@ pub trait NexusExternalApi {
async fn support_bundle_download_file(
rqctx: RequestContext<Self::Context>,
path_params: Path<params::SupportBundleFilePath>,
) -> Result<Response<Body>, HttpError>;
) -> Result<HttpResponseOk<FreeformBody>, HttpError>;

/// Download the metadata of a support bundle
#[endpoint {
Expand Down
6 changes: 3 additions & 3 deletions nexus/src/external_api/http_entrypoints.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ use super::{
},
};
use crate::{context::ApiContext, external_api::shared};
use dropshot::Body;
use dropshot::EmptyScanParams;
use dropshot::HttpError;
use dropshot::HttpResponseDeleted;
Expand All @@ -29,6 +28,7 @@ use dropshot::ResultsPage;
use dropshot::TypedBody;
use dropshot::WhichPage;
use dropshot::{ApiDescription, StreamingBody};
use dropshot::{Body, FreeformBody};
use dropshot::{HttpResponseAccepted, HttpResponseFound, HttpResponseSeeOther};
use dropshot::{HttpResponseCreated, HttpResponseHeaders};
use dropshot::{WebsocketChannelResult, WebsocketConnection};
Expand Down Expand Up @@ -6099,7 +6099,7 @@ impl NexusExternalApi for NexusExternalApiImpl {
async fn support_bundle_download(
rqctx: RequestContext<Self::Context>,
_path_params: Path<params::SupportBundlePath>,
) -> Result<Response<Body>, HttpError> {
) -> Result<HttpResponseOk<FreeformBody>, HttpError> {
let apictx = rqctx.context();
let handler = async {
let nexus = &apictx.context.nexus;
Expand All @@ -6122,7 +6122,7 @@ impl NexusExternalApi for NexusExternalApiImpl {
async fn support_bundle_download_file(
rqctx: RequestContext<Self::Context>,
_path_params: Path<params::SupportBundleFilePath>,
) -> Result<Response<Body>, HttpError> {
) -> Result<HttpResponseOk<FreeformBody>, HttpError> {
let apictx = rqctx.context();
let handler = async {
let nexus = &apictx.context.nexus;
Expand Down
16 changes: 14 additions & 2 deletions openapi/nexus.json
Original file line number Diff line number Diff line change
Expand Up @@ -475,13 +475,19 @@
}
],
"responses": {
"default": {
"200": {
"description": "",
"content": {
"*/*": {
"schema": {}
}
}
},
"4XX": {
"$ref": "#/components/responses/Error"
},
"5XX": {
"$ref": "#/components/responses/Error"
}
}
},
Expand Down Expand Up @@ -544,13 +550,19 @@
}
],
"responses": {
"default": {
"200": {
"description": "",
"content": {
"*/*": {
"schema": {}
}
}
},
"4XX": {
"$ref": "#/components/responses/Error"
},
"5XX": {
"$ref": "#/components/responses/Error"
}
}
},
Expand Down
Loading