synthetics_tests
Creates, updates, deletes, gets or lists a synthetics_tests resource.
Overview
| Name | synthetics_tests |
| Type | Resource |
| Id | datadog.monitoring.synthetics_tests |
Fields
The following fields are returned by SELECT queries:
- get_test
- list_tests
| Name | Datatype | Description |
|---|---|---|
name | string | Name of the test. |
monitor_id | integer (int64) | The associated monitor ID. |
public_id | string | The test public ID. |
config | object | Configuration object for a Synthetic test. |
creator | object | Object describing the creator of the shared element. |
locations | array | Array of locations used to run the test. |
message | string | Notification message associated with the test. |
options | object | Object describing the extra options for a Synthetic test. |
status | string | Define whether you want to start (live) or pause (paused) a Synthetic test. (live, paused) (example: live) |
subtype | string | The subtype of the Synthetic API test, http, ssl, tcp, dns, icmp, udp, websocket, grpc or multi. (http, ssl, tcp, dns, multi, icmp, udp, websocket, grpc) (example: http) |
tags | array | Array of tags attached to the test. |
type | string | Type of the Synthetic test. (api, browser, mobile, network) |
OK - Returns the list of all Synthetic tests.
| Name | Datatype | Description |
|---|---|---|
name | string | Name of the test. |
monitor_id | integer (int64) | The associated monitor ID. |
public_id | string | The test public ID. |
config | object | Configuration object for a Synthetic test. |
creator | object | Object describing the creator of the shared element. |
locations | array | Array of locations used to run the test. |
message | string | Notification message associated with the test. |
options | object | Object describing the extra options for a Synthetic test. |
status | string | Define whether you want to start (live) or pause (paused) a Synthetic test. (live, paused) (example: live) |
subtype | string | The subtype of the Synthetic API test, http, ssl, tcp, dns, icmp, udp, websocket, grpc or multi. (http, ssl, tcp, dns, multi, icmp, udp, websocket, grpc) (example: http) |
tags | array | Array of tags attached to the test. |
type | string | Type of the Synthetic test. (api, browser, mobile, network) |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_test | select | public_id | Get the detailed configuration associated with a Synthetic test. | |
list_tests | select | page_size, page_number | Get the list of all Synthetic tests. | |
patch_test | update | public_id | Patch the configuration of a Synthetic test with partial data. | |
delete_synthetics_tests | exec | data | ||
delete_tests | exec | Delete multiple Synthetic tests by ID. | ||
trigger_tests | exec | tests | Trigger a set of Synthetic tests. | |
trigger_citests | exec | Trigger a set of Synthetic tests for continuous integration. | ||
update_test_pause_status | exec | public_id | Pause or start a Synthetic test by changing the status. |
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 |
|---|---|---|
public_id | string | The public ID of the Synthetic test to update. |
site | string | The Datadog site (region) for your organization, for example datadoghq.com, us3.datadoghq.com, us5.datadoghq.com, ap1.datadoghq.com, ap2.datadoghq.com, datadoghq.eu, ddog-gov.com. Resolved from the DD_SITE environment variable when set. Optional: defaults to datadoghq.com, or the value of the DD_SITE environment variable when set; a WHERE value overrides both. |
page_number | integer (int64) | Used for pagination. Which page you want to retrieve. Starts at zero. |
page_size | integer (int64) | Used for pagination. The number of tests returned in the page. |
SELECT examples
- get_test
- list_tests
Get the detailed configuration associated with a Synthetic test.
SELECT
name,
monitor_id,
public_id,
config,
creator,
locations,
message,
options,
status,
subtype,
tags,
type
FROM datadog.monitoring.synthetics_tests
WHERE public_id = '{{ public_id }}' -- required
;
Get the list of all Synthetic tests.
SELECT
name,
monitor_id,
public_id,
config,
creator,
locations,
message,
options,
status,
subtype,
tags,
type
FROM datadog.monitoring.synthetics_tests
WHERE page_size = '{{ page_size }}'
AND page_number = '{{ page_number }}'
;
UPDATE examples
- patch_test
Patch the configuration of a Synthetic test with partial data.
UPDATE datadog.monitoring.synthetics_tests
SET
data = '{{ data }}'
WHERE
public_id = '{{ public_id }}' --required
RETURNING
name,
monitor_id,
public_id,
config,
creator,
locations,
message,
options,
status,
steps,
subtype,
tags,
type;
Lifecycle Methods
EXEC variables use wire (API) names.
- delete_synthetics_tests
- delete_tests
- trigger_tests
- trigger_citests
- update_test_pause_status
OK
EXEC datadog.monitoring.synthetics_tests.delete_synthetics_tests
@@json=
'{
"data": "{{ data }}"
}'
;
Delete multiple Synthetic tests by ID.
EXEC datadog.monitoring.synthetics_tests.delete_tests
@@json=
'{
"force_delete_dependencies": {{ force_delete_dependencies }},
"public_ids": "{{ public_ids }}"
}'
;
Trigger a set of Synthetic tests.
EXEC datadog.monitoring.synthetics_tests.trigger_tests
@@json=
'{
"tests": "{{ tests }}"
}'
;
Trigger a set of Synthetic tests for continuous integration.
EXEC datadog.monitoring.synthetics_tests.trigger_citests
@@json=
'{
"tests": "{{ tests }}"
}'
;
Pause or start a Synthetic test by changing the status.
EXEC datadog.monitoring.synthetics_tests.update_test_pause_status
@public_id='{{ public_id }}' --required,
@@json=
'{
"new_status": "{{ new_status }}"
}'
;