diff --git a/end-to-end-tests/src/instance_launch.rs b/end-to-end-tests/src/instance_launch.rs index f27261e82d2..1aae46fe984 100644 --- a/end-to-end-tests/src/instance_launch.rs +++ b/end-to-end-tests/src/instance_launch.rs @@ -92,6 +92,7 @@ async fn instance_launch() -> Result<()> { .first() .context("no external IPs")? .clone(); + let ExternalIp::Ephemeral { ip: ip_addr } = ip_addr else { anyhow::bail!("IP bound to instance was not ephemeral as required.") }; diff --git a/nexus/db-queries/src/db/datastore/probe.rs b/nexus/db-queries/src/db/datastore/probe.rs index f5200a4109d..815916eb53d 100644 --- a/nexus/db-queries/src/db/datastore/probe.rs +++ b/nexus/db-queries/src/db/datastore/probe.rs @@ -37,19 +37,19 @@ pub struct ProbeInfo { pub id: Uuid, pub name: Name, sled: Uuid, - pub external_ips: Vec, + pub external_ips: Vec, pub interface: NetworkInterface, } #[derive(Debug, Clone, JsonSchema, Serialize, Deserialize)] -pub struct ExternalIp { +pub struct ProbeExternalIp { ip: IpAddr, first_port: u16, last_port: u16, kind: IpKind, } -impl From for ExternalIp { +impl From for ProbeExternalIp { fn from(value: nexus_db_model::ExternalIp) -> Self { Self { ip: value.ip.ip(), diff --git a/openapi/nexus-internal.json b/openapi/nexus-internal.json index c6c9bc26653..68ab42561a8 100644 --- a/openapi/nexus-internal.json +++ b/openapi/nexus-internal.json @@ -3516,34 +3516,6 @@ "request_id" ] }, - "ExternalIp": { - "type": "object", - "properties": { - "first_port": { - "type": "integer", - "format": "uint16", - "minimum": 0 - }, - "ip": { - "type": "string", - "format": "ip" - }, - "kind": { - "$ref": "#/components/schemas/IpKind" - }, - "last_port": { - "type": "integer", - "format": "uint16", - "minimum": 0 - } - }, - "required": [ - "first_port", - "ip", - "kind", - "last_port" - ] - }, "ExternalPortDiscovery": { "oneOf": [ { @@ -5560,13 +5532,41 @@ "speed400_g" ] }, + "ProbeExternalIp": { + "type": "object", + "properties": { + "first_port": { + "type": "integer", + "format": "uint16", + "minimum": 0 + }, + "ip": { + "type": "string", + "format": "ip" + }, + "kind": { + "$ref": "#/components/schemas/IpKind" + }, + "last_port": { + "type": "integer", + "format": "uint16", + "minimum": 0 + } + }, + "required": [ + "first_port", + "ip", + "kind", + "last_port" + ] + }, "ProbeInfo": { "type": "object", "properties": { "external_ips": { "type": "array", "items": { - "$ref": "#/components/schemas/ExternalIp" + "$ref": "#/components/schemas/ProbeExternalIp" } }, "id": { diff --git a/openapi/nexus.json b/openapi/nexus.json index 9a91ed2933d..7173a0411af 100644 --- a/openapi/nexus.json +++ b/openapi/nexus.json @@ -2171,7 +2171,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ExternalIp2" + "$ref": "#/components/schemas/ExternalIp" } } } @@ -11761,34 +11761,6 @@ ] }, "ExternalIp": { - "type": "object", - "properties": { - "first_port": { - "type": "integer", - "format": "uint16", - "minimum": 0 - }, - "ip": { - "type": "string", - "format": "ip" - }, - "kind": { - "$ref": "#/components/schemas/IpKind" - }, - "last_port": { - "type": "integer", - "format": "uint16", - "minimum": 0 - } - }, - "required": [ - "first_port", - "ip", - "kind", - "last_port" - ] - }, - "ExternalIp2": { "oneOf": [ { "type": "object", @@ -11931,7 +11903,7 @@ "description": "list of items on this page of results", "type": "array", "items": { - "$ref": "#/components/schemas/ExternalIp2" + "$ref": "#/components/schemas/ExternalIp" } }, "next_page": { @@ -14370,13 +14342,41 @@ "sled" ] }, + "ProbeExternalIp": { + "type": "object", + "properties": { + "first_port": { + "type": "integer", + "format": "uint16", + "minimum": 0 + }, + "ip": { + "type": "string", + "format": "ip" + }, + "kind": { + "$ref": "#/components/schemas/IpKind" + }, + "last_port": { + "type": "integer", + "format": "uint16", + "minimum": 0 + } + }, + "required": [ + "first_port", + "ip", + "kind", + "last_port" + ] + }, "ProbeInfo": { "type": "object", "properties": { "external_ips": { "type": "array", "items": { - "$ref": "#/components/schemas/ExternalIp" + "$ref": "#/components/schemas/ProbeExternalIp" } }, "id": { diff --git a/sled-agent/src/probe_manager.rs b/sled-agent/src/probe_manager.rs index 288b62f8401..8481dc4b795 100644 --- a/sled-agent/src/probe_manager.rs +++ b/sled-agent/src/probe_manager.rs @@ -6,7 +6,7 @@ use illumos_utils::opte::params::VpcFirewallRule; use illumos_utils::opte::{DhcpCfg, PortManager}; use illumos_utils::running_zone::{RunningZone, ZoneBuilderFactory}; use illumos_utils::zone::Zones; -use nexus_client::types::{ExternalIp, ProbeInfo}; +use nexus_client::types::{ProbeExternalIp, ProbeInfo}; use omicron_common::api::external::{ VpcFirewallRuleAction, VpcFirewallRuleDirection, VpcFirewallRulePriority, VpcFirewallRuleStatus, @@ -95,7 +95,7 @@ struct ProbeState { /// Runtime state on this sled status: zone::State, /// The external IP addresses the probe has been assigned. - external_ips: Vec, + external_ips: Vec, /// The probes networking interface. interface: Option, }