libcloud.loadbalancer.drivers package

Submodules

libcloud.loadbalancer.drivers.brightbox module

class libcloud.loadbalancer.drivers.brightbox.BrightboxLBDriver(key, secret=None, secure=True, host=None, port=None, **kwargs)[source]

Bases: libcloud.loadbalancer.base.Driver

LB_STATE_MAP = {'creating': 1, 'deleted': 2, 'failing': 2, 'failed': 2, 'active': 0, 'deleting': 2}
balancer_attach_compute_node(balancer, node)[source]
balancer_attach_member(balancer, member)[source]
balancer_detach_member(balancer, member)[source]
balancer_list_members(balancer)[source]
connectionCls

alias of BrightboxConnection

create_balancer(name, port, protocol, algorithm, members)[source]
destroy_balancer(balancer)[source]
get_balancer(balancer_id)[source]
list_balancers()[source]
list_protocols()[source]
name = 'Brightbox'
website = 'http://www.brightbox.co.uk/'

libcloud.loadbalancer.drivers.cloudstack module

class libcloud.loadbalancer.drivers.cloudstack.CloudStackLBDriver(key, secret=None, secure=True, host=None, path=None, port=None, *args, **kwargs)[source]

Bases: libcloud.common.cloudstack.CloudStackDriverMixIn, libcloud.loadbalancer.base.Driver

Driver for CloudStack load balancers.

@inherits: Driver.__init__

LB_STATE_MAP = {'Active': 0}
api_name = 'cloudstack_lb'
balancer_attach_member(balancer, member)[source]
balancer_detach_member(balancer, member)[source]
balancer_list_members(balancer)[source]
create_balancer(name, members, protocol='http', port=80, algorithm=1, location=None, private_port=None, network_id=None, vpc_id=None)[source]

@inherits: Driver.create_balancer

Parameters:
  • location (NodeLocation) – Location
  • private_port (int) – Private port
  • network_id (str) – The guest network this rule will be created for.
destroy_balancer(balancer)[source]
get_balancer(balancer_id)[source]
list_balancers()[source]
list_protocols()[source]

We don’t actually have any protocol awareness beyond TCP.

Return type:list of str
name = 'CloudStack'
type = 'cloudstack'
website = 'http://cloudstack.org/'

libcloud.loadbalancer.drivers.elb module

class libcloud.loadbalancer.drivers.elb.ElasticLBDriver(access_id, secret, region)[source]

Bases: libcloud.loadbalancer.base.Driver

balancer_attach_compute_node(balancer, node)[source]
balancer_detach_member(balancer, member)[source]
balancer_list_members(balancer)[source]
connectionCls

alias of ELBConnection

create_balancer(name, port, protocol, algorithm, members, ex_members_availability_zones=None)[source]
destroy_balancer(balancer)[source]
ex_create_balancer_listeners(name, listeners=None)[source]

Creates one or more listeners on a load balancer for the specified port

Parameters:
  • name (str) – The mnemonic name associated with the load balancer
  • listeners (``list of tuple`) – Each tuple contain values, (LoadBalancerPortNumber, InstancePortNumber, Protocol,[SSLCertificateId])
ex_create_balancer_policy(name, policy_name, policy_type, policy_attributes=None)[source]

Create a new load balancer policy

Parameters:
  • name (str) – Balancer name to create the policy for
  • policy_name (str) – policy to be created
  • policy_type (str) – policy type being used to create policy.
  • policy_attributes (PolicyAttribute list) – Each list contain values, [‘AttributeName’, ‘value’]
ex_delete_balancer_policy(name, policy_name)[source]

Delete a load balancer policy

Parameters:
  • name (str) – balancer name for which policy will be deleted
  • policy_name (str) – The Mnemonic name for the policy being deleted
ex_list_balancer_policies(balancer)[source]

Return a list of policy description string.

Return type:list of str
ex_list_balancer_policy_types()[source]

Return a list of policy type description string.

Return type:list of str
ex_set_balancer_policies_backend_server(name, instance_port, policies)[source]

Replaces the current set of policies associated with a port on which the back-end server is listening with a new set of policies

Parameters:
  • name (str) – balancer name to set policies of backend server
  • instance_port (int) – Instance Port
  • policies (``string list`) – List of policies to be associated with the balancer
ex_set_balancer_policies_listener(name, port, policies)[source]

Associates, updates, or disables a policy with a listener on the load balancer

Parameters:
  • name (str) – balancer name to set policies for listerner
  • port (str) – port to use
  • policies (string list) – List of policies to be associated with the balancer
get_balancer(balancer_id)[source]
list_balancers()[source]
list_protocols()[source]
name = 'Amazon Elastic Load Balancing'
website = 'http://aws.amazon.com/elasticloadbalancing/'

libcloud.loadbalancer.drivers.gce module

class libcloud.loadbalancer.drivers.gce.GCELBDriver(*args, **kwargs)[source]

Bases: libcloud.loadbalancer.base.Driver

apiname = 'googleapis'
balancer_attach_compute_node(balancer, node)[source]

Attach a compute node as a member to the load balancer.

Parameters:
  • balancer (LoadBalancer) – LoadBalancer which should be used
  • node (Node) – Node to join to the balancer
Returns:

Member after joining the balancer.

Return type:

Member

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

Parameters:balancer (LoadBalancer) – LoadBalancer which should be used
Return type:list of Member
connectionCls

alias of GCEConnection

create_balancer(name, port, protocol, algorithm, members, ex_region=None, ex_healthchecks=None, ex_address=None, ex_session_affinity=None)[source]

Create a new load balancer instance.

For GCE, this means creating a forwarding rule and a matching target pool, then adding the members to the target pool.

Parameters:
  • name (str) – Name of the new load balancer (required)
  • port (str) – Port or range of ports the load balancer should listen on, defaults to all ports. Examples: ‘80’, ‘5000-5999’
  • protocol (str) – Load balancer protocol. Should be ‘tcp’ or ‘udp’, defaults to ‘tcp’.
  • members (list of Member or Node) – List of Members to attach to balancer. Can be Member objects or Node objects. Node objects are preferred for GCE, but Member objects are accepted to comply with the established libcloud API. Note that the ‘port’ attribute of the members is ignored.
  • algorithm (Algorithm or None) – Load balancing algorithm. Ignored for GCE which uses a hashing-based algorithm.
  • ex_region (C{GCERegion} or str) – Optional region to create the load balancer in. Defaults to the default region of the GCE Node Driver.
  • ex_healthchecks (list of GCEHealthCheck or list of str) – Optional list of healthcheck objects or names to add to the load balancer.
  • ex_address (C{GCEAddress}) – Optional static address object to be assigned to the load balancer.
  • ex_session_affinity (str) – Optional algorithm to use for session affinity. This will modify the hashing algorithm such that a client will tend to stick to a particular Member.
Returns:

LoadBalancer object

Return type:

LoadBalancer

destroy_balancer(balancer)[source]

Destroy a load balancer.

For GCE, this means destroying the associated forwarding rule, then destroying the target pool that was attached to the forwarding rule.

Parameters:balancer (LoadBalancer) – LoadBalancer which should be used
Returns:True if successful
Return type:bool
ex_balancer_attach_healthcheck(balancer, healthcheck)[source]

Attach a healthcheck to balancer

Parameters:
  • balancer (LoadBalancer) – LoadBalancer which should be used
  • healthcheck (GCEHealthCheck) – Healthcheck to add
Returns:

True if successful

Return type:

bool

ex_balancer_detach_healthcheck(balancer, healthcheck)[source]

Detach healtcheck from balancer

Parameters:
  • balancer (LoadBalancer) – LoadBalancer which should be used
  • healthcheck (GCEHealthCheck) – Healthcheck to remove
Returns:

True if successful

Return type:

bool

ex_balancer_list_healthchecks(balancer)[source]

Return list of healthchecks attached to balancer

Parameters:balancer (LoadBalancer) – LoadBalancer which should be used
Return type:list of HealthChecks
ex_create_healthcheck(*args, **kwargs)[source]
ex_list_healthchecks()[source]
get_balancer(balancer_id)[source]

Return a LoadBalancer object.

Parameters:
  • balancer_id – Name of load balancer you wish to fetch. For GCE, this is the name of the associated forwarding rule.
  • balancer_idstr
Return type:

LoadBalancer

list_balancers(ex_region=None)[source]

List all loadbalancers

Parameters:ex_region (str or GCERegion or None) – The region to return balancers from. If None, will default to self.region. If ‘all’, will return all balancers.
Return type:list of LoadBalancer
list_protocols()[source]

Return a list of supported protocols.

For GCE, this is simply a hardcoded list.

Return type:list of str
name = 'Google Compute Engine Load Balancer'
website = 'https://cloud.google.com/'

libcloud.loadbalancer.drivers.gogrid module

class libcloud.loadbalancer.drivers.gogrid.GoGridLBConnection(user_id, key, secure=True, host=None, port=None, url=None, timeout=None, proxy_url=None)[source]

Bases: libcloud.common.gogrid.GoGridConnection

Connection class for the GoGrid load-balancer driver.

responseCls

alias of GoGridLBResponse

class libcloud.loadbalancer.drivers.gogrid.GoGridLBDriver(*args, **kwargs)[source]

Bases: libcloud.common.gogrid.BaseGoGridDriver, libcloud.loadbalancer.base.Driver

@inherits: Driver.__init__

LB_STATE_MAP = {'On': 0, 'Unknown': 2}
api_name = 'gogrid_lb'
balancer_attach_member(balancer, member)[source]
balancer_detach_member(balancer, member)[source]
balancer_list_members(balancer)[source]
connectionCls

alias of GoGridLBConnection

create_balancer(name, members, protocol='http', port=80, algorithm=1)[source]
destroy_balancer(balancer)[source]
ex_create_balancer_nowait(name, members, protocol='http', port=80, algorithm=1)[source]

@inherits: Driver.create_balancer

get_balancer(**kwargs)[source]
list_balancers()[source]
list_protocols()[source]
name = 'GoGrid LB'
website = 'http://www.gogrid.com/'
class libcloud.loadbalancer.drivers.gogrid.GoGridLBResponse(*args, **kwargs)[source]

Bases: libcloud.common.gogrid.GoGridResponse

success()[source]

libcloud.loadbalancer.drivers.ninefold module

class libcloud.loadbalancer.drivers.ninefold.NinefoldLBDriver(key, secret=None, secure=True, host=None, path=None, port=None, *args, **kwargs)[source]

Bases: libcloud.loadbalancer.drivers.cloudstack.CloudStackLBDriver

Driver for load balancers on Ninefold’s Compute platform.

@inherits: Driver.__init__

host = 'api.ninefold.com'
name = 'Ninefold LB'
path = '/compute/v1.0/'
type = 'ninefold'
website = 'http://ninefold.com/'

libcloud.loadbalancer.drivers.rackspace module

class libcloud.loadbalancer.drivers.rackspace.RackspaceAccessRule(id=None, rule_type=None, address=None)[source]

Bases: object

An access rule allows or denies traffic to a Load Balancer based on the incoming IPs.

Parameters:
  • id (int) – Unique identifier to refer to this rule by.
  • rule_type – RackspaceAccessRuleType.ALLOW or RackspaceAccessRuleType.DENY.
  • address (str) – IP address or cidr (can be IPv4 or IPv6).
class libcloud.loadbalancer.drivers.rackspace.RackspaceAccessRuleType[source]

Bases: object

ALLOW = 0
DENY = 1
class libcloud.loadbalancer.drivers.rackspace.RackspaceConnection(*args, **kwargs)[source]

Bases: libcloud.compute.drivers.rackspace.RackspaceConnection, libcloud.common.base.PollingConnection

auth_url = 'https://auth.api.rackspacecloud.com'
cache_busting = True
encode_data(data)[source]
get_poll_request_kwargs(response, context, request_kwargs)[source]
has_completed(response)[source]
poll_interval = 2
request(action, params=None, data='', headers=None, method='GET')[source]
responseCls

alias of RackspaceResponse

timeout = 80
class libcloud.loadbalancer.drivers.rackspace.RackspaceConnectionThrottle(min_connections, max_connections, max_connection_rate, rate_interval_seconds)[source]

Bases: object

Parameters:
  • min_connections (int) – Minimum number of connections per IP address before applying throttling.
  • max_connections (int) – Maximum number of connections per IP address. (Must be between 0 and 100000, 0 allows an unlimited number of connections.)
  • max_connection_rate (int) – Maximum number of connections allowed from a single IP address within the given rate_interval_seconds. (Must be between 0 and 100000, 0 allows an unlimited number of connections.)
  • rate_interval_seconds (int) – Interval at which the max_connection_rate is enforced. (Must be between 1 and 3600.)
class libcloud.loadbalancer.drivers.rackspace.RackspaceHTTPHealthMonitor(type, delay, timeout, attempts_before_deactivation, path, body_regex, status_regex)[source]

Bases: libcloud.loadbalancer.drivers.rackspace.RackspaceHealthMonitor

A HTTP health monitor adds extra features to a Rackspace health monitor.

Parameters:
  • path (str) – the HTTP path to monitor.
  • body_regex (str) – Regular expression used to evaluate the body of the HTTP response.
  • status_regex (str) – Regular expression used to evaluate the HTTP status code of the response.
class libcloud.loadbalancer.drivers.rackspace.RackspaceHealthMonitor(type, delay, timeout, attempts_before_deactivation)[source]

Bases: object

Parameters:
  • type (str) – type of load balancer. currently CONNECT (connection monitoring), HTTP, HTTPS (connection and HTTP monitoring) are supported.
  • delay (int) – minimum seconds to wait before executing the health monitor. (Must be between 1 and 3600)
  • timeout (int) – maximum seconds to wait when establishing a connection before timing out. (Must be between 1 and 3600)
  • attempts_before_deactivation (int) – Number of monitor failures before removing a node from rotation. (Must be between 1 and 10)
class libcloud.loadbalancer.drivers.rackspace.RackspaceLBDriver(key, secret=None, secure=True, host=None, port=None, region='ord', **kwargs)[source]

Bases: libcloud.loadbalancer.base.Driver, libcloud.common.openstack.OpenStackDriverMixin

CONDITION_LB_MEMBER_MAP = {0: 'ENABLED', 1: 'DISABLED', 2: 'DRAINING'}
LB_MEMBER_CONDITION_MAP = {'DISABLED': 1, 'DRAINING': 2, 'ENABLED': 0}
LB_STATE_MAP = {'PENDING_DELETE': 1, 'DELETED': 4, 'PENDING_UPDATE': 1, 'BUILD': 1, 'ERROR': 3, 'ACTIVE': 0}
api_name = 'rackspace_lb'
balancer_attach_member(balancer, member)[source]
balancer_detach_member(balancer, member)[source]
balancer_list_members(balancer)[source]
connectionCls

alias of RackspaceConnection

create_balancer(name, members, protocol='http', port=80, algorithm=1)[source]
destroy_balancer(balancer)[source]
ex_balancer_access_list(balancer)[source]

List the access list.

Parameters:balancer (LoadBalancer) – Balancer which should be used
Return type:list of RackspaceAccessRule
ex_balancer_attach_members(balancer, members)[source]

Attaches a list of members to a load balancer.

Parameters:
  • balancer (LoadBalancer) – The Balancer to which members will be attached.
  • members (list of Member) – A list of Members to attach.
Return type:

list of Member

ex_balancer_detach_members(balancer, members)[source]

Detaches a list of members from a balancer (the API supports up to 10). This method blocks until the detach request has been processed and the balancer is in a RUNNING state again.

Parameters:
  • balancer (LoadBalancer) – The Balancer to detach members from.
  • members (list of Member) – A list of Members to detach.
Returns:

Updated Balancer.

Return type:

LoadBalancer

ex_balancer_detach_members_no_poll(balancer, members)[source]

Detaches a list of members from a balancer (the API supports up to 10). This method returns immediately.

Parameters:
  • balancer (LoadBalancer) – The Balancer to detach members from.
  • members (list of Member) – A list of Members to detach.
Returns:

Returns whether the detach request was accepted.

Return type:

bool

ex_balancer_update_member(balancer, member, **kwargs)[source]

Updates a Member’s extra attributes for a Balancer. The attributes can include ‘weight’ or ‘condition’. This method blocks until the update request has been processed and the balancer is in a RUNNING state again.

Parameters:
  • balancer (LoadBalancer) – Balancer to update the member on.
  • member (Member) – Member which should be used
  • **kwargs

    New attributes. Should contain either ‘weight’

or ‘condition’. ‘condition’ can be set to ‘ENABLED’, ‘DISABLED’. or ‘DRAINING’. ‘weight’ can be set to a positive integer between 1 and 100, with a higher weight indicating that the node will receive more traffic (assuming the Balancer is using a weighted algorithm). :type **kwargs: dict

Returns:Updated Member.
Return type:Member
ex_balancer_update_member_no_poll(balancer, member, **kwargs)[source]

Updates a Member’s extra attributes for a Balancer. The attribute can include ‘weight’ or ‘condition’. This method returns immediately.

Parameters:
  • balancer (LoadBalancer) – Balancer to update the member on.
  • member (Member) – Member which should be used
  • **kwargs

    New attributes. Should contain either ‘weight’

or ‘condition’. ‘condition’ can be set to ‘ENABLED’, ‘DISABLED’. or ‘DRAINING’. ‘weight’ can be set to a positive integer between 1 and 100, with a higher weight indicating that the node will receive more traffic (assuming the Balancer is using a weighted algorithm). :type **kwargs: dict

Returns:Returns whether the update request was accepted.
Return type:bool
ex_create_balancer(name, members, protocol='http', port=80, algorithm=1, vip='PUBLIC')[source]

Creates a new load balancer instance

Parameters:
  • name (str) – Name of the new load balancer (required)
  • members (list of Member) – list of:class:`Member`s to attach to balancer
  • protocol (str) – Loadbalancer protocol, defaults to http.
  • port (str) – Port the load balancer should listen on, defaults to 80
  • algorithm (Algorithm) – Load balancing algorithm, defaults to LBAlgorithm.ROUND_ROBIN
  • vip (str) – Virtual ip type of PUBLIC, SERVICENET, or ID of a virtual ip
Return type:

LoadBalancer

ex_create_balancer_access_rule(balancer, rule)[source]

Adds an access rule to a Balancer’s access list. This method blocks until the update request has been processed and the balancer is in a RUNNING state again.

Parameters:
  • balancer (LoadBalancer) – Balancer to create the access rule for.
  • rule (RackspaceAccessRule) – Access Rule to add to the balancer.
Returns:

The created access rule.

Return type:

RackspaceAccessRule

ex_create_balancer_access_rule_no_poll(balancer, rule)[source]

Adds an access rule to a Balancer’s access list. This method returns immediately.

Parameters:
  • balancer (LoadBalancer) – Balancer to create the access rule for.
  • rule (RackspaceAccessRule) – Access Rule to add to the balancer.
Returns:

Returns whether the create request was accepted.

Return type:

bool

ex_create_balancer_access_rules(balancer, rules)[source]

Adds a list of access rules to a Balancer’s access list. This method blocks until the update request has been processed and the balancer is in a RUNNING state again.

Parameters:
Returns:

The created access rules.

Return type:

RackspaceAccessRule

ex_create_balancer_access_rules_no_poll(balancer, rules)[source]

Adds a list of access rules to a Balancer’s access list. This method returns immediately.

Parameters:
Returns:

Returns whether the create request was accepted.

Return type:

bool

ex_destroy_balancer_access_rule(balancer, rule)[source]

Removes an access rule from a Balancer’s access list. This method blocks until the update request has been processed and the balancer is in a RUNNING state again.

Parameters:
  • balancer (LoadBalancer) – Balancer to remove the access rule from.
  • rule (RackspaceAccessRule) – Access Rule to remove from the balancer.
Returns:

Updated Balancer.

Return type:

LoadBalancer

ex_destroy_balancer_access_rule_no_poll(balancer, rule)[source]

Removes an access rule from a Balancer’s access list. This method returns immediately.

Parameters:
  • balancer (LoadBalancer) – Balancer to remove the access rule from.
  • rule (RackspaceAccessRule) – Access Rule to remove from the balancer.
Returns:

Returns whether the destroy request was accepted.

Return type:

bool

ex_destroy_balancer_access_rules(balancer, rules)[source]

Removes a list of access rules from a Balancer’s access list. This method blocks until the update request has been processed and the balancer is in a RUNNING state again.

Parameters:
Returns:

Updated Balancer.

Return type:

LoadBalancer

ex_destroy_balancer_access_rules_no_poll(balancer, rules)[source]

Removes a list of access rules from a Balancer’s access list. This method returns immediately.

Parameters:
Returns:

Returns whether the destroy request was accepted.

Return type:

bool

ex_destroy_balancers(balancers)[source]

Destroys a list of Balancers (the API supports up to 10).

Parameters:balancers (list of LoadBalancer) – A list of Balancers to destroy.
Returns:Returns whether the destroy request was accepted.
Return type:bool
ex_disable_balancer_connection_logging(balancer)[source]

Disables connection logging for a Balancer. This method blocks until the enable request has been processed and the balancer is in a RUNNING state again.

Parameters:balancer (LoadBalancer) – Balancer to disable connection logging on.
Returns:Updated Balancer.
Return type:LoadBalancer
ex_disable_balancer_connection_logging_no_poll(balancer)[source]

Disables connection logging for a Balancer. This method returns immediately.

Parameters:balancer (LoadBalancer) – Balancer to disable connection logging on.
Returns:Returns whether the disable request was accepted.
Return type:bool
ex_disable_balancer_connection_throttle(balancer)[source]

Disables a Balancer’s connection throttle. This method blocks until the disable request has been processed and the balancer is in a RUNNING state again.

Parameters:balancer (LoadBalancer) – Balancer to disable connection throttle on.
Returns:Updated Balancer.
Return type:LoadBalancer
ex_disable_balancer_connection_throttle_no_poll(balancer)[source]

Disables a Balancer’s connection throttle. This method returns immediately.

Parameters:balancer (LoadBalancer) – Balancer to disable connection throttle on.
Returns:Returns whether the disable request was accepted.
Return type:bool
ex_disable_balancer_custom_error_page(balancer)[source]

Disables a Balancer’s custom error page, returning its error page to the Rackspace-provided default. This method blocks until the disable request has been processed and the balancer is in a RUNNING state again.

Parameters:balancer (LoadBalancer) – Balancer to disable the custom error page for.
Returns:Updated Balancer.
Return type:LoadBalancer
ex_disable_balancer_custom_error_page_no_poll(balancer)[source]

Disables a Balancer’s custom error page, returning its error page to the Rackspace-provided default. This method returns immediately.

Parameters:balancer (LoadBalancer) – Balancer to disable the custom error page for.
Returns:Returns whether the disable request was accepted.
Return type:bool
ex_disable_balancer_health_monitor(balancer)[source]

Disables a Balancer’s health monitor. This method blocks until the disable request has been processed and the balancer is in a RUNNING state again.

Parameters:balancer (LoadBalancer) – Balancer to disable health monitor on.
Returns:Updated Balancer.
Return type:LoadBalancer
ex_disable_balancer_health_monitor_no_poll(balancer)[source]

Disables a Balancer’s health monitor. This method returns immediately.

Parameters:balancer (LoadBalancer) – Balancer to disable health monitor on.
Returns:Returns whether the disable request was accepted.
Return type:bool
ex_disable_balancer_session_persistence(balancer)[source]

Disables session persistence for a Balancer. This method blocks until the disable request has been processed and the balancer is in a RUNNING state again.

Parameters:balancer (LoadBalancer) – Balancer to disable session persistence on.
Returns:Updated Balancer.
Return type:LoadBalancer
ex_disable_balancer_session_persistence_no_poll(balancer)[source]

Disables session persistence for a Balancer. This method returns immediately.

Parameters:balancer (LoadBalancer) – Balancer to disable session persistence for.
Returns:Returns whether the disable request was accepted.
Return type:bool
ex_enable_balancer_connection_logging(balancer)[source]

Enables connection logging for a Balancer. This method blocks until the enable request has been processed and the balancer is in a RUNNING state again.

Parameters:balancer (LoadBalancer) – Balancer to enable connection logging on.
Returns:Updated Balancer.
Return type:LoadBalancer
ex_enable_balancer_connection_logging_no_poll(balancer)[source]

Enables connection logging for a Balancer. This method returns immediately.

Parameters:balancer (LoadBalancer) – Balancer to enable connection logging on.
Returns:Returns whether the enable request was accepted.
Return type:bool
ex_enable_balancer_session_persistence(balancer)[source]

Enables session persistence for a Balancer by setting the persistence type to ‘HTTP_COOKIE’. This method blocks until the enable request has been processed and the balancer is in a RUNNING state again.

Parameters:balancer (LoadBalancer) – Balancer to enable session persistence on.
Returns:Updated Balancer.
Return type:LoadBalancer
ex_enable_balancer_session_persistence_no_poll(balancer)[source]

Enables session persistence for a Balancer by setting the persistence type to ‘HTTP_COOKIE’. This method returns immediately.

Parameters:balancer (LoadBalancer) – Balancer to enable session persistence on.
Returns:Returns whether the enable request was accepted.
Return type:bool
ex_get_balancer_error_page(balancer)[source]

List error page configured for the specified load balancer.

Parameters:balancer (LoadBalancer) – Balancer which should be used
Return type:str
ex_list_algorithm_names()[source]

Lists algorithms supported by the API. Returned as strings because this list may change in the future.

Return type:list of str
ex_list_current_usage(balancer)[source]

Return current load balancer usage report.

Parameters:balancer (LoadBalancer) – Balancer to remove the access rules from.
Returns:Raw load balancer usage object.
Return type:dict
ex_list_protocols_with_default_ports()[source]

List protocols with default ports.

Return type:list of tuple
Returns:A list of protocols with default ports included.
ex_update_balancer_connection_throttle(balancer, connection_throttle)[source]

Updates a Balancer’s connection throttle. This method blocks until the update request has been processed and the balancer is in a RUNNING state again.

Parameters:
  • balancer (LoadBalancer) – Balancer to update connection throttle on.
  • connection_throttle (RackspaceConnectionThrottle) – Connection Throttle for the balancer.
Returns:

Updated Balancer.

Return type:

LoadBalancer

ex_update_balancer_connection_throttle_no_poll(balancer, connection_throttle)[source]

Sets a Balancer’s connection throttle. This method returns immediately.

Parameters:
  • balancer (LoadBalancer) – Balancer to update connection throttle on.
  • connection_throttle (RackspaceConnectionThrottle) – Connection Throttle for the balancer.
Returns:

Returns whether the update request was accepted.

Return type:

bool

ex_update_balancer_error_page(balancer, page_content)[source]

Updates a Balancer’s custom error page. This method blocks until the update request has been processed and the balancer is in a RUNNING state again.

Parameters:
  • balancer (LoadBalancer) – Balancer to update the custom error page for.
  • page_content (str) – HTML content for the custom error page.
Returns:

Updated Balancer.

Return type:

LoadBalancer

ex_update_balancer_error_page_no_poll(balancer, page_content)[source]

Updates a Balancer’s custom error page. This method returns immediately.

Parameters:
  • balancer (LoadBalancer) – Balancer to update the custom error page for.
  • page_content (str) – HTML content for the custom error page.
Returns:

Returns whether the update request was accepted.

Return type:

bool

ex_update_balancer_health_monitor(balancer, health_monitor)[source]

Sets a Balancer’s health monitor. This method blocks until the update request has been processed and the balancer is in a RUNNING state again.

Parameters:
  • balancer (LoadBalancer) – Balancer to update.
  • health_monitor (RackspaceHealthMonitor) – Health Monitor for the balancer.
Returns:

Updated Balancer.

Return type:

LoadBalancer

ex_update_balancer_health_monitor_no_poll(balancer, health_monitor)[source]

Sets a Balancer’s health monitor. This method returns immediately.

Parameters:
  • balancer (LoadBalancer) – Balancer to update health monitor on.
  • health_monitor (RackspaceHealthMonitor) – Health Monitor for the balancer.
Returns:

Returns whether the update request was accepted.

Return type:

bool

ex_update_balancer_no_poll(balancer, **kwargs)[source]

Update balancer no poll.

@inherits: Driver.update_balancer

get_balancer(balancer_id)[source]
list_balancers(ex_member_address=None)[source]

@inherits: Driver.list_balancers

Parameters:ex_member_address (str) – Optional IP address of the attachment member. If provided, only the load balancers which have this member attached will be returned.
list_protocols()[source]
name = 'Rackspace LB'
update_balancer(balancer, **kwargs)[source]
website = 'http://www.rackspace.com/'
class libcloud.loadbalancer.drivers.rackspace.RackspaceResponse(response, connection)[source]

Bases: libcloud.common.base.JsonResponse

Parameters:
parse_body()[source]
success()[source]
class libcloud.loadbalancer.drivers.rackspace.RackspaceUKLBDriver(*args, **kwargs)[source]

Bases: libcloud.loadbalancer.drivers.rackspace.RackspaceLBDriver

Module contents