All Products
Search
Document Center

Cloud Firewall:DescribeNatFirewallControlPolicy

Last Updated:Sep 02, 2024

Queries the information about all access control policies that are created for NAT firewalls.

Operation description

You can use this operation to query the information about all access control policies that are created for NAT firewalls by page.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer.

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.
OperationAccess levelResource typeCondition keyAssociated operation
yundun-cloudfirewall:DescribeNatFirewallControlPolicylist
  • All Resources
    *
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
LangstringNo

The language of the content within the response. Valid values:

  • zh: Chinese (default)
  • en: English
zh
NatGatewayIdstringYes

The ID of the NAT gateway.

ngw-xxxxxx
CurrentPagestringNo

The page number.

1
PageSizestringNo

The number of entries per page. Default value: 10.

10
SourcestringNo

The source address in the access control policy. Fuzzy match is supported. The value of this parameter varies based on the value of the SourceType parameter.

  • If SourceType is set to net, the value of Source must be a CIDR block. Example: 192.0.XX.XX/24.
  • If SourceType is set to group, the value of Source must be the name of an address book. Example: db_group. If the db_group address book does not contain addresses, all source addresses are queried.
  • If SourceType is set to location, the value of Source must be a location. Example: beijing.
Note If you do not specify this parameter, all types of source addresses are queried.
1.1.1.1/32
DestinationstringNo

The destination address in the access control policy. Fuzzy match is supported. The value of this parameter varies based on the value of the DestinationType parameter.

  • If DestinationType is set to net, the value of Destination must be a CIDR block. Example: 10.0.3.0/24.
  • If DestinationType is set to domain, the value of Destination must be a domain name. Example: aliyun.
  • If DestinationType is set to group, the value of Destination must be the name of an address book. Example: db_group.
  • If DestinationType is set to location, the value of Destination is a location. For more information about location codes, see AddControlPolicy . Example: ["BJ11", "ZB"].
Note If you do not specify this parameter, all types of destination addresses are queried.
x.x.x.x/32
DescriptionstringNo

The description of the access control policy. Fuzzy match is supported.

Note If you do not specify this parameter, the descriptions of all policies are queried.
test
ProtostringNo

The type of the protocol in the access control policy. Valid values:

  • TCP
  • UDP
  • ICMP
  • ANY: all types of protocols
Note If you do not specify this parameter, access control policies of all protocol types are queried.
ANY
AclActionstringNo

The action that Cloud Firewall performs on the traffic.

Valid values:

  • accept: allows the traffic.
  • drop: denies the traffic.
  • log: monitors the traffic.
accept
AclUuidstringNo

The UUID of the access control policy.

303f0697-2a21-4e43-b142-4a77adf7b358
ReleasestringNo

Specifies whether the access control policy is enabled. By default, an access control policy is enabled after it is created. Valid values:

  • true
  • false
true
DirectionstringYes

The direction of the traffic to which the access control policy applies. Valid values:

  • out: outbound traffic
out
RepeatTypestringNo

The recurrence type for the access control policy to take effect. Valid values:

  • Permanent (default): The policy always takes effect.
  • None: The policy takes effect only once.
  • Daily: The policy takes effect on a daily basis.
  • Weekly: The policy takes effect on a weekly basis.
  • Monthly: The policy takes effect on a monthly basis.
Permanent

Response parameters

ParameterTypeDescriptionExample
object
TotalCountstring

The total number of entries returned.

28
RequestIdstring

The request ID.

F183567D-8A52-5BAE-9472-F1C427378C28
Policysarray<object>

The information about the access control policies.

object
Destinationstring

The destination address in the access control policy. The value of this parameter varies based on the value of DestinationType. Valid values:

  • If the value of DestinationType is net, the value of this parameter is a CIDR block. Example: 192.0.XX.XX/24.
  • If the value of DestinationType is domain, the value of this parameter is a domain name. Example: aliyuncs.com.
  • If the value of DestinationType is group, the value of this parameter is the name of an address book. Example: db_group.
  • If the value of DestinationType is location, the value of this parameter is a location. For more information about location codes, see AddControlPolicy . Example: ["BJ11", "ZB"].
x.x.x.x/32
Orderinteger

The priority of the access control policy.

The priority value starts from 1. A smaller priority value indicates a higher priority.

1
DestPortGroupstring

The name of the destination port address book in the access control policy.

my_port_group
SourceTypestring

The type of the source address in the access control policy. Valid values:

  • net: CIDR block
  • group: address book
  • location: location
net
DnsResultTimelong

The time when the Domain Name System (DNS) resolution was performed. The value is a UNIX timestamp. Unit: seconds.

1579261141
DnsResultstring

The DNS resolution result.

111.0.XX.XX,112.0.XX.XX
ApplicationNameListarray

The application names.

string

The application name.

['HTTP', 'HTTPS']
AclUuidstring

The UUID of the access control policy.

00281255-d220-4db1-8f4f-c4df221a****
DestPortTypestring

The type of the destination port in the access control policy. Valid values:

  • port: port
  • group: port address book
port
Sourcestring

The source address in the access control policy. Valid values:

  • If the value of SourceType is net, the value of this parameter is a CIDR block. Example: 192.0.XX.XX/24.
  • If the value of SourceType is group, the value of this parameter is the name of an address book. Example: db_group.
  • If the value of SourceType is location, the value of this parameter is a location. For more information about location codes, see AddControlPolicy . Example: ["BJ11", "ZB"].
192.0.XX.XX/24
DestinationTypestring

The type of the destination address in the access control policy. Valid values:

  • net: CIDR block
  • group: address book
  • domain: domain name
  • location: location
net
HitTimesinteger

The number of hits for the access control policy.

100
HitLastTimelong

The time when the access control policy was last hit. The value is a UNIX timestamp. Unit: seconds.

1579261141
DestPortstring

The destination port in the access control policy.

80
Descriptionstring

The description of the access control policy.

test
AclActionstring

The action that Cloud Firewall performs on the traffic. Valid values:

  • accept: allows the traffic.
  • drop: denies the traffic.
  • log: monitors the traffic.
accept
Protostring

The protocol type in the access control policy. Valid values:

  • ANY
  • TCP
  • UDP
  • ICMP
TCP
DestinationGroupCidrsarray

The CIDR blocks in the destination address book.

string

The CIDR block in the destination address book.

[ "112.0.XX.XX/24", "112.0.XX.XX/32" ]
DestPortGroupPortsarray

The ports in the destination port address book.

string

The port in the destination port address book.

[80,443]
SourceGroupCidrsarray

The CIDR blocks in the source address book.

string

The CIDR block in the source address book.

['192.0.XX.XX/24', '192.0.XX.XX/32']
Releasestring

The status of the access control policy. By default, an access control policy is enabled after it is created. Valid values:

  • true: enabled
  • false: disabled
true
SourceGroupTypestring

The type of the source address book in the access control policy. The value is fixed as ip. The value indicates an address book that includes one or more CIDR blocks.

ip
DestinationGroupTypestring

The type of the destination address book in the access control policy. Valid values:

  • ip: an address book that includes one or more CIDR blocks
  • domain: an address book that includes one or more domain names
ip
NatGatewayIdstring

The ID of the NAT gateway.

ngw-xxxxxx
DomainResolveTypeinteger

The domain name resolution method of the access control policy. By default, an access control policy is enabled after the policy is created. Valid values:

  • 0: fully qualified domain name (FQDN)-based resolution
  • 1: DNS-based dynamic resolution
  • 2: FQDN and DNS-based dynamic resolution
1
SpreadCntstring

The total quota consumed by the returned access control policies, which is the sum of the quota consumed by each policy. The quota that is consumed by an access control policy is calculated by using the following formula: Quota that is consumed by an access control policy = Number of source addresses (number of CIDR blocks or regions) × Number of destination addresses (number of CIDR blocks, regions, or domain names) × Number of port ranges × Number of applications.

10,000
CreateTimelong

The time when the access control policy was created.

1761062400
ModifyTimelong

The time when the access control policy was modified.

1761062400
RepeatTypestring

The recurrence type for the access control policy to take effect. Valid values:

  • Permanent (default): The policy always takes effect.
  • None: The policy takes effect for only once.
  • Daily: The policy takes effect on a daily basis.
  • Weekly: The policy takes effect on a weekly basis.
  • Monthly: The policy takes effect on a monthly basis.
Permanent
RepeatDaysarray

The days of a week or of a month on which the access control policy takes effect.

  • If RepeatType is set to Permanent, None, or Daily, the value of this parameter is an empty array. Example: [].
  • If RepeatType is set to Weekly, this parameter must be specified. Example: [0, 6].
Note If RepeatType is set to Weekly, the fields in the value of this parameter cannot be repeated.
  • If RepeatType is set to Monthly, this parameter must be specified. Example: [1, 31].
Note If RepeatType is set to Monthly, the fields in the value of this parameter cannot be repeated.
long

The day of a week or of a month on which the access control policy takes effect.

Note If RepeatType is set to Weekly, valid values of this parameter are 0 to 6. Each week starts from Sunday. If RepeatType is set to Monthly, valid values of this parameter are 1 to 31.
1
RepeatStartTimestring

The point in time when the recurrence starts. Example: 08:00. The start time must be on the hour or on the half hour, and at least 30 minutes earlier than the end time.

Note If RepeatType is set to Permanent or None, this parameter is left empty. If RepeatType is set to Daily, Weekly, or Monthly, this parameter must be specified.
08:00
RepeatEndTimestring

The point in time when the recurrence ends. Example: 23:30. The end time must be on the hour or on the half hour, and at least 30 minutes later than the start time.

Note If RepeatType is set to Permanent or None, this parameter is left empty. If RepeatType is set to Daily, Weekly, or Monthly, this parameter must be specified.
23:30
StartTimelong

The time when the access control policy starts to take effect. The value is a UNIX timestamp. Unit: seconds. The start time must be on the hour or on the half hour, and at least 30 minutes earlier than the end time.

Note If RepeatType is set to Permanent, this parameter is left empty. If RepeatType is set to None, Daily, Weekly, or Monthly, this parameter must be specified.
1694761200
EndTimelong

The time when the access control policy stops taking effect. The value is a UNIX timestamp. Unit: seconds. The end time must be on the hour or on the half hour, and at least 30 minutes later than the start time.

Note If RepeatType is set to Permanent, this parameter is left empty. If RepeatType is set to None, Daily, Weekly, or Monthly, this parameter must be specified.
1694764800

Examples

Sample success responses

JSONformat

{
  "TotalCount": "28",
  "RequestId": "F183567D-8A52-5BAE-9472-F1C427378C28",
  "Policys": [
    {
      "Destination": "x.x.x.x/32",
      "Order": 1,
      "DestPortGroup": "my_port_group",
      "SourceType": "net",
      "DnsResultTime": 1579261141,
      "DnsResult": "111.0.XX.XX,112.0.XX.XX",
      "ApplicationNameList": [
        "['HTTP', 'HTTPS']"
      ],
      "AclUuid": "00281255-d220-4db1-8f4f-c4df221a****",
      "DestPortType": "port",
      "Source": "192.0.XX.XX/24",
      "DestinationType": "net",
      "HitTimes": 100,
      "HitLastTime": 1579261141,
      "DestPort": "80",
      "Description": "test",
      "AclAction": "accept",
      "Proto": "TCP",
      "DestinationGroupCidrs": [
        "[\n      \"112.0.XX.XX/24\",\n      \"112.0.XX.XX/32\"\n]"
      ],
      "DestPortGroupPorts": [
        "[80,443]"
      ],
      "SourceGroupCidrs": [
        "['192.0.XX.XX/24', '192.0.XX.XX/32']"
      ],
      "Release": "true",
      "SourceGroupType": "ip",
      "DestinationGroupType": "ip",
      "NatGatewayId": "ngw-xxxxxx",
      "DomainResolveType": 1,
      "SpreadCnt": "10,000",
      "CreateTime": 1761062400,
      "ModifyTime": 1761062400,
      "RepeatType": "Permanent",
      "RepeatDays": [
        1
      ],
      "RepeatStartTime": "08:00",
      "RepeatEndTime": "23:30",
      "StartTime": 1694761200,
      "EndTime": 1694764800
    }
  ]
}

Error codes

HTTP status codeError codeError messageDescription
400ErrorParametersUidThe aliUid parameter is invalid.The aliUid parameter is invalid.
400ErrorParametersPageSizeOrNoEither pageSize or pageNo is invalid.Either pageSize or pageNo is invalid.
400ErrorParameterIpVersionThe IP version is invalid.The IP version is invalid.
400ErrorParametersDirectionThe direction is invalid.The direction is invalid.
400ErrorDBSelectAn error occurred while querying database.An error occurred while querying database.
400ErrorUnmarshalJSONAn error occurred while parsing JSON.An error occurred while decoding JSON.

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
2024-07-31The Error code has changedView Change Details
2024-03-13The Error code has changedView Change Details
2023-10-12The Error code has changed. The request parameters of the API has changed. The response structure of the API has changedView Change Details
2023-08-29The Error code has changedView Change Details