更新时间:2025-09-30 GMT+08:00
分享

更新BotM流量检测条件

功能介绍

更新BotM流量检测条件

调用方法

请参见如何调用API

URI

PUT /v1/{project_id}/waf/policy/{policy_id}/bot-manager/traffic-detection-condition/{condition_id}

表1 路径参数

参数

是否必选

参数类型

描述

project_id

String

project_id

policy_id

String

policyId

condition_id

String

流量检测条件Id

请求参数

表2 请求Header参数

参数

是否必选

参数类型

描述

X-Auth-Token

String

租户token

Content-Type

String

内容类型

表3 请求Body参数

参数

是否必选

参数类型

描述

condition

TrafficDetectionConditionDTO object

流量检测条件

表4 TrafficDetectionConditionDTO

参数

是否必选

参数类型

描述

id

String

参数解释:

Id,唯一标识当前流量检测条件。

约束限制:

不涉及

取值范围:

不涉及

默认取值:

不涉及

match_field

String

参数解释:

匹配字段(类别),标识流量筛选的字段类型(如url表示URL路径)。

约束限制:

不涉及

取值范围:

不涉及

默认取值:

不涉及

match_field_index

String

参数解释:

子字段,匹配字段的细分维度(如无则不填)。

约束限制:

不涉及

取值范围:

不涉及

默认取值:

不涉及

logical_operator

String

参数解释:

逻辑运算符,标识匹配条件的逻辑关系(如contain表示包含)。

约束限制:

不涉及

取值范围:

不涉及

默认取值:

不涉及

match_contents

Array of strings

参数解释:

匹配内容,符合筛选条件的具体值列表(如特定URL路径)。

约束限制:

不涉及

取值范围:

不涉及

默认取值:

不涉及

value_list_res

String

参数解释:

引用表Id,关联预设的匹配内容列表ID(如无则不填)。

约束限制:

不涉及

取值范围:

不涉及

默认取值:

不涉及

响应参数

状态码:200

表5 响应Body参数

参数

参数类型

描述

id

String

参数解释:

Id,唯一标识当前流量检测条件。

约束限制:

不涉及

取值范围:

不涉及

默认取值:

不涉及

match_field

String

参数解释:

匹配字段(类别),标识流量筛选的字段类型(如url表示URL路径)。

约束限制:

不涉及

取值范围:

不涉及

默认取值:

不涉及

match_field_index

String

参数解释:

子字段,匹配字段的细分维度(如无则不填)。

约束限制:

不涉及

取值范围:

不涉及

默认取值:

不涉及

logical_operator

String

参数解释:

逻辑运算符,标识匹配条件的逻辑关系(如contain表示包含)。

约束限制:

不涉及

取值范围:

不涉及

默认取值:

不涉及

match_contents

Array of strings

参数解释:

匹配内容,符合筛选条件的具体值列表(如特定URL路径)。

约束限制:

不涉及

取值范围:

不涉及

默认取值:

不涉及

value_list_res

String

参数解释:

引用表Id,关联预设的匹配内容列表ID(如无则不填)。

约束限制:

不涉及

取值范围:

不涉及

默认取值:

不涉及

状态码:400

表6 响应Body参数

参数

参数类型

描述

error_code

String

错误码

error_msg

String

错误信息

encoded_authorization_message

String

编码 (加密) 后的详细拒绝原因,用户可以自行调用 STS 服务的decode-authorization-message接口进行解码,可参考STS5联调自验证。IAM5鉴权错误时才会返回此字段。

details

Array of IAM5ErrorDetails objects

调用下游服务的报错信息集合,IAM5鉴权错误时才会返回此字段。

表7 IAM5ErrorDetails

参数

参数类型

描述

error_code

String

下游服务错误码

error_msg

String

下游服务报错信息

状态码:401

表8 响应Body参数

参数

参数类型

描述

error_code

String

错误码

error_msg

String

错误信息

encoded_authorization_message

String

编码 (加密) 后的详细拒绝原因,用户可以自行调用 STS 服务的decode-authorization-message接口进行解码,可参考STS5联调自验证。IAM5鉴权错误时才会返回此字段。

details

Array of IAM5ErrorDetails objects

调用下游服务的报错信息集合,IAM5鉴权错误时才会返回此字段。

表9 IAM5ErrorDetails

参数

参数类型

描述

error_code

String

下游服务错误码

error_msg

String

下游服务报错信息

状态码:500

表10 响应Body参数

参数

参数类型

描述

error_code

String

错误码

error_msg

String

错误信息

encoded_authorization_message

String

编码 (加密) 后的详细拒绝原因,用户可以自行调用 STS 服务的decode-authorization-message接口进行解码,可参考STS5联调自验证。IAM5鉴权错误时才会返回此字段。

details

Array of IAM5ErrorDetails objects

调用下游服务的报错信息集合,IAM5鉴权错误时才会返回此字段。

表11 IAM5ErrorDetails

参数

参数类型

描述

error_code

String

下游服务错误码

error_msg

String

下游服务报错信息

请求示例

{
  "condition" : {
    "id" : "cond-123456",
    "match_field" : "url",
    "match_field_index" : "path",
    "logical_operator" : "contain",
    "match_contents" : [ "/admin/login", "/api/v1/sensitive", ".php?debug=1" ],
    "value_list_ref" : "vl-789012"
  }
}

响应示例

状态码:200

请求成功

{
  "id" : "cond-8f7e6d5c",
  "match_field" : "request_header",
  "match_field_index" : "User-Agent",
  "logical_operator" : "not_contain",
  "match_contents" : [ "bot", "crawler", "spider" ],
  "value_list_res" : "vl-1a2b3c4d"
}

状态码

状态码

描述

200

请求成功

400

请求失败

401

token权限不足

500

服务器内部错误

错误码

请参见错误码

相关文档