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

ModifyServerGroupAttributes

最近更新时间2024.02.29 14:48:19

首次发布时间2022.05.20 22:21:16

API 说明

API 名称:ModifyServerGroupAttributes。
API 域名:open.volcengineapi.com 。
API 描述:修改指定服务器组详细信息。

使用限制

节流限制:每秒最多提交 5 个 API 请求。

快速调试

URI 参数

在使用该部分 API 提交请求时必须包含以下 URI 参数。

除了 URI 参数,该 API 请求还需要包含签名参数。关于更多签名参数的信息,参见公共请求参数

名称类型是否必选格式说明
Action
string
[a-zA-Z]+
API 名称,如 ModifyServerGroupAttributes。
VersionstringYYYY-MM-DDAPI 版本信息。该参数的取值是 2020-04-01 。
X-Expiresint900表示签名的有效时间,单位是秒,默认值是900。

请求正文

在使用该 API 提交请求时,请求正文中可以包含的参数如下。

参数类型是否必选参数说明示例值
ServerGroupIdString后端服务器组ID。rsp-bp1o94dp5i6ea****

ServerGroupName

String

后端服务器组的名称。

  • 必须以字母或中文开头,可包含数字、点号(.)、下划线(_)和短横线(-)。
  • 限制为1 ~ 128个字符。
  • 不传入该参数或该参数不传入数值时,默认为后端服务器组ID。

default_servergroup

Description

String

后端服务器组的描述。

  • 不能以 http:// 或 https:// 开头。
  • 必须以字母或中文开头,可包含数字、英文逗号(,)、点号(.)、下划线(_)、空格( )、等号(=)、短横线(-)、中文逗号(,)、中文句号(。)。
  • 长度限制为1 ~ 255个字符。

This is the default servergroup

Scheduler

String

调度算法。取值:

  • wrr:加权轮询。
  • wlc:加权最小连接数。
  • sh:源地址哈希。

wrr

HealthCheckArray of HealthCheck修改健康检查的相关信息。具体参见下表 HealthCheck-
StickySessionConfigArray of StickySessionConfig更新会话保持功能的配置参数。具体参见下表 StickySessionConfig-

HealthCheck

参数类型是否必选参数说明示例值

HealthCheck.Enabled

String

监听器是否开启健康检查功能。取值:

  • on:开启。

  • off:不开启。

on
HealthCheck.IntervalInteger执行健康检查的时间间隔。 单位:秒,取值:1~300s,默认值为 2。2

HealthCheck.Timeout

Integer

健康检查的响应超时时间。

  • 表示如果后端服务器在指定的时间内没有正确响应,则判定为健康检查异常。

  • 单位:秒,取值:1~60,默认值为 2。

2

HealthCheck.HealthyThreshold

Integer

健康检查的健康阈值。

  • 表示连续执行指定次数的健康检查,结果均为正常的后端服务器将判定为健康检查正常。

  • 单位:次,取值:2~10,默认值为 3。

3

HealthCheck.UnhealthyThreshold

Integer

健康检查的不健康阈值。

  • 表示连续执行指定次数的健康检查,结果均为异常的后端服务器将判定为健康检查异常。

  • 单位:次,取值:2~10,默认值为 3。

3

HealthCheck.Method

String

健康检查的方法。取值:

  • GET(默认):服务器需支持GET方法。

  • HEAD:服务器仅返回HEAD头部信息,可以降低后端性能消耗,服务器需要支持HEAD方法。

HEAD

HealthCheck.DomainString健康检查的域名,需配置为后端服务器上真实对外提供服务的地址。www.test.com
HealthCheck.URIString健康检查的路径,需配置为后端服务器上真实对外提供的路径。默认值为 "/"。health

HealthCheck.HttpCode

String

健康检查正常的HTTP状态码,多个状态码间用半角逗号","分隔。取值:

  • http_2xx(默认值)。

  • http_3xx(默认值)。

  • http_4xx 。

  • http_5xx 。

"http_2xx,http_3xx"

HealthCheck.ProtocolString健康检查协议,当前仅支持HTTP。默认值为 HTTP。HTTP

HealthCheck.HttpVersion

String

健康检查HTTP协议版本,取值:

  • HTTP1.0(使用API时,HTTP协议版本默认值)。

  • HTTP1.1。

HTTP1.0

StickySessionConfig

参数类型是否必选参数说明示例值

StickySessionConfig.StickySessionEnabled

String

是否开启会话保持。取值如下:

  • on:开启;

  • off(默认值):关闭。

off

StickySessionConfig.StickySessionType

String

对 Cookie 的处理方式。当 StickySessionConfig.StickySessionEnabled 值为 on 时,此字段参数必填。取值如下:

  • insert(默认值):植入 Cookie;

    ALB 会记录客户端请求第一次转发到的后端服务器。ALB 在返回请求中植入 Cookie ,后续客户端请求携带此 Cookie,ALB 会将请求转发到之前记录的后端服务器上。

  • server:重写 Cookie;

    开启重写 Cookie 的会话保持后,在客户端请求第一次转发到后端服务器后,ALB 在返回请求中发现您自定义的 Cookie 时,会对原来的 Cookie 进行重写。后续客户端请求携带改写后的 Cookie,ALB 会将请求转发到之前记录的后端服务器上。

insert

StickySessionConfig.Cookie

String

服务配置的会话保持 Cookie 名称。仅在开启会话保持功能并选择重写 Cookie 时有效。 具体规则如下:

  • Cookie 名称长度为1~200个字符。

  • 名称只能包含 ASCII 英文字母和数字字符,不能包含半角逗号(,)、半角分号(;)或空格,也不能以美元符号($)开头。

  • 当 StickySessionConfig.StickySessionEnabled 值为 on,且 StickySessionConfig.StickySessionType 为 server时,此参数必填。

  • 当 StickySessionConfig.StickySessionEnabled 值为 on,且 StickySessionConfig.StickySessionType 为 insert 时,该参数无效。

MY_COOKIE

StickySessionConfig.CookieTimeout

Integer

会话保持 Cookie 超时时间。仅在开启会话保持功能并选择植入 Cookie 时有效。 单位:秒。具体规则如下:

  • 超时时间的取值范围:1~86400。 默认值为:1000。

  • 当 StickySessionConfig.StickySessionEnabled 值为 on,且 StickySessionType 为 insert 时,此参数必填。

  • 当 StickySessionConfig.StickySessionEnabled 值为 on,且 StickySessionType 为 server 时,此参数无效。

1000

响应正文

参数类型参数说明示例值
RequestId
String
请求ID。
20210811152539010225146063030****

示例

请求示例

GET /?Action=ModifyServerGroupAttributes&ServerGroupId=rsp-1g1f1g8rwii****uxxxn4h9n&ServerGroupName=test&HealthCheck.HttpCode="http_2xx,http_3xx"&Version=2020-04-01 HTTP/1.1
Host: open.volcengineapi.com
Region: cn-beijing
ServiceName: alb

响应示例

{
    "ResponseMetadata": {
        "RequestId": "20210816110638****2514606306AF947C",
        "Action": "ModifyServerGroupAttributes",
        "Version": "2020-04-01",
        "Service": "alb",
        "Region": "cn-beijing"
    },
    "Result": {
        "RequestId": "202108161106****22514606306AF947C",
    }
}

错误码

如果响应正文包含 Error 字段,则表示 API 请求失败。此处仅展示当前 API 的错误码,更多错误码请参见公共错误码

HTTP Code

错误码

错误信息

错误描述

400

OperationDenied.AccountArrears

The request on the specified resource is denied due to the account being in arrears status.

因账号处于欠费状态,对于该资源的操作请求被拒绝。

400InvalidServerGroupName.MalformedThe specified ServerGroupName is malformed.指定的 ServerGroupName 参数格式不合法。
400InvalidDescription.MalformedThe specified Description is malformed.指定的 Description 参数格式不合法。
400InvalidScheduler.MalformedThe specified Scheduler is malformed.指定的 Scheduler 参数格式不合法。
400InvalidStickySessionConfig.StickySessionEnabled.MalformedThe specified StickySessionConfig.StickySessionEnabled is malformed.指定的 StickySessionConfig.StickySessionEnabled 参数格式不合法。
400InvalidStickySessionConfig.StickySessionType.MalformedThe specified StickySessionConfig.StickySessionType is malformed.指定的 StickySessionConfig.StickySessionType 参数格式不合法。

400

MissingParameter

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

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

400

MissingParameter

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

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

400

InvalidStickySessionConfig.Cookie.Malformed

The specified StickySessionConfig.Cookie is malformed.

指定的 StickySessionConfig.Cookie 参数格式不合法。

400

MissingParameter

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

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

400InvalidStickySessionConfig.CookieTimeout.MalformedThe specified StickySessionConfig.CookieTimeout is malformed.指定的 StickySessionConfig.CookieTimeout 参数格式不合法。
400InvalidHealthCheck.Enabled.MalformedThe specified HealthCheck.Enabled is malformed.指定的 HealthCheck.Enabled 参数格式不合法。
400InvalidHealthCheck.Interval.MalformedThe specified HealthCheck.Interval is malformed.指定的 HealthCheck.Interval 参数格式不合法。
400InvalidHealthCheck.Timeout.MalformedThe specified HealthCheck.Timeout is malformed.指定的 HealthCheck.Timeout 参数格式不合法。
400InvalidHealthCheck.HealthyThreshold.MalformedThe specified HealthCheck.HealthyThreshold is malformed.指定的 HealthCheck.HealthyThreshold 参数格式不合法。
400InvalidHealthCheck.UnhealthyThreshold.MalformedThe specified HealthCheck.UnhealthyThreshold is malformed.指定的 HealthCheck.UnhealthyThreshold 参数格式不合法。
400InvalidHealthCheck.Protocol.MalformedThe specified HealthCheck.Protocol is malformed.指定的 HealthCheck.Protocol 参数格式不合法。
400InvalidHealthCheck.Method.MalformedThe specified HealthCheck.Method is malformed.指定的 HealthCheck.Method 参数格式不合法。
400InvalidHealthCheck.URI.MalformedThe specified HealthCheck.URI is malformed.指定的 HealthCheck.URI 参数格式不合法。
400InvalidHealthCheck.HttpCode.MalformedThe specified HealthCheck.HttpCode is malformed.指定的 HealthCheck.HttpCode 参数格式不合法。
400InvalidHealthCheck.Domain.MalformedThe specified HealthCheck.Domain is malformed.指定的 HealthCheck.Domain 参数格式不合法。
400InvalidLoadBalancer.InvalidStatusThe related LoadBalancer is not in the correct status for the request.关联的 ALB 实例所处状态无法响应该请求。
400InvalidServerGroup.InvalidStatusThe specified ServerGroup is not in the correct status for the request.指定的服务器组所处状态无法响应该请求。
400InvalidHealthCheck.HttpVersion.MalformedThe specified HealthCheck.HttpVersion is malformed.指定的 HealthCheck.HttpVersion 参数格式不合法。
400MissingParameterThe request is missing a required parameter. Ensure that you have supplied all the required parameters for the request; for example, 'HealthCheck.Domain'.该请求缺少必要参数。请确保发起请求已提供全部必要参数,比如: HealthCheck.Domain。

404

InvalidServerGroup.NotFound

The specified ServerGroup does not exist.

指定的服务器组不存在。