|
| 1 | +/* |
| 2 | + * SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. |
| 3 | + * SPDX-License-Identifier: Apache-2.0 |
| 4 | + * |
| 5 | + * Licensed under the Apache License, Version 2.0 (the "License"); |
| 6 | + * you may not use this file except in compliance with the License. |
| 7 | + * You may obtain a copy of the License at |
| 8 | + * |
| 9 | + * http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | + * |
| 11 | + * Unless required by applicable law or agreed to in writing, software |
| 12 | + * distributed under the License is distributed on an "AS IS" BASIS, |
| 13 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 14 | + * See the License for the specific language governing permissions and |
| 15 | + * limitations under the License. |
| 16 | + */ |
| 17 | + |
| 18 | +use carbide_uuid::machine::MachineId; |
| 19 | +use clap::Parser; |
| 20 | + |
| 21 | +#[derive(Parser, Debug, Clone)] |
| 22 | +pub enum Args { |
| 23 | + #[clap(about = "Pin the Redfish BMC vendor for a machine")] |
| 24 | + Set(VendorOverrideSet), |
| 25 | + #[clap(about = "Clear the Redfish BMC vendor override for a machine")] |
| 26 | + Clear(VendorOverrideClear), |
| 27 | + #[clap(about = "Show the Redfish BMC vendor override for a machine")] |
| 28 | + Show(VendorOverrideShow), |
| 29 | +} |
| 30 | + |
| 31 | +#[derive(Parser, Debug, Clone)] |
| 32 | +#[command(after_long_help = "\ |
| 33 | +EXAMPLES: |
| 34 | +
|
| 35 | +Force a machine's BMC vendor to Dell: |
| 36 | + $ nico-admin-cli machine vendor-override set 12345678-1234-5678-90ab-cdef01234567 \ |
| 37 | + --vendor Dell |
| 38 | +
|
| 39 | +")] |
| 40 | +pub struct VendorOverrideSet { |
| 41 | + #[clap(help = "The machine whose BMC vendor should be pinned")] |
| 42 | + pub machine: MachineId, |
| 43 | + #[clap( |
| 44 | + long, |
| 45 | + help = "RedfishVendor to force (e.g. Dell, Supermicro, NvidiaDpu, Hpe, Lenovo)" |
| 46 | + )] |
| 47 | + pub vendor: String, |
| 48 | +} |
| 49 | + |
| 50 | +#[derive(Parser, Debug, Clone)] |
| 51 | +#[command(after_long_help = "\ |
| 52 | +EXAMPLES: |
| 53 | +
|
| 54 | +Clear a machine's BMC vendor override (return to automatic detection): |
| 55 | + $ nico-admin-cli machine vendor-override clear 12345678-1234-5678-90ab-cdef01234567 |
| 56 | +
|
| 57 | +")] |
| 58 | +pub struct VendorOverrideClear { |
| 59 | + #[clap(help = "The machine whose BMC vendor override should be cleared")] |
| 60 | + pub machine: MachineId, |
| 61 | +} |
| 62 | + |
| 63 | +#[derive(Parser, Debug, Clone)] |
| 64 | +#[command(after_long_help = "\ |
| 65 | +EXAMPLES: |
| 66 | +
|
| 67 | +Show a machine's pinned BMC vendor (or that none is set): |
| 68 | + $ nico-admin-cli machine vendor-override show 12345678-1234-5678-90ab-cdef01234567 |
| 69 | +
|
| 70 | +")] |
| 71 | +pub struct VendorOverrideShow { |
| 72 | + #[clap(help = "The machine whose BMC vendor override should be shown")] |
| 73 | + pub machine: MachineId, |
| 74 | +} |
0 commit comments