|
16 | 16 | import com.datadog.api.client.v1.model.SyntheticsAssertionTarget;
|
17 | 17 | import com.datadog.api.client.v1.model.SyntheticsAssertionTargetValue;
|
18 | 18 | import com.datadog.api.client.v1.model.SyntheticsAssertionType;
|
| 19 | +import com.datadog.api.client.v1.model.SyntheticsBasicAuth; |
| 20 | +import com.datadog.api.client.v1.model.SyntheticsBasicAuthWeb; |
| 21 | +import com.datadog.api.client.v1.model.SyntheticsBasicAuthWebType; |
19 | 22 | import com.datadog.api.client.v1.model.SyntheticsConfigVariable;
|
20 | 23 | import com.datadog.api.client.v1.model.SyntheticsConfigVariableType;
|
21 | 24 | import com.datadog.api.client.v1.model.SyntheticsGlobalVariableParserType;
|
@@ -122,7 +125,147 @@ public static void main(String[] args) {
|
122 | 125 | .compressedJsonDescriptor(
|
123 | 126 | "eJy1lU1z2yAQhv+Lzj74I3ETH506bQ7OZOSm1w4Wa4epBARQppqM/3v5koCJJdvtxCdW77vPssCO3zMKUgHOFu/ZXvBiS6hZho/f8qe7pftYgXphWJrlA8XwxywEvNba+6PhkC2yVcVVswYp0R6ykRYlZ1SCV21SDrxsssPIeS9FJKqGfK2rqnmmSBwhWa2XlKgtaQPiDcRGCUDVfwGD2sKUqKEtc1cSoOrsMlaMOec1sySYCCgUYRSVLv2zSva2u+FQkB0pVkIw8bFuIudOOn3pOaKYVT3Iy97Pd0AYhOx5QcMsnxvRHlnuLf8ETDd3CNtrv2nejkDpRnANCmGkkFn/hsYzpBKE7jVbufgnKnV9HRM9zRPDDKPttYT61n0TdWkAAjggk9AhuxIeaXd69CYTcsGw7cBTakLVbNpRzGEgyWjkSOpMbZXkhGL6oX30R49qt3GoHrap7i0XdD41WQ+2icCNm5p1hmFqnHNlcla0riKmDZ183crDxChjbnurtxHPRE784sVhWvDfGP+SsTKibU3o5NtWHuZFGZOxP6P5VXqIOvaOSec4eYohyd7NslHuJbd1bewds85xYrNxkr2d+5IhFWF3NvaO684xjE2S5ulY+tu64Pna0fCPJgzw6vF5/WucLcYjt5xoq19O3UDptOg/OamJQRaCcPPnMTQ2QDFn+uhPvUfnCrMc99upyQY4Ui9Dlc/YoG3R/v4Cs9YE+g==")
|
124 | 127 | .metadata(Map.ofEntries())
|
125 |
| - .callType(SyntheticsTestCallType.UNARY)))))) |
| 128 | + .callType(SyntheticsTestCallType.UNARY))), |
| 129 | + new SyntheticsAPIStep( |
| 130 | + new SyntheticsAPITestStep() |
| 131 | + .name("SSL step") |
| 132 | + .subtype(SyntheticsAPITestStepSubtype.SSL) |
| 133 | + .allowFailure(false) |
| 134 | + .isCritical(true) |
| 135 | + .retry( |
| 136 | + new SyntheticsTestOptionsRetry().count(0L).interval(300.0)) |
| 137 | + .assertions( |
| 138 | + Collections.singletonList( |
| 139 | + new SyntheticsAssertion( |
| 140 | + new SyntheticsAssertionTarget() |
| 141 | + .operator( |
| 142 | + SyntheticsAssertionOperator |
| 143 | + .IS_IN_MORE_DAYS_THAN) |
| 144 | + .type(SyntheticsAssertionType.CERTIFICATE) |
| 145 | + .target( |
| 146 | + new SyntheticsAssertionTargetValue(10.0))))) |
| 147 | + .request( |
| 148 | + new SyntheticsTestRequest() |
| 149 | + .host("example.org") |
| 150 | + .port(new SyntheticsTestRequestPort(443L)))), |
| 151 | + new SyntheticsAPIStep( |
| 152 | + new SyntheticsAPITestStep() |
| 153 | + .name("DNS step") |
| 154 | + .subtype(SyntheticsAPITestStepSubtype.DNS) |
| 155 | + .allowFailure(false) |
| 156 | + .isCritical(true) |
| 157 | + .retry( |
| 158 | + new SyntheticsTestOptionsRetry().count(0L).interval(300.0)) |
| 159 | + .assertions( |
| 160 | + Collections.singletonList( |
| 161 | + new SyntheticsAssertion( |
| 162 | + new SyntheticsAssertionTarget() |
| 163 | + .operator(SyntheticsAssertionOperator.LESS_THAN) |
| 164 | + .type(SyntheticsAssertionType.RESPONSE_TIME) |
| 165 | + .target( |
| 166 | + new SyntheticsAssertionTargetValue( |
| 167 | + 1000.0))))) |
| 168 | + .request( |
| 169 | + new SyntheticsTestRequest() |
| 170 | + .host("troisdizaines.com") |
| 171 | + .dnsServer("8.8.8.8") |
| 172 | + .dnsServerPort("53"))), |
| 173 | + new SyntheticsAPIStep( |
| 174 | + new SyntheticsAPITestStep() |
| 175 | + .name("TCP step") |
| 176 | + .subtype(SyntheticsAPITestStepSubtype.TCP) |
| 177 | + .allowFailure(false) |
| 178 | + .isCritical(true) |
| 179 | + .retry( |
| 180 | + new SyntheticsTestOptionsRetry().count(0L).interval(300.0)) |
| 181 | + .assertions( |
| 182 | + Collections.singletonList( |
| 183 | + new SyntheticsAssertion( |
| 184 | + new SyntheticsAssertionTarget() |
| 185 | + .operator(SyntheticsAssertionOperator.LESS_THAN) |
| 186 | + .type(SyntheticsAssertionType.RESPONSE_TIME) |
| 187 | + .target( |
| 188 | + new SyntheticsAssertionTargetValue( |
| 189 | + 1000.0))))) |
| 190 | + .request( |
| 191 | + new SyntheticsTestRequest() |
| 192 | + .host("34.95.79.70") |
| 193 | + .port(new SyntheticsTestRequestPort(80L)) |
| 194 | + .shouldTrackHops(true) |
| 195 | + .timeout(32.0))), |
| 196 | + new SyntheticsAPIStep( |
| 197 | + new SyntheticsAPITestStep() |
| 198 | + .name("ICMP step") |
| 199 | + .subtype(SyntheticsAPITestStepSubtype.ICMP) |
| 200 | + .allowFailure(false) |
| 201 | + .isCritical(true) |
| 202 | + .retry( |
| 203 | + new SyntheticsTestOptionsRetry().count(0L).interval(300.0)) |
| 204 | + .assertions( |
| 205 | + Collections.singletonList( |
| 206 | + new SyntheticsAssertion( |
| 207 | + new SyntheticsAssertionTarget() |
| 208 | + .operator(SyntheticsAssertionOperator.IS) |
| 209 | + .target(new SyntheticsAssertionTargetValue(0.0)) |
| 210 | + .type( |
| 211 | + SyntheticsAssertionType |
| 212 | + .PACKET_LOSS_PERCENTAGE)))) |
| 213 | + .request( |
| 214 | + new SyntheticsTestRequest() |
| 215 | + .host("34.95.79.70") |
| 216 | + .numberOfPackets(4) |
| 217 | + .shouldTrackHops(true) |
| 218 | + .timeout(38.0))), |
| 219 | + new SyntheticsAPIStep( |
| 220 | + new SyntheticsAPITestStep() |
| 221 | + .name("Websocket step") |
| 222 | + .subtype(SyntheticsAPITestStepSubtype.WEBSOCKET) |
| 223 | + .allowFailure(false) |
| 224 | + .isCritical(true) |
| 225 | + .retry( |
| 226 | + new SyntheticsTestOptionsRetry().count(0L).interval(300.0)) |
| 227 | + .assertions( |
| 228 | + Collections.singletonList( |
| 229 | + new SyntheticsAssertion( |
| 230 | + new SyntheticsAssertionTarget() |
| 231 | + .operator(SyntheticsAssertionOperator.LESS_THAN) |
| 232 | + .type(SyntheticsAssertionType.RESPONSE_TIME) |
| 233 | + .target( |
| 234 | + new SyntheticsAssertionTargetValue( |
| 235 | + 1000.0))))) |
| 236 | + .request( |
| 237 | + new SyntheticsTestRequest() |
| 238 | + .url("ws://34.95.79.70/web-socket") |
| 239 | + .message("My message") |
| 240 | + .headers(Map.ofEntries(Map.entry("f", "g"))) |
| 241 | + .basicAuth( |
| 242 | + new SyntheticsBasicAuth( |
| 243 | + new SyntheticsBasicAuthWeb() |
| 244 | + .type(SyntheticsBasicAuthWebType.WEB) |
| 245 | + .username("user") |
| 246 | + .password("password"))))), |
| 247 | + new SyntheticsAPIStep( |
| 248 | + new SyntheticsAPITestStep() |
| 249 | + .name("UDP step") |
| 250 | + .subtype(SyntheticsAPITestStepSubtype.UDP) |
| 251 | + .allowFailure(false) |
| 252 | + .isCritical(true) |
| 253 | + .retry( |
| 254 | + new SyntheticsTestOptionsRetry().count(0L).interval(300.0)) |
| 255 | + .assertions( |
| 256 | + Collections.singletonList( |
| 257 | + new SyntheticsAssertion( |
| 258 | + new SyntheticsAssertionTarget() |
| 259 | + .operator(SyntheticsAssertionOperator.LESS_THAN) |
| 260 | + .type(SyntheticsAssertionType.RESPONSE_TIME) |
| 261 | + .target( |
| 262 | + new SyntheticsAssertionTargetValue( |
| 263 | + 1000.0))))) |
| 264 | + .request( |
| 265 | + new SyntheticsTestRequest() |
| 266 | + .host("8.8.8.8") |
| 267 | + .port(new SyntheticsTestRequestPort(53L)) |
| 268 | + .message("A image.google.com")))))) |
126 | 269 | .locations(Collections.singletonList("aws:us-east-2"))
|
127 | 270 | .message("BDD test payload: synthetics_api_test_multi_step_payload.json")
|
128 | 271 | .name("Example-Synthetic")
|
|
0 commit comments