All Products
Search
Document Center

Server Load Balancer:ListHealthCheckTemplates

Last Updated:Jun 10, 2026

Mengkueri templat pemeriksaan kesehatan di suatu wilayah.

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:ListHealthCheckTemplates

list

*HealthCheckTemplate

acs:alb:{#regionId}:{#accountId}:healthchecktemplate/*

None None

Parameter permintaan

Parameter

Type

Required

Description

Example

NextToken

string

No

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

  • Anda tidak perlu menentukan parameter ini untuk permintaan pertama.

  • Anda harus menentukan token yang diperoleh dari kueri sebelumnya sebagai nilai NextToken.

FFmyTO70tTpLG6I3FmYAXGKPd****

MaxResults

integer

No

Jumlah entri yang dikembalikan setiap pemanggilan. Nilai valid: 1 hingga 100. Nilai default: 20.

50

HealthCheckTemplateIds

array

No

ID templat pemeriksaan kesehatan.

string

No

The IDs of health check templates. You can specify up to 20 IDs in each call. The results are filtered based on the specified IDs.

hct-bp1qjwo61pqz3ahltv****

HealthCheckTemplateNames

array

No

Templat pemeriksaan kesehatan.

string

No

The names of health check templates. You can specify up to 10 names in each call. The results are filtered based on the specified names.

test

Tag

array<object>

No

Tag.

object

No

The tags.

Key

string

No

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

env

Value

string

No

The tag value. The tag value can be up to 128 characters in length and cannot start with acs: or aliyun. It cannot contain http:// or https://.

product

ResourceGroupId

string

No

ID kelompok sumber daya. Anda dapat memfilter hasil kueri berdasarkan ID yang ditentukan.

rg-atstuj3rtop****

Elemen respons

Element

Type

Description

Example

object

The information about the health check templates.

HealthCheckTemplates

array<object>

The health check templates.

array<object>

The information about the health check template.

HealthCheckConnectPort

integer

The port that is used for health checks.

Valid values: ** 0 to 65535**.

The default value is 0, which specifies that the port of a backend server is used for health checks.

80

HealthCheckHost

string

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

  • $SERVER_IP (default): the private IP address of a backend server. If an IP address is specified, or this parameter is not specified, the ALB instance uses the private IP address of each backend server as the domain name for health checks.

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

Catatan

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

$_ip

HealthCheckCodes

array

The HTTP status codes that indicate healthy backend servers.

string

The HTTP status code that indicates healthy backend servers.

  • If HealthCheckProtocol is set to HTTP or HTTPS, you can set HealthCheckCodes to http_2xx (default), http_3xx, http_4xx, or http_5xx. Separate multiple status codes with commas (,).

  • If HealthCheckProtocol is set to gRPC, the valid values of HealthCheckCodes are from 0 to 99. The default value is 0. Value ranges are supported. You can enter at most 20 value ranges. Separate multiple value ranges with commas (,).

Catatan

This parameter takes effect only if you set HealthCheckProtocol to HTTP, HTTPS, or gRPC.

http_2xx,http_3xx

HealthCheckHttpVersion

string

The HTTP version for health checks.

Valid values: HTTP 1.0 and HTTP 1.1.

Default value: HTTP 1.1.

Catatan

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

HTTP 1.0

HealthCheckInterval

integer

The interval at which health checks are performed. Unit: seconds. Valid values: 1 to 50. Default value: 2.

5

HealthCheckMethod

string

The HTTP method that is used for health checks. Valid values:

  • HEAD (default): By default, HTTP and HTTPS health checks use the HEAD method.

  • GET: If the length of a response exceeds 8 KB, the response is truncated. However, the health check result is not affected.

  • POST: gRPC health checks use the POST method by default.

Catatan

This parameter takes effect only if you set HealthCheckProtocol to HTTP, HTTPS, or gRPC.

HEAD

HealthCheckPath

string

The URL path that you want to use for health checks.

The URL must be 1 to 80 characters in length, and can contain letters, digits, the following special characters: - / . % ? # &, and the following extended characters: _ ; ~ ! ( ) * [ ] @ $ ^ : ' , +. The URL must start with a forward slash (/).

/test/index.html

HealthCheckProtocol

string

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

  • HTTP (default): The ALB instance sends HEAD or GET requests, which simulate browser requests, to check whether the backend server is healthy.

  • HTTPS: HTTPS health checks simulate browser behaviors by sending HEAD or GET requests to probe the availability of backend servers. HTTPS provides higher security because HTTPS supports data encryption.

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

  • gRPC: gRPC health checks send POST or GET requests to a backend server to check whether the backend server is healthy.

HTTP

HealthCheckTemplateId

string

The ID of the health check template.

hct-bp1qjwo61pqz3ahltv****

HealthCheckTemplateName

string

The name of the health check template.

The name must be 2 to 128 character characters in length, and can contain letters, digits, periods (.), underscores (_), and hyphens (-). It must start with a letter.

HealthCheckTemplate1

HealthCheckTimeout

integer

The timeout period of a health check response. If a backend Elastic Compute Service (ECS) instance does not respond within the specified timeout period, the ECS instance fails to pass the health check.

Valid values: 1 to 300. Unit: seconds.

Default value: 5.

3

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.

Default value: 3.

4

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.

Default value: 3.

4

Tags

array<object>

The tags.

object

The tags.

Key

string

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

env

Value

string

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

product

ResourceGroupId

string

The resource group ID.

rg-atstuj3rtop****

MaxResults

integer

The number of entries returned per page. Valid values: 1 to 100. Default value: 20.

50

NextToken

string

The returned value of NextToken is a pagination token, which 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 was returned in the previous query, specify the value to obtain the next set of results.

FFmyTO70tTpLG6I3FmYAXGKPd****

RequestId

string

The request ID.

365F4154-92F6-4AE4-92F8-7FF34B540710

TotalCount

integer

The total number of entries returned.

1000

Contoh

Respons sukses

JSONformat

{
  "HealthCheckTemplates": [
    {
      "HealthCheckConnectPort": 80,
      "HealthCheckHost": "$_ip",
      "HealthCheckCodes": [
        "http_2xx,http_3xx"
      ],
      "HealthCheckHttpVersion": "HTTP 1.0",
      "HealthCheckInterval": 5,
      "HealthCheckMethod": "HEAD",
      "HealthCheckPath": "/test/index.html",
      "HealthCheckProtocol": "HTTP",
      "HealthCheckTemplateId": "hct-bp1qjwo61pqz3ahltv****",
      "HealthCheckTemplateName": "HealthCheckTemplate1",
      "HealthCheckTimeout": 3,
      "HealthyThreshold": 4,
      "UnhealthyThreshold": 4,
      "Tags": [
        {
          "Key": "env",
          "Value": "product"
        }
      ],
      "ResourceGroupId": "rg-atstuj3rtop****"
    }
  ],
  "MaxResults": 50,
  "NextToken": "FFmyTO70tTpLG6I3FmYAXGKPd****",
  "RequestId": "365F4154-92F6-4AE4-92F8-7FF34B540710",
  "TotalCount": 1000
}

Kode kesalahan

HTTP status code

Error code

Error message

Description

403 Forbidden.HealthCheckTemplate Authentication has failed for HealthCheckTemplate.

Lihat Error Codes untuk daftar lengkap.

Catatan rilis

Lihat Release Notes untuk daftar lengkap.