Skip to content

Add support for all subtypes in multistep steps #2865

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
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
8 changes: 4 additions & 4 deletions .apigentools-info
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
"spec_versions": {
"v1": {
"apigentools_version": "1.6.6",
"regenerated": "2025-06-05 09:49:40.720994",
"spec_repo_commit": "faa72400"
"regenerated": "2025-06-06 09:05:58.608614",
"spec_repo_commit": "14586db5"
},
"v2": {
"apigentools_version": "1.6.6",
"regenerated": "2025-06-05 09:49:40.742309",
"spec_repo_commit": "faa72400"
"regenerated": "2025-06-06 09:05:58.627256",
"spec_repo_commit": "14586db5"
}
}
}
18 changes: 18 additions & 0 deletions .generator/schemas/v1/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14107,11 +14107,23 @@ components:
enum:
- http
- grpc
- ssl
- dns
- tcp
- udp
- icmp
- websocket
example: http
type: string
x-enum-varnames:
- HTTP
- GRPC
- SSL
- DNS
- TCP
- UDP
- ICMP
- WEBSOCKET
SyntheticsAPITestType:
default: api
description: Type of the Synthetic test, `api`.
Expand Down Expand Up @@ -17177,6 +17189,9 @@ components:
example: ''
type: string
type: array
checkCertificateRevocation:
description: Check for certificate revocation.
type: boolean
compressedJsonDescriptor:
description: A protobuf JSON descriptor that needs to be gzipped first then
base64 encoded.
Expand Down Expand Up @@ -17206,6 +17221,9 @@ components:
type: string
httpVersion:
$ref: '#/components/schemas/SyntheticsTestOptionsHTTPVersion'
isMessageBase64Encoded:
description: Whether the message is base64 encoded.
type: boolean
message:
description: Message to send for UDP or WebSocket tests.
type: string
Expand Down
147 changes: 146 additions & 1 deletion examples/v1/synthetics/CreateSyntheticsAPITest_1279271422.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@
import com.datadog.api.client.v1.model.SyntheticsAssertionTarget;
import com.datadog.api.client.v1.model.SyntheticsAssertionTargetValue;
import com.datadog.api.client.v1.model.SyntheticsAssertionType;
import com.datadog.api.client.v1.model.SyntheticsBasicAuth;
import com.datadog.api.client.v1.model.SyntheticsBasicAuthWeb;
import com.datadog.api.client.v1.model.SyntheticsBasicAuthWebType;
import com.datadog.api.client.v1.model.SyntheticsConfigVariable;
import com.datadog.api.client.v1.model.SyntheticsConfigVariableType;
import com.datadog.api.client.v1.model.SyntheticsGlobalVariableParserType;
Expand Down Expand Up @@ -122,7 +125,149 @@ public static void main(String[] args) {
.compressedJsonDescriptor(
"eJy1lU1z2yAQhv+Lzj74I3ETH506bQ7OZOSm1w4Wa4epBARQppqM/3v5koCJJdvtxCdW77vPssCO3zMKUgHOFu/ZXvBiS6hZho/f8qe7pftYgXphWJrlA8XwxywEvNba+6PhkC2yVcVVswYp0R6ykRYlZ1SCV21SDrxsssPIeS9FJKqGfK2rqnmmSBwhWa2XlKgtaQPiDcRGCUDVfwGD2sKUqKEtc1cSoOrsMlaMOec1sySYCCgUYRSVLv2zSva2u+FQkB0pVkIw8bFuIudOOn3pOaKYVT3Iy97Pd0AYhOx5QcMsnxvRHlnuLf8ETDd3CNtrv2nejkDpRnANCmGkkFn/hsYzpBKE7jVbufgnKnV9HRM9zRPDDKPttYT61n0TdWkAAjggk9AhuxIeaXd69CYTcsGw7cBTakLVbNpRzGEgyWjkSOpMbZXkhGL6oX30R49qt3GoHrap7i0XdD41WQ+2icCNm5p1hmFqnHNlcla0riKmDZ183crDxChjbnurtxHPRE784sVhWvDfGP+SsTKibU3o5NtWHuZFGZOxP6P5VXqIOvaOSec4eYohyd7NslHuJbd1bewds85xYrNxkr2d+5IhFWF3NvaO684xjE2S5ulY+tu64Pna0fCPJgzw6vF5/WucLcYjt5xoq19O3UDptOg/OamJQRaCcPPnMTQ2QDFn+uhPvUfnCrMc99upyQY4Ui9Dlc/YoG3R/v4Cs9YE+g==")
.metadata(Map.ofEntries())
.callType(SyntheticsTestCallType.UNARY))))))
.callType(SyntheticsTestCallType.UNARY))),
new SyntheticsAPIStep(
new SyntheticsAPITestStep()
.name("SSL step")
.subtype(SyntheticsAPITestStepSubtype.SSL)
.allowFailure(false)
.isCritical(true)
.retry(
new SyntheticsTestOptionsRetry().count(0L).interval(300.0))
.assertions(
Collections.singletonList(
new SyntheticsAssertion(
new SyntheticsAssertionTarget()
.operator(
SyntheticsAssertionOperator
.IS_IN_MORE_DAYS_THAN)
.type(SyntheticsAssertionType.CERTIFICATE)
.target(
new SyntheticsAssertionTargetValue(10.0)))))
.request(
new SyntheticsTestRequest()
.checkCertificateRevocation(true)
.host("example.org")
.port(new SyntheticsTestRequestPort(443L)))),
new SyntheticsAPIStep(
new SyntheticsAPITestStep()
.name("DNS step")
.subtype(SyntheticsAPITestStepSubtype.DNS)
.allowFailure(false)
.isCritical(true)
.retry(
new SyntheticsTestOptionsRetry().count(0L).interval(300.0))
.assertions(
Collections.singletonList(
new SyntheticsAssertion(
new SyntheticsAssertionTarget()
.operator(SyntheticsAssertionOperator.LESS_THAN)
.type(SyntheticsAssertionType.RESPONSE_TIME)
.target(
new SyntheticsAssertionTargetValue(
1000.0)))))
.request(
new SyntheticsTestRequest()
.host("troisdizaines.com")
.dnsServer("8.8.8.8")
.dnsServerPort("53"))),
new SyntheticsAPIStep(
new SyntheticsAPITestStep()
.name("TCP step")
.subtype(SyntheticsAPITestStepSubtype.TCP)
.allowFailure(false)
.isCritical(true)
.retry(
new SyntheticsTestOptionsRetry().count(0L).interval(300.0))
.assertions(
Collections.singletonList(
new SyntheticsAssertion(
new SyntheticsAssertionTarget()
.operator(SyntheticsAssertionOperator.LESS_THAN)
.type(SyntheticsAssertionType.RESPONSE_TIME)
.target(
new SyntheticsAssertionTargetValue(
1000.0)))))
.request(
new SyntheticsTestRequest()
.host("34.95.79.70")
.port(new SyntheticsTestRequestPort(80L))
.shouldTrackHops(true)
.timeout(32.0))),
new SyntheticsAPIStep(
new SyntheticsAPITestStep()
.name("ICMP step")
.subtype(SyntheticsAPITestStepSubtype.ICMP)
.allowFailure(false)
.isCritical(true)
.retry(
new SyntheticsTestOptionsRetry().count(0L).interval(300.0))
.assertions(
Collections.singletonList(
new SyntheticsAssertion(
new SyntheticsAssertionTarget()
.operator(SyntheticsAssertionOperator.IS)
.target(new SyntheticsAssertionTargetValue(0.0))
.type(
SyntheticsAssertionType
.PACKET_LOSS_PERCENTAGE))))
.request(
new SyntheticsTestRequest()
.host("34.95.79.70")
.numberOfPackets(4)
.shouldTrackHops(true)
.timeout(38.0))),
new SyntheticsAPIStep(
new SyntheticsAPITestStep()
.name("Websocket step")
.subtype(SyntheticsAPITestStepSubtype.WEBSOCKET)
.allowFailure(false)
.isCritical(true)
.retry(
new SyntheticsTestOptionsRetry().count(0L).interval(300.0))
.assertions(
Collections.singletonList(
new SyntheticsAssertion(
new SyntheticsAssertionTarget()
.operator(SyntheticsAssertionOperator.LESS_THAN)
.type(SyntheticsAssertionType.RESPONSE_TIME)
.target(
new SyntheticsAssertionTargetValue(
1000.0)))))
.request(
new SyntheticsTestRequest()
.url("ws://34.95.79.70/web-socket")
.message("My message")
.isMessageBase64Encoded(true)
.headers(Map.ofEntries(Map.entry("f", "g")))
.basicAuth(
new SyntheticsBasicAuth(
new SyntheticsBasicAuthWeb()
.type(SyntheticsBasicAuthWebType.WEB)
.username("user")
.password("password"))))),
new SyntheticsAPIStep(
new SyntheticsAPITestStep()
.name("UDP step")
.subtype(SyntheticsAPITestStepSubtype.UDP)
.allowFailure(false)
.isCritical(true)
.retry(
new SyntheticsTestOptionsRetry().count(0L).interval(300.0))
.assertions(
Collections.singletonList(
new SyntheticsAssertion(
new SyntheticsAssertionTarget()
.operator(SyntheticsAssertionOperator.LESS_THAN)
.type(SyntheticsAssertionType.RESPONSE_TIME)
.target(
new SyntheticsAssertionTargetValue(
1000.0)))))
.request(
new SyntheticsTestRequest()
.host("8.8.8.8")
.port(new SyntheticsTestRequestPort(53L))
.message("A image.google.com"))))))
.locations(Collections.singletonList("aws:us-east-2"))
.message("BDD test payload: synthetics_api_test_multi_step_payload.json")
.name("Example-Synthetic")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,18 @@
public class SyntheticsAPITestStepSubtype extends ModelEnum<String> {

private static final Set<String> allowedValues =
new HashSet<String>(Arrays.asList("http", "grpc"));
new HashSet<String>(
Arrays.asList("http", "grpc", "ssl", "dns", "tcp", "udp", "icmp", "websocket"));

public static final SyntheticsAPITestStepSubtype HTTP = new SyntheticsAPITestStepSubtype("http");
public static final SyntheticsAPITestStepSubtype GRPC = new SyntheticsAPITestStepSubtype("grpc");
public static final SyntheticsAPITestStepSubtype SSL = new SyntheticsAPITestStepSubtype("ssl");
public static final SyntheticsAPITestStepSubtype DNS = new SyntheticsAPITestStepSubtype("dns");
public static final SyntheticsAPITestStepSubtype TCP = new SyntheticsAPITestStepSubtype("tcp");
public static final SyntheticsAPITestStepSubtype UDP = new SyntheticsAPITestStepSubtype("udp");
public static final SyntheticsAPITestStepSubtype ICMP = new SyntheticsAPITestStepSubtype("icmp");
public static final SyntheticsAPITestStepSubtype WEBSOCKET =
new SyntheticsAPITestStepSubtype("websocket");

SyntheticsAPITestStepSubtype(String value) {
super(value, allowedValues);
Expand Down
Loading