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

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

Gandi node driver
Method __init__ @keyword key: API key or username to used @type key: str
Method list_nodes List all nodes @return: C{list} of L{Node} objects
Method reboot_node Reboot a node. @return: C{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: C{list} of L{NodeImage} objects
Method list_sizes List sizes on a provider @return: C{list} of L{NodeSize} objects
Method list_locations List data centers for a provider @return: C{list} of L{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 _get_size_price Undocumented
def __init__(self, key, secret=None, secure=False): (source)
@keyword    key:    API key or username to used
@type       key:    str

@keyword    secret: Secret password to be used
@type       secret: str

@keyword    secure: Weither to use HTTPS or HTTP. Note: Some providers
                    only support HTTPS, and it is on by default.
@type       secure: bool

@keyword    host: Override hostname used for connections.
@type       host: str

@keyword    port: Override port used for connections.
@type       port: 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
@return: C{list} of L{Node} objects
def reboot_node(self, node): (source)
Reboot a node.
@return: C{bool} 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.

@return: C{bool} 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 L{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.

@keyword    deploy: Deployment to run once machine is online and availble to SSH.
@type       deploy: L{Deployment}

@keyword    ssh_username: Optional name of the account which is used when connecting to
                          SSH server (default is root)
@type       ssh_username: C{str}

@keyword    ssh_port: Optional SSH server port (default is 22)
@type       ssh_port: C{int}

@keyword    ssh_timeout: Optional SSH connection timeout in seconds
                         (default is None)
@type       ssh_timeout: C{float}

See L{NodeDriver.create_node} for more keyword args.

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

@keyword    name:   String with a name for this new node (required)
@type       name:   str

@keyword    image:  OS Image to boot on node. (required)
@type       image:  L{NodeImage}

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

@keyword    size:   The size of resources allocated to this node.
                    (required)
@type       size:   L{NodeSize}

@keyword    login:  user name to create for login on this machine (required)
@type       login: String

@keyword    password: password for user that'll be created (required)
@type       password: String

@keywork    inet_family: version of ip to use, default 4 (optional)
@type       inet_family: int
def _to_image(self, img): (source)
Undocumented
def list_images(self, location=None): (source)
List images on a provider
@return: C{list} of L{NodeImage} objects
def _to_size(self, id, size): (source)
Undocumented
def list_sizes(self, location=None): (source)
List sizes on a provider
@return: C{list} of L{NodeSize} objects
def _to_loc(self, loc): (source)
Undocumented
def list_locations(self): (source)
List data centers for a provider
@return: C{list} of L{NodeLocation} objects
API Documentation for libcloud, generated by pydoctor at 2011-07-02 22:19:34.