Part of libcloud.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. |
Parameters | key | the API key to use (type: str ) |
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.
Returns | list of Node objects that the API
key can access |
Will issue a shutdown job followed by a boot job, using the last booted configuration. In most cases, this will be the only configuration.
Parameters | node | the Linode to reboot (type: Node ) |
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.
Parameters | node | the Linode to destroy (type: Node ) |
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.
Parameters | name | the name to assign the Linode (mandatory) (type: str ) |
image | which distribution to deploy on the Linode (mandatory) (type: NodeImage ) | |
size | the plan size to create (mandatory) (type: NodeSize ) | |
auth | an SSH key or root password (mandatory) (type: NodeAuthSSHKey
or NodeAuthPassword ) | |
location | which datacenter to create the Linode in (type: NodeLocation ) | |
ex_swap | size of the swap partition in MB (128) (type: int ) | |
ex_rsize | size of the root partition in MB (plan size - swap). (type: int ) | |
ex_kernel | a kernel ID from avail.kernels (Latest 2.6 Stable). (type: str ) | |
ex_payment | one of 1, 12, or 24; subscription length (1) (type: int ) | |
ex_comment | a small comment for the configuration (libcloud) (type: str ) | |
ex_private | whether or not to request a private IP (False) (type: bool ) | |
lconfig | what to call the configuration (generated) (type: str ) | |
lroot | what to call the root image (generated) (type: str ) | |
lswap | what to call the swap space (generated) (type: str ) | |
Returns | a Node representing the
newly-created Linode |
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.
Parameters | location | the facility to retrieve plans in (type: NodeLocation) |
Returns | a list of NodeSize s |
Retrieve all Linux distributions that can be deployed to a Linode.
Returns | a list of NodeImage s |
Retrieve all facilities that a Linode can be deployed in.
Returns | a list of NodeLocation s |
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.
Parameters | dc | the datacenter to create Linodes in unless specified (type: NodeLocation ) |