Bind a Network ACL with Subnets

Last updated: 2019-11-29 19:53:10

PDF

1. API Description

This API (CreateSubnetAclRule) is used to associate a network ACL with subnets.
API request domain name: vpc.api.qcloud.com

2. Input Parameters

Below is a list of API request parameters. You need to add common request parameters to your request when calling this API. For more information, see the Common Request Parameters page. The Action field for this API is CreateSubnetAclRule.

Parameter name Required Type Description
vpcId Yes String ID of the VPC to which the subnet belongs, which can be the vpcId or unVpcId (recommended), for example vpc-erxok83l. You can query the ID through the API DescribeVpcEx.
networkAclId Yes String Network ACL ID assigned by the system, for example: acl-e9dbyl8s. You can query the ID through the API DescribeNetworkAcl.
subnetIds.n Yes Array List of subnet IDs assigned by the system, for example: subnet-i6mdq6ra. Both the subnetId and unSubnetId are supported. unSubnetId is recommended. You can query the list through the API DescribeSubnetEx.

3. Output Parameters

Parameter name Type Description
code Int Error code. 0: Successful; other values: Failed.
message String Error message.

4. Error Codes

The following error codes only include business logic error codes for this API. For additional common error codes, see VPC Error Codes.

Error code Description
InvalidVpc.NotFound Invalid VPC. This error code indicates that the VPC does not exist. In this case, verify whether the resource information that you entered is correct. You can query the VPC through the API DescribeVpcEx.
InvalidNetworkAclID.NotFound Invalid network ACL ID. This error code indicates that the Network ACL ID does not exist. In this case, verify whether the resource information that you entered is correct. You can query this ID through the API DescribeNetworkAcl.

5. Sample

Input

  https://vpc.api.qcloud.com/v2/index.php?Action=CreateSubnetAclRule
  &<Common Request Parameters>
  &vpcId=vpc-erxok83l
  &networkAclId=acl-e9dbyl8s
  &subnetIds.0=subnet-i6mdq6ra

Output


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