

def ex_create_network(self, location, name, description=None):
    '\n        Create a new network in an MCP 1.0 location\n\n        :param   location: The target location (MCP1)\n        :type    location: :class:`NodeLocation` or ``str``\n\n        :param   name: The name of the network\n        :type    name: ``str``\n\n        :param   description: Additional description of the network\n        :type    description: ``str``\n\n        :return: A new instance of `DimensionDataNetwork`\n        :rtype:  Instance of :class:`DimensionDataNetwork`\n        '
    network_location = self._location_to_location_id(location)
    create_node = ET.Element('NewNetworkWithLocation', {
        'xmlns': NETWORK_NS,
    })
    ET.SubElement(create_node, 'name').text = name
    if (description is not None):
        ET.SubElement(create_node, 'description').text = description
    ET.SubElement(create_node, 'location').text = network_location
    self.connection.request_with_orgId_api_1('networkWithLocation', method='POST', data=ET.tostring(create_node))
    network = list(filter((lambda x: (x.name == name)), self.ex_list_networks(location)))[0]
    return network

dataset/ETHPy150Open apache/libcloud/libcloud/compute/drivers/dimensiondata.py DimensionDataNodeDriver.ex_create_network/original