'Configure the loadbalancer by adding it with a front-end port (aka
a service group in the Softlayer loadbalancer model).
Softlayer loadbalancer may be defined with multiple service
groups (front-end ports) each defined with a unique port number.
:param balancer: The loadbalancer.
:type  balancer: :class:`LoadBalancer`
:param port: Port of the service group, defaults to 80.
:type  port: ``int``
:param protocol: Loadbalancer protocol, defaults to http.
:type  protocol: ``str``
:param algorithm: Load balancing algorithm, defaults to
Algorithm.ROUND_ROBIN
:type  algorithm: :class:`Algorithm`
:param ex_allocation: The percentage of the total connection
allocations to allocate for this group.
:type  ex_allocation: ``int``
:return: ``True`` if ex_add_service_group was successful.
:rtype: ``bool``'

def ex_configure_load_balancer(self, balancer, port=80, protocol='http', algorithm=DEFAULT_ALGORITHM, ex_allocation=100):

    _types = self._get_routing_types()
    _methods = self._get_routing_methods()
    rt = find(_types, (lambda t: (t['keyname'] == protocol.upper())))
    if (not rt):
        raise LibcloudError(value=('Invalid    protocol    %s' % protocol), driver=self)
    value = self._algorithm_to_value(algorithm)
    meth = find(_methods, (lambda m: (m['keyname'] == value)))
    if (not meth):
        raise LibcloudError(value=('Invalid    algorithm    %s' % algorithm), driver=self)
    service_group_template = {'port': port, 'allocation': ex_allocation, 'serviceGroups': [{'routingTypeId': rt['id'], 'routingMethodId': meth['id']}]}
    lb = self._get_balancer_model(balancer.id)
    if (len(lb['virtualServers']) > 0):
        port = lb['virtualServers'][0]['port']
        raise LibcloudError(value=('Loadbalancer    already    configured    with    a    service    group    (front-end    port)' % port), driver=self)
    lb['virtualServers'].append(service_group_template)
    self.connection.request(lb_service, 'editObject', lb, id=balancer.id)
    return True
