wayscloud-cli 0.3.0__tar.gz → 0.4.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.
- {wayscloud_cli-0.3.0 → wayscloud_cli-0.4.0}/PKG-INFO +2 -2
- {wayscloud_cli-0.3.0 → wayscloud_cli-0.4.0}/pyproject.toml +2 -2
- {wayscloud_cli-0.3.0 → wayscloud_cli-0.4.0}/setup.cfg +1 -1
- wayscloud_cli-0.4.0/wayscloud_cli/__init__.py +1 -0
- {wayscloud_cli-0.3.0 → wayscloud_cli-0.4.0}/wayscloud_cli/commands/db.py +73 -0
- {wayscloud_cli-0.3.0 → wayscloud_cli-0.4.0}/wayscloud_cli/commands/dns.py +89 -0
- wayscloud_cli-0.4.0/wayscloud_cli/commands/iot.py +558 -0
- {wayscloud_cli-0.3.0 → wayscloud_cli-0.4.0}/wayscloud_cli/commands/redis.py +104 -0
- wayscloud_cli-0.4.0/wayscloud_cli/commands/storage.py +182 -0
- {wayscloud_cli-0.3.0 → wayscloud_cli-0.4.0}/wayscloud_cli/commands/vps.py +124 -0
- {wayscloud_cli-0.3.0 → wayscloud_cli-0.4.0}/wayscloud_cli.egg-info/PKG-INFO +2 -2
- {wayscloud_cli-0.3.0 → wayscloud_cli-0.4.0}/wayscloud_cli.egg-info/requires.txt +1 -1
- wayscloud_cli-0.3.0/wayscloud_cli/__init__.py +0 -1
- wayscloud_cli-0.3.0/wayscloud_cli/commands/iot.py +0 -154
- wayscloud_cli-0.3.0/wayscloud_cli/commands/storage.py +0 -76
- {wayscloud_cli-0.3.0 → wayscloud_cli-0.4.0}/README.md +0 -0
- {wayscloud_cli-0.3.0 → wayscloud_cli-0.4.0}/tests/test_smoke.py +0 -0
- {wayscloud_cli-0.3.0 → wayscloud_cli-0.4.0}/wayscloud_cli/__main__.py +0 -0
- {wayscloud_cli-0.3.0 → wayscloud_cli-0.4.0}/wayscloud_cli/commands/__init__.py +0 -0
- {wayscloud_cli-0.3.0 → wayscloud_cli-0.4.0}/wayscloud_cli/commands/app.py +0 -0
- {wayscloud_cli-0.3.0 → wayscloud_cli-0.4.0}/wayscloud_cli/commands/login.py +0 -0
- {wayscloud_cli-0.3.0 → wayscloud_cli-0.4.0}/wayscloud_cli/commands/shell.py +0 -0
- {wayscloud_cli-0.3.0 → wayscloud_cli-0.4.0}/wayscloud_cli/config.py +0 -0
- {wayscloud_cli-0.3.0 → wayscloud_cli-0.4.0}/wayscloud_cli/output.py +0 -0
- {wayscloud_cli-0.3.0 → wayscloud_cli-0.4.0}/wayscloud_cli/sdk.py +0 -0
- {wayscloud_cli-0.3.0 → wayscloud_cli-0.4.0}/wayscloud_cli.egg-info/SOURCES.txt +0 -0
- {wayscloud_cli-0.3.0 → wayscloud_cli-0.4.0}/wayscloud_cli.egg-info/dependency_links.txt +0 -0
- {wayscloud_cli-0.3.0 → wayscloud_cli-0.4.0}/wayscloud_cli.egg-info/entry_points.txt +0 -0
- {wayscloud_cli-0.3.0 → wayscloud_cli-0.4.0}/wayscloud_cli.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: wayscloud-cli
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.4.0
|
|
4
4
|
Summary: Command-line interface for WAYSCloud — manage VPS, DNS, databases, storage, apps, IoT, and more
|
|
5
5
|
License: MIT
|
|
6
6
|
Project-URL: Homepage, https://wayscloud.services
|
|
@@ -19,7 +19,7 @@ Classifier: Programming Language :: Python :: 3.12
|
|
|
19
19
|
Classifier: Operating System :: OS Independent
|
|
20
20
|
Requires-Python: >=3.9
|
|
21
21
|
Description-Content-Type: text/markdown
|
|
22
|
-
Requires-Dist: wayscloud>=0.
|
|
22
|
+
Requires-Dist: wayscloud>=0.3.0
|
|
23
23
|
Requires-Dist: typer>=0.9
|
|
24
24
|
Requires-Dist: rich>=13.0
|
|
25
25
|
Requires-Dist: websockets>=12.0
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "wayscloud-cli"
|
|
7
|
-
version = "0.
|
|
7
|
+
version = "0.4.0"
|
|
8
8
|
description = "Command-line interface for WAYSCloud — manage VPS, DNS, databases, storage, apps, IoT, and more"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
requires-python = ">=3.9"
|
|
@@ -22,7 +22,7 @@ classifiers = [
|
|
|
22
22
|
"Operating System :: OS Independent",
|
|
23
23
|
]
|
|
24
24
|
dependencies = [
|
|
25
|
-
"wayscloud>=0.
|
|
25
|
+
"wayscloud>=0.3.0",
|
|
26
26
|
"typer>=0.9",
|
|
27
27
|
"rich>=13.0",
|
|
28
28
|
"websockets>=12.0",
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "0.4.0"
|
|
@@ -91,3 +91,76 @@ def delete_database(
|
|
|
91
91
|
print_json(data)
|
|
92
92
|
else:
|
|
93
93
|
print(f"Database {name}: deleted")
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
@app.command("tiers")
|
|
97
|
+
def list_tiers(
|
|
98
|
+
token: Optional[str] = typer.Option(None, "--token", help="Override token"),
|
|
99
|
+
):
|
|
100
|
+
"""List available database tiers."""
|
|
101
|
+
c = get_client(token)
|
|
102
|
+
data = sdk_call(c.database.tiers)
|
|
103
|
+
if is_json_mode():
|
|
104
|
+
print_json(data)
|
|
105
|
+
return
|
|
106
|
+
tiers = data if isinstance(data, list) else []
|
|
107
|
+
for t in tiers:
|
|
108
|
+
name = t.get("name", t.get("tier", ""))
|
|
109
|
+
desc = t.get("description", "")
|
|
110
|
+
print(f" {name:<16} {desc}")
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
@app.command("firewall")
|
|
114
|
+
def list_firewall(
|
|
115
|
+
db_type: str = typer.Argument(..., help="Database type (postgresql/mariadb)"),
|
|
116
|
+
name: str = typer.Argument(..., help="Database name"),
|
|
117
|
+
token: Optional[str] = typer.Option(None, "--token", help="Override token"),
|
|
118
|
+
):
|
|
119
|
+
"""List firewall rules for a database."""
|
|
120
|
+
c = get_client(token)
|
|
121
|
+
data = sdk_call(c.database.firewall_rules, db_type, name)
|
|
122
|
+
rules = data if isinstance(data, list) else []
|
|
123
|
+
if is_json_mode():
|
|
124
|
+
print_json(rules)
|
|
125
|
+
return
|
|
126
|
+
if not rules:
|
|
127
|
+
print("No firewall rules.")
|
|
128
|
+
return
|
|
129
|
+
rows = [{"id": str(r.get("id", ""))[:12], "ip": r.get("ip_address", ""),
|
|
130
|
+
"desc": r.get("description", ""), "created": r.get("created_at", "")[:19]}
|
|
131
|
+
for r in rules]
|
|
132
|
+
print_table(rows, [("id", "ID", 14), ("ip", "IP Address", 20),
|
|
133
|
+
("desc", "Description", 24), ("created", "Created", 20)])
|
|
134
|
+
|
|
135
|
+
|
|
136
|
+
@app.command("firewall-add")
|
|
137
|
+
def add_firewall(
|
|
138
|
+
db_type: str = typer.Argument(..., help="Database type (postgresql/mariadb)"),
|
|
139
|
+
name: str = typer.Argument(..., help="Database name"),
|
|
140
|
+
ip: str = typer.Option(..., "--ip", help="IP address to whitelist"),
|
|
141
|
+
description: str = typer.Option("", "--description", help="Description"),
|
|
142
|
+
token: Optional[str] = typer.Option(None, "--token", help="Override token"),
|
|
143
|
+
):
|
|
144
|
+
"""Add a firewall rule to whitelist an IP address."""
|
|
145
|
+
c = get_client(token)
|
|
146
|
+
data = sdk_call(c.database.add_firewall_rule, db_type, name, ip_address=ip, description=description)
|
|
147
|
+
if is_json_mode():
|
|
148
|
+
print_json(data)
|
|
149
|
+
else:
|
|
150
|
+
print(f"Firewall rule added: {ip}")
|
|
151
|
+
|
|
152
|
+
|
|
153
|
+
@app.command("firewall-remove")
|
|
154
|
+
def remove_firewall(
|
|
155
|
+
db_type: str = typer.Argument(..., help="Database type (postgresql/mariadb)"),
|
|
156
|
+
name: str = typer.Argument(..., help="Database name"),
|
|
157
|
+
rule_id: str = typer.Option(..., "--rule-id", help="Rule ID"),
|
|
158
|
+
token: Optional[str] = typer.Option(None, "--token", help="Override token"),
|
|
159
|
+
):
|
|
160
|
+
"""Remove a firewall rule."""
|
|
161
|
+
c = get_client(token)
|
|
162
|
+
data = sdk_call(c.database.remove_firewall_rule, db_type, name, rule_id)
|
|
163
|
+
if is_json_mode():
|
|
164
|
+
print_json(data)
|
|
165
|
+
else:
|
|
166
|
+
print(f"Firewall rule {rule_id}: removed")
|
|
@@ -38,6 +38,25 @@ def list_zones(
|
|
|
38
38
|
])
|
|
39
39
|
|
|
40
40
|
|
|
41
|
+
@app.command("zones-info")
|
|
42
|
+
def zone_info(
|
|
43
|
+
zone_name: str = typer.Argument(..., help="Zone name"),
|
|
44
|
+
token: Optional[str] = typer.Option(None, "--token", help="Override token"),
|
|
45
|
+
):
|
|
46
|
+
"""Show details for a DNS zone."""
|
|
47
|
+
c = get_client(token)
|
|
48
|
+
data = sdk_call(c.dns.get, zone_name)
|
|
49
|
+
if is_json_mode():
|
|
50
|
+
print_json(data)
|
|
51
|
+
else:
|
|
52
|
+
from ..output import print_object
|
|
53
|
+
print_object(data, [
|
|
54
|
+
("name", "Name"), ("status", "Status"), ("zone_type", "Type"),
|
|
55
|
+
("record_count", "Records"), ("dnssec_enabled", "DNSSEC"),
|
|
56
|
+
("created_at", "Created"),
|
|
57
|
+
])
|
|
58
|
+
|
|
59
|
+
|
|
41
60
|
@app.command("zones-create")
|
|
42
61
|
def create_zone(
|
|
43
62
|
name: str = typer.Argument(..., help="Zone name"),
|
|
@@ -169,3 +188,73 @@ def delete_record(
|
|
|
169
188
|
print_json(data)
|
|
170
189
|
else:
|
|
171
190
|
print(f"Record {record_id}: deleted")
|
|
191
|
+
|
|
192
|
+
|
|
193
|
+
@app.command("dnssec-status")
|
|
194
|
+
def dnssec_status(
|
|
195
|
+
zone_name: str = typer.Argument(..., help="Zone name"),
|
|
196
|
+
token: Optional[str] = typer.Option(None, "--token", help="Override token"),
|
|
197
|
+
):
|
|
198
|
+
"""Show DNSSEC status for a zone."""
|
|
199
|
+
c = get_client(token)
|
|
200
|
+
data = sdk_call(c.dns.dnssec_status, zone_name)
|
|
201
|
+
if is_json_mode():
|
|
202
|
+
print_json(data)
|
|
203
|
+
else:
|
|
204
|
+
from ..output import print_object
|
|
205
|
+
print_object(data, [
|
|
206
|
+
("enabled", "Enabled"), ("ds_records", "DS Records"),
|
|
207
|
+
("algorithm", "Algorithm"), ("key_tag", "Key Tag"),
|
|
208
|
+
])
|
|
209
|
+
|
|
210
|
+
|
|
211
|
+
@app.command("dnssec-activate")
|
|
212
|
+
def dnssec_activate(
|
|
213
|
+
zone_name: str = typer.Argument(..., help="Zone name"),
|
|
214
|
+
token: Optional[str] = typer.Option(None, "--token", help="Override token"),
|
|
215
|
+
):
|
|
216
|
+
"""Activate DNSSEC for a zone."""
|
|
217
|
+
c = get_client(token)
|
|
218
|
+
data = sdk_call(c.dns.dnssec_activate, zone_name)
|
|
219
|
+
if is_json_mode():
|
|
220
|
+
print_json(data)
|
|
221
|
+
else:
|
|
222
|
+
print(f"DNSSEC activated for {zone_name}.")
|
|
223
|
+
|
|
224
|
+
|
|
225
|
+
@app.command("dnssec-deactivate")
|
|
226
|
+
def dnssec_deactivate(
|
|
227
|
+
zone_name: str = typer.Argument(..., help="Zone name"),
|
|
228
|
+
confirm: bool = typer.Option(False, "--confirm", help="Skip confirmation"),
|
|
229
|
+
token: Optional[str] = typer.Option(None, "--token", help="Override token"),
|
|
230
|
+
):
|
|
231
|
+
"""Deactivate DNSSEC for a zone."""
|
|
232
|
+
if not confirm:
|
|
233
|
+
print(f"This will deactivate DNSSEC for {zone_name}.")
|
|
234
|
+
print("Use --confirm to proceed.")
|
|
235
|
+
raise typer.Exit(code=1)
|
|
236
|
+
|
|
237
|
+
c = get_client(token)
|
|
238
|
+
data = sdk_call(c.dns.dnssec_deactivate, zone_name)
|
|
239
|
+
if is_json_mode():
|
|
240
|
+
print_json(data)
|
|
241
|
+
else:
|
|
242
|
+
print(f"DNSSEC deactivated for {zone_name}.")
|
|
243
|
+
|
|
244
|
+
|
|
245
|
+
@app.command("statistics")
|
|
246
|
+
def zone_statistics(
|
|
247
|
+
zone_name: str = typer.Argument(..., help="Zone name"),
|
|
248
|
+
token: Optional[str] = typer.Option(None, "--token", help="Override token"),
|
|
249
|
+
):
|
|
250
|
+
"""Show zone statistics (query counts)."""
|
|
251
|
+
c = get_client(token)
|
|
252
|
+
data = sdk_call(c.dns.statistics, zone_name)
|
|
253
|
+
if is_json_mode():
|
|
254
|
+
print_json(data)
|
|
255
|
+
else:
|
|
256
|
+
from ..output import print_object
|
|
257
|
+
print_object(data, [
|
|
258
|
+
("total_queries", "Total Queries"), ("queries_today", "Queries Today"),
|
|
259
|
+
("record_count", "Records"),
|
|
260
|
+
])
|