Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 55 additions & 0 deletions .generator/schemas/v1/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14597,6 +14597,61 @@ components:
oneOf:
- $ref: '#/components/schemas/SyntheticsAPITestStep'
- $ref: '#/components/schemas/SyntheticsAPIWaitStep'
- $ref: '#/components/schemas/SyntheticsAPISubtestStep'
SyntheticsAPISubtestStep:
description: The subtest step used in a Synthetics multi-step API test.
properties:
allowFailure:
description: Determines whether or not to continue with test if this step
fails.
type: boolean
alwaysExecute:
description: A boolean set to always execute this step even if the previous
step failed or was skipped.
type: boolean
exitIfSucceed:
description: Determines whether or not to exit the test if the step succeeds.
type: boolean
extractedValuesFromScript:
description: Generate variables using JavaScript.
type: string
id:
description: ID of the step.
example: abc-def-123
readOnly: true
type: string
isCritical:
description: 'Determines whether or not to consider the entire test as failed
if this step fails.

Can be used only if `allowFailure` is `true`.'
type: boolean
name:
description: The name of the step.
example: Example step name
type: string
retry:
$ref: '#/components/schemas/SyntheticsTestOptionsRetry'
subtestPublicId:
description: Public ID of the test to be played as part of a `playSubTest`
step type.
example: ''
type: string
subtype:
$ref: '#/components/schemas/SyntheticsAPISubtestStepSubtype'
required:
- name
- subtype
- subtestPublicId
type: object
SyntheticsAPISubtestStepSubtype:
description: The subtype of the Synthetic multi-step API subtest step.
enum:
- playSubTest
example: playSubTest
type: string
x-enum-varnames:
- PLAY_SUB_TEST
SyntheticsAPITest:
description: Object containing details about a Synthetic API test.
properties:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2025-12-26T15:22:45.114Z

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

49 changes: 49 additions & 0 deletions examples/v1/synthetics/CreateSyntheticsAPITest_2106135939.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# Create a multistep test with subtest returns "OK" response

require "datadog_api_client"
api_instance = DatadogAPIClient::V1::SyntheticsAPI.new

# there is a valid "synthetics_api_test" in the system
SYNTHETICS_API_TEST_PUBLIC_ID = ENV["SYNTHETICS_API_TEST_PUBLIC_ID"]

body = DatadogAPIClient::V1::SyntheticsAPITest.new({
config: DatadogAPIClient::V1::SyntheticsAPITestConfig.new({
steps: [
DatadogAPIClient::V1::SyntheticsAPITestStep.new({
assertions: [
DatadogAPIClient::V1::SyntheticsAssertionTarget.new({
operator: DatadogAPIClient::V1::SyntheticsAssertionOperator::IS,
type: DatadogAPIClient::V1::SyntheticsAssertionType::STATUS_CODE,
target: 200,
}),
],
name: "request is sent",
request: DatadogAPIClient::V1::SyntheticsTestRequest.new({
url: "https://httpbin.org/status/200",
method: "GET",
basic_auth: DatadogAPIClient::V1::SyntheticsBasicAuthWeb.new({
password: "password",
username: "username",
}),
}),
subtype: DatadogAPIClient::V1::SyntheticsAPITestStepSubtype::HTTP,
}),
DatadogAPIClient::V1::SyntheticsAPISubtestStep.new({
subtype: DatadogAPIClient::V1::SyntheticsAPISubtestStepSubtype::PLAY_SUB_TEST,
subtest_public_id: SYNTHETICS_API_TEST_PUBLIC_ID,
name: "subtest step",
}),
],
}),
locations: [
"aws:us-east-2",
],
message: "BDD test payload: synthetics_api_test_multi_step_with_subtest.json",
name: "Example-Synthetic",
options: DatadogAPIClient::V1::SyntheticsTestOptions.new({
tick_every: 60,
}),
subtype: DatadogAPIClient::V1::SyntheticsTestDetailsSubType::MULTI,
type: DatadogAPIClient::V1::SyntheticsAPITestType::API,
})
p api_instance.create_synthetics_api_test(body)
8 changes: 8 additions & 0 deletions features/v1/synthetics.feature
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,14 @@ Feature: Synthetics
And the response "config.steps[5].request.basicAuth.type" is equal to "oauth-client"
And the response "config.steps[6].request.basicAuth.type" is equal to "oauth-rop"

@team:DataDog/synthetics-managing
Scenario: Create a multistep test with subtest returns "OK" response
Given there is a valid "synthetics_api_test" in the system
And new "CreateSyntheticsAPITest" request
And body from file "synthetics_api_test_multi_step_with_subtest.json"
When the request is sent
Then the response status is 200 OK

@replay-only @team:DataDog/synthetics-managing
Scenario: Create a private location returns "OK" response
Given there is a valid "role" in the system
Expand Down
38 changes: 38 additions & 0 deletions features/v1/synthetics_api_test_multi_step_with_subtest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"config": {
"steps": [
{
"assertions": [
{
"operator": "is",
"type": "statusCode",
"target": 200
}
],
"name": "request is sent",
"request": {
"url": "https://httpbin.org/status/200",
"method": "GET",
"basicAuth": {
"password": "password",
"username": "username"
}
},
"subtype": "http"
},
{
"subtype": "playSubTest",
"subtestPublicId": "{{ synthetics_api_test.public_id }}",
"name": "subtest step"
}
]
},
"locations": ["aws:us-east-2"],
"message": "BDD test payload: synthetics_api_test_multi_step_with_subtest.json",
"name": "{{ unique }}",
"options": {
"tick_every": 60
},
"subtype": "multi",
"type": "api"
}
2 changes: 2 additions & 0 deletions lib/datadog_api_client/inflector.rb
Original file line number Diff line number Diff line change
Expand Up @@ -583,6 +583,8 @@ def overrides
"v1.sunburst_widget_legend_table_type" => "SunburstWidgetLegendTableType",
"v1.sunburst_widget_request" => "SunburstWidgetRequest",
"v1.synthetics_api_step" => "SyntheticsAPIStep",
"v1.synthetics_api_subtest_step" => "SyntheticsAPISubtestStep",
"v1.synthetics_api_subtest_step_subtype" => "SyntheticsAPISubtestStepSubtype",
"v1.synthetics_api_test" => "SyntheticsAPITest",
"v1.synthetics_api_test_config" => "SyntheticsAPITestConfig",
"v1.synthetics_api_test_failure_code" => "SyntheticsApiTestFailureCode",
Expand Down
3 changes: 2 additions & 1 deletion lib/datadog_api_client/v1/models/synthetics_api_step.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ class << self
def openapi_one_of
[
:'SyntheticsAPITestStep',
:'SyntheticsAPIWaitStep'
:'SyntheticsAPIWaitStep',
:'SyntheticsAPISubtestStep'
]
end
# Builds the object
Expand Down
Loading
Loading