openstack_cli_block_storage/v3/
group.rs1use clap::{Parser, Subcommand};
18
19use openstack_cli_core::{cli::CliArgs, error::OpenStackCliError};
20use openstack_sdk::AsyncOpenStack;
21
22pub mod create_313;
23pub mod create_from_src_314;
24pub mod delete_313;
25pub mod disable_replication_338;
26pub mod enable_replication_338;
27pub mod failover_replication_338;
28pub mod list;
29pub mod list_replication_targets_338;
30pub mod reset_status_320;
31pub mod set_313;
32pub mod show;
33
34#[derive(Parser)]
46pub struct GroupCommand {
47 #[command(subcommand)]
49 command: GroupCommands,
50}
51
52#[allow(missing_docs)]
54#[derive(Subcommand)]
55pub enum GroupCommands {
56 #[command(visible_alias = "create")]
57 Create313(Box<create_313::GroupCommand>),
58 #[command(visible_alias = "create_from_src")]
59 CreateFromSrc314(Box<create_from_src_314::GroupCommand>),
60 #[command(visible_alias = "delete")]
61 Delete313(Box<delete_313::GroupCommand>),
62 #[command(visible_alias = "disable-replication")]
63 DisableReplication338(Box<disable_replication_338::GroupCommand>),
64 #[command(visible_alias = "enable-replication")]
65 EnableReplication338(Box<enable_replication_338::GroupCommand>),
66 #[command(visible_alias = "failover-replication")]
67 FailoverReplication338(Box<failover_replication_338::GroupCommand>),
68 List(Box<list::GroupsCommand>),
69 #[command(visible_alias = "list-replication-targets")]
70 ListReplicationTargets338(Box<list_replication_targets_338::GroupCommand>),
71 #[command(visible_alias = "reset-status")]
72 ResetStatus320(Box<reset_status_320::GroupCommand>),
73 Set313(Box<set_313::GroupCommand>),
74 Show(Box<show::GroupCommand>),
75}
76
77impl GroupCommand {
78 pub async fn take_action<C: CliArgs>(
80 &self,
81 parsed_args: &C,
82 session: &mut AsyncOpenStack,
83 ) -> Result<(), OpenStackCliError> {
84 match &self.command {
85 GroupCommands::Create313(cmd) => cmd.take_action(parsed_args, session).await,
86 GroupCommands::CreateFromSrc314(cmd) => cmd.take_action(parsed_args, session).await,
87 GroupCommands::Delete313(cmd) => cmd.take_action(parsed_args, session).await,
88 GroupCommands::DisableReplication338(cmd) => {
89 cmd.take_action(parsed_args, session).await
90 }
91 GroupCommands::EnableReplication338(cmd) => cmd.take_action(parsed_args, session).await,
92 GroupCommands::FailoverReplication338(cmd) => {
93 cmd.take_action(parsed_args, session).await
94 }
95 GroupCommands::List(cmd) => cmd.take_action(parsed_args, session).await,
96 GroupCommands::ListReplicationTargets338(cmd) => {
97 cmd.take_action(parsed_args, session).await
98 }
99 GroupCommands::ResetStatus320(cmd) => cmd.take_action(parsed_args, session).await,
100 GroupCommands::Set313(cmd) => cmd.take_action(parsed_args, session).await,
101 GroupCommands::Show(cmd) => cmd.take_action(parsed_args, session).await,
102 }
103 }
104}