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

ModifyServerGroupAttributes

最近更新时间2024.04.03 10:22:59

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

调用 ModifyServerGroupAttributes 接口修改指定后端服务器组,包括服务器组的名称、描述、以及指定服务器的相关信息。

使用说明

调用一次接口最多可修改20台后端服务器。

调试

请求参数

名称类型是否必填示例值
描述
ActionStringModifyServerGroupAttributes要执行的操作,取值为ModifyServerGroupAttributes。
VersionString2020-04-01API版本信息,当前版本为:2020-04-01。
ServerGroupIdStringrsp-bp1o94dp5i6ea****后端服务器组ID。您可以调用DescribeServerGroups接口获取后端服务器组ID。

ServerGroupName

String

myservergroup

后端服务器组的名称。

  • 必须以字母、数字或中文开头,可包含字母、数字、中文及以下特殊字符:点号(.)、下划线(_)和中划线(-)。
  • 长度限制为1 ~ 128个字符。

Description

String

This is a servergroup.

后端服务器组的描述。

  • 必须以字母、数字或中文开头,可包含字母、数字、中文及以下特殊字符:英文逗号(,)、点号(.)、下划线(_)、空格( )、等号(=)、中划线(-)、中文逗号(,)、中文句号(。)。
  • 长度限制为0 ~ 255个字符。

Servers.N.ServerId

String

Servers.1.ServerId=rs-mjc9b2p0v6rk5smt1b27****&Servers.2.ServerId=rs-rry6aq7sb280v0x588v****

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

  • 参数 - N:表示后端服务器的序号。取值范围为1 ~ 20。
  • 多个后端服务器ID间使用“&”分隔。

Servers.N.Weight

Integer

Servers.1.Weight=100&Servers.2.Weight=100

后端服务器的权重,取值范围为0 ~ 100。

  • 如果权重设置为0,表示不会将请求转发给该后端服务器。
  • 参数 - N:表示后端服务器的序号。取值范围为1 ~ 20。

Servers.N.Port

Integer

Servers.1.Port=88&Servers.2.Port=443

后端服务器接收请求的端口号,取值范围为1~65535 。
参数 - N:表示后端服务器的序号。取值范围为1 ~ 20。

Servers.N.Description

String

Servers.1.Description=ecs1&Servers.2.Description=eni1

后端服务器的描述。

  • 参数 - N:表示后端服务器的序号。取值范围为1 ~ 20。
  • 必须以字母、数字或中文开头,可包含字母、数字、中文和以下特殊字符:或中文开头,可包含数字、英文逗号(,)、点号(.)、下划线(_)、空格( )、等号(=)、中划线(-)、中文逗号(,)、中文句号(。)。
  • 长度限制为0 ~ 255个字符。

返回参数

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

请求示例

GET /?Action=ModifyServerGroupAttributes&Version=2020-04-01&ServerGroupId=rsp-bp1o94dp5i6ea****&ServerGroupName=myservergroup&Servers.1.ServerId=rs-mjc9b2p0v6rk5smt1b27****&Servers.1.Port=88&&Servers.1.Weight=100 HTTP/11
Host: open.volcengineapi.com
Region: cn-beijing
Service: clb

返回示例

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

错误码

下表为您列举了该接口与业务逻辑相关的错误码。公共错误码请参见公共错误码文档。

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 参数格式不合法。
400InvalidPort.MalformedThe specified Port is malformed.指定的 Port 参数格式不合法。
400InvalidServerGroupName.MalformedThe specified ServerGroupName is malformed.指定的 ServerGroupName 参数格式不合法。
400InvalidServers.Description.MalformedThe specified Servers.Description is malformed.指定的 Servers.Description 参数格式不合法。
400InvalidServers.Weight.MalformedThe specified Servers.Weight is malformed.指定的 Servers.Weight 参数格式不合法。
400UnsupportedOperation.AccountArrearsThe request on the specified instance is denied due to the account in arrears status.因账户处于欠费状态,对于该实例的操作请求被拒绝。
400LimitExceeded.ServerNumberYou've reached the limit on the number of add servers that you can operate.已达到单次可操作的后端服务器的数量上限。
400InvalidIncorrectOrder.MalformedThe specified index order is malformed.指定的索引顺序参数格式不合法。
403InvalidResourceType.ServcieManagedThe specified ResourceType is managed by a service.指定的资源是服务托管资源。
404InvalidServerGroup.NotFoundThe specified ServerGroup does not exist.指定的后端服务器组不存在。
404InvalidServer.NotFoundThe specified Server does not exist.指定的后端服务器不存在。
404InvalidExclusiveCluster.NotFoundThe specified ExclusiveCluster does not exist.指定的独占集群不存在。
409InvalidServer.ConflictThe specified Server already exists.指定的后端服务器已存在。
409InvalidServerPort.ConflictThe specified Server Port already exists.指定的后端服务器端口已存在。
400InvalidLoadBalancer.InvalidStatusThe specified LoadBalancer is not in the correct status for the request.指定的负载均衡所处状态无法响应该请求。
412InvalidLoadBalancer.ExpiredThe specified LoadBalancer has expired.指定的负载均衡已过期。
412InvalidExclusiveCluster.ExpiredThe specified ExclusiveCluster has expired.指定的独占集群已过期。
412InvalidExclusiveCluster.UnPurchasedThe specified ExclusiveCluster is not purchased.指定的独占集群未购买。