libcloud.common.dimensiondata module

Dimension Data Common Components

exception libcloud.common.dimensiondata.DimensionDataAPIException(code, msg, driver)[source]

Bases: LibcloudError

class libcloud.common.dimensiondata.DimensionDataAccountDetails(user_name, full_name, first_name, last_name, email)[source]

Bases: object

Dimension Data account class details

class libcloud.common.dimensiondata.DimensionDataAntiAffinityRule(id, node_list)[source]

Bases: object

Anti-Affinity rule for DimensionData

An Anti-Affinity rule ensures that servers in the rule will not reside on the same VMware ESX host.

Instantiate a new DimensionDataAntiAffinityRule

Parameters:
  • id (str) – The ID of the Anti-Affinity rule

  • node_list (list of str) – List of node ids that belong in this rule

class libcloud.common.dimensiondata.DimensionDataBackupClient(id, type, status, schedule_policy, storage_policy, download_url, alert=None, running_job=None)[source]

Bases: object

An object that represents a backup client

Initialize an instance of DimensionDataBackupClient

Parameters:
  • id (str) – Unique ID for the client

  • type (DimensionDataBackupClientType) – The type of client that this client is

  • status (str) – The states of this particular backup client. i.e. (Unregistered)

  • schedule_policy (str) – The schedule policy for this client NOTE: Dimension Data only sends back the name of the schedule policy, no further details

  • storage_policy (str) – The storage policy for this client NOTE: Dimension Data only sends back the name of the storage policy, no further details

  • download_url (str) – The download url for this client

  • alert (DimensionDataBackupClientRunningJob) – The alert configured for this backup client (optional)

  • alert – The running job for the client (optional)

class libcloud.common.dimensiondata.DimensionDataBackupClientAlert(trigger, notify_list=[])[source]

Bases: object

An alert for a backup client

Initialize an instance of DimensionDataBackupClientAlert

Parameters:
  • trigger (str) – Trigger type for the client i.e. ON_FAILURE

  • notify_list (list of str) – List of email addresses that are notified when the alert is fired

class libcloud.common.dimensiondata.DimensionDataBackupClientRunningJob(id, status, percentage=0)[source]

Bases: object

A running job for a given backup client

Initialize an instance of DimensionDataBackupClientRunningJob

Parameters:
  • id (str) – The unique ID of the job

  • status (str) – The status of the job i.e. Waiting

  • percentage (int) – The percentage completion of the job

class libcloud.common.dimensiondata.DimensionDataBackupClientType(type, is_file_system, description)[source]

Bases: object

A client type object for backups

Initialize an instance of DimensionDataBackupClientType

Parameters:
  • type (str) – The type of client i.e. (FA.Linux, MySQL, etc.)

  • is_file_system (bool) – The name of the iRule

  • description (str) – Description of the client

class libcloud.common.dimensiondata.DimensionDataBackupDetails(asset_id, service_plan, status, clients=None)[source]

Bases: object

Dimension Data Backup Details represents information about a targets backups configuration

Initialize an instance of DimensionDataBackupDetails

Parameters:
  • asset_id (str) – Asset identification for backups

  • service_plan (str) – The service plan for backups. i.e (Essentials)

  • status (str) – The overall status this backup target. i.e. (unregistered)

  • clients (list of DimensionDataBackupClient) – Backup clients attached to this target

class libcloud.common.dimensiondata.DimensionDataBackupSchedulePolicy(name, description)[source]

Bases: object

A representation of a schedule policy

Initialize an instance of DimensionDataBackupSchedulePolicy

Parameters:
  • name (str) – The name of the policy i.e 12AM - 6AM

  • description (str) – Short summary of the details of the policy

class libcloud.common.dimensiondata.DimensionDataBackupStoragePolicy(name, retention_period, secondary_location)[source]

Bases: object

A representation of a storage policy

Initialize an instance of DimensionDataBackupStoragePolicy

Parameters:
  • name (str) – The name of the storage policy i.e. 14 Day Storage Policy

  • retention_period (int) – How long to keep the backup in days

  • secondary_location (str) – The secondary location i.e. Primary

class libcloud.common.dimensiondata.DimensionDataChildIpAddressList(id, name)[source]

Bases: object

DimensionData Child IP Address list

” Initialize an instance of DimensionDataChildIpAddressList

Parameters:
  • id (str) – GUID of the IP Address List key

  • name (str) – Name of the IP Address List

class libcloud.common.dimensiondata.DimensionDataChildPortList(id, name)[source]

Bases: object

DimensionData Child Port list

” Initialize an instance of DimensionDataChildIpAddressList

Parameters:
  • id (str) – GUID of the child port list key

  • name (str) – Name of the child port List

class libcloud.common.dimensiondata.DimensionDataConnection(user_id, key, secure=True, host=None, port=None, url=None, timeout=None, proxy_url=None, api_version=None, **conn_kwargs)[source]

Bases: ConnectionUserAndKey

Connection class for the DimensionData driver

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

active_api_version = '2.4'
add_default_headers(headers)[source]

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

Should return a dictionary.

allow_insecure = False
api_path_version_1 = '/oec'
api_path_version_2 = '/caas'
api_version_1 = 0.9
get_account_details()[source]

Get the details of this account

Return type:

DimensionDataAccountDetails

get_resource_path_api_1()[source]

This method returns a resource path which is necessary for referencing resources that require a full path instead of just an ID, such as networks, and customer snapshots.

get_resource_path_api_2()[source]

This method returns a resource path which is necessary for referencing resources that require a full path instead of just an ID, such as networks, and customer snapshots.

latest_api_version = '2.4'
oldest_api_version = '2.2'
paginated_request_with_orgId_api_2(action, params=None, data='', headers=None, method='GET', page_size=250)[source]

A paginated request to the MCP2.0 API This essentially calls out to request_with_orgId_api_2 for each page and yields the response to make a generator This generator can be looped through to grab all the pages.

Parameters:
  • action (str) – The resource to access (i.e. ‘network/vlan’)

  • params (dict or None) – Parameters to give to the action

  • data (str) – The data payload to be added to the request

  • headers (str or dict or None) – Additional header to be added to the request

  • method (str) – HTTP Method for the request (i.e. ‘GET’, ‘POST’)

  • page_size (int) – The size of each page to be returned Note: Max page size in MCP2.0 is currently 250

rawResponseCls

alias of DimensionDataRawResponse

raw_request_with_orgId_api_1(action, params=None, data='', headers=None, method='GET')[source]
request_api_1(action, params=None, data='', headers=None, method='GET')[source]
request_api_2(path, action, params=None, data='', headers=None, method='GET')[source]
request_with_orgId_api_1(action, params=None, data='', headers=None, method='GET')[source]
request_with_orgId_api_2(action, params=None, data='', headers=None, method='GET')[source]
responseCls

alias of DimensionDataResponse

wait_for_state(state, func, poll_interval=2, timeout=60, *args, **kwargs)[source]

Wait for the function which returns a instance with field status/state to match.

Keep polling func until one of the desired states is matched

Parameters:
  • state (str or list) – Either the desired state (str) or a list of states

  • func (function) – The function to call, e.g. ex_get_vlan. Note: This function needs to return an object which has status attribute.

  • poll_interval (int) – The number of seconds to wait between checks

  • timeout (int) – The total number of seconds to wait to reach a state

  • args (Positional arguments) – The arguments for func

  • kwargs (Keyword arguments) – The arguments for func

Returns:

Result from the calling function.

class libcloud.common.dimensiondata.DimensionDataDefaultHealthMonitor(id, name, node_compatible, pool_compatible)[source]

Bases: object

A default health monitor for a VIP (node, pool or listener)

Initialize an instance of DimensionDataDefaultHealthMonitor

Parameters:
  • id (str) – The ID of the monitor

  • name (str) – The name of the monitor

  • node_compatible (bool) – Is a monitor capable of monitoring nodes

  • pool_compatible (bool) – Is a monitor capable of monitoring pools

class libcloud.common.dimensiondata.DimensionDataDefaultiRule(id, name, compatible_listeners)[source]

Bases: object

A default iRule for a network domain, can be applied to a listener

Initialize an instance of DimensionDataDefaultiRule

Parameters:
class libcloud.common.dimensiondata.DimensionDataFirewallAddress(any_ip, ip_address, ip_prefix_size, port_begin, port_end, address_list_id, port_list_id)[source]

Bases: object

The source or destination model in a firewall rule

class libcloud.common.dimensiondata.DimensionDataFirewallRule(id, name, action, location, network_domain, status, ip_version, protocol, source, destination, enabled)[source]

Bases: object

DimensionData Firewall Rule for a network domain

class libcloud.common.dimensiondata.DimensionDataIpAddress(begin, end=None, prefix_size=None)[source]

Bases: object

A representation of IP Address in Dimension Data

Initialize an instance of DimensionDataIpAddress

Parameters:
  • begin (str) – IP Address Begin

  • end (str) – IP Address end

  • prefixSize (int) – IP Address prefix size

class libcloud.common.dimensiondata.DimensionDataIpAddressList(id, name, description, ip_version, ip_address_collection, state, create_time, child_ip_address_lists=None)[source]

Bases: object

DimensionData IP Address list

” Initialize an instance of DimensionDataIpAddressList

Parameters:
  • id (str) – GUID of the IP Address List key

  • name (str) – Name of the IP Address List

  • description (str) – Description of the IP Address List

  • ip_version (str) – IP version. E.g. IPV4, IPV6

  • ip_address_collection (List) – Collection of DimensionDataIpAddress

  • state (str) – IP Address list state

  • create_time (date time) – IP Address List created time

  • child_ip_address_lists (List of :class:'DimensionDataIpAddressList') – List of IP address list to be included

class libcloud.common.dimensiondata.DimensionDataNatRule(id, network_domain, internal_ip, external_ip, status)[source]

Bases: object

An IP NAT rule in a network domain

class libcloud.common.dimensiondata.DimensionDataNetwork(id, name, description, location, private_net, multicast, status)[source]

Bases: object

DimensionData network with location.

class libcloud.common.dimensiondata.DimensionDataNetworkDomain(id, name, description, location, status, plan)[source]

Bases: object

DimensionData network domain with location.

class libcloud.common.dimensiondata.DimensionDataNic(private_ip_v4=None, vlan=None, network_adapter_name=None)[source]

Bases: object

A representation of Network Adapter in Dimension Data

Initialize an instance of DimensionDataNic

Parameters:
  • private_ip_v4 (str) – IPv4

  • vlan (class: DimensionDataVlan or str) – Network VLAN

  • network_adapter_name (str) – Network Adapter Name

class libcloud.common.dimensiondata.DimensionDataPersistenceProfile(id, name, compatible_listeners, fallback_compatible)[source]

Bases: object

Each Persistence Profile declares the combination of Virtual Listener type and protocol with which it is compatible and whether or not it is compatible as a Fallback Persistence Profile.

Initialize an instance of DimensionDataPersistenceProfile

Parameters:
  • id (str) – The ID of the profile

  • name (str) – The name of the profile

  • compatible_listeners (list of DimensionDataVirtualListenerCompatibility) – List of compatible Virtual Listener types

  • fallback_compatible (bool) – Is capable as a fallback profile

class libcloud.common.dimensiondata.DimensionDataPool(id, name, description, status, load_balance_method, health_monitor_id, service_down_action, slow_ramp_time)[source]

Bases: object

DimensionData VIP Pool.

Initialize an instance of DimensionDataPool

Parameters:
  • id (str) – The ID of the pool

  • name (str) – The name of the pool

  • description (str) – Plan text description of the pool

  • status (DimensionDataStatus) – The status of the pool

  • load_balance_method (str) – The load balancer method

  • health_monitor_id (str) – The ID of the health monitor

  • service_down_action (str) – Action to take when pool is down

  • slow_ramp_time (int) – The ramp-up time for service recovery

class libcloud.common.dimensiondata.DimensionDataPoolMember(id, name, status, ip, port, node_id)[source]

Bases: object

DimensionData VIP Pool Member.

Initialize an instance of DimensionDataPoolMember

Parameters:
  • id (str) – The ID of the pool member

  • name (str) – The name of the pool member

  • status (DimensionDataStatus) – The status of the pool

  • ip (str) – The IP of the pool member

  • port (int) – The port of the pool member

  • node_id (str) – The ID of the associated node

class libcloud.common.dimensiondata.DimensionDataPort(begin, end=None)[source]

Bases: object

A representation of Port in Dimension Data

Initialize an instance of DimensionDataPort

Parameters:
  • begin (str) – Port Number Begin

  • end (str) – Port Number end

class libcloud.common.dimensiondata.DimensionDataPortList(id, name, description, port_collection, child_portlist_list, state, create_time)[source]

Bases: object

DimensionData Port list

” Initialize an instance of DimensionDataPortList

Parameters:
  • id (str) – GUID of the Port List key

  • name (str) – Name of the Port List

  • description (str) – Description of the Port List

  • port_collection (List) – Collection of DimensionDataPort

  • child_portlist_list (List) – Collection of DimensionDataChildPort

  • state (str) – Port list state

  • create_time (date time) – Port List created time

class libcloud.common.dimensiondata.DimensionDataPublicIpBlock(id, base_ip, size, location, network_domain, status)[source]

Bases: object

DimensionData Public IP Block with location.

class libcloud.common.dimensiondata.DimensionDataRawResponse(connection, response=None)[source]

Bases: RawResponse

Parameters:

connection (Connection) – Parent connection object.

class libcloud.common.dimensiondata.DimensionDataResponse(response, connection)[source]

Bases: XmlResponse

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

  • connection (Connection) – Parent connection object.

parse_error()[source]

Parse the error messages.

Override in a provider’s subclass.

Returns:

Parsed error.

Return type:

str

class libcloud.common.dimensiondata.DimensionDataServerCpuSpecification(cpu_count, cores_per_socket, performance)[source]

Bases: object

A class that represents the specification of the CPU(s) for a node

Instantiate a new DimensionDataServerCpuSpecification

Parameters:
  • cpu_count (int) – The number of CPUs

  • cores_per_socket (int) – The number of cores per socket, the recommendation is 1

  • performance (str) – The performance type, e.g. HIGHPERFORMANCE

class libcloud.common.dimensiondata.DimensionDataServerDisk(id=None, scsi_id=None, size_gb=None, speed=None, state=None)[source]

Bases: object

A class that represents the disk on a server

Instantiate a new DimensionDataServerDisk

Parameters:
  • id (str) – The id of the disk

  • scsi_id (int) – Representation for scsi

  • size_gb (int) – Size of the disk

  • speed (str) – Speed of the disk (i.e. STANDARD)

  • state (str) – State of the disk (i.e. PENDING)

class libcloud.common.dimensiondata.DimensionDataServerVMWareTools(status, version_status, api_version)[source]

Bases: object

A class that represents the VMWareTools for a node

Instantiate a new DimensionDataServerVMWareTools object

Parameters:
  • status (str) – The status of VMWare Tools

  • version_status (str) – The status for the version of VMWare Tools (i.e NEEDS_UPGRADE)

  • api_version (str) – The API version of VMWare Tools

class libcloud.common.dimensiondata.DimensionDataStatus(action=None, request_time=None, user_name=None, number_of_steps=None, update_time=None, step_name=None, step_number=None, step_percent_complete=None, failure_reason=None)[source]

Bases: object

DimensionData API pending operation status class

action, request_time, user_name, number_of_steps, update_time, step.name, step.number, step.percent_complete, failure_reason,

class libcloud.common.dimensiondata.DimensionDataTag(asset_type, asset_id, asset_name, datacenter, key, value)[source]

Bases: object

A representation of a Tag in Dimension Data A Tag first must have a Tag Key, then an asset is tag with a key and an option value. Tags can be queried later to filter assets and also show up on usage report if so desired.

Initialize an instance of DimensionDataTag

Parameters:
  • asset_type (str) – The type of asset. Current asset types: SERVER, VLAN, NETWORK_DOMAIN, CUSTOMER_IMAGE, PUBLIC_IP_BLOCK, ACCOUNT

  • asset_id (str) – The GUID of the asset that is tagged

  • asset_name (str) – The name of the asset that is tagged

  • datacenter (str) – The short datacenter name of the tagged asset

  • key (DimensionDataTagKey) – The tagged key

  • value (None or str) – The tagged value

class libcloud.common.dimensiondata.DimensionDataTagKey(id, name, description, value_required, display_on_report)[source]

Bases: object

A representation of a Tag Key in Dimension Data A tag key is required to tag an asset

Initialize an instance of DimensionDataTagKey

Parameters:
  • id (str) – GUID of the tag key

  • name (str) – Name of the tag key

  • description (str) – Description of the tag key

  • value_required (bool) – If a value is required for this tag key

  • display_on_report (bool) – If this tag key should be displayed on usage reports

class libcloud.common.dimensiondata.DimensionDataVIPNode(id, name, status, ip, connection_limit='10000', connection_rate_limit='10000')[source]

Bases: object

Initialize an instance of DimensionDataVIPNode

Parameters:
  • id (str) – The ID of the node

  • name (str) – The name of the node

  • status (DimensionDataStatus) – The status of the node

  • ip (str) – The IP of the node

  • connection_limit (int) – The total connection limit for the node

  • connection_rate_limit (int) – The rate limit for the node

class libcloud.common.dimensiondata.DimensionDataVirtualListener(id, name, status, ip)[source]

Bases: object

DimensionData Virtual Listener.

Initialize an instance of DimensionDataVirtualListener

Parameters:
  • id (str) – The ID of the listener

  • name (str) – The name of the listener

  • status (DimensionDataStatus) – The status of the listener

  • ip (str) – The IP of the listener

class libcloud.common.dimensiondata.DimensionDataVirtualListenerCompatibility(type, protocol)[source]

Bases: object

A compatibility preference for a persistence profile or iRule specifies which virtual listener types this profile or iRule can be applied to.

class libcloud.common.dimensiondata.DimensionDataVlan(id, name, description, location, network_domain, status, private_ipv4_range_address, private_ipv4_range_size, ipv6_range_address, ipv6_range_size, ipv4_gateway, ipv6_gateway)[source]

Bases: object

DimensionData VLAN.

Initialize an instance of DimensionDataVlan

Parameters:
  • id (str) – The ID of the VLAN

  • name (str) – The name of the VLAN

  • description (str) – Plan text description of the VLAN

  • location (NodeLocation) – The location (data center) of the VLAN

  • network_domain (DimensionDataNetworkDomain) – The Network Domain that owns this VLAN

  • status (DimensionDataStatus) – The status of the VLAN

  • private_ipv4_range_address (str) – The host address of the VLAN IP space

  • private_ipv4_range_size (int) – The size (e.g. ‘24’) of the VLAN as a CIDR range size

  • ipv6_range_address (str) – The host address of the VLAN IP space

  • ipv6_range_size (int) – The size (e.g. ‘32’) of the VLAN as a CIDR range size

  • ipv4_gateway (str) – The IPv4 default gateway address

  • ipv6_gateway (str) – The IPv6 default gateway address

libcloud.common.dimensiondata.LooseVersion(version)[source]
class libcloud.common.dimensiondata.NetworkDomainServicePlan[source]

Bases: object

ADVANCED = 'ADVANCED'
ESSENTIALS = 'ESSENTIALS'
libcloud.common.dimensiondata.dd_object_to_id(obj, obj_type, id_value='id')[source]

Takes in a DD object or string and prints out it’s id This is a helper method, as many of our functions can take either an object or a string, and we need an easy way of converting them

Parameters:
  • obj (object) – The object to get the id for

  • func (function) – The function to call, e.g. ex_get_vlan. Note: This function needs to return an object which has status attribute.

Return type:

str