Skip to content

Ephemeral IPs in instance IPs list should include pool ID #6825

@david-crespo

Description

@david-crespo

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.

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions