---
title: "更新系统配置"
method: PATCH
path: "/api/v1/config"
tags: ["配置管理"]
---

# 更新系统配置

`PATCH /api/v1/config`

使用补丁方式更新系统配置

## Request body

- DtoConfigPatchRequest — 用于部分更新配置的请求参数
  - `engine` DtoEnginePatchDTO
    - `appConfig` DtoAppConfigPatchDTO[] — 应用配置列表
      - `directives` string — 指令配置
      - `logFile` string — 日志文件
      - `logFormat` string — 日志格式
      - `logLevel` string — 日志级别
      - `name` string — 应用名称
      - `transactionTTL` integer — 事务超时时间(毫秒)
    - `asnDBPath` string — ASN数据库路径
    - `bind` string — 引擎绑定地址
    - `cityDBPath` string — 城市数据库路径
    - `flowController` DtoFlowControllerPatchDTO
      - `attackLimit` DtoLimitConfigPatchDTO
        - `blockDuration` integer — 封禁时长（秒）
        - `burstCount` integer — 允许的突发请求数
        - `enabled` boolean — 是否启用
        - `paramsCapacity` integer — 缓存容量
        - `statDuration` integer — 统计时间窗口（秒）
        - `threshold` integer — 阈值
      - `errorLimit` DtoLimitConfigPatchDTO
        - `blockDuration` integer — 封禁时长（秒）
        - `burstCount` integer — 允许的突发请求数
        - `enabled` boolean — 是否启用
        - `paramsCapacity` integer — 缓存容量
        - `statDuration` integer — 统计时间窗口（秒）
        - `threshold` integer — 阈值
      - `visitLimit` DtoLimitConfigPatchDTO
        - `blockDuration` integer — 封禁时长（秒）
        - `burstCount` integer — 允许的突发请求数
        - `enabled` boolean — 是否启用
        - `paramsCapacity` integer — 缓存容量
        - `statDuration` integer — 统计时间窗口（秒）
        - `threshold` integer — 阈值
    - `useBuiltinRules` boolean — 是否使用内置规则
  - `haproxy` DtoHaproxyPatchDTO
    - `backupsNumber` integer — 备份数量
    - `configBaseDir` string — 配置文件根目录
    - `haproxyBin` string — HAProxy二进制文件路径
    - `spoeAgentAddr` string — SPOE代理地址
    - `spoeAgentPort` integer — SPOE代理端口
    - `thread` integer — 线程数
  - `isDebug` boolean — 是否开启调试模式
  - `isK8s` boolean — 是否在K8s环境
  - `isResponseCheck` boolean — 是否检查响应
  - `name` string — 配置名称

## Response `200`

配置更新成功

- object — 成功的API响应标准格式
  - `code` integer
  - `data` DtoConfigResponse — 配置响应
    - `createdAt` string — 创建时间
    - `engine` DtoEngineDTO
      - `appConfig` DtoAppConfigDTO[] — 应用配置列表
        - `directives` string — 指令配置
        - `logFile` string — 日志文件
        - `logFormat` string — 日志格式
        - `logLevel` string — 日志级别
        - `name` string — 应用名称
        - `transactionTTL` integer — 事务超时时间(毫秒)
      - `asnDBPath` string — ASN数据库路径
      - `bind` string — 引擎绑定地址
      - `cityDBPath` string — 城市数据库路径
      - `flowController` DtoFlowControllerDTO
        - `attackLimit` DtoLimitConfigDTO
          - `blockDuration` integer — 封禁时长（秒）
          - `burstCount` integer — 允许的突发请求数
          - `enabled` boolean — 是否启用
          - `paramsCapacity` integer — 缓存容量
          - `statDuration` integer — 统计时间窗口（秒）
          - `threshold` integer — 阈值
        - `errorLimit` DtoLimitConfigDTO
          - `blockDuration` integer — 封禁时长（秒）
          - `burstCount` integer — 允许的突发请求数
          - `enabled` boolean — 是否启用
          - `paramsCapacity` integer — 缓存容量
          - `statDuration` integer — 统计时间窗口（秒）
          - `threshold` integer — 阈值
        - `visitLimit` DtoLimitConfigDTO
          - `blockDuration` integer — 封禁时长（秒）
          - `burstCount` integer — 允许的突发请求数
          - `enabled` boolean — 是否启用
          - `paramsCapacity` integer — 缓存容量
          - `statDuration` integer — 统计时间窗口（秒）
          - `threshold` integer — 阈值
      - `useBuiltinRules` boolean — 是否使用内置规则
    - `haproxy` DtoHaproxyDTO
      - `backupsNumber` integer — 备份数量
      - `configBaseDir` string — 配置文件根目录
      - `haproxyBin` string — HAProxy二进制文件路径
      - `spoeAgentAddr` string — SPOE代理地址
      - `spoeAgentPort` integer — SPOE代理端口
      - `thread` integer — 线程数
    - `id` string — 配置ID
    - `isDebug` boolean — 是否开启调试模式
    - `isK8s` boolean — 是否在K8s环境
    - `isResponseCheck` boolean — 是否检查响应
    - `name` string — 配置名称
    - `updatedAt` string — 更新时间
  - `message` string
  - `requestId` string
  - `success` boolean
  - `timestamp` string

## Other responses

- `400` — 请求参数错误
- `401` — 未授权访问
- `403` — 禁止访问
- `404` — 配置不存在
- `500` — 服务器内部错误

---

[API](https://skmtc.net/labring/apis/ruiqi-waf-api.md) · [All operations](https://skmtc.net/labring/apis/ruiqi-waf-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/labring/ruiqi-waf-api/revisions/aaacd7e06a88/schema)
