Skip to content

Commit

Permalink
comments on IpPool DB model
Browse files Browse the repository at this point in the history
  • Loading branch information
david-crespo committed Aug 28, 2023
1 parent 952bce6 commit 9099bd2
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions nexus/db-model/src/ip_pool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ use std::net::IpAddr;
use uuid::Uuid;

/// An IP Pool is a collection of IP addresses external to the rack.
///
/// IP pools can be external or internal. External IP pools can be associated
/// with a silo or project so that instance IP allocation draws from that pool
/// instead of a system pool.
#[derive(Queryable, Insertable, Selectable, Clone, Debug, Resource)]
#[diesel(table_name = ip_pool)]
pub struct IpPool {
Expand All @@ -38,7 +42,14 @@ pub struct IpPool {
/// the contained ranges.
pub rcgen: i64,

// Fields representating association with a silo or project. silo_id must be
// non-null if project_id is non-null. When project_id is non-null, silo_id
// will (naturally) be the ID of the project's silo. Both must be null if
// internal is true, i.e., internal IP pools must be fleet-level pools.

/// Silo, if IP pool is associated with a particular silo
pub silo_id: Option<Uuid>,
/// Project, if IP pool is associated with a particular project
pub project_id: Option<Uuid>,
}

Expand Down

0 comments on commit 9099bd2

Please sign in to comment.