Floating IPs include the pool but ephemeral IPs don't.
|
#[derive(Debug, Clone, Deserialize, PartialEq, Serialize, JsonSchema)] |
|
#[serde(tag = "kind", rename_all = "snake_case")] |
|
pub enum ExternalIp { |
|
Ephemeral { ip: IpAddr }, |
|
Floating(FloatingIp), |
|
} |
|
|
|
impl ExternalIp { |
|
pub fn ip(&self) -> IpAddr { |
|
match self { |
|
Self::Ephemeral { ip } => *ip, |
|
Self::Floating(float) => float.ip, |
|
} |
|
} |
|
|
|
pub fn kind(&self) -> IpKind { |
|
match self { |
|
Self::Ephemeral { .. } => IpKind::Ephemeral, |
|
Self::Floating(_) => IpKind::Floating, |
|
} |
|
} |
|
} |
|
|
|
/// A Floating IP is a well-known IP address which can be attached |
|
/// and detached from instances. |
|
#[derive( |
|
ObjectIdentity, Debug, PartialEq, Clone, Deserialize, Serialize, JsonSchema, |
|
)] |
|
#[serde(rename_all = "snake_case")] |
|
pub struct FloatingIp { |
|
#[serde(flatten)] |
|
pub identity: IdentityMetadata, |
|
/// The IP address held by this resource. |
|
pub ip: IpAddr, |
|
/// The ID of the IP pool this resource belongs to. |
|
pub ip_pool_id: Uuid, |
|
/// The project this resource exists within. |
|
pub project_id: Uuid, |
|
/// The ID of the instance that this Floating IP is attached to, |
|
/// if it is presently in use. |
|
pub instance_id: Option<Uuid>, |
|
} |
I want to be able to show the pool here.

Floating IPs include the pool but ephemeral IPs don't.
omicron/nexus/types/src/external_api/views.rs
Lines 465 to 506 in b0639b0
I want to be able to show the pool here.