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

Represents a Cloud Load Balancer instance. More...

Inheritance diagram for CloudLoadBalancer:
BaseResource

List of all members.

Public Member Functions

def __init__
def add_nodes
 Adds the nodes to this load balancer.
def add_virtualip
 Adds the virtual IP to this load balancer.
def get_usage
 Return the usage records for this load balancer.
def update
 Provides a way to modify the following attributes of a load balancer:
def delete_node
 Removes the node from the 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
 Returns the current error page for the load balancer.
def set_error_page
 Sets a custom error page for the load balancer.
def clear_error_page
 Resets the error page to the default.

Properties

 connection_logging
 content_caching
 session_persistence

Detailed Description

Represents a Cloud Load Balancer instance.


Constructor & Destructor Documentation

def __init__ (   self,
  args,
  kwargs 
)

Member Function Documentation

def add_access_list (   self,
  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,
  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,
  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,
  nodes 
)

Adds the nodes to this load balancer.

def add_ssl_termination (   self,
  securePort,
  privatekey,
  certificate,
  intermediateCertificate = None,
  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,
  vip 
)

Adds the virtual IP to this load balancer.

def clear_error_page (   self)

Resets the error page to the default.

def delete_access_list (   self)

Removes the access list from this load balancer.

def delete_access_list_items (   self,
  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.

Deletes all connection throttling settings for the load balancer.

def delete_health_monitor (   self)

Deletes the health monitor for the load balancer.

def delete_metadata (   self,
  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,
  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 the load balancer.

def delete_ssl_termination (   self)

Removes SSL termination for the load balancer.

def delete_virtualip (   self,
  vip 
)

Deletes the VirtualIP from its load balancer.

def get_access_list (   self)

Returns the current access list for the load balancer.

def get_connection_throttle (   self)

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_error_page (   self)

Returns the current error page for the load balancer.

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)

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)

Returns the current metadata for the load balancer.

def get_metadata_for_node (   self,
  node 
)

Returns the current metadata for the specified node.

def get_ssl_termination (   self)

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,
  start = None,
  end = None 
)

Return the usage records for this load balancer.

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 set_error_page (   self,
  html 
)

Sets a custom error page for the load balancer.

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,
  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,
  node,
  metadata 
)

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

Any existing metadata is cleared.

def update (   self,
  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,
  metadata 
)

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

def update_metadata_for_node (   self,
  node,
  metadata 
)

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

def update_node (   self,
  node,
  diff = None 
)

Updates the node's attributes.

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

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


Property Documentation

Initial value:
property(_get_connection_logging,
            _set_connection_logging, None, "The current state of connection "
            "logging. Possible values are True or False.")
content_caching [static]
Initial value:
property(_get_content_caching, _set_content_caching,
            None, "The current state of content caching. Possible values are "
            "True or False.")
Initial value:
property(_get_session_persistence,
            _set_session_persistence, None, "The current state of session "
            "persistence. Possible values are either 'HTTP_COOKIE' or "
            "'SOURCE_IP', depending on the type of load balancing.")

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