Class: DatadogAPIClient::V1::SyntheticsAPI

Inherits:
Object
  • Object
show all
Defined in:
lib/datadog_api_client/v1/api/synthetics_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = DatadogAPIClient::APIClient.default) ⇒ SyntheticsAPI

Returns a new instance of SyntheticsAPI.



22
23
24
# File 'lib/datadog_api_client/v1/api/synthetics_api.rb', line 22

def initialize(api_client = DatadogAPIClient::APIClient.default)
  @api_client = api_client
end

Instance Attribute Details

#api_client ⇒ Object

Returns the value of attribute api_client.



20
21
22
# File 'lib/datadog_api_client/v1/api/synthetics_api.rb', line 20

def api_client
  @api_client
end

Instance Method Details

#create_global_variable(body, opts = {}) ⇒ Object

Create a global variable.



29
30
31
32
# File 'lib/datadog_api_client/v1/api/synthetics_api.rb', line 29

def create_global_variable(body, opts = {})
  data, _status_code, _headers = create_global_variable_with_http_info(body, opts)
  data
end

#create_global_variable_with_http_info(body, opts = {}) ⇒ Array<(SyntheticsGlobalVariable, Integer, Hash)>

Create a global variable.

Create a Synthetic global variable.

Parameters:

Returns:

  • (Array<(SyntheticsGlobalVariable, Integer, Hash)>) —

    SyntheticsGlobalVariable data, response status code and response headers



41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
# File 'lib/datadog_api_client/v1/api/synthetics_api.rb', line 41

def create_global_variable_with_http_info(body, opts = {})

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SyntheticsAPI.create_global_variable ...'
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling SyntheticsAPI.create_global_variable"
  end
  # resource path
  local_var_path = '/api/v1/synthetics/variables'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(body)

  # return_type
  return_type = opts[:debug_return_type] || 'SyntheticsGlobalVariable'

  # auth_names
  auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]

  new_options = opts.merge(
    :operation => :create_global_variable,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type,
    :api_version => "V1"
  )

  data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SyntheticsAPI#create_global_variable\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#create_private_location(body, opts = {}) ⇒ Object

Create a private location.



96
97
98
99
# File 'lib/datadog_api_client/v1/api/synthetics_api.rb', line 96

def create_private_location(body, opts = {})
  data, _status_code, _headers = create_private_location_with_http_info(body, opts)
  data
end

#create_private_location_with_http_info(body, opts = {}) ⇒ Array<(SyntheticsPrivateLocationCreationResponse, Integer, Hash)>

Create a private location.

Create a new Synthetic private location.

Parameters:

  • body (SyntheticsPrivateLocation) —

    Details of the private location to create.

  • opts (Hash) (defaults to: {}) —

    the optional parameters

Returns:



108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
# File 'lib/datadog_api_client/v1/api/synthetics_api.rb', line 108

def create_private_location_with_http_info(body, opts = {})

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SyntheticsAPI.create_private_location ...'
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling SyntheticsAPI.create_private_location"
  end
  # resource path
  local_var_path = '/api/v1/synthetics/private-locations'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(body)

  # return_type
  return_type = opts[:debug_return_type] || 'SyntheticsPrivateLocationCreationResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]

  new_options = opts.merge(
    :operation => :create_private_location,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type,
    :api_version => "V1"
  )

  data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SyntheticsAPI#create_private_location\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#create_synthetics_api_test(body, opts = {}) ⇒ Object

Create an API test.



163
164
165
166
# File 'lib/datadog_api_client/v1/api/synthetics_api.rb', line 163

def create_synthetics_api_test(body, opts = {})
  data, _status_code, _headers = create_synthetics_api_test_with_http_info(body, opts)
  data
end

#create_synthetics_api_test_with_http_info(body, opts = {}) ⇒ Array<(SyntheticsAPITest, Integer, Hash)>

Create an API test.

Create a Synthetic API test.

Parameters:

  • body (SyntheticsAPITest) —

    Details of the test to create.

  • opts (Hash) (defaults to: {}) —

    the optional parameters

Returns:

  • (Array<(SyntheticsAPITest, Integer, Hash)>) —

    SyntheticsAPITest data, response status code and response headers



175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
# File 'lib/datadog_api_client/v1/api/synthetics_api.rb', line 175

def create_synthetics_api_test_with_http_info(body, opts = {})

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SyntheticsAPI.create_synthetics_api_test ...'
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling SyntheticsAPI.create_synthetics_api_test"
  end
  # resource path
  local_var_path = '/api/v1/synthetics/tests/api'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(body)

  # return_type
  return_type = opts[:debug_return_type] || 'SyntheticsAPITest'

  # auth_names
  auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]

  new_options = opts.merge(
    :operation => :create_synthetics_api_test,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type,
    :api_version => "V1"
  )

  data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SyntheticsAPI#create_synthetics_api_test\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#create_synthetics_browser_test(body, opts = {}) ⇒ Object

Create a browser test.



230
231
232
233
# File 'lib/datadog_api_client/v1/api/synthetics_api.rb', line 230

def create_synthetics_browser_test(body, opts = {})
  data, _status_code, _headers = create_synthetics_browser_test_with_http_info(body, opts)
  data
end

#create_synthetics_browser_test_with_http_info(body, opts = {}) ⇒ Array<(SyntheticsBrowserTest, Integer, Hash)>

Create a browser test.

Create a Synthetic browser test.

Parameters:

  • body (SyntheticsBrowserTest) —

    Details of the test to create.

  • opts (Hash) (defaults to: {}) —

    the optional parameters

Returns:

  • (Array<(SyntheticsBrowserTest, Integer, Hash)>) —

    SyntheticsBrowserTest data, response status code and response headers



242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
# File 'lib/datadog_api_client/v1/api/synthetics_api.rb', line 242

def create_synthetics_browser_test_with_http_info(body, opts = {})

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SyntheticsAPI.create_synthetics_browser_test ...'
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling SyntheticsAPI.create_synthetics_browser_test"
  end
  # resource path
  local_var_path = '/api/v1/synthetics/tests/browser'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(body)

  # return_type
  return_type = opts[:debug_return_type] || 'SyntheticsBrowserTest'

  # auth_names
  auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]

  new_options = opts.merge(
    :operation => :create_synthetics_browser_test,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type,
    :api_version => "V1"
  )

  data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SyntheticsAPI#create_synthetics_browser_test\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#create_synthetics_mobile_test(body, opts = {}) ⇒ Object

Create a mobile test.



297
298
299
300
# File 'lib/datadog_api_client/v1/api/synthetics_api.rb', line 297

def create_synthetics_mobile_test(body, opts = {})
  data, _status_code, _headers = create_synthetics_mobile_test_with_http_info(body, opts)
  data
end

#create_synthetics_mobile_test_with_http_info(body, opts = {}) ⇒ Array<(SyntheticsMobileTest, Integer, Hash)>

Create a mobile test.

Create a Synthetic mobile test.

Parameters:

  • body (SyntheticsMobileTest) —

    Details of the test to create.

  • opts (Hash) (defaults to: {}) —

    the optional parameters

Returns:

  • (Array<(SyntheticsMobileTest, Integer, Hash)>) —

    SyntheticsMobileTest data, response status code and response headers



309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
# File 'lib/datadog_api_client/v1/api/synthetics_api.rb', line 309

def create_synthetics_mobile_test_with_http_info(body, opts = {})

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SyntheticsAPI.create_synthetics_mobile_test ...'
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling SyntheticsAPI.create_synthetics_mobile_test"
  end
  # resource path
  local_var_path = '/api/v1/synthetics/tests/mobile'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(body)

  # return_type
  return_type = opts[:debug_return_type] || 'SyntheticsMobileTest'

  # auth_names
  auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]

  new_options = opts.merge(
    :operation => :create_synthetics_mobile_test,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type,
    :api_version => "V1"
  )

  data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SyntheticsAPI#create_synthetics_mobile_test\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#delete_global_variable(variable_id, opts = {}) ⇒ Object

Delete a global variable.



364
365
366
367
# File 'lib/datadog_api_client/v1/api/synthetics_api.rb', line 364

def delete_global_variable(variable_id, opts = {})
  delete_global_variable_with_http_info(variable_id, opts)
  nil
end

#delete_global_variable_with_http_info(variable_id, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Delete a global variable.

Delete a Synthetic global variable.

Parameters:

  • variable_id (String) —

    The ID of the global variable.

  • opts (Hash) (defaults to: {}) —

    the optional parameters

Returns:

  • (Array<(nil, Integer, Hash)>) —

    nil, response status code and response headers



376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
# File 'lib/datadog_api_client/v1/api/synthetics_api.rb', line 376

def delete_global_variable_with_http_info(variable_id, opts = {})

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SyntheticsAPI.delete_global_variable ...'
  end
  # verify the required parameter 'variable_id' is set
  if @api_client.config.client_side_validation && variable_id.nil?
    fail ArgumentError, "Missing the required parameter 'variable_id' when calling SyntheticsAPI.delete_global_variable"
  end
  # resource path
  local_var_path = '/api/v1/synthetics/variables/{variable_id}'.sub('{variable_id}', CGI.escape(variable_id.to_s).gsub('%2F', '/'))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['*/*'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type]

  # auth_names
  auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]

  new_options = opts.merge(
    :operation => :delete_global_variable,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type,
    :api_version => "V1"
  )

  data, status_code, headers = @api_client.call_api(Net::HTTP::Delete, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SyntheticsAPI#delete_global_variable\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#delete_private_location(location_id, opts = {}) ⇒ Object

Delete a private location.



429
430
431
432
# File 'lib/datadog_api_client/v1/api/synthetics_api.rb', line 429

def delete_private_location(location_id, opts = {})
  delete_private_location_with_http_info(location_id, opts)
  nil
end

#delete_private_location_with_http_info(location_id, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Delete a private location.

Delete a Synthetic private location.

Parameters:

  • location_id (String) —

    The ID of the private location.

  • opts (Hash) (defaults to: {}) —

    the optional parameters

Returns:

  • (Array<(nil, Integer, Hash)>) —

    nil, response status code and response headers



441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
# File 'lib/datadog_api_client/v1/api/synthetics_api.rb', line 441

def delete_private_location_with_http_info(location_id, opts = {})

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SyntheticsAPI.delete_private_location ...'
  end
  # verify the required parameter 'location_id' is set
  if @api_client.config.client_side_validation && location_id.nil?
    fail ArgumentError, "Missing the required parameter 'location_id' when calling SyntheticsAPI.delete_private_location"
  end
  # resource path
  local_var_path = '/api/v1/synthetics/private-locations/{location_id}'.sub('{location_id}', CGI.escape(location_id.to_s).gsub('%2F', '/'))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['*/*'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type]

  # auth_names
  auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]

  new_options = opts.merge(
    :operation => :delete_private_location,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type,
    :api_version => "V1"
  )

  data, status_code, headers = @api_client.call_api(Net::HTTP::Delete, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SyntheticsAPI#delete_private_location\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#delete_tests(body, opts = {}) ⇒ Object

Delete tests.



494
495
496
497
# File 'lib/datadog_api_client/v1/api/synthetics_api.rb', line 494

def delete_tests(body, opts = {})
  data, _status_code, _headers = delete_tests_with_http_info(body, opts)
  data
end

#delete_tests_with_http_info(body, opts = {}) ⇒ Array<(SyntheticsDeleteTestsResponse, Integer, Hash)>

Delete tests.

Delete multiple Synthetic tests by ID.

Parameters:

  • body (SyntheticsDeleteTestsPayload) —

    Public ID list of the Synthetic tests to be deleted.

  • opts (Hash) (defaults to: {}) —

    the optional parameters

Returns:



506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
# File 'lib/datadog_api_client/v1/api/synthetics_api.rb', line 506

def delete_tests_with_http_info(body, opts = {})

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SyntheticsAPI.delete_tests ...'
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling SyntheticsAPI.delete_tests"
  end
  # resource path
  local_var_path = '/api/v1/synthetics/tests/delete'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(body)

  # return_type
  return_type = opts[:debug_return_type] || 'SyntheticsDeleteTestsResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]

  new_options = opts.merge(
    :operation => :delete_tests,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type,
    :api_version => "V1"
  )

  data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SyntheticsAPI#delete_tests\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#edit_global_variable(variable_id, body, opts = {}) ⇒ Object

Edit a global variable.



561
562
563
564
# File 'lib/datadog_api_client/v1/api/synthetics_api.rb', line 561

def edit_global_variable(variable_id, body, opts = {})
  data, _status_code, _headers = edit_global_variable_with_http_info(variable_id, body, opts)
  data
end

#edit_global_variable_with_http_info(variable_id, body, opts = {}) ⇒ Array<(SyntheticsGlobalVariable, Integer, Hash)>

Edit a global variable.

Edit a Synthetic global variable.

Parameters:

  • variable_id (String) —

    The ID of the global variable.

  • body (SyntheticsGlobalVariableRequest) —

    Details of the global variable to update.

  • opts (Hash) (defaults to: {}) —

    the optional parameters

Returns:

  • (Array<(SyntheticsGlobalVariable, Integer, Hash)>) —

    SyntheticsGlobalVariable data, response status code and response headers



574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
# File 'lib/datadog_api_client/v1/api/synthetics_api.rb', line 574

def edit_global_variable_with_http_info(variable_id, body, opts = {})

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SyntheticsAPI.edit_global_variable ...'
  end
  # verify the required parameter 'variable_id' is set
  if @api_client.config.client_side_validation && variable_id.nil?
    fail ArgumentError, "Missing the required parameter 'variable_id' when calling SyntheticsAPI.edit_global_variable"
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling SyntheticsAPI.edit_global_variable"
  end
  # resource path
  local_var_path = '/api/v1/synthetics/variables/{variable_id}'.sub('{variable_id}', CGI.escape(variable_id.to_s).gsub('%2F', '/'))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(body)

  # return_type
  return_type = opts[:debug_return_type] || 'SyntheticsGlobalVariable'

  # auth_names
  auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]

  new_options = opts.merge(
    :operation => :edit_global_variable,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type,
    :api_version => "V1"
  )

  data, status_code, headers = @api_client.call_api(Net::HTTP::Put, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SyntheticsAPI#edit_global_variable\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#fetch_uptimes(body, opts = {}) ⇒ Object

Fetch uptime for multiple tests.



633
634
635
636
# File 'lib/datadog_api_client/v1/api/synthetics_api.rb', line 633

def fetch_uptimes(body, opts = {})
  data, _status_code, _headers = fetch_uptimes_with_http_info(body, opts)
  data
end

#fetch_uptimes_with_http_info(body, opts = {}) ⇒ Array<(Array<SyntheticsTestUptime>, Integer, Hash)>

Fetch uptime for multiple tests.

Fetch uptime for multiple Synthetic tests by ID.

Parameters:

  • body (SyntheticsFetchUptimesPayload) —

    Public ID list of the Synthetic tests and timeframe.

  • opts (Hash) (defaults to: {}) —

    the optional parameters

Returns:

  • (Array<(Array<SyntheticsTestUptime>, Integer, Hash)>) —

    Array data, response status code and response headers



645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
# File 'lib/datadog_api_client/v1/api/synthetics_api.rb', line 645

def fetch_uptimes_with_http_info(body, opts = {})

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SyntheticsAPI.fetch_uptimes ...'
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling SyntheticsAPI.fetch_uptimes"
  end
  # resource path
  local_var_path = '/api/v1/synthetics/tests/uptimes'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(body)

  # return_type
  return_type = opts[:debug_return_type] || 'Array<SyntheticsTestUptime>'

  # auth_names
  auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]

  new_options = opts.merge(
    :operation => :fetch_uptimes,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type,
    :api_version => "V1"
  )

  data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SyntheticsAPI#fetch_uptimes\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_api_test(public_id, opts = {}) ⇒ Object

Get an API test.



700
701
702
703
# File 'lib/datadog_api_client/v1/api/synthetics_api.rb', line 700

def get_api_test(public_id, opts = {})
  data, _status_code, _headers = get_api_test_with_http_info(public_id, opts)
  data
end

#get_api_test_latest_results(public_id, opts = {}) ⇒ Object

Get an API test's latest results summaries.



766
767
768
769
# File 'lib/datadog_api_client/v1/api/synthetics_api.rb', line 766

def get_api_test_latest_results(public_id, opts = {})
  data, _status_code, _headers = get_api_test_latest_results_with_http_info(public_id, opts)
  data
end

#get_api_test_latest_results_with_http_info(public_id, opts = {}) ⇒ Array<(SyntheticsGetAPITestLatestResultsResponse, Integer, Hash)>

Get an API test's latest results summaries.

Get the last 150 test results summaries for a given Synthetic API test. To filter tests across your organization by monitor status, state, or tags, use the Search Synthetic tests with filters endpoint.

Parameters:

  • public_id (String) —

    The public ID of the test for which to search results for.

  • opts (Hash) (defaults to: {}) —

    the optional parameters

Options Hash (opts):

  • :from_ts (Integer) —

    Timestamp in milliseconds from which to start querying results.

  • :to_ts (Integer) —

    Timestamp in milliseconds up to which to query results.

  • :probe_dc (Array<String>) —

    Locations for which to query results.

Returns:



783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
# File 'lib/datadog_api_client/v1/api/synthetics_api.rb', line 783

def get_api_test_latest_results_with_http_info(public_id, opts = {})

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SyntheticsAPI.get_api_test_latest_results ...'
  end
  # verify the required parameter 'public_id' is set
  if @api_client.config.client_side_validation && public_id.nil?
    fail ArgumentError, "Missing the required parameter 'public_id' when calling SyntheticsAPI.get_api_test_latest_results"
  end
  # resource path
  local_var_path = '/api/v1/synthetics/tests/{public_id}/results'.sub('{public_id}', CGI.escape(public_id.to_s).gsub('%2F', '/'))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'from_ts'] = opts[:'from_ts'] if !opts[:'from_ts'].nil?
  query_params[:'to_ts'] = opts[:'to_ts'] if !opts[:'to_ts'].nil?
  query_params[:'probe_dc'] = @api_client.build_collection_param(opts[:'probe_dc'], :multi) if !opts[:'probe_dc'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'SyntheticsGetAPITestLatestResultsResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]

  new_options = opts.merge(
    :operation => :get_api_test_latest_results,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type,
    :api_version => "V1"
  )
  new_options[:query_string_normalizer] = HTTParty::Request::NON_RAILS_QUERY_STRING_NORMALIZER

  data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SyntheticsAPI#get_api_test_latest_results\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_api_test_result(public_id, result_id, opts = {}) ⇒ Object

Get an API test result.



840
841
842
843
# File 'lib/datadog_api_client/v1/api/synthetics_api.rb', line 840

def get_api_test_result(public_id, result_id, opts = {})
  data, _status_code, _headers = get_api_test_result_with_http_info(public_id, result_id, opts)
  data
end

#get_api_test_result_with_http_info(public_id, result_id, opts = {}) ⇒ Array<(SyntheticsAPITestResultFull, Integer, Hash)>

Get an API test result.

Get a specific full result from a given Synthetic API test.

Parameters:

  • public_id (String) —

    The public ID of the API test to which the target result belongs.

  • result_id (String) —

    The ID of the result to get.

  • opts (Hash) (defaults to: {}) —

    the optional parameters

Returns:

  • (Array<(SyntheticsAPITestResultFull, Integer, Hash)>) —

    SyntheticsAPITestResultFull data, response status code and response headers



853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
# File 'lib/datadog_api_client/v1/api/synthetics_api.rb', line 853

def get_api_test_result_with_http_info(public_id, result_id, opts = {})

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SyntheticsAPI.get_api_test_result ...'
  end
  # verify the required parameter 'public_id' is set
  if @api_client.config.client_side_validation && public_id.nil?
    fail ArgumentError, "Missing the required parameter 'public_id' when calling SyntheticsAPI.get_api_test_result"
  end
  # verify the required parameter 'result_id' is set
  if @api_client.config.client_side_validation && result_id.nil?
    fail ArgumentError, "Missing the required parameter 'result_id' when calling SyntheticsAPI.get_api_test_result"
  end
  # resource path
  local_var_path = '/api/v1/synthetics/tests/{public_id}/results/{result_id}'.sub('{public_id}', CGI.escape(public_id.to_s).gsub('%2F', '/')).sub('{result_id}', CGI.escape(result_id.to_s).gsub('%2F', '/'))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'SyntheticsAPITestResultFull'

  # auth_names
  auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]

  new_options = opts.merge(
    :operation => :get_api_test_result,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type,
    :api_version => "V1"
  )

  data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SyntheticsAPI#get_api_test_result\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_api_test_with_http_info(public_id, opts = {}) ⇒ Array<(SyntheticsAPITest, Integer, Hash)>

Get an API test.

Get the detailed configuration of one Synthetic API test. For bulk configuration reads, prefer paginated SearchTests requests with include_full_config=true.

Parameters:

  • public_id (String) —

    The public ID of the test to get details from.

  • opts (Hash) (defaults to: {}) —

    the optional parameters

Returns:

  • (Array<(SyntheticsAPITest, Integer, Hash)>) —

    SyntheticsAPITest data, response status code and response headers



713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
# File 'lib/datadog_api_client/v1/api/synthetics_api.rb', line 713

def get_api_test_with_http_info(public_id, opts = {})

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SyntheticsAPI.get_api_test ...'
  end
  # verify the required parameter 'public_id' is set
  if @api_client.config.client_side_validation && public_id.nil?
    fail ArgumentError, "Missing the required parameter 'public_id' when calling SyntheticsAPI.get_api_test"
  end
  # resource path
  local_var_path = '/api/v1/synthetics/tests/api/{public_id}'.sub('{public_id}', CGI.escape(public_id.to_s).gsub('%2F', '/'))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'SyntheticsAPITest'

  # auth_names
  auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]

  new_options = opts.merge(
    :operation => :get_api_test,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type,
    :api_version => "V1"
  )

  data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SyntheticsAPI#get_api_test\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_browser_test(public_id, opts = {}) ⇒ Object

Get a browser test.



910
911
912
913
# File 'lib/datadog_api_client/v1/api/synthetics_api.rb', line 910

def get_browser_test(public_id, opts = {})
  data, _status_code, _headers = get_browser_test_with_http_info(public_id, opts)
  data
end

#get_browser_test_latest_results(public_id, opts = {}) ⇒ Object

Get a browser test's latest results summaries.



976
977
978
979
# File 'lib/datadog_api_client/v1/api/synthetics_api.rb', line 976

def get_browser_test_latest_results(public_id, opts = {})
  data, _status_code, _headers = get_browser_test_latest_results_with_http_info(public_id, opts)
  data
end

#get_browser_test_latest_results_with_http_info(public_id, opts = {}) ⇒ Array<(SyntheticsGetBrowserTestLatestResultsResponse, Integer, Hash)>

Get a browser test's latest results summaries.

Get the last 150 test results summaries for a given Synthetic browser test. To filter tests across your organization by monitor status, state, or tags, use the Search Synthetic tests with filters endpoint.

Parameters:

  • public_id (String) —

    The public ID of the browser test for which to search results for.

  • opts (Hash) (defaults to: {}) —

    the optional parameters

Options Hash (opts):

  • :from_ts (Integer) —

    Timestamp in milliseconds from which to start querying results.

  • :to_ts (Integer) —

    Timestamp in milliseconds up to which to query results.

  • :probe_dc (Array<String>) —

    Locations for which to query results.

Returns:



993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
# File 'lib/datadog_api_client/v1/api/synthetics_api.rb', line 993

def get_browser_test_latest_results_with_http_info(public_id, opts = {})

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SyntheticsAPI.get_browser_test_latest_results ...'
  end
  # verify the required parameter 'public_id' is set
  if @api_client.config.client_side_validation && public_id.nil?
    fail ArgumentError, "Missing the required parameter 'public_id' when calling SyntheticsAPI.get_browser_test_latest_results"
  end
  # resource path
  local_var_path = '/api/v1/synthetics/tests/browser/{public_id}/results'.sub('{public_id}', CGI.escape(public_id.to_s).gsub('%2F', '/'))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'from_ts'] = opts[:'from_ts'] if !opts[:'from_ts'].nil?
  query_params[:'to_ts'] = opts[:'to_ts'] if !opts[:'to_ts'].nil?
  query_params[:'probe_dc'] = @api_client.build_collection_param(opts[:'probe_dc'], :multi) if !opts[:'probe_dc'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'SyntheticsGetBrowserTestLatestResultsResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]

  new_options = opts.merge(
    :operation => :get_browser_test_latest_results,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type,
    :api_version => "V1"
  )
  new_options[:query_string_normalizer] = HTTParty::Request::NON_RAILS_QUERY_STRING_NORMALIZER

  data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SyntheticsAPI#get_browser_test_latest_results\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_browser_test_result(public_id, result_id, opts = {}) ⇒ Object

Get a browser test result.



1050
1051
1052
1053
# File 'lib/datadog_api_client/v1/api/synthetics_api.rb', line 1050

def get_browser_test_result(public_id, result_id, opts = {})
  data, _status_code, _headers = get_browser_test_result_with_http_info(public_id, result_id, opts)
  data
end

#get_browser_test_result_with_http_info(public_id, result_id, opts = {}) ⇒ Array<(SyntheticsBrowserTestResultFull, Integer, Hash)>

Get a browser test result.

Get a specific full result from a given Synthetic browser test.

Parameters:

  • public_id (String) —

    The public ID of the browser test to which the target result belongs.

  • result_id (String) —

    The ID of the result to get.

  • opts (Hash) (defaults to: {}) —

    the optional parameters

Returns:



1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
# File 'lib/datadog_api_client/v1/api/synthetics_api.rb', line 1063

def get_browser_test_result_with_http_info(public_id, result_id, opts = {})

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SyntheticsAPI.get_browser_test_result ...'
  end
  # verify the required parameter 'public_id' is set
  if @api_client.config.client_side_validation && public_id.nil?
    fail ArgumentError, "Missing the required parameter 'public_id' when calling SyntheticsAPI.get_browser_test_result"
  end
  # verify the required parameter 'result_id' is set
  if @api_client.config.client_side_validation && result_id.nil?
    fail ArgumentError, "Missing the required parameter 'result_id' when calling SyntheticsAPI.get_browser_test_result"
  end
  # resource path
  local_var_path = '/api/v1/synthetics/tests/browser/{public_id}/results/{result_id}'.sub('{public_id}', CGI.escape(public_id.to_s).gsub('%2F', '/')).sub('{result_id}', CGI.escape(result_id.to_s).gsub('%2F', '/'))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'SyntheticsBrowserTestResultFull'

  # auth_names
  auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]

  new_options = opts.merge(
    :operation => :get_browser_test_result,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type,
    :api_version => "V1"
  )

  data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SyntheticsAPI#get_browser_test_result\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_browser_test_with_http_info(public_id, opts = {}) ⇒ Array<(SyntheticsBrowserTest, Integer, Hash)>

Get a browser test.

Get the detailed configuration (including steps) associated with a Synthetic browser test.

Parameters:

  • public_id (String) —

    The public ID of the test to get details from.

  • opts (Hash) (defaults to: {}) —

    the optional parameters

Returns:

  • (Array<(SyntheticsBrowserTest, Integer, Hash)>) —

    SyntheticsBrowserTest data, response status code and response headers



923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
# File 'lib/datadog_api_client/v1/api/synthetics_api.rb', line 923

def get_browser_test_with_http_info(public_id, opts = {})

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SyntheticsAPI.get_browser_test ...'
  end
  # verify the required parameter 'public_id' is set
  if @api_client.config.client_side_validation && public_id.nil?
    fail ArgumentError, "Missing the required parameter 'public_id' when calling SyntheticsAPI.get_browser_test"
  end
  # resource path
  local_var_path = '/api/v1/synthetics/tests/browser/{public_id}'.sub('{public_id}', CGI.escape(public_id.to_s).gsub('%2F', '/'))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'SyntheticsBrowserTest'

  # auth_names
  auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]

  new_options = opts.merge(
    :operation => :get_browser_test,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type,
    :api_version => "V1"
  )

  data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SyntheticsAPI#get_browser_test\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_global_variable(variable_id, opts = {}) ⇒ Object

Get a global variable.



1120
1121
1122
1123
# File 'lib/datadog_api_client/v1/api/synthetics_api.rb', line 1120

def get_global_variable(variable_id, opts = {})
  data, _status_code, _headers = get_global_variable_with_http_info(variable_id, opts)
  data
end

#get_global_variable_with_http_info(variable_id, opts = {}) ⇒ Array<(SyntheticsGlobalVariable, Integer, Hash)>

Get a global variable.

Get the detailed configuration of a global variable.

Parameters:

  • variable_id (String) —

    The ID of the global variable.

  • opts (Hash) (defaults to: {}) —

    the optional parameters

Returns:

  • (Array<(SyntheticsGlobalVariable, Integer, Hash)>) —

    SyntheticsGlobalVariable data, response status code and response headers



1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
# File 'lib/datadog_api_client/v1/api/synthetics_api.rb', line 1132

def get_global_variable_with_http_info(variable_id, opts = {})

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SyntheticsAPI.get_global_variable ...'
  end
  # verify the required parameter 'variable_id' is set
  if @api_client.config.client_side_validation && variable_id.nil?
    fail ArgumentError, "Missing the required parameter 'variable_id' when calling SyntheticsAPI.get_global_variable"
  end
  # resource path
  local_var_path = '/api/v1/synthetics/variables/{variable_id}'.sub('{variable_id}', CGI.escape(variable_id.to_s).gsub('%2F', '/'))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'SyntheticsGlobalVariable'

  # auth_names
  auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]

  new_options = opts.merge(
    :operation => :get_global_variable,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type,
    :api_version => "V1"
  )

  data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SyntheticsAPI#get_global_variable\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_mobile_test(public_id, opts = {}) ⇒ Object

Get a mobile test.



1185
1186
1187
1188
# File 'lib/datadog_api_client/v1/api/synthetics_api.rb', line 1185

def get_mobile_test(public_id, opts = {})
  data, _status_code, _headers = get_mobile_test_with_http_info(public_id, opts)
  data
end

#get_mobile_test_with_http_info(public_id, opts = {}) ⇒ Array<(SyntheticsMobileTest, Integer, Hash)>

Get a mobile test.

Get the detailed configuration associated with a Synthetic mobile test.

Parameters:

  • public_id (String) —

    The public ID of the test to get details from.

  • opts (Hash) (defaults to: {}) —

    the optional parameters

Returns:

  • (Array<(SyntheticsMobileTest, Integer, Hash)>) —

    SyntheticsMobileTest data, response status code and response headers



1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
# File 'lib/datadog_api_client/v1/api/synthetics_api.rb', line 1198

def get_mobile_test_with_http_info(public_id, opts = {})

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SyntheticsAPI.get_mobile_test ...'
  end
  # verify the required parameter 'public_id' is set
  if @api_client.config.client_side_validation && public_id.nil?
    fail ArgumentError, "Missing the required parameter 'public_id' when calling SyntheticsAPI.get_mobile_test"
  end
  # resource path
  local_var_path = '/api/v1/synthetics/tests/mobile/{public_id}'.sub('{public_id}', CGI.escape(public_id.to_s).gsub('%2F', '/'))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'SyntheticsMobileTest'

  # auth_names
  auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]

  new_options = opts.merge(
    :operation => :get_mobile_test,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type,
    :api_version => "V1"
  )

  data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SyntheticsAPI#get_mobile_test\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_private_location(location_id, opts = {}) ⇒ Object

Get a private location.



1251
1252
1253
1254
# File 'lib/datadog_api_client/v1/api/synthetics_api.rb', line 1251

def get_private_location(location_id, opts = {})
  data, _status_code, _headers = get_private_location_with_http_info(location_id, opts)
  data
end

#get_private_location_with_http_info(location_id, opts = {}) ⇒ Array<(SyntheticsPrivateLocation, Integer, Hash)>

Get a private location.

Get a Synthetic private location.

Parameters:

  • location_id (String) —

    The ID of the private location.

  • opts (Hash) (defaults to: {}) —

    the optional parameters

Returns:

  • (Array<(SyntheticsPrivateLocation, Integer, Hash)>) —

    SyntheticsPrivateLocation data, response status code and response headers



1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
# File 'lib/datadog_api_client/v1/api/synthetics_api.rb', line 1263

def get_private_location_with_http_info(location_id, opts = {})

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SyntheticsAPI.get_private_location ...'
  end
  # verify the required parameter 'location_id' is set
  if @api_client.config.client_side_validation && location_id.nil?
    fail ArgumentError, "Missing the required parameter 'location_id' when calling SyntheticsAPI.get_private_location"
  end
  # resource path
  local_var_path = '/api/v1/synthetics/private-locations/{location_id}'.sub('{location_id}', CGI.escape(location_id.to_s).gsub('%2F', '/'))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'SyntheticsPrivateLocation'

  # auth_names
  auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]

  new_options = opts.merge(
    :operation => :get_private_location,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type,
    :api_version => "V1"
  )

  data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SyntheticsAPI#get_private_location\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_synthetics_ci_batch(batch_id, opts = {}) ⇒ Object

Get details of batch.



1316
1317
1318
1319
# File 'lib/datadog_api_client/v1/api/synthetics_api.rb', line 1316

def get_synthetics_ci_batch(batch_id, opts = {})
  data, _status_code, _headers = get_synthetics_ci_batch_with_http_info(batch_id, opts)
  data
end

#get_synthetics_ci_batch_with_http_info(batch_id, opts = {}) ⇒ Array<(SyntheticsBatchDetails, Integer, Hash)>

Get details of batch.

Get a batch's updated details.

Parameters:

  • batch_id (String) —

    The ID of the batch.

  • opts (Hash) (defaults to: {}) —

    the optional parameters

Returns:

  • (Array<(SyntheticsBatchDetails, Integer, Hash)>) —

    SyntheticsBatchDetails data, response status code and response headers



1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
# File 'lib/datadog_api_client/v1/api/synthetics_api.rb', line 1328

def get_synthetics_ci_batch_with_http_info(batch_id, opts = {})

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SyntheticsAPI.get_synthetics_ci_batch ...'
  end
  # verify the required parameter 'batch_id' is set
  if @api_client.config.client_side_validation && batch_id.nil?
    fail ArgumentError, "Missing the required parameter 'batch_id' when calling SyntheticsAPI.get_synthetics_ci_batch"
  end
  # resource path
  local_var_path = '/api/v1/synthetics/ci/batch/{batch_id}'.sub('{batch_id}', CGI.escape(batch_id.to_s).gsub('%2F', '/'))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'SyntheticsBatchDetails'

  # auth_names
  auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]

  new_options = opts.merge(
    :operation => :get_synthetics_ci_batch,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type,
    :api_version => "V1"
  )

  data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SyntheticsAPI#get_synthetics_ci_batch\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_synthetics_default_locations(opts = {}) ⇒ Object

Get the default locations.



1381
1382
1383
1384
# File 'lib/datadog_api_client/v1/api/synthetics_api.rb', line 1381

def get_synthetics_default_locations(opts = {})
  data, _status_code, _headers = get_synthetics_default_locations_with_http_info(opts)
  data
end

#get_synthetics_default_locations_with_http_info(opts = {}) ⇒ Array<(Array<String>, Integer, Hash)>

Get the default locations.

Get the default locations settings.

Parameters:

  • opts (Hash) (defaults to: {}) —

    the optional parameters

Returns:

  • (Array<(Array<String>, Integer, Hash)>) —

    Array data, response status code and response headers



1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
# File 'lib/datadog_api_client/v1/api/synthetics_api.rb', line 1392

def get_synthetics_default_locations_with_http_info(opts = {})

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SyntheticsAPI.get_synthetics_default_locations ...'
  end
  # resource path
  local_var_path = '/api/v1/synthetics/settings/default_locations'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'Array<String>'

  # auth_names
  auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]

  new_options = opts.merge(
    :operation => :get_synthetics_default_locations,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type,
    :api_version => "V1"
  )

  data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SyntheticsAPI#get_synthetics_default_locations\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_test(public_id, opts = {}) ⇒ Object

Get a test configuration.



1441
1442
1443
1444
# File 'lib/datadog_api_client/v1/api/synthetics_api.rb', line 1441

def get_test(public_id, opts = {})
  data, _status_code, _headers = get_test_with_http_info(public_id, opts)
  data
end

#get_test_with_http_info(public_id, opts = {}) ⇒ Array<(SyntheticsTestDetailsWithoutSteps, Integer, Hash)>

Get a test configuration.

Get the detailed configuration associated with a Synthetic test.

Parameters:

  • public_id (String) —

    The public ID of the test to get details from.

  • opts (Hash) (defaults to: {}) —

    the optional parameters

Returns:



1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
# File 'lib/datadog_api_client/v1/api/synthetics_api.rb', line 1453

def get_test_with_http_info(public_id, opts = {})

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SyntheticsAPI.get_test ...'
  end
  # verify the required parameter 'public_id' is set
  if @api_client.config.client_side_validation && public_id.nil?
    fail ArgumentError, "Missing the required parameter 'public_id' when calling SyntheticsAPI.get_test"
  end
  # resource path
  local_var_path = '/api/v1/synthetics/tests/{public_id}'.sub('{public_id}', CGI.escape(public_id.to_s).gsub('%2F', '/'))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'SyntheticsTestDetailsWithoutSteps'

  # auth_names
  auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]

  new_options = opts.merge(
    :operation => :get_test,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type,
    :api_version => "V1"
  )

  data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SyntheticsAPI#get_test\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_global_variables(opts = {}) ⇒ Object

Get all global variables.



1506
1507
1508
1509
# File 'lib/datadog_api_client/v1/api/synthetics_api.rb', line 1506

def list_global_variables(opts = {})
  data, _status_code, _headers = list_global_variables_with_http_info(opts)
  data
end

#list_global_variables_with_http_info(opts = {}) ⇒ Array<(SyntheticsListGlobalVariablesResponse, Integer, Hash)>

Get all global variables.

Get the list of all Synthetic global variables.

Parameters:

  • opts (Hash) (defaults to: {}) —

    the optional parameters

Returns:



1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
# File 'lib/datadog_api_client/v1/api/synthetics_api.rb', line 1517

def list_global_variables_with_http_info(opts = {})

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SyntheticsAPI.list_global_variables ...'
  end
  # resource path
  local_var_path = '/api/v1/synthetics/variables'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'SyntheticsListGlobalVariablesResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]

  new_options = opts.merge(
    :operation => :list_global_variables,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type,
    :api_version => "V1"
  )

  data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SyntheticsAPI#list_global_variables\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_locations(opts = {}) ⇒ Object

Get all locations (public and private).



1566
1567
1568
1569
# File 'lib/datadog_api_client/v1/api/synthetics_api.rb', line 1566

def list_locations(opts = {})
  data, _status_code, _headers = list_locations_with_http_info(opts)
  data
end

#list_locations_with_http_info(opts = {}) ⇒ Array<(SyntheticsLocations, Integer, Hash)>

Get all locations (public and private).

Get the list of public and private locations available for Synthetic tests. No arguments required.

Parameters:

  • opts (Hash) (defaults to: {}) —

    the optional parameters

Returns:

  • (Array<(SyntheticsLocations, Integer, Hash)>) —

    SyntheticsLocations data, response status code and response headers



1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
# File 'lib/datadog_api_client/v1/api/synthetics_api.rb', line 1578

def list_locations_with_http_info(opts = {})

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SyntheticsAPI.list_locations ...'
  end
  # resource path
  local_var_path = '/api/v1/synthetics/locations'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'SyntheticsLocations'

  # auth_names
  auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]

  new_options = opts.merge(
    :operation => :list_locations,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type,
    :api_version => "V1"
  )

  data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SyntheticsAPI#list_locations\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_tests(opts = {}) ⇒ Object

Get the list of all Synthetic tests.



1627
1628
1629
1630
# File 'lib/datadog_api_client/v1/api/synthetics_api.rb', line 1627

def list_tests(opts = {})
  data, _status_code, _headers = list_tests_with_http_info(opts)
  data
end

#list_tests_with_http_info(opts = {}) ⇒ Array<(SyntheticsListTestsResponse, Integer, Hash)>

Get the list of all Synthetic tests.

Get the list of all Synthetic tests. To use query filters or get monitor-health metadata, use the Search Synthetic tests with filters endpoint.

Parameters:

  • opts (Hash) (defaults to: {}) —

    the optional parameters

Options Hash (opts):

  • :page_size (Integer) —

    Used for pagination. The number of tests returned in the page.

  • :page_number (Integer) —

    Used for pagination. Which page you want to retrieve. Starts at zero.

Returns:

  • (Array<(SyntheticsListTestsResponse, Integer, Hash)>) —

    SyntheticsListTestsResponse data, response status code and response headers



1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
# File 'lib/datadog_api_client/v1/api/synthetics_api.rb', line 1641

def list_tests_with_http_info(opts = {})

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SyntheticsAPI.list_tests ...'
  end
  # resource path
  local_var_path = '/api/v1/synthetics/tests'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?
  query_params[:'page_number'] = opts[:'page_number'] if !opts[:'page_number'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'SyntheticsListTestsResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]

  new_options = opts.merge(
    :operation => :list_tests,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type,
    :api_version => "V1"
  )

  data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SyntheticsAPI#list_tests\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_tests_with_pagination(opts = {}) {|SyntheticsTestDetailsWithoutSteps| ... } ⇒ Object

Get the list of all Synthetic tests.

Provide a paginated version of #list_tests, returning all items.

To use it you need to use a block: list_tests_with_pagination { |item| p item }

Yields:



1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
# File 'lib/datadog_api_client/v1/api/synthetics_api.rb', line 1696

def list_tests_with_pagination(opts = {})
    api_version = "V1"
    page_size = @api_client.get_attribute_from_path(opts, "page_size", 100)
    @api_client.set_attribute_from_path(api_version, opts, "page_size", Integer, page_size)
    @api_client.set_attribute_from_path(api_version, opts, "page_number", Integer, 0)
    while true do
        response = list_tests(opts)
        @api_client.get_attribute_from_path(response, "tests").each { |item| yield(item) }
        if @api_client.get_attribute_from_path(response, "tests").length < page_size
          break
        end
        @api_client.set_attribute_from_path(api_version, opts, "page_number", Integer, @api_client.get_attribute_from_path(opts, "page_number", 0) + 1)
    end
end

#patch_test(public_id, body, opts = {}) ⇒ Object

Patch a Synthetic test.



1714
1715
1716
1717
# File 'lib/datadog_api_client/v1/api/synthetics_api.rb', line 1714

def patch_test(public_id, body, opts = {})
  data, _status_code, _headers = patch_test_with_http_info(public_id, body, opts)
  data
end

#patch_test_with_http_info(public_id, body, opts = {}) ⇒ Array<(SyntheticsTestDetails, Integer, Hash)>

Patch a Synthetic test.

Patch the configuration of a Synthetic test with partial data.

Parameters:

  • public_id (String) —

    The public ID of the test to patch.

  • body (SyntheticsPatchTestBody) —

    JSON Patch compliant list of operations

  • opts (Hash) (defaults to: {}) —

    the optional parameters

Returns:

  • (Array<(SyntheticsTestDetails, Integer, Hash)>) —

    SyntheticsTestDetails data, response status code and response headers



1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
# File 'lib/datadog_api_client/v1/api/synthetics_api.rb', line 1727

def patch_test_with_http_info(public_id, body, opts = {})

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SyntheticsAPI.patch_test ...'
  end
  # verify the required parameter 'public_id' is set
  if @api_client.config.client_side_validation && public_id.nil?
    fail ArgumentError, "Missing the required parameter 'public_id' when calling SyntheticsAPI.patch_test"
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling SyntheticsAPI.patch_test"
  end
  # resource path
  local_var_path = '/api/v1/synthetics/tests/{public_id}'.sub('{public_id}', CGI.escape(public_id.to_s).gsub('%2F', '/'))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(body)

  # return_type
  return_type = opts[:debug_return_type] || 'SyntheticsTestDetails'

  # auth_names
  auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]

  new_options = opts.merge(
    :operation => :patch_test,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type,
    :api_version => "V1"
  )

  data, status_code, headers = @api_client.call_api(Net::HTTP::Patch, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SyntheticsAPI#patch_test\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#search_tests(opts = {}) ⇒ Object

Search Synthetic tests with filters.



1786
1787
1788
1789
# File 'lib/datadog_api_client/v1/api/synthetics_api.rb', line 1786

def search_tests(opts = {})
  data, _status_code, _headers = search_tests_with_http_info(opts)
  data
end

#search_tests_with_http_info(opts = {}) ⇒ Array<(SyntheticsListTestsResponse, Integer, Hash)>

Search Synthetic tests with filters.

Search for Synthetic tests that match the text query. The response includes monitor health, facet counts, and pagination metadata. total can report 10,000 even when more tests match. Do not treat that value as an exact total. Access restrictions can return fewer tests than count, or none. Increase start by count for each page. In TypeScript, response-level total and facets, and test-level monitor_status (known values: OK, Alert, No Data), are available through additionalProperties.

Parameters:

  • opts (Hash) (defaults to: {}) —

    the optional parameters

Options Hash (opts):

  • :text (String) —

    Search query. Space-separated terms are combined with AND. - status:Alert or status:OK: monitor health. - state:live or state:paused: whether a test runs. - type:api, type:browser, or type:mobile: test type. - team:<name>, <key>:<value>, or tag:<key>:<value>: tags, for example team:dashboards env:prod. - test_criticality:(high OR very_high): tests with high or very high criticality. - Free text, for example checkout: test names. status:Alert state:live matches running tests with alerting monitors. Paused tests can remain alerting.

  • :include_full_config (Boolean) —

    If true, include the full configuration, including assertions and multistep API steps. If false or omitted, config contains only a reduced request summary. In TypeScript, multistep steps are in test.config?.additionalProperties?.steps.

  • :facets_only (Boolean) —

    If true, return facet counts with an empty tests array and total set to 0.

  • :start (Integer) —

    Zero-based result offset. Increase by count for each page, even if fewer tests are returned.

  • :count (Integer) —

    Maximum number of tests per page. Access restrictions can return fewer tests or none, even when more tests match.

  • :sort (String) —

    Sort by <field>,<direction>, where direction is asc or desc (for example, name,asc). Supported fields include name, status, tags, triggered, created, modified, priority, muted_elapsed, muted_left, creator, type, domain, and triage_score. test_criticality is an alias for triage_score. triggered,desc sorts by the most recent monitor trigger time (last_triggered_ts).

Returns:

  • (Array<(SyntheticsListTestsResponse, Integer, Hash)>) —

    SyntheticsListTestsResponse data, response status code and response headers



1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
# File 'lib/datadog_api_client/v1/api/synthetics_api.rb', line 1808

def search_tests_with_http_info(opts = {})

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SyntheticsAPI.search_tests ...'
  end
  # resource path
  local_var_path = '/api/v1/synthetics/tests/search'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'text'] = opts[:'text'] if !opts[:'text'].nil?
  query_params[:'include_full_config'] = opts[:'include_full_config'] if !opts[:'include_full_config'].nil?
  query_params[:'facets_only'] = opts[:'facets_only'] if !opts[:'facets_only'].nil?
  query_params[:'start'] = opts[:'start'] if !opts[:'start'].nil?
  query_params[:'count'] = opts[:'count'] if !opts[:'count'].nil?
  query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'SyntheticsListTestsResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]

  new_options = opts.merge(
    :operation => :search_tests,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type,
    :api_version => "V1"
  )

  data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SyntheticsAPI#search_tests\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#trigger_ci_tests(body, opts = {}) ⇒ Object

Trigger tests from CI/CD pipelines.



1863
1864
1865
1866
# File 'lib/datadog_api_client/v1/api/synthetics_api.rb', line 1863

def trigger_ci_tests(body, opts = {})
  data, _status_code, _headers = trigger_ci_tests_with_http_info(body, opts)
  data
end

#trigger_ci_tests_with_http_info(body, opts = {}) ⇒ Array<(SyntheticsTriggerCITestsResponse, Integer, Hash)>

Trigger tests from CI/CD pipelines.

Trigger a set of Synthetic tests for continuous integration.

Parameters:

  • body (SyntheticsCITestBody) —

    Details of the test to trigger.

  • opts (Hash) (defaults to: {}) —

    the optional parameters

Returns:



1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
# File 'lib/datadog_api_client/v1/api/synthetics_api.rb', line 1875

def trigger_ci_tests_with_http_info(body, opts = {})

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SyntheticsAPI.trigger_ci_tests ...'
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling SyntheticsAPI.trigger_ci_tests"
  end
  # resource path
  local_var_path = '/api/v1/synthetics/tests/trigger/ci'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(body)

  # return_type
  return_type = opts[:debug_return_type] || 'SyntheticsTriggerCITestsResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]

  new_options = opts.merge(
    :operation => :trigger_ci_tests,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type,
    :api_version => "V1"
  )

  data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SyntheticsAPI#trigger_ci_tests\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#trigger_tests(body, opts = {}) ⇒ Object

Trigger Synthetic tests.



1930
1931
1932
1933
# File 'lib/datadog_api_client/v1/api/synthetics_api.rb', line 1930

def trigger_tests(body, opts = {})
  data, _status_code, _headers = trigger_tests_with_http_info(body, opts)
  data
end

#trigger_tests_with_http_info(body, opts = {}) ⇒ Array<(SyntheticsTriggerCITestsResponse, Integer, Hash)>

Trigger Synthetic tests.

Trigger a set of Synthetic tests.

Parameters:

  • body (SyntheticsTriggerBody) —

    The identifiers of the tests to trigger.

  • opts (Hash) (defaults to: {}) —

    the optional parameters

Returns:



1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
# File 'lib/datadog_api_client/v1/api/synthetics_api.rb', line 1942

def trigger_tests_with_http_info(body, opts = {})

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SyntheticsAPI.trigger_tests ...'
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling SyntheticsAPI.trigger_tests"
  end
  # resource path
  local_var_path = '/api/v1/synthetics/tests/trigger'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(body)

  # return_type
  return_type = opts[:debug_return_type] || 'SyntheticsTriggerCITestsResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]

  new_options = opts.merge(
    :operation => :trigger_tests,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type,
    :api_version => "V1"
  )

  data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SyntheticsAPI#trigger_tests\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_api_test(public_id, body, opts = {}) ⇒ Object

Edit an API test.



1997
1998
1999
2000
# File 'lib/datadog_api_client/v1/api/synthetics_api.rb', line 1997

def update_api_test(public_id, body, opts = {})
  data, _status_code, _headers = update_api_test_with_http_info(public_id, body, opts)
  data
end

#update_api_test_with_http_info(public_id, body, opts = {}) ⇒ Array<(SyntheticsAPITest, Integer, Hash)>

Edit an API test.

Edit the configuration of a Synthetic API test.

Parameters:

  • public_id (String) —

    The public ID of the test to get details from.

  • body (SyntheticsAPITest) —

    New test details to be saved.

  • opts (Hash) (defaults to: {}) —

    the optional parameters

Returns:

  • (Array<(SyntheticsAPITest, Integer, Hash)>) —

    SyntheticsAPITest data, response status code and response headers



2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
# File 'lib/datadog_api_client/v1/api/synthetics_api.rb', line 2010

def update_api_test_with_http_info(public_id, body, opts = {})

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SyntheticsAPI.update_api_test ...'
  end
  # verify the required parameter 'public_id' is set
  if @api_client.config.client_side_validation && public_id.nil?
    fail ArgumentError, "Missing the required parameter 'public_id' when calling SyntheticsAPI.update_api_test"
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling SyntheticsAPI.update_api_test"
  end
  # resource path
  local_var_path = '/api/v1/synthetics/tests/api/{public_id}'.sub('{public_id}', CGI.escape(public_id.to_s).gsub('%2F', '/'))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(body)

  # return_type
  return_type = opts[:debug_return_type] || 'SyntheticsAPITest'

  # auth_names
  auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]

  new_options = opts.merge(
    :operation => :update_api_test,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type,
    :api_version => "V1"
  )

  data, status_code, headers = @api_client.call_api(Net::HTTP::Put, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SyntheticsAPI#update_api_test\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_browser_test(public_id, body, opts = {}) ⇒ Object

Edit a browser test.



2069
2070
2071
2072
# File 'lib/datadog_api_client/v1/api/synthetics_api.rb', line 2069

def update_browser_test(public_id, body, opts = {})
  data, _status_code, _headers = update_browser_test_with_http_info(public_id, body, opts)
  data
end

#update_browser_test_with_http_info(public_id, body, opts = {}) ⇒ Array<(SyntheticsBrowserTest, Integer, Hash)>

Edit a browser test.

Edit the configuration of a Synthetic browser test.

Parameters:

  • public_id (String) —

    The public ID of the test to edit.

  • body (SyntheticsBrowserTest) —

    New test details to be saved.

  • opts (Hash) (defaults to: {}) —

    the optional parameters

Returns:

  • (Array<(SyntheticsBrowserTest, Integer, Hash)>) —

    SyntheticsBrowserTest data, response status code and response headers



2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
# File 'lib/datadog_api_client/v1/api/synthetics_api.rb', line 2082

def update_browser_test_with_http_info(public_id, body, opts = {})

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SyntheticsAPI.update_browser_test ...'
  end
  # verify the required parameter 'public_id' is set
  if @api_client.config.client_side_validation && public_id.nil?
    fail ArgumentError, "Missing the required parameter 'public_id' when calling SyntheticsAPI.update_browser_test"
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling SyntheticsAPI.update_browser_test"
  end
  # resource path
  local_var_path = '/api/v1/synthetics/tests/browser/{public_id}'.sub('{public_id}', CGI.escape(public_id.to_s).gsub('%2F', '/'))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(body)

  # return_type
  return_type = opts[:debug_return_type] || 'SyntheticsBrowserTest'

  # auth_names
  auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]

  new_options = opts.merge(
    :operation => :update_browser_test,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type,
    :api_version => "V1"
  )

  data, status_code, headers = @api_client.call_api(Net::HTTP::Put, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SyntheticsAPI#update_browser_test\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_mobile_test(public_id, body, opts = {}) ⇒ Object

Edit a mobile test.



2141
2142
2143
2144
# File 'lib/datadog_api_client/v1/api/synthetics_api.rb', line 2141

def update_mobile_test(public_id, body, opts = {})
  data, _status_code, _headers = update_mobile_test_with_http_info(public_id, body, opts)
  data
end

#update_mobile_test_with_http_info(public_id, body, opts = {}) ⇒ Array<(SyntheticsMobileTest, Integer, Hash)>

Edit a mobile test.

Edit the configuration of a Synthetic mobile test.

Parameters:

  • public_id (String) —

    The public ID of the test to get details from.

  • body (SyntheticsMobileTest) —

    New test details to be saved.

  • opts (Hash) (defaults to: {}) —

    the optional parameters

Returns:

  • (Array<(SyntheticsMobileTest, Integer, Hash)>) —

    SyntheticsMobileTest data, response status code and response headers



2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
# File 'lib/datadog_api_client/v1/api/synthetics_api.rb', line 2154

def update_mobile_test_with_http_info(public_id, body, opts = {})

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SyntheticsAPI.update_mobile_test ...'
  end
  # verify the required parameter 'public_id' is set
  if @api_client.config.client_side_validation && public_id.nil?
    fail ArgumentError, "Missing the required parameter 'public_id' when calling SyntheticsAPI.update_mobile_test"
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling SyntheticsAPI.update_mobile_test"
  end
  # resource path
  local_var_path = '/api/v1/synthetics/tests/mobile/{public_id}'.sub('{public_id}', CGI.escape(public_id.to_s).gsub('%2F', '/'))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(body)

  # return_type
  return_type = opts[:debug_return_type] || 'SyntheticsMobileTest'

  # auth_names
  auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]

  new_options = opts.merge(
    :operation => :update_mobile_test,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type,
    :api_version => "V1"
  )

  data, status_code, headers = @api_client.call_api(Net::HTTP::Put, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SyntheticsAPI#update_mobile_test\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_private_location(location_id, body, opts = {}) ⇒ Object

Edit a private location.



2213
2214
2215
2216
# File 'lib/datadog_api_client/v1/api/synthetics_api.rb', line 2213

def update_private_location(location_id, body, opts = {})
  data, _status_code, _headers = update_private_location_with_http_info(location_id, body, opts)
  data
end

#update_private_location_with_http_info(location_id, body, opts = {}) ⇒ Array<(SyntheticsPrivateLocation, Integer, Hash)>

Edit a private location.

Edit a Synthetic private location.

Parameters:

  • location_id (String) —

    The ID of the private location.

  • body (SyntheticsPrivateLocation) —

    Details of the private location to be updated.

  • opts (Hash) (defaults to: {}) —

    the optional parameters

Returns:

  • (Array<(SyntheticsPrivateLocation, Integer, Hash)>) —

    SyntheticsPrivateLocation data, response status code and response headers



2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
# File 'lib/datadog_api_client/v1/api/synthetics_api.rb', line 2226

def update_private_location_with_http_info(location_id, body, opts = {})

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SyntheticsAPI.update_private_location ...'
  end
  # verify the required parameter 'location_id' is set
  if @api_client.config.client_side_validation && location_id.nil?
    fail ArgumentError, "Missing the required parameter 'location_id' when calling SyntheticsAPI.update_private_location"
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling SyntheticsAPI.update_private_location"
  end
  # resource path
  local_var_path = '/api/v1/synthetics/private-locations/{location_id}'.sub('{location_id}', CGI.escape(location_id.to_s).gsub('%2F', '/'))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(body)

  # return_type
  return_type = opts[:debug_return_type] || 'SyntheticsPrivateLocation'

  # auth_names
  auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]

  new_options = opts.merge(
    :operation => :update_private_location,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type,
    :api_version => "V1"
  )

  data, status_code, headers = @api_client.call_api(Net::HTTP::Put, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SyntheticsAPI#update_private_location\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_test_pause_status(public_id, body, opts = {}) ⇒ Object

Pause or start a test.



2285
2286
2287
2288
# File 'lib/datadog_api_client/v1/api/synthetics_api.rb', line 2285

def update_test_pause_status(public_id, body, opts = {})
  data, _status_code, _headers = update_test_pause_status_with_http_info(public_id, body, opts)
  data
end

#update_test_pause_status_with_http_info(public_id, body, opts = {}) ⇒ Array<(Boolean, Integer, Hash)>

Pause or start a test.

Pause or start a Synthetic test by changing the status.

Parameters:

  • public_id (String) —

    The public ID of the Synthetic test to update.

  • body (SyntheticsUpdateTestPauseStatusPayload) —

    Status to set the given Synthetic test to.

  • opts (Hash) (defaults to: {}) —

    the optional parameters

Returns:

  • (Array<(Boolean, Integer, Hash)>) —

    Boolean data, response status code and response headers



2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
# File 'lib/datadog_api_client/v1/api/synthetics_api.rb', line 2298

def update_test_pause_status_with_http_info(public_id, body, opts = {})

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SyntheticsAPI.update_test_pause_status ...'
  end
  # verify the required parameter 'public_id' is set
  if @api_client.config.client_side_validation && public_id.nil?
    fail ArgumentError, "Missing the required parameter 'public_id' when calling SyntheticsAPI.update_test_pause_status"
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling SyntheticsAPI.update_test_pause_status"
  end
  # resource path
  local_var_path = '/api/v1/synthetics/tests/{public_id}/status'.sub('{public_id}', CGI.escape(public_id.to_s).gsub('%2F', '/'))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(body)

  # return_type
  return_type = opts[:debug_return_type] || 'Boolean'

  # auth_names
  auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]

  new_options = opts.merge(
    :operation => :update_test_pause_status,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type,
    :api_version => "V1"
  )

  data, status_code, headers = @api_client.call_api(Net::HTTP::Put, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SyntheticsAPI#update_test_pause_status\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end