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 used

  • member (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 used

  • member (Member) – Member which should be used

Returns:

True if member detach was successful, otherwise False.

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 of Member

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) – Location

  • private_port (int) – Private port

  • network_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, otherwise False.

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_balancers()[source]

List all loadbalancers

Return type:

list of LoadBalancer

list_protocols()[source]

We don’t actually have any protocol awareness beyond TCP.

Return type:

list of str

name = 'CloudStack'
type = 'cloudstack'
website = 'http://cloudstack.org/'