Skip to content

Commit 9002d36

Browse files
[post-merge,openapi] updates
Match API versioning guidelines
1 parent ba17cbe commit 9002d36

File tree

4 files changed

+100
-134
lines changed

4 files changed

+100
-134
lines changed

nexus/external-api/src/lib.rs

Lines changed: 95 additions & 98 deletions
Original file line numberDiff line numberDiff line change
@@ -1726,30 +1726,6 @@ pub trait NexusExternalApi {
17261726
// TODO: Consider adding `.map()` to dropshot's `Path<T>` (like `TypedBody`)
17271727
// to enable inline delegation when path types differ between API versions.
17281728

1729-
/// List multicast groups
1730-
#[endpoint {
1731-
method = GET,
1732-
path = "/v1/multicast-groups",
1733-
tags = ["experimental"],
1734-
operation_id = "multicast_group_list",
1735-
versions = ..VERSION_MULTICAST_IMPLICIT_LIFECYCLE_UPDATES,
1736-
}]
1737-
async fn v2025121200_multicast_group_list(
1738-
rqctx: RequestContext<Self::Context>,
1739-
query_params: Query<PaginatedByNameOrId>,
1740-
) -> Result<
1741-
HttpResponseOk<ResultsPage<v2025121200::MulticastGroup>>,
1742-
HttpError,
1743-
> {
1744-
match Self::multicast_group_list(rqctx, query_params).await {
1745-
Ok(HttpResponseOk(page)) => Ok(HttpResponseOk(ResultsPage {
1746-
items: page.items.into_iter().map(|g| g.into()).collect(),
1747-
next_page: page.next_page,
1748-
})),
1749-
Err(e) => Err(e),
1750-
}
1751-
}
1752-
17531729
/// List multicast groups
17541730
#[endpoint {
17551731
method = GET,
@@ -1763,9 +1739,6 @@ pub trait NexusExternalApi {
17631739
) -> Result<HttpResponseOk<ResultsPage<views::MulticastGroup>>, HttpError>;
17641740

17651741
/// List multicast groups
1766-
///
1767-
/// Prior version that included deprecated `mvlan` field and omitted
1768-
/// `has_any_source_member`.
17691742
#[endpoint {
17701743
method = GET,
17711744
path = "/v1/multicast-groups",
@@ -1787,6 +1760,30 @@ pub trait NexusExternalApi {
17871760
}))
17881761
}
17891762

1763+
/// List multicast groups
1764+
#[endpoint {
1765+
method = GET,
1766+
path = "/v1/multicast-groups",
1767+
tags = ["experimental"],
1768+
operation_id = "multicast_group_list",
1769+
versions = ..VERSION_MULTICAST_IMPLICIT_LIFECYCLE_UPDATES,
1770+
}]
1771+
async fn v2025121200_multicast_group_list(
1772+
rqctx: RequestContext<Self::Context>,
1773+
query_params: Query<PaginatedByNameOrId>,
1774+
) -> Result<
1775+
HttpResponseOk<ResultsPage<v2025121200::MulticastGroup>>,
1776+
HttpError,
1777+
> {
1778+
match Self::multicast_group_list(rqctx, query_params).await {
1779+
Ok(HttpResponseOk(page)) => Ok(HttpResponseOk(ResultsPage {
1780+
items: page.items.into_iter().map(|g| g.into()).collect(),
1781+
next_page: page.next_page,
1782+
})),
1783+
Err(e) => Err(e),
1784+
}
1785+
}
1786+
17901787
/// Create a multicast group
17911788
///
17921789
/// Deprecated: Groups are created implicitly when adding members in newer
@@ -1812,23 +1809,6 @@ pub trait NexusExternalApi {
18121809
))
18131810
}
18141811

1815-
/// Fetch a multicast group
1816-
///
1817-
/// The group can be specified by name or UUID.
1818-
#[endpoint {
1819-
method = GET,
1820-
path = "/v1/multicast-groups/{multicast_group}",
1821-
tags = ["experimental"],
1822-
operation_id = "multicast_group_view",
1823-
versions = ..VERSION_MULTICAST_IMPLICIT_LIFECYCLE_UPDATES,
1824-
}]
1825-
// Cannot delegate inline: path types differ (NameOrId vs MulticastGroupIdentifier)
1826-
// and can't construct Path<T> (Dropshot extractor with private fields).
1827-
async fn v2025121200_multicast_group_view(
1828-
rqctx: RequestContext<Self::Context>,
1829-
path_params: Path<v2025121200::MulticastGroupPath>,
1830-
) -> Result<HttpResponseOk<v2025121200::MulticastGroup>, HttpError>;
1831-
18321812
/// Fetch a multicast group
18331813
///
18341814
/// The group can be specified by name, UUID, or multicast IP address
@@ -1846,8 +1826,8 @@ pub trait NexusExternalApi {
18461826

18471827
/// Fetch multicast group
18481828
///
1849-
/// Prior version that included deprecated `mvlan` field and omitted
1850-
/// `has_any_source_member`.
1829+
/// The group can be specified by name, UUID, or multicast IP address.
1830+
/// (e.g., "224.1.2.3" or "ff38::1").
18511831
#[endpoint {
18521832
method = GET,
18531833
path = "/v1/multicast-groups/{multicast_group}",
@@ -1863,6 +1843,23 @@ pub trait NexusExternalApi {
18631843
Ok(HttpResponseOk(group.into()))
18641844
}
18651845

1846+
/// Fetch a multicast group
1847+
///
1848+
/// The group can be specified by name or UUID.
1849+
#[endpoint {
1850+
method = GET,
1851+
path = "/v1/multicast-groups/{multicast_group}",
1852+
tags = ["experimental"],
1853+
operation_id = "multicast_group_view",
1854+
versions = ..VERSION_MULTICAST_IMPLICIT_LIFECYCLE_UPDATES,
1855+
}]
1856+
// Cannot delegate inline: path types differ (NameOrId vs MulticastGroupIdentifier)
1857+
// and can't construct Path<T> (Dropshot extractor with private fields).
1858+
async fn v2025121200_multicast_group_view(
1859+
rqctx: RequestContext<Self::Context>,
1860+
path_params: Path<v2025121200::MulticastGroupPath>,
1861+
) -> Result<HttpResponseOk<v2025121200::MulticastGroup>, HttpError>;
1862+
18661863
/// Update a multicast group
18671864
///
18681865
/// Deprecated: groups are managed implicitly through member operations.
@@ -1908,6 +1905,21 @@ pub trait NexusExternalApi {
19081905
))
19091906
}
19101907

1908+
/// List members of multicast group
1909+
///
1910+
/// The group can be specified by name, UUID, or multicast IP address.
1911+
#[endpoint {
1912+
method = GET,
1913+
path = "/v1/multicast-groups/{multicast_group}/members",
1914+
tags = ["experimental"],
1915+
versions = VERSION_MULTICAST_IMPLICIT_LIFECYCLE_UPDATES..,
1916+
}]
1917+
async fn multicast_group_member_list(
1918+
rqctx: RequestContext<Self::Context>,
1919+
path_params: Path<params::MulticastGroupPath>,
1920+
query_params: Query<PaginatedById>,
1921+
) -> Result<HttpResponseOk<ResultsPage<MulticastGroupMember>>, HttpError>;
1922+
19111923
/// List members of multicast group
19121924
///
19131925
/// The group can be specified by name or UUID.
@@ -1929,21 +1941,6 @@ pub trait NexusExternalApi {
19291941
HttpError,
19301942
>;
19311943

1932-
/// List members of multicast group
1933-
///
1934-
/// The group can be specified by name, UUID, or multicast IP address.
1935-
#[endpoint {
1936-
method = GET,
1937-
path = "/v1/multicast-groups/{multicast_group}/members",
1938-
tags = ["experimental"],
1939-
versions = VERSION_MULTICAST_IMPLICIT_LIFECYCLE_UPDATES..,
1940-
}]
1941-
async fn multicast_group_member_list(
1942-
rqctx: RequestContext<Self::Context>,
1943-
path_params: Path<params::MulticastGroupPath>,
1944-
query_params: Query<PaginatedById>,
1945-
) -> Result<HttpResponseOk<ResultsPage<MulticastGroupMember>>, HttpError>;
1946-
19471944
/// Add instance to multicast group
19481945
///
19491946
/// Deprecated: use the instance join endpoint which supports implicit group
@@ -3718,6 +3715,22 @@ pub trait NexusExternalApi {
37183715

37193716
// Instance Multicast Groups
37203717

3718+
/// List multicast groups for an instance
3719+
#[endpoint {
3720+
method = GET,
3721+
path = "/v1/instances/{instance}/multicast-groups",
3722+
tags = ["experimental"],
3723+
versions = VERSION_MULTICAST_IMPLICIT_LIFECYCLE_UPDATES..,
3724+
}]
3725+
async fn instance_multicast_group_list(
3726+
rqctx: RequestContext<Self::Context>,
3727+
query_params: Query<PaginatedById<params::OptionalProjectSelector>>,
3728+
path_params: Path<params::InstancePath>,
3729+
) -> Result<
3730+
HttpResponseOk<ResultsPage<views::MulticastGroupMember>>,
3731+
HttpError,
3732+
>;
3733+
37213734
/// List multicast groups for an instance
37223735
#[endpoint {
37233736
method = GET,
@@ -3752,21 +3765,28 @@ pub trait NexusExternalApi {
37523765
}
37533766
}
37543767

3755-
/// List multicast groups for an instance
3768+
/// Join multicast group by name, IP address, or UUID
3769+
///
3770+
/// Groups can be referenced by name, IP address, or UUID. If the group
3771+
/// doesn't exist, it's implicitly created with an auto-allocated IP from a
3772+
/// multicast pool linked to the caller's silo. When referencing by UUID,
3773+
/// the group must already exist.
3774+
///
3775+
/// Source IPs are optional for ASM addresses but required for SSM addresses
3776+
/// (232.0.0.0/8 for IPv4, ff3x::/32 for IPv6). Duplicate IPs in the request
3777+
/// are automatically deduplicated, with a maximum of 64 source IPs allowed.
37563778
#[endpoint {
3757-
method = GET,
3758-
path = "/v1/instances/{instance}/multicast-groups",
3779+
method = PUT,
3780+
path = "/v1/instances/{instance}/multicast-groups/{multicast_group}",
37593781
tags = ["experimental"],
37603782
versions = VERSION_MULTICAST_IMPLICIT_LIFECYCLE_UPDATES..,
37613783
}]
3762-
async fn instance_multicast_group_list(
3784+
async fn instance_multicast_group_join(
37633785
rqctx: RequestContext<Self::Context>,
3764-
query_params: Query<PaginatedById<params::OptionalProjectSelector>>,
3765-
path_params: Path<params::InstancePath>,
3766-
) -> Result<
3767-
HttpResponseOk<ResultsPage<views::MulticastGroupMember>>,
3768-
HttpError,
3769-
>;
3786+
path_params: Path<params::InstanceMulticastGroupPath>,
3787+
query_params: Query<params::OptionalProjectSelector>,
3788+
body_params: TypedBody<params::InstanceMulticastGroupJoin>,
3789+
) -> Result<HttpResponseCreated<views::MulticastGroupMember>, HttpError>;
37703790

37713791
/// Join multicast group
37723792
///
@@ -3786,28 +3806,18 @@ pub trait NexusExternalApi {
37863806
query_params: Query<params::OptionalProjectSelector>,
37873807
) -> Result<HttpResponseCreated<v2025121200::MulticastGroupMember>, HttpError>;
37883808

3789-
/// Join multicast group by name, IP address, or UUID
3790-
///
3791-
/// Groups can be referenced by name, IP address, or UUID. If the group
3792-
/// doesn't exist, it's implicitly created with an auto-allocated IP from a
3793-
/// multicast pool linked to the caller's silo. When referencing by UUID,
3794-
/// the group must already exist.
3795-
///
3796-
/// Source IPs are optional for ASM addresses but required for SSM addresses
3797-
/// (232.0.0.0/8 for IPv4, ff3x::/32 for IPv6). Duplicate IPs in the request
3798-
/// are automatically deduplicated, with a maximum of 64 source IPs allowed.
3809+
/// Leave multicast group by name, IP address, or UUID
37993810
#[endpoint {
3800-
method = PUT,
3811+
method = DELETE,
38013812
path = "/v1/instances/{instance}/multicast-groups/{multicast_group}",
38023813
tags = ["experimental"],
38033814
versions = VERSION_MULTICAST_IMPLICIT_LIFECYCLE_UPDATES..,
38043815
}]
3805-
async fn instance_multicast_group_join(
3816+
async fn instance_multicast_group_leave(
38063817
rqctx: RequestContext<Self::Context>,
38073818
path_params: Path<params::InstanceMulticastGroupPath>,
38083819
query_params: Query<params::OptionalProjectSelector>,
3809-
body_params: TypedBody<params::InstanceMulticastGroupJoin>,
3810-
) -> Result<HttpResponseCreated<views::MulticastGroupMember>, HttpError>;
3820+
) -> Result<HttpResponseDeleted, HttpError>;
38113821

38123822
/// Leave multicast group
38133823
///
@@ -3827,19 +3837,6 @@ pub trait NexusExternalApi {
38273837
query_params: Query<params::OptionalProjectSelector>,
38283838
) -> Result<HttpResponseDeleted, HttpError>;
38293839

3830-
/// Leave multicast group by name, IP address, or UUID
3831-
#[endpoint {
3832-
method = DELETE,
3833-
path = "/v1/instances/{instance}/multicast-groups/{multicast_group}",
3834-
tags = ["experimental"],
3835-
versions = VERSION_MULTICAST_IMPLICIT_LIFECYCLE_UPDATES..,
3836-
}]
3837-
async fn instance_multicast_group_leave(
3838-
rqctx: RequestContext<Self::Context>,
3839-
path_params: Path<params::InstanceMulticastGroupPath>,
3840-
query_params: Query<params::OptionalProjectSelector>,
3841-
) -> Result<HttpResponseDeleted, HttpError>;
3842-
38433840
// Snapshots
38443841

38453842
/// List snapshots

openapi/nexus/nexus-2026011501.0.0-e9837c.json renamed to openapi/nexus/nexus-2026011501.0.0-81034d.json

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -6073,7 +6073,6 @@
60736073
"experimental"
60746074
],
60756075
"summary": "List multicast groups",
6076-
"description": "Prior version that included deprecated `mvlan` field and omitted `has_any_source_member`.",
60776076
"operationId": "multicast_group_list",
60786077
"parameters": [
60796078
{
@@ -6133,7 +6132,7 @@
61336132
"experimental"
61346133
],
61356134
"summary": "Fetch multicast group",
6136-
"description": "Prior version that included deprecated `mvlan` field and omitted `has_any_source_member`.",
6135+
"description": "The group can be specified by name, UUID, or multicast IP address. (e.g., \"224.1.2.3\" or \"ff38::1\").",
61376136
"operationId": "multicast_group_view",
61386137
"parameters": [
61396138
{
@@ -23691,7 +23690,7 @@
2369123690
]
2369223691
},
2369323692
"PoolSelector": {
23694-
"description": "Specify which IP or external subnet pool to allocate from.",
23693+
"description": "Specify which IP pool to allocate from.",
2369523694
"oneOf": [
2369623695
{
2369723696
"description": "Use the specified pool by name or ID.",
@@ -29525,13 +29524,6 @@
2952529524
"url": "http://docs.oxide.computer/api/experimental"
2952629525
}
2952729526
},
29528-
{
29529-
"name": "external-subnets",
29530-
"description": "External subnets that can be attached to instances.",
29531-
"externalDocs": {
29532-
"url": "http://docs.oxide.computer/api/external-subnets"
29533-
}
29534-
},
2953529527
{
2953629528
"name": "floating-ips",
2953729529
"description": "Floating IPs allow a project to allocate well-known IPs to instances.",
@@ -29665,13 +29657,6 @@
2966529657
"url": "http://docs.oxide.computer/api/system-status"
2966629658
}
2966729659
},
29668-
{
29669-
"name": "system/subnet-pools",
29670-
"description": "Subnet pools are collections of IP subnets that can be assigned to silos. When a pool is linked to a silo, users in that silo can allocate external subnets from the pool.",
29671-
"externalDocs": {
29672-
"url": "http://docs.oxide.computer/api/system-subnet-pools"
29673-
}
29674-
},
2967529660
{
2967629661
"name": "system/update",
2967729662
"description": "Upload and manage system updates",

openapi/nexus/nexus-2026011600.0.0-483d60.json renamed to openapi/nexus/nexus-2026011600.0.0-4e3ad9.json

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -6073,7 +6073,6 @@
60736073
"experimental"
60746074
],
60756075
"summary": "List multicast groups",
6076-
"description": "Prior version that included deprecated `mvlan` field and omitted `has_any_source_member`.",
60776076
"operationId": "multicast_group_list",
60786077
"parameters": [
60796078
{
@@ -6133,7 +6132,7 @@
61336132
"experimental"
61346133
],
61356134
"summary": "Fetch multicast group",
6136-
"description": "Prior version that included deprecated `mvlan` field and omitted `has_any_source_member`.",
6135+
"description": "The group can be specified by name, UUID, or multicast IP address. (e.g., \"224.1.2.3\" or \"ff38::1\").",
61376136
"operationId": "multicast_group_view",
61386137
"parameters": [
61396138
{
@@ -23691,7 +23690,7 @@
2369123690
]
2369223691
},
2369323692
"PoolSelector": {
23694-
"description": "Specify which IP or external subnet pool to allocate from.",
23693+
"description": "Specify which IP pool to allocate from.",
2369523694
"oneOf": [
2369623695
{
2369723696
"description": "Use the specified pool by name or ID.",
@@ -29525,13 +29524,6 @@
2952529524
"url": "http://docs.oxide.computer/api/experimental"
2952629525
}
2952729526
},
29528-
{
29529-
"name": "external-subnets",
29530-
"description": "External subnets that can be attached to instances.",
29531-
"externalDocs": {
29532-
"url": "http://docs.oxide.computer/api/external-subnets"
29533-
}
29534-
},
2953529527
{
2953629528
"name": "floating-ips",
2953729529
"description": "Floating IPs allow a project to allocate well-known IPs to instances.",
@@ -29665,13 +29657,6 @@
2966529657
"url": "http://docs.oxide.computer/api/system-status"
2966629658
}
2966729659
},
29668-
{
29669-
"name": "system/subnet-pools",
29670-
"description": "Subnet pools are collections of IP subnets that can be assigned to silos. When a pool is linked to a silo, users in that silo can allocate external subnets from the pool.",
29671-
"externalDocs": {
29672-
"url": "http://docs.oxide.computer/api/system-subnet-pools"
29673-
}
29674-
},
2967529660
{
2967629661
"name": "system/update",
2967729662
"description": "Upload and manage system updates",

0 commit comments

Comments
 (0)