openstack_cli/compute/v2/
server_group.rs1use clap::{Parser, Subcommand};
18
19use openstack_sdk::AsyncOpenStack;
20
21use crate::{Cli, OpenStackCliError};
22
23pub mod create_20;
24pub mod create_215;
25pub mod create_264;
26pub mod delete;
27pub mod list;
28pub mod show;
29
30#[derive(Parser)]
34pub struct ServerGroupCommand {
35 #[command(subcommand)]
37 command: ServerGroupCommands,
38}
39
40#[allow(missing_docs)]
42#[derive(Subcommand)]
43pub enum ServerGroupCommands {
44 #[command(visible_alias = "create")]
45 Create264(create_264::ServerGroupCommand),
46 Create215(create_215::ServerGroupCommand),
47 Create20(create_20::ServerGroupCommand),
48 Delete(delete::ServerGroupCommand),
49 List(list::ServerGroupsCommand),
50 Show(show::ServerGroupCommand),
51}
52
53impl ServerGroupCommand {
54 pub async fn take_action(
56 &self,
57 parsed_args: &Cli,
58 session: &mut AsyncOpenStack,
59 ) -> Result<(), OpenStackCliError> {
60 match &self.command {
61 ServerGroupCommands::Create264(cmd) => cmd.take_action(parsed_args, session).await,
62 ServerGroupCommands::Create215(cmd) => cmd.take_action(parsed_args, session).await,
63 ServerGroupCommands::Create20(cmd) => cmd.take_action(parsed_args, session).await,
64 ServerGroupCommands::Delete(cmd) => cmd.take_action(parsed_args, session).await,
65 ServerGroupCommands::List(cmd) => cmd.take_action(parsed_args, session).await,
66 ServerGroupCommands::Show(cmd) => cmd.take_action(parsed_args, session).await,
67 }
68 }
69}