fgcp.libcloud.compute
index
compute.py

#  Copyright (C) 2016 Michel Dalle
#
#  Licensed under the Apache License, Version 2.0 (the "License");
#  you may not use this file except in compliance with the License.
#  You may obtain a copy of the License at
#
#    http://www.apache.org/licenses/LICENSE-2.0
#
#  Unless required by applicable law or agreed to in writing, software
#  distributed under the License is distributed on an "AS IS" BASIS,
#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#  See the License for the specific language governing permissions and
#  limitations under the License.

 
Classes
       
libcloud.common.base.ConnectionKey(libcloud.common.base.Connection)
FGCPConnectionKey
libcloud.common.types.LibcloudError(exceptions.Exception)
FGCPException
libcloud.compute.base.Node(libcloud.compute.base.UuidMixin)
FGCPNode
libcloud.compute.base.NodeImage(libcloud.compute.base.UuidMixin)
FGCPNodeImage
libcloud.compute.base.NodeLocation(__builtin__.object)
FGCPNodeLocation
libcloud.compute.base.StorageVolume(libcloud.compute.base.UuidMixin)
FGCPStorageVolume
libcloud.compute.base.VolumeSnapshot(__builtin__.object)
FGCPVolumeSnapshot
libcloud.compute.drivers.openstack.OpenStackNodeSize(libcloud.compute.base.NodeSize)
FGCPNodeSize
libcloud.compute.drivers.openstack.OpenStack_1_1_FloatingIpAddress(__builtin__.object)
FGCPFloatingIpAddress
libcloud.compute.drivers.openstack.OpenStack_1_1_FloatingIpPool(__builtin__.object)
FGCPFloatingIpPool
libcloud.compute.drivers.openstack.OpenStack_1_1_NodeDriver(libcloud.compute.drivers.openstack.OpenStackNodeDriver)
FGCPNodeDriver

 
class FGCPConnectionKey(libcloud.common.base.ConnectionKey)
    
Method resolution order:
FGCPConnectionKey
libcloud.common.base.ConnectionKey
libcloud.common.base.Connection
__builtin__.object

Methods defined here:
connect(self, host=None, port=None)

Methods inherited from libcloud.common.base.ConnectionKey:
__init__(self, key, secure=True, host=None, port=None, url=None, timeout=None, proxy_url=None, backoff=None, retry_delay=None)
Initialize `user_id` and `key`; set `secure` to an ``int`` based on
passed value.

Methods inherited from libcloud.common.base.Connection:
add_default_headers(self, headers)
Adds default headers (such as Authorization, X-Foo-Bar)
to the passed `headers`
 
Should return a dictionary.
add_default_params(self, params)
Adds default parameters (such as API key, version, etc.)
to the passed `params`
 
Should return a dictionary.
encode_data(self, data)
Encode body data.
 
Override in a provider's subclass.
morph_action_hook(self, action)
pre_connect_hook(self, params, headers)
A hook which is called before connecting to the remote server.
This hook can perform a final manipulation on the params, headers and
url parameters.
 
:type params: ``dict``
:param params: Request parameters.
 
:type headers: ``dict``
:param headers: Request headers.
request(self, action, params=None, data=None, headers=None, method='GET', raw=False, stream=False)
Request a given `action`.
 
Basically a wrapper around the connection
object's `request` that does some helpful pre-processing.
 
:type action: ``str``
:param action: A path. This can include arguments. If included,
    any extra parameters are appended to the existing ones.
 
:type params: ``dict``
:param params: Optional mapping of additional parameters to send. If
    None, leave as an empty ``dict``.
 
:type data: ``unicode``
:param data: A body of data to send with the request.
 
:type headers: ``dict``
:param headers: Extra headers to add to the request
    None, leave as an empty ``dict``.
 
:type method: ``str``
:param method: An HTTP method such as "GET" or "POST".
 
:type raw: ``bool``
:param raw: True to perform a "raw" request aka only send the headers
             and use the rawResponseCls class. This is used with
             storage API when uploading a file.
 
:type stream: ``bool``
:param stream: True to return an iterator in Response.iter_content
            and allow streaming of the response data
            (for downloading large files)
 
:return: An :class:`Response` instance.
:rtype: :class:`Response` instance
reset_context(self)
set_context(self, context)
set_http_proxy(self, proxy_url)
Set a HTTP proxy which will be used with this connection.
 
:param proxy_url: Proxy URL (e.g. http://<hostname>:<port> without
                  authentication and
                  http://<username>:<password>@<hostname>:<port> for
                  basic auth authentication information.
:type proxy_url: ``str``
user_agent_append(self, token)
Append a token to a user agent string.
 
Users of the library should call this to uniquely identify their
requests to a provider.
 
:type token: ``str``
:param token: Token to add to the user agent.

Data descriptors inherited from libcloud.common.base.Connection:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

Data and other attributes inherited from libcloud.common.base.Connection:
action = None
allow_insecure = True
backoff = None
cache_busting = False
conn_class = <class 'libcloud.http.LibcloudConnection'>
connection = None
driver = None
host = '127.0.0.1'
port = 443
rawResponseCls = <class 'libcloud.common.base.RawResponse'>
responseCls = <class 'libcloud.common.base.Response'>
A base Response class to derive from.
retry_delay = None
secure = 1
timeout = None

 
class FGCPException(libcloud.common.types.LibcloudError)
    
Method resolution order:
FGCPException
libcloud.common.types.LibcloudError
exceptions.Exception
exceptions.BaseException
__builtin__.object

Methods inherited from libcloud.common.types.LibcloudError:
__init__(self, value, driver=None)
__repr__(self)
__str__(self)

Data descriptors inherited from libcloud.common.types.LibcloudError:
__weakref__
list of weak references to the object (if defined)

Data and other attributes inherited from exceptions.Exception:
__new__ = <built-in method __new__ of type object>
T.__new__(S, ...) -> a new object with type S, a subtype of T

Methods inherited from exceptions.BaseException:
__delattr__(...)
x.__delattr__('name') <==> del x.name
__getattribute__(...)
x.__getattribute__('name') <==> x.name
__getitem__(...)
x.__getitem__(y) <==> x[y]
__getslice__(...)
x.__getslice__(i, j) <==> x[i:j]
 
Use of negative indices is not supported.
__reduce__(...)
__setattr__(...)
x.__setattr__('name', value) <==> x.name = value
__setstate__(...)
__unicode__(...)

Data descriptors inherited from exceptions.BaseException:
__dict__
args
message

 
class FGCPFloatingIpAddress(libcloud.compute.drivers.openstack.OpenStack_1_1_FloatingIpAddress)
    
Method resolution order:
FGCPFloatingIpAddress
libcloud.compute.drivers.openstack.OpenStack_1_1_FloatingIpAddress
__builtin__.object

Methods inherited from libcloud.compute.drivers.openstack.OpenStack_1_1_FloatingIpAddress:
__init__(self, id, ip_address, pool, node_id=None, driver=None)
__repr__(self)
delete(self)
Delete this floating IP
 
:rtype: ``bool``

Data descriptors inherited from libcloud.compute.drivers.openstack.OpenStack_1_1_FloatingIpAddress:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

 
class FGCPFloatingIpPool(libcloud.compute.drivers.openstack.OpenStack_1_1_FloatingIpPool)
    
Method resolution order:
FGCPFloatingIpPool
libcloud.compute.drivers.openstack.OpenStack_1_1_FloatingIpPool
__builtin__.object

Methods inherited from libcloud.compute.drivers.openstack.OpenStack_1_1_FloatingIpPool:
__init__(self, name, connection)
__repr__(self)
create_floating_ip(self)
Create new floating IP in the pool
 
:rtype: :class:`OpenStack_1_1_FloatingIpAddress`
delete_floating_ip(self, ip)
Delete specified floating IP from the pool
 
:param      ip: floating IP to remove
:type       ip::class:`OpenStack_1_1_FloatingIpAddress`
 
:rtype: ``bool``
get_floating_ip(self, ip)
Get specified floating IP from the pool
 
:param      ip: floating IP to get
:type       ip: ``str``
 
:rtype: :class:`OpenStack_1_1_FloatingIpAddress`
list_floating_ips(self)
List floating IPs in the pool
 
:rtype: ``list`` of :class:`OpenStack_1_1_FloatingIpAddress`

Data descriptors inherited from libcloud.compute.drivers.openstack.OpenStack_1_1_FloatingIpPool:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

 
class FGCPNode(libcloud.compute.base.Node)
    
Method resolution order:
FGCPNode
libcloud.compute.base.Node
libcloud.compute.base.UuidMixin
__builtin__.object

Methods inherited from libcloud.compute.base.Node:
__init__(self, id, name, state, public_ips, private_ips, driver, size=None, image=None, extra=None, created_at=None)
:param id: Node ID.
:type id: ``str``
 
:param name: Node name.
:type name: ``str``
 
:param state: Node state.
:type state: :class:`libcloud.compute.types.NodeState`
 
:param public_ips: Public IP addresses associated with this node.
:type public_ips: ``list``
 
:param private_ips: Private IP addresses associated with this node.
:type private_ips: ``list``
 
:param driver: Driver this node belongs to.
:type driver: :class:`.NodeDriver`
 
:param size: Size of this node. (optional)
:type size: :class:`.NodeSize`
 
:param image: Image of this node. (optional)
:type image: :class:`.NodeImage`
 
:param created_at: The datetime this node was created (optional)
:type created_at: :class: `datetime.datetime`
 
:param extra: Optional provider specific attributes associated with
              this node.
:type extra: ``dict``
__repr__(self)
destroy(self)
Destroy this node
 
:return: ``bool``
 
This calls the node's driver and destroys the node
 
>>> from libcloud.compute.drivers.dummy import DummyNodeDriver
>>> driver = DummyNodeDriver(0)
>>> from libcloud.compute.types import NodeState
>>> node = driver.create_node()
>>> node.state == NodeState.RUNNING
True
>>> node.destroy()
True
>>> node.state == NodeState.RUNNING
False
reboot(self)
Reboot this node
 
:return: ``bool``
 
This calls the node's driver and reboots the node
 
>>> from libcloud.compute.drivers.dummy import DummyNodeDriver
>>> driver = DummyNodeDriver(0)
>>> node = driver.create_node()
>>> node.state == NodeState.RUNNING
True
>>> node.state == NodeState.REBOOTING
False
>>> node.reboot()
True
>>> node.state == NodeState.REBOOTING
True

Methods inherited from libcloud.compute.base.UuidMixin:
get_uuid(self)
Unique hash for a node, node image, or node size
 
The hash is a function of an SHA1 hash of the node, node image,
or node size's ID and its driver which means that it should be
unique between all objects of its type.
In some subclasses (e.g. GoGridNode) there is no ID
available so the public IP address is used.  This means that,
unlike a properly done system UUID, the same UUID may mean a
different system install at a different time
 
>>> from libcloud.compute.drivers.dummy import DummyNodeDriver
>>> driver = DummyNodeDriver(0)
>>> node = driver.create_node()
>>> node.get_uuid()
'd3748461511d8b9b0e0bfa0d4d3383a619a2bb9f'
 
Note, for example, that this example will always produce the
same UUID!
 
:rtype: ``str``

Data descriptors inherited from libcloud.compute.base.UuidMixin:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)
uuid

 
class FGCPNodeDriver(libcloud.compute.drivers.openstack.OpenStack_1_1_NodeDriver)
    # Register FGCP as third party driver for libcloud
from libcloud.compute.providers import set_driver
from libcloud.compute.providers import get_driver
set_driver('fgcp',
           'fgcp.libcloud.compute',
           'FGCPNodeDriver')
cls = get_driver('fgcp')
 
# Connect with your client certificate to region 'uk' and work in location 'Demo VSystem'
driver = cls('client.pem', region='uk', location='Demo VSystem')
 
#regions = driver.list_regions()
#locations = driver.list_locations()
#nodes = driver.list_nodes()
#images = driver.list_images()
#sizes = driver.list_sizes()
#volumes = driver.list_volumes()
#for volume in volumes:
#    snapshots = driver.list_volume_snapshots(volume)
#    snapshots_and_backups = driver.list_volume_snapshots(volume, ex_include_backups=True)
#    backups = driver.ex_list_volume_backups(volume)
 
 
Requirements: this module uses tlslite.utils or gdata.tlslite.utils to create
the key signature, see https://pypi.python.org/pypi/tlslite-ng or
https://pypi.python.org/pypi/tlslite for download and installation
 
Note: to convert your .p12 or .pfx file to unencrypted PEM format, you can use
the following 'openssl' command:
 
openssl pkcs12 -in UserCert.p12 -out client.pem -nodes
 
 
Method resolution order:
FGCPNodeDriver
libcloud.compute.drivers.openstack.OpenStack_1_1_NodeDriver
libcloud.compute.drivers.openstack.OpenStackNodeDriver
libcloud.compute.base.NodeDriver
libcloud.common.base.BaseDriver
libcloud.common.openstack.OpenStackDriverMixin
__builtin__.object

Methods defined here:
__init__(self, *args, **kwargs)
ex_list_volume_backups(self, volume)
list_images(self, location=None, ex_only_active=True)
list_locations(self)
list_nodes(self, ex_all_tenants=False)
list_regions(self)
list_sizes(self, location=None)
list_volume_snapshots(self, volume, ex_include_backups=False)
list_volumes(self)

Data and other attributes defined here:
connectionCls = <class 'fgcp.libcloud.compute.FGCPConnectionKey'>
name = 'FGCP'
type = 'fgcp'

Methods inherited from libcloud.compute.drivers.openstack.OpenStack_1_1_NodeDriver:
create_image(self, node, name, metadata=None)
Creates a new image.
 
:param      node: Node
:type       node: :class:`Node`
 
:param      name: The name for the new image.
:type       name: ``str``
 
:param      metadata: Key and value pairs for metadata.
:type       metadata: ``dict``
 
:rtype: :class:`NodeImage`
create_key_pair(self, name)
create_node(self, **kwargs)
Create a new node
 
@inherits:  :class:`NodeDriver.create_node`
 
:keyword    ex_keyname:  The name of the key pair
:type       ex_keyname:  ``str``
 
:keyword    ex_userdata: String containing user data
                         see
                         https://help.ubuntu.com/community/CloudInit
:type       ex_userdata: ``str``
 
:keyword    ex_config_drive: Enable config drive
                             see
                             http://docs.openstack.org/grizzly/openstack-compute/admin/content/config-drive.html
:type       ex_config_drive: ``bool``
 
:keyword    ex_security_groups: List of security groups to assign to
                                the node
:type       ex_security_groups: ``list`` of
                               :class:`OpenStackSecurityGroup`
 
:keyword    ex_metadata: Key/Value metadata to associate with a node
:type       ex_metadata: ``dict``
 
:keyword    ex_files:   File Path => File contents to create on
                        the no  de
:type       ex_files:   ``dict``
 
 
:keyword    networks: The server is launched into a set of Networks.
:type       networks: ``list`` of :class:`OpenStackNetwork`
 
:keyword    ex_disk_config: Name of the disk configuration.
                            Can be either ``AUTO`` or ``MANUAL``.
:type       ex_disk_config: ``str``
 
:keyword    ex_config_drive: If True enables metadata injection in a
                             server through a configuration drive.
:type       ex_config_drive: ``bool``
 
:keyword    ex_admin_pass: The root password for the node
:type       ex_admin_pass: ``str``
 
:keyword    ex_availability_zone: Nova availability zone for the node
:type       ex_availability_zone: ``str``
create_volume_snapshot(self, volume, name=None, ex_description=None, ex_force=True)
Create snapshot from volume
 
:param volume: Instance of `StorageVolume`
:type  volume: `StorageVolume`
 
:param name: Name of snapshot (optional)
:type  name: `str` | `NoneType`
 
:param ex_description: Description of the snapshot (optional)
:type  ex_description: `str` | `NoneType`
 
:param ex_force: Specifies if we create a snapshot that is not in
                 state `available`. For example `in-use`. Defaults
                 to True. (optional)
:type  ex_force: `bool`
 
:rtype: :class:`VolumeSnapshot`
delete_image(self, image)
Delete a NodeImage
 
@inherits: :class:`NodeDriver.delete_image`
 
:param      image: image witch should be used
:type       image: :class:`NodeImage`
 
:rtype: ``bool``
delete_key_pair(self, key_pair)
Delete a KeyPair.
 
:param keypair: KeyPair to delete
:type  keypair: :class:`OpenStackKeyPair`
 
:rtype: ``bool``
destroy_volume_snapshot(self, snapshot)
ex_attach_floating_ip_to_node(self, node, ip)
Attach the floating IP to the node
 
:param      node: node
:type       node: :class:`Node`
 
:param      ip: floating IP to attach
:type       ip: ``str`` or :class:`OpenStack_1_1_FloatingIpAddress`
 
:rtype: ``bool``
ex_confirm_resize(self, node)
Confirms a pending resize action.
 
:param      node: Node to resize.
:type       node: :class:`Node`
 
:rtype: ``bool``
ex_create_floating_ip(self, ip_pool=None)
Create new floating IP. The ip_pool attribute is optional only if your
infrastructure has only one IP pool available.
 
:param      ip_pool: name of the floating IP pool
:type       ip_pool: ``str``
 
:rtype: :class:`OpenStack_1_1_FloatingIpAddress`
ex_create_keypair(self, name)
Create a new KeyPair
 
:param name: Name of the new KeyPair
:type  name: ``str``
 
:rtype: :class:`OpenStackKeyPair`
ex_create_network(self, name, cidr)
Create a new Network
 
:param name: Name of network which should be used
:type name: ``str``
 
:param cidr: cidr of network which should be used
:type cidr: ``str``
 
:rtype: :class:`OpenStackNetwork`
ex_create_security_group(self, name, description)
Create a new Security Group
 
:param name: Name of the new Security Group
:type  name: ``str``
 
:param description: Description of the new Security Group
:type  description: ``str``
 
:rtype: :class:`OpenStackSecurityGroup`
ex_create_security_group_rule(self, security_group, ip_protocol, from_port, to_port, cidr=None, source_security_group=None)
Create a new Rule in a Security Group
 
:param security_group: Security Group in which to add the rule
:type  security_group: :class:`OpenStackSecurityGroup`
 
:param ip_protocol: Protocol to which this rule applies
                    Examples: tcp, udp, ...
:type  ip_protocol: ``str``
 
:param from_port: First port of the port range
:type  from_port: ``int``
 
:param to_port: Last port of the port range
:type  to_port: ``int``
 
:param cidr: CIDR notation of the source IP range for this rule
:type  cidr: ``str``
 
:param source_security_group: Existing Security Group to use as the
                              source (instead of CIDR)
:type  source_security_group: L{OpenStackSecurityGroup
 
:rtype: :class:`OpenStackSecurityGroupRule`
ex_create_snapshot(self, volume, name, description=None, force=False)
Create a snapshot based off of a volume.
 
:param      volume: volume
:type       volume: :class:`StorageVolume`
 
:keyword    name: New name for the volume snapshot
:type       name: ``str``
 
:keyword    description: Description of the snapshot (optional)
:type       description: ``str``
 
:keyword    force: Whether to force creation (optional)
:type       force: ``bool``
 
:rtype:     :class:`VolumeSnapshot`
ex_delete_floating_ip(self, ip)
Delete specified floating IP
 
:param      ip: floating IP to remove
:type       ip: :class:`OpenStack_1_1_FloatingIpAddress`
 
:rtype: ``bool``
ex_delete_keypair(self, keypair)
Delete a KeyPair.
 
:param keypair: KeyPair to delete
:type  keypair: :class:`OpenStackKeyPair`
 
:rtype: ``bool``
ex_delete_network(self, network)
Get a list of NodeNetorks that are available.
 
:param network: Network which should be used
:type network: :class:`OpenStackNetwork`
 
:rtype: ``bool``
ex_delete_security_group(self, security_group)
Delete a Security Group.
 
:param security_group: Security Group should be deleted
:type  security_group: :class:`OpenStackSecurityGroup`
 
:rtype: ``bool``
ex_delete_security_group_rule(self, rule)
Delete a Rule from a Security Group.
 
:param rule: Rule should be deleted
:type  rule: :class:`OpenStackSecurityGroupRule`
 
:rtype: ``bool``
ex_delete_snapshot(self, snapshot)
Delete a VolumeSnapshot
 
:param      snapshot: snapshot
:type       snapshot: :class:`VolumeSnapshot`
 
:rtype:     ``bool``
ex_detach_floating_ip_from_node(self, node, ip)
Detach the floating IP from the node
 
:param      node: node
:type       node: :class:`Node`
 
:param      ip: floating IP to remove
:type       ip: ``str`` or :class:`OpenStack_1_1_FloatingIpAddress`
 
:rtype: ``bool``
ex_get_console_output(self, node, length=None)
Get console output
 
:param      node: node
:type       node: :class:`Node`
 
:param      length: Optional number of lines to fetch from the
                    console log
:type       length: ``int``
 
:return: Dictionary with the output
:rtype: ``dict``
ex_get_floating_ip(self, ip)
Get specified floating IP
 
:param      ip: floating IP to get
:type       ip: ``str``
 
:rtype: :class:`OpenStack_1_1_FloatingIpAddress`
ex_get_metadata(self, node)
Get a Node's metadata.
 
:param      node: Node
:type       node: :class:`Node`
 
:return: Key/Value metadata associated with node.
:rtype: ``dict``
ex_get_metadata_for_node(self, node)
Return the metadata associated with the node.
 
:param      node: Node instance
:type       node: :class:`Node`
 
:return: A dictionary or other mapping of strings to strings,
         associating tag names with tag values.
:type tags: ``dict``
ex_get_node_security_groups(self, node)
Get Security Groups of the specified server.
 
:rtype: ``list`` of :class:`OpenStackSecurityGroup`
ex_get_size(self, size_id)
Get a NodeSize
 
:param      size_id: ID of the size which should be used
:type       size_id: ``str``
 
:rtype: :class:`NodeSize`
ex_import_keypair(self, name, keyfile)
Import a KeyPair from a file
 
:param name: Name of the new KeyPair
:type  name: ``str``
 
:param keyfile: Path to the public key file (in OpenSSH format)
:type  keyfile: ``str``
 
:rtype: :class:`OpenStackKeyPair`
ex_import_keypair_from_string(self, name, key_material)
Import a KeyPair from a string
 
:param name: Name of the new KeyPair
:type  name: ``str``
 
:param key_material: Public key (in OpenSSH format)
:type  key_material: ``str``
 
:rtype: :class:`OpenStackKeyPair`
ex_list_floating_ip_pools(self)
List available floating IP pools
 
:rtype: ``list`` of :class:`OpenStack_1_1_FloatingIpPool`
ex_list_floating_ips(self)
List floating IPs
 
:rtype: ``list`` of :class:`OpenStack_1_1_FloatingIpAddress`
ex_list_keypairs(self)
Get a list of KeyPairs that are available.
 
:rtype: ``list`` of :class:`OpenStackKeyPair`
ex_list_networks(self)
Get a list of Networks that are available.
 
:rtype: ``list`` of :class:`OpenStackNetwork`
ex_list_security_groups(self)
Get a list of Security Groups that are available.
 
:rtype: ``list`` of :class:`OpenStackSecurityGroup`
ex_list_snapshots(self)
ex_pause_node(self, node)
ex_rebuild(self, node, image, **kwargs)
Rebuild a Node.
 
:param      node: Node to rebuild.
:type       node: :class:`Node`
 
:param      image: New image to use.
:type       image: :class:`NodeImage`
 
:keyword    ex_metadata: Key/Value metadata to associate with a node
:type       ex_metadata: ``dict``
 
:keyword    ex_files:   File Path => File contents to create on
                        the no  de
:type       ex_files:   ``dict``
 
:keyword    ex_keyname:  Name of existing public key to inject into
                         instance
:type       ex_keyname:  ``str``
 
:keyword    ex_userdata: String containing user data
                         see
                         https://help.ubuntu.com/community/CloudInit
:type       ex_userdata: ``str``
 
:keyword    ex_security_groups: List of security groups to assign to
                                the node
:type       ex_security_groups: ``list`` of
                               :class:`OpenStackSecurityGroup`
 
:keyword    ex_disk_config: Name of the disk configuration.
                            Can be either ``AUTO`` or ``MANUAL``.
:type       ex_disk_config: ``str``
 
:keyword    ex_config_drive: If True enables metadata injection in a
                             server through a configuration drive.
:type       ex_config_drive: ``bool``
 
:rtype: ``bool``
ex_rescue(self, node, password=None)
Rescue a node
 
:param      node: node
:type       node: :class:`Node`
 
:param      password: password
:type       password: ``str``
 
:rtype: :class:`Node`
ex_resize(self, node, size)
Change a node size.
 
:param      node: Node to resize.
:type       node: :class:`Node`
 
:type       size: :class:`NodeSize`
:param      size: New size to use.
 
:rtype: ``bool``
ex_resume_node(self, node)
ex_revert_resize(self, node)
Cancels and reverts a pending resize action.
 
:param      node: Node to resize.
:type       node: :class:`Node`
 
:rtype: ``bool``
ex_set_metadata(self, node, metadata)
Sets the Node's metadata.
 
:param      node: Node
:type       node: :class:`Node`
 
:param      metadata: Key/Value metadata to associate with a node
:type       metadata: ``dict``
 
:rtype: ``dict``
ex_set_password(self, node, password)
Changes the administrator password for a specified server.
 
:param      node: Node to rebuild.
:type       node: :class:`Node`
 
:param      password: The administrator password.
:type       password: ``str``
 
:rtype: ``bool``
ex_set_server_name(self, node, name)
Sets the Node's name.
 
:param      node: Node
:type       node: :class:`Node`
 
:param      name: The name of the server.
:type       name: ``str``
 
:rtype: :class:`Node`
ex_start_node(self, node)
ex_stop_node(self, node)
ex_suspend_node(self, node)
ex_unpause_node(self, node)
ex_unrescue(self, node)
Unrescue a node
 
:param      node: node
:type       node: :class:`Node`
 
:rtype: ``bool``
ex_update_node(self, node, **node_updates)
Update the Node's editable attributes.  The OpenStack API currently
supports editing name and IPv4/IPv6 access addresses.
 
The driver currently only supports updating the node name.
 
:param      node: Node
:type       node: :class:`Node`
 
:keyword    name:   New name for the server
:type       name:   ``str``
 
:rtype: :class:`Node`
get_image(self, image_id)
Get a NodeImage
 
@inherits: :class:`NodeDriver.get_image`
 
:param      image_id: ID of the image which should be used
:type       image_id: ``str``
 
:rtype: :class:`NodeImage`
get_key_pair(self, name)
import_key_pair_from_string(self, name, key_material)
list_key_pairs(self)

Data and other attributes inherited from libcloud.compute.drivers.openstack.OpenStack_1_1_NodeDriver:
features = {'create_node': ['generates_password']}

Methods inherited from libcloud.compute.drivers.openstack.OpenStackNodeDriver:
attach_volume(self, node, volume, device='auto')
create_volume(self, size, name, location=None, snapshot=None, ex_volume_type=None)
Create a new volume.
 
:param size: Size of volume in gigabytes (required)
:type size: ``int``
 
:param name: Name of the volume to be created
:type name: ``str``
 
:param location: Which data center to create a volume in. If
                       empty, undefined behavior will be selected.
                       (optional)
:type location: :class:`.NodeLocation`
 
:param snapshot:  Snapshot from which to create the new
                  volume.  (optional)
:type snapshot:  :class:`.VolumeSnapshot`
 
:param ex_volume_type: What kind of volume to create.
                    (optional)
:type ex_volume_type: ``str``
 
:return: The newly created volume.
:rtype: :class:`StorageVolume`
destroy_node(self, node)
destroy_volume(self, volume)
detach_volume(self, volume, ex_node=None)
ex_get_node_details(self, node_id)
Lists details of the specified server.
 
:param       node_id: ID of the node which should be used
:type        node_id: ``str``
 
:rtype: :class:`Node`
ex_get_volume(self, volumeId)
ex_hard_reboot_node(self, node)
Hard reboots the specified server
 
:param      node:  node
:type       node: :class:`Node`
 
:rtype: ``bool``
ex_soft_reboot_node(self, node)
Soft reboots the specified server
 
:param      node:  node
:type       node: :class:`Node`
 
:rtype: ``bool``
reboot_node(self, node)

Static methods inherited from libcloud.compute.drivers.openstack.OpenStackNodeDriver:
__new__(cls, key, secret=None, secure=True, host=None, port=None, api_version='1.1', **kwargs)

Data and other attributes inherited from libcloud.compute.drivers.openstack.OpenStackNodeDriver:
NODE_STATE_MAP = {'ACTIVE': 'running', 'BUILD': 'pending', 'DELETED': 'terminated', 'DELETE_IP': 'pending', 'ERROR': 'error', 'HARD_REBOOT': 'rebooting', 'PASSWORD': 'pending', 'PREP_RESIZE': 'pending', 'QUEUE_RESIZE': 'pending', 'REBOOT': 'rebooting', ...}
SNAPSHOT_STATE_MAP = {'available': 'available', 'creating': 'creating', 'deleting': 'deleting', 'error': 'error', 'error_restoring': 'error', 'restoring': 'restoring'}
VOLUME_STATE_MAP = {'attaching': 'attaching', 'available': 'available', 'backing-up': 'backup', 'creating': 'creating', 'deleting': 'deleting', 'error': 'error', 'error_deleting': 'error', 'error_extending': 'error', 'error_restoring': 'error', 'in-use': 'inuse', ...}
api_name = 'openstack'
website = 'http://openstack.org/'

Methods inherited from libcloud.compute.base.NodeDriver:
copy_image(self, source_region, node_image, name, description=None)
Copies an image from a source region to the current region.
 
:param source_region: Region to copy the node from.
:type source_region: ``str``
 
:param node_image: NodeImage to copy.
:type node_image: :class:`.NodeImage`:
 
:param name: name for new image.
:type name: ``str``
 
:param description: description for new image.
:type name: ``str``
 
:rtype: :class:`.NodeImage`:
:return: NodeImage instance on success.
deploy_node(self, **kwargs)
Create a new node, and start deployment.
 
In order to be able to SSH into a created node access credentials are
required.
 
A user can pass either a :class:`.NodeAuthPassword` or
:class:`.NodeAuthSSHKey` to the ``auth`` argument. If the
``create_node`` implementation supports that kind if credential (as
declared in ``self.features['create_node']``) then it is passed on to
``create_node``. Otherwise it is not passed on to ``create_node`` and
it is only used for authentication.
 
If the ``auth`` parameter is not supplied but the driver declares it
supports ``generates_password`` then the password returned by
``create_node`` will be used to SSH into the server.
 
Finally, if the ``ssh_key_file`` is supplied that key will be used to
SSH into the server.
 
This function may raise a :class:`DeploymentException`, if a
create_node call was successful, but there is a later error (like SSH
failing or timing out).  This exception includes a Node object which
you may want to destroy if incomplete deployments are not desirable.
 
>>> from libcloud.compute.drivers.dummy import DummyNodeDriver
>>> from libcloud.compute.deployment import ScriptDeployment
>>> from libcloud.compute.deployment import MultiStepDeployment
>>> from libcloud.compute.base import NodeAuthSSHKey
>>> driver = DummyNodeDriver(0)
>>> key = NodeAuthSSHKey('...') # read from file
>>> script = ScriptDeployment("yum -y install emacs strace tcpdump")
>>> msd = MultiStepDeployment([key, script])
>>> def d():
...     try:
...         driver.deploy_node(deploy=msd)
...     except NotImplementedError:
...         print ("not implemented for dummy driver")
>>> d()
not implemented for dummy driver
 
Deploy node is typically not overridden in subclasses.  The
existing implementation should be able to handle most such.
 
:param deploy: Deployment to run once machine is online and
                    available to SSH.
:type deploy: :class:`Deployment`
 
:param ssh_username: Optional name of the account which is used
                          when connecting to
                          SSH server (default is root)
:type ssh_username: ``str``
 
:param ssh_alternate_usernames: Optional list of ssh usernames to
                                     try to connect with if using the
                                     default one fails
:type ssh_alternate_usernames: ``list``
 
:param ssh_port: Optional SSH server port (default is 22)
:type ssh_port: ``int``
 
:param ssh_timeout: Optional SSH connection timeout in seconds
                         (default is 10)
:type ssh_timeout: ``float``
 
:param auth:   Initial authentication information for the node
                    (optional)
:type auth:   :class:`.NodeAuthSSHKey` or :class:`NodeAuthPassword`
 
:param ssh_key: A path (or paths) to an SSH private key with which
                     to attempt to authenticate. (optional)
:type ssh_key: ``str`` or ``list`` of ``str``
 
:param timeout: How many seconds to wait before timing out.
                     (default is 600)
:type timeout: ``int``
 
:param max_tries: How many times to retry if a deployment fails
                       before giving up (default is 3)
:type max_tries: ``int``
 
:param ssh_interface: The interface to wait for. Default is
                           'public_ips', other option is 'private_ips'.
:type ssh_interface: ``str``
import_key_pair_from_file(self, name, key_file_path)
Import a new public key from string.
 
:param name: Key pair name.
:type name: ``str``
 
:param key_file_path: Path to the public key file.
:type key_file_path: ``str``
 
:rtype: :class:`.KeyPair` object
wait_until_running(self, 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.
 
:param nodes: List of nodes to wait for.
:type nodes: ``list`` of :class:`.Node`
 
:param wait_period: How many seconds to wait between each loop
                    iteration. (default is 3)
:type wait_period: ``int``
 
:param timeout: How many seconds to wait before giving up.
                (default is 600)
:type timeout: ``int``
 
:param ssh_interface: Which attribute on the node to use to obtain
                      an IP address. Valid options: public_ips,
                      private_ips. Default is public_ips.
:type ssh_interface: ``str``
 
:param force_ipv4: Ignore IPv6 addresses (default is True).
:type force_ipv4: ``bool``
 
:param ex_list_nodes_kwargs: Optional driver-specific keyword arguments
                             which are passed to the ``list_nodes``
                             method.
:type ex_list_nodes_kwargs: ``dict``
 
:return: ``[(Node, ip_addresses)]`` list of tuple of Node instance and
         list of ip_address on success.
:rtype: ``list`` of ``tuple``

Data and other attributes inherited from libcloud.compute.base.NodeDriver:
port = None

Data descriptors inherited from libcloud.common.base.BaseDriver:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

Methods inherited from libcloud.common.openstack.OpenStackDriverMixin:
openstack_connection_kwargs(self)
:rtype: ``dict``

 
class FGCPNodeImage(libcloud.compute.base.NodeImage)
    
Method resolution order:
FGCPNodeImage
libcloud.compute.base.NodeImage
libcloud.compute.base.UuidMixin
__builtin__.object

Methods inherited from libcloud.compute.base.NodeImage:
__init__(self, id, name, driver, extra=None)
:param id: Image ID.
:type id: ``str``
 
:param name: Image name.
:type name: ``str``
 
:param driver: Driver this image belongs to.
:type driver: :class:`.NodeDriver`
 
:param extra: Optional provided specific attributes associated with
              this image.
:type extra: ``dict``
__repr__(self)

Methods inherited from libcloud.compute.base.UuidMixin:
get_uuid(self)
Unique hash for a node, node image, or node size
 
The hash is a function of an SHA1 hash of the node, node image,
or node size's ID and its driver which means that it should be
unique between all objects of its type.
In some subclasses (e.g. GoGridNode) there is no ID
available so the public IP address is used.  This means that,
unlike a properly done system UUID, the same UUID may mean a
different system install at a different time
 
>>> from libcloud.compute.drivers.dummy import DummyNodeDriver
>>> driver = DummyNodeDriver(0)
>>> node = driver.create_node()
>>> node.get_uuid()
'd3748461511d8b9b0e0bfa0d4d3383a619a2bb9f'
 
Note, for example, that this example will always produce the
same UUID!
 
:rtype: ``str``

Data descriptors inherited from libcloud.compute.base.UuidMixin:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)
uuid

 
class FGCPNodeLocation(libcloud.compute.base.NodeLocation)
    
Method resolution order:
FGCPNodeLocation
libcloud.compute.base.NodeLocation
__builtin__.object

Methods inherited from libcloud.compute.base.NodeLocation:
__init__(self, id, name, country, driver)
:param id: Location ID.
:type id: ``str``
 
:param name: Location name.
:type name: ``str``
 
:param country: Location country.
:type country: ``str``
 
:param driver: Driver this location belongs to.
:type driver: :class:`.NodeDriver`
__repr__(self)

Data descriptors inherited from libcloud.compute.base.NodeLocation:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

 
class FGCPNodeSize(libcloud.compute.drivers.openstack.OpenStackNodeSize)
    
Method resolution order:
FGCPNodeSize
libcloud.compute.drivers.openstack.OpenStackNodeSize
libcloud.compute.base.NodeSize
libcloud.compute.base.UuidMixin
__builtin__.object

Methods inherited from libcloud.compute.drivers.openstack.OpenStackNodeSize:
__init__(self, id, name, ram, disk, bandwidth, price, driver, vcpus=None, ephemeral_disk=None, swap=None, extra=None)
__repr__(self)

Methods inherited from libcloud.compute.base.UuidMixin:
get_uuid(self)
Unique hash for a node, node image, or node size
 
The hash is a function of an SHA1 hash of the node, node image,
or node size's ID and its driver which means that it should be
unique between all objects of its type.
In some subclasses (e.g. GoGridNode) there is no ID
available so the public IP address is used.  This means that,
unlike a properly done system UUID, the same UUID may mean a
different system install at a different time
 
>>> from libcloud.compute.drivers.dummy import DummyNodeDriver
>>> driver = DummyNodeDriver(0)
>>> node = driver.create_node()
>>> node.get_uuid()
'd3748461511d8b9b0e0bfa0d4d3383a619a2bb9f'
 
Note, for example, that this example will always produce the
same UUID!
 
:rtype: ``str``

Data descriptors inherited from libcloud.compute.base.UuidMixin:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)
uuid

 
class FGCPStorageVolume(libcloud.compute.base.StorageVolume)
    
Method resolution order:
FGCPStorageVolume
libcloud.compute.base.StorageVolume
libcloud.compute.base.UuidMixin
__builtin__.object

Methods inherited from libcloud.compute.base.StorageVolume:
__init__(self, id, name, size, driver, state=None, extra=None)
:param id: Storage volume ID.
:type id: ``str``
 
:param name: Storage volume name.
:type name: ``str``
 
:param size: Size of this volume (in GB).
:type size: ``int``
 
:param driver: Driver this image belongs to.
:type driver: :class:`.NodeDriver`
 
:param state: Optional state of the StorageVolume. If not
              provided, will default to UNKNOWN.
:type state: :class:`.StorageVolumeState`
 
:param extra: Optional provider specific attributes.
:type extra: ``dict``
__repr__(self)
attach(self, node, device=None)
Attach this volume to a node.
 
:param node: Node to attach volume to
:type node: :class:`.Node`
 
:param device: Where the device is exposed,
                    e.g. '/dev/sdb (optional)
:type device: ``str``
 
:return: ``True`` if attach was successful, ``False`` otherwise.
:rtype: ``bool``
destroy(self)
Destroy this storage volume.
 
:return: ``True`` if destroy was successful, ``False`` otherwise.
:rtype: ``bool``
detach(self)
Detach this volume from its node
 
:return: ``True`` if detach was successful, ``False`` otherwise.
:rtype: ``bool``
list_snapshots(self)
:rtype: ``list`` of ``VolumeSnapshot``
snapshot(self, name)
Creates a snapshot of this volume.
 
:return: Created snapshot.
:rtype: ``VolumeSnapshot``

Methods inherited from libcloud.compute.base.UuidMixin:
get_uuid(self)
Unique hash for a node, node image, or node size
 
The hash is a function of an SHA1 hash of the node, node image,
or node size's ID and its driver which means that it should be
unique between all objects of its type.
In some subclasses (e.g. GoGridNode) there is no ID
available so the public IP address is used.  This means that,
unlike a properly done system UUID, the same UUID may mean a
different system install at a different time
 
>>> from libcloud.compute.drivers.dummy import DummyNodeDriver
>>> driver = DummyNodeDriver(0)
>>> node = driver.create_node()
>>> node.get_uuid()
'd3748461511d8b9b0e0bfa0d4d3383a619a2bb9f'
 
Note, for example, that this example will always produce the
same UUID!
 
:rtype: ``str``

Data descriptors inherited from libcloud.compute.base.UuidMixin:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)
uuid

 
class FGCPVolumeSnapshot(libcloud.compute.base.VolumeSnapshot)
    
Method resolution order:
FGCPVolumeSnapshot
libcloud.compute.base.VolumeSnapshot
__builtin__.object

Methods inherited from libcloud.compute.base.VolumeSnapshot:
__init__(self, id, driver, size=None, extra=None, created=None, state=None, name=None)
VolumeSnapshot constructor.
 
:param      id: Snapshot ID.
:type       id: ``str``
 
:param      driver: The driver that represents a connection to the
                    provider
:type       driver: `NodeDriver`
 
:param      size: A snapshot size in GB.
:type       size: ``int``
 
:param      extra: Provider depends parameters for snapshot.
:type       extra: ``dict``
 
:param      created: A datetime object that represents when the
                     snapshot was created
:type       created: ``datetime.datetime``
 
:param      state: A string representing the state the snapshot is
                   in. See `libcloud.compute.types.StorageVolumeState`.
:type       state: ``str``
 
:param      name: A string representing the name of the snapshot
:type       name: ``str``
__repr__(self)
destroy(self)
Destroys this snapshot.
 
:rtype: ``bool``

Data descriptors inherited from libcloud.compute.base.VolumeSnapshot:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)