#NEWLINE# def create_balancer( self , name , port , protocol , algorithm , members , ex_members_availability_zones = None ) : #NEWLINE# #INDENT# if ( ex_members_availability_zones is None ) : #NEWLINE# #INDENT# ex_members_availability_zones = [ 'a' ] #NEWLINE# #UNINDENT# params = { #NEWLINE# #INDENT# 'Action' : 'CreateLoadBalancer' , #NEWLINE# 'LoadBalancerName' : name , #NEWLINE# 'Listeners.member.1.InstancePort' : str ( port ) , #NEWLINE# 'Listeners.member.1.InstanceProtocol' : protocol . upper ( ) , #NEWLINE# 'Listeners.member.1.LoadBalancerPort' : str ( port ) , #NEWLINE# 'Listeners.member.1.Protocol' : protocol . upper ( ) , #NEWLINE# #UNINDENT# } #NEWLINE# for ( i , z ) in enumerate ( ex_members_availability_zones ) : #NEWLINE# #INDENT# zone = '' . join ( ( self . region , z ) ) #NEWLINE# params [ ( 'AvailabilityZones.member.%d' % ( i + 1 ) ) ] = zone #NEWLINE# #UNINDENT# data = self . connection . request ( ROOT , params = params ) . object #NEWLINE# balancer = LoadBalancer ( id = name , name = name , state = State . PENDING , ip = findtext ( element = members , xpath = 'DNSName' , namespace = NS ) , port = port , driver = self . connection . driver ) #NEWLINE# balancer . _members = [ ] #NEWLINE# return balancer