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
// SPDX-FileCopyrightText: 2026 RAprogramm <andrey.rozanov.vl@gmail.com>
// SPDX-License-Identifier: MIT
//! Load balancer subcommands.
use clap::Subcommand;
/// Balancer subcommands.
#[derive(Subcommand, Debug)]
pub enum BalancerCommands {
/// List all balancers.
List {
/// Maximum number of balancers to return.
#[arg(long)]
limit: Option<i32>,
/// Number of balancers to skip.
#[arg(long)]
offset: Option<i32>
},
/// Show detailed info for a balancer.
Info {
/// Balancer ID.
#[arg(long)]
id: i32
},
/// Create a new balancer.
Create {
/// Balancer name.
#[arg(long)]
name: String
},
/// Delete a balancer by ID.
Delete {
/// Balancer ID.
#[arg(long)]
id: i32
},
/// Update balancer settings.
Update {
/// Balancer ID.
#[arg(long)]
id: i32,
/// New balancer name.
#[arg(long)]
name: Option<String>
},
/// List rules for a balancer.
RuleList {
/// Balancer ID.
#[arg(long)]
id: i32
},
/// Create a rule for a balancer.
RuleCreate {
/// Balancer ID.
#[arg(long)]
id: i32
},
/// Delete a rule from a balancer.
RuleDelete {
/// Balancer ID.
#[arg(long)]
id: i32,
/// Rule ID to delete.
#[arg(long)]
rule_id: i32
},
/// List IPs for a balancer.
IpList {
/// Balancer ID.
#[arg(long)]
id: i32
},
/// Add an IP to a balancer.
IpAdd {
/// Balancer ID.
#[arg(long)]
id: i32,
/// IP address to add.
#[arg(long)]
ip: String
},
/// Remove an IP from a balancer.
IpRemove {
/// Balancer ID.
#[arg(long)]
id: i32,
/// IP address to remove.
#[arg(long)]
ip: String
},
/// List available balancer presets.
PresetList
}