diff --git a/Cargo.lock b/Cargo.lock index 1a38aa26..86a4bee9 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -121,7 +121,7 @@ checksum = "3109e49b1e4909e9db6515a30c633684d68cdeaa252f215214cb4fa1a5bfee2c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.116", + "syn 2.0.117", "synstructure", ] @@ -133,7 +133,7 @@ checksum = "7b18050c2cd6fe86c3a76584ef5e0baf286d038cda203eb6223df2cc413565f7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.116", + "syn 2.0.117", ] [[package]] @@ -201,7 +201,7 @@ checksum = "c7c24de15d275a1ecfd47a380fb4d5ec9bfe0933f309ed5e705b775596a3574d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.116", + "syn 2.0.117", ] [[package]] @@ -212,7 +212,7 @@ checksum = "9035ad2d096bed7955a320ee7e2230574d28fd3c3a0f186cbea1ff3c7eed5dbb" dependencies = [ "proc-macro2", "quote", - "syn 2.0.116", + "syn 2.0.117", ] [[package]] @@ -476,7 +476,7 @@ dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.116", + "syn 2.0.117", ] [[package]] @@ -735,7 +735,7 @@ dependencies = [ "proc-macro2", "quote", "strsim", - "syn 2.0.116", + "syn 2.0.117", ] [[package]] @@ -746,7 +746,7 @@ checksum = "ac3984ec7bd6cfa798e62b4a642426a5be0e68f9401cfc2a01e3fa9ea2fcdb8d" dependencies = [ "darling_core", "quote", - "syn 2.0.116", + "syn 2.0.117", ] [[package]] @@ -798,7 +798,7 @@ checksum = "1e567bd82dcff979e4b03460c307b3cdc9e96fde3d73bed1496d2bc75d9dd62a" dependencies = [ "proc-macro2", "quote", - "syn 2.0.116", + "syn 2.0.117", ] [[package]] @@ -820,7 +820,7 @@ dependencies = [ "proc-macro2", "quote", "rustc_version", - "syn 2.0.116", + "syn 2.0.117", ] [[package]] @@ -907,7 +907,7 @@ checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.116", + "syn 2.0.117", ] [[package]] @@ -981,7 +981,7 @@ dependencies = [ "semver", "serde", "serde_tokenstream", - "syn 2.0.116", + "syn 2.0.117", ] [[package]] @@ -1291,7 +1291,7 @@ checksum = "e835b70203e41293343137df5c0664546da5745f82ec9b84d40be8336958447b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.116", + "syn 2.0.117", ] [[package]] @@ -1865,7 +1865,7 @@ dependencies = [ "indoc", "proc-macro2", "quote", - "syn 2.0.116", + "syn 2.0.117", ] [[package]] @@ -1985,7 +1985,7 @@ checksum = "f7946b4325269738f270bb55b3c19ab5c5040525f83fd625259422a9d25d9be5" dependencies = [ "proc-macro2", "quote", - "syn 2.0.116", + "syn 2.0.117", ] [[package]] @@ -2381,7 +2381,7 @@ checksum = "ed3955f1a9c7c0c15e092f9c887db08b1fc683305fdf6eb6684f22555355e202" dependencies = [ "proc-macro2", "quote", - "syn 2.0.116", + "syn 2.0.117", ] [[package]] @@ -2496,7 +2496,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.116", + "syn 2.0.117", ] [[package]] @@ -2747,7 +2747,7 @@ dependencies = [ "pest_meta", "proc-macro2", "quote", - "syn 2.0.116", + "syn 2.0.117", ] [[package]] @@ -2800,7 +2800,7 @@ dependencies = [ "phf_shared", "proc-macro2", "quote", - "syn 2.0.116", + "syn 2.0.117", ] [[package]] @@ -2916,7 +2916,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "479ca8adacdd7ce8f1fb39ce9ecccbfe93a3f1344b3d0d97f20bc0196208f62b" dependencies = [ "proc-macro2", - "syn 2.0.116", + "syn 2.0.117", ] [[package]] @@ -2930,8 +2930,8 @@ dependencies = [ [[package]] name = "progenitor" -version = "0.12.0" -source = "git+https://github.com/oxidecomputer/progenitor#b85633b980c25747a5b1ebbc8b5cb10317abdb5e" +version = "0.13.0" +source = "git+https://github.com/oxidecomputer/progenitor#54ee668b3b458c882a35787dc2a475d854d0a485" dependencies = [ "progenitor-impl", ] @@ -2953,8 +2953,8 @@ dependencies = [ [[package]] name = "progenitor-impl" -version = "0.12.0" -source = "git+https://github.com/oxidecomputer/progenitor#b85633b980c25747a5b1ebbc8b5cb10317abdb5e" +version = "0.13.0" +source = "git+https://github.com/oxidecomputer/progenitor#54ee668b3b458c882a35787dc2a475d854d0a485" dependencies = [ "heck", "http 1.4.0", @@ -2966,7 +2966,7 @@ dependencies = [ "schemars", "serde", "serde_json", - "syn 2.0.116", + "syn 2.0.117", "thiserror 2.0.18", "typify", "unicode-ident", @@ -3578,7 +3578,7 @@ dependencies = [ "proc-macro2", "quote", "serde_derive_internals", - "syn 2.0.116", + "syn 2.0.117", ] [[package]] @@ -3647,7 +3647,7 @@ checksum = "d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79" dependencies = [ "proc-macro2", "quote", - "syn 2.0.116", + "syn 2.0.117", ] [[package]] @@ -3658,7 +3658,7 @@ checksum = "18d26a20a969b9e3fdf2fc2d9f21eda6c40e2de84c9408bb5d3b05d499aae711" dependencies = [ "proc-macro2", "quote", - "syn 2.0.116", + "syn 2.0.117", ] [[package]] @@ -3722,7 +3722,7 @@ dependencies = [ "proc-macro2", "quote", "serde", - "syn 2.0.116", + "syn 2.0.117", ] [[package]] @@ -3974,7 +3974,7 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.116", + "syn 2.0.117", ] [[package]] @@ -3986,7 +3986,7 @@ dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.116", + "syn 2.0.117", ] [[package]] @@ -4024,9 +4024,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.116" +version = "2.0.117" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3df424c70518695237746f84cede799c9c58fcb37450d7b23716568cc8bc69cb" +checksum = "e665b8803e7b1d2a727f4023456bbbbe74da67099c585258af0ad9c5013b9b99" dependencies = [ "proc-macro2", "quote", @@ -4050,7 +4050,7 @@ checksum = "728a70f3dbaf5bab7f0c4b1ac8d7ae5ea60a4b5549c8a5914361c99147a709d2" dependencies = [ "proc-macro2", "quote", - "syn 2.0.116", + "syn 2.0.117", ] [[package]] @@ -4248,7 +4248,7 @@ checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.116", + "syn 2.0.117", ] [[package]] @@ -4259,7 +4259,7 @@ checksum = "ebc4ee7f67670e9b64d05fa4253e753e016c6c95ff35b89b7941d6b856dec1d5" dependencies = [ "proc-macro2", "quote", - "syn 2.0.116", + "syn 2.0.117", ] [[package]] @@ -4370,7 +4370,7 @@ checksum = "af407857209536a95c8e56f8231ef2c2e2aff839b22e07a1ffcbc617e9db9fa5" dependencies = [ "proc-macro2", "quote", - "syn 2.0.116", + "syn 2.0.117", ] [[package]] @@ -4624,7 +4624,7 @@ checksum = "7490cfa5ec963746568740651ac6781f701c9c5ea257c58e057f3ba8cf69e8da" dependencies = [ "proc-macro2", "quote", - "syn 2.0.116", + "syn 2.0.117", ] [[package]] @@ -4735,7 +4735,7 @@ dependencies = [ "semver", "serde", "serde_json", - "syn 2.0.116", + "syn 2.0.117", "thiserror 2.0.18", "unicode-ident", ] @@ -4753,7 +4753,7 @@ dependencies = [ "serde", "serde_json", "serde_tokenstream", - "syn 2.0.116", + "syn 2.0.117", "typify-impl", ] @@ -5005,7 +5005,7 @@ dependencies = [ "bumpalo", "proc-macro2", "quote", - "syn 2.0.116", + "syn 2.0.117", "wasm-bindgen-shared", ] @@ -5218,7 +5218,7 @@ checksum = "053e2e040ab57b9dc951b72c264860db7eb3b0200ba345b4e4c3b14f67855ddf" dependencies = [ "proc-macro2", "quote", - "syn 2.0.116", + "syn 2.0.117", ] [[package]] @@ -5229,7 +5229,7 @@ checksum = "3f316c4a2570ba26bbec722032c4099d8c8bc095efccdc15688708623367e358" dependencies = [ "proc-macro2", "quote", - "syn 2.0.116", + "syn 2.0.117", ] [[package]] @@ -5537,7 +5537,7 @@ dependencies = [ "heck", "indexmap", "prettyplease", - "syn 2.0.116", + "syn 2.0.117", "wasm-metadata", "wit-bindgen-core", "wit-component", @@ -5553,7 +5553,7 @@ dependencies = [ "prettyplease", "proc-macro2", "quote", - "syn 2.0.116", + "syn 2.0.117", "wit-bindgen-core", "wit-bindgen-rust", ] @@ -5667,7 +5667,7 @@ checksum = "b659052874eb698efe5b9e8cf382204678a0086ebf46982b79d6ca3182927e5d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.116", + "syn 2.0.117", "synstructure", ] @@ -5688,7 +5688,7 @@ checksum = "4122cd3169e94605190e77839c9a40d40ed048d305bfdc146e7df40ab0f3e517" dependencies = [ "proc-macro2", "quote", - "syn 2.0.116", + "syn 2.0.117", ] [[package]] @@ -5708,7 +5708,7 @@ checksum = "d71e5d6e06ab090c67b5e44993ec16b72dcbaabc526db883a360057678b48502" dependencies = [ "proc-macro2", "quote", - "syn 2.0.116", + "syn 2.0.117", "synstructure", ] @@ -5748,7 +5748,7 @@ checksum = "eadce39539ca5cb3985590102671f2567e659fca9666581ad3411d59207951f3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.116", + "syn 2.0.117", ] [[package]] diff --git a/cli/docs/cli.json b/cli/docs/cli.json index 92db31e3..27269d31 100644 --- a/cli/docs/cli.json +++ b/cli/docs/cli.json @@ -5640,31 +5640,6 @@ } ], "subcommands": [ - { - "name": "add", - "about": "Add sled to initialized rack", - "args": [ - { - "long": "json-body", - "help": "Path to a file that contains the full json body." - }, - { - "long": "json-body-template", - "help": "XXX" - }, - { - "long": "part" - }, - { - "long": "profile", - "help": "Configuration profile to use for commands", - "global": true - }, - { - "long": "serial" - } - ] - }, { "name": "disk-led", "about": "List physical disks attached to sleds", diff --git a/cli/src/cli_builder.rs b/cli/src/cli_builder.rs index 024b1794..091c99e7 100644 --- a/cli/src/cli_builder.rs +++ b/cli/src/cli_builder.rs @@ -710,7 +710,6 @@ fn xxx<'a>(command: CliCommand) -> Option<&'a str> { CliCommand::SledList => Some("system hardware sled list"), CliCommand::SledListUninitialized => Some("system hardware sled list-uninitialized"), CliCommand::SledView => Some("system hardware sled view"), - CliCommand::SledAdd => Some("system hardware sled add"), CliCommand::SledSetProvisionPolicy => Some("system hardware sled set-provision-policy"), CliCommand::SledInstanceList => Some("system hardware sled instance-list"), CliCommand::PhysicalDiskList => Some("system hardware disk list"), diff --git a/cli/src/generated_cli.rs b/cli/src/generated_cli.rs index 3f0d72d8..409b8a44 100644 --- a/cli/src/generated_cli.rs +++ b/cli/src/generated_cli.rs @@ -207,7 +207,6 @@ impl Cli { CliCommand::RackMembershipAbort => Self::cli_rack_membership_abort(), CliCommand::RackMembershipAddSleds => Self::cli_rack_membership_add_sleds(), CliCommand::SledList => Self::cli_sled_list(), - CliCommand::SledAdd => Self::cli_sled_add(), CliCommand::SledView => Self::cli_sled_view(), CliCommand::SledPhysicalDiskList => Self::cli_sled_physical_disk_list(), CliCommand::SledInstanceList => Self::cli_sled_instance_list(), @@ -5261,37 +5260,6 @@ impl Cli { .about("List sleds") } - pub fn cli_sled_add() -> ::clap::Command { - ::clap::Command::new("") - .arg( - ::clap::Arg::new("part") - .long("part") - .value_parser(::clap::value_parser!(::std::string::String)) - .required_unless_present("json-body"), - ) - .arg( - ::clap::Arg::new("serial") - .long("serial") - .value_parser(::clap::value_parser!(::std::string::String)) - .required_unless_present("json-body"), - ) - .arg( - ::clap::Arg::new("json-body") - .long("json-body") - .value_name("JSON-FILE") - .required(false) - .value_parser(::clap::value_parser!(std::path::PathBuf)) - .help("Path to a file that contains the full json body."), - ) - .arg( - ::clap::Arg::new("json-body-template") - .long("json-body-template") - .action(::clap::ArgAction::SetTrue) - .help("XXX"), - ) - .about("Add sled to initialized rack") - } - pub fn cli_sled_view() -> ::clap::Command { ::clap::Command::new("") .arg( @@ -9869,7 +9837,6 @@ impl Cli { self.execute_rack_membership_add_sleds(matches).await } CliCommand::SledList => self.execute_sled_list(matches).await, - CliCommand::SledAdd => self.execute_sled_add(matches).await, CliCommand::SledView => self.execute_sled_view(matches).await, CliCommand::SledPhysicalDiskList => self.execute_sled_physical_disk_list(matches).await, CliCommand::SledInstanceList => self.execute_sled_instance_list(matches).await, @@ -15782,38 +15749,6 @@ impl Cli { } } - pub async fn execute_sled_add(&self, matches: &::clap::ArgMatches) -> anyhow::Result<()> { - let mut request = self.client.sled_add(); - if let Some(value) = matches.get_one::<::std::string::String>("part") { - request = request.body_map(|body| body.part(value.clone())) - } - - if let Some(value) = matches.get_one::<::std::string::String>("serial") { - request = request.body_map(|body| body.serial(value.clone())) - } - - if let Some(value) = matches.get_one::("json-body") { - let body_txt = std::fs::read_to_string(value) - .with_context(|| format!("failed to read {}", value.display()))?; - let body_value = serde_json::from_str::(&body_txt) - .with_context(|| format!("failed to parse {}", value.display()))?; - request = request.body(body_value); - } - - self.config.execute_sled_add(matches, &mut request)?; - let result = request.send().await; - match result { - Ok(r) => { - self.config.success_item(&r); - Ok(()) - } - Err(r) => { - self.config.error(&r); - Err(anyhow::Error::new(r)) - } - } - } - pub async fn execute_sled_view(&self, matches: &::clap::ArgMatches) -> anyhow::Result<()> { let mut request = self.client.sled_view(); if let Some(value) = matches.get_one::<::uuid::Uuid>("sled-id") { @@ -22265,14 +22200,6 @@ pub trait CliConfig { Ok(()) } - fn execute_sled_add( - &self, - matches: &::clap::ArgMatches, - request: &mut builder::SledAdd, - ) -> anyhow::Result<()> { - Ok(()) - } - fn execute_sled_view( &self, matches: &::clap::ArgMatches, @@ -23629,7 +23556,6 @@ pub enum CliCommand { RackMembershipAbort, RackMembershipAddSleds, SledList, - SledAdd, SledView, SledPhysicalDiskList, SledInstanceList, @@ -23945,7 +23871,6 @@ impl CliCommand { CliCommand::RackMembershipAbort, CliCommand::RackMembershipAddSleds, CliCommand::SledList, - CliCommand::SledAdd, CliCommand::SledView, CliCommand::SledPhysicalDiskList, CliCommand::SledInstanceList, diff --git a/oxide.json b/oxide.json index 2fe07ce3..c533aa35 100644 --- a/oxide.json +++ b/oxide.json @@ -7,7 +7,7 @@ "url": "https://oxide.computer", "email": "api@oxide.computer" }, - "version": "2026021301.0.0" + "version": "2026021900.0.0" }, "paths": { "/device/auth": { @@ -8170,41 +8170,6 @@ "x-dropshot-pagination": { "required": [] } - }, - "post": { - "tags": [ - "system/hardware" - ], - "summary": "Add sled to initialized rack", - "operationId": "sled_add", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UninitializedSledId" - } - } - }, - "required": true - }, - "responses": { - "201": { - "description": "successful creation", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/SledId" - } - } - } - }, - "4XX": { - "$ref": "#/components/responses/Error" - }, - "5XX": { - "$ref": "#/components/responses/Error" - } - } } }, "/v1/system/hardware/sleds/{sled_id}": { @@ -27579,19 +27544,6 @@ "usable_physical_ram" ] }, - "SledId": { - "description": "The unique ID of a sled.", - "type": "object", - "properties": { - "id": { - "type": "string", - "format": "uuid" - } - }, - "required": [ - "id" - ] - }, "SledInstance": { "description": "An operator's view of an instance running on a given sled", "type": "object", @@ -29671,22 +29623,6 @@ "rack_id" ] }, - "UninitializedSledId": { - "description": "The unique hardware ID for a sled", - "type": "object", - "properties": { - "part": { - "type": "string" - }, - "serial": { - "type": "string" - } - }, - "required": [ - "part", - "serial" - ] - }, "UninitializedSledResultsPage": { "description": "A single page of results", "type": "object", diff --git a/sdk-httpmock/src/generated_httpmock.rs b/sdk-httpmock/src/generated_httpmock.rs index 9fdc2008..2f4b65f9 100644 --- a/sdk-httpmock/src/generated_httpmock.rs +++ b/sdk-httpmock/src/generated_httpmock.rs @@ -12287,65 +12287,6 @@ pub mod operations { } } - pub struct SledAddWhen(::httpmock::When); - impl SledAddWhen { - pub fn new(inner: ::httpmock::When) -> Self { - Self( - inner - .method(::httpmock::Method::POST) - .path_matches(regex::Regex::new("^/v1/system/hardware/sleds$").unwrap()), - ) - } - - pub fn into_inner(self) -> ::httpmock::When { - self.0 - } - - pub fn body(self, value: &types::UninitializedSledId) -> Self { - Self(self.0.json_body_obj(value)) - } - } - - pub struct SledAddThen(::httpmock::Then); - impl SledAddThen { - pub fn new(inner: ::httpmock::Then) -> Self { - Self(inner) - } - - pub fn into_inner(self) -> ::httpmock::Then { - self.0 - } - - pub fn created(self, value: &types::SledId) -> Self { - Self( - self.0 - .status(201u16) - .header("content-type", "application/json") - .json_body_obj(value), - ) - } - - pub fn client_error(self, status: u16, value: &types::Error) -> Self { - assert_eq!(status / 100u16, 4u16); - Self( - self.0 - .status(status) - .header("content-type", "application/json") - .json_body_obj(value), - ) - } - - pub fn server_error(self, status: u16, value: &types::Error) -> Self { - assert_eq!(status / 100u16, 5u16); - Self( - self.0 - .status(status) - .header("content-type", "application/json") - .json_body_obj(value), - ) - } - } - pub struct SledViewWhen(::httpmock::When); impl SledViewWhen { pub fn new(inner: ::httpmock::When) -> Self { @@ -23652,9 +23593,6 @@ pub trait MockServerExt { fn sled_list(&self, config_fn: F) -> ::httpmock::Mock<'_> where F: FnOnce(operations::SledListWhen, operations::SledListThen); - fn sled_add(&self, config_fn: F) -> ::httpmock::Mock<'_> - where - F: FnOnce(operations::SledAddWhen, operations::SledAddThen); fn sled_view(&self, config_fn: F) -> ::httpmock::Mock<'_> where F: FnOnce(operations::SledViewWhen, operations::SledViewThen); @@ -26301,18 +26239,6 @@ impl MockServerExt for ::httpmock::MockServer { }) } - fn sled_add(&self, config_fn: F) -> ::httpmock::Mock<'_> - where - F: FnOnce(operations::SledAddWhen, operations::SledAddThen), - { - self.mock(|when, then| { - config_fn( - operations::SledAddWhen::new(when), - operations::SledAddThen::new(then), - ) - }) - } - fn sled_view(&self, config_fn: F) -> ::httpmock::Mock<'_> where F: FnOnce(operations::SledViewWhen, operations::SledViewThen), diff --git a/sdk/src/generated_sdk.rs b/sdk/src/generated_sdk.rs index 4a2ed202..2b041980 100644 --- a/sdk/src/generated_sdk.rs +++ b/sdk/src/generated_sdk.rs @@ -26853,39 +26853,6 @@ pub mod types { } } - /// The unique ID of a sled. - /// - ///
JSON schema - /// - /// ```json - /// { - /// "description": "The unique ID of a sled.", - /// "type": "object", - /// "required": [ - /// "id" - /// ], - /// "properties": { - /// "id": { - /// "type": "string", - /// "format": "uuid" - /// } - /// } - /// } - /// ``` - ///
- #[derive( - :: serde :: Deserialize, :: serde :: Serialize, Clone, Debug, schemars :: JsonSchema, - )] - pub struct SledId { - pub id: ::uuid::Uuid, - } - - impl SledId { - pub fn builder() -> builder::SledId { - Default::default() - } - } - /// An operator's view of an instance running on a given sled /// ///
JSON schema @@ -32246,43 +32213,6 @@ pub mod types { } } - /// The unique hardware ID for a sled - /// - ///
JSON schema - /// - /// ```json - /// { - /// "description": "The unique hardware ID for a sled", - /// "type": "object", - /// "required": [ - /// "part", - /// "serial" - /// ], - /// "properties": { - /// "part": { - /// "type": "string" - /// }, - /// "serial": { - /// "type": "string" - /// } - /// } - /// } - /// ``` - ///
- #[derive( - :: serde :: Deserialize, :: serde :: Serialize, Clone, Debug, schemars :: JsonSchema, - )] - pub struct UninitializedSledId { - pub part: ::std::string::String, - pub serial: ::std::string::String, - } - - impl UninitializedSledId { - pub fn builder() -> builder::UninitializedSledId { - Default::default() - } - } - /// A single page of results /// ///
JSON schema @@ -57255,47 +57185,6 @@ pub mod types { } } - #[derive(Clone, Debug)] - pub struct SledId { - id: ::std::result::Result<::uuid::Uuid, ::std::string::String>, - } - - impl ::std::default::Default for SledId { - fn default() -> Self { - Self { - id: Err("no value supplied for id".to_string()), - } - } - } - - impl SledId { - pub fn id(mut self, value: T) -> Self - where - T: ::std::convert::TryInto<::uuid::Uuid>, - T::Error: ::std::fmt::Display, - { - self.id = value - .try_into() - .map_err(|e| format!("error converting supplied value for id: {e}")); - self - } - } - - impl ::std::convert::TryFrom for super::SledId { - type Error = super::error::ConversionError; - fn try_from( - value: SledId, - ) -> ::std::result::Result { - Ok(Self { id: value.id? }) - } - } - - impl ::std::convert::From for SledId { - fn from(value: super::SledId) -> Self { - Self { id: Ok(value.id) } - } - } - #[derive(Clone, Debug)] pub struct SledInstance { active_sled_id: ::std::result::Result<::uuid::Uuid, ::std::string::String>, @@ -62244,65 +62133,6 @@ pub mod types { } } - #[derive(Clone, Debug)] - pub struct UninitializedSledId { - part: ::std::result::Result<::std::string::String, ::std::string::String>, - serial: ::std::result::Result<::std::string::String, ::std::string::String>, - } - - impl ::std::default::Default for UninitializedSledId { - fn default() -> Self { - Self { - part: Err("no value supplied for part".to_string()), - serial: Err("no value supplied for serial".to_string()), - } - } - } - - impl UninitializedSledId { - pub fn part(mut self, value: T) -> Self - where - T: ::std::convert::TryInto<::std::string::String>, - T::Error: ::std::fmt::Display, - { - self.part = value - .try_into() - .map_err(|e| format!("error converting supplied value for part: {e}")); - self - } - pub fn serial(mut self, value: T) -> Self - where - T: ::std::convert::TryInto<::std::string::String>, - T::Error: ::std::fmt::Display, - { - self.serial = value - .try_into() - .map_err(|e| format!("error converting supplied value for serial: {e}")); - self - } - } - - impl ::std::convert::TryFrom for super::UninitializedSledId { - type Error = super::error::ConversionError; - fn try_from( - value: UninitializedSledId, - ) -> ::std::result::Result { - Ok(Self { - part: value.part?, - serial: value.serial?, - }) - } - } - - impl ::std::convert::From for UninitializedSledId { - fn from(value: super::UninitializedSledId) -> Self { - Self { - part: Ok(value.part), - serial: Ok(value.serial), - } - } - } - #[derive(Clone, Debug)] pub struct UninitializedSledResultsPage { items: ::std::result::Result< @@ -65676,7 +65506,7 @@ pub mod types { /// /// API for interacting with the Oxide control plane /// -/// Version: 2026021301.0.0 +/// Version: 2026021900.0.0 pub struct Client { pub(crate) baseurl: String, pub(crate) client: reqwest::Client, @@ -65717,7 +65547,7 @@ impl Client { impl ClientInfo<()> for Client { fn api_version() -> &'static str { - "2026021301.0.0" + "2026021900.0.0" } fn baseurl(&self) -> &str { @@ -69302,17 +69132,6 @@ pub trait ClientSystemHardwareExt { /// .await; /// ``` fn sled_list(&self) -> builder::SledList<'_>; - /// Add sled to initialized rack - /// - /// Sends a `POST` request to `/v1/system/hardware/sleds` - /// - /// ```ignore - /// let response = client.sled_add() - /// .body(body) - /// .send() - /// .await; - /// ``` - fn sled_add(&self) -> builder::SledAdd<'_>; /// Fetch sled /// /// Sends a `GET` request to `/v1/system/hardware/sleds/{sled_id}` @@ -69535,10 +69354,6 @@ impl ClientSystemHardwareExt for Client { builder::SledList::new(self) } - fn sled_add(&self) -> builder::SledAdd<'_> { - builder::SledAdd::new(self) - } - fn sled_view(&self) -> builder::SledView<'_> { builder::SledView::new(self) } @@ -91051,88 +90866,6 @@ pub mod builder { } } - /// Builder for [`ClientSystemHardwareExt::sled_add`] - /// - /// [`ClientSystemHardwareExt::sled_add`]: super::ClientSystemHardwareExt::sled_add - #[derive(Debug, Clone)] - pub struct SledAdd<'a> { - client: &'a super::Client, - body: Result, - } - - impl<'a> SledAdd<'a> { - pub fn new(client: &'a super::Client) -> Self { - Self { - client: client, - body: Ok(::std::default::Default::default()), - } - } - - pub fn body(mut self, value: V) -> Self - where - V: std::convert::TryInto, - >::Error: std::fmt::Display, - { - self.body = value - .try_into() - .map(From::from) - .map_err(|s| format!("conversion to `UninitializedSledId` for body failed: {}", s)); - self - } - - pub fn body_map(mut self, f: F) -> Self - where - F: std::ops::FnOnce( - types::builder::UninitializedSledId, - ) -> types::builder::UninitializedSledId, - { - self.body = self.body.map(f); - self - } - - /// Sends a `POST` request to `/v1/system/hardware/sleds` - pub async fn send(self) -> Result, Error> { - let Self { client, body } = self; - let body = body - .and_then(|v| types::UninitializedSledId::try_from(v).map_err(|e| e.to_string())) - .map_err(Error::InvalidRequest)?; - let url = format!("{}/v1/system/hardware/sleds", client.baseurl,); - let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); - header_map.append( - ::reqwest::header::HeaderName::from_static("api-version"), - ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .post(url) - .header( - ::reqwest::header::ACCEPT, - ::reqwest::header::HeaderValue::from_static("application/json"), - ) - .json(&body) - .headers(header_map) - .build()?; - let info = OperationInfo { - operation_id: "sled_add", - }; - client.pre(&mut request, &info).await?; - let result = client.exec(request, &info).await; - client.post(&result, &info).await?; - let response = result?; - match response.status().as_u16() { - 201u16 => ResponseValue::from_response(response).await, - 400u16..=499u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - 500u16..=599u16 => Err(Error::ErrorResponse( - ResponseValue::from_response(response).await?, - )), - _ => Err(Error::UnexpectedResponse(response)), - } - } - } - /// Builder for [`ClientSystemHardwareExt::sled_view`] /// /// [`ClientSystemHardwareExt::sled_view`]: super::ClientSystemHardwareExt::sled_view