Skip to content

Commit fe49a67

Browse files
authored
feat: support the new DNS API (#568)
Add support for the new [DNS API](https://docs.hetzner.cloud/reference/cloud#dns). The DNS API is currently in **beta**. See the [DNS API beta changelog](https://docs.hetzner.cloud/changelog#2025-10-07-dns-beta) for more details.
1 parent 4b3ac8c commit fe49a67

File tree

10 files changed

+3025
-2
lines changed

10 files changed

+3025
-2
lines changed

docs/api.clients.zones.rst

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
ZonesClient
2+
==================
3+
4+
5+
.. autoclass:: hcloud.zones.client.ZonesClient
6+
:members:
7+
8+
.. autoclass:: hcloud.zones.client.BoundZone
9+
:members:
10+
11+
.. autoclass:: hcloud.zones.client.BoundZoneRRSet
12+
:members:
13+
14+
.. autoclass:: hcloud.zones.domain.Zone
15+
:members:
16+
17+
.. autoclass:: hcloud.zones.domain.ZoneAuthoritativeNameservers
18+
:members:
19+
20+
.. autoclass:: hcloud.zones.domain.ZonePrimaryNameserver
21+
:members:
22+
23+
.. autoclass:: hcloud.zones.domain.ZoneRecord
24+
:members:
25+
26+
.. autoclass:: hcloud.zones.domain.ZoneRRSet
27+
:members:
28+
29+
.. autoclass:: hcloud.zones.domain.CreateZoneResponse
30+
:members:

hcloud/_client.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
from .servers import ServersClient
2727
from .ssh_keys import SSHKeysClient
2828
from .volumes import VolumesClient
29+
from .zones import ZonesClient
2930

3031

3132
class BackoffFunction(Protocol):
@@ -254,6 +255,12 @@ def __init__(
254255
:type: :class:`PlacementGroupsClient <hcloud.placement_groups.client.PlacementGroupsClient>`
255256
"""
256257

258+
self.zones = ZonesClient(self)
259+
"""ZonesClient Instance
260+
261+
:type: :class:`ZonesClient <hcloud.zones.client.ZonesClient>`
262+
"""
263+
257264
def request( # type: ignore[no-untyped-def]
258265
self,
259266
method: str,

hcloud/zones/__init__.py

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
from __future__ import annotations
2+
3+
from .client import (
4+
BoundZone,
5+
BoundZoneRRSet,
6+
ZonesClient,
7+
ZonesPageResult,
8+
)
9+
from .domain import (
10+
CreateZoneResponse,
11+
Zone,
12+
ZoneAuthoritativeNameservers,
13+
ZonePrimaryNameserver,
14+
ZoneRecord,
15+
ZoneRRSet,
16+
)
17+
18+
__all__ = [
19+
"BoundZone",
20+
"BoundZoneRRSet",
21+
"CreateZoneResponse",
22+
"Zone",
23+
"ZoneAuthoritativeNameservers",
24+
"ZonePrimaryNameserver",
25+
"ZoneRecord",
26+
"ZoneRRSet",
27+
"ZonesClient",
28+
"ZonesPageResult",
29+
]

0 commit comments

Comments
 (0)