previews
Creates, updates, deletes, gets or lists a previews resource.
Overview
| Name | previews |
| Type | Resource |
| Id | cloudflare.load_balancers.previews |
Fields
The following fields are returned by SELECT queries:
- get
Preview Result response.
| Name | Datatype | Description |
|---|---|---|
errors | array | |
messages | array | |
result | object | Resulting health data from a preview operation. |
success | boolean | Whether the API call was successful. (true) |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | preview_id, account_id | Get the result of a previous preview operation using the provided preview_id. | |
create | insert | monitor_id, account_id | Preview pools using the specified monitor with 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. |
monitor_id | string | The Load Balancer monitor ID. |
preview_id | string |
SELECT examples
- get
Get the result of a previous preview operation using the provided preview_id.
SELECT
errors,
messages,
result,
success
FROM cloudflare.load_balancers.previews
WHERE preview_id = '{{ preview_id }}' -- required
AND account_id = '{{ account_id }}' -- required
;
INSERT examples
- create
- Manifest
Preview pools using the specified monitor with provided monitor details. The returned preview_id can be used in the preview endpoint to retrieve the results.
INSERT INTO cloudflare.load_balancers.previews (
allow_insecure,
consecutive_down,
consecutive_up,
description,
expected_body,
expected_codes,
follow_redirects,
header,
interval,
method,
path,
port,
probe_zone,
retries,
timeout,
type,
monitor_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 }}',
'{{ monitor_id }}',
'{{ account_id }}'
RETURNING
errors,
messages,
result,
success
;
# Description fields are for documentation purposes
- name: previews
props:
- name: monitor_id
value: "{{ monitor_id }}"
description: Required parameter for the previews resource.
- name: account_id
value: "{{ account_id }}"
description: Required parameter for the previews 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