1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
// SPDX-FileCopyrightText: 2026 RAprogramm <andrey.rozanov.vl@gmail.com>
// SPDX-License-Identifier: MIT
//! Managed database subcommands.
use clap::Subcommand;
/// Database subcommands.
#[derive(Subcommand, Debug)]
pub enum DatabaseCommands {
/// List all databases.
List {
/// Maximum number of databases to return.
#[arg(long)]
limit: Option<i32>,
/// Number of databases to skip.
#[arg(long)]
offset: Option<i32>
},
/// Show detailed info for a database.
Info {
/// Database ID.
#[arg(long)]
id: i32
},
/// Create a new database.
Create {
/// Database name.
#[arg(long)]
name: String,
/// Database engine type (mysql, postgres, redis, mongodb, opensearch,
/// clickhouse, kafka, rabbitmq).
#[arg(long)]
type_: String,
/// Preset ID for the database.
#[arg(short = 'p', long)]
preset_id: i32
},
/// Delete a database by ID.
Delete {
/// Database ID.
#[arg(long)]
id: i32
},
/// Update database settings.
Update {
/// Database ID.
#[arg(long)]
id: i32,
/// New database name.
#[arg(long)]
name: Option<String>
},
/// List backups for a database.
BackupList {
/// Database ID.
#[arg(long)]
id: i32
},
/// Create a backup for a database.
BackupCreate {
/// Database ID.
#[arg(long)]
id: i32
},
/// List users for a database.
UserList {
/// Database ID.
#[arg(long)]
id: i32
},
/// Create a user for a database.
UserCreate {
/// Database ID.
#[arg(long)]
db_id: i32,
/// Database user login name.
#[arg(long)]
login: String,
/// Database user password.
#[arg(long)]
password: String
},
/// Delete a user from a database.
UserDelete {
/// Database ID.
#[arg(long)]
db_id: i32,
/// Database user login name.
#[arg(long)]
user_name: String
},
/// List available database presets.
PresetList,
/// List available database cluster types (engines and versions).
ListTypes,
/// List individual database instances within a cluster.
ListInstances {
/// Database cluster ID.
#[arg(long)]
id: i32
}
}