l.c.d.e.EC2NodeDriver(NodeDriver) : class documentation

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

Known subclasses: libcloud.compute.drivers.ec2.EC2APNENodeDriver, libcloud.compute.drivers.ec2.EC2APSENodeDriver, libcloud.compute.drivers.ec2.EC2EUNodeDriver, libcloud.compute.drivers.ec2.EC2SAEastNodeDriver, libcloud.compute.drivers.ec2.EC2USWestNodeDriver, libcloud.compute.drivers.ec2.EC2USWestOregonNodeDriver, libcloud.compute.drivers.ec2.EucNodeDriver, libcloud.compute.drivers.ec2.NimbusNodeDriver

Amazon EC2 node driver
Method list_nodes List all nodes
Method list_sizes List sizes on a provider
Method list_images List images on a provider
Method list_locations List data centers for a provider
Method create_volume Create a new volume.
Method destroy_volume Destroys a storage volume.
Method attach_volume Attaches volume to node.
Method detach_volume Detaches a volume from a node.
Method ex_create_keypair Creates a new keypair
Method ex_import_keypair imports a new public key
Method ex_describe_keypairs Describes a keypair by name
Method ex_create_security_group Creates a new Security Group
Method ex_authorize_security_group_permissive Edit a Security Group to allow all traffic.
Method ex_list_availability_zones Return a list of ExEC2AvailabilityZone objects for the current region.
Method ex_describe_tags Return a dictionary of tags for a resource (Node or StorageVolume).
Method ex_create_tags Create tags for a resource (Node or StorageVolume).
Method ex_delete_tags Delete tags from a resource.
Method ex_describe_all_addresses Return all the Elastic IP addresses for this account optionally, return only the allocated addresses
Method ex_associate_addresses Associate an IP address with a particular node.
Method ex_describe_addresses Return Elastic IP addresses for all the nodes in the provided list.
Method ex_describe_addresses_for_node Return a list of Elastic IP addresses associated with this node.
Method ex_modify_instance_attribute Modify node attributes. A list of valid attributes can be found at http://goo.gl/gxcj8
Method ex_change_node_size Change the node size. Note: Node must be turned of before changing the size.
Method create_node Create a new EC2 node
Method reboot_node Reboot a node.
Method ex_start_node Start the node by passing in the node object, does not work with instance store backed instances
Method ex_stop_node Stop the node by passing in the node object, does not work with instance store backed instances
Method destroy_node Destroy a node.
Method _pathlist Converts a key and an array of values into AWS query param format.
Method _get_boolean Undocumented
Method _get_state_boolean Checks for the instances's state
Method _get_terminate_boolean Undocumented
Method _to_nodes Undocumented
Method _to_node Undocumented
Method _to_images Undocumented
Method _to_image Undocumented
Method _to_volume Undocumented
Method _get_sizes Undocumented
Method _add_instance_filter Add instance filter to the provided params dictionary.

Inherited from NodeDriver:

Method __init__
Method deploy_node Create a new node, and start deployment.
Method _wait_until_running Block until node is fully booted and has an IP address assigned.
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 _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 _pathlist(self, key, arr): (source)
Converts a key and an array of values into AWS query param format.
def _get_boolean(self, element): (source)
Undocumented
def _get_state_boolean(self, element): (source)
Checks for the instances's state
def _get_terminate_boolean(self, element): (source)
Undocumented
def _to_nodes(self, object, xpath, groups=None): (source)
Undocumented
def _to_node(self, element, groups=None): (source)
Undocumented
def _to_images(self, object): (source)
Undocumented
def _to_image(self, element): (source)
Undocumented
def _to_volume(self, element, name): (source)
Undocumented
def list_nodes(self, ex_node_ids=None): (source)
List all nodes

Ex_node_ids parameter is used to filter the list of nodes that should be returned. Only the nodes with the corresponding node ids will be returned.

Parametersex_node_idsList of node.id (type: list of str)
Returns (type: list of Node)
def list_sizes(self, location=None): (source)
List sizes on a provider
ParameterslocationThe location at which to list sizes (type: NodeLocation)
Returnslist of node size objects (type: list of NodeSize)
def _get_sizes(self, ignored_size_ids=None): (source)
Undocumented
def list_images(self, location=None): (source)
List images on a provider
ParameterslocationThe location at which to list images (type: NodeLocation)
Returnslist of node image objects (type: list of NodeImage)
def list_locations(self): (source)
List data centers for a provider
Returnslist of node location objects (type: list of NodeLocation)
def create_volume(self, size, name, location=None, snapshot=None): (source)
Create a new volume.
ParameterssizeSize of volume in gigabytes (required) (type: int)
nameName of the volume to be created (type: str)
locationWhich data center to create a volume in. If empty, undefined behavoir will be selected. (optional) (type: NodeLocation)
snapshotName of snapshot from which to create the new volume. (optional) (type: str)
ReturnsThe newly created volume. (type: StorageVolume)
def destroy_volume(self, volume): (source)
Destroys a storage volume.
ParametersvolumeVolume to be destroyed (type: StorageVolume)
Returns (type: bool)
def attach_volume(self, node, volume, device): (source)
Attaches volume to node.
ParametersnodeNode to attach volume to (type: Node)
volumeVolume to attach (type: StorageVolume)
deviceWhere the device is exposed, e.g. '/dev/sdb (optional) (type: str)
Returns (type: bool)
def detach_volume(self, volume): (source)
Detaches a volume from a node.
ParametersvolumeVolume to be detached (type: StorageVolume)
Returns (type: bool)
def ex_create_keypair(self, name): (source)
Creates a new keypair
ParametersnameThe name of the keypair to Create. This must be unique, otherwise an InvalidKeyPair.Duplicate exception is raised. (type: str)
Returns (type: dict)
NoteThis is a non-standard extension API, and only works for EC2.
def ex_import_keypair(self, name, keyfile): (source)
imports a new public key
ParametersnameThe name of the public key to import. This must be unique, otherwise an InvalidKeyPair.Duplicate exception is raised. (type: str)
keyfileThe filename with path of the public key to import. (type: str)
Returns (type: dict)
NoteThis is a non-standard extension API, and only works for EC2.
def ex_describe_keypairs(self, name): (source)
Describes a keypair by name
ParametersnameThe name of the keypair to describe. (type: str)
Returns (type: dict)
NoteThis is a non-standard extension API, and only works for EC2.
def ex_create_security_group(self, name, description): (source)
Creates a new Security Group
ParametersnameThe name of the security group to Create. This must be unique. (type: str)
descriptionHuman readable description of a Security Group. (type: str)
Returns (type: str)
NoteThis is a non-standard extension API, and only works for EC2.
def ex_authorize_security_group_permissive(self, name): (source)
Edit a Security Group to allow all traffic.
ParametersnameThe name of the security group to edit (type: str)
Returns (type: list of str)
NoteThis is a non-standard extension API, and only works for EC2.
def ex_list_availability_zones(self, only_available=True): (source)
Return a list of ExEC2AvailabilityZone objects for the current region.

Note: This is an extension method and is only available for EC2 driver.

Parametersonly_availableIf true, return only availability zones with state 'available' (type: str)
Returns (type: list of ExEC2AvailabilityZone)
def ex_describe_tags(self, resource): (source)
Return a dictionary of tags for a resource (Node or StorageVolume).
Parametersresourceresource which should be used (type: Node or StorageVolume)
Returnsdict Node tags (type: dict)
def ex_create_tags(self, resource, tags): (source)
Create tags for a resource (Node or StorageVolume).
ParametersresourceResource to be tagged (type: Node or StorageVolume)
tagsA dictionary or other mapping of strings to strings, associating tag names with tag values. (type: dict)
Returns (type: bool)
def ex_delete_tags(self, resource, tags): (source)
Delete tags from a resource.
ParametersresourceResource to be tagged (type: Node or StorageVolume)
tagsA dictionary or other mapping of strings to strings, specifying the tag names and tag values to be deleted. (type: dict)
Returns (type: bool)
def _add_instance_filter(self, params, node): (source)
Add instance filter to the provided params dictionary.
def ex_describe_all_addresses(self, only_allocated=False): (source)
Return all the Elastic IP addresses for this account optionally, return only the allocated addresses
Parametersonly_allocatedIf true, return only those addresses that are associated with an instance (type: str)
Returnslist list of elastic ips for this particular account. (type: list of str)
def ex_associate_addresses(self, node, elastic_ip_address): (source)
Associate an IP address with a particular node.
ParametersnodeNode instance (type: Node)
elastic_ip_addressIP address which should be used (type: str)
Returns (type: bool)
def ex_describe_addresses(self, nodes): (source)
Return Elastic IP addresses for all the nodes in the provided list.
ParametersnodesList of Node instances (type: list of Node)
ReturnsDictionary where a key is a node ID and the value is a list with the Elastic IP addresses associated with this node. (type: dict)
def ex_describe_addresses_for_node(self, node): (source)
Return a list of Elastic IP addresses associated with this node.
ParametersnodeNode instance (type: Node)
Returnslist Elastic IP addresses attached to this node. (type: list of str)
def ex_modify_instance_attribute(self, node, attributes): (source)
Modify node attributes. A list of valid attributes can be found at http://goo.gl/gxcj8
ParametersnodeNode instance (type: Node)
attributesDictionary with node attributes (type: dict)
ReturnsTrue on success, False otherwise. (type: bool)
def ex_change_node_size(self, node, new_size): (source)
Change the node size. Note: Node must be turned of before changing the size.
ParametersnodeNode instance (type: Node)
new_sizeNodeSize intance (type: NodeSize)
ReturnsTrue on success, False otherwise. (type: bool)
def create_node(self, **kwargs): (source)
Create a new EC2 node

Reference: http://bit.ly/8ZyPSy [docs.amazonwebservices.com]

Parametersex_mincountMinimum number of instances to launch (type: int)
ex_maxcountMaximum number of instances to launch (type: int)
ex_securitygroupName of security group (type: str)
ex_keynameThe name of the key pair (type: str)
ex_userdataUser data (type: str)
ex_clienttokenUnique identifier to ensure idempotency (type: str)
Unknown Field: inheritsNodeDriver.create_node
def reboot_node(self, node): (source)
Reboot a node.
ParametersnodeThe node to be rebooted (type: Node)
ReturnsTrue if the reboot was successful, otherwise False (type: bool)
def ex_start_node(self, node): (source)
Start the node by passing in the node object, does not work with instance store backed instances
ParametersnodeNode which should be used (type: Node)
Returns (type: bool)
def ex_stop_node(self, node): (source)
Stop the node by passing in the node object, does not work with instance store backed instances
ParametersnodeNode which should be used (type: Node)
Returns (type: bool)
def destroy_node(self, node): (source)
Destroy a node.

Depending upon the provider, this may destroy all data associated with the node, including backups.

ParametersnodeThe node to be destroyed (type: Node)
ReturnsTrue if the destroy was successful, otherwise False (type: bool)
API Documentation for libcloud, generated by pydoctor at 2012-07-28 18:57:18.