libcloud.compute.drivers.rimuhosting module

RimuHosting Driver

class libcloud.compute.drivers.rimuhosting.RimuHostingConnection(key, secure=True, retry_delay=None, backoff=None, timeout=None)[source]

Bases: ConnectionKey

Connection class for the RimuHosting driver

Initialize user_id and key; set secure to an int based on passed value.

add_default_headers(headers)[source]

Adds default headers (such as Authorization, X-Foo-Bar) to the passed headers

Should return a dictionary.

api_context = '/r'
host: str = 'rimuhosting.com'
port = 443
request(action, params=None, data='', headers=None, method='GET')[source]

Request a given action.

Basically a wrapper around the connection object’s request that does some helpful pre-processing.

Parameters:
  • action (str) – A path. This can include arguments. If included, any extra parameters are appended to the existing ones.

  • params (dict) – Optional mapping of additional parameters to send. If None, leave as an empty dict.

  • data (unicode) – A body of data to send with the request.

  • headers (dict) – Extra headers to add to the request None, leave as an empty dict.

  • method (str) – An HTTP method such as “GET” or “POST”.

  • raw (bool) – True to perform a “raw” request aka only send the headers and use the rawResponseCls class. This is used with storage API when uploading a file.

  • stream (bool) – True to return an iterator in Response.iter_content and allow streaming of the response data (for downloading large files)

  • retry_failed – True if failed requests should be retried. This argument can override module level constant and environment variable value on per-request basis.

Returns:

An Response instance.

Return type:

Response instance

responseCls

alias of RimuHostingResponse

exception libcloud.compute.drivers.rimuhosting.RimuHostingException[source]

Bases: Exception

Exception class for RimuHosting driver

class libcloud.compute.drivers.rimuhosting.RimuHostingNodeDriver(key, host='rimuhosting.com', port=443, api_context='/r', secure=True)[source]

Bases: NodeDriver

RimuHosting node driver

Parameters:
  • key (str) – API key (required)

  • host (str) – hostname for connection

  • port (int) – Override port used for connections.

  • api_context (str) – Optional API context.

  • secure (bool) – Whether to use HTTPS or HTTP.

Return type:

None

connectionCls

alias of RimuHostingConnection

create_node(name, size, image, auth=None, ex_billing_oid=None, ex_host_server_oid=None, ex_vps_order_oid_to_clone=None, ex_num_ips=1, ex_extra_ip_reason=None, ex_memory_mb=None, ex_disk_space_mb=None, ex_disk_space_2_mb=None, ex_control_panel=None)[source]

Creates a RimuHosting instance

@inherits: NodeDriver.create_node

Parameters:
  • name (str) – Must be a FQDN. e.g example.com.

  • ex_billing_oid (str) – If not set, a billing method is automatically picked.

  • ex_host_server_oid (str) – The host server to set the VPS up on.

  • ex_vps_order_oid_to_clone (str) – Clone another VPS to use as the image for the new VPS.

  • ex_num_ips (int) – Number of IPs to allocate. Defaults to 1.

  • ex_extra_ip_reason (str) – Reason for needing the extra IPs.

  • ex_memory_mb (int) – Memory to allocate to the VPS.

  • ex_disk_space_mb (int) – Diskspace to allocate to the VPS. Defaults to 4096 (4GB).

  • ex_disk_space_2_mb (int) – Secondary disk size allocation. Disabled by default.

  • ex_control_panel (str) – Control panel to install on the VPS.

destroy_node(node)[source]

Destroy a node.

Depending upon the provider, this may destroy all data associated with the node, including backups.

Parameters:

node (Node) – The node to be destroyed

Returns:

True if the destroy was successful, False otherwise.

Return type:

bool

features: Dict[str, List[str]] = {'create_node': ['password']}
List of available features for a driver.
list_images(location=None)[source]

List images on a provider.

Parameters:

location (NodeLocation) – The location at which to list images.

Returns:

list of node image objects.

Return type:

list of NodeImage

list_locations()[source]

List data centers for a provider

Returns:

list of node location objects

Return type:

list of NodeLocation

list_nodes()[source]

List all nodes.

Returns:

list of node objects

Return type:

list of Node

list_sizes(location=None)[source]

List sizes on a provider

Parameters:

location (NodeLocation) – The location at which to list sizes

Returns:

list of node size objects

Return type:

list of NodeSize

name: str = 'RimuHosting'
reboot_node(node)[source]

Reboot a node.

Parameters:

node (Node) – The node to be rebooted

Returns:

True if the reboot was successful, otherwise False

Return type:

bool

type: Provider | str = 'rimuhosting'
website: str = 'http://rimuhosting.com/'
class libcloud.compute.drivers.rimuhosting.RimuHostingResponse(response, connection)[source]

Bases: JsonResponse

Response Class for RimuHosting driver

Parameters:
  • response (httplib.HTTPResponse) – HTTP response object. (optional)

  • connection (Connection) – Parent connection object.

parse_body()[source]

Parse response body.

Override in a provider’s subclass.

Returns:

Parsed body.

Return type:

str

success()[source]

Determine if our request was successful.

The meaning of this can be arbitrary; did we receive OK status? Did the node get created? Were we authenticated?

Return type:

bool

Returns:

True or False