Updated on 2025-08-29 GMT+08:00

Querying Health Checks

Function

This API is used to query all health checks.

Constraints

This API has the following constraints:

  • Parameters marker, limit, and page_reverse are used for pagination query.

  • Parameters marker and page_reverse take effect only when they are used together with parameter limit.

Calling Method

For details, see Calling APIs.

URI

GET /v3/{project_id}/elb/healthmonitors

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Definition: Specifies the project ID. For details about how to obtain a project ID, see Obtaining a Project ID.

Constraints: N/A

Range: The value can contain a maximum of 32 characters, including digits and lowercase letters.

Default value: N/A

Table 2 Query Parameters

Parameter

Mandatory

Type

Description

marker

No

String

Definition: Specifies the ID of the last record on the previous page.

Constraints:

  • This parameter must be used together with limit.

  • If the parameter is not specified, only resources on the first page are queried.

  • This parameter cannot be left blank or set to an invalid ID.

Range: N/A

Default value: N/A

limit

No

Integer

Definition: Specifies the number of records returned on each page.

Constraints: N/A

Range: 0 to 2000

Default value: 2000

page_reverse

No

Boolean

Definition: Specifies whether to use reverse query.

Constraints:

  • This parameter must be used together with limit.

  • If page_reverse is set to true and you want to query the resources on the previous page, set the value of marker to the value of previous_marker.

Range:

  • true: Query resources on the previous page.

  • false: Query resources on the next page.

Default value: false

id

No

Array of strings

Specifies the health check ID.

Multiple IDs can be used for query in the format of id=xxx&id=xxx.

monitor_port

No

Array of integers

Specifies the port used for the health check.

Multiple ports can be used for query in the format of monitor_port=xxx&monitor_port=xxx.

domain_name

No

Array of strings

Specifies the domain name to which HTTP requests are sent during the health check.

The value can contain only digits, letters, hyphens (-), and periods (.) and must start with a digit or letter.

Multiple domain names can be used for query in the format of domain_name=xxx&domain_name=xxx.

name

No

Array of strings

Specifies the health check name.

Multiple names can be used for query in the format of name=xxx&name=xxx.

delay

No

Array of integers

Specifies the interval between health checks, in seconds. The value ranges from 1 to 50.

Multiple intervals can be used for query in the format of delay=xxx&delay=xxx.

max_retries

No

Array of integers

Specifies the number of consecutive health checks when the health check result of a backend server changes from OFFLINE to ONLINE.

Range: 1 to 10

Multiple values can be used for query in the format of max_retries=xxx&max_retries=xxx.

admin_state_up

No

Boolean

Definition: Specifies the administrative status of the health check.

Range:

  • true: The health check function is enabled.

  • false: The health check function is disabled.

max_retries_down

No

Array of integers

Specifies the number of consecutive health checks when the health check result of a backend server changes from ONLINE to OFFLINE.

Range: 1 to 10

Multiple values can be used for query in the format of max_retries_down=xxx&max_retries_down=xxx.

timeout

No

Integer

Specifies the maximum time required for waiting for a response from the health check, in seconds.

type

No

Array of strings

Specifies the health check protocol. The value can be TCP, UDP_CONNECT, HTTP, HTTPS, TLS, or GRPC.

Multiple protocols can be used for query in the format of type=xxx&type=xxx.

expected_codes

No

Array of strings

Specifies the expected HTTP status code. This parameter will take effect only when type is set to HTTP, HTTPS, or GRPC.

The value options are as follows:

  • A specific value, for example, 200

  • A list of values that are separated with commas (,), for example, 200, 202

  • A value range, for example, 200-204

The default value is 200.

Multiple status codes can be used for query in the format of expected_codes=xxx&expected_codes=xxx.

url_path

No

Array of strings

Specifies the HTTP request path for the health check. The value must start with a slash (/), and the default value is /. This parameter is available only when type is set to HTTP or HTTPS.

Multiple paths can be used for query in the format of url_path=xxx&url_path=xxx.

http_method

No

Array of strings

Specifies the HTTP method.

The value can be GET, HEAD, or POST.

Multiple methods can be used for query in the format of http_method=xxx&http_method=xxx.

enterprise_project_id

No

Array of strings

Definition: Specifies the ID of the enterprise project.

Multiple values can be used for query in the format of:

enterprise_project_id=xxx&enterprise_project_id=xxx.

Constraints:

  • If enterprise_project_id is not specified, resources in all enterprise projects are queried by default. Fine-grained authorization is performed. The elb:healthmonitors:list permission must be assigned to the user group.

  • If enterprise_project_id is specified, the value can be a specific enterprise project ID or all_granted_eps. If the value is a specific enterprise project ID, only resources in the enterprise project are queried. If the value is all_granted_eps, resources in the enterprise projects with the elb:healthmonitors:list permission are queried.

Range: N/A

Default value: N/A

Request Parameters

Table 3 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

Definition: Specifies the token used for IAM authentication.

Response Parameters

Status code: 200

Table 4 Response body parameters

Parameter

Type

Description

request_id

String

Definition: Specifies the request ID.

Range: The value is automatically generated, and can contain characters including digits, lowercase letters, and hyphens (-).

page_info

PageInfo object

Definition: Specifies the pagination information.

healthmonitors

Array of HealthMonitor objects

Specifies the health check.

Table 5 PageInfo

Parameter

Type

Description

previous_marker

String

Definition: Specifies the ID of the first record in the pagination query result. If page_reverse is set to true, this parameter is used together to query resources on the previous page.

Range: N/A

next_marker

String

Definition: Specifies the ID of the last record in the pagination query result. It is usually used to query resources on the next page.

Range: N/A

current_count

Integer

Definition: Specifies the number of records returned on the current page.

Range: N/A

Table 6 HealthMonitor

Parameter

Type

Description

admin_state_up

Boolean

Specifies the administrative status of the health check.

Range:

  • true: The health check function is enabled.

  • false: The health check function is disabled.

Default value: true

delay

Integer

Specifies the interval between health checks, in seconds. The value ranges from 1 to 50.

domain_name

String

Specifies the domain name that HTTP requests are sent to during the health check.

The value can contain only digits, letters, hyphens (-), and periods (.) and must start with a digit or letter.

The value is left blank by default, indicating that the virtual IP address of the load balancer is used as the destination address of HTTP requests.

This parameter is available only when type is set to HTTP or HTTPS.

expected_codes

String

Specifies the expected HTTP status code.

Value options:

  • A specific value, for example, 200

  • A list of values that are separated with commas (,), for example, 200, 202

  • A value range, for example, 200-204

If type is set to GRPC, the default value is 0. If type is set to other protocols, the default value is 200.

This parameter will take effect only when type is set to HTTP, HTTPS or GRPC.

http_method

String

Specifies the HTTP method. The value can be GET, HEAD, or POST. The default value is GET.

This parameter is available when type is set to HTTP or HTTPS.

id

String

Specifies the health check ID.

max_retries

Integer

Specifies the number of consecutive health checks when the health check result of a backend server changes from OFFLINE to ONLINE.

Range: 1 to 10

max_retries_down

Integer

Specifies the number of consecutive health checks when the health check result of a backend server changes from ONLINE to OFFLINE.

Range: 1 to 10. The default value is 3.

monitor_port

Integer

Definition: Specifies the health check port.

Constraints: If the backend server group protocol is IP, monitor_port cannot be 0.

Range: 1 to 65535, or null (the port of a backend server will be used by default).

Default value: null

name

String

Specifies the health check name.

pools

Array of PoolRef objects

Specifies the IDs of the backend server groups for which the health check is configured. Only one ID will be returned.

project_id

String

Specifies the project ID.

timeout

Integer

Specifies the maximum time required for waiting for a response from the health check, in seconds.

It is recommended that you set the value less than that of parameter delay.

type

String

Specifies the health check protocol. The value can be TCP, UDP_CONNECT, HTTP, HTTPS, GRPC, or TLS.

Note:

  • If the protocol of the backend server is QUIC, the value can only be UDP_CONNECT.

  • If the protocol of the backend server is UDP, the value can only be UDP_CONNECT.

  • If the protocol of the backend server is TCP, the value can only be TCP, HTTP, or HTTPS.

  • If the protocol of the backend server is IP, the value can only be TCP, HTTP, or HTTPS.

  • If the protocol of the backend server is HTTP, the value can only be TCP, HTTP, HTTPS, GRPC, or TLS.

  • If the protocol of the backend server is HTTPS, the value can only be TCP, HTTP, HTTPS, GRPC, or TLS.

  • If the protocol of the backend server is GRPC, the value can only be TCP, HTTP, HTTPS, GRPC, or TLS.

  • If the protocol of the backend server is TLS, the value can only be TCP, HTTP, HTTPS, GRPC, or TLS.

QUIC protocol is not supported.

url_path

String

Specifies the HTTP request path for the health check. The value must start with a slash (/), and the default value is /.

The value can contain letters, digits, hyphens (-), slashes (/), periods (.), percentage signs (%), question marks (?), pound signs (#), ampersand signs (&), and the extended character set: _;~!()*[]@$^:',+.

This parameter is available only when type is set to HTTP or HTTPS.

created_at

String

Specifies the time when the health check was configured. The format is yyyy-MM-dd'T'HH:mm:ss'Z' (UTC time).

updated_at

String

Specifies the time when the health check was updated. The format is yyyy-MM-dd'T'HH:mm:ss'Z' (UTC time).

Table 7 PoolRef

Parameter

Type

Description

id

String

Definition: Specifies the backend server group ID.

Range: N/A

Example Requests

Querying health checks

GET https://{ELB_Endpoint}/v3/99a3fff0d03c428eac3678da6a7d0f24/elb/healthmonitors

Example Responses

Status code: 200

Successful request.

{
  "healthmonitors" : [ {
    "monitor_port" : null,
    "id" : "c2b210b2-60c4-449d-91e2-9e9ea1dd7441",
    "project_id" : "99a3fff0d03c428eac3678da6a7d0f24",
    "domain_name" : null,
    "name" : "My Healthmonitor update",
    "delay" : 10,
    "max_retries" : 10,
    "pools" : [ {
      "id" : "488acc50-6bcf-423d-8f0a-0f4184f5b8a0"
    } ],
    "admin_state_up" : true,
    "timeout" : 30,
    "type" : "HTTP",
    "expected_codes" : "200",
    "url_path" : "/",
    "http_method" : "GET"
  }, {
    "monitor_port" : null,
    "id" : "cda1af03-0660-4fd2-8edf-e38c79846e08",
    "project_id" : "99a3fff0d03c428eac3678da6a7d0f24",
    "domain_name" : "akik..un.com",
    "name" : "lijunqiu",
    "delay" : 50,
    "max_retries" : 1,
    "pools" : [ {
      "id" : "ae6e45ba-be84-4074-8ac6-bc4a56484809"
    } ],
    "admin_state_up" : false,
    "timeout" : 3,
    "type" : "UDP_CONNECT",
    "expected_codes" : null,
    "url_path" : "/world",
    "http_method" : null
  } ],
  "page_info" : {
    "next_marker" : "cda1af03-0660-4fd2-8edf-e38c79846e08",
    "previous_marker" : "c2b210b2-60c4-449d-91e2-9e9ea1dd7441",
    "current_count" : 2
  },
  "request_id" : "814bc40e-8b0a-4ced-b8e5-f136c3e1df6a"
}

Status Codes

Status Code

Description

200

Successful request.

Error Codes

See Error Codes.