Skip to content

Commit 653b58b

Browse files
authored
Make support-bundle API path param consistent (#8159)
The `support_bundle` path parameter takes a UUID. Our other APIs that require a UUID will include `id` in their title, e.g. `disk_id`. Update the bundle path parameters to `bundle_id` to make it consistent and shorten the CLI arg a bit.
1 parent 6e74618 commit 653b58b

File tree

9 files changed

+87
-95
lines changed

9 files changed

+87
-95
lines changed

nexus/external-api/output/nexus_tags.txt

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -53,14 +53,14 @@ probe_delete DELETE /experimental/v1/probes/{probe
5353
probe_list GET /experimental/v1/probes
5454
probe_view GET /experimental/v1/probes/{probe}
5555
support_bundle_create POST /experimental/v1/system/support-bundles
56-
support_bundle_delete DELETE /experimental/v1/system/support-bundles/{support_bundle}
57-
support_bundle_download GET /experimental/v1/system/support-bundles/{support_bundle}/download
58-
support_bundle_download_file GET /experimental/v1/system/support-bundles/{support_bundle}/download/{file}
59-
support_bundle_head HEAD /experimental/v1/system/support-bundles/{support_bundle}/download
60-
support_bundle_head_file HEAD /experimental/v1/system/support-bundles/{support_bundle}/download/{file}
61-
support_bundle_index GET /experimental/v1/system/support-bundles/{support_bundle}/index
56+
support_bundle_delete DELETE /experimental/v1/system/support-bundles/{bundle_id}
57+
support_bundle_download GET /experimental/v1/system/support-bundles/{bundle_id}/download
58+
support_bundle_download_file GET /experimental/v1/system/support-bundles/{bundle_id}/download/{file}
59+
support_bundle_head HEAD /experimental/v1/system/support-bundles/{bundle_id}/download
60+
support_bundle_head_file HEAD /experimental/v1/system/support-bundles/{bundle_id}/download/{file}
61+
support_bundle_index GET /experimental/v1/system/support-bundles/{bundle_id}/index
6262
support_bundle_list GET /experimental/v1/system/support-bundles
63-
support_bundle_view GET /experimental/v1/system/support-bundles/{support_bundle}
63+
support_bundle_view GET /experimental/v1/system/support-bundles/{bundle_id}
6464
target_release_update PUT /v1/system/update/target-release
6565
target_release_view GET /v1/system/update/target-release
6666
timeseries_query POST /v1/timeseries/query

nexus/external-api/src/lib.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3141,7 +3141,7 @@ pub trait NexusExternalApi {
31413141
/// View a support bundle
31423142
#[endpoint {
31433143
method = GET,
3144-
path = "/experimental/v1/system/support-bundles/{support_bundle}",
3144+
path = "/experimental/v1/system/support-bundles/{bundle_id}",
31453145
tags = ["hidden"], // system/support-bundles: only one tag is allowed
31463146
}]
31473147
async fn support_bundle_view(
@@ -3152,7 +3152,7 @@ pub trait NexusExternalApi {
31523152
/// Download the index of a support bundle
31533153
#[endpoint {
31543154
method = GET,
3155-
path = "/experimental/v1/system/support-bundles/{support_bundle}/index",
3155+
path = "/experimental/v1/system/support-bundles/{bundle_id}/index",
31563156
tags = ["hidden"], // system/support-bundles: only one tag is allowed
31573157
}]
31583158
async fn support_bundle_index(
@@ -3163,7 +3163,7 @@ pub trait NexusExternalApi {
31633163
/// Download the contents of a support bundle
31643164
#[endpoint {
31653165
method = GET,
3166-
path = "/experimental/v1/system/support-bundles/{support_bundle}/download",
3166+
path = "/experimental/v1/system/support-bundles/{bundle_id}/download",
31673167
tags = ["hidden"], // system/support-bundles: only one tag is allowed
31683168
}]
31693169
async fn support_bundle_download(
@@ -3174,7 +3174,7 @@ pub trait NexusExternalApi {
31743174
/// Download a file within a support bundle
31753175
#[endpoint {
31763176
method = GET,
3177-
path = "/experimental/v1/system/support-bundles/{support_bundle}/download/{file}",
3177+
path = "/experimental/v1/system/support-bundles/{bundle_id}/download/{file}",
31783178
tags = ["hidden"], // system/support-bundles: only one tag is allowed
31793179
}]
31803180
async fn support_bundle_download_file(
@@ -3185,7 +3185,7 @@ pub trait NexusExternalApi {
31853185
/// Download the metadata of a support bundle
31863186
#[endpoint {
31873187
method = HEAD,
3188-
path = "/experimental/v1/system/support-bundles/{support_bundle}/download",
3188+
path = "/experimental/v1/system/support-bundles/{bundle_id}/download",
31893189
tags = ["hidden"], // system/support-bundles: only one tag is allowed
31903190
}]
31913191
async fn support_bundle_head(
@@ -3196,7 +3196,7 @@ pub trait NexusExternalApi {
31963196
/// Download the metadata of a file within the support bundle
31973197
#[endpoint {
31983198
method = HEAD,
3199-
path = "/experimental/v1/system/support-bundles/{support_bundle}/download/{file}",
3199+
path = "/experimental/v1/system/support-bundles/{bundle_id}/download/{file}",
32003200
tags = ["hidden"], // system/support-bundles: only one tag is allowed
32013201
}]
32023202
async fn support_bundle_head_file(
@@ -3220,7 +3220,7 @@ pub trait NexusExternalApi {
32203220
/// collected, or to remove metadata for a support bundle that has failed.
32213221
#[endpoint {
32223222
method = DELETE,
3223-
path = "/experimental/v1/system/support-bundles/{support_bundle}",
3223+
path = "/experimental/v1/system/support-bundles/{bundle_id}",
32243224
tags = ["hidden"], // system/support-bundles: only one tag is allowed
32253225
}]
32263226
async fn support_bundle_delete(

nexus/internal-api/src/lib.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -555,7 +555,7 @@ pub trait NexusInternalApi {
555555
/// View a support bundle
556556
#[endpoint {
557557
method = GET,
558-
path = "/experimental/v1/system/support-bundles/{support_bundle}",
558+
path = "/experimental/v1/system/support-bundles/{bundle_id}",
559559
}]
560560
async fn support_bundle_view(
561561
rqctx: RequestContext<Self::Context>,
@@ -565,7 +565,7 @@ pub trait NexusInternalApi {
565565
/// Download the index of a support bundle
566566
#[endpoint {
567567
method = GET,
568-
path = "/experimental/v1/system/support-bundles/{support_bundle}/index",
568+
path = "/experimental/v1/system/support-bundles/{bundle_id}/index",
569569
}]
570570
async fn support_bundle_index(
571571
rqctx: RequestContext<Self::Context>,
@@ -575,7 +575,7 @@ pub trait NexusInternalApi {
575575
/// Download the contents of a support bundle
576576
#[endpoint {
577577
method = GET,
578-
path = "/experimental/v1/system/support-bundles/{support_bundle}/download",
578+
path = "/experimental/v1/system/support-bundles/{bundle_id}/download",
579579
}]
580580
async fn support_bundle_download(
581581
rqctx: RequestContext<Self::Context>,
@@ -585,7 +585,7 @@ pub trait NexusInternalApi {
585585
/// Download a file within a support bundle
586586
#[endpoint {
587587
method = GET,
588-
path = "/experimental/v1/system/support-bundles/{support_bundle}/download/{file}",
588+
path = "/experimental/v1/system/support-bundles/{bundle_id}/download/{file}",
589589
}]
590590
async fn support_bundle_download_file(
591591
rqctx: RequestContext<Self::Context>,
@@ -595,7 +595,7 @@ pub trait NexusInternalApi {
595595
/// Download the metadata of a support bundle
596596
#[endpoint {
597597
method = HEAD,
598-
path = "/experimental/v1/system/support-bundles/{support_bundle}/download",
598+
path = "/experimental/v1/system/support-bundles/{bundle_id}/download",
599599
}]
600600
async fn support_bundle_head(
601601
rqctx: RequestContext<Self::Context>,
@@ -605,7 +605,7 @@ pub trait NexusInternalApi {
605605
/// Download the metadata of a file within the support bundle
606606
#[endpoint {
607607
method = HEAD,
608-
path = "/experimental/v1/system/support-bundles/{support_bundle}/download/{file}",
608+
path = "/experimental/v1/system/support-bundles/{bundle_id}/download/{file}",
609609
}]
610610
async fn support_bundle_head_file(
611611
rqctx: RequestContext<Self::Context>,
@@ -627,7 +627,7 @@ pub trait NexusInternalApi {
627627
/// collected, or to remove metadata for a support bundle that has failed.
628628
#[endpoint {
629629
method = DELETE,
630-
path = "/experimental/v1/system/support-bundles/{support_bundle}",
630+
path = "/experimental/v1/system/support-bundles/{bundle_id}",
631631
}]
632632
async fn support_bundle_delete(
633633
rqctx: RequestContext<Self::Context>,

nexus/src/external_api/http_entrypoints.rs

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7060,7 +7060,7 @@ impl NexusExternalApi for NexusExternalApiImpl {
70607060
let bundle = nexus
70617061
.support_bundle_view(
70627062
&opctx,
7063-
SupportBundleUuid::from_untyped_uuid(path.support_bundle),
7063+
SupportBundleUuid::from_untyped_uuid(path.bundle_id),
70647064
)
70657065
.await?;
70667066

@@ -7090,7 +7090,7 @@ impl NexusExternalApi for NexusExternalApiImpl {
70907090
let body = nexus
70917091
.support_bundle_download(
70927092
&opctx,
7093-
SupportBundleUuid::from_untyped_uuid(path.support_bundle),
7093+
SupportBundleUuid::from_untyped_uuid(path.bundle_id),
70947094
SupportBundleQueryType::Index,
70957095
head,
70967096
range,
@@ -7122,7 +7122,7 @@ impl NexusExternalApi for NexusExternalApiImpl {
71227122
let body = nexus
71237123
.support_bundle_download(
71247124
&opctx,
7125-
SupportBundleUuid::from_untyped_uuid(path.support_bundle),
7125+
SupportBundleUuid::from_untyped_uuid(path.bundle_id),
71267126
SupportBundleQueryType::Whole,
71277127
head,
71287128
range,
@@ -7153,9 +7153,7 @@ impl NexusExternalApi for NexusExternalApiImpl {
71537153
let body = nexus
71547154
.support_bundle_download(
71557155
&opctx,
7156-
SupportBundleUuid::from_untyped_uuid(
7157-
path.bundle.support_bundle,
7158-
),
7156+
SupportBundleUuid::from_untyped_uuid(path.bundle.bundle_id),
71597157
SupportBundleQueryType::Path { file_path: path.file },
71607158
head,
71617159
range,
@@ -7186,7 +7184,7 @@ impl NexusExternalApi for NexusExternalApiImpl {
71867184
let body = nexus
71877185
.support_bundle_download(
71887186
&opctx,
7189-
SupportBundleUuid::from_untyped_uuid(path.support_bundle),
7187+
SupportBundleUuid::from_untyped_uuid(path.bundle_id),
71907188
SupportBundleQueryType::Whole,
71917189
head,
71927190
range,
@@ -7217,9 +7215,7 @@ impl NexusExternalApi for NexusExternalApiImpl {
72177215
let body = nexus
72187216
.support_bundle_download(
72197217
&opctx,
7220-
SupportBundleUuid::from_untyped_uuid(
7221-
path.bundle.support_bundle,
7222-
),
7218+
SupportBundleUuid::from_untyped_uuid(path.bundle.bundle_id),
72237219
SupportBundleQueryType::Path { file_path: path.file },
72247220
head,
72257221
range,
@@ -7271,7 +7267,7 @@ impl NexusExternalApi for NexusExternalApiImpl {
72717267
nexus
72727268
.support_bundle_delete(
72737269
&opctx,
7274-
SupportBundleUuid::from_untyped_uuid(path.support_bundle),
7270+
SupportBundleUuid::from_untyped_uuid(path.bundle_id),
72757271
)
72767272
.await?;
72777273

nexus/src/internal_api/http_entrypoints.rs

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -979,7 +979,7 @@ impl NexusInternalApi for NexusInternalApiImpl {
979979
let bundle = nexus
980980
.support_bundle_view(
981981
&opctx,
982-
SupportBundleUuid::from_untyped_uuid(path.support_bundle),
982+
SupportBundleUuid::from_untyped_uuid(path.bundle_id),
983983
)
984984
.await?;
985985

@@ -1009,7 +1009,7 @@ impl NexusInternalApi for NexusInternalApiImpl {
10091009
let body = nexus
10101010
.support_bundle_download(
10111011
&opctx,
1012-
SupportBundleUuid::from_untyped_uuid(path.support_bundle),
1012+
SupportBundleUuid::from_untyped_uuid(path.bundle_id),
10131013
SupportBundleQueryType::Index,
10141014
head,
10151015
range,
@@ -1041,7 +1041,7 @@ impl NexusInternalApi for NexusInternalApiImpl {
10411041
let body = nexus
10421042
.support_bundle_download(
10431043
&opctx,
1044-
SupportBundleUuid::from_untyped_uuid(path.support_bundle),
1044+
SupportBundleUuid::from_untyped_uuid(path.bundle_id),
10451045
SupportBundleQueryType::Whole,
10461046
head,
10471047
range,
@@ -1072,9 +1072,7 @@ impl NexusInternalApi for NexusInternalApiImpl {
10721072
let body = nexus
10731073
.support_bundle_download(
10741074
&opctx,
1075-
SupportBundleUuid::from_untyped_uuid(
1076-
path.bundle.support_bundle,
1077-
),
1075+
SupportBundleUuid::from_untyped_uuid(path.bundle.bundle_id),
10781076
SupportBundleQueryType::Path { file_path: path.file },
10791077
head,
10801078
range,
@@ -1105,7 +1103,7 @@ impl NexusInternalApi for NexusInternalApiImpl {
11051103
let body = nexus
11061104
.support_bundle_download(
11071105
&opctx,
1108-
SupportBundleUuid::from_untyped_uuid(path.support_bundle),
1106+
SupportBundleUuid::from_untyped_uuid(path.bundle_id),
11091107
SupportBundleQueryType::Whole,
11101108
head,
11111109
range,
@@ -1136,9 +1134,7 @@ impl NexusInternalApi for NexusInternalApiImpl {
11361134
let body = nexus
11371135
.support_bundle_download(
11381136
&opctx,
1139-
SupportBundleUuid::from_untyped_uuid(
1140-
path.bundle.support_bundle,
1141-
),
1137+
SupportBundleUuid::from_untyped_uuid(path.bundle.bundle_id),
11421138
SupportBundleQueryType::Path { file_path: path.file },
11431139
head,
11441140
range,
@@ -1190,7 +1186,7 @@ impl NexusInternalApi for NexusInternalApiImpl {
11901186
nexus
11911187
.support_bundle_delete(
11921188
&opctx,
1193-
SupportBundleUuid::from_untyped_uuid(path.support_bundle),
1189+
SupportBundleUuid::from_untyped_uuid(path.bundle_id),
11941190
)
11951191
.await?;
11961192

nexus/tests/output/uncovered-authz-endpoints.txt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@ API endpoints with no coverage in authz tests:
22
probe_delete (delete "/experimental/v1/probes/{probe}")
33
probe_list (get "/experimental/v1/probes")
44
probe_view (get "/experimental/v1/probes/{probe}")
5-
support_bundle_download (get "/experimental/v1/system/support-bundles/{support_bundle}/download")
6-
support_bundle_download_file (get "/experimental/v1/system/support-bundles/{support_bundle}/download/{file}")
7-
support_bundle_index (get "/experimental/v1/system/support-bundles/{support_bundle}/index")
5+
support_bundle_download (get "/experimental/v1/system/support-bundles/{bundle_id}/download")
6+
support_bundle_download_file (get "/experimental/v1/system/support-bundles/{bundle_id}/download/{file}")
7+
support_bundle_index (get "/experimental/v1/system/support-bundles/{bundle_id}/index")
88
ping (get "/v1/ping")
99
networking_switch_port_lldp_neighbors (get "/v1/system/hardware/rack-switch-port/{rack_id}/{switch_location}/{port}/lldp/neighbors")
1010
networking_switch_port_lldp_config_view (get "/v1/system/hardware/switch-port/{port}/lldp/config")
1111
networking_switch_port_status (get "/v1/system/hardware/switch-port/{port}/status")
12-
support_bundle_head (head "/experimental/v1/system/support-bundles/{support_bundle}/download")
13-
support_bundle_head_file (head "/experimental/v1/system/support-bundles/{support_bundle}/download/{file}")
12+
support_bundle_head (head "/experimental/v1/system/support-bundles/{bundle_id}/download")
13+
support_bundle_head_file (head "/experimental/v1/system/support-bundles/{bundle_id}/download/{file}")
1414
device_auth_request (post "/device/auth")
1515
device_auth_confirm (post "/device/confirm")
1616
device_access_token (post "/device/token")

nexus/types/src/external_api/params.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ path_param!(AddressLotPath, address_lot, "address lot");
9494
path_param!(ProbePath, probe, "probe");
9595
path_param!(CertificatePath, certificate, "certificate");
9696

97-
id_path_param!(SupportBundlePath, support_bundle, "support bundle");
97+
id_path_param!(SupportBundlePath, bundle_id, "support bundle");
9898
id_path_param!(GroupPath, group_id, "group");
9999

100100
// TODO: The hardware resources should be represented by its UUID or a hardware

0 commit comments

Comments
 (0)