devnomads-cli 0.16.0__py3-none-any.whl → 0.17.0__py3-none-any.whl
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.16.0.dist-info → devnomads_cli-0.17.0.dist-info}/METADATA +1 -1
- devnomads_cli-0.17.0.dist-info/RECORD +7 -0
- dncli.py +704 -42
- devnomads_cli-0.16.0.dist-info/RECORD +0 -7
- {devnomads_cli-0.16.0.dist-info → devnomads_cli-0.17.0.dist-info}/WHEEL +0 -0
- {devnomads_cli-0.16.0.dist-info → devnomads_cli-0.17.0.dist-info}/entry_points.txt +0 -0
- {devnomads_cli-0.16.0.dist-info → devnomads_cli-0.17.0.dist-info}/licenses/LICENSE +0 -0
- {devnomads_cli-0.16.0.dist-info → devnomads_cli-0.17.0.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
dncli.py,sha256=L3volfhwr56gKTIH3RRTTgJs7pT77ZYbO8lQZTu6uIg,457194
|
|
2
|
+
devnomads_cli-0.17.0.dist-info/licenses/LICENSE,sha256=WPXQ_lmpr3tVzTD9Z6VTiBgFnFey-cEwEYoG4HlmbxY,1066
|
|
3
|
+
devnomads_cli-0.17.0.dist-info/METADATA,sha256=UaftzOxvZ-CqTw2kUK70XNdmhZqQ6xNAwmyqTpmNFsM,17472
|
|
4
|
+
devnomads_cli-0.17.0.dist-info/WHEEL,sha256=mOdXR9C3wMVov7cSY8PY-XCzo3SmmWCHvGQr5csJoao,91
|
|
5
|
+
devnomads_cli-0.17.0.dist-info/entry_points.txt,sha256=irLaKiGtIzEKi87exmXAg0srUmoDK31fL0SlqJasAEU,69
|
|
6
|
+
devnomads_cli-0.17.0.dist-info/top_level.txt,sha256=rFWIJDQgL3jA2q6b2GAqZgCknDED4WLxNcHTktuWS1I,6
|
|
7
|
+
devnomads_cli-0.17.0.dist-info/RECORD,,
|
dncli.py
CHANGED
|
@@ -54,6 +54,8 @@ from typing import (
|
|
|
54
54
|
Literal,
|
|
55
55
|
Protocol,
|
|
56
56
|
TypeGuard,
|
|
57
|
+
get_args,
|
|
58
|
+
get_origin,
|
|
57
59
|
)
|
|
58
60
|
|
|
59
61
|
import httpx
|
|
@@ -70,7 +72,7 @@ from rich.markup import escape
|
|
|
70
72
|
from rich.table import Table
|
|
71
73
|
from typer.core import TyperGroup
|
|
72
74
|
|
|
73
|
-
__version__ = "0.
|
|
75
|
+
__version__ = "0.17.0"
|
|
74
76
|
|
|
75
77
|
# Distribution names, for reporting versions via `dncli version`.
|
|
76
78
|
CLI_PACKAGE = "devnomads-cli"
|
|
@@ -1650,6 +1652,45 @@ HANDWRITTEN_CHANGES = {
|
|
|
1650
1652
|
_CATALOG_SKIP = {"output", "columns", "timeout"}
|
|
1651
1653
|
|
|
1652
1654
|
|
|
1655
|
+
def _param_type(param: Any) -> tuple[str, list[Any] | None]:
|
|
1656
|
+
"""A parameter's type name and its choices (None unless it has them).
|
|
1657
|
+
|
|
1658
|
+
typer up to 0.28 builds a click type for every parameter (`param.type`).
|
|
1659
|
+
typer 0.29 dropped click's types: it keeps the Python annotation in
|
|
1660
|
+
`param.type_descriptor` and converts values itself, so read that."""
|
|
1661
|
+
|
|
1662
|
+
click_type = getattr(param, "type", None)
|
|
1663
|
+
if click_type is not None:
|
|
1664
|
+
choices = getattr(click_type, "choices", None)
|
|
1665
|
+
if choices is not None:
|
|
1666
|
+
return "choice", list(choices)
|
|
1667
|
+
name = click_type.name
|
|
1668
|
+
return {"integer": "int", "text": "str"}.get(name, name), None
|
|
1669
|
+
|
|
1670
|
+
descriptor = getattr(param, "type_descriptor", None)
|
|
1671
|
+
annotation = getattr(descriptor, "annotation", str)
|
|
1672
|
+
if get_origin(annotation) in (list, tuple) and get_args(annotation):
|
|
1673
|
+
annotation = get_args(annotation)[0] # a repeatable option
|
|
1674
|
+
if get_origin(annotation) is Literal:
|
|
1675
|
+
return "choice", list(get_args(annotation))
|
|
1676
|
+
if isinstance(annotation, type) and issubclass(annotation, Enum):
|
|
1677
|
+
return "choice", [member.value for member in annotation]
|
|
1678
|
+
if annotation is bool:
|
|
1679
|
+
return "bool", None
|
|
1680
|
+
if annotation is int:
|
|
1681
|
+
ranged = getattr(param, "min", None) is not None or (
|
|
1682
|
+
getattr(param, "max", None) is not None
|
|
1683
|
+
)
|
|
1684
|
+
return ("integer range" if ranged else "int"), None
|
|
1685
|
+
if annotation is float:
|
|
1686
|
+
return "float", None
|
|
1687
|
+
if isinstance(annotation, type) and issubclass(annotation, Path):
|
|
1688
|
+
info = getattr(descriptor, "parameter_info", None)
|
|
1689
|
+
files = getattr(info, "file_okay", True)
|
|
1690
|
+
return ("path" if files else "directory"), None
|
|
1691
|
+
return "str", None
|
|
1692
|
+
|
|
1693
|
+
|
|
1653
1694
|
def _param_entry(param: Any) -> dict[str, Any]:
|
|
1654
1695
|
"""One option or argument of a click command, for `dncli commands`.
|
|
1655
1696
|
Duck-typed: typer ships its own click, so isinstance checks miss."""
|
|
@@ -1660,15 +1701,9 @@ def _param_entry(param: Any) -> dict[str, Any]:
|
|
|
1660
1701
|
else:
|
|
1661
1702
|
longs = [opt for opt in param.opts if opt.startswith("--")]
|
|
1662
1703
|
name = longs[0] if longs else param.opts[0]
|
|
1663
|
-
choices =
|
|
1704
|
+
type_name, choices = _param_type(param)
|
|
1664
1705
|
if getattr(param, "is_flag", False):
|
|
1665
|
-
type_name = "flag"
|
|
1666
|
-
elif choices is not None:
|
|
1667
|
-
type_name = "choice"
|
|
1668
|
-
else:
|
|
1669
|
-
type_name = {"integer": "int", "text": "str"}.get(
|
|
1670
|
-
param.type.name, param.type.name
|
|
1671
|
-
)
|
|
1706
|
+
type_name, choices = "flag", None
|
|
1672
1707
|
entry: dict[str, Any] = {
|
|
1673
1708
|
"name": name,
|
|
1674
1709
|
"kind": kind,
|
|
@@ -1729,6 +1764,8 @@ def command_catalog(prefix: list[str] | None = None) -> list[dict[str, Any]]:
|
|
|
1729
1764
|
"method": meta["method"] if meta else None,
|
|
1730
1765
|
"path": meta["path"] if meta else None,
|
|
1731
1766
|
"params": params,
|
|
1767
|
+
# what to do after it, e.g. the proxy and database a new site needs
|
|
1768
|
+
**({"next": meta["next"]} if meta and meta.get("next") else {}),
|
|
1732
1769
|
}
|
|
1733
1770
|
)
|
|
1734
1771
|
|
|
@@ -1939,7 +1976,7 @@ def _verify_devnomads_key(api_url: str, api_key: str) -> None:
|
|
|
1939
1976
|
"""Best-effort check that a freshly stored key actually authenticates.
|
|
1940
1977
|
|
|
1941
1978
|
There is no no-op auth endpoint, so this hits the cheapest one -
|
|
1942
|
-
GET /
|
|
1979
|
+
GET /clients. A 401 is reported as a warning (the key is still stored);
|
|
1943
1980
|
network or other errors are ignored so `configure` works offline.
|
|
1944
1981
|
"""
|
|
1945
1982
|
|
|
@@ -1950,7 +1987,7 @@ def _verify_devnomads_key(api_url: str, api_key: str) -> None:
|
|
|
1950
1987
|
user_agent=user_agent(),
|
|
1951
1988
|
timeout=REQUEST_TIMEOUT,
|
|
1952
1989
|
) as client:
|
|
1953
|
-
client.request("GET", "/
|
|
1990
|
+
client.request("GET", "/clients")
|
|
1954
1991
|
except AuthError:
|
|
1955
1992
|
err_console.print(
|
|
1956
1993
|
"warning: the key was stored, but the API rejected it (401) - "
|
|
@@ -3430,7 +3467,9 @@ def skill_install(
|
|
|
3430
3467
|
Code (~/.claude/skills), Codex (~/.agents/skills), Gemini CLI
|
|
3431
3468
|
(~/.gemini/skills), GitHub Copilot (~/.copilot/skills), Cursor
|
|
3432
3469
|
(~/.cursor/skills) and OpenCode (~/.config/opencode/skills). Run it
|
|
3433
|
-
again after upgrading dncli to update the skill
|
|
3470
|
+
again after upgrading dncli to update the skill: a copy an older dncli
|
|
3471
|
+
wrote is replaced without asking, an edited one only after one
|
|
3472
|
+
confirmation for all of them."""
|
|
3434
3473
|
|
|
3435
3474
|
if path is not None:
|
|
3436
3475
|
if agents:
|
|
@@ -3445,19 +3484,138 @@ def skill_install(
|
|
|
3445
3484
|
targets = list(
|
|
3446
3485
|
dict.fromkeys(_skill_dirs(agent, project)[1] for agent in chosen)
|
|
3447
3486
|
)
|
|
3448
|
-
for base in targets
|
|
3449
|
-
_install_skill(base / SKILL_NAME / "SKILL.md", yes)
|
|
3487
|
+
_install_skills([base / SKILL_NAME / "SKILL.md" for base in targets], yes)
|
|
3450
3488
|
|
|
3451
3489
|
|
|
3452
|
-
|
|
3453
|
-
|
|
3454
|
-
|
|
3455
|
-
|
|
3456
|
-
|
|
3457
|
-
|
|
3490
|
+
# `dncli skill install` stamps the copy it writes with the dncli version and a
|
|
3491
|
+
# digest of the skill text, in the frontmatter's metadata. A later dncli can
|
|
3492
|
+
# then tell a copy an older dncli wrote (replaced without asking) from one
|
|
3493
|
+
# someone edited (replaced after confirmation), and warn about old copies.
|
|
3494
|
+
_SKILL_STAMP = re.compile(r'^ dncli-(version|sha256): "([^"]*)"\n', re.MULTILINE)
|
|
3495
|
+
|
|
3496
|
+
|
|
3497
|
+
def _skill_digest(text: str) -> str:
|
|
3498
|
+
return hashlib.sha256(text.encode()).hexdigest()
|
|
3499
|
+
|
|
3500
|
+
|
|
3501
|
+
def skill_text() -> str:
|
|
3502
|
+
"""SKILL.md as `dncli skill install` writes it: stamped with this dncli's
|
|
3503
|
+
version and the digest of the skill text."""
|
|
3504
|
+
|
|
3505
|
+
end = SKILL_MD.index("\n---\n", 3) + 1 # where the closing --- starts
|
|
3506
|
+
head, rest = SKILL_MD[:end], SKILL_MD[end:]
|
|
3507
|
+
stamp = (
|
|
3508
|
+
f' dncli-version: "{__version__}"\n'
|
|
3509
|
+
f' dncli-sha256: "{_skill_digest(SKILL_MD)}"\n'
|
|
3510
|
+
)
|
|
3511
|
+
if re.search(r"^metadata:\n", head, re.MULTILINE):
|
|
3512
|
+
head = re.sub(
|
|
3513
|
+
r"^metadata:\n", lambda m: m[0] + stamp, head, count=1, flags=re.MULTILINE
|
|
3514
|
+
)
|
|
3515
|
+
else:
|
|
3516
|
+
head += "metadata:\n" + stamp
|
|
3517
|
+
return head + rest
|
|
3518
|
+
|
|
3519
|
+
|
|
3520
|
+
@dataclass
|
|
3521
|
+
class InstalledSkill:
|
|
3522
|
+
path: Path
|
|
3523
|
+
current: bool # exactly what this dncli writes
|
|
3524
|
+
version: str | None # the dncli that wrote it; None when not stamped
|
|
3525
|
+
edited: bool # changed since; True when it cannot be told
|
|
3526
|
+
project: bool = False # in the current project, not the home directory
|
|
3527
|
+
|
|
3528
|
+
@property
|
|
3529
|
+
def older(self) -> bool:
|
|
3530
|
+
"""Written by an older dncli, or by one that did not stamp it."""
|
|
3531
|
+
|
|
3532
|
+
written = _version_tuple(self.version)
|
|
3533
|
+
return written is None or written < (_version_tuple(__version__) or written)
|
|
3534
|
+
|
|
3535
|
+
@property
|
|
3536
|
+
def safe_to_replace(self) -> bool:
|
|
3537
|
+
"""An unedited copy from an older dncli: nothing of anyone's is lost."""
|
|
3538
|
+
|
|
3539
|
+
return not self.edited and self.older
|
|
3540
|
+
|
|
3541
|
+
|
|
3542
|
+
def read_installed_skill(path: Path) -> InstalledSkill | None:
|
|
3543
|
+
"""The skill installed at ``path``, or None when there is none."""
|
|
3544
|
+
|
|
3545
|
+
try:
|
|
3546
|
+
text = path.read_text()
|
|
3547
|
+
except (OSError, UnicodeDecodeError):
|
|
3548
|
+
return None
|
|
3549
|
+
if text == skill_text():
|
|
3550
|
+
return InstalledSkill(path, True, __version__, False)
|
|
3551
|
+
stamp = dict(_SKILL_STAMP.findall(text))
|
|
3552
|
+
unstamped = _SKILL_STAMP.sub("", text)
|
|
3553
|
+
# drop the metadata key the stamp added, when nothing else is under it
|
|
3554
|
+
unstamped = re.sub(r"^metadata:\n(?=---\n)", "", unstamped, flags=re.MULTILINE)
|
|
3555
|
+
edited = "sha256" not in stamp or _skill_digest(unstamped) != stamp["sha256"]
|
|
3556
|
+
return InstalledSkill(path, False, stamp.get("version"), edited)
|
|
3557
|
+
|
|
3558
|
+
|
|
3559
|
+
def _install_skills(targets: list[Path], yes: bool) -> None:
|
|
3560
|
+
"""Write the skill to every target. New copies and unedited ones from an
|
|
3561
|
+
older dncli first; then one question for all the copies that may hold
|
|
3562
|
+
someone's edits (or come from a newer dncli)."""
|
|
3563
|
+
|
|
3564
|
+
safe: list[tuple[Path, InstalledSkill | None]] = []
|
|
3565
|
+
risky: list[InstalledSkill] = []
|
|
3566
|
+
for target in targets:
|
|
3567
|
+
found = read_installed_skill(target)
|
|
3568
|
+
if found and found.current:
|
|
3569
|
+
err_console.print(f"{target} is up to date", markup=False, soft_wrap=True)
|
|
3570
|
+
elif found is None or found.safe_to_replace:
|
|
3571
|
+
safe.append((target, found))
|
|
3572
|
+
else:
|
|
3573
|
+
risky.append(found)
|
|
3574
|
+
for target, found in safe:
|
|
3575
|
+
_write_skill(target, found)
|
|
3576
|
+
if not risky:
|
|
3577
|
+
return
|
|
3578
|
+
for found in risky:
|
|
3579
|
+
if found.version is None:
|
|
3580
|
+
why = "from a dncli that did not record whether it was edited"
|
|
3581
|
+
elif found.edited:
|
|
3582
|
+
why = "edited"
|
|
3583
|
+
else:
|
|
3584
|
+
why = f"from a newer dncli, {found.version}"
|
|
3585
|
+
err_console.print(f" {found.path} ({why})", markup=False, soft_wrap=True)
|
|
3586
|
+
_confirm(
|
|
3587
|
+
f"Replace {'this copy' if len(risky) == 1 else 'these copies'} "
|
|
3588
|
+
"with this dncli version's skill?",
|
|
3589
|
+
yes,
|
|
3590
|
+
)
|
|
3591
|
+
for found in risky:
|
|
3592
|
+
_write_skill(found.path, found)
|
|
3593
|
+
|
|
3594
|
+
|
|
3595
|
+
def _write_skill(target: Path, found: InstalledSkill | None) -> None:
|
|
3458
3596
|
target.parent.mkdir(parents=True, exist_ok=True)
|
|
3459
|
-
target.write_text(
|
|
3460
|
-
|
|
3597
|
+
target.write_text(skill_text())
|
|
3598
|
+
if found is None:
|
|
3599
|
+
err_console.print(f"installed {target}", markup=False, soft_wrap=True)
|
|
3600
|
+
else:
|
|
3601
|
+
was = f" (was dncli {found.version})" if found.version else ""
|
|
3602
|
+
err_console.print(f"updated {target}{was}", markup=False, soft_wrap=True)
|
|
3603
|
+
|
|
3604
|
+
|
|
3605
|
+
def installed_skills() -> list[InstalledSkill]:
|
|
3606
|
+
"""The skill copies in every agent's skills directory, in your home
|
|
3607
|
+
directory and in the current project."""
|
|
3608
|
+
|
|
3609
|
+
paths: dict[Path, bool] = {} # path -> in the project
|
|
3610
|
+
for project in (False, True):
|
|
3611
|
+
for agent in SkillAgent:
|
|
3612
|
+
try:
|
|
3613
|
+
base = _skill_dirs(agent, project)[1]
|
|
3614
|
+
except OSError: # the current directory is gone
|
|
3615
|
+
continue
|
|
3616
|
+
paths.setdefault(base / SKILL_NAME / "SKILL.md", project)
|
|
3617
|
+
found = [(read_installed_skill(path), project) for path, project in paths.items()]
|
|
3618
|
+
return [replace(skill, project=project) for skill, project in found if skill]
|
|
3461
3619
|
|
|
3462
3620
|
|
|
3463
3621
|
def _list_rows(state: AppState, path: str) -> list[dict[str, Any]]:
|
|
@@ -3679,11 +3837,13 @@ def _generated_call(
|
|
|
3679
3837
|
required: list[str] | None = None,
|
|
3680
3838
|
edits: dict[str, tuple[str, str, list[str] | None, list[str] | None]] | None = None,
|
|
3681
3839
|
dry_run: bool = False,
|
|
3840
|
+
next_steps: str | None = None,
|
|
3682
3841
|
) -> None:
|
|
3683
3842
|
"""Shared runtime for generated commands: resolve names to ids, build
|
|
3684
3843
|
the request, confirm if needed (or only show it with --dry-run), call
|
|
3685
3844
|
the API, render the result. ``wait`` is None for a synchronous
|
|
3686
|
-
operation, and True/False for one that queues jobs.
|
|
3845
|
+
operation, and True/False for one that queues jobs. ``next_steps`` is
|
|
3846
|
+
printed on stderr once the API has accepted the request."""
|
|
3687
3847
|
|
|
3688
3848
|
state = state_from(ctx, output, select)
|
|
3689
3849
|
path_params = dict(path_params)
|
|
@@ -3737,13 +3897,14 @@ def _generated_call(
|
|
|
3737
3897
|
data = response.data
|
|
3738
3898
|
if wait is not None and isinstance(data, list):
|
|
3739
3899
|
_queued_jobs(state, response, wait, deadline, timeout)
|
|
3740
|
-
|
|
3741
|
-
if data is None:
|
|
3900
|
+
elif data is None:
|
|
3742
3901
|
err_console.print("ok")
|
|
3743
|
-
|
|
3744
|
-
|
|
3745
|
-
|
|
3746
|
-
|
|
3902
|
+
else:
|
|
3903
|
+
if isinstance(data, list):
|
|
3904
|
+
data = sort_rows(data, sort)
|
|
3905
|
+
render(state, data, columns=columns, title=path)
|
|
3906
|
+
if next_steps:
|
|
3907
|
+
err_console.print(next_steps, markup=False, highlight=False)
|
|
3747
3908
|
|
|
3748
3909
|
|
|
3749
3910
|
def _parse_object(text: str, fields: dict[str, str]) -> dict[str, Any]:
|
|
@@ -3861,7 +4022,7 @@ def _wait_for_batch(
|
|
|
3861
4022
|
|
|
3862
4023
|
# --- BEGIN GENERATED COMMANDS (tools/generate.py; do not edit by hand) ---
|
|
3863
4024
|
|
|
3864
|
-
API_VERSION = "0.6.
|
|
4025
|
+
API_VERSION = "0.6.31"
|
|
3865
4026
|
SKILL_MD = """\
|
|
3866
4027
|
---
|
|
3867
4028
|
name: devnomads
|
|
@@ -4020,6 +4181,7 @@ Job `status` is one of `queued`, `running`, `completed`, `failed`,
|
|
|
4020
4181
|
| `--ipv4-network-id`, `--ipv6-network-id` | `dncli servers networks list` (same `vlan`) | |
|
|
4021
4182
|
| `--key-id` | `dncli keys list` | `name` |
|
|
4022
4183
|
| `--handle-id-*`, `--handle-id` | `dncli handles list` | |
|
|
4184
|
+
| `--nameserver-group-id` | `dncli nameserver-groups list` | `name` |
|
|
4023
4185
|
| `--volume-id` | `dncli containers clusters volumes list <cluster_id>` | `path` |
|
|
4024
4186
|
| `--user-id`, `--database-user-id` | `dncli databases clusters users list <cluster_id>` | `username` |
|
|
4025
4187
|
|
|
@@ -4035,7 +4197,12 @@ dncli services list --out json -c service_id,type,entity
|
|
|
4035
4197
|
dncli sites show example.com --out json
|
|
4036
4198
|
```
|
|
4037
4199
|
|
|
4038
|
-
Create a site (asynchronous)
|
|
4200
|
+
Create a site (asynchronous). A site only holds the files and runs PHP. It
|
|
4201
|
+
usually needs two more services, each created and billed on its own, which
|
|
4202
|
+
users often do not expect: a **proxy**, so visitors reach the site on its
|
|
4203
|
+
domain, and for most applications (WordPress, Magento, Laravel, ...) a
|
|
4204
|
+
**database**. Tell the user this before you start, and ask whether they
|
|
4205
|
+
already have them or want them created too:
|
|
4039
4206
|
|
|
4040
4207
|
```sh
|
|
4041
4208
|
dncli clients list --out json -c id,name
|
|
@@ -4044,8 +4211,33 @@ dncli sites clusters list --out json -c id,name,php_versions
|
|
|
4044
4211
|
dncli sites create --client-id 12 --product-sku <sku> --cluster-id 3 \\
|
|
4045
4212
|
--primary-domain example.com --php-version 8.3 --profile default \\
|
|
4046
4213
|
--generate-password --dry-run # check the request, then without --dry-run and with --wait
|
|
4214
|
+
|
|
4215
|
+
# the proxy: same domain and aliases, the site's host(s) as backend
|
|
4216
|
+
dncli sites show example.com --out json | jq -r '.site.hosts[].hostname'
|
|
4217
|
+
dncli proxies list --out json | jq '.[] | {entity, cluster: .proxy.cluster_id, backends: .proxy.backends}'
|
|
4218
|
+
dncli proxies create --client-id 12 --cluster-id <ask> \\
|
|
4219
|
+
--primary-domain example.com --backends-service-type site \\
|
|
4220
|
+
--backend web04.sites.infrapod.nl --dry-run # one --backend per host, --alias per site alias
|
|
4221
|
+
|
|
4222
|
+
# the database, its user and their access: see "Create a database with a user"
|
|
4047
4223
|
```
|
|
4048
4224
|
|
|
4225
|
+
**Pick the proxy cluster and the database cluster with the user; never
|
|
4226
|
+
guess.** Not every proxy cluster can reach every web server, and the cluster
|
|
4227
|
+
lists do not say which can: a client sees the shared clusters and possibly
|
|
4228
|
+
its own, without anything that links a proxy cluster to the site clusters it
|
|
4229
|
+
serves. The best evidence is the client's existing proxies: those whose
|
|
4230
|
+
`backends` include the site's host show which proxy cluster already reaches
|
|
4231
|
+
that server. Suggest that cluster, but ask the user to confirm, and ask
|
|
4232
|
+
outright when existing proxies point at several clusters or at none (a new
|
|
4233
|
+
server). Never take the first cluster in the list. The same goes for the
|
|
4234
|
+
database cluster: nothing in the API links a database to a site, so ask the
|
|
4235
|
+
user which one to use.
|
|
4236
|
+
|
|
4237
|
+
`dncli sites create` prints a short reminder of these steps on stderr once
|
|
4238
|
+
the site is accepted, and `dncli commands sites create --out json` lists it
|
|
4239
|
+
as `next`.
|
|
4240
|
+
|
|
4049
4241
|
Create a server and give the user SSH access:
|
|
4050
4242
|
|
|
4051
4243
|
```sh
|
|
@@ -4164,7 +4356,9 @@ dncli containers deploy <service_id> --wait # nothing runs until deployed
|
|
|
4164
4356
|
`dncli containers instances deploy`.
|
|
4165
4357
|
- `dncli proxies create` ignores `--is-health-checked`, `--force-ssl`,
|
|
4166
4358
|
`--is-down-backend` and `--temporary-url-domain`; set them afterwards with
|
|
4167
|
-
`dncli proxies update`. A proxy and
|
|
4359
|
+
`dncli proxies update`. A proxy's domain and aliases cannot be in use by
|
|
4360
|
+
another proxy or a forward; a site on the same domain is fine (that is
|
|
4361
|
+
how a site is served).
|
|
4168
4362
|
- On update commands, list options (`--alias`, `--backend`, `--whitelist-ip`)
|
|
4169
4363
|
replace the whole list. To change one entry use `--add-alias` /
|
|
4170
4364
|
`--remove-alias` (and `--add-backend` / `--remove-backend` on proxies):
|
|
@@ -4181,6 +4375,12 @@ dncli containers deploy <service_id> --wait # nothing runs until deployed
|
|
|
4181
4375
|
- `dncli emails records list` only returns records for transactional email
|
|
4182
4376
|
services.
|
|
4183
4377
|
- New handles can only be used for domains once their job has completed.
|
|
4378
|
+
- A domain's nameservers come from a nameserver group: DevNomads' shared
|
|
4379
|
+
group (DevNomads manages the DNS) or one of the client's own. Ask which
|
|
4380
|
+
one when registering (`--nameserver-group-id`); `dncli domains update`
|
|
4381
|
+
moves a domain to another group. Nameservers added to an own group
|
|
4382
|
+
(`dncli nameserver-groups nameservers create`) must already resolve to
|
|
4383
|
+
both an IPv4 and an IPv6 address.
|
|
4184
4384
|
"""
|
|
4185
4385
|
|
|
4186
4386
|
LOOKUPS: dict[str, dict[str, Any]] = {
|
|
@@ -4219,6 +4419,11 @@ LOOKUPS: dict[str, dict[str, Any]] = {
|
|
|
4219
4419
|
"name": "alias",
|
|
4220
4420
|
},
|
|
4221
4421
|
"key_id": {"what": "SSH key", "list": "/keys", "name": "name"},
|
|
4422
|
+
"nameserver_group_id": {
|
|
4423
|
+
"what": "nameserver group",
|
|
4424
|
+
"list": "/services/domains/nameserver-groups",
|
|
4425
|
+
"name": "name",
|
|
4426
|
+
},
|
|
4222
4427
|
"proxies:cluster_id": {
|
|
4223
4428
|
"what": "proxy cluster",
|
|
4224
4429
|
"list": "/services/proxies/clusters",
|
|
@@ -4249,7 +4454,7 @@ COMMAND_META: dict[str, dict[str, Any]] = {
|
|
|
4249
4454
|
},
|
|
4250
4455
|
"handles create": {
|
|
4251
4456
|
"method": "POST",
|
|
4252
|
-
"path": "/handles",
|
|
4457
|
+
"path": "/services/domains/handles",
|
|
4253
4458
|
"changes": True,
|
|
4254
4459
|
"confirm": False,
|
|
4255
4460
|
"background": True,
|
|
@@ -4257,7 +4462,7 @@ COMMAND_META: dict[str, dict[str, Any]] = {
|
|
|
4257
4462
|
},
|
|
4258
4463
|
"handles list": {
|
|
4259
4464
|
"method": "GET",
|
|
4260
|
-
"path": "/handles",
|
|
4465
|
+
"path": "/services/domains/handles",
|
|
4261
4466
|
"changes": False,
|
|
4262
4467
|
"confirm": False,
|
|
4263
4468
|
"background": False,
|
|
@@ -4265,7 +4470,7 @@ COMMAND_META: dict[str, dict[str, Any]] = {
|
|
|
4265
4470
|
},
|
|
4266
4471
|
"handles show": {
|
|
4267
4472
|
"method": "GET",
|
|
4268
|
-
"path": "/handles/{handleId}",
|
|
4473
|
+
"path": "/services/domains/handles/{handleId}",
|
|
4269
4474
|
"changes": False,
|
|
4270
4475
|
"confirm": False,
|
|
4271
4476
|
"background": False,
|
|
@@ -4351,6 +4556,70 @@ COMMAND_META: dict[str, dict[str, Any]] = {
|
|
|
4351
4556
|
"background": False,
|
|
4352
4557
|
"billing": False,
|
|
4353
4558
|
},
|
|
4559
|
+
"nameserver-groups list": {
|
|
4560
|
+
"method": "GET",
|
|
4561
|
+
"path": "/services/domains/nameserver-groups",
|
|
4562
|
+
"changes": False,
|
|
4563
|
+
"confirm": False,
|
|
4564
|
+
"background": False,
|
|
4565
|
+
"billing": False,
|
|
4566
|
+
},
|
|
4567
|
+
"nameserver-groups nameservers list": {
|
|
4568
|
+
"method": "GET",
|
|
4569
|
+
"path": "/services/domains/nameserver-groups/{nameserverGroupId}/nameservers",
|
|
4570
|
+
"changes": False,
|
|
4571
|
+
"confirm": False,
|
|
4572
|
+
"background": False,
|
|
4573
|
+
"billing": False,
|
|
4574
|
+
},
|
|
4575
|
+
"nameserver-groups nameservers show": {
|
|
4576
|
+
"method": "GET",
|
|
4577
|
+
"path": "/services/domains/nameserver-groups/{nameserverGroupId}/nameservers/{nameserverId}",
|
|
4578
|
+
"changes": False,
|
|
4579
|
+
"confirm": False,
|
|
4580
|
+
"background": False,
|
|
4581
|
+
"billing": False,
|
|
4582
|
+
},
|
|
4583
|
+
"nameserver-groups nameservers create": {
|
|
4584
|
+
"method": "POST",
|
|
4585
|
+
"path": "/services/domains/nameserver-groups/{nameserverGroupId}/nameservers",
|
|
4586
|
+
"changes": True,
|
|
4587
|
+
"confirm": False,
|
|
4588
|
+
"background": True,
|
|
4589
|
+
"billing": False,
|
|
4590
|
+
},
|
|
4591
|
+
"nameserver-groups nameservers update": {
|
|
4592
|
+
"method": "PUT",
|
|
4593
|
+
"path": "/services/domains/nameserver-groups/{nameserverGroupId}/nameservers/{nameserverId}",
|
|
4594
|
+
"changes": True,
|
|
4595
|
+
"confirm": False,
|
|
4596
|
+
"background": True,
|
|
4597
|
+
"billing": False,
|
|
4598
|
+
},
|
|
4599
|
+
"nameserver-groups show": {
|
|
4600
|
+
"method": "GET",
|
|
4601
|
+
"path": "/services/domains/nameserver-groups/{nameserverGroupId}",
|
|
4602
|
+
"changes": False,
|
|
4603
|
+
"confirm": False,
|
|
4604
|
+
"background": False,
|
|
4605
|
+
"billing": False,
|
|
4606
|
+
},
|
|
4607
|
+
"nameserver-groups create": {
|
|
4608
|
+
"method": "POST",
|
|
4609
|
+
"path": "/services/domains/nameserver-groups",
|
|
4610
|
+
"changes": True,
|
|
4611
|
+
"confirm": False,
|
|
4612
|
+
"background": True,
|
|
4613
|
+
"billing": False,
|
|
4614
|
+
},
|
|
4615
|
+
"nameserver-groups update": {
|
|
4616
|
+
"method": "PUT",
|
|
4617
|
+
"path": "/services/domains/nameserver-groups/{nameserverGroupId}",
|
|
4618
|
+
"changes": True,
|
|
4619
|
+
"confirm": False,
|
|
4620
|
+
"background": False,
|
|
4621
|
+
"billing": False,
|
|
4622
|
+
},
|
|
4354
4623
|
"products list": {
|
|
4355
4624
|
"method": "GET",
|
|
4356
4625
|
"path": "/products",
|
|
@@ -4791,6 +5060,14 @@ COMMAND_META: dict[str, dict[str, Any]] = {
|
|
|
4791
5060
|
"background": False,
|
|
4792
5061
|
"billing": False,
|
|
4793
5062
|
},
|
|
5063
|
+
"domains nameservers list": {
|
|
5064
|
+
"method": "GET",
|
|
5065
|
+
"path": "/services/domains/{serviceId}/nameservers",
|
|
5066
|
+
"changes": False,
|
|
5067
|
+
"confirm": False,
|
|
5068
|
+
"background": False,
|
|
5069
|
+
"billing": False,
|
|
5070
|
+
},
|
|
4794
5071
|
"domains show": {
|
|
4795
5072
|
"method": "GET",
|
|
4796
5073
|
"path": "/services/domains/{serviceId}",
|
|
@@ -4799,6 +5076,14 @@ COMMAND_META: dict[str, dict[str, Any]] = {
|
|
|
4799
5076
|
"background": False,
|
|
4800
5077
|
"billing": False,
|
|
4801
5078
|
},
|
|
5079
|
+
"domains update": {
|
|
5080
|
+
"method": "PUT",
|
|
5081
|
+
"path": "/services/domains/{serviceId}",
|
|
5082
|
+
"changes": True,
|
|
5083
|
+
"confirm": False,
|
|
5084
|
+
"background": True,
|
|
5085
|
+
"billing": False,
|
|
5086
|
+
},
|
|
4802
5087
|
"emails aliases create": {
|
|
4803
5088
|
"method": "POST",
|
|
4804
5089
|
"path": "/services/emails/{serviceId}/aliases",
|
|
@@ -5438,6 +5723,7 @@ COMMAND_META: dict[str, dict[str, Any]] = {
|
|
|
5438
5723
|
"confirm": False,
|
|
5439
5724
|
"background": True,
|
|
5440
5725
|
"billing": True,
|
|
5726
|
+
"next": "Next, unless they exist already: a proxy so visitors reach the site (dncli proxies create --backends-service-type site with the site's domain as --primary-domain, its aliases as --alias and each host in site.hosts of `dncli sites show` as --backend), and for most applications a database (dncli databases create, then databases users create and databases permissions create). Both are separate services. Not every proxy cluster can reach every web server: existing proxies with the same host as backend show one that does.",
|
|
5441
5727
|
},
|
|
5442
5728
|
"sites update": {
|
|
5443
5729
|
"method": "PUT",
|
|
@@ -5632,6 +5918,12 @@ gen_keys = typer.Typer(
|
|
|
5632
5918
|
no_args_is_help=True,
|
|
5633
5919
|
)
|
|
5634
5920
|
app.add_typer(gen_keys, name="keys")
|
|
5921
|
+
gen_nameserver_groups = typer.Typer(
|
|
5922
|
+
cls=PrefixGroup,
|
|
5923
|
+
help="Sets of nameservers a domain can be delegated to: DevNomads' shared ones, or your own.",
|
|
5924
|
+
no_args_is_help=True,
|
|
5925
|
+
)
|
|
5926
|
+
app.add_typer(gen_nameserver_groups, name="nameserver-groups")
|
|
5635
5927
|
gen_products = typer.Typer(
|
|
5636
5928
|
cls=PrefixGroup,
|
|
5637
5929
|
help="Products you can order, with their SKUs and prices.",
|
|
@@ -5702,6 +5994,12 @@ gen_domains_handles = typer.Typer(
|
|
|
5702
5994
|
no_args_is_help=True,
|
|
5703
5995
|
)
|
|
5704
5996
|
gen_domains.add_typer(gen_domains_handles, name="handles")
|
|
5997
|
+
gen_domains_nameservers = typer.Typer(
|
|
5998
|
+
cls=PrefixGroup,
|
|
5999
|
+
help="The nameservers a domain is delegated to.",
|
|
6000
|
+
no_args_is_help=True,
|
|
6001
|
+
)
|
|
6002
|
+
gen_domains.add_typer(gen_domains_nameservers, name="nameservers")
|
|
5705
6003
|
gen_emails_aliases = typer.Typer(
|
|
5706
6004
|
cls=PrefixGroup,
|
|
5707
6005
|
help="Extra addresses that deliver to a mailbox.",
|
|
@@ -5740,6 +6038,12 @@ gen_jobs_batches = typer.Typer(
|
|
|
5740
6038
|
no_args_is_help=True,
|
|
5741
6039
|
)
|
|
5742
6040
|
gen_jobs.add_typer(gen_jobs_batches, name="batches")
|
|
6041
|
+
gen_nameserver_groups_nameservers = typer.Typer(
|
|
6042
|
+
cls=PrefixGroup,
|
|
6043
|
+
help="The nameservers in one of your nameserver groups.",
|
|
6044
|
+
no_args_is_help=True,
|
|
6045
|
+
)
|
|
6046
|
+
gen_nameserver_groups.add_typer(gen_nameserver_groups_nameservers, name="nameservers")
|
|
5743
6047
|
gen_proxies_certificates = typer.Typer(
|
|
5744
6048
|
cls=PrefixGroup,
|
|
5745
6049
|
help="The TLS certificates of a proxy's primary domain and aliases.",
|
|
@@ -5930,7 +6234,7 @@ def gen_handles_create(
|
|
|
5930
6234
|
_generated_call(
|
|
5931
6235
|
ctx,
|
|
5932
6236
|
"POST",
|
|
5933
|
-
"/handles",
|
|
6237
|
+
"/services/domains/handles",
|
|
5934
6238
|
{},
|
|
5935
6239
|
body={
|
|
5936
6240
|
"client_id": client_id,
|
|
@@ -5972,7 +6276,7 @@ def gen_handles_index(
|
|
|
5972
6276
|
_generated_call(
|
|
5973
6277
|
ctx,
|
|
5974
6278
|
"GET",
|
|
5975
|
-
"/handles",
|
|
6279
|
+
"/services/domains/handles",
|
|
5976
6280
|
{},
|
|
5977
6281
|
sort=sort,
|
|
5978
6282
|
timeout=timeout,
|
|
@@ -5996,7 +6300,7 @@ def gen_handles_show(
|
|
|
5996
6300
|
_generated_call(
|
|
5997
6301
|
ctx,
|
|
5998
6302
|
"GET",
|
|
5999
|
-
"/handles/{handleId}",
|
|
6303
|
+
"/services/domains/handles/{handleId}",
|
|
6000
6304
|
{"handleId": handle_id},
|
|
6001
6305
|
timeout=timeout,
|
|
6002
6306
|
output=output,
|
|
@@ -6274,6 +6578,255 @@ def gen_keys_store(
|
|
|
6274
6578
|
)
|
|
6275
6579
|
|
|
6276
6580
|
|
|
6581
|
+
@gen_nameserver_groups.command("list")
|
|
6582
|
+
def gen_nameserverGroups_index(
|
|
6583
|
+
ctx: typer.Context,
|
|
6584
|
+
sort: str | None = _SORT_OPT,
|
|
6585
|
+
timeout: int = _TIMEOUT_OPT,
|
|
6586
|
+
output: OutputFormat | None = _OUTPUT_OPT,
|
|
6587
|
+
columns: str | None = _COLUMNS_OPT,
|
|
6588
|
+
) -> None:
|
|
6589
|
+
"""List the nameserver groups you can use: DevNomads' shared ones and your own."""
|
|
6590
|
+
|
|
6591
|
+
_generated_call(
|
|
6592
|
+
ctx,
|
|
6593
|
+
"GET",
|
|
6594
|
+
"/services/domains/nameserver-groups",
|
|
6595
|
+
{},
|
|
6596
|
+
sort=sort,
|
|
6597
|
+
timeout=timeout,
|
|
6598
|
+
output=output,
|
|
6599
|
+
select=columns,
|
|
6600
|
+
)
|
|
6601
|
+
|
|
6602
|
+
|
|
6603
|
+
@gen_nameserver_groups_nameservers.command("list")
|
|
6604
|
+
def gen_nameserverGroups_nameservers_index(
|
|
6605
|
+
ctx: typer.Context,
|
|
6606
|
+
nameserver_group_id: str = typer.Argument(
|
|
6607
|
+
...,
|
|
6608
|
+
metavar="NAMESERVER_GROUP_ID",
|
|
6609
|
+
help="Nameserver group id, from `dncli nameserver-groups list`. The nameserver group's unique `name` works too.",
|
|
6610
|
+
),
|
|
6611
|
+
sort: str | None = _SORT_OPT,
|
|
6612
|
+
timeout: int = _TIMEOUT_OPT,
|
|
6613
|
+
output: OutputFormat | None = _OUTPUT_OPT,
|
|
6614
|
+
columns: str | None = _COLUMNS_OPT,
|
|
6615
|
+
) -> None:
|
|
6616
|
+
"""List the nameservers in a nameserver group."""
|
|
6617
|
+
|
|
6618
|
+
_generated_call(
|
|
6619
|
+
ctx,
|
|
6620
|
+
"GET",
|
|
6621
|
+
"/services/domains/nameserver-groups/{nameserverGroupId}/nameservers",
|
|
6622
|
+
{"nameserverGroupId": nameserver_group_id},
|
|
6623
|
+
sort=sort,
|
|
6624
|
+
lookups={"nameserverGroupId": "nameserver_group_id"},
|
|
6625
|
+
timeout=timeout,
|
|
6626
|
+
output=output,
|
|
6627
|
+
select=columns,
|
|
6628
|
+
)
|
|
6629
|
+
|
|
6630
|
+
|
|
6631
|
+
@gen_nameserver_groups_nameservers.command("show")
|
|
6632
|
+
def gen_nameserverGroups_nameservers_show(
|
|
6633
|
+
ctx: typer.Context,
|
|
6634
|
+
nameserver_group_id: str = typer.Argument(
|
|
6635
|
+
...,
|
|
6636
|
+
metavar="NAMESERVER_GROUP_ID",
|
|
6637
|
+
help="Nameserver group id, from `dncli nameserver-groups list`. The nameserver group's unique `name` works too.",
|
|
6638
|
+
),
|
|
6639
|
+
nameserver_id: int = typer.Argument(
|
|
6640
|
+
...,
|
|
6641
|
+
metavar="NAMESERVER_ID",
|
|
6642
|
+
help="Nameserver id, from `dncli nameserver-groups nameservers list`.",
|
|
6643
|
+
),
|
|
6644
|
+
timeout: int = _TIMEOUT_OPT,
|
|
6645
|
+
output: OutputFormat | None = _OUTPUT_OPT,
|
|
6646
|
+
columns: str | None = _COLUMNS_OPT,
|
|
6647
|
+
) -> None:
|
|
6648
|
+
"""Show a nameserver in a nameserver group."""
|
|
6649
|
+
|
|
6650
|
+
_generated_call(
|
|
6651
|
+
ctx,
|
|
6652
|
+
"GET",
|
|
6653
|
+
"/services/domains/nameserver-groups/{nameserverGroupId}/nameservers/{nameserverId}",
|
|
6654
|
+
{"nameserverGroupId": nameserver_group_id, "nameserverId": nameserver_id},
|
|
6655
|
+
lookups={"nameserverGroupId": "nameserver_group_id"},
|
|
6656
|
+
timeout=timeout,
|
|
6657
|
+
output=output,
|
|
6658
|
+
select=columns,
|
|
6659
|
+
)
|
|
6660
|
+
|
|
6661
|
+
|
|
6662
|
+
@gen_nameserver_groups_nameservers.command("create")
|
|
6663
|
+
def gen_nameserverGroups_nameservers_store(
|
|
6664
|
+
ctx: typer.Context,
|
|
6665
|
+
nameserver_group_id: str = typer.Argument(
|
|
6666
|
+
...,
|
|
6667
|
+
metavar="NAMESERVER_GROUP_ID",
|
|
6668
|
+
help="Nameserver group id, from `dncli nameserver-groups list`. The nameserver group's unique `name` works too.",
|
|
6669
|
+
),
|
|
6670
|
+
hostname: str = typer.Option(
|
|
6671
|
+
..., help="Hostname of the nameserver, e.g. ns1.example.com."
|
|
6672
|
+
),
|
|
6673
|
+
wait: bool = _WAIT_OPT,
|
|
6674
|
+
dry_run: bool = _DRY_RUN_OPT,
|
|
6675
|
+
timeout: int = _TIMEOUT_OPT,
|
|
6676
|
+
output: OutputFormat | None = _OUTPUT_OPT,
|
|
6677
|
+
columns: str | None = _COLUMNS_OPT,
|
|
6678
|
+
) -> None:
|
|
6679
|
+
"""Add a nameserver to one of your nameserver groups.
|
|
6680
|
+
|
|
6681
|
+
The hostname must already resolve to both an IPv4 and an IPv6 address; the API stores those addresses (glue) with it. There is no command to remove a nameserver.
|
|
6682
|
+
"""
|
|
6683
|
+
|
|
6684
|
+
_generated_call(
|
|
6685
|
+
ctx,
|
|
6686
|
+
"POST",
|
|
6687
|
+
"/services/domains/nameserver-groups/{nameserverGroupId}/nameservers",
|
|
6688
|
+
{"nameserverGroupId": nameserver_group_id},
|
|
6689
|
+
body={"hostname": hostname},
|
|
6690
|
+
lookups={"nameserverGroupId": "nameserver_group_id"},
|
|
6691
|
+
dry_run=dry_run,
|
|
6692
|
+
wait=wait,
|
|
6693
|
+
timeout=timeout,
|
|
6694
|
+
output=output,
|
|
6695
|
+
select=columns,
|
|
6696
|
+
)
|
|
6697
|
+
|
|
6698
|
+
|
|
6699
|
+
@gen_nameserver_groups_nameservers.command("update")
|
|
6700
|
+
def gen_nameserverGroups_nameservers_update(
|
|
6701
|
+
ctx: typer.Context,
|
|
6702
|
+
nameserver_group_id: str = typer.Argument(
|
|
6703
|
+
...,
|
|
6704
|
+
metavar="NAMESERVER_GROUP_ID",
|
|
6705
|
+
help="Nameserver group id, from `dncli nameserver-groups list`. The nameserver group's unique `name` works too.",
|
|
6706
|
+
),
|
|
6707
|
+
nameserver_id: int = typer.Argument(
|
|
6708
|
+
...,
|
|
6709
|
+
metavar="NAMESERVER_ID",
|
|
6710
|
+
help="Nameserver id, from `dncli nameserver-groups nameservers list`.",
|
|
6711
|
+
),
|
|
6712
|
+
hostname: str = typer.Option(..., help="New hostname of the nameserver."),
|
|
6713
|
+
wait: bool = _WAIT_OPT,
|
|
6714
|
+
dry_run: bool = _DRY_RUN_OPT,
|
|
6715
|
+
timeout: int = _TIMEOUT_OPT,
|
|
6716
|
+
output: OutputFormat | None = _OUTPUT_OPT,
|
|
6717
|
+
columns: str | None = _COLUMNS_OPT,
|
|
6718
|
+
) -> None:
|
|
6719
|
+
"""Change the hostname of a nameserver in one of your groups.
|
|
6720
|
+
|
|
6721
|
+
The new hostname must resolve to both an IPv4 and an IPv6 address."""
|
|
6722
|
+
|
|
6723
|
+
_generated_call(
|
|
6724
|
+
ctx,
|
|
6725
|
+
"PUT",
|
|
6726
|
+
"/services/domains/nameserver-groups/{nameserverGroupId}/nameservers/{nameserverId}",
|
|
6727
|
+
{"nameserverGroupId": nameserver_group_id, "nameserverId": nameserver_id},
|
|
6728
|
+
body={"hostname": hostname},
|
|
6729
|
+
lookups={"nameserverGroupId": "nameserver_group_id"},
|
|
6730
|
+
dry_run=dry_run,
|
|
6731
|
+
wait=wait,
|
|
6732
|
+
timeout=timeout,
|
|
6733
|
+
output=output,
|
|
6734
|
+
select=columns,
|
|
6735
|
+
)
|
|
6736
|
+
|
|
6737
|
+
|
|
6738
|
+
@gen_nameserver_groups.command("show")
|
|
6739
|
+
def gen_nameserverGroups_show(
|
|
6740
|
+
ctx: typer.Context,
|
|
6741
|
+
nameserver_group_id: str = typer.Argument(
|
|
6742
|
+
...,
|
|
6743
|
+
metavar="NAMESERVER_GROUP_ID",
|
|
6744
|
+
help="Nameserver group id, from `dncli nameserver-groups list`. The nameserver group's unique `name` works too.",
|
|
6745
|
+
),
|
|
6746
|
+
timeout: int = _TIMEOUT_OPT,
|
|
6747
|
+
output: OutputFormat | None = _OUTPUT_OPT,
|
|
6748
|
+
columns: str | None = _COLUMNS_OPT,
|
|
6749
|
+
) -> None:
|
|
6750
|
+
"""Show a nameserver group and its nameservers."""
|
|
6751
|
+
|
|
6752
|
+
_generated_call(
|
|
6753
|
+
ctx,
|
|
6754
|
+
"GET",
|
|
6755
|
+
"/services/domains/nameserver-groups/{nameserverGroupId}",
|
|
6756
|
+
{"nameserverGroupId": nameserver_group_id},
|
|
6757
|
+
lookups={"nameserverGroupId": "nameserver_group_id"},
|
|
6758
|
+
timeout=timeout,
|
|
6759
|
+
output=output,
|
|
6760
|
+
select=columns,
|
|
6761
|
+
)
|
|
6762
|
+
|
|
6763
|
+
|
|
6764
|
+
@gen_nameserver_groups.command("create")
|
|
6765
|
+
def gen_nameserverGroups_store(
|
|
6766
|
+
ctx: typer.Context,
|
|
6767
|
+
client_id: str = typer.Option(
|
|
6768
|
+
...,
|
|
6769
|
+
help="Client the group belongs to, from `dncli clients list`. The client's unique `name` works too.",
|
|
6770
|
+
),
|
|
6771
|
+
name: str = typer.Option(..., help="Name of the group (up to 191 characters)."),
|
|
6772
|
+
wait: bool = _WAIT_OPT,
|
|
6773
|
+
dry_run: bool = _DRY_RUN_OPT,
|
|
6774
|
+
timeout: int = _TIMEOUT_OPT,
|
|
6775
|
+
output: OutputFormat | None = _OUTPUT_OPT,
|
|
6776
|
+
columns: str | None = _COLUMNS_OPT,
|
|
6777
|
+
) -> None:
|
|
6778
|
+
"""Create your own nameserver group.
|
|
6779
|
+
|
|
6780
|
+
Add its nameservers with `dncli nameserver-groups nameservers create`, then point domains at it with --nameserver-group-id. There is no command to delete a group.
|
|
6781
|
+
"""
|
|
6782
|
+
|
|
6783
|
+
_generated_call(
|
|
6784
|
+
ctx,
|
|
6785
|
+
"POST",
|
|
6786
|
+
"/services/domains/nameserver-groups",
|
|
6787
|
+
{},
|
|
6788
|
+
body={"client_id": client_id, "name": name},
|
|
6789
|
+
lookups={"client_id": "client_id"},
|
|
6790
|
+
dry_run=dry_run,
|
|
6791
|
+
wait=wait,
|
|
6792
|
+
timeout=timeout,
|
|
6793
|
+
output=output,
|
|
6794
|
+
select=columns,
|
|
6795
|
+
)
|
|
6796
|
+
|
|
6797
|
+
|
|
6798
|
+
@gen_nameserver_groups.command("update")
|
|
6799
|
+
def gen_nameserverGroups_update(
|
|
6800
|
+
ctx: typer.Context,
|
|
6801
|
+
nameserver_group_id: str = typer.Argument(
|
|
6802
|
+
...,
|
|
6803
|
+
metavar="NAMESERVER_GROUP_ID",
|
|
6804
|
+
help="Nameserver group id, from `dncli nameserver-groups list`. The nameserver group's unique `name` works too.",
|
|
6805
|
+
),
|
|
6806
|
+
name: str = typer.Option(..., help="New name (up to 191 characters)."),
|
|
6807
|
+
dry_run: bool = _DRY_RUN_OPT,
|
|
6808
|
+
timeout: int = _TIMEOUT_OPT,
|
|
6809
|
+
output: OutputFormat | None = _OUTPUT_OPT,
|
|
6810
|
+
columns: str | None = _COLUMNS_OPT,
|
|
6811
|
+
) -> None:
|
|
6812
|
+
"""Rename one of your nameserver groups.
|
|
6813
|
+
|
|
6814
|
+
The shared DevNomads groups cannot be changed."""
|
|
6815
|
+
|
|
6816
|
+
_generated_call(
|
|
6817
|
+
ctx,
|
|
6818
|
+
"PUT",
|
|
6819
|
+
"/services/domains/nameserver-groups/{nameserverGroupId}",
|
|
6820
|
+
{"nameserverGroupId": nameserver_group_id},
|
|
6821
|
+
body={"name": name},
|
|
6822
|
+
lookups={"nameserverGroupId": "nameserver_group_id"},
|
|
6823
|
+
dry_run=dry_run,
|
|
6824
|
+
timeout=timeout,
|
|
6825
|
+
output=output,
|
|
6826
|
+
select=columns,
|
|
6827
|
+
)
|
|
6828
|
+
|
|
6829
|
+
|
|
6277
6830
|
@gen_products.command("list")
|
|
6278
6831
|
def gen_products_index(
|
|
6279
6832
|
ctx: typer.Context,
|
|
@@ -7991,8 +8544,9 @@ def gen_services_domains_create(
|
|
|
7991
8544
|
None,
|
|
7992
8545
|
help="Transfer (EPP) code from the current registrar; required with --type transfer.",
|
|
7993
8546
|
),
|
|
7994
|
-
|
|
7995
|
-
...,
|
|
8547
|
+
nameserver_group_id: str = typer.Option(
|
|
8548
|
+
...,
|
|
8549
|
+
help="Nameserver group to delegate the domain to, from `dncli nameserver-groups list`; DevNomads' shared group means DevNomads manages the DNS. The nameserver group's unique `name` works too.",
|
|
7996
8550
|
),
|
|
7997
8551
|
handle_id_owner: int = typer.Option(
|
|
7998
8552
|
..., help="Owner (registrant) handle, the `id` from `dncli handles list`."
|
|
@@ -8024,12 +8578,15 @@ def gen_services_domains_create(
|
|
|
8024
8578
|
"domain": domain,
|
|
8025
8579
|
"type": type,
|
|
8026
8580
|
"token": token,
|
|
8027
|
-
"
|
|
8581
|
+
"nameserver_group_id": nameserver_group_id,
|
|
8028
8582
|
"handle_id_owner": handle_id_owner,
|
|
8029
8583
|
"handle_id_administrative": handle_id_administrative,
|
|
8030
8584
|
"handle_id_technical": handle_id_technical,
|
|
8031
8585
|
},
|
|
8032
|
-
lookups={
|
|
8586
|
+
lookups={
|
|
8587
|
+
"client_id": "client_id",
|
|
8588
|
+
"nameserver_group_id": "nameserver_group_id",
|
|
8589
|
+
},
|
|
8033
8590
|
dry_run=dry_run,
|
|
8034
8591
|
wait=wait,
|
|
8035
8592
|
timeout=timeout,
|
|
@@ -8192,6 +8749,34 @@ def gen_services_domains_index(
|
|
|
8192
8749
|
)
|
|
8193
8750
|
|
|
8194
8751
|
|
|
8752
|
+
@gen_domains_nameservers.command("list")
|
|
8753
|
+
def gen_services_domains_nameservers_index(
|
|
8754
|
+
ctx: typer.Context,
|
|
8755
|
+
service_id: str = typer.Argument(
|
|
8756
|
+
...,
|
|
8757
|
+
metavar="SERVICE_ID",
|
|
8758
|
+
help="Service id, or the service's unique entity name (usually its domain or name).",
|
|
8759
|
+
),
|
|
8760
|
+
sort: str | None = _SORT_OPT,
|
|
8761
|
+
timeout: int = _TIMEOUT_OPT,
|
|
8762
|
+
output: OutputFormat | None = _OUTPUT_OPT,
|
|
8763
|
+
columns: str | None = _COLUMNS_OPT,
|
|
8764
|
+
) -> None:
|
|
8765
|
+
"""List the nameservers of a domain's nameserver group."""
|
|
8766
|
+
|
|
8767
|
+
_generated_call(
|
|
8768
|
+
ctx,
|
|
8769
|
+
"GET",
|
|
8770
|
+
"/services/domains/{serviceId}/nameservers",
|
|
8771
|
+
{"serviceId": service_id},
|
|
8772
|
+
sort=sort,
|
|
8773
|
+
resolve="/services/domains",
|
|
8774
|
+
timeout=timeout,
|
|
8775
|
+
output=output,
|
|
8776
|
+
select=columns,
|
|
8777
|
+
)
|
|
8778
|
+
|
|
8779
|
+
|
|
8195
8780
|
@gen_domains.command("show")
|
|
8196
8781
|
def gen_services_domains_show(
|
|
8197
8782
|
ctx: typer.Context,
|
|
@@ -8218,6 +8803,44 @@ def gen_services_domains_show(
|
|
|
8218
8803
|
)
|
|
8219
8804
|
|
|
8220
8805
|
|
|
8806
|
+
@gen_domains.command("update")
|
|
8807
|
+
def gen_services_domains_update(
|
|
8808
|
+
ctx: typer.Context,
|
|
8809
|
+
service_id: str = typer.Argument(
|
|
8810
|
+
...,
|
|
8811
|
+
metavar="SERVICE_ID",
|
|
8812
|
+
help="Service id, or the service's unique entity name (usually its domain or name).",
|
|
8813
|
+
),
|
|
8814
|
+
nameserver_group_id: str = typer.Option(
|
|
8815
|
+
...,
|
|
8816
|
+
help="Nameserver group, from `dncli nameserver-groups list`. The nameserver group's unique `name` works too.",
|
|
8817
|
+
),
|
|
8818
|
+
wait: bool = _WAIT_OPT,
|
|
8819
|
+
dry_run: bool = _DRY_RUN_OPT,
|
|
8820
|
+
timeout: int = _TIMEOUT_OPT,
|
|
8821
|
+
output: OutputFormat | None = _OUTPUT_OPT,
|
|
8822
|
+
columns: str | None = _COLUMNS_OPT,
|
|
8823
|
+
) -> None:
|
|
8824
|
+
"""Move a domain to another nameserver group.
|
|
8825
|
+
|
|
8826
|
+
The registry gets the group's nameservers in the background."""
|
|
8827
|
+
|
|
8828
|
+
_generated_call(
|
|
8829
|
+
ctx,
|
|
8830
|
+
"PUT",
|
|
8831
|
+
"/services/domains/{serviceId}",
|
|
8832
|
+
{"serviceId": service_id},
|
|
8833
|
+
body={"nameserver_group_id": nameserver_group_id},
|
|
8834
|
+
resolve="/services/domains",
|
|
8835
|
+
lookups={"nameserver_group_id": "nameserver_group_id"},
|
|
8836
|
+
dry_run=dry_run,
|
|
8837
|
+
wait=wait,
|
|
8838
|
+
timeout=timeout,
|
|
8839
|
+
output=output,
|
|
8840
|
+
select=columns,
|
|
8841
|
+
)
|
|
8842
|
+
|
|
8843
|
+
|
|
8221
8844
|
@gen_emails_aliases.command("create")
|
|
8222
8845
|
def gen_services_emails_aliases_create(
|
|
8223
8846
|
ctx: typer.Context,
|
|
@@ -11099,6 +11722,8 @@ def gen_services_sites_store(
|
|
|
11099
11722
|
"symfony",
|
|
11100
11723
|
"mediawiki",
|
|
11101
11724
|
"mediawiki_public",
|
|
11725
|
+
"joomla",
|
|
11726
|
+
"mmx_pagebuilder",
|
|
11102
11727
|
] = typer.Option(..., help="Web server preset for an application."),
|
|
11103
11728
|
mail_from: str | None = typer.Option(
|
|
11104
11729
|
None,
|
|
@@ -11147,6 +11772,8 @@ def gen_services_sites_store(
|
|
|
11147
11772
|
) -> None:
|
|
11148
11773
|
"""Create a site.
|
|
11149
11774
|
|
|
11775
|
+
A site holds the files and runs PHP. It usually needs two more services, each created and billed on its own: a proxy, so visitors reach the site on its domain, and for most applications a database. Once the site exists: `dncli proxies create --backends-service-type site --primary-domain <the site's domain> --backend <host>`, with one --backend for each host in `site.hosts` of `dncli sites show` and an --alias for each of the site's aliases. Then `dncli databases create`, `dncli databases users create` and `dncli databases permissions create`. Not every proxy cluster can reach every web server, and the cluster lists do not say which can: existing proxies with the same host as backend (`dncli proxies list`) show a cluster that does. When in doubt, ask DevNomads; the same holds for the database cluster.
|
|
11776
|
+
|
|
11150
11777
|
Billing starts right away."""
|
|
11151
11778
|
|
|
11152
11779
|
_generated_call(
|
|
@@ -11182,6 +11809,7 @@ def gen_services_sites_store(
|
|
|
11182
11809
|
required=["password"],
|
|
11183
11810
|
dry_run=dry_run,
|
|
11184
11811
|
wait=wait,
|
|
11812
|
+
next_steps="Next, unless they exist already: a proxy so visitors reach the site (dncli proxies create --backends-service-type site with the site's domain as --primary-domain, its aliases as --alias and each host in site.hosts of `dncli sites show` as --backend), and for most applications a database (dncli databases create, then databases users create and databases permissions create). Both are separate services. Not every proxy cluster can reach every web server: existing proxies with the same host as backend show one that does.",
|
|
11185
11813
|
timeout=timeout,
|
|
11186
11814
|
output=output,
|
|
11187
11815
|
select=columns,
|
|
@@ -11233,6 +11861,8 @@ def gen_services_sites_update(
|
|
|
11233
11861
|
"symfony",
|
|
11234
11862
|
"mediawiki",
|
|
11235
11863
|
"mediawiki_public",
|
|
11864
|
+
"joomla",
|
|
11865
|
+
"mmx_pagebuilder",
|
|
11236
11866
|
]
|
|
11237
11867
|
| None
|
|
11238
11868
|
) = typer.Option(None, help="Web server preset for an application."),
|
|
@@ -13337,6 +13967,37 @@ def notify_update() -> None:
|
|
|
13337
13967
|
_change_update_state(lambda state: state.update(notified_at=time.time()))
|
|
13338
13968
|
|
|
13339
13969
|
|
|
13970
|
+
def notify_skill(args: list[str]) -> None:
|
|
13971
|
+
"""Print one line on stderr when an installed copy of the skill comes from
|
|
13972
|
+
an older dncli, at most once a day. Not after `dncli skill ...` itself."""
|
|
13973
|
+
|
|
13974
|
+
if not _update_check_enabled() or "skill" in args[:3]:
|
|
13975
|
+
return
|
|
13976
|
+
notified = _read_update_state().get("skill_notified_at", 0)
|
|
13977
|
+
if isinstance(notified, (int, float)) and (
|
|
13978
|
+
time.time() - notified < UPDATE_CHECK_INTERVAL
|
|
13979
|
+
):
|
|
13980
|
+
return
|
|
13981
|
+
old = [found for found in installed_skills() if not found.current and found.older]
|
|
13982
|
+
if not old:
|
|
13983
|
+
return
|
|
13984
|
+
commands = sorted(
|
|
13985
|
+
{
|
|
13986
|
+
"dncli skill install" + (" --project" if found.project else "")
|
|
13987
|
+
for found in old
|
|
13988
|
+
}
|
|
13989
|
+
)
|
|
13990
|
+
where = str(old[0].path.parent).replace(str(Path.home()), "~", 1)
|
|
13991
|
+
if len(old) > 1:
|
|
13992
|
+
where += f" and {len(old) - 1} more"
|
|
13993
|
+
err_console.print(
|
|
13994
|
+
f"[yellow]the devnomads skill in {escape(where)} is from an older dncli[/]: "
|
|
13995
|
+
f"update it with {' and '.join(commands)}",
|
|
13996
|
+
soft_wrap=True,
|
|
13997
|
+
)
|
|
13998
|
+
_change_update_state(lambda state: state.update(skill_notified_at=time.time()))
|
|
13999
|
+
|
|
14000
|
+
|
|
13340
14001
|
# Hidden spelling of --yes, for when you really, really mean it. Click cannot
|
|
13341
14002
|
# hide one name of an option, so the entry point rewrites it before parsing.
|
|
13342
14003
|
OPTION_ALIASES = {"--yes-i-really-really-mean-it": "--yes"}
|
|
@@ -13360,6 +14021,7 @@ def run() -> None:
|
|
|
13360
14021
|
app()
|
|
13361
14022
|
finally:
|
|
13362
14023
|
notify_update()
|
|
14024
|
+
notify_skill(sys.argv[1:])
|
|
13363
14025
|
|
|
13364
14026
|
|
|
13365
14027
|
if __name__ == "__main__":
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
dncli.py,sha256=pTAmIydiC7hbr1UbVLJJH4EYK4AwLtljRj4nn_4X9yU,431062
|
|
2
|
-
devnomads_cli-0.16.0.dist-info/licenses/LICENSE,sha256=WPXQ_lmpr3tVzTD9Z6VTiBgFnFey-cEwEYoG4HlmbxY,1066
|
|
3
|
-
devnomads_cli-0.16.0.dist-info/METADATA,sha256=mMpe96WCF-PEV4A2GBRgS9tKwHA-VV_XnWu-uz5SitU,17472
|
|
4
|
-
devnomads_cli-0.16.0.dist-info/WHEEL,sha256=mOdXR9C3wMVov7cSY8PY-XCzo3SmmWCHvGQr5csJoao,91
|
|
5
|
-
devnomads_cli-0.16.0.dist-info/entry_points.txt,sha256=irLaKiGtIzEKi87exmXAg0srUmoDK31fL0SlqJasAEU,69
|
|
6
|
-
devnomads_cli-0.16.0.dist-info/top_level.txt,sha256=rFWIJDQgL3jA2q6b2GAqZgCknDED4WLxNcHTktuWS1I,6
|
|
7
|
-
devnomads_cli-0.16.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|