Updating Subnet Information
Function
This API is used to update information about a subnet.
URI
PUT /v1/{project_id}/vpcs/{vpc_id}/subnets/{subnet_id}
Table 1 describes the parameters.
Parameter | Mandatory | Description |
---|---|---|
project_id | Yes | Specifies the project ID. For details about how to obtain a project ID, see Obtaining a Project ID. |
vpc_id | Yes | Specifies the VPC ID of the subnet. |
subnet_id | Yes | Specifies the subnet ID that uniquely identifies the subnet. If you use the management console, the value of this parameter is the Network ID value. |
Request Parameters
Parameter | Mandatory | Type | Description |
---|---|---|---|
subnet | Yes | subnet object | Specifies the subnet objects. |
Parameter | Mandatory | Type | Description |
---|---|---|---|
name | Yes | String |
|
description | No | String |
|
ipv6_enable | No | Boolean |
|
dhcp_enable | No | Boolean |
|
primary_dns | No | String |
|
secondary_dns | No | String |
|
dnsList | No | Array of strings |
|
Example Request
- Change the name of the subnet whose ID is 4779ab1c-7c1a-44b1-a02e-93dfc361b32d to subnet02, and also change its DNS and DHCP configurations.PUT https://{Endpoint}/v1/{project_id}/vpcs/{vpc_id}/subnets/4779ab1c-7c1a-44b1-a02e-93dfc361b32d{"subnet": {"name": "subnet02","ipv6_enable": true,"dhcp_enable": false,"primary_dns": "114.xx.xx.115","secondary_dns": "114.xx.xx.116"}}
Response Parameters
Parameter | Type | Description |
---|---|---|
subnet | subnet object | Specifies the subnet objects. |
Parameter | Type | Description |
---|---|---|
id | String | Specifies a resource ID in UUID format. |
status | String |
|
Example Response
{"subnet": {"id": "4779ab1c-7c1a-44b1-a02e-93dfc361b32d","status": "ACTIVE"}}
Status Code
See Status Codes.
Error Code
See Error Codes.
- Function
- URI
- Request Parameters
- Example Request
- Response Parameters
- Example Response
- Status Code
- Error Code