libcloud.loadbalancer.drivers.brightbox module
- class libcloud.loadbalancer.drivers.brightbox.BrightboxLBDriver(key, secret=None, secure=True, host=None, port=None, **kwargs)[source]
Bases:
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
- LB_STATE_MAP = {'active': 0, 'creating': 1, 'deleted': 2, 'deleting': 2, 'failed': 2, 'failing': 2}
- 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 usednode (
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 usedmember (
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 usedmember (
Member
) – Member which should be used
- Returns:
True
if member detach was successful, otherwiseFalse
.- 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
ofMember
- connectionCls
alias of
BrightboxConnection
- create_balancer(name, port, protocol, algorithm, members)[source]
Create a new load balancer instance
- Parameters:
name (
str
) – Name of the new load balancer (required)port (
str
) – Port the load balancer should listen on, defaults to 80protocol (
str
) – Loadbalancer protocol, defaults to http.members (
list
ofMember
) – list of Members to attach to balanceralgorithm (
Algorithm
) – Load balancing algorithm, defaults to ROUND_ROBIN.
- Return type:
LoadBalancer
- destroy_balancer(balancer)[source]
Destroy a load balancer
- Parameters:
balancer (
LoadBalancer
) – LoadBalancer which should be used- Returns:
True
if the destroy was successful, otherwiseFalse
.- Return type:
bool
- 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
- name = 'Brightbox'
- website = 'http://www.brightbox.co.uk/'