# HTTPAccessLogPolicyService
> 访问日志策略服务

---

## countAllHTTPAccessLogPolicies
> 计算访问日志策略数量

- 角色：`admin`
- HTTP：`POST https://backend.dooki.cloud/HTTPAccessLogPolicyService/countAllHTTPAccessLogPolicies`
- RPC：`rpc countAllHTTPAccessLogPolicies (CountAllHTTPAccessLogPoliciesRequest) returns (RPCCountResponse);`

**请求对象 (`CountAllHTTPAccessLogPoliciesRequest`)**

```json
{}
```

**响应对象 (`RPCCountResponse`)**

```json
{
  "count": "int64 // 数量"
}
```

**调用示例**

```bash
curl -X POST "https://backend.dooki.cloud/HTTPAccessLogPolicyService/countAllHTTPAccessLogPolicies" \
  -H "Content-Type: application/json" \
  -H "X-Edge-Access-Token: <YOUR_TOKEN>" \
  -d '{
    ...
  }'
```

---

## createHTTPAccessLogPolicy
> 创建访问日志策略

- 角色：`admin`
- HTTP：`POST https://backend.dooki.cloud/HTTPAccessLogPolicyService/createHTTPAccessLogPolicy`
- RPC：`rpc createHTTPAccessLogPolicy (CreateHTTPAccessLogPolicyRequest) returns (CreateHTTPAccessLogPolicyResponse);`

**请求对象 (`CreateHTTPAccessLogPolicyRequest`)**

```json
{
  "name": "string // 名称",
  "type": "string",
  "optionsJSON": "bytes",
  "condsJSON": "bytes",
  "isPublic": "bool",
  "firewallOnly": "bool",
  "disableDefaultDB": "bool"
}
```

**响应对象 (`CreateHTTPAccessLogPolicyResponse`)**

```json
{
  "httpAccessLogPolicyId": "int64"
}
```

**调用示例**

```bash
curl -X POST "https://backend.dooki.cloud/HTTPAccessLogPolicyService/createHTTPAccessLogPolicy" \
  -H "Content-Type: application/json" \
  -H "X-Edge-Access-Token: <YOUR_TOKEN>" \
  -d '{
    ...
  }'
```

---

## deleteHTTPAccessLogPolicy
> 删除访问日志策略

- 角色：`admin`
- HTTP：`POST https://backend.dooki.cloud/HTTPAccessLogPolicyService/deleteHTTPAccessLogPolicy`
- RPC：`rpc deleteHTTPAccessLogPolicy (DeleteHTTPAccessLogPolicyRequest) returns (RPCSuccess);`

**请求对象 (`DeleteHTTPAccessLogPolicyRequest`)**

```json
{
  "httpAccessLogPolicyId": "int64"
}
```

**响应对象 (`RPCSuccess`)**

```json
{}
```

**调用示例**

```bash
curl -X POST "https://backend.dooki.cloud/HTTPAccessLogPolicyService/deleteHTTPAccessLogPolicy" \
  -H "Content-Type: application/json" \
  -H "X-Edge-Access-Token: <YOUR_TOKEN>" \
  -d '{
    ...
  }'
```

---

## findHTTPAccessLogPolicy
> 查找单个访问日志策略

- 角色：`admin`
- HTTP：`POST https://backend.dooki.cloud/HTTPAccessLogPolicyService/findHTTPAccessLogPolicy`
- RPC：`rpc findHTTPAccessLogPolicy (FindHTTPAccessLogPolicyRequest) returns (FindHTTPAccessLogPolicyResponse);`

**请求对象 (`FindHTTPAccessLogPolicyRequest`)**

```json
{
  "httpAccessLogPolicyId": "int64"
}
```

**响应对象 (`FindHTTPAccessLogPolicyResponse`)**

```json
{
  "httpAccessLogPolicy": "HTTPAccessLogPolicy"
}
```

**调用示例**

```bash
curl -X POST "https://backend.dooki.cloud/HTTPAccessLogPolicyService/findHTTPAccessLogPolicy" \
  -H "Content-Type: application/json" \
  -H "X-Edge-Access-Token: <YOUR_TOKEN>" \
  -d '{
    ...
  }'
```

---

## listHTTPAccessLogPolicies
> 列出单页访问日志策略

- 角色：`admin`
- HTTP：`POST https://backend.dooki.cloud/HTTPAccessLogPolicyService/listHTTPAccessLogPolicies`
- RPC：`rpc listHTTPAccessLogPolicies (ListHTTPAccessLogPoliciesRequest) returns (ListHTTPAccessLogPoliciesResponse);`

**请求对象 (`ListHTTPAccessLogPoliciesRequest`)**

```json
{
  "offset": "int64 // 读取位置",
  "size": "int64 // 数量，通常不能小于0"
}
```

**响应对象 (`ListHTTPAccessLogPoliciesResponse`)**

```json
{
  "httpAccessLogPolicies": "[]HTTPAccessLogPolicy"
}
```

**调用示例**

```bash
curl -X POST "https://backend.dooki.cloud/HTTPAccessLogPolicyService/listHTTPAccessLogPolicies" \
  -H "Content-Type: application/json" \
  -H "X-Edge-Access-Token: <YOUR_TOKEN>" \
  -d '{
    ...
  }'
```

---

## updateHTTPAccessLogPolicy
> 修改访问日志策略

- 角色：`admin`
- HTTP：`POST https://backend.dooki.cloud/HTTPAccessLogPolicyService/updateHTTPAccessLogPolicy`
- RPC：`rpc updateHTTPAccessLogPolicy (UpdateHTTPAccessLogPolicyRequest) returns (RPCSuccess);`

**请求对象 (`UpdateHTTPAccessLogPolicyRequest`)**

```json
{
  "httpAccessLogPolicyId": "int64",
  "name": "string // 名称",
  "isOn": "bool // 是否启用",
  "optionsJSON": "bytes",
  "condsJSON": "bytes",
  "isPublic": "bool",
  "firewallOnly": "bool",
  "disableDefaultDB": "bool"
}
```

**响应对象 (`RPCSuccess`)**

```json
{}
```

**调用示例**

```bash
curl -X POST "https://backend.dooki.cloud/HTTPAccessLogPolicyService/updateHTTPAccessLogPolicy" \
  -H "Content-Type: application/json" \
  -H "X-Edge-Access-Token: <YOUR_TOKEN>" \
  -d '{
    ...
  }'
```

---

## writeHTTPAccessLogPolicy
> 测试写入某个访问日志策略

- 角色：`admin`
- HTTP：`POST https://backend.dooki.cloud/HTTPAccessLogPolicyService/writeHTTPAccessLogPolicy`
- RPC：`rpc writeHTTPAccessLogPolicy (WriteHTTPAccessLogPolicyRequest) returns (RPCSuccess);`

**请求对象 (`WriteHTTPAccessLogPolicyRequest`)**

```json
{
  "httpAccessLogPolicyId": "int64",
  "httpAccessLog": "HTTPAccessLog"
}
```

**响应对象 (`RPCSuccess`)**

```json
{}
```

**调用示例**

```bash
curl -X POST "https://backend.dooki.cloud/HTTPAccessLogPolicyService/writeHTTPAccessLogPolicy" \
  -H "Content-Type: application/json" \
  -H "X-Edge-Access-Token: <YOUR_TOKEN>" \
  -d '{
    ...
  }'
```

---
