• Elastic Load Balancing

elb
  1. Help Center
  2. Elastic Load Balancing
  3. API Reference
  4. Enhanced Load Balancer APIs
  5. Health Monitor (Health Check)
  6. Querying All Health Checks

Querying All Health Checks

Function

This API is used to query all the health checks. Filter query and pagination query are supported.

URI

GET /v2.0/lbaas/healthmonitors

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.

Request

  • Request parameters
    Table 1 Parameter description

    Parameter

    Type

    Mandatory

    Description

    marker

    String

    No

    Specifies the ID of the health check from which pagination query starts, that is, the ID of the last health check on the previous page.

    This parameter must be used together with limit.

    limit

    Int

    No

    Specifies the number of health checks on each page.

    The value ranges from 0 to intmax.

    page_reverse

    Bool

    No

    Specifies the page direction. The value can be true or false, and the default value is false. The last page in the list requested with page_reverse set to false will not contain the "next" link, and the last page in the list requested with page_reverse set to true will not contain the "previous" link.

    This parameter must be used together with limit.

    id

    Uuid

    No

    Specifies the health check ID.

    tenant_id

    String (255)

    No

    Specifies the ID of the project where the health check is performed.

    name

    String (255)

    No

    Specifies the health check name.

    delay

    Int

    No

    Specifies the interval between health checks in the unit of second. The value ranges from 1 to 50.

    max_retries

    Int

    No

    Specifies the maximum number of retries. The value ranges from 1 to 10.

    admin_state_up

    Bool

    No

    Specifies the administrative status of the health check.

    The value can be true or false. The default value is true.

    • true: indicates that the health check function is enabled.
    • false: indicates that the health check function is disabled.

    timeout

    Int

    No

    Specifies the health check timeout duration in the unit of second. The value ranges from 1 to 50.

    NOTE:

    You are advised to set the value less than that of parameter delay.

    type

    String

    No

    Specifies the health check protocol.

    The value can be TCP, UDP_CONNECT, or HTTP.

    monitor_port

    Int

    No

    Specifies the health check port. The value ranges from 1 to 65535.

    The value is left blank by default, indicating that the port of the backend server is used as the health check port.

    expected_codes

    String (19)

    No

    Specifies the expected HTTP response status code. The default value is 200.

    The value can be one of the following:

    A single value, such as 200

    A list of values, such as 200 and 202

    Value range, such as 200 to 204

    This parameter is valid when type is set to HTTP.
    NOTE:

    This parameter is reserved and has been not used.

    domain_name

    String (100)

    No

    Specifies the domain name of the HTTP request during the health check.

    This parameter is valid when type is set to HTTP.

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

    The parameter value can contain only digits, letters, hyphens (-), and periods (.) and must start with a digit or letter, for example, www.huaweitest.com.

    url_path

    String (255)

    No

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

    This parameter is valid when type is set to HTTP.

    An example value is /test.

    http_method

    String (16)

    No

    Specifies the HTTP request method. The default value is GET.

    The value can be GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, CONNECT, and PATCH.

    This parameter is valid when type is set to HTTP.

    NOTE:

    This parameter is reserved and has been not used.

  • Example request
    GET https://{Endpoint}/v2.0/lbaas/healthmonitors

Response

  • Response parameters
    Table 2 Parameter description

    Parameter

    Type

    Description

    healthmonitors

    List

    Lists the health checks. For details, see Table 3.

    Table 3 healthmonitors field description

    Parameter

    Type

    Description

    id

    Uuid

    Specifies the health check ID.

    tenant_id

    String (255)

    Specifies the ID of the project where the health check is performed.

    name

    String (255)

    Specifies the health check name.

    delay

    Int

    Specifies the interval between health checks in the unit of second. The value ranges from 1 to 50.

    max_retries

    Int

    Specifies the maximum number of retries. The value ranges from 1 to 10.

    pools

    List

    Lists the IDs of backend server groups associated with the health check.

    admin_state_up

    Bool

    Specifies the administrative status of the health check.

    The value can be true or false. The default value is true.

    • true: indicates that the health check function is enabled.
    • false: indicates that the health check function is disabled.

    timeout

    Int

    Specifies the health check timeout duration in the unit of second. The value ranges from 1 to 50.

    NOTE:

    You are advised to set the value less than that of parameter delay.

    type

    String

    Specifies the health check protocol.

    The value can be TCP, UDP_CONNECT, or HTTP.

    monitor_port

    Int

    Specifies the health check port. The value ranges from 1 to 65535.

    The value is left blank by default, indicating that the port of the backend server is used as the health check port.

    expected_codes

    String (19)

    Specifies the expected HTTP response status code. The default value is 200.

    The value can be one of the following:

    A single value, such as 200

    A list of values, such as 200 and 202

    Value range, such as 200 to 204

    This parameter is valid when type is set to HTTP.
    NOTE:

    This parameter is reserved and has been not used.

    domain_name

    String (100)

    Specifies the domain name of the HTTP request during the health check.

    This parameter is valid when type is set to HTTP.

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

    The parameter value can contain only digits, letters, hyphens (-), and periods (.) and must start with a digit or letter, for example, www.huaweitest.com.

    url_path

    String (255)

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

    This parameter is valid when type is set to HTTP.

    An example value is /test.

    http_method

    String (16)

    Specifies the HTTP request method. The default value is GET.

    The value can be GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, CONNECT, and PATCH.

    This parameter is valid when type is set to HTTP.

    NOTE:

    This parameter is reserved and has been not used.

    healthmonitors_links

    List

    Provides links to the previous or next page during pagination query, respectively.

    This parameter exists only in the response body of pagination query.

    For details, see Table 4.

    Table 4 healthmonitors_links field description

    Parameter

    Type

    Description

    href

    String

    Provides links to the previous or next page during pagination query, respectively.

    rel

    String (255)

    Specifies the prompt of the previous or next page.

    The value can be next or previous. The value next indicates the href containing the URL of the next page, and previous indicates the href containing the URL of the previous page.

  • Example response
    {
        "healthmonitors": [
            {
                "monitor_port": null,
                "name": "",
                "admin_state_up": true,
                "tenant_id": "601240b9c5c94059b63d484c92cfe308",
                 
                "domain_name": null,
                "delay": 5,
                "expected_codes": "200",
                "max_retries": 3,
                "http_method": "GET",
                "timeout": 10,
                "pools": [
                    {
                        "id": "caef8316-6b65-4676-8293-cf41fb63cc2a"
                    }
                ],
                "url_path": "/",
                "type": "HTTP",
                "id": "1b587819-d619-49c1-9101-fe72d8b361ef"
            }
        ]
    }

Response Codes

For details, see HTTP Status Codes for Enhanced Load Balancers.