Skip to main content

synthetics_tests

Creates, updates, deletes, gets or lists a synthetics_tests resource.

Overview

Namesynthetics_tests
TypeResource
Iddatadog.monitoring.synthetics_tests

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
namestringName of the test.
monitor_idinteger (int64)The associated monitor ID.
public_idstringThe test public ID.
configobjectConfiguration object for a Synthetic test.
creatorobjectObject describing the creator of the shared element.
locationsarrayArray of locations used to run the test.
messagestringNotification message associated with the test.
optionsobjectObject describing the extra options for a Synthetic test.
statusstringDefine whether you want to start (live) or pause (paused) a Synthetic test. (live, paused) (example: live)
subtypestringThe 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)
tagsarrayArray of tags attached to the test.
typestringType of the Synthetic test. (api, browser, mobile, network)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_testselectpublic_idGet the detailed configuration associated with a Synthetic test.
list_testsselectpage_size, page_numberGet the list of all Synthetic tests.
patch_testupdatepublic_idPatch the configuration of a Synthetic test with partial data.
delete_synthetics_testsexecdata
delete_testsexecDelete multiple Synthetic tests by ID.
trigger_testsexectestsTrigger a set of Synthetic tests.
trigger_citestsexecTrigger a set of Synthetic tests for continuous integration.
update_test_pause_statusexecpublic_idPause 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.

NameDatatypeDescription
public_idstringThe public ID of the Synthetic test to update.
sitestringThe 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_numberinteger (int64)Used for pagination. Which page you want to retrieve. Starts at zero.
page_sizeinteger (int64)Used for pagination. The number of tests returned in the page.

SELECT examples

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
;

UPDATE examples

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.

OK

EXEC datadog.monitoring.synthetics_tests.delete_synthetics_tests
@@json=
'{
"data": "{{ data }}"
}'
;