monitors
Creates, updates, deletes, gets or lists a monitors resource.
Overview
| Name | monitors |
| Type | Resource |
| Id | cloudflare.load_balancers.monitors |
Fields
The following fields are returned by SELECT queries:
- get_by_account
- list_by_account
- get_by_user
- list_by_user
Monitor Details response.
| Name | Datatype | Description |
|---|---|---|
id | string | (example: f1aba936b94213e5b8dca0c0dbf1f9cc) |
allow_insecure | boolean | Do not validate the certificate when monitor use HTTPS. This parameter is currently only valid for HTTP and HTTPS monitors. |
consecutive_down | integer | To be marked unhealthy the monitored origin must fail this healthcheck N consecutive times. |
consecutive_up | integer | To be marked healthy the monitored origin must pass this healthcheck N consecutive times. |
created_on | string | (example: 2014-01-01T05:20:00.12345Z) |
description | string | Object description. (default: , example: Login page monitor) |
expected_body | string | 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: , example: alive) |
expected_codes | string | The expected HTTP response code or code range of the health check. This parameter is only valid for HTTP and HTTPS monitors. (default: , example: 2xx) |
follow_redirects | boolean | Follow redirects if returned by the origin. This parameter is only valid for HTTP and HTTPS monitors. |
header | object | 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. |
interval | integer | 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. |
method | string | 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. (example: GET, x-stainless-terraform-configurability: computed_optional) |
modified_on | string | (example: 2014-01-01T05:20:00.12345Z) |
path | string | The endpoint path you want to conduct a health check against. This parameter is only valid for HTTP and HTTPS monitors. (example: /health, x-stainless-terraform-configurability: computed_optional) |
port | integer | 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). (x-stainless-terraform-configurability: optional) |
probe_zone | string | Assign this monitor to emulate the specified zone while probing. This parameter is only valid for HTTP and HTTPS monitors. (default: , example: example.com) |
retries | integer | The number of retries to attempt in case of a timeout before marking the origin as unhealthy. Retries are attempted immediately. |
timeout | integer | The timeout (in seconds) before marking the health check as failed. |
type | string | The protocol to use for the health check. Currently supported protocols are 'HTTP','HTTPS', 'TCP', 'ICMP-PING', 'UDP-ICMP', and 'SMTP'. (http, https, tcp, udp_icmp, icmp_ping, smtp) (default: http, example: https) |
List Monitors response.
| Name | Datatype | Description |
|---|---|---|
id | string | (example: f1aba936b94213e5b8dca0c0dbf1f9cc) |
allow_insecure | boolean | Do not validate the certificate when monitor use HTTPS. This parameter is currently only valid for HTTP and HTTPS monitors. |
consecutive_down | integer | To be marked unhealthy the monitored origin must fail this healthcheck N consecutive times. |
consecutive_up | integer | To be marked healthy the monitored origin must pass this healthcheck N consecutive times. |
created_on | string | (example: 2014-01-01T05:20:00.12345Z) |
description | string | Object description. (default: , example: Login page monitor) |
expected_body | string | 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: , example: alive) |
expected_codes | string | The expected HTTP response code or code range of the health check. This parameter is only valid for HTTP and HTTPS monitors. (default: , example: 2xx) |
follow_redirects | boolean | Follow redirects if returned by the origin. This parameter is only valid for HTTP and HTTPS monitors. |
header | object | 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. |
interval | integer | 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. |
method | string | 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. (example: GET, x-stainless-terraform-configurability: computed_optional) |
modified_on | string | (example: 2014-01-01T05:20:00.12345Z) |
path | string | The endpoint path you want to conduct a health check against. This parameter is only valid for HTTP and HTTPS monitors. (example: /health, x-stainless-terraform-configurability: computed_optional) |
port | integer | 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). (x-stainless-terraform-configurability: optional) |
probe_zone | string | Assign this monitor to emulate the specified zone while probing. This parameter is only valid for HTTP and HTTPS monitors. (default: , example: example.com) |
retries | integer | The number of retries to attempt in case of a timeout before marking the origin as unhealthy. Retries are attempted immediately. |
timeout | integer | The timeout (in seconds) before marking the health check as failed. |
type | string | The protocol to use for the health check. Currently supported protocols are 'HTTP','HTTPS', 'TCP', 'ICMP-PING', 'UDP-ICMP', and 'SMTP'. (http, https, tcp, udp_icmp, icmp_ping, smtp) (default: http, example: https) |
Monitor Details response.
| Name | Datatype | Description |
|---|---|---|
id | string | (example: f1aba936b94213e5b8dca0c0dbf1f9cc) |
allow_insecure | boolean | Do not validate the certificate when monitor use HTTPS. This parameter is currently only valid for HTTP and HTTPS monitors. |
consecutive_down | integer | To be marked unhealthy the monitored origin must fail this healthcheck N consecutive times. |
consecutive_up | integer | To be marked healthy the monitored origin must pass this healthcheck N consecutive times. |
created_on | string | (example: 2014-01-01T05:20:00.12345Z) |
description | string | Object description. (default: , example: Login page monitor) |
expected_body | string | 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: , example: alive) |
expected_codes | string | The expected HTTP response code or code range of the health check. This parameter is only valid for HTTP and HTTPS monitors. (default: , example: 2xx) |
follow_redirects | boolean | Follow redirects if returned by the origin. This parameter is only valid for HTTP and HTTPS monitors. |
header | object | 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. |
interval | integer | 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. |
method | string | 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. (example: GET, x-stainless-terraform-configurability: computed_optional) |
modified_on | string | (example: 2014-01-01T05:20:00.12345Z) |
path | string | The endpoint path you want to conduct a health check against. This parameter is only valid for HTTP and HTTPS monitors. (example: /health, x-stainless-terraform-configurability: computed_optional) |
port | integer | 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). (x-stainless-terraform-configurability: optional) |
probe_zone | string | Assign this monitor to emulate the specified zone while probing. This parameter is only valid for HTTP and HTTPS monitors. (default: , example: example.com) |
retries | integer | The number of retries to attempt in case of a timeout before marking the origin as unhealthy. Retries are attempted immediately. |
timeout | integer | The timeout (in seconds) before marking the health check as failed. |
type | string | The protocol to use for the health check. Currently supported protocols are 'HTTP','HTTPS', 'TCP', 'ICMP-PING', 'UDP-ICMP', and 'SMTP'. (http, https, tcp, udp_icmp, icmp_ping, smtp) (default: http, example: https) |
Successful list monitors response.
| Name | Datatype | Description |
|---|---|---|
id | string | (example: f1aba936b94213e5b8dca0c0dbf1f9cc) |
allow_insecure | boolean | Do not validate the certificate when monitor use HTTPS. This parameter is currently only valid for HTTP and HTTPS monitors. |
consecutive_down | integer | To be marked unhealthy the monitored origin must fail this healthcheck N consecutive times. |
consecutive_up | integer | To be marked healthy the monitored origin must pass this healthcheck N consecutive times. |
created_on | string | (example: 2014-01-01T05:20:00.12345Z) |
description | string | Object description. (default: , example: Login page monitor) |
expected_body | string | 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: , example: alive) |
expected_codes | string | The expected HTTP response code or code range of the health check. This parameter is only valid for HTTP and HTTPS monitors. (default: , example: 2xx) |
follow_redirects | boolean | Follow redirects if returned by the origin. This parameter is only valid for HTTP and HTTPS monitors. |
header | object | 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. |
interval | integer | 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. |
method | string | 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. (example: GET, x-stainless-terraform-configurability: computed_optional) |
modified_on | string | (example: 2014-01-01T05:20:00.12345Z) |
path | string | The endpoint path you want to conduct a health check against. This parameter is only valid for HTTP and HTTPS monitors. (example: /health, x-stainless-terraform-configurability: computed_optional) |
port | integer | 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). (x-stainless-terraform-configurability: optional) |
probe_zone | string | Assign this monitor to emulate the specified zone while probing. This parameter is only valid for HTTP and HTTPS monitors. (default: , example: example.com) |
retries | integer | The number of retries to attempt in case of a timeout before marking the origin as unhealthy. Retries are attempted immediately. |
timeout | integer | The timeout (in seconds) before marking the health check as failed. |
type | string | The protocol to use for the health check. Currently supported protocols are 'HTTP','HTTPS', 'TCP', 'ICMP-PING', 'UDP-ICMP', and 'SMTP'. (http, https, tcp, udp_icmp, icmp_ping, smtp) (default: http, example: https) |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_by_account | select | monitor_id, account_id | List a single configured monitor for an account. | |
list_by_account | select | account_id | List configured monitors for an account. | |
get_by_user | select | monitor_id | List a single configured monitor for a user. | |
list_by_user | select | List configured monitors for a user. | ||
create | insert | account_id | Create a configured monitor. | |
load_balancer_monitors_create_monitor | insert | Create a configured monitor. | ||
edit | update | monitor_id, account_id | Apply changes to an existing monitor, overwriting the supplied properties. | |
load_balancer_monitors_patch_monitor | update | monitor_id | Apply changes to an existing monitor, overwriting the supplied properties. | |
update | replace | monitor_id, account_id | Modify a configured monitor. | |
load_balancer_monitors_update_monitor | replace | monitor_id | Modify a configured monitor. | |
delete | delete | monitor_id, account_id | Delete a configured monitor. | |
load_balancer_monitors_delete_monitor | delete | monitor_id | Delete a configured monitor. |
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. |
monitor_id | string | The Load Balancer monitor ID. |
SELECT examples
- get_by_account
- list_by_account
- get_by_user
- list_by_user
List a single configured monitor for an account.
SELECT
id,
allow_insecure,
consecutive_down,
consecutive_up,
created_on,
description,
expected_body,
expected_codes,
follow_redirects,
header,
interval,
method,
modified_on,
path,
port,
probe_zone,
retries,
timeout,
type
FROM cloudflare.load_balancers.monitors
WHERE monitor_id = '{{ monitor_id }}' -- required
AND account_id = '{{ account_id }}' -- required
;
List configured monitors for an account.
SELECT
id,
allow_insecure,
consecutive_down,
consecutive_up,
created_on,
description,
expected_body,
expected_codes,
follow_redirects,
header,
interval,
method,
modified_on,
path,
port,
probe_zone,
retries,
timeout,
type
FROM cloudflare.load_balancers.monitors
WHERE account_id = '{{ account_id }}' -- required
;
List a single configured monitor for a user.
SELECT
id,
allow_insecure,
consecutive_down,
consecutive_up,
created_on,
description,
expected_body,
expected_codes,
follow_redirects,
header,
interval,
method,
modified_on,
path,
port,
probe_zone,
retries,
timeout,
type
FROM cloudflare.load_balancers.monitors
WHERE monitor_id = '{{ monitor_id }}' -- required
;
List configured monitors for a user.
SELECT
id,
allow_insecure,
consecutive_down,
consecutive_up,
created_on,
description,
expected_body,
expected_codes,
follow_redirects,
header,
interval,
method,
modified_on,
path,
port,
probe_zone,
retries,
timeout,
type
FROM cloudflare.load_balancers.monitors
;
INSERT examples
- create
- load_balancer_monitors_create_monitor
- Manifest
Create a configured monitor.
INSERT INTO cloudflare.load_balancers.monitors (
allow_insecure,
consecutive_down,
consecutive_up,
description,
expected_body,
expected_codes,
follow_redirects,
header,
interval,
method,
path,
port,
probe_zone,
retries,
timeout,
type,
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 }}',
'{{ account_id }}'
RETURNING
errors,
messages,
result,
success
;
Create a configured monitor.
INSERT INTO cloudflare.load_balancers.monitors (
allow_insecure,
consecutive_down,
consecutive_up,
description,
expected_body,
expected_codes,
follow_redirects,
header,
interval,
method,
path,
port,
probe_zone,
retries,
timeout,
type
)
SELECT
{{ allow_insecure }},
{{ consecutive_down }},
{{ consecutive_up }},
'{{ description }}',
'{{ expected_body }}',
'{{ expected_codes }}',
{{ follow_redirects }},
'{{ header }}',
{{ interval }},
'{{ method }}',
'{{ path }}',
{{ port }},
'{{ probe_zone }}',
{{ retries }},
{{ timeout }},
'{{ type }}'
RETURNING
errors,
messages,
result,
success
;
# Description fields are for documentation purposes
- name: monitors
props:
- name: account_id
value: "{{ account_id }}"
description: Required parameter for the monitors 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
UPDATE examples
- edit
- load_balancer_monitors_patch_monitor
Apply changes to an existing monitor, overwriting the supplied properties.
UPDATE cloudflare.load_balancers.monitors
SET
allow_insecure = {{ allow_insecure }},
consecutive_down = {{ consecutive_down }},
consecutive_up = {{ consecutive_up }},
description = '{{ description }}',
expected_body = '{{ expected_body }}',
expected_codes = '{{ expected_codes }}',
follow_redirects = {{ follow_redirects }},
header = '{{ header }}',
interval = {{ interval }},
method = '{{ method }}',
path = '{{ path }}',
port = {{ port }},
probe_zone = '{{ probe_zone }}',
retries = {{ retries }},
timeout = {{ timeout }},
type = '{{ type }}'
WHERE
monitor_id = '{{ monitor_id }}' --required
AND account_id = '{{ account_id }}' --required
RETURNING
errors,
messages,
result,
success;
Apply changes to an existing monitor, overwriting the supplied properties.
UPDATE cloudflare.load_balancers.monitors
SET
allow_insecure = {{ allow_insecure }},
consecutive_down = {{ consecutive_down }},
consecutive_up = {{ consecutive_up }},
description = '{{ description }}',
expected_body = '{{ expected_body }}',
expected_codes = '{{ expected_codes }}',
follow_redirects = {{ follow_redirects }},
header = '{{ header }}',
interval = {{ interval }},
method = '{{ method }}',
path = '{{ path }}',
port = {{ port }},
probe_zone = '{{ probe_zone }}',
retries = {{ retries }},
timeout = {{ timeout }},
type = '{{ type }}'
WHERE
monitor_id = '{{ monitor_id }}' --required
RETURNING
errors,
messages,
result,
success;
REPLACE examples
- update
- load_balancer_monitors_update_monitor
Modify a configured monitor.
REPLACE cloudflare.load_balancers.monitors
SET
allow_insecure = {{ allow_insecure }},
consecutive_down = {{ consecutive_down }},
consecutive_up = {{ consecutive_up }},
description = '{{ description }}',
expected_body = '{{ expected_body }}',
expected_codes = '{{ expected_codes }}',
follow_redirects = {{ follow_redirects }},
header = '{{ header }}',
interval = {{ interval }},
method = '{{ method }}',
path = '{{ path }}',
port = {{ port }},
probe_zone = '{{ probe_zone }}',
retries = {{ retries }},
timeout = {{ timeout }},
type = '{{ type }}'
WHERE
monitor_id = '{{ monitor_id }}' --required
AND account_id = '{{ account_id }}' --required
RETURNING
errors,
messages,
result,
success;
Modify a configured monitor.
REPLACE cloudflare.load_balancers.monitors
SET
allow_insecure = {{ allow_insecure }},
consecutive_down = {{ consecutive_down }},
consecutive_up = {{ consecutive_up }},
description = '{{ description }}',
expected_body = '{{ expected_body }}',
expected_codes = '{{ expected_codes }}',
follow_redirects = {{ follow_redirects }},
header = '{{ header }}',
interval = {{ interval }},
method = '{{ method }}',
path = '{{ path }}',
port = {{ port }},
probe_zone = '{{ probe_zone }}',
retries = {{ retries }},
timeout = {{ timeout }},
type = '{{ type }}'
WHERE
monitor_id = '{{ monitor_id }}' --required
RETURNING
errors,
messages,
result,
success;
DELETE examples
- delete
- load_balancer_monitors_delete_monitor
Delete a configured monitor.
DELETE FROM cloudflare.load_balancers.monitors
WHERE monitor_id = '{{ monitor_id }}' --required
AND account_id = '{{ account_id }}' --required
;
Delete a configured monitor.
DELETE FROM cloudflare.load_balancers.monitors
WHERE monitor_id = '{{ monitor_id }}' --required
;