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:
CloudStackDriverMixIn
,Driver
Driver for CloudStack load balancers.
@inherits:
Driver.__init__
- LB_STATE_MAP = {'Active': 0}
- api_name = 'cloudstack_lb'
- 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
- 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
) – Locationprivate_port (
int
) – Private portnetwork_id (
str
) – The guest network this rule will be created for.
- 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
- list_protocols()[source]
We don’t actually have any protocol awareness beyond TCP.
- Return type:
list
ofstr
- name = 'CloudStack'
- type = 'cloudstack'
- website = 'http://cloudstack.org/'