All Products
Search
Document Center

Server Load Balancer:ListServerGroups

Last Updated:Jun 10, 2026

Mengkueri kelompok server dari Instans Gateway Load Balancer (GWLB).

Coba sekarang

Coba API ini di OpenAPI Explorer tanpa perlu penandatanganan manual. Panggilan yang berhasil akan secara otomatis menghasilkan contoh kode SDK sesuai dengan parameter Anda. Unduh kode tersebut dengan kredensial bawaan yang aman untuk penggunaan lokal.

Test

RAM authorization

Tabel berikut menjelaskan otorisasi yang diperlukan untuk memanggil API ini. Anda dapat menentukannya dalam kebijakan Resource Access Management (RAM). Kolom pada tabel dijelaskan sebagai berikut:

  • Action: Aksi yang dapat digunakan dalam elemen Action pada pernyataan kebijakan izin RAM untuk memberikan izin guna melakukan operasi tersebut.

  • API: API yang dapat Anda panggil untuk melakukan aksi tersebut.

  • Access level: Tingkat akses yang telah ditentukan untuk setiap API. Nilai yang valid: create, list, get, update, dan delete.

  • Resource type: Jenis resource yang mendukung otorisasi untuk melakukan aksi tersebut. Ini menunjukkan apakah aksi tersebut mendukung izin tingkat resource. Resource yang ditentukan harus kompatibel dengan aksi tersebut. Jika tidak, kebijakan tersebut tidak akan berlaku.

    • Untuk API dengan izin tingkat resource, jenis resource yang diperlukan ditandai dengan tanda bintang (*). Tentukan Nama Sumber Daya Alibaba Cloud (ARN) yang sesuai dalam elemen Resource pada kebijakan.

    • Untuk API tanpa izin tingkat resource, ditampilkan sebagai All Resources. Gunakan tanda bintang (*) dalam elemen Resource pada kebijakan.

  • Condition key: Kunci kondisi yang didefinisikan oleh layanan. Kunci ini memungkinkan kontrol granular, berlaku baik hanya untuk aksi maupun untuk aksi yang terkait dengan resource tertentu. Selain kunci kondisi spesifik layanan, Alibaba Cloud menyediakan serangkaian common condition keys yang berlaku di semua layanan yang didukung RAM.

  • Dependent action: Aksi dependen yang diperlukan untuk menjalankan aksi tersebut. Untuk menyelesaikan aksi tersebut, pengguna RAM atau role RAM harus memiliki izin untuk melakukan semua aksi dependen.

Action

Access level

Resource type

Condition key

Dependent action

gwlb:ListServerGroups

get

ServerGroup

acs:gwlb:{#regionId}:{#accountId}:servergroup/*

ServerGroup

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

VPC

acs:vpc:{#regionId}:{#accountId}:vpc/{#VpcId}

None None

Parameter permintaan

Parameter

Type

Required

Description

Example

ServerGroupIds

array

No

ID kelompok server.

Anda dapat menentukan maksimal 20 ID kelompok server dalam setiap panggilan.

string

No

The server group ID.

sgp-atstuj3rtoptyui****

ServerGroupNames

array

No

Nama kelompok server.

Anda dapat menentukan maksimal 20 nama kelompok server dalam setiap panggilan.

string

No

The server group name.

testServerGroupName

ServerGroupType

string

No

Tipe kelompok server. Nilai valid:

  • Instance: memungkinkan Anda menentukan Sumber daya bertipe Ecs, Eni, atau Eci.

  • Ip: memungkinkan Anda menambahkan server dengan menentukan alamat IP.

Instance

ResourceGroupId

string

No

ID kelompok sumber daya tempat instans berada.

rg-atstuj3rtop****

Tag

array<object>

No

Kunci tag.

Anda dapat menentukan maksimal 20 tag dalam setiap panggilan.

object

No

The tag.

Key

string

No

The tag key. The tag key cannot be an empty string. The tag key can be up to 128 characters in length, and cannot start with acs: or aliyun. The tag key cannot contain http:// or https://.

testTagKey

Value

string

No

The tag value. The tag value can be up to 256 characters in length and cannot contain http:// or https://.

testTagValue

VpcId

string

No

ID VPC.

vpc-bp15zckdt37pq72zv****

NextToken

string

No

Token paginasi yang digunakan di permintaan berikutnya untuk mengambil halaman hasil baru. Nilai valid:

  • Jika NextToken kosong, tidak ada halaman berikutnya.

  • Jika nilai NextToken dikembalikan, nilai tersebut menunjukkan token yang digunakan untuk kueri berikutnya.

FFmyTO70tTpLG6I3FmYAXGKPd****

MaxResults

integer

No

Jumlah entri per halaman.

Nilai valid: 1 hingga 1000.

Nilai default: 20.

20

Skip

integer

No

Jumlah entri yang akan dilewati dalam panggilan.

1

Elemen respons

Element

Type

Description

Example

object

The response parameters.

MaxResults

integer

The number of entries per page.

Valid values: 1 to 1000.

20

NextToken

string

A pagination token. It can be used in the next request to retrieve a new page of results. Valid values:

  • If NextToken is empty, no next page exists.

  • If a value of NextToken is returned, the value indicates the token that is used for the next query.

FFmyTO70tTpLG6I3FmYAXGKPd****

RequestId

string

The request ID.

54B48E3D-DF70-471B-AA93-08E683A1B45

ServerGroups

array<object>

The configurations of the server group.

array<object>

The server group.

ConnectionDrainConfig

object

The configurations of connection draining.

ConnectionDrainEnabled

boolean

Indicates whether connection draining is enabled. Valid values:

  • true

  • false

false

ConnectionDrainTimeout

integer

The timeout period of connection draining.

Unit: seconds

Valid values: 1 to 3600.

300

CreateTime

string

The time when the resource was created. The time follows the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time is displayed in UTC.

2024-08-05T18:24:07Z

HealthCheckConfig

object

The configuration of health checks.

HealthCheckConnectPort

integer

The backend server port that is used for health checks.

Valid values: 1 to 65535.

80

HealthCheckConnectTimeout

integer

The maximum timeout period of a health check.

Unit: seconds

Valid values: 1 to 300.

5

HealthCheckDomain

string

The domain name that is used for health checks. Valid values:

  • $SERVER_IP: the internal IP address of a backend server.

  • domain: a domain name. The domain name must be 1 to 80 characters in length, and can contain letters, digits, hyphens (-), and periods (.).

Catatan

This parameter takes effect only if you set HealthCheckProtocol to HTTP.

$SERVER_IP

HealthCheckEnabled

boolean

Indicates whether the health check feature is enabled. Valid values:

  • true

  • false

true

HealthCheckHttpCode

array

The HTTP status codes that the system returns for health checks.

string

The HTTP status code to return for health checks. Separate multiple HTTP status codes with commas (,). Valid values:

  • http_2xx

  • http_3xx

  • http_4xx

  • http_5xx

Default value: http_2xx.

Catatan

This parameter takes effect only if you set HealthCheckProtocol to HTTP.

http_2xx

HealthCheckInterval

integer

The interval at which health checks are performed.

Unit: seconds

Valid values: 1 to 50.

10

HealthCheckPath

string

The URL that is used for health checks.

The URL must be 1 to 80 characters in length, and can contain letters, digits, and the following special characters: - / . % ? # & The URL must start with a forward slash (/).

Catatan

This parameter takes effect only if you set HealthCheckProtocol to HTTP.

/test/index.html

HealthCheckProtocol

string

The protocol that is used for health checks. Valid values:

  • TCP: TCP health checks send TCP SYN packets to a backend server to check whether the port of the backend server is reachable.

  • HTTP: HTTP health checks simulate a process that uses a web browser to access resources by sending HEAD or GET requests to an instance. These requests are used to check whether the instance is healthy.

TCP

HealthyThreshold

integer

The number of times that an unhealthy backend server must consecutively pass health checks before it is declared healthy. In this case, the health status changes from fail to success.

Valid values: 2 to 10.

2

UnhealthyThreshold

integer

The number of times that a healthy backend server must consecutively fail health checks before it is declared unhealthy. In this case, the health status changes from success to fail.

Valid values: 2 to 10.

2

HealthCheckReq

string

HealthCheckExp

string

Protocol

string

The backend protocol. Valid values:

  • GENEVE.

GENEVE

RelatedLoadBalancerIds

array

The IDs of the GWLB instances that are associated with the server group.

string

The ID of the GWLB instance that is associated with the server group.

gwlb-cp6prgqy40hols****

ResourceGroupId

string

The resource group ID.

rg-atstuj3rtop****

Scheduler

string

The scheduling algorithm. Valid values:

  • 5TCH: indicates consistent hashing that is based on the following factors: source IP address, destination IP address, source port, protocol, and destination port. Requests that contain the same information based on the preceding factors are forwarded to the same backend server.

  • 3TCH: indicates consistent hashing that is based on the following factors: source IP address, destination IP address, and protocol. Requests that contain the same information based on the preceding factors are forwarded to the same backend server.

  • 2TCH: indicates consistent hashing that is based on the following factors: source IP address and destination IP address. Requests that contain the same information based on the preceding factors are forwarded to the same backend server.

5TCH

ServerCount

integer

The number of server groups.

2

ServerGroupId

string

The server group ID.

sgp-atstuj3rtoptyui****

ServerGroupName

string

The server group name.

testServerGroupName

ServerGroupStatus

string

The status of the server group. Valid values:

  • Creating

  • Available

  • Configuring

Available

ServerGroupType

string

The server group type. Valid values:

  • Instance: allows you to specify servers of the Ecs, Eni, or Eci type.

  • Ip: allows you to add servers of by specifying IP addresses.

Instance

ServerFailoverMode

string

Specifies how GWLB processes requests over existing connections when a backend server is not running as expected. Valid values:

  • NoRebalance: GWLB continues to forward requests over existing connections to the unhealthy backend server.

  • Rebalance: GWLB forwards requests over existing connections to the remaining healthy backend servers.

NoRebalance

Tags

array<object>

The tags.

object

The tag.

Key

string

The tag key. The tag key cannot be an empty string. The tag key can be up to 128 characters in length, and cannot start with acs: or aliyun. The tag key cannot contain http:// or https://.

testTagKey

Value

string

The tag value. The tag value can be up to 256 characters in length and cannot contain http:// or https://.

testTagValue

VpcId

string

The VPC ID.

vpc-bp15zckdt37pq72zv****

TotalCount

integer

The total number of entries returned.

1

Contoh

Respons sukses

JSONformat

{
  "MaxResults": 20,
  "NextToken": "FFmyTO70tTpLG6I3FmYAXGKPd****",
  "RequestId": "54B48E3D-DF70-471B-AA93-08E683A1B45",
  "ServerGroups": [
    {
      "ConnectionDrainConfig": {
        "ConnectionDrainEnabled": false,
        "ConnectionDrainTimeout": 300
      },
      "CreateTime": "2024-08-05T18:24:07Z",
      "HealthCheckConfig": {
        "HealthCheckConnectPort": 80,
        "HealthCheckConnectTimeout": 5,
        "HealthCheckDomain": "$SERVER_IP",
        "HealthCheckEnabled": true,
        "HealthCheckHttpCode": [
          "http_2xx"
        ],
        "HealthCheckInterval": 10,
        "HealthCheckPath": "/test/index.html",
        "HealthCheckProtocol": "TCP",
        "HealthyThreshold": 2,
        "UnhealthyThreshold": 2,
        "HealthCheckReq": "",
        "HealthCheckExp": ""
      },
      "Protocol": "GENEVE",
      "RelatedLoadBalancerIds": [
        "gwlb-cp6prgqy40hols****"
      ],
      "ResourceGroupId": "rg-atstuj3rtop****",
      "Scheduler": "5TCH",
      "ServerCount": 2,
      "ServerGroupId": "sgp-atstuj3rtoptyui****",
      "ServerGroupName": "testServerGroupName",
      "ServerGroupStatus": "Available",
      "ServerGroupType": "Instance",
      "ServerFailoverMode": "NoRebalance",
      "Tags": [
        {
          "Key": "testTagKey",
          "Value": "testTagValue"
        }
      ],
      "VpcId": "vpc-bp15zckdt37pq72zv****"
    }
  ],
  "TotalCount": 1
}

Kode kesalahan

Lihat Error Codes untuk daftar lengkap.

Catatan rilis

Lihat Release Notes untuk daftar lengkap.