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 rulenode_list (
list
ofstr
) – 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 clienttype (
DimensionDataBackupClientType
) – The type of client that this client isstatus (
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 detailsstorage_policy (
str
) – The storage policy for this client NOTE: Dimension Data only sends back the name of the storage policy, no further detailsdownload_url (
str
) – The download url for this clientalert (
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_FAILUREnotify_list (
list
ofstr
) – 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 jobstatus (
str
) – The status of the job i.e. Waitingpercentage (
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 iRuledescription (
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 backupsservice_plan (
str
) – The service plan for backups. i.e (Essentials)status (
str
) – The overall status this backup target. i.e. (unregistered)clients (
list
ofDimensionDataBackupClient
) – 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 - 6AMdescription (
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 Policyretention_period (
int
) – How long to keep the backup in dayssecondary_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 keyname (
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 keyname (
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_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
orNone
) – Parameters to give to the actiondata (
str
) – The data payload to be added to the requestheaders (
str
ordict
orNone
) – Additional header to be added to the requestmethod (
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
- 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
orlist
) – Either the desired state (str) or a list of statesfunc (
function
) – The function to call, e.g. ex_get_vlan. Note: This function needs to return an object which hasstatus
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 monitorname (
str
) – The name of the monitornode_compatible (
bool
) – Is a monitor capable of monitoring nodespool_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:
id (
str
) – The ID of the iRulename (
str
) – The name of the iRulecompatible_listeners (
list
ofDimensionDataVirtualListenerCompatibility
) – List of compatible Virtual Listener types
- 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 Beginend (
str
) – IP Address endprefixSize (
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 keyname (
str
) – Name of the IP Address Listdescription (
str
) – Description of the IP Address Listip_version (
str
) – IP version. E.g. IPV4, IPV6ip_address_collection (
List
) – Collection of DimensionDataIpAddressstate (
str
) – IP Address list statecreate_time (
date time
) – IP Address List created timechild_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
) – IPv4vlan (class: DimensionDataVlan or
str
) – Network VLANnetwork_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 profilename (
str
) – The name of the profilecompatible_listeners (
list
ofDimensionDataVirtualListenerCompatibility
) – List of compatible Virtual Listener typesfallback_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 poolname (
str
) – The name of the pooldescription (
str
) – Plan text description of the poolstatus (
DimensionDataStatus
) – The status of the poolload_balance_method (
str
) – The load balancer methodhealth_monitor_id (
str
) – The ID of the health monitorservice_down_action (
str
) – Action to take when pool is downslow_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 membername (
str
) – The name of the pool memberstatus (
DimensionDataStatus
) – The status of the poolip (
str
) – The IP of the pool memberport (
int
) – The port of the pool membernode_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 Beginend (
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 keyname (
str
) – Name of the Port Listdescription (
str
) – Description of the Port Listport_collection (
List
) – Collection of DimensionDataPortchild_portlist_list (
List
) – Collection of DimensionDataChildPortstate (
str
) – Port list statecreate_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.
- 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 CPUscores_per_socket (
int
) – The number of cores per socket, the recommendation is 1performance (
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 diskscsi_id (
int
) – Representation for scsisize_gb (
int
) – Size of the diskspeed (
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 Toolsversion_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, ACCOUNTasset_id (
str
) – The GUID of the asset that is taggedasset_name (
str
) – The name of the asset that is taggeddatacenter (
str
) – The short datacenter name of the tagged assetkey (
DimensionDataTagKey
) – The tagged keyvalue (
None
orstr
) – 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 keyname (
str
) – Name of the tag keydescription (
str
) – Description of the tag keyvalue_required (
bool
) – If a value is required for this tag keydisplay_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 nodename (
str
) – The name of the nodestatus (
DimensionDataStatus
) – The status of the nodeip (
str
) – The IP of the nodeconnection_limit (
int
) – The total connection limit for the nodeconnection_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 listenername (
str
) – The name of the listenerstatus (
DimensionDataStatus
) – The status of the listenerip (
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 VLANname (
str
) – The name of the VLANdescription (
str
) – Plan text description of the VLANlocation (
NodeLocation
) – The location (data center) of the VLANnetwork_domain (
DimensionDataNetworkDomain
) – The Network Domain that owns this VLANstatus (
DimensionDataStatus
) – The status of the VLANprivate_ipv4_range_address (
str
) – The host address of the VLAN IP spaceprivate_ipv4_range_size (
int
) – The size (e.g. ‘24’) of the VLAN as a CIDR range sizeipv6_range_address (
str
) – The host address of the VLAN IP spaceipv6_range_size (
int
) – The size (e.g. ‘32’) of the VLAN as a CIDR range sizeipv4_gateway (
str
) – The IPv4 default gateway addressipv6_gateway (
str
) – The IPv6 default gateway address
- 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 forfunc (
function
) – The function to call, e.g. ex_get_vlan. Note: This function needs to return an object which hasstatus
attribute.
- Return type:
str