proxcli 0.4.0__tar.gz → 0.5.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. {proxcli-0.4.0 → proxcli-0.5.0}/CHANGELOG.md +7 -0
  2. {proxcli-0.4.0 → proxcli-0.5.0}/PKG-INFO +99 -1
  3. {proxcli-0.4.0 → proxcli-0.5.0}/README.md +98 -0
  4. {proxcli-0.4.0 → proxcli-0.5.0}/proxmox/cli/main.py +2 -0
  5. proxcli-0.5.0/proxmox/cli/pool.py +74 -0
  6. {proxcli-0.4.0 → proxcli-0.5.0}/pyproject.toml +1 -1
  7. {proxcli-0.4.0 → proxcli-0.5.0}/uv.lock +1 -1
  8. {proxcli-0.4.0 → proxcli-0.5.0}/.env.example +0 -0
  9. {proxcli-0.4.0 → proxcli-0.5.0}/.github/workflows/ci.yml +0 -0
  10. {proxcli-0.4.0 → proxcli-0.5.0}/.gitignore +0 -0
  11. {proxcli-0.4.0 → proxcli-0.5.0}/.python-version +0 -0
  12. {proxcli-0.4.0 → proxcli-0.5.0}/AGENTS.md +0 -0
  13. {proxcli-0.4.0 → proxcli-0.5.0}/PLAN.md +0 -0
  14. {proxcli-0.4.0 → proxcli-0.5.0}/PROJECT.md +0 -0
  15. {proxcli-0.4.0 → proxcli-0.5.0}/PROMPT.md +0 -0
  16. {proxcli-0.4.0 → proxcli-0.5.0}/TODO.md +0 -0
  17. {proxcli-0.4.0 → proxcli-0.5.0}/proxmox/__init__.py +0 -0
  18. {proxcli-0.4.0 → proxcli-0.5.0}/proxmox/cli/__init__.py +0 -0
  19. {proxcli-0.4.0 → proxcli-0.5.0}/proxmox/cli/auth.py +0 -0
  20. {proxcli-0.4.0 → proxcli-0.5.0}/proxmox/cli/cluster.py +0 -0
  21. {proxcli-0.4.0 → proxcli-0.5.0}/proxmox/cli/container.py +0 -0
  22. {proxcli-0.4.0 → proxcli-0.5.0}/proxmox/cli/firewall_helpers.py +0 -0
  23. {proxcli-0.4.0 → proxcli-0.5.0}/proxmox/cli/node.py +0 -0
  24. {proxcli-0.4.0 → proxcli-0.5.0}/proxmox/cli/storage.py +0 -0
  25. {proxcli-0.4.0 → proxcli-0.5.0}/proxmox/cli/tasks.py +0 -0
  26. {proxcli-0.4.0 → proxcli-0.5.0}/proxmox/cli/vm.py +0 -0
  27. {proxcli-0.4.0 → proxcli-0.5.0}/proxmox/client/__init__.py +0 -0
  28. {proxcli-0.4.0 → proxcli-0.5.0}/proxmox/client/auth.py +0 -0
  29. {proxcli-0.4.0 → proxcli-0.5.0}/proxmox/client/client.py +0 -0
  30. {proxcli-0.4.0 → proxcli-0.5.0}/proxmox/client/exceptions.py +0 -0
  31. {proxcli-0.4.0 → proxcli-0.5.0}/proxmox/config/__init__.py +0 -0
  32. {proxcli-0.4.0 → proxcli-0.5.0}/proxmox/config/config.py +0 -0
  33. {proxcli-0.4.0 → proxcli-0.5.0}/proxmox/config/models.py +0 -0
  34. {proxcli-0.4.0 → proxcli-0.5.0}/proxmox/output/__init__.py +0 -0
  35. {proxcli-0.4.0 → proxcli-0.5.0}/proxmox/output/formatter.py +0 -0
  36. {proxcli-0.4.0 → proxcli-0.5.0}/proxmox/output/json_fmt.py +0 -0
  37. {proxcli-0.4.0 → proxcli-0.5.0}/proxmox/output/table_fmt.py +0 -0
  38. {proxcli-0.4.0 → proxcli-0.5.0}/proxmox/output/yaml_fmt.py +0 -0
  39. {proxcli-0.4.0 → proxcli-0.5.0}/proxmox/utils/__init__.py +0 -0
  40. {proxcli-0.4.0 → proxcli-0.5.0}/proxmox/utils/helpers.py +0 -0
  41. {proxcli-0.4.0 → proxcli-0.5.0}/proxmox/utils/logging.py +0 -0
  42. {proxcli-0.4.0 → proxcli-0.5.0}/tests/__init__.py +0 -0
  43. {proxcli-0.4.0 → proxcli-0.5.0}/tests/conftest.py +0 -0
  44. {proxcli-0.4.0 → proxcli-0.5.0}/tests/test_auth.py +0 -0
  45. {proxcli-0.4.0 → proxcli-0.5.0}/tests/test_cli/__init__.py +0 -0
  46. {proxcli-0.4.0 → proxcli-0.5.0}/tests/test_cli/test_main.py +0 -0
  47. {proxcli-0.4.0 → proxcli-0.5.0}/tests/test_client.py +0 -0
  48. {proxcli-0.4.0 → proxcli-0.5.0}/tests/test_config.py +0 -0
  49. {proxcli-0.4.0 → proxcli-0.5.0}/tests/test_integration/__init__.py +0 -0
  50. {proxcli-0.4.0 → proxcli-0.5.0}/tests/test_output/__init__.py +0 -0
  51. {proxcli-0.4.0 → proxcli-0.5.0}/tests/test_output/test_formatter.py +0 -0
@@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [0.5.0] - 2026-06-20
11
+
12
+ ### Added
13
+ - Pool management (`proxmox pool`): list, show, create, update, delete.
14
+ Wraps `/pools` endpoints.
15
+
10
16
  ## [0.4.0] - 2026-06-20
11
17
 
12
18
  ### Added
@@ -61,6 +67,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
61
67
  - CSRF ticket auto-refresh on 401.
62
68
  - AI-agent-friendly: default JSON output, strict exit codes, `--dry-run` mode.
63
69
 
70
+ [0.5.0]: https://github.com/xezpeleta/proxcli/releases/tag/v0.5.0
64
71
  [0.4.0]: https://github.com/xezpeleta/proxcli/releases/tag/v0.4.0
65
72
  [0.3.0]: https://github.com/xezpeleta/proxcli/releases/tag/v0.3.0
66
73
  [0.2.1]: https://github.com/xezpeleta/proxcli/releases/tag/v0.2.1
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: proxcli
3
- Version: 0.4.0
3
+ Version: 0.5.0
4
4
  Summary: A CLI tool to interact with Proxmox VE nodes and clusters via the REST API
5
5
  Author-email: Xabi Ezpeleta <xezpeleta@gmail.com>
6
6
  License: MIT
@@ -141,6 +141,18 @@ proxmox vm reboot <vmid> [--node <node>]
141
141
  proxmox vm suspend <vmid> [--node <node>]
142
142
  proxmox vm resume <vmid> [--node <node>]
143
143
  proxmox vm delete <vmid> [--node <node>] [--force] [--purge]
144
+
145
+ # VM firewall
146
+ proxmox vm firewall options <vmid> [--node <node>]
147
+ proxmox vm firewall enable <vmid> [--node <node>]
148
+ proxmox vm firewall disable <vmid> [--node <node>]
149
+ proxmox vm firewall policy <vmid> --in-policy ACCEPT --out-policy DROP [--node <node>]
150
+ proxmox vm firewall rules list <vmid> [--node <node>]
151
+ proxmox vm firewall rules add <vmid> --action ACCEPT --dport 22 --proto tcp [--source <cidr>] [--comment <text>]
152
+ proxmox vm firewall rules show <vmid> <pos>
153
+ proxmox vm firewall rules update <vmid> <pos> --action DROP
154
+ proxmox vm firewall rules delete <vmid> <pos>
155
+ proxmox vm firewall refs <vmid> [--type alias|ipset|group]
144
156
  ```
145
157
 
146
158
  ### Container (LXC)
@@ -152,6 +164,18 @@ proxmox container create --node <node> --vmid <id> --ostemplate <tmpl> [--memory
152
164
  proxmox container start <vmid> [--node <node>]
153
165
  proxmox container stop <vmid> [--node <node>]
154
166
  proxmox container delete <vmid> [--node <node>] [--force] [--purge]
167
+
168
+ # Container firewall
169
+ proxmox container firewall options <vmid> [--node <node>]
170
+ proxmox container firewall enable <vmid> [--node <node>]
171
+ proxmox container firewall disable <vmid> [--node <node>]
172
+ proxmox container firewall policy <vmid> --in-policy ACCEPT --out-policy DROP
173
+ proxmox container firewall rules list <vmid> [--node <node>]
174
+ proxmox container firewall rules add <vmid> --action ACCEPT --dport 22 --proto tcp
175
+ proxmox container firewall rules show <vmid> <pos>
176
+ proxmox container firewall rules update <vmid> <pos> --action DROP
177
+ proxmox container firewall rules delete <vmid> <pos>
178
+ proxmox container firewall refs <vmid> [--type alias|ipset|group]
155
179
  ```
156
180
 
157
181
  ### Node
@@ -160,6 +184,18 @@ proxmox container delete <vmid> [--node <node>] [--force] [--purge]
160
184
  proxmox node list
161
185
  proxmox node show <node>
162
186
  proxmox node status [<node>]
187
+
188
+ # Node firewall
189
+ proxmox node firewall options <node>
190
+ proxmox node firewall enable <node>
191
+ proxmox node firewall disable <node>
192
+ proxmox node firewall policy <node> --in-policy ACCEPT --out-policy DROP
193
+ proxmox node firewall rules list <node>
194
+ proxmox node firewall rules add <node> --action ACCEPT --dport 22 --proto tcp
195
+ proxmox node firewall rules show <node> <pos>
196
+ proxmox node firewall rules update <node> <pos> --action DROP
197
+ proxmox node firewall rules delete <node> <pos>
198
+ proxmox node firewall refs <node> [--type alias|ipset|group]
163
199
  ```
164
200
 
165
201
  ### Storage
@@ -168,12 +204,45 @@ proxmox node status [<node>]
168
204
  proxmox storage list [--node <node>]
169
205
  proxmox storage show <storage>
170
206
  proxmox storage content <storage> [--node <node>]
207
+ proxmox storage upload --node <node> --storage <storage> --file <path> [--content-type iso|vztmpl|import]
208
+ ```
209
+
210
+ ### Pool
211
+
212
+ ```bash
213
+ proxmox pool list
214
+ proxmox pool show <poolid>
215
+ proxmox pool create <poolid> [--comment <text>]
216
+ proxmox pool update <poolid> [--comment <text>] [--allow-delete]
217
+ proxmox pool delete <poolid>
171
218
  ```
172
219
 
173
220
  ### Cluster
174
221
 
175
222
  ```bash
176
223
  proxmox cluster status
224
+
225
+ # Cluster firewall
226
+ proxmox cluster firewall options
227
+ proxmox cluster firewall enable
228
+ proxmox cluster firewall disable
229
+ proxmox cluster firewall policy --in-policy ACCEPT --out-policy DROP
230
+ proxmox cluster firewall rules # list (shorthand)
231
+ proxmox cluster firewall rules list # list (explicit)
232
+ proxmox cluster firewall rules add --action ACCEPT --dport 22 --source 10.0.0.0/8
233
+ proxmox cluster firewall rules show <pos>
234
+ proxmox cluster firewall rules update <pos> --action DROP
235
+ proxmox cluster firewall rules delete <pos>
236
+ proxmox cluster firewall aliases # list (shorthand)
237
+ proxmox cluster firewall aliases add <name> --cidr 10.0.0.0/24 --comment "web tier"
238
+ proxmox cluster firewall aliases delete <name>
239
+ proxmox cluster firewall ipsets # list (shorthand)
240
+ proxmox cluster firewall ipsets add <name> --comment "trusted hosts"
241
+ proxmox cluster firewall ipsets show <name>
242
+ proxmox cluster firewall ipsets delete <name>
243
+ proxmox cluster firewall ipsets add-cidr <name> --cidr 192.168.1.0/24
244
+ proxmox cluster firewall ipsets delete-cidr <name> --cidr 192.168.1.0/24
245
+ proxmox cluster firewall refs [--type alias|ipset|group]
177
246
  ```
178
247
 
179
248
  ### Task
@@ -260,3 +329,32 @@ uv build
260
329
  ## License
261
330
 
262
331
  MIT
332
+
333
+ ## Firewall Rule Options
334
+
335
+ Firewall rules share the same flags across cluster, node, VM, and container. The `--macro` flag can be used as a shortcut for common services (e.g., `--macro SSH` sets up port 22/tcp).
336
+
337
+ | Flag | Values | Description |
338
+ |---|---|---|
339
+ | `--action` | `ACCEPT`, `DENY`, `REJECT` | Rule action (required for `add`) |
340
+ | `--type` | `in`, `out` | Traffic direction (default: `in`) |
341
+ | `--iface` | e.g. `net0` | Network interface |
342
+ | `--source` | CIDR | Source IP/CIDR |
343
+ | `--dest` | CIDR | Destination IP/CIDR |
344
+ | `--dport` | e.g. `80` or `8000-9000` | Destination port |
345
+ | `--sport` | e.g. `1024-65535` | Source port |
346
+ | `--proto` | `tcp`, `udp`, `icmp`, `any` | Protocol |
347
+ | `--macro` | e.g. `SSH`, `HTTP`, `HTTPS`, `Ping` | Pre-defined service macro |
348
+ | `--comment` | text | Comment / description |
349
+ | `--enable` | `0`, `1` | Enable the rule (default: `1`) |
350
+ | `--log` | `emerg`..`debug`, `nolog` | Log level |
351
+
352
+ Example:
353
+
354
+ ```bash
355
+ # Allow SSH from a specific subnet
356
+ proxmox vm firewall rules add 100 --action ACCEPT --dport 22 --proto tcp --source 192.168.1.0/24 --comment "Admin SSH"
357
+
358
+ # Or use a macro
359
+ proxmox vm firewall rules add 100 --action ACCEPT --macro SSH --source 192.168.1.0/24
360
+ ```
@@ -118,6 +118,18 @@ proxmox vm reboot <vmid> [--node <node>]
118
118
  proxmox vm suspend <vmid> [--node <node>]
119
119
  proxmox vm resume <vmid> [--node <node>]
120
120
  proxmox vm delete <vmid> [--node <node>] [--force] [--purge]
121
+
122
+ # VM firewall
123
+ proxmox vm firewall options <vmid> [--node <node>]
124
+ proxmox vm firewall enable <vmid> [--node <node>]
125
+ proxmox vm firewall disable <vmid> [--node <node>]
126
+ proxmox vm firewall policy <vmid> --in-policy ACCEPT --out-policy DROP [--node <node>]
127
+ proxmox vm firewall rules list <vmid> [--node <node>]
128
+ proxmox vm firewall rules add <vmid> --action ACCEPT --dport 22 --proto tcp [--source <cidr>] [--comment <text>]
129
+ proxmox vm firewall rules show <vmid> <pos>
130
+ proxmox vm firewall rules update <vmid> <pos> --action DROP
131
+ proxmox vm firewall rules delete <vmid> <pos>
132
+ proxmox vm firewall refs <vmid> [--type alias|ipset|group]
121
133
  ```
122
134
 
123
135
  ### Container (LXC)
@@ -129,6 +141,18 @@ proxmox container create --node <node> --vmid <id> --ostemplate <tmpl> [--memory
129
141
  proxmox container start <vmid> [--node <node>]
130
142
  proxmox container stop <vmid> [--node <node>]
131
143
  proxmox container delete <vmid> [--node <node>] [--force] [--purge]
144
+
145
+ # Container firewall
146
+ proxmox container firewall options <vmid> [--node <node>]
147
+ proxmox container firewall enable <vmid> [--node <node>]
148
+ proxmox container firewall disable <vmid> [--node <node>]
149
+ proxmox container firewall policy <vmid> --in-policy ACCEPT --out-policy DROP
150
+ proxmox container firewall rules list <vmid> [--node <node>]
151
+ proxmox container firewall rules add <vmid> --action ACCEPT --dport 22 --proto tcp
152
+ proxmox container firewall rules show <vmid> <pos>
153
+ proxmox container firewall rules update <vmid> <pos> --action DROP
154
+ proxmox container firewall rules delete <vmid> <pos>
155
+ proxmox container firewall refs <vmid> [--type alias|ipset|group]
132
156
  ```
133
157
 
134
158
  ### Node
@@ -137,6 +161,18 @@ proxmox container delete <vmid> [--node <node>] [--force] [--purge]
137
161
  proxmox node list
138
162
  proxmox node show <node>
139
163
  proxmox node status [<node>]
164
+
165
+ # Node firewall
166
+ proxmox node firewall options <node>
167
+ proxmox node firewall enable <node>
168
+ proxmox node firewall disable <node>
169
+ proxmox node firewall policy <node> --in-policy ACCEPT --out-policy DROP
170
+ proxmox node firewall rules list <node>
171
+ proxmox node firewall rules add <node> --action ACCEPT --dport 22 --proto tcp
172
+ proxmox node firewall rules show <node> <pos>
173
+ proxmox node firewall rules update <node> <pos> --action DROP
174
+ proxmox node firewall rules delete <node> <pos>
175
+ proxmox node firewall refs <node> [--type alias|ipset|group]
140
176
  ```
141
177
 
142
178
  ### Storage
@@ -145,12 +181,45 @@ proxmox node status [<node>]
145
181
  proxmox storage list [--node <node>]
146
182
  proxmox storage show <storage>
147
183
  proxmox storage content <storage> [--node <node>]
184
+ proxmox storage upload --node <node> --storage <storage> --file <path> [--content-type iso|vztmpl|import]
185
+ ```
186
+
187
+ ### Pool
188
+
189
+ ```bash
190
+ proxmox pool list
191
+ proxmox pool show <poolid>
192
+ proxmox pool create <poolid> [--comment <text>]
193
+ proxmox pool update <poolid> [--comment <text>] [--allow-delete]
194
+ proxmox pool delete <poolid>
148
195
  ```
149
196
 
150
197
  ### Cluster
151
198
 
152
199
  ```bash
153
200
  proxmox cluster status
201
+
202
+ # Cluster firewall
203
+ proxmox cluster firewall options
204
+ proxmox cluster firewall enable
205
+ proxmox cluster firewall disable
206
+ proxmox cluster firewall policy --in-policy ACCEPT --out-policy DROP
207
+ proxmox cluster firewall rules # list (shorthand)
208
+ proxmox cluster firewall rules list # list (explicit)
209
+ proxmox cluster firewall rules add --action ACCEPT --dport 22 --source 10.0.0.0/8
210
+ proxmox cluster firewall rules show <pos>
211
+ proxmox cluster firewall rules update <pos> --action DROP
212
+ proxmox cluster firewall rules delete <pos>
213
+ proxmox cluster firewall aliases # list (shorthand)
214
+ proxmox cluster firewall aliases add <name> --cidr 10.0.0.0/24 --comment "web tier"
215
+ proxmox cluster firewall aliases delete <name>
216
+ proxmox cluster firewall ipsets # list (shorthand)
217
+ proxmox cluster firewall ipsets add <name> --comment "trusted hosts"
218
+ proxmox cluster firewall ipsets show <name>
219
+ proxmox cluster firewall ipsets delete <name>
220
+ proxmox cluster firewall ipsets add-cidr <name> --cidr 192.168.1.0/24
221
+ proxmox cluster firewall ipsets delete-cidr <name> --cidr 192.168.1.0/24
222
+ proxmox cluster firewall refs [--type alias|ipset|group]
154
223
  ```
155
224
 
156
225
  ### Task
@@ -237,3 +306,32 @@ uv build
237
306
  ## License
238
307
 
239
308
  MIT
309
+
310
+ ## Firewall Rule Options
311
+
312
+ Firewall rules share the same flags across cluster, node, VM, and container. The `--macro` flag can be used as a shortcut for common services (e.g., `--macro SSH` sets up port 22/tcp).
313
+
314
+ | Flag | Values | Description |
315
+ |---|---|---|
316
+ | `--action` | `ACCEPT`, `DENY`, `REJECT` | Rule action (required for `add`) |
317
+ | `--type` | `in`, `out` | Traffic direction (default: `in`) |
318
+ | `--iface` | e.g. `net0` | Network interface |
319
+ | `--source` | CIDR | Source IP/CIDR |
320
+ | `--dest` | CIDR | Destination IP/CIDR |
321
+ | `--dport` | e.g. `80` or `8000-9000` | Destination port |
322
+ | `--sport` | e.g. `1024-65535` | Source port |
323
+ | `--proto` | `tcp`, `udp`, `icmp`, `any` | Protocol |
324
+ | `--macro` | e.g. `SSH`, `HTTP`, `HTTPS`, `Ping` | Pre-defined service macro |
325
+ | `--comment` | text | Comment / description |
326
+ | `--enable` | `0`, `1` | Enable the rule (default: `1`) |
327
+ | `--log` | `emerg`..`debug`, `nolog` | Log level |
328
+
329
+ Example:
330
+
331
+ ```bash
332
+ # Allow SSH from a specific subnet
333
+ proxmox vm firewall rules add 100 --action ACCEPT --dport 22 --proto tcp --source 192.168.1.0/24 --comment "Admin SSH"
334
+
335
+ # Or use a macro
336
+ proxmox vm firewall rules add 100 --action ACCEPT --macro SSH --source 192.168.1.0/24
337
+ ```
@@ -59,6 +59,7 @@ def build_root_parser() -> argparse.ArgumentParser:
59
59
  from proxmox.cli.cluster import register_cluster_parser
60
60
  from proxmox.cli.container import register_container_parser
61
61
  from proxmox.cli.node import register_node_parser
62
+ from proxmox.cli.pool import register_pool_parser
62
63
  from proxmox.cli.storage import register_storage_parser
63
64
  from proxmox.cli.tasks import register_task_parser
64
65
  from proxmox.cli.vm import register_vm_parser
@@ -66,6 +67,7 @@ def build_root_parser() -> argparse.ArgumentParser:
66
67
  register_auth_parser(subparsers)
67
68
  register_vm_parser(subparsers)
68
69
  register_node_parser(subparsers)
70
+ register_pool_parser(subparsers)
69
71
  register_container_parser(subparsers)
70
72
  register_storage_parser(subparsers)
71
73
  register_cluster_parser(subparsers)
@@ -0,0 +1,74 @@
1
+ """`proxmox pool` subcommand — resource pool management."""
2
+
3
+ from __future__ import annotations
4
+
5
+ import argparse
6
+
7
+ from proxmox.client.client import ProxmoxClient
8
+
9
+
10
+ def register_pool_parser(subparsers: argparse._SubParsersAction) -> None:
11
+ """Register the `proxmox pool` subcommand tree."""
12
+ pool_parser = subparsers.add_parser("pool", help="Manage resource pools")
13
+ pool_sub = pool_parser.add_subparsers(dest="action", title="actions", required=True)
14
+
15
+ # --- pool list ---
16
+ pool_list = pool_sub.add_parser("list", help="List all pools")
17
+ pool_list.set_defaults(func=_pool_list)
18
+
19
+ # --- pool show ---
20
+ pool_show = pool_sub.add_parser("show", help="Show pool details and members")
21
+ pool_show.add_argument("poolid", help="Pool ID")
22
+ pool_show.set_defaults(func=_pool_show)
23
+
24
+ # --- pool create ---
25
+ pool_create = pool_sub.add_parser("create", help="Create a new pool")
26
+ pool_create.add_argument("poolid", help="Pool ID")
27
+ pool_create.add_argument("--comment", default=None, help="Pool description / comment")
28
+ pool_create.set_defaults(func=_pool_create)
29
+
30
+ # --- pool update ---
31
+ pool_update = pool_sub.add_parser("update", help="Update a pool's comment")
32
+ pool_update.add_argument("poolid", help="Pool ID")
33
+ pool_update.add_argument("--comment", default=None, help="New comment (omit to clear)")
34
+ pool_update.add_argument("--allow-delete", action="store_true", help="Allow deletion of pool comment")
35
+ pool_update.set_defaults(func=_pool_update)
36
+
37
+ # --- pool delete ---
38
+ pool_delete = pool_sub.add_parser("delete", help="Delete a pool")
39
+ pool_delete.add_argument("poolid", help="Pool ID")
40
+ pool_delete.set_defaults(func=_pool_delete)
41
+
42
+
43
+ # ---------------------------------------------------------------------------
44
+ # Handlers
45
+ # ---------------------------------------------------------------------------
46
+
47
+ def _pool_list(_args: argparse.Namespace, client: ProxmoxClient) -> dict | list:
48
+ return client.get("/pools")
49
+
50
+
51
+ def _pool_show(args: argparse.Namespace, client: ProxmoxClient) -> dict:
52
+ return client.get(f"/pools/{args.poolid}")
53
+
54
+
55
+ def _pool_create(args: argparse.Namespace, client: ProxmoxClient) -> dict:
56
+ data: dict = {"poolid": args.poolid}
57
+ if args.comment:
58
+ data["comment"] = args.comment
59
+ return client.post("/pools", data=data)
60
+
61
+
62
+ def _pool_update(args: argparse.Namespace, client: ProxmoxClient) -> dict:
63
+ data: dict = {}
64
+ if args.comment is not None:
65
+ data["comment"] = args.comment
66
+ if args.allow_delete:
67
+ data["delete"] = 1
68
+ if not data:
69
+ return {"error": "Nothing to update. Use --comment or --allow-delete."}
70
+ return client.put(f"/pools/{args.poolid}", data=data)
71
+
72
+
73
+ def _pool_delete(args: argparse.Namespace, client: ProxmoxClient) -> dict:
74
+ return client.delete(f"/pools/{args.poolid}")
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "proxcli"
3
- version = "0.4.0"
3
+ version = "0.5.0"
4
4
  description = "A CLI tool to interact with Proxmox VE nodes and clusters via the REST API"
5
5
  readme = "README.md"
6
6
  authors = [
@@ -254,7 +254,7 @@ wheels = [
254
254
 
255
255
  [[package]]
256
256
  name = "proxcli"
257
- version = "0.4.0"
257
+ version = "0.5.0"
258
258
  source = { editable = "." }
259
259
  dependencies = [
260
260
  { name = "httpx" },
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes