• Virtual Private Cloud

vpc
  1. Help Center
  2. Virtual Private Cloud
  3. API Reference
  4. OpenStack Neutron APIs
  5. Network
  6. Creating a Network

Creating a Network

Function

This interface is used to create a network.

URI

POST /v2.0/networks

Request Message

Table 1 Request parameter

Parameter

Type

Mandatory

Description

network

Dict

Yes

Specifies the network list. For details, see Table 1.

This parameter has no mandatory fields.

Response Message

Table 2 Response parameter

Parameter

Type

Description

network

Dict

Specifies the network list. For details, see Table 1.

Example:

Example request

POST /v2.0/networks 
{
    "network": {
           "name": "network-test",
           "shared": false,
           "admin_state_up": true
    }
}

Example response

{
    "network": {
        "id": "c360322d-5315-45d7-b7d2-481f98c56edb",
        "name": "network-test",
        "status": "ACTIVE",
        "shared": false,
        "subnets": [],
        "availability_zone_hints": [],
        "availability_zones": [
            "az2.dc2",
            "az5.dc5"
        ],
        "admin_state_up": true,
        "tenant_id": "bbfe8c41dd034a07bebd592bf03b4b0c",
        "project_id": "bbfe8c41dd034a07bebd592bf03b4b0c",
        "provider:network_type": "vxlan",
        "router:external": false,
        "port_security_enabled": true,
        "created_at": "2018-09-20T01:53:18",
        "updated_at": "2018-09-20T01:53:20"
    }
}

Status Codes

For details, see section Status Codes.