You need to enable JavaScript to run this app.
导航

ModifyRules

最近更新时间2023.11.16 15:51:42

首次发布时间2021.08.31 10:37:28

调用 ModifyRules 接口更换指定HTTP/HTTPS监听器中转发规则对应的后端服务器组或修改转发规则的描述。

调用说明

  • 单次调用API修改规则数量上限为50。
  • 创建监听器接口中配置的ServerGroupId参数会对应创建一个默认的转发规则转发至指定后端服务器组,默认转发规则不支持修改。
  • 2021年8月30日后,七层监听器上线默认后端服务器组功能,存量七层监听器需参考 ModifyListenerAttributes 接口为监听器配置默认后端服务器组,否则将创建域名为空的转发规则。

调试

请求参数

名称类型是否必填示例值
描述
ActionStringModifyRules要执行的操作,取值为ModifyRules。
VersionString2020-04-01API版本信息,当前版本为:2020-04-01。
ListenerIdStringlsn-2fek3rgsxhrsw5oxruwec****监听器的ID。您可以调用DescribeListeners接口获取监听器ID。

Rules.N.RuleId

String

Rules.1.RuleId=rule-2fegss1cplxxc5oxruvvq****&Rules.2.RuleId=rule-3ciynwkb46c6rrt4jszkd****

转发规则的ID。您可以调用DescribeRules接口获取转发规则ID。

  • 参数 - N:表示转发规则的序号,取值范围为1 ~ 50。
  • 多个转发规则间使用“&”分隔。

Rules.N.ServerGroupId

String

Rules.1.ServerGroupId=rsp-bp1o94dp5i6ea****&Rules.2.ServerGroupId=rsp-2fea4bshkqv405oxruuz4****

后端服务器组ID。您可以调用DescribeServerGroups接口获取后端服务器组ID。

  • 参数 - N:表示转发规则的序号,取值范围为1 ~ 50。
  • 多个转发规则间使用“&”分隔。

Rules.N.Description

String

Rules.1.Description=rule1&Rules.2.Description=rule2

转发规则的描述。

  • 参数 - N:表示转发规则的序号,取值范围为1 ~ 50。
  • 多个转发规则间使用“&”分隔。
规范如下:
  • 必须以字母、数字或中文开头,可包含字母、数字、中文及以下特殊字符:英文逗号(,)、点号(.)、下划线(_)、空格( )、等号(=)、中划线(-)、中文逗号(,)、中文句号(。)。
  • 长度限制为0 ~ 255个字符。
  • 返回数据

    字段类型示例值描述
    RequestIdString20210811152539010225146063030****请求ID。

    请求示例

    GET /?Action=ModifyRules&Version=2020-04-01&ListenerId=lsn-2fek3rgsxhrsw5oxruwec****&Rules.1.RuleId=rule-2fegss1cplxxc5oxruvvq****&Rules.1.ServerGroupId=rsp-bp1o94dp5i6ea****&Rules.1.Description=test HTTP/1.1
    Host: open.volcengineapi.com
    Region: cn-beijing
    Service: clb
    

    返回示例

    {
        "ResponseMetadata": {
            "RequestId": "20210811152539010225146063030****",
            "Action": "ModifyRules",
            "Version": "2020-04-01",
            "Service": "clb",
            "Region": "cn-beijing"
        },
        "Result": {
            "RequestId": "20210811152539010225146063030****"
        }
    }
    

    错误码

    此处仅展示当前API的错误码,更多错误码请参见公共错误码

    HttpCode错误码错误信息描述

    400

    MissingParameter

    The request is missing a required parameter. Ensure that you have supplied all the required parameters for the request; for example, the 'XXX'.

    该请求缺少必要参数。请确保发起请求已提供全部必要参数,比如XXX

    说明

    其中,XXX表示缺少的参数名称。

    400InvalidDescription.MalformedThe specified Description is malformed.指定的 Description 参数格式不合法。
    400UnsupportedOperation.AccountArrearsThe request on the specified instance is denied due to the account in arrears status.因账户处于欠费状态,对于该实例的操作请求被拒绝。
    400InvalidLoadBalancer.InvalidStatusThe specified LoadBalancer is not in the correct status for the request.指定的负载均衡所处状态无法响应该请求。
    400InvalidDefaultRule.UnSupportActionThe specified Default Rule does not support this action.指定的默认转发规则不支持当前操作。
    400LimitExceeded.RuleYou've reached the limit on the number of rules that you can operate.已达到可操作转发规则的数量上限。
    400InvalidIncorrectOrder.MalformedThe specified index order is malformed.指定的索引顺序参数格式不合法。
    403InvalidResourceType.ServcieManagedThe specified ResourceType is managed by a service.指定的资源是服务托管资源。
    404InvalidListener.NotFoundThe specified Listener does not exist.指定的监听器不存在。
    404InvalidRule.NotFoundThe specified Rule does not exist.指定的转发规则不存在。
    404InvalidServerGroup.NotFoundThe specified ServerGroup does not exist.指定的后端服务器组不存在。
    404InvalidExclusiveCluster.NotFoundThe specified ExclusiveCluster does not exist.指定的独占集群不存在。
    409InvalidRule.ConflictThe specified Rule already exists.指定的转发规则已存在。
    412InvalidLoadBalancer.ExpiredThe specified LoadBalancer has expired.指定的负载均衡已过期。
    412InvalidExclusiveCluster.ExpiredThe specified ExclusiveCluster has expired.指定的独占集群已过期。
    412InvalidExclusiveCluster.UnPurchasedThe specified ExclusiveCluster is not purchased.指定的独占集群未购买。