diff --git a/Cargo.lock b/Cargo.lock index a16906f0..f3d18129 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -349,7 +349,7 @@ checksum = "16e62a023e7c117e27523144c5d2459f4397fcc3cab0085af8e2224f643a0193" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.51", ] [[package]] @@ -366,7 +366,7 @@ checksum = "c980ee35e870bd1a4d2c8294d4c04d0499e67bca1e4b5cefcc693c2fa00caea9" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.51", ] [[package]] @@ -597,7 +597,7 @@ dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.51", ] [[package]] @@ -877,7 +877,7 @@ dependencies = [ "quote", "serde", "serde_tokenstream", - "syn 2.0.48", + "syn 2.0.51", ] [[package]] @@ -1160,7 +1160,7 @@ checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.51", ] [[package]] @@ -1979,7 +1979,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.51", ] [[package]] @@ -2183,7 +2183,7 @@ checksum = "266c042b60c9c76b8d53061e52b2e0d1116abc57cefc8c5cd671619a56ac3690" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.51", ] [[package]] @@ -2321,7 +2321,7 @@ dependencies = [ [[package]] name = "progenitor" version = "0.5.0" -source = "git+https://github.com/oxidecomputer/progenitor#bc0bb4b0fb40084f189eb1a8807b17fbd0ce0b64" +source = "git+https://github.com/oxidecomputer/progenitor#08bbafc251d3d6828ca5921d1658c3d12d64fe7c" dependencies = [ "progenitor-client 0.5.0 (git+https://github.com/oxidecomputer/progenitor)", "progenitor-impl", @@ -2347,7 +2347,7 @@ dependencies = [ [[package]] name = "progenitor-client" version = "0.5.0" -source = "git+https://github.com/oxidecomputer/progenitor#bc0bb4b0fb40084f189eb1a8807b17fbd0ce0b64" +source = "git+https://github.com/oxidecomputer/progenitor#08bbafc251d3d6828ca5921d1658c3d12d64fe7c" dependencies = [ "bytes", "futures-core", @@ -2361,7 +2361,7 @@ dependencies = [ [[package]] name = "progenitor-impl" version = "0.5.0" -source = "git+https://github.com/oxidecomputer/progenitor#bc0bb4b0fb40084f189eb1a8807b17fbd0ce0b64" +source = "git+https://github.com/oxidecomputer/progenitor#08bbafc251d3d6828ca5921d1658c3d12d64fe7c" dependencies = [ "getopts", "heck", @@ -2374,7 +2374,7 @@ dependencies = [ "schemars", "serde", "serde_json", - "syn 2.0.48", + "syn 2.0.51", "thiserror", "typify", "unicode-ident", @@ -2383,7 +2383,7 @@ dependencies = [ [[package]] name = "progenitor-macro" version = "0.5.0" -source = "git+https://github.com/oxidecomputer/progenitor#bc0bb4b0fb40084f189eb1a8807b17fbd0ce0b64" +source = "git+https://github.com/oxidecomputer/progenitor#08bbafc251d3d6828ca5921d1658c3d12d64fe7c" dependencies = [ "openapiv3", "proc-macro2", @@ -2394,7 +2394,7 @@ dependencies = [ "serde_json", "serde_tokenstream", "serde_yaml", - "syn 2.0.48", + "syn 2.0.51", ] [[package]] @@ -2824,7 +2824,7 @@ checksum = "7eb0b34b42edc17f6b7cac84a52a1c5f0e1bb2227e997ca9011ea3dd34e8610b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.51", ] [[package]] @@ -2887,7 +2887,7 @@ dependencies = [ "proc-macro2", "quote", "serde", - "syn 2.0.48", + "syn 2.0.51", ] [[package]] @@ -3115,9 +3115,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.48" +version = "2.0.51" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f3531638e407dfc0814761abb7c00a5b54992b849452a0646b7f65c9f770f3f" +checksum = "6ab617d94515e94ae53b8406c628598680aa0c9587474ecbe58188f7b345d66c" dependencies = [ "proc-macro2", "quote", @@ -3233,7 +3233,7 @@ checksum = "a953cb265bef375dae3de6663da4d3804eee9682ea80d8e2542529b73c531c81" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.51", ] [[package]] @@ -3344,7 +3344,7 @@ checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.51", ] [[package]] @@ -3477,7 +3477,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.51", ] [[package]] @@ -3533,7 +3533,7 @@ checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" [[package]] name = "typify" version = "0.0.15" -source = "git+https://github.com/oxidecomputer/typify#ce009d6f83b620cbd0e3acdd9b9ea071018471d8" +source = "git+https://github.com/oxidecomputer/typify#78dcbffb83d9faa88153b33503d64c23ec090b95" dependencies = [ "typify-impl", "typify-macro", @@ -3542,7 +3542,7 @@ dependencies = [ [[package]] name = "typify-impl" version = "0.0.15" -source = "git+https://github.com/oxidecomputer/typify#ce009d6f83b620cbd0e3acdd9b9ea071018471d8" +source = "git+https://github.com/oxidecomputer/typify#78dcbffb83d9faa88153b33503d64c23ec090b95" dependencies = [ "heck", "log", @@ -3551,7 +3551,7 @@ dependencies = [ "regress", "schemars", "serde_json", - "syn 2.0.48", + "syn 2.0.51", "thiserror", "unicode-ident", ] @@ -3559,7 +3559,7 @@ dependencies = [ [[package]] name = "typify-macro" version = "0.0.15" -source = "git+https://github.com/oxidecomputer/typify#ce009d6f83b620cbd0e3acdd9b9ea071018471d8" +source = "git+https://github.com/oxidecomputer/typify#78dcbffb83d9faa88153b33503d64c23ec090b95" dependencies = [ "proc-macro2", "quote", @@ -3567,7 +3567,7 @@ dependencies = [ "serde", "serde_json", "serde_tokenstream", - "syn 2.0.48", + "syn 2.0.51", "typify-impl", ] @@ -3750,7 +3750,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.51", "wasm-bindgen-shared", ] @@ -3784,7 +3784,7 @@ checksum = "642f325be6301eb8107a83d12a8ac6c1e1c54345a7ef1a9261962dfefda09e66" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.51", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -4060,7 +4060,7 @@ checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.51", ] [[package]] diff --git a/cli/docs/cli.json b/cli/docs/cli.json index b95907cf..2e6909de 100644 --- a/cli/docs/cli.json +++ b/cli/docs/cli.json @@ -637,11 +637,11 @@ "about": "Create floating IP", "args": [ { - "long": "address", - "help": "An IP address to reserve for use as a floating IP. This field is optional: when not set, an address will be automatically chosen from `pool`. If set, then the IP must be available in the resolved `pool`." + "long": "description" }, { - "long": "description" + "long": "ip", + "help": "An IP address to reserve for use as a floating IP. This field is optional: when not set, an address will be automatically chosen from `pool`. If set, then the IP must be available in the resolved `pool`." }, { "long": "json-body", @@ -2629,8 +2629,8 @@ ] }, { - "name": "set-provision-state", - "about": "Set sled provision state", + "name": "set-provision-policy", + "about": "Set sled provision policy", "args": [ { "long": "json-body", diff --git a/cli/src/cli_builder.rs b/cli/src/cli_builder.rs index 105e19ce..00dd8aa1 100644 --- a/cli/src/cli_builder.rs +++ b/cli/src/cli_builder.rs @@ -455,7 +455,7 @@ fn xxx<'a>(command: CliCommand) -> Option<&'a str> { CliCommand::SledListUninitialized => Some("system hardware sled list-uninitialized"), CliCommand::SledView => Some("system hardware sled view"), CliCommand::SledAdd => Some("system hardware sled add"), - CliCommand::SledSetProvisionState => Some("system hardware sled set-provision-state"), + CliCommand::SledSetProvisionPolicy => Some("system hardware sled set-provision-policy"), CliCommand::SledInstanceList => Some("system hardware sled instance-list"), CliCommand::PhysicalDiskList => Some("system hardware disk list"), CliCommand::SledPhysicalDiskList => Some("system hardware sled disk-led"), diff --git a/cli/src/generated_cli.rs b/cli/src/generated_cli.rs index 85432dcf..421964c4 100644 --- a/cli/src/generated_cli.rs +++ b/cli/src/generated_cli.rs @@ -105,7 +105,7 @@ impl Cli { CliCommand::SledView => Self::cli_sled_view(), CliCommand::SledPhysicalDiskList => Self::cli_sled_physical_disk_list(), CliCommand::SledInstanceList => Self::cli_sled_instance_list(), - CliCommand::SledSetProvisionState => Self::cli_sled_set_provision_state(), + CliCommand::SledSetProvisionPolicy => Self::cli_sled_set_provision_policy(), CliCommand::SledListUninitialized => Self::cli_sled_list_uninitialized(), CliCommand::NetworkingSwitchPortList => Self::cli_networking_switch_port_list(), CliCommand::NetworkingSwitchPortApplySettings => { @@ -806,8 +806,14 @@ impl Cli { pub fn cli_floating_ip_create() -> clap::Command { clap::Command::new("") .arg( - clap::Arg::new("address") - .long("address") + clap::Arg::new("description") + .long("description") + .value_parser(clap::value_parser!(String)) + .required_unless_present("json-body"), + ) + .arg( + clap::Arg::new("ip") + .long("ip") .value_parser(clap::value_parser!(std::net::IpAddr)) .required(false) .help( @@ -816,12 +822,6 @@ impl Cli { `pool`. If set, then the IP must be available in the resolved `pool`.", ), ) - .arg( - clap::Arg::new("description") - .long("description") - .value_parser(clap::value_parser!(String)) - .required_unless_present("json-body"), - ) .arg( clap::Arg::new("name") .long("name") @@ -2741,7 +2741,7 @@ impl Cli { .about("List instances running on given sled") } - pub fn cli_sled_set_provision_state() -> clap::Command { + pub fn cli_sled_set_provision_policy() -> clap::Command { clap::Command::new("") .arg( clap::Arg::new("sled-id") @@ -2755,10 +2755,10 @@ impl Cli { .long("state") .value_parser(clap::builder::TypedValueParser::map( clap::builder::PossibleValuesParser::new([ - types::SledProvisionState::Provisionable.to_string(), - types::SledProvisionState::NonProvisionable.to_string(), + types::SledProvisionPolicy::Provisionable.to_string(), + types::SledProvisionPolicy::NonProvisionable.to_string(), ]), - |s| types::SledProvisionState::try_from(s).unwrap(), + |s| types::SledProvisionPolicy::try_from(s).unwrap(), )) .required_unless_present("json-body") .help("The provision state."), @@ -2777,7 +2777,7 @@ impl Cli { .action(clap::ArgAction::SetTrue) .help("XXX"), ) - .about("Set sled provision state") + .about("Set sled provision policy") } pub fn cli_sled_list_uninitialized() -> clap::Command { @@ -5323,8 +5323,8 @@ impl Cli { 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, - CliCommand::SledSetProvisionState => { - self.execute_sled_set_provision_state(matches).await + CliCommand::SledSetProvisionPolicy => { + self.execute_sled_set_provision_policy(matches).await } CliCommand::SledListUninitialized => { self.execute_sled_list_uninitialized(matches).await @@ -6085,14 +6085,14 @@ impl Cli { matches: &clap::ArgMatches, ) -> anyhow::Result<()> { let mut request = self.client.floating_ip_create(); - if let Some(value) = matches.get_one::("address") { - request = request.body_map(|body| body.address(value.clone())) - } - if let Some(value) = matches.get_one::("description") { request = request.body_map(|body| body.description(value.clone())) } + if let Some(value) = matches.get_one::("ip") { + request = request.body_map(|body| body.ip(value.clone())) + } + if let Some(value) = matches.get_one::("name") { request = request.body_map(|body| body.name(value.clone())) } @@ -8189,28 +8189,28 @@ impl Cli { } } - pub async fn execute_sled_set_provision_state( + pub async fn execute_sled_set_provision_policy( &self, matches: &clap::ArgMatches, ) -> anyhow::Result<()> { - let mut request = self.client.sled_set_provision_state(); + let mut request = self.client.sled_set_provision_policy(); if let Some(value) = matches.get_one::("sled-id") { request = request.sled_id(value.clone()); } - if let Some(value) = matches.get_one::("state") { + if let Some(value) = matches.get_one::("state") { request = request.body_map(|body| body.state(value.clone())) } if let Some(value) = matches.get_one::("json-body") { let body_txt = std::fs::read_to_string(value).unwrap(); let body_value = - serde_json::from_str::(&body_txt).unwrap(); + serde_json::from_str::(&body_txt).unwrap(); request = request.body(body_value); } self.config - .execute_sled_set_provision_state(matches, &mut request)?; + .execute_sled_set_provision_policy(matches, &mut request)?; let result = request.send().await; match result { Ok(r) => { @@ -11693,10 +11693,10 @@ pub trait CliConfig { Ok(()) } - fn execute_sled_set_provision_state( + fn execute_sled_set_provision_policy( &self, matches: &clap::ArgMatches, - request: &mut builder::SledSetProvisionState, + request: &mut builder::SledSetProvisionPolicy, ) -> anyhow::Result<()> { Ok(()) } @@ -12478,7 +12478,7 @@ pub enum CliCommand { SledView, SledPhysicalDiskList, SledInstanceList, - SledSetProvisionState, + SledSetProvisionPolicy, SledListUninitialized, NetworkingSwitchPortList, NetworkingSwitchPortApplySettings, @@ -12656,7 +12656,7 @@ impl CliCommand { CliCommand::SledView, CliCommand::SledPhysicalDiskList, CliCommand::SledInstanceList, - CliCommand::SledSetProvisionState, + CliCommand::SledSetProvisionPolicy, CliCommand::SledListUninitialized, CliCommand::NetworkingSwitchPortList, CliCommand::NetworkingSwitchPortApplySettings, diff --git a/oxide.json b/oxide.json index f42841dc..b0aa84d6 100644 --- a/oxide.json +++ b/oxide.json @@ -4221,13 +4221,13 @@ } } }, - "/v1/system/hardware/sleds/{sled_id}/provision-state": { + "/v1/system/hardware/sleds/{sled_id}/provision-policy": { "put": { "tags": [ "system/hardware" ], - "summary": "Set sled provision state", - "operationId": "sled_set_provision_state", + "summary": "Set sled provision policy", + "operationId": "sled_set_provision_policy", "parameters": [ { "in": "path", @@ -4244,7 +4244,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/SledProvisionStateParams" + "$ref": "#/components/schemas/SledProvisionPolicyParams" } } }, @@ -4256,7 +4256,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/SledProvisionStateResponse" + "$ref": "#/components/schemas/SledProvisionPolicyResponse" } } } @@ -11864,15 +11864,15 @@ "description": "Parameters for creating a new floating IP address for instances.", "type": "object", "properties": { - "address": { + "description": { + "type": "string" + }, + "ip": { "nullable": true, "description": "An IP address to reserve for use as a floating IP. This field is optional: when not set, an address will be automatically chosen from `pool`. If set, then the IP must be available in the resolved `pool`.", "type": "string", "format": "ip" }, - "description": { - "type": "string" - }, "name": { "$ref": "#/components/schemas/Name" }, @@ -14839,11 +14839,11 @@ "type": "string", "format": "uuid" }, - "provision_state": { - "description": "The provision state of the sled.", + "policy": { + "description": "The operator-defined policy of a sled.", "allOf": [ { - "$ref": "#/components/schemas/SledProvisionState" + "$ref": "#/components/schemas/SledPolicy" } ] }, @@ -14852,6 +14852,14 @@ "type": "string", "format": "uuid" }, + "state": { + "description": "The current state Nexus believes the sled to be in.", + "allOf": [ + { + "$ref": "#/components/schemas/SledState" + } + ] + }, "time_created": { "description": "timestamp when this resource was created", "type": "string", @@ -14880,8 +14888,9 @@ "required": [ "baseboard", "id", - "provision_state", + "policy", "rack_id", + "state", "time_created", "time_modified", "usable_hardware_threads", @@ -14971,8 +14980,52 @@ "items" ] }, - "SledProvisionState": { - "description": "The provision state of a sled.\n\nThis controls whether new resources are going to be provisioned on this sled.", + "SledPolicy": { + "description": "The operator-defined policy of a sled.", + "oneOf": [ + { + "description": "The operator has indicated that the sled is in-service.", + "type": "object", + "properties": { + "kind": { + "type": "string", + "enum": [ + "in_service" + ] + }, + "provision_policy": { + "description": "Determines whether new resources can be provisioned onto the sled.", + "allOf": [ + { + "$ref": "#/components/schemas/SledProvisionPolicy" + } + ] + } + }, + "required": [ + "kind", + "provision_policy" + ] + }, + { + "description": "The operator has indicated that the sled has been permanently removed from service.\n\nThis is a terminal state: once a particular sled ID is expunged, it will never return to service. (The actual hardware may be reused, but it will be treated as a brand-new sled.)\n\nAn expunged sled is always non-provisionable.", + "type": "object", + "properties": { + "kind": { + "type": "string", + "enum": [ + "expunged" + ] + } + }, + "required": [ + "kind" + ] + } + ] + }, + "SledProvisionPolicy": { + "description": "The operator-defined provision policy of a sled.\n\nThis controls whether new resources are going to be provisioned on this sled.", "oneOf": [ { "description": "New resources will be provisioned on this sled.", @@ -14982,7 +15035,7 @@ ] }, { - "description": "New resources will not be provisioned on this sled. However, existing resources will continue to be on this sled unless manually migrated off.", + "description": "New resources will not be provisioned on this sled. However, if the sled is currently in service, existing resources will continue to be on this sled unless manually migrated off.", "type": "string", "enum": [ "non_provisionable" @@ -14990,15 +15043,15 @@ } ] }, - "SledProvisionStateParams": { - "description": "Parameters for `sled_set_provision_state`.", + "SledProvisionPolicyParams": { + "description": "Parameters for `sled_set_provision_policy`.", "type": "object", "properties": { "state": { "description": "The provision state.", "allOf": [ { - "$ref": "#/components/schemas/SledProvisionState" + "$ref": "#/components/schemas/SledProvisionPolicy" } ] } @@ -15007,15 +15060,15 @@ "state" ] }, - "SledProvisionStateResponse": { - "description": "Response to `sled_set_provision_state`.", + "SledProvisionPolicyResponse": { + "description": "Response to `sled_set_provision_policy`.", "type": "object", "properties": { "new_state": { "description": "The new provision state.", "allOf": [ { - "$ref": "#/components/schemas/SledProvisionState" + "$ref": "#/components/schemas/SledProvisionPolicy" } ] }, @@ -15023,7 +15076,7 @@ "description": "The old provision state.", "allOf": [ { - "$ref": "#/components/schemas/SledProvisionState" + "$ref": "#/components/schemas/SledProvisionPolicy" } ] } @@ -15054,6 +15107,25 @@ "items" ] }, + "SledState": { + "description": "The current state of the sled, as determined by Nexus.", + "oneOf": [ + { + "description": "The sled is currently active, and has resources allocated on it.", + "type": "string", + "enum": [ + "active" + ] + }, + { + "description": "The sled has been permanently removed from service.\n\nThis is a terminal state: once a particular sled ID is decommissioned, it will never return to service. (The actual hardware may be reused, but it will be treated as a brand-new sled.)", + "type": "string", + "enum": [ + "decommissioned" + ] + } + ] + }, "Snapshot": { "description": "View of a Snapshot", "type": "object", diff --git a/sdk-httpmock/src/generated_httpmock.rs b/sdk-httpmock/src/generated_httpmock.rs index 5ee4d17d..dd060516 100644 --- a/sdk-httpmock/src/generated_httpmock.rs +++ b/sdk-httpmock/src/generated_httpmock.rs @@ -6952,11 +6952,11 @@ pub mod operations { } } - pub struct SledSetProvisionStateWhen(httpmock::When); - impl SledSetProvisionStateWhen { + pub struct SledSetProvisionPolicyWhen(httpmock::When); + impl SledSetProvisionPolicyWhen { pub fn new(inner: httpmock::When) -> Self { Self(inner.method(httpmock::Method::PUT).path_matches( - regex::Regex::new("^/v1/system/hardware/sleds/[^/]*/provision-state$").unwrap(), + regex::Regex::new("^/v1/system/hardware/sleds/[^/]*/provision-policy$").unwrap(), )) } @@ -6966,20 +6966,20 @@ pub mod operations { pub fn sled_id(self, value: &uuid::Uuid) -> Self { let re = regex::Regex::new(&format!( - "^/v1/system/hardware/sleds/{}/provision-state$", + "^/v1/system/hardware/sleds/{}/provision-policy$", value.to_string() )) .unwrap(); Self(self.0.path_matches(re)) } - pub fn body(self, value: &types::SledProvisionStateParams) -> Self { + pub fn body(self, value: &types::SledProvisionPolicyParams) -> Self { Self(self.0.json_body_obj(value)) } } - pub struct SledSetProvisionStateThen(httpmock::Then); - impl SledSetProvisionStateThen { + pub struct SledSetProvisionPolicyThen(httpmock::Then); + impl SledSetProvisionPolicyThen { pub fn new(inner: httpmock::Then) -> Self { Self(inner) } @@ -6988,7 +6988,7 @@ pub mod operations { self.0 } - pub fn ok(self, value: &types::SledProvisionStateResponse) -> Self { + pub fn ok(self, value: &types::SledProvisionPolicyResponse) -> Self { Self( self.0 .status(200u16) @@ -14004,9 +14004,9 @@ pub trait MockServerExt { fn sled_instance_list(&self, config_fn: F) -> httpmock::Mock where F: FnOnce(operations::SledInstanceListWhen, operations::SledInstanceListThen); - fn sled_set_provision_state(&self, config_fn: F) -> httpmock::Mock + fn sled_set_provision_policy(&self, config_fn: F) -> httpmock::Mock where - F: FnOnce(operations::SledSetProvisionStateWhen, operations::SledSetProvisionStateThen); + F: FnOnce(operations::SledSetProvisionPolicyWhen, operations::SledSetProvisionPolicyThen); fn sled_list_uninitialized(&self, config_fn: F) -> httpmock::Mock where F: FnOnce(operations::SledListUninitializedWhen, operations::SledListUninitializedThen); @@ -15405,14 +15405,14 @@ impl MockServerExt for httpmock::MockServer { }) } - fn sled_set_provision_state(&self, config_fn: F) -> httpmock::Mock + fn sled_set_provision_policy(&self, config_fn: F) -> httpmock::Mock where - F: FnOnce(operations::SledSetProvisionStateWhen, operations::SledSetProvisionStateThen), + F: FnOnce(operations::SledSetProvisionPolicyWhen, operations::SledSetProvisionPolicyThen), { self.mock(|when, then| { config_fn( - operations::SledSetProvisionStateWhen::new(when), - operations::SledSetProvisionStateThen::new(then), + operations::SledSetProvisionPolicyWhen::new(when), + operations::SledSetProvisionPolicyThen::new(then), ) }) } diff --git a/sdk/src/generated_sdk.rs b/sdk/src/generated_sdk.rs index 702c5adf..c8ba9f9c 100644 --- a/sdk/src/generated_sdk.rs +++ b/sdk/src/generated_sdk.rs @@ -2,6 +2,7 @@ #[allow(unused_imports)] use progenitor_client::{encode_path, RequestBuilderExt}; +#[allow(unused_imports)] pub use progenitor_client::{ByteStream, Error, ResponseValue}; #[allow(unused_imports)] use reqwest::header::{HeaderMap, HeaderValue}; @@ -6975,7 +6976,10 @@ pub mod types { /// "name" /// ], /// "properties": { - /// "address": { + /// "description": { + /// "type": "string" + /// }, + /// "ip": { /// "description": "An IP address to reserve for use as a floating IP. /// This field is optional: when not set, an address will be automatically /// chosen from `pool`. If set, then the IP must be available in the @@ -6986,9 +6990,6 @@ pub mod types { /// ], /// "format": "ip" /// }, - /// "description": { - /// "type": "string" - /// }, /// "name": { /// "$ref": "#/components/schemas/Name" /// }, @@ -7007,13 +7008,13 @@ pub mod types { /// #[derive(Clone, Debug, Deserialize, Serialize, schemars :: JsonSchema)] pub struct FloatingIpCreate { + pub description: String, /// An IP address to reserve for use as a floating IP. This field is /// optional: when not set, an address will be automatically chosen from /// `pool`. If set, then the IP must be available in the resolved /// `pool`. #[serde(default, skip_serializing_if = "Option::is_none")] - pub address: Option, - pub description: String, + pub ip: Option, pub name: Name, /// The parent IP pool that a floating IP is pulled from. If unset, the /// default pool is selected. @@ -15242,8 +15243,9 @@ pub mod types { /// "required": [ /// "baseboard", /// "id", - /// "provision_state", + /// "policy", /// "rack_id", + /// "state", /// "time_created", /// "time_modified", /// "usable_hardware_threads", @@ -15259,11 +15261,11 @@ pub mod types { /// "type": "string", /// "format": "uuid" /// }, - /// "provision_state": { - /// "description": "The provision state of the sled.", + /// "policy": { + /// "description": "The operator-defined policy of a sled.", /// "allOf": [ /// { - /// "$ref": "#/components/schemas/SledProvisionState" + /// "$ref": "#/components/schemas/SledPolicy" /// } /// ] /// }, @@ -15272,6 +15274,15 @@ pub mod types { /// "type": "string", /// "format": "uuid" /// }, + /// "state": { + /// "description": "The current state Nexus believes the sled to be + /// in.", + /// "allOf": [ + /// { + /// "$ref": "#/components/schemas/SledState" + /// } + /// ] + /// }, /// "time_created": { /// "description": "timestamp when this resource was created", /// "type": "string", @@ -15306,10 +15317,12 @@ pub mod types { pub baseboard: Baseboard, /// unique, immutable, system-controlled identifier for each resource pub id: uuid::Uuid, - /// The provision state of the sled. - pub provision_state: SledProvisionState, + /// The operator-defined policy of a sled. + pub policy: SledPolicy, /// The rack to which this Sled is currently attached pub rack_id: uuid::Uuid, + /// The current state Nexus believes the sled to be in. + pub state: SledState, /// timestamp when this resource was created pub time_created: chrono::DateTime, /// timestamp when this resource was last modified @@ -15488,7 +15501,86 @@ pub mod types { } } - /// The provision state of a sled. + /// The operator-defined policy of a sled. + /// + ///
JSON schema + /// + /// ```json + /// { + /// "description": "The operator-defined policy of a sled.", + /// "oneOf": [ + /// { + /// "description": "The operator has indicated that the sled is + /// in-service.", + /// "type": "object", + /// "required": [ + /// "kind", + /// "provision_policy" + /// ], + /// "properties": { + /// "kind": { + /// "type": "string", + /// "enum": [ + /// "in_service" + /// ] + /// }, + /// "provision_policy": { + /// "description": "Determines whether new resources can be + /// provisioned onto the sled.", + /// "allOf": [ + /// { + /// "$ref": "#/components/schemas/SledProvisionPolicy" + /// } + /// ] + /// } + /// } + /// }, + /// { + /// "description": "The operator has indicated that the sled has been + /// permanently removed from service.\n\nThis is a terminal state: once a + /// particular sled ID is expunged, it will never return to service. (The + /// actual hardware may be reused, but it will be treated as a brand-new + /// sled.)\n\nAn expunged sled is always non-provisionable.", + /// "type": "object", + /// "required": [ + /// "kind" + /// ], + /// "properties": { + /// "kind": { + /// "type": "string", + /// "enum": [ + /// "expunged" + /// ] + /// } + /// } + /// } + /// ] + /// } + /// ``` + ///
+ #[derive(Clone, Debug, Deserialize, Serialize, schemars :: JsonSchema)] + #[serde(tag = "kind", content = "provision_policy")] + pub enum SledPolicy { + /// The operator has indicated that the sled is in-service. + #[serde(rename = "in_service")] + InService(SledProvisionPolicy), + #[serde(rename = "expunged")] + Expunged, + } + + impl From<&SledPolicy> for SledPolicy { + fn from(value: &SledPolicy) -> Self { + value.clone() + } + } + + impl From for SledPolicy { + fn from(value: SledProvisionPolicy) -> Self { + Self::InService(value) + } + } + + /// The operator-defined provision policy of a sled. /// /// This controls whether new resources are going to be provisioned on this /// sled. @@ -15497,8 +15589,9 @@ pub mod types { /// /// ```json /// { - /// "description": "The provision state of a sled.\n\nThis controls whether - /// new resources are going to be provisioned on this sled.", + /// "description": "The operator-defined provision policy of a + /// sled.\n\nThis controls whether new resources are going to be provisioned + /// on this sled.", /// "oneOf": [ /// { /// "description": "New resources will be provisioned on this sled.", @@ -15509,8 +15602,8 @@ pub mod types { /// }, /// { /// "description": "New resources will not be provisioned on this sled. - /// However, existing resources will continue to be on this sled unless - /// manually migrated off.", + /// However, if the sled is currently in service, existing resources will + /// continue to be on this sled unless manually migrated off.", /// "type": "string", /// "enum": [ /// "non_provisionable" @@ -15533,24 +15626,24 @@ pub mod types { Serialize, schemars :: JsonSchema, )] - pub enum SledProvisionState { + pub enum SledProvisionPolicy { /// New resources will be provisioned on this sled. #[serde(rename = "provisionable")] Provisionable, - /// New resources will not be provisioned on this sled. However, - /// existing resources will continue to be on this sled unless manually - /// migrated off. + /// New resources will not be provisioned on this sled. However, if the + /// sled is currently in service, existing resources will continue to be + /// on this sled unless manually migrated off. #[serde(rename = "non_provisionable")] NonProvisionable, } - impl From<&SledProvisionState> for SledProvisionState { - fn from(value: &SledProvisionState) -> Self { + impl From<&SledProvisionPolicy> for SledProvisionPolicy { + fn from(value: &SledProvisionPolicy) -> Self { value.clone() } } - impl ToString for SledProvisionState { + impl ToString for SledProvisionPolicy { fn to_string(&self) -> String { match *self { Self::Provisionable => "provisionable".to_string(), @@ -15559,7 +15652,7 @@ pub mod types { } } - impl std::str::FromStr for SledProvisionState { + impl std::str::FromStr for SledProvisionPolicy { type Err = self::error::ConversionError; fn from_str(value: &str) -> Result { match value { @@ -15570,34 +15663,34 @@ pub mod types { } } - impl std::convert::TryFrom<&str> for SledProvisionState { + impl std::convert::TryFrom<&str> for SledProvisionPolicy { type Error = self::error::ConversionError; fn try_from(value: &str) -> Result { value.parse() } } - impl std::convert::TryFrom<&String> for SledProvisionState { + impl std::convert::TryFrom<&String> for SledProvisionPolicy { type Error = self::error::ConversionError; fn try_from(value: &String) -> Result { value.parse() } } - impl std::convert::TryFrom for SledProvisionState { + impl std::convert::TryFrom for SledProvisionPolicy { type Error = self::error::ConversionError; fn try_from(value: String) -> Result { value.parse() } } - /// Parameters for `sled_set_provision_state`. + /// Parameters for `sled_set_provision_policy`. /// ///
JSON schema /// /// ```json /// { - /// "description": "Parameters for `sled_set_provision_state`.", + /// "description": "Parameters for `sled_set_provision_policy`.", /// "type": "object", /// "required": [ /// "state" @@ -15607,7 +15700,7 @@ pub mod types { /// "description": "The provision state.", /// "allOf": [ /// { - /// "$ref": "#/components/schemas/SledProvisionState" + /// "$ref": "#/components/schemas/SledProvisionPolicy" /// } /// ] /// } @@ -15616,30 +15709,30 @@ pub mod types { /// ``` ///
#[derive(Clone, Debug, Deserialize, Serialize, schemars :: JsonSchema)] - pub struct SledProvisionStateParams { + pub struct SledProvisionPolicyParams { /// The provision state. - pub state: SledProvisionState, + pub state: SledProvisionPolicy, } - impl From<&SledProvisionStateParams> for SledProvisionStateParams { - fn from(value: &SledProvisionStateParams) -> Self { + impl From<&SledProvisionPolicyParams> for SledProvisionPolicyParams { + fn from(value: &SledProvisionPolicyParams) -> Self { value.clone() } } - impl SledProvisionStateParams { - pub fn builder() -> builder::SledProvisionStateParams { + impl SledProvisionPolicyParams { + pub fn builder() -> builder::SledProvisionPolicyParams { Default::default() } } - /// Response to `sled_set_provision_state`. + /// Response to `sled_set_provision_policy`. /// ///
JSON schema /// /// ```json /// { - /// "description": "Response to `sled_set_provision_state`.", + /// "description": "Response to `sled_set_provision_policy`.", /// "type": "object", /// "required": [ /// "new_state", @@ -15650,7 +15743,7 @@ pub mod types { /// "description": "The new provision state.", /// "allOf": [ /// { - /// "$ref": "#/components/schemas/SledProvisionState" + /// "$ref": "#/components/schemas/SledProvisionPolicy" /// } /// ] /// }, @@ -15658,7 +15751,7 @@ pub mod types { /// "description": "The old provision state.", /// "allOf": [ /// { - /// "$ref": "#/components/schemas/SledProvisionState" + /// "$ref": "#/components/schemas/SledProvisionPolicy" /// } /// ] /// } @@ -15667,21 +15760,21 @@ pub mod types { /// ``` ///
#[derive(Clone, Debug, Deserialize, Serialize, schemars :: JsonSchema)] - pub struct SledProvisionStateResponse { + pub struct SledProvisionPolicyResponse { /// The new provision state. - pub new_state: SledProvisionState, + pub new_state: SledProvisionPolicy, /// The old provision state. - pub old_state: SledProvisionState, + pub old_state: SledProvisionPolicy, } - impl From<&SledProvisionStateResponse> for SledProvisionStateResponse { - fn from(value: &SledProvisionStateResponse) -> Self { + impl From<&SledProvisionPolicyResponse> for SledProvisionPolicyResponse { + fn from(value: &SledProvisionPolicyResponse) -> Self { value.clone() } } - impl SledProvisionStateResponse { - pub fn builder() -> builder::SledProvisionStateResponse { + impl SledProvisionPolicyResponse { + pub fn builder() -> builder::SledProvisionPolicyResponse { Default::default() } } @@ -15738,6 +15831,110 @@ pub mod types { } } + /// The current state of the sled, as determined by Nexus. + /// + ///
JSON schema + /// + /// ```json + /// { + /// "description": "The current state of the sled, as determined by + /// Nexus.", + /// "oneOf": [ + /// { + /// "description": "The sled is currently active, and has resources + /// allocated on it.", + /// "type": "string", + /// "enum": [ + /// "active" + /// ] + /// }, + /// { + /// "description": "The sled has been permanently removed from + /// service.\n\nThis is a terminal state: once a particular sled ID is + /// decommissioned, it will never return to service. (The actual hardware + /// may be reused, but it will be treated as a brand-new sled.)", + /// "type": "string", + /// "enum": [ + /// "decommissioned" + /// ] + /// } + /// ] + /// } + /// ``` + ///
+ #[derive( + Clone, + Copy, + Debug, + Deserialize, + Eq, + Hash, + Ord, + PartialEq, + PartialOrd, + Serialize, + schemars :: JsonSchema, + )] + pub enum SledState { + /// The sled is currently active, and has resources allocated on it. + #[serde(rename = "active")] + Active, + /// The sled has been permanently removed from service. + /// + /// This is a terminal state: once a particular sled ID is + /// decommissioned, it will never return to service. (The actual + /// hardware may be reused, but it will be treated as a brand-new sled.) + #[serde(rename = "decommissioned")] + Decommissioned, + } + + impl From<&SledState> for SledState { + fn from(value: &SledState) -> Self { + value.clone() + } + } + + impl ToString for SledState { + fn to_string(&self) -> String { + match *self { + Self::Active => "active".to_string(), + Self::Decommissioned => "decommissioned".to_string(), + } + } + } + + impl std::str::FromStr for SledState { + type Err = self::error::ConversionError; + fn from_str(value: &str) -> Result { + match value { + "active" => Ok(Self::Active), + "decommissioned" => Ok(Self::Decommissioned), + _ => Err("invalid value".into()), + } + } + } + + impl std::convert::TryFrom<&str> for SledState { + type Error = self::error::ConversionError; + fn try_from(value: &str) -> Result { + value.parse() + } + } + + impl std::convert::TryFrom<&String> for SledState { + type Error = self::error::ConversionError; + fn try_from(value: &String) -> Result { + value.parse() + } + } + + impl std::convert::TryFrom for SledState { + type Error = self::error::ConversionError; + fn try_from(value: String) -> Result { + value.parse() + } + } + /// View of a Snapshot /// ///
JSON schema @@ -24786,8 +24983,8 @@ pub mod types { #[derive(Clone, Debug)] pub struct FloatingIpCreate { - address: Result, String>, description: Result, + ip: Result, String>, name: Result, pool: Result, String>, } @@ -24795,8 +24992,8 @@ pub mod types { impl Default for FloatingIpCreate { fn default() -> Self { Self { - address: Ok(Default::default()), description: Err("no value supplied for description".to_string()), + ip: Ok(Default::default()), name: Err("no value supplied for name".to_string()), pool: Ok(Default::default()), } @@ -24804,24 +25001,24 @@ pub mod types { } impl FloatingIpCreate { - pub fn address(mut self, value: T) -> Self + pub fn description(mut self, value: T) -> Self where - T: std::convert::TryInto>, + T: std::convert::TryInto, T::Error: std::fmt::Display, { - self.address = value + self.description = value .try_into() - .map_err(|e| format!("error converting supplied value for address: {}", e)); + .map_err(|e| format!("error converting supplied value for description: {}", e)); self } - pub fn description(mut self, value: T) -> Self + pub fn ip(mut self, value: T) -> Self where - T: std::convert::TryInto, + T: std::convert::TryInto>, T::Error: std::fmt::Display, { - self.description = value + self.ip = value .try_into() - .map_err(|e| format!("error converting supplied value for description: {}", e)); + .map_err(|e| format!("error converting supplied value for ip: {}", e)); self } pub fn name(mut self, value: T) -> Self @@ -24850,8 +25047,8 @@ pub mod types { type Error = super::error::ConversionError; fn try_from(value: FloatingIpCreate) -> Result { Ok(Self { - address: value.address?, description: value.description?, + ip: value.ip?, name: value.name?, pool: value.pool?, }) @@ -24861,8 +25058,8 @@ pub mod types { impl From for FloatingIpCreate { fn from(value: super::FloatingIpCreate) -> Self { Self { - address: Ok(value.address), description: Ok(value.description), + ip: Ok(value.ip), name: Ok(value.name), pool: Ok(value.pool), } @@ -31196,8 +31393,9 @@ pub mod types { pub struct Sled { baseboard: Result, id: Result, - provision_state: Result, + policy: Result, rack_id: Result, + state: Result, time_created: Result, String>, time_modified: Result, String>, usable_hardware_threads: Result, @@ -31209,8 +31407,9 @@ pub mod types { Self { baseboard: Err("no value supplied for baseboard".to_string()), id: Err("no value supplied for id".to_string()), - provision_state: Err("no value supplied for provision_state".to_string()), + policy: Err("no value supplied for policy".to_string()), rack_id: Err("no value supplied for rack_id".to_string()), + state: Err("no value supplied for state".to_string()), time_created: Err("no value supplied for time_created".to_string()), time_modified: Err("no value supplied for time_modified".to_string()), usable_hardware_threads: Err( @@ -31244,14 +31443,14 @@ pub mod types { .map_err(|e| format!("error converting supplied value for id: {}", e)); self } - pub fn provision_state(mut self, value: T) -> Self + pub fn policy(mut self, value: T) -> Self where - T: std::convert::TryInto, + T: std::convert::TryInto, T::Error: std::fmt::Display, { - self.provision_state = value.try_into().map_err(|e| { - format!("error converting supplied value for provision_state: {}", e) - }); + self.policy = value + .try_into() + .map_err(|e| format!("error converting supplied value for policy: {}", e)); self } pub fn rack_id(mut self, value: T) -> Self @@ -31264,6 +31463,16 @@ pub mod types { .map_err(|e| format!("error converting supplied value for rack_id: {}", e)); self } + pub fn state(mut self, value: T) -> Self + where + T: std::convert::TryInto, + T::Error: std::fmt::Display, + { + self.state = value + .try_into() + .map_err(|e| format!("error converting supplied value for state: {}", e)); + self + } pub fn time_created(mut self, value: T) -> Self where T: std::convert::TryInto>, @@ -31318,8 +31527,9 @@ pub mod types { Ok(Self { baseboard: value.baseboard?, id: value.id?, - provision_state: value.provision_state?, + policy: value.policy?, rack_id: value.rack_id?, + state: value.state?, time_created: value.time_created?, time_modified: value.time_modified?, usable_hardware_threads: value.usable_hardware_threads?, @@ -31333,8 +31543,9 @@ pub mod types { Self { baseboard: Ok(value.baseboard), id: Ok(value.id), - provision_state: Ok(value.provision_state), + policy: Ok(value.policy), rack_id: Ok(value.rack_id), + state: Ok(value.state), time_created: Ok(value.time_created), time_modified: Ok(value.time_modified), usable_hardware_threads: Ok(value.usable_hardware_threads), @@ -31586,11 +31797,11 @@ pub mod types { } #[derive(Clone, Debug)] - pub struct SledProvisionStateParams { - state: Result, + pub struct SledProvisionPolicyParams { + state: Result, } - impl Default for SledProvisionStateParams { + impl Default for SledProvisionPolicyParams { fn default() -> Self { Self { state: Err("no value supplied for state".to_string()), @@ -31598,10 +31809,10 @@ pub mod types { } } - impl SledProvisionStateParams { + impl SledProvisionPolicyParams { pub fn state(mut self, value: T) -> Self where - T: std::convert::TryInto, + T: std::convert::TryInto, T::Error: std::fmt::Display, { self.state = value @@ -31611,10 +31822,10 @@ pub mod types { } } - impl std::convert::TryFrom for super::SledProvisionStateParams { + impl std::convert::TryFrom for super::SledProvisionPolicyParams { type Error = super::error::ConversionError; fn try_from( - value: SledProvisionStateParams, + value: SledProvisionPolicyParams, ) -> Result { Ok(Self { state: value.state?, @@ -31622,8 +31833,8 @@ pub mod types { } } - impl From for SledProvisionStateParams { - fn from(value: super::SledProvisionStateParams) -> Self { + impl From for SledProvisionPolicyParams { + fn from(value: super::SledProvisionPolicyParams) -> Self { Self { state: Ok(value.state), } @@ -31631,12 +31842,12 @@ pub mod types { } #[derive(Clone, Debug)] - pub struct SledProvisionStateResponse { - new_state: Result, - old_state: Result, + pub struct SledProvisionPolicyResponse { + new_state: Result, + old_state: Result, } - impl Default for SledProvisionStateResponse { + impl Default for SledProvisionPolicyResponse { fn default() -> Self { Self { new_state: Err("no value supplied for new_state".to_string()), @@ -31645,10 +31856,10 @@ pub mod types { } } - impl SledProvisionStateResponse { + impl SledProvisionPolicyResponse { pub fn new_state(mut self, value: T) -> Self where - T: std::convert::TryInto, + T: std::convert::TryInto, T::Error: std::fmt::Display, { self.new_state = value @@ -31658,7 +31869,7 @@ pub mod types { } pub fn old_state(mut self, value: T) -> Self where - T: std::convert::TryInto, + T: std::convert::TryInto, T::Error: std::fmt::Display, { self.old_state = value @@ -31668,10 +31879,10 @@ pub mod types { } } - impl std::convert::TryFrom for super::SledProvisionStateResponse { + impl std::convert::TryFrom for super::SledProvisionPolicyResponse { type Error = super::error::ConversionError; fn try_from( - value: SledProvisionStateResponse, + value: SledProvisionPolicyResponse, ) -> Result { Ok(Self { new_state: value.new_state?, @@ -31680,8 +31891,8 @@ pub mod types { } } - impl From for SledProvisionStateResponse { - fn from(value: super::SledProvisionStateResponse) -> Self { + impl From for SledProvisionPolicyResponse { + fn from(value: super::SledProvisionPolicyResponse) -> Self { Self { new_state: Ok(value.new_state), old_state: Ok(value.old_state), @@ -37851,22 +38062,22 @@ pub trait ClientSystemHardwareExt { /// .await; /// ``` fn sled_instance_list(&self) -> builder::SledInstanceList; - /// Set sled provision state + /// Set sled provision policy /// /// Sends a `PUT` request to - /// `/v1/system/hardware/sleds/{sled_id}/provision-state` + /// `/v1/system/hardware/sleds/{sled_id}/provision-policy` /// /// Arguments: /// - `sled_id`: ID of the sled /// - `body` /// ```ignore - /// let response = client.sled_set_provision_state() + /// let response = client.sled_set_provision_policy() /// .sled_id(sled_id) /// .body(body) /// .send() /// .await; /// ``` - fn sled_set_provision_state(&self) -> builder::SledSetProvisionState; + fn sled_set_provision_policy(&self) -> builder::SledSetProvisionPolicy; /// List uninitialized sleds /// /// Sends a `GET` request to `/v1/system/hardware/sleds-uninitialized` @@ -38010,8 +38221,8 @@ impl ClientSystemHardwareExt for Client { builder::SledInstanceList::new(self) } - fn sled_set_provision_state(&self) -> builder::SledSetProvisionState { - builder::SledSetProvisionState::new(self) + fn sled_set_provision_policy(&self) -> builder::SledSetProvisionPolicy { + builder::SledSetProvisionPolicy::new(self) } fn sled_list_uninitialized(&self) -> builder::SledListUninitialized { @@ -48651,22 +48862,22 @@ pub mod builder { } } - /// Builder for [`ClientSystemHardwareExt::sled_set_provision_state`] + /// Builder for [`ClientSystemHardwareExt::sled_set_provision_policy`] /// - /// [`ClientSystemHardwareExt::sled_set_provision_state`]: super::ClientSystemHardwareExt::sled_set_provision_state + /// [`ClientSystemHardwareExt::sled_set_provision_policy`]: super::ClientSystemHardwareExt::sled_set_provision_policy #[derive(Debug, Clone)] - pub struct SledSetProvisionState<'a> { + pub struct SledSetProvisionPolicy<'a> { client: &'a super::Client, sled_id: Result, - body: Result, + body: Result, } - impl<'a> SledSetProvisionState<'a> { + impl<'a> SledSetProvisionPolicy<'a> { pub fn new(client: &'a super::Client) -> Self { Self { client: client, sled_id: Err("sled_id was not initialized".to_string()), - body: Ok(types::builder::SledProvisionStateParams::default()), + body: Ok(types::builder::SledProvisionPolicyParams::default()), } } @@ -48682,12 +48893,13 @@ pub mod builder { pub fn body(mut self, value: V) -> Self where - V: std::convert::TryInto, - >::Error: std::fmt::Display, + V: std::convert::TryInto, + >::Error: + std::fmt::Display, { self.body = value.try_into().map(From::from).map_err(|s| { format!( - "conversion to `SledProvisionStateParams` for body failed: {}", + "conversion to `SledProvisionPolicyParams` for body failed: {}", s ) }); @@ -48697,18 +48909,19 @@ pub mod builder { pub fn body_map(mut self, f: F) -> Self where F: std::ops::FnOnce( - types::builder::SledProvisionStateParams, - ) -> types::builder::SledProvisionStateParams, + types::builder::SledProvisionPolicyParams, + ) -> types::builder::SledProvisionPolicyParams, { self.body = self.body.map(f); self } /// Sends a `PUT` request to - /// `/v1/system/hardware/sleds/{sled_id}/provision-state` + /// `/v1/system/hardware/sleds/{sled_id}/provision-policy` pub async fn send( self, - ) -> Result, Error> { + ) -> Result, Error> + { let Self { client, sled_id, @@ -48717,11 +48930,11 @@ pub mod builder { let sled_id = sled_id.map_err(Error::InvalidRequest)?; let body = body .and_then(|v| { - types::SledProvisionStateParams::try_from(v).map_err(|e| e.to_string()) + types::SledProvisionPolicyParams::try_from(v).map_err(|e| e.to_string()) }) .map_err(Error::InvalidRequest)?; let url = format!( - "{}/v1/system/hardware/sleds/{}/provision-state", + "{}/v1/system/hardware/sleds/{}/provision-policy", client.baseurl, encode_path(&sled_id.to_string()), ); @@ -57666,6 +57879,7 @@ pub mod builder { /// Items consumers will typically use such as the Client and /// extension traits. pub mod prelude { + #[allow(unused_imports)] pub use super::Client; pub use super::ClientDisksExt; pub use super::ClientFloatingIpsExt;