All Products
Search
Document Center

Server Load Balancer:GetListenerHealthStatus

Last Updated:Jun 10, 2026

Mengambil status pemeriksaan kesehatan dari sebuah Pendengar dan daftar aturan pengalihannya.

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

alb:GetListenerHealthStatus

get

*LoadBalancer

acs:alb:{#regionId}:{#accountId}:loadbalancer/{#loadbalancerId}

None None

Parameter permintaan

Parameter

Type

Required

Description

Example

ListenerId

string

Yes

ID Pendengar dalam daftar.

lsn-o4u54y73wq7b******

IncludeRule

boolean

No

Apakah akan menyertakan hasil pemeriksaan kesehatan untuk aturan pengalihan.

  • true

  • false (default).

true

NextToken

string

No

Token yang digunakan untuk mengambil halaman daftar berikutnya.

  • Anda tidak perlu menentukan parameter ini untuk permintaan pertama.

  • Untuk permintaan berikutnya, tetapkan parameter ini ke nilai NextToken yang dikembalikan di tanggapan sebelumnya.

FFmyTO70tTpLG6I3FmYAXGKPd****

MaxResults

integer

No

Jumlah entri yang dikembalikan per halaman. Rentang: 1 hingga 30. Default: 20.

20

Elemen respons

Element

Type

Description

Example

object

The health check statuses of the listener and its associated forwarding rules.

ListenerHealthStatus

array<object>

A list of health check statuses for the server groups that are associated with the listener.

array<object>

The health check status of a server group that is associated with the listener.

ListenerId

string

The ID of the listener.

lsn-o4u54y73wq7b******

ListenerPort

integer

The port of the listener.

80

ListenerProtocol

string

The protocol of the listener.

http

ServerGroupInfos

array<object>

Information about the server groups.

array<object>

Information about a server group.

HealthCheckEnabled

string

Indicates whether health checks are enabled. If on is returned, it indicates that health checks are enabled.

on

NonNormalServers

array<object>

A list of unhealthy backend servers.

array<object>

A list of unhealthy backend servers.

Port

integer

The backend port.

90

Reason

object

The cause for the unhealthy state of the backend servers.

ActualResponse

string

The HTTP status code returned from the server, for example, 302.

Catatan

A value is returned only if ReasonCode is set to RESPONSE_MISMATCH.

302

ExpectedResponse

string

The HTTP status code returned after backend servers pass health checks.

Valid values: HTTP_2xx, HTTP_3xx, HTTP_4xx, and HTTP_5xx. Multiple status codes are separated by commas (,).

Catatan

This value is returned only if ReasonCode is set to RESPONSE_MISMATCH.

HTTP_2xx

ReasonCode

string

The reason why the value of Status is Unhealthy. Only HTTP and HTTPS listeners support this parameter.

  • CONNECT_TIMEOUT: ALB failed to connect to the backend server within the specified period of time.

  • CONNECT_FAILED: ALB failed to connect to the backend server.

  • RECV_RESPONSE_FAILED: ALB failed to receive a response from the backend server.

  • RECV_RESPONSE_TIMEOUT: ALB failed to receive a response from the backend server within the specified period of time.

  • SEND_REQUEST_FAILED: ALB failed to send a request to the backend server.

  • SEND_REQUEST_TIMEOUT: ALB failed to send a request to the backend server within the specified period of time.

  • RESPONSE_FORMAT_ERROR: The format of the response from the backend server is invalid.

  • RESPONSE_MISMATCH: The HTTP status code returned from the backend server is not the expected one.

RESPONSE_MISMATCH

ServerId

string

The ID of the backend server.

i-uf62h8v******

ServerIp

string

The IP address of the backend server.

192.168.8.10

Status

string

The status of the health check. Valid values: Valid values:

  • Initial: indicates that health checks are configured for the NLB instance, but no data was found.

  • Unhealthy: indicates that the backend server consecutively fails health checks.

  • Unused: indicates that the weight of the backend server is 0.

  • Unavailable: indicates that health checks are disabled.

Initial

ServerGroupId

string

The ID of the server group that is associated with the listener.

sgp-8ilqs4axp6******

ActionType

string

The action specified for the server group. Valid values:

  • ForwardGroup: distributes requests to server groups.

  • TrafficMirror: mirrors requests to server groups.

TrafficMirror

RequestId

string

The request ID.

CEF72CEB-54B6-4AE8-B225-F876F******

RuleHealthStatus

array<object>

A list of health check statuses for the forwarding rules.

array<object>

The health check status of a forwarding rule.

RuleId

string

The ID of the forwarding rule.

rule-hp34s2h0xx1ht4nwo****

ServerGroupInfos

array<object>

A list of associated server groups.

array<object>

Details of an associated server group.

HealthCheckEnabled

string

Indicates whether health checks are enabled. If on is returned, it indicates that health checks are enabled.

on

NonNormalServers

array<object>

A list of unhealthy backend servers.

array<object>

A list of unhealthy backend servers.

Port

integer

The backend port.

90

Reason

object

The cause for the unhealthy state of the backend servers.

ActualResponse

string

The HTTP status code returned from the server, for example, 302.

Catatan

A value is returned only if ReasonCode is set to RESPONSE_MISMATCH.

302

ExpectedResponse

string

The HTTP status code returned after backend servers pass health checks.

Valid values: HTTP_2xx, HTTP_3xx, HTTP_4xx, and HTTP_5xx. Multiple status codes are separated by commas (,).

Catatan

A value is returned only if ReasonCode is set to RESPONSE_MISMATCH.

HTTP_2xx

ReasonCode

string

The reason why the value of Status is Unhealthy. Only forwarding rules for HTTP and HTTPS listeners support this parameter.

  • CONNECT_TIMEOUT: ALB failed to connect to the backend server within the specified period of time.

  • CONNECT_FAILED: ALB failed to connect to the backend server.

  • RECV_RESPONSE_FAILED: ALB failed to receive a response from the backend server.

  • RECV_RESPONSE_TIMEOUT: ALB failed to receive a response from the backend server within the specified period of time.

  • SEND_REQUEST_FAILED: ALB failed to send a request to the backend server.

  • SEND_REQUEST_TIMEOUT: ALB failed to send a request to the backend server within the specified period of time.

  • RESPONSE_FORMAT_ERROR: The format of the response from the backend server is invalid.

  • RESPONSE_MISMATCH: The HTTP status code returned from the backend server is not the expected one.

RESPONSE_MISMATCH

ServerId

string

The ID of the backend server.

i-uf62h8v******

ServerIp

string

The IP address of the server group.

192.168.2.11

Status

string

The status of the health check. Valid values: Valid values:

  • Initial: indicates that health checks are configured for the NLB instance, but no data was found.

  • Unhealthy: indicates that the backend server consecutively fails health checks.

  • Unused: indicates that the weight of the backend server is 0.

  • Unavailable: indicates that health checks are disabled.

Initial

ServerGroupId

string

The ID of the server group that is associated with the listener.

sgp-8ilqs4axp6******

ActionType

string

The action specified for the server group.

TrafficMirror

NextToken

string

The pagination token that is used in the next request to retrieve a new page of results.

  • If this parameter is empty, all results have been returned.

  • If a value is returned, pass it in the next request to retrieve the next page of results.

FFmyTO70tTpLG6I3FmYAXGKPd****

Contoh

Respons sukses

JSONformat

{
  "ListenerHealthStatus": [
    {
      "ListenerId": "lsn-o4u54y73wq7b******",
      "ListenerPort": 80,
      "ListenerProtocol": "http",
      "ServerGroupInfos": [
        {
          "HealthCheckEnabled": "on",
          "NonNormalServers": [
            {
              "Port": 90,
              "Reason": {
                "ActualResponse": "302",
                "ExpectedResponse": "HTTP_2xx",
                "ReasonCode": "RESPONSE_MISMATCH"
              },
              "ServerId": "i-uf62h8v******",
              "ServerIp": "192.168.8.10",
              "Status": "Initial"
            }
          ],
          "ServerGroupId": "sgp-8ilqs4axp6******",
          "ActionType": "TrafficMirror"
        }
      ]
    }
  ],
  "RequestId": "CEF72CEB-54B6-4AE8-B225-F876F******",
  "RuleHealthStatus": [
    {
      "RuleId": "rule-hp34s2h0xx1ht4nwo****",
      "ServerGroupInfos": [
        {
          "HealthCheckEnabled": "on",
          "NonNormalServers": [
            {
              "Port": 90,
              "Reason": {
                "ActualResponse": "302",
                "ExpectedResponse": "HTTP_2xx",
                "ReasonCode": "RESPONSE_MISMATCH"
              },
              "ServerId": "i-uf62h8v******",
              "ServerIp": "192.168.2.11",
              "Status": "Initial"
            }
          ],
          "ServerGroupId": "sgp-8ilqs4axp6******",
          "ActionType": "TrafficMirror"
        }
      ]
    }
  ],
  "NextToken": "FFmyTO70tTpLG6I3FmYAXGKPd****"
}

Kode kesalahan

HTTP status code

Error code

Error message

Description

403 Forbidden.LoadBalancer Authentication is failed for %s.
404 ResourceNotFound.LoadBalancer The specified resource %s is not found.
404 ResourceNotFound.Listener The specified resource %s is not found.

Lihat Error Codes untuk daftar lengkap.

Catatan rilis

Lihat Release Notes untuk daftar lengkap.