|
5 | 5 | use std::collections::{BTreeMap, BTreeSet};
|
6 | 6 |
|
7 | 7 | use dropshot::{
|
8 |
| - HttpError, HttpResponseCreated, HttpResponseDeleted, HttpResponseOk, |
| 8 | + Body, HttpError, HttpResponseCreated, HttpResponseDeleted, HttpResponseOk, |
9 | 9 | HttpResponseUpdatedNoContent, Path, Query, RequestContext, ResultsPage,
|
10 | 10 | TypedBody,
|
11 | 11 | };
|
| 12 | +use http::Response; |
12 | 13 | use nexus_types::{
|
13 | 14 | deployment::{
|
14 | 15 | Blueprint, BlueprintMetadata, BlueprintTarget, BlueprintTargetSet,
|
15 | 16 | ClickhousePolicy, OximeterReadPolicy,
|
16 | 17 | },
|
17 | 18 | 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, |
21 | 24 | },
|
22 | 25 | internal_api::{
|
23 | 26 | params::{
|
@@ -537,6 +540,100 @@ pub trait NexusInternalApi {
|
537 | 540 | disk: TypedBody<PhysicalDiskPath>,
|
538 | 541 | ) -> Result<HttpResponseUpdatedNoContent, HttpError>;
|
539 | 542 |
|
| 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 | + |
540 | 637 | /// Get all the probes associated with a given sled.
|
541 | 638 | #[endpoint {
|
542 | 639 | method = GET,
|
|
0 commit comments