API References

Main Interface

class Client(token: str, api_endpoint: str = 'https://api.hetzner.cloud/v1', application_name: str | None = None, application_version: str | None = None, poll_interval: int = 1, timeout: float | tuple[float, float] | None = None)[source]

Base Client for accessing the Hetzner Cloud API

actions

ActionsClient Instance

Type:

ActionsClient

certificates

CertificatesClient Instance

Type:

CertificatesClient

datacenters

DatacentersClient Instance

Type:

DatacentersClient

firewalls

FirewallsClient Instance

Type:

FirewallsClient

floating_ips

FloatingIPsClient Instance

Type:

FloatingIPsClient

images

ImagesClient Instance

Type:

ImagesClient

isos

ImagesClient Instance

Type:

IsosClient

load_balancer_types

LoadBalancerTypesClient Instance

Type:

LoadBalancerTypesClient

load_balancers

LoadBalancersClient Instance

Type:

LoadBalancersClient

locations

LocationsClient Instance

Type:

LocationsClient

networks

NetworksClient Instance

Type:

NetworksClient

placement_groups

PlacementGroupsClient Instance

Type:

PlacementGroupsClient

primary_ips

PrimaryIPsClient Instance

Type:

PrimaryIPsClient

request(method: str, url: str, tries: int = 1, **kwargs) dict[source]

Perform a request to the Hetzner Cloud API, wrapper around requests.request

Parameters:
  • method – HTTP Method to perform the Request

  • url – URL of the Endpoint

  • tries – Tries of the request (used internally, should not be set by the user)

  • timeout – Requests timeout in seconds

Returns:

Response

server_types

ServerTypesClient Instance

Type:

ServerTypesClient

servers

ServersClient Instance

Type:

ServersClient

ssh_keys

SSHKeysClient Instance

Type:

SSHKeysClient

volumes

VolumesClient Instance

Type:

VolumesClient

API Clients

Exceptions

class HCloudException[source]

There was an error while using the hcloud library

class APIException(code: int | str, message: str | None, details: Any)[source]

There was an error while performing an API Request

class ActionException(action: Action | BoundAction)[source]

A generic action exception

class ActionFailedException(action: Action | BoundAction)[source]

The pending action failed

class ActionTimeoutException(action: Action | BoundAction)[source]

The pending action timed out

Other