diff --git a/openstack_cli/src/block_storage/v3.rs b/openstack_cli/src/block_storage/v3.rs index fde9dbd54..90badc8c6 100644 --- a/openstack_cli/src/block_storage/v3.rs +++ b/openstack_cli/src/block_storage/v3.rs @@ -33,6 +33,8 @@ pub mod limit; pub mod message; pub mod os_volume_transfer; pub mod qos_spec; +pub mod quota_class_set; +pub mod quota_set; pub mod resource_filter; pub mod service; pub mod snapshot; @@ -68,6 +70,8 @@ pub enum BlockStorageCommands { Message(Box), OsVolumeTransfer(Box), QosSpec(Box), + QuotaClassSet(Box), + QuotaSet(Box), Service(Box), Snapshot(Box), SnapshotManage(Box), @@ -108,6 +112,8 @@ impl BlockStorageCommand { cmd.take_action(parsed_args, session).await } BlockStorageCommands::QosSpec(cmd) => cmd.take_action(parsed_args, session).await, + BlockStorageCommands::QuotaClassSet(cmd) => cmd.take_action(parsed_args, session).await, + BlockStorageCommands::QuotaSet(cmd) => cmd.take_action(parsed_args, session).await, BlockStorageCommands::Service(cmd) => cmd.take_action(parsed_args, session).await, BlockStorageCommands::Snapshot(cmd) => cmd.take_action(parsed_args, session).await, BlockStorageCommands::SnapshotManage(cmd) => { diff --git a/openstack_cli/src/block_storage/v3/quota_class_set.rs b/openstack_cli/src/block_storage/v3/quota_class_set.rs new file mode 100644 index 000000000..1dc0ac42b --- /dev/null +++ b/openstack_cli/src/block_storage/v3/quota_class_set.rs @@ -0,0 +1,58 @@ +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// SPDX-License-Identifier: Apache-2.0 + +//! Block storage Volume `quota-class-set` commands + +use clap::{Parser, Subcommand}; + +use crate::{Cli, OpenStackCliError}; + +use openstack_sdk::AsyncOpenStack; + +pub mod set; +pub mod show; + +/// Quota class set extension (os-quota-class-sets) +/// +/// Administrators only, depending on policy settings. +/// +/// Shows and updates quota classes for a project. +#[derive(Parser)] +pub struct QuotaClassSetCommand { + /// subcommand + #[command(subcommand)] + command: QuotaClassSetCommands, +} + +/// Supported subcommands +#[allow(missing_docs)] +#[derive(Subcommand)] +pub enum QuotaClassSetCommands { + Set(Box), + Show(Box), +} + +impl QuotaClassSetCommand { + /// Perform command action + pub async fn take_action( + &self, + parsed_args: &Cli, + session: &mut AsyncOpenStack, + ) -> Result<(), OpenStackCliError> { + match &self.command { + QuotaClassSetCommands::Set(cmd) => cmd.take_action(parsed_args, session).await, + QuotaClassSetCommands::Show(cmd) => cmd.take_action(parsed_args, session).await, + } + } +} diff --git a/openstack_cli/src/block_storage/v3/quota_set.rs b/openstack_cli/src/block_storage/v3/quota_set.rs new file mode 100644 index 000000000..a4c6a376c --- /dev/null +++ b/openstack_cli/src/block_storage/v3/quota_set.rs @@ -0,0 +1,64 @@ +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// SPDX-License-Identifier: Apache-2.0 + +//! Block storage Volume `quota-set` commands + +use clap::{Parser, Subcommand}; + +use crate::{Cli, OpenStackCliError}; + +use openstack_sdk::AsyncOpenStack; + +pub mod defaults; +pub mod delete; +pub mod set; +pub mod show; + +/// Quota sets extension (os-quota-sets) +/// +/// Administrators only, depending on policy settings. +/// +/// Shows, updates, and deletes quotas for a project. +#[derive(Parser)] +pub struct QuotaSetCommand { + /// subcommand + #[command(subcommand)] + command: QuotaSetCommands, +} + +/// Supported subcommands +#[allow(missing_docs)] +#[derive(Subcommand)] +pub enum QuotaSetCommands { + Defaults(Box), + Delete(Box), + Set(Box), + Show(Box), +} + +impl QuotaSetCommand { + /// Perform command action + pub async fn take_action( + &self, + parsed_args: &Cli, + session: &mut AsyncOpenStack, + ) -> Result<(), OpenStackCliError> { + match &self.command { + QuotaSetCommands::Defaults(cmd) => cmd.take_action(parsed_args, session).await, + QuotaSetCommands::Delete(cmd) => cmd.take_action(parsed_args, session).await, + QuotaSetCommands::Set(cmd) => cmd.take_action(parsed_args, session).await, + QuotaSetCommands::Show(cmd) => cmd.take_action(parsed_args, session).await, + } + } +} diff --git a/openstack_cli/tests/block_storage/v3/mod.rs b/openstack_cli/tests/block_storage/v3/mod.rs index b30c8b5c3..52a93b0a8 100644 --- a/openstack_cli/tests/block_storage/v3/mod.rs +++ b/openstack_cli/tests/block_storage/v3/mod.rs @@ -24,6 +24,8 @@ mod host; mod limit; mod message; mod qos_spec; +mod quota_class_set; +mod quota_set; mod resource_filter; mod service; mod snapshot; diff --git a/openstack_cli/tests/block_storage/v3/quota_set/get_autogen.rs b/openstack_cli/tests/block_storage/v3/quota_class_set/mod.rs similarity index 77% rename from openstack_cli/tests/block_storage/v3/quota_set/get_autogen.rs rename to openstack_cli/tests/block_storage/v3/quota_class_set/mod.rs index a53843a9c..e2808d313 100644 --- a/openstack_cli/tests/block_storage/v3/quota_set/get_autogen.rs +++ b/openstack_cli/tests/block_storage/v3/quota_class_set/mod.rs @@ -11,9 +11,9 @@ // limitations under the License. // // SPDX-License-Identifier: Apache-2.0 -// -// WARNING: This file is automatically generated from OpenAPI schema using -// `openstack-codegenerator`. + +mod set_autogen; +mod show_autogen; use assert_cmd::prelude::*; use std::process::Command; @@ -22,11 +22,7 @@ use std::process::Command; fn help() -> Result<(), Box> { let mut cmd = Command::cargo_bin("osc")?; - cmd.arg("block-storage") - .arg("quota-set") - .arg("default") - .arg("get") - .arg("--help"); + cmd.args(["block-storage", "quota-class-set", "--help"]); cmd.assert().success(); Ok(()) diff --git a/openstack_sdk/src/api/block_storage/v3/quota_set/default.rs b/openstack_cli/tests/block_storage/v3/quota_set/mod.rs similarity index 63% rename from openstack_sdk/src/api/block_storage/v3/quota_set/default.rs rename to openstack_cli/tests/block_storage/v3/quota_set/mod.rs index 4455c8dc9..00a2ff2a5 100644 --- a/openstack_sdk/src/api/block_storage/v3/quota_set/default.rs +++ b/openstack_cli/tests/block_storage/v3/quota_set/mod.rs @@ -11,9 +11,21 @@ // limitations under the License. // // SPDX-License-Identifier: Apache-2.0 -// -// WARNING: This file is automatically generated from OpenAPI schema using -// `openstack-codegenerator`. -//! `/v3/os-quota-sets/{id}/defaults` REST operations of block_storage -pub mod get; +mod defaults_autogen; +mod delete_autogen; +mod set_autogen; +mod show_autogen; + +use assert_cmd::prelude::*; +use std::process::Command; + +#[test] +fn help() -> Result<(), Box> { + let mut cmd = Command::cargo_bin("osc")?; + + cmd.args(["block-storage", "quota-set", "--help"]); + cmd.assert().success(); + + Ok(()) +}