synthetics_api_tests
Creates, updates, deletes, gets or lists a synthetics_api_tests resource.
Overview
| Name | synthetics_api_tests |
| Type | Resource |
| Id | datadog.monitoring.synthetics_api_tests |
Fields
The following fields are returned by SELECT queries:
- get_apitest
| Name | Datatype | Description |
|---|---|---|
name | string | Name of the test. (example: Example test name) |
monitor_id | integer (int64) | The associated monitor ID. |
public_id | string | The public ID for the test. (example: 123-abc-456) |
config | object | Configuration object for a Synthetic API test. |
locations | array | Array of locations used to run the test. |
message | string | Notification message associated with the test. (example: Notification message) |
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. (api) (default: api, example: api) |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_apitest | select | public_id | Get the detailed configuration associated with<br />a Synthetic API test. | |
create_synthetics_apitest | insert | name, config, locations, options, type, message | Create a Synthetic API test. | |
update_apitest | replace | public_id, name, config, locations, options, type, message | Edit 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.
| Name | Datatype | Description |
|---|---|---|
public_id | string | The public ID of the test to get details from. |
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. |
SELECT examples
- get_apitest
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_synthetics_apitest
- Manifest
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
;
# Description fields are for documentation purposes
- name: synthetics_api_tests
props:
- name: config
description: |
Configuration object for a Synthetic API test.
value:
assertions:
- operator: "{{ operator }}"
property: "{{ property }}"
target: {{ target }}
timingsScope: "{{ timingsScope }}"
type: "{{ type }}"
code: "{{ code }}"
configVariables:
- example: "{{ example }}"
id: "{{ id }}"
name: "{{ name }}"
pattern: "{{ pattern }}"
secure: {{ secure }}
type: "{{ type }}"
request:
allow_insecure: {{ allow_insecure }}
basicAuth:
password: "{{ password }}"
type: "{{ type }}"
username: "{{ username }}"
accessKey: "{{ accessKey }}"
region: "{{ region }}"
secretKey: "{{ secretKey }}"
serviceName: "{{ serviceName }}"
sessionToken: "{{ sessionToken }}"
domain: "{{ domain }}"
workstation: "{{ workstation }}"
accessTokenUrl: "{{ accessTokenUrl }}"
audience: "{{ audience }}"
clientId: "{{ clientId }}"
clientSecret: "{{ clientSecret }}"
resource: "{{ resource }}"
scope: "{{ scope }}"
tokenApiAuthentication: "{{ tokenApiAuthentication }}"
addClaims:
exp: {{ exp }}
iat: {{ iat }}
algorithm: "{{ algorithm }}"
expiresIn: {{ expiresIn }}
header: "{{ header }}"
payload: "{{ payload }}"
secret: "{{ secret }}"
tokenPrefix: "{{ tokenPrefix }}"
body: "{{ body }}"
bodyType: "{{ bodyType }}"
callType: "{{ callType }}"
certificate:
cert:
content: "{{ content }}"
filename: "{{ filename }}"
updatedAt: "{{ updatedAt }}"
key:
content: "{{ content }}"
filename: "{{ filename }}"
updatedAt: "{{ updatedAt }}"
certificateDomains:
- "{{ certificateDomains }}"
checkCertificateRevocation: {{ checkCertificateRevocation }}
compressedJsonDescriptor: "{{ compressedJsonDescriptor }}"
compressedProtoFile: "{{ compressedProtoFile }}"
disableAiaIntermediateFetching: {{ disableAiaIntermediateFetching }}
dnsServer: "{{ dnsServer }}"
dnsServerPort: {{ dnsServerPort }}
files:
- bucketKey: "{{ bucketKey }}"
content: "{{ content }}"
encoding: "{{ encoding }}"
name: "{{ name }}"
originalFileName: "{{ originalFileName }}"
size: {{ size }}
type: "{{ type }}"
follow_redirects: {{ follow_redirects }}
form: "{{ form }}"
headers: "{{ headers }}"
host: "{{ host }}"
httpVersion: "{{ httpVersion }}"
ignore_certificate_validation: {{ ignore_certificate_validation }}
isMessageBase64Encoded: {{ isMessageBase64Encoded }}
mcpProtocolVersion: "{{ mcpProtocolVersion }}"
message: "{{ message }}"
metadata: "{{ metadata }}"
method: "{{ method }}"
noSavingResponseBody: {{ noSavingResponseBody }}
numberOfPackets: {{ numberOfPackets }}
persistCookies: {{ persistCookies }}
port: {{ port }}
proxy:
headers: "{{ headers }}"
url: "{{ url }}"
query: "{{ query }}"
servername: "{{ servername }}"
service: "{{ service }}"
shouldTrackHops: {{ shouldTrackHops }}
timeout: {{ timeout }}
toolArgs: "{{ toolArgs }}"
toolName: "{{ toolName }}"
url: "{{ url }}"
steps:
- allowFailure: {{ allowFailure }}
assertions: "{{ assertions }}"
exitIfSucceed: {{ exitIfSucceed }}
extractedValues: "{{ extractedValues }}"
extractedValuesFromScript: "{{ extractedValuesFromScript }}"
id: "{{ id }}"
isCritical: {{ isCritical }}
name: "{{ name }}"
request:
allow_insecure: {{ allow_insecure }}
basicAuth:
password: "{{ password }}"
type: "{{ type }}"
username: "{{ username }}"
accessKey: "{{ accessKey }}"
region: "{{ region }}"
secretKey: "{{ secretKey }}"
serviceName: "{{ serviceName }}"
sessionToken: "{{ sessionToken }}"
domain: "{{ domain }}"
workstation: "{{ workstation }}"
accessTokenUrl: "{{ accessTokenUrl }}"
audience: "{{ audience }}"
clientId: "{{ clientId }}"
clientSecret: "{{ clientSecret }}"
resource: "{{ resource }}"
scope: "{{ scope }}"
tokenApiAuthentication: "{{ tokenApiAuthentication }}"
addClaims:
exp: {{ exp }}
iat: {{ iat }}
algorithm: "{{ algorithm }}"
expiresIn: {{ expiresIn }}
header: "{{ header }}"
payload: "{{ payload }}"
secret: "{{ secret }}"
tokenPrefix: "{{ tokenPrefix }}"
body: "{{ body }}"
bodyType: "{{ bodyType }}"
callType: "{{ callType }}"
certificate:
cert:
content: "{{ content }}"
filename: "{{ filename }}"
updatedAt: "{{ updatedAt }}"
key:
content: "{{ content }}"
filename: "{{ filename }}"
updatedAt: "{{ updatedAt }}"
certificateDomains:
- "{{ certificateDomains }}"
checkCertificateRevocation: {{ checkCertificateRevocation }}
compressedJsonDescriptor: "{{ compressedJsonDescriptor }}"
compressedProtoFile: "{{ compressedProtoFile }}"
disableAiaIntermediateFetching: {{ disableAiaIntermediateFetching }}
dnsServer: "{{ dnsServer }}"
dnsServerPort: {{ dnsServerPort }}
files:
- bucketKey: "{{ bucketKey }}"
content: "{{ content }}"
encoding: "{{ encoding }}"
name: "{{ name }}"
originalFileName: "{{ originalFileName }}"
size: {{ size }}
type: "{{ type }}"
follow_redirects: {{ follow_redirects }}
form: "{{ form }}"
headers: "{{ headers }}"
host: "{{ host }}"
httpVersion: "{{ httpVersion }}"
ignore_certificate_validation: {{ ignore_certificate_validation }}
isMessageBase64Encoded: {{ isMessageBase64Encoded }}
mcpProtocolVersion: "{{ mcpProtocolVersion }}"
message: "{{ message }}"
metadata: "{{ metadata }}"
method: "{{ method }}"
noSavingResponseBody: {{ noSavingResponseBody }}
numberOfPackets: {{ numberOfPackets }}
persistCookies: {{ persistCookies }}
port: {{ port }}
proxy:
headers: "{{ headers }}"
url: "{{ url }}"
query: "{{ query }}"
servername: "{{ servername }}"
service: "{{ service }}"
shouldTrackHops: {{ shouldTrackHops }}
timeout: {{ timeout }}
toolArgs: "{{ toolArgs }}"
toolName: "{{ toolName }}"
url: "{{ url }}"
retry:
count: {{ count }}
interval: {{ interval }}
subtype: "{{ subtype }}"
value: {{ value }}
alwaysExecute: {{ alwaysExecute }}
subtestPublicId: "{{ subtestPublicId }}"
variablesFromScript: "{{ variablesFromScript }}"
- name: locations
value:
- "{{ locations }}"
description: |
Array of locations used to run the test.
- name: message
value: "{{ message }}"
description: |
Notification message associated with the test.
- name: name
value: "{{ name }}"
description: |
Name of the test.
- name: options
description: |
Object describing the extra options for a Synthetic test.
value:
accept_self_signed: {{ accept_self_signed }}
allow_insecure: {{ allow_insecure }}
blockedRequestPatterns:
- "{{ blockedRequestPatterns }}"
captureNetworkPayloads: {{ captureNetworkPayloads }}
checkCertificateRevocation: {{ checkCertificateRevocation }}
ci:
executionRule: "{{ executionRule }}"
device_ids:
- "{{ device_ids }}"
disableAiaIntermediateFetching: {{ disableAiaIntermediateFetching }}
disableCors: {{ disableCors }}
disableCsp: {{ disableCsp }}
enableProfiling: {{ enableProfiling }}
enableSecurityTesting: {{ enableSecurityTesting }}
follow_redirects: {{ follow_redirects }}
httpVersion: "{{ httpVersion }}"
ignoreServerCertificateError: {{ ignoreServerCertificateError }}
ignore_certificate_validation: {{ ignore_certificate_validation }}
initialNavigationTimeout: {{ initialNavigationTimeout }}
min_failure_duration: {{ min_failure_duration }}
min_location_failed: {{ min_location_failed }}
monitor_name: "{{ monitor_name }}"
monitor_options:
escalation_message: "{{ escalation_message }}"
notification_preset_name: "{{ notification_preset_name }}"
renotify_interval: {{ renotify_interval }}
renotify_occurrences: {{ renotify_occurrences }}
monitor_priority: {{ monitor_priority }}
noScreenshot: {{ noScreenshot }}
restricted_roles:
- "{{ restricted_roles }}"
retry:
count: {{ count }}
interval: {{ interval }}
rumSettings:
applicationId: "{{ applicationId }}"
clientTokenId: {{ clientTokenId }}
isEnabled: {{ isEnabled }}
scheduling:
timeframes:
- day: {{ day }}
from: "{{ from }}"
to: "{{ to }}"
timezone: "{{ timezone }}"
tick_every: {{ tick_every }}
- name: status
value: "{{ status }}"
description: |
Define whether you want to start (`live`) or pause (`paused`) a
Synthetic test.
valid_values: ['live', 'paused']
- name: subtype
value: "{{ subtype }}"
description: |
The subtype of the Synthetic API test, `http`, `ssl`, `tcp`,
`dns`, `icmp`, `udp`, `websocket`, `grpc` or `multi`.
valid_values: ['http', 'ssl', 'tcp', 'dns', 'multi', 'icmp', 'udp', 'websocket', 'grpc']
- name: tags
value:
- "{{ tags }}"
description: |
Array of tags attached to the test.
- name: type
value: "{{ type }}"
description: |
Type of the Synthetic test, `api`.
valid_values: ['api']
default: api
REPLACE examples
- update_apitest
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;