All Products
Search
Document Center

Virtual Private Cloud:UpdateNetworkAclEntries

Last Updated:Mar 04, 2024

Updates the rules of a network access control list (ACL).

Operation description

  • UpdateNetworkAclEntries is an asynchronous operation. After a request is sent, the system returns a request ID and runs the task in the background. You can call the DescribeNetworkAclAttributes operation to query the status of a network ACL:

    • If the network ACL is in the Modifying state, the rules of the network ACL are being updated.
    • If the network ACL is in the Available state, the rules of the network ACL are updated.
  • You cannot repeatedly call the UpdateNetworkAclEntries operation to update the rules of a network ACL within the specified period of time.

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

Request parameters

ParameterTypeRequiredDescriptionExample
IngressAclEntriesobject []No

The information about the inbound rule.

NetworkAclEntryIdstringNo

The ID of the inbound rule.

Valid values of N: 0 to 99. You can specify at most 100 inbound rules.

nae-2zepn32de59j8m4****
EntryTypestringNo

The type of the rule. Set the value to custom, which specifies custom rules.

custom
NetworkAclEntryNamestringNo

The name of the inbound rule.

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

acl-3
PolicystringNo

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

  • accept
  • drop
accept
SourceCidrIpstringNo

The source CIDR block.

10.0.0.0/24
IpVersionstringNo

The IP version. Valid values:

  • IPv4 (default)
  • IPv6
IPv4
DescriptionstringNo

The description of the inbound rule.

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

This is IngressAclEntries.
ProtocolstringNo

The protocol. Valid values:

  • icmp
  • gre
  • tcp
  • udp
  • all
all
PortstringNo

The source port range of the inbound rule.

  • 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
EgressAclEntriesobject []No

The information about the outbound rules.

NetworkAclEntryIdstringNo

The ID of the outbound rule.

Valid values of N: 0 to 99. You can specify at most 100 outbound rules.

nae-2zecs97e0brcge46****
EntryTypestringNo

The type of the rule. Set the value to custom, which specifies custom rules.

custom
NetworkAclEntryNamestringNo

The name of the outbound rule.

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

acl-2
PolicystringNo

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

  • accept
  • drop
accept
DescriptionstringNo

The description of the outbound rule.

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

This is EgressAclEntries.
ProtocolstringNo

The protocol. Valid values:

  • icmp
  • gre
  • tcp
  • udp
  • all
all
DestinationCidrIpstringNo

The destination CIDR block.

10.0.0.0/24
IpVersionstringNo

The IP version. Valid values:

  • IPv4 (default)
  • IPv6
IPv4
PortstringNo

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
UpdateIngressAclEntriesbooleanNo

Specifies whether to update inbound rules. Valid values:

  • true
  • false (default)
Note This parameter cannot be used to add inbound rules to ACLs. If you want to add more inbound rules to ACLs, you must specify both the existing rule and the rule that you want to add when you call this API operation. If you specify only the rule that you want to add, it overwrites the existing rule.
false
UpdateEgressAclEntriesbooleanNo

Specifies whether to update outbound rules. Valid values:

  • true
  • false (default)
Note This parameter cannot be used to add outbound rules to ACLs. If you want to add more outbound rules to ACLs, specify both the existing rule and the rule that you want to add when you call this API operation. If you specify only the rule that you want to add, it overwrites the existing rule.
false
NetworkAclIdstringYes

The ID of the network ACL.

nacl-bp1lhl0taikrzxsc****
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 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
DryRunbooleanNo

Specifies whether to perform only a dry run, without performing the actual request. Valid values:

  • true: performs a dry run. The system checks the request for potential issues, including the AccessKey pair, the permissions of the RAM user, and the required parameters. If the request fails the dry run, an error message is returned. If the request passes the dry run, the DryRunOperation error code is returned.
  • false (default): performs a dry run and performs the actual request. If the request passes the dry run, a 2xx HTTP status code is returned and the operation is performed.
true

Response parameters

ParameterTypeDescriptionExample
object
RequestIdstring

The request ID.

1170A5A0-E760-4331-9133-A7D38D973215

Examples

Sample success responses

JSONformat

{
  "RequestId": "1170A5A0-E760-4331-9133-A7D38D973215"
}

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-
400ParameterMissing.PortParameterMissing.Port-
400ParameterIllegal.PortParameterIllegal.Port-
400ParameterIllegal.PolicyParameterIllegal.Policy-
400ParameterMissing.PolicyParameterMissing.Policy-
400ParameterIllegal.ProtocolParameterIllegal.Protocol-
400ParameterMissing.ProtocolParameterMissing.Protocol-
400ParameterLengthIllegal.NameParameterLengthIllegal.NameThe length of the rule name is invalid.
400ParameterIllegal.NameParameterIllegal.NameThe name of the entry is invalid.
400ParameterLengthIllegal.DescriptionParameterLengthIllegal.Description-
400ParameterIllegal.DescriptionParameterIllegal.Description-
400ParameterIllegal.SourceCidrIpParameterIllegal.SourceCidrIp-
400ParameterMissing.SourceCidrIpParameterMissing.SourceCidrIp-
400ParameterIllegal.DestinationCidrIpParameterIllegal.DestinationCidrIp-
400ParameterMissing.DestinationCidrIpParameterMissing.DestinationCidrIp-
400QuotaExceed.NetworkAclEntryNetwork acl entry is over limit.The number of rules in the network ACL has reached the upper limit
400InvalidNetworkAcl.NotFoundThe special Network Acl is not found.The network ACL is not found.
400NetworkStatus.ModifyingThe special Network Acl is in modifying.The network ACL is being modified.
400ResourceStatus.ErrorThe binding instance is in middle status.The status of the instance is invalid.
400NotSupport.NetworkAclNetwork acl is not support now.-
400IllegalParam.IngressAclEntryIdThe specified IngressAclEntryId is invalid.The specified IngressAclEntryId is invalid.
400IllegalParam.EgressAclEntryIdThe specified EgressAclEntryId is invalid.The specified EgressAclEntryId is invalid.
400OperationDenied.VpcIpv6NotEnabledIPv6 has not been enabled for the VPC.The error message returned because the VPC does not support IPv6 and the operation is denied.
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-24API Description Update. The Error code has changed. The request parameters of the API has changedsee changesets
Change itemChange content
API DescriptionAPI Description Update.
Error CodesThe Error code has changed.
    Error Codes 400 change
    delete Error Codes: 500
Input ParametersThe request parameters of the API has changed.
    Added Input Parameters: DryRun