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 _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 __init__(self, key): (source)
Instantiate the driver with the given API key
Parameterskeythe API key to use (type: 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.

Returnslist of 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.

Parametersnodethe Linode to reboot (type: 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.

Parametersnodethe Linode to destroy (type: 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.

Parametersnamethe name to assign the Linode (mandatory) (type: str)
imagewhich distribution to deploy on the Linode (mandatory) (type: NodeImage)
sizethe plan size to create (mandatory) (type: NodeSize)
authan SSH key or root password (mandatory) (type: NodeAuthSSHKey or NodeAuthPassword)
locationwhich datacenter to create the Linode in (type: NodeLocation)
ex_swapsize of the swap partition in MB (128) (type: int)
ex_rsizesize of the root partition in MB (plan size - swap). (type: int)
ex_kernela kernel ID from avail.kernels (Latest 2.6 Stable). (type: str)
ex_paymentone of 1, 12, or 24; subscription length (1) (type: int)
ex_commenta small comment for the configuration (libcloud) (type: str)
ex_privatewhether or not to request a private IP (False) (type: bool)
lconfigwhat to call the configuration (generated) (type: str)
lrootwhat to call the root image (generated) (type: str)
lswapwhat to call the swap space (generated) (type: str)
Returnsa 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.

Parameterslocationthe facility to retrieve plans in (type: NodeLocation)
Returnsa list of NodeSizes
def list_images(self): (source)
List available Linux distributions

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

Returnsa list of NodeImages
def list_locations(self): (source)
List available facilities for deployment

Retrieve all facilities that a Linode can be deployed in.

Returnsa list of NodeLocations
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 create_node will use. If a location keyword is not passed to create_node, this method must have already been used.

Parametersdcthe datacenter to create Linodes in unless specified (type: NodeLocation)
def _to_nodes(self, objs): (source)
Convert returned JSON Linodes into Node instances
Parametersobjslist of JSON dictionaries representing the Linodes (type: list)
Returnslist of Nodes
API Documentation for libcloud, generated by pydoctor at 2012-07-15 18:46:59.