From c27c3e8694cfa80dba8b1233b44de77fa4119cc4 Mon Sep 17 00:00:00 2001 From: "oxide-reflector-bot[bot]" <130185838+oxide-reflector-bot[bot]@users.noreply.github.com> Date: Wed, 5 Nov 2025 17:31:21 +0000 Subject: [PATCH 01/10] Rebuilt with latest dependency updates --- oxide.json | 2 +- sdk/src/generated_sdk.rs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/oxide.json b/oxide.json index 04c6ccc7..85e943a9 100644 --- a/oxide.json +++ b/oxide.json @@ -7,7 +7,7 @@ "url": "https://oxide.computer", "email": "api@oxide.computer" }, - "version": "20251008.0.0" + "version": "20251208.0.0" }, "paths": { "/device/auth": { diff --git a/sdk/src/generated_sdk.rs b/sdk/src/generated_sdk.rs index b5cd4db6..f63e394e 100644 --- a/sdk/src/generated_sdk.rs +++ b/sdk/src/generated_sdk.rs @@ -61716,7 +61716,7 @@ pub mod types { /// /// API for interacting with the Oxide control plane /// -/// Version: 20251008.0.0 +/// Version: 20251208.0.0 pub struct Client { pub(crate) baseurl: String, pub(crate) client: reqwest::Client, @@ -61757,7 +61757,7 @@ impl Client { impl ClientInfo<()> for Client { fn api_version() -> &'static str { - "20251008.0.0" + "20251208.0.0" } fn baseurl(&self) -> &str { From b7246ac14122a3c70560e7815b7168efca0db987 Mon Sep 17 00:00:00 2001 From: "oxide-reflector-bot[bot]" <130185838+oxide-reflector-bot[bot]@users.noreply.github.com> Date: Mon, 10 Nov 2025 21:25:58 +0000 Subject: [PATCH 02/10] Rebuilt with latest dependency updates --- oxide.json | 42 +++-------- sdk/src/generated_sdk.rs | 156 ++++++++++++--------------------------- 2 files changed, 60 insertions(+), 138 deletions(-) diff --git a/oxide.json b/oxide.json index 85e943a9..e658f2c1 100644 --- a/oxide.json +++ b/oxide.json @@ -18226,27 +18226,18 @@ }, "p50": { "nullable": true, - "allOf": [ - { - "$ref": "#/components/schemas/Quantile" - } - ] + "type": "number", + "format": "double" }, "p90": { "nullable": true, - "allOf": [ - { - "$ref": "#/components/schemas/Quantile" - } - ] + "type": "number", + "format": "double" }, "p99": { "nullable": true, - "allOf": [ - { - "$ref": "#/components/schemas/Quantile" - } - ] + "type": "number", + "format": "double" }, "squared_mean": { "type": "number", @@ -18295,27 +18286,18 @@ }, "p50": { "nullable": true, - "allOf": [ - { - "$ref": "#/components/schemas/Quantile" - } - ] + "type": "number", + "format": "double" }, "p90": { "nullable": true, - "allOf": [ - { - "$ref": "#/components/schemas/Quantile" - } - ] + "type": "number", + "format": "double" }, "p99": { "nullable": true, - "allOf": [ - { - "$ref": "#/components/schemas/Quantile" - } - ] + "type": "number", + "format": "double" }, "squared_mean": { "type": "number", diff --git a/sdk/src/generated_sdk.rs b/sdk/src/generated_sdk.rs index f63e394e..b5917bef 100644 --- a/sdk/src/generated_sdk.rs +++ b/sdk/src/generated_sdk.rs @@ -9622,46 +9622,25 @@ pub mod types { /// "format": "double" /// }, /// "p50": { - /// "oneOf": [ - /// { - /// "type": "null" - /// }, - /// { - /// "allOf": [ - /// { - /// "$ref": "#/components/schemas/Quantile" - /// } - /// ] - /// } - /// ] + /// "type": [ + /// "number", + /// "null" + /// ], + /// "format": "double" /// }, /// "p90": { - /// "oneOf": [ - /// { - /// "type": "null" - /// }, - /// { - /// "allOf": [ - /// { - /// "$ref": "#/components/schemas/Quantile" - /// } - /// ] - /// } - /// ] + /// "type": [ + /// "number", + /// "null" + /// ], + /// "format": "double" /// }, /// "p99": { - /// "oneOf": [ - /// { - /// "type": "null" - /// }, - /// { - /// "allOf": [ - /// { - /// "$ref": "#/components/schemas/Quantile" - /// } - /// ] - /// } - /// ] + /// "type": [ + /// "number", + /// "null" + /// ], + /// "format": "double" /// }, /// "squared_mean": { /// "type": "number", @@ -9686,11 +9665,11 @@ pub mod types { #[serde(default, skip_serializing_if = "::std::option::Option::is_none")] pub min: ::std::option::Option, #[serde(default, skip_serializing_if = "::std::option::Option::is_none")] - pub p50: ::std::option::Option, + pub p50: ::std::option::Option, #[serde(default, skip_serializing_if = "::std::option::Option::is_none")] - pub p90: ::std::option::Option, + pub p90: ::std::option::Option, #[serde(default, skip_serializing_if = "::std::option::Option::is_none")] - pub p99: ::std::option::Option, + pub p99: ::std::option::Option, pub squared_mean: f64, pub sum_of_samples: f64, } @@ -9761,46 +9740,25 @@ pub mod types { /// "format": "int64" /// }, /// "p50": { - /// "oneOf": [ - /// { - /// "type": "null" - /// }, - /// { - /// "allOf": [ - /// { - /// "$ref": "#/components/schemas/Quantile" - /// } - /// ] - /// } - /// ] + /// "type": [ + /// "number", + /// "null" + /// ], + /// "format": "double" /// }, /// "p90": { - /// "oneOf": [ - /// { - /// "type": "null" - /// }, - /// { - /// "allOf": [ - /// { - /// "$ref": "#/components/schemas/Quantile" - /// } - /// ] - /// } - /// ] + /// "type": [ + /// "number", + /// "null" + /// ], + /// "format": "double" /// }, /// "p99": { - /// "oneOf": [ - /// { - /// "type": "null" - /// }, - /// { - /// "allOf": [ - /// { - /// "$ref": "#/components/schemas/Quantile" - /// } - /// ] - /// } - /// ] + /// "type": [ + /// "number", + /// "null" + /// ], + /// "format": "double" /// }, /// "squared_mean": { /// "type": "number", @@ -9825,11 +9783,11 @@ pub mod types { #[serde(default, skip_serializing_if = "::std::option::Option::is_none")] pub min: ::std::option::Option, #[serde(default, skip_serializing_if = "::std::option::Option::is_none")] - pub p50: ::std::option::Option, + pub p50: ::std::option::Option, #[serde(default, skip_serializing_if = "::std::option::Option::is_none")] - pub p90: ::std::option::Option, + pub p90: ::std::option::Option, #[serde(default, skip_serializing_if = "::std::option::Option::is_none")] - pub p99: ::std::option::Option, + pub p99: ::std::option::Option, pub squared_mean: f64, pub sum_of_samples: i64, } @@ -41808,18 +41766,9 @@ pub mod types { counts: ::std::result::Result<::std::vec::Vec, ::std::string::String>, max: ::std::result::Result<::std::option::Option, ::std::string::String>, min: ::std::result::Result<::std::option::Option, ::std::string::String>, - p50: ::std::result::Result< - ::std::option::Option, - ::std::string::String, - >, - p90: ::std::result::Result< - ::std::option::Option, - ::std::string::String, - >, - p99: ::std::result::Result< - ::std::option::Option, - ::std::string::String, - >, + p50: ::std::result::Result<::std::option::Option, ::std::string::String>, + p90: ::std::result::Result<::std::option::Option, ::std::string::String>, + p99: ::std::result::Result<::std::option::Option, ::std::string::String>, squared_mean: ::std::result::Result, sum_of_samples: ::std::result::Result, } @@ -41883,7 +41832,7 @@ pub mod types { } pub fn p50(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.p50 = value @@ -41893,7 +41842,7 @@ pub mod types { } pub fn p90(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.p90 = value @@ -41903,7 +41852,7 @@ pub mod types { } pub fn p99(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.p99 = value @@ -41974,18 +41923,9 @@ pub mod types { counts: ::std::result::Result<::std::vec::Vec, ::std::string::String>, max: ::std::result::Result<::std::option::Option, ::std::string::String>, min: ::std::result::Result<::std::option::Option, ::std::string::String>, - p50: ::std::result::Result< - ::std::option::Option, - ::std::string::String, - >, - p90: ::std::result::Result< - ::std::option::Option, - ::std::string::String, - >, - p99: ::std::result::Result< - ::std::option::Option, - ::std::string::String, - >, + p50: ::std::result::Result<::std::option::Option, ::std::string::String>, + p90: ::std::result::Result<::std::option::Option, ::std::string::String>, + p99: ::std::result::Result<::std::option::Option, ::std::string::String>, squared_mean: ::std::result::Result, sum_of_samples: ::std::result::Result, } @@ -42049,7 +41989,7 @@ pub mod types { } pub fn p50(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.p50 = value @@ -42059,7 +41999,7 @@ pub mod types { } pub fn p90(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.p90 = value @@ -42069,7 +42009,7 @@ pub mod types { } pub fn p99(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.p99 = value From 50cc707dc31d0ac8e0dface60579b597fb6252e7 Mon Sep 17 00:00:00 2001 From: "oxide-reflector-bot[bot]" <130185838+oxide-reflector-bot[bot]@users.noreply.github.com> Date: Tue, 11 Nov 2025 00:15:07 +0000 Subject: [PATCH 03/10] Rebuilt with latest dependency updates --- Cargo.lock | 80 +++++++++++++++++++++++++++--------------------------- 1 file changed, 40 insertions(+), 40 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 8739b416..7a5f0ddc 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -317,7 +317,7 @@ checksum = "c7c24de15d275a1ecfd47a380fb4d5ec9bfe0933f309ed5e705b775596a3574d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.108", + "syn 2.0.110", ] [[package]] @@ -334,7 +334,7 @@ checksum = "9035ad2d096bed7955a320ee7e2230574d28fd3c3a0f186cbea1ff3c7eed5dbb" dependencies = [ "proc-macro2", "quote", - "syn 2.0.108", + "syn 2.0.110", ] [[package]] @@ -585,7 +585,7 @@ dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.108", + "syn 2.0.110", ] [[package]] @@ -798,7 +798,7 @@ dependencies = [ "proc-macro2", "quote", "strsim", - "syn 2.0.108", + "syn 2.0.110", ] [[package]] @@ -809,7 +809,7 @@ checksum = "fc34b93ccb385b40dc71c6fceac4b2ad23662c7eeb248cf10d529b7e055b6ead" dependencies = [ "darling_core", "quote", - "syn 2.0.108", + "syn 2.0.110", ] [[package]] @@ -841,7 +841,7 @@ checksum = "30542c1ad912e0e3d22a1935c290e12e8a29d704a420177a31faad4a601a0800" dependencies = [ "proc-macro2", "quote", - "syn 2.0.108", + "syn 2.0.110", ] [[package]] @@ -862,7 +862,7 @@ dependencies = [ "convert_case", "proc-macro2", "quote", - "syn 2.0.108", + "syn 2.0.110", ] [[package]] @@ -949,7 +949,7 @@ checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.108", + "syn 2.0.110", ] [[package]] @@ -1029,7 +1029,7 @@ dependencies = [ "semver", "serde", "serde_tokenstream", - "syn 2.0.108", + "syn 2.0.110", ] [[package]] @@ -1302,7 +1302,7 @@ checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" dependencies = [ "proc-macro2", "quote", - "syn 2.0.108", + "syn 2.0.110", ] [[package]] @@ -1866,7 +1866,7 @@ dependencies = [ "indoc", "proc-macro2", "quote", - "syn 2.0.108", + "syn 2.0.110", ] [[package]] @@ -1986,7 +1986,7 @@ checksum = "6c6e1db7ed32c6c71b759497fae34bf7933636f75a251b9e736555da426f6442" dependencies = [ "proc-macro2", "quote", - "syn 2.0.108", + "syn 2.0.110", ] [[package]] @@ -2409,7 +2409,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.108", + "syn 2.0.110", ] [[package]] @@ -2777,7 +2777,7 @@ dependencies = [ [[package]] name = "progenitor" version = "0.11.2" -source = "git+https://github.com/oxidecomputer/progenitor#91bb0f4a755eb9540c980fcee97ee884e33a7f65" +source = "git+https://github.com/oxidecomputer/progenitor#9d0d23f3bb44defc2f5c62986137946bc1b3f157" dependencies = [ "progenitor-impl", ] @@ -2800,7 +2800,7 @@ dependencies = [ [[package]] name = "progenitor-impl" version = "0.11.2" -source = "git+https://github.com/oxidecomputer/progenitor#91bb0f4a755eb9540c980fcee97ee884e33a7f65" +source = "git+https://github.com/oxidecomputer/progenitor#9d0d23f3bb44defc2f5c62986137946bc1b3f157" dependencies = [ "heck", "http 1.3.1", @@ -2812,7 +2812,7 @@ dependencies = [ "schemars", "serde", "serde_json", - "syn 2.0.108", + "syn 2.0.110", "thiserror 2.0.17", "typify", "unicode-ident", @@ -2875,9 +2875,9 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.41" +version = "1.0.42" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce25767e7b499d1b604768e7cde645d14cc8584231ea6b295e9c9eb22c02e1d1" +checksum = "a338cc41d27e6cc6dce6cefc13a0729dfbb81c262b1f519331575dd80ef3067f" dependencies = [ "proc-macro2", ] @@ -3288,7 +3288,7 @@ dependencies = [ "proc-macro2", "quote", "serde_derive_internals", - "syn 2.0.108", + "syn 2.0.110", ] [[package]] @@ -3357,7 +3357,7 @@ checksum = "d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79" dependencies = [ "proc-macro2", "quote", - "syn 2.0.108", + "syn 2.0.110", ] [[package]] @@ -3368,7 +3368,7 @@ checksum = "18d26a20a969b9e3fdf2fc2d9f21eda6c40e2de84c9408bb5d3b05d499aae711" dependencies = [ "proc-macro2", "quote", - "syn 2.0.108", + "syn 2.0.110", ] [[package]] @@ -3431,7 +3431,7 @@ dependencies = [ "proc-macro2", "quote", "serde", - "syn 2.0.108", + "syn 2.0.110", ] [[package]] @@ -3686,7 +3686,7 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.108", + "syn 2.0.110", ] [[package]] @@ -3724,9 +3724,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.108" +version = "2.0.110" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da58917d35242480a05c2897064da0a80589a2a0476c9a3f2fdc83b53502e917" +checksum = "a99801b5bd34ede4cf3fc688c5919368fea4e4814a4664359503e6015b280aea" dependencies = [ "proc-macro2", "quote", @@ -3750,7 +3750,7 @@ checksum = "728a70f3dbaf5bab7f0c4b1ac8d7ae5ea60a4b5549c8a5914361c99147a709d2" dependencies = [ "proc-macro2", "quote", - "syn 2.0.108", + "syn 2.0.110", ] [[package]] @@ -3885,7 +3885,7 @@ checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.108", + "syn 2.0.110", ] [[package]] @@ -3896,7 +3896,7 @@ checksum = "3ff15c8ecd7de3849db632e14d18d2571fa09dfc5ed93479bc4485c7a517c913" dependencies = [ "proc-macro2", "quote", - "syn 2.0.108", + "syn 2.0.110", ] [[package]] @@ -4017,7 +4017,7 @@ checksum = "af407857209536a95c8e56f8231ef2c2e2aff839b22e07a1ffcbc617e9db9fa5" dependencies = [ "proc-macro2", "quote", - "syn 2.0.108", + "syn 2.0.110", ] [[package]] @@ -4246,7 +4246,7 @@ checksum = "1b1ffbcf9c6f6b99d386e7444eb608ba646ae452a36b39737deb9663b610f662" dependencies = [ "proc-macro2", "quote", - "syn 2.0.108", + "syn 2.0.110", ] [[package]] @@ -4357,7 +4357,7 @@ dependencies = [ "semver", "serde", "serde_json", - "syn 2.0.108", + "syn 2.0.110", "thiserror 2.0.17", "unicode-ident", ] @@ -4375,7 +4375,7 @@ dependencies = [ "serde", "serde_json", "serde_tokenstream", - "syn 2.0.108", + "syn 2.0.110", "typify-impl", ] @@ -4572,7 +4572,7 @@ dependencies = [ "log", "proc-macro2", "quote", - "syn 2.0.108", + "syn 2.0.110", "wasm-bindgen-shared", ] @@ -4607,7 +4607,7 @@ checksum = "8ae87ea40c9f689fc23f209965b6fb8a99ad69aeeb0231408be24920604395de" dependencies = [ "proc-macro2", "quote", - "syn 2.0.108", + "syn 2.0.110", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -4715,7 +4715,7 @@ checksum = "a47fddd13af08290e67f4acabf4b459f647552718f683a7b415d290ac744a836" dependencies = [ "proc-macro2", "quote", - "syn 2.0.108", + "syn 2.0.110", ] [[package]] @@ -4726,7 +4726,7 @@ checksum = "bd9211b69f8dcdfa817bfd14bf1c97c9188afa36f4750130fcdf3f400eca9fa8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.108", + "syn 2.0.110", ] [[package]] @@ -5007,7 +5007,7 @@ checksum = "38da3c9736e16c5d3c8c597a9aaa5d1fa565d0532ae05e27c24aa62fb32c0ab6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.108", + "syn 2.0.110", "synstructure", ] @@ -5028,7 +5028,7 @@ checksum = "28a6e20d751156648aa063f3800b706ee209a32c0b4d9f24be3d980b01be55ef" dependencies = [ "proc-macro2", "quote", - "syn 2.0.108", + "syn 2.0.110", ] [[package]] @@ -5048,7 +5048,7 @@ checksum = "d71e5d6e06ab090c67b5e44993ec16b72dcbaabc526db883a360057678b48502" dependencies = [ "proc-macro2", "quote", - "syn 2.0.108", + "syn 2.0.110", "synstructure", ] @@ -5088,7 +5088,7 @@ checksum = "5b96237efa0c878c64bd89c436f661be4e46b2f3eff1ebb976f7ef2321d2f58f" dependencies = [ "proc-macro2", "quote", - "syn 2.0.108", + "syn 2.0.110", ] [[package]] From 4ec541860da2bbaa6c8d393f72071dcbd27e1211 Mon Sep 17 00:00:00 2001 From: "oxide-reflector-bot[bot]" <130185838+oxide-reflector-bot[bot]@users.noreply.github.com> Date: Tue, 11 Nov 2025 17:19:37 +0000 Subject: [PATCH 04/10] Rebuilt with latest dependency updates --- oxide.json | 10 ++++ sdk/src/generated_sdk.rs | 99 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 109 insertions(+) diff --git a/oxide.json b/oxide.json index e658f2c1..5800b1c9 100644 --- a/oxide.json +++ b/oxide.json @@ -17777,6 +17777,9 @@ "device_path": { "type": "string" }, + "disk_type": { + "$ref": "#/components/schemas/DiskType" + }, "id": { "description": "unique, immutable, system-controlled identifier for each resource", "type": "string", @@ -17827,6 +17830,7 @@ "block_size", "description", "device_path", + "disk_type", "id", "name", "project_id", @@ -18195,6 +18199,12 @@ } ] }, + "DiskType": { + "type": "string", + "enum": [ + "crucible" + ] + }, "Distributiondouble": { "description": "A distribution is a sequence of bins and counts in those bins, and some statistical information tracked to compute the mean, standard deviation, and quantile estimates.\n\nMin, max, and the p-* quantiles are treated as optional due to the possibility of distribution operations, like subtraction.", "type": "object", diff --git a/sdk/src/generated_sdk.rs b/sdk/src/generated_sdk.rs index b5917bef..d6015bf5 100644 --- a/sdk/src/generated_sdk.rs +++ b/sdk/src/generated_sdk.rs @@ -8917,6 +8917,7 @@ pub mod types { /// "block_size", /// "description", /// "device_path", + /// "disk_type", /// "id", /// "name", /// "project_id", @@ -8936,6 +8937,9 @@ pub mod types { /// "device_path": { /// "type": "string" /// }, + /// "disk_type": { + /// "$ref": "#/components/schemas/DiskType" + /// }, /// "id": { /// "description": "unique, immutable, system-controlled identifier for /// each resource", @@ -9000,6 +9004,7 @@ pub mod types { /// human-readable free-form text about a resource pub description: ::std::string::String, pub device_path: ::std::string::String, + pub disk_type: DiskType, /// unique, immutable, system-controlled identifier for each resource pub id: ::uuid::Uuid, /// ID of image from which disk was created, if any @@ -9568,6 +9573,86 @@ pub mod types { } } + /// `DiskType` + /// + ///
JSON schema + /// + /// ```json + /// { + /// "type": "string", + /// "enum": [ + /// "crucible" + /// ] + /// } + /// ``` + ///
+ #[derive( + :: serde :: Deserialize, + :: serde :: Serialize, + Clone, + Copy, + Debug, + Eq, + Hash, + Ord, + PartialEq, + PartialOrd, + schemars :: JsonSchema, + )] + pub enum DiskType { + #[serde(rename = "crucible")] + Crucible, + } + + impl ::std::convert::From<&Self> for DiskType { + fn from(value: &DiskType) -> Self { + value.clone() + } + } + + impl ::std::fmt::Display for DiskType { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + match *self { + Self::Crucible => f.write_str("crucible"), + } + } + } + + impl ::std::str::FromStr for DiskType { + type Err = self::error::ConversionError; + fn from_str(value: &str) -> ::std::result::Result { + match value { + "crucible" => Ok(Self::Crucible), + _ => Err("invalid value".into()), + } + } + } + + impl ::std::convert::TryFrom<&str> for DiskType { + type Error = self::error::ConversionError; + fn try_from(value: &str) -> ::std::result::Result { + value.parse() + } + } + + impl ::std::convert::TryFrom<&::std::string::String> for DiskType { + 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 DiskType { + type Error = self::error::ConversionError; + fn try_from( + value: ::std::string::String, + ) -> ::std::result::Result { + value.parse() + } + } + /// A distribution is a sequence of bins and counts in those bins, and some /// statistical information tracked to compute the mean, standard deviation, /// and quantile estimates. @@ -41368,6 +41453,7 @@ pub mod types { block_size: ::std::result::Result, description: ::std::result::Result<::std::string::String, ::std::string::String>, device_path: ::std::result::Result<::std::string::String, ::std::string::String>, + disk_type: ::std::result::Result, id: ::std::result::Result<::uuid::Uuid, ::std::string::String>, image_id: ::std::result::Result<::std::option::Option<::uuid::Uuid>, ::std::string::String>, @@ -41393,6 +41479,7 @@ pub mod types { block_size: Err("no value supplied for block_size".to_string()), description: Err("no value supplied for description".to_string()), device_path: Err("no value supplied for device_path".to_string()), + disk_type: Err("no value supplied for disk_type".to_string()), id: Err("no value supplied for id".to_string()), image_id: Ok(Default::default()), name: Err("no value supplied for name".to_string()), @@ -41437,6 +41524,16 @@ pub mod types { .map_err(|e| format!("error converting supplied value for device_path: {}", e)); self } + pub fn disk_type(mut self, value: T) -> Self + where + T: ::std::convert::TryInto, + T::Error: ::std::fmt::Display, + { + self.disk_type = value + .try_into() + .map_err(|e| format!("error converting supplied value for disk_type: {}", e)); + self + } pub fn id(mut self, value: T) -> Self where T: ::std::convert::TryInto<::uuid::Uuid>, @@ -41536,6 +41633,7 @@ pub mod types { block_size: value.block_size?, description: value.description?, device_path: value.device_path?, + disk_type: value.disk_type?, id: value.id?, image_id: value.image_id?, name: value.name?, @@ -41555,6 +41653,7 @@ pub mod types { block_size: Ok(value.block_size), description: Ok(value.description), device_path: Ok(value.device_path), + disk_type: Ok(value.disk_type), id: Ok(value.id), image_id: Ok(value.image_id), name: Ok(value.name), From 8e818dfd06889f8242fb970b4d83fa7ee34d1d1a Mon Sep 17 00:00:00 2001 From: "oxide-reflector-bot[bot]" <130185838+oxide-reflector-bot[bot]@users.noreply.github.com> Date: Fri, 14 Nov 2025 21:42:49 +0000 Subject: [PATCH 05/10] Rebuilt with latest dependency updates --- Cargo.lock | 4 +- cli/src/generated_cli.rs | 505 +++++++++++++++++++++++++-------------- 2 files changed, 327 insertions(+), 182 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 7a5f0ddc..77281c82 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2777,7 +2777,7 @@ dependencies = [ [[package]] name = "progenitor" version = "0.11.2" -source = "git+https://github.com/oxidecomputer/progenitor#9d0d23f3bb44defc2f5c62986137946bc1b3f157" +source = "git+https://github.com/oxidecomputer/progenitor#132a79af0b1ed0de5bd4462c2c272584a0c8be3b" dependencies = [ "progenitor-impl", ] @@ -2800,7 +2800,7 @@ dependencies = [ [[package]] name = "progenitor-impl" version = "0.11.2" -source = "git+https://github.com/oxidecomputer/progenitor#9d0d23f3bb44defc2f5c62986137946bc1b3f157" +source = "git+https://github.com/oxidecomputer/progenitor#132a79af0b1ed0de5bd4462c2c272584a0c8be3b" dependencies = [ "heck", "http 1.3.1", diff --git a/cli/src/generated_cli.rs b/cli/src/generated_cli.rs index b4cc04a1..141f4382 100644 --- a/cli/src/generated_cli.rs +++ b/cli/src/generated_cli.rs @@ -1,5 +1,6 @@ // The contents of this file are generated; do not modify them. +use anyhow::Context as _; use oxide::*; pub struct Cli { client: Client, @@ -9116,8 +9117,10 @@ impl Cli { } 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(); + 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); } @@ -9144,8 +9147,10 @@ impl Cli { } 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(); + 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); } @@ -9182,9 +9187,10 @@ impl Cli { } 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(); + 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); } @@ -9264,8 +9270,10 @@ impl Cli { } 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(); + 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); } @@ -9382,8 +9390,10 @@ impl Cli { } 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(); + 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); } @@ -9440,8 +9450,10 @@ impl Cli { } 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(); + 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); } @@ -9715,8 +9727,10 @@ impl Cli { } 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(); + 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); } @@ -9785,8 +9799,10 @@ impl Cli { } 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(); + 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); } @@ -10204,9 +10220,10 @@ impl Cli { } 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(); + 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); } @@ -10352,9 +10369,10 @@ impl Cli { } 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(); + 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); } @@ -10423,9 +10441,10 @@ impl Cli { } 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(); + 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); } @@ -10649,9 +10668,10 @@ impl Cli { } 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(); + 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); } @@ -10736,8 +10756,10 @@ impl Cli { } 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(); + 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); } @@ -10862,8 +10884,10 @@ impl Cli { } 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(); + 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); } @@ -10951,9 +10975,10 @@ impl Cli { } 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(); + 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); } @@ -11046,8 +11071,10 @@ impl Cli { } 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(); + 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); } @@ -11136,8 +11163,10 @@ impl Cli { } 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(); + 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); } @@ -11206,8 +11235,10 @@ impl Cli { } 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(); + 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); } @@ -11276,8 +11307,10 @@ impl Cli { } 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(); + 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); } @@ -11441,8 +11474,10 @@ impl Cli { } 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(); + 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); } @@ -11643,8 +11678,10 @@ impl Cli { } 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(); + 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); } @@ -11722,8 +11759,10 @@ impl Cli { } 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(); + 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); } @@ -11930,8 +11969,10 @@ impl Cli { } 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(); + 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); } @@ -11968,8 +12009,10 @@ impl Cli { } 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(); + 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); } @@ -12034,8 +12077,10 @@ impl Cli { } 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(); + 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); } @@ -12357,9 +12402,11 @@ impl Cli { } if let Some(value) = matches.get_one::("json-body") { - let body_txt = std::fs::read_to_string(value).unwrap(); + 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).unwrap(); + serde_json::from_str::(&body_txt) + .with_context(|| format!("failed to parse {}", value.display()))?; request = request.body(body_value); } @@ -12501,9 +12548,10 @@ impl Cli { } 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(); + 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); } @@ -12633,9 +12681,10 @@ impl Cli { } 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(); + 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); } @@ -12801,9 +12850,10 @@ impl Cli { } 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(); + 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); } @@ -13018,8 +13068,10 @@ impl Cli { } 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(); + 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); } @@ -13225,9 +13277,11 @@ impl Cli { } if let Some(value) = matches.get_one::("json-body") { - let body_txt = std::fs::read_to_string(value).unwrap(); + 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).unwrap(); + serde_json::from_str::(&body_txt) + .with_context(|| format!("failed to parse {}", value.display()))?; request = request.body(body_value); } @@ -13308,9 +13362,11 @@ impl Cli { } if let Some(value) = matches.get_one::("json-body") { - let body_txt = std::fs::read_to_string(value).unwrap(); + 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).unwrap(); + serde_json::from_str::(&body_txt) + .with_context(|| format!("failed to parse {}", value.display()))?; request = request.body(body_value); } @@ -13396,8 +13452,10 @@ impl Cli { pub async fn execute_policy_update(&self, matches: &::clap::ArgMatches) -> anyhow::Result<()> { let mut request = self.client.policy_update(); 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(); + 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); } @@ -13461,8 +13519,10 @@ impl Cli { } 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(); + 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); } @@ -13515,8 +13575,10 @@ impl Cli { } 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(); + 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); } @@ -13588,8 +13650,10 @@ impl Cli { } 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(); + 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); } @@ -13669,8 +13733,10 @@ impl Cli { } 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(); + 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); } @@ -14004,8 +14070,10 @@ impl Cli { } 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(); + 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); } @@ -14145,9 +14213,10 @@ impl Cli { } 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(); + 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); } @@ -14329,8 +14398,10 @@ impl Cli { } 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(); + 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); } @@ -14371,9 +14442,10 @@ impl Cli { } 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(); + 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); } @@ -14570,8 +14642,10 @@ impl Cli { } 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(); + 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); } @@ -14632,8 +14706,10 @@ impl Cli { } 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(); + 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); } @@ -14694,9 +14770,10 @@ impl Cli { } 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(); + 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); } @@ -14797,8 +14874,10 @@ impl Cli { } 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(); + 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); } @@ -14851,8 +14930,10 @@ impl Cli { } 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(); + 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); } @@ -14940,8 +15021,10 @@ impl Cli { } 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(); + 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); } @@ -14970,8 +15053,10 @@ impl Cli { } 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(); + 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); } @@ -15052,8 +15137,10 @@ impl Cli { } 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(); + 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); } @@ -15090,8 +15177,10 @@ impl Cli { } 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(); + 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); } @@ -15224,8 +15313,10 @@ impl Cli { ) -> anyhow::Result<()> { let mut request = self.client.ip_pool_service_range_add(); 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(); + 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); } @@ -15250,8 +15341,10 @@ impl Cli { ) -> anyhow::Result<()> { let mut request = self.client.ip_pool_service_range_remove(); 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(); + 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); } @@ -15384,8 +15477,10 @@ impl Cli { } 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(); + 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); } @@ -15523,8 +15618,10 @@ impl Cli { ) -> anyhow::Result<()> { let mut request = self.client.networking_allow_list_update(); 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(); + 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); } @@ -15557,8 +15654,10 @@ impl Cli { } 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(); + 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); } @@ -15607,8 +15706,10 @@ impl Cli { } 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(); + 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); } @@ -15713,8 +15814,10 @@ impl Cli { } 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(); + 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); } @@ -15803,9 +15906,10 @@ impl Cli { } 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(); + 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); } @@ -15990,8 +16094,10 @@ impl Cli { } 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(); + 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); } @@ -16081,9 +16187,10 @@ impl Cli { } 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(); + 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); } @@ -16197,9 +16304,10 @@ impl Cli { } 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(); + 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); } @@ -16292,8 +16400,10 @@ impl Cli { ) -> anyhow::Result<()> { let mut request = self.client.system_policy_update(); 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(); + 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); } @@ -16512,8 +16622,10 @@ impl Cli { } 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(); + 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); } @@ -16649,8 +16761,10 @@ impl Cli { } 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(); + 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); } @@ -16715,8 +16829,10 @@ impl Cli { } 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(); + 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); } @@ -16745,8 +16861,10 @@ impl Cli { } 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(); + 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); } @@ -16923,9 +17041,10 @@ impl Cli { } 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(); + 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); } @@ -16991,8 +17110,10 @@ impl Cli { ) -> anyhow::Result<()> { let mut request = self.client.system_update_trust_root_create(); 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::<::serde_json::Value>(&body_txt).unwrap(); + let body_txt = std::fs::read_to_string(value) + .with_context(|| format!("failed to read {}", value.display()))?; + let body_value = serde_json::from_str::<::serde_json::Value>(&body_txt) + .with_context(|| format!("failed to parse {}", value.display()))?; request = request.body(body_value); } @@ -17265,8 +17386,10 @@ impl Cli { } 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(); + 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); } @@ -17514,9 +17637,10 @@ impl Cli { } 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(); + 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); } @@ -17613,8 +17737,10 @@ impl Cli { } 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(); + 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); } @@ -17699,8 +17825,10 @@ impl Cli { } 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(); + 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); } @@ -17824,8 +17952,10 @@ impl Cli { } 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(); + 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); } @@ -17901,8 +18031,10 @@ impl Cli { } 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(); + 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); } @@ -18034,8 +18166,10 @@ impl Cli { } 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(); + 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); } @@ -18115,8 +18249,10 @@ impl Cli { } 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(); + 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); } @@ -18282,8 +18418,10 @@ impl Cli { } 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(); + 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); } @@ -18348,8 +18486,10 @@ impl Cli { } 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(); + 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); } @@ -18409,8 +18549,10 @@ impl Cli { } 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(); + 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); } @@ -18451,9 +18593,10 @@ impl Cli { } 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(); + 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); } @@ -18510,8 +18653,10 @@ impl Cli { } 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(); + 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); } From 59fc09c40d85a90fa65566742dfe614f81b9f3e4 Mon Sep 17 00:00:00 2001 From: "oxide-reflector-bot[bot]" <130185838+oxide-reflector-bot[bot]@users.noreply.github.com> Date: Sat, 15 Nov 2025 05:47:26 +0000 Subject: [PATCH 06/10] Rebuilt with latest dependency updates --- cli/src/generated_cli.rs | 1369 +++++++-- oxide.json | 879 +++++- sdk-httpmock/src/generated_httpmock.rs | 1255 +++++++- sdk/src/generated_sdk.rs | 3858 +++++++++++++++++++++--- 4 files changed, 6636 insertions(+), 725 deletions(-) diff --git a/cli/src/generated_cli.rs b/cli/src/generated_cli.rs index 141f4382..72434ea6 100644 --- a/cli/src/generated_cli.rs +++ b/cli/src/generated_cli.rs @@ -117,6 +117,9 @@ impl Cli { CliCommand::InstanceExternalIpList => Self::cli_instance_external_ip_list(), CliCommand::InstanceEphemeralIpAttach => Self::cli_instance_ephemeral_ip_attach(), CliCommand::InstanceEphemeralIpDetach => Self::cli_instance_ephemeral_ip_detach(), + CliCommand::InstanceMulticastGroupList => Self::cli_instance_multicast_group_list(), + CliCommand::InstanceMulticastGroupJoin => Self::cli_instance_multicast_group_join(), + CliCommand::InstanceMulticastGroupLeave => Self::cli_instance_multicast_group_leave(), CliCommand::InstanceReboot => Self::cli_instance_reboot(), CliCommand::InstanceSerialConsole => Self::cli_instance_serial_console(), CliCommand::InstanceSerialConsoleStream => Self::cli_instance_serial_console_stream(), @@ -154,6 +157,14 @@ impl Cli { CliCommand::CurrentUserSshKeyView => Self::cli_current_user_ssh_key_view(), CliCommand::CurrentUserSshKeyDelete => Self::cli_current_user_ssh_key_delete(), CliCommand::SiloMetric => Self::cli_silo_metric(), + CliCommand::MulticastGroupList => Self::cli_multicast_group_list(), + CliCommand::MulticastGroupCreate => Self::cli_multicast_group_create(), + CliCommand::MulticastGroupView => Self::cli_multicast_group_view(), + CliCommand::MulticastGroupUpdate => Self::cli_multicast_group_update(), + CliCommand::MulticastGroupDelete => Self::cli_multicast_group_delete(), + CliCommand::MulticastGroupMemberList => Self::cli_multicast_group_member_list(), + CliCommand::MulticastGroupMemberAdd => Self::cli_multicast_group_member_add(), + CliCommand::MulticastGroupMemberRemove => Self::cli_multicast_group_member_remove(), CliCommand::InstanceNetworkInterfaceList => Self::cli_instance_network_interface_list(), CliCommand::InstanceNetworkInterfaceCreate => { Self::cli_instance_network_interface_create() @@ -234,6 +245,7 @@ impl Cli { CliCommand::IpPoolServiceRangeAdd => Self::cli_ip_pool_service_range_add(), CliCommand::IpPoolServiceRangeRemove => Self::cli_ip_pool_service_range_remove(), CliCommand::SystemMetric => Self::cli_system_metric(), + CliCommand::LookupMulticastGroupByIp => Self::cli_lookup_multicast_group_by_ip(), CliCommand::NetworkingAddressLotList => Self::cli_networking_address_lot_list(), CliCommand::NetworkingAddressLotCreate => Self::cli_networking_address_lot_create(), CliCommand::NetworkingAddressLotView => Self::cli_networking_address_lot_view(), @@ -3001,6 +3013,87 @@ impl Cli { .about("Detach and deallocate ephemeral IP from instance") } + pub fn cli_instance_multicast_group_list() -> ::clap::Command { + ::clap::Command::new("") + .arg( + ::clap::Arg::new("instance") + .long("instance") + .value_parser(::clap::value_parser!(types::NameOrId)) + .required(true) + .help("Name or ID of the instance"), + ) + .arg( + ::clap::Arg::new("project") + .long("project") + .value_parser(::clap::value_parser!(types::NameOrId)) + .required(false) + .help("Name or ID of the project"), + ) + .about("List multicast groups for instance") + } + + pub fn cli_instance_multicast_group_join() -> ::clap::Command { + ::clap::Command::new("") + .arg( + ::clap::Arg::new("instance") + .long("instance") + .value_parser(::clap::value_parser!(types::NameOrId)) + .required(true) + .help("Name or ID of the instance"), + ) + .arg( + ::clap::Arg::new("multicast-group") + .long("multicast-group") + .value_parser(::clap::value_parser!(types::NameOrId)) + .required(true) + .help("Name or ID of the multicast group"), + ) + .arg( + ::clap::Arg::new("project") + .long("project") + .value_parser(::clap::value_parser!(types::NameOrId)) + .required(false) + .help("Name or ID of the project"), + ) + .about("Join multicast group.") + .long_about( + "This is functionally equivalent to adding the instance via the group's member \ + management endpoint or updating the instance's `multicast_groups` field. All \ + approaches modify the same membership and trigger reconciliation.", + ) + } + + pub fn cli_instance_multicast_group_leave() -> ::clap::Command { + ::clap::Command::new("") + .arg( + ::clap::Arg::new("instance") + .long("instance") + .value_parser(::clap::value_parser!(types::NameOrId)) + .required(true) + .help("Name or ID of the instance"), + ) + .arg( + ::clap::Arg::new("multicast-group") + .long("multicast-group") + .value_parser(::clap::value_parser!(types::NameOrId)) + .required(true) + .help("Name or ID of the multicast group"), + ) + .arg( + ::clap::Arg::new("project") + .long("project") + .value_parser(::clap::value_parser!(types::NameOrId)) + .required(false) + .help("Name or ID of the project"), + ) + .about("Leave multicast group.") + .long_about( + "This is functionally equivalent to removing the instance via the group's member \ + management endpoint or updating the instance's `multicast_groups` field. All \ + approaches modify the same membership and trigger reconciliation.", + ) + } + pub fn cli_instance_reboot() -> ::clap::Command { ::clap::Command::new("") .arg( @@ -3956,15 +4049,8 @@ impl Cli { ) } - pub fn cli_instance_network_interface_list() -> ::clap::Command { + pub fn cli_multicast_group_list() -> ::clap::Command { ::clap::Command::new("") - .arg( - ::clap::Arg::new("instance") - .long("instance") - .value_parser(::clap::value_parser!(types::NameOrId)) - .required(true) - .help("Name or ID of the instance"), - ) .arg( ::clap::Arg::new("limit") .long("limit") @@ -3972,16 +4058,6 @@ impl Cli { .required(false) .help("Maximum number of items returned by a single call"), ) - .arg( - ::clap::Arg::new("project") - .long("project") - .value_parser(::clap::value_parser!(types::NameOrId)) - .required(false) - .help( - "Name or ID of the project, only required if `instance` is provided as a \ - `Name`", - ), - ) .arg( ::clap::Arg::new("sort-by") .long("sort-by") @@ -3995,10 +4071,10 @@ impl Cli { )) .required(false), ) - .about("List network interfaces") + .about("List all multicast groups.") } - pub fn cli_instance_network_interface_create() -> ::clap::Command { + pub fn cli_multicast_group_create() -> ::clap::Command { ::clap::Command::new("") .arg( ::clap::Arg::new("description") @@ -4007,20 +4083,25 @@ impl Cli { .required_unless_present("json-body"), ) .arg( - ::clap::Arg::new("instance") - .long("instance") - .value_parser(::clap::value_parser!(types::NameOrId)) - .required(true) - .help("Name or ID of the instance"), + ::clap::Arg::new("multicast-ip") + .long("multicast-ip") + .value_parser(::clap::value_parser!(::std::net::IpAddr)) + .required(false) + .help( + "The multicast IP address to allocate. If None, one will be allocated \ + from the default pool.", + ), ) .arg( - ::clap::Arg::new("ip") - .long("ip") - .value_parser(::clap::value_parser!(::std::net::IpAddr)) + ::clap::Arg::new("mvlan") + .long("mvlan") + .value_parser(::clap::value_parser!(u16)) .required(false) .help( - "The IP address for the interface. One will be auto-assigned if not \ - provided.", + "Multicast VLAN (MVLAN) for egress multicast traffic to upstream \ + networks. Tags packets leaving the rack to traverse VLAN-segmented \ + upstream networks.\n\nValid range: 2-4094 (VLAN IDs 0-1 are reserved by \ + IEEE 802.1Q standard).", ), ) .arg( @@ -4030,29 +4111,15 @@ impl Cli { .required_unless_present("json-body"), ) .arg( - ::clap::Arg::new("project") - .long("project") + ::clap::Arg::new("pool") + .long("pool") .value_parser(::clap::value_parser!(types::NameOrId)) .required(false) .help( - "Name or ID of the project, only required if `instance` is provided as a \ - `Name`", + "Name or ID of the IP pool to allocate from. If None, uses the default \ + multicast pool.", ), ) - .arg( - ::clap::Arg::new("subnet-name") - .long("subnet-name") - .value_parser(::clap::value_parser!(types::Name)) - .required_unless_present("json-body") - .help("The VPC Subnet in which to create the interface."), - ) - .arg( - ::clap::Arg::new("vpc-name") - .long("vpc-name") - .value_parser(::clap::value_parser!(types::Name)) - .required_unless_present("json-body") - .help("The VPC in which to create the interface."), - ) .arg( ::clap::Arg::new("json-body") .long("json-body") @@ -4067,91 +4134,139 @@ impl Cli { .action(::clap::ArgAction::SetTrue) .help("XXX"), ) - .about("Create network interface") + .about("Create a multicast group.") + .long_about( + "Multicast groups are fleet-scoped resources that can be joined by instances \ + across projects and silos. A single multicast IP serves all group members \ + regardless of project or silo boundaries.", + ) } - pub fn cli_instance_network_interface_view() -> ::clap::Command { + pub fn cli_multicast_group_view() -> ::clap::Command { ::clap::Command::new("") .arg( - ::clap::Arg::new("instance") - .long("instance") + ::clap::Arg::new("multicast-group") + .long("multicast-group") .value_parser(::clap::value_parser!(types::NameOrId)) - .required(false) - .help("Name or ID of the instance"), + .required(true) + .help("Name or ID of the multicast group"), + ) + .about("Fetch a multicast group.") + } + + pub fn cli_multicast_group_update() -> ::clap::Command { + ::clap::Command::new("") + .arg( + ::clap::Arg::new("description") + .long("description") + .value_parser(::clap::value_parser!(::std::string::String)) + .required(false), ) .arg( - ::clap::Arg::new("interface") - .long("interface") + ::clap::Arg::new("multicast-group") + .long("multicast-group") .value_parser(::clap::value_parser!(types::NameOrId)) .required(true) - .help("Name or ID of the network interface"), + .help("Name or ID of the multicast group"), ) .arg( - ::clap::Arg::new("project") - .long("project") - .value_parser(::clap::value_parser!(types::NameOrId)) + ::clap::Arg::new("mvlan") + .long("mvlan") + .value_parser(::clap::value_parser!(u16)) .required(false) .help( - "Name or ID of the project, only required if `instance` is provided as a \ - `Name`", + "Multicast VLAN (MVLAN) for egress multicast traffic to upstream \ + networks. Set to null to clear the MVLAN. Valid range: 2-4094 when \ + provided. Omit the field to leave mvlan unchanged.", ), ) - .about("Fetch network interface") + .arg( + ::clap::Arg::new("name") + .long("name") + .value_parser(::clap::value_parser!(types::Name)) + .required(false), + ) + .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("Update a multicast group.") } - pub fn cli_instance_network_interface_update() -> ::clap::Command { + pub fn cli_multicast_group_delete() -> ::clap::Command { ::clap::Command::new("") .arg( - ::clap::Arg::new("description") - .long("description") - .value_parser(::clap::value_parser!(::std::string::String)) - .required(false), + ::clap::Arg::new("multicast-group") + .long("multicast-group") + .value_parser(::clap::value_parser!(types::NameOrId)) + .required(true) + .help("Name or ID of the multicast group"), ) + .about("Delete a multicast group.") + } + + pub fn cli_multicast_group_member_list() -> ::clap::Command { + ::clap::Command::new("") .arg( - ::clap::Arg::new("instance") - .long("instance") - .value_parser(::clap::value_parser!(types::NameOrId)) + ::clap::Arg::new("limit") + .long("limit") + .value_parser(::clap::value_parser!(::std::num::NonZeroU32)) .required(false) - .help("Name or ID of the instance"), + .help("Maximum number of items returned by a single call"), ) .arg( - ::clap::Arg::new("interface") - .long("interface") + ::clap::Arg::new("multicast-group") + .long("multicast-group") .value_parser(::clap::value_parser!(types::NameOrId)) .required(true) - .help("Name or ID of the network interface"), + .help("Name or ID of the multicast group"), ) .arg( - ::clap::Arg::new("name") - .long("name") - .value_parser(::clap::value_parser!(types::Name)) + ::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 members of a multicast group.") + } + + pub fn cli_multicast_group_member_add() -> ::clap::Command { + ::clap::Command::new("") .arg( - ::clap::Arg::new("primary") - .long("primary") - .value_parser(::clap::value_parser!(bool)) - .required(false) - .help( - "Make a secondary interface the instance's primary interface.\n\nIf \ - applied to a secondary interface, that interface will become the primary \ - on the next reboot of the instance. Note that this may have implications \ - for routing between instances, as the new primary interface will be on a \ - distinct subnet from the previous primary interface.\n\nNote that this \ - can only be used to select a new primary interface for an instance. \ - Requests to change the primary interface into a secondary will return an \ - error.", - ), + ::clap::Arg::new("instance") + .long("instance") + .value_parser(::clap::value_parser!(types::NameOrId)) + .required_unless_present("json-body") + .help("Name or ID of the instance to add to the multicast group"), + ) + .arg( + ::clap::Arg::new("multicast-group") + .long("multicast-group") + .value_parser(::clap::value_parser!(types::NameOrId)) + .required(true) + .help("Name or ID of the multicast group"), ) .arg( ::clap::Arg::new("project") .long("project") .value_parser(::clap::value_parser!(types::NameOrId)) .required(false) - .help( - "Name or ID of the project, only required if `instance` is provided as a \ - `Name`", - ), + .help("Name or ID of the project"), ) .arg( ::clap::Arg::new("json-body") @@ -4167,54 +4282,306 @@ impl Cli { .action(::clap::ArgAction::SetTrue) .help("XXX"), ) - .about("Update network interface") + .about("Add instance to a multicast group.") + .long_about( + "Functionally equivalent to updating the instance's `multicast_groups` field. \ + Both approaches modify the same underlying membership and trigger the same \ + reconciliation logic.\n\nSpecify instance by name (requires `?project=`) \ + or UUID.", + ) } - pub fn cli_instance_network_interface_delete() -> ::clap::Command { + pub fn cli_multicast_group_member_remove() -> ::clap::Command { ::clap::Command::new("") .arg( ::clap::Arg::new("instance") .long("instance") .value_parser(::clap::value_parser!(types::NameOrId)) - .required(false) + .required(true) .help("Name or ID of the instance"), ) .arg( - ::clap::Arg::new("interface") - .long("interface") + ::clap::Arg::new("multicast-group") + .long("multicast-group") .value_parser(::clap::value_parser!(types::NameOrId)) .required(true) - .help("Name or ID of the network interface"), + .help("Name or ID of the multicast group"), ) .arg( ::clap::Arg::new("project") .long("project") .value_parser(::clap::value_parser!(types::NameOrId)) .required(false) - .help( - "Name or ID of the project, only required if `instance` is provided as a \ - `Name`", - ), + .help("Name or ID of the project"), ) - .about("Delete network interface") + .about("Remove instance from a multicast group.") .long_about( - "Note that the primary interface for an instance cannot be deleted if there are \ - any secondary interfaces. A new primary interface must be designated first. The \ - primary interface can be deleted if there are no secondary interfaces.", + "Functionally equivalent to removing the group from the instance's \ + `multicast_groups` field. Both approaches modify the same underlying membership \ + and trigger reconciliation.\n\nSpecify instance by name (requires \ + `?project=`) or UUID.", ) } - pub fn cli_ping() -> ::clap::Command { - ::clap::Command::new("") - .about("Ping API") - .long_about("Always responds with Ok if it responds at all.") - } - - pub fn cli_policy_view() -> ::clap::Command { - ::clap::Command::new("").about("Fetch current silo's IAM policy") - } - - pub fn cli_policy_update() -> ::clap::Command { + pub fn cli_instance_network_interface_list() -> ::clap::Command { + ::clap::Command::new("") + .arg( + ::clap::Arg::new("instance") + .long("instance") + .value_parser(::clap::value_parser!(types::NameOrId)) + .required(true) + .help("Name or ID of the instance"), + ) + .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("project") + .long("project") + .value_parser(::clap::value_parser!(types::NameOrId)) + .required(false) + .help( + "Name or ID of the project, only required if `instance` is provided as a \ + `Name`", + ), + ) + .arg( + ::clap::Arg::new("sort-by") + .long("sort-by") + .value_parser(::clap::builder::TypedValueParser::map( + ::clap::builder::PossibleValuesParser::new([ + types::NameOrIdSortMode::NameAscending.to_string(), + types::NameOrIdSortMode::NameDescending.to_string(), + types::NameOrIdSortMode::IdAscending.to_string(), + ]), + |s| types::NameOrIdSortMode::try_from(s).unwrap(), + )) + .required(false), + ) + .about("List network interfaces") + } + + pub fn cli_instance_network_interface_create() -> ::clap::Command { + ::clap::Command::new("") + .arg( + ::clap::Arg::new("description") + .long("description") + .value_parser(::clap::value_parser!(::std::string::String)) + .required_unless_present("json-body"), + ) + .arg( + ::clap::Arg::new("instance") + .long("instance") + .value_parser(::clap::value_parser!(types::NameOrId)) + .required(true) + .help("Name or ID of the instance"), + ) + .arg( + ::clap::Arg::new("ip") + .long("ip") + .value_parser(::clap::value_parser!(::std::net::IpAddr)) + .required(false) + .help( + "The IP address for the interface. One will be auto-assigned if not \ + provided.", + ), + ) + .arg( + ::clap::Arg::new("name") + .long("name") + .value_parser(::clap::value_parser!(types::Name)) + .required_unless_present("json-body"), + ) + .arg( + ::clap::Arg::new("project") + .long("project") + .value_parser(::clap::value_parser!(types::NameOrId)) + .required(false) + .help( + "Name or ID of the project, only required if `instance` is provided as a \ + `Name`", + ), + ) + .arg( + ::clap::Arg::new("subnet-name") + .long("subnet-name") + .value_parser(::clap::value_parser!(types::Name)) + .required_unless_present("json-body") + .help("The VPC Subnet in which to create the interface."), + ) + .arg( + ::clap::Arg::new("vpc-name") + .long("vpc-name") + .value_parser(::clap::value_parser!(types::Name)) + .required_unless_present("json-body") + .help("The VPC in which to create the interface."), + ) + .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("Create network interface") + } + + pub fn cli_instance_network_interface_view() -> ::clap::Command { + ::clap::Command::new("") + .arg( + ::clap::Arg::new("instance") + .long("instance") + .value_parser(::clap::value_parser!(types::NameOrId)) + .required(false) + .help("Name or ID of the instance"), + ) + .arg( + ::clap::Arg::new("interface") + .long("interface") + .value_parser(::clap::value_parser!(types::NameOrId)) + .required(true) + .help("Name or ID of the network interface"), + ) + .arg( + ::clap::Arg::new("project") + .long("project") + .value_parser(::clap::value_parser!(types::NameOrId)) + .required(false) + .help( + "Name or ID of the project, only required if `instance` is provided as a \ + `Name`", + ), + ) + .about("Fetch network interface") + } + + pub fn cli_instance_network_interface_update() -> ::clap::Command { + ::clap::Command::new("") + .arg( + ::clap::Arg::new("description") + .long("description") + .value_parser(::clap::value_parser!(::std::string::String)) + .required(false), + ) + .arg( + ::clap::Arg::new("instance") + .long("instance") + .value_parser(::clap::value_parser!(types::NameOrId)) + .required(false) + .help("Name or ID of the instance"), + ) + .arg( + ::clap::Arg::new("interface") + .long("interface") + .value_parser(::clap::value_parser!(types::NameOrId)) + .required(true) + .help("Name or ID of the network interface"), + ) + .arg( + ::clap::Arg::new("name") + .long("name") + .value_parser(::clap::value_parser!(types::Name)) + .required(false), + ) + .arg( + ::clap::Arg::new("primary") + .long("primary") + .value_parser(::clap::value_parser!(bool)) + .required(false) + .help( + "Make a secondary interface the instance's primary interface.\n\nIf \ + applied to a secondary interface, that interface will become the primary \ + on the next reboot of the instance. Note that this may have implications \ + for routing between instances, as the new primary interface will be on a \ + distinct subnet from the previous primary interface.\n\nNote that this \ + can only be used to select a new primary interface for an instance. \ + Requests to change the primary interface into a secondary will return an \ + error.", + ), + ) + .arg( + ::clap::Arg::new("project") + .long("project") + .value_parser(::clap::value_parser!(types::NameOrId)) + .required(false) + .help( + "Name or ID of the project, only required if `instance` is provided as a \ + `Name`", + ), + ) + .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("Update network interface") + } + + pub fn cli_instance_network_interface_delete() -> ::clap::Command { + ::clap::Command::new("") + .arg( + ::clap::Arg::new("instance") + .long("instance") + .value_parser(::clap::value_parser!(types::NameOrId)) + .required(false) + .help("Name or ID of the instance"), + ) + .arg( + ::clap::Arg::new("interface") + .long("interface") + .value_parser(::clap::value_parser!(types::NameOrId)) + .required(true) + .help("Name or ID of the network interface"), + ) + .arg( + ::clap::Arg::new("project") + .long("project") + .value_parser(::clap::value_parser!(types::NameOrId)) + .required(false) + .help( + "Name or ID of the project, only required if `instance` is provided as a \ + `Name`", + ), + ) + .about("Delete network interface") + .long_about( + "Note that the primary interface for an instance cannot be deleted if there are \ + any secondary interfaces. A new primary interface must be designated first. The \ + primary interface can be deleted if there are no secondary interfaces.", + ) + } + + pub fn cli_ping() -> ::clap::Command { + ::clap::Command::new("") + .about("Ping API") + .long_about("Always responds with Ok if it responds at all.") + } + + pub fn cli_policy_view() -> ::clap::Command { + ::clap::Command::new("").about("Fetch current silo's IAM policy") + } + + pub fn cli_policy_update() -> ::clap::Command { ::clap::Command::new("") .arg( ::clap::Arg::new("json-body") @@ -5870,6 +6237,18 @@ impl Cli { ) } + pub fn cli_lookup_multicast_group_by_ip() -> ::clap::Command { + ::clap::Command::new("") + .arg( + ::clap::Arg::new("address") + .long("address") + .value_parser(::clap::value_parser!(::std::net::IpAddr)) + .required(true) + .help("IP address of the multicast group"), + ) + .about("Look up multicast group by IP address.") + } + pub fn cli_networking_address_lot_list() -> ::clap::Command { ::clap::Command::new("") .arg( @@ -6445,7 +6824,10 @@ impl Cli { .long("rack-id") .value_parser(::clap::value_parser!(::uuid::Uuid)) .required_unless_present("json-body") - .help("The containing the switch this loopback address will be configured on."), + .help( + "The rack containing the switch this loopback address will be configured \ + on.", + ), ) .arg( ::clap::Arg::new("switch-location") @@ -8732,6 +9114,15 @@ impl Cli { CliCommand::InstanceEphemeralIpDetach => { self.execute_instance_ephemeral_ip_detach(matches).await } + CliCommand::InstanceMulticastGroupList => { + self.execute_instance_multicast_group_list(matches).await + } + CliCommand::InstanceMulticastGroupJoin => { + self.execute_instance_multicast_group_join(matches).await + } + CliCommand::InstanceMulticastGroupLeave => { + self.execute_instance_multicast_group_leave(matches).await + } CliCommand::InstanceReboot => self.execute_instance_reboot(matches).await, CliCommand::InstanceSerialConsole => { self.execute_instance_serial_console(matches).await @@ -8797,6 +9188,20 @@ impl Cli { self.execute_current_user_ssh_key_delete(matches).await } CliCommand::SiloMetric => self.execute_silo_metric(matches).await, + CliCommand::MulticastGroupList => self.execute_multicast_group_list(matches).await, + CliCommand::MulticastGroupCreate => self.execute_multicast_group_create(matches).await, + CliCommand::MulticastGroupView => self.execute_multicast_group_view(matches).await, + CliCommand::MulticastGroupUpdate => self.execute_multicast_group_update(matches).await, + CliCommand::MulticastGroupDelete => self.execute_multicast_group_delete(matches).await, + CliCommand::MulticastGroupMemberList => { + self.execute_multicast_group_member_list(matches).await + } + CliCommand::MulticastGroupMemberAdd => { + self.execute_multicast_group_member_add(matches).await + } + CliCommand::MulticastGroupMemberRemove => { + self.execute_multicast_group_member_remove(matches).await + } CliCommand::InstanceNetworkInterfaceList => { self.execute_instance_network_interface_list(matches).await } @@ -8913,6 +9318,9 @@ impl Cli { self.execute_ip_pool_service_range_remove(matches).await } CliCommand::SystemMetric => self.execute_system_metric(matches).await, + CliCommand::LookupMulticastGroupByIp => { + self.execute_lookup_multicast_group_by_ip(matches).await + } CliCommand::NetworkingAddressLotList => { self.execute_networking_address_lot_list(matches).await } @@ -11951,19 +12359,127 @@ impl Cli { } } - pub async fn execute_instance_disk_attach( + pub async fn execute_instance_disk_attach( + &self, + matches: &::clap::ArgMatches, + ) -> anyhow::Result<()> { + let mut request = self.client.instance_disk_attach(); + if let Some(value) = matches.get_one::("disk") { + request = request.body_map(|body| body.disk(value.clone())) + } + + if let Some(value) = matches.get_one::("instance") { + request = request.instance(value.clone()); + } + + if let Some(value) = matches.get_one::("project") { + request = request.project(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_instance_disk_attach(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_instance_disk_detach( + &self, + matches: &::clap::ArgMatches, + ) -> anyhow::Result<()> { + let mut request = self.client.instance_disk_detach(); + if let Some(value) = matches.get_one::("disk") { + request = request.body_map(|body| body.disk(value.clone())) + } + + if let Some(value) = matches.get_one::("instance") { + request = request.instance(value.clone()); + } + + if let Some(value) = matches.get_one::("project") { + request = request.project(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_instance_disk_detach(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_instance_external_ip_list( + &self, + matches: &::clap::ArgMatches, + ) -> anyhow::Result<()> { + let mut request = self.client.instance_external_ip_list(); + if let Some(value) = matches.get_one::("instance") { + request = request.instance(value.clone()); + } + + if let Some(value) = matches.get_one::("project") { + request = request.project(value.clone()); + } + + self.config + .execute_instance_external_ip_list(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_instance_ephemeral_ip_attach( &self, matches: &::clap::ArgMatches, ) -> anyhow::Result<()> { - let mut request = self.client.instance_disk_attach(); - if let Some(value) = matches.get_one::("disk") { - request = request.body_map(|body| body.disk(value.clone())) - } - + let mut request = self.client.instance_ephemeral_ip_attach(); if let Some(value) = matches.get_one::("instance") { request = request.instance(value.clone()); } + if let Some(value) = matches.get_one::("pool") { + request = request.body_map(|body| body.pool(value.clone())) + } + if let Some(value) = matches.get_one::("project") { request = request.project(value.clone()); } @@ -11971,13 +12487,13 @@ impl Cli { 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) + 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_instance_disk_attach(matches, &mut request)?; + .execute_instance_ephemeral_ip_attach(matches, &mut request)?; let result = request.send().await; match result { Ok(r) => { @@ -11991,15 +12507,11 @@ impl Cli { } } - pub async fn execute_instance_disk_detach( + pub async fn execute_instance_ephemeral_ip_detach( &self, matches: &::clap::ArgMatches, ) -> anyhow::Result<()> { - let mut request = self.client.instance_disk_detach(); - if let Some(value) = matches.get_one::("disk") { - request = request.body_map(|body| body.disk(value.clone())) - } - + let mut request = self.client.instance_ephemeral_ip_detach(); if let Some(value) = matches.get_one::("instance") { request = request.instance(value.clone()); } @@ -12008,20 +12520,12 @@ impl Cli { request = request.project(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_instance_disk_detach(matches, &mut request)?; + .execute_instance_ephemeral_ip_detach(matches, &mut request)?; let result = request.send().await; match result { Ok(r) => { - self.config.success_item(&r); + self.config.success_no_item(&r); Ok(()) } Err(r) => { @@ -12031,11 +12535,11 @@ impl Cli { } } - pub async fn execute_instance_external_ip_list( + pub async fn execute_instance_multicast_group_list( &self, matches: &::clap::ArgMatches, ) -> anyhow::Result<()> { - let mut request = self.client.instance_external_ip_list(); + let mut request = self.client.instance_multicast_group_list(); if let Some(value) = matches.get_one::("instance") { request = request.instance(value.clone()); } @@ -12045,7 +12549,7 @@ impl Cli { } self.config - .execute_instance_external_ip_list(matches, &mut request)?; + .execute_instance_multicast_group_list(matches, &mut request)?; let result = request.send().await; match result { Ok(r) => { @@ -12059,33 +12563,25 @@ impl Cli { } } - pub async fn execute_instance_ephemeral_ip_attach( + pub async fn execute_instance_multicast_group_join( &self, matches: &::clap::ArgMatches, ) -> anyhow::Result<()> { - let mut request = self.client.instance_ephemeral_ip_attach(); + let mut request = self.client.instance_multicast_group_join(); if let Some(value) = matches.get_one::("instance") { request = request.instance(value.clone()); } - if let Some(value) = matches.get_one::("pool") { - request = request.body_map(|body| body.pool(value.clone())) + if let Some(value) = matches.get_one::("multicast-group") { + request = request.multicast_group(value.clone()); } if let Some(value) = matches.get_one::("project") { request = request.project(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_instance_ephemeral_ip_attach(matches, &mut request)?; + .execute_instance_multicast_group_join(matches, &mut request)?; let result = request.send().await; match result { Ok(r) => { @@ -12099,21 +12595,25 @@ impl Cli { } } - pub async fn execute_instance_ephemeral_ip_detach( + pub async fn execute_instance_multicast_group_leave( &self, matches: &::clap::ArgMatches, ) -> anyhow::Result<()> { - let mut request = self.client.instance_ephemeral_ip_detach(); + let mut request = self.client.instance_multicast_group_leave(); if let Some(value) = matches.get_one::("instance") { request = request.instance(value.clone()); } + if let Some(value) = matches.get_one::("multicast-group") { + request = request.multicast_group(value.clone()); + } + if let Some(value) = matches.get_one::("project") { request = request.project(value.clone()); } self.config - .execute_instance_ephemeral_ip_detach(matches, &mut request)?; + .execute_instance_multicast_group_leave(matches, &mut request)?; let result = request.send().await; match result { Ok(r) => { @@ -12985,9 +13485,191 @@ impl Cli { request = request.sort_by(value.clone()); } - self.config - .execute_current_user_groups(matches, &mut request)?; - self.config.list_start::(); + self.config + .execute_current_user_groups(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_current_user_ssh_key_list( + &self, + matches: &::clap::ArgMatches, + ) -> anyhow::Result<()> { + let mut request = self.client.current_user_ssh_key_list(); + 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_current_user_ssh_key_list(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_current_user_ssh_key_create( + &self, + matches: &::clap::ArgMatches, + ) -> anyhow::Result<()> { + let mut request = self.client.current_user_ssh_key_create(); + if let Some(value) = matches.get_one::<::std::string::String>("description") { + request = request.body_map(|body| body.description(value.clone())) + } + + if let Some(value) = matches.get_one::("name") { + request = request.body_map(|body| body.name(value.clone())) + } + + if let Some(value) = matches.get_one::<::std::string::String>("public-key") { + request = request.body_map(|body| body.public_key(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_current_user_ssh_key_create(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_current_user_ssh_key_view( + &self, + matches: &::clap::ArgMatches, + ) -> anyhow::Result<()> { + let mut request = self.client.current_user_ssh_key_view(); + if let Some(value) = matches.get_one::("ssh-key") { + request = request.ssh_key(value.clone()); + } + + self.config + .execute_current_user_ssh_key_view(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_current_user_ssh_key_delete( + &self, + matches: &::clap::ArgMatches, + ) -> anyhow::Result<()> { + let mut request = self.client.current_user_ssh_key_delete(); + if let Some(value) = matches.get_one::("ssh-key") { + request = request.ssh_key(value.clone()); + } + + self.config + .execute_current_user_ssh_key_delete(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_silo_metric(&self, matches: &::clap::ArgMatches) -> anyhow::Result<()> { + let mut request = self.client.silo_metric(); + if let Some(value) = + matches.get_one::<::chrono::DateTime<::chrono::offset::Utc>>("end-time") + { + request = request.end_time(value.clone()); + } + + if let Some(value) = matches.get_one::<::std::num::NonZeroU32>("limit") { + request = request.limit(value.clone()); + } + + if let Some(value) = matches.get_one::("metric-name") { + request = request.metric_name(value.clone()); + } + + if let Some(value) = matches.get_one::("order") { + request = request.order(value.clone()); + } + + if let Some(value) = matches.get_one::("project") { + request = request.project(value.clone()); + } + + if let Some(value) = + matches.get_one::<::chrono::DateTime<::chrono::offset::Utc>>("start-time") + { + request = request.start_time(value.clone()); + } + + self.config.execute_silo_metric(matches, &mut request)?; + self.config.list_start::(); let mut stream = futures::StreamExt::take( request.stream(), matches @@ -13001,7 +13683,8 @@ impl Cli { return Err(anyhow::Error::new(r)); } Ok(None) => { - self.config.list_end_success::(); + self.config + .list_end_success::(); return Ok(()); } Ok(Some(value)) => { @@ -13011,11 +13694,11 @@ impl Cli { } } - pub async fn execute_current_user_ssh_key_list( + pub async fn execute_multicast_group_list( &self, matches: &::clap::ArgMatches, ) -> anyhow::Result<()> { - let mut request = self.client.current_user_ssh_key_list(); + let mut request = self.client.multicast_group_list(); if let Some(value) = matches.get_one::<::std::num::NonZeroU32>("limit") { request = request.limit(value.clone()); } @@ -13025,8 +13708,8 @@ impl Cli { } self.config - .execute_current_user_ssh_key_list(matches, &mut request)?; - self.config.list_start::(); + .execute_multicast_group_list(matches, &mut request)?; + self.config.list_start::(); let mut stream = futures::StreamExt::take( request.stream(), matches @@ -13040,7 +13723,8 @@ impl Cli { return Err(anyhow::Error::new(r)); } Ok(None) => { - self.config.list_end_success::(); + self.config + .list_end_success::(); return Ok(()); } Ok(Some(value)) => { @@ -13050,33 +13734,41 @@ impl Cli { } } - pub async fn execute_current_user_ssh_key_create( + pub async fn execute_multicast_group_create( &self, matches: &::clap::ArgMatches, ) -> anyhow::Result<()> { - let mut request = self.client.current_user_ssh_key_create(); + let mut request = self.client.multicast_group_create(); if let Some(value) = matches.get_one::<::std::string::String>("description") { request = request.body_map(|body| body.description(value.clone())) } + if let Some(value) = matches.get_one::<::std::net::IpAddr>("multicast-ip") { + request = request.body_map(|body| body.multicast_ip(value.clone())) + } + + if let Some(value) = matches.get_one::("mvlan") { + request = request.body_map(|body| body.mvlan(value.clone())) + } + if let Some(value) = matches.get_one::("name") { request = request.body_map(|body| body.name(value.clone())) } - if let Some(value) = matches.get_one::<::std::string::String>("public-key") { - request = request.body_map(|body| body.public_key(value.clone())) + if let Some(value) = matches.get_one::("pool") { + request = request.body_map(|body| body.pool(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) + 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_current_user_ssh_key_create(matches, &mut request)?; + .execute_multicast_group_create(matches, &mut request)?; let result = request.send().await; match result { Ok(r) => { @@ -13090,17 +13782,17 @@ impl Cli { } } - pub async fn execute_current_user_ssh_key_view( + pub async fn execute_multicast_group_view( &self, matches: &::clap::ArgMatches, ) -> anyhow::Result<()> { - let mut request = self.client.current_user_ssh_key_view(); - if let Some(value) = matches.get_one::("ssh-key") { - request = request.ssh_key(value.clone()); + let mut request = self.client.multicast_group_view(); + if let Some(value) = matches.get_one::("multicast-group") { + request = request.multicast_group(value.clone()); } self.config - .execute_current_user_ssh_key_view(matches, &mut request)?; + .execute_multicast_group_view(matches, &mut request)?; let result = request.send().await; match result { Ok(r) => { @@ -13114,21 +13806,41 @@ impl Cli { } } - pub async fn execute_current_user_ssh_key_delete( + pub async fn execute_multicast_group_update( &self, matches: &::clap::ArgMatches, ) -> anyhow::Result<()> { - let mut request = self.client.current_user_ssh_key_delete(); - if let Some(value) = matches.get_one::("ssh-key") { - request = request.ssh_key(value.clone()); + let mut request = self.client.multicast_group_update(); + if let Some(value) = matches.get_one::<::std::string::String>("description") { + request = request.body_map(|body| body.description(value.clone())) + } + + if let Some(value) = matches.get_one::("multicast-group") { + request = request.multicast_group(value.clone()); + } + + if let Some(value) = matches.get_one::("mvlan") { + request = request.body_map(|body| body.mvlan(value.clone())) + } + + if let Some(value) = matches.get_one::("name") { + request = request.body_map(|body| body.name(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_current_user_ssh_key_delete(matches, &mut request)?; + .execute_multicast_group_update(matches, &mut request)?; let result = request.send().await; match result { Ok(r) => { - self.config.success_no_item(&r); + self.config.success_item(&r); Ok(()) } Err(r) => { @@ -13138,38 +13850,51 @@ impl Cli { } } - pub async fn execute_silo_metric(&self, matches: &::clap::ArgMatches) -> anyhow::Result<()> { - let mut request = self.client.silo_metric(); - if let Some(value) = - matches.get_one::<::chrono::DateTime<::chrono::offset::Utc>>("end-time") - { - request = request.end_time(value.clone()); - } - - if let Some(value) = matches.get_one::<::std::num::NonZeroU32>("limit") { - request = request.limit(value.clone()); + pub async fn execute_multicast_group_delete( + &self, + matches: &::clap::ArgMatches, + ) -> anyhow::Result<()> { + let mut request = self.client.multicast_group_delete(); + if let Some(value) = matches.get_one::("multicast-group") { + request = request.multicast_group(value.clone()); } - if let Some(value) = matches.get_one::("metric-name") { - request = request.metric_name(value.clone()); + self.config + .execute_multicast_group_delete(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)) + } } + } - if let Some(value) = matches.get_one::("order") { - request = request.order(value.clone()); + pub async fn execute_multicast_group_member_list( + &self, + matches: &::clap::ArgMatches, + ) -> anyhow::Result<()> { + let mut request = self.client.multicast_group_member_list(); + if let Some(value) = matches.get_one::<::std::num::NonZeroU32>("limit") { + request = request.limit(value.clone()); } - if let Some(value) = matches.get_one::("project") { - request = request.project(value.clone()); + if let Some(value) = matches.get_one::("multicast-group") { + request = request.multicast_group(value.clone()); } - if let Some(value) = - matches.get_one::<::chrono::DateTime<::chrono::offset::Utc>>("start-time") - { - request = request.start_time(value.clone()); + if let Some(value) = matches.get_one::("sort-by") { + request = request.sort_by(value.clone()); } - self.config.execute_silo_metric(matches, &mut request)?; - self.config.list_start::(); + self.config + .execute_multicast_group_member_list(matches, &mut request)?; + self.config + .list_start::(); let mut stream = futures::StreamExt::take( request.stream(), matches @@ -13184,7 +13909,7 @@ impl Cli { } Ok(None) => { self.config - .list_end_success::(); + .list_end_success::(); return Ok(()); } Ok(Some(value)) => { @@ -13194,6 +13919,78 @@ impl Cli { } } + pub async fn execute_multicast_group_member_add( + &self, + matches: &::clap::ArgMatches, + ) -> anyhow::Result<()> { + let mut request = self.client.multicast_group_member_add(); + if let Some(value) = matches.get_one::("instance") { + request = request.body_map(|body| body.instance(value.clone())) + } + + if let Some(value) = matches.get_one::("multicast-group") { + request = request.multicast_group(value.clone()); + } + + if let Some(value) = matches.get_one::("project") { + request = request.project(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_multicast_group_member_add(matches, &mut request)?; + let result = request.send().await; + match result { + Ok(r) => { + self.config.success_item(&r); + Ok(()) + } + Err(r) => { + self.config.error(&r); + Err(anyhow::Error::new(r)) + } + } + } + + pub async fn execute_multicast_group_member_remove( + &self, + matches: &::clap::ArgMatches, + ) -> anyhow::Result<()> { + let mut request = self.client.multicast_group_member_remove(); + if let Some(value) = matches.get_one::("instance") { + request = request.instance(value.clone()); + } + + if let Some(value) = matches.get_one::("multicast-group") { + request = request.multicast_group(value.clone()); + } + + if let Some(value) = matches.get_one::("project") { + request = request.project(value.clone()); + } + + self.config + .execute_multicast_group_member_remove(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_instance_network_interface_list( &self, matches: &::clap::ArgMatches, @@ -15419,6 +16216,30 @@ impl Cli { } } + pub async fn execute_lookup_multicast_group_by_ip( + &self, + matches: &::clap::ArgMatches, + ) -> anyhow::Result<()> { + let mut request = self.client.lookup_multicast_group_by_ip(); + if let Some(value) = matches.get_one::<::std::net::IpAddr>("address") { + request = request.address(value.clone()); + } + + self.config + .execute_lookup_multicast_group_by_ip(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_networking_address_lot_list( &self, matches: &::clap::ArgMatches, @@ -19416,6 +20237,30 @@ pub trait CliConfig { Ok(()) } + fn execute_instance_multicast_group_list( + &self, + matches: &::clap::ArgMatches, + request: &mut builder::InstanceMulticastGroupList, + ) -> anyhow::Result<()> { + Ok(()) + } + + fn execute_instance_multicast_group_join( + &self, + matches: &::clap::ArgMatches, + request: &mut builder::InstanceMulticastGroupJoin, + ) -> anyhow::Result<()> { + Ok(()) + } + + fn execute_instance_multicast_group_leave( + &self, + matches: &::clap::ArgMatches, + request: &mut builder::InstanceMulticastGroupLeave, + ) -> anyhow::Result<()> { + Ok(()) + } + fn execute_instance_reboot( &self, matches: &::clap::ArgMatches, @@ -19648,6 +20493,70 @@ pub trait CliConfig { Ok(()) } + fn execute_multicast_group_list( + &self, + matches: &::clap::ArgMatches, + request: &mut builder::MulticastGroupList, + ) -> anyhow::Result<()> { + Ok(()) + } + + fn execute_multicast_group_create( + &self, + matches: &::clap::ArgMatches, + request: &mut builder::MulticastGroupCreate, + ) -> anyhow::Result<()> { + Ok(()) + } + + fn execute_multicast_group_view( + &self, + matches: &::clap::ArgMatches, + request: &mut builder::MulticastGroupView, + ) -> anyhow::Result<()> { + Ok(()) + } + + fn execute_multicast_group_update( + &self, + matches: &::clap::ArgMatches, + request: &mut builder::MulticastGroupUpdate, + ) -> anyhow::Result<()> { + Ok(()) + } + + fn execute_multicast_group_delete( + &self, + matches: &::clap::ArgMatches, + request: &mut builder::MulticastGroupDelete, + ) -> anyhow::Result<()> { + Ok(()) + } + + fn execute_multicast_group_member_list( + &self, + matches: &::clap::ArgMatches, + request: &mut builder::MulticastGroupMemberList, + ) -> anyhow::Result<()> { + Ok(()) + } + + fn execute_multicast_group_member_add( + &self, + matches: &::clap::ArgMatches, + request: &mut builder::MulticastGroupMemberAdd, + ) -> anyhow::Result<()> { + Ok(()) + } + + fn execute_multicast_group_member_remove( + &self, + matches: &::clap::ArgMatches, + request: &mut builder::MulticastGroupMemberRemove, + ) -> anyhow::Result<()> { + Ok(()) + } + fn execute_instance_network_interface_list( &self, matches: &::clap::ArgMatches, @@ -20160,6 +21069,14 @@ pub trait CliConfig { Ok(()) } + fn execute_lookup_multicast_group_by_ip( + &self, + matches: &::clap::ArgMatches, + request: &mut builder::LookupMulticastGroupByIp, + ) -> anyhow::Result<()> { + Ok(()) + } + fn execute_networking_address_lot_list( &self, matches: &::clap::ArgMatches, @@ -21034,6 +21951,9 @@ pub enum CliCommand { InstanceExternalIpList, InstanceEphemeralIpAttach, InstanceEphemeralIpDetach, + InstanceMulticastGroupList, + InstanceMulticastGroupJoin, + InstanceMulticastGroupLeave, InstanceReboot, InstanceSerialConsole, InstanceSerialConsoleStream, @@ -21063,6 +21983,14 @@ pub enum CliCommand { CurrentUserSshKeyView, CurrentUserSshKeyDelete, SiloMetric, + MulticastGroupList, + MulticastGroupCreate, + MulticastGroupView, + MulticastGroupUpdate, + MulticastGroupDelete, + MulticastGroupMemberList, + MulticastGroupMemberAdd, + MulticastGroupMemberRemove, InstanceNetworkInterfaceList, InstanceNetworkInterfaceCreate, InstanceNetworkInterfaceView, @@ -21127,6 +22055,7 @@ pub enum CliCommand { IpPoolServiceRangeAdd, IpPoolServiceRangeRemove, SystemMetric, + LookupMulticastGroupByIp, NetworkingAddressLotList, NetworkingAddressLotCreate, NetworkingAddressLotView, @@ -21317,6 +22246,9 @@ impl CliCommand { CliCommand::InstanceExternalIpList, CliCommand::InstanceEphemeralIpAttach, CliCommand::InstanceEphemeralIpDetach, + CliCommand::InstanceMulticastGroupList, + CliCommand::InstanceMulticastGroupJoin, + CliCommand::InstanceMulticastGroupLeave, CliCommand::InstanceReboot, CliCommand::InstanceSerialConsole, CliCommand::InstanceSerialConsoleStream, @@ -21346,6 +22278,14 @@ impl CliCommand { CliCommand::CurrentUserSshKeyView, CliCommand::CurrentUserSshKeyDelete, CliCommand::SiloMetric, + CliCommand::MulticastGroupList, + CliCommand::MulticastGroupCreate, + CliCommand::MulticastGroupView, + CliCommand::MulticastGroupUpdate, + CliCommand::MulticastGroupDelete, + CliCommand::MulticastGroupMemberList, + CliCommand::MulticastGroupMemberAdd, + CliCommand::MulticastGroupMemberRemove, CliCommand::InstanceNetworkInterfaceList, CliCommand::InstanceNetworkInterfaceCreate, CliCommand::InstanceNetworkInterfaceView, @@ -21410,6 +22350,7 @@ impl CliCommand { CliCommand::IpPoolServiceRangeAdd, CliCommand::IpPoolServiceRangeRemove, CliCommand::SystemMetric, + CliCommand::LookupMulticastGroupByIp, CliCommand::NetworkingAddressLotList, CliCommand::NetworkingAddressLotCreate, CliCommand::NetworkingAddressLotView, diff --git a/oxide.json b/oxide.json index 5800b1c9..621cb8cc 100644 --- a/oxide.json +++ b/oxide.json @@ -4278,6 +4278,155 @@ } } }, + "/v1/instances/{instance}/multicast-groups": { + "get": { + "tags": [ + "experimental" + ], + "summary": "List multicast groups for instance", + "operationId": "instance_multicast_group_list", + "parameters": [ + { + "in": "query", + "name": "project", + "description": "Name or ID of the project", + "schema": { + "$ref": "#/components/schemas/NameOrId" + } + }, + { + "in": "path", + "name": "instance", + "description": "Name or ID of the instance", + "required": true, + "schema": { + "$ref": "#/components/schemas/NameOrId" + } + } + ], + "responses": { + "200": { + "description": "successful operation", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/MulticastGroupMemberResultsPage" + } + } + } + }, + "4XX": { + "$ref": "#/components/responses/Error" + }, + "5XX": { + "$ref": "#/components/responses/Error" + } + } + } + }, + "/v1/instances/{instance}/multicast-groups/{multicast_group}": { + "put": { + "tags": [ + "experimental" + ], + "summary": "Join multicast group.", + "description": "This is functionally equivalent to adding the instance via the group's member management endpoint or updating the instance's `multicast_groups` field. All approaches modify the same membership and trigger reconciliation.", + "operationId": "instance_multicast_group_join", + "parameters": [ + { + "in": "path", + "name": "instance", + "description": "Name or ID of the instance", + "required": true, + "schema": { + "$ref": "#/components/schemas/NameOrId" + } + }, + { + "in": "path", + "name": "multicast_group", + "description": "Name or ID of the multicast group", + "required": true, + "schema": { + "$ref": "#/components/schemas/NameOrId" + } + }, + { + "in": "query", + "name": "project", + "description": "Name or ID of the project", + "schema": { + "$ref": "#/components/schemas/NameOrId" + } + } + ], + "responses": { + "201": { + "description": "successful creation", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/MulticastGroupMember" + } + } + } + }, + "4XX": { + "$ref": "#/components/responses/Error" + }, + "5XX": { + "$ref": "#/components/responses/Error" + } + } + }, + "delete": { + "tags": [ + "experimental" + ], + "summary": "Leave multicast group.", + "description": "This is functionally equivalent to removing the instance via the group's member management endpoint or updating the instance's `multicast_groups` field. All approaches modify the same membership and trigger reconciliation.", + "operationId": "instance_multicast_group_leave", + "parameters": [ + { + "in": "path", + "name": "instance", + "description": "Name or ID of the instance", + "required": true, + "schema": { + "$ref": "#/components/schemas/NameOrId" + } + }, + { + "in": "path", + "name": "multicast_group", + "description": "Name or ID of the multicast group", + "required": true, + "schema": { + "$ref": "#/components/schemas/NameOrId" + } + }, + { + "in": "query", + "name": "project", + "description": "Name or ID of the project", + "schema": { + "$ref": "#/components/schemas/NameOrId" + } + } + ], + "responses": { + "204": { + "description": "successful deletion" + }, + "4XX": { + "$ref": "#/components/responses/Error" + }, + "5XX": { + "$ref": "#/components/responses/Error" + } + } + } + }, "/v1/instances/{instance}/reboot": { "post": { "tags": [ @@ -5879,6 +6028,386 @@ } } }, + "/v1/multicast-groups": { + "get": { + "tags": [ + "experimental" + ], + "summary": "List all multicast groups.", + "operationId": "multicast_group_list", + "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/NameOrIdSortMode" + } + } + ], + "responses": { + "200": { + "description": "successful operation", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/MulticastGroupResultsPage" + } + } + } + }, + "4XX": { + "$ref": "#/components/responses/Error" + }, + "5XX": { + "$ref": "#/components/responses/Error" + } + }, + "x-dropshot-pagination": { + "required": [] + } + }, + "post": { + "tags": [ + "experimental" + ], + "summary": "Create a multicast group.", + "description": "Multicast groups are fleet-scoped resources that can be joined by instances across projects and silos. A single multicast IP serves all group members regardless of project or silo boundaries.", + "operationId": "multicast_group_create", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/MulticastGroupCreate" + } + } + }, + "required": true + }, + "responses": { + "201": { + "description": "successful creation", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/MulticastGroup" + } + } + } + }, + "4XX": { + "$ref": "#/components/responses/Error" + }, + "5XX": { + "$ref": "#/components/responses/Error" + } + } + } + }, + "/v1/multicast-groups/{multicast_group}": { + "get": { + "tags": [ + "experimental" + ], + "summary": "Fetch a multicast group.", + "operationId": "multicast_group_view", + "parameters": [ + { + "in": "path", + "name": "multicast_group", + "description": "Name or ID of the multicast group", + "required": true, + "schema": { + "$ref": "#/components/schemas/NameOrId" + } + } + ], + "responses": { + "200": { + "description": "successful operation", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/MulticastGroup" + } + } + } + }, + "4XX": { + "$ref": "#/components/responses/Error" + }, + "5XX": { + "$ref": "#/components/responses/Error" + } + } + }, + "put": { + "tags": [ + "experimental" + ], + "summary": "Update a multicast group.", + "operationId": "multicast_group_update", + "parameters": [ + { + "in": "path", + "name": "multicast_group", + "description": "Name or ID of the multicast group", + "required": true, + "schema": { + "$ref": "#/components/schemas/NameOrId" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/MulticastGroupUpdate" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "successful operation", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/MulticastGroup" + } + } + } + }, + "4XX": { + "$ref": "#/components/responses/Error" + }, + "5XX": { + "$ref": "#/components/responses/Error" + } + } + }, + "delete": { + "tags": [ + "experimental" + ], + "summary": "Delete a multicast group.", + "operationId": "multicast_group_delete", + "parameters": [ + { + "in": "path", + "name": "multicast_group", + "description": "Name or ID of the multicast group", + "required": true, + "schema": { + "$ref": "#/components/schemas/NameOrId" + } + } + ], + "responses": { + "204": { + "description": "successful deletion" + }, + "4XX": { + "$ref": "#/components/responses/Error" + }, + "5XX": { + "$ref": "#/components/responses/Error" + } + } + } + }, + "/v1/multicast-groups/{multicast_group}/members": { + "get": { + "tags": [ + "experimental" + ], + "summary": "List members of a multicast group.", + "operationId": "multicast_group_member_list", + "parameters": [ + { + "in": "path", + "name": "multicast_group", + "description": "Name or ID of the multicast group", + "required": true, + "schema": { + "$ref": "#/components/schemas/NameOrId" + } + }, + { + "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/MulticastGroupMemberResultsPage" + } + } + } + }, + "4XX": { + "$ref": "#/components/responses/Error" + }, + "5XX": { + "$ref": "#/components/responses/Error" + } + }, + "x-dropshot-pagination": { + "required": [] + } + }, + "post": { + "tags": [ + "experimental" + ], + "summary": "Add instance to a multicast group.", + "description": "Functionally equivalent to updating the instance's `multicast_groups` field. Both approaches modify the same underlying membership and trigger the same reconciliation logic.\n\nSpecify instance by name (requires `?project=`) or UUID.", + "operationId": "multicast_group_member_add", + "parameters": [ + { + "in": "path", + "name": "multicast_group", + "description": "Name or ID of the multicast group", + "required": true, + "schema": { + "$ref": "#/components/schemas/NameOrId" + } + }, + { + "in": "query", + "name": "project", + "description": "Name or ID of the project", + "schema": { + "$ref": "#/components/schemas/NameOrId" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/MulticastGroupMemberAdd" + } + } + }, + "required": true + }, + "responses": { + "201": { + "description": "successful creation", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/MulticastGroupMember" + } + } + } + }, + "4XX": { + "$ref": "#/components/responses/Error" + }, + "5XX": { + "$ref": "#/components/responses/Error" + } + } + } + }, + "/v1/multicast-groups/{multicast_group}/members/{instance}": { + "delete": { + "tags": [ + "experimental" + ], + "summary": "Remove instance from a multicast group.", + "description": "Functionally equivalent to removing the group from the instance's `multicast_groups` field. Both approaches modify the same underlying membership and trigger reconciliation.\n\nSpecify instance by name (requires `?project=`) or UUID.", + "operationId": "multicast_group_member_remove", + "parameters": [ + { + "in": "path", + "name": "instance", + "description": "Name or ID of the instance", + "required": true, + "schema": { + "$ref": "#/components/schemas/NameOrId" + } + }, + { + "in": "path", + "name": "multicast_group", + "description": "Name or ID of the multicast group", + "required": true, + "schema": { + "$ref": "#/components/schemas/NameOrId" + } + }, + { + "in": "query", + "name": "project", + "description": "Name or ID of the project", + "schema": { + "$ref": "#/components/schemas/NameOrId" + } + } + ], + "responses": { + "204": { + "description": "successful deletion" + }, + "4XX": { + "$ref": "#/components/responses/Error" + }, + "5XX": { + "$ref": "#/components/responses/Error" + } + } + } + }, "/v1/network-interfaces": { "get": { "tags": [ @@ -9084,12 +9613,51 @@ "5XX": { "$ref": "#/components/responses/Error" } - }, - "x-dropshot-pagination": { - "required": [ - "end_time", - "start_time" - ] + }, + "x-dropshot-pagination": { + "required": [ + "end_time", + "start_time" + ] + } + } + }, + "/v1/system/multicast-groups/by-ip/{address}": { + "get": { + "tags": [ + "experimental" + ], + "summary": "Look up multicast group by IP address.", + "operationId": "lookup_multicast_group_by_ip", + "parameters": [ + { + "in": "path", + "name": "address", + "description": "IP address of the multicast group", + "required": true, + "schema": { + "type": "string", + "format": "ip" + } + } + ], + "responses": { + "200": { + "description": "successful operation", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/MulticastGroup" + } + } + } + }, + "4XX": { + "$ref": "#/components/responses/Error" + }, + "5XX": { + "$ref": "#/components/responses/Error" + } } } }, @@ -20552,6 +21120,14 @@ } ] }, + "multicast_groups": { + "description": "The multicast groups this instance should join.\n\nThe instance will be automatically added as a member of the specified multicast groups during creation, enabling it to send and receive multicast traffic for those groups.", + "default": [], + "type": "array", + "items": { + "$ref": "#/components/schemas/NameOrId" + } + }, "name": { "$ref": "#/components/schemas/Name" }, @@ -21075,6 +21651,15 @@ } ] }, + "multicast_groups": { + "nullable": true, + "description": "Multicast groups this instance should join.\n\nWhen specified, this replaces the instance's current multicast group membership with the new set of groups. The instance will leave any groups not listed here and join any new groups that are specified.\n\nIf not provided (None), the instance's multicast group membership will not be changed.", + "default": null, + "type": "array", + "items": { + "$ref": "#/components/schemas/NameOrId" + } + }, "ncpus": { "description": "The number of vCPUs to be allocated to the instance", "allOf": [ @@ -22219,7 +22804,7 @@ "minimum": 0 }, "rack_id": { - "description": "The containing the switch this loopback address will be configured on.", + "description": "The rack containing the switch this loopback address will be configured on.", "type": "string", "format": "uuid" }, @@ -22375,6 +22960,279 @@ "datum_type" ] }, + "MulticastGroup": { + "description": "View of a Multicast Group", + "type": "object", + "properties": { + "description": { + "description": "human-readable free-form text about a resource", + "type": "string" + }, + "id": { + "description": "unique, immutable, system-controlled identifier for each resource", + "type": "string", + "format": "uuid" + }, + "ip_pool_id": { + "description": "The ID of the IP pool this resource belongs to.", + "type": "string", + "format": "uuid" + }, + "multicast_ip": { + "description": "The multicast IP address held by this resource.", + "type": "string", + "format": "ip" + }, + "mvlan": { + "nullable": true, + "description": "Multicast VLAN (MVLAN) for egress multicast traffic to upstream networks. None means no VLAN tagging on egress.", + "type": "integer", + "format": "uint16", + "minimum": 0 + }, + "name": { + "description": "unique, mutable, user-controlled identifier for each resource", + "allOf": [ + { + "$ref": "#/components/schemas/Name" + } + ] + }, + "source_ips": { + "description": "Source IP addresses for Source-Specific Multicast (SSM). Empty array means any source is allowed.", + "type": "array", + "items": { + "type": "string", + "format": "ip" + } + }, + "state": { + "description": "Current state of the multicast group.", + "type": "string" + }, + "time_created": { + "description": "timestamp when this resource was created", + "type": "string", + "format": "date-time" + }, + "time_modified": { + "description": "timestamp when this resource was last modified", + "type": "string", + "format": "date-time" + } + }, + "required": [ + "description", + "id", + "ip_pool_id", + "multicast_ip", + "name", + "source_ips", + "state", + "time_created", + "time_modified" + ] + }, + "MulticastGroupCreate": { + "description": "Create-time parameters for a multicast group.", + "type": "object", + "properties": { + "description": { + "type": "string" + }, + "multicast_ip": { + "nullable": true, + "description": "The multicast IP address to allocate. If None, one will be allocated from the default pool.", + "default": null, + "type": "string", + "format": "ip" + }, + "mvlan": { + "nullable": true, + "description": "Multicast VLAN (MVLAN) for egress multicast traffic to upstream networks. Tags packets leaving the rack to traverse VLAN-segmented upstream networks.\n\nValid range: 2-4094 (VLAN IDs 0-1 are reserved by IEEE 802.1Q standard).", + "default": null, + "type": "integer", + "format": "uint16", + "minimum": 0 + }, + "name": { + "$ref": "#/components/schemas/Name" + }, + "pool": { + "nullable": true, + "description": "Name or ID of the IP pool to allocate from. If None, uses the default multicast pool.", + "default": null, + "allOf": [ + { + "$ref": "#/components/schemas/NameOrId" + } + ] + }, + "source_ips": { + "nullable": true, + "description": "Source IP addresses for Source-Specific Multicast (SSM).\n\nNone uses default behavior (Any-Source Multicast). Empty list explicitly allows any source (Any-Source Multicast). Non-empty list restricts to specific sources (SSM).", + "default": null, + "type": "array", + "items": { + "type": "string", + "format": "ip" + } + } + }, + "required": [ + "description", + "name" + ] + }, + "MulticastGroupMember": { + "description": "View of a Multicast Group Member (instance belonging to a multicast group)", + "type": "object", + "properties": { + "description": { + "description": "human-readable free-form text about a resource", + "type": "string" + }, + "id": { + "description": "unique, immutable, system-controlled identifier for each resource", + "type": "string", + "format": "uuid" + }, + "instance_id": { + "description": "The ID of the instance that is a member of this group.", + "type": "string", + "format": "uuid" + }, + "multicast_group_id": { + "description": "The ID of the multicast group this member belongs to.", + "type": "string", + "format": "uuid" + }, + "name": { + "description": "unique, mutable, user-controlled identifier for each resource", + "allOf": [ + { + "$ref": "#/components/schemas/Name" + } + ] + }, + "state": { + "description": "Current state of the multicast group membership.", + "type": "string" + }, + "time_created": { + "description": "timestamp when this resource was created", + "type": "string", + "format": "date-time" + }, + "time_modified": { + "description": "timestamp when this resource was last modified", + "type": "string", + "format": "date-time" + } + }, + "required": [ + "description", + "id", + "instance_id", + "multicast_group_id", + "name", + "state", + "time_created", + "time_modified" + ] + }, + "MulticastGroupMemberAdd": { + "description": "Parameters for adding an instance to a multicast group.", + "type": "object", + "properties": { + "instance": { + "description": "Name or ID of the instance to add to the multicast group", + "allOf": [ + { + "$ref": "#/components/schemas/NameOrId" + } + ] + } + }, + "required": [ + "instance" + ] + }, + "MulticastGroupMemberResultsPage": { + "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/MulticastGroupMember" + } + }, + "next_page": { + "nullable": true, + "description": "token used to fetch the next page of results (if any)", + "type": "string" + } + }, + "required": [ + "items" + ] + }, + "MulticastGroupResultsPage": { + "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/MulticastGroup" + } + }, + "next_page": { + "nullable": true, + "description": "token used to fetch the next page of results (if any)", + "type": "string" + } + }, + "required": [ + "items" + ] + }, + "MulticastGroupUpdate": { + "description": "Update-time parameters for a multicast group.", + "type": "object", + "properties": { + "description": { + "nullable": true, + "type": "string" + }, + "mvlan": { + "nullable": true, + "description": "Multicast VLAN (MVLAN) for egress multicast traffic to upstream networks. Set to null to clear the MVLAN. Valid range: 2-4094 when provided. Omit the field to leave mvlan unchanged.", + "type": "integer", + "format": "uint16", + "minimum": 0 + }, + "name": { + "nullable": true, + "allOf": [ + { + "$ref": "#/components/schemas/Name" + } + ] + }, + "source_ips": { + "nullable": true, + "type": "array", + "items": { + "type": "string", + "format": "ip" + } + } + } + }, "Name": { "title": "A name unique within the parent collection", "description": "Names must begin with a lower case ASCII letter, be composed exclusively of lowercase ASCII, uppercase ASCII, numbers, and '-', and may not end with a '-'. Names cannot be a UUID, but they may contain a UUID. They can be at most 63 characters long.", @@ -28209,6 +29067,13 @@ "url": "http://docs.oxide.computer/api/metrics" } }, + { + "name": "multicast-groups", + "description": "Multicast groups provide efficient one-to-many network communication.", + "externalDocs": { + "url": "http://docs.oxide.computer/api/multicast-groups" + } + }, { "name": "policy", "description": "System-wide IAM policy", diff --git a/sdk-httpmock/src/generated_httpmock.rs b/sdk-httpmock/src/generated_httpmock.rs index 85dcd225..d8f9c66a 100644 --- a/sdk-httpmock/src/generated_httpmock.rs +++ b/sdk-httpmock/src/generated_httpmock.rs @@ -6979,6 +6979,255 @@ pub mod operations { } } + pub struct InstanceMulticastGroupListWhen(::httpmock::When); + impl InstanceMulticastGroupListWhen { + pub fn new(inner: ::httpmock::When) -> Self { + Self( + inner.method(::httpmock::Method::GET).path_matches( + regex::Regex::new("^/v1/instances/[^/]*/multicast-groups$").unwrap(), + ), + ) + } + + pub fn into_inner(self) -> ::httpmock::When { + self.0 + } + + pub fn instance(self, value: &types::NameOrId) -> Self { + let re = regex::Regex::new(&format!( + "^/v1/instances/{}/multicast-groups$", + value.to_string() + )) + .unwrap(); + Self(self.0.path_matches(re)) + } + + pub fn project<'a, T>(self, value: T) -> Self + where + T: Into>, + { + if let Some(value) = value.into() { + Self(self.0.query_param("project", value.to_string())) + } else { + Self(self.0.matches(|req| { + req.query_params + .as_ref() + .and_then(|qs| qs.iter().find(|(key, _)| key == "project")) + .is_none() + })) + } + } + } + + pub struct InstanceMulticastGroupListThen(::httpmock::Then); + impl InstanceMulticastGroupListThen { + pub fn new(inner: ::httpmock::Then) -> Self { + Self(inner) + } + + pub fn into_inner(self) -> ::httpmock::Then { + self.0 + } + + pub fn ok(self, value: &types::MulticastGroupMemberResultsPage) -> 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 InstanceMulticastGroupJoinWhen(::httpmock::When); + impl InstanceMulticastGroupJoinWhen { + pub fn new(inner: ::httpmock::When) -> Self { + Self(inner.method(::httpmock::Method::PUT).path_matches( + regex::Regex::new("^/v1/instances/[^/]*/multicast-groups/[^/]*$").unwrap(), + )) + } + + pub fn into_inner(self) -> ::httpmock::When { + self.0 + } + + pub fn instance(self, value: &types::NameOrId) -> Self { + let re = regex::Regex::new(&format!( + "^/v1/instances/{}/multicast-groups/.*$", + value.to_string() + )) + .unwrap(); + Self(self.0.path_matches(re)) + } + + pub fn multicast_group(self, value: &types::NameOrId) -> Self { + let re = regex::Regex::new(&format!( + "^/v1/instances/.*/multicast-groups/{}$", + value.to_string() + )) + .unwrap(); + Self(self.0.path_matches(re)) + } + + pub fn project<'a, T>(self, value: T) -> Self + where + T: Into>, + { + if let Some(value) = value.into() { + Self(self.0.query_param("project", value.to_string())) + } else { + Self(self.0.matches(|req| { + req.query_params + .as_ref() + .and_then(|qs| qs.iter().find(|(key, _)| key == "project")) + .is_none() + })) + } + } + } + + pub struct InstanceMulticastGroupJoinThen(::httpmock::Then); + impl InstanceMulticastGroupJoinThen { + pub fn new(inner: ::httpmock::Then) -> Self { + Self(inner) + } + + pub fn into_inner(self) -> ::httpmock::Then { + self.0 + } + + pub fn created(self, value: &types::MulticastGroupMember) -> 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 InstanceMulticastGroupLeaveWhen(::httpmock::When); + impl InstanceMulticastGroupLeaveWhen { + pub fn new(inner: ::httpmock::When) -> Self { + Self(inner.method(::httpmock::Method::DELETE).path_matches( + regex::Regex::new("^/v1/instances/[^/]*/multicast-groups/[^/]*$").unwrap(), + )) + } + + pub fn into_inner(self) -> ::httpmock::When { + self.0 + } + + pub fn instance(self, value: &types::NameOrId) -> Self { + let re = regex::Regex::new(&format!( + "^/v1/instances/{}/multicast-groups/.*$", + value.to_string() + )) + .unwrap(); + Self(self.0.path_matches(re)) + } + + pub fn multicast_group(self, value: &types::NameOrId) -> Self { + let re = regex::Regex::new(&format!( + "^/v1/instances/.*/multicast-groups/{}$", + value.to_string() + )) + .unwrap(); + Self(self.0.path_matches(re)) + } + + pub fn project<'a, T>(self, value: T) -> Self + where + T: Into>, + { + if let Some(value) = value.into() { + Self(self.0.query_param("project", value.to_string())) + } else { + Self(self.0.matches(|req| { + req.query_params + .as_ref() + .and_then(|qs| qs.iter().find(|(key, _)| key == "project")) + .is_none() + })) + } + } + } + + pub struct InstanceMulticastGroupLeaveThen(::httpmock::Then); + impl InstanceMulticastGroupLeaveThen { + 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 InstanceRebootWhen(::httpmock::When); impl InstanceRebootWhen { pub fn new(inner: ::httpmock::When) -> Self { @@ -9606,36 +9855,679 @@ pub mod operations { } } - pub fn order(self, value: T) -> Self - where - T: Into>, - { - if let Some(value) = value.into() { - Self(self.0.query_param("order", value.to_string())) - } else { - Self(self.0.matches(|req| { - req.query_params - .as_ref() - .and_then(|qs| qs.iter().find(|(key, _)| key == "order")) - .is_none() - })) - } + pub fn order(self, value: T) -> Self + where + T: Into>, + { + if let Some(value) = value.into() { + Self(self.0.query_param("order", value.to_string())) + } else { + Self(self.0.matches(|req| { + req.query_params + .as_ref() + .and_then(|qs| qs.iter().find(|(key, _)| key == "order")) + .is_none() + })) + } + } + + 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.matches(|req| { + req.query_params + .as_ref() + .and_then(|qs| qs.iter().find(|(key, _)| key == "page_token")) + .is_none() + })) + } + } + + pub fn project<'a, T>(self, value: T) -> Self + where + T: Into>, + { + if let Some(value) = value.into() { + Self(self.0.query_param("project", value.to_string())) + } else { + Self(self.0.matches(|req| { + req.query_params + .as_ref() + .and_then(|qs| qs.iter().find(|(key, _)| key == "project")) + .is_none() + })) + } + } + + pub fn start_time<'a, T>(self, value: T) -> Self + where + T: Into>>, + { + if let Some(value) = value.into() { + Self(self.0.query_param("start_time", value.to_string())) + } else { + Self(self.0.matches(|req| { + req.query_params + .as_ref() + .and_then(|qs| qs.iter().find(|(key, _)| key == "start_time")) + .is_none() + })) + } + } + } + + pub struct SiloMetricThen(::httpmock::Then); + impl SiloMetricThen { + pub fn new(inner: ::httpmock::Then) -> Self { + Self(inner) + } + + pub fn into_inner(self) -> ::httpmock::Then { + self.0 + } + + pub fn ok(self, value: &types::MeasurementResultsPage) -> 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 MulticastGroupListWhen(::httpmock::When); + impl MulticastGroupListWhen { + pub fn new(inner: ::httpmock::When) -> Self { + Self( + inner + .method(::httpmock::Method::GET) + .path_matches(regex::Regex::new("^/v1/multicast-groups$").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.matches(|req| { + req.query_params + .as_ref() + .and_then(|qs| qs.iter().find(|(key, _)| key == "limit")) + .is_none() + })) + } + } + + 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.matches(|req| { + req.query_params + .as_ref() + .and_then(|qs| qs.iter().find(|(key, _)| key == "page_token")) + .is_none() + })) + } + } + + 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.matches(|req| { + req.query_params + .as_ref() + .and_then(|qs| qs.iter().find(|(key, _)| key == "sort_by")) + .is_none() + })) + } + } + } + + pub struct MulticastGroupListThen(::httpmock::Then); + impl MulticastGroupListThen { + pub fn new(inner: ::httpmock::Then) -> Self { + Self(inner) + } + + pub fn into_inner(self) -> ::httpmock::Then { + self.0 + } + + pub fn ok(self, value: &types::MulticastGroupResultsPage) -> 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 MulticastGroupCreateWhen(::httpmock::When); + impl MulticastGroupCreateWhen { + pub fn new(inner: ::httpmock::When) -> Self { + Self( + inner + .method(::httpmock::Method::POST) + .path_matches(regex::Regex::new("^/v1/multicast-groups$").unwrap()), + ) + } + + pub fn into_inner(self) -> ::httpmock::When { + self.0 + } + + pub fn body(self, value: &types::MulticastGroupCreate) -> Self { + Self(self.0.json_body_obj(value)) + } + } + + pub struct MulticastGroupCreateThen(::httpmock::Then); + impl MulticastGroupCreateThen { + pub fn new(inner: ::httpmock::Then) -> Self { + Self(inner) + } + + pub fn into_inner(self) -> ::httpmock::Then { + self.0 + } + + pub fn created(self, value: &types::MulticastGroup) -> 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 MulticastGroupViewWhen(::httpmock::When); + impl MulticastGroupViewWhen { + pub fn new(inner: ::httpmock::When) -> Self { + Self( + inner + .method(::httpmock::Method::GET) + .path_matches(regex::Regex::new("^/v1/multicast-groups/[^/]*$").unwrap()), + ) + } + + pub fn into_inner(self) -> ::httpmock::When { + self.0 + } + + pub fn multicast_group(self, value: &types::NameOrId) -> Self { + let re = regex::Regex::new(&format!("^/v1/multicast-groups/{}$", value.to_string())) + .unwrap(); + Self(self.0.path_matches(re)) + } + } + + pub struct MulticastGroupViewThen(::httpmock::Then); + impl MulticastGroupViewThen { + pub fn new(inner: ::httpmock::Then) -> Self { + Self(inner) + } + + pub fn into_inner(self) -> ::httpmock::Then { + self.0 + } + + pub fn ok(self, value: &types::MulticastGroup) -> 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 MulticastGroupUpdateWhen(::httpmock::When); + impl MulticastGroupUpdateWhen { + pub fn new(inner: ::httpmock::When) -> Self { + Self( + inner + .method(::httpmock::Method::PUT) + .path_matches(regex::Regex::new("^/v1/multicast-groups/[^/]*$").unwrap()), + ) + } + + pub fn into_inner(self) -> ::httpmock::When { + self.0 + } + + pub fn multicast_group(self, value: &types::NameOrId) -> Self { + let re = regex::Regex::new(&format!("^/v1/multicast-groups/{}$", value.to_string())) + .unwrap(); + Self(self.0.path_matches(re)) + } + + pub fn body(self, value: &types::MulticastGroupUpdate) -> Self { + Self(self.0.json_body_obj(value)) + } + } + + pub struct MulticastGroupUpdateThen(::httpmock::Then); + impl MulticastGroupUpdateThen { + pub fn new(inner: ::httpmock::Then) -> Self { + Self(inner) + } + + pub fn into_inner(self) -> ::httpmock::Then { + self.0 + } + + pub fn ok(self, value: &types::MulticastGroup) -> 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 MulticastGroupDeleteWhen(::httpmock::When); + impl MulticastGroupDeleteWhen { + pub fn new(inner: ::httpmock::When) -> Self { + Self( + inner + .method(::httpmock::Method::DELETE) + .path_matches(regex::Regex::new("^/v1/multicast-groups/[^/]*$").unwrap()), + ) + } + + pub fn into_inner(self) -> ::httpmock::When { + self.0 + } + + pub fn multicast_group(self, value: &types::NameOrId) -> Self { + let re = regex::Regex::new(&format!("^/v1/multicast-groups/{}$", value.to_string())) + .unwrap(); + Self(self.0.path_matches(re)) + } + } + + pub struct MulticastGroupDeleteThen(::httpmock::Then); + impl MulticastGroupDeleteThen { + 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 MulticastGroupMemberListWhen(::httpmock::When); + impl MulticastGroupMemberListWhen { + pub fn new(inner: ::httpmock::When) -> Self { + Self( + inner.method(::httpmock::Method::GET).path_matches( + regex::Regex::new("^/v1/multicast-groups/[^/]*/members$").unwrap(), + ), + ) + } + + pub fn into_inner(self) -> ::httpmock::When { + self.0 + } + + pub fn multicast_group(self, value: &types::NameOrId) -> Self { + let re = regex::Regex::new(&format!( + "^/v1/multicast-groups/{}/members$", + value.to_string() + )) + .unwrap(); + Self(self.0.path_matches(re)) + } + + 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.matches(|req| { + req.query_params + .as_ref() + .and_then(|qs| qs.iter().find(|(key, _)| key == "limit")) + .is_none() + })) + } + } + + 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.matches(|req| { + req.query_params + .as_ref() + .and_then(|qs| qs.iter().find(|(key, _)| key == "page_token")) + .is_none() + })) + } + } + + 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.matches(|req| { + req.query_params + .as_ref() + .and_then(|qs| qs.iter().find(|(key, _)| key == "sort_by")) + .is_none() + })) + } + } + } + + pub struct MulticastGroupMemberListThen(::httpmock::Then); + impl MulticastGroupMemberListThen { + pub fn new(inner: ::httpmock::Then) -> Self { + Self(inner) + } + + pub fn into_inner(self) -> ::httpmock::Then { + self.0 + } + + pub fn ok(self, value: &types::MulticastGroupMemberResultsPage) -> 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 MulticastGroupMemberAddWhen(::httpmock::When); + impl MulticastGroupMemberAddWhen { + pub fn new(inner: ::httpmock::When) -> Self { + Self( + inner.method(::httpmock::Method::POST).path_matches( + regex::Regex::new("^/v1/multicast-groups/[^/]*/members$").unwrap(), + ), + ) + } + + pub fn into_inner(self) -> ::httpmock::When { + self.0 + } + + pub fn multicast_group(self, value: &types::NameOrId) -> Self { + let re = regex::Regex::new(&format!( + "^/v1/multicast-groups/{}/members$", + value.to_string() + )) + .unwrap(); + Self(self.0.path_matches(re)) + } + + pub fn project<'a, T>(self, value: T) -> Self + where + T: Into>, + { + if let Some(value) = value.into() { + Self(self.0.query_param("project", value.to_string())) + } else { + Self(self.0.matches(|req| { + req.query_params + .as_ref() + .and_then(|qs| qs.iter().find(|(key, _)| key == "project")) + .is_none() + })) + } + } + + pub fn body(self, value: &types::MulticastGroupMemberAdd) -> Self { + Self(self.0.json_body_obj(value)) + } + } + + pub struct MulticastGroupMemberAddThen(::httpmock::Then); + impl MulticastGroupMemberAddThen { + pub fn new(inner: ::httpmock::Then) -> Self { + Self(inner) + } + + pub fn into_inner(self) -> ::httpmock::Then { + self.0 + } + + pub fn created(self, value: &types::MulticastGroupMember) -> 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 MulticastGroupMemberRemoveWhen(::httpmock::When); + impl MulticastGroupMemberRemoveWhen { + pub fn new(inner: ::httpmock::When) -> Self { + Self(inner.method(::httpmock::Method::DELETE).path_matches( + regex::Regex::new("^/v1/multicast-groups/[^/]*/members/[^/]*$").unwrap(), + )) + } + + pub fn into_inner(self) -> ::httpmock::When { + self.0 + } + + pub fn multicast_group(self, value: &types::NameOrId) -> Self { + let re = regex::Regex::new(&format!( + "^/v1/multicast-groups/{}/members/.*$", + value.to_string() + )) + .unwrap(); + Self(self.0.path_matches(re)) } - 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.matches(|req| { - req.query_params - .as_ref() - .and_then(|qs| qs.iter().find(|(key, _)| key == "page_token")) - .is_none() - })) - } + pub fn instance(self, value: &types::NameOrId) -> Self { + let re = regex::Regex::new(&format!( + "^/v1/multicast-groups/.*/members/{}$", + value.to_string() + )) + .unwrap(); + Self(self.0.path_matches(re)) } pub fn project<'a, T>(self, value: T) -> Self @@ -9653,26 +10545,10 @@ pub mod operations { })) } } - - pub fn start_time<'a, T>(self, value: T) -> Self - where - T: Into>>, - { - if let Some(value) = value.into() { - Self(self.0.query_param("start_time", value.to_string())) - } else { - Self(self.0.matches(|req| { - req.query_params - .as_ref() - .and_then(|qs| qs.iter().find(|(key, _)| key == "start_time")) - .is_none() - })) - } - } } - pub struct SiloMetricThen(::httpmock::Then); - impl SiloMetricThen { + pub struct MulticastGroupMemberRemoveThen(::httpmock::Then); + impl MulticastGroupMemberRemoveThen { pub fn new(inner: ::httpmock::Then) -> Self { Self(inner) } @@ -9681,13 +10557,8 @@ pub mod operations { self.0 } - pub fn ok(self, value: &types::MeasurementResultsPage) -> Self { - Self( - self.0 - .status(200u16) - .header("content-type", "application/json") - .json_body_obj(value), - ) + pub fn no_content(self) -> Self { + Self(self.0.status(204u16)) } pub fn client_error(self, status: u16, value: &types::Error) -> Self { @@ -14808,6 +15679,68 @@ pub mod operations { } } + pub struct LookupMulticastGroupByIpWhen(::httpmock::When); + impl LookupMulticastGroupByIpWhen { + pub fn new(inner: ::httpmock::When) -> Self { + Self(inner.method(::httpmock::Method::GET).path_matches( + regex::Regex::new("^/v1/system/multicast-groups/by-ip/[^/]*$").unwrap(), + )) + } + + pub fn into_inner(self) -> ::httpmock::When { + self.0 + } + + pub fn address(self, value: &::std::net::IpAddr) -> Self { + let re = regex::Regex::new(&format!( + "^/v1/system/multicast-groups/by-ip/{}$", + value.to_string() + )) + .unwrap(); + Self(self.0.path_matches(re)) + } + } + + pub struct LookupMulticastGroupByIpThen(::httpmock::Then); + impl LookupMulticastGroupByIpThen { + pub fn new(inner: ::httpmock::Then) -> Self { + Self(inner) + } + + pub fn into_inner(self) -> ::httpmock::Then { + self.0 + } + + pub fn ok(self, value: &types::MulticastGroup) -> 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 NetworkingAddressLotListWhen(::httpmock::When); impl NetworkingAddressLotListWhen { pub fn new(inner: ::httpmock::When) -> Self { @@ -22686,6 +23619,24 @@ pub trait MockServerExt { operations::InstanceEphemeralIpDetachWhen, operations::InstanceEphemeralIpDetachThen, ); + fn instance_multicast_group_list(&self, config_fn: F) -> ::httpmock::Mock<'_> + where + F: FnOnce( + operations::InstanceMulticastGroupListWhen, + operations::InstanceMulticastGroupListThen, + ); + fn instance_multicast_group_join(&self, config_fn: F) -> ::httpmock::Mock<'_> + where + F: FnOnce( + operations::InstanceMulticastGroupJoinWhen, + operations::InstanceMulticastGroupJoinThen, + ); + fn instance_multicast_group_leave(&self, config_fn: F) -> ::httpmock::Mock<'_> + where + F: FnOnce( + operations::InstanceMulticastGroupLeaveWhen, + operations::InstanceMulticastGroupLeaveThen, + ); fn instance_reboot(&self, config_fn: F) -> ::httpmock::Mock<'_> where F: FnOnce(operations::InstanceRebootWhen, operations::InstanceRebootThen); @@ -22803,6 +23754,36 @@ pub trait MockServerExt { fn silo_metric(&self, config_fn: F) -> ::httpmock::Mock<'_> where F: FnOnce(operations::SiloMetricWhen, operations::SiloMetricThen); + fn multicast_group_list(&self, config_fn: F) -> ::httpmock::Mock<'_> + where + F: FnOnce(operations::MulticastGroupListWhen, operations::MulticastGroupListThen); + fn multicast_group_create(&self, config_fn: F) -> ::httpmock::Mock<'_> + where + F: FnOnce(operations::MulticastGroupCreateWhen, operations::MulticastGroupCreateThen); + fn multicast_group_view(&self, config_fn: F) -> ::httpmock::Mock<'_> + where + F: FnOnce(operations::MulticastGroupViewWhen, operations::MulticastGroupViewThen); + fn multicast_group_update(&self, config_fn: F) -> ::httpmock::Mock<'_> + where + F: FnOnce(operations::MulticastGroupUpdateWhen, operations::MulticastGroupUpdateThen); + fn multicast_group_delete(&self, config_fn: F) -> ::httpmock::Mock<'_> + where + F: FnOnce(operations::MulticastGroupDeleteWhen, operations::MulticastGroupDeleteThen); + fn multicast_group_member_list(&self, config_fn: F) -> ::httpmock::Mock<'_> + where + F: FnOnce( + operations::MulticastGroupMemberListWhen, + operations::MulticastGroupMemberListThen, + ); + fn multicast_group_member_add(&self, config_fn: F) -> ::httpmock::Mock<'_> + where + F: FnOnce(operations::MulticastGroupMemberAddWhen, operations::MulticastGroupMemberAddThen); + fn multicast_group_member_remove(&self, config_fn: F) -> ::httpmock::Mock<'_> + where + F: FnOnce( + operations::MulticastGroupMemberRemoveWhen, + operations::MulticastGroupMemberRemoveThen, + ); fn instance_network_interface_list(&self, config_fn: F) -> ::httpmock::Mock<'_> where F: FnOnce( @@ -23043,6 +24024,12 @@ pub trait MockServerExt { fn system_metric(&self, config_fn: F) -> ::httpmock::Mock<'_> where F: FnOnce(operations::SystemMetricWhen, operations::SystemMetricThen); + fn lookup_multicast_group_by_ip(&self, config_fn: F) -> ::httpmock::Mock<'_> + where + F: FnOnce( + operations::LookupMulticastGroupByIpWhen, + operations::LookupMulticastGroupByIpThen, + ); fn networking_address_lot_list(&self, config_fn: F) -> ::httpmock::Mock<'_> where F: FnOnce( @@ -24525,6 +25512,51 @@ impl MockServerExt for ::httpmock::MockServer { }) } + fn instance_multicast_group_list(&self, config_fn: F) -> ::httpmock::Mock<'_> + where + F: FnOnce( + operations::InstanceMulticastGroupListWhen, + operations::InstanceMulticastGroupListThen, + ), + { + self.mock(|when, then| { + config_fn( + operations::InstanceMulticastGroupListWhen::new(when), + operations::InstanceMulticastGroupListThen::new(then), + ) + }) + } + + fn instance_multicast_group_join(&self, config_fn: F) -> ::httpmock::Mock<'_> + where + F: FnOnce( + operations::InstanceMulticastGroupJoinWhen, + operations::InstanceMulticastGroupJoinThen, + ), + { + self.mock(|when, then| { + config_fn( + operations::InstanceMulticastGroupJoinWhen::new(when), + operations::InstanceMulticastGroupJoinThen::new(then), + ) + }) + } + + fn instance_multicast_group_leave(&self, config_fn: F) -> ::httpmock::Mock<'_> + where + F: FnOnce( + operations::InstanceMulticastGroupLeaveWhen, + operations::InstanceMulticastGroupLeaveThen, + ), + { + self.mock(|when, then| { + config_fn( + operations::InstanceMulticastGroupLeaveWhen::new(when), + operations::InstanceMulticastGroupLeaveThen::new(then), + ) + }) + } + fn instance_reboot(&self, config_fn: F) -> ::httpmock::Mock<'_> where F: FnOnce(operations::InstanceRebootWhen, operations::InstanceRebootThen), @@ -24903,6 +25935,108 @@ impl MockServerExt for ::httpmock::MockServer { }) } + fn multicast_group_list(&self, config_fn: F) -> ::httpmock::Mock<'_> + where + F: FnOnce(operations::MulticastGroupListWhen, operations::MulticastGroupListThen), + { + self.mock(|when, then| { + config_fn( + operations::MulticastGroupListWhen::new(when), + operations::MulticastGroupListThen::new(then), + ) + }) + } + + fn multicast_group_create(&self, config_fn: F) -> ::httpmock::Mock<'_> + where + F: FnOnce(operations::MulticastGroupCreateWhen, operations::MulticastGroupCreateThen), + { + self.mock(|when, then| { + config_fn( + operations::MulticastGroupCreateWhen::new(when), + operations::MulticastGroupCreateThen::new(then), + ) + }) + } + + fn multicast_group_view(&self, config_fn: F) -> ::httpmock::Mock<'_> + where + F: FnOnce(operations::MulticastGroupViewWhen, operations::MulticastGroupViewThen), + { + self.mock(|when, then| { + config_fn( + operations::MulticastGroupViewWhen::new(when), + operations::MulticastGroupViewThen::new(then), + ) + }) + } + + fn multicast_group_update(&self, config_fn: F) -> ::httpmock::Mock<'_> + where + F: FnOnce(operations::MulticastGroupUpdateWhen, operations::MulticastGroupUpdateThen), + { + self.mock(|when, then| { + config_fn( + operations::MulticastGroupUpdateWhen::new(when), + operations::MulticastGroupUpdateThen::new(then), + ) + }) + } + + fn multicast_group_delete(&self, config_fn: F) -> ::httpmock::Mock<'_> + where + F: FnOnce(operations::MulticastGroupDeleteWhen, operations::MulticastGroupDeleteThen), + { + self.mock(|when, then| { + config_fn( + operations::MulticastGroupDeleteWhen::new(when), + operations::MulticastGroupDeleteThen::new(then), + ) + }) + } + + fn multicast_group_member_list(&self, config_fn: F) -> ::httpmock::Mock<'_> + where + F: FnOnce( + operations::MulticastGroupMemberListWhen, + operations::MulticastGroupMemberListThen, + ), + { + self.mock(|when, then| { + config_fn( + operations::MulticastGroupMemberListWhen::new(when), + operations::MulticastGroupMemberListThen::new(then), + ) + }) + } + + fn multicast_group_member_add(&self, config_fn: F) -> ::httpmock::Mock<'_> + where + F: FnOnce(operations::MulticastGroupMemberAddWhen, operations::MulticastGroupMemberAddThen), + { + self.mock(|when, then| { + config_fn( + operations::MulticastGroupMemberAddWhen::new(when), + operations::MulticastGroupMemberAddThen::new(then), + ) + }) + } + + fn multicast_group_member_remove(&self, config_fn: F) -> ::httpmock::Mock<'_> + where + F: FnOnce( + operations::MulticastGroupMemberRemoveWhen, + operations::MulticastGroupMemberRemoveThen, + ), + { + self.mock(|when, then| { + config_fn( + operations::MulticastGroupMemberRemoveWhen::new(when), + operations::MulticastGroupMemberRemoveThen::new(then), + ) + }) + } + fn instance_network_interface_list(&self, config_fn: F) -> ::httpmock::Mock<'_> where F: FnOnce( @@ -25719,6 +26853,21 @@ impl MockServerExt for ::httpmock::MockServer { }) } + fn lookup_multicast_group_by_ip(&self, config_fn: F) -> ::httpmock::Mock<'_> + where + F: FnOnce( + operations::LookupMulticastGroupByIpWhen, + operations::LookupMulticastGroupByIpThen, + ), + { + self.mock(|when, then| { + config_fn( + operations::LookupMulticastGroupByIpWhen::new(when), + operations::LookupMulticastGroupByIpThen::new(then), + ) + }) + } + fn networking_address_lot_list(&self, config_fn: F) -> ::httpmock::Mock<'_> where F: FnOnce( diff --git a/sdk/src/generated_sdk.rs b/sdk/src/generated_sdk.rs index d6015bf5..23c6aff3 100644 --- a/sdk/src/generated_sdk.rs +++ b/sdk/src/generated_sdk.rs @@ -15170,6 +15170,17 @@ pub mod types { /// } /// ] /// }, + /// "multicast_groups": { + /// "description": "The multicast groups this instance should + /// join.\n\nThe instance will be automatically added as a member of the + /// specified multicast groups during creation, enabling it to send and + /// receive multicast traffic for those groups.", + /// "default": [], + /// "type": "array", + /// "items": { + /// "$ref": "#/components/schemas/NameOrId" + /// } + /// }, /// "name": { /// "$ref": "#/components/schemas/Name" /// }, @@ -15299,6 +15310,13 @@ pub mod types { pub hostname: Hostname, /// The amount of RAM (in bytes) to be allocated to the instance pub memory: ByteCount, + /// The multicast groups this instance should join. + /// + /// The instance will be automatically added as a member of the + /// specified multicast groups during creation, enabling it to send and + /// receive multicast traffic for those groups. + #[serde(default, skip_serializing_if = "::std::vec::Vec::is_empty")] + pub multicast_groups: ::std::vec::Vec, pub name: Name, /// The number of vCPUs to be allocated to the instance pub ncpus: InstanceCpuCount, @@ -16364,6 +16382,21 @@ pub mod types { /// } /// ] /// }, + /// "multicast_groups": { + /// "description": "Multicast groups this instance should join.\n\nWhen + /// specified, this replaces the instance's current multicast group + /// membership with the new set of groups. The instance will leave any + /// groups not listed here and join any new groups that are specified.\n\nIf + /// not provided (None), the instance's multicast group membership will not + /// be changed.", + /// "type": [ + /// "array", + /// "null" + /// ], + /// "items": { + /// "$ref": "#/components/schemas/NameOrId" + /// } + /// }, /// "ncpus": { /// "description": "The number of vCPUs to be allocated to the /// instance", @@ -16417,6 +16450,16 @@ pub mod types { pub cpu_platform: ::std::option::Option, /// The amount of RAM (in bytes) to be allocated to the instance pub memory: ByteCount, + /// Multicast groups this instance should join. + /// + /// When specified, this replaces the instance's current multicast group + /// membership with the new set of groups. The instance will leave any + /// groups not listed here and join any new groups that are specified. + /// + /// If not provided (None), the instance's multicast group membership + /// will not be changed. + #[serde(default, skip_serializing_if = "::std::option::Option::is_none")] + pub multicast_groups: ::std::option::Option<::std::vec::Vec>, /// The number of vCPUs to be allocated to the instance pub ncpus: InstanceCpuCount, } @@ -19504,8 +19547,8 @@ pub mod types { /// "minimum": 0.0 /// }, /// "rack_id": { - /// "description": "The containing the switch this loopback address - /// will be configured on.", + /// "description": "The rack containing the switch this loopback + /// address will be configured on.", /// "type": "string", /// "format": "uuid" /// }, @@ -19536,8 +19579,8 @@ pub mod types { pub anycast: bool, /// The subnet mask to use for the address. pub mask: u8, - /// The containing the switch this loopback address will be configured - /// on. + /// The rack containing the switch this loopback address will be + /// configured on. pub rack_id: ::uuid::Uuid, /// The location of the switch within the rack this loopback address /// will be configured on. @@ -20035,6 +20078,602 @@ pub mod types { } } + /// View of a Multicast Group + /// + ///
JSON schema + /// + /// ```json + /// { + /// "description": "View of a Multicast Group", + /// "type": "object", + /// "required": [ + /// "description", + /// "id", + /// "ip_pool_id", + /// "multicast_ip", + /// "name", + /// "source_ips", + /// "state", + /// "time_created", + /// "time_modified" + /// ], + /// "properties": { + /// "description": { + /// "description": "human-readable free-form text about a resource", + /// "type": "string" + /// }, + /// "id": { + /// "description": "unique, immutable, system-controlled identifier for + /// each resource", + /// "type": "string", + /// "format": "uuid" + /// }, + /// "ip_pool_id": { + /// "description": "The ID of the IP pool this resource belongs to.", + /// "type": "string", + /// "format": "uuid" + /// }, + /// "multicast_ip": { + /// "description": "The multicast IP address held by this resource.", + /// "type": "string", + /// "format": "ip" + /// }, + /// "mvlan": { + /// "description": "Multicast VLAN (MVLAN) for egress multicast traffic + /// to upstream networks. None means no VLAN tagging on egress.", + /// "type": [ + /// "integer", + /// "null" + /// ], + /// "format": "uint16", + /// "minimum": 0.0 + /// }, + /// "name": { + /// "description": "unique, mutable, user-controlled identifier for + /// each resource", + /// "allOf": [ + /// { + /// "$ref": "#/components/schemas/Name" + /// } + /// ] + /// }, + /// "source_ips": { + /// "description": "Source IP addresses for Source-Specific Multicast + /// (SSM). Empty array means any source is allowed.", + /// "type": "array", + /// "items": { + /// "type": "string", + /// "format": "ip" + /// } + /// }, + /// "state": { + /// "description": "Current state of the multicast group.", + /// "type": "string" + /// }, + /// "time_created": { + /// "description": "timestamp when this resource was created", + /// "type": "string", + /// "format": "date-time" + /// }, + /// "time_modified": { + /// "description": "timestamp when this resource was last modified", + /// "type": "string", + /// "format": "date-time" + /// } + /// } + /// } + /// ``` + ///
+ #[derive( + :: serde :: Deserialize, :: serde :: Serialize, Clone, Debug, schemars :: JsonSchema, + )] + pub struct MulticastGroup { + /// human-readable free-form text about a resource + pub description: ::std::string::String, + /// unique, immutable, system-controlled identifier for each resource + pub id: ::uuid::Uuid, + /// The ID of the IP pool this resource belongs to. + pub ip_pool_id: ::uuid::Uuid, + /// The multicast IP address held by this resource. + pub multicast_ip: ::std::net::IpAddr, + /// Multicast VLAN (MVLAN) for egress multicast traffic to upstream + /// networks. None means no VLAN tagging on egress. + #[serde(default, skip_serializing_if = "::std::option::Option::is_none")] + pub mvlan: ::std::option::Option, + /// unique, mutable, user-controlled identifier for each resource + pub name: Name, + /// Source IP addresses for Source-Specific Multicast (SSM). Empty array + /// means any source is allowed. + pub source_ips: ::std::vec::Vec<::std::net::IpAddr>, + /// Current state of the multicast group. + pub state: ::std::string::String, + /// timestamp when this resource was created + pub time_created: ::chrono::DateTime<::chrono::offset::Utc>, + /// timestamp when this resource was last modified + pub time_modified: ::chrono::DateTime<::chrono::offset::Utc>, + } + + impl ::std::convert::From<&MulticastGroup> for MulticastGroup { + fn from(value: &MulticastGroup) -> Self { + value.clone() + } + } + + impl MulticastGroup { + pub fn builder() -> builder::MulticastGroup { + Default::default() + } + } + + /// Create-time parameters for a multicast group. + /// + ///
JSON schema + /// + /// ```json + /// { + /// "description": "Create-time parameters for a multicast group.", + /// "type": "object", + /// "required": [ + /// "description", + /// "name" + /// ], + /// "properties": { + /// "description": { + /// "type": "string" + /// }, + /// "multicast_ip": { + /// "description": "The multicast IP address to allocate. If None, one + /// will be allocated from the default pool.", + /// "type": [ + /// "string", + /// "null" + /// ], + /// "format": "ip" + /// }, + /// "mvlan": { + /// "description": "Multicast VLAN (MVLAN) for egress multicast traffic + /// to upstream networks. Tags packets leaving the rack to traverse + /// VLAN-segmented upstream networks.\n\nValid range: 2-4094 (VLAN IDs 0-1 + /// are reserved by IEEE 802.1Q standard).", + /// "type": [ + /// "integer", + /// "null" + /// ], + /// "format": "uint16", + /// "minimum": 0.0 + /// }, + /// "name": { + /// "$ref": "#/components/schemas/Name" + /// }, + /// "pool": { + /// "description": "Name or ID of the IP pool to allocate from. If + /// None, uses the default multicast pool.", + /// "oneOf": [ + /// { + /// "type": "null" + /// }, + /// { + /// "allOf": [ + /// { + /// "$ref": "#/components/schemas/NameOrId" + /// } + /// ] + /// } + /// ] + /// }, + /// "source_ips": { + /// "description": "Source IP addresses for Source-Specific Multicast + /// (SSM).\n\nNone uses default behavior (Any-Source Multicast). Empty list + /// explicitly allows any source (Any-Source Multicast). Non-empty list + /// restricts to specific sources (SSM).", + /// "type": [ + /// "array", + /// "null" + /// ], + /// "items": { + /// "type": "string", + /// "format": "ip" + /// } + /// } + /// } + /// } + /// ``` + ///
+ #[derive( + :: serde :: Deserialize, :: serde :: Serialize, Clone, Debug, schemars :: JsonSchema, + )] + pub struct MulticastGroupCreate { + pub description: ::std::string::String, + /// The multicast IP address to allocate. If None, one will be allocated + /// from the default pool. + #[serde(default, skip_serializing_if = "::std::option::Option::is_none")] + pub multicast_ip: ::std::option::Option<::std::net::IpAddr>, + /// Multicast VLAN (MVLAN) for egress multicast traffic to upstream + /// networks. Tags packets leaving the rack to traverse VLAN-segmented + /// upstream networks. + /// + /// Valid range: 2-4094 (VLAN IDs 0-1 are reserved by IEEE 802.1Q + /// standard). + #[serde(default, skip_serializing_if = "::std::option::Option::is_none")] + pub mvlan: ::std::option::Option, + pub name: Name, + /// Name or ID of the IP pool to allocate from. If None, uses the + /// default multicast pool. + #[serde(default, skip_serializing_if = "::std::option::Option::is_none")] + pub pool: ::std::option::Option, + /// Source IP addresses for Source-Specific Multicast (SSM). + /// + /// None uses default behavior (Any-Source Multicast). Empty list + /// explicitly allows any source (Any-Source Multicast). Non-empty list + /// restricts to specific sources (SSM). + #[serde(default, skip_serializing_if = "::std::option::Option::is_none")] + pub source_ips: ::std::option::Option<::std::vec::Vec<::std::net::IpAddr>>, + } + + impl ::std::convert::From<&MulticastGroupCreate> for MulticastGroupCreate { + fn from(value: &MulticastGroupCreate) -> Self { + value.clone() + } + } + + impl MulticastGroupCreate { + pub fn builder() -> builder::MulticastGroupCreate { + Default::default() + } + } + + /// View of a Multicast Group Member (instance belonging to a multicast + /// group) + /// + ///
JSON schema + /// + /// ```json + /// { + /// "description": "View of a Multicast Group Member (instance belonging to + /// a multicast group)", + /// "type": "object", + /// "required": [ + /// "description", + /// "id", + /// "instance_id", + /// "multicast_group_id", + /// "name", + /// "state", + /// "time_created", + /// "time_modified" + /// ], + /// "properties": { + /// "description": { + /// "description": "human-readable free-form text about a resource", + /// "type": "string" + /// }, + /// "id": { + /// "description": "unique, immutable, system-controlled identifier for + /// each resource", + /// "type": "string", + /// "format": "uuid" + /// }, + /// "instance_id": { + /// "description": "The ID of the instance that is a member of this + /// group.", + /// "type": "string", + /// "format": "uuid" + /// }, + /// "multicast_group_id": { + /// "description": "The ID of the multicast group this member belongs + /// to.", + /// "type": "string", + /// "format": "uuid" + /// }, + /// "name": { + /// "description": "unique, mutable, user-controlled identifier for + /// each resource", + /// "allOf": [ + /// { + /// "$ref": "#/components/schemas/Name" + /// } + /// ] + /// }, + /// "state": { + /// "description": "Current state of the multicast group membership.", + /// "type": "string" + /// }, + /// "time_created": { + /// "description": "timestamp when this resource was created", + /// "type": "string", + /// "format": "date-time" + /// }, + /// "time_modified": { + /// "description": "timestamp when this resource was last modified", + /// "type": "string", + /// "format": "date-time" + /// } + /// } + /// } + /// ``` + ///
+ #[derive( + :: serde :: Deserialize, :: serde :: Serialize, Clone, Debug, schemars :: JsonSchema, + )] + pub struct MulticastGroupMember { + /// human-readable free-form text about a resource + pub description: ::std::string::String, + /// unique, immutable, system-controlled identifier for each resource + pub id: ::uuid::Uuid, + /// The ID of the instance that is a member of this group. + pub instance_id: ::uuid::Uuid, + /// The ID of the multicast group this member belongs to. + pub multicast_group_id: ::uuid::Uuid, + /// unique, mutable, user-controlled identifier for each resource + pub name: Name, + /// Current state of the multicast group membership. + pub state: ::std::string::String, + /// timestamp when this resource was created + pub time_created: ::chrono::DateTime<::chrono::offset::Utc>, + /// timestamp when this resource was last modified + pub time_modified: ::chrono::DateTime<::chrono::offset::Utc>, + } + + impl ::std::convert::From<&MulticastGroupMember> for MulticastGroupMember { + fn from(value: &MulticastGroupMember) -> Self { + value.clone() + } + } + + impl MulticastGroupMember { + pub fn builder() -> builder::MulticastGroupMember { + Default::default() + } + } + + /// Parameters for adding an instance to a multicast group. + /// + ///
JSON schema + /// + /// ```json + /// { + /// "description": "Parameters for adding an instance to a multicast + /// group.", + /// "type": "object", + /// "required": [ + /// "instance" + /// ], + /// "properties": { + /// "instance": { + /// "description": "Name or ID of the instance to add to the multicast + /// group", + /// "allOf": [ + /// { + /// "$ref": "#/components/schemas/NameOrId" + /// } + /// ] + /// } + /// } + /// } + /// ``` + ///
+ #[derive( + :: serde :: Deserialize, :: serde :: Serialize, Clone, Debug, schemars :: JsonSchema, + )] + pub struct MulticastGroupMemberAdd { + /// Name or ID of the instance to add to the multicast group + pub instance: NameOrId, + } + + impl ::std::convert::From<&MulticastGroupMemberAdd> for MulticastGroupMemberAdd { + fn from(value: &MulticastGroupMemberAdd) -> Self { + value.clone() + } + } + + impl MulticastGroupMemberAdd { + pub fn builder() -> builder::MulticastGroupMemberAdd { + 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/MulticastGroupMember" + /// } + /// }, + /// "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 MulticastGroupMemberResultsPage { + /// 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 ::std::convert::From<&MulticastGroupMemberResultsPage> for MulticastGroupMemberResultsPage { + fn from(value: &MulticastGroupMemberResultsPage) -> Self { + value.clone() + } + } + + impl MulticastGroupMemberResultsPage { + pub fn builder() -> builder::MulticastGroupMemberResultsPage { + 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/MulticastGroup" + /// } + /// }, + /// "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 MulticastGroupResultsPage { + /// 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 ::std::convert::From<&MulticastGroupResultsPage> for MulticastGroupResultsPage { + fn from(value: &MulticastGroupResultsPage) -> Self { + value.clone() + } + } + + impl MulticastGroupResultsPage { + pub fn builder() -> builder::MulticastGroupResultsPage { + Default::default() + } + } + + /// Update-time parameters for a multicast group. + /// + ///
JSON schema + /// + /// ```json + /// { + /// "description": "Update-time parameters for a multicast group.", + /// "type": "object", + /// "properties": { + /// "description": { + /// "type": [ + /// "string", + /// "null" + /// ] + /// }, + /// "mvlan": { + /// "description": "Multicast VLAN (MVLAN) for egress multicast traffic + /// to upstream networks. Set to null to clear the MVLAN. Valid range: + /// 2-4094 when provided. Omit the field to leave mvlan unchanged.", + /// "type": [ + /// "integer", + /// "null" + /// ], + /// "format": "uint16", + /// "minimum": 0.0 + /// }, + /// "name": { + /// "oneOf": [ + /// { + /// "type": "null" + /// }, + /// { + /// "allOf": [ + /// { + /// "$ref": "#/components/schemas/Name" + /// } + /// ] + /// } + /// ] + /// }, + /// "source_ips": { + /// "type": [ + /// "array", + /// "null" + /// ], + /// "items": { + /// "type": "string", + /// "format": "ip" + /// } + /// } + /// } + /// } + /// ``` + ///
+ #[derive( + :: serde :: Deserialize, :: serde :: Serialize, Clone, Debug, schemars :: JsonSchema, + )] + pub struct MulticastGroupUpdate { + #[serde(default, skip_serializing_if = "::std::option::Option::is_none")] + pub description: ::std::option::Option<::std::string::String>, + /// Multicast VLAN (MVLAN) for egress multicast traffic to upstream + /// networks. Set to null to clear the MVLAN. Valid range: 2-4094 when + /// provided. Omit the field to leave mvlan unchanged. + #[serde(default, skip_serializing_if = "::std::option::Option::is_none")] + pub mvlan: ::std::option::Option, + #[serde(default, skip_serializing_if = "::std::option::Option::is_none")] + pub name: ::std::option::Option, + #[serde(default, skip_serializing_if = "::std::option::Option::is_none")] + pub source_ips: ::std::option::Option<::std::vec::Vec<::std::net::IpAddr>>, + } + + impl ::std::convert::From<&MulticastGroupUpdate> for MulticastGroupUpdate { + fn from(value: &MulticastGroupUpdate) -> Self { + value.clone() + } + } + + impl ::std::default::Default for MulticastGroupUpdate { + fn default() -> Self { + Self { + description: Default::default(), + mvlan: Default::default(), + name: Default::default(), + source_ips: Default::default(), + } + } + } + + impl MulticastGroupUpdate { + pub fn builder() -> builder::MulticastGroupUpdate { + Default::default() + } + } + /// Names must begin with a lower case ASCII letter, be composed exclusively /// of lowercase ASCII, uppercase ASCII, numbers, and '-', and may not end /// with a '-'. Names cannot be a UUID, but they may contain a UUID. They @@ -45878,6 +46517,8 @@ pub mod types { >, hostname: ::std::result::Result, memory: ::std::result::Result, + multicast_groups: + ::std::result::Result<::std::vec::Vec, ::std::string::String>, name: ::std::result::Result, ncpus: ::std::result::Result, network_interfaces: ::std::result::Result< @@ -45904,6 +46545,7 @@ pub mod types { external_ips: Ok(Default::default()), hostname: Err("no value supplied for hostname".to_string()), memory: Err("no value supplied for memory".to_string()), + multicast_groups: Ok(Default::default()), name: Err("no value supplied for name".to_string()), ncpus: Err("no value supplied for ncpus".to_string()), network_interfaces: Ok(super::defaults::instance_create_network_interfaces()), @@ -46011,6 +46653,19 @@ pub mod types { .map_err(|e| format!("error converting supplied value for memory: {}", e)); self } + pub fn multicast_groups(mut self, value: T) -> Self + where + T: ::std::convert::TryInto<::std::vec::Vec>, + T::Error: ::std::fmt::Display, + { + self.multicast_groups = value.try_into().map_err(|e| { + format!( + "error converting supplied value for multicast_groups: {}", + e + ) + }); + self + } pub fn name(mut self, value: T) -> Self where T: ::std::convert::TryInto, @@ -46091,6 +46746,7 @@ pub mod types { external_ips: value.external_ips?, hostname: value.hostname?, memory: value.memory?, + multicast_groups: value.multicast_groups?, name: value.name?, ncpus: value.ncpus?, network_interfaces: value.network_interfaces?, @@ -46113,6 +46769,7 @@ pub mod types { external_ips: Ok(value.external_ips), hostname: Ok(value.hostname), memory: Ok(value.memory), + multicast_groups: Ok(value.multicast_groups), name: Ok(value.name), ncpus: Ok(value.ncpus), network_interfaces: Ok(value.network_interfaces), @@ -46755,6 +47412,10 @@ pub mod types { ::std::string::String, >, memory: ::std::result::Result, + multicast_groups: ::std::result::Result< + ::std::option::Option<::std::vec::Vec>, + ::std::string::String, + >, ncpus: ::std::result::Result, } @@ -46767,6 +47428,7 @@ pub mod types { boot_disk: Err("no value supplied for boot_disk".to_string()), cpu_platform: Err("no value supplied for cpu_platform".to_string()), memory: Err("no value supplied for memory".to_string()), + multicast_groups: Ok(Default::default()), ncpus: Err("no value supplied for ncpus".to_string()), } } @@ -46816,6 +47478,19 @@ pub mod types { .map_err(|e| format!("error converting supplied value for memory: {}", e)); self } + pub fn multicast_groups(mut self, value: T) -> Self + where + T: ::std::convert::TryInto<::std::option::Option<::std::vec::Vec>>, + T::Error: ::std::fmt::Display, + { + self.multicast_groups = value.try_into().map_err(|e| { + format!( + "error converting supplied value for multicast_groups: {}", + e + ) + }); + self + } pub fn ncpus(mut self, value: T) -> Self where T: ::std::convert::TryInto, @@ -46838,6 +47513,7 @@ pub mod types { boot_disk: value.boot_disk?, cpu_platform: value.cpu_platform?, memory: value.memory?, + multicast_groups: value.multicast_groups?, ncpus: value.ncpus?, }) } @@ -46850,6 +47526,7 @@ pub mod types { boot_disk: Ok(value.boot_disk), cpu_platform: Ok(value.cpu_platform), memory: Ok(value.memory), + multicast_groups: Ok(value.multicast_groups), ncpus: Ok(value.ncpus), } } @@ -49835,38 +50512,54 @@ pub mod types { } #[derive(Clone, Debug)] - pub struct NetworkInterface { + pub struct MulticastGroup { + description: ::std::result::Result<::std::string::String, ::std::string::String>, id: ::std::result::Result<::uuid::Uuid, ::std::string::String>, - ip: ::std::result::Result<::std::net::IpAddr, ::std::string::String>, - kind: ::std::result::Result, - mac: ::std::result::Result, + ip_pool_id: ::std::result::Result<::uuid::Uuid, ::std::string::String>, + multicast_ip: ::std::result::Result<::std::net::IpAddr, ::std::string::String>, + mvlan: ::std::result::Result<::std::option::Option, ::std::string::String>, name: ::std::result::Result, - primary: ::std::result::Result, - slot: ::std::result::Result, - subnet: ::std::result::Result, - transit_ips: - ::std::result::Result<::std::vec::Vec, ::std::string::String>, - vni: ::std::result::Result, + source_ips: + ::std::result::Result<::std::vec::Vec<::std::net::IpAddr>, ::std::string::String>, + state: ::std::result::Result<::std::string::String, ::std::string::String>, + time_created: ::std::result::Result< + ::chrono::DateTime<::chrono::offset::Utc>, + ::std::string::String, + >, + time_modified: ::std::result::Result< + ::chrono::DateTime<::chrono::offset::Utc>, + ::std::string::String, + >, } - impl ::std::default::Default for NetworkInterface { + impl ::std::default::Default for MulticastGroup { fn default() -> Self { Self { + description: Err("no value supplied for description".to_string()), id: Err("no value supplied for id".to_string()), - ip: Err("no value supplied for ip".to_string()), - kind: Err("no value supplied for kind".to_string()), - mac: Err("no value supplied for mac".to_string()), + ip_pool_id: Err("no value supplied for ip_pool_id".to_string()), + multicast_ip: Err("no value supplied for multicast_ip".to_string()), + mvlan: Ok(Default::default()), name: Err("no value supplied for name".to_string()), - primary: Err("no value supplied for primary".to_string()), - slot: Err("no value supplied for slot".to_string()), - subnet: Err("no value supplied for subnet".to_string()), - transit_ips: Ok(Default::default()), - vni: Err("no value supplied for vni".to_string()), + source_ips: Err("no value supplied for source_ips".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()), } } } - impl NetworkInterface { + impl MulticastGroup { + pub fn description(mut self, value: T) -> Self + where + T: ::std::convert::TryInto<::std::string::String>, + T::Error: ::std::fmt::Display, + { + self.description = value + .try_into() + .map_err(|e| format!("error converting supplied value for description: {}", e)); + self + } pub fn id(mut self, value: T) -> Self where T: ::std::convert::TryInto<::uuid::Uuid>, @@ -49877,34 +50570,34 @@ pub mod types { .map_err(|e| format!("error converting supplied value for id: {}", e)); self } - pub fn ip(mut self, value: T) -> Self + pub fn ip_pool_id(mut self, value: T) -> Self where - T: ::std::convert::TryInto<::std::net::IpAddr>, + T: ::std::convert::TryInto<::uuid::Uuid>, T::Error: ::std::fmt::Display, { - self.ip = value + self.ip_pool_id = value .try_into() - .map_err(|e| format!("error converting supplied value for ip: {}", e)); + .map_err(|e| format!("error converting supplied value for ip_pool_id: {}", e)); self } - pub fn kind(mut self, value: T) -> Self + pub fn multicast_ip(mut self, value: T) -> Self where - T: ::std::convert::TryInto, + T: ::std::convert::TryInto<::std::net::IpAddr>, T::Error: ::std::fmt::Display, { - self.kind = value - .try_into() - .map_err(|e| format!("error converting supplied value for kind: {}", e)); + self.multicast_ip = value.try_into().map_err(|e| { + format!("error converting supplied value for multicast_ip: {}", e) + }); self } - pub fn mac(mut self, value: T) -> Self + pub fn mvlan(mut self, value: T) -> Self where - T: ::std::convert::TryInto, + T: ::std::convert::TryInto<::std::option::Option>, T::Error: ::std::fmt::Display, { - self.mac = value + self.mvlan = value .try_into() - .map_err(|e| format!("error converting supplied value for mac: {}", e)); + .map_err(|e| format!("error converting supplied value for mvlan: {}", e)); self } pub fn name(mut self, value: T) -> Self @@ -49917,160 +50610,151 @@ pub mod types { .map_err(|e| format!("error converting supplied value for name: {}", e)); self } - pub fn primary(mut self, value: T) -> Self + pub fn source_ips(mut self, value: T) -> Self where - T: ::std::convert::TryInto, + T: ::std::convert::TryInto<::std::vec::Vec<::std::net::IpAddr>>, T::Error: ::std::fmt::Display, { - self.primary = value + self.source_ips = value .try_into() - .map_err(|e| format!("error converting supplied value for primary: {}", e)); + .map_err(|e| format!("error converting supplied value for source_ips: {}", e)); self } - pub fn slot(mut self, value: T) -> Self - where - T: ::std::convert::TryInto, - T::Error: ::std::fmt::Display, - { - self.slot = value - .try_into() - .map_err(|e| format!("error converting supplied value for slot: {}", e)); - self - } - pub fn subnet(mut self, value: T) -> Self + pub fn state(mut self, value: T) -> Self where - T: ::std::convert::TryInto, + T: ::std::convert::TryInto<::std::string::String>, T::Error: ::std::fmt::Display, { - self.subnet = value + self.state = value .try_into() - .map_err(|e| format!("error converting supplied value for subnet: {}", e)); + .map_err(|e| format!("error converting supplied value for state: {}", e)); self } - pub fn transit_ips(mut self, value: T) -> Self + pub fn time_created(mut self, value: T) -> Self where - T: ::std::convert::TryInto<::std::vec::Vec>, + T: ::std::convert::TryInto<::chrono::DateTime<::chrono::offset::Utc>>, T::Error: ::std::fmt::Display, { - self.transit_ips = value - .try_into() - .map_err(|e| format!("error converting supplied value for transit_ips: {}", e)); + self.time_created = value.try_into().map_err(|e| { + format!("error converting supplied value for time_created: {}", e) + }); self } - pub fn vni(mut self, value: T) -> Self + pub fn time_modified(mut self, value: T) -> Self where - T: ::std::convert::TryInto, + T: ::std::convert::TryInto<::chrono::DateTime<::chrono::offset::Utc>>, T::Error: ::std::fmt::Display, { - self.vni = value - .try_into() - .map_err(|e| format!("error converting supplied value for vni: {}", e)); + self.time_modified = value.try_into().map_err(|e| { + format!("error converting supplied value for time_modified: {}", e) + }); self } } - impl ::std::convert::TryFrom for super::NetworkInterface { + impl ::std::convert::TryFrom for super::MulticastGroup { type Error = super::error::ConversionError; fn try_from( - value: NetworkInterface, + value: MulticastGroup, ) -> ::std::result::Result { Ok(Self { + description: value.description?, id: value.id?, - ip: value.ip?, - kind: value.kind?, - mac: value.mac?, + ip_pool_id: value.ip_pool_id?, + multicast_ip: value.multicast_ip?, + mvlan: value.mvlan?, name: value.name?, - primary: value.primary?, - slot: value.slot?, - subnet: value.subnet?, - transit_ips: value.transit_ips?, - vni: value.vni?, + source_ips: value.source_ips?, + state: value.state?, + time_created: value.time_created?, + time_modified: value.time_modified?, }) } } - impl ::std::convert::From for NetworkInterface { - fn from(value: super::NetworkInterface) -> Self { + impl ::std::convert::From for MulticastGroup { + fn from(value: super::MulticastGroup) -> Self { Self { + description: Ok(value.description), id: Ok(value.id), - ip: Ok(value.ip), - kind: Ok(value.kind), - mac: Ok(value.mac), + ip_pool_id: Ok(value.ip_pool_id), + multicast_ip: Ok(value.multicast_ip), + mvlan: Ok(value.mvlan), name: Ok(value.name), - primary: Ok(value.primary), - slot: Ok(value.slot), - subnet: Ok(value.subnet), - transit_ips: Ok(value.transit_ips), - vni: Ok(value.vni), + source_ips: Ok(value.source_ips), + state: Ok(value.state), + time_created: Ok(value.time_created), + time_modified: Ok(value.time_modified), } } } #[derive(Clone, Debug)] - pub struct OxqlQueryResult { - tables: ::std::result::Result<::std::vec::Vec, ::std::string::String>, + pub struct MulticastGroupCreate { + description: ::std::result::Result<::std::string::String, ::std::string::String>, + multicast_ip: ::std::result::Result< + ::std::option::Option<::std::net::IpAddr>, + ::std::string::String, + >, + mvlan: ::std::result::Result<::std::option::Option, ::std::string::String>, + name: ::std::result::Result, + pool: ::std::result::Result< + ::std::option::Option, + ::std::string::String, + >, + source_ips: ::std::result::Result< + ::std::option::Option<::std::vec::Vec<::std::net::IpAddr>>, + ::std::string::String, + >, } - impl ::std::default::Default for OxqlQueryResult { + impl ::std::default::Default for MulticastGroupCreate { fn default() -> Self { Self { - tables: Err("no value supplied for tables".to_string()), + description: Err("no value supplied for description".to_string()), + multicast_ip: Ok(Default::default()), + mvlan: Ok(Default::default()), + name: Err("no value supplied for name".to_string()), + pool: Ok(Default::default()), + source_ips: Ok(Default::default()), } } } - impl OxqlQueryResult { - pub fn tables(mut self, value: T) -> Self + impl MulticastGroupCreate { + pub fn description(mut self, value: T) -> Self where - T: ::std::convert::TryInto<::std::vec::Vec>, + T: ::std::convert::TryInto<::std::string::String>, T::Error: ::std::fmt::Display, { - self.tables = value + self.description = value .try_into() - .map_err(|e| format!("error converting supplied value for tables: {}", e)); + .map_err(|e| format!("error converting supplied value for description: {}", e)); self } - } - - impl ::std::convert::TryFrom for super::OxqlQueryResult { - type Error = super::error::ConversionError; - fn try_from( - value: OxqlQueryResult, - ) -> ::std::result::Result { - Ok(Self { - tables: value.tables?, - }) - } - } - - impl ::std::convert::From for OxqlQueryResult { - fn from(value: super::OxqlQueryResult) -> Self { - Self { - tables: Ok(value.tables), - } + pub fn multicast_ip(mut self, value: T) -> Self + where + T: ::std::convert::TryInto<::std::option::Option<::std::net::IpAddr>>, + T::Error: ::std::fmt::Display, + { + self.multicast_ip = value.try_into().map_err(|e| { + format!("error converting supplied value for multicast_ip: {}", e) + }); + self } - } - - #[derive(Clone, Debug)] - pub struct OxqlTable { - name: ::std::result::Result<::std::string::String, ::std::string::String>, - timeseries: - ::std::result::Result<::std::vec::Vec, ::std::string::String>, - } - - impl ::std::default::Default for OxqlTable { - fn default() -> Self { - Self { - name: Err("no value supplied for name".to_string()), - timeseries: Err("no value supplied for timeseries".to_string()), - } + pub fn mvlan(mut self, value: T) -> Self + where + T: ::std::convert::TryInto<::std::option::Option>, + T::Error: ::std::fmt::Display, + { + self.mvlan = value + .try_into() + .map_err(|e| format!("error converting supplied value for mvlan: {}", e)); + self } - } - - impl OxqlTable { pub fn name(mut self, value: T) -> Self where - T: ::std::convert::TryInto<::std::string::String>, + T: ::std::convert::TryInto, T::Error: ::std::fmt::Display, { self.name = value @@ -50078,49 +50762,67 @@ pub mod types { .map_err(|e| format!("error converting supplied value for name: {}", e)); self } - pub fn timeseries(mut self, value: T) -> Self + pub fn pool(mut self, value: T) -> Self where - T: ::std::convert::TryInto<::std::vec::Vec>, + T: ::std::convert::TryInto<::std::option::Option>, T::Error: ::std::fmt::Display, { - self.timeseries = value + self.pool = value .try_into() - .map_err(|e| format!("error converting supplied value for timeseries: {}", e)); + .map_err(|e| format!("error converting supplied value for pool: {}", e)); + self + } + pub fn source_ips(mut self, value: T) -> Self + where + T: ::std::convert::TryInto< + ::std::option::Option<::std::vec::Vec<::std::net::IpAddr>>, + >, + T::Error: ::std::fmt::Display, + { + self.source_ips = value + .try_into() + .map_err(|e| format!("error converting supplied value for source_ips: {}", e)); self } } - impl ::std::convert::TryFrom for super::OxqlTable { + impl ::std::convert::TryFrom for super::MulticastGroupCreate { type Error = super::error::ConversionError; fn try_from( - value: OxqlTable, + value: MulticastGroupCreate, ) -> ::std::result::Result { Ok(Self { + description: value.description?, + multicast_ip: value.multicast_ip?, + mvlan: value.mvlan?, name: value.name?, - timeseries: value.timeseries?, + pool: value.pool?, + source_ips: value.source_ips?, }) } } - impl ::std::convert::From for OxqlTable { - fn from(value: super::OxqlTable) -> Self { + impl ::std::convert::From for MulticastGroupCreate { + fn from(value: super::MulticastGroupCreate) -> Self { Self { + description: Ok(value.description), + multicast_ip: Ok(value.multicast_ip), + mvlan: Ok(value.mvlan), name: Ok(value.name), - timeseries: Ok(value.timeseries), + pool: Ok(value.pool), + source_ips: Ok(value.source_ips), } } } #[derive(Clone, Debug)] - pub struct PhysicalDisk { - form_factor: ::std::result::Result, + pub struct MulticastGroupMember { + description: ::std::result::Result<::std::string::String, ::std::string::String>, id: ::std::result::Result<::uuid::Uuid, ::std::string::String>, - model: ::std::result::Result<::std::string::String, ::std::string::String>, - policy: ::std::result::Result, - serial: ::std::result::Result<::std::string::String, ::std::string::String>, - sled_id: - ::std::result::Result<::std::option::Option<::uuid::Uuid>, ::std::string::String>, - state: ::std::result::Result, + instance_id: ::std::result::Result<::uuid::Uuid, ::std::string::String>, + multicast_group_id: ::std::result::Result<::uuid::Uuid, ::std::string::String>, + name: ::std::result::Result, + state: ::std::result::Result<::std::string::String, ::std::string::String>, time_created: ::std::result::Result< ::chrono::DateTime<::chrono::offset::Utc>, ::std::string::String, @@ -50129,35 +50831,32 @@ pub mod types { ::chrono::DateTime<::chrono::offset::Utc>, ::std::string::String, >, - vendor: ::std::result::Result<::std::string::String, ::std::string::String>, } - impl ::std::default::Default for PhysicalDisk { + impl ::std::default::Default for MulticastGroupMember { fn default() -> Self { Self { - form_factor: Err("no value supplied for form_factor".to_string()), + description: Err("no value supplied for description".to_string()), id: Err("no value supplied for id".to_string()), - model: Err("no value supplied for model".to_string()), - policy: Err("no value supplied for policy".to_string()), - serial: Err("no value supplied for serial".to_string()), - sled_id: Ok(Default::default()), + instance_id: Err("no value supplied for instance_id".to_string()), + multicast_group_id: Err("no value supplied for multicast_group_id".to_string()), + name: Err("no value supplied for name".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()), - vendor: Err("no value supplied for vendor".to_string()), } } } - impl PhysicalDisk { - pub fn form_factor(mut self, value: T) -> Self + impl MulticastGroupMember { + pub fn description(mut self, value: T) -> Self where - T: ::std::convert::TryInto, + T: ::std::convert::TryInto<::std::string::String>, T::Error: ::std::fmt::Display, { - self.form_factor = value + self.description = value .try_into() - .map_err(|e| format!("error converting supplied value for form_factor: {}", e)); + .map_err(|e| format!("error converting supplied value for description: {}", e)); self } pub fn id(mut self, value: T) -> Self @@ -50170,49 +50869,757 @@ pub mod types { .map_err(|e| format!("error converting supplied value for id: {}", e)); self } - pub fn model(mut self, value: T) -> Self + pub fn instance_id(mut self, value: T) -> Self where - T: ::std::convert::TryInto<::std::string::String>, + T: ::std::convert::TryInto<::uuid::Uuid>, T::Error: ::std::fmt::Display, { - self.model = value + self.instance_id = value .try_into() - .map_err(|e| format!("error converting supplied value for model: {}", e)); + .map_err(|e| format!("error converting supplied value for instance_id: {}", e)); self } - pub fn policy(mut self, value: T) -> Self + pub fn multicast_group_id(mut self, value: T) -> Self where - T: ::std::convert::TryInto, - T::Error: ::std::fmt::Display, - { - self.policy = value - .try_into() - .map_err(|e| format!("error converting supplied value for policy: {}", e)); - self - } - pub fn serial(mut self, value: T) -> Self - where - T: ::std::convert::TryInto<::std::string::String>, + T: ::std::convert::TryInto<::uuid::Uuid>, T::Error: ::std::fmt::Display, { - self.serial = value - .try_into() - .map_err(|e| format!("error converting supplied value for serial: {}", e)); + self.multicast_group_id = value.try_into().map_err(|e| { + format!( + "error converting supplied value for multicast_group_id: {}", + e + ) + }); self } - pub fn sled_id(mut self, value: T) -> Self + pub fn name(mut self, value: T) -> Self where - T: ::std::convert::TryInto<::std::option::Option<::uuid::Uuid>>, + T: ::std::convert::TryInto, T::Error: ::std::fmt::Display, { - self.sled_id = value + self.name = value .try_into() - .map_err(|e| format!("error converting supplied value for sled_id: {}", e)); + .map_err(|e| format!("error converting supplied value for name: {}", e)); self } pub fn state(mut self, value: T) -> Self where - T: ::std::convert::TryInto, + T: ::std::convert::TryInto<::std::string::String>, + 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<::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 + } + pub fn time_modified(mut self, value: T) -> Self + where + T: ::std::convert::TryInto<::chrono::DateTime<::chrono::offset::Utc>>, + T::Error: ::std::fmt::Display, + { + self.time_modified = value.try_into().map_err(|e| { + format!("error converting supplied value for time_modified: {}", e) + }); + self + } + } + + impl ::std::convert::TryFrom for super::MulticastGroupMember { + type Error = super::error::ConversionError; + fn try_from( + value: MulticastGroupMember, + ) -> ::std::result::Result { + Ok(Self { + description: value.description?, + id: value.id?, + instance_id: value.instance_id?, + multicast_group_id: value.multicast_group_id?, + name: value.name?, + state: value.state?, + time_created: value.time_created?, + time_modified: value.time_modified?, + }) + } + } + + impl ::std::convert::From for MulticastGroupMember { + fn from(value: super::MulticastGroupMember) -> Self { + Self { + description: Ok(value.description), + id: Ok(value.id), + instance_id: Ok(value.instance_id), + multicast_group_id: Ok(value.multicast_group_id), + name: Ok(value.name), + state: Ok(value.state), + time_created: Ok(value.time_created), + time_modified: Ok(value.time_modified), + } + } + } + + #[derive(Clone, Debug)] + pub struct MulticastGroupMemberAdd { + instance: ::std::result::Result, + } + + impl ::std::default::Default for MulticastGroupMemberAdd { + fn default() -> Self { + Self { + instance: Err("no value supplied for instance".to_string()), + } + } + } + + impl MulticastGroupMemberAdd { + pub fn instance(mut self, value: T) -> Self + where + T: ::std::convert::TryInto, + T::Error: ::std::fmt::Display, + { + self.instance = value + .try_into() + .map_err(|e| format!("error converting supplied value for instance: {}", e)); + self + } + } + + impl ::std::convert::TryFrom for super::MulticastGroupMemberAdd { + type Error = super::error::ConversionError; + fn try_from( + value: MulticastGroupMemberAdd, + ) -> ::std::result::Result { + Ok(Self { + instance: value.instance?, + }) + } + } + + impl ::std::convert::From for MulticastGroupMemberAdd { + fn from(value: super::MulticastGroupMemberAdd) -> Self { + Self { + instance: Ok(value.instance), + } + } + } + + #[derive(Clone, Debug)] + pub struct MulticastGroupMemberResultsPage { + 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 MulticastGroupMemberResultsPage { + fn default() -> Self { + Self { + items: Err("no value supplied for items".to_string()), + next_page: Ok(Default::default()), + } + } + } + + impl MulticastGroupMemberResultsPage { + 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::MulticastGroupMemberResultsPage + { + type Error = super::error::ConversionError; + fn try_from( + value: MulticastGroupMemberResultsPage, + ) -> ::std::result::Result { + Ok(Self { + items: value.items?, + next_page: value.next_page?, + }) + } + } + + impl ::std::convert::From + for MulticastGroupMemberResultsPage + { + fn from(value: super::MulticastGroupMemberResultsPage) -> Self { + Self { + items: Ok(value.items), + next_page: Ok(value.next_page), + } + } + } + + #[derive(Clone, Debug)] + pub struct MulticastGroupResultsPage { + 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 MulticastGroupResultsPage { + fn default() -> Self { + Self { + items: Err("no value supplied for items".to_string()), + next_page: Ok(Default::default()), + } + } + } + + impl MulticastGroupResultsPage { + 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::MulticastGroupResultsPage { + type Error = super::error::ConversionError; + fn try_from( + value: MulticastGroupResultsPage, + ) -> ::std::result::Result { + Ok(Self { + items: value.items?, + next_page: value.next_page?, + }) + } + } + + impl ::std::convert::From for MulticastGroupResultsPage { + fn from(value: super::MulticastGroupResultsPage) -> Self { + Self { + items: Ok(value.items), + next_page: Ok(value.next_page), + } + } + } + + #[derive(Clone, Debug)] + pub struct MulticastGroupUpdate { + description: ::std::result::Result< + ::std::option::Option<::std::string::String>, + ::std::string::String, + >, + mvlan: ::std::result::Result<::std::option::Option, ::std::string::String>, + name: ::std::result::Result<::std::option::Option, ::std::string::String>, + source_ips: ::std::result::Result< + ::std::option::Option<::std::vec::Vec<::std::net::IpAddr>>, + ::std::string::String, + >, + } + + impl ::std::default::Default for MulticastGroupUpdate { + fn default() -> Self { + Self { + description: Ok(Default::default()), + mvlan: Ok(Default::default()), + name: Ok(Default::default()), + source_ips: Ok(Default::default()), + } + } + } + + impl MulticastGroupUpdate { + pub fn description(mut self, value: T) -> Self + where + T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>, + T::Error: ::std::fmt::Display, + { + self.description = value + .try_into() + .map_err(|e| format!("error converting supplied value for description: {}", e)); + self + } + pub fn mvlan(mut self, value: T) -> Self + where + T: ::std::convert::TryInto<::std::option::Option>, + T::Error: ::std::fmt::Display, + { + self.mvlan = value + .try_into() + .map_err(|e| format!("error converting supplied value for mvlan: {}", e)); + self + } + pub fn name(mut self, value: T) -> Self + where + T: ::std::convert::TryInto<::std::option::Option>, + T::Error: ::std::fmt::Display, + { + self.name = value + .try_into() + .map_err(|e| format!("error converting supplied value for name: {}", e)); + self + } + pub fn source_ips(mut self, value: T) -> Self + where + T: ::std::convert::TryInto< + ::std::option::Option<::std::vec::Vec<::std::net::IpAddr>>, + >, + T::Error: ::std::fmt::Display, + { + self.source_ips = value + .try_into() + .map_err(|e| format!("error converting supplied value for source_ips: {}", e)); + self + } + } + + impl ::std::convert::TryFrom for super::MulticastGroupUpdate { + type Error = super::error::ConversionError; + fn try_from( + value: MulticastGroupUpdate, + ) -> ::std::result::Result { + Ok(Self { + description: value.description?, + mvlan: value.mvlan?, + name: value.name?, + source_ips: value.source_ips?, + }) + } + } + + impl ::std::convert::From for MulticastGroupUpdate { + fn from(value: super::MulticastGroupUpdate) -> Self { + Self { + description: Ok(value.description), + mvlan: Ok(value.mvlan), + name: Ok(value.name), + source_ips: Ok(value.source_ips), + } + } + } + + #[derive(Clone, Debug)] + pub struct NetworkInterface { + id: ::std::result::Result<::uuid::Uuid, ::std::string::String>, + ip: ::std::result::Result<::std::net::IpAddr, ::std::string::String>, + kind: ::std::result::Result, + mac: ::std::result::Result, + name: ::std::result::Result, + primary: ::std::result::Result, + slot: ::std::result::Result, + subnet: ::std::result::Result, + transit_ips: + ::std::result::Result<::std::vec::Vec, ::std::string::String>, + vni: ::std::result::Result, + } + + impl ::std::default::Default for NetworkInterface { + fn default() -> Self { + Self { + id: Err("no value supplied for id".to_string()), + ip: Err("no value supplied for ip".to_string()), + kind: Err("no value supplied for kind".to_string()), + mac: Err("no value supplied for mac".to_string()), + name: Err("no value supplied for name".to_string()), + primary: Err("no value supplied for primary".to_string()), + slot: Err("no value supplied for slot".to_string()), + subnet: Err("no value supplied for subnet".to_string()), + transit_ips: Ok(Default::default()), + vni: Err("no value supplied for vni".to_string()), + } + } + } + + impl NetworkInterface { + pub fn id(mut self, value: T) -> Self + where + T: ::std::convert::TryInto<::uuid::Uuid>, + T::Error: ::std::fmt::Display, + { + self.id = value + .try_into() + .map_err(|e| format!("error converting supplied value for id: {}", e)); + self + } + pub fn ip(mut self, value: T) -> Self + where + T: ::std::convert::TryInto<::std::net::IpAddr>, + T::Error: ::std::fmt::Display, + { + self.ip = value + .try_into() + .map_err(|e| format!("error converting supplied value for ip: {}", e)); + self + } + pub fn kind(mut self, value: T) -> Self + where + T: ::std::convert::TryInto, + T::Error: ::std::fmt::Display, + { + self.kind = value + .try_into() + .map_err(|e| format!("error converting supplied value for kind: {}", e)); + self + } + pub fn mac(mut self, value: T) -> Self + where + T: ::std::convert::TryInto, + T::Error: ::std::fmt::Display, + { + self.mac = value + .try_into() + .map_err(|e| format!("error converting supplied value for mac: {}", e)); + self + } + pub fn name(mut self, value: T) -> Self + where + T: ::std::convert::TryInto, + T::Error: ::std::fmt::Display, + { + self.name = value + .try_into() + .map_err(|e| format!("error converting supplied value for name: {}", e)); + self + } + pub fn primary(mut self, value: T) -> Self + where + T: ::std::convert::TryInto, + T::Error: ::std::fmt::Display, + { + self.primary = value + .try_into() + .map_err(|e| format!("error converting supplied value for primary: {}", e)); + self + } + pub fn slot(mut self, value: T) -> Self + where + T: ::std::convert::TryInto, + T::Error: ::std::fmt::Display, + { + self.slot = value + .try_into() + .map_err(|e| format!("error converting supplied value for slot: {}", e)); + self + } + pub fn subnet(mut self, value: T) -> Self + where + T: ::std::convert::TryInto, + T::Error: ::std::fmt::Display, + { + self.subnet = value + .try_into() + .map_err(|e| format!("error converting supplied value for subnet: {}", e)); + self + } + pub fn transit_ips(mut self, value: T) -> Self + where + T: ::std::convert::TryInto<::std::vec::Vec>, + T::Error: ::std::fmt::Display, + { + self.transit_ips = value + .try_into() + .map_err(|e| format!("error converting supplied value for transit_ips: {}", e)); + self + } + pub fn vni(mut self, value: T) -> Self + where + T: ::std::convert::TryInto, + T::Error: ::std::fmt::Display, + { + self.vni = value + .try_into() + .map_err(|e| format!("error converting supplied value for vni: {}", e)); + self + } + } + + impl ::std::convert::TryFrom for super::NetworkInterface { + type Error = super::error::ConversionError; + fn try_from( + value: NetworkInterface, + ) -> ::std::result::Result { + Ok(Self { + id: value.id?, + ip: value.ip?, + kind: value.kind?, + mac: value.mac?, + name: value.name?, + primary: value.primary?, + slot: value.slot?, + subnet: value.subnet?, + transit_ips: value.transit_ips?, + vni: value.vni?, + }) + } + } + + impl ::std::convert::From for NetworkInterface { + fn from(value: super::NetworkInterface) -> Self { + Self { + id: Ok(value.id), + ip: Ok(value.ip), + kind: Ok(value.kind), + mac: Ok(value.mac), + name: Ok(value.name), + primary: Ok(value.primary), + slot: Ok(value.slot), + subnet: Ok(value.subnet), + transit_ips: Ok(value.transit_ips), + vni: Ok(value.vni), + } + } + } + + #[derive(Clone, Debug)] + pub struct OxqlQueryResult { + tables: ::std::result::Result<::std::vec::Vec, ::std::string::String>, + } + + impl ::std::default::Default for OxqlQueryResult { + fn default() -> Self { + Self { + tables: Err("no value supplied for tables".to_string()), + } + } + } + + impl OxqlQueryResult { + pub fn tables(mut self, value: T) -> Self + where + T: ::std::convert::TryInto<::std::vec::Vec>, + T::Error: ::std::fmt::Display, + { + self.tables = value + .try_into() + .map_err(|e| format!("error converting supplied value for tables: {}", e)); + self + } + } + + impl ::std::convert::TryFrom for super::OxqlQueryResult { + type Error = super::error::ConversionError; + fn try_from( + value: OxqlQueryResult, + ) -> ::std::result::Result { + Ok(Self { + tables: value.tables?, + }) + } + } + + impl ::std::convert::From for OxqlQueryResult { + fn from(value: super::OxqlQueryResult) -> Self { + Self { + tables: Ok(value.tables), + } + } + } + + #[derive(Clone, Debug)] + pub struct OxqlTable { + name: ::std::result::Result<::std::string::String, ::std::string::String>, + timeseries: + ::std::result::Result<::std::vec::Vec, ::std::string::String>, + } + + impl ::std::default::Default for OxqlTable { + fn default() -> Self { + Self { + name: Err("no value supplied for name".to_string()), + timeseries: Err("no value supplied for timeseries".to_string()), + } + } + } + + impl OxqlTable { + pub fn name(mut self, value: T) -> Self + where + T: ::std::convert::TryInto<::std::string::String>, + T::Error: ::std::fmt::Display, + { + self.name = value + .try_into() + .map_err(|e| format!("error converting supplied value for name: {}", e)); + self + } + pub fn timeseries(mut self, value: T) -> Self + where + T: ::std::convert::TryInto<::std::vec::Vec>, + T::Error: ::std::fmt::Display, + { + self.timeseries = value + .try_into() + .map_err(|e| format!("error converting supplied value for timeseries: {}", e)); + self + } + } + + impl ::std::convert::TryFrom for super::OxqlTable { + type Error = super::error::ConversionError; + fn try_from( + value: OxqlTable, + ) -> ::std::result::Result { + Ok(Self { + name: value.name?, + timeseries: value.timeseries?, + }) + } + } + + impl ::std::convert::From for OxqlTable { + fn from(value: super::OxqlTable) -> Self { + Self { + name: Ok(value.name), + timeseries: Ok(value.timeseries), + } + } + } + + #[derive(Clone, Debug)] + pub struct PhysicalDisk { + form_factor: ::std::result::Result, + id: ::std::result::Result<::uuid::Uuid, ::std::string::String>, + model: ::std::result::Result<::std::string::String, ::std::string::String>, + policy: ::std::result::Result, + serial: ::std::result::Result<::std::string::String, ::std::string::String>, + sled_id: + ::std::result::Result<::std::option::Option<::uuid::Uuid>, ::std::string::String>, + state: ::std::result::Result, + time_created: ::std::result::Result< + ::chrono::DateTime<::chrono::offset::Utc>, + ::std::string::String, + >, + time_modified: ::std::result::Result< + ::chrono::DateTime<::chrono::offset::Utc>, + ::std::string::String, + >, + vendor: ::std::result::Result<::std::string::String, ::std::string::String>, + } + + impl ::std::default::Default for PhysicalDisk { + fn default() -> Self { + Self { + form_factor: Err("no value supplied for form_factor".to_string()), + id: Err("no value supplied for id".to_string()), + model: Err("no value supplied for model".to_string()), + policy: Err("no value supplied for policy".to_string()), + serial: Err("no value supplied for serial".to_string()), + sled_id: Ok(Default::default()), + 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()), + vendor: Err("no value supplied for vendor".to_string()), + } + } + } + + impl PhysicalDisk { + pub fn form_factor(mut self, value: T) -> Self + where + T: ::std::convert::TryInto, + T::Error: ::std::fmt::Display, + { + self.form_factor = value + .try_into() + .map_err(|e| format!("error converting supplied value for form_factor: {}", e)); + self + } + pub fn id(mut self, value: T) -> Self + where + T: ::std::convert::TryInto<::uuid::Uuid>, + T::Error: ::std::fmt::Display, + { + self.id = value + .try_into() + .map_err(|e| format!("error converting supplied value for id: {}", e)); + self + } + 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 policy(mut self, value: T) -> Self + where + T: ::std::convert::TryInto, + T::Error: ::std::fmt::Display, + { + self.policy = value + .try_into() + .map_err(|e| format!("error converting supplied value for policy: {}", 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 sled_id(mut self, value: T) -> Self + where + T: ::std::convert::TryInto<::std::option::Option<::uuid::Uuid>>, + T::Error: ::std::fmt::Display, + { + self.sled_id = value + .try_into() + .map_err(|e| format!("error converting supplied value for sled_id: {}", e)); + self + } + pub fn state(mut self, value: T) -> Self + where + T: ::std::convert::TryInto, T::Error: ::std::fmt::Display, { self.state = value @@ -62827,6 +64234,223 @@ pub trait ClientExperimentalExt { /// .await; /// ``` fn instance_affinity_group_list(&self) -> builder::InstanceAffinityGroupList<'_>; + /// List multicast groups for instance + /// + /// Sends a `GET` request to `/v1/instances/{instance}/multicast-groups` + /// + /// Arguments: + /// - `instance`: Name or ID of the instance + /// - `project`: Name or ID of the project + /// ```ignore + /// let response = client.instance_multicast_group_list() + /// .instance(instance) + /// .project(project) + /// .send() + /// .await; + /// ``` + fn instance_multicast_group_list(&self) -> builder::InstanceMulticastGroupList<'_>; + /// Join multicast group + /// + /// This is functionally equivalent to adding the instance via the group's + /// member management endpoint or updating the instance's `multicast_groups` + /// field. All approaches modify the same membership and trigger + /// reconciliation. + /// + /// Sends a `PUT` request to + /// `/v1/instances/{instance}/multicast-groups/{multicast_group}` + /// + /// Arguments: + /// - `instance`: Name or ID of the instance + /// - `multicast_group`: Name or ID of the multicast group + /// - `project`: Name or ID of the project + /// ```ignore + /// let response = client.instance_multicast_group_join() + /// .instance(instance) + /// .multicast_group(multicast_group) + /// .project(project) + /// .send() + /// .await; + /// ``` + fn instance_multicast_group_join(&self) -> builder::InstanceMulticastGroupJoin<'_>; + /// Leave multicast group + /// + /// This is functionally equivalent to removing the instance via the group's + /// member management endpoint or updating the instance's `multicast_groups` + /// field. All approaches modify the same membership and trigger + /// reconciliation. + /// + /// Sends a `DELETE` request to + /// `/v1/instances/{instance}/multicast-groups/{multicast_group}` + /// + /// Arguments: + /// - `instance`: Name or ID of the instance + /// - `multicast_group`: Name or ID of the multicast group + /// - `project`: Name or ID of the project + /// ```ignore + /// let response = client.instance_multicast_group_leave() + /// .instance(instance) + /// .multicast_group(multicast_group) + /// .project(project) + /// .send() + /// .await; + /// ``` + fn instance_multicast_group_leave(&self) -> builder::InstanceMulticastGroupLeave<'_>; + /// List all multicast groups + /// + /// Sends a `GET` request to `/v1/multicast-groups` + /// + /// 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.multicast_group_list() + /// .limit(limit) + /// .page_token(page_token) + /// .sort_by(sort_by) + /// .send() + /// .await; + /// ``` + fn multicast_group_list(&self) -> builder::MulticastGroupList<'_>; + /// Create a multicast group + /// + /// Multicast groups are fleet-scoped resources that can be joined by + /// instances across projects and silos. A single multicast IP serves all + /// group members regardless of project or silo boundaries. + /// + /// Sends a `POST` request to `/v1/multicast-groups` + /// + /// ```ignore + /// let response = client.multicast_group_create() + /// .body(body) + /// .send() + /// .await; + /// ``` + fn multicast_group_create(&self) -> builder::MulticastGroupCreate<'_>; + /// Fetch a multicast group + /// + /// Sends a `GET` request to `/v1/multicast-groups/{multicast_group}` + /// + /// Arguments: + /// - `multicast_group`: Name or ID of the multicast group + /// ```ignore + /// let response = client.multicast_group_view() + /// .multicast_group(multicast_group) + /// .send() + /// .await; + /// ``` + fn multicast_group_view(&self) -> builder::MulticastGroupView<'_>; + /// Update a multicast group + /// + /// Sends a `PUT` request to `/v1/multicast-groups/{multicast_group}` + /// + /// Arguments: + /// - `multicast_group`: Name or ID of the multicast group + /// - `body` + /// ```ignore + /// let response = client.multicast_group_update() + /// .multicast_group(multicast_group) + /// .body(body) + /// .send() + /// .await; + /// ``` + fn multicast_group_update(&self) -> builder::MulticastGroupUpdate<'_>; + /// Delete a multicast group + /// + /// Sends a `DELETE` request to `/v1/multicast-groups/{multicast_group}` + /// + /// Arguments: + /// - `multicast_group`: Name or ID of the multicast group + /// ```ignore + /// let response = client.multicast_group_delete() + /// .multicast_group(multicast_group) + /// .send() + /// .await; + /// ``` + fn multicast_group_delete(&self) -> builder::MulticastGroupDelete<'_>; + /// List members of a multicast group + /// + /// Sends a `GET` request to + /// `/v1/multicast-groups/{multicast_group}/members` + /// + /// Arguments: + /// - `multicast_group`: Name or ID of the multicast group + /// - `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.multicast_group_member_list() + /// .multicast_group(multicast_group) + /// .limit(limit) + /// .page_token(page_token) + /// .sort_by(sort_by) + /// .send() + /// .await; + /// ``` + fn multicast_group_member_list(&self) -> builder::MulticastGroupMemberList<'_>; + /// Add instance to a multicast group + /// + /// Functionally equivalent to updating the instance's `multicast_groups` + /// field. Both approaches modify the same underlying membership and trigger + /// the same reconciliation logic. + /// + /// Specify instance by name (requires `?project=`) or UUID. + /// + /// Sends a `POST` request to + /// `/v1/multicast-groups/{multicast_group}/members` + /// + /// Arguments: + /// - `multicast_group`: Name or ID of the multicast group + /// - `project`: Name or ID of the project + /// - `body` + /// ```ignore + /// let response = client.multicast_group_member_add() + /// .multicast_group(multicast_group) + /// .project(project) + /// .body(body) + /// .send() + /// .await; + /// ``` + fn multicast_group_member_add(&self) -> builder::MulticastGroupMemberAdd<'_>; + /// Remove instance from a multicast group + /// + /// Functionally equivalent to removing the group from the instance's + /// `multicast_groups` field. Both approaches modify the same underlying + /// membership and trigger reconciliation. + /// + /// Specify instance by name (requires `?project=`) or UUID. + /// + /// Sends a `DELETE` request to + /// `/v1/multicast-groups/{multicast_group}/members/{instance}` + /// + /// Arguments: + /// - `multicast_group`: Name or ID of the multicast group + /// - `instance`: Name or ID of the instance + /// - `project`: Name or ID of the project + /// ```ignore + /// let response = client.multicast_group_member_remove() + /// .multicast_group(multicast_group) + /// .instance(instance) + /// .project(project) + /// .send() + /// .await; + /// ``` + fn multicast_group_member_remove(&self) -> builder::MulticastGroupMemberRemove<'_>; + /// Look up multicast group by IP address + /// + /// Sends a `GET` request to `/v1/system/multicast-groups/by-ip/{address}` + /// + /// Arguments: + /// - `address`: IP address of the multicast group + /// ```ignore + /// let response = client.lookup_multicast_group_by_ip() + /// .address(address) + /// .send() + /// .await; + /// ``` + fn lookup_multicast_group_by_ip(&self) -> builder::LookupMulticastGroupByIp<'_>; /// Run project-scoped timeseries query /// /// Queries are written in OxQL. Project must be specified by name or ID in @@ -62947,6 +64571,54 @@ impl ClientExperimentalExt for Client { builder::InstanceAffinityGroupList::new(self) } + fn instance_multicast_group_list(&self) -> builder::InstanceMulticastGroupList<'_> { + builder::InstanceMulticastGroupList::new(self) + } + + fn instance_multicast_group_join(&self) -> builder::InstanceMulticastGroupJoin<'_> { + builder::InstanceMulticastGroupJoin::new(self) + } + + fn instance_multicast_group_leave(&self) -> builder::InstanceMulticastGroupLeave<'_> { + builder::InstanceMulticastGroupLeave::new(self) + } + + fn multicast_group_list(&self) -> builder::MulticastGroupList<'_> { + builder::MulticastGroupList::new(self) + } + + fn multicast_group_create(&self) -> builder::MulticastGroupCreate<'_> { + builder::MulticastGroupCreate::new(self) + } + + fn multicast_group_view(&self) -> builder::MulticastGroupView<'_> { + builder::MulticastGroupView::new(self) + } + + fn multicast_group_update(&self) -> builder::MulticastGroupUpdate<'_> { + builder::MulticastGroupUpdate::new(self) + } + + fn multicast_group_delete(&self) -> builder::MulticastGroupDelete<'_> { + builder::MulticastGroupDelete::new(self) + } + + fn multicast_group_member_list(&self) -> builder::MulticastGroupMemberList<'_> { + builder::MulticastGroupMemberList::new(self) + } + + fn multicast_group_member_add(&self) -> builder::MulticastGroupMemberAdd<'_> { + builder::MulticastGroupMemberAdd::new(self) + } + + fn multicast_group_member_remove(&self) -> builder::MulticastGroupMemberRemove<'_> { + builder::MulticastGroupMemberRemove::new(self) + } + + fn lookup_multicast_group_by_ip(&self) -> builder::LookupMulticastGroupByIp<'_> { + builder::LookupMulticastGroupByIp::new(self) + } + fn timeseries_query(&self) -> builder::TimeseriesQuery<'_> { builder::TimeseriesQuery::new(self) } @@ -77286,10 +78958,314 @@ pub mod builder { self } - /// Sends a `GET` request to `/v1/instances/{instance}/external-ips` + /// Sends a `GET` request to `/v1/instances/{instance}/external-ips` + pub async fn send( + self, + ) -> Result, Error> { + let Self { + client, + instance, + project, + } = self; + let instance = instance.map_err(Error::InvalidRequest)?; + let project = project.map_err(Error::InvalidRequest)?; + let url = format!( + "{}/v1/instances/{}/external-ips", + client.baseurl, + encode_path(&instance.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 + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .query(&progenitor_client::QueryParam::new("project", &project)) + .headers(header_map) + .build()?; + let info = OperationInfo { + operation_id: "instance_external_ip_list", + }; + 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)), + } + } + } + + /// Builder for [`ClientInstancesExt::instance_ephemeral_ip_attach`] + /// + /// [`ClientInstancesExt::instance_ephemeral_ip_attach`]: super::ClientInstancesExt::instance_ephemeral_ip_attach + #[derive(Debug, Clone)] + pub struct InstanceEphemeralIpAttach<'a> { + client: &'a super::Client, + instance: Result, + project: Result, String>, + body: Result, + } + + impl<'a> InstanceEphemeralIpAttach<'a> { + pub fn new(client: &'a super::Client) -> Self { + Self { + client: client, + instance: Err("instance was not initialized".to_string()), + project: Ok(None), + body: Ok(::std::default::Default::default()), + } + } + + pub fn instance(mut self, value: V) -> Self + where + V: std::convert::TryInto, + { + self.instance = value + .try_into() + .map_err(|_| "conversion to `NameOrId` for instance failed".to_string()); + self + } + + pub fn project(mut self, value: V) -> Self + where + V: std::convert::TryInto, + { + self.project = value + .try_into() + .map(Some) + .map_err(|_| "conversion to `NameOrId` for project failed".to_string()); + self + } + + 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 `EphemeralIpCreate` for body failed: {}", s)); + self + } + + pub fn body_map(mut self, f: F) -> Self + where + F: std::ops::FnOnce( + types::builder::EphemeralIpCreate, + ) -> types::builder::EphemeralIpCreate, + { + self.body = self.body.map(f); + self + } + + /// Sends a `POST` request to + /// `/v1/instances/{instance}/external-ips/ephemeral` + pub async fn send(self) -> Result, Error> { + let Self { + client, + instance, + project, + body, + } = self; + let instance = instance.map_err(Error::InvalidRequest)?; + let project = project.map_err(Error::InvalidRequest)?; + let body = body + .and_then(|v| types::EphemeralIpCreate::try_from(v).map_err(|e| e.to_string())) + .map_err(Error::InvalidRequest)?; + let url = format!( + "{}/v1/instances/{}/external-ips/ephemeral", + client.baseurl, + encode_path(&instance.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 + .post(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .json(&body) + .query(&progenitor_client::QueryParam::new("project", &project)) + .headers(header_map) + .build()?; + let info = OperationInfo { + operation_id: "instance_ephemeral_ip_attach", + }; + 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() { + 202u16 => 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 [`ClientInstancesExt::instance_ephemeral_ip_detach`] + /// + /// [`ClientInstancesExt::instance_ephemeral_ip_detach`]: super::ClientInstancesExt::instance_ephemeral_ip_detach + #[derive(Debug, Clone)] + pub struct InstanceEphemeralIpDetach<'a> { + client: &'a super::Client, + instance: Result, + project: Result, String>, + } + + impl<'a> InstanceEphemeralIpDetach<'a> { + pub fn new(client: &'a super::Client) -> Self { + Self { + client: client, + instance: Err("instance was not initialized".to_string()), + project: Ok(None), + } + } + + pub fn instance(mut self, value: V) -> Self + where + V: std::convert::TryInto, + { + self.instance = value + .try_into() + .map_err(|_| "conversion to `NameOrId` for instance failed".to_string()); + self + } + + pub fn project(mut self, value: V) -> Self + where + V: std::convert::TryInto, + { + self.project = value + .try_into() + .map(Some) + .map_err(|_| "conversion to `NameOrId` for project failed".to_string()); + self + } + + /// Sends a `DELETE` request to + /// `/v1/instances/{instance}/external-ips/ephemeral` + pub async fn send(self) -> Result, Error> { + let Self { + client, + instance, + project, + } = self; + let instance = instance.map_err(Error::InvalidRequest)?; + let project = project.map_err(Error::InvalidRequest)?; + let url = format!( + "{}/v1/instances/{}/external-ips/ephemeral", + client.baseurl, + encode_path(&instance.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"), + ) + .query(&progenitor_client::QueryParam::new("project", &project)) + .headers(header_map) + .build()?; + let info = OperationInfo { + operation_id: "instance_ephemeral_ip_detach", + }; + 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 [`ClientExperimentalExt::instance_multicast_group_list`] + /// + /// [`ClientExperimentalExt::instance_multicast_group_list`]: super::ClientExperimentalExt::instance_multicast_group_list + #[derive(Debug, Clone)] + pub struct InstanceMulticastGroupList<'a> { + client: &'a super::Client, + instance: Result, + project: Result, String>, + } + + impl<'a> InstanceMulticastGroupList<'a> { + pub fn new(client: &'a super::Client) -> Self { + Self { + client: client, + instance: Err("instance was not initialized".to_string()), + project: Ok(None), + } + } + + pub fn instance(mut self, value: V) -> Self + where + V: std::convert::TryInto, + { + self.instance = value + .try_into() + .map_err(|_| "conversion to `NameOrId` for instance failed".to_string()); + self + } + + pub fn project(mut self, value: V) -> Self + where + V: std::convert::TryInto, + { + self.project = value + .try_into() + .map(Some) + .map_err(|_| "conversion to `NameOrId` for project failed".to_string()); + self + } + + /// Sends a `GET` request to `/v1/instances/{instance}/multicast-groups` pub async fn send( self, - ) -> Result, Error> { + ) -> Result, Error> + { let Self { client, instance, @@ -77298,7 +79274,7 @@ pub mod builder { let instance = instance.map_err(Error::InvalidRequest)?; let project = project.map_err(Error::InvalidRequest)?; let url = format!( - "{}/v1/instances/{}/external-ips", + "{}/v1/instances/{}/multicast-groups", client.baseurl, encode_path(&instance.to_string()), ); @@ -77319,7 +79295,7 @@ pub mod builder { .headers(header_map) .build()?; let info = OperationInfo { - operation_id: "instance_external_ip_list", + operation_id: "instance_multicast_group_list", }; client.pre(&mut request, &info).await?; let result = client.exec(request, &info).await; @@ -77338,24 +79314,24 @@ pub mod builder { } } - /// Builder for [`ClientInstancesExt::instance_ephemeral_ip_attach`] + /// Builder for [`ClientExperimentalExt::instance_multicast_group_join`] /// - /// [`ClientInstancesExt::instance_ephemeral_ip_attach`]: super::ClientInstancesExt::instance_ephemeral_ip_attach + /// [`ClientExperimentalExt::instance_multicast_group_join`]: super::ClientExperimentalExt::instance_multicast_group_join #[derive(Debug, Clone)] - pub struct InstanceEphemeralIpAttach<'a> { + pub struct InstanceMulticastGroupJoin<'a> { client: &'a super::Client, instance: Result, + multicast_group: Result, project: Result, String>, - body: Result, } - impl<'a> InstanceEphemeralIpAttach<'a> { + impl<'a> InstanceMulticastGroupJoin<'a> { pub fn new(client: &'a super::Client) -> Self { Self { client: client, instance: Err("instance was not initialized".to_string()), + multicast_group: Err("multicast_group was not initialized".to_string()), project: Ok(None), - body: Ok(::std::default::Default::default()), } } @@ -77369,57 +79345,46 @@ pub mod builder { self } - pub fn project(mut self, value: V) -> Self + pub fn multicast_group(mut self, value: V) -> Self where V: std::convert::TryInto, { - self.project = value + self.multicast_group = value .try_into() - .map(Some) - .map_err(|_| "conversion to `NameOrId` for project failed".to_string()); + .map_err(|_| "conversion to `NameOrId` for multicast_group failed".to_string()); self } - pub fn body(mut self, value: V) -> Self + pub fn project(mut self, value: V) -> Self where - V: std::convert::TryInto, - >::Error: std::fmt::Display, + V: std::convert::TryInto, { - self.body = value + self.project = value .try_into() - .map(From::from) - .map_err(|s| format!("conversion to `EphemeralIpCreate` for body failed: {}", s)); - self - } - - pub fn body_map(mut self, f: F) -> Self - where - F: std::ops::FnOnce( - types::builder::EphemeralIpCreate, - ) -> types::builder::EphemeralIpCreate, - { - self.body = self.body.map(f); + .map(Some) + .map_err(|_| "conversion to `NameOrId` for project failed".to_string()); self } - /// Sends a `POST` request to - /// `/v1/instances/{instance}/external-ips/ephemeral` - pub async fn send(self) -> Result, Error> { + /// Sends a `PUT` request to + /// `/v1/instances/{instance}/multicast-groups/{multicast_group}` + pub async fn send( + self, + ) -> Result, Error> { let Self { client, instance, + multicast_group, project, - body, } = self; let instance = instance.map_err(Error::InvalidRequest)?; + let multicast_group = multicast_group.map_err(Error::InvalidRequest)?; let project = project.map_err(Error::InvalidRequest)?; - let body = body - .and_then(|v| types::EphemeralIpCreate::try_from(v).map_err(|e| e.to_string())) - .map_err(Error::InvalidRequest)?; let url = format!( - "{}/v1/instances/{}/external-ips/ephemeral", + "{}/v1/instances/{}/multicast-groups/{}", client.baseurl, encode_path(&instance.to_string()), + encode_path(&multicast_group.to_string()), ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -77429,24 +79394,23 @@ pub mod builder { #[allow(unused_mut)] let mut request = client .client - .post(url) + .put(url) .header( ::reqwest::header::ACCEPT, ::reqwest::header::HeaderValue::from_static("application/json"), ) - .json(&body) .query(&progenitor_client::QueryParam::new("project", &project)) .headers(header_map) .build()?; let info = OperationInfo { - operation_id: "instance_ephemeral_ip_attach", + operation_id: "instance_multicast_group_join", }; 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() { - 202u16 => ResponseValue::from_response(response).await, + 201u16 => ResponseValue::from_response(response).await, 400u16..=499u16 => Err(Error::ErrorResponse( ResponseValue::from_response(response).await?, )), @@ -77458,21 +79422,23 @@ pub mod builder { } } - /// Builder for [`ClientInstancesExt::instance_ephemeral_ip_detach`] + /// Builder for [`ClientExperimentalExt::instance_multicast_group_leave`] /// - /// [`ClientInstancesExt::instance_ephemeral_ip_detach`]: super::ClientInstancesExt::instance_ephemeral_ip_detach + /// [`ClientExperimentalExt::instance_multicast_group_leave`]: super::ClientExperimentalExt::instance_multicast_group_leave #[derive(Debug, Clone)] - pub struct InstanceEphemeralIpDetach<'a> { + pub struct InstanceMulticastGroupLeave<'a> { client: &'a super::Client, instance: Result, + multicast_group: Result, project: Result, String>, } - impl<'a> InstanceEphemeralIpDetach<'a> { + impl<'a> InstanceMulticastGroupLeave<'a> { pub fn new(client: &'a super::Client) -> Self { Self { client: client, instance: Err("instance was not initialized".to_string()), + multicast_group: Err("multicast_group was not initialized".to_string()), project: Ok(None), } } @@ -77487,6 +79453,16 @@ pub mod builder { self } + pub fn multicast_group(mut self, value: V) -> Self + where + V: std::convert::TryInto, + { + self.multicast_group = value + .try_into() + .map_err(|_| "conversion to `NameOrId` for multicast_group failed".to_string()); + self + } + pub fn project(mut self, value: V) -> Self where V: std::convert::TryInto, @@ -77499,19 +79475,22 @@ pub mod builder { } /// Sends a `DELETE` request to - /// `/v1/instances/{instance}/external-ips/ephemeral` + /// `/v1/instances/{instance}/multicast-groups/{multicast_group}` pub async fn send(self) -> Result, Error> { let Self { client, instance, + multicast_group, project, } = self; let instance = instance.map_err(Error::InvalidRequest)?; + let multicast_group = multicast_group.map_err(Error::InvalidRequest)?; let project = project.map_err(Error::InvalidRequest)?; let url = format!( - "{}/v1/instances/{}/external-ips/ephemeral", + "{}/v1/instances/{}/multicast-groups/{}", client.baseurl, encode_path(&instance.to_string()), + encode_path(&multicast_group.to_string()), ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -77530,7 +79509,7 @@ pub mod builder { .headers(header_map) .build()?; let info = OperationInfo { - operation_id: "instance_ephemeral_ip_detach", + operation_id: "instance_multicast_group_leave", }; client.pre(&mut request, &info).await?; let result = client.exec(request, &info).await; @@ -80102,23 +82081,301 @@ pub mod builder { } } - /// Builder for [`ClientConsoleAuthExt::logout`] + /// Builder for [`ClientConsoleAuthExt::logout`] + /// + /// [`ClientConsoleAuthExt::logout`]: super::ClientConsoleAuthExt::logout + #[derive(Debug, Clone)] + pub struct Logout<'a> { + client: &'a super::Client, + } + + impl<'a> Logout<'a> { + pub fn new(client: &'a super::Client) -> Self { + Self { client: client } + } + + /// Sends a `POST` request to `/v1/logout` + pub async fn send(self) -> Result, Error> { + let Self { client } = self; + let url = format!("{}/v1/logout", client.baseurl,); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + #[allow(unused_mut)] + let mut request = client + .client + .post(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) + .build()?; + let info = OperationInfo { + operation_id: "logout", + }; + 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 [`ClientCurrentUserExt::current_user_view`] + /// + /// [`ClientCurrentUserExt::current_user_view`]: super::ClientCurrentUserExt::current_user_view + #[derive(Debug, Clone)] + pub struct CurrentUserView<'a> { + client: &'a super::Client, + } + + impl<'a> CurrentUserView<'a> { + pub fn new(client: &'a super::Client) -> Self { + Self { client: client } + } + + /// Sends a `GET` request to `/v1/me` + pub async fn send(self) -> Result, Error> { + let Self { client } = self; + let url = format!("{}/v1/me", 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"), + ) + .headers(header_map) + .build()?; + let info = OperationInfo { + operation_id: "current_user_view", + }; + 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)), + } + } + } + + /// Builder for [`ClientTokensExt::current_user_access_token_list`] + /// + /// [`ClientTokensExt::current_user_access_token_list`]: super::ClientTokensExt::current_user_access_token_list + #[derive(Debug, Clone)] + pub struct CurrentUserAccessTokenList<'a> { + client: &'a super::Client, + limit: Result, String>, + page_token: Result, String>, + sort_by: Result, String>, + } + + impl<'a> CurrentUserAccessTokenList<'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/me/access-tokens` + 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/me/access-tokens", 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: "current_user_access_token_list", + }; + 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/me/access-tokens` + 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), + 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 [`ClientTokensExt::current_user_access_token_delete`] /// - /// [`ClientConsoleAuthExt::logout`]: super::ClientConsoleAuthExt::logout + /// [`ClientTokensExt::current_user_access_token_delete`]: super::ClientTokensExt::current_user_access_token_delete #[derive(Debug, Clone)] - pub struct Logout<'a> { + pub struct CurrentUserAccessTokenDelete<'a> { client: &'a super::Client, + token_id: Result<::uuid::Uuid, String>, } - impl<'a> Logout<'a> { + impl<'a> CurrentUserAccessTokenDelete<'a> { pub fn new(client: &'a super::Client) -> Self { - Self { client: client } + Self { + client: client, + token_id: Err("token_id was not initialized".to_string()), + } } - /// Sends a `POST` request to `/v1/logout` + pub fn token_id(mut self, value: V) -> Self + where + V: std::convert::TryInto<::uuid::Uuid>, + { + self.token_id = value + .try_into() + .map_err(|_| "conversion to `:: uuid :: Uuid` for token_id failed".to_string()); + self + } + + /// Sends a `DELETE` request to `/v1/me/access-tokens/{token_id}` pub async fn send(self) -> Result, Error> { - let Self { client } = self; - let url = format!("{}/v1/logout", client.baseurl,); + let Self { client, token_id } = self; + let token_id = token_id.map_err(Error::InvalidRequest)?; + let url = format!( + "{}/v1/me/access-tokens/{}", + client.baseurl, + encode_path(&token_id.to_string()), + ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -80127,7 +82384,7 @@ pub mod builder { #[allow(unused_mut)] let mut request = client .client - .post(url) + .delete(url) .header( ::reqwest::header::ACCEPT, ::reqwest::header::HeaderValue::from_static("application/json"), @@ -80135,7 +82392,7 @@ pub mod builder { .headers(header_map) .build()?; let info = OperationInfo { - operation_id: "logout", + operation_id: "current_user_access_token_delete", }; client.pre(&mut request, &info).await?; let result = client.exec(request, &info).await; @@ -80154,23 +82411,72 @@ pub mod builder { } } - /// Builder for [`ClientCurrentUserExt::current_user_view`] + /// Builder for [`ClientCurrentUserExt::current_user_groups`] /// - /// [`ClientCurrentUserExt::current_user_view`]: super::ClientCurrentUserExt::current_user_view + /// [`ClientCurrentUserExt::current_user_groups`]: super::ClientCurrentUserExt::current_user_groups #[derive(Debug, Clone)] - pub struct CurrentUserView<'a> { + pub struct CurrentUserGroups<'a> { client: &'a super::Client, + limit: Result, String>, + page_token: Result, String>, + sort_by: Result, String>, } - impl<'a> CurrentUserView<'a> { + impl<'a> CurrentUserGroups<'a> { pub fn new(client: &'a super::Client) -> Self { - Self { client: client } + Self { + client: client, + limit: Ok(None), + page_token: Ok(None), + sort_by: Ok(None), + } } - /// Sends a `GET` request to `/v1/me` - pub async fn send(self) -> Result, Error> { - let Self { client } = self; - let url = format!("{}/v1/me", client.baseurl,); + 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/me/groups` + 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/me/groups", client.baseurl,); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -80184,10 +82490,16 @@ pub mod builder { ::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: "current_user_view", + operation_id: "current_user_groups", }; client.pre(&mut request, &info).await?; let result = client.exec(request, &info).await; @@ -80204,20 +82516,66 @@ pub mod builder { _ => Err(Error::UnexpectedResponse(response)), } } + + /// Streams `GET` requests to `/v1/me/groups` + 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), + 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 [`ClientTokensExt::current_user_access_token_list`] + /// Builder for [`ClientCurrentUserExt::current_user_ssh_key_list`] /// - /// [`ClientTokensExt::current_user_access_token_list`]: super::ClientTokensExt::current_user_access_token_list + /// [`ClientCurrentUserExt::current_user_ssh_key_list`]: super::ClientCurrentUserExt::current_user_ssh_key_list #[derive(Debug, Clone)] - pub struct CurrentUserAccessTokenList<'a> { + pub struct CurrentUserSshKeyList<'a> { client: &'a super::Client, limit: Result, String>, page_token: Result, String>, - sort_by: Result, String>, + sort_by: Result, String>, } - impl<'a> CurrentUserAccessTokenList<'a> { + impl<'a> CurrentUserSshKeyList<'a> { pub fn new(client: &'a super::Client) -> Self { Self { client: client, @@ -80249,20 +82607,19 @@ pub mod builder { pub fn sort_by(mut self, value: V) -> Self where - V: std::convert::TryInto, + V: std::convert::TryInto, { self.sort_by = value .try_into() .map(Some) - .map_err(|_| "conversion to `IdSortMode` for sort_by failed".to_string()); + .map_err(|_| "conversion to `NameOrIdSortMode` for sort_by failed".to_string()); self } - /// Sends a `GET` request to `/v1/me/access-tokens` + /// Sends a `GET` request to `/v1/me/ssh-keys` pub async fn send( self, - ) -> Result, Error> - { + ) -> Result, Error> { let Self { client, limit, @@ -80272,7 +82629,7 @@ pub mod builder { 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/me/access-tokens", client.baseurl,); + let url = format!("{}/v1/me/ssh-keys", client.baseurl,); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -80295,7 +82652,7 @@ pub mod builder { .headers(header_map) .build()?; let info = OperationInfo { - operation_id: "current_user_access_token_list", + operation_id: "current_user_ssh_key_list", }; client.pre(&mut request, &info).await?; let result = client.exec(request, &info).await; @@ -80313,12 +82670,11 @@ pub mod builder { } } - /// Streams `GET` requests to `/v1/me/access-tokens` + /// Streams `GET` requests to `/v1/me/ssh-keys` pub fn stream( self, - ) -> impl futures::Stream>> - + Unpin - + 'a { + ) -> impl futures::Stream>> + Unpin + 'a + { use ::futures::StreamExt; use ::futures::TryFutureExt; use ::futures::TryStreamExt; @@ -80361,41 +82717,192 @@ pub mod builder { } } - /// Builder for [`ClientTokensExt::current_user_access_token_delete`] + /// Builder for [`ClientCurrentUserExt::current_user_ssh_key_create`] /// - /// [`ClientTokensExt::current_user_access_token_delete`]: super::ClientTokensExt::current_user_access_token_delete + /// [`ClientCurrentUserExt::current_user_ssh_key_create`]: super::ClientCurrentUserExt::current_user_ssh_key_create #[derive(Debug, Clone)] - pub struct CurrentUserAccessTokenDelete<'a> { + pub struct CurrentUserSshKeyCreate<'a> { client: &'a super::Client, - token_id: Result<::uuid::Uuid, String>, + body: Result, } - impl<'a> CurrentUserAccessTokenDelete<'a> { + impl<'a> CurrentUserSshKeyCreate<'a> { pub fn new(client: &'a super::Client) -> Self { Self { client: client, - token_id: Err("token_id was not initialized".to_string()), + body: Ok(::std::default::Default::default()), } } - pub fn token_id(mut self, value: V) -> Self + pub fn body(mut self, value: V) -> Self where - V: std::convert::TryInto<::uuid::Uuid>, + V: std::convert::TryInto, + >::Error: std::fmt::Display, { - self.token_id = value + self.body = value .try_into() - .map_err(|_| "conversion to `:: uuid :: Uuid` for token_id failed".to_string()); + .map(From::from) + .map_err(|s| format!("conversion to `SshKeyCreate` for body failed: {}", s)); self } - /// Sends a `DELETE` request to `/v1/me/access-tokens/{token_id}` + pub fn body_map(mut self, f: F) -> Self + where + F: std::ops::FnOnce(types::builder::SshKeyCreate) -> types::builder::SshKeyCreate, + { + self.body = self.body.map(f); + self + } + + /// Sends a `POST` request to `/v1/me/ssh-keys` + pub async fn send(self) -> Result, Error> { + let Self { client, body } = self; + let body = body + .and_then(|v| types::SshKeyCreate::try_from(v).map_err(|e| e.to_string())) + .map_err(Error::InvalidRequest)?; + let url = format!("{}/v1/me/ssh-keys", client.baseurl,); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + #[allow(unused_mut)] + let mut request = client + .client + .post(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .json(&body) + .headers(header_map) + .build()?; + let info = OperationInfo { + operation_id: "current_user_ssh_key_create", + }; + 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 [`ClientCurrentUserExt::current_user_ssh_key_view`] + /// + /// [`ClientCurrentUserExt::current_user_ssh_key_view`]: super::ClientCurrentUserExt::current_user_ssh_key_view + #[derive(Debug, Clone)] + pub struct CurrentUserSshKeyView<'a> { + client: &'a super::Client, + ssh_key: Result, + } + + impl<'a> CurrentUserSshKeyView<'a> { + pub fn new(client: &'a super::Client) -> Self { + Self { + client: client, + ssh_key: Err("ssh_key was not initialized".to_string()), + } + } + + pub fn ssh_key(mut self, value: V) -> Self + where + V: std::convert::TryInto, + { + self.ssh_key = value + .try_into() + .map_err(|_| "conversion to `NameOrId` for ssh_key failed".to_string()); + self + } + + /// Sends a `GET` request to `/v1/me/ssh-keys/{ssh_key}` + pub async fn send(self) -> Result, Error> { + let Self { client, ssh_key } = self; + let ssh_key = ssh_key.map_err(Error::InvalidRequest)?; + let url = format!( + "{}/v1/me/ssh-keys/{}", + client.baseurl, + encode_path(&ssh_key.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 + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) + .build()?; + let info = OperationInfo { + operation_id: "current_user_ssh_key_view", + }; + 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)), + } + } + } + + /// Builder for [`ClientCurrentUserExt::current_user_ssh_key_delete`] + /// + /// [`ClientCurrentUserExt::current_user_ssh_key_delete`]: super::ClientCurrentUserExt::current_user_ssh_key_delete + #[derive(Debug, Clone)] + pub struct CurrentUserSshKeyDelete<'a> { + client: &'a super::Client, + ssh_key: Result, + } + + impl<'a> CurrentUserSshKeyDelete<'a> { + pub fn new(client: &'a super::Client) -> Self { + Self { + client: client, + ssh_key: Err("ssh_key was not initialized".to_string()), + } + } + + pub fn ssh_key(mut self, value: V) -> Self + where + V: std::convert::TryInto, + { + self.ssh_key = value + .try_into() + .map_err(|_| "conversion to `NameOrId` for ssh_key failed".to_string()); + self + } + + /// Sends a `DELETE` request to `/v1/me/ssh-keys/{ssh_key}` pub async fn send(self) -> Result, Error> { - let Self { client, token_id } = self; - let token_id = token_id.map_err(Error::InvalidRequest)?; + let Self { client, ssh_key } = self; + let ssh_key = ssh_key.map_err(Error::InvalidRequest)?; let url = format!( - "{}/v1/me/access-tokens/{}", + "{}/v1/me/ssh-keys/{}", client.baseurl, - encode_path(&token_id.to_string()), + encode_path(&ssh_key.to_string()), ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -80413,7 +82920,7 @@ pub mod builder { .headers(header_map) .build()?; let info = OperationInfo { - operation_id: "current_user_access_token_delete", + operation_id: "current_user_ssh_key_delete", }; client.pre(&mut request, &info).await?; let result = client.exec(request, &info).await; @@ -80432,27 +82939,57 @@ pub mod builder { } } - /// Builder for [`ClientCurrentUserExt::current_user_groups`] + /// Builder for [`ClientMetricsExt::silo_metric`] /// - /// [`ClientCurrentUserExt::current_user_groups`]: super::ClientCurrentUserExt::current_user_groups + /// [`ClientMetricsExt::silo_metric`]: super::ClientMetricsExt::silo_metric #[derive(Debug, Clone)] - pub struct CurrentUserGroups<'a> { + pub struct SiloMetric<'a> { client: &'a super::Client, + metric_name: Result, + end_time: Result>, String>, limit: Result, String>, + order: Result, String>, page_token: Result, String>, - sort_by: Result, String>, + project: Result, String>, + start_time: Result>, String>, } - impl<'a> CurrentUserGroups<'a> { + impl<'a> SiloMetric<'a> { pub fn new(client: &'a super::Client) -> Self { Self { client: client, + metric_name: Err("metric_name was not initialized".to_string()), + end_time: Ok(None), limit: Ok(None), + order: Ok(None), page_token: Ok(None), - sort_by: Ok(None), + project: Ok(None), + start_time: Ok(None), } } + pub fn metric_name(mut self, value: V) -> Self + where + V: std::convert::TryInto, + { + self.metric_name = value + .try_into() + .map_err(|_| "conversion to `SystemMetricName` for metric_name failed".to_string()); + self + } + + pub fn end_time(mut self, value: V) -> Self + where + V: std::convert::TryInto<::chrono::DateTime<::chrono::offset::Utc>>, + { + self.end_time = value.try_into().map(Some).map_err(|_| { + "conversion to `:: chrono :: DateTime < :: chrono :: offset :: Utc >` for end_time \ + failed" + .to_string() + }); + self + } + pub fn limit(mut self, value: V) -> Self where V: std::convert::TryInto<::std::num::NonZeroU32>, @@ -80463,6 +83000,17 @@ pub mod builder { self } + pub fn order(mut self, value: V) -> Self + where + V: std::convert::TryInto, + { + self.order = value + .try_into() + .map(Some) + .map_err(|_| "conversion to `PaginationOrder` for order failed".to_string()); + self + } + pub fn page_token(mut self, value: V) -> Self where V: std::convert::TryInto<::std::string::String>, @@ -80473,31 +83021,55 @@ pub mod builder { self } - pub fn sort_by(mut self, value: V) -> Self + pub fn project(mut self, value: V) -> Self where - V: std::convert::TryInto, + V: std::convert::TryInto, { - self.sort_by = value + self.project = value .try_into() .map(Some) - .map_err(|_| "conversion to `IdSortMode` for sort_by failed".to_string()); + .map_err(|_| "conversion to `NameOrId` for project failed".to_string()); self } - /// Sends a `GET` request to `/v1/me/groups` + pub fn start_time(mut self, value: V) -> Self + where + V: std::convert::TryInto<::chrono::DateTime<::chrono::offset::Utc>>, + { + self.start_time = value.try_into().map(Some).map_err(|_| { + "conversion to `:: chrono :: DateTime < :: chrono :: offset :: Utc >` for \ + start_time failed" + .to_string() + }); + self + } + + /// Sends a `GET` request to `/v1/metrics/{metric_name}` pub async fn send( self, - ) -> Result, Error> { + ) -> Result, Error> { let Self { client, + metric_name, + end_time, limit, + order, page_token, - sort_by, + project, + start_time, } = self; + let metric_name = metric_name.map_err(Error::InvalidRequest)?; + let end_time = end_time.map_err(Error::InvalidRequest)?; let limit = limit.map_err(Error::InvalidRequest)?; + let order = order.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/me/groups", client.baseurl,); + let project = project.map_err(Error::InvalidRequest)?; + let start_time = start_time.map_err(Error::InvalidRequest)?; + let url = format!( + "{}/v1/metrics/{}", + client.baseurl, + encode_path(&metric_name.to_string()), + ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -80511,16 +83083,22 @@ pub mod builder { ::reqwest::header::ACCEPT, ::reqwest::header::HeaderValue::from_static("application/json"), ) + .query(&progenitor_client::QueryParam::new("end_time", &end_time)) .query(&progenitor_client::QueryParam::new("limit", &limit)) + .query(&progenitor_client::QueryParam::new("order", &order)) .query(&progenitor_client::QueryParam::new( "page_token", &page_token, )) - .query(&progenitor_client::QueryParam::new("sort_by", &sort_by)) + .query(&progenitor_client::QueryParam::new("project", &project)) + .query(&progenitor_client::QueryParam::new( + "start_time", + &start_time, + )) .headers(header_map) .build()?; let info = OperationInfo { - operation_id: "current_user_groups", + operation_id: "silo_metric", }; client.pre(&mut request, &info).await?; let result = client.exec(request, &info).await; @@ -80538,17 +83116,20 @@ pub mod builder { } } - /// Streams `GET` requests to `/v1/me/groups` + /// Streams `GET` requests to `/v1/metrics/{metric_name}` pub fn stream( self, - ) -> impl futures::Stream>> + Unpin + 'a + ) -> impl futures::Stream>> + Unpin + 'a { use ::futures::StreamExt; use ::futures::TryFutureExt; use ::futures::TryStreamExt; let next = Self { + end_time: Ok(None), + order: Ok(None), page_token: Ok(None), - sort_by: Ok(None), + project: Ok(None), + start_time: Ok(None), ..self.clone() }; self.send() @@ -80585,18 +83166,18 @@ pub mod builder { } } - /// Builder for [`ClientCurrentUserExt::current_user_ssh_key_list`] + /// Builder for [`ClientExperimentalExt::multicast_group_list`] /// - /// [`ClientCurrentUserExt::current_user_ssh_key_list`]: super::ClientCurrentUserExt::current_user_ssh_key_list + /// [`ClientExperimentalExt::multicast_group_list`]: super::ClientExperimentalExt::multicast_group_list #[derive(Debug, Clone)] - pub struct CurrentUserSshKeyList<'a> { + pub struct MulticastGroupList<'a> { client: &'a super::Client, limit: Result, String>, page_token: Result, String>, sort_by: Result, String>, } - impl<'a> CurrentUserSshKeyList<'a> { + impl<'a> MulticastGroupList<'a> { pub fn new(client: &'a super::Client) -> Self { Self { client: client, @@ -80637,10 +83218,10 @@ pub mod builder { self } - /// Sends a `GET` request to `/v1/me/ssh-keys` + /// Sends a `GET` request to `/v1/multicast-groups` pub async fn send( self, - ) -> Result, Error> { + ) -> Result, Error> { let Self { client, limit, @@ -80650,7 +83231,7 @@ pub mod builder { 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/me/ssh-keys", client.baseurl,); + let url = format!("{}/v1/multicast-groups", client.baseurl,); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -80673,7 +83254,7 @@ pub mod builder { .headers(header_map) .build()?; let info = OperationInfo { - operation_id: "current_user_ssh_key_list", + operation_id: "multicast_group_list", }; client.pre(&mut request, &info).await?; let result = client.exec(request, &info).await; @@ -80691,10 +83272,10 @@ pub mod builder { } } - /// Streams `GET` requests to `/v1/me/ssh-keys` + /// Streams `GET` requests to `/v1/multicast-groups` pub fn stream( self, - ) -> impl futures::Stream>> + Unpin + 'a + ) -> impl futures::Stream>> + Unpin + 'a { use ::futures::StreamExt; use ::futures::TryFutureExt; @@ -80738,16 +83319,16 @@ pub mod builder { } } - /// Builder for [`ClientCurrentUserExt::current_user_ssh_key_create`] + /// Builder for [`ClientExperimentalExt::multicast_group_create`] /// - /// [`ClientCurrentUserExt::current_user_ssh_key_create`]: super::ClientCurrentUserExt::current_user_ssh_key_create + /// [`ClientExperimentalExt::multicast_group_create`]: super::ClientExperimentalExt::multicast_group_create #[derive(Debug, Clone)] - pub struct CurrentUserSshKeyCreate<'a> { + pub struct MulticastGroupCreate<'a> { client: &'a super::Client, - body: Result, + body: Result, } - impl<'a> CurrentUserSshKeyCreate<'a> { + impl<'a> MulticastGroupCreate<'a> { pub fn new(client: &'a super::Client) -> Self { Self { client: client, @@ -80757,31 +83338,37 @@ 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 `SshKeyCreate` for body failed: {}", s)); + self.body = value.try_into().map(From::from).map_err(|s| { + format!( + "conversion to `MulticastGroupCreate` for body failed: {}", + s + ) + }); self } pub fn body_map(mut self, f: F) -> Self where - F: std::ops::FnOnce(types::builder::SshKeyCreate) -> types::builder::SshKeyCreate, + F: std::ops::FnOnce( + types::builder::MulticastGroupCreate, + ) -> types::builder::MulticastGroupCreate, { self.body = self.body.map(f); self } - /// Sends a `POST` request to `/v1/me/ssh-keys` - pub async fn send(self) -> Result, Error> { + /// Sends a `POST` request to `/v1/multicast-groups` + pub async fn send( + self, + ) -> Result, Error> { let Self { client, body } = self; let body = body - .and_then(|v| types::SshKeyCreate::try_from(v).map_err(|e| e.to_string())) + .and_then(|v| types::MulticastGroupCreate::try_from(v).map_err(|e| e.to_string())) .map_err(Error::InvalidRequest)?; - let url = format!("{}/v1/me/ssh-keys", client.baseurl,); + let url = format!("{}/v1/multicast-groups", client.baseurl,); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( ::reqwest::header::HeaderName::from_static("api-version"), @@ -80799,7 +83386,7 @@ pub mod builder { .headers(header_map) .build()?; let info = OperationInfo { - operation_id: "current_user_ssh_key_create", + operation_id: "multicast_group_create", }; client.pre(&mut request, &info).await?; let result = client.exec(request, &info).await; @@ -80818,41 +83405,46 @@ pub mod builder { } } - /// Builder for [`ClientCurrentUserExt::current_user_ssh_key_view`] + /// Builder for [`ClientExperimentalExt::multicast_group_view`] /// - /// [`ClientCurrentUserExt::current_user_ssh_key_view`]: super::ClientCurrentUserExt::current_user_ssh_key_view + /// [`ClientExperimentalExt::multicast_group_view`]: super::ClientExperimentalExt::multicast_group_view #[derive(Debug, Clone)] - pub struct CurrentUserSshKeyView<'a> { + pub struct MulticastGroupView<'a> { client: &'a super::Client, - ssh_key: Result, + multicast_group: Result, } - impl<'a> CurrentUserSshKeyView<'a> { + impl<'a> MulticastGroupView<'a> { pub fn new(client: &'a super::Client) -> Self { Self { client: client, - ssh_key: Err("ssh_key was not initialized".to_string()), + multicast_group: Err("multicast_group was not initialized".to_string()), } } - pub fn ssh_key(mut self, value: V) -> Self + pub fn multicast_group(mut self, value: V) -> Self where V: std::convert::TryInto, { - self.ssh_key = value + self.multicast_group = value .try_into() - .map_err(|_| "conversion to `NameOrId` for ssh_key failed".to_string()); + .map_err(|_| "conversion to `NameOrId` for multicast_group failed".to_string()); self } - /// Sends a `GET` request to `/v1/me/ssh-keys/{ssh_key}` - pub async fn send(self) -> Result, Error> { - let Self { client, ssh_key } = self; - let ssh_key = ssh_key.map_err(Error::InvalidRequest)?; + /// Sends a `GET` request to `/v1/multicast-groups/{multicast_group}` + pub async fn send( + self, + ) -> Result, Error> { + let Self { + client, + multicast_group, + } = self; + let multicast_group = multicast_group.map_err(Error::InvalidRequest)?; let url = format!( - "{}/v1/me/ssh-keys/{}", + "{}/v1/multicast-groups/{}", client.baseurl, - encode_path(&ssh_key.to_string()), + encode_path(&multicast_group.to_string()), ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -80870,7 +83462,7 @@ pub mod builder { .headers(header_map) .build()?; let info = OperationInfo { - operation_id: "current_user_ssh_key_view", + operation_id: "multicast_group_view", }; client.pre(&mut request, &info).await?; let result = client.exec(request, &info).await; @@ -80889,41 +83481,151 @@ pub mod builder { } } - /// Builder for [`ClientCurrentUserExt::current_user_ssh_key_delete`] + /// Builder for [`ClientExperimentalExt::multicast_group_update`] /// - /// [`ClientCurrentUserExt::current_user_ssh_key_delete`]: super::ClientCurrentUserExt::current_user_ssh_key_delete + /// [`ClientExperimentalExt::multicast_group_update`]: super::ClientExperimentalExt::multicast_group_update #[derive(Debug, Clone)] - pub struct CurrentUserSshKeyDelete<'a> { + pub struct MulticastGroupUpdate<'a> { client: &'a super::Client, - ssh_key: Result, + multicast_group: Result, + body: Result, } - impl<'a> CurrentUserSshKeyDelete<'a> { + impl<'a> MulticastGroupUpdate<'a> { pub fn new(client: &'a super::Client) -> Self { Self { client: client, - ssh_key: Err("ssh_key was not initialized".to_string()), + multicast_group: Err("multicast_group was not initialized".to_string()), + body: Ok(::std::default::Default::default()), } } - pub fn ssh_key(mut self, value: V) -> Self + pub fn multicast_group(mut self, value: V) -> Self where V: std::convert::TryInto, { - self.ssh_key = value + self.multicast_group = value .try_into() - .map_err(|_| "conversion to `NameOrId` for ssh_key failed".to_string()); + .map_err(|_| "conversion to `NameOrId` for multicast_group failed".to_string()); self } - /// Sends a `DELETE` request to `/v1/me/ssh-keys/{ssh_key}` + 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 `MulticastGroupUpdate` for body failed: {}", + s + ) + }); + self + } + + pub fn body_map(mut self, f: F) -> Self + where + F: std::ops::FnOnce( + types::builder::MulticastGroupUpdate, + ) -> types::builder::MulticastGroupUpdate, + { + self.body = self.body.map(f); + self + } + + /// Sends a `PUT` request to `/v1/multicast-groups/{multicast_group}` + pub async fn send( + self, + ) -> Result, Error> { + let Self { + client, + multicast_group, + body, + } = self; + let multicast_group = multicast_group.map_err(Error::InvalidRequest)?; + let body = body + .and_then(|v| types::MulticastGroupUpdate::try_from(v).map_err(|e| e.to_string())) + .map_err(Error::InvalidRequest)?; + let url = format!( + "{}/v1/multicast-groups/{}", + client.baseurl, + encode_path(&multicast_group.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 + .put(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .json(&body) + .headers(header_map) + .build()?; + let info = OperationInfo { + operation_id: "multicast_group_update", + }; + 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)), + } + } + } + + /// Builder for [`ClientExperimentalExt::multicast_group_delete`] + /// + /// [`ClientExperimentalExt::multicast_group_delete`]: super::ClientExperimentalExt::multicast_group_delete + #[derive(Debug, Clone)] + pub struct MulticastGroupDelete<'a> { + client: &'a super::Client, + multicast_group: Result, + } + + impl<'a> MulticastGroupDelete<'a> { + pub fn new(client: &'a super::Client) -> Self { + Self { + client: client, + multicast_group: Err("multicast_group was not initialized".to_string()), + } + } + + pub fn multicast_group(mut self, value: V) -> Self + where + V: std::convert::TryInto, + { + self.multicast_group = value + .try_into() + .map_err(|_| "conversion to `NameOrId` for multicast_group failed".to_string()); + self + } + + /// Sends a `DELETE` request to `/v1/multicast-groups/{multicast_group}` pub async fn send(self) -> Result, Error> { - let Self { client, ssh_key } = self; - let ssh_key = ssh_key.map_err(Error::InvalidRequest)?; + let Self { + client, + multicast_group, + } = self; + let multicast_group = multicast_group.map_err(Error::InvalidRequest)?; let url = format!( - "{}/v1/me/ssh-keys/{}", + "{}/v1/multicast-groups/{}", client.baseurl, - encode_path(&ssh_key.to_string()), + encode_path(&multicast_group.to_string()), ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -80941,7 +83643,7 @@ pub mod builder { .headers(header_map) .build()?; let info = OperationInfo { - operation_id: "current_user_ssh_key_delete", + operation_id: "multicast_group_delete", }; client.pre(&mut request, &info).await?; let result = client.exec(request, &info).await; @@ -80960,54 +83662,36 @@ pub mod builder { } } - /// Builder for [`ClientMetricsExt::silo_metric`] + /// Builder for [`ClientExperimentalExt::multicast_group_member_list`] /// - /// [`ClientMetricsExt::silo_metric`]: super::ClientMetricsExt::silo_metric + /// [`ClientExperimentalExt::multicast_group_member_list`]: super::ClientExperimentalExt::multicast_group_member_list #[derive(Debug, Clone)] - pub struct SiloMetric<'a> { + pub struct MulticastGroupMemberList<'a> { client: &'a super::Client, - metric_name: Result, - end_time: Result>, String>, + multicast_group: Result, limit: Result, String>, - order: Result, String>, page_token: Result, String>, - project: Result, String>, - start_time: Result>, String>, + sort_by: Result, String>, } - impl<'a> SiloMetric<'a> { + impl<'a> MulticastGroupMemberList<'a> { pub fn new(client: &'a super::Client) -> Self { Self { client: client, - metric_name: Err("metric_name was not initialized".to_string()), - end_time: Ok(None), + multicast_group: Err("multicast_group was not initialized".to_string()), limit: Ok(None), - order: Ok(None), page_token: Ok(None), - project: Ok(None), - start_time: Ok(None), + sort_by: Ok(None), } } - pub fn metric_name(mut self, value: V) -> Self + pub fn multicast_group(mut self, value: V) -> Self where - V: std::convert::TryInto, + V: std::convert::TryInto, { - self.metric_name = value + self.multicast_group = value .try_into() - .map_err(|_| "conversion to `SystemMetricName` for metric_name failed".to_string()); - self - } - - pub fn end_time(mut self, value: V) -> Self - where - V: std::convert::TryInto<::chrono::DateTime<::chrono::offset::Utc>>, - { - self.end_time = value.try_into().map(Some).map_err(|_| { - "conversion to `:: chrono :: DateTime < :: chrono :: offset :: Utc >` for end_time \ - failed" - .to_string() - }); + .map_err(|_| "conversion to `NameOrId` for multicast_group failed".to_string()); self } @@ -81021,17 +83705,6 @@ pub mod builder { self } - pub fn order(mut self, value: V) -> Self - where - V: std::convert::TryInto, - { - self.order = value - .try_into() - .map(Some) - .map_err(|_| "conversion to `PaginationOrder` for order failed".to_string()); - self - } - pub fn page_token(mut self, value: V) -> Self where V: std::convert::TryInto<::std::string::String>, @@ -81042,54 +83715,38 @@ pub mod builder { self } - pub fn project(mut self, value: V) -> Self + pub fn sort_by(mut self, value: V) -> Self where - V: std::convert::TryInto, + V: std::convert::TryInto, { - self.project = value + self.sort_by = value .try_into() .map(Some) - .map_err(|_| "conversion to `NameOrId` for project failed".to_string()); - self - } - - pub fn start_time(mut self, value: V) -> Self - where - V: std::convert::TryInto<::chrono::DateTime<::chrono::offset::Utc>>, - { - self.start_time = value.try_into().map(Some).map_err(|_| { - "conversion to `:: chrono :: DateTime < :: chrono :: offset :: Utc >` for \ - start_time failed" - .to_string() - }); + .map_err(|_| "conversion to `IdSortMode` for sort_by failed".to_string()); self } - /// Sends a `GET` request to `/v1/metrics/{metric_name}` + /// Sends a `GET` request to + /// `/v1/multicast-groups/{multicast_group}/members` pub async fn send( self, - ) -> Result, Error> { + ) -> Result, Error> + { let Self { client, - metric_name, - end_time, + multicast_group, limit, - order, page_token, - project, - start_time, + sort_by, } = self; - let metric_name = metric_name.map_err(Error::InvalidRequest)?; - let end_time = end_time.map_err(Error::InvalidRequest)?; + let multicast_group = multicast_group.map_err(Error::InvalidRequest)?; let limit = limit.map_err(Error::InvalidRequest)?; - let order = order.map_err(Error::InvalidRequest)?; let page_token = page_token.map_err(Error::InvalidRequest)?; - let project = project.map_err(Error::InvalidRequest)?; - let start_time = start_time.map_err(Error::InvalidRequest)?; + let sort_by = sort_by.map_err(Error::InvalidRequest)?; let url = format!( - "{}/v1/metrics/{}", + "{}/v1/multicast-groups/{}/members", client.baseurl, - encode_path(&metric_name.to_string()), + encode_path(&multicast_group.to_string()), ); let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); header_map.append( @@ -81104,22 +83761,16 @@ pub mod builder { ::reqwest::header::ACCEPT, ::reqwest::header::HeaderValue::from_static("application/json"), ) - .query(&progenitor_client::QueryParam::new("end_time", &end_time)) .query(&progenitor_client::QueryParam::new("limit", &limit)) - .query(&progenitor_client::QueryParam::new("order", &order)) .query(&progenitor_client::QueryParam::new( "page_token", &page_token, )) - .query(&progenitor_client::QueryParam::new("project", &project)) - .query(&progenitor_client::QueryParam::new( - "start_time", - &start_time, - )) + .query(&progenitor_client::QueryParam::new("sort_by", &sort_by)) .headers(header_map) .build()?; let info = OperationInfo { - operation_id: "silo_metric", + operation_id: "multicast_group_member_list", }; client.pre(&mut request, &info).await?; let result = client.exec(request, &info).await; @@ -81137,20 +83788,19 @@ pub mod builder { } } - /// Streams `GET` requests to `/v1/metrics/{metric_name}` + /// Streams `GET` requests to + /// `/v1/multicast-groups/{multicast_group}/members` pub fn stream( self, - ) -> impl futures::Stream>> + Unpin + 'a - { + ) -> impl futures::Stream>> + + Unpin + + 'a { use ::futures::StreamExt; use ::futures::TryFutureExt; use ::futures::TryStreamExt; let next = Self { - end_time: Ok(None), - order: Ok(None), page_token: Ok(None), - project: Ok(None), - start_time: Ok(None), + sort_by: Ok(None), ..self.clone() }; self.send() @@ -81187,6 +83837,238 @@ pub mod builder { } } + /// Builder for [`ClientExperimentalExt::multicast_group_member_add`] + /// + /// [`ClientExperimentalExt::multicast_group_member_add`]: super::ClientExperimentalExt::multicast_group_member_add + #[derive(Debug, Clone)] + pub struct MulticastGroupMemberAdd<'a> { + client: &'a super::Client, + multicast_group: Result, + project: Result, String>, + body: Result, + } + + impl<'a> MulticastGroupMemberAdd<'a> { + pub fn new(client: &'a super::Client) -> Self { + Self { + client: client, + multicast_group: Err("multicast_group was not initialized".to_string()), + project: Ok(None), + body: Ok(::std::default::Default::default()), + } + } + + pub fn multicast_group(mut self, value: V) -> Self + where + V: std::convert::TryInto, + { + self.multicast_group = value + .try_into() + .map_err(|_| "conversion to `NameOrId` for multicast_group failed".to_string()); + self + } + + pub fn project(mut self, value: V) -> Self + where + V: std::convert::TryInto, + { + self.project = value + .try_into() + .map(Some) + .map_err(|_| "conversion to `NameOrId` for project failed".to_string()); + self + } + + 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 `MulticastGroupMemberAdd` for body failed: {}", + s + ) + }); + self + } + + pub fn body_map(mut self, f: F) -> Self + where + F: std::ops::FnOnce( + types::builder::MulticastGroupMemberAdd, + ) -> types::builder::MulticastGroupMemberAdd, + { + self.body = self.body.map(f); + self + } + + /// Sends a `POST` request to + /// `/v1/multicast-groups/{multicast_group}/members` + pub async fn send( + self, + ) -> Result, Error> { + let Self { + client, + multicast_group, + project, + body, + } = self; + let multicast_group = multicast_group.map_err(Error::InvalidRequest)?; + let project = project.map_err(Error::InvalidRequest)?; + let body = body + .and_then(|v| { + types::MulticastGroupMemberAdd::try_from(v).map_err(|e| e.to_string()) + }) + .map_err(Error::InvalidRequest)?; + let url = format!( + "{}/v1/multicast-groups/{}/members", + client.baseurl, + encode_path(&multicast_group.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 + .post(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .json(&body) + .query(&progenitor_client::QueryParam::new("project", &project)) + .headers(header_map) + .build()?; + let info = OperationInfo { + operation_id: "multicast_group_member_add", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 201u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + } + + /// Builder for [`ClientExperimentalExt::multicast_group_member_remove`] + /// + /// [`ClientExperimentalExt::multicast_group_member_remove`]: super::ClientExperimentalExt::multicast_group_member_remove + #[derive(Debug, Clone)] + pub struct MulticastGroupMemberRemove<'a> { + client: &'a super::Client, + multicast_group: Result, + instance: Result, + project: Result, String>, + } + + impl<'a> MulticastGroupMemberRemove<'a> { + pub fn new(client: &'a super::Client) -> Self { + Self { + client: client, + multicast_group: Err("multicast_group was not initialized".to_string()), + instance: Err("instance was not initialized".to_string()), + project: Ok(None), + } + } + + pub fn multicast_group(mut self, value: V) -> Self + where + V: std::convert::TryInto, + { + self.multicast_group = value + .try_into() + .map_err(|_| "conversion to `NameOrId` for multicast_group failed".to_string()); + self + } + + pub fn instance(mut self, value: V) -> Self + where + V: std::convert::TryInto, + { + self.instance = value + .try_into() + .map_err(|_| "conversion to `NameOrId` for instance failed".to_string()); + self + } + + pub fn project(mut self, value: V) -> Self + where + V: std::convert::TryInto, + { + self.project = value + .try_into() + .map(Some) + .map_err(|_| "conversion to `NameOrId` for project failed".to_string()); + self + } + + /// Sends a `DELETE` request to + /// `/v1/multicast-groups/{multicast_group}/members/{instance}` + pub async fn send(self) -> Result, Error> { + let Self { + client, + multicast_group, + instance, + project, + } = self; + let multicast_group = multicast_group.map_err(Error::InvalidRequest)?; + let instance = instance.map_err(Error::InvalidRequest)?; + let project = project.map_err(Error::InvalidRequest)?; + let url = format!( + "{}/v1/multicast-groups/{}/members/{}", + client.baseurl, + encode_path(&multicast_group.to_string()), + encode_path(&instance.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"), + ) + .query(&progenitor_client::QueryParam::new("project", &project)) + .headers(header_map) + .build()?; + let info = OperationInfo { + operation_id: "multicast_group_member_remove", + }; + 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 [`ClientInstancesExt::instance_network_interface_list`] /// /// [`ClientInstancesExt::instance_network_interface_list`]: super::ClientInstancesExt::instance_network_interface_list @@ -88456,6 +91338,80 @@ pub mod builder { } } + /// Builder for [`ClientExperimentalExt::lookup_multicast_group_by_ip`] + /// + /// [`ClientExperimentalExt::lookup_multicast_group_by_ip`]: super::ClientExperimentalExt::lookup_multicast_group_by_ip + #[derive(Debug, Clone)] + pub struct LookupMulticastGroupByIp<'a> { + client: &'a super::Client, + address: Result<::std::net::IpAddr, String>, + } + + impl<'a> LookupMulticastGroupByIp<'a> { + pub fn new(client: &'a super::Client) -> Self { + Self { + client: client, + address: Err("address was not initialized".to_string()), + } + } + + pub fn address(mut self, value: V) -> Self + where + V: std::convert::TryInto<::std::net::IpAddr>, + { + self.address = value.try_into().map_err(|_| { + "conversion to `:: std :: net :: IpAddr` for address failed".to_string() + }); + self + } + + /// Sends a `GET` request to + /// `/v1/system/multicast-groups/by-ip/{address}` + pub async fn send( + self, + ) -> Result, Error> { + let Self { client, address } = self; + let address = address.map_err(Error::InvalidRequest)?; + let url = format!( + "{}/v1/system/multicast-groups/by-ip/{}", + client.baseurl, + encode_path(&address.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 + .get(url) + .header( + ::reqwest::header::ACCEPT, + ::reqwest::header::HeaderValue::from_static("application/json"), + ) + .headers(header_map) + .build()?; + let info = OperationInfo { + operation_id: "lookup_multicast_group_by_ip", + }; + 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)), + } + } + } + /// Builder for [`ClientSystemNetworkingExt::networking_address_lot_list`] /// /// [`ClientSystemNetworkingExt::networking_address_lot_list`]: super::ClientSystemNetworkingExt::networking_address_lot_list From 6ea85c380e6a80c32e7f7eb3535f3104d019b66b Mon Sep 17 00:00:00 2001 From: "oxide-reflector-bot[bot]" <130185838+oxide-reflector-bot[bot]@users.noreply.github.com> Date: Sat, 15 Nov 2025 23:15:30 +0000 Subject: [PATCH 07/10] Rebuilt with latest dependency updates --- Cargo.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 77281c82..b2db4ffc 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2777,7 +2777,7 @@ dependencies = [ [[package]] name = "progenitor" version = "0.11.2" -source = "git+https://github.com/oxidecomputer/progenitor#132a79af0b1ed0de5bd4462c2c272584a0c8be3b" +source = "git+https://github.com/oxidecomputer/progenitor#8d6643d39dcfa955fd12ad230641f44749eb404b" dependencies = [ "progenitor-impl", ] @@ -2800,7 +2800,7 @@ dependencies = [ [[package]] name = "progenitor-impl" version = "0.11.2" -source = "git+https://github.com/oxidecomputer/progenitor#132a79af0b1ed0de5bd4462c2c272584a0c8be3b" +source = "git+https://github.com/oxidecomputer/progenitor#8d6643d39dcfa955fd12ad230641f44749eb404b" dependencies = [ "heck", "http 1.3.1", From 974155e7497ba4ba5a3c0233835088ad140e1374 Mon Sep 17 00:00:00 2001 From: "Adam H. Leventhal" Date: Sun, 16 Nov 2025 11:08:36 -0800 Subject: [PATCH 08/10] add multicast subcommands --- cli/docs/cli.json | 325 ++++++++++++++++++++++++++++++++++++++++- cli/src/cli_builder.rs | 21 +++ 2 files changed, 345 insertions(+), 1 deletion(-) diff --git a/cli/docs/cli.json b/cli/docs/cli.json index 3fd73f54..37a45892 100644 --- a/cli/docs/cli.json +++ b/cli/docs/cli.json @@ -1695,6 +1695,329 @@ ] } ] + }, + { + "name": "multicast-group", + "args": [ + { + "long": "profile", + "help": "Configuration profile to use for commands", + "global": true + } + ], + "subcommands": [ + { + "name": "join", + "about": "Join multicast group.", + "long_about": "This is functionally equivalent to adding the instance via the group's member management endpoint or updating the instance's `multicast_groups` field. All approaches modify the same membership and trigger reconciliation.", + "args": [ + { + "long": "instance", + "help": "Name or ID of the instance" + }, + { + "long": "multicast-group", + "help": "Name or ID of the multicast group" + }, + { + "long": "profile", + "help": "Configuration profile to use for commands", + "global": true + }, + { + "long": "project", + "help": "Name or ID of the project" + } + ] + }, + { + "name": "leave", + "about": "Leave multicast group.", + "long_about": "This is functionally equivalent to removing the instance via the group's member management endpoint or updating the instance's `multicast_groups` field. All approaches modify the same membership and trigger reconciliation.", + "args": [ + { + "long": "instance", + "help": "Name or ID of the instance" + }, + { + "long": "multicast-group", + "help": "Name or ID of the multicast group" + }, + { + "long": "profile", + "help": "Configuration profile to use for commands", + "global": true + }, + { + "long": "project", + "help": "Name or ID of the project" + } + ] + }, + { + "name": "list", + "about": "List multicast groups for instance", + "args": [ + { + "long": "instance", + "help": "Name or ID of the instance" + }, + { + "long": "profile", + "help": "Configuration profile to use for commands", + "global": true + }, + { + "long": "project", + "help": "Name or ID of the project" + } + ] + } + ] + } + ] + }, + { + "name": "multicast-group", + "args": [ + { + "long": "profile", + "help": "Configuration profile to use for commands", + "global": true + } + ], + "subcommands": [ + { + "name": "create", + "about": "Create a multicast group.", + "long_about": "Multicast groups are fleet-scoped resources that can be joined by instances across projects and silos. A single multicast IP serves all group members regardless of project or silo boundaries.", + "args": [ + { + "long": "description" + }, + { + "long": "json-body", + "help": "Path to a file that contains the full json body." + }, + { + "long": "json-body-template", + "help": "XXX" + }, + { + "long": "multicast-ip", + "help": "The multicast IP address to allocate. If None, one will be allocated from the default pool." + }, + { + "long": "mvlan", + "help": "Multicast VLAN (MVLAN) for egress multicast traffic to upstream networks. Tags packets leaving the rack to traverse VLAN-segmented upstream networks.\n\nValid range: 2-4094 (VLAN IDs 0-1 are reserved by IEEE 802.1Q standard)." + }, + { + "long": "name" + }, + { + "long": "pool", + "help": "Name or ID of the IP pool to allocate from. If None, uses the default multicast pool." + }, + { + "long": "profile", + "help": "Configuration profile to use for commands", + "global": true + } + ] + }, + { + "name": "delete", + "about": "Delete a multicast group.", + "args": [ + { + "long": "multicast-group", + "help": "Name or ID of the multicast group" + }, + { + "long": "profile", + "help": "Configuration profile to use for commands", + "global": true + } + ] + }, + { + "name": "list", + "about": "List all multicast groups.", + "args": [ + { + "long": "limit", + "help": "Maximum number of items returned by a single call" + }, + { + "long": "profile", + "help": "Configuration profile to use for commands", + "global": true + }, + { + "long": "sort-by", + "values": [ + "name_ascending", + "name_descending", + "id_ascending" + ] + } + ] + }, + { + "name": "lookup-by-ip", + "about": "Look up multicast group by IP address.", + "args": [ + { + "long": "address", + "help": "IP address of the multicast group" + }, + { + "long": "profile", + "help": "Configuration profile to use for commands", + "global": true + } + ] + }, + { + "name": "member", + "args": [ + { + "long": "profile", + "help": "Configuration profile to use for commands", + "global": true + } + ], + "subcommands": [ + { + "name": "add", + "about": "Add instance to a multicast group.", + "long_about": "Functionally equivalent to updating the instance's `multicast_groups` field. Both approaches modify the same underlying membership and trigger the same reconciliation logic.\n\nSpecify instance by name (requires `?project=`) or UUID.", + "args": [ + { + "long": "instance", + "help": "Name or ID of the instance to add to the multicast group" + }, + { + "long": "json-body", + "help": "Path to a file that contains the full json body." + }, + { + "long": "json-body-template", + "help": "XXX" + }, + { + "long": "multicast-group", + "help": "Name or ID of the multicast group" + }, + { + "long": "profile", + "help": "Configuration profile to use for commands", + "global": true + }, + { + "long": "project", + "help": "Name or ID of the project" + } + ] + }, + { + "name": "list", + "about": "List members of a multicast group.", + "args": [ + { + "long": "limit", + "help": "Maximum number of items returned by a single call" + }, + { + "long": "multicast-group", + "help": "Name or ID of the multicast group" + }, + { + "long": "profile", + "help": "Configuration profile to use for commands", + "global": true + }, + { + "long": "sort-by", + "values": [ + "id_ascending" + ] + } + ] + }, + { + "name": "remove", + "about": "Remove instance from a multicast group.", + "long_about": "Functionally equivalent to removing the group from the instance's `multicast_groups` field. Both approaches modify the same underlying membership and trigger reconciliation.\n\nSpecify instance by name (requires `?project=`) or UUID.", + "args": [ + { + "long": "instance", + "help": "Name or ID of the instance" + }, + { + "long": "multicast-group", + "help": "Name or ID of the multicast group" + }, + { + "long": "profile", + "help": "Configuration profile to use for commands", + "global": true + }, + { + "long": "project", + "help": "Name or ID of the project" + } + ] + } + ] + }, + { + "name": "update", + "about": "Update a multicast group.", + "args": [ + { + "long": "description" + }, + { + "long": "json-body", + "help": "Path to a file that contains the full json body." + }, + { + "long": "json-body-template", + "help": "XXX" + }, + { + "long": "multicast-group", + "help": "Name or ID of the multicast group" + }, + { + "long": "mvlan", + "help": "Multicast VLAN (MVLAN) for egress multicast traffic to upstream networks. Set to null to clear the MVLAN. Valid range: 2-4094 when provided. Omit the field to leave mvlan unchanged." + }, + { + "long": "name" + }, + { + "long": "profile", + "help": "Configuration profile to use for commands", + "global": true + } + ] + }, + { + "name": "view", + "about": "Fetch a multicast group.", + "args": [ + { + "long": "multicast-group", + "help": "Name or ID of the multicast group" + }, + { + "long": "profile", + "help": "Configuration profile to use for commands", + "global": true + } + ] } ] }, @@ -7497,7 +7820,7 @@ }, { "long": "rack-id", - "help": "The containing the switch this loopback address will be configured on." + "help": "The rack containing the switch this loopback address will be configured on." }, { "long": "switch-location", diff --git a/cli/src/cli_builder.rs b/cli/src/cli_builder.rs index 67ab7f11..7b28a92e 100644 --- a/cli/src/cli_builder.rs +++ b/cli/src/cli_builder.rs @@ -636,6 +636,15 @@ fn xxx<'a>(command: CliCommand) -> Option<&'a str> { CliCommand::InstanceNetworkInterfaceView => Some("instance nic view"), CliCommand::InstanceNetworkInterfaceUpdate => Some("instance nic update"), CliCommand::InstanceNetworkInterfaceDelete => Some("instance nic delete"), + CliCommand::InstanceMulticastGroupList => { + Some("experimental instance multicast-group list") + } + CliCommand::InstanceMulticastGroupJoin => { + Some("experimental instance multicast-group join") + } + CliCommand::InstanceMulticastGroupLeave => { + Some("experimental instance multicast-group leave") + } CliCommand::PolicyView => Some("policy view"), CliCommand::PolicyUpdate => Some("policy update"), @@ -734,6 +743,18 @@ fn xxx<'a>(command: CliCommand) -> Option<&'a str> { CliCommand::ProbeList => Some("experimental system probe list"), CliCommand::ProbeView => Some("experimental system probe view"), + CliCommand::MulticastGroupList => Some("experimental multicast-group list"), + CliCommand::MulticastGroupCreate => Some("experimental multicast-group create"), + CliCommand::MulticastGroupView => Some("experimental multicast-group view"), + CliCommand::MulticastGroupDelete => Some("experimental multicast-group delete"), + CliCommand::MulticastGroupUpdate => Some("experimental multicast-group update"), + CliCommand::MulticastGroupMemberList => Some("experimental multicast-group member list"), + CliCommand::MulticastGroupMemberAdd => Some("experimental multicast-group member add"), + CliCommand::MulticastGroupMemberRemove => { + Some("experimental multicast-group member remove") + } + CliCommand::LookupMulticastGroupByIp => Some("experimental multicast-group lookup-by-ip"), + // Metrics-related subcommands CliCommand::TimeseriesQuery => Some("experimental timeseries query"), CliCommand::SystemTimeseriesQuery => Some("experimental system timeseries query"), From 2fe16278ba5a784cec3d56592e67d4d6ab847e16 Mon Sep 17 00:00:00 2001 From: "oxide-reflector-bot[bot]" <130185838+oxide-reflector-bot[bot]@users.noreply.github.com> Date: Mon, 17 Nov 2025 17:24:31 +0000 Subject: [PATCH 09/10] Rebuilt with latest dependency updates --- Cargo.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index b2db4ffc..4f78503e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2777,7 +2777,7 @@ dependencies = [ [[package]] name = "progenitor" version = "0.11.2" -source = "git+https://github.com/oxidecomputer/progenitor#8d6643d39dcfa955fd12ad230641f44749eb404b" +source = "git+https://github.com/oxidecomputer/progenitor#912cdcdabb0d8008484bdffd693b11c518057a09" dependencies = [ "progenitor-impl", ] @@ -2800,7 +2800,7 @@ dependencies = [ [[package]] name = "progenitor-impl" version = "0.11.2" -source = "git+https://github.com/oxidecomputer/progenitor#8d6643d39dcfa955fd12ad230641f44749eb404b" +source = "git+https://github.com/oxidecomputer/progenitor#912cdcdabb0d8008484bdffd693b11c518057a09" dependencies = [ "heck", "http 1.3.1", From 62f7694cbb72ea12c0511e5dbed70b602fc22326 Mon Sep 17 00:00:00 2001 From: "oxide-reflector-bot[bot]" <130185838+oxide-reflector-bot[bot]@users.noreply.github.com> Date: Tue, 18 Nov 2025 15:42:40 +0000 Subject: [PATCH 10/10] Rebuilt with latest dependency updates --- cli/src/generated_cli.rs | 20 +++++++++++++++++--- oxide.json | 4 ++-- sdk/src/generated_sdk.rs | 37 +++++++++++++++++++++++++++++++++---- 3 files changed, 52 insertions(+), 9 deletions(-) diff --git a/cli/src/generated_cli.rs b/cli/src/generated_cli.rs index 72434ea6..5acbf83c 100644 --- a/cli/src/generated_cli.rs +++ b/cli/src/generated_cli.rs @@ -389,8 +389,16 @@ impl Cli { .value_parser(::clap::value_parser!(::std::num::NonZeroU32)) .required(false) .help( - "Optional lifetime for the access token in seconds. If not specified, the \ - silo's max TTL will be used (if set).", + "Optional lifetime for the access token in seconds.\n\nThis value will be \ + validated during the confirmation step. If not specified, it defaults to \ + the silo's max TTL, which can be seen at `/v1/auth-settings`. If \ + specified, must not exceed the silo's max TTL.\n\nSome special logic \ + applies when authenticating the confirmation request with an existing \ + device token: the requested TTL must not produce an expiration time \ + later than the authenticating token's expiration. If no TTL is \ + specified, the expiration will be the lesser of the silo max and the \ + authenticating token's expiration time. To get the longest allowed \ + lifetime, omit the TTL and authenticate with a web console session.", ), ) .arg( @@ -441,7 +449,13 @@ impl Cli { .long_about( "This endpoint is designed to be accessed by the user agent (browser), not the \ client requesting the token. So we do not actually return the token here; it \ - will be returned in response to the poll on `/device/token`.", + will be returned in response to the poll on `/device/token`.\n\nSome special \ + logic applies when authenticating this request with an existing device token \ + instead of a console session: the requested TTL must not produce an expiration \ + time later than the authenticating token's expiration. If no TTL was specified \ + in the initial grant request, the expiration will be the lesser of the silo max \ + and the authenticating token's expiration time. To get the longest allowed \ + lifetime, omit the TTL and authenticate with a web console session.", ) } diff --git a/oxide.json b/oxide.json index 621cb8cc..4a418f0d 100644 --- a/oxide.json +++ b/oxide.json @@ -46,7 +46,7 @@ "console-auth" ], "summary": "Confirm an OAuth 2.0 Device Authorization Grant", - "description": "This endpoint is designed to be accessed by the user agent (browser), not the client requesting the token. So we do not actually return the token here; it will be returned in response to the poll on `/device/token`.", + "description": "This endpoint is designed to be accessed by the user agent (browser), not the client requesting the token. So we do not actually return the token here; it will be returned in response to the poll on `/device/token`.\n\nSome special logic applies when authenticating this request with an existing device token instead of a console session: the requested TTL must not produce an expiration time later than the authenticating token's expiration. If no TTL was specified in the initial grant request, the expiration will be the lesser of the silo max and the authenticating token's expiration time. To get the longest allowed lifetime, omit the TTL and authenticate with a web console session.", "operationId": "device_auth_confirm", "requestBody": { "content": { @@ -18288,7 +18288,7 @@ }, "ttl_seconds": { "nullable": true, - "description": "Optional lifetime for the access token in seconds. If not specified, the silo's max TTL will be used (if set).", + "description": "Optional lifetime for the access token in seconds.\n\nThis value will be validated during the confirmation step. If not specified, it defaults to the silo's max TTL, which can be seen at `/v1/auth-settings`. If specified, must not exceed the silo's max TTL.\n\nSome special logic applies when authenticating the confirmation request with an existing device token: the requested TTL must not produce an expiration time later than the authenticating token's expiration. If no TTL is specified, the expiration will be the lesser of the silo max and the authenticating token's expiration time. To get the longest allowed lifetime, omit the TTL and authenticate with a web console session.", "type": "integer", "format": "uint32", "minimum": 1 diff --git a/sdk/src/generated_sdk.rs b/sdk/src/generated_sdk.rs index 23c6aff3..2664acf4 100644 --- a/sdk/src/generated_sdk.rs +++ b/sdk/src/generated_sdk.rs @@ -8788,8 +8788,17 @@ pub mod types { /// "format": "uuid" /// }, /// "ttl_seconds": { - /// "description": "Optional lifetime for the access token in seconds. - /// If not specified, the silo's max TTL will be used (if set).", + /// "description": "Optional lifetime for the access token in + /// seconds.\n\nThis value will be validated during the confirmation step. + /// If not specified, it defaults to the silo's max TTL, which can be seen + /// at `/v1/auth-settings`. If specified, must not exceed the silo's max + /// TTL.\n\nSome special logic applies when authenticating the confirmation + /// request with an existing device token: the requested TTL must not + /// produce an expiration time later than the authenticating token's + /// expiration. If no TTL is specified, the expiration will be the lesser of + /// the silo max and the authenticating token's expiration time. To get the + /// longest allowed lifetime, omit the TTL and authenticate with a web + /// console session.", /// "type": [ /// "integer", /// "null" @@ -8806,8 +8815,20 @@ pub mod types { )] pub struct DeviceAuthRequest { pub client_id: ::uuid::Uuid, - /// Optional lifetime for the access token in seconds. If not specified, - /// the silo's max TTL will be used (if set). + /// Optional lifetime for the access token in seconds. + /// + /// This value will be validated during the confirmation step. If not + /// specified, it defaults to the silo's max TTL, which can be seen at + /// `/v1/auth-settings`. If specified, must not exceed the silo's max + /// TTL. + /// + /// Some special logic applies when authenticating the confirmation + /// request with an existing device token: the requested TTL must not + /// produce an expiration time later than the authenticating token's + /// expiration. If no TTL is specified, the expiration will be the + /// lesser of the silo max and the authenticating token's expiration + /// time. To get the longest allowed lifetime, omit the TTL and + /// authenticate with a web console session. #[serde(default, skip_serializing_if = "::std::option::Option::is_none")] pub ttl_seconds: ::std::option::Option<::std::num::NonZeroU32>, } @@ -63463,6 +63484,14 @@ pub trait ClientConsoleAuthExt { /// token here; it will be returned in response to the poll on /// `/device/token`. /// + /// Some special logic applies when authenticating this request with an + /// existing device token instead of a console session: the requested TTL + /// must not produce an expiration time later than the authenticating + /// token's expiration. If no TTL was specified in the initial grant + /// request, the expiration will be the lesser of the silo max and the + /// authenticating token's expiration time. To get the longest allowed + /// lifetime, omit the TTL and authenticate with a web console session. + /// /// Sends a `POST` request to `/device/confirm` /// /// ```ignore