Create Network
POST /v2.0/networks
Create a network. The next step is to create a subnet for the created network.
info
Source: create-network
Request
Body parameters
| Name | In | Type | Description |
|---|---|---|---|
network | body | object | A network object. |
mtu (Optional) | body | integer | Maximum transmission unit. Minimum 68 (IPv4) or 1280 (IPv6). |
name (Optional) | body | string | Human-readable name of the network. |
description (Optional) | body | string | Human-readable description. |
tenant_id (Optional) | body | string | Alias for project ID. Admin/advsvc can specify others. |
project_id (Optional) | body | string | ID of the owning project. Admin/advsvc can specify other projects. |
Example requests
Using curl (create a private network)
curl -ks -H 'Content-Type: application/json' \
-H 'X-Auth-Token: gAAAAA<...>' -d '
{
"network": {
"name": "privnet1"
}
}' https://api.vietnix.cloud:9696/v2.0/networks
Using HTTP request
POST https://api.vietnix.cloud:9696/v2.0/networks
Response
Response parameters
| Name | Type | Description |
|---|---|---|
network | object | A network object. |
admin_state_up | boolean | Administrative state: up (true) or down (false). |
availability_zone_hints | array | Availability zone candidates. Current VHI returns default or null. |
availability_zones | array | Availability zones. Current VHI returns default or null. |
created_at | string | Creation time (ISO 8601). |
dns_domain | string | DNS domain. |
id | string | Network ID. |
ipv4_address_scope | string | IPv4 address scope ID. |
ipv6_address_scope | string | IPv6 address scope ID. |
l2_adjacency | boolean | Whether L2 connectivity is available throughout the network. |
mtu | integer | Maximum transmission unit. |
name | string | Human-readable name. |
port_security_enabled | boolean | Port security status (default for new ports). |
project_id | string | Owning project ID. |
provider:network_type | string | Provider network type (e.g., flat, vlan, vxlan, gre). |
provider:physical_network | string | Physical network. |
provider:segmentation_id | integer | Provider segmentation identifier. |
qos_policy_id | string | Associated QoS policy ID. |
revision_number | integer | Revision number. |
router:external | boolean | Whether network is external. |
segments | array | List of provider segment objects. |
shared | boolean | Whether network is shared across tenants. |
status | string | Network status: ACTIVE, DOWN, BUILD, ERROR. |
subnets | array | Associated subnet IDs. |
tenant_id | string | Owning project ID. |
updated_at | string | Last update time (ISO 8601) or null. |
vlan_transparent | boolean | VLAN transparency mode. |
default_vnic_type | string | Default vnic_type for ports in this network. |
description | string | Human-readable description. |
is_default | boolean | Whether network is default pool. |
tags | array | List of resource tags. |
Sample responses
{
"network": {
"id": "170546a1-a70a-40af-93e2-9261c7c05b77",
"name": "privnet1",
"tenant_id": "f33507157a634f1cac71e06a70fb558e",
"admin_state_up": true,
"mtu": 1413,
"default_vnic_type": null,
"status": "ACTIVE",
"subnets": [],
"shared": false,
"project_id": "f33507157a634f1cac71e06a70fb558e",
"port_security_enabled": true,
"qos_policy_id": "dfc42ced-02c8-4b1f-bbe6-14cc014f259d",
"router:external": false,
"provider:network_type": "vxlan",
"is_default": false,
"availability_zone_hints": [],
"availability_zones": [],
"ipv4_address_scope": null,
"ipv6_address_scope": null,
"description": "",
"rbac_policies": [],
"tags": [],
"created_at": "2025-09-23T06:42:18Z",
"updated_at": "2025-09-23T06:42:18Z",
"revision_number": 1
}
}
Status codes
Success
| Status Code | Description |
|---|---|
| 201 - Created | Resource was created and is ready to use. |
Error
| Status Code | Description |
|---|---|
| 400 - Bad Request | Some content in the request was invalid. |
| 401 - Unauthorized | User must authenticate before making a request. |