l.l.b.Driver(BaseDriver) : class documentation

Part of libcloud.loadbalancer.base View Source View In Hierarchy

Known subclasses: libcloud.loadbalancer.drivers.brightbox.BrightboxLBDriver, libcloud.loadbalancer.drivers.cloudstack.CloudStackLBDriver, libcloud.loadbalancer.drivers.gogrid.GoGridLBDriver, libcloud.loadbalancer.drivers.rackspace.RackspaceLBDriver

A base LBDriver class to derive from

This class is always subclassed by a specific driver.
Method __init__ @keyword key: API key or username to used @type key: str
Method list_protocols Return a list of supported protocols.
Method list_balancers List all loadbalancers
Method create_balancer Create a new load balancer instance
Method destroy_balancer Destroy a load balancer
Method get_balancer Return a C{LoadBalancer} object.
Method update_balancer Sets the name, algorithm, protocol, or port on a load balancer.
Method balancer_attach_compute_node Attach a compute node as a member to the load balancer.
Method balancer_attach_member Attach a member to balancer
Method balancer_detach_member Detach member from balancer
Method balancer_list_members Return list of members attached to balancer
Method list_supported_algorithms Return algorithms supported by this driver.
Method _value_to_algorithm Return C{LBAlgorithm} based on the value.
Method _algorithm_to_value Return value based in the algorithm (C{LBAlgorithm}).

Inherited from BaseDriver:

Method _ex_connection_class_kwargs Return extra connection keyword arguments which are passed to the Connection class constructor.
def __init__(self, key, secret=None, secure=True, host=None, port=None, **kwargs): (source)
@keyword    key:    API key or username to used
@type       key:    str

@keyword    secret: Secret password to be used
@type       secret: str

@keyword    secure: Weither to use HTTPS or HTTP. Note: Some providers
                    only support HTTPS, and it is on by default.
@type       secure: bool

@keyword    host: Override hostname used for connections.
@type       host: str

@keyword    port: Override port used for connections.
@type       port: int

@keyword    api_version: Optional API version. Only used by drivers
                         which support multiple API versions.
@type       api_version: str

@requires: key, secret
def list_protocols(self): (source)
Return a list of supported protocols.
def list_balancers(self): (source)
List all loadbalancers

@return: C{list} of L{LoadBalancer} objects
def create_balancer(self, name, port, protocol, algorithm, members): (source)
Create a new load balancer instance

@keyword name: Name of the new load balancer (required)
@type name: C{str}
@keyword members: C{list} ofL{Member}s to attach to balancer
@type: C{list} of L{Member}s
@keyword protocol: Loadbalancer protocol, defaults to http.
@type: C{str}
@keyword port: Port the load balancer should listen on, defaults to 80
@type port: C{str}
@keyword algorithm: Load balancing algorithm, defaults to
                    LBAlgorithm.ROUND_ROBIN
@type algorithm: C{LBAlgorithm}
def destroy_balancer(self, balancer): (source)
Destroy a load balancer

@return: C{bool} True if the destroy was successful, otherwise False
def get_balancer(self, balancer_id): (source)
Return a C{LoadBalancer} object.

@keyword balancer_id: id of a load balancer you want to fetch
@type balancer_id: C{str}

@return: C{LoadBalancer}
def update_balancer(self, balancer, **kwargs): (source)
Sets the name, algorithm, protocol, or port on a load balancer.

@keyword    name: New load balancer name
@type       metadata: C{str}

@keyword    algorithm: New load balancer algorithm
@type       metadata: C{libcloud.loadbalancer.base.Algorithm}

@keyword    protocol: New load balancer protocol
@type       metadata: C{str}

@keyword    port: New load balancer port
@type       metadata: C{int}
def balancer_attach_compute_node(self, balancer, node): (source)
Attach a compute node as a member to the load balancer.

@keyword node: Member to join to the balancer
@type member: C{libcloud.compute.base.Node}
@return {Member} Member after joining the balancer.
def balancer_attach_member(self, balancer, member): (source)
Attach a member to balancer

@keyword member: Member to join to the balancer
@type member: C{Member}
@return {Member} Member after joining the balancer.
def balancer_detach_member(self, balancer, member): (source)
Detach member from balancer

@return: C{bool} True if member detach was successful, otherwise False
def balancer_list_members(self, balancer): (source)
Return list of members attached to balancer

@return: C{list} of L{Member}s
def _value_to_algorithm(self, value): (source)
Return C{LBAlgorithm} based on the value.
def _algorithm_to_value(self, algorithm): (source)
Return value based in the algorithm (C{LBAlgorithm}).
def list_supported_algorithms(self): (source)
Return algorithms supported by this driver.
API Documentation for libcloud, generated by pydoctor at 2012-11-19 11:53:43.