Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
david-crespo opened this issue Oct 10, 2024 · 0 comments
Open

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

david-crespo opened this issue Oct 10, 2024 · 0 comments

Comments

@david-crespo
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant