pyrax
Python Bindings for the Rackspace Cloud
 All Classes Namespaces Files Functions Variables Properties
Public Member Functions | Public Attributes | Static Public Attributes
CloudLoadBalancerClient Class Reference

This is the primary class for interacting with Cloud Load Balancers. More...

Inheritance diagram for CloudLoadBalancerClient:
BaseClient

List of all members.

Public Member Functions

def __init__
def get_usage
 Return the load balancer usage records for this account.
def allowed_domains
 This property lists the allowed domains for a load balancer.
def algorithms
 Returns a list of available load balancing algorithms.
def protocols
 Returns a list of available load balancing protocols.
def update
 Provides a way to modify the following attributes of a load balancer:
def add_nodes
 Adds the nodes to this load balancer.
def add_virtualip
 Adds the virtual IP to this load balancer.
def delete_node
 Removes the node from its load balancer.
def update_node
 Updates the node's attributes.
def delete_virtualip
 Deletes the VirtualIP from its load balancer.
def get_access_list
 Returns the current access list for the load balancer.
def add_access_list
 Adds the access list provided to the load balancer.
def delete_access_list
 Removes the access list from this load balancer.
def delete_access_list_items
 Removes the item(s) from the load balancer's access list that match the provided IDs.
def get_health_monitor
 Returns a dict representing the health monitor for the load balancer.
def add_health_monitor
 Adds a health monitor to the load balancer.
def delete_health_monitor
 Deletes the health monitor for the load balancer.
def get_connection_throttle
 Returns a dict representing the connection throttling information for the load balancer.
def add_connection_throttle
 Updates the connection throttling information for the load balancer with the supplied values.
def delete_connection_throttle
 Deletes all connection throttling settings for the load balancer.
def get_ssl_termination
 Returns a dict representing the SSL termination configuration for the load balancer.
def add_ssl_termination
 Adds SSL termination information to the load balancer.
def update_ssl_termination
 Updates existing SSL termination information for the load balancer without affecting the existing certificates/keys.
def delete_ssl_termination
 Removes SSL termination for the load balancer.
def get_metadata
 Returns the current metadata for the load balancer.
def set_metadata
 Sets the metadata for the load balancer to the supplied dictionary of values.
def update_metadata
 Updates the existing metadata for the load balancer with the supplied dictionary.
def delete_metadata
 Deletes metadata items specified by the 'keys' parameter for this load balancer.
def get_metadata_for_node
 Returns the current metadata for the specified node.
def set_metadata_for_node
 Sets the metadata for the specified node to the supplied dictionary of values.
def update_metadata_for_node
 Updates the existing metadata for the specified node with the supplied dictionary.
def delete_metadata_for_node
 Deletes metadata items specified by the 'keys' parameter for the specified node.
def get_error_page
 Load Balancers all have a default error page that is shown to an end user who is attempting to access a load balancer node that is offline/unavailable.
def set_error_page
 A single custom error page may be added per account load balancer with an HTTP protocol.
def clear_error_page
 Resets the error page to the default.
def get_connection_logging
 Returns the current setting for connection logging for the load balancer.
def set_connection_logging
 Sets connection logging for the load balancer to either True or False.
def get_content_caching
 Returns the current setting for content caching for the load balancer.
def set_content_caching
 Sets content caching for the load balancer to either True or False.
def get_session_persistence
 Returns the current setting for session persistence for the load balancer.
def set_session_persistence
 Sets the type of session persistence for the load balancer.

Public Attributes

 Node
 VirtualIP

Static Public Attributes

string name = "Cloud Load Balancers"

Detailed Description

This is the primary class for interacting with Cloud Load Balancers.


Constructor & Destructor Documentation

def __init__ (   self,
  args,
  kwargs 
)

Member Function Documentation

def add_access_list (   self,
  loadbalancer,
  access_list 
)

Adds the access list provided to the load balancer.

The 'access_list' should be a dict in the following format:

{"accessList": [ {"address": "192.0.43.10", "type": "DENY"}, {"address": "192.0.43.11", "type": "ALLOW"}, ... {"address": "192.0.43.99", "type": "DENY"}, ] }

If no access list exists, it is created. If an access list already exists, it is updated with the provided list.

def add_connection_throttle (   self,
  loadbalancer,
  maxConnectionRate = None,
  maxConnections = None,
  minConnections = None,
  rateInterval = None 
)

Updates the connection throttling information for the load balancer with the supplied values.

At least one of the parameters must be supplied.

def add_health_monitor (   self,
  loadbalancer,
  type,
  delay = 10,
  timeout = 10,
  attemptsBeforeDeactivation = 3,
  path = "/",
  statusRegex = None,
  bodyRegex = None,
  hostHeader = None 
)

Adds a health monitor to the load balancer.

If a monitor already exists, it is updated with the supplied settings.

def add_nodes (   self,
  loadbalancer,
  nodes 
)

Adds the nodes to this load balancer.

def add_ssl_termination (   self,
  loadbalancer,
  securePort,
  privatekey,
  certificate,
  intermediateCertificate,
  enabled = True,
  secureTrafficOnly = False 
)

Adds SSL termination information to the load balancer.

If SSL termination has already been configured, it is updated with the supplied settings.

def add_virtualip (   self,
  loadbalancer,
  vip 
)

Adds the virtual IP to this load balancer.

def algorithms (   self)

Returns a list of available load balancing algorithms.

def allowed_domains (   self)

This property lists the allowed domains for a load balancer.

The allowed domains are restrictions set for the allowed domain names used for adding load balancer nodes. In order to submit a domain name as an address for the load balancer node to add, the user must verify that the domain is valid by using the List Allowed Domains call. Once verified, simply supply the domain name in place of the node's address in the add_nodes() call.

def clear_error_page (   self,
  loadbalancer 
)

Resets the error page to the default.

def delete_access_list (   self,
  loadbalancer 
)

Removes the access list from this load balancer.

def delete_access_list_items (   self,
  loadbalancer,
  item_ids 
)

Removes the item(s) from the load balancer's access list that match the provided IDs.

'item_ids' should be one or more access list item IDs.

def delete_connection_throttle (   self,
  loadbalancer 
)

Deletes all connection throttling settings for the load balancer.

def delete_health_monitor (   self,
  loadbalancer 
)

Deletes the health monitor for the load balancer.

def delete_metadata (   self,
  loadbalancer,
  keys = None 
)

Deletes metadata items specified by the 'keys' parameter for this load balancer.

If no value for 'keys' is provided, all metadata is deleted.

def delete_metadata_for_node (   self,
  loadbalancer,
  node,
  keys = None 
)

Deletes metadata items specified by the 'keys' parameter for the specified node.

If no value for 'keys' is provided, all metadata is deleted.

def delete_node (   self,
  node 
)

Removes the node from its load balancer.

def delete_ssl_termination (   self,
  loadbalancer 
)

Removes SSL termination for the load balancer.

def delete_virtualip (   self,
  vip 
)

Deletes the VirtualIP from its load balancer.

def get_access_list (   self,
  loadbalancer 
)

Returns the current access list for the load balancer.

def get_connection_logging (   self,
  loadbalancer 
)

Returns the current setting for connection logging for the load balancer.

def get_connection_throttle (   self,
  loadbalancer 
)

Returns a dict representing the connection throttling information for the load balancer.

If no connection throttle has been configured, returns an empty dict.

def get_content_caching (   self,
  loadbalancer 
)

Returns the current setting for content caching for the load balancer.

def get_error_page (   self,
  loadbalancer 
)

Load Balancers all have a default error page that is shown to an end user who is attempting to access a load balancer node that is offline/unavailable.

def get_health_monitor (   self,
  loadbalancer 
)

Returns a dict representing the health monitor for the load balancer.

If no monitor has been configured, returns an empty dict.

def get_metadata (   self,
  loadbalancer 
)

Returns the current metadata for the load balancer.

def get_metadata_for_node (   self,
  loadbalancer,
  node 
)

Returns the current metadata for the specified node.

def get_session_persistence (   self,
  loadbalancer 
)

Returns the current setting for session persistence for the load balancer.

def get_ssl_termination (   self,
  loadbalancer 
)

Returns a dict representing the SSL termination configuration for the load balancer.

If SSL termination has not been configured, returns an empty dict.

def get_usage (   self,
  loadbalancer = None,
  start = None,
  end = None 
)

Return the load balancer usage records for this account.

If 'loadbalancer' is None, records for all load balancers are returned. You may optionally include a start datetime or an end datetime, or both, which will limit the records to those on or after the start time, and those before or on the end time. These times should be Python datetime.datetime objects, Python datetime.date objects, or strings in the format: "YYYY-MM-DD HH:MM:SS" or "YYYY-MM-DD".

def protocols (   self)

Returns a list of available load balancing protocols.

def set_connection_logging (   self,
  loadbalancer,
  val 
)

Sets connection logging for the load balancer to either True or False.

def set_content_caching (   self,
  loadbalancer,
  val 
)

Sets content caching for the load balancer to either True or False.

def set_error_page (   self,
  loadbalancer,
  html 
)

A single custom error page may be added per account load balancer with an HTTP protocol.

Page updates will override existing content. If a custom error page is deleted, or the load balancer is changed to a non-HTTP protocol, the default error page will be restored.

def set_metadata (   self,
  loadbalancer,
  metadata 
)

Sets the metadata for the load balancer to the supplied dictionary of values.

Any existing metadata is cleared.

def set_metadata_for_node (   self,
  loadbalancer,
  node,
  metadata 
)

Sets the metadata for the specified node to the supplied dictionary of values.

Any existing metadata is cleared.

def set_session_persistence (   self,
  loadbalancer,
  val 
)

Sets the type of session persistence for the load balancer.

This must be one of either "HTTP_COOKIE" or "SOURCE_IP", depending on the type of load balancing.

def update (   self,
  loadbalancer,
  name = None,
  algorithm = None,
  protocol = None,
  halfClosed = None,
  port = None,
  timeout = None 
)

Provides a way to modify the following attributes of a load balancer:

  • name
  • algorithm
  • protocol
  • halfClosed
  • port
  • timeout
def update_metadata (   self,
  loadbalancer,
  metadata 
)

Updates the existing metadata for the load balancer with the supplied dictionary.

def update_metadata_for_node (   self,
  loadbalancer,
  node,
  metadata 
)

Updates the existing metadata for the specified node with the supplied dictionary.

def update_node (   self,
  node 
)

Updates the node's attributes.

def update_ssl_termination (   self,
  loadbalancer,
  securePort = None,
  enabled = None,
  secureTrafficOnly = None 
)

Updates existing SSL termination information for the load balancer without affecting the existing certificates/keys.


Member Data Documentation

string name = "Cloud Load Balancers" [static]

Reimplemented from BaseClient.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Properties