openstack_cli_network/v2/vpn/
endpoint_group.rs1use clap::{Parser, Subcommand};
18
19use openstack_sdk::AsyncOpenStack;
20
21use openstack_cli_core::{cli::CliArgs, error::OpenStackCliError};
22
23pub mod create;
24pub mod delete;
25pub mod list;
26pub mod set;
27pub mod show;
28
29#[derive(Parser)]
34pub struct EndpointGroupCommand {
35 #[command(subcommand)]
37 command: EndpointGroupCommands,
38}
39
40#[allow(missing_docs)]
42#[derive(Subcommand)]
43pub enum EndpointGroupCommands {
44 Create(create::EndpointGroupCommand),
45 Delete(delete::EndpointGroupCommand),
46 List(list::EndpointGroupsCommand),
47 Set(set::EndpointGroupCommand),
48 Show(show::EndpointGroupCommand),
49}
50
51impl EndpointGroupCommand {
52 pub async fn take_action<C: CliArgs>(
54 &self,
55 parsed_args: &C,
56 session: &mut AsyncOpenStack,
57 ) -> Result<(), OpenStackCliError> {
58 match &self.command {
59 EndpointGroupCommands::Create(cmd) => cmd.take_action(parsed_args, session).await,
60 EndpointGroupCommands::Delete(cmd) => cmd.take_action(parsed_args, session).await,
61 EndpointGroupCommands::List(cmd) => cmd.take_action(parsed_args, session).await,
62 EndpointGroupCommands::Set(cmd) => cmd.take_action(parsed_args, session).await,
63 EndpointGroupCommands::Show(cmd) => cmd.take_action(parsed_args, session).await,
64 }
65 }
66}