Skip to content

Commit

Permalink
Merge branch 'main' into felixmcfelix/no-opte-vnic
Browse files Browse the repository at this point in the history
  • Loading branch information
FelixMcFelix committed Jul 16, 2024
2 parents 58c10b9 + 8316247 commit 6f4058c
Show file tree
Hide file tree
Showing 15 changed files with 215 additions and 220 deletions.
104 changes: 8 additions & 96 deletions Cargo.lock

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

5 changes: 0 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -483,9 +483,6 @@ slog-term = "2.9.1"
smf = "0.2"
socket2 = { version = "0.5", features = ["all"] }
sp-sim = { path = "sp-sim" }
sprockets-common = { git = "https://github.com/oxidecomputer/sprockets", rev = "77df31efa5619d0767ffc837ef7468101608aee9" }
sprockets-host = { git = "https://github.com/oxidecomputer/sprockets", rev = "77df31efa5619d0767ffc837ef7468101608aee9" }
sprockets-rot = { git = "https://github.com/oxidecomputer/sprockets", rev = "77df31efa5619d0767ffc837ef7468101608aee9" }
sqlformat = "0.2.4"
sqlparser = { version = "0.45.0", features = [ "visitor" ] }
static_assertions = "1.1.0"
Expand Down Expand Up @@ -683,8 +680,6 @@ opt-level = 3
opt-level = 3
[profile.dev.package.rsa]
opt-level = 3
[profile.dev.package.salty]
opt-level = 3
[profile.dev.package.signature]
opt-level = 3
[profile.dev.package.subtle]
Expand Down
30 changes: 30 additions & 0 deletions clients/sled-agent-client/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -593,6 +593,36 @@ impl From<omicron_common::api::internal::shared::NetworkInterfaceKind>
}
}

impl From<omicron_common::api::internal::shared::SledIdentifiers>
for types::SledIdentifiers
{
fn from(
value: omicron_common::api::internal::shared::SledIdentifiers,
) -> Self {
Self {
model: value.model,
rack_id: value.rack_id,
revision: value.revision,
serial: value.serial,
sled_id: value.sled_id,
}
}
}

impl From<types::SledIdentifiers>
for omicron_common::api::internal::shared::SledIdentifiers
{
fn from(value: types::SledIdentifiers) -> Self {
Self {
model: value.model,
rack_id: value.rack_id,
revision: value.revision,
serial: value.serial,
sled_id: value.sled_id,
}
}
}

/// Exposes additional [`Client`] interfaces for use by the test suite. These
/// are bonus endpoints, not generated in the real client.
#[async_trait]
Expand Down
20 changes: 20 additions & 0 deletions common/src/api/internal/shared.rs
Original file line number Diff line number Diff line change
Expand Up @@ -702,6 +702,26 @@ pub struct ResolvedVpcRouteSet {
pub routes: HashSet<ResolvedVpcRoute>,
}

/// Identifiers for a single sled.
///
/// This is intended primarily to be used in timeseries, to identify
/// sled from which metric data originates.
#[derive(Clone, Debug, Deserialize, Serialize, JsonSchema, PartialEq)]
pub struct SledIdentifiers {
/// Control plane ID of the rack this sled is a member of
pub rack_id: Uuid,
/// Control plane ID for the sled itself
pub sled_id: Uuid,
/// Model name of the sled
pub model: String,
/// Revision number of the sled
pub revision: u32,
/// Serial number of the sled
//
// NOTE: This is only guaranteed to be unique within a model.
pub serial: String,
}

#[cfg(test)]
mod tests {
use crate::api::internal::shared::AllowedSourceIps;
Expand Down
2 changes: 1 addition & 1 deletion dev-tools/xtask/src/download.rs
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ async fn get_values_from_file<const N: usize>(

let content = tokio::fs::read_to_string(&path)
.await
.context("Failed to read {path}")?;
.with_context(|| format!("Failed to read {path}"))?;
for line in content.lines() {
let line = line.trim();
let Some((key, value)) = line.split_once('=') else {
Expand Down
61 changes: 61 additions & 0 deletions openapi/sled-agent.json
Original file line number Diff line number Diff line change
Expand Up @@ -710,6 +710,30 @@
}
}
},
"/sled-identifiers": {
"get": {
"summary": "Fetch sled identifiers",
"operationId": "sled_identifiers",
"responses": {
"200": {
"description": "successful operation",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/SledIdentifiers"
}
}
}
},
"4XX": {
"$ref": "#/components/responses/Error"
},
"5XX": {
"$ref": "#/components/responses/Error"
}
}
}
},
"/sled-role": {
"get": {
"operationId": "sled_role_get",
Expand Down Expand Up @@ -4549,6 +4573,43 @@
"type": "string",
"pattern": "^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$"
},
"SledIdentifiers": {
"description": "Identifiers for a single sled.\n\nThis is intended primarily to be used in timeseries, to identify sled from which metric data originates.",
"type": "object",
"properties": {
"model": {
"description": "Model name of the sled",
"type": "string"
},
"rack_id": {
"description": "Control plane ID of the rack this sled is a member of",
"type": "string",
"format": "uuid"
},
"revision": {
"description": "Revision number of the sled",
"type": "integer",
"format": "uint32",
"minimum": 0
},
"serial": {
"description": "Serial number of the sled",
"type": "string"
},
"sled_id": {
"description": "Control plane ID for the sled itself",
"type": "string",
"format": "uuid"
}
},
"required": [
"model",
"rack_id",
"revision",
"serial",
"sled_id"
]
},
"SledInstanceState": {
"description": "A wrapper type containing a sled's total knowledge of the state of a specific VMM and the instance it incarnates.",
"type": "object",
Expand Down
Loading

0 comments on commit 6f4058c

Please sign in to comment.