Skip to content

Commit 0f0371a

Browse files
authored
Merge pull request #48 from hetznercloud/implement-networks
Implement networks
2 parents 51d5b0e + 8cefbd3 commit 0f0371a

23 files changed

Lines changed: 1845 additions & 24 deletions

File tree

.gitlab-ci.yml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,6 @@ python27:
2020
image: python:2.7
2121
script: tox -e py27
2222

23-
python34:
24-
<<: *tests_template
25-
image: python:3.4
26-
script: tox -e py34
27-
2823
python35:
2924
<<: *tests_template
3025
image: python:3.5

docs/api.clients.networks.rst

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
NetworksClient
2+
==================
3+
4+
5+
.. autoclass:: hcloud.networks.client.NetworksClient
6+
:members:
7+
8+
.. autoclass:: hcloud.networks.client.BoundNetwork
9+
:members:
10+
11+
.. autoclass:: hcloud.networks.domain.Network
12+
:members:
13+
14+
.. autoclass:: hcloud.networks.domain.NetworkSubnet
15+
:members:
16+
17+
.. autoclass:: hcloud.networks.domain.NetworkRoutes
18+
:members:
19+
20+
.. autoclass:: hcloud.networks.domain.CreateNetworkResponse
21+
:members:

hcloud/hcloud.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
from hcloud.actions.client import ActionsClient
88
from hcloud.floating_ips.client import FloatingIPsClient
9+
from hcloud.networks.client import NetworksClient
910
from hcloud.isos.client import IsosClient
1011
from hcloud.servers.client import ServersClient
1112
from hcloud.server_types.client import ServerTypesClient
@@ -106,6 +107,11 @@ def __init__(self, token, api_endpoint="https://api.hetzner.cloud/v1", applicati
106107
107108
:type: :class:`FloatingIPsClient <hcloud.floating_ips.client.FloatingIPsClient>`
108109
"""
110+
self.networks = NetworksClient(self)
111+
"""NetworksClient Instance
112+
113+
:type: :class:`NetworksClient <hcloud.networks.client.NetworksClient>`
114+
"""
109115

110116
def _get_user_agent(self):
111117
"""Get the user agent of the hcloud-python instance with the user application name (if specified)

hcloud/locations/domain.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ class Location(BaseDomain, DomainIdentityMixin):
1919
Latitude of the city closest to the location
2020
:param longitude: float
2121
Longitude of the city closest to the location
22+
:param network_zone: str
23+
Name of network zone this location resides in
2224
"""
2325

2426
__slots__ = (
@@ -28,7 +30,8 @@ class Location(BaseDomain, DomainIdentityMixin):
2830
"country",
2931
"city",
3032
"latitude",
31-
"longitude"
33+
"longitude",
34+
"network_zone"
3235
)
3336

3437
def __init__(
@@ -39,7 +42,8 @@ def __init__(
3942
country=None,
4043
city=None,
4144
latitude=None,
42-
longitude=None
45+
longitude=None,
46+
network_zone=None,
4347
):
4448
self.id = id
4549
self.name = name
@@ -48,3 +52,4 @@ def __init__(
4852
self.city = city
4953
self.latitude = latitude
5054
self.longitude = longitude
55+
self.network_zone = network_zone

hcloud/networks/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# -*- coding: utf-8 -*-

0 commit comments

Comments
 (0)