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}
Name |
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
Name |
Mandatory |
Type |
Description |
---|---|---|---|
subnet |
Yes |
subnet object |
Specifies the subnet objects. |
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 |
|
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
Name |
Type |
Description |
---|---|---|
subnet |
subnet 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.
Error Code
See Error Codes.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot