l.c.d.l.LinodeNodeDriver(NodeDriver) : class documentation

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

libcloud driver for the Linode API

Rough mapping of which is which:

    list_nodes              linode.list
    reboot_node             linode.reboot
    destroy_node            linode.delete
    create_node             linode.create, linode.update,
                            linode.disk.createfromdistribution,
                            linode.disk.create, linode.config.create,
                            linode.ip.addprivate, linode.boot
    list_sizes              avail.linodeplans
    list_images             avail.distributions
    list_locations          avail.datacenters

For more information on the Linode API, be sure to read the reference:

    http://www.linode.com/api/
Method __init__ Instantiate the driver with the given API key
Method list_nodes List all Linodes that the API key can access
Method reboot_node Reboot the given Linode
Method destroy_node Destroy the given Linode
Method create_node Create a new Linode, deploy a Linux distribution, and boot
Method list_sizes List available Linode plans
Method list_images List available Linux distributions
Method list_locations List available facilities for deployment
Method linode_set_datacenter Set the default datacenter for Linode creation
Method _to_nodes Convert returned JSON Linodes into Node instances

Inherited from NodeDriver:

Method deploy_node Create a new node, and start deployment.
Method _get_size_price Undocumented
def __init__(self, key): (source)
Instantiate the driver with the given API key

@keyword key: the API key to use
@type key: C{str}
def list_nodes(self): (source)
List all Linodes that the API key can access

This call will return all Linodes that the API key in use has access to.
If a node is in this list, rebooting will work; however, creation and
destruction are a separate grant.

@return: C{list} of L{Node} objects that the API key can access
def reboot_node(self, node): (source)
Reboot the given Linode

Will issue a shutdown job followed by a boot job, using the last booted
configuration.  In most cases, this will be the only configuration.

@keyword node: the Linode to reboot
@type node: L{Node}
def destroy_node(self, node): (source)
Destroy the given Linode

Will remove the Linode from the account and issue a prorated credit. A
grant for removing Linodes from the account is required, otherwise this
method will fail.

In most cases, all disk images must be removed from a Linode before the
Linode can be removed; however, this call explicitly skips those
safeguards.  There is no going back from this method.

@keyword node: the Linode to destroy
@type node: L{Node}
def create_node(self, **kwargs): (source)
Create a new Linode, deploy a Linux distribution, and boot

This call abstracts much of the functionality of provisioning a Linode
and getting it booted.  A global grant to add Linodes to the account is
required, as this call will result in a billing charge.

Note that there is a safety valve of 5 Linodes per hour, in order to
prevent a runaway script from ruining your day.

@keyword name: the name to assign the Linode (mandatory)
@type name: C{str}

@keyword image: which distribution to deploy on the Linode (mandatory)
@type image: L{NodeImage}

@keyword size: the plan size to create (mandatory)
@type size: L{NodeSize}

@keyword auth: an SSH key or root password (mandatory)
@type auth: L{NodeAuthSSHKey} or L{NodeAuthPassword}

@keyword location: which datacenter to create the Linode in
@type location: L{NodeLocation}

@keyword ex_swap: size of the swap partition in MB (128)
@type ex_swap: C{int}

@keyword ex_rsize: size of the root partition in MB (plan size - swap).
@type ex_rsize: C{int}

@keyword ex_kernel: a kernel ID from avail.kernels (Latest 2.6 Stable).
@type ex_kernel: C{str}

@keyword ex_payment: one of 1, 12, or 24; subscription length (1)
@type ex_payment: C{int}

@keyword ex_comment: a small comment for the configuration (libcloud)
@type ex_comment: C{str}

@keyword ex_private: whether or not to request a private IP (False)
@type ex_private: C{bool}

@keyword lconfig: what to call the configuration (generated)
@type lconfig: C{str}

@keyword lroot: what to call the root image (generated)
@type lroot: C{str}

@keyword lswap: what to call the swap space (generated)
@type lswap: C{str}

@return: a L{Node} representing the newly-created Linode
def list_sizes(self, location=None): (source)
List available Linode plans

Gets the sizes that can be used for creating a Linode.  Since available
Linode plans vary per-location, this method can also be passed a
location to filter the availability.

@keyword location: the facility to retrieve plans in
@type location: NodeLocation

@return: a C{list} of L{NodeSize}s
def list_images(self): (source)
List available Linux distributions

Retrieve all Linux distributions that can be deployed to a Linode.

@return: a C{list} of L{NodeImage}s
def list_locations(self): (source)
List available facilities for deployment

Retrieve all facilities that a Linode can be deployed in.

@return: a C{list} of L{NodeLocation}s
def linode_set_datacenter(self, dc): (source)
Set the default datacenter for Linode creation

Since Linodes must be created in a facility, this function sets the
default that L{create_node} will use.  If a C{location} keyword is not
passed to L{create_node}, this method must have already been used.

@keyword dc: the datacenter to create Linodes in unless specified
@type dc: L{NodeLocation}
def _to_nodes(self, objs): (source)
Convert returned JSON Linodes into Node instances

@keyword objs: C{list} of JSON dictionaries representing the Linodes
@type objs: C{list}
@return: C{list} of L{Node}s
API Documentation for libcloud, generated by pydoctor at 2011-07-02 22:19:34.