l.c.d.g.GandiNodeDriver(BaseGandiDriver, NodeDriver) : class documentation

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

Gandi node driver
Method list_nodes List all nodes @return: list of Node objects
Method reboot_node Reboot a node. @return: bool True if the reboot was successful, otherwise False
Method destroy_node Destroy a node.
Method deploy_node Create a new node, and start deployment.
Method create_node Create a new Gandi node
Method list_images List images on a provider @return: list of NodeImage objects
Method list_sizes List sizes on a provider @return: list of NodeSize objects
Method list_locations List data centers for a provider @return: list of NodeLocation objects
Method ex_list_interfaces Specific method to list network interfaces
Method ex_list_disks Specific method to list all disk
Method ex_node_attach_disk Specific method to attach a disk to a node
Method ex_node_detach_disk Specific method to detach a disk from a node
Method ex_node_attach_interface Specific method to attach an interface to a node
Method ex_node_detach_interface Specific method to detach an interface from a node
Method ex_snapshot_disk Specific method to make a snapshot of a disk
Method ex_update_disk Specific method to update size or name of a disk WARNING: if a server is attached it'll be rebooted
Method _node_info Undocumented
Method _to_node Undocumented
Method _to_nodes Undocumented
Method _to_image Undocumented
Method _to_size Undocumented
Method _to_loc Undocumented
Method _to_iface Undocumented
Method _to_ifaces Undocumented
Method _to_disk Undocumented
Method _to_disks Undocumented

Inherited from BaseGandiDriver:

Method __init__ Undocumented
Method _wait_operation Wait for an operation to succeed

Inherited from NodeDriver:

Method __init__
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 _node_info(self, id): (source)
Undocumented
def _to_node(self, vm): (source)
Undocumented
def _to_nodes(self, vms): (source)
Undocumented
def list_nodes(self): (source)
List all nodes
Returnslist of Node objects
def reboot_node(self, node): (source)
Reboot a node.
Returnsbool True if the reboot was successful, otherwise False
def destroy_node(self, node): (source)
Destroy a node.

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

Returnsbool True if the destroy was successful, otherwise False
def deploy_node(self, **kwargs): (source)
Create a new node, and start deployment.

Depends on a Provider Driver supporting either using a specific password or returning a generated password.

This function may raise a 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.

ParametersdeployDeployment to run once machine is online and availble to SSH. (type: Deployment)
ssh_usernameOptional name of the account which is used when connecting to SSH server (default is root) (type: str)
ssh_portOptional SSH server port (default is 22) (type: int)
ssh_timeoutOptional SSH connection timeout in seconds (default is None) (type: float)
authInitial authentication information for the node (optional) (type: NodeAuthSSHKey or NodeAuthPassword

See NodeDriver.create_node for more keyword args.

>>> from libcloud.compute.drivers.dummy import DummyNodeDriver
>>> from libcloud.deployment import ScriptDeployment
>>> from libcloud.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:
...         node = 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.

)
def create_node(self, **kwargs): (source)
Create a new Gandi node
ParametersnameString with a name for this new node (required) (type: str)
imageOS Image to boot on node. (required) (type: NodeImage)
locationWhich data center to create a node in. If empty, undefined behavoir will be selected. (optional) (type: NodeLocation)
sizeThe size of resources allocated to this node. (required) (type: NodeSize)
loginuser name to create for login on machine (required) (type: String)
passwordpassword for user that'll be created (required) (type: String)
Unknown Field: keyworkinet_familyversion of ip to use, default 4 (optional)
def _to_image(self, img): (source)
Undocumented
def list_images(self, location=None): (source)
List images on a provider
Returnslist of NodeImage objects
def _to_size(self, id, size): (source)
Undocumented
def list_sizes(self, location=None): (source)
List sizes on a provider
Returnslist of NodeSize objects
def _to_loc(self, loc): (source)
Undocumented
def list_locations(self): (source)
List data centers for a provider
Returnslist of NodeLocation objects
def _to_iface(self, iface): (source)
Undocumented
def _to_ifaces(self, ifaces): (source)
Undocumented
def ex_list_interfaces(self): (source)
Specific method to list network interfaces
def _to_disk(self, element): (source)
Undocumented
def _to_disks(self, elements): (source)
Undocumented
def ex_list_disks(self): (source)
Specific method to list all disk
def ex_node_attach_disk(self, node, disk): (source)
Specific method to attach a disk to a node
def ex_node_detach_disk(self, node, disk): (source)
Specific method to detach a disk from a node
def ex_node_attach_interface(self, node, iface): (source)
Specific method to attach an interface to a node
def ex_node_detach_interface(self, node, iface): (source)
Specific method to detach an interface from a node
def ex_snapshot_disk(self, disk, name=None): (source)
Specific method to make a snapshot of a disk
def ex_update_disk(self, disk, new_size=None, new_name=None): (source)
Specific method to update size or name of a disk WARNING: if a server is attached it'll be rebooted
API Documentation for libcloud, generated by pydoctor at 2012-07-15 18:45:43.