diff --git a/Cargo.lock b/Cargo.lock index 099a99eb..f4791181 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3000,7 +3000,7 @@ dependencies = [ [[package]] name = "progenitor" version = "0.14.0" -source = "git+https://github.com/oxidecomputer/progenitor#1a5b88f727afaa20c8c19b6aacc87e911a6045b2" +source = "git+https://github.com/oxidecomputer/progenitor#a644439074df0c962727e8da920b5a191b6b32eb" dependencies = [ "progenitor-impl", ] @@ -3023,7 +3023,7 @@ dependencies = [ [[package]] name = "progenitor-impl" version = "0.14.0" -source = "git+https://github.com/oxidecomputer/progenitor#1a5b88f727afaa20c8c19b6aacc87e911a6045b2" +source = "git+https://github.com/oxidecomputer/progenitor#a644439074df0c962727e8da920b5a191b6b32eb" dependencies = [ "heck", "http 1.4.0", diff --git a/cli/src/generated_cli.rs b/cli/src/generated_cli.rs index 5efe48d0..408fb9f6 100644 --- a/cli/src/generated_cli.rs +++ b/cli/src/generated_cli.rs @@ -196,8 +196,14 @@ impl Cli { CliCommand::SubnetPoolList => Self::cli_subnet_pool_list(), CliCommand::SubnetPoolView => Self::cli_subnet_pool_view(), CliCommand::AuditLogList => Self::cli_audit_log_list(), + CliCommand::PhysicalDiskEnableAdoption => Self::cli_physical_disk_enable_adoption(), + CliCommand::PhysicalDiskDisableAdoption => Self::cli_physical_disk_disable_adoption(), + CliCommand::PhysicalDiskListAdoptionRequests => { + Self::cli_physical_disk_list_adoption_requests() + } CliCommand::PhysicalDiskList => Self::cli_physical_disk_list(), CliCommand::PhysicalDiskView => Self::cli_physical_disk_view(), + CliCommand::PhysicalDiskListUnadopted => Self::cli_physical_disk_list_unadopted(), CliCommand::NetworkingSwitchPortLldpNeighbors => { Self::cli_networking_switch_port_lldp_neighbors() } @@ -5058,6 +5064,78 @@ impl Cli { ) } + pub fn cli_physical_disk_enable_adoption() -> ::clap::Command { + ::clap::Command::new("") + .arg( + ::clap::Arg::new("model") + .long("model") + .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("vendor") + .long("vendor") + .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("Enable adoption of a physical disk for general use") + } + + pub fn cli_physical_disk_disable_adoption() -> ::clap::Command { + ::clap::Command::new("") + .arg( + ::clap::Arg::new("physical-disk-adoption-req-id") + .long("physical-disk-adoption-req-id") + .value_parser(::clap::value_parser!(::uuid::Uuid)) + .required(true) + .help("ID of the physical disk adoption request"), + ) + .about("Disable adoption of a physical disk for general use") + } + + pub fn cli_physical_disk_list_adoption_requests() -> ::clap::Command { + ::clap::Command::new("") + .arg( + ::clap::Arg::new("limit") + .long("limit") + .value_parser(::clap::value_parser!(::std::num::NonZeroU32)) + .required(false) + .help("Maximum number of items returned by a single call"), + ) + .arg( + ::clap::Arg::new("sort-by") + .long("sort-by") + .value_parser(::clap::builder::TypedValueParser::map( + ::clap::builder::PossibleValuesParser::new([ + types::IdSortMode::IdAscending.to_string(), + ]), + |s| types::IdSortMode::try_from(s).unwrap(), + )) + .required(false), + ) + .about("List physical disk adoption requests") + } + pub fn cli_physical_disk_list() -> ::clap::Command { ::clap::Command::new("") .arg( @@ -5093,6 +5171,18 @@ impl Cli { .about("Get physical disk") } + pub fn cli_physical_disk_list_unadopted() -> ::clap::Command { + ::clap::Command::new("") + .arg( + ::clap::Arg::new("limit") + .long("limit") + .value_parser(::clap::value_parser!(::std::num::NonZeroU32)) + .required(false) + .help("Maximum number of items returned by a single call"), + ) + .about("List physical disks that have not yet been adopted for use") + } + pub fn cli_networking_switch_port_lldp_neighbors() -> ::clap::Command { ::clap::Command::new("") .arg( @@ -9948,8 +10038,21 @@ impl Cli { CliCommand::SubnetPoolList => self.execute_subnet_pool_list(matches).await, CliCommand::SubnetPoolView => self.execute_subnet_pool_view(matches).await, CliCommand::AuditLogList => self.execute_audit_log_list(matches).await, + CliCommand::PhysicalDiskEnableAdoption => { + self.execute_physical_disk_enable_adoption(matches).await + } + CliCommand::PhysicalDiskDisableAdoption => { + self.execute_physical_disk_disable_adoption(matches).await + } + CliCommand::PhysicalDiskListAdoptionRequests => { + self.execute_physical_disk_list_adoption_requests(matches) + .await + } CliCommand::PhysicalDiskList => self.execute_physical_disk_list(matches).await, CliCommand::PhysicalDiskView => self.execute_physical_disk_view(matches).await, + CliCommand::PhysicalDiskListUnadopted => { + self.execute_physical_disk_list_unadopted(matches).await + } CliCommand::NetworkingSwitchPortLldpNeighbors => { self.execute_networking_switch_port_lldp_neighbors(matches) .await @@ -15587,6 +15690,112 @@ impl Cli { } } + pub async fn execute_physical_disk_enable_adoption( + &self, + matches: &::clap::ArgMatches, + ) -> anyhow::Result<()> { + let mut request = self.client.physical_disk_enable_adoption(); + if let Some(value) = matches.get_one::<::std::string::String>("model") { + request = request.body_map(|body| body.model(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::<::std::string::String>("vendor") { + request = request.body_map(|body| body.vendor(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_physical_disk_enable_adoption(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_physical_disk_disable_adoption( + &self, + matches: &::clap::ArgMatches, + ) -> anyhow::Result<()> { + let mut request = self.client.physical_disk_disable_adoption(); + if let Some(value) = matches.get_one::<::uuid::Uuid>("physical-disk-adoption-req-id") { + request = request.physical_disk_adoption_req_id(value.clone()); + } + + self.config + .execute_physical_disk_disable_adoption(matches, &mut request)?; + let result = request.send().await; + match result { + Ok(r) => { + self.config.success_no_item(&r); + Ok(()) + } + Err(r) => { + self.config.error(&r); + Err(anyhow::Error::new(r)) + } + } + } + + pub async fn execute_physical_disk_list_adoption_requests( + &self, + matches: &::clap::ArgMatches, + ) -> anyhow::Result<()> { + let mut request = self.client.physical_disk_list_adoption_requests(); + if let Some(value) = matches.get_one::<::std::num::NonZeroU32>("limit") { + request = request.limit(value.clone()); + } + + if let Some(value) = matches.get_one::("sort-by") { + request = request.sort_by(value.clone()); + } + + self.config + .execute_physical_disk_list_adoption_requests(matches, &mut request)?; + self.config + .list_start::(); + let mut stream = futures::StreamExt::take( + request.stream(), + matches + .get_one::("limit") + .map_or(usize::MAX, |x| x.get() as usize), + ); + loop { + match futures::TryStreamExt::try_next(&mut stream).await { + Err(r) => { + self.config.list_end_error(&r); + return Err(anyhow::Error::new(r)); + } + Ok(None) => { + self.config + .list_end_success::(); + return Ok(()); + } + Ok(Some(value)) => { + self.config.list_item(&value); + } + } + } + } + pub async fn execute_physical_disk_list( &self, matches: &::clap::ArgMatches, @@ -15651,6 +15860,43 @@ impl Cli { } } + pub async fn execute_physical_disk_list_unadopted( + &self, + matches: &::clap::ArgMatches, + ) -> anyhow::Result<()> { + let mut request = self.client.physical_disk_list_unadopted(); + if let Some(value) = matches.get_one::<::std::num::NonZeroU32>("limit") { + request = request.limit(value.clone()); + } + + self.config + .execute_physical_disk_list_unadopted(matches, &mut request)?; + self.config + .list_start::(); + let mut stream = futures::StreamExt::take( + request.stream(), + matches + .get_one::("limit") + .map_or(usize::MAX, |x| x.get() as usize), + ); + loop { + match futures::TryStreamExt::try_next(&mut stream).await { + Err(r) => { + self.config.list_end_error(&r); + return Err(anyhow::Error::new(r)); + } + Ok(None) => { + self.config + .list_end_success::(); + return Ok(()); + } + Ok(Some(value)) => { + self.config.list_item(&value); + } + } + } + } + pub async fn execute_networking_switch_port_lldp_neighbors( &self, matches: &::clap::ArgMatches, @@ -22291,6 +22537,30 @@ pub trait CliConfig { Ok(()) } + fn execute_physical_disk_enable_adoption( + &self, + matches: &::clap::ArgMatches, + request: &mut builder::PhysicalDiskEnableAdoption, + ) -> anyhow::Result<()> { + Ok(()) + } + + fn execute_physical_disk_disable_adoption( + &self, + matches: &::clap::ArgMatches, + request: &mut builder::PhysicalDiskDisableAdoption, + ) -> anyhow::Result<()> { + Ok(()) + } + + fn execute_physical_disk_list_adoption_requests( + &self, + matches: &::clap::ArgMatches, + request: &mut builder::PhysicalDiskListAdoptionRequests, + ) -> anyhow::Result<()> { + Ok(()) + } + fn execute_physical_disk_list( &self, matches: &::clap::ArgMatches, @@ -22307,6 +22577,14 @@ pub trait CliConfig { Ok(()) } + fn execute_physical_disk_list_unadopted( + &self, + matches: &::clap::ArgMatches, + request: &mut builder::PhysicalDiskListUnadopted, + ) -> anyhow::Result<()> { + Ok(()) + } + fn execute_networking_switch_port_lldp_neighbors( &self, matches: &::clap::ArgMatches, @@ -23718,8 +23996,12 @@ pub enum CliCommand { SubnetPoolList, SubnetPoolView, AuditLogList, + PhysicalDiskEnableAdoption, + PhysicalDiskDisableAdoption, + PhysicalDiskListAdoptionRequests, PhysicalDiskList, PhysicalDiskView, + PhysicalDiskListUnadopted, NetworkingSwitchPortLldpNeighbors, RackList, RackView, @@ -24034,8 +24316,12 @@ impl CliCommand { CliCommand::SubnetPoolList, CliCommand::SubnetPoolView, CliCommand::AuditLogList, + CliCommand::PhysicalDiskEnableAdoption, + CliCommand::PhysicalDiskDisableAdoption, + CliCommand::PhysicalDiskListAdoptionRequests, CliCommand::PhysicalDiskList, CliCommand::PhysicalDiskView, + CliCommand::PhysicalDiskListUnadopted, CliCommand::NetworkingSwitchPortLldpNeighbors, CliCommand::RackList, CliCommand::RackView, @@ -24359,8 +24645,12 @@ impl CliCommand { CliCommand::SubnetPoolList => "subnet_pool_list", CliCommand::SubnetPoolView => "subnet_pool_view", CliCommand::AuditLogList => "audit_log_list", + CliCommand::PhysicalDiskEnableAdoption => "physical_disk_enable_adoption", + CliCommand::PhysicalDiskDisableAdoption => "physical_disk_disable_adoption", + CliCommand::PhysicalDiskListAdoptionRequests => "physical_disk_list_adoption_requests", CliCommand::PhysicalDiskList => "physical_disk_list", CliCommand::PhysicalDiskView => "physical_disk_view", + CliCommand::PhysicalDiskListUnadopted => "physical_disk_list_unadopted", CliCommand::NetworkingSwitchPortLldpNeighbors => { "networking_switch_port_lldp_neighbors" } diff --git a/oxide.json b/oxide.json index 9fc59f29..71ee60f8 100644 --- a/oxide.json +++ b/oxide.json @@ -7,7 +7,7 @@ "url": "https://oxide.computer", "email": "api@oxide.computer" }, - "version": "2026043000.0.0" + "version": "2026050800.0.0" }, "paths": { "/device/auth": { @@ -7696,6 +7696,134 @@ } } }, + "/v1/system/hardware/disk-adoption-request": { + "put": { + "tags": [ + "system/hardware" + ], + "summary": "Enable adoption of a physical disk for general use", + "operationId": "physical_disk_enable_adoption", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PhysicalDiskManufacturerIdentity" + } + } + }, + "required": true + }, + "responses": { + "201": { + "description": "successful creation", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PhysicalDiskAdoptionRequest" + } + } + } + }, + "4XX": { + "$ref": "#/components/responses/Error" + }, + "5XX": { + "$ref": "#/components/responses/Error" + } + } + } + }, + "/v1/system/hardware/disk-adoption-request/{physical_disk_adoption_req_id}": { + "delete": { + "tags": [ + "system/hardware" + ], + "summary": "Disable adoption of a physical disk for general use", + "operationId": "physical_disk_disable_adoption", + "parameters": [ + { + "in": "path", + "name": "physical_disk_adoption_req_id", + "description": "ID of the physical disk adoption request", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "204": { + "description": "successful deletion" + }, + "4XX": { + "$ref": "#/components/responses/Error" + }, + "5XX": { + "$ref": "#/components/responses/Error" + } + } + } + }, + "/v1/system/hardware/disk-adoption-requests": { + "get": { + "tags": [ + "system/hardware" + ], + "summary": "List physical disk adoption requests", + "operationId": "physical_disk_list_adoption_requests", + "parameters": [ + { + "in": "query", + "name": "limit", + "description": "Maximum number of items returned by a single call", + "schema": { + "nullable": true, + "type": "integer", + "format": "uint32", + "minimum": 1 + } + }, + { + "in": "query", + "name": "page_token", + "description": "Token returned by previous call to retrieve the subsequent page", + "schema": { + "nullable": true, + "type": "string" + } + }, + { + "in": "query", + "name": "sort_by", + "schema": { + "$ref": "#/components/schemas/IdSortMode" + } + } + ], + "responses": { + "200": { + "description": "successful operation", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PhysicalDiskAdoptionRequestResultsPage" + } + } + } + }, + "4XX": { + "$ref": "#/components/responses/Error" + }, + "5XX": { + "$ref": "#/components/responses/Error" + } + }, + "x-dropshot-pagination": { + "required": [] + } + } + }, "/v1/system/hardware/disks": { "get": { "tags": [ @@ -7794,6 +7922,58 @@ } } }, + "/v1/system/hardware/disks-unadopted": { + "get": { + "tags": [ + "system/hardware" + ], + "summary": "List physical disks that have not yet been adopted for use", + "operationId": "physical_disk_list_unadopted", + "parameters": [ + { + "in": "query", + "name": "limit", + "description": "Maximum number of items returned by a single call", + "schema": { + "nullable": true, + "type": "integer", + "format": "uint32", + "minimum": 1 + } + }, + { + "in": "query", + "name": "page_token", + "description": "Token returned by previous call to retrieve the subsequent page", + "schema": { + "nullable": true, + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "successful operation", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnadoptedPhysicalDiskResultsPage" + } + } + } + }, + "4XX": { + "$ref": "#/components/responses/Error" + }, + "5XX": { + "$ref": "#/components/responses/Error" + } + }, + "x-dropshot-pagination": { + "required": [] + } + } + }, "/v1/system/hardware/rack-switch-port/{rack_id}/{switch_slot}/{port}/lldp/neighbors": { "get": { "tags": [ @@ -25170,6 +25350,57 @@ "vendor" ] }, + "PhysicalDiskAdoptionRequest": { + "description": "A request to adopt a physical disk into the control plane", + "type": "object", + "properties": { + "disk_id": { + "$ref": "#/components/schemas/PhysicalDiskManufacturerIdentity" + }, + "id": { + "$ref": "#/components/schemas/PhysicalDiskAdoptionRequestUuid" + }, + "time_created": { + "type": "string", + "format": "date-time" + } + }, + "required": [ + "disk_id", + "id", + "time_created" + ] + }, + "PhysicalDiskAdoptionRequestResultsPage": { + "description": "A single page of results", + "type": "object", + "properties": { + "items": { + "description": "list of items on this page of results", + "type": "array", + "items": { + "$ref": "#/components/schemas/PhysicalDiskAdoptionRequest" + } + }, + "next_page": { + "nullable": true, + "description": "token used to fetch the next page of results (if any)", + "type": "string" + } + }, + "required": [ + "items" + ] + }, + "PhysicalDiskAdoptionRequestUuid": { + "x-rust-type": { + "crate": "omicron-uuid-kinds", + "path": "omicron_uuid_kinds::PhysicalDiskAdoptionRequestUuid", + "version": "*" + }, + "type": "string", + "format": "uuid" + }, "PhysicalDiskKind": { "description": "Describes the form factor of physical disks.", "type": "string", @@ -25178,6 +25409,26 @@ "u2" ] }, + "PhysicalDiskManufacturerIdentity": { + "description": "The unique identity of a physical disk provided by the manufacturer", + "type": "object", + "properties": { + "model": { + "type": "string" + }, + "serial": { + "type": "string" + }, + "vendor": { + "type": "string" + } + }, + "required": [ + "model", + "serial", + "vendor" + ] + }, "PhysicalDiskPolicy": { "description": "The operator-defined policy of a physical disk.", "oneOf": [ @@ -27872,6 +28123,15 @@ } ] }, + "SledUuid": { + "x-rust-type": { + "crate": "omicron-uuid-kinds", + "path": "omicron_uuid_kinds::SledUuid", + "version": "*" + }, + "type": "string", + "format": "uuid" + }, "Snapshot": { "description": "View of a Snapshot", "type": "object", @@ -28595,7 +28855,7 @@ "description": "The switch interface kind.", "allOf": [ { - "$ref": "#/components/schemas/SwitchInterfaceKind2" + "$ref": "#/components/schemas/SwitchInterfaceKind" } ] }, @@ -28705,32 +28965,6 @@ } ] }, - "SwitchInterfaceKind2": { - "description": "Describes the kind of an switch interface.", - "oneOf": [ - { - "description": "Primary interfaces are associated with physical links. There is exactly one primary interface per physical link.", - "type": "string", - "enum": [ - "primary" - ] - }, - { - "description": "VLAN interfaces allow physical interfaces to be multiplexed onto multiple logical links, each distinguished by a 12-bit 802.1Q Ethernet tag.", - "type": "string", - "enum": [ - "vlan" - ] - }, - { - "description": "Loopback interfaces are anchors for IP addresses that are not specific to any particular port.", - "type": "string", - "enum": [ - "loopback" - ] - } - ] - }, "SwitchLinkState": {}, "SwitchPort": { "description": "A switch port represents a physical external port on a rack switch.", @@ -28861,7 +29095,7 @@ "description": "The physical link geometry of the port.", "allOf": [ { - "$ref": "#/components/schemas/SwitchPortGeometry2" + "$ref": "#/components/schemas/SwitchPortGeometry" } ] }, @@ -28919,32 +29153,6 @@ } ] }, - "SwitchPortGeometry2": { - "description": "The link geometry associated with a switch port.", - "oneOf": [ - { - "description": "The port contains a single QSFP28 link with four lanes.", - "type": "string", - "enum": [ - "qsfp28x1" - ] - }, - { - "description": "The port contains two QSFP28 links each with two lanes.", - "type": "string", - "enum": [ - "qsfp28x2" - ] - }, - { - "description": "The port contains four SFP28 links each with one lane.", - "type": "string", - "enum": [ - "sfp28x4" - ] - } - ] - }, "SwitchPortLinkConfig": { "description": "A link configuration for a port settings object.", "type": "object", @@ -29003,7 +29211,7 @@ "description": "The tx_eq configuration for this link.", "allOf": [ { - "$ref": "#/components/schemas/TxEqConfig2" + "$ref": "#/components/schemas/TxEqConfig" } ] } @@ -29169,13 +29377,6 @@ "description": "Timestamp when this resource was last modified", "type": "string", "format": "date-time" - }, - "vlan_interfaces": { - "description": "Vlan interface settings.", - "type": "array", - "items": { - "$ref": "#/components/schemas/SwitchVlanInterfaceConfig" - } } }, "required": [ @@ -29190,8 +29391,7 @@ "port", "routes", "time_created", - "time_modified", - "vlan_interfaces" + "time_modified" ] }, "SwitchPortSettingsCreate": { @@ -29382,27 +29582,6 @@ } ] }, - "SwitchVlanInterfaceConfig": { - "description": "A switch port VLAN interface configuration for a port settings object.", - "type": "object", - "properties": { - "interface_config_id": { - "description": "The switch interface configuration this VLAN interface configuration belongs to.", - "type": "string", - "format": "uuid" - }, - "vlan_id": { - "description": "The virtual network id for this interface that is used for producing and consuming 802.1Q Ethernet tags. This field has a maximum value of 4095 as 802.1Q tags are twelve bits.", - "type": "integer", - "format": "uint16", - "minimum": 0 - } - }, - "required": [ - "interface_config_id", - "vlan_id" - ] - }, "TargetRelease": { "description": "View of a system software target release", "type": "object", @@ -29667,41 +29846,51 @@ } } }, - "TxEqConfig2": { - "description": "Per-port tx-eq overrides. This can be used to fine-tune the transceiver equalization settings to improve signal integrity.", + "UnadoptedPhysicalDisk": { + "description": "A physical disk that has not yet been adopted by the control plane", "type": "object", "properties": { - "main": { - "nullable": true, - "description": "Main tap", - "type": "integer", - "format": "int32" + "disk_id": { + "$ref": "#/components/schemas/PhysicalDiskManufacturerIdentity" }, - "post1": { - "nullable": true, - "description": "Post-cursor tap1", - "type": "integer", - "format": "int32" + "sled_id": { + "$ref": "#/components/schemas/SledUuid" }, - "post2": { - "nullable": true, - "description": "Post-cursor tap2", + "slot": { "type": "integer", - "format": "int32" + "format": "int64" }, - "pre1": { - "nullable": true, - "description": "Pre-cursor tap1", - "type": "integer", - "format": "int32" + "variant": { + "$ref": "#/components/schemas/PhysicalDiskKind" + } + }, + "required": [ + "disk_id", + "sled_id", + "slot", + "variant" + ] + }, + "UnadoptedPhysicalDiskResultsPage": { + "description": "A single page of results", + "type": "object", + "properties": { + "items": { + "description": "list of items on this page of results", + "type": "array", + "items": { + "$ref": "#/components/schemas/UnadoptedPhysicalDisk" + } }, - "pre2": { + "next_page": { "nullable": true, - "description": "Pre-cursor tap2", - "type": "integer", - "format": "int32" + "description": "token used to fetch the next page of results (if any)", + "type": "string" } - } + }, + "required": [ + "items" + ] }, "UninitializedSled": { "description": "A sled that has not been added to an initialized rack yet", diff --git a/sdk-httpmock/src/generated_httpmock.rs b/sdk-httpmock/src/generated_httpmock.rs index 4c6db7a7..6c2d2375 100644 --- a/sdk-httpmock/src/generated_httpmock.rs +++ b/sdk-httpmock/src/generated_httpmock.rs @@ -11592,6 +11592,206 @@ pub mod operations { } } + pub struct PhysicalDiskEnableAdoptionWhen(::httpmock::When); + impl PhysicalDiskEnableAdoptionWhen { + pub fn new(inner: ::httpmock::When) -> Self { + Self(inner.method(::httpmock::Method::PUT).path_matches( + regex::Regex::new("^/v1/system/hardware/disk-adoption-request$").unwrap(), + )) + } + + pub fn into_inner(self) -> ::httpmock::When { + self.0 + } + + pub fn body(self, value: &types::PhysicalDiskManufacturerIdentity) -> Self { + Self(self.0.json_body_obj(value)) + } + } + + pub struct PhysicalDiskEnableAdoptionThen(::httpmock::Then); + impl PhysicalDiskEnableAdoptionThen { + pub fn new(inner: ::httpmock::Then) -> Self { + Self(inner) + } + + pub fn into_inner(self) -> ::httpmock::Then { + self.0 + } + + pub fn created(self, value: &types::PhysicalDiskAdoptionRequest) -> 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 PhysicalDiskDisableAdoptionWhen(::httpmock::When); + impl PhysicalDiskDisableAdoptionWhen { + pub fn new(inner: ::httpmock::When) -> Self { + Self(inner.method(::httpmock::Method::DELETE).path_matches( + regex::Regex::new("^/v1/system/hardware/disk-adoption-request/[^/]*$").unwrap(), + )) + } + + pub fn into_inner(self) -> ::httpmock::When { + self.0 + } + + pub fn physical_disk_adoption_req_id(self, value: &::uuid::Uuid) -> Self { + let re = regex::Regex::new(&format!( + "^/v1/system/hardware/disk-adoption-request/{}$", + value.to_string() + )) + .unwrap(); + Self(self.0.path_matches(re)) + } + } + + pub struct PhysicalDiskDisableAdoptionThen(::httpmock::Then); + impl PhysicalDiskDisableAdoptionThen { + pub fn new(inner: ::httpmock::Then) -> Self { + Self(inner) + } + + pub fn into_inner(self) -> ::httpmock::Then { + self.0 + } + + pub fn no_content(self) -> Self { + Self(self.0.status(204u16)) + } + + 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 PhysicalDiskListAdoptionRequestsWhen(::httpmock::When); + impl PhysicalDiskListAdoptionRequestsWhen { + pub fn new(inner: ::httpmock::When) -> Self { + Self(inner.method(::httpmock::Method::GET).path_matches( + regex::Regex::new("^/v1/system/hardware/disk-adoption-requests$").unwrap(), + )) + } + + pub fn into_inner(self) -> ::httpmock::When { + self.0 + } + + pub fn limit(self, value: T) -> Self + where + T: Into>, + { + if let Some(value) = value.into() { + Self(self.0.query_param("limit", value.to_string())) + } else { + Self(self.0.query_param_missing("limit")) + } + } + + pub fn page_token<'a, T>(self, value: T) -> Self + where + T: Into>, + { + if let Some(value) = value.into() { + Self(self.0.query_param("page_token", value.to_string())) + } else { + Self(self.0.query_param_missing("page_token")) + } + } + + pub fn sort_by(self, value: T) -> Self + where + T: Into>, + { + if let Some(value) = value.into() { + Self(self.0.query_param("sort_by", value.to_string())) + } else { + Self(self.0.query_param_missing("sort_by")) + } + } + } + + pub struct PhysicalDiskListAdoptionRequestsThen(::httpmock::Then); + impl PhysicalDiskListAdoptionRequestsThen { + pub fn new(inner: ::httpmock::Then) -> Self { + Self(inner) + } + + pub fn into_inner(self) -> ::httpmock::Then { + self.0 + } + + pub fn ok(self, value: &types::PhysicalDiskAdoptionRequestResultsPage) -> Self { + Self( + self.0 + .status(200u16) + .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 PhysicalDiskListWhen(::httpmock::When); impl PhysicalDiskListWhen { pub fn new(inner: ::httpmock::When) -> Self { @@ -11744,6 +11944,83 @@ pub mod operations { } } + pub struct PhysicalDiskListUnadoptedWhen(::httpmock::When); + impl PhysicalDiskListUnadoptedWhen { + pub fn new(inner: ::httpmock::When) -> Self { + Self( + inner.method(::httpmock::Method::GET).path_matches( + regex::Regex::new("^/v1/system/hardware/disks-unadopted$").unwrap(), + ), + ) + } + + pub fn into_inner(self) -> ::httpmock::When { + self.0 + } + + pub fn limit(self, value: T) -> Self + where + T: Into>, + { + if let Some(value) = value.into() { + Self(self.0.query_param("limit", value.to_string())) + } else { + Self(self.0.query_param_missing("limit")) + } + } + + pub fn page_token<'a, T>(self, value: T) -> Self + where + T: Into>, + { + if let Some(value) = value.into() { + Self(self.0.query_param("page_token", value.to_string())) + } else { + Self(self.0.query_param_missing("page_token")) + } + } + } + + pub struct PhysicalDiskListUnadoptedThen(::httpmock::Then); + impl PhysicalDiskListUnadoptedThen { + pub fn new(inner: ::httpmock::Then) -> Self { + Self(inner) + } + + pub fn into_inner(self) -> ::httpmock::Then { + self.0 + } + + pub fn ok(self, value: &types::UnadoptedPhysicalDiskResultsPage) -> Self { + Self( + self.0 + .status(200u16) + .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 NetworkingSwitchPortLldpNeighborsWhen(::httpmock::When); impl NetworkingSwitchPortLldpNeighborsWhen { pub fn new(inner: ::httpmock::When) -> Self { @@ -23633,12 +23910,36 @@ pub trait MockServerExt { fn audit_log_list(&self, config_fn: F) -> ::httpmock::Mock<'_> where F: FnOnce(operations::AuditLogListWhen, operations::AuditLogListThen); + fn physical_disk_enable_adoption(&self, config_fn: F) -> ::httpmock::Mock<'_> + where + F: FnOnce( + operations::PhysicalDiskEnableAdoptionWhen, + operations::PhysicalDiskEnableAdoptionThen, + ); + fn physical_disk_disable_adoption(&self, config_fn: F) -> ::httpmock::Mock<'_> + where + F: FnOnce( + operations::PhysicalDiskDisableAdoptionWhen, + operations::PhysicalDiskDisableAdoptionThen, + ); + fn physical_disk_list_adoption_requests(&self, config_fn: F) -> ::httpmock::Mock<'_> + where + F: FnOnce( + operations::PhysicalDiskListAdoptionRequestsWhen, + operations::PhysicalDiskListAdoptionRequestsThen, + ); fn physical_disk_list(&self, config_fn: F) -> ::httpmock::Mock<'_> where F: FnOnce(operations::PhysicalDiskListWhen, operations::PhysicalDiskListThen); fn physical_disk_view(&self, config_fn: F) -> ::httpmock::Mock<'_> where F: FnOnce(operations::PhysicalDiskViewWhen, operations::PhysicalDiskViewThen); + fn physical_disk_list_unadopted(&self, config_fn: F) -> ::httpmock::Mock<'_> + where + F: FnOnce( + operations::PhysicalDiskListUnadoptedWhen, + operations::PhysicalDiskListUnadoptedThen, + ); fn networking_switch_port_lldp_neighbors(&self, config_fn: F) -> ::httpmock::Mock<'_> where F: FnOnce( @@ -26204,6 +26505,51 @@ impl MockServerExt for ::httpmock::MockServer { }) } + fn physical_disk_enable_adoption(&self, config_fn: F) -> ::httpmock::Mock<'_> + where + F: FnOnce( + operations::PhysicalDiskEnableAdoptionWhen, + operations::PhysicalDiskEnableAdoptionThen, + ), + { + self.mock(|when, then| { + config_fn( + operations::PhysicalDiskEnableAdoptionWhen::new(when), + operations::PhysicalDiskEnableAdoptionThen::new(then), + ) + }) + } + + fn physical_disk_disable_adoption(&self, config_fn: F) -> ::httpmock::Mock<'_> + where + F: FnOnce( + operations::PhysicalDiskDisableAdoptionWhen, + operations::PhysicalDiskDisableAdoptionThen, + ), + { + self.mock(|when, then| { + config_fn( + operations::PhysicalDiskDisableAdoptionWhen::new(when), + operations::PhysicalDiskDisableAdoptionThen::new(then), + ) + }) + } + + fn physical_disk_list_adoption_requests(&self, config_fn: F) -> ::httpmock::Mock<'_> + where + F: FnOnce( + operations::PhysicalDiskListAdoptionRequestsWhen, + operations::PhysicalDiskListAdoptionRequestsThen, + ), + { + self.mock(|when, then| { + config_fn( + operations::PhysicalDiskListAdoptionRequestsWhen::new(when), + operations::PhysicalDiskListAdoptionRequestsThen::new(then), + ) + }) + } + fn physical_disk_list(&self, config_fn: F) -> ::httpmock::Mock<'_> where F: FnOnce(operations::PhysicalDiskListWhen, operations::PhysicalDiskListThen), @@ -26228,6 +26574,21 @@ impl MockServerExt for ::httpmock::MockServer { }) } + fn physical_disk_list_unadopted(&self, config_fn: F) -> ::httpmock::Mock<'_> + where + F: FnOnce( + operations::PhysicalDiskListUnadoptedWhen, + operations::PhysicalDiskListUnadoptedThen, + ), + { + self.mock(|when, then| { + config_fn( + operations::PhysicalDiskListUnadoptedWhen::new(when), + operations::PhysicalDiskListUnadoptedThen::new(then), + ) + }) + } + fn networking_switch_port_lldp_neighbors(&self, config_fn: F) -> ::httpmock::Mock<'_> where F: FnOnce( diff --git a/sdk/src/generated_sdk.rs b/sdk/src/generated_sdk.rs index ae68b3f7..fd101b24 100644 --- a/sdk/src/generated_sdk.rs +++ b/sdk/src/generated_sdk.rs @@ -21418,6 +21418,165 @@ pub mod types { } } + /// A request to adopt a physical disk into the control plane + /// + ///
JSON schema + /// + /// ```json + /// { + /// "description": "A request to adopt a physical disk into the control + /// plane", + /// "type": "object", + /// "required": [ + /// "disk_id", + /// "id", + /// "time_created" + /// ], + /// "properties": { + /// "disk_id": { + /// "$ref": "#/components/schemas/PhysicalDiskManufacturerIdentity" + /// }, + /// "id": { + /// "$ref": "#/components/schemas/PhysicalDiskAdoptionRequestUuid" + /// }, + /// "time_created": { + /// "type": "string", + /// "format": "date-time" + /// } + /// } + /// } + /// ``` + ///
+ #[derive( + :: serde :: Deserialize, :: serde :: Serialize, Clone, Debug, schemars :: JsonSchema, + )] + pub struct PhysicalDiskAdoptionRequest { + pub disk_id: PhysicalDiskManufacturerIdentity, + pub id: PhysicalDiskAdoptionRequestUuid, + pub time_created: ::chrono::DateTime<::chrono::offset::Utc>, + } + + impl PhysicalDiskAdoptionRequest { + pub fn builder() -> builder::PhysicalDiskAdoptionRequest { + Default::default() + } + } + + /// A single page of results + /// + ///
JSON schema + /// + /// ```json + /// { + /// "description": "A single page of results", + /// "type": "object", + /// "required": [ + /// "items" + /// ], + /// "properties": { + /// "items": { + /// "description": "list of items on this page of results", + /// "type": "array", + /// "items": { + /// "$ref": "#/components/schemas/PhysicalDiskAdoptionRequest" + /// } + /// }, + /// "next_page": { + /// "description": "token used to fetch the next page of results (if + /// any)", + /// "type": [ + /// "string", + /// "null" + /// ] + /// } + /// } + /// } + /// ``` + ///
+ #[derive( + :: serde :: Deserialize, :: serde :: Serialize, Clone, Debug, schemars :: JsonSchema, + )] + pub struct PhysicalDiskAdoptionRequestResultsPage { + /// list of items on this page of results + pub items: ::std::vec::Vec, + /// token used to fetch the next page of results (if any) + #[serde(default, skip_serializing_if = "::std::option::Option::is_none")] + pub next_page: ::std::option::Option<::std::string::String>, + } + + impl PhysicalDiskAdoptionRequestResultsPage { + pub fn builder() -> builder::PhysicalDiskAdoptionRequestResultsPage { + Default::default() + } + } + + /// `PhysicalDiskAdoptionRequestUuid` + /// + ///
JSON schema + /// + /// ```json + /// { + /// "type": "string", + /// "format": "uuid", + /// "x-rust-type": { + /// "crate": "omicron-uuid-kinds", + /// "path": "omicron_uuid_kinds::PhysicalDiskAdoptionRequestUuid", + /// "version": "*" + /// } + /// } + /// ``` + ///
+ #[derive( + :: serde :: Deserialize, :: serde :: Serialize, Clone, Debug, schemars :: JsonSchema, + )] + #[serde(transparent)] + pub struct PhysicalDiskAdoptionRequestUuid(pub ::uuid::Uuid); + impl ::std::ops::Deref for PhysicalDiskAdoptionRequestUuid { + type Target = ::uuid::Uuid; + fn deref(&self) -> &::uuid::Uuid { + &self.0 + } + } + + impl ::std::convert::From for ::uuid::Uuid { + fn from(value: PhysicalDiskAdoptionRequestUuid) -> Self { + value.0 + } + } + + impl ::std::convert::From<::uuid::Uuid> for PhysicalDiskAdoptionRequestUuid { + fn from(value: ::uuid::Uuid) -> Self { + Self(value) + } + } + + impl ::std::str::FromStr for PhysicalDiskAdoptionRequestUuid { + type Err = <::uuid::Uuid as ::std::str::FromStr>::Err; + fn from_str(value: &str) -> ::std::result::Result { + Ok(Self(value.parse()?)) + } + } + + impl ::std::convert::TryFrom<&str> for PhysicalDiskAdoptionRequestUuid { + type Error = <::uuid::Uuid as ::std::str::FromStr>::Err; + fn try_from(value: &str) -> ::std::result::Result { + value.parse() + } + } + + impl ::std::convert::TryFrom for PhysicalDiskAdoptionRequestUuid { + type Error = <::uuid::Uuid as ::std::str::FromStr>::Err; + fn try_from(value: String) -> ::std::result::Result { + value.parse() + } + } + + impl ::std::fmt::Display for PhysicalDiskAdoptionRequestUuid { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + self.0.fmt(f) + } + } + /// Describes the form factor of physical disks. /// ///
JSON schema @@ -21498,6 +21657,49 @@ pub mod types { } } + /// The unique identity of a physical disk provided by the manufacturer + /// + ///
JSON schema + /// + /// ```json + /// { + /// "description": "The unique identity of a physical disk provided by the + /// manufacturer", + /// "type": "object", + /// "required": [ + /// "model", + /// "serial", + /// "vendor" + /// ], + /// "properties": { + /// "model": { + /// "type": "string" + /// }, + /// "serial": { + /// "type": "string" + /// }, + /// "vendor": { + /// "type": "string" + /// } + /// } + /// } + /// ``` + ///
+ #[derive( + :: serde :: Deserialize, :: serde :: Serialize, Clone, Debug, schemars :: JsonSchema, + )] + pub struct PhysicalDiskManufacturerIdentity { + pub model: ::std::string::String, + pub serial: ::std::string::String, + pub vendor: ::std::string::String, + } + + impl PhysicalDiskManufacturerIdentity { + pub fn builder() -> builder::PhysicalDiskManufacturerIdentity { + Default::default() + } + } + /// The operator-defined policy of a physical disk. /// ///
JSON schema @@ -27589,6 +27791,73 @@ pub mod types { } } + /// `SledUuid` + /// + ///
JSON schema + /// + /// ```json + /// { + /// "type": "string", + /// "format": "uuid", + /// "x-rust-type": { + /// "crate": "omicron-uuid-kinds", + /// "path": "omicron_uuid_kinds::SledUuid", + /// "version": "*" + /// } + /// } + /// ``` + ///
+ #[derive( + :: serde :: Deserialize, :: serde :: Serialize, Clone, Debug, schemars :: JsonSchema, + )] + #[serde(transparent)] + pub struct SledUuid(pub ::uuid::Uuid); + impl ::std::ops::Deref for SledUuid { + type Target = ::uuid::Uuid; + fn deref(&self) -> &::uuid::Uuid { + &self.0 + } + } + + impl ::std::convert::From for ::uuid::Uuid { + fn from(value: SledUuid) -> Self { + value.0 + } + } + + impl ::std::convert::From<::uuid::Uuid> for SledUuid { + fn from(value: ::uuid::Uuid) -> Self { + Self(value) + } + } + + impl ::std::str::FromStr for SledUuid { + type Err = <::uuid::Uuid as ::std::str::FromStr>::Err; + fn from_str(value: &str) -> ::std::result::Result { + Ok(Self(value.parse()?)) + } + } + + impl ::std::convert::TryFrom<&str> for SledUuid { + type Error = <::uuid::Uuid as ::std::str::FromStr>::Err; + fn try_from(value: &str) -> ::std::result::Result { + value.parse() + } + } + + impl ::std::convert::TryFrom for SledUuid { + type Error = <::uuid::Uuid as ::std::str::FromStr>::Err; + fn try_from(value: String) -> ::std::result::Result { + value.parse() + } + } + + impl ::std::fmt::Display for SledUuid { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + self.0.fmt(f) + } + } + /// View of a Snapshot /// ///
JSON schema @@ -29254,7 +29523,7 @@ pub mod types { /// "description": "The switch interface kind.", /// "allOf": [ /// { - /// "$ref": "#/components/schemas/SwitchInterfaceKind2" + /// "$ref": "#/components/schemas/SwitchInterfaceKind" /// } /// ] /// }, @@ -29281,7 +29550,7 @@ pub mod types { /// The name of this switch interface. pub interface_name: Name, /// The switch interface kind. - pub kind: SwitchInterfaceKind2, + pub kind: SwitchInterfaceKind, /// The port settings object this switch interface configuration belongs /// to. pub port_settings_id: ::uuid::Uuid, @@ -29450,119 +29719,6 @@ pub mod types { } } - /// Describes the kind of an switch interface. - /// - ///
JSON schema - /// - /// ```json - /// { - /// "description": "Describes the kind of an switch interface.", - /// "oneOf": [ - /// { - /// "description": "Primary interfaces are associated with physical - /// links. There is exactly one primary interface per physical link.", - /// "type": "string", - /// "enum": [ - /// "primary" - /// ] - /// }, - /// { - /// "description": "VLAN interfaces allow physical interfaces to be - /// multiplexed onto multiple logical links, each distinguished by a 12-bit - /// 802.1Q Ethernet tag.", - /// "type": "string", - /// "enum": [ - /// "vlan" - /// ] - /// }, - /// { - /// "description": "Loopback interfaces are anchors for IP addresses - /// that are not specific to any particular port.", - /// "type": "string", - /// "enum": [ - /// "loopback" - /// ] - /// } - /// ] - /// } - /// ``` - ///
- #[derive( - :: serde :: Deserialize, - :: serde :: Serialize, - Clone, - Copy, - Debug, - Eq, - Hash, - Ord, - PartialEq, - PartialOrd, - schemars :: JsonSchema, - )] - pub enum SwitchInterfaceKind2 { - /// Primary interfaces are associated with physical links. There is - /// exactly one primary interface per physical link. - #[serde(rename = "primary")] - Primary, - /// VLAN interfaces allow physical interfaces to be multiplexed onto - /// multiple logical links, each distinguished by a 12-bit 802.1Q - /// Ethernet tag. - #[serde(rename = "vlan")] - Vlan, - /// Loopback interfaces are anchors for IP addresses that are not - /// specific to any particular port. - #[serde(rename = "loopback")] - Loopback, - } - - impl ::std::fmt::Display for SwitchInterfaceKind2 { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - match *self { - Self::Primary => f.write_str("primary"), - Self::Vlan => f.write_str("vlan"), - Self::Loopback => f.write_str("loopback"), - } - } - } - - impl ::std::str::FromStr for SwitchInterfaceKind2 { - type Err = self::error::ConversionError; - fn from_str(value: &str) -> ::std::result::Result { - match value { - "primary" => Ok(Self::Primary), - "vlan" => Ok(Self::Vlan), - "loopback" => Ok(Self::Loopback), - _ => Err("invalid value".into()), - } - } - } - - impl ::std::convert::TryFrom<&str> for SwitchInterfaceKind2 { - type Error = self::error::ConversionError; - fn try_from(value: &str) -> ::std::result::Result { - value.parse() - } - } - - impl ::std::convert::TryFrom<&::std::string::String> for SwitchInterfaceKind2 { - type Error = self::error::ConversionError; - fn try_from( - value: &::std::string::String, - ) -> ::std::result::Result { - value.parse() - } - } - - impl ::std::convert::TryFrom<::std::string::String> for SwitchInterfaceKind2 { - type Error = self::error::ConversionError; - fn try_from( - value: ::std::string::String, - ) -> ::std::result::Result { - value.parse() - } - } - /// `SwitchLinkState` /// ///
JSON schema @@ -29833,7 +29989,7 @@ pub mod types { /// "description": "The physical link geometry of the port.", /// "allOf": [ /// { - /// "$ref": "#/components/schemas/SwitchPortGeometry2" + /// "$ref": "#/components/schemas/SwitchPortGeometry" /// } /// ] /// }, @@ -29852,7 +30008,7 @@ pub mod types { )] pub struct SwitchPortConfig { /// The physical link geometry of the port. - pub geometry: SwitchPortGeometry2, + pub geometry: SwitchPortGeometry, /// The id of the port settings object this configuration belongs to. pub port_settings_id: ::uuid::Uuid, } @@ -30009,114 +30165,6 @@ pub mod types { } } - /// The link geometry associated with a switch port. - /// - ///
JSON schema - /// - /// ```json - /// { - /// "description": "The link geometry associated with a switch port.", - /// "oneOf": [ - /// { - /// "description": "The port contains a single QSFP28 link with four - /// lanes.", - /// "type": "string", - /// "enum": [ - /// "qsfp28x1" - /// ] - /// }, - /// { - /// "description": "The port contains two QSFP28 links each with two - /// lanes.", - /// "type": "string", - /// "enum": [ - /// "qsfp28x2" - /// ] - /// }, - /// { - /// "description": "The port contains four SFP28 links each with one - /// lane.", - /// "type": "string", - /// "enum": [ - /// "sfp28x4" - /// ] - /// } - /// ] - /// } - /// ``` - ///
- #[derive( - :: serde :: Deserialize, - :: serde :: Serialize, - Clone, - Copy, - Debug, - Eq, - Hash, - Ord, - PartialEq, - PartialOrd, - schemars :: JsonSchema, - )] - pub enum SwitchPortGeometry2 { - /// The port contains a single QSFP28 link with four lanes. - #[serde(rename = "qsfp28x1")] - Qsfp28x1, - /// The port contains two QSFP28 links each with two lanes. - #[serde(rename = "qsfp28x2")] - Qsfp28x2, - /// The port contains four SFP28 links each with one lane. - #[serde(rename = "sfp28x4")] - Sfp28x4, - } - - impl ::std::fmt::Display for SwitchPortGeometry2 { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - match *self { - Self::Qsfp28x1 => f.write_str("qsfp28x1"), - Self::Qsfp28x2 => f.write_str("qsfp28x2"), - Self::Sfp28x4 => f.write_str("sfp28x4"), - } - } - } - - impl ::std::str::FromStr for SwitchPortGeometry2 { - type Err = self::error::ConversionError; - fn from_str(value: &str) -> ::std::result::Result { - match value { - "qsfp28x1" => Ok(Self::Qsfp28x1), - "qsfp28x2" => Ok(Self::Qsfp28x2), - "sfp28x4" => Ok(Self::Sfp28x4), - _ => Err("invalid value".into()), - } - } - } - - impl ::std::convert::TryFrom<&str> for SwitchPortGeometry2 { - type Error = self::error::ConversionError; - fn try_from(value: &str) -> ::std::result::Result { - value.parse() - } - } - - impl ::std::convert::TryFrom<&::std::string::String> for SwitchPortGeometry2 { - type Error = self::error::ConversionError; - fn try_from( - value: &::std::string::String, - ) -> ::std::result::Result { - value.parse() - } - } - - impl ::std::convert::TryFrom<::std::string::String> for SwitchPortGeometry2 { - type Error = self::error::ConversionError; - fn try_from( - value: ::std::string::String, - ) -> ::std::result::Result { - value.parse() - } - } - /// A link configuration for a port settings object. /// ///
JSON schema @@ -30208,7 +30256,7 @@ pub mod types { /// { /// "allOf": [ /// { - /// "$ref": "#/components/schemas/TxEqConfig2" + /// "$ref": "#/components/schemas/TxEqConfig" /// } /// ] /// } @@ -30243,7 +30291,7 @@ pub mod types { pub speed: LinkSpeed, /// The tx_eq configuration for this link. #[serde(default, skip_serializing_if = "::std::option::Option::is_none")] - pub tx_eq_config: ::std::option::Option, + pub tx_eq_config: ::std::option::Option, } impl SwitchPortLinkConfig { @@ -30419,8 +30467,7 @@ pub mod types { /// "port", /// "routes", /// "time_created", - /// "time_modified", - /// "vlan_interfaces" + /// "time_modified" /// ], /// "properties": { /// "addresses": { @@ -30502,13 +30549,6 @@ pub mod types { /// "description": "Timestamp when this resource was last modified", /// "type": "string", /// "format": "date-time" - /// }, - /// "vlan_interfaces": { - /// "description": "Vlan interface settings.", - /// "type": "array", - /// "items": { - /// "$ref": "#/components/schemas/SwitchVlanInterfaceConfig" - /// } /// } /// } /// } @@ -30543,8 +30583,6 @@ pub mod types { pub time_created: ::chrono::DateTime<::chrono::offset::Utc>, /// Timestamp when this resource was last modified pub time_modified: ::chrono::DateTime<::chrono::offset::Utc>, - /// Vlan interface settings. - pub vlan_interfaces: ::std::vec::Vec, } impl SwitchPortSettings { @@ -30977,57 +31015,6 @@ pub mod types { } } - /// A switch port VLAN interface configuration for a port settings object. - /// - ///
JSON schema - /// - /// ```json - /// { - /// "description": "A switch port VLAN interface configuration for a port - /// settings object.", - /// "type": "object", - /// "required": [ - /// "interface_config_id", - /// "vlan_id" - /// ], - /// "properties": { - /// "interface_config_id": { - /// "description": "The switch interface configuration this VLAN - /// interface configuration belongs to.", - /// "type": "string", - /// "format": "uuid" - /// }, - /// "vlan_id": { - /// "description": "The virtual network id for this interface that is - /// used for producing and consuming 802.1Q Ethernet tags. This field has a - /// maximum value of 4095 as 802.1Q tags are twelve bits.", - /// "type": "integer", - /// "format": "uint16", - /// "minimum": 0.0 - /// } - /// } - /// } - /// ``` - ///
- #[derive( - :: serde :: Deserialize, :: serde :: Serialize, Clone, Debug, schemars :: JsonSchema, - )] - pub struct SwitchVlanInterfaceConfig { - /// The switch interface configuration this VLAN interface configuration - /// belongs to. - pub interface_config_id: ::uuid::Uuid, - /// The virtual network id for this interface that is used for producing - /// and consuming 802.1Q Ethernet tags. This field has a maximum value - /// of 4095 as 802.1Q tags are twelve bits. - pub vlan_id: u16, - } - - impl SwitchVlanInterfaceConfig { - pub fn builder() -> builder::SwitchVlanInterfaceConfig { - Default::default() - } - } - /// `SystemMetricName` /// ///
JSON schema @@ -32267,57 +32254,81 @@ pub mod types { } } - /// Per-port tx-eq overrides. This can be used to fine-tune the transceiver - /// equalization settings to improve signal integrity. + /// A physical disk that has not yet been adopted by the control plane /// ///
JSON schema /// /// ```json /// { - /// "description": "Per-port tx-eq overrides. This can be used to - /// fine-tune the transceiver equalization settings to improve signal - /// integrity.", + /// "description": "A physical disk that has not yet been adopted by the + /// control plane", /// "type": "object", + /// "required": [ + /// "disk_id", + /// "sled_id", + /// "slot", + /// "variant" + /// ], /// "properties": { - /// "main": { - /// "description": "Main tap", - /// "type": [ - /// "integer", - /// "null" - /// ], - /// "format": "int32" + /// "disk_id": { + /// "$ref": "#/components/schemas/PhysicalDiskManufacturerIdentity" /// }, - /// "post1": { - /// "description": "Post-cursor tap1", - /// "type": [ - /// "integer", - /// "null" - /// ], - /// "format": "int32" + /// "sled_id": { + /// "$ref": "#/components/schemas/SledUuid" /// }, - /// "post2": { - /// "description": "Post-cursor tap2", - /// "type": [ - /// "integer", - /// "null" - /// ], - /// "format": "int32" + /// "slot": { + /// "type": "integer", + /// "format": "int64" /// }, - /// "pre1": { - /// "description": "Pre-cursor tap1", - /// "type": [ - /// "integer", - /// "null" - /// ], - /// "format": "int32" + /// "variant": { + /// "$ref": "#/components/schemas/PhysicalDiskKind" + /// } + /// } + /// } + /// ``` + ///
+ #[derive( + :: serde :: Deserialize, :: serde :: Serialize, Clone, Debug, schemars :: JsonSchema, + )] + pub struct UnadoptedPhysicalDisk { + pub disk_id: PhysicalDiskManufacturerIdentity, + pub sled_id: SledUuid, + pub slot: i64, + pub variant: PhysicalDiskKind, + } + + impl UnadoptedPhysicalDisk { + pub fn builder() -> builder::UnadoptedPhysicalDisk { + Default::default() + } + } + + /// A single page of results + /// + ///
JSON schema + /// + /// ```json + /// { + /// "description": "A single page of results", + /// "type": "object", + /// "required": [ + /// "items" + /// ], + /// "properties": { + /// "items": { + /// "description": "list of items on this page of results", + /// "type": "array", + /// "items": { + /// "$ref": "#/components/schemas/UnadoptedPhysicalDisk" + /// } /// }, - /// "pre2": { - /// "description": "Pre-cursor tap2", + /// "next_page": { + /// "description": "token used to fetch the next page of results (if + /// any)", /// "type": [ - /// "integer", + /// "string", /// "null" - /// ], - /// "format": "int32" + /// ] /// } /// } /// } @@ -32326,38 +32337,16 @@ pub mod types { #[derive( :: serde :: Deserialize, :: serde :: Serialize, Clone, Debug, schemars :: JsonSchema, )] - pub struct TxEqConfig2 { - /// Main tap - #[serde(default, skip_serializing_if = "::std::option::Option::is_none")] - pub main: ::std::option::Option, - /// Post-cursor tap1 - #[serde(default, skip_serializing_if = "::std::option::Option::is_none")] - pub post1: ::std::option::Option, - /// Post-cursor tap2 - #[serde(default, skip_serializing_if = "::std::option::Option::is_none")] - pub post2: ::std::option::Option, - /// Pre-cursor tap1 - #[serde(default, skip_serializing_if = "::std::option::Option::is_none")] - pub pre1: ::std::option::Option, - /// Pre-cursor tap2 + pub struct UnadoptedPhysicalDiskResultsPage { + /// list of items on this page of results + pub items: ::std::vec::Vec, + /// token used to fetch the next page of results (if any) #[serde(default, skip_serializing_if = "::std::option::Option::is_none")] - pub pre2: ::std::option::Option, - } - - impl ::std::default::Default for TxEqConfig2 { - fn default() -> Self { - Self { - main: Default::default(), - post1: Default::default(), - post2: Default::default(), - pre1: Default::default(), - pre2: Default::default(), - } - } + pub next_page: ::std::option::Option<::std::string::String>, } - impl TxEqConfig2 { - pub fn builder() -> builder::TxEqConfig2 { + impl UnadoptedPhysicalDiskResultsPage { + pub fn builder() -> builder::UnadoptedPhysicalDiskResultsPage { Default::default() } } @@ -52718,6 +52707,234 @@ pub mod types { } } + #[derive(Clone, Debug)] + pub struct PhysicalDiskAdoptionRequest { + disk_id: ::std::result::Result< + super::PhysicalDiskManufacturerIdentity, + ::std::string::String, + >, + id: ::std::result::Result< + super::PhysicalDiskAdoptionRequestUuid, + ::std::string::String, + >, + time_created: ::std::result::Result< + ::chrono::DateTime<::chrono::offset::Utc>, + ::std::string::String, + >, + } + + impl ::std::default::Default for PhysicalDiskAdoptionRequest { + fn default() -> Self { + Self { + disk_id: Err("no value supplied for disk_id".to_string()), + id: Err("no value supplied for id".to_string()), + time_created: Err("no value supplied for time_created".to_string()), + } + } + } + + impl PhysicalDiskAdoptionRequest { + pub fn disk_id(mut self, value: T) -> Self + where + T: ::std::convert::TryInto, + T::Error: ::std::fmt::Display, + { + self.disk_id = value + .try_into() + .map_err(|e| format!("error converting supplied value for disk_id: {e}")); + self + } + pub fn id(mut self, value: T) -> Self + where + T: ::std::convert::TryInto, + T::Error: ::std::fmt::Display, + { + self.id = value + .try_into() + .map_err(|e| format!("error converting supplied value for id: {e}")); + self + } + pub fn time_created(mut self, value: T) -> Self + where + T: ::std::convert::TryInto<::chrono::DateTime<::chrono::offset::Utc>>, + T::Error: ::std::fmt::Display, + { + self.time_created = value + .try_into() + .map_err(|e| format!("error converting supplied value for time_created: {e}")); + self + } + } + + impl ::std::convert::TryFrom for super::PhysicalDiskAdoptionRequest { + type Error = super::error::ConversionError; + fn try_from( + value: PhysicalDiskAdoptionRequest, + ) -> ::std::result::Result { + Ok(Self { + disk_id: value.disk_id?, + id: value.id?, + time_created: value.time_created?, + }) + } + } + + impl ::std::convert::From for PhysicalDiskAdoptionRequest { + fn from(value: super::PhysicalDiskAdoptionRequest) -> Self { + Self { + disk_id: Ok(value.disk_id), + id: Ok(value.id), + time_created: Ok(value.time_created), + } + } + } + + #[derive(Clone, Debug)] + pub struct PhysicalDiskAdoptionRequestResultsPage { + items: ::std::result::Result< + ::std::vec::Vec, + ::std::string::String, + >, + next_page: ::std::result::Result< + ::std::option::Option<::std::string::String>, + ::std::string::String, + >, + } + + impl ::std::default::Default for PhysicalDiskAdoptionRequestResultsPage { + fn default() -> Self { + Self { + items: Err("no value supplied for items".to_string()), + next_page: Ok(Default::default()), + } + } + } + + impl PhysicalDiskAdoptionRequestResultsPage { + pub fn items(mut self, value: T) -> Self + where + T: ::std::convert::TryInto<::std::vec::Vec>, + T::Error: ::std::fmt::Display, + { + self.items = value + .try_into() + .map_err(|e| format!("error converting supplied value for items: {e}")); + self + } + pub fn next_page(mut self, value: T) -> Self + where + T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>, + T::Error: ::std::fmt::Display, + { + self.next_page = value + .try_into() + .map_err(|e| format!("error converting supplied value for next_page: {e}")); + self + } + } + + impl ::std::convert::TryFrom + for super::PhysicalDiskAdoptionRequestResultsPage + { + type Error = super::error::ConversionError; + fn try_from( + value: PhysicalDiskAdoptionRequestResultsPage, + ) -> ::std::result::Result { + Ok(Self { + items: value.items?, + next_page: value.next_page?, + }) + } + } + + impl ::std::convert::From + for PhysicalDiskAdoptionRequestResultsPage + { + fn from(value: super::PhysicalDiskAdoptionRequestResultsPage) -> Self { + Self { + items: Ok(value.items), + next_page: Ok(value.next_page), + } + } + } + + #[derive(Clone, Debug)] + pub struct PhysicalDiskManufacturerIdentity { + model: ::std::result::Result<::std::string::String, ::std::string::String>, + serial: ::std::result::Result<::std::string::String, ::std::string::String>, + vendor: ::std::result::Result<::std::string::String, ::std::string::String>, + } + + impl ::std::default::Default for PhysicalDiskManufacturerIdentity { + fn default() -> Self { + Self { + model: Err("no value supplied for model".to_string()), + serial: Err("no value supplied for serial".to_string()), + vendor: Err("no value supplied for vendor".to_string()), + } + } + } + + impl PhysicalDiskManufacturerIdentity { + pub fn model(mut self, value: T) -> Self + where + T: ::std::convert::TryInto<::std::string::String>, + T::Error: ::std::fmt::Display, + { + self.model = value + .try_into() + .map_err(|e| format!("error converting supplied value for model: {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 + } + pub fn vendor(mut self, value: T) -> Self + where + T: ::std::convert::TryInto<::std::string::String>, + T::Error: ::std::fmt::Display, + { + self.vendor = value + .try_into() + .map_err(|e| format!("error converting supplied value for vendor: {e}")); + self + } + } + + impl ::std::convert::TryFrom + for super::PhysicalDiskManufacturerIdentity + { + type Error = super::error::ConversionError; + fn try_from( + value: PhysicalDiskManufacturerIdentity, + ) -> ::std::result::Result { + Ok(Self { + model: value.model?, + serial: value.serial?, + vendor: value.vendor?, + }) + } + } + + impl ::std::convert::From + for PhysicalDiskManufacturerIdentity + { + fn from(value: super::PhysicalDiskManufacturerIdentity) -> Self { + Self { + model: Ok(value.model), + serial: Ok(value.serial), + vendor: Ok(value.vendor), + } + } + } + #[derive(Clone, Debug)] pub struct PhysicalDiskResultsPage { items: @@ -59839,7 +60056,7 @@ pub mod types { pub struct SwitchInterfaceConfig { id: ::std::result::Result<::uuid::Uuid, ::std::string::String>, interface_name: ::std::result::Result, - kind: ::std::result::Result, + kind: ::std::result::Result, port_settings_id: ::std::result::Result<::uuid::Uuid, ::std::string::String>, v6_enabled: ::std::result::Result, } @@ -59879,7 +60096,7 @@ pub mod types { } pub fn kind(mut self, value: T) -> Self where - T: ::std::convert::TryInto, + T: ::std::convert::TryInto, T::Error: ::std::fmt::Display, { self.kind = value @@ -60289,7 +60506,7 @@ pub mod types { #[derive(Clone, Debug)] pub struct SwitchPortConfig { - geometry: ::std::result::Result, + geometry: ::std::result::Result, port_settings_id: ::std::result::Result<::uuid::Uuid, ::std::string::String>, } @@ -60305,7 +60522,7 @@ pub mod types { impl SwitchPortConfig { pub fn geometry(mut self, value: T) -> Self where - T: ::std::convert::TryInto, + T: ::std::convert::TryInto, T::Error: ::std::fmt::Display, { self.geometry = value @@ -60405,7 +60622,7 @@ pub mod types { port_settings_id: ::std::result::Result<::uuid::Uuid, ::std::string::String>, speed: ::std::result::Result, tx_eq_config: ::std::result::Result< - ::std::option::Option, + ::std::option::Option, ::std::string::String, >, } @@ -60498,7 +60715,7 @@ pub mod types { } pub fn tx_eq_config(mut self, value: T) -> Self where - T: ::std::convert::TryInto<::std::option::Option>, + T: ::std::convert::TryInto<::std::option::Option>, T::Error: ::std::fmt::Display, { self.tx_eq_config = value @@ -60754,10 +60971,6 @@ pub mod types { ::chrono::DateTime<::chrono::offset::Utc>, ::std::string::String, >, - vlan_interfaces: ::std::result::Result< - ::std::vec::Vec, - ::std::string::String, - >, } impl ::std::default::Default for SwitchPortSettings { @@ -60775,7 +60988,6 @@ pub mod types { routes: Err("no value supplied for routes".to_string()), time_created: Err("no value supplied for time_created".to_string()), time_modified: Err("no value supplied for time_modified".to_string()), - vlan_interfaces: Err("no value supplied for vlan_interfaces".to_string()), } } } @@ -60901,16 +61113,6 @@ pub mod types { .map_err(|e| format!("error converting supplied value for time_modified: {e}")); self } - pub fn vlan_interfaces(mut self, value: T) -> Self - where - T: ::std::convert::TryInto<::std::vec::Vec>, - T::Error: ::std::fmt::Display, - { - self.vlan_interfaces = value.try_into().map_err(|e| { - format!("error converting supplied value for vlan_interfaces: {e}") - }); - self - } } impl ::std::convert::TryFrom for super::SwitchPortSettings { @@ -60931,7 +61133,6 @@ pub mod types { routes: value.routes?, time_created: value.time_created?, time_modified: value.time_modified?, - vlan_interfaces: value.vlan_interfaces?, }) } } @@ -60951,7 +61152,6 @@ pub mod types { routes: Ok(value.routes), time_created: Ok(value.time_created), time_modified: Ok(value.time_modified), - vlan_interfaces: Ok(value.vlan_interfaces), } } } @@ -61422,67 +61622,6 @@ pub mod types { } } - #[derive(Clone, Debug)] - pub struct SwitchVlanInterfaceConfig { - interface_config_id: ::std::result::Result<::uuid::Uuid, ::std::string::String>, - vlan_id: ::std::result::Result, - } - - impl ::std::default::Default for SwitchVlanInterfaceConfig { - fn default() -> Self { - Self { - interface_config_id: Err( - "no value supplied for interface_config_id".to_string() - ), - vlan_id: Err("no value supplied for vlan_id".to_string()), - } - } - } - - impl SwitchVlanInterfaceConfig { - pub fn interface_config_id(mut self, value: T) -> Self - where - T: ::std::convert::TryInto<::uuid::Uuid>, - T::Error: ::std::fmt::Display, - { - self.interface_config_id = value.try_into().map_err(|e| { - format!("error converting supplied value for interface_config_id: {e}") - }); - self - } - pub fn vlan_id(mut self, value: T) -> Self - where - T: ::std::convert::TryInto, - T::Error: ::std::fmt::Display, - { - self.vlan_id = value - .try_into() - .map_err(|e| format!("error converting supplied value for vlan_id: {e}")); - self - } - } - - impl ::std::convert::TryFrom for super::SwitchVlanInterfaceConfig { - type Error = super::error::ConversionError; - fn try_from( - value: SwitchVlanInterfaceConfig, - ) -> ::std::result::Result { - Ok(Self { - interface_config_id: value.interface_config_id?, - vlan_id: value.vlan_id?, - }) - } - } - - impl ::std::convert::From for SwitchVlanInterfaceConfig { - fn from(value: super::SwitchVlanInterfaceConfig) -> Self { - Self { - interface_config_id: Ok(value.interface_config_id), - vlan_id: Ok(value.vlan_id), - } - } - } - #[derive(Clone, Debug)] pub struct TargetRelease { time_requested: ::std::result::Result< @@ -62238,102 +62377,160 @@ pub mod types { } #[derive(Clone, Debug)] - pub struct TxEqConfig2 { - main: ::std::result::Result<::std::option::Option, ::std::string::String>, - post1: ::std::result::Result<::std::option::Option, ::std::string::String>, - post2: ::std::result::Result<::std::option::Option, ::std::string::String>, - pre1: ::std::result::Result<::std::option::Option, ::std::string::String>, - pre2: ::std::result::Result<::std::option::Option, ::std::string::String>, + pub struct UnadoptedPhysicalDisk { + disk_id: ::std::result::Result< + super::PhysicalDiskManufacturerIdentity, + ::std::string::String, + >, + sled_id: ::std::result::Result, + slot: ::std::result::Result, + variant: ::std::result::Result, } - impl ::std::default::Default for TxEqConfig2 { + impl ::std::default::Default for UnadoptedPhysicalDisk { fn default() -> Self { Self { - main: Ok(Default::default()), - post1: Ok(Default::default()), - post2: Ok(Default::default()), - pre1: Ok(Default::default()), - pre2: Ok(Default::default()), + disk_id: Err("no value supplied for disk_id".to_string()), + sled_id: Err("no value supplied for sled_id".to_string()), + slot: Err("no value supplied for slot".to_string()), + variant: Err("no value supplied for variant".to_string()), } } } - impl TxEqConfig2 { - pub fn main(mut self, value: T) -> Self + impl UnadoptedPhysicalDisk { + pub fn disk_id(mut self, value: T) -> Self where - T: ::std::convert::TryInto<::std::option::Option>, + T: ::std::convert::TryInto, T::Error: ::std::fmt::Display, { - self.main = value + self.disk_id = value .try_into() - .map_err(|e| format!("error converting supplied value for main: {e}")); + .map_err(|e| format!("error converting supplied value for disk_id: {e}")); self } - pub fn post1(mut self, value: T) -> Self + pub fn sled_id(mut self, value: T) -> Self where - T: ::std::convert::TryInto<::std::option::Option>, + T: ::std::convert::TryInto, T::Error: ::std::fmt::Display, { - self.post1 = value + self.sled_id = value .try_into() - .map_err(|e| format!("error converting supplied value for post1: {e}")); + .map_err(|e| format!("error converting supplied value for sled_id: {e}")); self } - pub fn post2(mut self, value: T) -> Self + pub fn slot(mut self, value: T) -> Self where - T: ::std::convert::TryInto<::std::option::Option>, + T: ::std::convert::TryInto, T::Error: ::std::fmt::Display, { - self.post2 = value + self.slot = value .try_into() - .map_err(|e| format!("error converting supplied value for post2: {e}")); + .map_err(|e| format!("error converting supplied value for slot: {e}")); self } - pub fn pre1(mut self, value: T) -> Self + pub fn variant(mut self, value: T) -> Self where - T: ::std::convert::TryInto<::std::option::Option>, + T: ::std::convert::TryInto, T::Error: ::std::fmt::Display, { - self.pre1 = value + self.variant = value .try_into() - .map_err(|e| format!("error converting supplied value for pre1: {e}")); + .map_err(|e| format!("error converting supplied value for variant: {e}")); self } - pub fn pre2(mut self, value: T) -> Self + } + + impl ::std::convert::TryFrom for super::UnadoptedPhysicalDisk { + type Error = super::error::ConversionError; + fn try_from( + value: UnadoptedPhysicalDisk, + ) -> ::std::result::Result { + Ok(Self { + disk_id: value.disk_id?, + sled_id: value.sled_id?, + slot: value.slot?, + variant: value.variant?, + }) + } + } + + impl ::std::convert::From for UnadoptedPhysicalDisk { + fn from(value: super::UnadoptedPhysicalDisk) -> Self { + Self { + disk_id: Ok(value.disk_id), + sled_id: Ok(value.sled_id), + slot: Ok(value.slot), + variant: Ok(value.variant), + } + } + } + + #[derive(Clone, Debug)] + pub struct UnadoptedPhysicalDiskResultsPage { + items: ::std::result::Result< + ::std::vec::Vec, + ::std::string::String, + >, + next_page: ::std::result::Result< + ::std::option::Option<::std::string::String>, + ::std::string::String, + >, + } + + impl ::std::default::Default for UnadoptedPhysicalDiskResultsPage { + fn default() -> Self { + Self { + items: Err("no value supplied for items".to_string()), + next_page: Ok(Default::default()), + } + } + } + + impl UnadoptedPhysicalDiskResultsPage { + pub fn items(mut self, value: T) -> Self where - T: ::std::convert::TryInto<::std::option::Option>, + T: ::std::convert::TryInto<::std::vec::Vec>, T::Error: ::std::fmt::Display, { - self.pre2 = value + self.items = value .try_into() - .map_err(|e| format!("error converting supplied value for pre2: {e}")); + .map_err(|e| format!("error converting supplied value for items: {e}")); + self + } + pub fn next_page(mut self, value: T) -> Self + where + T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>, + T::Error: ::std::fmt::Display, + { + self.next_page = value + .try_into() + .map_err(|e| format!("error converting supplied value for next_page: {e}")); self } } - impl ::std::convert::TryFrom for super::TxEqConfig2 { + impl ::std::convert::TryFrom + for super::UnadoptedPhysicalDiskResultsPage + { type Error = super::error::ConversionError; fn try_from( - value: TxEqConfig2, + value: UnadoptedPhysicalDiskResultsPage, ) -> ::std::result::Result { Ok(Self { - main: value.main?, - post1: value.post1?, - post2: value.post2?, - pre1: value.pre1?, - pre2: value.pre2?, + items: value.items?, + next_page: value.next_page?, }) } } - impl ::std::convert::From for TxEqConfig2 { - fn from(value: super::TxEqConfig2) -> Self { + impl ::std::convert::From + for UnadoptedPhysicalDiskResultsPage + { + fn from(value: super::UnadoptedPhysicalDiskResultsPage) -> Self { Self { - main: Ok(value.main), - post1: Ok(value.post1), - post2: Ok(value.post2), - pre1: Ok(value.pre1), - pre2: Ok(value.pre2), + items: Ok(value.items), + next_page: Ok(value.next_page), } } } @@ -65810,7 +66007,7 @@ pub mod types { /// /// API for interacting with the Oxide control plane /// -/// Version: 2026043000.0.0 +/// Version: 2026050800.0.0 pub struct Client { pub(crate) baseurl: String, pub(crate) client: reqwest::Client, @@ -65851,7 +66048,7 @@ impl Client { impl ClientInfo<()> for Client { fn api_version() -> &'static str { - "2026043000.0.0" + "2026050800.0.0" } fn baseurl(&self) -> &str { @@ -69356,6 +69553,52 @@ impl ClientSystemAuditLogExt for Client { /// unit of expansion of an Oxide deployment. Racks are in turn composed of /// sleds, switches, power supplies, and a cabled backplane. pub trait ClientSystemHardwareExt { + /// Enable adoption of a physical disk for general use + /// + /// Sends a `PUT` request to `/v1/system/hardware/disk-adoption-request` + /// + /// ```ignore + /// let response = client.physical_disk_enable_adoption() + /// .body(body) + /// .send() + /// .await; + /// ``` + fn physical_disk_enable_adoption(&self) -> builder::PhysicalDiskEnableAdoption<'_>; + /// Disable adoption of a physical disk for general use + /// + /// Sends a `DELETE` request to + /// `/v1/system/hardware/disk-adoption-request/ + /// {physical_disk_adoption_req_id}` + /// + /// Arguments: + /// - `physical_disk_adoption_req_id`: ID of the physical disk adoption + /// request + /// ```ignore + /// let response = client.physical_disk_disable_adoption() + /// .physical_disk_adoption_req_id(physical_disk_adoption_req_id) + /// .send() + /// .await; + /// ``` + fn physical_disk_disable_adoption(&self) -> builder::PhysicalDiskDisableAdoption<'_>; + /// List physical disk adoption requests + /// + /// Sends a `GET` request to `/v1/system/hardware/disk-adoption-requests` + /// + /// Arguments: + /// - `limit`: Maximum number of items returned by a single call + /// - `page_token`: Token returned by previous call to retrieve the + /// subsequent page + /// - `sort_by` + /// ```ignore + /// let response = client.physical_disk_list_adoption_requests() + /// .limit(limit) + /// .page_token(page_token) + /// .sort_by(sort_by) + /// .send() + /// .await; + /// ``` + fn physical_disk_list_adoption_requests(&self) + -> builder::PhysicalDiskListAdoptionRequests<'_>; /// List physical disks /// /// Sends a `GET` request to `/v1/system/hardware/disks` @@ -69387,6 +69630,22 @@ pub trait ClientSystemHardwareExt { /// .await; /// ``` fn physical_disk_view(&self) -> builder::PhysicalDiskView<'_>; + /// List physical disks that have not yet been adopted for use + /// + /// Sends a `GET` request to `/v1/system/hardware/disks-unadopted` + /// + /// Arguments: + /// - `limit`: Maximum number of items returned by a single call + /// - `page_token`: Token returned by previous call to retrieve the + /// subsequent page + /// ```ignore + /// let response = client.physical_disk_list_unadopted() + /// .limit(limit) + /// .page_token(page_token) + /// .send() + /// .await; + /// ``` + fn physical_disk_list_unadopted(&self) -> builder::PhysicalDiskListUnadopted<'_>; /// List racks /// /// Sends a `GET` request to `/v1/system/hardware/racks` @@ -69638,6 +69897,20 @@ pub trait ClientSystemHardwareExt { } impl ClientSystemHardwareExt for Client { + fn physical_disk_enable_adoption(&self) -> builder::PhysicalDiskEnableAdoption<'_> { + builder::PhysicalDiskEnableAdoption::new(self) + } + + fn physical_disk_disable_adoption(&self) -> builder::PhysicalDiskDisableAdoption<'_> { + builder::PhysicalDiskDisableAdoption::new(self) + } + + fn physical_disk_list_adoption_requests( + &self, + ) -> builder::PhysicalDiskListAdoptionRequests<'_> { + builder::PhysicalDiskListAdoptionRequests::new(self) + } + fn physical_disk_list(&self) -> builder::PhysicalDiskList<'_> { builder::PhysicalDiskList::new(self) } @@ -69646,6 +69919,10 @@ impl ClientSystemHardwareExt for Client { builder::PhysicalDiskView::new(self) } + fn physical_disk_list_unadopted(&self) -> builder::PhysicalDiskListUnadopted<'_> { + builder::PhysicalDiskListUnadopted::new(self) + } + fn rack_list(&self) -> builder::RackList<'_> { builder::RackList::new(self) } @@ -90122,6 +90399,341 @@ pub mod builder { } } + /// Builder for [`ClientSystemHardwareExt::physical_disk_enable_adoption`] + /// + /// [`ClientSystemHardwareExt::physical_disk_enable_adoption`]: super::ClientSystemHardwareExt::physical_disk_enable_adoption + #[derive(Debug, Clone)] + pub struct PhysicalDiskEnableAdoption<'a> { + client: &'a super::Client, + body: Result, + } + + impl<'a> PhysicalDiskEnableAdoption<'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 `PhysicalDiskManufacturerIdentity` for body failed: {}", + s + ) + }); + self + } + + pub fn body_map(mut self, f: F) -> Self + where + F: std::ops::FnOnce( + types::builder::PhysicalDiskManufacturerIdentity, + ) -> types::builder::PhysicalDiskManufacturerIdentity, + { + self.body = self.body.map(f); + self + } + + /// Sends a `PUT` request to `/v1/system/hardware/disk-adoption-request` + pub async fn send( + self, + ) -> Result, Error> + { + let Self { client, body } = self; + let body = body + .and_then(|v| { + types::PhysicalDiskManufacturerIdentity::try_from(v).map_err(|e| e.to_string()) + }) + .map_err(Error::InvalidRequest)?; + let url = format!( + "{}/v1/system/hardware/disk-adoption-request", + 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 + .put(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .json(&body) + .headers(header_map) + .build()?; + let info = OperationInfo { + operation_id: "physical_disk_enable_adoption", + }; + 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::physical_disk_disable_adoption`] + /// + /// [`ClientSystemHardwareExt::physical_disk_disable_adoption`]: super::ClientSystemHardwareExt::physical_disk_disable_adoption + #[derive(Debug, Clone)] + pub struct PhysicalDiskDisableAdoption<'a> { + client: &'a super::Client, + physical_disk_adoption_req_id: Result<::uuid::Uuid, String>, + } + + impl<'a> PhysicalDiskDisableAdoption<'a> { + pub fn new(client: &'a super::Client) -> Self { + Self { + client: client, + physical_disk_adoption_req_id: Err("physical_disk_adoption_req_id was not \ + initialized" + .to_string()), + } + } + + pub fn physical_disk_adoption_req_id(mut self, value: V) -> Self + where + V: std::convert::TryInto<::uuid::Uuid>, + { + self.physical_disk_adoption_req_id = value.try_into().map_err(|_| { + "conversion to `:: uuid :: Uuid` for physical_disk_adoption_req_id failed" + .to_string() + }); + self + } + + /// Sends a `DELETE` request to + /// `/v1/system/hardware/disk-adoption-request/ + /// {physical_disk_adoption_req_id}` + pub async fn send(self) -> Result, Error> { + let Self { + client, + physical_disk_adoption_req_id, + } = self; + let physical_disk_adoption_req_id = + physical_disk_adoption_req_id.map_err(Error::InvalidRequest)?; + let url = format!( + "{}/v1/system/hardware/disk-adoption-request/{}", + client.baseurl, + encode_path(&physical_disk_adoption_req_id.to_string()), + ); + 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 + .delete(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) + .build()?; + let info = OperationInfo { + operation_id: "physical_disk_disable_adoption", + }; + 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() { + 204u16 => Ok(ResponseValue::empty(response)), + 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::physical_disk_list_adoption_requests`] + /// + /// [`ClientSystemHardwareExt::physical_disk_list_adoption_requests`]: super::ClientSystemHardwareExt::physical_disk_list_adoption_requests + #[derive(Debug, Clone)] + pub struct PhysicalDiskListAdoptionRequests<'a> { + client: &'a super::Client, + limit: Result, String>, + page_token: Result, String>, + sort_by: Result, String>, + } + + impl<'a> PhysicalDiskListAdoptionRequests<'a> { + pub fn new(client: &'a super::Client) -> Self { + Self { + client: client, + limit: Ok(None), + page_token: Ok(None), + sort_by: Ok(None), + } + } + + pub fn limit(mut self, value: V) -> Self + where + V: std::convert::TryInto<::std::num::NonZeroU32>, + { + self.limit = value.try_into().map(Some).map_err(|_| { + "conversion to `:: std :: num :: NonZeroU32` for limit failed".to_string() + }); + self + } + + pub fn page_token(mut self, value: V) -> Self + where + V: std::convert::TryInto<::std::string::String>, + { + self.page_token = value.try_into().map(Some).map_err(|_| { + "conversion to `:: std :: string :: String` for page_token failed".to_string() + }); + self + } + + pub fn sort_by(mut self, value: V) -> Self + where + V: std::convert::TryInto, + { + self.sort_by = value + .try_into() + .map(Some) + .map_err(|_| "conversion to `IdSortMode` for sort_by failed".to_string()); + self + } + + /// Sends a `GET` request to + /// `/v1/system/hardware/disk-adoption-requests` + pub async fn send( + self, + ) -> Result, Error> + { + let Self { + client, + limit, + page_token, + sort_by, + } = self; + let limit = limit.map_err(Error::InvalidRequest)?; + let page_token = page_token.map_err(Error::InvalidRequest)?; + let sort_by = sort_by.map_err(Error::InvalidRequest)?; + let url = format!( + "{}/v1/system/hardware/disk-adoption-requests", + 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 + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .query(&progenitor_client::QueryParam::new("limit", &limit)) + .query(&progenitor_client::QueryParam::new( + "page_token", + &page_token, + )) + .query(&progenitor_client::QueryParam::new("sort_by", &sort_by)) + .headers(header_map) + .build()?; + let info = OperationInfo { + operation_id: "physical_disk_list_adoption_requests", + }; + 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() { + 200u16 => 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)), + } + } + + /// Streams `GET` requests to + /// `/v1/system/hardware/disk-adoption-requests` + pub fn stream( + self, + ) -> impl futures::Stream< + Item = Result>, + > + Unpin + + 'a { + use ::futures::StreamExt; + use ::futures::TryFutureExt; + use ::futures::TryStreamExt; + let next = Self { + page_token: Ok(None), + sort_by: Ok(None), + ..self.clone() + }; + self.send() + .map_ok(move |page| { + let page = page.into_inner(); + let first = futures::stream::iter(page.items).map(Ok); + let rest = futures::stream::try_unfold( + (page.next_page, next), + |(next_page, next)| async { + if next_page.is_none() { + Ok(None) + } else { + Self { + page_token: Ok(next_page), + ..next.clone() + } + .send() + .map_ok(|page| { + let page = page.into_inner(); + Some(( + futures::stream::iter(page.items).map(Ok), + (page.next_page, next), + )) + }) + .await + } + }, + ) + .try_flatten(); + first.chain(rest) + }) + .try_flatten_stream() + .boxed() + } + } + /// Builder for [`ClientSystemHardwareExt::physical_disk_list`] /// /// [`ClientSystemHardwareExt::physical_disk_list`]: super::ClientSystemHardwareExt::physical_disk_list @@ -90346,6 +90958,144 @@ pub mod builder { } } + /// Builder for [`ClientSystemHardwareExt::physical_disk_list_unadopted`] + /// + /// [`ClientSystemHardwareExt::physical_disk_list_unadopted`]: super::ClientSystemHardwareExt::physical_disk_list_unadopted + #[derive(Debug, Clone)] + pub struct PhysicalDiskListUnadopted<'a> { + client: &'a super::Client, + limit: Result, String>, + page_token: Result, String>, + } + + impl<'a> PhysicalDiskListUnadopted<'a> { + pub fn new(client: &'a super::Client) -> Self { + Self { + client: client, + limit: Ok(None), + page_token: Ok(None), + } + } + + pub fn limit(mut self, value: V) -> Self + where + V: std::convert::TryInto<::std::num::NonZeroU32>, + { + self.limit = value.try_into().map(Some).map_err(|_| { + "conversion to `:: std :: num :: NonZeroU32` for limit failed".to_string() + }); + self + } + + pub fn page_token(mut self, value: V) -> Self + where + V: std::convert::TryInto<::std::string::String>, + { + self.page_token = value.try_into().map(Some).map_err(|_| { + "conversion to `:: std :: string :: String` for page_token failed".to_string() + }); + self + } + + /// Sends a `GET` request to `/v1/system/hardware/disks-unadopted` + pub async fn send( + self, + ) -> Result, Error> + { + let Self { + client, + limit, + page_token, + } = self; + let limit = limit.map_err(Error::InvalidRequest)?; + let page_token = page_token.map_err(Error::InvalidRequest)?; + let url = format!("{}/v1/system/hardware/disks-unadopted", 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 + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .query(&progenitor_client::QueryParam::new("limit", &limit)) + .query(&progenitor_client::QueryParam::new( + "page_token", + &page_token, + )) + .headers(header_map) + .build()?; + let info = OperationInfo { + operation_id: "physical_disk_list_unadopted", + }; + 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() { + 200u16 => 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)), + } + } + + /// Streams `GET` requests to `/v1/system/hardware/disks-unadopted` + pub fn stream( + self, + ) -> impl futures::Stream>> + + Unpin + + 'a { + use ::futures::StreamExt; + use ::futures::TryFutureExt; + use ::futures::TryStreamExt; + let next = Self { + page_token: Ok(None), + ..self.clone() + }; + self.send() + .map_ok(move |page| { + let page = page.into_inner(); + let first = futures::stream::iter(page.items).map(Ok); + let rest = futures::stream::try_unfold( + (page.next_page, next), + |(next_page, next)| async { + if next_page.is_none() { + Ok(None) + } else { + Self { + page_token: Ok(next_page), + ..next.clone() + } + .send() + .map_ok(|page| { + let page = page.into_inner(); + Some(( + futures::stream::iter(page.items).map(Ok), + (page.next_page, next), + )) + }) + .await + } + }, + ) + .try_flatten(); + first.chain(rest) + }) + .try_flatten_stream() + .boxed() + } + } + /// Builder for /// [`ClientSystemNetworkingExt::networking_switch_port_lldp_neighbors`] ///