Skip to main content

synthetics_api_tests

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

Overview

Namesynthetics_api_tests
TypeResource
Iddatadog.monitoring.synthetics_api_tests

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
namestringName of the test. (example: Example test name)
monitor_idinteger (int64)The associated monitor ID.
public_idstringThe public ID for the test. (example: 123-abc-456)
configobjectConfiguration object for a Synthetic API test.
locationsarrayArray of locations used to run the test.
messagestringNotification message associated with the test. (example: Notification message)
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. (api) (default: api, example: api)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_apitestselectpublic_idGet the detailed configuration associated with<br />a Synthetic API test.
create_synthetics_apitestinsertname, config, locations, options, type, messageCreate a Synthetic API test.
update_apitestreplacepublic_id, name, config, locations, options, type, messageEdit the configuration of a Synthetic API test.

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 test to get details from.
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.

SELECT examples

Get the detailed configuration associated with<br />a Synthetic API test.

SELECT
name,
monitor_id,
public_id,
config,
locations,
message,
options,
status,
subtype,
tags,
type
FROM datadog.monitoring.synthetics_api_tests
WHERE public_id = '{{ public_id }}' -- required
;

INSERT examples

Create a Synthetic API test.

INSERT INTO datadog.monitoring.synthetics_api_tests (
config,
locations,
message,
name,
options,
status,
subtype,
tags,
type
)
SELECT
'{{ config }}' /* required */,
'{{ locations }}' /* required */,
'{{ message }}' /* required */,
'{{ name }}' /* required */,
'{{ options }}' /* required */,
'{{ status }}',
'{{ subtype }}',
'{{ tags }}',
'{{ type }}' /* required */
RETURNING
name,
monitor_id,
public_id,
config,
locations,
message,
options,
status,
subtype,
tags,
type
;

REPLACE examples

Edit the configuration of a Synthetic API test.

REPLACE datadog.monitoring.synthetics_api_tests
SET
config = '{{ config }}',
locations = '{{ locations }}',
message = '{{ message }}',
name = '{{ name }}',
options = '{{ options }}',
status = '{{ status }}',
subtype = '{{ subtype }}',
tags = '{{ tags }}',
type = '{{ type }}'
WHERE
public_id = '{{ public_id }}' --required
AND name = '{{ name }}' --required
AND config = '{{ config }}' --required
AND locations = '{{ locations }}' --required
AND options = '{{ options }}' --required
AND type = '{{ type }}' --required
AND message = '{{ message }}' --required
RETURNING
name,
monitor_id,
public_id,
config,
locations,
message,
options,
status,
subtype,
tags,
type;