openstack_cli/identity/v3/registered_limit.rs
1// Licensed under the Apache License, Version 2.0 (the "License");
2// you may not use this file except in compliance with the License.
3// You may obtain a copy of the License at
4//
5// http://www.apache.org/licenses/LICENSE-2.0
6//
7// Unless required by applicable law or agreed to in writing, software
8// distributed under the License is distributed on an "AS IS" BASIS,
9// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10// See the License for the specific language governing permissions and
11// limitations under the License.
12//
13// SPDX-License-Identifier: Apache-2.0
14
15//! Identity Registered RegisteredLimits commands
16
17use clap::{Parser, Subcommand};
18
19use openstack_sdk::AsyncOpenStack;
20
21use crate::{Cli, OpenStackCliError};
22
23pub mod create;
24pub mod delete;
25pub mod list;
26pub mod set;
27pub mod show;
28
29/// Unified Limits - Registered limits
30///
31/// In OpenStack, a quota system mainly contains two parts: limit and usage. The Unified limits in
32/// Keystone is a replacement of the limit part. It contains two kinds of resources: Registered
33/// RegisteredLimit and RegisteredLimit. A registered limit is a default limit. It is usually
34/// created by the services which are registered in Keystone. A limit is the limit that override
35/// the registered limit for each project.
36#[derive(Parser)]
37pub struct RegisteredLimitCommand {
38 #[command(subcommand)]
39 command: RegisteredLimitCommands,
40}
41
42/// Supported subcommands
43#[allow(missing_docs)]
44#[derive(Subcommand)]
45pub enum RegisteredLimitCommands {
46 Create(create::RegisteredLimitCommand),
47 Delete(delete::RegisteredLimitCommand),
48 List(list::RegisteredLimitsCommand),
49 Set(set::RegisteredLimitCommand),
50 Show(show::RegisteredLimitCommand),
51}
52
53impl RegisteredLimitCommand {
54 /// Perform command action
55 pub async fn take_action(
56 &self,
57 parsed_args: &Cli,
58 session: &mut AsyncOpenStack,
59 ) -> Result<(), OpenStackCliError> {
60 match &self.command {
61 RegisteredLimitCommands::Create(cmd) => cmd.take_action(parsed_args, session).await,
62 RegisteredLimitCommands::Delete(cmd) => cmd.take_action(parsed_args, session).await,
63 RegisteredLimitCommands::List(cmd) => cmd.take_action(parsed_args, session).await,
64 RegisteredLimitCommands::Set(cmd) => cmd.take_action(parsed_args, session).await,
65 RegisteredLimitCommands::Show(cmd) => cmd.take_action(parsed_args, session).await,
66 }
67 }
68}