All Products
Search
Document Center

Virtual Private Cloud:DescribeNetworkAclAttributes

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:DescribeNetworkAclAttributesRead
  • NetworkAcl
    acs:vpc:{#regionId}:{#accountId}:networkacl/{#NetworkAclId}
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
NetworkAclIdstringYes

The ID of the network ACL.

nacl-a2do9e413e0spzasx****
RegionIdstringYes

The region ID of the network ACL.

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

cn-hangzhou
ClientTokenstringNo

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

You can use the client to generate the value, but you must make sure that it 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
RequestIdstring

The ID of the request.

F5905F9C-0161-4E72-9CB1-1F3F3CF6268A
NetworkAclAttributeobject

The details about the network ACL.

Statusstring

The status of the associated resource. Valid values:

  • Available
  • Modifying
Available
VpcIdstring

The ID of the virtual private cloud (VPC) with which the network ACL is associated.

vpc-a2d33rfpl72k5defr****
CreationTimestring

The time when the network ACL was created.

2021-12-25 11:33:27
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-a2do9e413e0spnhmj****
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 information about the inbound rules of the network ACL.

NetworkAclEntryIdstring

The ID of the inbound rule.

nae-a2dk86arlydmevfbg****
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, which indicates port 1 to port 200, or port 80. Valid values for a port: 1 to 65535.
-1/-1
EgressAclEntriesobject []

The information about the outbound rules of the network ACL.

NetworkAclEntryIdstring

The ID of the outbound rule.

nae-a2d447uw4tillxdcv****
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 indicates 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, which indicates port 1 to port 200, or port 80. Valid values for a port: 1 to 65535.
-1/-1
Resourcesobject []

The details about the resource that is associated with the network ACL.

Statusstring

The status of the associated resource. Valid values:

  • BINDED: The resource is associated with the network ACL.
  • BINDING: The resource is being associated with the network ACL.
  • UNBINDING: The resource is disassociated from the network ACL.
BINDED
ResourceTypestring

The type of resource with which you want to associate the network ACL. The value is set to VSwitch.

VSwitch
ResourceIdstring

The ID of the associated resource.

vsw-bp1de348lntdwxscd****
Tagsobject []

The tag list.

Keystring

The tag key.

FinanceDept
Valuestring

The tag value.

FinanceJoshua

Examples

Sample success responses

JSONformat

{
  "RequestId": "F5905F9C-0161-4E72-9CB1-1F3F3CF6268A",
  "NetworkAclAttribute": {
    "Status": "Available",
    "VpcId": "vpc-a2d33rfpl72k5defr****",
    "CreationTime": "2021-12-25 11:33:27",
    "Description": "This is my NetworkAcl.",
    "NetworkAclName": "acl-1",
    "NetworkAclId": "nacl-a2do9e413e0spnhmj****",
    "OwnerId": 253460731706911260,
    "RegionId": "cn-hangzhou",
    "IngressAclEntries": {
      "IngressAclEntry": [
        {
          "NetworkAclEntryId": "nae-a2dk86arlydmevfbg****",
          "NetworkAclEntryName": "acl-3",
          "Policy": "accept",
          "Description": "This is IngressAclEntries.",
          "SourceCidrIp": "10.0.0.0/24",
          "Protocol": "all",
          "Port": "-1/-1"
        }
      ]
    },
    "EgressAclEntries": {
      "EgressAclEntry": [
        {
          "NetworkAclEntryId": "nae-a2d447uw4tillxdcv****",
          "NetworkAclEntryName": "acl-2",
          "Policy": "accept",
          "Description": "This is EgressAclEntries.",
          "Protocol": "all",
          "DestinationCidrIp": "10.0.0.0/24",
          "Port": "-1/-1"
        }
      ]
    },
    "Resources": {
      "Resource": [
        {
          "Status": "BINDED",
          "ResourceType": "VSwitch",
          "ResourceId": "vsw-bp1de348lntdwxscd****"
        }
      ]
    },
    "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-
400ParameterMissing.NetworkAclIdParameterMissing.NetworkAclId-
400ParameterEmpty.NetworkAclIdParameterEmpty.NetworkAclId-
400InvalidNetworkAcl.NotFoundThe special Network Acl is not found.The network ACL is not found.
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.