Creates an access control list (ACL) rule.
Debugging
Authorization information
The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action
policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:
- Operation: the value that you can use in the Action element to specify the operation on a resource.
- Access level: the access level of each operation. The levels are read, write, and list.
- Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
- The required resource types are displayed in bold characters.
- If the permissions cannot be granted at the resource level,
All Resources
is used in the Resource type column of the operation.
- Condition Key: the condition key that is defined by the cloud service.
- Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
Operation | Access level | Resource type | Condition key | Associated operation |
---|---|---|---|---|
smartag:AddACLRule | Write |
|
| none |
Request parameters
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
RegionId | string | Yes | The ID of the region where the ACL is deployed. You can call the DescribeRegions operation to query the most recent region list. | cn-shanghai |
AclId | string | Yes | The ID of the ACL. | acl-xhwhyuo43l0n***** |
Description | string | No | The description of the ACL rule. The description must be 1 to 512 characters in length. | desctest |
Direction | string | Yes | The direction of traffic in which the ACL rule is applied. Valid values:
| in |
SourceCidr | string | Yes | The range of the source IP addresses. Specify the value of this parameter in CIDR notation. Example: 192.168.1.0/24. | 192.168.20.0/24 |
DestCidr | string | Yes | The range of the destination IP addresses. Specify the value of this parameter in CIDR notation. Example: 192.168.10.0/24. | 192.168.10.0/24 |
IpProtocol | string | Yes | The protocol used by the ACL rule. The protocols that are provided in this topic are for reference only. The protocols available in the SAG console may vary. The value of the parameter is not case-sensitive. | tcp |
SourcePortRange | string | Yes | The source port range. Valid values: 1 to 65535 and -1. Set the source port range in one of the following formats: 1/200 or 80/80. A value of -1/-1 indicates all ports. | 1/200 |
DestPortRange | string | Yes | The destination port range. Valid values: 1 to 65535 and -1. Set the destination port range in one of the following formats: 1/200 or 80/80. A value of -1/-1 indicates all ports. | 1/200 |
Policy | string | Yes | The action policy of the ACL rule. Valid values:
| accept |
Priority | integer | No | The priority of the ACL rule. A smaller value indicates a higher priority. If rules have the same priority, whichever applied to the SAG devices earlier takes effect. Valid values: 1 to 100. Default value: 1. | 12 |
Type | string | No | The type of the ACL rule: Valid values:
| LAN |
Name | string | No | The name of the ACL rule. The name must be 2 to 100 characters in length, and can contain letters, digits, periods (.), underscores (_), and hyphens (-). It must start with a letter. | doctest |
DpiSignatureIds | array | No | ||
string | No | The ID of the application. You can enter at most 100 application IDs in each call. | 1 | |
DpiGroupIds | array | No | ||
string | No | The ID of the application group. You can enter at most 100 application group IDs in each call. | 20 |
Response parameters
Examples
Sample success responses
JSON
format
{
"Policy": "drop",
"Description": "test",
"RequestId": "880F84CB-9B54-4413-A8A3-8832C82D1BC4",
"SourcePortRange": "1/65535",
"SourceCidr": "192.168.20.0/24",
"Priority": 1,
"AclId": "acl-xhwhyuo43l0*******",
"AcrId": "acr-c1hkd054qywi******",
"DestPortRange": "1/65535",
"Direction": "out",
"DpiGroupIds": {
"DpiGroupId": [
"20"
]
},
"Name": "doctest",
"Type": "LAN",
"GmtCreate": 1553766882689,
"DestCidr": "192.168.10.0/24",
"DpiSignatureIds": {
"DpiSignatureId": [
"1"
]
},
"IpProtocol": "TCP"
}
Error codes
HTTP status code | Error code | Error message | Description |
---|---|---|---|
400 | ACL.NoSupportWanType | An SAG 1000 device does not support a WAN ACL. | An SAG 1000 device does not support a WAN ACL. |
400 | ACL.InvalidType | The specified ACL type is invalid. | The specified ACL type is invalid. |
403 | Forbidden | User not authorized to operate on the specified resource. | You do not have permissions to manage the specified resource. |
403 | MissingParameter | The input parameter is missing, please check your input. | Missing parameters. Check whether all required parameters are set. |
403 | InvalidDescription | Description not valid. | The length of the description has exceeded the upper limit. |
403 | InvalidParameter | The specified parameter is invalid. | Invalid parameters. |
403 | FeatureNotSupport | The current edition of the smart access gateway does not support this feature. | The current version of Smart Access Gateway does not support this feature. |
403 | FeatureNotSupportForActiveSmartAG | The current edition of the active smart access gateway does not support this feature. | The current edition of the active SAG instance does not support this feature. |
403 | FeatureNotSupportForStandBySmartAG | The current edition of the standby smart access gateway does not support this feature. | The current version of Smart Access Gateway does not support this feature. |
403 | NotSupportedProtocol | The specified protocol of the ACL rule is not supported. | The specified protocol of the ACL rule is not supported. |
403 | InvalidId.ACL | The specified ACL ID is invalid. | The specified ACL group ID is invalid. |
403 | InvalidPortRange | The specified port range is invalid. | The specified port range is invalid. |
403 | AcrPerAclAmountLimit | The maximum number of rules in an ACL is exceeded. You can open a ticket to increase the quota. | The number of ACL rules has reached the upper limit of ACL rules that you can create under each ACL group. You can submit a ticket to request a quota increase. |
403 | InternalError | An internal server error occurred. | An internal server error occurred. |
For a list of error codes, visit the Service error codes.
Change history
Change time | Summary of changes | Operation |
---|