Hetzner Cloud Python

https://travis-ci.com/hetznercloud/hcloud-python.svg?branch=master https://readthedocs.org/projects/hcloud-python/badge/?version=latest

This is the official Hetzner Cloud python library.

Examples

Create Server

1
2
3
4
5
6
7
8
9
from hcloud import Client
from hcloud.server_types.domain import ServerType
from hcloud.images.domain import Image

client = Client(token="{YOUR_API_TOKEN}")  # Please paste your API token here between the quotes
response = client.servers.create(name="my-server", server_type=ServerType(name="cx11"), image=Image(name="ubuntu-20.04"))
server = response.server
print(server)
print("Root Password: " + response.root_password)

List Servers

1
2
3
4
5
from hcloud import Client

client = Client(token="{YOUR_API_TOKEN}")  # Please paste your API token here between the quotes
servers = client.servers.get_all()
print(servers)

You can find more examples in the Example Folder in the Github Repository.

License

The MIT License (MIT). Please see License File for more information.