openstack_cli_compute/v2/server/
volume_attachment.rs1use clap::{Parser, Subcommand};
18
19use openstack_sdk::AsyncOpenStack;
20
21use openstack_cli_core::{cli::CliArgs, error::OpenStackCliError};
22
23mod create_20;
24mod create_249;
25mod create_279;
26mod delete;
27mod list;
28mod set_20;
29mod set_285;
30mod show;
31
32#[derive(Parser)]
38pub struct VolumeAttachmentCommand {
39 #[command(subcommand)]
41 command: VolumeAttachmentCommands,
42}
43
44#[allow(missing_docs)]
46#[derive(Subcommand)]
47pub enum VolumeAttachmentCommands {
48 Create20(create_20::VolumeAttachmentCommand),
49 Create249(create_249::VolumeAttachmentCommand),
50 #[command(visible_alias = "create")]
51 Create279(create_279::VolumeAttachmentCommand),
52 Delete(delete::VolumeAttachmentCommand),
53 List(list::VolumeAttachmentsCommand),
54 Set20(set_20::VolumeAttachmentCommand),
55 #[command(visible_alias = "set")]
56 Set285(set_285::VolumeAttachmentCommand),
57 Show(show::VolumeAttachmentCommand),
58}
59
60impl VolumeAttachmentCommand {
61 pub async fn take_action<C: CliArgs>(
63 &self,
64 parsed_args: &C,
65 session: &mut AsyncOpenStack,
66 ) -> Result<(), OpenStackCliError> {
67 match &self.command {
68 VolumeAttachmentCommands::Create20(cmd) => cmd.take_action(parsed_args, session).await,
69 VolumeAttachmentCommands::Create249(cmd) => cmd.take_action(parsed_args, session).await,
70 VolumeAttachmentCommands::Create279(cmd) => cmd.take_action(parsed_args, session).await,
71 VolumeAttachmentCommands::Delete(cmd) => cmd.take_action(parsed_args, session).await,
72 VolumeAttachmentCommands::List(cmd) => cmd.take_action(parsed_args, session).await,
73 VolumeAttachmentCommands::Set20(cmd) => cmd.take_action(parsed_args, session).await,
74 VolumeAttachmentCommands::Set285(cmd) => cmd.take_action(parsed_args, session).await,
75 VolumeAttachmentCommands::Show(cmd) => cmd.take_action(parsed_args, session).await,
76 }
77 }
78}