def create_lb(self, name, protocol='HTTP', port=80, algorithm=None,
            virtual_ips=[], nodes=[], node_port=None):
        """
        Create a new LBaaS instance. A name is required. If no nodes
        are required, the instance ``status`` (after it's built) will be
        ``ERROR`` until nodes are added. The return dict contains the id
        and ``virtualIps`` (the external IP).

        :param string name:  The LBaaS name - should be unique

        :param string protocol:  Supported: HTTP, TCP

        :param int port:  The external port. Supported: 80, 443, seemingly

        :param list virtual_ips:  Use an existing IP (allows multiple
                                  ports per IP)

        :param list nodes:  Nodes addresses to add
        """
        log.info("Creating load balancer '%s'" % name)
        protocol = protocol.upper()
        nodes_to_add = []
        if nodes:
            nodes_to_add = map(
                    lambda n: {'address': n, 'port': str(node_port)}, 
                    nodes
                    )
        data = {
            'name': name,
            'protocol': protocol,
            'port': str(port),
            'nodes': nodes_to_add,
        }
        if virtual_ips:
            data['virtualIps'] = map(lambda i: {'id': i}, virtual_ips)
        if algorithm:
            data['algorithm'] = algorithm
        resp, body = self._request('post', '/loadbalancers', data=data)
        return body
def create_lb ( self , name , protocol = 'HTTP' , port = 80 , algorithm = None , virtual_ips = [ ] , nodes = [ ] , node_port = None ) : log . info ( "Creating load balancer '%s'" % name ) protocol = protocol . upper ( ) nodes_to_add = [ ] if nodes : nodes_to_add = map ( lambda n : { 'address' : n , 'port' : str ( node_port ) } , nodes ) data = { 'name' : name , 'protocol' : protocol , 'port' : str ( port ) , 'nodes' : nodes_to_add , } if virtual_ips : data [ 'virtualIps' ] = map ( lambda i : { 'id' : i } , virtual_ips ) if algorithm : data [ 'algorithm' ] = algorithm resp , body = self . _request ( 'post' , '/loadbalancers' , data = data ) return body
Create a new LBaaS instance. A name is required. If no nodes
        are required, the instance ``status`` (after it's built) will be
        ``ERROR`` until nodes are added. The return dict contains the id
        and ``virtualIps`` (the external IP).

        :param string name:  The LBaaS name - should be unique

        :param string protocol:  Supported: HTTP, TCP

        :param int port:  The external port. Supported: 80, 443, seemingly

        :param list virtual_ips:  Use an existing IP (allows multiple
                                  ports per IP)

        :param list nodes:  Nodes addresses to add