Skip to content

Commit fd126ad

Browse files
merge main
2 parents 310c086 + b129a0e commit fd126ad

File tree

9 files changed

+658
-652
lines changed

9 files changed

+658
-652
lines changed

nexus/external-api/src/lib.rs

Lines changed: 63 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ mod v2025122300;
4141
mod v2026010100;
4242
mod v2026010300;
4343
mod v2026010500;
44-
mod v2026011501;
4544
mod v2026011600;
4645

4746
#[cfg(test)]
@@ -1618,17 +1617,19 @@ pub trait NexusExternalApi {
16181617
method = POST,
16191618
path = "/v1/floating-ips",
16201619
tags = ["floating-ips"],
1621-
versions = VERSION_POOL_SELECTION_ENUMS..VERSION_RENAME_ADDRESS_SELECTOR_TO_ADDRESS_ALLOCATOR,
1620+
versions = ..VERSION_IP_VERSION_AND_MULTIPLE_DEFAULT_POOLS,
16221621
}]
1623-
async fn v2026011501_floating_ip_create(
1622+
async fn v2025121200_floating_ip_create(
16241623
rqctx: RequestContext<Self::Context>,
16251624
query_params: Query<params::ProjectSelector>,
1626-
floating_params: TypedBody<v2026011501::FloatingIpCreate>,
1625+
floating_params: TypedBody<v2025121200::FloatingIpCreate>,
16271626
) -> Result<HttpResponseCreated<views::FloatingIp>, HttpError> {
1628-
Self::v2026011600_floating_ip_create(
1627+
let floating_params =
1628+
floating_params.map(v2026010300::FloatingIpCreate::from);
1629+
Self::v2026010300_floating_ip_create(
16291630
rqctx,
16301631
query_params,
1631-
floating_params.map(Into::into),
1632+
floating_params,
16321633
)
16331634
.await
16341635
}
@@ -1648,8 +1649,8 @@ pub trait NexusExternalApi {
16481649
floating_params: TypedBody<v2026010300::FloatingIpCreate>,
16491650
) -> Result<HttpResponseCreated<views::FloatingIp>, HttpError> {
16501651
let floating_params =
1651-
floating_params.try_map(v2026011501::FloatingIpCreate::try_from)?;
1652-
Self::v2026011501_floating_ip_create(
1652+
floating_params.try_map(v2026010500::FloatingIpCreate::try_from)?;
1653+
Self::v2026010500_floating_ip_create(
16531654
rqctx,
16541655
query_params,
16551656
floating_params,
@@ -1663,19 +1664,17 @@ pub trait NexusExternalApi {
16631664
method = POST,
16641665
path = "/v1/floating-ips",
16651666
tags = ["floating-ips"],
1666-
versions = ..VERSION_IP_VERSION_AND_MULTIPLE_DEFAULT_POOLS,
1667+
versions = VERSION_POOL_SELECTION_ENUMS..VERSION_RENAME_ADDRESS_SELECTOR_TO_ADDRESS_ALLOCATOR,
16671668
}]
1668-
async fn v2025121200_floating_ip_create(
1669+
async fn v2026010500_floating_ip_create(
16691670
rqctx: RequestContext<Self::Context>,
16701671
query_params: Query<params::ProjectSelector>,
1671-
floating_params: TypedBody<v2025121200::FloatingIpCreate>,
1672+
floating_params: TypedBody<v2026010500::FloatingIpCreate>,
16721673
) -> Result<HttpResponseCreated<views::FloatingIp>, HttpError> {
1673-
let floating_params =
1674-
floating_params.map(v2026010300::FloatingIpCreate::from);
1675-
Self::v2026010300_floating_ip_create(
1674+
Self::v2026011600_floating_ip_create(
16761675
rqctx,
16771676
query_params,
1678-
floating_params,
1677+
floating_params.map(Into::into),
16791678
)
16801679
.await
16811680
}
@@ -2188,44 +2187,32 @@ pub trait NexusExternalApi {
21882187

21892188
/// Create instance
21902189
#[endpoint {
2191-
operation_id = "disk_create",
21922190
method = POST,
21932191
path = "/v1/instances",
21942192
tags = ["instances"],
2195-
versions = ..VERSION_LOCAL_STORAGE,
2193+
versions = VERSION_MULTICAST_IMPLICIT_LIFECYCLE_UPDATES..,
21962194
}]
2197-
async fn v2025112000_instance_create(
2195+
async fn instance_create(
21982196
rqctx: RequestContext<Self::Context>,
21992197
query_params: Query<params::ProjectSelector>,
2200-
new_instance: TypedBody<v2025112000::InstanceCreate>,
2201-
) -> Result<HttpResponseCreated<Instance>, HttpError> {
2202-
Self::v2025121200_instance_create(
2203-
rqctx,
2204-
query_params,
2205-
new_instance.map(Into::into),
2206-
)
2207-
.await
2208-
}
2198+
new_instance: TypedBody<params::InstanceCreate>,
2199+
) -> Result<HttpResponseCreated<Instance>, HttpError>;
22092200

22102201
/// Create instance
22112202
#[endpoint {
22122203
operation_id = "instance_create",
22132204
method = POST,
22142205
path = "/v1/instances",
22152206
tags = ["instances"],
2216-
versions = VERSION_LOCAL_STORAGE..VERSION_IP_VERSION_AND_MULTIPLE_DEFAULT_POOLS,
2207+
versions = VERSION_POOL_SELECTION_ENUMS..VERSION_MULTICAST_IMPLICIT_LIFECYCLE_UPDATES,
22172208
}]
2218-
async fn v2025121200_instance_create(
2209+
async fn v2026010500_instance_create(
22192210
rqctx: RequestContext<Self::Context>,
22202211
query_params: Query<params::ProjectSelector>,
2221-
new_instance: TypedBody<v2025121200::InstanceCreate>,
2212+
new_instance: TypedBody<v2026010500::InstanceCreate>,
22222213
) -> Result<HttpResponseCreated<Instance>, HttpError> {
2223-
Self::v2026010100_instance_create(
2224-
rqctx,
2225-
query_params,
2226-
new_instance.map(Into::into),
2227-
)
2228-
.await
2214+
Self::instance_create(rqctx, query_params, new_instance.map(Into::into))
2215+
.await
22292216
}
22302217

22312218
/// Create instance
@@ -2234,16 +2221,19 @@ pub trait NexusExternalApi {
22342221
method = POST,
22352222
path = "/v1/instances",
22362223
tags = ["instances"],
2237-
versions =
2238-
VERSION_IP_VERSION_AND_MULTIPLE_DEFAULT_POOLS..VERSION_DUAL_STACK_NICS,
2224+
versions = VERSION_DUAL_STACK_NICS..VERSION_POOL_SELECTION_ENUMS,
22392225
}]
2240-
async fn v2026010100_instance_create(
2226+
async fn v2026010300_instance_create(
22412227
rqctx: RequestContext<Self::Context>,
22422228
query_params: Query<params::ProjectSelector>,
2243-
new_instance: TypedBody<v2026010100::InstanceCreate>,
2229+
new_instance: TypedBody<v2026010300::InstanceCreate>,
22442230
) -> Result<HttpResponseCreated<Instance>, HttpError> {
2245-
let new_instance = new_instance.try_map(TryInto::try_into)?;
2246-
Self::instance_create(rqctx, query_params, new_instance).await
2231+
Self::v2026010500_instance_create(
2232+
rqctx,
2233+
query_params,
2234+
new_instance.try_map(TryInto::try_into)?,
2235+
)
2236+
.await
22472237
}
22482238

22492239
/// Create instance
@@ -2252,15 +2242,20 @@ pub trait NexusExternalApi {
22522242
method = POST,
22532243
path = "/v1/instances",
22542244
tags = ["instances"],
2255-
versions = VERSION_DUAL_STACK_NICS..VERSION_POOL_SELECTION_ENUMS,
2245+
versions =
2246+
VERSION_IP_VERSION_AND_MULTIPLE_DEFAULT_POOLS..VERSION_DUAL_STACK_NICS,
22562247
}]
2257-
async fn v2026010300_instance_create(
2248+
async fn v2025122300_instance_create(
22582249
rqctx: RequestContext<Self::Context>,
22592250
query_params: Query<params::ProjectSelector>,
2260-
new_instance: TypedBody<v2026010300::InstanceCreate>,
2251+
new_instance: TypedBody<v2025122300::InstanceCreate>,
22612252
) -> Result<HttpResponseCreated<Instance>, HttpError> {
2262-
let new_instance = new_instance.try_map(TryInto::try_into)?;
2263-
Self::instance_create(rqctx, query_params, new_instance).await
2253+
Self::v2026010300_instance_create(
2254+
rqctx,
2255+
query_params,
2256+
new_instance.try_map(TryInto::try_into)?,
2257+
)
2258+
.await
22642259
}
22652260

22662261
/// Create instance
@@ -2269,29 +2264,41 @@ pub trait NexusExternalApi {
22692264
method = POST,
22702265
path = "/v1/instances",
22712266
tags = ["instances"],
2272-
versions = VERSION_POOL_SELECTION_ENUMS..VERSION_MULTICAST_IMPLICIT_LIFECYCLE_UPDATES,
2267+
versions = VERSION_LOCAL_STORAGE..VERSION_IP_VERSION_AND_MULTIPLE_DEFAULT_POOLS,
22732268
}]
2274-
async fn v2026010500_instance_create(
2269+
async fn v2025120300_instance_create(
22752270
rqctx: RequestContext<Self::Context>,
22762271
query_params: Query<params::ProjectSelector>,
2277-
new_instance: TypedBody<v2026010500::InstanceCreate>,
2272+
new_instance: TypedBody<v2025120300::InstanceCreate>,
22782273
) -> Result<HttpResponseCreated<Instance>, HttpError> {
2279-
Self::instance_create(rqctx, query_params, new_instance.map(Into::into))
2280-
.await
2274+
Self::v2025122300_instance_create(
2275+
rqctx,
2276+
query_params,
2277+
new_instance.map(Into::into),
2278+
)
2279+
.await
22812280
}
22822281

22832282
/// Create instance
22842283
#[endpoint {
2284+
operation_id = "instance_create",
22852285
method = POST,
22862286
path = "/v1/instances",
22872287
tags = ["instances"],
2288-
versions = VERSION_MULTICAST_IMPLICIT_LIFECYCLE_UPDATES..,
2288+
versions = ..VERSION_LOCAL_STORAGE,
22892289
}]
2290-
async fn instance_create(
2290+
async fn v2025112000_instance_create(
22912291
rqctx: RequestContext<Self::Context>,
22922292
query_params: Query<params::ProjectSelector>,
2293-
new_instance: TypedBody<params::InstanceCreate>,
2294-
) -> Result<HttpResponseCreated<Instance>, HttpError>;
2293+
new_instance: TypedBody<v2025112000::InstanceCreate>,
2294+
) -> Result<HttpResponseCreated<Instance>, HttpError> {
2295+
Self::v2025120300_instance_create(
2296+
rqctx,
2297+
query_params,
2298+
new_instance.map(Into::into),
2299+
)
2300+
.await
2301+
}
22952302

22962303
/// Fetch instance
22972304
#[endpoint {

nexus/external-api/src/v2025112000.rs

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@
22
// License, v. 2.0. If a copy of the MPL was not distributed with this
33
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
44

5-
//! Nexus external types that changed from 2025112000 to 2025120300
5+
//! Types from API version 2025112000 (INITIAL) that changed in version
6+
//! 2025120300 (LOCAL_STORAGE).
67
7-
use crate::v2025121200;
8+
use crate::v2025120300;
89
use crate::v2026010100;
910
use nexus_types::external_api::params;
1011
use omicron_common::api::external;
@@ -220,9 +221,9 @@ pub struct InstanceCreate {
220221
/// By default, all instances have outbound connectivity, but no inbound
221222
/// connectivity. These external addresses can be used to provide a fixed,
222223
/// known IP address for making inbound connections to the instance.
223-
// Delegates through v2025121200 → params::ExternalIpCreate
224+
// Delegates through v2025120300 → params::ExternalIpCreate
224225
#[serde(default)]
225-
pub external_ips: Vec<v2025121200::ExternalIpCreate>,
226+
pub external_ips: Vec<v2025120300::ExternalIpCreate>,
226227

227228
/// The multicast groups this instance should join.
228229
///
@@ -302,9 +303,9 @@ pub struct InstanceCreate {
302303
pub cpu_platform: Option<external::InstanceCpuPlatform>,
303304
}
304305

305-
impl From<InstanceCreate> for v2025121200::InstanceCreate {
306-
fn from(old: InstanceCreate) -> v2025121200::InstanceCreate {
307-
v2025121200::InstanceCreate {
306+
impl From<InstanceCreate> for v2025120300::InstanceCreate {
307+
fn from(old: InstanceCreate) -> v2025120300::InstanceCreate {
308+
v2025120300::InstanceCreate {
308309
identity: old.identity,
309310
ncpus: old.ncpus,
310311
memory: old.memory,

0 commit comments

Comments
 (0)