Adds an access control rule.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
smartag:AddACLRule |
create |
*Acl
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| RegionId |
string |
Yes |
The ID of the region where the access control list (ACL) is located. For more information, see DescribeRegions. |
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 to which the ACL rule applies. Valid values:
|
in |
| SourceCidr |
string |
Yes |
The source CIDR block. For example: 192.168.1.0/24. |
192.168.20.0/24 |
| DestCidr |
string |
Yes |
The destination CIDR block. For example: 192.168.10.0/24. |
192.168.10.0/24 |
| IpProtocol |
string |
Yes |
The protocol to which the ACL rule applies. For a list of supported protocols, see the console. The protocol is not case-sensitive. |
tcp |
| SourcePortRange |
string |
Yes |
The source port range. Valid values: -1 and 1 to 65535. Use the format 1/200 or 80/80. A value of -1/-1 means all ports. |
1/200 |
| DestPortRange |
string |
Yes |
The destination port range. Valid values: -1 and 1 to 65535. Use the format 1/200 or 80/80. A value of -1/-1 means all ports. |
1/200 |
| Policy |
string |
Yes |
The authorization 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 multiple rules have the same priority, the rule that is first delivered to the Smart Access Gateway device takes precedence. 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, start with a letter, and can contain digits, periods (.), underscores (_), and hyphens (-). |
doctest |
| DpiSignatureIds |
array |
No |
A list of application IDs. The ACL rule matches traffic of the specified applications. For more information, see ListDpiSignatures. You can specify up to 10 application IDs. |
1 |
|
string |
No |
The application ID. You can specify up to 100 application IDs. |
1 |
|
| DpiGroupIds |
array |
No |
A list of application group IDs. The ACL rule matches traffic of the specified application groups. For more information, see ListDpiGroups. You can specify up to 10 application group IDs. |
20 |
|
string |
No |
The application group ID. You can specify up to 100 application group IDs. |
20 |
Response parameters
|
Parameter |
Type |
Description |
Example |
|
object |
|||
| Policy |
string |
The authorization policy of the ACL rule.
|
drop |
| Description |
string |
The description of the ACL rule. |
test |
| RequestId |
string |
The request ID. |
880F84CB-9B54-4413-A8A3-8832C82D1BC4 |
| SourcePortRange |
string |
The source port range. |
1/65535 |
| SourceCidr |
string |
The source CIDR block. The source CIDR block is in the CIDR format. For example: 192.168.1.0/24. |
192.168.20.0/24 |
| Priority |
integer |
The priority of the ACL rule. A smaller value indicates a higher priority. If multiple rules have the same priority, the rule that is first delivered to the Smart Access Gateway device takes precedence. |
1 |
| AclId |
string |
The ID of the ACL. |
acl-xhwhyuo43l0******* |
| AcrId |
string |
The ID of the ACL rule. |
acr-c1hkd054qywi****** |
| DestPortRange |
string |
The destination port range. |
1/65535 |
| Direction |
string |
The direction of traffic to which the ACL rule applies. Valid values:
|
out |
| DpiGroupIds |
object |
||
| DpiGroupId |
array |
||
|
string |
A list of application group IDs that the ACL rule matches. |
20 |
|
| Name |
string |
The name of the ACL rule. |
doctest |
| Type |
string |
The type of the ACL rule.
|
LAN |
| GmtCreate |
integer |
The UNIX timestamp when the ACL rule was created. This value is a long integer. If rules have the same priority, the one with the earlier timestamp takes precedence. |
1553766882689 |
| DestCidr |
string |
The destination CIDR block. For example: 192.168.10.0/24. |
192.168.10.0/24 |
| DpiSignatureIds |
object |
||
| DpiSignatureId |
array |
||
|
string |
A list of application IDs that the ACL rule matches. |
1 |
|
| IpProtocol |
string |
The protocol to which the ACL rule applies. |
TCP |
Examples
Success response
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. |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.