Updating Subnet Information
Function
This API is used to update information about a subnet.
Authorization Information
Each account has all the permissions required to call all APIs, but IAM users must be assigned the required permissions.
- If you are using role/policy-based authorization, see the required permissions in Permissions and Supported Actions.
- If you are using identity policy-based authorization, the following identity policy-based permissions are required.
Action
Access Level
Resource Type (*: required)
Condition Key
Alias
Dependencies
vpc:subnets:update
Write
subnet *
- g:ResourceTag/<tag-key>
- vpc:SubnetId
- vpc:VpcId
- vpc:AvailabilityZone
- g:EnterpriseProjectId
-
-
-
vpc:SubnetIpv6Enable
URI
PUT /v1/{project_id}/vpcs/{vpc_id}/subnets/{subnet_id}
|
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 |
|
|
enable_network_address_usage_metrics |
No |
Boolean |
|
|
primary_dns |
No |
String |
For instructions about how to obtain a private DNS server address, see What Are the Private DNS Server Addresses Provided by the DNS Service? For instructions about how to obtain a DNS server address, see Querying Name Servers. |
|
secondary_dns |
No |
String |
For instructions about how to obtain a private DNS server address, see What Are the Private DNS Server Addresses Provided by the DNS Service? For instructions about how to obtain a DNS server address, see Querying Name Servers. |
|
dnsList |
No |
Array of strings |
For instructions about how to obtain a private DNS server address, see What Are the Private DNS Server Addresses Provided by the DNS Service? For instructions about how to obtain a DNS server address, see Querying Name Servers. |
|
extra_dhcp_opts |
No |
Array of extra_dhcp_opt objects |
Specifies the NTP server address or DHCP lease time configured for the subnet. For details, see Table 4. |
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" }, { "opt_value": "24h", "opt_name": "addresstime" }, { "opt_value": "2h", "opt_name": "ipv6_addresstime" } ] "enable_network_address_usage_metrics": false } }
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.
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