health
Creates, updates, deletes, gets or lists a health resource.
Overview
| Name | health |
| Type | Resource |
| Id | cloudflare.load_balancers.health |
Fields
The following fields are returned by SELECT queries:
- list_by_account
- list_by_user
Pool Health Details response.
| Name | Datatype | Description |
|---|---|---|
pool_id | string | Pool ID. (example: 17b5962d775c646f3f9725cbc7a53df4) |
pop_health | object | List of regions and associated health status. |
Pool Health Details response.
| Name | Datatype | Description |
|---|---|---|
pool_id | string | Pool ID. (example: 17b5962d775c646f3f9725cbc7a53df4) |
pop_health | object | List of regions and associated health status. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
list_by_account | select | pool_id, account_id | Fetch the latest pool health status for a single pool. | |
list_by_user | select | pool_id | Fetch the latest pool health status for a single pool. | |
create | insert | pool_id, account_id | Preview pool health using provided monitor details. The returned preview_id can be used in the preview endpoint to retrieve the results. |
Parameters
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
account_id | string | The Cloudflare account ID. |
pool_id | string | The Load Balancer pool ID. |
SELECT examples
- list_by_account
- list_by_user
Fetch the latest pool health status for a single pool.
SELECT
pool_id,
pop_health
FROM cloudflare.load_balancers.health
WHERE pool_id = '{{ pool_id }}' -- required
AND account_id = '{{ account_id }}' -- required
;
Fetch the latest pool health status for a single pool.
SELECT
pool_id,
pop_health
FROM cloudflare.load_balancers.health
WHERE pool_id = '{{ pool_id }}' -- required
;
INSERT examples
- create
- Manifest
Preview pool health using provided monitor details. The returned preview_id can be used in the preview endpoint to retrieve the results.
INSERT INTO cloudflare.load_balancers.health (
allow_insecure,
consecutive_down,
consecutive_up,
description,
expected_body,
expected_codes,
follow_redirects,
header,
interval,
method,
path,
port,
probe_zone,
retries,
timeout,
type,
pool_id,
account_id
)
SELECT
{{ allow_insecure }},
{{ consecutive_down }},
{{ consecutive_up }},
'{{ description }}',
'{{ expected_body }}',
'{{ expected_codes }}',
{{ follow_redirects }},
'{{ header }}',
{{ interval }},
'{{ method }}',
'{{ path }}',
{{ port }},
'{{ probe_zone }}',
{{ retries }},
{{ timeout }},
'{{ type }}',
'{{ pool_id }}',
'{{ account_id }}'
RETURNING
errors,
messages,
result,
success
;
# Description fields are for documentation purposes
- name: health
props:
- name: pool_id
value: "{{ pool_id }}"
description: Required parameter for the health resource.
- name: account_id
value: "{{ account_id }}"
description: Required parameter for the health resource.
- name: allow_insecure
value: {{ allow_insecure }}
description: |
Do not validate the certificate when monitor use HTTPS. This parameter is currently only valid for HTTP and HTTPS monitors.
default: false
- name: consecutive_down
value: {{ consecutive_down }}
description: |
To be marked unhealthy the monitored origin must fail this healthcheck N consecutive times.
- name: consecutive_up
value: {{ consecutive_up }}
description: |
To be marked healthy the monitored origin must pass this healthcheck N consecutive times.
- name: description
value: "{{ description }}"
description: |
Object description.
default:
- name: expected_body
value: "{{ expected_body }}"
description: |
A case-insensitive sub-string to look for in the response body. If this string is not found, the origin will be marked as unhealthy. This parameter is only valid for HTTP and HTTPS monitors.
default:
- name: expected_codes
value: "{{ expected_codes }}"
description: |
The expected HTTP response code or code range of the health check. This parameter is only valid for HTTP and HTTPS monitors.
default:
- name: follow_redirects
value: {{ follow_redirects }}
description: |
Follow redirects if returned by the origin. This parameter is only valid for HTTP and HTTPS monitors.
default: false
- name: header
value: "{{ header }}"
description: |
The HTTP request headers to send in the health check. It is recommended you set a Host header by default. The User-Agent header cannot be overridden. This parameter is only valid for HTTP and HTTPS monitors.
- name: interval
value: {{ interval }}
description: |
The interval between each health check. Shorter intervals may improve failover time, but will increase load on the origins as we check from multiple locations.
default: 60
- name: method
value: "{{ method }}"
description: |
The method to use for the health check. This defaults to 'GET' for HTTP/HTTPS based checks and 'connection_established' for TCP based health checks.
- name: path
value: "{{ path }}"
description: |
The endpoint path you want to conduct a health check against. This parameter is only valid for HTTP and HTTPS monitors.
- name: port
value: {{ port }}
description: |
The port number to connect to for the health check. Required for TCP, UDP, and SMTP checks. HTTP and HTTPS checks should only define the port when using a non-standard port (HTTP: default 80, HTTPS: default 443).
- name: probe_zone
value: "{{ probe_zone }}"
description: |
Assign this monitor to emulate the specified zone while probing. This parameter is only valid for HTTP and HTTPS monitors.
default:
- name: retries
value: {{ retries }}
description: |
The number of retries to attempt in case of a timeout before marking the origin as unhealthy. Retries are attempted immediately.
default: 2
- name: timeout
value: {{ timeout }}
description: |
The timeout (in seconds) before marking the health check as failed.
default: 5
- name: type
value: "{{ type }}"
description: |
The protocol to use for the health check. Currently supported protocols are 'HTTP','HTTPS', 'TCP', 'ICMP-PING', 'UDP-ICMP', and 'SMTP'.
valid_values: ['http', 'https', 'tcp', 'udp_icmp', 'icmp_ping', 'smtp']
default: http