All Products
Search
Document Center

Virtual Private Cloud:DescribeNetworkAcls

Last Updated:Dec 06, 2023

Queries network access control lists (ACLs).

debugging

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

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.
OperationAccess levelResource typeCondition keyAssociated operation
vpc:DescribeNetworkAclsList
  • NetworkAcl
    acs:vpc:{#regionId}:{#accountId}:networkacl/*
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
NetworkAclIdstringNo

The ID of the network ACL.

nacl-bp1lhl0taikrbgnh****
NetworkAclNamestringNo

The name of the network ACL.

The name must be 1 to 128 characters in length, and cannot start with http:// or https://.

acl-1
VpcIdstringNo

The ID of the virtual private cloud (VPC) to which the network ACL belongs.

vpc-m5ebpc2xh64mqm27e****
ResourceTypestringNo

The type of the associated instance. Set the value to VSwitch.

This parameter is valid only if ResourceType and ResourceId are both set.

VSwitch
ResourceIdstringNo

The ID of the associated instance.

vsw-bp1de348lntdwnhbg****
PageNumberintegerNo

The number of the page to return. Default value: 1.

1
PageSizeintegerNo

The number of entries to return on each page. Maximum value: 50. Default value: 10.

10
RegionIdstringYes

The region ID of the network ACL.

You can call the DescribeRegions operation to query the most recent region list.

cn-hangzhou
Tagsobject []No
KeystringNo

The tag key. You can specify at most 20 tag keys. It cannot be an empty string.

The key cannot exceed 64 characters in length, and can contain digits, periods (.), underscores (_), and hyphens (-). The key must start with a letter but cannot start with aliyun or acs:. The key cannot contain http:// or https://.

FinanceDept
ValuestringNo

The tag value. You can specify at most 20 tag values. It can be an empty string.

The tag value cannot exceed 128 characters in length, and can contain digits, periods (.), underscores (_), and hyphens (-). It must start with a letter but cannot start with aliyun or acs:. It cannot contain http:// or https://.

FinanceJoshua
ClientTokenstringNo

The client token that you want to use to ensure the idempotence of the request.

You can use the client to generate the value, but you must make sure that the value is unique among different requests. ClientToken can contain only ASCII characters.

Note If you do not set this parameter, the system sets ClientToken to the value of RequestId. The value of RequestId for each API request may be different.
123e4567-e89b-12d3-a456-426655440000

Response parameters

ParameterTypeDescriptionExample
object
PageSizestring

The number of entries returned on each page.

10
RequestIdstring

The ID of the request.

F7DDDC17-FA06-4AC2-8F35-59D2470FCFC1
PageNumberstring

The page number of the returned page.

1
TotalCountstring

The total number of entries returned.

2
NetworkAclsobject []

The details about the network ACL.

Statusstring

The status of the network ACL. Valid values:

  • Available
  • Modifying
Available
VpcIdstring

The ID of the associated VPC.

vpc-m5ebpc2xh64mqm27e****
CreationTimestring

The time when the network ACL was created.

2021-12-25 11:44:17
Descriptionstring

The description of the network ACL.

This is my NetworkAcl.
NetworkAclNamestring

The name of the network ACL.

acl-1
NetworkAclIdstring

The ID of the network ACL.

nacl-a2do9e413e0spxscd****
OwnerIdlong

The ID of the Alibaba Cloud account to which the network ACL belongs.

253460731706911258
RegionIdstring

The region ID of the network ACL.

cn-hangzhou
IngressAclEntriesobject []

The inbound rules.

NetworkAclEntryIdstring

The ID of the inbound rule.

nae-a2dk86arlydmezasw****
NetworkAclEntryNamestring

The name of the inbound rule.

acl-3
Policystring

The action to be performed on network traffic that matches the rule. Valid values:

  • accept: allows network traffic.
  • drop: blocks network traffic.
accept
Descriptionstring

The description of the inbound rule.

This is IngressAclEntries.
SourceCidrIpstring

The source CIDR block.

10.0.0.0/24
Protocolstring

The protocol. Valid values:

  • icmp: ICMP
  • gre: GRE
  • tcp: TCP
  • udp: UDP
  • all: all protocols
all
Portstring

The destination port range of the inbound traffic.

  • If Protocol of the inbound rule is set to all, icmp, or gre, the port range is -1/-1, which indicates all ports.
  • If Protocol of the inbound rule is set to tcp or udp, the port range is in the following format: 1/200 or 80/80. 1/200 indicates port 1 to port 200. 80/80 indicates port 80. Valid values for a port: 1 to 65535.
-1/-1
EgressAclEntriesobject []

The outbound rules.

NetworkAclEntryIdstring

The ID of the outbound rule.

nae-a2d447uw4tillfvgb****
NetworkAclEntryNamestring

The name of the outbound rule.

acl-2
Policystring

The action to be performed on network traffic that matches the rule. Valid values:

  • accept: allows network traffic.
  • drop: blocks network traffic.
accept
Descriptionstring

The description of the outbound rule.

This is EgressAclEntries.
Protocolstring

The protocol. Valid values:

  • icmp: ICMP
  • gre: GRE
  • tcp: TCP
  • udp: UDP
  • all: all protocols
all
DestinationCidrIpstring

The destination CIDR block.

10.0.0.0/24
Portstring

The destination port range of the outbound traffic.

  • If Protocol of the outbound rule is set to all, icmp, or gre, the port range is -1/-1, which specifies all ports.
  • If Protocol of the outbound rule is set to tcp or udp, the port range is in the following format: 1/200 or 80/80. 1/200 indicates port 1 to port 200. 80/80 indicates port 80. Valid values for a port: 1 to 65535.
-1/-1
Resourcesobject []

The resources that are associated with the network ACL.

Statusstring

The association status of the resource. Valid values:

  • BINDED: associated
  • BINDING: being associated
  • UNBINDING: disassociated
BINDED
ResourceTypestring

The type of the associated resource.

VSwitch
ResourceIdstring

The ID of the associated resource.

vsw-bp1de348lntdwcdf****
Tagsobject []

The tag list.

Keystring

The tag key.

FinanceDept
Valuestring

The tag value.

FinanceJoshua

Examples

Sample success responses

JSONformat

{
  "PageSize": "10",
  "RequestId": "F7DDDC17-FA06-4AC2-8F35-59D2470FCFC1",
  "PageNumber": "1",
  "TotalCount": "2",
  "NetworkAcls": {
    "NetworkAcl": [
      {
        "Status": "Available",
        "VpcId": "vpc-m5ebpc2xh64mqm27e****",
        "CreationTime": "2021-12-25 11:44:17",
        "Description": "This is my NetworkAcl.",
        "NetworkAclName": "acl-1",
        "NetworkAclId": "nacl-a2do9e413e0spxscd****",
        "OwnerId": 253460731706911260,
        "RegionId": "cn-hangzhou",
        "IngressAclEntries": {
          "IngressAclEntry": [
            {
              "NetworkAclEntryId": "nae-a2dk86arlydmezasw****",
              "NetworkAclEntryName": "acl-3\t",
              "Policy": "accept",
              "Description": "This is IngressAclEntries.",
              "SourceCidrIp": "10.0.0.0/24\t",
              "Protocol": "all",
              "Port": "-1/-1\t"
            }
          ]
        },
        "EgressAclEntries": {
          "EgressAclEntry": [
            {
              "NetworkAclEntryId": "nae-a2d447uw4tillfvgb****",
              "NetworkAclEntryName": "acl-2\t",
              "Policy": "accept",
              "Description": "This is EgressAclEntries.",
              "Protocol": "all",
              "DestinationCidrIp": "10.0.0.0/24\t",
              "Port": "-1/-1\t"
            }
          ]
        },
        "Resources": {
          "Resource": [
            {
              "Status": "BINDED",
              "ResourceType": "VSwitch",
              "ResourceId": "vsw-bp1de348lntdwcdf****"
            }
          ]
        },
        "Tags": {
          "Tag": [
            {
              "Key": "FinanceDept",
              "Value": "FinanceJoshua"
            }
          ]
        }
      }
    ]
  }
}

Error codes

HTTP status codeError codeError messageDescription
400ParameterMissing.AliUidParameterMissing.AliUid-
400ParameterMissing.BidParameterMissing.Bid-
400ParameterMissing.RegionIdParameterMissing.RegionId-
400ParameterEmpty.RegionIdParameterEmpty.RegionId-
400NotSupport.NetworkAclNetwork acl is not support now.-
500InternalErrorThe request processing has failed due to some unknown error.An unknown error occurred.

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

Change history

Change timeSummary of changesOperation
2023-11-24The error codes of the API operation change.,The response structure of the API operation changes.see changesets
Change itemChange content
Error CodesThe error codes of the API operation change.
    delete Error Codes: 400
    delete Error Codes: 500
Output ParametersThe response structure of the API operation changes.
2023-05-09The error codes of the API operation change.see changesets
Change itemChange content
Error CodesThe error codes of the API operation change.
    delete Error Codes: 400
    delete Error Codes: 500