'Create and attach a load balancer to a data center.
:param  datacenter: The DC you are renaming.
:type   datacenter: :class:`Datacenter`
:param  name: Load balancer name.
:type   name: ``str``
:param  ip: Load balancer IPV4 address.
:type   ip: ``str``
:param  dhcp: If true, the load balancer
will reserve an IP address using DHCP.
:type   dhcp: ``bool``
:param  nics: Optional network interfaces
taking part in load balancing.
:param  nics: ``list`` of class ``ProfitBricksNetworkInterface``
:return:    Instance class ``ProfitBricksLoadBalancer``
:rtype:     :class:`ProfitBricksLoadBalancer`'

def ex_create_load_balancer(self, datacenter, name=None, ip=None, dhcp=None, nics=None):

    action = datacenter.extra['entities']['loadbalancers']['href']
    body = {'properties': {'name': (name or 'Load    Balancer    -    {datacenter_name}'.format(datacenter_name=datacenter.name))}}
    if (ip is not None):
        body['properties']['ip'] = ip
    if (dhcp is not None):
        body['properties']['dhcp'] = dhcp
    if (nics is not None):
        body['entities'] = defaultdict(dict)
        body['entities']['balancednics']['items'] = [{'id': nic.id} for nic in nics]
    response = self.connection.request(action=action, headers={'Content-Type': 'application/json'}, data=body, method='POST', with_full_url=True)
    return self._to_load_balancer(response.object, response.headers)
