Skip to content

Latest commit

 

History

History
78 lines (60 loc) · 3.19 KB

File metadata and controls

78 lines (60 loc) · 3.19 KB

Upgrading

This project adheres to Semantic Versioning.

Before upgrading, make sure to resolve any deprecation warnings.

Upgrading to v2

  • #397: The package version was moved from hcloud.__version__.VERSION to hcloud.__version__, make sure to update your import paths:
-from hcloud.__version__ import VERSION
+from hcloud import __version__ as VERSION
  • #401: The deprecated hcloud.hcloud module was removed, make sure to update your import paths:
-from hcloud.hcloud import Client
+from hcloud import Client
-client = Client(token=token)
-client.poll_interval = 2
+client = Client(
+   token=token,
+   poll_interval=2,
+)
  • #400: The Client.request method now returns an empty dict instead of an empty string when the API response is empty:
 response = client.request(method="DELETE", url="/primary_ips/123456")
-assert response == ""
+assert response == {}
 client.isos.get_all(
-   include_wildcard_architecture=True,
+   include_architecture_wildcard=True,
 )
 client.primary_ips.create(
    "ipv4",
-   None,
    "my-ip",
    assignee_id=12345,
 )
 client.primary_ips.create(
    "ipv4",
-   Datacenter(name="fsn1-dc14"),
    "my-ip",
+   datacenter=Datacenter(name="fsn1-dc14"),
 )
  • #406: In the Client.servers.rebuild method, the single action return value was deprecated and is now removed. The method now returns a full response wrapping the action and an optional root password:
-action = client.servers.rebuild(server, image)
+resp = client.servers.rebuild(server, image)
+action = resp.action
+root_password = resp.root_password