• 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. Modifying a Health Check

Modifying a Health Check

Function

This API is used to modify a health check.

URI

PUT /v2.0/lbaas/healthmonitors/{healthmonitor_id}

Table 1 Parameter description

Parameter

Type

Mandatory

Description

healthmonitor_id

Uuid

Yes

Specifies the health check ID.

Constraints

If provisioning_status of the load balancer for which the health check is configured is not ACTIVE, the health check cannot be updated.

Request

  • Request parameters
    Table 2 Parameter description

    Parameter

    Type

    Mandatory

    Description

    healthmonitor

    Dict

    Yes

    Specifies the health check. For details, see Table 3.

    Table 3 healthmonitor field description

    Parameter

    Type

    Mandatory

    Description

    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.

    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

    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

    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

    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
    PUT https://{Endpoint}/v2.0/lbaas/healthmonitors/b7633ade-24dc-4d72-8475-06aa22be5412
    
    {
      "healthmonitor": {
        "delay": 15,
        "name": "health-xx",
        "timeout": 12
       }
      }

Response

  • Response parameters
    Table 4 Parameter description

    Parameter

    Type

    Description

    healthmonitor

    Dict

    Specifies the health check. For details, see Table 5.

    Table 5 healthmonitor 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 available only 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.

  • Example response
    {
      "healthmonitor": {
        "name": "health-xx",
        "admin_state_up": true,
        "tenant_id": "145483a5107745e9b3d80f956713e6a3",
        
        "domain_name": null,
        "delay": 15,
        "expected_codes": "200",
        "max_retries": 10,
        "http_method": "GET",
        "timeout": 12,
        "pools": [
          {
            "id": "bb44bffb-05d9-412c-9d9c-b189d9e14193"
          }
        ],
        "url_path": "/",
        "type": "HTTP",
        "id": "2dca3867-98c5-4cde-8f2c-b89ae6bd7e36",
        "monitor_port": 112
      }
    }

Response Codes

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