Modify Subnet Attributes

Last updated: 2017-12-05 15:56:54

1. API Description

This API (ModifySubnetAttribute) is used to modify subnet attribute.
Domain for API request:vpc.api.qcloud.com

Currently you can only modify names in the subnet attributes.

2. Input Parameters

The following request parameter list only provides API request parameters. Common request parameters need to be added when the API is called. For more information, refer to Common Request Parameters. The Action field for this API is ModifySubnetAttribute.

Parameter Name Required Type Description
vpcId Yes String VPC ID of the subnet, which can be vpcId or unVpcId. unVpcId is recommended. You can query this through API DescribeVpcEx.
subnetId Yes String ID of the subnet to be modified. Both subnetId and unSubnetId are supported. unSubnetId is recommended. You can query this through the API DescribeSubnetEx.
subnetName Yes String Subnet name. You can specify any name you like, but its length should be limited to 60 characters.

3. Output Parameters

Parameter Name Type Description
code Int Common error code; 0: Succeeded; other values: Failed. For more information, please refer to Common Error Codes on the Error Code page.
message String Module error message description depending on API.

4. Error Code Table

The following error code list only provides the business logic error codes for this API. For additional common error codes, refer to VPC Error Codes.

Error Code Description
InvalidVpc.NotFound Invalid VPC. VPC resource does not exist. Please verify that the resource information you entered is correct. You can query the VPC via the API DescribeVpcEx.
InvalidSubnet.NotFound Invalid subnet. Subnet resource does not exist. Please verify that the resource information you entered is correct. You can query subnets via the API DescribeSubnetEx.
InvalidSubnetName Subnet name is invalid or is already used by another subnet under the VPC. You can specify any name you like, but its length should be limited to 60 characters.

5. Example

Input

  https://vpc.api.qcloud.com/v2/index.php?Action=ModifySubnetAttribute
  &<Common request parameters>
  &vpcId=vpc-2ari9m7h
  &subnetId=subnet-5gu2jxf4
  &subnetName=wikitttt

Output

{
    "code": 0,
    "message": ""
}