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

Update Oximeter-related DataStore methods for incoming reconfigurator support #6518

Merged
merged 8 commits into from
Sep 16, 2024
5 changes: 4 additions & 1 deletion nexus/db-model/src/oximeter_info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use nexus_types::internal_api;
use uuid::Uuid;

/// A record representing a registered `oximeter` collector.
#[derive(Queryable, Insertable, Debug, Clone, Copy)]
#[derive(Queryable, Insertable, Debug, Clone, Copy, PartialEq, Eq)]
#[diesel(table_name = oximeter)]
pub struct OximeterInfo {
/// The ID for this oximeter instance.
Expand All @@ -18,6 +18,8 @@ pub struct OximeterInfo {
pub time_created: DateTime<Utc>,
/// When this resource was last modified.
pub time_modified: DateTime<Utc>,
/// When this resource was deleted.
pub time_deleted: Option<DateTime<Utc>>,
/// The address on which this `oximeter` instance listens for requests.
pub ip: ipnetwork::IpNetwork,
/// The port on which this `oximeter` instance listens for requests.
Expand All @@ -31,6 +33,7 @@ impl OximeterInfo {
id: info.collector_id,
time_created: now,
time_modified: now,
time_deleted: None,
ip: info.address.ip().into(),
port: info.address.port().into(),
}
Expand Down
1 change: 1 addition & 0 deletions nexus/db-model/src/schema.rs
Original file line number Diff line number Diff line change
Expand Up @@ -794,6 +794,7 @@ table! {
id -> Uuid,
time_created -> Timestamptz,
time_modified -> Timestamptz,
time_deleted -> Nullable<Timestamptz>,
ip -> Inet,
port -> Int4,
}
Expand Down
3 changes: 2 additions & 1 deletion nexus/db-model/src/schema_versions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ use std::collections::BTreeMap;
///
/// This must be updated when you change the database schema. Refer to
/// schema/crdb/README.adoc in the root of this repository for details.
pub const SCHEMA_VERSION: SemverVersion = SemverVersion::new(94, 0, 0);
pub const SCHEMA_VERSION: SemverVersion = SemverVersion::new(95, 0, 0);

/// List of all past database schema versions, in *reverse* order
///
Expand All @@ -29,6 +29,7 @@ static KNOWN_VERSIONS: Lazy<Vec<KnownVersion>> = Lazy::new(|| {
// | leaving the first copy as an example for the next person.
// v
// KnownVersion::new(next_int, "unique-dirname-with-the-sql-files"),
KnownVersion::new(95, "oximeter-add-time-deleted"),
KnownVersion::new(94, "put-back-creating-vmm-state"),
KnownVersion::new(93, "dataset-kinds-zone-and-debug"),
KnownVersion::new(92, "lldp-link-config-nullable"),
Expand Down
1 change: 1 addition & 0 deletions nexus/db-queries/src/db/datastore/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ pub use dns::DnsVersionUpdateBuilder;
pub use instance::{InstanceAndActiveVmm, InstanceGestalt};
pub use inventory::DataStoreInventoryTest;
use nexus_db_model::AllSchemaVersions;
pub use oximeter::CollectorReassignment;
pub use rack::RackInit;
pub use rack::SledUnderlayAllocationResult;
pub use region::RegionAllocationFor;
Expand Down
Loading
Loading