Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions clients/gateway-client/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ workspace = true
[dependencies]
base64.workspace = true
chrono.workspace = true
daft.workspace = true
gateway-messages.workspace = true
progenitor.workspace = true
rand.workspace = true
Expand Down
3 changes: 3 additions & 0 deletions clients/gateway-client/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,9 @@ progenitor::generate_api!(
SpIgnition = { derives = [PartialEq, Eq, PartialOrd, Ord] },
SpIgnitionSystemType = { derives = [Copy, PartialEq, Eq, PartialOrd, Ord] },
SpState = { derives = [PartialEq, Eq, PartialOrd, Ord] },
SpType = { derives = [daft::Diffable] },
SpUpdateStatus = { derives = [PartialEq, Hash, Eq] },
UpdatePreparationProgress = { derives = [PartialEq, Hash, Eq] },
},
);

Expand Down
2 changes: 2 additions & 0 deletions common/src/update.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use std::fmt;

use daft::Diffable;
use schemars::JsonSchema;
use serde::{Deserialize, Serialize};
use tufaceous_artifact::{Artifact, ArtifactKind, ArtifactVersion};
Expand All @@ -15,6 +16,7 @@ use tufaceous_artifact::{Artifact, ArtifactKind, ArtifactVersion};
// TODO: move this to tufaceous-artifact in the future
#[derive(
Debug,
Diffable,
Clone,
PartialEq,
Eq,
Expand Down
24 changes: 23 additions & 1 deletion nexus/types/src/inventory.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ use crate::external_api::params::UninitializedSledId;
use chrono::DateTime;
use chrono::Utc;
use clickhouse_admin_types::ClickhouseKeeperClusterMembership;
use daft::Diffable;
pub use gateway_client::types::PowerState;
pub use gateway_client::types::RotImageError;
pub use gateway_client::types::RotSlot;
Expand All @@ -34,6 +35,7 @@ use omicron_uuid_kinds::CollectionUuid;
use omicron_uuid_kinds::DatasetUuid;
use omicron_uuid_kinds::SledUuid;
use omicron_uuid_kinds::ZpoolUuid;
use schemars::JsonSchema;
use serde::{Deserialize, Serialize};
use serde_with::serde_as;
use std::collections::BTreeMap;
Expand Down Expand Up @@ -205,7 +207,16 @@ impl Collection {
/// the same part number and serial number but a new revision number, we'd want
/// to treat that as the same baseboard as one with a different revision number.
#[derive(
Clone, Debug, Ord, Eq, PartialOrd, PartialEq, Deserialize, Serialize,
Clone,
Debug,
Diffable,
Ord,
Eq,
PartialOrd,
PartialEq,
Deserialize,
Serialize,
JsonSchema,
)]
pub struct BaseboardId {
/// Oxide Part Number
Expand All @@ -226,6 +237,17 @@ impl From<UninitializedSledId> for BaseboardId {
}
}

impl slog::KV for BaseboardId {
fn serialize(
&self,
_record: &slog::Record,
serializer: &mut dyn slog::Serializer,
) -> slog::Result {
serializer.emit_str("part_number".into(), &self.part_number)?;
serializer.emit_str("serial_number".into(), &self.serial_number)
}
}

/// Caboose contents found during a collection
///
/// These are normalized in the database. Each distinct `Caboose` is assigned a
Expand Down
Loading