'List local area network on:
- a datacenter if one is specified
- all datacenters if none specified
:param  datacenter: The DC you are renaming.
:type   datacenter: :class:`Datacenter`
:return:    ``list`` of class ``ProfitBricksLan``
:rtype:     `list`'

def ex_list_lans(self, datacenter=None):

    if (datacenter is not None):
        action = datacenter.extra['entities']['lans']['href']
        request = self.connection.request(action=action, params={'depth': 3}, method='GET', with_full_url=True)
        lans = self._to_lans(request.object)
    else:
        datacenters = self.ex_list_datacenters()
        lans = []
        for datacenter in datacenters:
            action = datacenter.extra['entities']['lans']['href']
            request = self.connection.request(action=action, params={'depth': 3}, method='GET', with_full_url=True)
            lans += self._to_lans(request.object)
    return lans
