def create_balancer(self, name, port, protocol, algorithm, members):
        network_domain_id = self.network_domain_id
        if port is None:
            port = 80
        if protocol is None:
            protocol = 'http'
        if algorithm is None:
            algorithm = Algorithm.ROUND_ROBIN

        # Create a pool first
        pool = self.ex_create_pool(
            network_domain_id=network_domain_id,
            name=name,
            ex_description=None,
            balancer_method=self._ALGORITHM_TO_VALUE_MAP[algorithm])

        # Attach the members to the pool as nodes
        if members is not None:
            for member in members:
                node = self.ex_create_node(
                    network_domain_id=network_domain_id,
                    name=member.ip,
                    ip=member.ip,
                    ex_description=None)
                self.ex_create_pool_member(
                    pool=pool,
                    node=node,
                    port=port)

        # Create the virtual listener (balancer)
        listener = self.ex_create_virtual_listener(
            network_domain_id=network_domain_id,
            name=name,
            ex_description=name,
            port=port,
            pool=pool)

        return LoadBalancer(
            id=listener.id,
            name=listener.name,
            state=State.RUNNING,
            ip=listener.ip,
            port=port,
            driver=self,
            extra={'pool_id': pool.id,
                   'network_domain_id': network_domain_id}
        )
Create a new load balancer instance
dataset/ETHPy150Open apache/libcloud/libcloud/loadbalancer/drivers/dimensiondata.py/DimensionDataLBDriver.create_balancer