UpdateRulesAttribute - 批量更新转发规则属性

批量更新转发规则属性。

接口说明

UpdateRulesAttribute 接口属于异步接口,即系统返回一个请求 ID,但该转发规则属性尚未批量更新成功,系统后台的更新任务仍在进行。您可以调用 ListRules 查询转发规则属性的更新状态:

  • 当多条转发规则属性处于 Configuring 状态时,表示转发规则属性正在批量更新中。

  • 当多条转发规则属性处于 Available 状态时,表示转发规则属性批量更新成功。

  • 一条转发规则最多支持添加的条件数(RuleConditions)和动作数(RuleActions)如下:

    • 条件数:基础版 5 条,标准版 10 条,WAF 增强版 10 条。

    • 动作数:基础版 3 条,标准版 5 条,WAF 增强版 5 条。

调试

您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。

调试

授权信息

下表是API对应的授权信息,可以在RAM权限策略语句的Action元素中使用,用来给RAM用户或RAM角色授予调用此API的权限。具体说明如下:

  • 操作:是指具体的权限点。

  • 访问级别:是指每个操作的访问级别,取值为写入(Write)、读取(Read)或列出(List)。

  • 资源类型:是指操作中支持授权的资源类型。具体说明如下:

    • 对于必选的资源类型,用前面加 * 表示。

    • 对于不支持资源级授权的操作,用全部资源表示。

  • 条件关键字:是指云产品自身定义的条件关键字。

  • 关联操作:是指成功执行操作所需要的其他权限。操作者必须同时具备关联操作的权限,操作才能成功。

操作

访问级别

资源类型

条件关键字

关联操作

alb:UpdateRulesAttribute

update

*LoadBalancer

acs:alb:{#regionId}:{#accountId}:loadbalancer/{#LoadBalancerId}

*ServerGroup

acs:alb:{#regionId}:{#accountId}:servergroup/{#ServerGroupId}

请求参数

名称

类型

必填

描述

示例值

ClientToken

string

客户端 Token,用于保证请求的幂等性。

由客户端生成该参数值,要保证在不同请求间唯一。ClientToken 只支持 ASCII 字符。

说明

若您未指定,则系统自动使用 API 请求的 RequestId 作为 ClientToken 标识。每次 API 请求的 RequestId 不一样。

123e4567-e89b-12d3-a456-42665544***

Rules

array<object>

转发规则列表

array<object>

转发规则

Priority

integer

转发规则优先级

80

RuleName

string

转发规则名称

rule_111

RuleActions

array

转发规则动作列表

array<object>

转发规则动作

FixedResponseConfig

object

返回固定内容动作配置

Content

string

内容

dssacav

ContentType

string

内容类型

text/plain

HttpCode

string

HTTP 响应码

200

ForwardGroupConfig

object

转发组动作配置

ServerGroupTuples

array

转发到的目的服务器组列表

object

转发到的目的服务器组

ServerGroupId

string

服务器组标识

sgp-3kbj35ay7cvi******

Weight

integer

权重

100

ServerGroupStickySession

object

服务器组之间会话保持

Enabled

boolean

是否开启会话保持

true

Timeout

integer

超时时间

100

InsertHeaderConfig

object

插入头部动作配置

CoverEnabled

boolean

是否覆盖请求中的值

False

Key

string

HTTP 标头

key

Value

string

HTTP 标头内容

value

ValueType

string

取值类型

SystemDefined

Order

integer

优先级

1

RedirectConfig

object

重定向动作配置

Host

string

要跳转的主机地址

test.alb.com

HttpCode

string

跳转方式

301

Path

string

要跳转的路径

/

Port

string

要跳转的端口

443

Protocol

string

要跳转的协议

HTTPS

Query

string

要跳转的查询字符串

${query}

RewriteConfig

object

内部重定向动作配置

Host

string

主机名

${host}

Path

string

路径

/

Query

string

查询

${query}

Type

string

转发规则动作类型

ForwardGroup

TrafficLimitConfig

object

流量限速

QPS

integer

每秒请求次数。

1000

PerIpQps

integer

单 IP 每秒请求次数。

100

TrafficMirrorConfig

object

流量镜像

TargetType

string

镜像目标类型

ForwardGroupMirror

MirrorGroupConfig

object

镜像至服务器组

ServerGroupTuples

array

流量镜像至服务器组。

object

流量镜像至服务器组。

ServerGroupId

string

服务器组 ID。

sgp-vlnjo1rhw0vc******

RemoveHeaderConfig

object

去除 HTTP 标头

Key

string

HTTP 标头键

key

CorsConfig

object

跨域

AllowOrigin

array

允许的访问来源

string

允许的访问来源

*

AllowMethods

array

选择跨域访问时允许的 HTTP 方法

string

选择跨域访问时允许的 HTTP 方法。取值:

  • GET

  • POST

  • PUT

  • DELETE

  • HEAD

  • OPTIONS

  • PATCH

GET

AllowHeaders

array

允许跨域的 Header 列表

string

允许跨域的 Header

test

ExposeHeaders

array

允许暴露的 Header 列表

string

允许暴露的 Header

test

AllowCredentials

string

是否允许携带凭证信息

off

MaxAge

integer

预检请求在浏览器的最大缓存时间

60

RuleConditions

array

转发规则条件列表

array<object>

转发规则条件

CookieConfig

object

Cookie 条件配置

Values

array

Cookie 键值对列表

object

Cookie 键值对

Key

string

Cookie 条件键

key

Value

string

Cookie 条件值

value

HeaderConfig

object

HTTP 标头条件配置

Key

string

HTTP 标头键

key

Values

array

HTTP 标头值列表

string

HTTP 标头值

value

HostConfig

object

主机名条件配置

Values

array

主机名列表

string

主机名

www.example.com

MethodConfig

object

HTTP 请求方法条件配置

Values

array

HTTP 请求方法列表

string

HTTP 请求方法

PUT

PathConfig

object

查询字符串条件配置

Values

array

路径条件列表

string

路径条件

/test

QueryStringConfig

object

查询字符串条件配置

Values

array

查询字符串条件键值对列表

object

查询字符串条件键值对

Key

string

查询字符串条件键

account

Value

string

查询字符串条件值

on

ResponseHeaderConfig

object

返回 HTTP 标头

Key

string

返回 HTTP 标头键

test

Values

array

返回 HTTP 标头值

string

返回 HTTP 标头值

value

ResponseStatusCodeConfig

object

返回状态码条件

Values

array

返回状态码条件

string

返回状态码条件

200

Type

string

条件类型

Header

SourceIpConfig

object

基于源 IP 业务流量匹配

Values

array

添加一个或多个 IP 地址或者 IP 地址段。

string

添加一个或多个 IP 地址或者 IP 地址段。

192.168.1.1

RuleId

string

转发规则 ID

rule-n4hfecmmtmfl******

DryRun

boolean

是否只预检此次请求,取值:

  • true:发送检查请求,不会批量更新转发规则属性。检查项包括是否填写了必需参数、请求格式、业务限制。如果检查不通过,则返回对应错误。如果检查通过,则返回错误码DryRunOperation

  • false(默认值):发送正常请求,通过检查后返回HTTP 2xx状态码并直接进行操作。

false

返回参数

名称

类型

描述

示例值

object

Schema of Response

RequestId

string

请求 ID。

365F4154-92F6-4AE4-92F8-7FF34B540710

JobId

string

异步任务 ID。

72dcd26b-f12d-4c27-b3af-18f6aed5****

示例

正常返回示例

JSON格式

{
  "RequestId": "365F4154-92F6-4AE4-92F8-7FF34B540710",
  "JobId": "72dcd26b-f12d-4c27-b3af-18f6aed5****"
}

错误码

HTTP status code

错误码

错误信息

描述

400 OperationDenied.IpGroupCanNotUsedForMirrorAction The operation is not allowed because of %s. 操作被拒绝,原因是%s。
400 IncorrectStatus.Rule The status of %s [%s] is incorrect. 转发规则的当前状态不支持本次操作。
400 OperationDenied.SameGroupForForwardAndMirrorAction The operation is not allowed because of %s. 操作被拒绝,原因是%s。
400 OperationDenied.GRPCServerGroup The operation is not allowed because of %s. 操作被拒绝,原因是存在绑定本GRPC服务器组的监听没有启用HTTP2.0。
400 Conflict.Priority There is already %s having the same configuration with %s. 优先级冲突,已经存在相同配置
400 ResourceQuotaExceeded.ServerGroupAttachedNum The quota of %s is exceeded for resource %s, usage %s/%s. 服务器组可被关联数已超额度限制。
400 ResourceQuotaExceeded.LoadBalancerServersNum The quota of %s is exceeded for resource %s, usage %s/%s. 后端服务器数已超额度限制。
400 ResourceQuotaExceeded.ServerAddedNum The quota of %s is exceeded for resource %s, usage %s/%s. 服务器添加到组已超额度限制。
400 QuotaExceeded.RuleWildcardsNum The quota of %s is exceeded, usage %s/%s. 配额%s已超额度限制,目前已使用%s,配额为%s。
400 QuotaExceeded.RuleMatchEvaluationsNum The quota of %s is exceeded, usage %s/%s. 转发规则条件数已超额度限制。
400 QuotaExceeded.RuleActionsNum The quota of %s is exceeded, usage %s/%s. 配额%s已超额度限制,目前已使用%s,配额为%s。
400 Mismatch.Protocol The %s is mismatched for %s and %s. %s在%s和%s中不匹配。
400 Mismatch.VpcId The %s is mismatched for %s and %s. %s在%s和%s中不匹配。
400 OperationDenied.ServiceManagedResource The operation is not allowed because the current resource of %s is managed resource. 操作被拒绝,原因是资源%s为托管资源。
400 OperationDenied.ListenerIdInconsistent The operation is not allowed because of ListenerIdInconsistent. 操作被拒绝,原因是当前转发规则属于不同的监听。
400 IllegalParam.Priority The param of Priority is illegal. 参数Priority非法
400 OperationDenied.MirrorActionSupportHttpGroupOnly The operation is not allowed because of MirrorActionSupportHttpGroupOnly. 操作被拒绝,原因是流量镜像动作只支持HTTP类型的服务器组。
400 OperationDenied.ProtocolMustSameForForwardGroupAction The operation is not allowed because of ProtocolMustSameForForwardGroupAction. 操作被禁止,原因:必须是相同的协议
404 ResourceNotFound.Rule The specified resource %s is not found. 资源%s不存在。
404 ResourceNotFound.ServerGroup The specified resource %s is not found. 后端服务器组不存在。

访问错误中心查看更多错误码。

变更历史

更多信息,参考变更详情