libcloud.loadbalancer.drivers.dimensiondata module

class libcloud.loadbalancer.drivers.dimensiondata.DimensionDataLBDriver(key, secret=None, secure=True, host=None, port=None, api_version=None, region='dd-na', **kwargs)[source]

Bases: Driver

DimensionData node driver.

Parameters:
  • key (str) – API key or username to be used (required)

  • secret (str) – Secret password to be used (required)

  • secure (bool) – Whether to use HTTPS or HTTP. Note: Some providers only support HTTPS, and it is on by default.

  • host (str) – Override hostname used for connections.

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

  • api_version (str) – Optional API version. Only used by drivers which support multiple API versions.

  • region (str) – Optional driver region. Only used by drivers which support multiple regions.

Return type:

None

api_version = 1.0
balancer_attach_member(balancer, member)[source]

Attach a member to balancer

Parameters:
  • balancer (LoadBalancer) – LoadBalancer which should be used

  • member (Member) – Member to join to the balancer

Returns:

Member after joining the balancer.

Return type:

Member

balancer_detach_member(balancer, member)[source]

Detach member from balancer

Parameters:
  • balancer (LoadBalancer) – LoadBalancer which should be used

  • member (Member) – Member which should be used

Returns:

True if member detach was successful, otherwise False.

Return type:

bool

balancer_list_members(balancer)[source]

Return list of members attached to balancer.

In Dimension Data terminology these are the members of the pools within a virtual listener.

Parameters:

balancer (LoadBalancer) – LoadBalancer which should be used

Return type:

list of Member

connectionCls

alias of DimensionDataConnection

create_balancer(name, port=None, protocol=None, algorithm=None, members=None, ex_listener_ip_address=None)[source]

Create a new load balancer instance

Parameters:
  • name (str) – Name of the new load balancer (required)

  • port (int) – An integer in the range of 1-65535. If not supplied, it will be taken to mean ‘Any Port’

  • protocol (str) – Loadbalancer protocol, defaults to http.

  • members (list of Member) – list of Members to attach to balancer (optional)

  • algorithm (Algorithm) – Load balancing algorithm, defaults to ROUND_ROBIN.

  • ex_listener_ip_address (str) – Must be a valid IPv4 in dot-decimal notation (x.x.x.x).

Return type:

LoadBalancer

destroy_balancer(balancer)[source]

Destroy a load balancer (virtual listener)

Parameters:

balancer (LoadBalancer) – LoadBalancer which should be used

Returns:

True if the destroy was successful, otherwise False.

Return type:

bool

ex_create_node(network_domain_id, name, ip, ex_description, connection_limit=25000, connection_rate_limit=2000)[source]

Create a new node

Parameters:
  • network_domain_id – Network Domain ID (required)

  • name (str) – name of the node (required)

  • ip (str) – IPv4 address of the node (required)

  • ex_description (str) – Description of the node (required)

  • connection_limit (int) – Maximum number of concurrent connections per sec

  • connection_rate_limit (int) – Maximum number of concurrent sessions

Returns:

Instance of DimensionDataVIPNode

Return type:

DimensionDataVIPNode

ex_create_pool(network_domain_id, name, balancer_method, ex_description, health_monitors=None, service_down_action='NONE', slow_ramp_time=30)[source]

Create a new pool

Parameters:
  • network_domain_id – Network Domain ID (required)

  • name (str) – name of the node (required)

  • balancer_method (str) – The load balancer algorithm (required)

  • ex_description (str) – Description of the node (required)

  • health_monitors (list of DimensionDataDefaultHealthMonitor) – A list of health monitors to use for the pool.

  • service_down_action (str) – What to do when node is unavailable NONE, DROP or RESELECT

  • slow_ramp_time (int) – Number of seconds to stagger ramp up of nodes

Returns:

Instance of DimensionDataPool

Return type:

DimensionDataPool

ex_create_pool_member(pool, node, port=None)[source]

Create a new member in an existing pool from an existing node

Parameters:
  • pool (DimensionDataPool) – Instance of DimensionDataPool (required)

  • node (DimensionDataVIPNode) – Instance of DimensionDataVIPNode (required)

  • port (str) – Port the the service will listen on

Returns:

The node member, instance of DimensionDataPoolMember

Return type:

DimensionDataPoolMember

ex_create_virtual_listener(network_domain_id, name, ex_description, port=None, pool=None, listener_ip_address=None, persistence_profile=None, fallback_persistence_profile=None, irule=None, protocol='TCP', connection_limit=25000, connection_rate_limit=2000, source_port_preservation='PRESERVE')[source]

Create a new virtual listener (load balancer)

Parameters:
  • network_domain_id – Network Domain ID (required)

  • name (str) – name of the listener (required)

  • ex_description (str) – Description of the node (required)

  • port (int) – An integer in the range of 1-65535. If not supplied, it will be taken to mean ‘Any Port’

  • pool (DimensionDataPool) – The pool to use for the listener

  • listener_ip_address (str) – The IPv4 Address of the virtual listener

  • persistence_profile (DimensionDataPersistenceProfile) – Persistence profile

  • fallback_persistence_profile (DimensionDataPersistenceProfile) – Fallback persistence profile

  • irule (DimensionDataDefaultiRule) – The iRule to apply

  • protocol (str) – For STANDARD type, ANY, TCP or UDP for PERFORMANCE_LAYER_4 choice of ANY, TCP, UDP, HTTP

  • connection_limit (int) – Maximum number of concurrent connections per sec

  • connection_rate_limit (int) – Maximum number of concurrent sessions

  • source_port_preservation (str) – Choice of PRESERVE, PRESERVE_STRICT or CHANGE

Returns:

Instance of the listener

Return type:

DimensionDataVirtualListener

ex_destroy_node(node_id)[source]

Destroy a specific node

Parameters:

node_id (str) – The ID of of a DimensionDataVIPNode

Returns:

True for success, False for failure

Return type:

bool

ex_destroy_pool(pool)[source]

Destroy an existing pool

Parameters:

pool (DimensionDataPool) – The instance of DimensionDataPool to destroy

Returns:

True for success, False for failure

Return type:

bool

ex_destroy_pool_member(member, destroy_node=False)[source]

Destroy a specific member of a pool

Parameters:
  • pool (DimensionDataPoolMember) – The instance of a pool member

  • destroy_node (bool) – Also destroy the associated node

Returns:

True for success, False for failure

Return type:

bool

ex_get_current_network_domain()[source]

Get the current network domain ID of the driver.

Returns:

ID of the network domain

Return type:

str

ex_get_default_health_monitors(network_domain_id)[source]

Get the default health monitors available for a network domain

Parameters:

network_domain_id (str) – The ID of of a DimensionDataNetworkDomain

Return type:

list of DimensionDataDefaultHealthMonitor

ex_get_default_irules(network_domain_id)[source]

Get the default iRules available for a network domain

Parameters:

network_domain_id (str) – The ID of of a DimensionDataNetworkDomain

Return type:

list of DimensionDataDefaultiRule

ex_get_default_persistence_profiles(network_domain_id)[source]

Get the default persistence profiles available for a network domain

Parameters:

network_domain_id (str) – The ID of of a DimensionDataNetworkDomain

Return type:

list of DimensionDataPersistenceProfile

ex_get_node(node_id)[source]

Get the node specified by node_id

Returns:

Returns an instance of DimensionDataVIPNode

Return type:

Instance of DimensionDataVIPNode

ex_get_nodes(ex_network_domain_id=None)[source]

Get the nodes within this geography or in given network.

Parameters:

ex_network_domain_id (str) – UUID of Network Domain if not None returns only balancers in the given network if None then returns all pools for the organization

Returns:

Returns an list of DimensionDataVIPNode

Return type:

list of DimensionDataVIPNode

ex_get_pool(pool_id)[source]

Get a specific pool inside the current geography

Parameters:

pool_id (str) – The identifier of the pool

Returns:

Returns an instance of DimensionDataPool

Return type:

DimensionDataPool

ex_get_pool_member(pool_member_id)[source]

Get a specific member of a pool

Parameters:

pool (str) – The id of a pool member

Returns:

Returns an instance of DimensionDataPoolMember

Return type:

DimensionDataPoolMember

ex_get_pool_members(pool_id)[source]

Get the members of a pool

Parameters:

pool (DimensionDataPool) – The instance of a pool

Returns:

Returns an list of DimensionDataPoolMember

Return type:

list of DimensionDataPoolMember

ex_get_pools(ex_network_domain_id=None)[source]

Get all of the pools inside the current geography or in given network.

Parameters:

ex_network_domain_id (str) – UUID of Network Domain if not None returns only balancers in the given network if None then returns all pools for the organization

Returns:

Returns a list of type DimensionDataPool

Return type:

list of DimensionDataPool

ex_set_current_network_domain(network_domain_id)[source]

Set the network domain (part of the network) of the driver

Parameters:

network_domain_id (str) – ID of the pool (required)

ex_set_node_state(node, enabled)[source]

Change the state of a node (enable/disable)

Parameters:
  • pool (DimensionDataNode) – The instance of DimensionDataNode to update

  • enabled (bool) – The target state of the node

Returns:

The instance of DimensionDataNode

Return type:

DimensionDataNode

ex_set_pool_member_state(member, enabled=True)[source]
ex_update_node(node)[source]

Update the properties of a node

Parameters:

pool (DimensionDataNode) – The instance of DimensionDataNode to update

Returns:

The instance of DimensionDataNode

Return type:

DimensionDataNode

ex_update_pool(pool)[source]

Update the properties of an existing pool only method, serviceDownAction and slowRampTime are updated

Parameters:

pool (DimensionDataPool) – The instance of DimensionDataPool to update

Returns:

True for success, False for failure

Return type:

bool

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

Wait for the function which returns a instance with field status 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

  • 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

get_balancer(balancer_id)[source]

Return a LoadBalancer object.

Parameters:

balancer_id (str) – id of a load balancer you want to fetch

Return type:

LoadBalancer

list_balancers(ex_network_domain_id=None)[source]

List all loadbalancers inside a geography or in given network.

In Dimension Data terminology these are known as virtual listeners

Parameters:

ex_network_domain_id (str) – UUID of Network Domain if not None returns only balancers in the given network if None then returns all pools for the organization

Return type:

list of LoadBalancer

list_protocols()[source]

Return a list of supported protocols.

Since all protocols are support by Dimension Data, this is a list of common protocols.

Return type:

list of str

name = 'Dimension Data Load Balancer'
network_domain_id = None
selected_region = None
type = 'dimensiondata'
website = 'https://cloud.dimensiondata.com/'