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

DescribeServerGroups

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

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

调用 DescribeServerGroups 接口查询后端服务器组列表。

调试

请求参数

名称类型是否必填示例值
描述
ActionStringDescribeServerGroups要执行的操作,取值为DescribeServerGroups。
VersionString2020-04-01API版本信息,当前版本为:2020-04-01。
LoadBalancerIdStringclb-bp1o94dp5i6ea****后端服务器所属的负载均衡实例ID。您可以调用DescribeLoadBalancers接口获取负载均衡实例ID。
ServerGroupNameStringmyservergroup后端服务器组名称。

ServerGroupIds.N

String

ServerGroupIds.1=rsp-2fel9y8pxr56o5oxruuuu****&ServerGroupIds.2=rsp-1g0ogy36a8t8g8ibuxwy5****

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

  • 参数 - N:表示后端服务器组的序号,取值范围为1 ~ 100。
  • 多个后端服务器组ID间使用“&”分隔。
PageSizeInteger20分页查询时每页的行数,取值范围为1 ~100,默认为10。
PageNumberInteger1列表的页码,默认值为1。

Type

String

instance

后端服务器组的类型。取值如下:

  • instance(默认值):表示该后端服务器组只能添加云服务器的主网卡或辅助网卡作为后端服务器。
  • ip:表示该后端服务器组只能添加IP地址作为后端服务器。

返回数据

字段类型示例值
描述
RequestIdString20210811152539010225146063030****请求ID。
PageSizeInteger20当前分页的行数。
PageNumberInteger1当前页码。
TotalCountInteger50符合条件的后端服务器组总数。
ServerGroupsArray of Struct-符合条件的后端服务器组的详细信息。具体请参见下表“ ServerGroups ”。

ServerGroups

字段类型示例值
描述
ServerGroupIdStringrsp-2fel9y8pxr56o5oxruuuu****后端服务器组的ID。
ServerGroupNameStringmyservergroup后端服务器组的名称。

Type

String

instance

后端服务器组的类型。

  • instance:表示该后端服务器组只能添加云服务器的主网卡或辅助网卡作为后端服务器。
  • ip:表示该后端服务器组只能添加IP地址作为后端服务器。
DescriptionStringtest后端服务器组的描述。
CreateTimeString2021-08-11T16:37:37Z后端服务器组的创建时间。
UpdateTimeString2021-08-11T16:37:37Z后端服务器组的最近操作时间。

AddressIpVersion

String

ipv4

后端服务器组的IP地址类型。

  • ipv4:表示该后端服务器组为IPv4类型。
  • ipv6:表示该后端服务器组为IPv6类型。

支持IPv6后端的功能正在邀测中,如需使用,请联系客户经理申请权限。

请求示例

GET /?Action=DescribeServerGroups&Version=2020-04-01&ServerGroupIds.1=rsp-2fel9y8pxr56o5oxruuuu**** HTTP/1.1
Host: open.volcengineapi.com
Region: cn-beijing
Service: clb

返回示例

{
    "ResponseMetadata": {
        "RequestId": "20210811152539010225146063030****",
        "Action": "DescribeServerGroups",
        "Version": "2020-04-01",
        "Service": "clb",
        "Region": "cn-beijing"
    },      
    "Result": {
        "RequestId": "20210811152539010225146063030****",
        "PageNumber": 1,
        "PageSize": 20,
        "TotalCount": 1,
        "ServerGroups": [
            {
                "CreateTime": "2021-08-12T17:27:23z",
                "UpdateTime": "2021-08-12T17:27:23z",
                "ServerGroupId": "rsp-2fel9y8pxr56o5oxruuuu****",
                "ServerGroupName": "myservergroup",
                "Type": "instance",
                "Description": "test",
                "AddressIpVersion": "ipv4"
            }
        ]
    }
}

错误码

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

HttpCode错误码错误信息描述
400InvalidName.MalformedThe specified Name is malformed.指定的 Name 参数格式不合法。
400InvalidType.MalformedThe specified Type is malformed.指定的 Type 参数格式不合法。
400InvalidPaging.MalformedThe specified PageNumber or PageSize is malformed.指定的分页参数格式不合法。
400LimitExceeded.ServerGroupIdYou've reached the limit on the number of ServerGroupId that you can operate.已达到单次可操作后端服务器组的资源数量上限。