• Native OpenStack API

noa
  1. Help Center
  2. Native OpenStack API
  3. API Reference
  4. Neutron
  5. Subnet
  6. Updating a Subnet

Updating a Subnet

Function

This interface is used to update information about a subnet.

Restrictions

When updating the allocation_pools field, neither gateway nor broadcast IP addresses can be included.

URI

PUT /v2.0/subnets/{subnet_id}

Request Message

Table 1 Request parameter

Parameter

Type

Mandatory

Description

subnet

dict

Yes

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

This parameter has no mandatory fields. You must specify at least one attribute when updating the subnet.

Response Message

Table 2 Response parameter

Parameter

Type

Description

subnet

dict

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

Example:

Example request

PUT /v2.0/subnets/98bac90c-0ba7-4a63-8995-097da9bead1c  
{
  "subnet": {
    "name": "subnet-test"
  }
}

Example response

{
    "subnet": {
        "name": "subnet-test",
        "cidr": "172.16.2.0/24",
        "id": "98bac90c-0ba7-4a63-8995-097da9bead1c",
        "enable_dhcp": true,
        "network_id": "0133cd73-34d4-4d4c-bf1f-e65b24603206",
        "tenant_id": "bbfe8c41dd034a07bebd592bf03b4b0c",
        "project_id": "bbfe8c41dd034a07bebd592bf03b4b0c",
        "dns_nameservers": [],
        "allocation_pools": [
            {
                "start": "172.16.2.2",
                "end": "172.16.2.251"
            }
        ],
        "host_routes": [],
        "ip_version": 4,
        "gateway_ip": "172.16.2.1",
        "created_at": "2018-09-20T02:02:16",
        "updated_at": "2018-09-20T02:03:03"
    }
}

Status Codes

For details, see section Status Codes.