Update subnet
Updates the specified subnet.
URI
/v2.0/subnets/{subnet_id}
Description of the URI:
{subnet_id}: The UUID of the subnet.
HTTP method
PUT
Request parameter
| Key | Description | Type | Required/optional | 
|---|---|---|---|
| name | The subnet name. | xsd:string | Optional | 
| gateway_ip | The gateway IP address. | xsd:string | Optional | 
| enable_dhcp | Set to "true" if DHCP is enabled, or "false" otherwise. | xsd:boolean | Optional | 
| dns_nameservers | A list of DNS name servers for the subnet. For example ["8.8.8.7", "8.8.8.8"].  | 
             xsd:string | Optional | 
| host_routes | A list of host route dictionaries for the subnet. For example:
               | 
             xsd:list | Optional | 
CAUTION:
For a subnet for use with the Window virtual server for SAP service or the physical server for SAP HANA service, please take note of the following points.
- It is not possible to change the string "fcx_subnet-w:" or "fcx_subnet-b:" at the start of the name parameter.
 - gateway_ip cannot be changed.
 - The information specified for host_routes, enable_dhcp, and dns_nameservers is not set for the servers (VMs) created in the Windows virtual server for SAP service or the physical server for SAP HANA service.
 
CAUTION:
When updating a subnet that uses an SSL-VPN connection, take note of the following points.
- Do not delete gateway_ip (change it to null).
 
CAUTION:
When updating host_routes, take note of the following points.
- After update, to reflect the changes on any running VMs it is necessary to restart those VMs.
 - If the subnet is specified when creating or adding a load balancer, after update it is necessary to re-create the relevant load balancer to reflect the changes.
 
Example request
{
    "subnet": {
        "name": "my_subnet"
    }
}    
     
     
   Response status
| Status code | Description | 
|---|---|
| 200 | Normal response codes | 
| badRequest (400) | Error response codes | 
| unauthorized (401) | Error response codes | 
| forbidden (403) | Error response codes | 
| itemNotFound (404) | Error response codes | 
Response body (normal status)
       {
        "subnet": {
         "name": "private-subnet",
         "enable_dhcp": true,
         "network_id": "db193ab3-96e3-4cb3-8fc5-05f4296d0324",
         "tenant_id": "26a7980765d0414dbc1fc1f88cdb7e6e",
         "dns_nameservers": [],
         "gateway_ip": "10.0.0.1",
         "ipv6_ra_mode": null,
         "allocation_pools": [
          {
           "start": "10.0.0.2",
           "end": "10.0.0.254"
          }
         ],
         "host_routes": [],
         "ip_version": 4,
         "ipv6_address_mode": null,
         "cidr": "10.0.0.0/24",
         "id": "08eae331-0402-425a-923c-34f7cfe39c1b",  
         "subnetpool_id": null,
         "availability_zone": "AZ1"
        }
       }
      
    Description of response body (normal status)
| Item | Description | 
|---|---|
| name | The subnet name. | 
| enable_dhcp | Set to "true" if DHCP is enabled, or "false" otherwise. | 
| network_id | The ID of the attached network. | 
| tenant_id | The ID of the project who owns the network. | 
| dns_nameservers | A list of DNS name servers for the subnet.  For example ["8.8.8.7", "8.8.8.8"].  | 
            
| allocation_pools | The start and end addresses for the allocation pools. | 
| host_routes | A list of host route dictionaries for the subnet. For example: | 
            
| ip_version | The IP version, which can be 4 or 6. | 
| gateway_ip | The gateway IP address. | 
| cidr | The CIDR. | 
| id | The ID of the subnet. | 
| availability_zone | The Availability Zone name. | 
| ipv6_ra_mode | This attribute is used to specify if the Networking service should transmit ICMPv6 packets, for a subnet. This value is null.  | 
            
| ipv6_address_mode | This attribute is used to control how addressing is handled by OpenStack. There are a number of different ways that guest instances can obtain an IPv6 address, and this attribute exposes these choices to users of the Networking API. This value is null.  | 
            
| subnetpool_id | The UUID of the subnet pool. This value is null.  |