24 KiB
- original_name
vpc_subnet01_0004.html
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 <vpc_subnet01_0004__table27806533>
describes the parameters.
Name | Mandatory | Description |
---|---|---|
project_id | Yes | Specifies the 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
Name | Mandatory | Type | Description |
---|---|---|---|
subnet | Yes | subnet <vpc_subnet01_0004__table45027976> object |
Specifies the subnet objects <vpc_subnet01_0004__table45027976> . |
Name | 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 |
|
extra_dhcp_opts | No | Array of extra_dhcp_opt <vpc_subnet01_0004__table019517383270> objects |
Specifies the NTP server address configured for the subnet. For details, see Table 4 <vpc_subnet01_0004__table019517383270> . |
Name | Mandatory | Type | Description |
---|---|---|---|
opt_value | No | String |
|
opt_name | Yes | String |
|
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", "extra_dhcp_opts": [ { "opt_value": "10.100.0.33,10.100.0.34", "opt_name": "ntp" } ] } }
Response Parameters
Name | Type | Description |
---|---|---|
subnet | subnet <vpc_subnet01_0004__table1210700> object |
Specifies the subnet objects. |
Name | 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 <vpc_api_0002>
.
Error Code
See Error Codes <vpc_api_0003>
.