From 75b234dd06a46d9856fd2659addcb7e978cef9cc Mon Sep 17 00:00:00 2001 From: Franz Schwartau Date: Wed, 27 Jun 2018 12:13:59 +0200 Subject: [PATCH 1/7] Servers can be created via API not datacenters, unfortunately. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index b267b8f..8337d0b 100644 --- a/README.md +++ b/README.md @@ -101,7 +101,7 @@ promptly reviewed and evaluated on its suitability to be merged into the main br ### v1.1.0 -* Allows new datacenters to be created in any datacenter in a selected location. See [pull request 16](). +* Allows new servers to be created in any datacenter in a selected location. See [pull request 16](). ### v1.0.4 From 5838bbeec65f589f47149fe6da03fd321b811ba9 Mon Sep 17 00:00:00 2001 From: Jochen Breuer Date: Fri, 13 Jul 2018 17:16:21 +0200 Subject: [PATCH 2/7] "My required server name" is not a valid hostname Since `name` is used as the hostname, you can't have a name with blanks. Replaced them with dashes. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 8337d0b..e800dff 100644 --- a/README.md +++ b/README.md @@ -568,7 +568,7 @@ To create a server, you can call the `create` top level action method. This meth are optional, some aren't). ```python -server_a, create_action = client.servers().create(name="My required server name", # REQUIRED +server_a, create_action = client.servers().create(name="my-required-server-name", # REQUIRED server_type=SERVER_TYPE_1CPU_2GB, # REQUIRED image=IMAGE_UBUNTU_1604, # REQUIRED datacenter=DATACENTER_FALKENSTEIN_1, From 91d7b44af3c7f915a759ed378872875207a24701 Mon Sep 17 00:00:00 2001 From: Joshua Grimm Date: Fri, 3 Aug 2018 16:17:10 +0200 Subject: [PATCH 3/7] corrected status code of ssh_key delete --- hetznercloud/ssh_keys.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hetznercloud/ssh_keys.py b/hetznercloud/ssh_keys.py index 9c6a575..c3148ff 100644 --- a/hetznercloud/ssh_keys.py +++ b/hetznercloud/ssh_keys.py @@ -46,7 +46,7 @@ def __init__(self, config): def delete(self): status_code, result = _get_results(self._config, "ssh_keys/%s" % self.id, method="DELETE") - if status_code != 201: + if status_code != 204: raise HetznerActionException(result) def update(self, name): @@ -69,4 +69,4 @@ def _load_from_json(config, json): ssh_key.fingerprint = json["fingerprint"] ssh_key.public_key = json["public_key"] - return ssh_key \ No newline at end of file + return ssh_key From df7d5559773139179f5d4c2f67d973d2db5db42d Mon Sep 17 00:00:00 2001 From: Franz Schwartau Date: Sat, 18 Aug 2018 09:09:21 +0200 Subject: [PATCH 4/7] Add new image constants to documentation. Should have been part of commit 4cbd00080388f4c3a315f04d0844dd4fb49a856e --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index e800dff..619e1a9 100644 --- a/README.md +++ b/README.md @@ -207,9 +207,11 @@ Constants that represent the server types available to users. Constants that represent the standard images available to users. * `IMAGE_UBUNTU_1604` - Ubuntu 16.04 LTS +* `IMAGE_UBUNTU_1804` - Ubuntu 18.04 LTS * `IMAGE_DEBIAN_9` - Debian 9.3 -* `IMAGE_CENTOS_7` - CentOS 7.4 +* `IMAGE_CENTOS_7` - CentOS 7.5 * `IMAGE_FEDORA_27` - Fedora 27 +* `IMAGE_FEDORA_28` - Fedora 28 ##### Datacentre constants From 1b516dd71670dd5cbd9c119ab18de7d4bad99367 Mon Sep 17 00:00:00 2001 From: Franz Schwartau Date: Sat, 18 Aug 2018 09:20:42 +0200 Subject: [PATCH 5/7] New server types with dedicated VCPUs (ccx11 to ccx51). --- README.md | 7 +++++++ hetznercloud/constants.py | 6 ++++++ 2 files changed, 13 insertions(+) diff --git a/README.md b/README.md index e800dff..f4d11a8 100644 --- a/README.md +++ b/README.md @@ -202,6 +202,13 @@ Constants that represent the server types available to users. * `SERVER_TYPE_8CPU_32GB` - The largest type with 8 CPU cores, 32GB of RAM and a 240GB SSD disk. * `SERVER_TYPE_8CPU_32GB_CEPH` - The same as above but with a 240GB CEPH network-attached disk. + +* `SERVER_TYPE_2CPU_8GB_DVCPU` - 2 dedicated CPU cores, 8GB of RAM and 80GB SSD disk. +* `SERVER_TYPE_4CPU_16GB_DVCPU` - 4 dedicated CPU cores, 16GB of RAM and 160GB SSD disk. +* `SERVER_TYPE_8CPU_32GB_DVCPU` - 8 dedicated CPU cores, 32GB of RAM and 240GB SSD disk. +* `SERVER_TYPE_16CPU_64GB_DVCPU` - 16 dedicated CPU cores, 64GB of RAM and 360GB SSD disk. +* `SERVER_TYPE_32CPU_128GB_DVCPU` - 32 dedicated CPU cores, 128GB of RAM and 540GB SSD disk. + ##### Image types Constants that represent the standard images available to users. diff --git a/hetznercloud/constants.py b/hetznercloud/constants.py index a17a71d..07bba67 100644 --- a/hetznercloud/constants.py +++ b/hetznercloud/constants.py @@ -27,6 +27,12 @@ SERVER_TYPE_8CPU_32GB = "cx51" SERVER_TYPE_8CPU_32GB_CEPH = "cx51-ceph" +SERVER_TYPE_2CPU_8GB_DVCPU = "ccx11" +SERVER_TYPE_4CPU_16GB_DVCPU = "ccx21" +SERVER_TYPE_8CPU_32GB_DVCPU = "ccx31" +SERVER_TYPE_16CPU_64GB_DVCPU = "ccx41" +SERVER_TYPE_32CPU_128GB_DVCPU = "ccx51" + IMAGE_UBUNTU_1604 = "ubuntu-16.04" IMAGE_UBUNTU_1804 = "ubuntu-18.04" IMAGE_DEBIAN_9 = "debian-9" From c340a1a5be3c4b9ffe58064fd34361f4735bc4bc Mon Sep 17 00:00:00 2001 From: Sven Speckmaier Date: Tue, 21 Aug 2018 15:53:39 +0200 Subject: [PATCH 6/7] parse `ip` field from floating ip api data --- hetznercloud/floating_ips.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hetznercloud/floating_ips.py b/hetznercloud/floating_ips.py index 9824b99..b6e86c9 100644 --- a/hetznercloud/floating_ips.py +++ b/hetznercloud/floating_ips.py @@ -45,6 +45,7 @@ class HetznerCloudFloatingIp(object): def __init__(self, config): self._config = config self.id = 0 + self.ip = "" self.description = "" self.type = "" self.server = 0 @@ -108,6 +109,7 @@ def _load_from_json(config, json): float_ip.id = int(json["id"]) float_ip.description = json["description"] + float_ip.ip = json["ip"] float_ip.type = json["type"] float_ip.server = int(json["server"]) if json["server"] is not None else 0 float_ip.ptr_ips = [entry["ip"] for entry in json["dns_ptr"]] From 5ce11c52a396e074038df38d0011efacb254e855 Mon Sep 17 00:00:00 2001 From: Joshua Grimm Date: Thu, 30 Aug 2018 15:34:44 +0200 Subject: [PATCH 7/7] Readme: corrected cloud-init example --- README.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index e800dff..cf7206f 100644 --- a/README.md +++ b/README.md @@ -574,9 +574,14 @@ server_a, create_action = client.servers().create(name="my-required-server-name" datacenter=DATACENTER_FALKENSTEIN_1, start_after_create=True, ssh_keys=["my-ssh-key-1", "my-ssh-key-2"], - user_data="rm -rf a-file") + user_data='''#cloud-config + packages: + - screen + - git + ''') server_a.wait_until_status_is(SERVER_STATUS_RUNNING) ``` +For more details on user_data please see https://cloudinit.readthedocs.io/en/latest/topics/examples.html #### Server modifier actions