该接口用于更新Web应用防火墙(WAF)中的单个规则。通过此接口,用户可以修改特定规则的配置和状态。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
授权信息
下表是API对应的授权信息,可以在RAM权限策略语句的Action
元素中使用,用来给RAM用户或RAM角色授予调用此API的权限。具体说明如下:
- 操作:是指具体的权限点。
- 访问级别:是指每个操作的访问级别,取值为写入(Write)、读取(Read)或列出(List)。
- 资源类型:是指操作中支持授权的资源类型。具体说明如下:
- 对于必选的资源类型,用前面加 * 表示。
- 对于不支持资源级授权的操作,用
全部资源
表示。
- 条件关键字:是指云产品自身定义的条件关键字。
- 关联操作:是指成功执行操作所需要的其他权限。操作者必须同时具备关联操作的权限,操作才能成功。
操作 | 访问级别 | 资源类型 | 条件关键字 | 关联操作 |
---|
操作 | 访问级别 | 资源类型 | 条件关键字 | 关联操作 |
---|---|---|---|---|
esa:UpdateWafRule | update | *Site acs:esa:{#regionId}:{#accountId}:site/{#SiteId} |
| 无 |
请求参数
名称 | 类型 | 必填 | 描述 | 示例值 |
---|
名称 | 类型 | 必填 | 描述 | 示例值 |
---|---|---|---|---|
SiteId | long | 是 | 站点 ID,可通过调用 ListSites 接口获取。 | 1 |
SiteVersion | integer | 否 | 站点版本。 | 0 |
Id | long | 是 | WAF 规则的 ID,可通过调用 ListWafRules 接口获取。 | 20000001 |
Position | long | 否 | 规则在规则集中的位置顺序。 | 1 |
Status | string | 否 | 规则状态。 | on |
Config | WafRuleConfig | 否 | 规则配置。 |
返回参数
示例
正常返回示例
JSON
格式
{
"RequestId": "36af3fcc-43d0-441c-86b1-428951dc8225",
"Id": 20000001
}
错误码
HTTP status code | 错误码 | 错误信息 | 描述 |
---|
HTTP status code | 错误码 | 错误信息 | 描述 |
---|---|---|---|
400 | InvalidParameter | The specified parameter is invalid. | 输入参数规范校验失败。 |
400 | Rule.NotExist | The specified rule does not exist. | 指定的规则在当前上下文或系统配置中不存在。请确认规则标识符的存在,并确保它已被正确定义或实现。 |
400 | InternalException | Failed to call the service. Try again later or contact technical support. | 调用服务失败,请稍后重试或联系客服咨询详情。 |
400 | SpecifiedVersionReadOnly | The specified version number is read-only and cannot be modified. | 指定的版本号为只读版本, 无法修改版本配置。 |
403 | %s.NotSupport | The specified resource type %s is not supported. | 不支持指定的资源类型。如需使用该类型资源,请与我们联系。 |
403 | %s.OverQuota | The quantity of %s exceeds the quota. | 该资源的数量超出了配额所规定的范围,如需申请更多的额度,请与我们联系。 |
403 | %s.WrongValueMatched | The value of specified parameter %s can not pass the matching check. | 指定的参数对应的值不能通过匹配校验。如果您确定需要使用该参数值,请与我们联系。 |
403 | Rule.Config.Malformed | The format of the rule configuration is invalid.Check the configuration for syntax errors or structural inconsistencies and correct them to meet the requirements. | 指定的规则配置格式错误或未按要求格式编写。请检查规则配置中是否存在语法错误或结构不一致,并予以纠正,以符合预期的配置架构。 |
403 | Rule.Config.Noncompliance | The specified rule configuration does not meet the compliance requirements.Check and adjust your configurations. | 指定的规则配置未满足既定的合规性标准。请检查规则设置,查找任何不符合或违反预期标准的差异,并进行必要的调整,以确保所有规则均得到正确验证。 |
403 | Rule.Position.Invalid | The specified position for the rule is invalid.Check and adjust the configuration to make sure it meets the requirements. | 指定的规则位置无效或超出了可接受范围。请核实规则位置参数,并作出适当更正,以确保符合既定边界或序列要求。 |
403 | Rule.Name.AlreadyExists | The specified rule name already exists.Try again with a unique name or modify the existing rule name. | 指定的规则名称在系统配置中已存在,不能重复使用。请选择一个不与现有规则名称冲突的独特规则名称,或在必要时考虑更改现有规则的名称,以消除任何可能的歧义,并确保每个规则标识符的唯一性。 |
403 | Expression.Invalid | The specified expression is invalid: %s. | 指定的表达式是无效的。 |
访问错误中心查看更多错误码。