基础防护模板 保存
更新时间:2026-03-10
POST
/v1/waf/webTemplate/save
基础防护模板 保存
请求参数
Headers 参数
除公共头域外,无其它特殊头域
Body 参数
name
string
web防护规则模板名称
必选
bindInfo
array
关联站点信息,必传但允许为空数组
可选
显示子属性
隐藏子属性
items
object {2}
显示子属性
隐藏子属性
instanceID
string
必选
subdomains
array
必选
显示子属性
隐藏子属性
items
string
switch
integer
开关状态。0 => 关、1=>开
必选
templateType
string
接入类型。枚举值:saas、native
必选
action
string
处置动作。枚举值:log => 观察、deny => 拦截
必选
templateKey
string
可选
rulesGroupID
string
规则组唯一标识,对应groupKey。默认规则组分别对应:low => 低级、middle => 中级、high => 高级
必选
请求结构
{
"name": "web防护规则模板名称",
"bindInfo": [],
"switch": 1,
"templateType": "saas",
"action": "log",
"templateKey": "",
"rulesGroupID": "middle"
}
示例代码
保存基础防护模板
请求示例
curl -X POST "https://api.example.com/v1/waf/webTemplate/save" \
-H "Content-Type: application/json" \
-d '{
"name": "我的防护模板",
"bindInfo": [
{
"instanceID": "instance-001",
"subdomains": ["www.example.com"]
}
],
"switch": 1,
"templateType": "saas",
"action": "log",
"rulesGroupID": "middle"
}'
返回响应
Headers 参数
除公共头域外,无其它特殊头域
返回参数
status
integer
状态码
必选
result
object {1}
必选
显示子属性
隐藏子属性
templateKey
string
模板唯一标识
必选
成功保存模板后的返回结果
成功响应示例
{
"status": 200,
"result": {
"templateKey": "template-abc123"
}
}
