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 = APIClient.default)
  @api_client = api_client
end

Instance Attribute Details

#api_clientObject

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.



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

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:

  • body (SyntheticsGlobalVariable)

    Details of the global variable to create.

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

    the optional parameters

Returns:

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

    SyntheticsGlobalVariable data, response status code and response headers



40
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
92
93
94
95
96
97
98
# File 'lib/datadog_api_client/v1/api/synthetics_api.rb', line 40

def create_global_variable_with_http_info(body, opts = {})

  if @api_client.config.unstable_operations.has_key?(:create_global_variable)
    unstable_enabled = @api_client.config.unstable_operations[:create_global_variable]
    if unstable_enabled
      @api_client.config.logger.warn format("Using unstable operation '%s'", "create_global_variable")
    else
      raise APIError.new(message: format("Unstable operation '%s' is disabled", "create_global_variable"))
    end
  end

  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] || [:AuthZ, :apiKeyAuth, :appKeyAuth]

  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
  )

  data, status_code, headers = @api_client.call_api(: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.



105
106
107
108
# File 'lib/datadog_api_client/v1/api/synthetics_api.rb', line 105

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:



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
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
# File 'lib/datadog_api_client/v1/api/synthetics_api.rb', line 115

def create_private_location_with_http_info(body, opts = {})

  if @api_client.config.unstable_operations.has_key?(:create_private_location)
    unstable_enabled = @api_client.config.unstable_operations[:create_private_location]
    if unstable_enabled
      @api_client.config.logger.warn format("Using unstable operation '%s'", "create_private_location")
    else
      raise APIError.new(message: format("Unstable operation '%s' is disabled", "create_private_location"))
    end
  end

  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] || [:AuthZ, :apiKeyAuth, :appKeyAuth]

  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
  )

  data, status_code, headers = @api_client.call_api(: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.



180
181
182
183
# File 'lib/datadog_api_client/v1/api/synthetics_api.rb', line 180

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



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
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
# File 'lib/datadog_api_client/v1/api/synthetics_api.rb', line 190

def create_synthetics_api_test_with_http_info(body, opts = {})

  if @api_client.config.unstable_operations.has_key?(:create_synthetics_api_test)
    unstable_enabled = @api_client.config.unstable_operations[:create_synthetics_api_test]
    if unstable_enabled
      @api_client.config.logger.warn format("Using unstable operation '%s'", "create_synthetics_api_test")
    else
      raise APIError.new(message: format("Unstable operation '%s' is disabled", "create_synthetics_api_test"))
    end
  end

  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] || [:AuthZ, :apiKeyAuth, :appKeyAuth]

  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
  )

  data, status_code, headers = @api_client.call_api(: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.



255
256
257
258
# File 'lib/datadog_api_client/v1/api/synthetics_api.rb', line 255

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



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
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
# File 'lib/datadog_api_client/v1/api/synthetics_api.rb', line 265

def create_synthetics_browser_test_with_http_info(body, opts = {})

  if @api_client.config.unstable_operations.has_key?(:create_synthetics_browser_test)
    unstable_enabled = @api_client.config.unstable_operations[:create_synthetics_browser_test]
    if unstable_enabled
      @api_client.config.logger.warn format("Using unstable operation '%s'", "create_synthetics_browser_test")
    else
      raise APIError.new(message: format("Unstable operation '%s' is disabled", "create_synthetics_browser_test"))
    end
  end

  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] || [:AuthZ, :apiKeyAuth, :appKeyAuth]

  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
  )

  data, status_code, headers = @api_client.call_api(: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

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

Delete a global variable.



330
331
332
333
# File 'lib/datadog_api_client/v1/api/synthetics_api.rb', line 330

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



340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
# File 'lib/datadog_api_client/v1/api/synthetics_api.rb', line 340

def delete_global_variable_with_http_info(variable_id, opts = {})

  if @api_client.config.unstable_operations.has_key?(:delete_global_variable)
    unstable_enabled = @api_client.config.unstable_operations[:delete_global_variable]
    if unstable_enabled
      @api_client.config.logger.warn format("Using unstable operation '%s'", "delete_global_variable")
    else
      raise APIError.new(message: format("Unstable operation '%s' is disabled", "delete_global_variable"))
    end
  end

  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))

  # 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]

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

  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
  )

  data, status_code, headers = @api_client.call_api(: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.



403
404
405
406
# File 'lib/datadog_api_client/v1/api/synthetics_api.rb', line 403

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



413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
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
# File 'lib/datadog_api_client/v1/api/synthetics_api.rb', line 413

def delete_private_location_with_http_info(location_id, opts = {})

  if @api_client.config.unstable_operations.has_key?(:delete_private_location)
    unstable_enabled = @api_client.config.unstable_operations[:delete_private_location]
    if unstable_enabled
      @api_client.config.logger.warn format("Using unstable operation '%s'", "delete_private_location")
    else
      raise APIError.new(message: format("Unstable operation '%s' is disabled", "delete_private_location"))
    end
  end

  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))

  # 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]

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

  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
  )

  data, status_code, headers = @api_client.call_api(: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.



476
477
478
479
# File 'lib/datadog_api_client/v1/api/synthetics_api.rb', line 476

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:



486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
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
# File 'lib/datadog_api_client/v1/api/synthetics_api.rb', line 486

def delete_tests_with_http_info(body, opts = {})

  if @api_client.config.unstable_operations.has_key?(:delete_tests)
    unstable_enabled = @api_client.config.unstable_operations[:delete_tests]
    if unstable_enabled
      @api_client.config.logger.warn format("Using unstable operation '%s'", "delete_tests")
    else
      raise APIError.new(message: format("Unstable operation '%s' is disabled", "delete_tests"))
    end
  end

  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] || [:AuthZ, :apiKeyAuth, :appKeyAuth]

  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
  )

  data, status_code, headers = @api_client.call_api(: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.



552
553
554
555
# File 'lib/datadog_api_client/v1/api/synthetics_api.rb', line 552

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 (SyntheticsGlobalVariable)

    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



563
564
565
566
567
568
569
570
571
572
573
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
# File 'lib/datadog_api_client/v1/api/synthetics_api.rb', line 563

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

  if @api_client.config.unstable_operations.has_key?(:edit_global_variable)
    unstable_enabled = @api_client.config.unstable_operations[:edit_global_variable]
    if unstable_enabled
      @api_client.config.logger.warn format("Using unstable operation '%s'", "edit_global_variable")
    else
      raise APIError.new(message: format("Unstable operation '%s' is disabled", "edit_global_variable"))
    end
  end

  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))

  # 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] || [:AuthZ, :apiKeyAuth, :appKeyAuth]

  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
  )

  data, status_code, headers = @api_client.call_api(: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

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

Get an API test.



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

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.



708
709
710
711
# File 'lib/datadog_api_client/v1/api/synthetics_api.rb', line 708

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.

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:



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
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
# File 'lib/datadog_api_client/v1/api/synthetics_api.rb', line 721

def get_api_test_latest_results_with_http_info(public_id, opts = {})

  if @api_client.config.unstable_operations.has_key?(:get_api_test_latest_results)
    unstable_enabled = @api_client.config.unstable_operations[:get_api_test_latest_results]
    if unstable_enabled
      @api_client.config.logger.warn format("Using unstable operation '%s'", "get_api_test_latest_results")
    else
      raise APIError.new(message: format("Unstable operation '%s' is disabled", "get_api_test_latest_results"))
    end
  end

  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))

  # 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] || [:AuthZ, :apiKeyAuth, :appKeyAuth]

  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
  )

  data, status_code, headers = @api_client.call_api(: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.



788
789
790
791
# File 'lib/datadog_api_client/v1/api/synthetics_api.rb', line 788

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



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
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
# File 'lib/datadog_api_client/v1/api/synthetics_api.rb', line 799

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

  if @api_client.config.unstable_operations.has_key?(:get_api_test_result)
    unstable_enabled = @api_client.config.unstable_operations[:get_api_test_result]
    if unstable_enabled
      @api_client.config.logger.warn format("Using unstable operation '%s'", "get_api_test_result")
    else
      raise APIError.new(message: format("Unstable operation '%s' is disabled", "get_api_test_result"))
    end
  end

  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)).sub('{' + 'result_id' + '}', CGI.escape(result_id.to_s))

  # 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] || [:AuthZ, :apiKeyAuth, :appKeyAuth]

  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
  )

  data, status_code, headers = @api_client.call_api(: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 associated with a Synthetic API test.

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



642
643
644
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
696
697
698
# File 'lib/datadog_api_client/v1/api/synthetics_api.rb', line 642

def get_api_test_with_http_info(public_id, opts = {})

  if @api_client.config.unstable_operations.has_key?(:get_api_test)
    unstable_enabled = @api_client.config.unstable_operations[:get_api_test]
    if unstable_enabled
      @api_client.config.logger.warn format("Using unstable operation '%s'", "get_api_test")
    else
      raise APIError.new(message: format("Unstable operation '%s' is disabled", "get_api_test"))
    end
  end

  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))

  # 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] || [:AuthZ, :apiKeyAuth, :appKeyAuth]

  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
  )

  data, status_code, headers = @api_client.call_api(: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.



866
867
868
869
# File 'lib/datadog_api_client/v1/api/synthetics_api.rb', line 866

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.



942
943
944
945
# File 'lib/datadog_api_client/v1/api/synthetics_api.rb', line 942

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.

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:



955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
# File 'lib/datadog_api_client/v1/api/synthetics_api.rb', line 955

def get_browser_test_latest_results_with_http_info(public_id, opts = {})

  if @api_client.config.unstable_operations.has_key?(:get_browser_test_latest_results)
    unstable_enabled = @api_client.config.unstable_operations[:get_browser_test_latest_results]
    if unstable_enabled
      @api_client.config.logger.warn format("Using unstable operation '%s'", "get_browser_test_latest_results")
    else
      raise APIError.new(message: format("Unstable operation '%s' is disabled", "get_browser_test_latest_results"))
    end
  end

  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))

  # 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] || [:AuthZ, :apiKeyAuth, :appKeyAuth]

  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
  )

  data, status_code, headers = @api_client.call_api(: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.



1022
1023
1024
1025
# File 'lib/datadog_api_client/v1/api/synthetics_api.rb', line 1022

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:



1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
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
# File 'lib/datadog_api_client/v1/api/synthetics_api.rb', line 1033

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

  if @api_client.config.unstable_operations.has_key?(:get_browser_test_result)
    unstable_enabled = @api_client.config.unstable_operations[:get_browser_test_result]
    if unstable_enabled
      @api_client.config.logger.warn format("Using unstable operation '%s'", "get_browser_test_result")
    else
      raise APIError.new(message: format("Unstable operation '%s' is disabled", "get_browser_test_result"))
    end
  end

  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)).sub('{' + 'result_id' + '}', CGI.escape(result_id.to_s))

  # 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] || [:AuthZ, :apiKeyAuth, :appKeyAuth]

  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
  )

  data, status_code, headers = @api_client.call_api(: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



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
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
# File 'lib/datadog_api_client/v1/api/synthetics_api.rb', line 876

def get_browser_test_with_http_info(public_id, opts = {})

  if @api_client.config.unstable_operations.has_key?(:get_browser_test)
    unstable_enabled = @api_client.config.unstable_operations[:get_browser_test]
    if unstable_enabled
      @api_client.config.logger.warn format("Using unstable operation '%s'", "get_browser_test")
    else
      raise APIError.new(message: format("Unstable operation '%s' is disabled", "get_browser_test"))
    end
  end

  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))

  # 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] || [:AuthZ, :apiKeyAuth, :appKeyAuth]

  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
  )

  data, status_code, headers = @api_client.call_api(: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.



1100
1101
1102
1103
# File 'lib/datadog_api_client/v1/api/synthetics_api.rb', line 1100

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



1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
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
# File 'lib/datadog_api_client/v1/api/synthetics_api.rb', line 1110

def get_global_variable_with_http_info(variable_id, opts = {})

  if @api_client.config.unstable_operations.has_key?(:get_global_variable)
    unstable_enabled = @api_client.config.unstable_operations[:get_global_variable]
    if unstable_enabled
      @api_client.config.logger.warn format("Using unstable operation '%s'", "get_global_variable")
    else
      raise APIError.new(message: format("Unstable operation '%s' is disabled", "get_global_variable"))
    end
  end

  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))

  # 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] || [:AuthZ, :apiKeyAuth, :appKeyAuth]

  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
  )

  data, status_code, headers = @api_client.call_api(: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_private_location(location_id, opts = {}) ⇒ Object

Get a private location.



1173
1174
1175
1176
# File 'lib/datadog_api_client/v1/api/synthetics_api.rb', line 1173

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



1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
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
# File 'lib/datadog_api_client/v1/api/synthetics_api.rb', line 1183

def get_private_location_with_http_info(location_id, opts = {})

  if @api_client.config.unstable_operations.has_key?(:get_private_location)
    unstable_enabled = @api_client.config.unstable_operations[:get_private_location]
    if unstable_enabled
      @api_client.config.logger.warn format("Using unstable operation '%s'", "get_private_location")
    else
      raise APIError.new(message: format("Unstable operation '%s' is disabled", "get_private_location"))
    end
  end

  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))

  # 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] || [:AuthZ, :apiKeyAuth, :appKeyAuth]

  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
  )

  data, status_code, headers = @api_client.call_api(: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.



1246
1247
1248
1249
# File 'lib/datadog_api_client/v1/api/synthetics_api.rb', line 1246

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



1256
1257
1258
1259
1260
1261
1262
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
1312
# File 'lib/datadog_api_client/v1/api/synthetics_api.rb', line 1256

def get_synthetics_ci_batch_with_http_info(batch_id, opts = {})

  if @api_client.config.unstable_operations.has_key?(:get_synthetics_ci_batch)
    unstable_enabled = @api_client.config.unstable_operations[:get_synthetics_ci_batch]
    if unstable_enabled
      @api_client.config.logger.warn format("Using unstable operation '%s'", "get_synthetics_ci_batch")
    else
      raise APIError.new(message: format("Unstable operation '%s' is disabled", "get_synthetics_ci_batch"))
    end
  end

  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))

  # 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] || [:AuthZ, :apiKeyAuth, :appKeyAuth]

  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
  )

  data, status_code, headers = @api_client.call_api(: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.



1175
1176
1177
1178
# File 'lib/datadog_api_client/v1/api/synthetics_api.rb', line 1175

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



1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
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
# File 'lib/datadog_api_client/v1/api/synthetics_api.rb', line 1186

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]

  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.



1319
1320
1321
1322
# File 'lib/datadog_api_client/v1/api/synthetics_api.rb', line 1319

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<(SyntheticsTestDetails, 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:

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

    SyntheticsTestDetails data, response status code and response headers



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
1377
1378
1379
1380
1381
1382
1383
1384
1385
# File 'lib/datadog_api_client/v1/api/synthetics_api.rb', line 1329

def get_test_with_http_info(public_id, opts = {})

  if @api_client.config.unstable_operations.has_key?(:get_test)
    unstable_enabled = @api_client.config.unstable_operations[:get_test]
    if unstable_enabled
      @api_client.config.logger.warn format("Using unstable operation '%s'", "get_test")
    else
      raise APIError.new(message: format("Unstable operation '%s' is disabled", "get_test"))
    end
  end

  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))

  # 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] || 'SyntheticsTestDetails'

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

  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
  )

  data, status_code, headers = @api_client.call_api(: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.



1391
1392
1393
1394
# File 'lib/datadog_api_client/v1/api/synthetics_api.rb', line 1391

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:



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
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
# File 'lib/datadog_api_client/v1/api/synthetics_api.rb', line 1400

def list_global_variables_with_http_info(opts = {})

  if @api_client.config.unstable_operations.has_key?(:list_global_variables)
    unstable_enabled = @api_client.config.unstable_operations[:list_global_variables]
    if unstable_enabled
      @api_client.config.logger.warn format("Using unstable operation '%s'", "list_global_variables")
    else
      raise APIError.new(message: format("Unstable operation '%s' is disabled", "list_global_variables"))
    end
  end

  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] || [:AuthZ, :apiKeyAuth, :appKeyAuth]

  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
  )

  data, status_code, headers = @api_client.call_api(: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).



1458
1459
1460
1461
# File 'lib/datadog_api_client/v1/api/synthetics_api.rb', line 1458

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



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
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
# File 'lib/datadog_api_client/v1/api/synthetics_api.rb', line 1467

def list_locations_with_http_info(opts = {})

  if @api_client.config.unstable_operations.has_key?(:list_locations)
    unstable_enabled = @api_client.config.unstable_operations[:list_locations]
    if unstable_enabled
      @api_client.config.logger.warn format("Using unstable operation '%s'", "list_locations")
    else
      raise APIError.new(message: format("Unstable operation '%s' is disabled", "list_locations"))
    end
  end

  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] || [:AuthZ, :apiKeyAuth, :appKeyAuth]

  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
  )

  data, status_code, headers = @api_client.call_api(: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.



1525
1526
1527
1528
# File 'lib/datadog_api_client/v1/api/synthetics_api.rb', line 1525

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.

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



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
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
# File 'lib/datadog_api_client/v1/api/synthetics_api.rb', line 1534

def list_tests_with_http_info(opts = {})

  if @api_client.config.unstable_operations.has_key?(:list_tests)
    unstable_enabled = @api_client.config.unstable_operations[:list_tests]
    if unstable_enabled
      @api_client.config.logger.warn format("Using unstable operation '%s'", "list_tests")
    else
      raise APIError.new(message: format("Unstable operation '%s' is disabled", "list_tests"))
    end
  end

  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] || {}

  # 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] || [:AuthZ, :apiKeyAuth, :appKeyAuth]

  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
  )

  data, status_code, headers = @api_client.call_api(: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 = {}) {|SyntheticsTestDetails| ... } ⇒ 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:



1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
# File 'lib/datadog_api_client/v1/api/synthetics_api.rb', line 1489

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.



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

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



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
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
# File 'lib/datadog_api_client/v1/api/synthetics_api.rb', line 1520

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

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

Trigger tests from CI/CD pipelines.



1593
1594
1595
1596
# File 'lib/datadog_api_client/v1/api/synthetics_api.rb', line 1593

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:



1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
# File 'lib/datadog_api_client/v1/api/synthetics_api.rb', line 1603

def trigger_ci_tests_with_http_info(body, opts = {})

  if @api_client.config.unstable_operations.has_key?(:trigger_ci_tests)
    unstable_enabled = @api_client.config.unstable_operations[:trigger_ci_tests]
    if unstable_enabled
      @api_client.config.logger.warn format("Using unstable operation '%s'", "trigger_ci_tests")
    else
      raise APIError.new(message: format("Unstable operation '%s' is disabled", "trigger_ci_tests"))
    end
  end

  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] || [:AuthZ, :apiKeyAuth, :appKeyAuth]

  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
  )

  data, status_code, headers = @api_client.call_api(: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.



1668
1669
1670
1671
# File 'lib/datadog_api_client/v1/api/synthetics_api.rb', line 1668

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:



1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
# File 'lib/datadog_api_client/v1/api/synthetics_api.rb', line 1678

def trigger_tests_with_http_info(body, opts = {})

  if @api_client.config.unstable_operations.has_key?(:trigger_tests)
    unstable_enabled = @api_client.config.unstable_operations[:trigger_tests]
    if unstable_enabled
      @api_client.config.logger.warn format("Using unstable operation '%s'", "trigger_tests")
    else
      raise APIError.new(message: format("Unstable operation '%s' is disabled", "trigger_tests"))
    end
  end

  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] || [:AuthZ, :apiKeyAuth, :appKeyAuth]

  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
  )

  data, status_code, headers = @api_client.call_api(: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.



1744
1745
1746
1747
# File 'lib/datadog_api_client/v1/api/synthetics_api.rb', line 1744

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



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
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
# File 'lib/datadog_api_client/v1/api/synthetics_api.rb', line 1755

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

  if @api_client.config.unstable_operations.has_key?(:update_api_test)
    unstable_enabled = @api_client.config.unstable_operations[:update_api_test]
    if unstable_enabled
      @api_client.config.logger.warn format("Using unstable operation '%s'", "update_api_test")
    else
      raise APIError.new(message: format("Unstable operation '%s' is disabled", "update_api_test"))
    end
  end

  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))

  # 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] || [:AuthZ, :apiKeyAuth, :appKeyAuth]

  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
  )

  data, status_code, headers = @api_client.call_api(: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.



1825
1826
1827
1828
# File 'lib/datadog_api_client/v1/api/synthetics_api.rb', line 1825

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



1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
# File 'lib/datadog_api_client/v1/api/synthetics_api.rb', line 1836

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

  if @api_client.config.unstable_operations.has_key?(:update_browser_test)
    unstable_enabled = @api_client.config.unstable_operations[:update_browser_test]
    if unstable_enabled
      @api_client.config.logger.warn format("Using unstable operation '%s'", "update_browser_test")
    else
      raise APIError.new(message: format("Unstable operation '%s' is disabled", "update_browser_test"))
    end
  end

  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))

  # 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] || [:AuthZ, :apiKeyAuth, :appKeyAuth]

  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
  )

  data, status_code, headers = @api_client.call_api(: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_private_location(location_id, body, opts = {}) ⇒ Object

Edit a private location.



1906
1907
1908
1909
# File 'lib/datadog_api_client/v1/api/synthetics_api.rb', line 1906

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



1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
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
# File 'lib/datadog_api_client/v1/api/synthetics_api.rb', line 1917

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

  if @api_client.config.unstable_operations.has_key?(:update_private_location)
    unstable_enabled = @api_client.config.unstable_operations[:update_private_location]
    if unstable_enabled
      @api_client.config.logger.warn format("Using unstable operation '%s'", "update_private_location")
    else
      raise APIError.new(message: format("Unstable operation '%s' is disabled", "update_private_location"))
    end
  end

  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))

  # 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] || [:AuthZ, :apiKeyAuth, :appKeyAuth]

  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
  )

  data, status_code, headers = @api_client.call_api(: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.



1987
1988
1989
1990
# File 'lib/datadog_api_client/v1/api/synthetics_api.rb', line 1987

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



1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
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
# File 'lib/datadog_api_client/v1/api/synthetics_api.rb', line 1998

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

  if @api_client.config.unstable_operations.has_key?(:update_test_pause_status)
    unstable_enabled = @api_client.config.unstable_operations[:update_test_pause_status]
    if unstable_enabled
      @api_client.config.logger.warn format("Using unstable operation '%s'", "update_test_pause_status")
    else
      raise APIError.new(message: format("Unstable operation '%s' is disabled", "update_test_pause_status"))
    end
  end

  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))

  # 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] || [:AuthZ, :apiKeyAuth, :appKeyAuth]

  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
  )

  data, status_code, headers = @api_client.call_api(: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