Compute Driver Documentation is a public cloud provider based in Switzerland.


How to get an API Key

Simply visit and generate your key.

You can generate read and read/write API keys. These token types give you more access control. Revoking an API token is also possible.

Using the API to the full extent

Most of the API is covered by the simple commands:

  • driver.list_sizes()
  • driver.list_images()
  • driver.list_nodes()
  • driver.reboot_node(node)
  • driver.ex_start_node(node)
  • driver.ex_stop_node(node)
  • driver.ex_node_by_uuid(server_uuid)
  • driver.destroy_node(node)
  • driver.create_node(name, size, image, ex_create_attr={})

In our example below you can see how you use ex_create_attr when creating servers. Possible dictionary entries in ex_create_attr are:

  • ssh_keys (list of str) - A list of SSH public keys.
  • volume_size_gb (int) - The size in GB of the root volume.
  • bulk_volume_size_gb (int) - The size in GB of the bulk storage volume.
  • use_public_network (bool) - Attaching/Detaching the public network interface.
  • use_private_network (bool) - Attaching/Detaching the private network interface.
  • use_ipv6 (bool) - Enabling/Disabling IPv6.
  • anti_affinity_with (str) - Pass the UUID of another server.
  • user_data (str) - Cloud-init configuration (cloud-config). Provide YAML.

There’s more extensive documentation on these parameters in our Server-Create API Documentation.


Create a server

from pprint import pprint

import libcloud

cls = libcloud.get_driver(

TOKEN = '3pjzjh3h3rfynqa4iemvtvc33pyfzss2'
driver = cls(TOKEN)

sizes = driver.list_sizes()
images = driver.list_images()

new_node = driver.create_node(
        ssh_keys=['ssh-rsa AAAAB3Nza...'],

API Docs

class libcloud.compute.drivers.cloudscale.CloudscaleNodeDriver(key, **kwargs)[source]

Cloudscale’s node driver.

create_node(name, size, image, location=None, ex_create_attr=None)[source]

Create a node.

The ex_create_attr parameter can include the following dictionary key and value pairs:

  • ssh_keys: list of str ssh public keys
  • volume_size_gb: int defaults to 10.
  • bulk_volume_size_gb: defaults to None.
  • use_public_network: bool defaults to True
  • use_private_network: bool defaults to False
  • use_ipv6: bool defaults to True
  • anti_affinity_with: uuid of a server to create an anti-affinity group with that server or add it to the same group as that server.
  • user_data: str for optional cloud-config data
Parameters:ex_create_attr (dict) – A dictionary of optional attributes for droplet creation
Returns:The newly created node.
Return type:Node

Delete a node. It’s also possible to use node.destroy(). This will irreversibly delete the server and all its volumes. So please be cautious.

Parameters:ex_user_data (str) – A valid uuid that references your exisiting server.
Returns:The server node you asked for.
Return type:Node

List all images.

Images are identified by slugs on This means that minor version upgrades (e.g. Ubuntu 16.04.1 to Ubuntu 16.04.2) will be possible within the same id ubuntu-16.04.


List all your existing compute nodes.


Lists all available sizes. On cloudscale these are known as flavors.


Reboot a node. It’s also possible to use node.reboot().

wait_until_running(nodes, wait_period=3, timeout=600, ssh_interface='public_ips', force_ipv4=True, ex_list_nodes_kwargs=None)

Block until the provided nodes are considered running.

Node is considered running when it’s state is “running” and when it has at least one IP address assigned.

  • nodes (list of Node) – List of nodes to wait for.
  • wait_period (int) – How many seconds to wait between each loop iteration. (default is 3)
  • timeout (int) – How many seconds to wait before giving up. (default is 600)
  • ssh_interface (str) – Which attribute on the node to use to obtain an IP address. Valid options: public_ips, private_ips. Default is public_ips.
  • force_ipv4 (bool) – Ignore IPv6 addresses (default is True).
  • ex_list_nodes_kwargs (dict) – Optional driver-specific keyword arguments which are passed to the list_nodes method.

[(Node, ip_addresses)] list of tuple of Node instance and list of ip_address on success.

Return type:

list of tuple