All Products
Search
Document Center

Virtual Private Cloud:DescribeNetworkAcls

Last Updated:Aug 29, 2024

Queries network ACLs.

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
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 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 specified.

VSwitch
ResourceIdstringNo

The ID of the associated instance.

vsw-bp1de348lntdwnhbg****
PageNumberintegerNo

The page number. Default value: 1.

1
PageSizeintegerNo

The number of entries per 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
Tagsarray<object>No

The tag list.

objectNo
KeystringNo

The key of tag N to add to the resource. You can specify up to 20 tag keys. The tag key cannot be an empty string.

The tag key can be up to 128 characters in length. It cannot start with aliyun or acs:, and cannot contain http:// or https://.

FinanceDept
ValuestringNo

The value of tag N to add to the resource. You can specify at most 20 tag values. The tag value can be an empty string.

The tag value can be up to 128 characters in length and cannot contain http:// or https://. The tag value cannot start with aliyun or acs:.

FinanceJoshua
ClientTokenstringNo

The client token that is used to ensure the idempotence of the request.

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

Note If you do not specify this parameter, the system automatically uses the request ID as the client token. The request ID may be different for each request.
123e4567-e89b-12d3-a456-426655440000

Response parameters

ParameterTypeDescriptionExample
object
PageSizestring

The number of entries per page.

10
RequestIdstring

The request ID.

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

The page number.

1
TotalCountstring

The number of entries returned.

2
NetworkAclsarray<object>

The details of the network ACLs.

object
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
IngressAclEntriesarray<object>

The configurations of the inbound rules.

object
NetworkAclEntryIdstring

The ID of the inbound rule.

nae-a2dk86arlydmezasw****
EntryTypestring

The type of the inbound rule.

  • custom

  • system

custom
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
  • drop
accept
Descriptionstring

The description of the inbound rule.

This is IngressAclEntries.
SourceCidrIpstring

The source CIDR block.

10.0.0.0/24
IpVersionstring

The IP version.

  • IPv4
  • IPv6
IPv4
Protocolstring

The protocol. Valid values:

  • icmp
  • gre
  • tcp
  • udp
  • all
all
Portstring

The destination port range of the inbound traffic.

  • If the protocol of the inbound rule is set to all, icmp, or gre, the port range is -1/-1, which specifies all ports.
  • If the protocol of the inbound rule is set to tcp or udp, set the port range in the following format: 1/200 or 80/80, which specifies port 1 to port 200 or port 80. Valid ports: 1 to 65535.
-1/-1
EgressAclEntriesarray<object>

The outbound rules.

object
NetworkAclEntryIdstring

The ID of the outbound rule.

nae-a2d447uw4tillfvgb****
EntryTypestring

The type of the inbound rule.

  • custom

  • system

custom
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
  • drop
accept
Descriptionstring

The description of the outbound rule.

This is EgressAclEntries.
Protocolstring

The protocol. Valid values:

  • icmp
  • gre
  • tcp
  • udp
  • all
all
DestinationCidrIpstring

The destination CIDR block.

10.0.0.0/24
IpVersionstring

The IP version.

  • IPv4
  • IPv6
IPV4
Portstring

The destination port range of the outbound traffic.

  • If the protocol of the outbound rule is set to all, icmp, or gre, the port range is -1/-1, which specified all ports.
  • If the protocol of the outbound rule is set to tcp or udp, set the port range in the following format: 1/200 or 80/80, which specifies port 1 to port 200 or port 80. Valid values for a port: 1 to 65535.
-1/-1
Resourcesarray<object>

The resources that are associated with the network ACL.

object
Statusstring

The association status of the resource. Valid values:

  • BINDED
  • BINDING
  • UNBINDING
BINDED
ResourceTypestring

The type of resource with which you want to associate the network ACL.

VSwitch
ResourceIdstring

The ID of the associated resource.

vsw-bp1de348lntdwcdf****
Tagsarray<object>

The information about the tags.

object
Keystring

The key of tag N added to the resource.

FinanceDept
Valuestring

The value of tag N added to the resource.

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****",
              "EntryType": "custom",
              "NetworkAclEntryName": "acl-3\t",
              "Policy": "accept",
              "Description": "This is IngressAclEntries.",
              "SourceCidrIp": "10.0.0.0/24\t",
              "IpVersion": "IPv4",
              "Protocol": "all",
              "Port": "-1/-1\t"
            }
          ]
        },
        "EgressAclEntries": {
          "EgressAclEntry": [
            {
              "NetworkAclEntryId": "nae-a2d447uw4tillfvgb****",
              "EntryType": "custom",
              "NetworkAclEntryName": "acl-2\t",
              "Policy": "accept",
              "Description": "This is EgressAclEntries.",
              "Protocol": "all",
              "DestinationCidrIp": "10.0.0.0/24\t",
              "IpVersion": "IPV4",
              "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 code has changed. The response structure of the API has changedView Change Details
2023-05-09The Error code has changedView Change Details