# Create ACL Rules - CreateNetworkAclEntry

## Overview

Create ACL Rules






## Definition

### Public Parameters

| Parameter Name | Type | Description Information | Required |
|:---|:---|:---|:---|
| **Action**     | string  | Corresponding API command name, the current API is `CreateNetworkAclEntry`.                      | **Yes** |
| **PublicKey**  | string  | The user's public key can be obtained from [Console](https://console.netlake.cn/uaccount/api_manage)                                             | **Yes** |
| **Signature**  | string  | User signature generated based on public key and API command, see [Signature Algorithm](/docs/api/summary/signature.md)  | **Yes** |

### Request Parameters

| Parameter Name | Type | Description Information | Required |
|:---|:---|:---|:---|
| **Region** | string | Region. See [List of Regions and Availability Zones](/docs/api/summary/regionlist) |**Yes**|
| **ProjectId** | string | Project ID. If not filled in, the default project is used, sub-accounts must be filled in. Please refer to the [GetProjectList interface](/docs/api/summary/get_project_list). |No|
| **AclId** | string | ACL's ID |**Yes**|
| **Priority** | int | The priority of the Entry, for the same Direction, cannot be repeated. |**Yes**|
| **Direction** | string | Outbound or Inbound ("Ingress", "Egress") |**Yes**|
| **IpProtocol** | string | Protocol Rule Description |**Yes**|
| **CidrBlock** | string | CIDR representation of IPv4 segment |**Yes**|
| **PortRange** | string | Targeted Port Range |**Yes**|
| **EntryAction** | string | Behavior of the rule ("Accept", "Reject") |**Yes**|
| **Description** | string | Description. The length limit is no more than 32 bytes. |No|
| **TargetType** | int | Application target type. 0 represents 'all resources within the subnet', 1 represents 'specified resources within the subnet', default is 0. |No|
| **TargetResourceIds.N** | string | Application target resource list. It is effective for all resources by default. This value does not need to be filled when TargetType is 0. |No|

### Response Field

| Field Name | Type | Description Information | Required |
|:---|:---|:---|:---|
| **RetCode** | int | Return status code. If it is 0, it means successful return. If it is not 0, it means failure. |**Yes**|
| **Action** | string | Operation command name. |**Yes**|
| **Message** | string | Returns an error message, providing detailed description when `RetCode` is non-zero. |No|
| **EntryId** | string | ID of the created Entry |**Yes**|




## Example

### Request Example
    
```
https://api.netlake.cn/?Action=CreateNetworkAclEntry
&Region=cn-bj
&AclId=netacl-xxxxxx
&ProjectId=org-xxxxx
&Priority=1000
&Direction=Ingress
&IpProtocol=TCP
&CidrBlock=0.0.0.0/0
&PortRange=1-65535
&EntryAction=Accept
&TargetType=2
&TargetResourceIds.n=uhost-xxxxxx
&Description=LpTJGGVz
```

### Response Example
    
```json
{
  "Action": "CreateNetworkAclEntryResponse",
  "EntryId": "netaclentry_xxxxxx",
  "RetCode": 0
}
```





