@@ -15,6 +15,9 @@ use datadog_api_client::datadogV1::model::SyntheticsAssertionOperator;
15
15
use datadog_api_client:: datadogV1:: model:: SyntheticsAssertionTarget ;
16
16
use datadog_api_client:: datadogV1:: model:: SyntheticsAssertionTargetValue ;
17
17
use datadog_api_client:: datadogV1:: model:: SyntheticsAssertionType ;
18
+ use datadog_api_client:: datadogV1:: model:: SyntheticsBasicAuth ;
19
+ use datadog_api_client:: datadogV1:: model:: SyntheticsBasicAuthWeb ;
20
+ use datadog_api_client:: datadogV1:: model:: SyntheticsBasicAuthWebType ;
18
21
use datadog_api_client:: datadogV1:: model:: SyntheticsConfigVariable ;
19
22
use datadog_api_client:: datadogV1:: model:: SyntheticsConfigVariableType ;
20
23
use datadog_api_client:: datadogV1:: model:: SyntheticsGlobalVariableParserType ;
@@ -133,6 +136,193 @@ async fn main() {
133
136
. is_critical( true )
134
137
. retry( SyntheticsTestOptionsRetry :: new( ) . count( 0 ) . interval( 300.0 as f64 ) ) ,
135
138
) ,
139
+ ) ,
140
+ SyntheticsAPIStep :: SyntheticsAPITestStep (
141
+ Box :: new(
142
+ SyntheticsAPITestStep :: new(
143
+ vec![
144
+ SyntheticsAssertion :: SyntheticsAssertionTarget (
145
+ Box :: new(
146
+ SyntheticsAssertionTarget :: new(
147
+ SyntheticsAssertionOperator :: IS_IN_MORE_DAYS_THAN ,
148
+ SyntheticsAssertionTargetValue
149
+ :: SyntheticsAssertionTargetValueNumber (
150
+ 10.0 as f64 ,
151
+ ) ,
152
+ SyntheticsAssertionType :: CERTIFICATE ,
153
+ ) ,
154
+ ) ,
155
+ )
156
+ ] ,
157
+ "SSL step" . to_string( ) ,
158
+ SyntheticsTestRequest :: new( )
159
+ . check_certificate_revocation( true )
160
+ . host( "example.org" . to_string( ) )
161
+ . port( SyntheticsTestRequestPort :: SyntheticsTestRequestNumericalPort ( 443 ) ) ,
162
+ SyntheticsAPITestStepSubtype :: SSL ,
163
+ )
164
+ . allow_failure( false )
165
+ . is_critical( true )
166
+ . retry( SyntheticsTestOptionsRetry :: new( ) . count( 0 ) . interval( 300.0 as f64 ) ) ,
167
+ ) ,
168
+ ) ,
169
+ SyntheticsAPIStep :: SyntheticsAPITestStep (
170
+ Box :: new(
171
+ SyntheticsAPITestStep :: new(
172
+ vec![
173
+ SyntheticsAssertion :: SyntheticsAssertionTarget (
174
+ Box :: new(
175
+ SyntheticsAssertionTarget :: new(
176
+ SyntheticsAssertionOperator :: LESS_THAN ,
177
+ SyntheticsAssertionTargetValue
178
+ :: SyntheticsAssertionTargetValueNumber (
179
+ 1000.0 as f64 ,
180
+ ) ,
181
+ SyntheticsAssertionType :: RESPONSE_TIME ,
182
+ ) ,
183
+ ) ,
184
+ )
185
+ ] ,
186
+ "DNS step" . to_string( ) ,
187
+ SyntheticsTestRequest :: new( )
188
+ . dns_server( "8.8.8.8" . to_string( ) )
189
+ . dns_server_port( "53" . to_string( ) )
190
+ . host( "troisdizaines.com" . to_string( ) ) ,
191
+ SyntheticsAPITestStepSubtype :: DNS ,
192
+ )
193
+ . allow_failure( false )
194
+ . is_critical( true )
195
+ . retry( SyntheticsTestOptionsRetry :: new( ) . count( 0 ) . interval( 300.0 as f64 ) ) ,
196
+ ) ,
197
+ ) ,
198
+ SyntheticsAPIStep :: SyntheticsAPITestStep (
199
+ Box :: new(
200
+ SyntheticsAPITestStep :: new(
201
+ vec![
202
+ SyntheticsAssertion :: SyntheticsAssertionTarget (
203
+ Box :: new(
204
+ SyntheticsAssertionTarget :: new(
205
+ SyntheticsAssertionOperator :: LESS_THAN ,
206
+ SyntheticsAssertionTargetValue
207
+ :: SyntheticsAssertionTargetValueNumber (
208
+ 1000.0 as f64 ,
209
+ ) ,
210
+ SyntheticsAssertionType :: RESPONSE_TIME ,
211
+ ) ,
212
+ ) ,
213
+ )
214
+ ] ,
215
+ "TCP step" . to_string( ) ,
216
+ SyntheticsTestRequest :: new( )
217
+ . host( "34.95.79.70" . to_string( ) )
218
+ . port( SyntheticsTestRequestPort :: SyntheticsTestRequestNumericalPort ( 80 ) )
219
+ . should_track_hops( true )
220
+ . timeout( 32.0 as f64 ) ,
221
+ SyntheticsAPITestStepSubtype :: TCP ,
222
+ )
223
+ . allow_failure( false )
224
+ . is_critical( true )
225
+ . retry( SyntheticsTestOptionsRetry :: new( ) . count( 0 ) . interval( 300.0 as f64 ) ) ,
226
+ ) ,
227
+ ) ,
228
+ SyntheticsAPIStep :: SyntheticsAPITestStep (
229
+ Box :: new(
230
+ SyntheticsAPITestStep :: new(
231
+ vec![
232
+ SyntheticsAssertion :: SyntheticsAssertionTarget (
233
+ Box :: new(
234
+ SyntheticsAssertionTarget :: new(
235
+ SyntheticsAssertionOperator :: IS ,
236
+ SyntheticsAssertionTargetValue
237
+ :: SyntheticsAssertionTargetValueNumber (
238
+ 0.0 as f64 ,
239
+ ) ,
240
+ SyntheticsAssertionType :: PACKET_LOSS_PERCENTAGE ,
241
+ ) ,
242
+ ) ,
243
+ )
244
+ ] ,
245
+ "ICMP step" . to_string( ) ,
246
+ SyntheticsTestRequest :: new( )
247
+ . host( "34.95.79.70" . to_string( ) )
248
+ . number_of_packets( 4 )
249
+ . should_track_hops( true )
250
+ . timeout( 38.0 as f64 ) ,
251
+ SyntheticsAPITestStepSubtype :: ICMP ,
252
+ )
253
+ . allow_failure( false )
254
+ . is_critical( true )
255
+ . retry( SyntheticsTestOptionsRetry :: new( ) . count( 0 ) . interval( 300.0 as f64 ) ) ,
256
+ ) ,
257
+ ) ,
258
+ SyntheticsAPIStep :: SyntheticsAPITestStep (
259
+ Box :: new(
260
+ SyntheticsAPITestStep :: new(
261
+ vec![
262
+ SyntheticsAssertion :: SyntheticsAssertionTarget (
263
+ Box :: new(
264
+ SyntheticsAssertionTarget :: new(
265
+ SyntheticsAssertionOperator :: LESS_THAN ,
266
+ SyntheticsAssertionTargetValue
267
+ :: SyntheticsAssertionTargetValueNumber (
268
+ 1000.0 as f64 ,
269
+ ) ,
270
+ SyntheticsAssertionType :: RESPONSE_TIME ,
271
+ ) ,
272
+ ) ,
273
+ )
274
+ ] ,
275
+ "Websocket step" . to_string( ) ,
276
+ SyntheticsTestRequest :: new( )
277
+ . basic_auth(
278
+ SyntheticsBasicAuth :: SyntheticsBasicAuthWeb (
279
+ Box :: new(
280
+ SyntheticsBasicAuthWeb :: new(
281
+ "password" . to_string( ) ,
282
+ "user" . to_string( ) ,
283
+ ) . type_( SyntheticsBasicAuthWebType :: WEB ) ,
284
+ ) ,
285
+ ) ,
286
+ )
287
+ . headers( BTreeMap :: from( [ ( "f" . to_string( ) , "g" . to_string( ) ) ] ) )
288
+ . is_message_base64_encoded( true )
289
+ . message( "My message" . to_string( ) )
290
+ . url( "ws://34.95.79.70/web-socket" . to_string( ) ) ,
291
+ SyntheticsAPITestStepSubtype :: WEBSOCKET ,
292
+ )
293
+ . allow_failure( false )
294
+ . is_critical( true )
295
+ . retry( SyntheticsTestOptionsRetry :: new( ) . count( 0 ) . interval( 300.0 as f64 ) ) ,
296
+ ) ,
297
+ ) ,
298
+ SyntheticsAPIStep :: SyntheticsAPITestStep (
299
+ Box :: new(
300
+ SyntheticsAPITestStep :: new(
301
+ vec![
302
+ SyntheticsAssertion :: SyntheticsAssertionTarget (
303
+ Box :: new(
304
+ SyntheticsAssertionTarget :: new(
305
+ SyntheticsAssertionOperator :: LESS_THAN ,
306
+ SyntheticsAssertionTargetValue
307
+ :: SyntheticsAssertionTargetValueNumber (
308
+ 1000.0 as f64 ,
309
+ ) ,
310
+ SyntheticsAssertionType :: RESPONSE_TIME ,
311
+ ) ,
312
+ ) ,
313
+ )
314
+ ] ,
315
+ "UDP step" . to_string( ) ,
316
+ SyntheticsTestRequest :: new( )
317
+ . host( "8.8.8.8" . to_string( ) )
318
+ . message( "A image.google.com" . to_string( ) )
319
+ . port( SyntheticsTestRequestPort :: SyntheticsTestRequestNumericalPort ( 53 ) ) ,
320
+ SyntheticsAPITestStepSubtype :: UDP ,
321
+ )
322
+ . allow_failure( false )
323
+ . is_critical( true )
324
+ . retry( SyntheticsTestOptionsRetry :: new( ) . count( 0 ) . interval( 300.0 as f64 ) ) ,
325
+ ) ,
136
326
)
137
327
] ,
138
328
) ,
0 commit comments