devnomads-cli 0.17.0__tar.gz → 0.17.2__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.
- {devnomads_cli-0.17.0 → devnomads_cli-0.17.2}/PKG-INFO +28 -5
- {devnomads_cli-0.17.0 → devnomads_cli-0.17.2}/README.md +27 -4
- {devnomads_cli-0.17.0 → devnomads_cli-0.17.2}/devnomads_cli.egg-info/PKG-INFO +28 -5
- {devnomads_cli-0.17.0 → devnomads_cli-0.17.2}/dncli.py +43 -17
- {devnomads_cli-0.17.0 → devnomads_cli-0.17.2}/pyproject.toml +1 -1
- {devnomads_cli-0.17.0 → devnomads_cli-0.17.2}/tests/test_generated_cli.py +90 -0
- {devnomads_cli-0.17.0 → devnomads_cli-0.17.2}/LICENSE +0 -0
- {devnomads_cli-0.17.0 → devnomads_cli-0.17.2}/devnomads_cli.egg-info/SOURCES.txt +0 -0
- {devnomads_cli-0.17.0 → devnomads_cli-0.17.2}/devnomads_cli.egg-info/dependency_links.txt +0 -0
- {devnomads_cli-0.17.0 → devnomads_cli-0.17.2}/devnomads_cli.egg-info/entry_points.txt +0 -0
- {devnomads_cli-0.17.0 → devnomads_cli-0.17.2}/devnomads_cli.egg-info/requires.txt +0 -0
- {devnomads_cli-0.17.0 → devnomads_cli-0.17.2}/devnomads_cli.egg-info/top_level.txt +0 -0
- {devnomads_cli-0.17.0 → devnomads_cli-0.17.2}/setup.cfg +0 -0
- {devnomads_cli-0.17.0 → devnomads_cli-0.17.2}/tests/test_agent_features.py +0 -0
- {devnomads_cli-0.17.0 → devnomads_cli-0.17.2}/tests/test_cert.py +0 -0
- {devnomads_cli-0.17.0 → devnomads_cli-0.17.2}/tests/test_cli.py +0 -0
- {devnomads_cli-0.17.0 → devnomads_cli-0.17.2}/tests/test_config.py +0 -0
- {devnomads_cli-0.17.0 → devnomads_cli-0.17.2}/tests/test_generate.py +0 -0
- {devnomads_cli-0.17.0 → devnomads_cli-0.17.2}/tests/test_helpers.py +0 -0
- {devnomads_cli-0.17.0 → devnomads_cli-0.17.2}/tests/test_hook.py +0 -0
- {devnomads_cli-0.17.0 → devnomads_cli-0.17.2}/tests/test_sites_publish.py +0 -0
- {devnomads_cli-0.17.0 → devnomads_cli-0.17.2}/tests/test_sites_ssh.py +0 -0
- {devnomads_cli-0.17.0 → devnomads_cli-0.17.2}/tests/test_skill_install.py +0 -0
- {devnomads_cli-0.17.0 → devnomads_cli-0.17.2}/tests/test_ssh_keys.py +0 -0
- {devnomads_cli-0.17.0 → devnomads_cli-0.17.2}/tests/test_transfer.py +0 -0
- {devnomads_cli-0.17.0 → devnomads_cli-0.17.2}/tests/test_versions.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: devnomads-cli
|
|
3
|
-
Version: 0.17.
|
|
3
|
+
Version: 0.17.2
|
|
4
4
|
Summary: Manage your DevNomads services from the command line
|
|
5
5
|
Author-email: DevNomads <support@devnomads.nl>
|
|
6
6
|
License: MIT
|
|
@@ -27,13 +27,19 @@ as **`devnomads-cli`**.
|
|
|
27
27
|
## Install
|
|
28
28
|
|
|
29
29
|
Install dncli with [uv](https://docs.astral.sh/uv/). It gives dncli
|
|
30
|
-
its own isolated environment and
|
|
31
|
-
|
|
30
|
+
its own isolated environment and installs the `dncli` command in
|
|
31
|
+
`~/.local/bin`:
|
|
32
32
|
|
|
33
33
|
```sh
|
|
34
34
|
uv tool install devnomads-cli
|
|
35
|
+
uv tool update-shell # adds ~/.local/bin to your PATH, if it isn't yet
|
|
35
36
|
```
|
|
36
37
|
|
|
38
|
+
Then open a new terminal so the PATH change takes effect. On a fresh
|
|
39
|
+
machine, and on macOS in particular, `~/.local/bin` is not on your PATH
|
|
40
|
+
by default, so without this step the shell reports `dncli: command not
|
|
41
|
+
found`.
|
|
42
|
+
|
|
37
43
|
No uv yet? Install it first:
|
|
38
44
|
|
|
39
45
|
```sh
|
|
@@ -41,9 +47,23 @@ curl -LsSf https://astral.sh/uv/install.sh | sh #
|
|
|
41
47
|
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex" # Windows
|
|
42
48
|
```
|
|
43
49
|
|
|
50
|
+
The installer adds `~/.local/bin` to your shell profile, but only new
|
|
51
|
+
terminals pick that up: open a new one before running `uv tool install`.
|
|
52
|
+
|
|
44
53
|
pipx (`pipx install devnomads-cli`) and pip (`pip install
|
|
45
54
|
devnomads-cli`) work as well.
|
|
46
55
|
|
|
56
|
+
**Windows: `DLL load failed while importing _ctypes`.** When no Python is
|
|
57
|
+
installed, uv downloads its own Python build. On Windows with Smart App
|
|
58
|
+
Control or an App Control policy, that build's DLLs can be blocked ("…
|
|
59
|
+
blocked by an application control policy"). Install the official Python
|
|
60
|
+
and tell uv to use it instead; `--force` replaces the broken install:
|
|
61
|
+
|
|
62
|
+
```powershell
|
|
63
|
+
winget install Python.Python.3.12
|
|
64
|
+
uv tool install devnomads-cli --python-preference only-system --force
|
|
65
|
+
```
|
|
66
|
+
|
|
47
67
|
### Updates
|
|
48
68
|
|
|
49
69
|
Upgrade with:
|
|
@@ -296,7 +316,7 @@ fields, and reports an error on an unknown column name.
|
|
|
296
316
|
|
|
297
317
|
Commands that take a service id also accept a unique entity name and
|
|
298
318
|
resolve it for you, so `dncli domains show example.com` works as well
|
|
299
|
-
as `dncli domains show 1234`. Clients, SSH keys, clusters, hypervisors,
|
|
319
|
+
as `dncli domains show 1234`. Clients, SSH keys, clusters, nameserver groups, hypervisors,
|
|
300
320
|
database users and volumes take a name too, as an argument or an
|
|
301
321
|
option: `dncli databases permissions create stelling_bg25 --user-id stelling`. The
|
|
302
322
|
help of each such option says which field it matches. Names match
|
|
@@ -366,7 +386,10 @@ dncli skill install --project # into the current project instead
|
|
|
366
386
|
```
|
|
367
387
|
|
|
368
388
|
Run it again after upgrading dncli to update the skill; `dncli skill
|
|
369
|
-
show` prints it.
|
|
389
|
+
show` prints it. A copy an older dncli installed is replaced without
|
|
390
|
+
asking; a copy someone edited is replaced only after one confirmation
|
|
391
|
+
for all of them. When an installed copy is older than your dncli, dncli
|
|
392
|
+
says so (at a terminal, at most once a day, like the update notice).
|
|
370
393
|
|
|
371
394
|
## Certificates
|
|
372
395
|
|
|
@@ -11,13 +11,19 @@ as **`devnomads-cli`**.
|
|
|
11
11
|
## Install
|
|
12
12
|
|
|
13
13
|
Install dncli with [uv](https://docs.astral.sh/uv/). It gives dncli
|
|
14
|
-
its own isolated environment and
|
|
15
|
-
|
|
14
|
+
its own isolated environment and installs the `dncli` command in
|
|
15
|
+
`~/.local/bin`:
|
|
16
16
|
|
|
17
17
|
```sh
|
|
18
18
|
uv tool install devnomads-cli
|
|
19
|
+
uv tool update-shell # adds ~/.local/bin to your PATH, if it isn't yet
|
|
19
20
|
```
|
|
20
21
|
|
|
22
|
+
Then open a new terminal so the PATH change takes effect. On a fresh
|
|
23
|
+
machine, and on macOS in particular, `~/.local/bin` is not on your PATH
|
|
24
|
+
by default, so without this step the shell reports `dncli: command not
|
|
25
|
+
found`.
|
|
26
|
+
|
|
21
27
|
No uv yet? Install it first:
|
|
22
28
|
|
|
23
29
|
```sh
|
|
@@ -25,9 +31,23 @@ curl -LsSf https://astral.sh/uv/install.sh | sh #
|
|
|
25
31
|
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex" # Windows
|
|
26
32
|
```
|
|
27
33
|
|
|
34
|
+
The installer adds `~/.local/bin` to your shell profile, but only new
|
|
35
|
+
terminals pick that up: open a new one before running `uv tool install`.
|
|
36
|
+
|
|
28
37
|
pipx (`pipx install devnomads-cli`) and pip (`pip install
|
|
29
38
|
devnomads-cli`) work as well.
|
|
30
39
|
|
|
40
|
+
**Windows: `DLL load failed while importing _ctypes`.** When no Python is
|
|
41
|
+
installed, uv downloads its own Python build. On Windows with Smart App
|
|
42
|
+
Control or an App Control policy, that build's DLLs can be blocked ("…
|
|
43
|
+
blocked by an application control policy"). Install the official Python
|
|
44
|
+
and tell uv to use it instead; `--force` replaces the broken install:
|
|
45
|
+
|
|
46
|
+
```powershell
|
|
47
|
+
winget install Python.Python.3.12
|
|
48
|
+
uv tool install devnomads-cli --python-preference only-system --force
|
|
49
|
+
```
|
|
50
|
+
|
|
31
51
|
### Updates
|
|
32
52
|
|
|
33
53
|
Upgrade with:
|
|
@@ -280,7 +300,7 @@ fields, and reports an error on an unknown column name.
|
|
|
280
300
|
|
|
281
301
|
Commands that take a service id also accept a unique entity name and
|
|
282
302
|
resolve it for you, so `dncli domains show example.com` works as well
|
|
283
|
-
as `dncli domains show 1234`. Clients, SSH keys, clusters, hypervisors,
|
|
303
|
+
as `dncli domains show 1234`. Clients, SSH keys, clusters, nameserver groups, hypervisors,
|
|
284
304
|
database users and volumes take a name too, as an argument or an
|
|
285
305
|
option: `dncli databases permissions create stelling_bg25 --user-id stelling`. The
|
|
286
306
|
help of each such option says which field it matches. Names match
|
|
@@ -350,7 +370,10 @@ dncli skill install --project # into the current project instead
|
|
|
350
370
|
```
|
|
351
371
|
|
|
352
372
|
Run it again after upgrading dncli to update the skill; `dncli skill
|
|
353
|
-
show` prints it.
|
|
373
|
+
show` prints it. A copy an older dncli installed is replaced without
|
|
374
|
+
asking; a copy someone edited is replaced only after one confirmation
|
|
375
|
+
for all of them. When an installed copy is older than your dncli, dncli
|
|
376
|
+
says so (at a terminal, at most once a day, like the update notice).
|
|
354
377
|
|
|
355
378
|
## Certificates
|
|
356
379
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: devnomads-cli
|
|
3
|
-
Version: 0.17.
|
|
3
|
+
Version: 0.17.2
|
|
4
4
|
Summary: Manage your DevNomads services from the command line
|
|
5
5
|
Author-email: DevNomads <support@devnomads.nl>
|
|
6
6
|
License: MIT
|
|
@@ -27,13 +27,19 @@ as **`devnomads-cli`**.
|
|
|
27
27
|
## Install
|
|
28
28
|
|
|
29
29
|
Install dncli with [uv](https://docs.astral.sh/uv/). It gives dncli
|
|
30
|
-
its own isolated environment and
|
|
31
|
-
|
|
30
|
+
its own isolated environment and installs the `dncli` command in
|
|
31
|
+
`~/.local/bin`:
|
|
32
32
|
|
|
33
33
|
```sh
|
|
34
34
|
uv tool install devnomads-cli
|
|
35
|
+
uv tool update-shell # adds ~/.local/bin to your PATH, if it isn't yet
|
|
35
36
|
```
|
|
36
37
|
|
|
38
|
+
Then open a new terminal so the PATH change takes effect. On a fresh
|
|
39
|
+
machine, and on macOS in particular, `~/.local/bin` is not on your PATH
|
|
40
|
+
by default, so without this step the shell reports `dncli: command not
|
|
41
|
+
found`.
|
|
42
|
+
|
|
37
43
|
No uv yet? Install it first:
|
|
38
44
|
|
|
39
45
|
```sh
|
|
@@ -41,9 +47,23 @@ curl -LsSf https://astral.sh/uv/install.sh | sh #
|
|
|
41
47
|
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex" # Windows
|
|
42
48
|
```
|
|
43
49
|
|
|
50
|
+
The installer adds `~/.local/bin` to your shell profile, but only new
|
|
51
|
+
terminals pick that up: open a new one before running `uv tool install`.
|
|
52
|
+
|
|
44
53
|
pipx (`pipx install devnomads-cli`) and pip (`pip install
|
|
45
54
|
devnomads-cli`) work as well.
|
|
46
55
|
|
|
56
|
+
**Windows: `DLL load failed while importing _ctypes`.** When no Python is
|
|
57
|
+
installed, uv downloads its own Python build. On Windows with Smart App
|
|
58
|
+
Control or an App Control policy, that build's DLLs can be blocked ("…
|
|
59
|
+
blocked by an application control policy"). Install the official Python
|
|
60
|
+
and tell uv to use it instead; `--force` replaces the broken install:
|
|
61
|
+
|
|
62
|
+
```powershell
|
|
63
|
+
winget install Python.Python.3.12
|
|
64
|
+
uv tool install devnomads-cli --python-preference only-system --force
|
|
65
|
+
```
|
|
66
|
+
|
|
47
67
|
### Updates
|
|
48
68
|
|
|
49
69
|
Upgrade with:
|
|
@@ -296,7 +316,7 @@ fields, and reports an error on an unknown column name.
|
|
|
296
316
|
|
|
297
317
|
Commands that take a service id also accept a unique entity name and
|
|
298
318
|
resolve it for you, so `dncli domains show example.com` works as well
|
|
299
|
-
as `dncli domains show 1234`. Clients, SSH keys, clusters, hypervisors,
|
|
319
|
+
as `dncli domains show 1234`. Clients, SSH keys, clusters, nameserver groups, hypervisors,
|
|
300
320
|
database users and volumes take a name too, as an argument or an
|
|
301
321
|
option: `dncli databases permissions create stelling_bg25 --user-id stelling`. The
|
|
302
322
|
help of each such option says which field it matches. Names match
|
|
@@ -366,7 +386,10 @@ dncli skill install --project # into the current project instead
|
|
|
366
386
|
```
|
|
367
387
|
|
|
368
388
|
Run it again after upgrading dncli to update the skill; `dncli skill
|
|
369
|
-
show` prints it.
|
|
389
|
+
show` prints it. A copy an older dncli installed is replaced without
|
|
390
|
+
asking; a copy someone edited is replaced only after one confirmation
|
|
391
|
+
for all of them. When an installed copy is older than your dncli, dncli
|
|
392
|
+
says so (at a terminal, at most once a day, like the update notice).
|
|
370
393
|
|
|
371
394
|
## Certificates
|
|
372
395
|
|
|
@@ -72,7 +72,7 @@ from rich.markup import escape
|
|
|
72
72
|
from rich.table import Table
|
|
73
73
|
from typer.core import TyperGroup
|
|
74
74
|
|
|
75
|
-
__version__ = "0.17.
|
|
75
|
+
__version__ = "0.17.2"
|
|
76
76
|
|
|
77
77
|
# Distribution names, for reporting versions via `dncli version`.
|
|
78
78
|
CLI_PACKAGE = "devnomads-cli"
|
|
@@ -4022,7 +4022,7 @@ def _wait_for_batch(
|
|
|
4022
4022
|
|
|
4023
4023
|
# --- BEGIN GENERATED COMMANDS (tools/generate.py; do not edit by hand) ---
|
|
4024
4024
|
|
|
4025
|
-
API_VERSION = "0.6.
|
|
4025
|
+
API_VERSION = "0.6.32"
|
|
4026
4026
|
SKILL_MD = """\
|
|
4027
4027
|
---
|
|
4028
4028
|
name: devnomads
|
|
@@ -4182,6 +4182,7 @@ Job `status` is one of `queued`, `running`, `completed`, `failed`,
|
|
|
4182
4182
|
| `--key-id` | `dncli keys list` | `name` |
|
|
4183
4183
|
| `--handle-id-*`, `--handle-id` | `dncli handles list` | |
|
|
4184
4184
|
| `--nameserver-group-id` | `dncli nameserver-groups list` | `name` |
|
|
4185
|
+
| nameserver id argument | `dncli nameserver-groups nameservers list <group>` | `hostname` |
|
|
4185
4186
|
| `--volume-id` | `dncli containers clusters volumes list <cluster_id>` | `path` |
|
|
4186
4187
|
| `--user-id`, `--database-user-id` | `dncli databases clusters users list <cluster_id>` | `username` |
|
|
4187
4188
|
|
|
@@ -4377,10 +4378,14 @@ dncli containers deploy <service_id> --wait # nothing runs until deployed
|
|
|
4377
4378
|
- New handles can only be used for domains once their job has completed.
|
|
4378
4379
|
- A domain's nameservers come from a nameserver group: DevNomads' shared
|
|
4379
4380
|
group (DevNomads manages the DNS) or one of the client's own. Ask which
|
|
4380
|
-
one when registering (`--nameserver-group-id`)
|
|
4381
|
-
|
|
4382
|
-
|
|
4383
|
-
|
|
4381
|
+
one when registering (`--nameserver-group-id`). Nameservers added to an
|
|
4382
|
+
own group (`dncli nameserver-groups nameservers create`) must already
|
|
4383
|
+
resolve to both an IPv4 and an IPv6 address.
|
|
4384
|
+
- `dncli domains update <domain>` turns DNSSEC on (`--dnssec`) or off
|
|
4385
|
+
(`--no-dnssec`) at the registrar, and moves a domain to another group
|
|
4386
|
+
(`--nameserver-group-id`). One of `--dnssec`/`--no-dnssec` is always
|
|
4387
|
+
required, and a group move needs `--no-dnssec`: switch DNSSEC back on
|
|
4388
|
+
with a second update after the move's job has completed.
|
|
4384
4389
|
"""
|
|
4385
4390
|
|
|
4386
4391
|
LOOKUPS: dict[str, dict[str, Any]] = {
|
|
@@ -4424,6 +4429,12 @@ LOOKUPS: dict[str, dict[str, Any]] = {
|
|
|
4424
4429
|
"list": "/services/domains/nameserver-groups",
|
|
4425
4430
|
"name": "name",
|
|
4426
4431
|
},
|
|
4432
|
+
"nameserver_id": {
|
|
4433
|
+
"what": "nameserver",
|
|
4434
|
+
"list": "/services/domains/nameserver-groups/{nameserverGroupId}/nameservers",
|
|
4435
|
+
"name": "hostname",
|
|
4436
|
+
"each": {"nameserverGroupId": "/services/domains/nameserver-groups"},
|
|
4437
|
+
},
|
|
4427
4438
|
"proxies:cluster_id": {
|
|
4428
4439
|
"what": "proxy cluster",
|
|
4429
4440
|
"list": "/services/proxies/clusters",
|
|
@@ -6636,10 +6647,10 @@ def gen_nameserverGroups_nameservers_show(
|
|
|
6636
6647
|
metavar="NAMESERVER_GROUP_ID",
|
|
6637
6648
|
help="Nameserver group id, from `dncli nameserver-groups list`. The nameserver group's unique `name` works too.",
|
|
6638
6649
|
),
|
|
6639
|
-
nameserver_id:
|
|
6650
|
+
nameserver_id: str = typer.Argument(
|
|
6640
6651
|
...,
|
|
6641
6652
|
metavar="NAMESERVER_ID",
|
|
6642
|
-
help="Nameserver id, from `dncli nameserver-groups nameservers list`.",
|
|
6653
|
+
help="Nameserver id, from `dncli nameserver-groups nameservers list`. The nameserver's unique `hostname` works too.",
|
|
6643
6654
|
),
|
|
6644
6655
|
timeout: int = _TIMEOUT_OPT,
|
|
6645
6656
|
output: OutputFormat | None = _OUTPUT_OPT,
|
|
@@ -6652,7 +6663,10 @@ def gen_nameserverGroups_nameservers_show(
|
|
|
6652
6663
|
"GET",
|
|
6653
6664
|
"/services/domains/nameserver-groups/{nameserverGroupId}/nameservers/{nameserverId}",
|
|
6654
6665
|
{"nameserverGroupId": nameserver_group_id, "nameserverId": nameserver_id},
|
|
6655
|
-
lookups={
|
|
6666
|
+
lookups={
|
|
6667
|
+
"nameserverGroupId": "nameserver_group_id",
|
|
6668
|
+
"nameserverId": "nameserver_id",
|
|
6669
|
+
},
|
|
6656
6670
|
timeout=timeout,
|
|
6657
6671
|
output=output,
|
|
6658
6672
|
select=columns,
|
|
@@ -6704,10 +6718,10 @@ def gen_nameserverGroups_nameservers_update(
|
|
|
6704
6718
|
metavar="NAMESERVER_GROUP_ID",
|
|
6705
6719
|
help="Nameserver group id, from `dncli nameserver-groups list`. The nameserver group's unique `name` works too.",
|
|
6706
6720
|
),
|
|
6707
|
-
nameserver_id:
|
|
6721
|
+
nameserver_id: str = typer.Argument(
|
|
6708
6722
|
...,
|
|
6709
6723
|
metavar="NAMESERVER_ID",
|
|
6710
|
-
help="Nameserver id, from `dncli nameserver-groups nameservers list`.",
|
|
6724
|
+
help="Nameserver id, from `dncli nameserver-groups nameservers list`. The nameserver's unique `hostname` works too.",
|
|
6711
6725
|
),
|
|
6712
6726
|
hostname: str = typer.Option(..., help="New hostname of the nameserver."),
|
|
6713
6727
|
wait: bool = _WAIT_OPT,
|
|
@@ -6726,7 +6740,10 @@ def gen_nameserverGroups_nameservers_update(
|
|
|
6726
6740
|
"/services/domains/nameserver-groups/{nameserverGroupId}/nameservers/{nameserverId}",
|
|
6727
6741
|
{"nameserverGroupId": nameserver_group_id, "nameserverId": nameserver_id},
|
|
6728
6742
|
body={"hostname": hostname},
|
|
6729
|
-
lookups={
|
|
6743
|
+
lookups={
|
|
6744
|
+
"nameserverGroupId": "nameserver_group_id",
|
|
6745
|
+
"nameserverId": "nameserver_id",
|
|
6746
|
+
},
|
|
6730
6747
|
dry_run=dry_run,
|
|
6731
6748
|
wait=wait,
|
|
6732
6749
|
timeout=timeout,
|
|
@@ -8811,9 +8828,14 @@ def gen_services_domains_update(
|
|
|
8811
8828
|
metavar="SERVICE_ID",
|
|
8812
8829
|
help="Service id, or the service's unique entity name (usually its domain or name).",
|
|
8813
8830
|
),
|
|
8814
|
-
|
|
8831
|
+
is_dnssec_enabled: bool = typer.Option(
|
|
8815
8832
|
...,
|
|
8816
|
-
|
|
8833
|
+
"--dnssec/--no-dnssec",
|
|
8834
|
+
help="DNSSEC at the registrar: --dnssec to turn it on, --no-dnssec to turn it off. Must be --no-dnssec when changing the nameserver group.",
|
|
8835
|
+
),
|
|
8836
|
+
nameserver_group_id: str | None = typer.Option(
|
|
8837
|
+
None,
|
|
8838
|
+
help="Nameserver group to move the domain to, from `dncli nameserver-groups list`. The nameserver group's unique `name` works too.",
|
|
8817
8839
|
),
|
|
8818
8840
|
wait: bool = _WAIT_OPT,
|
|
8819
8841
|
dry_run: bool = _DRY_RUN_OPT,
|
|
@@ -8821,16 +8843,20 @@ def gen_services_domains_update(
|
|
|
8821
8843
|
output: OutputFormat | None = _OUTPUT_OPT,
|
|
8822
8844
|
columns: str | None = _COLUMNS_OPT,
|
|
8823
8845
|
) -> None:
|
|
8824
|
-
"""
|
|
8846
|
+
"""Turn DNSSEC on or off at the registrar, or move a domain to another nameserver group.
|
|
8825
8847
|
|
|
8826
|
-
The registry gets the
|
|
8848
|
+
--dnssec or --no-dnssec is always required. Moving to another group needs --no-dnssec; turn DNSSEC back on with a second update once the move is done. The registry gets the changes in the background.
|
|
8849
|
+
"""
|
|
8827
8850
|
|
|
8828
8851
|
_generated_call(
|
|
8829
8852
|
ctx,
|
|
8830
8853
|
"PUT",
|
|
8831
8854
|
"/services/domains/{serviceId}",
|
|
8832
8855
|
{"serviceId": service_id},
|
|
8833
|
-
body={
|
|
8856
|
+
body={
|
|
8857
|
+
"is_dnssec_enabled": is_dnssec_enabled,
|
|
8858
|
+
"nameserver_group_id": nameserver_group_id,
|
|
8859
|
+
},
|
|
8834
8860
|
resolve="/services/domains",
|
|
8835
8861
|
lookups={"nameserver_group_id": "nameserver_group_id"},
|
|
8836
8862
|
dry_run=dry_run,
|
|
@@ -668,3 +668,93 @@ def test_sites_create_help_mentions_proxy_and_database():
|
|
|
668
668
|
result = runner.invoke(app, ["sites", "create", "--help"], env={"COLUMNS": "200"})
|
|
669
669
|
assert "dncli proxies create" in result.output
|
|
670
670
|
assert "dncli databases create" in result.output
|
|
671
|
+
|
|
672
|
+
|
|
673
|
+
NAMESERVER_GROUPS = [
|
|
674
|
+
{"id": 1, "client_id": None, "name": "devnomads"},
|
|
675
|
+
{"id": 5, "client_id": 9, "name": "own-dns"},
|
|
676
|
+
]
|
|
677
|
+
|
|
678
|
+
|
|
679
|
+
def _mock_domains_and_groups():
|
|
680
|
+
respx.get(f"{API}/services/domains").mock(
|
|
681
|
+
return_value=Response(200, json=[{"service_id": 42, "entity": "example.com"}])
|
|
682
|
+
)
|
|
683
|
+
respx.get(f"{API}/services/domains/nameserver-groups").mock(
|
|
684
|
+
return_value=Response(200, json={"data": NAMESERVER_GROUPS})
|
|
685
|
+
)
|
|
686
|
+
return respx.put(f"{API}/services/domains/42").mock(
|
|
687
|
+
return_value=Response(202, json={"data": []})
|
|
688
|
+
)
|
|
689
|
+
|
|
690
|
+
|
|
691
|
+
@respx.mock
|
|
692
|
+
def test_domains_update_turns_dnssec_on_by_entity(configured):
|
|
693
|
+
route = _mock_domains_and_groups()
|
|
694
|
+
result = runner.invoke(app, ["domains", "update", "example.com", "--dnssec"])
|
|
695
|
+
assert result.exit_code == 0, result.output
|
|
696
|
+
assert json.loads(route.calls.last.request.content) == {"is_dnssec_enabled": True}
|
|
697
|
+
|
|
698
|
+
|
|
699
|
+
@respx.mock
|
|
700
|
+
def test_domains_update_moves_group_by_name(configured):
|
|
701
|
+
route = _mock_domains_and_groups()
|
|
702
|
+
result = runner.invoke(
|
|
703
|
+
app,
|
|
704
|
+
[
|
|
705
|
+
"domains",
|
|
706
|
+
"update",
|
|
707
|
+
"example.com",
|
|
708
|
+
"--no-dnssec",
|
|
709
|
+
"--nameserver-group-id",
|
|
710
|
+
"own-dns",
|
|
711
|
+
],
|
|
712
|
+
)
|
|
713
|
+
assert result.exit_code == 0, result.output
|
|
714
|
+
assert json.loads(route.calls.last.request.content) == {
|
|
715
|
+
"is_dnssec_enabled": False,
|
|
716
|
+
"nameserver_group_id": 5,
|
|
717
|
+
}
|
|
718
|
+
|
|
719
|
+
|
|
720
|
+
def test_domains_update_requires_a_dnssec_choice(configured):
|
|
721
|
+
result = runner.invoke(
|
|
722
|
+
app, ["domains", "update", "example.com", "--nameserver-group-id", "5"]
|
|
723
|
+
)
|
|
724
|
+
assert result.exit_code != 0
|
|
725
|
+
assert "--dnssec" in result.output
|
|
726
|
+
|
|
727
|
+
|
|
728
|
+
@respx.mock
|
|
729
|
+
def test_nameserver_resolves_by_hostname_within_its_group(configured):
|
|
730
|
+
respx.get(f"{API}/services/domains/nameserver-groups").mock(
|
|
731
|
+
return_value=Response(200, json={"data": NAMESERVER_GROUPS})
|
|
732
|
+
)
|
|
733
|
+
respx.get(f"{API}/services/domains/nameserver-groups/5/nameservers").mock(
|
|
734
|
+
return_value=Response(
|
|
735
|
+
200,
|
|
736
|
+
json={
|
|
737
|
+
"data": [
|
|
738
|
+
{"id": 11, "hostname": "ns1.example.com"},
|
|
739
|
+
{"id": 12, "hostname": "ns2.example.com"},
|
|
740
|
+
]
|
|
741
|
+
},
|
|
742
|
+
)
|
|
743
|
+
)
|
|
744
|
+
detail = respx.get(
|
|
745
|
+
f"{API}/services/domains/nameserver-groups/5/nameservers/12"
|
|
746
|
+
).mock(return_value=Response(200, json={"id": 12, "hostname": "ns2.example.com"}))
|
|
747
|
+
result = runner.invoke(
|
|
748
|
+
app,
|
|
749
|
+
[
|
|
750
|
+
"--out",
|
|
751
|
+
"json",
|
|
752
|
+
"nameserver-groups",
|
|
753
|
+
"nameservers",
|
|
754
|
+
"show",
|
|
755
|
+
"own-dns",
|
|
756
|
+
"ns2.example.com",
|
|
757
|
+
],
|
|
758
|
+
)
|
|
759
|
+
assert result.exit_code == 0, result.output
|
|
760
|
+
assert detail.called
|
|
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
|