twc_rs/cli/images.rs
1// SPDX-FileCopyrightText: 2026 RAprogramm <andrey.rozanov.vl@gmail.com>
2// SPDX-License-Identifier: MIT
3
4//! Server image subcommands.
5
6use clap::Subcommand;
7
8/// Disk image subcommands.
9#[derive(Subcommand, Debug)]
10pub enum ImageCommands {
11 /// List all disk images.
12 List,
13 /// Show detailed info for an image.
14 Info {
15 /// Image ID.
16 #[arg(long)]
17 id: String
18 },
19 /// Create a new image.
20 Create {
21 /// Image name.
22 #[arg(long)]
23 name: String,
24 /// Location where the image is created.
25 #[arg(long)]
26 location: String
27 },
28 /// Update an image's name.
29 Set {
30 /// Image ID.
31 #[arg(long)]
32 id: String,
33 /// New image name.
34 #[arg(long)]
35 name: Option<String>
36 },
37 /// Delete an image by ID.
38 Delete {
39 /// Image ID.
40 #[arg(long)]
41 id: String
42 },
43 /// Upload a local image file to an image.
44 Upload {
45 /// Image ID.
46 #[arg(long)]
47 id: String,
48 /// Path to the local image file.
49 #[arg(long)]
50 file: String
51 }
52}