Skip to content

Commit

Permalink
test run + fixups
Browse files Browse the repository at this point in the history
  • Loading branch information
davepacheco committed Jan 11, 2024
1 parent f50ee0f commit a2abb97
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 10 deletions.
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 dev-tools/omdb/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ serde.workspace = true
serde_json.workspace = true
sled-agent-client.workspace = true
slog.workspace = true
slog-error-chain.workspace = true
strum.workspace = true
tabled.workspace = true
textwrap.workspace = true
Expand Down
20 changes: 14 additions & 6 deletions dev-tools/omdb/src/bin/omdb/nexus.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ use nexus_client::types::BackgroundTask;
use nexus_client::types::CurrentStatus;
use nexus_client::types::LastResult;
use serde::Deserialize;
use slog_error_chain::InlineErrorChain;
use std::collections::BTreeMap;
use tabled::Tabled;
use uuid::Uuid;
Expand Down Expand Up @@ -694,12 +695,19 @@ async fn cmd_nexus_blueprints_list(
time_created: String,
}

let target_id = client
.blueprint_target_view()
.await
.context("fetching current target blueprint")?
.into_inner()
.target_id;
let target_id = match client.blueprint_target_view().await {
Ok(result) => Some(result.into_inner().target_id),
Err(error) => {
// This request will fail if there's no target configured, so it's
// not necessarily a big deal.
eprintln!(
"warn: failed to fetch current target: {}",
InlineErrorChain::new(&error),
);
None
}
};

let rows: Vec<BlueprintRow> = client
.blueprint_list_stream(None, None)
.try_collect::<Vec<_>>()
Expand Down
12 changes: 8 additions & 4 deletions openapi/nexus-internal.json
Original file line number Diff line number Diff line change
Expand Up @@ -2069,6 +2069,7 @@
]
},
"Blueprint": {
"description": "Describes all automatically-managed software and configuration in the rack",
"type": "object",
"properties": {
"creator": {
Expand All @@ -2092,7 +2093,7 @@
"reason": {
"type": "string"
},
"sleds": {
"sleds_in_cluster": {
"type": "array",
"items": {
"type": "string",
Expand All @@ -2118,7 +2119,7 @@
"id",
"omicron_zones",
"reason",
"sleds",
"sleds_in_cluster",
"time_created",
"zones_in_service"
]
Expand Down Expand Up @@ -2149,21 +2150,24 @@
"type": "object",
"properties": {
"enabled": {
"description": "policy: should the system actively work towards this blueprint\n\nThis should generally be left enabled.",
"type": "boolean"
},
"set_at": {
"description": "when this blueprint was made the target",
"type": "string",
"format": "date-time"
},
"target_id": {
"nullable": true,
"description": "id of the blueprint that the system is trying to make real",
"type": "string",
"format": "uuid"
}
},
"required": [
"enabled",
"set_at"
"set_at",
"target_id"
]
},
"BlueprintTargetSet": {
Expand Down

0 comments on commit a2abb97

Please sign in to comment.