l.c.d.c.CloudStackNodeDriver(CloudStackDriverMixIn, NodeDriver) : class documentation

Part of libcloud.compute.drivers.cloudstack View Source View In Hierarchy

Known subclasses: libcloud.compute.drivers.ktucloud.KTUCloudNodeDriver, libcloud.compute.drivers.ninefold.NinefoldNodeDriver

Driver for the CloudStack API.

@cvar host: The host where the API can be reached.
@cvar path: The path where the API can be reached.
@cvar async_poll_frequency: How often (in seconds) to poll for async
                            job completion.
@type async_poll_frequency: C{int}
Method __init__ @inherits: L{NodeDriver.__init__}
Method list_images List images on a provider
Method list_locations List data centers for a provider
Method list_nodes @inherits: L{NodeDriver.list_nodes} @rtype: C{list} of L{CloudStackNode}
Method list_sizes List sizes on a provider
Method create_node @inherits: L{NodeDriver.create_node}
Method destroy_node @inherits: L{NodeDriver.reboot_node} @type node: L{CloudStackNode}
Method reboot_node @inherits: L{NodeDriver.reboot_node} @type node: L{CloudStackNode}
Method ex_start Starts/Resumes a stopped virtual machine
Method ex_stop Stops/Suspends a running virtual machine
Method ex_list_disk_offerings Fetch a list of all available disk offerings.
Method ex_list_networks List the available networks
Method create_volume Create a new volume.
Method attach_volume @inherits: L{NodeDriver.attach_volume} @type node: L{CloudStackNode}
Method detach_volume Detaches a volume from a node.
Method destroy_volume Destroys a storage volume.
Method ex_allocate_public_ip Allocate a public IP and bind it to a node.
Method ex_release_public_ip Release a public IP.
Method ex_add_ip_forwarding_rule "Add a NAT/firewall forwarding rule.
Method ex_delete_ip_forwarding_rule Remove a NAT/firewall forwarding rule.
Method ex_list_keypairs List Registered SSH Key Pairs
Method ex_create_keypair Creates a SSH KeyPair, returns fingerprint and private key
Method ex_delete_keypair Deletes an existing SSH KeyPair
Method ex_list_security_groups Lists Security Groups
Method ex_create_security_group Creates a new Security Group
Method ex_delete_security_group Deletes a given Security Group
Method ex_authorize_security_group_ingress Creates a new Security Group Ingress rule
Method ex_register_iso Registers an existing ISO by URL.

Inherited from CloudStackDriverMixIn:

Method _sync_request Undocumented
Method _async_request Undocumented

Inherited from NodeDriver:

Method deploy_node Create a new node, and start deployment.
Method wait_until_running Block until the given nodes are fully booted and have an IP address assigned.
Method _wait_until_running Undocumented
Method _ssh_client_connect Try to connect to the remote SSH server. If a connection times out or is refused it is retried up to timeout number of seconds.
Method _connect_and_run_deployment_script Undocumented
Method _run_deployment_script Run the deployment script on the provided node. At this point it is assumed that SSH connection has already been established.
Method _get_size_price Undocumented

Inherited from BaseDriver (via NodeDriver):

Method _ex_connection_class_kwargs Return extra connection keyword arguments which are passed to the Connection class constructor.
def __init__(self, key, *args, secret=None, secure=True, host=None, path=None, port=None, **kwargs): (source)
@inherits: L{NodeDriver.__init__}

@param    host: The host where the API can be reached. (required)
@type     host: C{str}

@param    path: The host where the API can be reached. (required)
@type     path: C{str}
def list_images(self, location=None): (source)
List images on a provider

@keyword location: The location at which to list images
@type location: L{NodeLocation}

@return: list of node image objects
@rtype: C{list} of L{NodeImage}
def list_locations(self): (source)
List data centers for a provider

@return: list of node location objects
@rtype: C{list} of L{NodeLocation}
def list_nodes(self): (source)
@inherits: L{NodeDriver.list_nodes}
@rtype: C{list} of L{CloudStackNode}
def list_sizes(self, location=None): (source)
List sizes on a provider

@keyword location: The location at which to list sizes
@type location: L{NodeLocation}

@return: list of node size objects
@rtype: C{list} of L{NodeSize}
def create_node(self, name, size, image, location=None, extra_args=None, **kwargs): (source)
@inherits: L{NodeDriver.create_node}

@keyword  extra_args: Extra argument passed to the
"deployVirtualMachine" call. A list of available arguments can be found
at http://cloudstack.apache.org/docs/api/apidocs-4.0.0/root_admin/deployVirtualMachine.html
@type     extra_args:   C{dict}

@rtype: L{CloudStackNode}
def destroy_node(self, node): (source)
@inherits: L{NodeDriver.reboot_node}
@type node: L{CloudStackNode}
def reboot_node(self, node): (source)
@inherits: L{NodeDriver.reboot_node}
@type node: L{CloudStackNode}
def ex_start(self, node): (source)
Starts/Resumes a stopped virtual machine

@type node: L{CloudStackNode}

@param id: The ID of the virtual machine (required)
@type  id: C{uuid}

@param hostid: destination Host ID to deploy the VM to
               parameter available for root admin only
@type  hostid: C{uuid}

@rtype C{str}
def ex_stop(self, node): (source)
Stops/Suspends a running virtual machine

@type node: L{CloudStackNode}

@param id: The ID of the virtual machine
@type  id: C{uuid}

@param forced: Force stop the VM
               (vm is marked as Stopped even when command
                fails to be send to the backend).
               The caller knows the VM is stopped.
@type  forced: C{bool}

@rtype C{str}
def ex_list_disk_offerings(self): (source)
Fetch a list of all available disk offerings.

@rtype: C{list} of L{CloudStackDiskOffering}
def ex_list_networks(self): (source)
List the available networks
def create_volume(self, size, name, location, snapshot=None): (source)
Create a new volume.

@param      size: Size of volume in gigabytes (required)
@type       size: C{int}

@keyword    name: Name of the volume to be created
@type       name: C{str}

@keyword    location: Which data center to create a volume in. If
                       empty, undefined behavoir will be selected.
                       (optional)
@type       location: L{NodeLocation}

@keyword    snapshot:  Name of snapshot from which to create the new
                       volume.  (optional)
@type       snapshot:  C{str}

@return: The newly created volume.
@rtype: L{StorageVolume}
def attach_volume(self, node, volume, device=None): (source)
@inherits: L{NodeDriver.attach_volume}
@type node: L{CloudStackNode}
def detach_volume(self, volume): (source)
Detaches a volume from a node.

@param      volume: Volume to be detached
@type       volume: L{StorageVolume}

@rtype: C{bool}
def destroy_volume(self, volume): (source)
Destroys a storage volume.

@param      volume: Volume to be destroyed
@type       volume: L{StorageVolume}

@rtype: C{bool}
def ex_allocate_public_ip(self, node): (source)
Allocate a public IP and bind it to a node.

@param node: Node which should be used
@type  node: L{CloudStackNode}

@rtype: L{CloudStackAddress}
def ex_release_public_ip(self, node, address): (source)
Release a public IP.

@param node: Node which should be used
@type  node: L{CloudStackNode}

@param address: CloudStackAddress which should be used
@type  address: L{CloudStackAddress}

@rtype: C{bool}
def ex_add_ip_forwarding_rule(self, node, address, protocol, start_port, end_port=None): (source)
"Add a NAT/firewall forwarding rule.

@param node: Node which should be used
@type  node: L{CloudStackNode}

@param      address: CloudStackAddress which should be used
@type       address: L{CloudStackAddress}

@param      protocol: Protocol which should be used (TCP or UDP)
@type       protocol: C{str}

@param      start_port: Start port which should be used
@type       start_port: C{int}

@param end_port: End port which should be used
@type end_port: C{int}

@rtype: L{CloudStackForwardingRule}
def ex_delete_ip_forwarding_rule(self, node, rule): (source)
Remove a NAT/firewall forwarding rule.

@param node: Node which should be used
@type  node: L{CloudStackNode}

@param rule: Forwarding rule which should be used
@type rule: L{CloudStackForwardingRule}

@rtype: C{bool}
def ex_list_keypairs(self, **kwargs): (source)
List Registered SSH Key Pairs

@param     projectid: list objects by project
@type      projectid: C{uuid}

@param     page: The page to list the keypairs from
@type      page: C{int}

@param     keyword: List by keyword
@type      keyword: C{str}

@param     listall: If set to false, list only resources
                    belonging to the command's caller;
                    if set to true - list resources that
                    the caller is authorized to see.
                    Default value is false

@type      listall: C{bool}

@param     pagesize: The number of results per page
@type      pagesize: C{int}

@param     account: List resources by account.
                    Must be used with the domainId parameter
@type      account: C{str}

@param     isrecursive: Defaults to false, but if true,
                        lists all resources from
                        the parent specified by the
                        domainId till leaves.
@type      isrecursive: C{bool}

@param     fingerprint: A public key fingerprint to look for
@type      fingerprint: C{str}

@param     name: A key pair name to look for
@type      name: C{str}

@param     domainid: List only resources belonging to
                             the domain specified
@type      domainid: C{uuid}

@return:   A list of keypair dictionaries
@rtype:    L{dict}
def ex_create_keypair(self, name, **kwargs): (source)
Creates a SSH KeyPair, returns fingerprint and private key

@param     name: Name of the keypair (required)
@type      name: C{str}

@param     projectid: An optional project for the ssh key
@type      projectid: C{str}

@param     domainid: An optional domainId for the ssh key.
                     If the account parameter is used,
                     domainId must also be used.
@type      domainid: C{str}

@param     account: An optional account for the ssh key.
                    Must be used with domainId.
@type      account: C{str}

@return:   A keypair dictionary
@rtype:    C{dict}
def ex_delete_keypair(self, name, **kwargs): (source)
Deletes an existing SSH KeyPair

@param     name: Name of the keypair (required)
@type      name: C{str}

@param     projectid: The project associated with keypair
@type      projectid: C{uuid}

@param     domainid : The domain ID associated with the keypair
@type      domainid: C{uuid}

@param     account : The account associated with the keypair.
                     Must be used with the domainId parameter.
@type      account: C{str}

@return:   True of False based on success of Keypair deletion
@rtype:    C{bool}
def ex_list_security_groups(self, **kwargs): (source)
Lists Security Groups

@param domainid: List only resources belonging to the domain specified
@type  domainid: C{uuid}

@param account: List resources by account. Must be used with
                                           the domainId parameter.
@type  account: C{str}

@param listall: If set to false, list only resources belonging to
                                 the command's caller; if set to true
                                 list resources that the caller is
                                 authorized to see.
                                 Default value is false
@type  listall: C{bool}

@param pagesize: Number of entries per page
@type  pagesize: C{int}

@param keyword: List by keyword
@type  keyword: C{str}

@param tags: List resources by tags (key/value pairs)
@type  tags: C{dict}

@param id: list the security group by the id provided
@type  id: C{uuid}

@param securitygroupname: lists security groups by name
@type  securitygroupname: C{str}

@param virtualmachineid: lists security groups by virtual machine id
@type  virtualmachineid: C{uuid}

@param projectid: list objects by project
@type  projectid: C{uuid}

@param isrecursive: (boolean) defaults to false, but if true,
                              lists all resources from the parent
                              specified by the domainId till leaves.
@type  isrecursive: C{bool}

@param page: (integer)
@type  page: C{int}

@rtype C{list}
def ex_create_security_group(self, name, **kwargs): (source)
Creates a new Security Group

@param name: name of the security group (required)
@type  name: C{str}

@param account: An optional account for the security group.
                Must be used with domainId.
@type  account: C{str}

@param domainid: An optional domainId for the security group.
                 If the account parameter is used,
                 domainId must also be used.
@type  domainid: C{uuid}

@param description: The description of the security group
@type  description: C{str}

@param projectid: Deploy vm for the project
@type  projectid: C{uuid}

@rtype: C{dict}
def ex_delete_security_group(self, name): (source)
Deletes a given Security Group

@param domainid: The domain ID of account owning
                 the security group
@type  domainid: C{uuid}

@param id: The ID of the security group.
           Mutually exclusive with name parameter
@type  id: C{uuid}

@param name: The ID of the security group.
             Mutually exclusive with id parameter
@type name: C{str}

@param account: The account of the security group.
                Must be specified with domain ID
@type  account: C{str}

@param projectid:  The project of the security group
@type  projectid:  C{uuid}

@rtype: C{bool}
def ex_authorize_security_group_ingress(self, securitygroupname, protocol, cidrlist, startport, endport=None): (source)
Creates a new Security Group Ingress rule

@param domainid: An optional domainId for the security group.
                 If the account parameter is used,
                 domainId must also be used.
@type domainid: C{uuid}

@param startport: Start port for this ingress rule
@type  startport: C{int}

@param securitygroupid: The ID of the security group.
                        Mutually exclusive with securityGroupName
                        parameter
@type  securitygroupid: C{uuid}

@param cidrlist: The cidr list associated
@type  cidrlist: C{list}

@param usersecuritygrouplist: user to security group mapping
@type  usersecuritygrouplist: C{map}

@param securitygroupname: The name of the security group.
                          Mutually exclusive with
                          securityGroupName parameter
@type  securitygroupname: C{str}

@param account: An optional account for the security group.
                Must be used with domainId.
@type  account: C{str}

@param icmpcode: Error code for this icmp message
@type  icmpcode: C{int}

@param protocol: TCP is default. UDP is the other supported protocol
@type  protocol: C{str}

@param icmptype: type of the icmp message being sent
@type  icmptype: C{int}

@param projectid: An optional project of the security group
@type  projectid: C{uuid}

@param endport: end port for this ingress rule
@type  endport: C{int}

@rtype: C{list}
def ex_register_iso(self, name, url, location=None, **kwargs): (source)
Registers an existing ISO by URL.

@param      name: Name which should be used
@type       name: C{str}

@param      url: Url should be used
@type       url: C{str}

@param      location: Location which should be used
@type       location: L{NodeLocation}

@rtype: C{str}
API Documentation for libcloud, generated by pydoctor at 2013-09-04 21:31:29.