From 2bf8975f2ee20b0a5e894a9ee78f40526a87f870 Mon Sep 17 00:00:00 2001 From: "oxide-reflector-bot[bot]" <130185838+oxide-reflector-bot[bot]@users.noreply.github.com> Date: Mon, 30 Dec 2024 15:52:54 +0000 Subject: [PATCH 01/17] Rebuilt with latest dependency updates --- Cargo.lock | 66 +++++++++++++++++++++++++++--------------------------- 1 file changed, 33 insertions(+), 33 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index df453455..5d1cf277 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -333,7 +333,7 @@ checksum = "c7c24de15d275a1ecfd47a380fb4d5ec9bfe0933f309ed5e705b775596a3574d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.91", + "syn 2.0.93", ] [[package]] @@ -350,7 +350,7 @@ checksum = "721cae7de5c34fbb2acd27e21e6d2cf7b886dce0c27388d46c4e6c47ea4318dd" dependencies = [ "proc-macro2", "quote", - "syn 2.0.91", + "syn 2.0.93", ] [[package]] @@ -593,7 +593,7 @@ dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.91", + "syn 2.0.93", ] [[package]] @@ -839,7 +839,7 @@ checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.91", + "syn 2.0.93", ] [[package]] @@ -910,7 +910,7 @@ dependencies = [ "semver", "serde", "serde_tokenstream", - "syn 2.0.91", + "syn 2.0.93", ] [[package]] @@ -1143,7 +1143,7 @@ checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" dependencies = [ "proc-macro2", "quote", - "syn 2.0.91", + "syn 2.0.93", ] [[package]] @@ -1650,7 +1650,7 @@ checksum = "1ec89e9337638ecdc08744df490b221a7399bf8d164eb52a665454e60e075ad6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.91", + "syn 2.0.93", ] [[package]] @@ -2168,7 +2168,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.91", + "syn 2.0.93", ] [[package]] @@ -2502,7 +2502,7 @@ dependencies = [ [[package]] name = "progenitor" version = "0.9.0" -source = "git+https://github.com/oxidecomputer/progenitor#a01e0fb71d56986bad28a066f65369ea5a022d4b" +source = "git+https://github.com/oxidecomputer/progenitor#865b8d575b26eaa02f3ec45cb87e447bfa2de10d" dependencies = [ "progenitor-impl", ] @@ -2525,7 +2525,7 @@ dependencies = [ [[package]] name = "progenitor-impl" version = "0.9.0" -source = "git+https://github.com/oxidecomputer/progenitor#a01e0fb71d56986bad28a066f65369ea5a022d4b" +source = "git+https://github.com/oxidecomputer/progenitor#865b8d575b26eaa02f3ec45cb87e447bfa2de10d" dependencies = [ "heck", "http 1.2.0", @@ -2537,7 +2537,7 @@ dependencies = [ "schemars", "serde", "serde_json", - "syn 2.0.91", + "syn 2.0.93", "thiserror 2.0.9", "typify", "unicode-ident", @@ -2597,9 +2597,9 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.37" +version = "1.0.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5b9d34b8991d19d98081b46eacdd8eb58c6f2b201139f7c5f643cc155a633af" +checksum = "0e4dccaaaf89514f546c693ddc140f729f958c247918a13380cccc6078391acc" dependencies = [ "proc-macro2", ] @@ -2953,7 +2953,7 @@ dependencies = [ "proc-macro2", "quote", "serde_derive_internals", - "syn 2.0.91", + "syn 2.0.93", ] [[package]] @@ -3011,7 +3011,7 @@ checksum = "46f859dbbf73865c6627ed570e78961cd3ac92407a2d117204c49232485da55e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.91", + "syn 2.0.93", ] [[package]] @@ -3022,7 +3022,7 @@ checksum = "18d26a20a969b9e3fdf2fc2d9f21eda6c40e2de84c9408bb5d3b05d499aae711" dependencies = [ "proc-macro2", "quote", - "syn 2.0.91", + "syn 2.0.93", ] [[package]] @@ -3075,7 +3075,7 @@ dependencies = [ "proc-macro2", "quote", "serde", - "syn 2.0.91", + "syn 2.0.93", ] [[package]] @@ -3265,7 +3265,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d904e7009df136af5297832a3ace3370cd14ff1546a232f4f185036c2736fcac" dependencies = [ "quote", - "syn 2.0.91", + "syn 2.0.93", ] [[package]] @@ -3318,7 +3318,7 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.91", + "syn 2.0.93", ] [[package]] @@ -3340,9 +3340,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.91" +version = "2.0.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d53cbcb5a243bd33b7858b1d7f4aca2153490815872d86d955d6ea29f743c035" +checksum = "9c786062daee0d6db1132800e623df74274a0a87322d8e183338e01b3d98d058" dependencies = [ "proc-macro2", "quote", @@ -3366,7 +3366,7 @@ checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" dependencies = [ "proc-macro2", "quote", - "syn 2.0.91", + "syn 2.0.93", ] [[package]] @@ -3501,7 +3501,7 @@ checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.91", + "syn 2.0.93", ] [[package]] @@ -3512,7 +3512,7 @@ checksum = "7b50fa271071aae2e6ee85f842e2e28ba8cd2c5fb67f11fcb1fd70b276f9e7d4" dependencies = [ "proc-macro2", "quote", - "syn 2.0.91", + "syn 2.0.93", ] [[package]] @@ -3634,7 +3634,7 @@ checksum = "693d596312e88961bc67d7f1f97af8a70227d9f90c31bba5806eec004978d752" dependencies = [ "proc-macro2", "quote", - "syn 2.0.91", + "syn 2.0.93", ] [[package]] @@ -3821,7 +3821,7 @@ dependencies = [ "semver", "serde", "serde_json", - "syn 2.0.91", + "syn 2.0.93", "thiserror 2.0.9", "unicode-ident", ] @@ -3839,7 +3839,7 @@ dependencies = [ "serde", "serde_json", "serde_tokenstream", - "syn 2.0.91", + "syn 2.0.93", "typify-impl", ] @@ -4024,7 +4024,7 @@ dependencies = [ "log", "proc-macro2", "quote", - "syn 2.0.91", + "syn 2.0.93", "wasm-bindgen-shared", ] @@ -4059,7 +4059,7 @@ checksum = "30d7a95b763d3c45903ed6c81f156801839e5ee968bb07e534c44df0fcd330c2" dependencies = [ "proc-macro2", "quote", - "syn 2.0.91", + "syn 2.0.93", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -4409,7 +4409,7 @@ checksum = "2380878cad4ac9aac1e2435f3eb4020e8374b5f13c296cb75b4620ff8e229154" dependencies = [ "proc-macro2", "quote", - "syn 2.0.91", + "syn 2.0.93", "synstructure", ] @@ -4431,7 +4431,7 @@ checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.91", + "syn 2.0.93", ] [[package]] @@ -4451,7 +4451,7 @@ checksum = "595eed982f7d355beb85837f651fa22e90b3c044842dc7f2c2842c086f295808" dependencies = [ "proc-macro2", "quote", - "syn 2.0.91", + "syn 2.0.93", "synstructure", ] @@ -4480,5 +4480,5 @@ checksum = "6eafa6dfb17584ea3e2bd6e76e0cc15ad7af12b09abdd1ca55961bed9b1063c6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.91", + "syn 2.0.93", ] From 43b20ea0afeb190505eeb246b4b9a0e85d6a4136 Mon Sep 17 00:00:00 2001 From: "oxide-reflector-bot[bot]" <130185838+oxide-reflector-bot[bot]@users.noreply.github.com> Date: Mon, 30 Dec 2024 16:04:47 +0000 Subject: [PATCH 02/17] Rebuilt with latest dependency updates --- Cargo.lock | 12 ++++++------ cli/tests/data/test_auth_status.stdout | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 5d1cf277..8e437c3f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2502,7 +2502,7 @@ dependencies = [ [[package]] name = "progenitor" version = "0.9.0" -source = "git+https://github.com/oxidecomputer/progenitor#865b8d575b26eaa02f3ec45cb87e447bfa2de10d" +source = "git+https://github.com/oxidecomputer/progenitor#74c5e1108665519506ed0b78d9330635e50f22ef" dependencies = [ "progenitor-impl", ] @@ -2525,7 +2525,7 @@ dependencies = [ [[package]] name = "progenitor-impl" version = "0.9.0" -source = "git+https://github.com/oxidecomputer/progenitor#865b8d575b26eaa02f3ec45cb87e447bfa2de10d" +source = "git+https://github.com/oxidecomputer/progenitor#74c5e1108665519506ed0b78d9330635e50f22ef" dependencies = [ "heck", "http 1.2.0", @@ -2996,18 +2996,18 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.216" +version = "1.0.217" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b9781016e935a97e8beecf0c933758c97a5520d32930e460142b4cd80c6338e" +checksum = "02fc4265df13d6fa1d00ecff087228cc0a2b5f3c0e87e258d8b94a156e984c70" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.216" +version = "1.0.217" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46f859dbbf73865c6627ed570e78961cd3ac92407a2d117204c49232485da55e" +checksum = "5a9bf7cf98d04a2b28aead066b7496853d4779c9cc183c440dbac457641e19a0" dependencies = [ "proc-macro2", "quote", diff --git a/cli/tests/data/test_auth_status.stdout b/cli/tests/data/test_auth_status.stdout index 8b382f00..7bb9694b 100644 --- a/cli/tests/data/test_auth_status.stdout +++ b/cli/tests/data/test_auth_status.stdout @@ -1,4 +1,4 @@ Profile "jennifer" () status: Authenticated Profile "lightman" () status: Authenticated Profile "malvin" () status: Server responded with an error message: ** IMPROPER REQUEST ** -Profile "sting" (https://unresolvabledomainnameihope) status: Failed to connect to server: \ No newline at end of file +Profile "sting" (https://unresolvabledomainnameihope) status: Request timed out From 511aefb7393d1a44806bc132b33e8160801446c8 Mon Sep 17 00:00:00 2001 From: "oxide-reflector-bot[bot]" <130185838+oxide-reflector-bot[bot]@users.noreply.github.com> Date: Tue, 31 Dec 2024 06:57:53 +0000 Subject: [PATCH 03/17] Rebuilt with latest dependency updates --- cli/tests/data/test_auth_status.stdout | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cli/tests/data/test_auth_status.stdout b/cli/tests/data/test_auth_status.stdout index 7bb9694b..8b382f00 100644 --- a/cli/tests/data/test_auth_status.stdout +++ b/cli/tests/data/test_auth_status.stdout @@ -1,4 +1,4 @@ Profile "jennifer" () status: Authenticated Profile "lightman" () status: Authenticated Profile "malvin" () status: Server responded with an error message: ** IMPROPER REQUEST ** -Profile "sting" (https://unresolvabledomainnameihope) status: Request timed out +Profile "sting" (https://unresolvabledomainnameihope) status: Failed to connect to server: \ No newline at end of file From 8319010bd06533789ca73bf0b16f3ea24254f63f Mon Sep 17 00:00:00 2001 From: "oxide-reflector-bot[bot]" <130185838+oxide-reflector-bot[bot]@users.noreply.github.com> Date: Mon, 6 Jan 2025 17:34:27 +0000 Subject: [PATCH 04/17] Rebuilt with latest dependency updates --- Cargo.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 5252e01a..25f27a7c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2502,7 +2502,7 @@ dependencies = [ [[package]] name = "progenitor" version = "0.9.0" -source = "git+https://github.com/oxidecomputer/progenitor#74c5e1108665519506ed0b78d9330635e50f22ef" +source = "git+https://github.com/oxidecomputer/progenitor#bc2ad0910c40eb4f8d9b3b07e1088a70e19dbc79" dependencies = [ "progenitor-impl", ] @@ -2525,7 +2525,7 @@ dependencies = [ [[package]] name = "progenitor-impl" version = "0.9.0" -source = "git+https://github.com/oxidecomputer/progenitor#74c5e1108665519506ed0b78d9330635e50f22ef" +source = "git+https://github.com/oxidecomputer/progenitor#bc2ad0910c40eb4f8d9b3b07e1088a70e19dbc79" dependencies = [ "heck", "http 1.2.0", From d5cafcdcb7cd771f1a488d43308031dad9aa0a31 Mon Sep 17 00:00:00 2001 From: "oxide-reflector-bot[bot]" <130185838+oxide-reflector-bot[bot]@users.noreply.github.com> Date: Mon, 6 Jan 2025 17:46:52 +0000 Subject: [PATCH 05/17] Rebuilt with latest dependency updates --- Cargo.lock | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 25f27a7c..0f476eb2 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2501,8 +2501,8 @@ dependencies = [ [[package]] name = "progenitor" -version = "0.9.0" -source = "git+https://github.com/oxidecomputer/progenitor#bc2ad0910c40eb4f8d9b3b07e1088a70e19dbc79" +version = "0.9.1" +source = "git+https://github.com/oxidecomputer/progenitor#3e41c75acbe5da36c42e120329fef1bc5904d5a7" dependencies = [ "progenitor-impl", ] @@ -2524,8 +2524,8 @@ dependencies = [ [[package]] name = "progenitor-impl" -version = "0.9.0" -source = "git+https://github.com/oxidecomputer/progenitor#bc2ad0910c40eb4f8d9b3b07e1088a70e19dbc79" +version = "0.9.1" +source = "git+https://github.com/oxidecomputer/progenitor#3e41c75acbe5da36c42e120329fef1bc5904d5a7" dependencies = [ "heck", "http 1.2.0", From 1db0c93a5aa61b9eba7b4bb9835aa5ffe74c5d9e Mon Sep 17 00:00:00 2001 From: "oxide-reflector-bot[bot]" <130185838+oxide-reflector-bot[bot]@users.noreply.github.com> Date: Mon, 6 Jan 2025 18:01:11 +0000 Subject: [PATCH 06/17] Rebuilt with latest dependency updates --- Cargo.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 712f973a..ae1996cb 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2502,7 +2502,7 @@ dependencies = [ [[package]] name = "progenitor" version = "0.9.1" -source = "git+https://github.com/oxidecomputer/progenitor#3e41c75acbe5da36c42e120329fef1bc5904d5a7" +source = "git+https://github.com/oxidecomputer/progenitor#3da48ad3caa517e5100cbb63ff2cae3bbc536c6f" dependencies = [ "progenitor-impl", ] @@ -2525,7 +2525,7 @@ dependencies = [ [[package]] name = "progenitor-impl" version = "0.9.1" -source = "git+https://github.com/oxidecomputer/progenitor#3e41c75acbe5da36c42e120329fef1bc5904d5a7" +source = "git+https://github.com/oxidecomputer/progenitor#3da48ad3caa517e5100cbb63ff2cae3bbc536c6f" dependencies = [ "heck", "http 1.2.0", From 2bbee3506b1ca40ec4046fa30534a970cf2f05fb Mon Sep 17 00:00:00 2001 From: "oxide-reflector-bot[bot]" <130185838+oxide-reflector-bot[bot]@users.noreply.github.com> Date: Mon, 6 Jan 2025 22:57:32 +0000 Subject: [PATCH 07/17] Rebuilt with latest dependency updates --- Cargo.lock | 62 +++++++++++++++++++++++++++--------------------------- 1 file changed, 31 insertions(+), 31 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index ae1996cb..ce4369c2 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -333,7 +333,7 @@ checksum = "c7c24de15d275a1ecfd47a380fb4d5ec9bfe0933f309ed5e705b775596a3574d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.93", + "syn 2.0.95", ] [[package]] @@ -350,7 +350,7 @@ checksum = "721cae7de5c34fbb2acd27e21e6d2cf7b886dce0c27388d46c4e6c47ea4318dd" dependencies = [ "proc-macro2", "quote", - "syn 2.0.93", + "syn 2.0.95", ] [[package]] @@ -593,7 +593,7 @@ dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.93", + "syn 2.0.95", ] [[package]] @@ -839,7 +839,7 @@ checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.93", + "syn 2.0.95", ] [[package]] @@ -910,7 +910,7 @@ dependencies = [ "semver", "serde", "serde_tokenstream", - "syn 2.0.93", + "syn 2.0.95", ] [[package]] @@ -1143,7 +1143,7 @@ checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" dependencies = [ "proc-macro2", "quote", - "syn 2.0.93", + "syn 2.0.95", ] [[package]] @@ -1650,7 +1650,7 @@ checksum = "1ec89e9337638ecdc08744df490b221a7399bf8d164eb52a665454e60e075ad6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.93", + "syn 2.0.95", ] [[package]] @@ -2168,7 +2168,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.93", + "syn 2.0.95", ] [[package]] @@ -2502,7 +2502,7 @@ dependencies = [ [[package]] name = "progenitor" version = "0.9.1" -source = "git+https://github.com/oxidecomputer/progenitor#3da48ad3caa517e5100cbb63ff2cae3bbc536c6f" +source = "git+https://github.com/oxidecomputer/progenitor#514a0b26c185351d28c5dff8470ce6801786b81a" dependencies = [ "progenitor-impl", ] @@ -2525,7 +2525,7 @@ dependencies = [ [[package]] name = "progenitor-impl" version = "0.9.1" -source = "git+https://github.com/oxidecomputer/progenitor#3da48ad3caa517e5100cbb63ff2cae3bbc536c6f" +source = "git+https://github.com/oxidecomputer/progenitor#514a0b26c185351d28c5dff8470ce6801786b81a" dependencies = [ "heck", "http 1.2.0", @@ -2537,7 +2537,7 @@ dependencies = [ "schemars", "serde", "serde_json", - "syn 2.0.93", + "syn 2.0.95", "thiserror 2.0.9", "typify", "unicode-ident", @@ -2954,7 +2954,7 @@ dependencies = [ "proc-macro2", "quote", "serde_derive_internals", - "syn 2.0.93", + "syn 2.0.95", ] [[package]] @@ -3012,7 +3012,7 @@ checksum = "5a9bf7cf98d04a2b28aead066b7496853d4779c9cc183c440dbac457641e19a0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.93", + "syn 2.0.95", ] [[package]] @@ -3023,7 +3023,7 @@ checksum = "18d26a20a969b9e3fdf2fc2d9f21eda6c40e2de84c9408bb5d3b05d499aae711" dependencies = [ "proc-macro2", "quote", - "syn 2.0.93", + "syn 2.0.95", ] [[package]] @@ -3076,7 +3076,7 @@ dependencies = [ "proc-macro2", "quote", "serde", - "syn 2.0.93", + "syn 2.0.95", ] [[package]] @@ -3266,7 +3266,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d904e7009df136af5297832a3ace3370cd14ff1546a232f4f185036c2736fcac" dependencies = [ "quote", - "syn 2.0.93", + "syn 2.0.95", ] [[package]] @@ -3319,7 +3319,7 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.93", + "syn 2.0.95", ] [[package]] @@ -3341,9 +3341,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.93" +version = "2.0.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c786062daee0d6db1132800e623df74274a0a87322d8e183338e01b3d98d058" +checksum = "46f71c0377baf4ef1cc3e3402ded576dccc315800fbc62dfc7fe04b009773b4a" dependencies = [ "proc-macro2", "quote", @@ -3367,7 +3367,7 @@ checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" dependencies = [ "proc-macro2", "quote", - "syn 2.0.93", + "syn 2.0.95", ] [[package]] @@ -3502,7 +3502,7 @@ checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.93", + "syn 2.0.95", ] [[package]] @@ -3513,7 +3513,7 @@ checksum = "7b50fa271071aae2e6ee85f842e2e28ba8cd2c5fb67f11fcb1fd70b276f9e7d4" dependencies = [ "proc-macro2", "quote", - "syn 2.0.93", + "syn 2.0.95", ] [[package]] @@ -3635,7 +3635,7 @@ checksum = "693d596312e88961bc67d7f1f97af8a70227d9f90c31bba5806eec004978d752" dependencies = [ "proc-macro2", "quote", - "syn 2.0.93", + "syn 2.0.95", ] [[package]] @@ -3843,7 +3843,7 @@ dependencies = [ "semver", "serde", "serde_json", - "syn 2.0.93", + "syn 2.0.95", "thiserror 2.0.9", "unicode-ident", ] @@ -3861,7 +3861,7 @@ dependencies = [ "serde", "serde_json", "serde_tokenstream", - "syn 2.0.93", + "syn 2.0.95", "typify-impl", ] @@ -4046,7 +4046,7 @@ dependencies = [ "log", "proc-macro2", "quote", - "syn 2.0.93", + "syn 2.0.95", "wasm-bindgen-shared", ] @@ -4081,7 +4081,7 @@ checksum = "30d7a95b763d3c45903ed6c81f156801839e5ee968bb07e534c44df0fcd330c2" dependencies = [ "proc-macro2", "quote", - "syn 2.0.93", + "syn 2.0.95", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -4431,7 +4431,7 @@ checksum = "2380878cad4ac9aac1e2435f3eb4020e8374b5f13c296cb75b4620ff8e229154" dependencies = [ "proc-macro2", "quote", - "syn 2.0.93", + "syn 2.0.95", "synstructure", ] @@ -4453,7 +4453,7 @@ checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.93", + "syn 2.0.95", ] [[package]] @@ -4473,7 +4473,7 @@ checksum = "595eed982f7d355beb85837f651fa22e90b3c044842dc7f2c2842c086f295808" dependencies = [ "proc-macro2", "quote", - "syn 2.0.93", + "syn 2.0.95", "synstructure", ] @@ -4502,5 +4502,5 @@ checksum = "6eafa6dfb17584ea3e2bd6e76e0cc15ad7af12b09abdd1ca55961bed9b1063c6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.93", + "syn 2.0.95", ] From d3026f6e9318643bc7157793de506d1dfd5fd45e Mon Sep 17 00:00:00 2001 From: "oxide-reflector-bot[bot]" <130185838+oxide-reflector-bot[bot]@users.noreply.github.com> Date: Mon, 6 Jan 2025 23:22:03 +0000 Subject: [PATCH 08/17] Rebuilt with latest dependency updates --- cli/src/generated_cli.rs | 470 +++++++++ oxide.json | 432 +++++++- sdk-httpmock/src/generated_httpmock.rs | 658 ++++++++++++ sdk/src/generated_sdk.rs | 1288 ++++++++++++++++++++++++ 4 files changed, 2836 insertions(+), 12 deletions(-) diff --git a/cli/src/generated_cli.rs b/cli/src/generated_cli.rs index cfee47a5..781086b3 100644 --- a/cli/src/generated_cli.rs +++ b/cli/src/generated_cli.rs @@ -20,6 +20,15 @@ impl Cli { CliCommand::ProbeCreate => Self::cli_probe_create(), CliCommand::ProbeView => Self::cli_probe_view(), CliCommand::ProbeDelete => Self::cli_probe_delete(), + CliCommand::SupportBundleList => Self::cli_support_bundle_list(), + CliCommand::SupportBundleCreate => Self::cli_support_bundle_create(), + CliCommand::SupportBundleView => Self::cli_support_bundle_view(), + CliCommand::SupportBundleDelete => Self::cli_support_bundle_delete(), + CliCommand::SupportBundleDownload => Self::cli_support_bundle_download(), + CliCommand::SupportBundleHead => Self::cli_support_bundle_head(), + CliCommand::SupportBundleDownloadFile => Self::cli_support_bundle_download_file(), + CliCommand::SupportBundleHeadFile => Self::cli_support_bundle_head_file(), + CliCommand::SupportBundleIndex => Self::cli_support_bundle_index(), CliCommand::LoginSaml => Self::cli_login_saml(), CliCommand::CertificateList => Self::cli_certificate_list(), CliCommand::CertificateCreate => Self::cli_certificate_create(), @@ -490,6 +499,135 @@ impl Cli { .about("Delete instrumentation probe") } + pub fn cli_support_bundle_list() -> ::clap::Command { + ::clap::Command::new("") + .arg( + ::clap::Arg::new("limit") + .long("limit") + .value_parser(::clap::value_parser!(std::num::NonZeroU32)) + .required(false) + .help("Maximum number of items returned by a single call"), + ) + .arg( + ::clap::Arg::new("sort-by") + .long("sort-by") + .value_parser(::clap::builder::TypedValueParser::map( + ::clap::builder::PossibleValuesParser::new([ + types::IdSortMode::IdAscending.to_string(), + ]), + |s| types::IdSortMode::try_from(s).unwrap(), + )) + .required(false), + ) + .about("List all support bundles") + } + + pub fn cli_support_bundle_create() -> ::clap::Command { + ::clap::Command::new("").about("Create a new support bundle") + } + + pub fn cli_support_bundle_view() -> ::clap::Command { + ::clap::Command::new("") + .arg( + ::clap::Arg::new("support-bundle") + .long("support-bundle") + .value_parser(::clap::value_parser!(uuid::Uuid)) + .required(true) + .help("ID of the support bundle"), + ) + .about("View a support bundle") + } + + pub fn cli_support_bundle_delete() -> ::clap::Command { + ::clap::Command::new("") + .arg( + ::clap::Arg::new("support-bundle") + .long("support-bundle") + .value_parser(::clap::value_parser!(uuid::Uuid)) + .required(true) + .help("ID of the support bundle"), + ) + .about("Delete an existing support bundle") + .long_about( + "May also be used to cancel a support bundle which is currently being collected, \ + or to remove metadata for a support bundle that has failed.", + ) + } + + pub fn cli_support_bundle_download() -> ::clap::Command { + ::clap::Command::new("") + .arg( + ::clap::Arg::new("support-bundle") + .long("support-bundle") + .value_parser(::clap::value_parser!(uuid::Uuid)) + .required(true) + .help("ID of the support bundle"), + ) + .about("Download the contents of a support bundle") + } + + pub fn cli_support_bundle_head() -> ::clap::Command { + ::clap::Command::new("") + .arg( + ::clap::Arg::new("support-bundle") + .long("support-bundle") + .value_parser(::clap::value_parser!(uuid::Uuid)) + .required(true) + .help("ID of the support bundle"), + ) + .about("Download the metadata of a support bundle") + } + + pub fn cli_support_bundle_download_file() -> ::clap::Command { + ::clap::Command::new("") + .arg( + ::clap::Arg::new("file") + .long("file") + .value_parser(::clap::value_parser!(::std::string::String)) + .required(true) + .help("The file within the bundle to download"), + ) + .arg( + ::clap::Arg::new("support-bundle") + .long("support-bundle") + .value_parser(::clap::value_parser!(uuid::Uuid)) + .required(true) + .help("ID of the support bundle"), + ) + .about("Download a file within a support bundle") + } + + pub fn cli_support_bundle_head_file() -> ::clap::Command { + ::clap::Command::new("") + .arg( + ::clap::Arg::new("file") + .long("file") + .value_parser(::clap::value_parser!(::std::string::String)) + .required(true) + .help("The file within the bundle to download"), + ) + .arg( + ::clap::Arg::new("support-bundle") + .long("support-bundle") + .value_parser(::clap::value_parser!(uuid::Uuid)) + .required(true) + .help("ID of the support bundle"), + ) + .about("Download the metadata of a file within the support bundle") + } + + pub fn cli_support_bundle_index() -> ::clap::Command { + ::clap::Command::new("") + .arg( + ::clap::Arg::new("support-bundle") + .long("support-bundle") + .value_parser(::clap::value_parser!(uuid::Uuid)) + .required(true) + .help("ID of the support bundle"), + ) + .about("Download the index of a support bundle") + } + pub fn cli_login_saml() -> ::clap::Command { ::clap::Command::new("") .arg( @@ -6634,6 +6772,21 @@ impl Cli { CliCommand::ProbeCreate => self.execute_probe_create(matches).await, CliCommand::ProbeView => self.execute_probe_view(matches).await, CliCommand::ProbeDelete => self.execute_probe_delete(matches).await, + CliCommand::SupportBundleList => self.execute_support_bundle_list(matches).await, + CliCommand::SupportBundleCreate => self.execute_support_bundle_create(matches).await, + CliCommand::SupportBundleView => self.execute_support_bundle_view(matches).await, + CliCommand::SupportBundleDelete => self.execute_support_bundle_delete(matches).await, + CliCommand::SupportBundleDownload => { + self.execute_support_bundle_download(matches).await + } + CliCommand::SupportBundleHead => self.execute_support_bundle_head(matches).await, + CliCommand::SupportBundleDownloadFile => { + self.execute_support_bundle_download_file(matches).await + } + CliCommand::SupportBundleHeadFile => { + self.execute_support_bundle_head_file(matches).await + } + CliCommand::SupportBundleIndex => self.execute_support_bundle_index(matches).await, CliCommand::LoginSaml => self.execute_login_saml(matches).await, CliCommand::CertificateList => self.execute_certificate_list(matches).await, CliCommand::CertificateCreate => self.execute_certificate_create(matches).await, @@ -7214,6 +7367,233 @@ impl Cli { } } + pub async fn execute_support_bundle_list( + &self, + matches: &::clap::ArgMatches, + ) -> anyhow::Result<()> { + let mut request = self.client.support_bundle_list(); + if let Some(value) = matches.get_one::("limit") { + request = request.limit(value.clone()); + } + + if let Some(value) = matches.get_one::("sort-by") { + request = request.sort_by(value.clone()); + } + + self.config + .execute_support_bundle_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_support_bundle_create( + &self, + matches: &::clap::ArgMatches, + ) -> anyhow::Result<()> { + let mut request = self.client.support_bundle_create(); + self.config + .execute_support_bundle_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_support_bundle_view( + &self, + matches: &::clap::ArgMatches, + ) -> anyhow::Result<()> { + let mut request = self.client.support_bundle_view(); + if let Some(value) = matches.get_one::("support-bundle") { + request = request.support_bundle(value.clone()); + } + + self.config + .execute_support_bundle_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_support_bundle_delete( + &self, + matches: &::clap::ArgMatches, + ) -> anyhow::Result<()> { + let mut request = self.client.support_bundle_delete(); + if let Some(value) = matches.get_one::("support-bundle") { + request = request.support_bundle(value.clone()); + } + + self.config + .execute_support_bundle_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_support_bundle_download( + &self, + matches: &::clap::ArgMatches, + ) -> anyhow::Result<()> { + let mut request = self.client.support_bundle_download(); + if let Some(value) = matches.get_one::("support-bundle") { + request = request.support_bundle(value.clone()); + } + + self.config + .execute_support_bundle_download(matches, &mut request)?; + let result = request.send().await; + match result { + Ok(r) => { + todo!() + } + Err(r) => { + todo!() + } + } + } + + pub async fn execute_support_bundle_head( + &self, + matches: &::clap::ArgMatches, + ) -> anyhow::Result<()> { + let mut request = self.client.support_bundle_head(); + if let Some(value) = matches.get_one::("support-bundle") { + request = request.support_bundle(value.clone()); + } + + self.config + .execute_support_bundle_head(matches, &mut request)?; + let result = request.send().await; + match result { + Ok(r) => { + todo!() + } + Err(r) => { + todo!() + } + } + } + + pub async fn execute_support_bundle_download_file( + &self, + matches: &::clap::ArgMatches, + ) -> anyhow::Result<()> { + let mut request = self.client.support_bundle_download_file(); + if let Some(value) = matches.get_one::<::std::string::String>("file") { + request = request.file(value.clone()); + } + + if let Some(value) = matches.get_one::("support-bundle") { + request = request.support_bundle(value.clone()); + } + + self.config + .execute_support_bundle_download_file(matches, &mut request)?; + let result = request.send().await; + match result { + Ok(r) => { + todo!() + } + Err(r) => { + todo!() + } + } + } + + pub async fn execute_support_bundle_head_file( + &self, + matches: &::clap::ArgMatches, + ) -> anyhow::Result<()> { + let mut request = self.client.support_bundle_head_file(); + if let Some(value) = matches.get_one::<::std::string::String>("file") { + request = request.file(value.clone()); + } + + if let Some(value) = matches.get_one::("support-bundle") { + request = request.support_bundle(value.clone()); + } + + self.config + .execute_support_bundle_head_file(matches, &mut request)?; + let result = request.send().await; + match result { + Ok(r) => { + todo!() + } + Err(r) => { + todo!() + } + } + } + + pub async fn execute_support_bundle_index( + &self, + matches: &::clap::ArgMatches, + ) -> anyhow::Result<()> { + let mut request = self.client.support_bundle_index(); + if let Some(value) = matches.get_one::("support-bundle") { + request = request.support_bundle(value.clone()); + } + + self.config + .execute_support_bundle_index(matches, &mut request)?; + let result = request.send().await; + match result { + Ok(r) => { + todo!() + } + Err(r) => { + todo!() + } + } + } + pub async fn execute_login_saml(&self, matches: &::clap::ArgMatches) -> anyhow::Result<()> { let mut request = self.client.login_saml(); if let Some(value) = matches.get_one::("provider-name") { @@ -14200,6 +14580,78 @@ pub trait CliConfig { Ok(()) } + fn execute_support_bundle_list( + &self, + matches: &::clap::ArgMatches, + request: &mut builder::SupportBundleList, + ) -> anyhow::Result<()> { + Ok(()) + } + + fn execute_support_bundle_create( + &self, + matches: &::clap::ArgMatches, + request: &mut builder::SupportBundleCreate, + ) -> anyhow::Result<()> { + Ok(()) + } + + fn execute_support_bundle_view( + &self, + matches: &::clap::ArgMatches, + request: &mut builder::SupportBundleView, + ) -> anyhow::Result<()> { + Ok(()) + } + + fn execute_support_bundle_delete( + &self, + matches: &::clap::ArgMatches, + request: &mut builder::SupportBundleDelete, + ) -> anyhow::Result<()> { + Ok(()) + } + + fn execute_support_bundle_download( + &self, + matches: &::clap::ArgMatches, + request: &mut builder::SupportBundleDownload, + ) -> anyhow::Result<()> { + Ok(()) + } + + fn execute_support_bundle_head( + &self, + matches: &::clap::ArgMatches, + request: &mut builder::SupportBundleHead, + ) -> anyhow::Result<()> { + Ok(()) + } + + fn execute_support_bundle_download_file( + &self, + matches: &::clap::ArgMatches, + request: &mut builder::SupportBundleDownloadFile, + ) -> anyhow::Result<()> { + Ok(()) + } + + fn execute_support_bundle_head_file( + &self, + matches: &::clap::ArgMatches, + request: &mut builder::SupportBundleHeadFile, + ) -> anyhow::Result<()> { + Ok(()) + } + + fn execute_support_bundle_index( + &self, + matches: &::clap::ArgMatches, + request: &mut builder::SupportBundleIndex, + ) -> anyhow::Result<()> { + Ok(()) + } + fn execute_login_saml( &self, matches: &::clap::ArgMatches, @@ -15826,6 +16278,15 @@ pub enum CliCommand { ProbeCreate, ProbeView, ProbeDelete, + SupportBundleList, + SupportBundleCreate, + SupportBundleView, + SupportBundleDelete, + SupportBundleDownload, + SupportBundleHead, + SupportBundleDownloadFile, + SupportBundleHeadFile, + SupportBundleIndex, LoginSaml, CertificateList, CertificateCreate, @@ -16040,6 +16501,15 @@ impl CliCommand { CliCommand::ProbeCreate, CliCommand::ProbeView, CliCommand::ProbeDelete, + CliCommand::SupportBundleList, + CliCommand::SupportBundleCreate, + CliCommand::SupportBundleView, + CliCommand::SupportBundleDelete, + CliCommand::SupportBundleDownload, + CliCommand::SupportBundleHead, + CliCommand::SupportBundleDownloadFile, + CliCommand::SupportBundleHeadFile, + CliCommand::SupportBundleIndex, CliCommand::LoginSaml, CliCommand::CertificateList, CliCommand::CertificateCreate, diff --git a/oxide.json b/oxide.json index c0b6a96f..bc043059 100644 --- a/oxide.json +++ b/oxide.json @@ -301,6 +301,329 @@ } } }, + "/experimental/v1/system/support-bundles": { + "get": { + "tags": [ + "hidden" + ], + "summary": "List all support bundles", + "operationId": "support_bundle_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/IdSortMode" + } + } + ], + "responses": { + "200": { + "description": "successful operation", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SupportBundleInfoResultsPage" + } + } + } + }, + "4XX": { + "$ref": "#/components/responses/Error" + }, + "5XX": { + "$ref": "#/components/responses/Error" + } + }, + "x-dropshot-pagination": { + "required": [] + } + }, + "post": { + "tags": [ + "hidden" + ], + "summary": "Create a new support bundle", + "operationId": "support_bundle_create", + "responses": { + "201": { + "description": "successful creation", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SupportBundleInfo" + } + } + } + }, + "4XX": { + "$ref": "#/components/responses/Error" + }, + "5XX": { + "$ref": "#/components/responses/Error" + } + } + } + }, + "/experimental/v1/system/support-bundles/{support_bundle}": { + "get": { + "tags": [ + "hidden" + ], + "summary": "View a support bundle", + "operationId": "support_bundle_view", + "parameters": [ + { + "in": "path", + "name": "support_bundle", + "description": "ID of the support bundle", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "successful operation", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SupportBundleInfo" + } + } + } + }, + "4XX": { + "$ref": "#/components/responses/Error" + }, + "5XX": { + "$ref": "#/components/responses/Error" + } + } + }, + "delete": { + "tags": [ + "hidden" + ], + "summary": "Delete an existing support bundle", + "description": "May also be used to cancel a support bundle which is currently being collected, or to remove metadata for a support bundle that has failed.", + "operationId": "support_bundle_delete", + "parameters": [ + { + "in": "path", + "name": "support_bundle", + "description": "ID of the support bundle", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "204": { + "description": "successful deletion" + }, + "4XX": { + "$ref": "#/components/responses/Error" + }, + "5XX": { + "$ref": "#/components/responses/Error" + } + } + } + }, + "/experimental/v1/system/support-bundles/{support_bundle}/download": { + "get": { + "tags": [ + "hidden" + ], + "summary": "Download the contents of a support bundle", + "operationId": "support_bundle_download", + "parameters": [ + { + "in": "path", + "name": "support_bundle", + "description": "ID of the support bundle", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "default": { + "description": "", + "content": { + "*/*": { + "schema": {} + } + } + } + } + }, + "head": { + "tags": [ + "hidden" + ], + "summary": "Download the metadata of a support bundle", + "operationId": "support_bundle_head", + "parameters": [ + { + "in": "path", + "name": "support_bundle", + "description": "ID of the support bundle", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "default": { + "description": "", + "content": { + "*/*": { + "schema": {} + } + } + } + } + } + }, + "/experimental/v1/system/support-bundles/{support_bundle}/download/{file}": { + "get": { + "tags": [ + "hidden" + ], + "summary": "Download a file within a support bundle", + "operationId": "support_bundle_download_file", + "parameters": [ + { + "in": "path", + "name": "file", + "description": "The file within the bundle to download", + "required": true, + "schema": { + "type": "string" + } + }, + { + "in": "path", + "name": "support_bundle", + "description": "ID of the support bundle", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "default": { + "description": "", + "content": { + "*/*": { + "schema": {} + } + } + } + } + }, + "head": { + "tags": [ + "hidden" + ], + "summary": "Download the metadata of a file within the support bundle", + "operationId": "support_bundle_head_file", + "parameters": [ + { + "in": "path", + "name": "file", + "description": "The file within the bundle to download", + "required": true, + "schema": { + "type": "string" + } + }, + { + "in": "path", + "name": "support_bundle", + "description": "ID of the support bundle", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "default": { + "description": "", + "content": { + "*/*": { + "schema": {} + } + } + } + } + } + }, + "/experimental/v1/system/support-bundles/{support_bundle}/index": { + "get": { + "tags": [ + "hidden" + ], + "summary": "Download the index of a support bundle", + "operationId": "support_bundle_index", + "parameters": [ + { + "in": "path", + "name": "support_bundle", + "description": "ID of the support bundle", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "default": { + "description": "", + "content": { + "*/*": { + "schema": {} + } + } + } + } + } + }, "/login/{silo_name}/saml/{provider_name}": { "post": { "tags": [ @@ -20059,6 +20382,87 @@ "items" ] }, + "SupportBundleInfo": { + "type": "object", + "properties": { + "id": { + "$ref": "#/components/schemas/TypedUuidForSupportBundleKind" + }, + "reason_for_creation": { + "type": "string" + }, + "reason_for_failure": { + "nullable": true, + "type": "string" + }, + "state": { + "$ref": "#/components/schemas/SupportBundleState" + }, + "time_created": { + "type": "string", + "format": "date-time" + } + }, + "required": [ + "id", + "reason_for_creation", + "state", + "time_created" + ] + }, + "SupportBundleInfoResultsPage": { + "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/SupportBundleInfo" + } + }, + "next_page": { + "nullable": true, + "description": "token used to fetch the next page of results (if any)", + "type": "string" + } + }, + "required": [ + "items" + ] + }, + "SupportBundleState": { + "oneOf": [ + { + "description": "Support Bundle still actively being collected.\n\nThis is the initial state for a Support Bundle, and it will automatically transition to either \"Failing\" or \"Active\".\n\nIf a user no longer wants to access a Support Bundle, they can request cancellation, which will transition to the \"Destroying\" state.", + "type": "string", + "enum": [ + "collecting" + ] + }, + { + "description": "Support Bundle is being destroyed.\n\nOnce backing storage has been freed, this bundle is destroyed.", + "type": "string", + "enum": [ + "destroying" + ] + }, + { + "description": "Support Bundle was not created successfully, or was created and has lost backing storage.\n\nThe record of the bundle still exists for readability, but the only valid operation on these bundles is to destroy them.", + "type": "string", + "enum": [ + "failed" + ] + }, + { + "description": "Support Bundle has been processed, and is ready for usage.", + "type": "string", + "enum": [ + "active" + ] + } + ] + }, "Switch": { "description": "An operator's view of a Switch.", "type": "object", @@ -21073,6 +21477,10 @@ } } }, + "TypedUuidForSupportBundleKind": { + "type": "string", + "format": "uuid" + }, "UninitializedSled": { "description": "A sled that has not been added to an initialized rack yet", "type": "object", @@ -22509,6 +22917,18 @@ } ] }, + "IdSortMode": { + "description": "Supported set of sort modes for scanning by id only.\n\nCurrently, we only support scanning in ascending order.", + "oneOf": [ + { + "description": "sort in increasing order of \"id\"", + "type": "string", + "enum": [ + "id_ascending" + ] + } + ] + }, "DiskMetricName": { "type": "string", "enum": [ @@ -22528,18 +22948,6 @@ "descending" ] }, - "IdSortMode": { - "description": "Supported set of sort modes for scanning by id only.\n\nCurrently, we only support scanning in ascending order.", - "oneOf": [ - { - "description": "sort in increasing order of \"id\"", - "type": "string", - "enum": [ - "id_ascending" - ] - } - ] - }, "SystemMetricName": { "type": "string", "enum": [ diff --git a/sdk-httpmock/src/generated_httpmock.rs b/sdk-httpmock/src/generated_httpmock.rs index 73c304a2..57c46f4f 100644 --- a/sdk-httpmock/src/generated_httpmock.rs +++ b/sdk-httpmock/src/generated_httpmock.rs @@ -445,6 +445,523 @@ pub mod operations { } } + pub struct SupportBundleListWhen(::httpmock::When); + impl SupportBundleListWhen { + pub fn new(inner: ::httpmock::When) -> Self { + Self(inner.method(::httpmock::Method::GET).path_matches( + regex::Regex::new("^/experimental/v1/system/support-bundles$").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 SupportBundleListThen(::httpmock::Then); + impl SupportBundleListThen { + pub fn new(inner: ::httpmock::Then) -> Self { + Self(inner) + } + + pub fn into_inner(self) -> ::httpmock::Then { + self.0 + } + + pub fn ok(self, value: &types::SupportBundleInfoResultsPage) -> 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 SupportBundleCreateWhen(::httpmock::When); + impl SupportBundleCreateWhen { + pub fn new(inner: ::httpmock::When) -> Self { + Self(inner.method(::httpmock::Method::POST).path_matches( + regex::Regex::new("^/experimental/v1/system/support-bundles$").unwrap(), + )) + } + + pub fn into_inner(self) -> ::httpmock::When { + self.0 + } + } + + pub struct SupportBundleCreateThen(::httpmock::Then); + impl SupportBundleCreateThen { + pub fn new(inner: ::httpmock::Then) -> Self { + Self(inner) + } + + pub fn into_inner(self) -> ::httpmock::Then { + self.0 + } + + pub fn created(self, value: &types::SupportBundleInfo) -> 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 SupportBundleViewWhen(::httpmock::When); + impl SupportBundleViewWhen { + pub fn new(inner: ::httpmock::When) -> Self { + Self(inner.method(::httpmock::Method::GET).path_matches( + regex::Regex::new("^/experimental/v1/system/support-bundles/[^/]*$").unwrap(), + )) + } + + pub fn into_inner(self) -> ::httpmock::When { + self.0 + } + + pub fn support_bundle(self, value: &uuid::Uuid) -> Self { + let re = regex::Regex::new(&format!( + "^/experimental/v1/system/support-bundles/{}$", + value.to_string() + )) + .unwrap(); + Self(self.0.path_matches(re)) + } + } + + pub struct SupportBundleViewThen(::httpmock::Then); + impl SupportBundleViewThen { + pub fn new(inner: ::httpmock::Then) -> Self { + Self(inner) + } + + pub fn into_inner(self) -> ::httpmock::Then { + self.0 + } + + pub fn ok(self, value: &types::SupportBundleInfo) -> 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 SupportBundleDeleteWhen(::httpmock::When); + impl SupportBundleDeleteWhen { + pub fn new(inner: ::httpmock::When) -> Self { + Self(inner.method(::httpmock::Method::DELETE).path_matches( + regex::Regex::new("^/experimental/v1/system/support-bundles/[^/]*$").unwrap(), + )) + } + + pub fn into_inner(self) -> ::httpmock::When { + self.0 + } + + pub fn support_bundle(self, value: &uuid::Uuid) -> Self { + let re = regex::Regex::new(&format!( + "^/experimental/v1/system/support-bundles/{}$", + value.to_string() + )) + .unwrap(); + Self(self.0.path_matches(re)) + } + } + + pub struct SupportBundleDeleteThen(::httpmock::Then); + impl SupportBundleDeleteThen { + 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 SupportBundleDownloadWhen(::httpmock::When); + impl SupportBundleDownloadWhen { + pub fn new(inner: ::httpmock::When) -> Self { + Self( + inner.method(::httpmock::Method::GET).path_matches( + regex::Regex::new("^/experimental/v1/system/support-bundles/[^/]*/download$") + .unwrap(), + ), + ) + } + + pub fn into_inner(self) -> ::httpmock::When { + self.0 + } + + pub fn support_bundle(self, value: &uuid::Uuid) -> Self { + let re = regex::Regex::new(&format!( + "^/experimental/v1/system/support-bundles/{}/download$", + value.to_string() + )) + .unwrap(); + Self(self.0.path_matches(re)) + } + } + + pub struct SupportBundleDownloadThen(::httpmock::Then); + impl SupportBundleDownloadThen { + pub fn new(inner: ::httpmock::Then) -> Self { + Self(inner) + } + + pub fn into_inner(self) -> ::httpmock::Then { + self.0 + } + + pub fn default_response(self, status: u16, value: serde_json::Value) -> Self { + Self( + self.0 + .status(status) + .header("content-type", "application/json") + .json_body(value), + ) + } + } + + pub struct SupportBundleHeadWhen(::httpmock::When); + impl SupportBundleHeadWhen { + pub fn new(inner: ::httpmock::When) -> Self { + Self( + inner.method(::httpmock::Method::HEAD).path_matches( + regex::Regex::new("^/experimental/v1/system/support-bundles/[^/]*/download$") + .unwrap(), + ), + ) + } + + pub fn into_inner(self) -> ::httpmock::When { + self.0 + } + + pub fn support_bundle(self, value: &uuid::Uuid) -> Self { + let re = regex::Regex::new(&format!( + "^/experimental/v1/system/support-bundles/{}/download$", + value.to_string() + )) + .unwrap(); + Self(self.0.path_matches(re)) + } + } + + pub struct SupportBundleHeadThen(::httpmock::Then); + impl SupportBundleHeadThen { + pub fn new(inner: ::httpmock::Then) -> Self { + Self(inner) + } + + pub fn into_inner(self) -> ::httpmock::Then { + self.0 + } + + pub fn default_response(self, status: u16, value: serde_json::Value) -> Self { + Self( + self.0 + .status(status) + .header("content-type", "application/json") + .json_body(value), + ) + } + } + + pub struct SupportBundleDownloadFileWhen(::httpmock::When); + impl SupportBundleDownloadFileWhen { + pub fn new(inner: ::httpmock::When) -> Self { + Self( + inner.method(::httpmock::Method::GET).path_matches( + regex::Regex::new( + "^/experimental/v1/system/support-bundles/[^/]*/download/[^/]*$", + ) + .unwrap(), + ), + ) + } + + pub fn into_inner(self) -> ::httpmock::When { + self.0 + } + + pub fn support_bundle(self, value: &uuid::Uuid) -> Self { + let re = regex::Regex::new(&format!( + "^/experimental/v1/system/support-bundles/{}/download/.*$", + value.to_string() + )) + .unwrap(); + Self(self.0.path_matches(re)) + } + + pub fn file(self, value: &str) -> Self { + let re = regex::Regex::new(&format!( + "^/experimental/v1/system/support-bundles/.*/download/{}$", + value.to_string() + )) + .unwrap(); + Self(self.0.path_matches(re)) + } + } + + pub struct SupportBundleDownloadFileThen(::httpmock::Then); + impl SupportBundleDownloadFileThen { + pub fn new(inner: ::httpmock::Then) -> Self { + Self(inner) + } + + pub fn into_inner(self) -> ::httpmock::Then { + self.0 + } + + pub fn default_response(self, status: u16, value: serde_json::Value) -> Self { + Self( + self.0 + .status(status) + .header("content-type", "application/json") + .json_body(value), + ) + } + } + + pub struct SupportBundleHeadFileWhen(::httpmock::When); + impl SupportBundleHeadFileWhen { + pub fn new(inner: ::httpmock::When) -> Self { + Self( + inner.method(::httpmock::Method::HEAD).path_matches( + regex::Regex::new( + "^/experimental/v1/system/support-bundles/[^/]*/download/[^/]*$", + ) + .unwrap(), + ), + ) + } + + pub fn into_inner(self) -> ::httpmock::When { + self.0 + } + + pub fn support_bundle(self, value: &uuid::Uuid) -> Self { + let re = regex::Regex::new(&format!( + "^/experimental/v1/system/support-bundles/{}/download/.*$", + value.to_string() + )) + .unwrap(); + Self(self.0.path_matches(re)) + } + + pub fn file(self, value: &str) -> Self { + let re = regex::Regex::new(&format!( + "^/experimental/v1/system/support-bundles/.*/download/{}$", + value.to_string() + )) + .unwrap(); + Self(self.0.path_matches(re)) + } + } + + pub struct SupportBundleHeadFileThen(::httpmock::Then); + impl SupportBundleHeadFileThen { + pub fn new(inner: ::httpmock::Then) -> Self { + Self(inner) + } + + pub fn into_inner(self) -> ::httpmock::Then { + self.0 + } + + pub fn default_response(self, status: u16, value: serde_json::Value) -> Self { + Self( + self.0 + .status(status) + .header("content-type", "application/json") + .json_body(value), + ) + } + } + + pub struct SupportBundleIndexWhen(::httpmock::When); + impl SupportBundleIndexWhen { + pub fn new(inner: ::httpmock::When) -> Self { + Self(inner.method(::httpmock::Method::GET).path_matches( + regex::Regex::new("^/experimental/v1/system/support-bundles/[^/]*/index$").unwrap(), + )) + } + + pub fn into_inner(self) -> ::httpmock::When { + self.0 + } + + pub fn support_bundle(self, value: &uuid::Uuid) -> Self { + let re = regex::Regex::new(&format!( + "^/experimental/v1/system/support-bundles/{}/index$", + value.to_string() + )) + .unwrap(); + Self(self.0.path_matches(re)) + } + } + + pub struct SupportBundleIndexThen(::httpmock::Then); + impl SupportBundleIndexThen { + pub fn new(inner: ::httpmock::Then) -> Self { + Self(inner) + } + + pub fn into_inner(self) -> ::httpmock::Then { + self.0 + } + + pub fn default_response(self, status: u16, value: serde_json::Value) -> Self { + Self( + self.0 + .status(status) + .header("content-type", "application/json") + .json_body(value), + ) + } + } + pub struct LoginSamlWhen(::httpmock::When); impl LoginSamlWhen { pub fn new(inner: ::httpmock::When) -> Self { @@ -17053,6 +17570,36 @@ pub trait MockServerExt { fn probe_delete(&self, config_fn: F) -> ::httpmock::Mock where F: FnOnce(operations::ProbeDeleteWhen, operations::ProbeDeleteThen); + fn support_bundle_list(&self, config_fn: F) -> ::httpmock::Mock + where + F: FnOnce(operations::SupportBundleListWhen, operations::SupportBundleListThen); + fn support_bundle_create(&self, config_fn: F) -> ::httpmock::Mock + where + F: FnOnce(operations::SupportBundleCreateWhen, operations::SupportBundleCreateThen); + fn support_bundle_view(&self, config_fn: F) -> ::httpmock::Mock + where + F: FnOnce(operations::SupportBundleViewWhen, operations::SupportBundleViewThen); + fn support_bundle_delete(&self, config_fn: F) -> ::httpmock::Mock + where + F: FnOnce(operations::SupportBundleDeleteWhen, operations::SupportBundleDeleteThen); + fn support_bundle_download(&self, config_fn: F) -> ::httpmock::Mock + where + F: FnOnce(operations::SupportBundleDownloadWhen, operations::SupportBundleDownloadThen); + fn support_bundle_head(&self, config_fn: F) -> ::httpmock::Mock + where + F: FnOnce(operations::SupportBundleHeadWhen, operations::SupportBundleHeadThen); + fn support_bundle_download_file(&self, config_fn: F) -> ::httpmock::Mock + where + F: FnOnce( + operations::SupportBundleDownloadFileWhen, + operations::SupportBundleDownloadFileThen, + ); + fn support_bundle_head_file(&self, config_fn: F) -> ::httpmock::Mock + where + F: FnOnce(operations::SupportBundleHeadFileWhen, operations::SupportBundleHeadFileThen); + fn support_bundle_index(&self, config_fn: F) -> ::httpmock::Mock + where + F: FnOnce(operations::SupportBundleIndexWhen, operations::SupportBundleIndexThen); fn login_saml(&self, config_fn: F) -> ::httpmock::Mock where F: FnOnce(operations::LoginSamlWhen, operations::LoginSamlThen); @@ -17884,6 +18431,117 @@ impl MockServerExt for ::httpmock::MockServer { }) } + fn support_bundle_list(&self, config_fn: F) -> ::httpmock::Mock + where + F: FnOnce(operations::SupportBundleListWhen, operations::SupportBundleListThen), + { + self.mock(|when, then| { + config_fn( + operations::SupportBundleListWhen::new(when), + operations::SupportBundleListThen::new(then), + ) + }) + } + + fn support_bundle_create(&self, config_fn: F) -> ::httpmock::Mock + where + F: FnOnce(operations::SupportBundleCreateWhen, operations::SupportBundleCreateThen), + { + self.mock(|when, then| { + config_fn( + operations::SupportBundleCreateWhen::new(when), + operations::SupportBundleCreateThen::new(then), + ) + }) + } + + fn support_bundle_view(&self, config_fn: F) -> ::httpmock::Mock + where + F: FnOnce(operations::SupportBundleViewWhen, operations::SupportBundleViewThen), + { + self.mock(|when, then| { + config_fn( + operations::SupportBundleViewWhen::new(when), + operations::SupportBundleViewThen::new(then), + ) + }) + } + + fn support_bundle_delete(&self, config_fn: F) -> ::httpmock::Mock + where + F: FnOnce(operations::SupportBundleDeleteWhen, operations::SupportBundleDeleteThen), + { + self.mock(|when, then| { + config_fn( + operations::SupportBundleDeleteWhen::new(when), + operations::SupportBundleDeleteThen::new(then), + ) + }) + } + + fn support_bundle_download(&self, config_fn: F) -> ::httpmock::Mock + where + F: FnOnce(operations::SupportBundleDownloadWhen, operations::SupportBundleDownloadThen), + { + self.mock(|when, then| { + config_fn( + operations::SupportBundleDownloadWhen::new(when), + operations::SupportBundleDownloadThen::new(then), + ) + }) + } + + fn support_bundle_head(&self, config_fn: F) -> ::httpmock::Mock + where + F: FnOnce(operations::SupportBundleHeadWhen, operations::SupportBundleHeadThen), + { + self.mock(|when, then| { + config_fn( + operations::SupportBundleHeadWhen::new(when), + operations::SupportBundleHeadThen::new(then), + ) + }) + } + + fn support_bundle_download_file(&self, config_fn: F) -> ::httpmock::Mock + where + F: FnOnce( + operations::SupportBundleDownloadFileWhen, + operations::SupportBundleDownloadFileThen, + ), + { + self.mock(|when, then| { + config_fn( + operations::SupportBundleDownloadFileWhen::new(when), + operations::SupportBundleDownloadFileThen::new(then), + ) + }) + } + + fn support_bundle_head_file(&self, config_fn: F) -> ::httpmock::Mock + where + F: FnOnce(operations::SupportBundleHeadFileWhen, operations::SupportBundleHeadFileThen), + { + self.mock(|when, then| { + config_fn( + operations::SupportBundleHeadFileWhen::new(when), + operations::SupportBundleHeadFileThen::new(then), + ) + }) + } + + fn support_bundle_index(&self, config_fn: F) -> ::httpmock::Mock + where + F: FnOnce(operations::SupportBundleIndexWhen, operations::SupportBundleIndexThen), + { + self.mock(|when, then| { + config_fn( + operations::SupportBundleIndexWhen::new(when), + operations::SupportBundleIndexThen::new(then), + ) + }) + } + fn login_saml(&self, config_fn: F) -> ::httpmock::Mock where F: FnOnce(operations::LoginSamlWhen, operations::LoginSamlThen), diff --git a/sdk/src/generated_sdk.rs b/sdk/src/generated_sdk.rs index 2363be38..1b27acac 100644 --- a/sdk/src/generated_sdk.rs +++ b/sdk/src/generated_sdk.rs @@ -22822,6 +22822,265 @@ pub mod types { } } + /// SupportBundleInfo + /// + ///
JSON schema + /// + /// ```json + /// { + /// "type": "object", + /// "required": [ + /// "id", + /// "reason_for_creation", + /// "state", + /// "time_created" + /// ], + /// "properties": { + /// "id": { + /// "$ref": "#/components/schemas/TypedUuidForSupportBundleKind" + /// }, + /// "reason_for_creation": { + /// "type": "string" + /// }, + /// "reason_for_failure": { + /// "type": [ + /// "string", + /// "null" + /// ] + /// }, + /// "state": { + /// "$ref": "#/components/schemas/SupportBundleState" + /// }, + /// "time_created": { + /// "type": "string", + /// "format": "date-time" + /// } + /// } + /// } + /// ``` + ///
+ #[derive( + :: serde :: Deserialize, :: serde :: Serialize, Clone, Debug, schemars :: JsonSchema, + )] + pub struct SupportBundleInfo { + pub id: TypedUuidForSupportBundleKind, + pub reason_for_creation: ::std::string::String, + #[serde(default, skip_serializing_if = "::std::option::Option::is_none")] + pub reason_for_failure: ::std::option::Option<::std::string::String>, + pub state: SupportBundleState, + pub time_created: chrono::DateTime, + } + + impl ::std::convert::From<&SupportBundleInfo> for SupportBundleInfo { + fn from(value: &SupportBundleInfo) -> Self { + value.clone() + } + } + + impl SupportBundleInfo { + pub fn builder() -> builder::SupportBundleInfo { + 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/SupportBundleInfo" + /// } + /// }, + /// "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 SupportBundleInfoResultsPage { + /// 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<&SupportBundleInfoResultsPage> for SupportBundleInfoResultsPage { + fn from(value: &SupportBundleInfoResultsPage) -> Self { + value.clone() + } + } + + impl SupportBundleInfoResultsPage { + pub fn builder() -> builder::SupportBundleInfoResultsPage { + Default::default() + } + } + + /// SupportBundleState + /// + ///
JSON schema + /// + /// ```json + /// { + /// "oneOf": [ + /// { + /// "description": "Support Bundle still actively being + /// collected.\n\nThis is the initial state for a Support Bundle, and it + /// will automatically transition to either \"Failing\" or \"Active\".\n\nIf + /// a user no longer wants to access a Support Bundle, they can request + /// cancellation, which will transition to the \"Destroying\" state.", + /// "type": "string", + /// "enum": [ + /// "collecting" + /// ] + /// }, + /// { + /// "description": "Support Bundle is being destroyed.\n\nOnce backing + /// storage has been freed, this bundle is destroyed.", + /// "type": "string", + /// "enum": [ + /// "destroying" + /// ] + /// }, + /// { + /// "description": "Support Bundle was not created successfully, or was + /// created and has lost backing storage.\n\nThe record of the bundle still + /// exists for readability, but the only valid operation on these bundles is + /// to destroy them.", + /// "type": "string", + /// "enum": [ + /// "failed" + /// ] + /// }, + /// { + /// "description": "Support Bundle has been processed, and is ready for + /// usage.", + /// "type": "string", + /// "enum": [ + /// "active" + /// ] + /// } + /// ] + /// } + /// ``` + ///
+ #[derive( + :: serde :: Deserialize, + :: serde :: Serialize, + Clone, + Copy, + Debug, + Eq, + Hash, + Ord, + PartialEq, + PartialOrd, + schemars :: JsonSchema, + )] + pub enum SupportBundleState { + /// Support Bundle still actively being collected. + /// + /// This is the initial state for a Support Bundle, and it will + /// automatically transition to either "Failing" or "Active". + /// + /// If a user no longer wants to access a Support Bundle, they can + /// request cancellation, which will transition to the "Destroying" + /// state. + #[serde(rename = "collecting")] + Collecting, + /// Support Bundle is being destroyed. + /// + /// Once backing storage has been freed, this bundle is destroyed. + #[serde(rename = "destroying")] + Destroying, + /// Support Bundle was not created successfully, or was created and has + /// lost backing storage. + /// + /// The record of the bundle still exists for readability, but the only + /// valid operation on these bundles is to destroy them. + #[serde(rename = "failed")] + Failed, + /// Support Bundle has been processed, and is ready for usage. + #[serde(rename = "active")] + Active, + } + + impl ::std::convert::From<&Self> for SupportBundleState { + fn from(value: &SupportBundleState) -> Self { + value.clone() + } + } + + impl ::std::fmt::Display for SupportBundleState { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + match *self { + Self::Collecting => write!(f, "collecting"), + Self::Destroying => write!(f, "destroying"), + Self::Failed => write!(f, "failed"), + Self::Active => write!(f, "active"), + } + } + } + + impl ::std::str::FromStr for SupportBundleState { + type Err = self::error::ConversionError; + fn from_str(value: &str) -> ::std::result::Result { + match value { + "collecting" => Ok(Self::Collecting), + "destroying" => Ok(Self::Destroying), + "failed" => Ok(Self::Failed), + "active" => Ok(Self::Active), + _ => Err("invalid value".into()), + } + } + } + + impl ::std::convert::TryFrom<&str> for SupportBundleState { + type Error = self::error::ConversionError; + fn try_from(value: &str) -> ::std::result::Result { + value.parse() + } + } + + impl ::std::convert::TryFrom<&::std::string::String> for SupportBundleState { + 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 SupportBundleState { + type Error = self::error::ConversionError; + fn try_from( + value: ::std::string::String, + ) -> ::std::result::Result { + value.parse() + } + } + /// An operator's view of a Switch. /// ///
JSON schema @@ -25448,6 +25707,81 @@ pub mod types { } } + /// TypedUuidForSupportBundleKind + /// + ///
JSON schema + /// + /// ```json + /// { + /// "type": "string", + /// "format": "uuid" + /// } + /// ``` + ///
+ #[derive( + :: serde :: Deserialize, :: serde :: Serialize, Clone, Debug, schemars :: JsonSchema, + )] + #[serde(transparent)] + pub struct TypedUuidForSupportBundleKind(pub uuid::Uuid); + impl ::std::ops::Deref for TypedUuidForSupportBundleKind { + type Target = uuid::Uuid; + fn deref(&self) -> &uuid::Uuid { + &self.0 + } + } + + impl ::std::convert::From for uuid::Uuid { + fn from(value: TypedUuidForSupportBundleKind) -> Self { + value.0 + } + } + + impl ::std::convert::From<&TypedUuidForSupportBundleKind> for TypedUuidForSupportBundleKind { + fn from(value: &TypedUuidForSupportBundleKind) -> Self { + value.clone() + } + } + + impl ::std::convert::From for TypedUuidForSupportBundleKind { + fn from(value: uuid::Uuid) -> Self { + Self(value) + } + } + + impl ::std::str::FromStr for TypedUuidForSupportBundleKind { + type Err = ::Err; + fn from_str(value: &str) -> ::std::result::Result { + Ok(Self(value.parse()?)) + } + } + + impl ::std::convert::TryFrom<&str> for TypedUuidForSupportBundleKind { + type Error = ::Err; + fn try_from(value: &str) -> ::std::result::Result { + value.parse() + } + } + + impl ::std::convert::TryFrom<&String> for TypedUuidForSupportBundleKind { + type Error = ::Err; + fn try_from(value: &String) -> ::std::result::Result { + value.parse() + } + } + + impl ::std::convert::TryFrom for TypedUuidForSupportBundleKind { + type Error = ::Err; + fn try_from(value: String) -> ::std::result::Result { + value.parse() + } + } + + impl ::std::fmt::Display for TypedUuidForSupportBundleKind { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + self.0.fmt(f) + } + } + /// A sled that has not been added to an initialized rack yet /// ///
JSON schema @@ -45799,6 +46133,185 @@ pub mod types { } } + #[derive(Clone, Debug)] + pub struct SupportBundleInfo { + id: ::std::result::Result, + reason_for_creation: + ::std::result::Result<::std::string::String, ::std::string::String>, + reason_for_failure: ::std::result::Result< + ::std::option::Option<::std::string::String>, + ::std::string::String, + >, + state: ::std::result::Result, + time_created: + ::std::result::Result, ::std::string::String>, + } + + impl ::std::default::Default for SupportBundleInfo { + fn default() -> Self { + Self { + id: Err("no value supplied for id".to_string()), + reason_for_creation: Err( + "no value supplied for reason_for_creation".to_string() + ), + reason_for_failure: Ok(Default::default()), + state: Err("no value supplied for state".to_string()), + time_created: Err("no value supplied for time_created".to_string()), + } + } + } + + impl SupportBundleInfo { + pub fn id(mut self, value: T) -> Self + where + T: ::std::convert::TryInto, + T::Error: ::std::fmt::Display, + { + self.id = value + .try_into() + .map_err(|e| format!("error converting supplied value for id: {}", e)); + self + } + pub fn reason_for_creation(mut self, value: T) -> Self + where + T: ::std::convert::TryInto<::std::string::String>, + T::Error: ::std::fmt::Display, + { + self.reason_for_creation = value.try_into().map_err(|e| { + format!( + "error converting supplied value for reason_for_creation: {}", + e + ) + }); + self + } + pub fn reason_for_failure(mut self, value: T) -> Self + where + T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>, + T::Error: ::std::fmt::Display, + { + self.reason_for_failure = value.try_into().map_err(|e| { + format!( + "error converting supplied value for reason_for_failure: {}", + e + ) + }); + self + } + pub fn state(mut self, value: T) -> Self + where + T: ::std::convert::TryInto, + T::Error: ::std::fmt::Display, + { + self.state = value + .try_into() + .map_err(|e| format!("error converting supplied value for state: {}", e)); + self + } + pub fn time_created(mut self, value: T) -> Self + where + T: ::std::convert::TryInto>, + T::Error: ::std::fmt::Display, + { + self.time_created = value.try_into().map_err(|e| { + format!("error converting supplied value for time_created: {}", e) + }); + self + } + } + + impl ::std::convert::TryFrom for super::SupportBundleInfo { + type Error = super::error::ConversionError; + fn try_from( + value: SupportBundleInfo, + ) -> ::std::result::Result { + Ok(Self { + id: value.id?, + reason_for_creation: value.reason_for_creation?, + reason_for_failure: value.reason_for_failure?, + state: value.state?, + time_created: value.time_created?, + }) + } + } + + impl ::std::convert::From for SupportBundleInfo { + fn from(value: super::SupportBundleInfo) -> Self { + Self { + id: Ok(value.id), + reason_for_creation: Ok(value.reason_for_creation), + reason_for_failure: Ok(value.reason_for_failure), + state: Ok(value.state), + time_created: Ok(value.time_created), + } + } + } + + #[derive(Clone, Debug)] + pub struct SupportBundleInfoResultsPage { + 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 SupportBundleInfoResultsPage { + fn default() -> Self { + Self { + items: Err("no value supplied for items".to_string()), + next_page: Ok(Default::default()), + } + } + } + + impl SupportBundleInfoResultsPage { + 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::SupportBundleInfoResultsPage { + type Error = super::error::ConversionError; + fn try_from( + value: SupportBundleInfoResultsPage, + ) -> ::std::result::Result { + Ok(Self { + items: value.items?, + next_page: value.next_page?, + }) + } + } + + impl ::std::convert::From for SupportBundleInfoResultsPage { + fn from(value: super::SupportBundleInfoResultsPage) -> Self { + Self { + items: Ok(value.items), + next_page: Ok(value.next_page), + } + } + } + #[derive(Clone, Debug)] pub struct Switch { baseboard: ::std::result::Result, @@ -51126,6 +51639,141 @@ pub trait ClientHiddenExt { /// .await; /// ``` fn probe_delete(&self) -> builder::ProbeDelete; + /// List all support bundles + /// + /// Sends a `GET` request to `/experimental/v1/system/support-bundles` + /// + /// 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.support_bundle_list() + /// .limit(limit) + /// .page_token(page_token) + /// .sort_by(sort_by) + /// .send() + /// .await; + /// ``` + fn support_bundle_list(&self) -> builder::SupportBundleList; + /// Create a new support bundle + /// + /// Sends a `POST` request to `/experimental/v1/system/support-bundles` + /// + /// ```ignore + /// let response = client.support_bundle_create() + /// .send() + /// .await; + /// ``` + fn support_bundle_create(&self) -> builder::SupportBundleCreate; + /// View a support bundle + /// + /// Sends a `GET` request to + /// `/experimental/v1/system/support-bundles/{support_bundle}` + /// + /// Arguments: + /// - `support_bundle`: ID of the support bundle + /// ```ignore + /// let response = client.support_bundle_view() + /// .support_bundle(support_bundle) + /// .send() + /// .await; + /// ``` + fn support_bundle_view(&self) -> builder::SupportBundleView; + /// Delete an existing support bundle + /// + /// May also be used to cancel a support bundle which is currently being + /// collected, or to remove metadata for a support bundle that has failed. + /// + /// Sends a `DELETE` request to + /// `/experimental/v1/system/support-bundles/{support_bundle}` + /// + /// Arguments: + /// - `support_bundle`: ID of the support bundle + /// ```ignore + /// let response = client.support_bundle_delete() + /// .support_bundle(support_bundle) + /// .send() + /// .await; + /// ``` + fn support_bundle_delete(&self) -> builder::SupportBundleDelete; + /// Download the contents of a support bundle + /// + /// Sends a `GET` request to + /// `/experimental/v1/system/support-bundles/{support_bundle}/download` + /// + /// Arguments: + /// - `support_bundle`: ID of the support bundle + /// ```ignore + /// let response = client.support_bundle_download() + /// .support_bundle(support_bundle) + /// .send() + /// .await; + /// ``` + fn support_bundle_download(&self) -> builder::SupportBundleDownload; + /// Download the metadata of a support bundle + /// + /// Sends a `HEAD` request to + /// `/experimental/v1/system/support-bundles/{support_bundle}/download` + /// + /// Arguments: + /// - `support_bundle`: ID of the support bundle + /// ```ignore + /// let response = client.support_bundle_head() + /// .support_bundle(support_bundle) + /// .send() + /// .await; + /// ``` + fn support_bundle_head(&self) -> builder::SupportBundleHead; + /// Download a file within a support bundle + /// + /// Sends a `GET` request to + /// `/experimental/v1/system/support-bundles/{support_bundle}/download/ + /// {file}` + /// + /// Arguments: + /// - `support_bundle`: ID of the support bundle + /// - `file`: The file within the bundle to download + /// ```ignore + /// let response = client.support_bundle_download_file() + /// .support_bundle(support_bundle) + /// .file(file) + /// .send() + /// .await; + /// ``` + fn support_bundle_download_file(&self) -> builder::SupportBundleDownloadFile; + /// Download the metadata of a file within the support bundle + /// + /// Sends a `HEAD` request to + /// `/experimental/v1/system/support-bundles/{support_bundle}/download/ + /// {file}` + /// + /// Arguments: + /// - `support_bundle`: ID of the support bundle + /// - `file`: The file within the bundle to download + /// ```ignore + /// let response = client.support_bundle_head_file() + /// .support_bundle(support_bundle) + /// .file(file) + /// .send() + /// .await; + /// ``` + fn support_bundle_head_file(&self) -> builder::SupportBundleHeadFile; + /// Download the index of a support bundle + /// + /// Sends a `GET` request to + /// `/experimental/v1/system/support-bundles/{support_bundle}/index` + /// + /// Arguments: + /// - `support_bundle`: ID of the support bundle + /// ```ignore + /// let response = client.support_bundle_index() + /// .support_bundle(support_bundle) + /// .send() + /// .await; + /// ``` + fn support_bundle_index(&self) -> builder::SupportBundleIndex; /// Log user out of web console by deleting session on client and server /// /// Sends a `POST` request to `/v1/logout` @@ -51186,6 +51834,42 @@ impl ClientHiddenExt for Client { builder::ProbeDelete::new(self) } + fn support_bundle_list(&self) -> builder::SupportBundleList { + builder::SupportBundleList::new(self) + } + + fn support_bundle_create(&self) -> builder::SupportBundleCreate { + builder::SupportBundleCreate::new(self) + } + + fn support_bundle_view(&self) -> builder::SupportBundleView { + builder::SupportBundleView::new(self) + } + + fn support_bundle_delete(&self) -> builder::SupportBundleDelete { + builder::SupportBundleDelete::new(self) + } + + fn support_bundle_download(&self) -> builder::SupportBundleDownload { + builder::SupportBundleDownload::new(self) + } + + fn support_bundle_head(&self) -> builder::SupportBundleHead { + builder::SupportBundleHead::new(self) + } + + fn support_bundle_download_file(&self) -> builder::SupportBundleDownloadFile { + builder::SupportBundleDownloadFile::new(self) + } + + fn support_bundle_head_file(&self) -> builder::SupportBundleHeadFile { + builder::SupportBundleHeadFile::new(self) + } + + fn support_bundle_index(&self) -> builder::SupportBundleIndex { + builder::SupportBundleIndex::new(self) + } + fn logout(&self) -> builder::Logout { builder::Logout::new(self) } @@ -55749,6 +56433,610 @@ pub mod builder { } } + /// Builder for [`ClientHiddenExt::support_bundle_list`] + /// + /// [`ClientHiddenExt::support_bundle_list`]: super::ClientHiddenExt::support_bundle_list + #[derive(Debug, Clone)] + pub struct SupportBundleList<'a> { + client: &'a super::Client, + limit: Result, String>, + page_token: Result, String>, + sort_by: Result, String>, + } + + impl<'a> SupportBundleList<'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, + { + 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 `/experimental/v1/system/support-bundles` + 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!("{}/experimental/v1/system/support-bundles", client.baseurl,); + #[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)) + .build()?; + let result = client.client.execute(request).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 `/experimental/v1/system/support-bundles` + 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 [`ClientHiddenExt::support_bundle_create`] + /// + /// [`ClientHiddenExt::support_bundle_create`]: super::ClientHiddenExt::support_bundle_create + #[derive(Debug, Clone)] + pub struct SupportBundleCreate<'a> { + client: &'a super::Client, + } + + impl<'a> SupportBundleCreate<'a> { + pub fn new(client: &'a super::Client) -> Self { + Self { client: client } + } + + /// Sends a `POST` request to `/experimental/v1/system/support-bundles` + pub async fn send( + self, + ) -> Result, Error> { + let Self { client } = self; + let url = format!("{}/experimental/v1/system/support-bundles", client.baseurl,); + #[allow(unused_mut)] + let mut request = client + .client + .post(url) + .header( + reqwest::header::ACCEPT, + reqwest::header::HeaderValue::from_static("application/json"), + ) + .build()?; + let result = client.client.execute(request).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 [`ClientHiddenExt::support_bundle_view`] + /// + /// [`ClientHiddenExt::support_bundle_view`]: super::ClientHiddenExt::support_bundle_view + #[derive(Debug, Clone)] + pub struct SupportBundleView<'a> { + client: &'a super::Client, + support_bundle: Result, + } + + impl<'a> SupportBundleView<'a> { + pub fn new(client: &'a super::Client) -> Self { + Self { + client: client, + support_bundle: Err("support_bundle was not initialized".to_string()), + } + } + + pub fn support_bundle(mut self, value: V) -> Self + where + V: std::convert::TryInto, + { + self.support_bundle = value + .try_into() + .map_err(|_| "conversion to `uuid :: Uuid` for support_bundle failed".to_string()); + self + } + + /// Sends a `GET` request to + /// `/experimental/v1/system/support-bundles/{support_bundle}` + pub async fn send( + self, + ) -> Result, Error> { + let Self { + client, + support_bundle, + } = self; + let support_bundle = support_bundle.map_err(Error::InvalidRequest)?; + let url = format!( + "{}/experimental/v1/system/support-bundles/{}", + client.baseurl, + encode_path(&support_bundle.to_string()), + ); + #[allow(unused_mut)] + let mut request = client + .client + .get(url) + .header( + reqwest::header::ACCEPT, + reqwest::header::HeaderValue::from_static("application/json"), + ) + .build()?; + let result = client.client.execute(request).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 [`ClientHiddenExt::support_bundle_delete`] + /// + /// [`ClientHiddenExt::support_bundle_delete`]: super::ClientHiddenExt::support_bundle_delete + #[derive(Debug, Clone)] + pub struct SupportBundleDelete<'a> { + client: &'a super::Client, + support_bundle: Result, + } + + impl<'a> SupportBundleDelete<'a> { + pub fn new(client: &'a super::Client) -> Self { + Self { + client: client, + support_bundle: Err("support_bundle was not initialized".to_string()), + } + } + + pub fn support_bundle(mut self, value: V) -> Self + where + V: std::convert::TryInto, + { + self.support_bundle = value + .try_into() + .map_err(|_| "conversion to `uuid :: Uuid` for support_bundle failed".to_string()); + self + } + + /// Sends a `DELETE` request to + /// `/experimental/v1/system/support-bundles/{support_bundle}` + pub async fn send(self) -> Result, Error> { + let Self { + client, + support_bundle, + } = self; + let support_bundle = support_bundle.map_err(Error::InvalidRequest)?; + let url = format!( + "{}/experimental/v1/system/support-bundles/{}", + client.baseurl, + encode_path(&support_bundle.to_string()), + ); + #[allow(unused_mut)] + let mut request = client + .client + .delete(url) + .header( + reqwest::header::ACCEPT, + reqwest::header::HeaderValue::from_static("application/json"), + ) + .build()?; + let result = client.client.execute(request).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 [`ClientHiddenExt::support_bundle_download`] + /// + /// [`ClientHiddenExt::support_bundle_download`]: super::ClientHiddenExt::support_bundle_download + #[derive(Debug, Clone)] + pub struct SupportBundleDownload<'a> { + client: &'a super::Client, + support_bundle: Result, + } + + impl<'a> SupportBundleDownload<'a> { + pub fn new(client: &'a super::Client) -> Self { + Self { + client: client, + support_bundle: Err("support_bundle was not initialized".to_string()), + } + } + + pub fn support_bundle(mut self, value: V) -> Self + where + V: std::convert::TryInto, + { + self.support_bundle = value + .try_into() + .map_err(|_| "conversion to `uuid :: Uuid` for support_bundle failed".to_string()); + self + } + + /// Sends a `GET` request to + /// `/experimental/v1/system/support-bundles/{support_bundle}/download` + pub async fn send(self) -> Result, Error> { + let Self { + client, + support_bundle, + } = self; + let support_bundle = support_bundle.map_err(Error::InvalidRequest)?; + let url = format!( + "{}/experimental/v1/system/support-bundles/{}/download", + client.baseurl, + encode_path(&support_bundle.to_string()), + ); + #[allow(unused_mut)] + let mut request = client.client.get(url).build()?; + let result = client.client.execute(request).await; + let response = result?; + match response.status().as_u16() { + 200..=299 => Ok(ResponseValue::stream(response)), + _ => Err(Error::ErrorResponse(ResponseValue::stream(response))), + } + } + } + + /// Builder for [`ClientHiddenExt::support_bundle_head`] + /// + /// [`ClientHiddenExt::support_bundle_head`]: super::ClientHiddenExt::support_bundle_head + #[derive(Debug, Clone)] + pub struct SupportBundleHead<'a> { + client: &'a super::Client, + support_bundle: Result, + } + + impl<'a> SupportBundleHead<'a> { + pub fn new(client: &'a super::Client) -> Self { + Self { + client: client, + support_bundle: Err("support_bundle was not initialized".to_string()), + } + } + + pub fn support_bundle(mut self, value: V) -> Self + where + V: std::convert::TryInto, + { + self.support_bundle = value + .try_into() + .map_err(|_| "conversion to `uuid :: Uuid` for support_bundle failed".to_string()); + self + } + + /// Sends a `HEAD` request to + /// `/experimental/v1/system/support-bundles/{support_bundle}/download` + pub async fn send(self) -> Result, Error> { + let Self { + client, + support_bundle, + } = self; + let support_bundle = support_bundle.map_err(Error::InvalidRequest)?; + let url = format!( + "{}/experimental/v1/system/support-bundles/{}/download", + client.baseurl, + encode_path(&support_bundle.to_string()), + ); + #[allow(unused_mut)] + let mut request = client.client.head(url).build()?; + let result = client.client.execute(request).await; + let response = result?; + match response.status().as_u16() { + 200..=299 => Ok(ResponseValue::stream(response)), + _ => Err(Error::ErrorResponse(ResponseValue::stream(response))), + } + } + } + + /// Builder for [`ClientHiddenExt::support_bundle_download_file`] + /// + /// [`ClientHiddenExt::support_bundle_download_file`]: super::ClientHiddenExt::support_bundle_download_file + #[derive(Debug, Clone)] + pub struct SupportBundleDownloadFile<'a> { + client: &'a super::Client, + support_bundle: Result, + file: Result<::std::string::String, String>, + } + + impl<'a> SupportBundleDownloadFile<'a> { + pub fn new(client: &'a super::Client) -> Self { + Self { + client: client, + support_bundle: Err("support_bundle was not initialized".to_string()), + file: Err("file was not initialized".to_string()), + } + } + + pub fn support_bundle(mut self, value: V) -> Self + where + V: std::convert::TryInto, + { + self.support_bundle = value + .try_into() + .map_err(|_| "conversion to `uuid :: Uuid` for support_bundle failed".to_string()); + self + } + + pub fn file(mut self, value: V) -> Self + where + V: std::convert::TryInto<::std::string::String>, + { + self.file = value.try_into().map_err(|_| { + "conversion to `:: std :: string :: String` for file failed".to_string() + }); + self + } + + /// Sends a `GET` request to + /// `/experimental/v1/system/support-bundles/{support_bundle}/download/ + /// {file}` + pub async fn send(self) -> Result, Error> { + let Self { + client, + support_bundle, + file, + } = self; + let support_bundle = support_bundle.map_err(Error::InvalidRequest)?; + let file = file.map_err(Error::InvalidRequest)?; + let url = format!( + "{}/experimental/v1/system/support-bundles/{}/download/{}", + client.baseurl, + encode_path(&support_bundle.to_string()), + encode_path(&file.to_string()), + ); + #[allow(unused_mut)] + let mut request = client.client.get(url).build()?; + let result = client.client.execute(request).await; + let response = result?; + match response.status().as_u16() { + 200..=299 => Ok(ResponseValue::stream(response)), + _ => Err(Error::ErrorResponse(ResponseValue::stream(response))), + } + } + } + + /// Builder for [`ClientHiddenExt::support_bundle_head_file`] + /// + /// [`ClientHiddenExt::support_bundle_head_file`]: super::ClientHiddenExt::support_bundle_head_file + #[derive(Debug, Clone)] + pub struct SupportBundleHeadFile<'a> { + client: &'a super::Client, + support_bundle: Result, + file: Result<::std::string::String, String>, + } + + impl<'a> SupportBundleHeadFile<'a> { + pub fn new(client: &'a super::Client) -> Self { + Self { + client: client, + support_bundle: Err("support_bundle was not initialized".to_string()), + file: Err("file was not initialized".to_string()), + } + } + + pub fn support_bundle(mut self, value: V) -> Self + where + V: std::convert::TryInto, + { + self.support_bundle = value + .try_into() + .map_err(|_| "conversion to `uuid :: Uuid` for support_bundle failed".to_string()); + self + } + + pub fn file(mut self, value: V) -> Self + where + V: std::convert::TryInto<::std::string::String>, + { + self.file = value.try_into().map_err(|_| { + "conversion to `:: std :: string :: String` for file failed".to_string() + }); + self + } + + /// Sends a `HEAD` request to + /// `/experimental/v1/system/support-bundles/{support_bundle}/download/ + /// {file}` + pub async fn send(self) -> Result, Error> { + let Self { + client, + support_bundle, + file, + } = self; + let support_bundle = support_bundle.map_err(Error::InvalidRequest)?; + let file = file.map_err(Error::InvalidRequest)?; + let url = format!( + "{}/experimental/v1/system/support-bundles/{}/download/{}", + client.baseurl, + encode_path(&support_bundle.to_string()), + encode_path(&file.to_string()), + ); + #[allow(unused_mut)] + let mut request = client.client.head(url).build()?; + let result = client.client.execute(request).await; + let response = result?; + match response.status().as_u16() { + 200..=299 => Ok(ResponseValue::stream(response)), + _ => Err(Error::ErrorResponse(ResponseValue::stream(response))), + } + } + } + + /// Builder for [`ClientHiddenExt::support_bundle_index`] + /// + /// [`ClientHiddenExt::support_bundle_index`]: super::ClientHiddenExt::support_bundle_index + #[derive(Debug, Clone)] + pub struct SupportBundleIndex<'a> { + client: &'a super::Client, + support_bundle: Result, + } + + impl<'a> SupportBundleIndex<'a> { + pub fn new(client: &'a super::Client) -> Self { + Self { + client: client, + support_bundle: Err("support_bundle was not initialized".to_string()), + } + } + + pub fn support_bundle(mut self, value: V) -> Self + where + V: std::convert::TryInto, + { + self.support_bundle = value + .try_into() + .map_err(|_| "conversion to `uuid :: Uuid` for support_bundle failed".to_string()); + self + } + + /// Sends a `GET` request to + /// `/experimental/v1/system/support-bundles/{support_bundle}/index` + pub async fn send(self) -> Result, Error> { + let Self { + client, + support_bundle, + } = self; + let support_bundle = support_bundle.map_err(Error::InvalidRequest)?; + let url = format!( + "{}/experimental/v1/system/support-bundles/{}/index", + client.baseurl, + encode_path(&support_bundle.to_string()), + ); + #[allow(unused_mut)] + let mut request = client.client.get(url).build()?; + let result = client.client.execute(request).await; + let response = result?; + match response.status().as_u16() { + 200..=299 => Ok(ResponseValue::stream(response)), + _ => Err(Error::ErrorResponse(ResponseValue::stream(response))), + } + } + } + /// Builder for [`ClientLoginExt::login_saml`] /// /// [`ClientLoginExt::login_saml`]: super::ClientLoginExt::login_saml From 37279329a2544789e6941022fff48d15f237c211 Mon Sep 17 00:00:00 2001 From: "Adam H. Leventhal" Date: Tue, 14 Jan 2025 19:43:47 -0800 Subject: [PATCH 09/17] deal with new API operations --- cli/src/cli_builder.rs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/cli/src/cli_builder.rs b/cli/src/cli_builder.rs index 21aca5e4..511db53a 100644 --- a/cli/src/cli_builder.rs +++ b/cli/src/cli_builder.rs @@ -583,6 +583,17 @@ fn xxx<'a>(command: CliCommand) -> Option<&'a str> { Some("experimental system timeseries schema list") } + // Support bundles are not yet implemented. + CliCommand::SupportBundleList + | CliCommand::SupportBundleCreate + | CliCommand::SupportBundleView + | CliCommand::SupportBundleDelete + | CliCommand::SupportBundleDownload + | CliCommand::SupportBundleHead + | CliCommand::SupportBundleDownloadFile + | CliCommand::SupportBundleHeadFile + | CliCommand::SupportBundleIndex => None, + // Commands not yet implemented CliCommand::DeviceAccessToken | CliCommand::DeviceAuthConfirm From a7f2a35679992e4e4b27f2a5c4b4a80e034df065 Mon Sep 17 00:00:00 2001 From: "oxide-reflector-bot[bot]" <130185838+oxide-reflector-bot[bot]@users.noreply.github.com> Date: Wed, 15 Jan 2025 03:56:26 +0000 Subject: [PATCH 10/17] Rebuilt with latest dependency updates --- Cargo.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index d8e5dd7f..0ef34ad5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2502,7 +2502,7 @@ dependencies = [ [[package]] name = "progenitor" version = "0.9.1" -source = "git+https://github.com/oxidecomputer/progenitor#514a0b26c185351d28c5dff8470ce6801786b81a" +source = "git+https://github.com/oxidecomputer/progenitor#75c3cda76586a35751ac6992600cb026d8b05856" dependencies = [ "progenitor-impl", ] @@ -2525,7 +2525,7 @@ dependencies = [ [[package]] name = "progenitor-impl" version = "0.9.1" -source = "git+https://github.com/oxidecomputer/progenitor#514a0b26c185351d28c5dff8470ce6801786b81a" +source = "git+https://github.com/oxidecomputer/progenitor#75c3cda76586a35751ac6992600cb026d8b05856" dependencies = [ "heck", "http 1.2.0", From 93ec049f1e48425e3937032acab5d2951bdd2fdf Mon Sep 17 00:00:00 2001 From: "oxide-reflector-bot[bot]" <130185838+oxide-reflector-bot[bot]@users.noreply.github.com> Date: Wed, 15 Jan 2025 04:10:02 +0000 Subject: [PATCH 11/17] Rebuilt with latest dependency updates --- Cargo.lock | 62 +++++++++++++++++++++++++++--------------------------- 1 file changed, 31 insertions(+), 31 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index f04cb6cb..57a52790 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -321,7 +321,7 @@ checksum = "c7c24de15d275a1ecfd47a380fb4d5ec9bfe0933f309ed5e705b775596a3574d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.95", + "syn 2.0.96", ] [[package]] @@ -338,7 +338,7 @@ checksum = "3f934833b4b7233644e5848f235df3f57ed8c80f1528a26c3dfa13d2147fa056" dependencies = [ "proc-macro2", "quote", - "syn 2.0.95", + "syn 2.0.96", ] [[package]] @@ -581,7 +581,7 @@ dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.95", + "syn 2.0.96", ] [[package]] @@ -827,7 +827,7 @@ checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.95", + "syn 2.0.96", ] [[package]] @@ -898,7 +898,7 @@ dependencies = [ "semver", "serde", "serde_tokenstream", - "syn 2.0.95", + "syn 2.0.96", ] [[package]] @@ -1131,7 +1131,7 @@ checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" dependencies = [ "proc-macro2", "quote", - "syn 2.0.95", + "syn 2.0.96", ] [[package]] @@ -1628,7 +1628,7 @@ checksum = "1ec89e9337638ecdc08744df490b221a7399bf8d164eb52a665454e60e075ad6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.95", + "syn 2.0.96", ] [[package]] @@ -2146,7 +2146,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.95", + "syn 2.0.96", ] [[package]] @@ -2480,7 +2480,7 @@ dependencies = [ [[package]] name = "progenitor" version = "0.9.1" -source = "git+https://github.com/oxidecomputer/progenitor#514a0b26c185351d28c5dff8470ce6801786b81a" +source = "git+https://github.com/oxidecomputer/progenitor#9298f2f5d3261235ecf1e848ffad07153e8d39e5" dependencies = [ "progenitor-impl", ] @@ -2503,7 +2503,7 @@ dependencies = [ [[package]] name = "progenitor-impl" version = "0.9.1" -source = "git+https://github.com/oxidecomputer/progenitor#514a0b26c185351d28c5dff8470ce6801786b81a" +source = "git+https://github.com/oxidecomputer/progenitor#9298f2f5d3261235ecf1e848ffad07153e8d39e5" dependencies = [ "heck", "http 1.2.0", @@ -2515,7 +2515,7 @@ dependencies = [ "schemars", "serde", "serde_json", - "syn 2.0.95", + "syn 2.0.96", "thiserror 2.0.9", "typify", "unicode-ident", @@ -2932,7 +2932,7 @@ dependencies = [ "proc-macro2", "quote", "serde_derive_internals", - "syn 2.0.95", + "syn 2.0.96", ] [[package]] @@ -2990,7 +2990,7 @@ checksum = "5a9bf7cf98d04a2b28aead066b7496853d4779c9cc183c440dbac457641e19a0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.95", + "syn 2.0.96", ] [[package]] @@ -3001,7 +3001,7 @@ checksum = "18d26a20a969b9e3fdf2fc2d9f21eda6c40e2de84c9408bb5d3b05d499aae711" dependencies = [ "proc-macro2", "quote", - "syn 2.0.95", + "syn 2.0.96", ] [[package]] @@ -3054,7 +3054,7 @@ dependencies = [ "proc-macro2", "quote", "serde", - "syn 2.0.95", + "syn 2.0.96", ] [[package]] @@ -3244,7 +3244,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d904e7009df136af5297832a3ace3370cd14ff1546a232f4f185036c2736fcac" dependencies = [ "quote", - "syn 2.0.95", + "syn 2.0.96", ] [[package]] @@ -3297,7 +3297,7 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.95", + "syn 2.0.96", ] [[package]] @@ -3319,9 +3319,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.95" +version = "2.0.96" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46f71c0377baf4ef1cc3e3402ded576dccc315800fbc62dfc7fe04b009773b4a" +checksum = "d5d0adab1ae378d7f53bdebc67a39f1f151407ef230f0ce2883572f5d8985c80" dependencies = [ "proc-macro2", "quote", @@ -3345,7 +3345,7 @@ checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" dependencies = [ "proc-macro2", "quote", - "syn 2.0.95", + "syn 2.0.96", ] [[package]] @@ -3481,7 +3481,7 @@ checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.95", + "syn 2.0.96", ] [[package]] @@ -3492,7 +3492,7 @@ checksum = "7b50fa271071aae2e6ee85f842e2e28ba8cd2c5fb67f11fcb1fd70b276f9e7d4" dependencies = [ "proc-macro2", "quote", - "syn 2.0.95", + "syn 2.0.96", ] [[package]] @@ -3614,7 +3614,7 @@ checksum = "6e06d43f1345a3bcd39f6a56dbb7dcab2ba47e68e8ac134855e7e2bdbaf8cab8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.95", + "syn 2.0.96", ] [[package]] @@ -3822,7 +3822,7 @@ dependencies = [ "semver", "serde", "serde_json", - "syn 2.0.95", + "syn 2.0.96", "thiserror 2.0.9", "unicode-ident", ] @@ -3840,7 +3840,7 @@ dependencies = [ "serde", "serde_json", "serde_tokenstream", - "syn 2.0.95", + "syn 2.0.96", "typify-impl", ] @@ -4025,7 +4025,7 @@ dependencies = [ "log", "proc-macro2", "quote", - "syn 2.0.95", + "syn 2.0.96", "wasm-bindgen-shared", ] @@ -4060,7 +4060,7 @@ checksum = "30d7a95b763d3c45903ed6c81f156801839e5ee968bb07e534c44df0fcd330c2" dependencies = [ "proc-macro2", "quote", - "syn 2.0.95", + "syn 2.0.96", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -4410,7 +4410,7 @@ checksum = "2380878cad4ac9aac1e2435f3eb4020e8374b5f13c296cb75b4620ff8e229154" dependencies = [ "proc-macro2", "quote", - "syn 2.0.95", + "syn 2.0.96", "synstructure", ] @@ -4432,7 +4432,7 @@ checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.95", + "syn 2.0.96", ] [[package]] @@ -4452,7 +4452,7 @@ checksum = "595eed982f7d355beb85837f651fa22e90b3c044842dc7f2c2842c086f295808" dependencies = [ "proc-macro2", "quote", - "syn 2.0.95", + "syn 2.0.96", "synstructure", ] @@ -4481,5 +4481,5 @@ checksum = "6eafa6dfb17584ea3e2bd6e76e0cc15ad7af12b09abdd1ca55961bed9b1063c6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.95", + "syn 2.0.96", ] From a432ed1863ef3c890f4aa92c92064910faf57c28 Mon Sep 17 00:00:00 2001 From: "oxide-reflector-bot[bot]" <130185838+oxide-reflector-bot[bot]@users.noreply.github.com> Date: Wed, 15 Jan 2025 04:22:50 +0000 Subject: [PATCH 12/17] Rebuilt with latest dependency updates --- Cargo.lock | 62 +++++++++++++++++++++++++++--------------------------- 1 file changed, 31 insertions(+), 31 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index b603db9d..d116af2c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -321,7 +321,7 @@ checksum = "c7c24de15d275a1ecfd47a380fb4d5ec9bfe0933f309ed5e705b775596a3574d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.95", + "syn 2.0.96", ] [[package]] @@ -338,7 +338,7 @@ checksum = "3f934833b4b7233644e5848f235df3f57ed8c80f1528a26c3dfa13d2147fa056" dependencies = [ "proc-macro2", "quote", - "syn 2.0.95", + "syn 2.0.96", ] [[package]] @@ -581,7 +581,7 @@ dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.95", + "syn 2.0.96", ] [[package]] @@ -827,7 +827,7 @@ checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.95", + "syn 2.0.96", ] [[package]] @@ -898,7 +898,7 @@ dependencies = [ "semver", "serde", "serde_tokenstream", - "syn 2.0.95", + "syn 2.0.96", ] [[package]] @@ -1131,7 +1131,7 @@ checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" dependencies = [ "proc-macro2", "quote", - "syn 2.0.95", + "syn 2.0.96", ] [[package]] @@ -1628,7 +1628,7 @@ checksum = "1ec89e9337638ecdc08744df490b221a7399bf8d164eb52a665454e60e075ad6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.95", + "syn 2.0.96", ] [[package]] @@ -2146,7 +2146,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.95", + "syn 2.0.96", ] [[package]] @@ -2480,7 +2480,7 @@ dependencies = [ [[package]] name = "progenitor" version = "0.9.1" -source = "git+https://github.com/oxidecomputer/progenitor#514a0b26c185351d28c5dff8470ce6801786b81a" +source = "git+https://github.com/oxidecomputer/progenitor#9298f2f5d3261235ecf1e848ffad07153e8d39e5" dependencies = [ "progenitor-impl", ] @@ -2503,7 +2503,7 @@ dependencies = [ [[package]] name = "progenitor-impl" version = "0.9.1" -source = "git+https://github.com/oxidecomputer/progenitor#514a0b26c185351d28c5dff8470ce6801786b81a" +source = "git+https://github.com/oxidecomputer/progenitor#9298f2f5d3261235ecf1e848ffad07153e8d39e5" dependencies = [ "heck", "http 1.2.0", @@ -2515,7 +2515,7 @@ dependencies = [ "schemars", "serde", "serde_json", - "syn 2.0.95", + "syn 2.0.96", "thiserror 2.0.11", "typify", "unicode-ident", @@ -2932,7 +2932,7 @@ dependencies = [ "proc-macro2", "quote", "serde_derive_internals", - "syn 2.0.95", + "syn 2.0.96", ] [[package]] @@ -2990,7 +2990,7 @@ checksum = "5a9bf7cf98d04a2b28aead066b7496853d4779c9cc183c440dbac457641e19a0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.95", + "syn 2.0.96", ] [[package]] @@ -3001,7 +3001,7 @@ checksum = "18d26a20a969b9e3fdf2fc2d9f21eda6c40e2de84c9408bb5d3b05d499aae711" dependencies = [ "proc-macro2", "quote", - "syn 2.0.95", + "syn 2.0.96", ] [[package]] @@ -3054,7 +3054,7 @@ dependencies = [ "proc-macro2", "quote", "serde", - "syn 2.0.95", + "syn 2.0.96", ] [[package]] @@ -3244,7 +3244,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d904e7009df136af5297832a3ace3370cd14ff1546a232f4f185036c2736fcac" dependencies = [ "quote", - "syn 2.0.95", + "syn 2.0.96", ] [[package]] @@ -3297,7 +3297,7 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.95", + "syn 2.0.96", ] [[package]] @@ -3319,9 +3319,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.95" +version = "2.0.96" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46f71c0377baf4ef1cc3e3402ded576dccc315800fbc62dfc7fe04b009773b4a" +checksum = "d5d0adab1ae378d7f53bdebc67a39f1f151407ef230f0ce2883572f5d8985c80" dependencies = [ "proc-macro2", "quote", @@ -3345,7 +3345,7 @@ checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" dependencies = [ "proc-macro2", "quote", - "syn 2.0.95", + "syn 2.0.96", ] [[package]] @@ -3481,7 +3481,7 @@ checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.95", + "syn 2.0.96", ] [[package]] @@ -3492,7 +3492,7 @@ checksum = "26afc1baea8a989337eeb52b6e72a039780ce45c3edfcc9c5b9d112feeb173c2" dependencies = [ "proc-macro2", "quote", - "syn 2.0.95", + "syn 2.0.96", ] [[package]] @@ -3614,7 +3614,7 @@ checksum = "6e06d43f1345a3bcd39f6a56dbb7dcab2ba47e68e8ac134855e7e2bdbaf8cab8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.95", + "syn 2.0.96", ] [[package]] @@ -3822,7 +3822,7 @@ dependencies = [ "semver", "serde", "serde_json", - "syn 2.0.95", + "syn 2.0.96", "thiserror 2.0.11", "unicode-ident", ] @@ -3840,7 +3840,7 @@ dependencies = [ "serde", "serde_json", "serde_tokenstream", - "syn 2.0.95", + "syn 2.0.96", "typify-impl", ] @@ -4025,7 +4025,7 @@ dependencies = [ "log", "proc-macro2", "quote", - "syn 2.0.95", + "syn 2.0.96", "wasm-bindgen-shared", ] @@ -4060,7 +4060,7 @@ checksum = "30d7a95b763d3c45903ed6c81f156801839e5ee968bb07e534c44df0fcd330c2" dependencies = [ "proc-macro2", "quote", - "syn 2.0.95", + "syn 2.0.96", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -4410,7 +4410,7 @@ checksum = "2380878cad4ac9aac1e2435f3eb4020e8374b5f13c296cb75b4620ff8e229154" dependencies = [ "proc-macro2", "quote", - "syn 2.0.95", + "syn 2.0.96", "synstructure", ] @@ -4432,7 +4432,7 @@ checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.95", + "syn 2.0.96", ] [[package]] @@ -4452,7 +4452,7 @@ checksum = "595eed982f7d355beb85837f651fa22e90b3c044842dc7f2c2842c086f295808" dependencies = [ "proc-macro2", "quote", - "syn 2.0.95", + "syn 2.0.96", "synstructure", ] @@ -4481,5 +4481,5 @@ checksum = "6eafa6dfb17584ea3e2bd6e76e0cc15ad7af12b09abdd1ca55961bed9b1063c6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.95", + "syn 2.0.96", ] From f18e620cf3e3c92e0ca911c4ecd50d5872ee0ef9 Mon Sep 17 00:00:00 2001 From: "oxide-reflector-bot[bot]" <130185838+oxide-reflector-bot[bot]@users.noreply.github.com> Date: Tue, 21 Jan 2025 22:59:58 +0000 Subject: [PATCH 13/17] Rebuilt with latest dependency updates --- Cargo.lock | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 117b4dfd..348e8077 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1654,9 +1654,9 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.7.0" +version = "2.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62f822373a4fe84d4bb149bf54e584a7f4abec90e072ed49cda0edea5b95471f" +checksum = "8c9c992b02b5b4c94ea26e32fe5bccb7aa7d9f390ab5c1221ff895bc7ea8b652" dependencies = [ "equivalent", "hashbrown", @@ -2470,9 +2470,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.92" +version = "1.0.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37d3544b3f2748c54e147655edb5025752e2303145b5aefb3c3ea2c78b973bb0" +checksum = "60946a68e5f9d28b0dc1c21bb8a97ee7d018a8b322fa57838ba31cc878e22d99" dependencies = [ "unicode-ident", ] @@ -2480,7 +2480,7 @@ dependencies = [ [[package]] name = "progenitor" version = "0.9.1" -source = "git+https://github.com/oxidecomputer/progenitor#9298f2f5d3261235ecf1e848ffad07153e8d39e5" +source = "git+https://github.com/oxidecomputer/progenitor#8a15f874d1f4ff1098cb5dc8abbc25af38d90884" dependencies = [ "progenitor-impl", ] @@ -2503,7 +2503,7 @@ dependencies = [ [[package]] name = "progenitor-impl" version = "0.9.1" -source = "git+https://github.com/oxidecomputer/progenitor#9298f2f5d3261235ecf1e848ffad07153e8d39e5" +source = "git+https://github.com/oxidecomputer/progenitor#8a15f874d1f4ff1098cb5dc8abbc25af38d90884" dependencies = [ "heck", "http 1.2.0", From 805b1369e00bf64557169574dbc551ab31126246 Mon Sep 17 00:00:00 2001 From: "oxide-reflector-bot[bot]" <130185838+oxide-reflector-bot[bot]@users.noreply.github.com> Date: Fri, 24 Jan 2025 20:47:36 +0000 Subject: [PATCH 14/17] Rebuilt with latest dependency updates --- cli/src/generated_cli.rs | 371 +++++++++ oxide.json | 281 +++++++ sdk-httpmock/src/generated_httpmock.rs | 335 ++++++++ sdk/src/generated_sdk.rs | 1039 ++++++++++++++++++++++-- 4 files changed, 1966 insertions(+), 60 deletions(-) diff --git a/cli/src/generated_cli.rs b/cli/src/generated_cli.rs index 781086b3..db5380e9 100644 --- a/cli/src/generated_cli.rs +++ b/cli/src/generated_cli.rs @@ -129,6 +129,9 @@ impl Cli { CliCommand::SnapshotDelete => Self::cli_snapshot_delete(), CliCommand::PhysicalDiskList => Self::cli_physical_disk_list(), CliCommand::PhysicalDiskView => Self::cli_physical_disk_view(), + CliCommand::NetworkingSwitchPortLldpNeighbors => { + Self::cli_networking_switch_port_lldp_neighbors() + } CliCommand::RackList => Self::cli_rack_list(), CliCommand::RackView => Self::cli_rack_view(), CliCommand::SledList => Self::cli_sled_list(), @@ -139,6 +142,12 @@ impl Cli { CliCommand::SledSetProvisionPolicy => Self::cli_sled_set_provision_policy(), CliCommand::SledListUninitialized => Self::cli_sled_list_uninitialized(), CliCommand::NetworkingSwitchPortList => Self::cli_networking_switch_port_list(), + CliCommand::NetworkingSwitchPortLldpConfigView => { + Self::cli_networking_switch_port_lldp_config_view() + } + CliCommand::NetworkingSwitchPortLldpConfigUpdate => { + Self::cli_networking_switch_port_lldp_config_update() + } CliCommand::NetworkingSwitchPortApplySettings => { Self::cli_networking_switch_port_apply_settings() } @@ -3478,6 +3487,50 @@ impl Cli { .about("Get a physical disk") } + pub fn cli_networking_switch_port_lldp_neighbors() -> ::clap::Command { + ::clap::Command::new("") + .arg( + ::clap::Arg::new("limit") + .long("limit") + .value_parser(::clap::value_parser!(std::num::NonZeroU32)) + .required(false) + .help("Maximum number of items returned by a single call"), + ) + .arg( + ::clap::Arg::new("port") + .long("port") + .value_parser(::clap::value_parser!(types::Name)) + .required(true) + .help("A name to use when selecting switch ports."), + ) + .arg( + ::clap::Arg::new("rack-id") + .long("rack-id") + .value_parser(::clap::value_parser!(uuid::Uuid)) + .required(true) + .help("A rack id to use when selecting switch ports."), + ) + .arg( + ::clap::Arg::new("sort-by") + .long("sort-by") + .value_parser(::clap::builder::TypedValueParser::map( + ::clap::builder::PossibleValuesParser::new([ + types::IdSortMode::IdAscending.to_string(), + ]), + |s| types::IdSortMode::try_from(s).unwrap(), + )) + .required(false), + ) + .arg( + ::clap::Arg::new("switch-location") + .long("switch-location") + .value_parser(::clap::value_parser!(types::Name)) + .required(true) + .help("A switch location to use when selecting switch ports."), + ) + .about("Fetch the LLDP neighbors seen on a switch port") + } + pub fn cli_rack_list() -> ::clap::Command { ::clap::Command::new("") .arg( @@ -3720,6 +3773,128 @@ impl Cli { .about("List switch ports") } + pub fn cli_networking_switch_port_lldp_config_view() -> ::clap::Command { + ::clap::Command::new("") + .arg( + ::clap::Arg::new("port") + .long("port") + .value_parser(::clap::value_parser!(types::Name)) + .required(true) + .help("A name to use when selecting switch ports."), + ) + .arg( + ::clap::Arg::new("rack-id") + .long("rack-id") + .value_parser(::clap::value_parser!(uuid::Uuid)) + .required(true) + .help("A rack id to use when selecting switch ports."), + ) + .arg( + ::clap::Arg::new("switch-location") + .long("switch-location") + .value_parser(::clap::value_parser!(types::Name)) + .required(true) + .help("A switch location to use when selecting switch ports."), + ) + .about("Fetch the LLDP configuration for a switch port") + } + + pub fn cli_networking_switch_port_lldp_config_update() -> ::clap::Command { + ::clap::Command::new("") + .arg( + ::clap::Arg::new("chassis-id") + .long("chassis-id") + .value_parser(::clap::value_parser!(::std::string::String)) + .required(false) + .help("The LLDP chassis identifier TLV."), + ) + .arg( + ::clap::Arg::new("enabled") + .long("enabled") + .value_parser(::clap::value_parser!(bool)) + .required_unless_present("json-body") + .help("Whether or not the LLDP service is enabled."), + ) + .arg( + ::clap::Arg::new("id") + .long("id") + .value_parser(::clap::value_parser!(uuid::Uuid)) + .required_unless_present("json-body") + .help("The id of this LLDP service instance."), + ) + .arg( + ::clap::Arg::new("link-description") + .long("link-description") + .value_parser(::clap::value_parser!(::std::string::String)) + .required(false) + .help("The LLDP link description TLV."), + ) + .arg( + ::clap::Arg::new("link-name") + .long("link-name") + .value_parser(::clap::value_parser!(::std::string::String)) + .required(false) + .help("The LLDP link name TLV."), + ) + .arg( + ::clap::Arg::new("management-ip") + .long("management-ip") + .value_parser(::clap::value_parser!(types::IpNet)) + .required(false) + .help("The LLDP management IP TLV."), + ) + .arg( + ::clap::Arg::new("port") + .long("port") + .value_parser(::clap::value_parser!(types::Name)) + .required(true) + .help("A name to use when selecting switch ports."), + ) + .arg( + ::clap::Arg::new("rack-id") + .long("rack-id") + .value_parser(::clap::value_parser!(uuid::Uuid)) + .required(true) + .help("A rack id to use when selecting switch ports."), + ) + .arg( + ::clap::Arg::new("switch-location") + .long("switch-location") + .value_parser(::clap::value_parser!(types::Name)) + .required(true) + .help("A switch location to use when selecting switch ports."), + ) + .arg( + ::clap::Arg::new("system-description") + .long("system-description") + .value_parser(::clap::value_parser!(::std::string::String)) + .required(false) + .help("The LLDP system description TLV."), + ) + .arg( + ::clap::Arg::new("system-name") + .long("system-name") + .value_parser(::clap::value_parser!(::std::string::String)) + .required(false) + .help("The LLDP system name TLV."), + ) + .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 the LLDP configuration for a switch port") + } + pub fn cli_networking_switch_port_apply_settings() -> ::clap::Command { ::clap::Command::new("") .arg( @@ -6930,6 +7105,10 @@ impl Cli { CliCommand::SnapshotDelete => self.execute_snapshot_delete(matches).await, CliCommand::PhysicalDiskList => self.execute_physical_disk_list(matches).await, CliCommand::PhysicalDiskView => self.execute_physical_disk_view(matches).await, + CliCommand::NetworkingSwitchPortLldpNeighbors => { + self.execute_networking_switch_port_lldp_neighbors(matches) + .await + } CliCommand::RackList => self.execute_rack_list(matches).await, CliCommand::RackView => self.execute_rack_view(matches).await, CliCommand::SledList => self.execute_sled_list(matches).await, @@ -6946,6 +7125,14 @@ impl Cli { CliCommand::NetworkingSwitchPortList => { self.execute_networking_switch_port_list(matches).await } + CliCommand::NetworkingSwitchPortLldpConfigView => { + self.execute_networking_switch_port_lldp_config_view(matches) + .await + } + CliCommand::NetworkingSwitchPortLldpConfigUpdate => { + self.execute_networking_switch_port_lldp_config_update(matches) + .await + } CliCommand::NetworkingSwitchPortApplySettings => { self.execute_networking_switch_port_apply_settings(matches) .await @@ -10638,6 +10825,58 @@ impl Cli { } } + pub async fn execute_networking_switch_port_lldp_neighbors( + &self, + matches: &::clap::ArgMatches, + ) -> anyhow::Result<()> { + let mut request = self.client.networking_switch_port_lldp_neighbors(); + if let Some(value) = matches.get_one::("limit") { + request = request.limit(value.clone()); + } + + if let Some(value) = matches.get_one::("port") { + request = request.port(value.clone()); + } + + if let Some(value) = matches.get_one::("rack-id") { + request = request.rack_id(value.clone()); + } + + if let Some(value) = matches.get_one::("sort-by") { + request = request.sort_by(value.clone()); + } + + if let Some(value) = matches.get_one::("switch-location") { + request = request.switch_location(value.clone()); + } + + self.config + .execute_networking_switch_port_lldp_neighbors(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_rack_list(&self, matches: &::clap::ArgMatches) -> anyhow::Result<()> { let mut request = self.client.rack_list(); if let Some(value) = matches.get_one::("limit") { @@ -10982,6 +11221,108 @@ impl Cli { } } + pub async fn execute_networking_switch_port_lldp_config_view( + &self, + matches: &::clap::ArgMatches, + ) -> anyhow::Result<()> { + let mut request = self.client.networking_switch_port_lldp_config_view(); + if let Some(value) = matches.get_one::("port") { + request = request.port(value.clone()); + } + + if let Some(value) = matches.get_one::("rack-id") { + request = request.rack_id(value.clone()); + } + + if let Some(value) = matches.get_one::("switch-location") { + request = request.switch_location(value.clone()); + } + + self.config + .execute_networking_switch_port_lldp_config_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_networking_switch_port_lldp_config_update( + &self, + matches: &::clap::ArgMatches, + ) -> anyhow::Result<()> { + let mut request = self.client.networking_switch_port_lldp_config_update(); + if let Some(value) = matches.get_one::<::std::string::String>("chassis-id") { + request = request.body_map(|body| body.chassis_id(value.clone())) + } + + if let Some(value) = matches.get_one::("enabled") { + request = request.body_map(|body| body.enabled(value.clone())) + } + + if let Some(value) = matches.get_one::("id") { + request = request.body_map(|body| body.id(value.clone())) + } + + if let Some(value) = matches.get_one::<::std::string::String>("link-description") { + request = request.body_map(|body| body.link_description(value.clone())) + } + + if let Some(value) = matches.get_one::<::std::string::String>("link-name") { + request = request.body_map(|body| body.link_name(value.clone())) + } + + if let Some(value) = matches.get_one::("management-ip") { + request = request.body_map(|body| body.management_ip(value.clone())) + } + + if let Some(value) = matches.get_one::("port") { + request = request.port(value.clone()); + } + + if let Some(value) = matches.get_one::("rack-id") { + request = request.rack_id(value.clone()); + } + + if let Some(value) = matches.get_one::("switch-location") { + request = request.switch_location(value.clone()); + } + + if let Some(value) = matches.get_one::<::std::string::String>("system-description") { + request = request.body_map(|body| body.system_description(value.clone())) + } + + if let Some(value) = matches.get_one::<::std::string::String>("system-name") { + request = request.body_map(|body| body.system_name(value.clone())) + } + + if let Some(value) = matches.get_one::("json-body") { + let body_txt = std::fs::read_to_string(value).unwrap(); + let body_value = serde_json::from_str::(&body_txt).unwrap(); + request = request.body(body_value); + } + + self.config + .execute_networking_switch_port_lldp_config_update(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_networking_switch_port_apply_settings( &self, matches: &::clap::ArgMatches, @@ -15356,6 +15697,14 @@ pub trait CliConfig { Ok(()) } + fn execute_networking_switch_port_lldp_neighbors( + &self, + matches: &::clap::ArgMatches, + request: &mut builder::NetworkingSwitchPortLldpNeighbors, + ) -> anyhow::Result<()> { + Ok(()) + } + fn execute_rack_list( &self, matches: &::clap::ArgMatches, @@ -15436,6 +15785,22 @@ pub trait CliConfig { Ok(()) } + fn execute_networking_switch_port_lldp_config_view( + &self, + matches: &::clap::ArgMatches, + request: &mut builder::NetworkingSwitchPortLldpConfigView, + ) -> anyhow::Result<()> { + Ok(()) + } + + fn execute_networking_switch_port_lldp_config_update( + &self, + matches: &::clap::ArgMatches, + request: &mut builder::NetworkingSwitchPortLldpConfigUpdate, + ) -> anyhow::Result<()> { + Ok(()) + } + fn execute_networking_switch_port_apply_settings( &self, matches: &::clap::ArgMatches, @@ -16375,6 +16740,7 @@ pub enum CliCommand { SnapshotDelete, PhysicalDiskList, PhysicalDiskView, + NetworkingSwitchPortLldpNeighbors, RackList, RackView, SledList, @@ -16385,6 +16751,8 @@ pub enum CliCommand { SledSetProvisionPolicy, SledListUninitialized, NetworkingSwitchPortList, + NetworkingSwitchPortLldpConfigView, + NetworkingSwitchPortLldpConfigUpdate, NetworkingSwitchPortApplySettings, NetworkingSwitchPortClearSettings, NetworkingSwitchPortStatus, @@ -16598,6 +16966,7 @@ impl CliCommand { CliCommand::SnapshotDelete, CliCommand::PhysicalDiskList, CliCommand::PhysicalDiskView, + CliCommand::NetworkingSwitchPortLldpNeighbors, CliCommand::RackList, CliCommand::RackView, CliCommand::SledList, @@ -16608,6 +16977,8 @@ impl CliCommand { CliCommand::SledSetProvisionPolicy, CliCommand::SledListUninitialized, CliCommand::NetworkingSwitchPortList, + CliCommand::NetworkingSwitchPortLldpConfigView, + CliCommand::NetworkingSwitchPortLldpConfigUpdate, CliCommand::NetworkingSwitchPortApplySettings, CliCommand::NetworkingSwitchPortClearSettings, CliCommand::NetworkingSwitchPortStatus, diff --git a/oxide.json b/oxide.json index bc043059..45f2d478 100644 --- a/oxide.json +++ b/oxide.json @@ -5134,6 +5134,93 @@ } } }, + "/v1/system/hardware/rack-switch-port/{rack_id}/{switch_location}/{port}/lldp/neighbors": { + "get": { + "tags": [ + "system/networking" + ], + "summary": "Fetch the LLDP neighbors seen on a switch port", + "operationId": "networking_switch_port_lldp_neighbors", + "parameters": [ + { + "in": "path", + "name": "port", + "description": "A name to use when selecting switch ports.", + "required": true, + "schema": { + "$ref": "#/components/schemas/Name" + } + }, + { + "in": "path", + "name": "rack_id", + "description": "A rack id to use when selecting switch ports.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "in": "path", + "name": "switch_location", + "description": "A switch location to use when selecting switch ports.", + "required": true, + "schema": { + "$ref": "#/components/schemas/Name" + } + }, + { + "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/LldpNeighborResultsPage" + } + } + } + }, + "4XX": { + "$ref": "#/components/responses/Error" + }, + "5XX": { + "$ref": "#/components/responses/Error" + } + }, + "x-dropshot-pagination": { + "required": [] + } + } + }, "/v1/system/hardware/racks": { "get": { "tags": [ @@ -5673,6 +5760,121 @@ } } }, + "/v1/system/hardware/switch-port/{port}/lldp/config": { + "get": { + "tags": [ + "system/networking" + ], + "summary": "Fetch the LLDP configuration for a switch port", + "operationId": "networking_switch_port_lldp_config_view", + "parameters": [ + { + "in": "path", + "name": "port", + "description": "A name to use when selecting switch ports.", + "required": true, + "schema": { + "$ref": "#/components/schemas/Name" + } + }, + { + "in": "query", + "name": "rack_id", + "description": "A rack id to use when selecting switch ports.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "in": "query", + "name": "switch_location", + "description": "A switch location to use when selecting switch ports.", + "required": true, + "schema": { + "$ref": "#/components/schemas/Name" + } + } + ], + "responses": { + "200": { + "description": "successful operation", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/LldpLinkConfig" + } + } + } + }, + "4XX": { + "$ref": "#/components/responses/Error" + }, + "5XX": { + "$ref": "#/components/responses/Error" + } + } + }, + "post": { + "tags": [ + "system/networking" + ], + "summary": "Update the LLDP configuration for a switch port", + "operationId": "networking_switch_port_lldp_config_update", + "parameters": [ + { + "in": "path", + "name": "port", + "description": "A name to use when selecting switch ports.", + "required": true, + "schema": { + "$ref": "#/components/schemas/Name" + } + }, + { + "in": "query", + "name": "rack_id", + "description": "A rack id to use when selecting switch ports.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "in": "query", + "name": "switch_location", + "description": "A switch location to use when selecting switch ports.", + "required": true, + "schema": { + "$ref": "#/components/schemas/Name" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/LldpLinkConfig" + } + } + }, + "required": true + }, + "responses": { + "204": { + "description": "resource updated" + }, + "4XX": { + "$ref": "#/components/responses/Error" + }, + "5XX": { + "$ref": "#/components/responses/Error" + } + } + } + }, "/v1/system/hardware/switch-port/{port}/settings": { "post": { "tags": [ @@ -17796,6 +17998,85 @@ "enabled" ] }, + "LldpNeighbor": { + "description": "Information about LLDP advertisements from other network entities directly connected to a switch port. This structure contains both metadata about when and where the neighbor was seen, as well as the specific information the neighbor was advertising.", + "type": "object", + "properties": { + "chassis_id": { + "description": "The LLDP chassis identifier advertised by the neighbor", + "type": "string" + }, + "first_seen": { + "description": "Initial sighting of this LldpNeighbor", + "type": "string", + "format": "date-time" + }, + "last_seen": { + "description": "Most recent sighting of this LldpNeighbor", + "type": "string", + "format": "date-time" + }, + "link_description": { + "nullable": true, + "description": "The LLDP link description advertised by the neighbor", + "type": "string" + }, + "link_name": { + "description": "The LLDP link name advertised by the neighbor", + "type": "string" + }, + "local_port": { + "description": "The port on which the neighbor was seen", + "type": "string" + }, + "management_ip": { + "description": "The LLDP management IP(s) advertised by the neighbor", + "type": "array", + "items": { + "$ref": "#/components/schemas/IpNet" + } + }, + "system_description": { + "nullable": true, + "description": "The LLDP system description advertised by the neighbor", + "type": "string" + }, + "system_name": { + "nullable": true, + "description": "The LLDP system name advertised by the neighbor", + "type": "string" + } + }, + "required": [ + "chassis_id", + "first_seen", + "last_seen", + "link_name", + "local_port", + "management_ip" + ] + }, + "LldpNeighborResultsPage": { + "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/LldpNeighbor" + } + }, + "next_page": { + "nullable": true, + "description": "token used to fetch the next page of results (if any)", + "type": "string" + } + }, + "required": [ + "items" + ] + }, "LoopbackAddress": { "description": "A loopback address is an address that is assigned to a rack switch but is not associated with any particular port.", "type": "object", diff --git a/sdk-httpmock/src/generated_httpmock.rs b/sdk-httpmock/src/generated_httpmock.rs index 57c46f4f..9744a884 100644 --- a/sdk-httpmock/src/generated_httpmock.rs +++ b/sdk-httpmock/src/generated_httpmock.rs @@ -8459,6 +8459,139 @@ pub mod operations { } } + pub struct NetworkingSwitchPortLldpNeighborsWhen(::httpmock::When); + impl NetworkingSwitchPortLldpNeighborsWhen { + pub fn new(inner: ::httpmock::When) -> Self { + Self( + inner.method(::httpmock::Method::GET).path_matches( + regex::Regex::new( + "^/v1/system/hardware/rack-switch-port/[^/]*/[^/]*/[^/]*/lldp/neighbors$", + ) + .unwrap(), + ), + ) + } + + pub fn into_inner(self) -> ::httpmock::When { + self.0 + } + + pub fn rack_id(self, value: &uuid::Uuid) -> Self { + let re = regex::Regex::new(&format!( + "^/v1/system/hardware/rack-switch-port/{}/.*/.*/lldp/neighbors$", + value.to_string() + )) + .unwrap(); + Self(self.0.path_matches(re)) + } + + pub fn switch_location(self, value: &types::Name) -> Self { + let re = regex::Regex::new(&format!( + "^/v1/system/hardware/rack-switch-port/.*/{}/.*/lldp/neighbors$", + value.to_string() + )) + .unwrap(); + Self(self.0.path_matches(re)) + } + + pub fn port(self, value: &types::Name) -> Self { + let re = regex::Regex::new(&format!( + "^/v1/system/hardware/rack-switch-port/.*/.*/{}/lldp/neighbors$", + 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 NetworkingSwitchPortLldpNeighborsThen(::httpmock::Then); + impl NetworkingSwitchPortLldpNeighborsThen { + pub fn new(inner: ::httpmock::Then) -> Self { + Self(inner) + } + + pub fn into_inner(self) -> ::httpmock::Then { + self.0 + } + + pub fn ok(self, value: &types::LldpNeighborResultsPage) -> 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 RackListWhen(::httpmock::When); impl RackListWhen { pub fn new(inner: ::httpmock::When) -> Self { @@ -9342,6 +9475,145 @@ pub mod operations { } } + pub struct NetworkingSwitchPortLldpConfigViewWhen(::httpmock::When); + impl NetworkingSwitchPortLldpConfigViewWhen { + pub fn new(inner: ::httpmock::When) -> Self { + Self(inner.method(::httpmock::Method::GET).path_matches( + regex::Regex::new("^/v1/system/hardware/switch-port/[^/]*/lldp/config$").unwrap(), + )) + } + + pub fn into_inner(self) -> ::httpmock::When { + self.0 + } + + pub fn port(self, value: &types::Name) -> Self { + let re = regex::Regex::new(&format!( + "^/v1/system/hardware/switch-port/{}/lldp/config$", + value.to_string() + )) + .unwrap(); + Self(self.0.path_matches(re)) + } + + pub fn rack_id(self, value: &uuid::Uuid) -> Self { + Self(self.0.query_param("rack_id", value.to_string())) + } + + pub fn switch_location(self, value: &types::Name) -> Self { + Self(self.0.query_param("switch_location", value.to_string())) + } + } + + pub struct NetworkingSwitchPortLldpConfigViewThen(::httpmock::Then); + impl NetworkingSwitchPortLldpConfigViewThen { + pub fn new(inner: ::httpmock::Then) -> Self { + Self(inner) + } + + pub fn into_inner(self) -> ::httpmock::Then { + self.0 + } + + pub fn ok(self, value: &types::LldpLinkConfig) -> 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 NetworkingSwitchPortLldpConfigUpdateWhen(::httpmock::When); + impl NetworkingSwitchPortLldpConfigUpdateWhen { + pub fn new(inner: ::httpmock::When) -> Self { + Self(inner.method(::httpmock::Method::POST).path_matches( + regex::Regex::new("^/v1/system/hardware/switch-port/[^/]*/lldp/config$").unwrap(), + )) + } + + pub fn into_inner(self) -> ::httpmock::When { + self.0 + } + + pub fn port(self, value: &types::Name) -> Self { + let re = regex::Regex::new(&format!( + "^/v1/system/hardware/switch-port/{}/lldp/config$", + value.to_string() + )) + .unwrap(); + Self(self.0.path_matches(re)) + } + + pub fn rack_id(self, value: &uuid::Uuid) -> Self { + Self(self.0.query_param("rack_id", value.to_string())) + } + + pub fn switch_location(self, value: &types::Name) -> Self { + Self(self.0.query_param("switch_location", value.to_string())) + } + + pub fn body(self, value: &types::LldpLinkConfig) -> Self { + Self(self.0.json_body_obj(value)) + } + } + + pub struct NetworkingSwitchPortLldpConfigUpdateThen(::httpmock::Then); + impl NetworkingSwitchPortLldpConfigUpdateThen { + 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 NetworkingSwitchPortApplySettingsWhen(::httpmock::When); impl NetworkingSwitchPortApplySettingsWhen { pub fn new(inner: ::httpmock::When) -> Self { @@ -17912,6 +18184,12 @@ pub trait MockServerExt { fn physical_disk_view(&self, config_fn: F) -> ::httpmock::Mock where F: FnOnce(operations::PhysicalDiskViewWhen, operations::PhysicalDiskViewThen); + fn networking_switch_port_lldp_neighbors(&self, config_fn: F) -> ::httpmock::Mock + where + F: FnOnce( + operations::NetworkingSwitchPortLldpNeighborsWhen, + operations::NetworkingSwitchPortLldpNeighborsThen, + ); fn rack_list(&self, config_fn: F) -> ::httpmock::Mock where F: FnOnce(operations::RackListWhen, operations::RackListThen); @@ -17945,6 +18223,18 @@ pub trait MockServerExt { operations::NetworkingSwitchPortListWhen, operations::NetworkingSwitchPortListThen, ); + fn networking_switch_port_lldp_config_view(&self, config_fn: F) -> ::httpmock::Mock + where + F: FnOnce( + operations::NetworkingSwitchPortLldpConfigViewWhen, + operations::NetworkingSwitchPortLldpConfigViewThen, + ); + fn networking_switch_port_lldp_config_update(&self, config_fn: F) -> ::httpmock::Mock + where + F: FnOnce( + operations::NetworkingSwitchPortLldpConfigUpdateWhen, + operations::NetworkingSwitchPortLldpConfigUpdateThen, + ); fn networking_switch_port_apply_settings(&self, config_fn: F) -> ::httpmock::Mock where F: FnOnce( @@ -19646,6 +19936,21 @@ impl MockServerExt for ::httpmock::MockServer { }) } + fn networking_switch_port_lldp_neighbors(&self, config_fn: F) -> ::httpmock::Mock + where + F: FnOnce( + operations::NetworkingSwitchPortLldpNeighborsWhen, + operations::NetworkingSwitchPortLldpNeighborsThen, + ), + { + self.mock(|when, then| { + config_fn( + operations::NetworkingSwitchPortLldpNeighborsWhen::new(when), + operations::NetworkingSwitchPortLldpNeighborsThen::new(then), + ) + }) + } + fn rack_list(&self, config_fn: F) -> ::httpmock::Mock where F: FnOnce(operations::RackListWhen, operations::RackListThen), @@ -19769,6 +20074,36 @@ impl MockServerExt for ::httpmock::MockServer { }) } + fn networking_switch_port_lldp_config_view(&self, config_fn: F) -> ::httpmock::Mock + where + F: FnOnce( + operations::NetworkingSwitchPortLldpConfigViewWhen, + operations::NetworkingSwitchPortLldpConfigViewThen, + ), + { + self.mock(|when, then| { + config_fn( + operations::NetworkingSwitchPortLldpConfigViewWhen::new(when), + operations::NetworkingSwitchPortLldpConfigViewThen::new(then), + ) + }) + } + + fn networking_switch_port_lldp_config_update(&self, config_fn: F) -> ::httpmock::Mock + where + F: FnOnce( + operations::NetworkingSwitchPortLldpConfigUpdateWhen, + operations::NetworkingSwitchPortLldpConfigUpdateThen, + ), + { + self.mock(|when, then| { + config_fn( + operations::NetworkingSwitchPortLldpConfigUpdateWhen::new(when), + operations::NetworkingSwitchPortLldpConfigUpdateThen::new(then), + ) + }) + } + fn networking_switch_port_apply_settings(&self, config_fn: F) -> ::httpmock::Mock where F: FnOnce( diff --git a/sdk/src/generated_sdk.rs b/sdk/src/generated_sdk.rs index 1b27acac..488487c5 100644 --- a/sdk/src/generated_sdk.rs +++ b/sdk/src/generated_sdk.rs @@ -15793,6 +15793,180 @@ pub mod types { } } + /// Information about LLDP advertisements from other network entities + /// directly connected to a switch port. This structure contains both + /// metadata about when and where the neighbor was seen, as well as the + /// specific information the neighbor was advertising. + /// + ///
JSON schema + /// + /// ```json + /// { + /// "description": "Information about LLDP advertisements from other + /// network entities directly connected to a switch port. This structure + /// contains both metadata about when and where the neighbor was seen, as + /// well as the specific information the neighbor was advertising.", + /// "type": "object", + /// "required": [ + /// "chassis_id", + /// "first_seen", + /// "last_seen", + /// "link_name", + /// "local_port", + /// "management_ip" + /// ], + /// "properties": { + /// "chassis_id": { + /// "description": "The LLDP chassis identifier advertised by the + /// neighbor", + /// "type": "string" + /// }, + /// "first_seen": { + /// "description": "Initial sighting of this LldpNeighbor", + /// "type": "string", + /// "format": "date-time" + /// }, + /// "last_seen": { + /// "description": "Most recent sighting of this LldpNeighbor", + /// "type": "string", + /// "format": "date-time" + /// }, + /// "link_description": { + /// "description": "The LLDP link description advertised by the + /// neighbor", + /// "type": [ + /// "string", + /// "null" + /// ] + /// }, + /// "link_name": { + /// "description": "The LLDP link name advertised by the neighbor", + /// "type": "string" + /// }, + /// "local_port": { + /// "description": "The port on which the neighbor was seen", + /// "type": "string" + /// }, + /// "management_ip": { + /// "description": "The LLDP management IP(s) advertised by the + /// neighbor", + /// "type": "array", + /// "items": { + /// "$ref": "#/components/schemas/IpNet" + /// } + /// }, + /// "system_description": { + /// "description": "The LLDP system description advertised by the + /// neighbor", + /// "type": [ + /// "string", + /// "null" + /// ] + /// }, + /// "system_name": { + /// "description": "The LLDP system name advertised by the neighbor", + /// "type": [ + /// "string", + /// "null" + /// ] + /// } + /// } + /// } + /// ``` + ///
+ #[derive( + :: serde :: Deserialize, :: serde :: Serialize, Clone, Debug, schemars :: JsonSchema, + )] + pub struct LldpNeighbor { + /// The LLDP chassis identifier advertised by the neighbor + pub chassis_id: ::std::string::String, + /// Initial sighting of this LldpNeighbor + pub first_seen: chrono::DateTime, + /// Most recent sighting of this LldpNeighbor + pub last_seen: chrono::DateTime, + /// The LLDP link description advertised by the neighbor + #[serde(default, skip_serializing_if = "::std::option::Option::is_none")] + pub link_description: ::std::option::Option<::std::string::String>, + /// The LLDP link name advertised by the neighbor + pub link_name: ::std::string::String, + /// The port on which the neighbor was seen + pub local_port: ::std::string::String, + /// The LLDP management IP(s) advertised by the neighbor + pub management_ip: ::std::vec::Vec, + /// The LLDP system description advertised by the neighbor + #[serde(default, skip_serializing_if = "::std::option::Option::is_none")] + pub system_description: ::std::option::Option<::std::string::String>, + /// The LLDP system name advertised by the neighbor + #[serde(default, skip_serializing_if = "::std::option::Option::is_none")] + pub system_name: ::std::option::Option<::std::string::String>, + } + + impl ::std::convert::From<&LldpNeighbor> for LldpNeighbor { + fn from(value: &LldpNeighbor) -> Self { + value.clone() + } + } + + impl LldpNeighbor { + pub fn builder() -> builder::LldpNeighbor { + 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/LldpNeighbor" + /// } + /// }, + /// "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 LldpNeighborResultsPage { + /// 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<&LldpNeighborResultsPage> for LldpNeighborResultsPage { + fn from(value: &LldpNeighborResultsPage) -> Self { + value.clone() + } + } + + impl LldpNeighborResultsPage { + pub fn builder() -> builder::LldpNeighborResultsPage { + Default::default() + } + } + /// A loopback address is an address that is assigned to a rack switch but /// is not associated with any particular port. /// @@ -40607,6 +40781,244 @@ pub mod types { } } + #[derive(Clone, Debug)] + pub struct LldpNeighbor { + chassis_id: ::std::result::Result<::std::string::String, ::std::string::String>, + first_seen: + ::std::result::Result, ::std::string::String>, + last_seen: + ::std::result::Result, ::std::string::String>, + link_description: ::std::result::Result< + ::std::option::Option<::std::string::String>, + ::std::string::String, + >, + link_name: ::std::result::Result<::std::string::String, ::std::string::String>, + local_port: ::std::result::Result<::std::string::String, ::std::string::String>, + management_ip: + ::std::result::Result<::std::vec::Vec, ::std::string::String>, + system_description: ::std::result::Result< + ::std::option::Option<::std::string::String>, + ::std::string::String, + >, + system_name: ::std::result::Result< + ::std::option::Option<::std::string::String>, + ::std::string::String, + >, + } + + impl ::std::default::Default for LldpNeighbor { + fn default() -> Self { + Self { + chassis_id: Err("no value supplied for chassis_id".to_string()), + first_seen: Err("no value supplied for first_seen".to_string()), + last_seen: Err("no value supplied for last_seen".to_string()), + link_description: Ok(Default::default()), + link_name: Err("no value supplied for link_name".to_string()), + local_port: Err("no value supplied for local_port".to_string()), + management_ip: Err("no value supplied for management_ip".to_string()), + system_description: Ok(Default::default()), + system_name: Ok(Default::default()), + } + } + } + + impl LldpNeighbor { + pub fn chassis_id(mut self, value: T) -> Self + where + T: ::std::convert::TryInto<::std::string::String>, + T::Error: ::std::fmt::Display, + { + self.chassis_id = value + .try_into() + .map_err(|e| format!("error converting supplied value for chassis_id: {}", e)); + self + } + pub fn first_seen(mut self, value: T) -> Self + where + T: ::std::convert::TryInto>, + T::Error: ::std::fmt::Display, + { + self.first_seen = value + .try_into() + .map_err(|e| format!("error converting supplied value for first_seen: {}", e)); + self + } + pub fn last_seen(mut self, value: T) -> Self + where + T: ::std::convert::TryInto>, + T::Error: ::std::fmt::Display, + { + self.last_seen = value + .try_into() + .map_err(|e| format!("error converting supplied value for last_seen: {}", e)); + self + } + pub fn link_description(mut self, value: T) -> Self + where + T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>, + T::Error: ::std::fmt::Display, + { + self.link_description = value.try_into().map_err(|e| { + format!( + "error converting supplied value for link_description: {}", + e + ) + }); + self + } + pub fn link_name(mut self, value: T) -> Self + where + T: ::std::convert::TryInto<::std::string::String>, + T::Error: ::std::fmt::Display, + { + self.link_name = value + .try_into() + .map_err(|e| format!("error converting supplied value for link_name: {}", e)); + self + } + pub fn local_port(mut self, value: T) -> Self + where + T: ::std::convert::TryInto<::std::string::String>, + T::Error: ::std::fmt::Display, + { + self.local_port = value + .try_into() + .map_err(|e| format!("error converting supplied value for local_port: {}", e)); + self + } + pub fn management_ip(mut self, value: T) -> Self + where + T: ::std::convert::TryInto<::std::vec::Vec>, + T::Error: ::std::fmt::Display, + { + self.management_ip = value.try_into().map_err(|e| { + format!("error converting supplied value for management_ip: {}", e) + }); + self + } + pub fn system_description(mut self, value: T) -> Self + where + T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>, + T::Error: ::std::fmt::Display, + { + self.system_description = value.try_into().map_err(|e| { + format!( + "error converting supplied value for system_description: {}", + e + ) + }); + self + } + pub fn system_name(mut self, value: T) -> Self + where + T: ::std::convert::TryInto<::std::option::Option<::std::string::String>>, + T::Error: ::std::fmt::Display, + { + self.system_name = value + .try_into() + .map_err(|e| format!("error converting supplied value for system_name: {}", e)); + self + } + } + + impl ::std::convert::TryFrom for super::LldpNeighbor { + type Error = super::error::ConversionError; + fn try_from( + value: LldpNeighbor, + ) -> ::std::result::Result { + Ok(Self { + chassis_id: value.chassis_id?, + first_seen: value.first_seen?, + last_seen: value.last_seen?, + link_description: value.link_description?, + link_name: value.link_name?, + local_port: value.local_port?, + management_ip: value.management_ip?, + system_description: value.system_description?, + system_name: value.system_name?, + }) + } + } + + impl ::std::convert::From for LldpNeighbor { + fn from(value: super::LldpNeighbor) -> Self { + Self { + chassis_id: Ok(value.chassis_id), + first_seen: Ok(value.first_seen), + last_seen: Ok(value.last_seen), + link_description: Ok(value.link_description), + link_name: Ok(value.link_name), + local_port: Ok(value.local_port), + management_ip: Ok(value.management_ip), + system_description: Ok(value.system_description), + system_name: Ok(value.system_name), + } + } + } + + #[derive(Clone, Debug)] + pub struct LldpNeighborResultsPage { + 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 LldpNeighborResultsPage { + fn default() -> Self { + Self { + items: Err("no value supplied for items".to_string()), + next_page: Ok(Default::default()), + } + } + } + + impl LldpNeighborResultsPage { + 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::LldpNeighborResultsPage { + type Error = super::error::ConversionError; + fn try_from( + value: LldpNeighborResultsPage, + ) -> ::std::result::Result { + Ok(Self { + items: value.items?, + next_page: value.next_page?, + }) + } + } + + impl ::std::convert::From for LldpNeighborResultsPage { + fn from(value: super::LldpNeighborResultsPage) -> Self { + Self { + items: Ok(value.items), + next_page: Ok(value.next_page), + } + } + } + #[derive(Clone, Debug)] pub struct LoopbackAddress { address: ::std::result::Result, @@ -54038,6 +54450,77 @@ impl ClientSystemMetricsExt for Client { /// This provides rack-level network configuration. pub trait ClientSystemNetworkingExt { + /// Fetch the LLDP neighbors seen on a switch port + /// + /// Sends a `GET` request to + /// `/v1/system/hardware/rack-switch-port/{rack_id}/{switch_location}/ + /// {port}/lldp/neighbors` + /// + /// Arguments: + /// - `rack_id`: A rack id to use when selecting switch ports. + /// - `switch_location`: A switch location to use when selecting switch + /// ports. + /// - `port`: A name to use when selecting switch ports. + /// - `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.networking_switch_port_lldp_neighbors() + /// .rack_id(rack_id) + /// .switch_location(switch_location) + /// .port(port) + /// .limit(limit) + /// .page_token(page_token) + /// .sort_by(sort_by) + /// .send() + /// .await; + /// ``` + fn networking_switch_port_lldp_neighbors(&self) -> builder::NetworkingSwitchPortLldpNeighbors; + /// Fetch the LLDP configuration for a switch port + /// + /// Sends a `GET` request to + /// `/v1/system/hardware/switch-port/{port}/lldp/config` + /// + /// Arguments: + /// - `port`: A name to use when selecting switch ports. + /// - `rack_id`: A rack id to use when selecting switch ports. + /// - `switch_location`: A switch location to use when selecting switch + /// ports. + /// ```ignore + /// let response = client.networking_switch_port_lldp_config_view() + /// .port(port) + /// .rack_id(rack_id) + /// .switch_location(switch_location) + /// .send() + /// .await; + /// ``` + fn networking_switch_port_lldp_config_view( + &self, + ) -> builder::NetworkingSwitchPortLldpConfigView; + /// Update the LLDP configuration for a switch port + /// + /// Sends a `POST` request to + /// `/v1/system/hardware/switch-port/{port}/lldp/config` + /// + /// Arguments: + /// - `port`: A name to use when selecting switch ports. + /// - `rack_id`: A rack id to use when selecting switch ports. + /// - `switch_location`: A switch location to use when selecting switch + /// ports. + /// - `body` + /// ```ignore + /// let response = client.networking_switch_port_lldp_config_update() + /// .port(port) + /// .rack_id(rack_id) + /// .switch_location(switch_location) + /// .body(body) + /// .send() + /// .await; + /// ``` + fn networking_switch_port_lldp_config_update( + &self, + ) -> builder::NetworkingSwitchPortLldpConfigUpdate; /// List address lots /// /// Sends a `GET` request to `/v1/system/networking/address-lot` @@ -54422,6 +54905,22 @@ pub trait ClientSystemNetworkingExt { } impl ClientSystemNetworkingExt for Client { + fn networking_switch_port_lldp_neighbors(&self) -> builder::NetworkingSwitchPortLldpNeighbors { + builder::NetworkingSwitchPortLldpNeighbors::new(self) + } + + fn networking_switch_port_lldp_config_view( + &self, + ) -> builder::NetworkingSwitchPortLldpConfigView { + builder::NetworkingSwitchPortLldpConfigView::new(self) + } + + fn networking_switch_port_lldp_config_update( + &self, + ) -> builder::NetworkingSwitchPortLldpConfigUpdate { + builder::NetworkingSwitchPortLldpConfigUpdate::new(self) + } + fn networking_address_lot_list(&self) -> builder::NetworkingAddressLotList { builder::NetworkingAddressLotList::new(self) } @@ -66116,66 +66615,261 @@ pub mod builder { } } - /// Builder for [`ClientSystemHardwareExt::physical_disk_view`] - /// - /// [`ClientSystemHardwareExt::physical_disk_view`]: super::ClientSystemHardwareExt::physical_disk_view - #[derive(Debug, Clone)] - pub struct PhysicalDiskView<'a> { - client: &'a super::Client, - disk_id: Result, - } - - impl<'a> PhysicalDiskView<'a> { - pub fn new(client: &'a super::Client) -> Self { - Self { - client: client, - disk_id: Err("disk_id was not initialized".to_string()), - } - } - - pub fn disk_id(mut self, value: V) -> Self - where - V: std::convert::TryInto, - { - self.disk_id = value - .try_into() - .map_err(|_| "conversion to `uuid :: Uuid` for disk_id failed".to_string()); - self - } - - /// Sends a `GET` request to `/v1/system/hardware/disks/{disk_id}` - pub async fn send(self) -> Result, Error> { - let Self { client, disk_id } = self; - let disk_id = disk_id.map_err(Error::InvalidRequest)?; - let url = format!( - "{}/v1/system/hardware/disks/{}", - client.baseurl, - encode_path(&disk_id.to_string()), - ); - #[allow(unused_mut)] - let mut request = client - .client - .get(url) - .header( - reqwest::header::ACCEPT, - reqwest::header::HeaderValue::from_static("application/json"), - ) - .build()?; - let result = client.client.execute(request).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 [`ClientSystemHardwareExt::physical_disk_view`] + /// + /// [`ClientSystemHardwareExt::physical_disk_view`]: super::ClientSystemHardwareExt::physical_disk_view + #[derive(Debug, Clone)] + pub struct PhysicalDiskView<'a> { + client: &'a super::Client, + disk_id: Result, + } + + impl<'a> PhysicalDiskView<'a> { + pub fn new(client: &'a super::Client) -> Self { + Self { + client: client, + disk_id: Err("disk_id was not initialized".to_string()), + } + } + + pub fn disk_id(mut self, value: V) -> Self + where + V: std::convert::TryInto, + { + self.disk_id = value + .try_into() + .map_err(|_| "conversion to `uuid :: Uuid` for disk_id failed".to_string()); + self + } + + /// Sends a `GET` request to `/v1/system/hardware/disks/{disk_id}` + pub async fn send(self) -> Result, Error> { + let Self { client, disk_id } = self; + let disk_id = disk_id.map_err(Error::InvalidRequest)?; + let url = format!( + "{}/v1/system/hardware/disks/{}", + client.baseurl, + encode_path(&disk_id.to_string()), + ); + #[allow(unused_mut)] + let mut request = client + .client + .get(url) + .header( + reqwest::header::ACCEPT, + reqwest::header::HeaderValue::from_static("application/json"), + ) + .build()?; + let result = client.client.execute(request).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_switch_port_lldp_neighbors`] + /// + /// [`ClientSystemNetworkingExt::networking_switch_port_lldp_neighbors`]: super::ClientSystemNetworkingExt::networking_switch_port_lldp_neighbors + #[derive(Debug, Clone)] + pub struct NetworkingSwitchPortLldpNeighbors<'a> { + client: &'a super::Client, + rack_id: Result, + switch_location: Result, + port: Result, + limit: Result, String>, + page_token: Result, String>, + sort_by: Result, String>, + } + + impl<'a> NetworkingSwitchPortLldpNeighbors<'a> { + pub fn new(client: &'a super::Client) -> Self { + Self { + client: client, + rack_id: Err("rack_id was not initialized".to_string()), + switch_location: Err("switch_location was not initialized".to_string()), + port: Err("port was not initialized".to_string()), + limit: Ok(None), + page_token: Ok(None), + sort_by: Ok(None), + } + } + + pub fn rack_id(mut self, value: V) -> Self + where + V: std::convert::TryInto, + { + self.rack_id = value + .try_into() + .map_err(|_| "conversion to `uuid :: Uuid` for rack_id failed".to_string()); + self + } + + pub fn switch_location(mut self, value: V) -> Self + where + V: std::convert::TryInto, + { + self.switch_location = value + .try_into() + .map_err(|_| "conversion to `Name` for switch_location failed".to_string()); + self + } + + pub fn port(mut self, value: V) -> Self + where + V: std::convert::TryInto, + { + self.port = value + .try_into() + .map_err(|_| "conversion to `Name` for port failed".to_string()); + self + } + + pub fn limit(mut self, value: V) -> Self + where + V: std::convert::TryInto, + { + self.limit = value.try_into().map(Some).map_err(|_| { + "conversion to `std :: num :: NonZeroU32` for limit failed".to_string() + }); + self + } + + pub fn page_token(mut self, value: V) -> Self + where + V: std::convert::TryInto<::std::string::String>, + { + self.page_token = value.try_into().map(Some).map_err(|_| { + "conversion to `:: std :: string :: String` for page_token failed".to_string() + }); + self + } + + pub fn sort_by(mut self, value: V) -> Self + where + V: std::convert::TryInto, + { + self.sort_by = value + .try_into() + .map(Some) + .map_err(|_| "conversion to `IdSortMode` for sort_by failed".to_string()); + self + } + + /// Sends a `GET` request to + /// `/v1/system/hardware/rack-switch-port/{rack_id}/{switch_location}/ + /// {port}/lldp/neighbors` + pub async fn send( + self, + ) -> Result, Error> { + let Self { + client, + rack_id, + switch_location, + port, + limit, + page_token, + sort_by, + } = self; + let rack_id = rack_id.map_err(Error::InvalidRequest)?; + let switch_location = switch_location.map_err(Error::InvalidRequest)?; + let port = port.map_err(Error::InvalidRequest)?; + let limit = limit.map_err(Error::InvalidRequest)?; + let page_token = page_token.map_err(Error::InvalidRequest)?; + let sort_by = sort_by.map_err(Error::InvalidRequest)?; + let url = format!( + "{}/v1/system/hardware/rack-switch-port/{}/{}/{}/lldp/neighbors", + client.baseurl, + encode_path(&rack_id.to_string()), + encode_path(&switch_location.to_string()), + encode_path(&port.to_string()), + ); + #[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)) + .build()?; + let result = client.client.execute(request).await; + let response = result?; + match response.status().as_u16() { + 200u16 => ResponseValue::from_response(response).await, + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + + /// Streams `GET` requests to + /// `/v1/system/hardware/rack-switch-port/{rack_id}/{switch_location}/ + /// {port}/lldp/neighbors` + 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 [`ClientSystemHardwareExt::rack_list`] /// /// [`ClientSystemHardwareExt::rack_list`]: super::ClientSystemHardwareExt::rack_list @@ -67364,6 +68058,231 @@ pub mod builder { } } + /// Builder for + /// [`ClientSystemNetworkingExt::networking_switch_port_lldp_config_view`] + /// + /// [`ClientSystemNetworkingExt::networking_switch_port_lldp_config_view`]: super::ClientSystemNetworkingExt::networking_switch_port_lldp_config_view + #[derive(Debug, Clone)] + pub struct NetworkingSwitchPortLldpConfigView<'a> { + client: &'a super::Client, + port: Result, + rack_id: Result, + switch_location: Result, + } + + impl<'a> NetworkingSwitchPortLldpConfigView<'a> { + pub fn new(client: &'a super::Client) -> Self { + Self { + client: client, + port: Err("port was not initialized".to_string()), + rack_id: Err("rack_id was not initialized".to_string()), + switch_location: Err("switch_location was not initialized".to_string()), + } + } + + pub fn port(mut self, value: V) -> Self + where + V: std::convert::TryInto, + { + self.port = value + .try_into() + .map_err(|_| "conversion to `Name` for port failed".to_string()); + self + } + + pub fn rack_id(mut self, value: V) -> Self + where + V: std::convert::TryInto, + { + self.rack_id = value + .try_into() + .map_err(|_| "conversion to `uuid :: Uuid` for rack_id failed".to_string()); + self + } + + pub fn switch_location(mut self, value: V) -> Self + where + V: std::convert::TryInto, + { + self.switch_location = value + .try_into() + .map_err(|_| "conversion to `Name` for switch_location failed".to_string()); + self + } + + /// Sends a `GET` request to + /// `/v1/system/hardware/switch-port/{port}/lldp/config` + pub async fn send( + self, + ) -> Result, Error> { + let Self { + client, + port, + rack_id, + switch_location, + } = self; + let port = port.map_err(Error::InvalidRequest)?; + let rack_id = rack_id.map_err(Error::InvalidRequest)?; + let switch_location = switch_location.map_err(Error::InvalidRequest)?; + let url = format!( + "{}/v1/system/hardware/switch-port/{}/lldp/config", + client.baseurl, + encode_path(&port.to_string()), + ); + #[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("rack_id", &rack_id)) + .query(&progenitor_client::QueryParam::new( + "switch_location", + &switch_location, + )) + .build()?; + let result = client.client.execute(request).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_switch_port_lldp_config_update`] + /// + /// [`ClientSystemNetworkingExt::networking_switch_port_lldp_config_update`]: super::ClientSystemNetworkingExt::networking_switch_port_lldp_config_update + #[derive(Debug, Clone)] + pub struct NetworkingSwitchPortLldpConfigUpdate<'a> { + client: &'a super::Client, + port: Result, + rack_id: Result, + switch_location: Result, + body: Result, + } + + impl<'a> NetworkingSwitchPortLldpConfigUpdate<'a> { + pub fn new(client: &'a super::Client) -> Self { + Self { + client: client, + port: Err("port was not initialized".to_string()), + rack_id: Err("rack_id was not initialized".to_string()), + switch_location: Err("switch_location was not initialized".to_string()), + body: Ok(::std::default::Default::default()), + } + } + + pub fn port(mut self, value: V) -> Self + where + V: std::convert::TryInto, + { + self.port = value + .try_into() + .map_err(|_| "conversion to `Name` for port failed".to_string()); + self + } + + pub fn rack_id(mut self, value: V) -> Self + where + V: std::convert::TryInto, + { + self.rack_id = value + .try_into() + .map_err(|_| "conversion to `uuid :: Uuid` for rack_id failed".to_string()); + self + } + + pub fn switch_location(mut self, value: V) -> Self + where + V: std::convert::TryInto, + { + self.switch_location = value + .try_into() + .map_err(|_| "conversion to `Name` for switch_location 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 `LldpLinkConfig` for body failed: {}", s)); + self + } + + pub fn body_map(mut self, f: F) -> Self + where + F: std::ops::FnOnce(types::builder::LldpLinkConfig) -> types::builder::LldpLinkConfig, + { + self.body = self.body.map(f); + self + } + + /// Sends a `POST` request to + /// `/v1/system/hardware/switch-port/{port}/lldp/config` + pub async fn send(self) -> Result, Error> { + let Self { + client, + port, + rack_id, + switch_location, + body, + } = self; + let port = port.map_err(Error::InvalidRequest)?; + let rack_id = rack_id.map_err(Error::InvalidRequest)?; + let switch_location = switch_location.map_err(Error::InvalidRequest)?; + let body = body + .and_then(|v| types::LldpLinkConfig::try_from(v).map_err(|e| e.to_string())) + .map_err(Error::InvalidRequest)?; + let url = format!( + "{}/v1/system/hardware/switch-port/{}/lldp/config", + client.baseurl, + encode_path(&port.to_string()), + ); + #[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("rack_id", &rack_id)) + .query(&progenitor_client::QueryParam::new( + "switch_location", + &switch_location, + )) + .build()?; + let result = client.client.execute(request).await; + let response = result?; + match response.status().as_u16() { + 204u16 => Ok(ResponseValue::empty(response)), + 400u16..=499u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + 500u16..=599u16 => Err(Error::ErrorResponse( + ResponseValue::from_response(response).await?, + )), + _ => Err(Error::UnexpectedResponse(response)), + } + } + } + /// Builder for /// [`ClientSystemHardwareExt::networking_switch_port_apply_settings`] /// From 831831914178a858f8b7cbe2124554cdfd93b6ad Mon Sep 17 00:00:00 2001 From: "oxide-reflector-bot[bot]" <130185838+oxide-reflector-bot[bot]@users.noreply.github.com> Date: Wed, 29 Jan 2025 18:31:26 +0000 Subject: [PATCH 15/17] Rebuilt with latest dependency updates --- Cargo.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index e09f0744..f1fadc0a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2480,7 +2480,7 @@ dependencies = [ [[package]] name = "progenitor" version = "0.9.1" -source = "git+https://github.com/oxidecomputer/progenitor#8a15f874d1f4ff1098cb5dc8abbc25af38d90884" +source = "git+https://github.com/oxidecomputer/progenitor#8d130e72db63c46438e6ea56add88381b2d979ba" dependencies = [ "progenitor-impl", ] @@ -2503,7 +2503,7 @@ dependencies = [ [[package]] name = "progenitor-impl" version = "0.9.1" -source = "git+https://github.com/oxidecomputer/progenitor#8a15f874d1f4ff1098cb5dc8abbc25af38d90884" +source = "git+https://github.com/oxidecomputer/progenitor#8d130e72db63c46438e6ea56add88381b2d979ba" dependencies = [ "heck", "http 1.2.0", From 9aa3eff05a36f5cbe61db02cc6edf4213490e88b Mon Sep 17 00:00:00 2001 From: "oxide-reflector-bot[bot]" <130185838+oxide-reflector-bot[bot]@users.noreply.github.com> Date: Sat, 1 Feb 2025 21:00:14 +0000 Subject: [PATCH 16/17] 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 45f2d478..c94b5970 100644 --- a/oxide.json +++ b/oxide.json @@ -7,7 +7,7 @@ "url": "https://oxide.computer", "email": "api@oxide.computer" }, - "version": "20241204.0.0" + "version": "20250212.0.0" }, "paths": { "/device/auth": { diff --git a/sdk/src/generated_sdk.rs b/sdk/src/generated_sdk.rs index 488487c5..629c7ecf 100644 --- a/sdk/src/generated_sdk.rs +++ b/sdk/src/generated_sdk.rs @@ -51528,7 +51528,7 @@ pub mod types { /// /// API for interacting with the Oxide control plane /// -/// Version: 20241204.0.0 +/// Version: 20250212.0.0 pub struct Client { pub(crate) baseurl: String, pub(crate) client: reqwest::Client, @@ -51581,7 +51581,7 @@ impl Client { /// This string is pulled directly from the source OpenAPI /// document and may be in any format the API selects. pub fn api_version(&self) -> &'static str { - "20241204.0.0" + "20250212.0.0" } } From 3fa58eb765448db212477d14b4fd741490bed5a6 Mon Sep 17 00:00:00 2001 From: "oxide-reflector-bot[bot]" <130185838+oxide-reflector-bot[bot]@users.noreply.github.com> Date: Mon, 3 Feb 2025 15:15:13 +0000 Subject: [PATCH 17/17] Rebuilt with latest dependency updates --- Cargo.lock | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index f1fadc0a..3e77f868 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2480,7 +2480,7 @@ dependencies = [ [[package]] name = "progenitor" version = "0.9.1" -source = "git+https://github.com/oxidecomputer/progenitor#8d130e72db63c46438e6ea56add88381b2d979ba" +source = "git+https://github.com/oxidecomputer/progenitor#0add9971b000647bdff2842665ffb8ebe49170e3" dependencies = [ "progenitor-impl", ] @@ -2503,7 +2503,7 @@ dependencies = [ [[package]] name = "progenitor-impl" version = "0.9.1" -source = "git+https://github.com/oxidecomputer/progenitor#8d130e72db63c46438e6ea56add88381b2d979ba" +source = "git+https://github.com/oxidecomputer/progenitor#0add9971b000647bdff2842665ffb8ebe49170e3" dependencies = [ "heck", "http 1.2.0", @@ -3006,9 +3006,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.137" +version = "1.0.138" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "930cfb6e6abf99298aaad7d29abbef7a9999a9a8806a40088f55f0dcec03146b" +checksum = "d434192e7da787e94a6ea7e9670b26a036d0ca41e0b7efb2676dd32bae872949" dependencies = [ "itoa", "memchr",