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
23 changes: 0 additions & 23 deletions openapi/wicketd.json
Original file line number Diff line number Diff line change
Expand Up @@ -319,29 +319,6 @@
"$ref": "#/components/responses/Error"
}
}
},
"post": {
"summary": "Run rack setup.",
"description": "Will return an error if not all of the rack setup configuration has been populated.",
"operationId": "post_run_rack_setup",
"responses": {
"200": {
"description": "successful operation",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/RackInitUuid"
}
}
}
},
"4XX": {
"$ref": "#/components/responses/Error"
},
"5XX": {
"$ref": "#/components/responses/Error"
}
}
}
},
"/rack-setup/config": {
Expand Down
4 changes: 2 additions & 2 deletions wicket/src/wicketd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -290,10 +290,10 @@ impl WicketdManager {

fn start_rack_initialization(&self) {
let log = self.log.clone();
let addr = self.wicketd_addr;
let addr = self.commission_addr;
let events_tx = self.events_tx.clone();
tokio::spawn(async move {
let client = create_wicketd_client(&log, addr, WICKETD_TIMEOUT);
let client = create_commission_client(&log, addr, WICKETD_TIMEOUT);
let response = match client.post_run_rack_setup().await {
Ok(_) => Ok(()),
Err(error) => Err(error.to_string()),
Expand Down
13 changes: 0 additions & 13 deletions wicketd-api/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ use dropshot::RequestContext;
use dropshot::StreamingBody;
use dropshot::TypedBody;
use gateway_client::types::IgnitionCommand;
use omicron_uuid_kinds::RackInitUuid;
use schemars::JsonSchema;
use semver::Version;
use serde::Deserialize;
Expand Down Expand Up @@ -186,18 +185,6 @@ pub trait WicketdApi {
rqctx: RequestContext<Self::Context>,
) -> Result<HttpResponseOk<RackOperationStatus>, HttpError>;

/// Run rack setup.
///
/// Will return an error if not all of the rack setup configuration has
/// been populated.
#[endpoint {
method = POST,
path = "/rack-setup"
}]
async fn post_run_rack_setup(
rqctx: RequestContext<Self::Context>,
) -> Result<HttpResponseOk<RackInitUuid>, HttpError>;

/// A status endpoint used to report high level information known to
/// wicketd.
///
Expand Down
2 changes: 1 addition & 1 deletion wicketd/src/commission/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
//! The stable wicketd commissioning API.
//!
//! This API is used by automated tooling such as rkdeploy to commission new
//! racks. It is a reduced subset of the full, unstable wicketd API.
//! racks.
//!
//! **Automation must always use the stable API!**
//!
Expand Down
36 changes: 0 additions & 36 deletions wicketd/src/http_entrypoints.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ use crate::mgs::GetInventoryResponse as GetMgsInventoryResponse;
use crate::mgs::records_to_mgs_inventory;
use crate::multirack_config::CurrentMultirackJoinConfig;
use crate::transceivers::GetTransceiversResponse;
use bootstrap_agent_lockstep_client::ClientInfo as _;
use bootstrap_agent_lockstep_types::RackOperationStatus;
use dropshot::ApiDescription;
use dropshot::HttpError;
Expand All @@ -26,7 +25,6 @@ use dropshot::RequestContext;
use dropshot::StreamingBody;
use dropshot::TypedBody;
use internal_dns_resolver::Resolver;
use omicron_uuid_kinds::RackInitUuid;
use sled_agent_types::early_networking::SwitchSlot;
use slog::o;
use std::sync::Arc;
Expand Down Expand Up @@ -310,40 +308,6 @@ impl WicketdApi for WicketdApiImpl {
Ok(HttpResponseOk(op_status))
}

async fn post_run_rack_setup(
rqctx: RequestContext<Self::Context>,
) -> Result<HttpResponseOk<RackInitUuid>, HttpError> {
let ctx = rqctx.context();
let log = &rqctx.log;

let client = ba_lockstep_client(ctx);
let request = {
let mut config = ctx.rss_or_multirack_join_config.lock().unwrap();

let rss_config = config.rss_config_mut_or_conflict(
"cannot run rack setup when not preparing for RSS",
)?;

rss_config.start_rss_request(&ctx.bootstrap_peers, log).map_err(
|err| HttpError::for_bad_request(None, format!("{err:#}")),
)?
};

slog::info!(
ctx.log,
"Sending RSS initialize request to {}",
client.baseurl()
);

let init_id = client
.rack_initialize(&request)
.await
.map_err(|err| ba_lockstep_error_to_http(err, "rack setup"))?
.into_inner();

Ok(HttpResponseOk(init_id))
}

async fn get_inventory(
rqctx: RequestContext<Self::Context>,
body_params: TypedBody<GetInventoryParams>,
Expand Down
Loading