CloudSigma Compute Driver Documentation¶
CloudSigma is a pure IaaS provided based in Zurich, Switzerland with data centers in Zurich, Switzerland, Las Vegas, United States and Washington DC, United States.

CloudSigma driver supports working with legacy API v1.0 and a new and actively supported API v2.0. API v1.0 has been deprecated and as such, you are strongly encouraged to migrate any existing code which uses API v1.0 to API v2.0.
Instantiating a driver¶
CloudSigma driver constructor takes different arguments with which you tell it which region to connect to, which api version to use and so on.
Available arguments:
region
- Which region to connect to. Defaults tozrh
. All the supported values:zrh
,lvs
,wdc
api_version
- Which API version to use. Defaults to2.0
. All the supported values:1.0
(deprecated),2.0
For information on how to use those arguments, see the Examples section below.
Basics¶
Pre-installed library drives vs installation CD drives¶
CloudSigma has a concept of so called library drives. Library drives exist in two forms:
Pre-installed library drives
Installation CD drives
Pre-installed library drives already have an existing operating system installed on them. They can be cloned and directly used when creating a server.
In Libcloud, pre-installed library drives are exposed as
libcloud.compute.base.NodeImage
objects through a standard
libcloud.compute.base.NodeDriver.list_images()
method.
Installation CD drives are different and not something which is supported by a big chunk of other providers. Unlike pre-installed drives which represent an already installed operating system, those drives represent an operating system installation medium (CD / DVD).
Those installation CD drives don’t fit well into the NodeImage
concept so they
are represented using
libcloud.compute.drivers.cloudsigma.CloudSigmaDrive
objects through the
libcloud.compute.drivers.cloudsigma.CloudSigma_2_0_NodeDriver.ex_list_library_drives()
method.
For more information and examples on how to use the installation CD drives, see the Create a server using an installation CD example below.
Library drives vs user drives¶
As noted above, CloudSigma has a concept called library drives. You can use library drives either by cloning them (pre-installed library drives) or by directly mounting them to the server (installer CD drives).
Besides library drives, CloudSigma also has a concept of user drives. User drives are drives which belong to your account. Those drives have either been cloned from the library drives or created from scratch.
To view all the drives which belong to your account, you can use the
libcloud.compute.drivers.cloudsigma.CloudSigma_2_0_NodeDriver.ex_list_user_drives()
method.
Server creation work-flow¶
Server creation work-flow consists of multiple steps and depends on the type of the image you are using.
If you are using a pre-installed image:
Provided image is cloned so it can be used
Cloned drive is resized to match the size specified using NodeSize
Server is created and the cloned drive is attached to it
Server is started
If you are using an installation CD:
Server is created and selected installation CD is attached to it
Server is started
Examples¶
Connect to zrh region using new API v2.0¶
from libcloud.compute.types import Provider
from libcloud.compute.providers import get_driver
cls = get_driver(Provider.CLOUDSIGMA)
# "api_version" argument can be left out since it defaults to 2.0
driver = cls("username", "password", region="zrh", api_version="2.0")
Connect to zrh region using deprecated API v1.0¶
As noted above, API 1.0 has been deprecated and you are strongly encouraged to migrate any code which uses API 1.0 to API 2.0. This example is only included here for completeness.
from libcloud.compute.types import Provider
from libcloud.compute.providers import get_driver
cls = get_driver(Provider.CLOUDSIGMA)
driver = cls("username", "password", region="zrh", api_version="1.0")
Listing available sizes, images and drives¶
In Libcloud, a libcloud.compute.base.NodeSize
represents a physical
configuration of a server and a libcloud.compute.base.NodeImage
represents an operating system.
To comply with a standard Libcloud API,
libcloud.compute.base.NodeDriver.list_images()
method only returns
available pre-installed library images. Those images can be passed directly
to
libcloud.compute.drivers.cloudsigma.CloudSigma_2_0_NodeDriver.create_node()
method and used to create a server.
If you want to list all the available images and drives, you should use
libcloud.compute.drivers.cloudsigma.CloudSigma_2_0_NodeDriver.ex_list_library_drives()
method.
The example below shows how to list all the available sizes, images and drives.
from libcloud.compute.types import Provider
from libcloud.compute.providers import get_driver
cls = get_driver(Provider.CLOUDSIGMA)
driver = cls("username", "password", region="zrh", api_version="2.0")
sizes = driver.list_sizes()
print(sizes)
images = driver.list_images()
print(images)
drives = driver.ex_list_library_drives()
print(drives)
Create a server using a custom node size¶
Unlike most of the other cloud providers out there, CloudSigma is not limited to pre-defined instance sizes and allows you to specify your own custom size when creating a node.
This means you can totally customize server for your work-load and specify exactly how much CPU, memory and disk space you want.
To follow Libcloud standard API, CloudSigma driver also exposes some
pre-defined instance sizes through the
libcloud.compute.drivers.cloudsigma.CloudSigma_2_0_NodeDriver.list_sizes()
method.
This example shows how to create a node using a custom size.
from libcloud.compute.types import Provider
from libcloud.compute.providers import get_driver
from libcloud.compute.drivers.cloudsigma import CloudSigmaNodeSize
cls = get_driver(Provider.CLOUDSIGMA)
driver = cls("username", "password", region="zrh", api_version="2.0")
name = "test node custom size"
image = driver.list_images()[0]
# Custom node size with 56 GB of ram, 5000 MHz CPU and 200 GB SSD drive
size = CloudSigmaNodeSize(
id=1,
name="my size",
cpu=5000,
ram=5600,
disk=200,
bandwidth=None,
price=0,
driver=driver,
)
node = driver.create_node(name=name, size=size, image=image)
print(node)
Keep in mind that there are some limits in place:
CPU - 1 GHz to 80GHz
Memory - 1 GB to 128 GB
Disk - 1 GB to 8249 GB
You can find exact limits and free capacity for your account’s location using
libcloud.compute.drivers.cloudsigma.CloudSigma_2_0_NodeDriver.ex_list_capabilities()
method.
Create a server with a VLAN¶
By default, each server created with Libcloud has one network interface with a public IP assigned.
Besides networks with a public IP, CloudSigma also allows you to create and use VLANs.
This example shows how to do that. It first creates a VLAN by purchasing a subscription and then assigns the create VLAN to a node upon creation.
Created node will have two network interfaces assigned - one with a public IP and one with the provided VLAN.
from libcloud.compute.types import Provider
from libcloud.compute.providers import get_driver
cls = get_driver(Provider.CLOUDSIGMA)
driver = cls("username", "password", region="zrh", api_version="2.0")
name = "test node with vlan"
size = driver.list_sizes()[0]
image = driver.list_images()[0]
# 1. Create a VLAN. VLANs are created by purchasing a subscription.
subscription = driver.ex_create_subscription(
amount=1, period="1 month", resource="vlan", auto_renew=True
)
vlan_uuid = subscription.subscribed_object
# 2. Create a node with a VLAN
node = driver.create_node(name=name, size=size, image=image, ex_vlan=vlan_uuid)
print(node)
Create a server using an installation CD¶
This example shows how to create a server using an installation CD instead of a pre-installed drive (all the other create server examples in this section assume you are using a pre-installed drive).
Creating a server using an installation CD means that you can’t directly use the server after it has been created. Instead, you need to connect to the server using VNC and walk-through the installation process.
The example below shows how to create a server using FreeBSD 8.2 installation CD.
from libcloud.compute.types import Provider
from libcloud.compute.providers import get_driver
cls = get_driver(Provider.CLOUDSIGMA)
driver = cls("username", "password", region="zrh", api_version="2.0")
name = "test node"
size = driver.list_sizes()[0]
drives = driver.ex_list_library_drives()
image = [drive for drive in drives if drive.name == "FreeBSD 8.2" and drive.media == "cdrom"][0]
# 1. Create a node
node = driver.create_node(name=name, size=size, image=image)
print(node)
# 2. Wait for node to come online
driver.wait_until_running(nodes=[node])
# 3. Enable and obtain VNC URL so we can connect to the VNC server and walk
# through the installation process
tunnel_url = driver.ex_open_vnc_tunnel(node=node)
print("VNC tunnel URL: %s" % (tunnel_url))
print("VNC password: %s" % (node.extra["vnc_password"]))
Associate metadata with a server upon creation¶
CloudSigma allows you to associate arbitrary key / value pairs with each server. This examples shows how to do that upon server creation.
from libcloud.compute.types import Provider
from libcloud.compute.providers import get_driver
cls = get_driver(Provider.CLOUDSIGMA)
driver = cls("username", "password", region="zrh", api_version="2.0")
name = "test node sizeth metadata"
size = driver.list_sizes()[0]
image = driver.list_images()[0]
metadata = {
"ssh_public_key": "my public key",
"role": "database server",
"region": "zrh",
}
node = driver.create_node(name=name, size=size, image=image, ex_metadata=metadata)
print(node)
Add a tag to the server¶
CloudSigma allows you to organize resources such as servers and drivers by tagging them. This example shows how to do that.
from libcloud.compute.types import Provider
from libcloud.compute.providers import get_driver
cls = get_driver(Provider.CLOUDSIGMA)
driver = cls("username", "password", region="zrh", api_version="2.0")
node = driver.list_nodes()[0]
tag_names = ["zrh", "database-server", "monited"]
tags = []
# 1. Create necessary tags
for tag_name in tag_names:
tag = driver.ex_create_tag(name="database-servers")
tags.append(tag)
# 2. Tag node with the created tags
for tag in tags:
driver.ex_tag_resource(resource=node, tag=tag)
Open a VNC tunnel to the server¶
CloudSigma allows you to connect and manage your server using VNC. To
connect to the server using VNC, you can use clients such as vinagre
or
vncviewer
on Ubuntu and other Linux distributions.
This example shows how to open a VNC connection to your server and retrieve a connection URL.
After you have retrieved the URL, you will also need a password which you specified (or it was auto-generated if you haven’t specified it) when creating a server.
If you can’t remember the password, you can use
libcloud.compute.drivers.CloudSigma_2_0_NodeDriver.list_nodes()
method
and access node.extra['vnc_password']
attribute.
After you are done using VNC, it’s recommended to close a tunnel using
libcloud.compute.drivers.cloudsigma.CloudSigma_2_0_NodeDriver.ex_close_vnc_tunnel()
method.
from libcloud.compute.types import Provider
from libcloud.compute.providers import get_driver
cls = get_driver(Provider.CLOUDSIGMA)
driver = cls("username", "password", region="zrh", api_version="2.0")
node = driver.list_nodes()[0]
vnc_url = driver.ex_open_vnc_tunnel(node=node)
vnc_password = node.extra["vnc_password"]
values = {"url": vnc_url, "password": vnc_password}
print("URL: %(url)s, Password: %(password)s" % values)
# When you are done
driver.ex_close_vnc_tunnel(node=node)
Attach firewall policy to the server¶
CloudSigma allows you to restrict access to your servers by using firewall
policies. This example shows how to attach an existing policy to all your
servers tagged with database-server
.
from libcloud.compute.types import Provider
from libcloud.compute.providers import get_driver
cls = get_driver(Provider.CLOUDSIGMA)
driver = cls("username", "password", region="zrh", api_version="2.0")
tags = driver.ex_list_tags()
tag = [tag for tag in tags if tag.name == "database-server"][0]
nodes = driver.list_nodes(ex_tag=tag)
policy = driver.ex_list_firewall_policies()[0]
for node in nodes:
driver.ex_attach_firewall_policy(policy=policy, node=node)
Starting a server in a different availability group using avoid functionality¶
CloudSigma allows you to specify a list of server UUIDs which to avoid when starting a server.
This helps make your infrastructure more highly available and is useful when you want to create a server in a different availability zone than the existing server.
The example below shows how to create a new server in a different availability zone from all the existing servers.
Keep in mind that as noted in the CloudSigma documentation, this functionality uses the best effort mode. This means that the request might succeed even if the avoid can not be satisfied and the requested resource ends in the same availability group as an avoid resource.
from libcloud.compute.types import Provider
from libcloud.compute.providers import get_driver
cls = get_driver(Provider.CLOUDSIGMA)
driver = cls("username", "password", region="zrh", api_version="2.0")
name = "test node avoid mode"
size = driver.list_sizes()[0]
image = driver.list_images()[0]
existing_nodes = driver.list_nodes()
existing_node_uuids = [node.id for node in existing_nodes]
node = driver.create_node(name=name, size=size, image=image, ex_avoid=existing_node_uuids)
print(node)
To check which servers and drives share the same physical compute / storage
host, you can use the
libcloud.compute.drivers.cloudsigma.CloudSigma_2_0_NodeDriver.ex_list_servers_availability_groups()
and libcloud.compute.drivers.cloudsigma.CloudSigma_2_0_NodeDriver.ex_list_drives_availability_groups()
method as displayed below.
from libcloud.compute.types import Provider
from libcloud.compute.providers import get_driver
cls = get_driver(Provider.CLOUDSIGMA)
driver = cls("username", "password", region="zrh", api_version="2.0")
servers_groups = driver.ex_list_servers_availability_groups()
drives_groups = driver.ex_list_drives_availability_groups()
print(servers_groups)
print(drives_groups)
Both of those methods return a list
. Servers and drives which share the same
physical host will be stored under the same index in the returned list.
Purchasing a subscription¶
A lot of resources such as SSDs, VLANs, IPs and others are created by purchasing a subscription.
When you purchase a subscription you need to supply the following arguments:
amount
- Subscription amount. Unit depends on the purchased resource. For example, if you are purchasing avlan
resource,amount
represents a number of VLAN networks you want to purchase.period
- For how long to purchase the subscription. Example values:1 month
,30 days
, etc.resource
- Resource to purchase the subscription for. Valid values:cpu
,mem
,tx
,ip
,vlan
auto_renew
-True
to auto renew the subscription when it expires.
The example below shows how to purchase a single VLAN for a duration of 30 days which will be automatically renewed when it expires.
from libcloud.compute.types import Provider
from libcloud.compute.providers import get_driver
cls = get_driver(Provider.CLOUDSIGMA)
driver = cls("username", "password", region="zrh", api_version="2.0")
subscription = driver.ex_create_subscription(
amount=1, period="30 days", resource="vlan", auto_renew=True
)
print(subscription)
Retrieving the account balance¶
This example shows how to retrieve the account balance. The method returns a
dictionary with two keys - balance
and currency
.
from libcloud.compute.types import Provider
from libcloud.compute.providers import get_driver
cls = get_driver(Provider.CLOUDSIGMA)
driver = cls("username", "password", region="zrh", api_version="2.0")
balance = driver.ex_get_balance()
values = {"balance": balance["balance"], "currency": balance["currency"]}
print("Account balance: %(balance)s %(currency)s" % values)
Other Resources¶
CloudSigma API V2.0 is now supported in Libcloud - CloudSigma Blog
API Docs¶
- class libcloud.compute.drivers.cloudsigma.CloudSigma_2_0_NodeDriver(key, secret=None, secure=True, host=None, port=None, api_version='2.0', **kwargs)[source]¶
Driver for CloudSigma API v2.0.
- Parameters:
key (
str
) – API key or username to be used (required)secret (
str
) – Secret password to be used (required)secure (
bool
) – Whether to use HTTPS or HTTP. Note: Some providers only support HTTPS, and it is on by default.host (
str
) – Override hostname used for connections.port (
int
) – Override port used for connections.api_version (
str
) – Optional API version. Only used by drivers which support multiple API versions.region (
str
) – Optional driver region. Only used by drivers which support multiple regions.
- Return type:
None
- attach_volume(node, volume)[source]¶
Attaches volume to node.
- Parameters:
node (
Node
) – Node to attach volume to.volume (
StorageVolume
) – Volume to attach.device (
str
) – Where the device is exposed, e.g. ‘/dev/sdb’
- Rytpe:
bool
- connectionCls¶
alias of
CloudSigma_2_0_Connection
- create_node(name, size, image, ex_metadata=None, ex_vnc_password=None, ex_avoid=None, ex_vlan=None, public_keys=None)[source]¶
Create a new server.
Server creation consists multiple steps depending on the type of the image used.
Installation CD:
Create a server and attach installation cd
Start a server
Pre-installed image:
Clone provided library drive so we can use it
Resize cloned drive to the desired size
Create a server and attach cloned drive
Start a server
- Parameters:
ex_metadata (
dict
) – Key / value pairs to associate with the created node. (optional)ex_vnc_password (
str
) – Password to use for VNC access. If not provided, random password is generated.ex_avoid (
list
) – A list of server UUIDs to avoid when starting this node. (optional)ex_vlan (
str
) – Optional UUID of a VLAN network to use. If specified, server will have two nics assigned - 1 with a public ip and 1 with the provided VLAN.public_keys (
list
ofstr
) – Optional list of SSH key UUIDs
- create_volume(name, size, media='disk', ex_avoid=None)[source]¶
Create a new volume.
- Parameters:
size (
int
) – Size of volume in gigabytes (required)name (
str
) – Name of the volume to be createdlocation (
NodeLocation
) – Which data center to create a volume in. If empty, undefined behavior will be selected. (optional)snapshot (
VolumeSnapshot
) – Snapshot from which to create the new volume. (optional)
- Returns:
The newly created volume.
- Return type:
StorageVolume
- delete_key_pair(key_pair)[source]¶
Delete an existing key pair.
- Parameters:
key_pair (
KeyPair
) – Key pair object- Return type:
bool
- destroy_node(node, ex_delete_drives=False)[source]¶
Destroy the node and all the associated drives.
- Returns:
True
on success,False
otherwise.- Return type:
bool
- destroy_volume(drive)[source]¶
Destroys a storage volume.
- Parameters:
volume (
StorageVolume
) – Volume to be destroyed- Return type:
bool
- detach_volume(node, volume)[source]¶
Detaches a volume from a node.
- Parameters:
volume (
StorageVolume
) – Volume to be detached- Return type:
bool
- ex_attach_drive(node, drive)[source]¶
Attach drive to node
- Parameters:
node (
libcloud.compute.base.Node
) – Node to attach the drive to.drive (
CloudSigmaDrive
) – Drive to attach.
- Returns:
True
on success,False
otherwise.- Return type:
bool
- ex_attach_firewall_policy(policy, node, nic_mac=None)[source]¶
Attach firewall policy to a public NIC interface on the server.
- Parameters:
policy (
CloudSigmaFirewallPolicy
) – Firewall policy to attach.node (
libcloud.compute.base.Node
) – Node to attach policy to.nic_mac (
str
) – Optional MAC address of the NIC to add the policy to. If not specified, first public interface is used instead.
- Returns:
Node object to which the policy was attached to.
- Return type:
- ex_clone_drive(drive, name=None, ex_avoid=None)[source]¶
Clone a library or a standard drive.
- Parameters:
drive (
libcloud.compute.base.NodeImage
orCloudSigmaDrive
) – Drive to clone.name (
str
) – Optional name for the cloned drive.ex_avoid (
list
) – A list of other drive uuids to avoid when creating this drive. If provided, drive will attempt to be created on a different physical infrastructure from other drives specified using this argument. (optional)
- Returns:
New cloned drive.
- Return type:
- ex_clone_node(node, name=None, random_vnc_password=None)[source]¶
Clone the provided node.
- Parameters:
name (
str
) – Optional name for the cloned node.random_vnc_password (
bool
) – If True, a new random VNC password will be generated for the cloned node. Otherwise password from the cloned node will be reused.
- Returns:
Cloned node.
- Return type:
- ex_close_vnc_tunnel(node)[source]¶
Close a VNC server to the provided node.
- Parameters:
node (
libcloud.compute.base.Node
) – Node to close the VNC tunnel to.- Returns:
True
on success,False
otherwise.- Return type:
bool
- ex_create_drive(name, size, media='disk', ex_avoid=None)[source]¶
Create a new drive.
- Parameters:
name (
str
) – Drive name.size (
int
) – Drive size in GBs.media (
str
) – Drive media type (cdrom, disk).ex_avoid (
list
) – A list of other drive uuids to avoid when creating this drive. If provided, drive will attempt to be created on a different physical infrastructure from other drives specified using this argument. (optional)
- Returns:
Created drive object.
- Return type:
- ex_create_firewall_policy(name, rules=None)[source]¶
Create a firewall policy.
- Parameters:
name (
str
) – Policy name.rules (
list
ofdict
) – List of firewall policy rules to associate with this policy. (optional)
- Returns:
Created firewall policy object.
- Return type:
- ex_create_subscription(amount, period, resource, auto_renew=False)[source]¶
Create a new subscription.
- Parameters:
amount (
int
) – Subscription amount. For example, in dssd case this would be disk size in gigabytes.period (
str
) – Subscription period. For example: 30 days, 1 week, 1 month, …resource (
str
) – Resource the purchase the subscription for.auto_renew (
bool
) – True to automatically renew the subscription.
- ex_create_tag(name, resource_uuids=None)[source]¶
Create a tag.
- Parameters:
name (
str
) – Tag name.resource_uuids (
list
ofstr
) – Optional list of resource UUIDs to assign this tag go.
- Returns:
Created tag object.
- Return type:
- ex_delete_firewall_policy(policy)[source]¶
Delete a firewall policy.
- Parameters:
policy (
CloudSigmaFirewallPolicy
) – Policy to delete to.- Returns:
True
on success,False
otherwise.- Return type:
bool
- ex_delete_tag(tag)[source]¶
Delete a tag.
- Parameters:
tag (
CloudSigmaTag
) – Tag to delete.- Returns:
True
on success,False
otherwise.- Return type:
bool
- ex_edit_node(node, params)[source]¶
Edit a node.
- Parameters:
node (
libcloud.compute.base.Node
) – Node to edit.params (
dict
) – Node parameters to update.
:return Edited node. :rtype:
libcloud.compute.base.Node
- ex_get_balance()[source]¶
Retrieve account balance information.
- Returns:
Dictionary with two items (“balance” and “currency”).
- Return type:
dict
- ex_get_drive(drive_id)[source]¶
Retrieve information about a single drive.
- Parameters:
drive_id (
str
) – ID of the drive to retrieve.- Returns:
Drive object.
- Return type:
- ex_get_pricing()[source]¶
Retrieve pricing information that are applicable to the cloud.
- Returns:
Dictionary with pricing information.
- Return type:
dict
- ex_get_tag(tag_id)[source]¶
Retrieve a single tag.
- Parameters:
tag_id (
str
) – ID of the tag to retrieve.- Return type:
list
ofCloudSigmaTag
objects
- ex_get_usage()[source]¶
Retrieve account current usage information.
- Returns:
Dictionary with two items (“balance” and “usage”).
- Return type:
dict
- ex_list_capabilities()[source]¶
Retrieve all the basic and sensible limits of the API.
- Return type:
dict
- ex_list_drives_availability_groups()[source]¶
Return which drives share the same physical storage host.
- Returns:
A list of drive UUIDs which share the same physical storage host. Drives which share the same host will be stored under the same list index.
- Return type:
list
oflist
- ex_list_firewall_policies()[source]¶
List firewall policies.
- Return type:
list
ofCloudSigmaFirewallPolicy
- ex_list_library_drives()[source]¶
Return a list of all the available library drives (pre-installed and installation CDs).
- Return type:
list
ofCloudSigmaDrive
objects
- ex_list_servers_availability_groups()[source]¶
Return which running servers share the same physical compute host.
- Returns:
A list of server UUIDs which share the same physical compute host. Servers which share the same host will be stored under the same list index.
- Return type:
list
oflist
- ex_list_subscriptions(status='all', resources=None)[source]¶
List subscriptions for this account.
- Parameters:
status (
str
) – Only return subscriptions with the provided status (optional).resources (
list
) – Only return subscriptions for the provided resources (optional).
- Return type:
list
- ex_list_tags()[source]¶
List all the available tags.
- Return type:
list
ofCloudSigmaTag
objects
- ex_list_user_drives()[source]¶
Return a list of all the available user’s drives.
- Return type:
list
ofCloudSigmaDrive
objects
- ex_open_vnc_tunnel(node)[source]¶
Open a VNC tunnel to the provided node and return the VNC url.
- Parameters:
node (
libcloud.compute.base.Node
) – Node to open the VNC tunnel to.- Returns:
URL of the opened VNC tunnel.
- Return type:
str
- ex_resize_drive(drive, size)[source]¶
Resize a drive.
- Parameters:
drive – Drive to resize.
size (
int
) – New drive size in GBs.
- Returns:
Drive object which is being resized.
- Return type:
- ex_tag_resource(resource, tag)[source]¶
Associate tag with the provided resource.
- Parameters:
resource (
libcloud.compute.base.Node
orCloudSigmaDrive
) – Resource to associate a tag with.tag (
CloudSigmaTag
) – Tag to associate with the resources.
- Returns:
Updated tag object.
- Return type:
- ex_tag_resources(resources, tag)[source]¶
Associate tag with the provided resources.
- Parameters:
resources (
list
oflibcloud.compute.base.Node
orCloudSigmaDrive
) – Resources to associate a tag with.tag (
CloudSigmaTag
) – Tag to associate with the resources.
- Returns:
Updated tag object.
- Return type:
- ex_toggle_subscription_auto_renew(subscription)[source]¶
Toggle subscription auto renew status.
- Parameters:
subscription (
CloudSigmaSubscription
) – Subscription to toggle the auto renew flag for.- Returns:
True
on success,False
otherwise.- Return type:
bool
- get_key_pair(key_uuid)[source]¶
Retrieve a single key pair.
- Parameters:
name (
str
) – The uuid of the key pair to retrieve.- Return type:
- import_key_pair_from_string(name, key_material)[source]¶
Import a new public key from string.
- Parameters:
name (
str
) – Key pair name.key_material (
str
) – Public key material.
- Return type:
KeyPair
object
- list_images()[source]¶
Return a list of available pre-installed library drives.
Note: If you want to list all the available library drives (both pre-installed and installation CDs), use
ex_list_library_drives()
method.
- list_key_pairs()[source]¶
List all the available key pair objects.
- Return type:
list
ofKeyPair
objects
- list_nodes(ex_tag=None)[source]¶
List available nodes.
- Parameters:
ex_tag (
CloudSigmaTag
) – If specified, only return servers tagged with the provided tag.
- list_volumes()[source]¶
List storage volumes.
- Return type:
list
ofStorageVolume
- reboot_node(node)[source]¶
Reboot a node.
Because Cloudsigma API does not provide native reboot call, it’s emulated using stop and start.
- Parameters:
node (
libcloud.compute.base.Node
) – Node to reboot.
- start_node(node, ex_avoid=None)[source]¶
Start a node.
- Parameters:
node (
libcloud.compute.base.Node
) – Node to start.ex_avoid (
list
) – A list of other server uuids to avoid when starting this node. If provided, node will attempt to be started on a different physical infrastructure from other servers specified using this argument. (optional)
- class libcloud.compute.drivers.cloudsigma.CloudSigmaDrive(id, name, size, media, status, driver, extra=None)[source]¶
Represents a CloudSigma drive.
- Parameters:
id (
str
) – Drive ID.name (
str
) – Drive name.size (
float
) – Drive size (in GBs).media (
str
) – Drive media (cdrom / disk).status (
str
) – Drive status (unmounted / mounted).
- class libcloud.compute.drivers.cloudsigma.CloudSigmaTag(id, name, resources=None)[source]¶
Represents a CloudSigma tag object.
- Parameters:
id (
str
) – Tag ID.name (
str
) – Tag name.resource – IDs of resources which are associated with this tag.
- class libcloud.compute.drivers.cloudsigma.CloudSigmaSubscription(id, resource, amount, period, status, price, start_time, end_time, auto_renew, subscribed_object=None)[source]¶
Represents CloudSigma subscription.
- Parameters:
id (
str
) – Subscription ID.resource (
str
) – Resource (e.g vlan, ip, etc.).period (
str
) – Subscription period.status (
str
) – Subscription status (active / inactive).price (
str
) – Subscription price.start_time (
datetime.datetime
) – Start time for this subscription.end_time (
datetime.datetime
) – End time for this subscription.auto_renew (
bool
) – True if the subscription is auto renewed.subscribed_object (
str
) – Optional UUID of the subscribed object.
- class libcloud.compute.drivers.cloudsigma.CloudSigmaFirewallPolicy(id, name, rules)[source]¶
Represents a CloudSigma firewall policy.
- Parameters:
id (
str
) – Policy ID.name (
str
) – Policy name.rules (
list
ofCloudSigmaFirewallPolicyRule
objects) – Rules associated with this policy.
- class libcloud.compute.drivers.cloudsigma.CloudSigmaFirewallPolicyRule(action, direction, ip_proto=None, src_ip=None, src_port=None, dst_ip=None, dst_port=None, comment=None)[source]¶
Represents a CloudSigma firewall policy rule.
- Parameters:
action (
str
) – Action (drop / accept).direction (
str
) – Rule direction (in / out / both)>ip_proto (
str
.) – IP protocol (tcp / udp).src_ip (
str
) – Source IP in CIDR notation.src_port (
str
) – Source port or a port range.dst_ip (
str
) – Destination IP in CIDR notation.src_port – Destination port or a port range.
comment (
str
) – Comment associated with the policy.