Skip to content

Commit 71dace9

Browse files
authored
[nexus] Put support bundles in internal API (#7971)
They're already in the external API, but this makes them accessible to omdb
1 parent 21b35cb commit 71dace9

File tree

5 files changed

+768
-4
lines changed

5 files changed

+768
-4
lines changed

Cargo.lock

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

nexus/internal-api/Cargo.toml

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ workspace = true
99

1010
[dependencies]
1111
dropshot.workspace = true
12+
http.workspace = true
1213
nexus-types.workspace = true
1314
omicron-common.workspace = true
1415
omicron-uuid-kinds.workspace = true

nexus/internal-api/src/lib.rs

+101-4
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,22 @@
55
use std::collections::{BTreeMap, BTreeSet};
66

77
use dropshot::{
8-
HttpError, HttpResponseCreated, HttpResponseDeleted, HttpResponseOk,
8+
Body, HttpError, HttpResponseCreated, HttpResponseDeleted, HttpResponseOk,
99
HttpResponseUpdatedNoContent, Path, Query, RequestContext, ResultsPage,
1010
TypedBody,
1111
};
12+
use http::Response;
1213
use nexus_types::{
1314
deployment::{
1415
Blueprint, BlueprintMetadata, BlueprintTarget, BlueprintTargetSet,
1516
ClickhousePolicy, OximeterReadPolicy,
1617
},
1718
external_api::{
18-
params::{PhysicalDiskPath, SledSelector, UninitializedSledId},
19-
shared::{ProbeInfo, UninitializedSled},
20-
views::{Ping, PingStatus, SledPolicy},
19+
params::{self, PhysicalDiskPath, SledSelector, UninitializedSledId},
20+
shared::{self, ProbeInfo, UninitializedSled},
21+
views::Ping,
22+
views::PingStatus,
23+
views::SledPolicy,
2124
},
2225
internal_api::{
2326
params::{
@@ -537,6 +540,100 @@ pub trait NexusInternalApi {
537540
disk: TypedBody<PhysicalDiskPath>,
538541
) -> Result<HttpResponseUpdatedNoContent, HttpError>;
539542

543+
// Support bundles (experimental)
544+
545+
/// List all support bundles
546+
#[endpoint {
547+
method = GET,
548+
path = "/experimental/v1/system/support-bundles",
549+
}]
550+
async fn support_bundle_list(
551+
rqctx: RequestContext<Self::Context>,
552+
query_params: Query<PaginatedById>,
553+
) -> Result<HttpResponseOk<ResultsPage<shared::SupportBundleInfo>>, HttpError>;
554+
555+
/// View a support bundle
556+
#[endpoint {
557+
method = GET,
558+
path = "/experimental/v1/system/support-bundles/{support_bundle}",
559+
}]
560+
async fn support_bundle_view(
561+
rqctx: RequestContext<Self::Context>,
562+
path_params: Path<params::SupportBundlePath>,
563+
) -> Result<HttpResponseOk<shared::SupportBundleInfo>, HttpError>;
564+
565+
/// Download the index of a support bundle
566+
#[endpoint {
567+
method = GET,
568+
path = "/experimental/v1/system/support-bundles/{support_bundle}/index",
569+
}]
570+
async fn support_bundle_index(
571+
rqctx: RequestContext<Self::Context>,
572+
path_params: Path<params::SupportBundlePath>,
573+
) -> Result<Response<Body>, HttpError>;
574+
575+
/// Download the contents of a support bundle
576+
#[endpoint {
577+
method = GET,
578+
path = "/experimental/v1/system/support-bundles/{support_bundle}/download",
579+
}]
580+
async fn support_bundle_download(
581+
rqctx: RequestContext<Self::Context>,
582+
path_params: Path<params::SupportBundlePath>,
583+
) -> Result<Response<Body>, HttpError>;
584+
585+
/// Download a file within a support bundle
586+
#[endpoint {
587+
method = GET,
588+
path = "/experimental/v1/system/support-bundles/{support_bundle}/download/{file}",
589+
}]
590+
async fn support_bundle_download_file(
591+
rqctx: RequestContext<Self::Context>,
592+
path_params: Path<params::SupportBundleFilePath>,
593+
) -> Result<Response<Body>, HttpError>;
594+
595+
/// Download the metadata of a support bundle
596+
#[endpoint {
597+
method = HEAD,
598+
path = "/experimental/v1/system/support-bundles/{support_bundle}/download",
599+
}]
600+
async fn support_bundle_head(
601+
rqctx: RequestContext<Self::Context>,
602+
path_params: Path<params::SupportBundlePath>,
603+
) -> Result<Response<Body>, HttpError>;
604+
605+
/// Download the metadata of a file within the support bundle
606+
#[endpoint {
607+
method = HEAD,
608+
path = "/experimental/v1/system/support-bundles/{support_bundle}/download/{file}",
609+
}]
610+
async fn support_bundle_head_file(
611+
rqctx: RequestContext<Self::Context>,
612+
path_params: Path<params::SupportBundleFilePath>,
613+
) -> Result<Response<Body>, HttpError>;
614+
615+
/// Create a new support bundle
616+
#[endpoint {
617+
method = POST,
618+
path = "/experimental/v1/system/support-bundles",
619+
}]
620+
async fn support_bundle_create(
621+
rqctx: RequestContext<Self::Context>,
622+
) -> Result<HttpResponseCreated<shared::SupportBundleInfo>, HttpError>;
623+
624+
/// Delete an existing support bundle
625+
///
626+
/// May also be used to cancel a support bundle which is currently being
627+
/// collected, or to remove metadata for a support bundle that has failed.
628+
#[endpoint {
629+
method = DELETE,
630+
path = "/experimental/v1/system/support-bundles/{support_bundle}",
631+
}]
632+
async fn support_bundle_delete(
633+
rqctx: RequestContext<Self::Context>,
634+
path_params: Path<params::SupportBundlePath>,
635+
) -> Result<HttpResponseDeleted, HttpError>;
636+
540637
/// Get all the probes associated with a given sled.
541638
#[endpoint {
542639
method = GET,

0 commit comments

Comments
 (0)