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

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

Gandi node driver
Method __init__
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 _wait_operation Wait for an operation to succeed
Method _node_info Undocumented
Method _to_node Undocumented
Method _to_nodes Undocumented
Method _to_image Undocumented
Method _to_size Undocumented
Method _to_loc Undocumented

Inherited from NodeDriver:

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
def __init__(self, key, secret=None, secure=False): (source)
ParameterskeyAPI key or username to used (type: str)
secretSecret password to be used (type: str)
secureWeither to use HTTPS or HTTP. Note: Some providers only support HTTPS, and it is on by default. (type: bool)
hostOverride hostname used for connections. (type: str)
portOverride port used for connections. (type: int)
def _wait_operation(self, id, timeout=DEFAULT_TIMEOUT, check_interval=DEFAULT_INTERVAL): (source)
Wait for an operation to succeed
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 this 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
API Documentation for libcloud, generated by pydoctor at 2012-07-15 18:45:14.