<s> from lib . action import PyraxBaseAction <EOL> __all__ = [ <EOL> '<STR_LIT>' <EOL> ] <EOL> class CreateLoadBalancerAction ( PyraxBaseAction ) : <EOL> def run ( self , name , port , protocol ) : <EOL> clb = self . pyrax . cloud_loadbalancers <EOL> virtual_ipv4 = clb . VirtualIP ( type = "<STR_LIT>" , ipVersion = '<STR_LIT>' ) <EOL> self . logger . info ( '<STR_LIT>' ) <EOL> load_balancer = clb . create ( name , port = port , protocol = protocol , virtual_ips = [ virtual_ipv4 ] ) <EOL> self . pyrax . utils . wait_until ( load_balancer , "<STR_LIT:status>" , "<STR_LIT>" , interval = <NUM_LIT:1> , <EOL> attempts = <NUM_LIT:30> ) <EOL> self . logger . info ( '<STR_LIT>' % load_balancer ) <EOL> payload = { <EOL> '<STR_LIT>' : load_balancer . cluster , <EOL> '<STR_LIT>' : load_balancer . algorithm , <EOL> '<STR_LIT:id>' : load_balancer . id , <EOL> '<STR_LIT:name>' : load_balancer . name , <EOL> '<STR_LIT:port>' : load_balancer . port , <EOL> '<STR_LIT>' : load_balancer . protocol , <EOL> '<STR_LIT>' : load_balancer . sourceAddresses [ '<STR_LIT>' ] , <EOL> '<STR_LIT>' : load_balancer . sourceAddresses [ '<STR_LIT>' ] , <EOL> '<STR_LIT>' : load_balancer . sourceAddresses [ '<STR_LIT>' ] , <EOL> '<STR_LIT>' : load_balancer . connectionLogging [ '<STR_LIT>' ] , <EOL> '<STR_LIT>' : load_balancer . contentCaching [ '<STR_LIT>' ] , <EOL> '<STR_LIT>' : load_balancer . httpsRedirect , <EOL> '<STR_LIT>' : load_balancer . timeout , <EOL> '<STR_LIT:status>' : load_balancer . status <EOL> } <EOL> return payload </s>
