Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions openstack_cli/src/block_storage/v3.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -68,6 +70,8 @@ pub enum BlockStorageCommands {
Message(Box<message::MessageCommand>),
OsVolumeTransfer(Box<os_volume_transfer::VolumeTransferCommand>),
QosSpec(Box<qos_spec::QosSpecCommand>),
QuotaClassSet(Box<quota_class_set::QuotaClassSetCommand>),
QuotaSet(Box<quota_set::QuotaSetCommand>),
Service(Box<service::ServiceCommand>),
Snapshot(Box<snapshot::SnapshotCommand>),
SnapshotManage(Box<snapshot_manage::SnapshotManageCommand>),
Expand Down Expand Up @@ -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) => {
Expand Down
58 changes: 58 additions & 0 deletions openstack_cli/src/block_storage/v3/quota_class_set.rs
Original file line number Diff line number Diff line change
@@ -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<set::QuotaClassSetCommand>),
Show(Box<show::QuotaClassSetCommand>),
}

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,
}
}
}
64 changes: 64 additions & 0 deletions openstack_cli/src/block_storage/v3/quota_set.rs
Original file line number Diff line number Diff line change
@@ -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<defaults::QuotaSetCommand>),
Delete(Box<delete::QuotaSetCommand>),
Set(Box<set::QuotaSetCommand>),
Show(Box<show::QuotaSetCommand>),
}

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,
}
}
}
2 changes: 2 additions & 0 deletions openstack_cli/tests/block_storage/v3/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -22,11 +22,7 @@ use std::process::Command;
fn help() -> Result<(), Box<dyn std::error::Error>> {
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(())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<dyn std::error::Error>> {
let mut cmd = Command::cargo_bin("osc")?;

cmd.args(["block-storage", "quota-set", "--help"]);
cmd.assert().success();

Ok(())
}