Create network
Creates a network.
URI
/v2.0/networks
HTTP method
POST
Request parameter
| Key | Description | Type | Required/optional | 
|---|---|---|---|
| admin_state_up | The administrative state of the network, which is up (true) or down (false). | xsd:bool | Optional | 
| name | The network name. A request body is optional: If you include it, it can specify this optional attribute. | xsd:string | Optional | 
| shared | Indicates whether this network is shared across all projects. By default, only administrative users can change this value. | xsd:bool | Optional | 
| availability_zone | The Availability Zone name. If you do not specify this, the resource will be created in the default Availability Zone.  | 
             xsd:string | Optional | 
Example request
{
	"network": {
		"name": "sample_network",
		"admin_state_up": true,
		"availability_zone": "AZ1"
	}
}    
     
     
   Response status
| Status code | Description | 
|---|---|
| 201 | Normal response codes | 
| badRequest (400) | Error response codes | 
| unauthorized (401) | Error response codes | 
Response body (normal status)
{
    "network": {
        "status": "ACTIVE",
        "subnets": [],
        "name": "net1",
        "admin_state_up": true,
        "tenant_id": "9bacb3c5d39d41a79512987f338cf177",
        "segments": [
            {
                "provider:segmentation_id": 2,
                "provider:physical_network": "8bab8453-1bc9-45af-8c70-f83aa9b50453",
                "provider:network_type": "vlan"
            },
            {
                "provider:segmentation_id": null,
                "provider:physical_network": "8bab8453-1bc9-45af-8c70-f83aa9b50453",
                "provider:network_type": "stt"
            }
        ],
        "shared": false,
        "port_security_enabled": true,
        "id": "4e8e5957-649f-477b-9e5b-f1f75b21c03c",
        "availability_zone": "AZ1"
    }
}
     
     
   Description of response body (normal status)
| Item | Description | 
|---|---|
| admin_state_up | The administrative state of the network, which is up (true) or down (false). | 
| id | The network ID. | 
| name | The network name. | 
| shared | Indicates whether this network is shared across all projects. | 
| status | The network status. | 
| subnets | The associated subnets. | 
| tenant_id | The project ID. | 
| availability_zone | The Availability Zone name |