'Creates a Network, only available in advanced zones.
:param  display_text: the display text of the network
:type   display_text: ``str``
:param  name: the name of the network
:type   name: ``str``
:param  network_offering: NetworkOffering object
:type   network_offering: :class:\'CloudStackNetworkOffering`
:param location: Zone object
:type  location: :class:`NodeLocation`
:param  gateway: Optional, the Gateway of this network
:type   gateway: ``str``
:param  netmask: Optional, the netmask of this network
:type   netmask: ``str``
:param  network_domain: Optional, the DNS domain of the network
:type   network_domain: ``str``
:param  vpc_id: Optional, the VPC id the network belongs to
:type   vpc_id: ``str``
:param  project_id: Optional, the project id the networks belongs to
:type   project_id: ``str``
:rtype: :class:`CloudStackNetwork`'

def ex_create_network(self, display_text, name, network_offering, location, gateway=None, netmask=None, network_domain=None, vpc_id=None, project_id=None):

    extra_map = RESOURCE_EXTRA_ATTRIBUTES_MAP['network']
    args = {'displaytext': display_text, 'name': name, 'networkofferingid': network_offering.id, 'zoneid': location.id}
    if (gateway is not None):
        args['gateway'] = gateway
    if (netmask is not None):
        args['netmask'] = netmask
    if (network_domain is not None):
        args['networkdomain'] = network_domain
    if (vpc_id is not None):
        args['vpcid'] = vpc_id
    if (project_id is not None):
        args['projectid'] = project_id
    '    Cloudstack    allows    for    duplicate    network    names,\n                                this    should    be    handled    in    the    code    leveraging    libcloud\n                                As    there    could    be    use    cases    for    duplicate    names.\n                                e.g.    management    from    ROOT    level'
    result = self._sync_request(command='createNetwork', params=args, method='GET')
    result = result['network']
    extra = self._get_extra_dict(result, extra_map)
    network = CloudStackNetwork(display_text, name, network_offering.id, result['id'], location.id, self, extra=extra)
    return network
