Class: DatadogAPIClient::V2::SyntheticsAPI

Inherits:
Object
  • Object
show all
Defined in:
lib/datadog_api_client/v2/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/v2/api/synthetics_api.rb', line 22

def initialize(api_client = DatadogAPIClient::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/v2/api/synthetics_api.rb', line 20

def api_client
  @api_client
end

Instance Method Details

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

Create a Network Path test.



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

def create_synthetics_network_test(body, opts = {})
  data, _status_code, _headers = create_synthetics_network_test_with_http_info(body, opts)
  data
end

#create_synthetics_network_test_with_http_info(body, opts = {}) ⇒ Array<(SyntheticsNetworkTestResponse, Integer, Hash)>

Create a Network Path test.

Parameters:

Returns:



38
39
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
# File 'lib/datadog_api_client/v2/api/synthetics_api.rb', line 38

def create_synthetics_network_test_with_http_info(body, opts = {})

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SyntheticsAPI.create_synthetics_network_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_network_test"
  end
  # resource path
  local_var_path = '/api/v2/synthetics/tests/network'

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

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

  new_options = opts.merge(
    :operation => :create_synthetics_network_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 => "V2"
  )

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

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

Create a test suite.



93
94
95
96
# File 'lib/datadog_api_client/v2/api/synthetics_api.rb', line 93

def create_synthetics_suite(body, opts = {})
  data, _status_code, _headers = create_synthetics_suite_with_http_info(body, opts)
  data
end

#create_synthetics_suite_with_http_info(body, opts = {}) ⇒ Array<(SyntheticsSuiteResponse, Integer, Hash)>

Create a test suite.

Parameters:

Returns:

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

    SyntheticsSuiteResponse data, response status code and response headers



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

def create_synthetics_suite_with_http_info(body, opts = {})

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SyntheticsAPI.create_synthetics_suite ...'
  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_suite"
  end
  # resource path
  local_var_path = '/api/v2/synthetics/suites'

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

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

  new_options = opts.merge(
    :operation => :create_synthetics_suite,
    :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 => "V2"
  )

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

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

Bulk delete suites.



157
158
159
160
# File 'lib/datadog_api_client/v2/api/synthetics_api.rb', line 157

def delete_synthetics_suites(body, opts = {})
  data, _status_code, _headers = delete_synthetics_suites_with_http_info(body, opts)
  data
end

#delete_synthetics_suites_with_http_info(body, opts = {}) ⇒ Array<(DeletedSuitesResponse, Integer, Hash)>

Bulk delete suites.

Parameters:

Returns:

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

    DeletedSuitesResponse data, response status code and response headers



166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
# File 'lib/datadog_api_client/v2/api/synthetics_api.rb', line 166

def delete_synthetics_suites_with_http_info(body, opts = {})

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SyntheticsAPI.delete_synthetics_suites ...'
  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_synthetics_suites"
  end
  # resource path
  local_var_path = '/api/v2/synthetics/suites/bulk-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] || 'DeletedSuitesResponse'

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

  new_options = opts.merge(
    :operation => :delete_synthetics_suites,
    :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 => "V2"
  )

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

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

Bulk delete tests.



221
222
223
224
# File 'lib/datadog_api_client/v2/api/synthetics_api.rb', line 221

def delete_synthetics_tests(body, opts = {})
  data, _status_code, _headers = delete_synthetics_tests_with_http_info(body, opts)
  data
end

#delete_synthetics_tests_with_http_info(body, opts = {}) ⇒ Array<(DeletedTestsResponse, Integer, Hash)>

Bulk delete tests.

Parameters:

Returns:

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

    DeletedTestsResponse data, response status code and response headers



230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
# File 'lib/datadog_api_client/v2/api/synthetics_api.rb', line 230

def delete_synthetics_tests_with_http_info(body, opts = {})

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SyntheticsAPI.delete_synthetics_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_synthetics_tests"
  end
  # resource path
  local_var_path = '/api/v2/synthetics/tests/bulk-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] || 'DeletedTestsResponse'

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

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

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

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

Edit a test suite.



285
286
287
288
# File 'lib/datadog_api_client/v2/api/synthetics_api.rb', line 285

def edit_synthetics_suite(public_id, body, opts = {})
  data, _status_code, _headers = edit_synthetics_suite_with_http_info(public_id, body, opts)
  data
end

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

Edit a test suite.

Parameters:

  • public_id (String)

    The public ID of the suite to edit.

  • body (SuiteCreateEditRequest)

    New suite details to be saved.

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

    the optional parameters

Returns:

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

    SyntheticsSuiteResponse data, response status code and response headers



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
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
# File 'lib/datadog_api_client/v2/api/synthetics_api.rb', line 295

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

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SyntheticsAPI.edit_synthetics_suite ...'
  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.edit_synthetics_suite"
  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_synthetics_suite"
  end
  # resource path
  local_var_path = '/api/v2/synthetics/suites/{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] || 'SyntheticsSuiteResponse'

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

  new_options = opts.merge(
    :operation => :edit_synthetics_suite,
    :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 => "V2"
  )

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

#get_on_demand_concurrency_cap(opts = {}) ⇒ Object

Get the on-demand concurrency cap.



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

def get_on_demand_concurrency_cap(opts = {})
  data, _status_code, _headers = get_on_demand_concurrency_cap_with_http_info(opts)
  data
end

#get_on_demand_concurrency_cap_with_http_info(opts = {}) ⇒ Array<(OnDemandConcurrencyCapResponse, Integer, Hash)>

Get the on-demand concurrency cap.

Get the on-demand concurrency cap.

Parameters:

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

    the optional parameters

Returns:



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
# File 'lib/datadog_api_client/v2/api/synthetics_api.rb', line 40

def get_on_demand_concurrency_cap_with_http_info(opts = {})

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SyntheticsAPI.get_on_demand_concurrency_cap ...'
  end
  # resource path
  local_var_path = '/api/v2/synthetics/settings/on_demand_concurrency_cap'

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

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

  new_options = opts.merge(
    :operation => :get_on_demand_concurrency_cap,
    :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 => "V2"
  )

  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_on_demand_concurrency_cap\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

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

Get a Network Path test.



414
415
416
417
# File 'lib/datadog_api_client/v2/api/synthetics_api.rb', line 414

def get_synthetics_network_test(public_id, opts = {})
  data, _status_code, _headers = get_synthetics_network_test_with_http_info(public_id, opts)
  data
end

#get_synthetics_network_test_with_http_info(public_id, opts = {}) ⇒ Array<(SyntheticsNetworkTestResponse, Integer, Hash)>

Get a Network Path test.

Parameters:

  • public_id (String)

    The public ID of the Network Path test to get details from.

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

    the optional parameters

Returns:



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
470
471
# File 'lib/datadog_api_client/v2/api/synthetics_api.rb', line 423

def get_synthetics_network_test_with_http_info(public_id, opts = {})

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SyntheticsAPI.get_synthetics_network_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_synthetics_network_test"
  end
  # resource path
  local_var_path = '/api/v2/synthetics/tests/network/{public_id}'.sub('{public_id}', CGI.escape(public_id.to_s).gsub('%2F', '/'))

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

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

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

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

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

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

  new_options = opts.merge(
    :operation => :get_synthetics_network_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 => "V2"
  )

  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_network_test\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

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

Get a suite.



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

def get_synthetics_suite(public_id, opts = {})
  data, _status_code, _headers = get_synthetics_suite_with_http_info(public_id, opts)
  data
end

#get_synthetics_suite_with_http_info(public_id, opts = {}) ⇒ Array<(SyntheticsSuiteResponse, Integer, Hash)>

Get a suite.

Parameters:

  • public_id (String)

    The public ID of the suite to get details from.

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

    the optional parameters

Returns:

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

    SyntheticsSuiteResponse data, response status code and response headers



485
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
# File 'lib/datadog_api_client/v2/api/synthetics_api.rb', line 485

def get_synthetics_suite_with_http_info(public_id, opts = {})

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SyntheticsAPI.get_synthetics_suite ...'
  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_synthetics_suite"
  end
  # resource path
  local_var_path = '/api/v2/synthetics/suites/{public_id}'.sub('{public_id}', CGI.escape(public_id.to_s).gsub('%2F', '/'))

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

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

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

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

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

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

  new_options = opts.merge(
    :operation => :get_synthetics_suite,
    :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 => "V2"
  )

  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_suite\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

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

Patch a global variable.



538
539
540
541
# File 'lib/datadog_api_client/v2/api/synthetics_api.rb', line 538

def patch_global_variable(variable_id, body, opts = {})
  data, _status_code, _headers = patch_global_variable_with_http_info(variable_id, body, opts)
  data
end

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

Patch a global variable.

Patch a global variable using JSON Patch (RFC 6902). This endpoint allows partial updates to a global variable by specifying only the fields to modify.

Common operations include:

  • Replace field values: {"op": "replace", "path": "/name", "value": "new_name"}
  • Update nested values: {"op": "replace", "path": "/value/value", "value": "new_value"}
  • Add/update tags: {"op": "add", "path": "/tags/-", "value": "new_tag"}
  • Remove fields: {"op": "remove", "path": "/description"}

Parameters:

  • variable_id (String)

    The ID of the global variable.

  • body (GlobalVariableJsonPatchRequest)

    JSON Patch document with operations to apply.

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

    the optional parameters

Returns:

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

    GlobalVariableResponse data, response status code and response headers



558
559
560
561
562
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
# File 'lib/datadog_api_client/v2/api/synthetics_api.rb', line 558

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

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SyntheticsAPI.patch_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.patch_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.patch_global_variable"
  end
  # resource path
  local_var_path = '/api/v2/synthetics/variables/{variable_id}/jsonpatch'.sub('{variable_id}', CGI.escape(variable_id.to_s).gsub('%2F', '/'))

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

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

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

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

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

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

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

  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_global_variable\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#search_suites(opts = {}) ⇒ Object

Search test suites.



617
618
619
620
# File 'lib/datadog_api_client/v2/api/synthetics_api.rb', line 617

def search_suites(opts = {})
  data, _status_code, _headers = search_suites_with_http_info(opts)
  data
end

#search_suites_with_http_info(opts = {}) ⇒ Array<(SyntheticsSuiteSearchResponse, Integer, Hash)>

Search test suites.

Search for test suites.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :query (String)

    The search query.

  • :sort (String)

    The sort order for the results (e.g., name,asc or name,desc).

  • :facets_only (Boolean)

    If true, return only facets instead of full test details.

  • :start (Integer)

    The offset from which to start returning results.

  • :count (Integer)

    The maximum number of results to return.

Returns:



633
634
635
636
637
638
639
640
641
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
# File 'lib/datadog_api_client/v2/api/synthetics_api.rb', line 633

def search_suites_with_http_info(opts = {})

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SyntheticsAPI.search_suites ...'
  end
  # resource path
  local_var_path = '/api/v2/synthetics/suites/search'

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

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

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

  new_options = opts.merge(
    :operation => :search_suites,
    :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 => "V2"
  )

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

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

Save new value for on-demand concurrency cap.



89
90
91
92
# File 'lib/datadog_api_client/v2/api/synthetics_api.rb', line 89

def set_on_demand_concurrency_cap(body, opts = {})
  data, _status_code, _headers = set_on_demand_concurrency_cap_with_http_info(body, opts)
  data
end

#set_on_demand_concurrency_cap_with_http_info(body, opts = {}) ⇒ Array<(OnDemandConcurrencyCapResponse, Integer, Hash)>

Save new value for on-demand concurrency cap.

Save new value for on-demand concurrency cap.

Parameters:

Returns:



101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
# File 'lib/datadog_api_client/v2/api/synthetics_api.rb', line 101

def set_on_demand_concurrency_cap_with_http_info(body, opts = {})

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SyntheticsAPI.set_on_demand_concurrency_cap ...'
  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.set_on_demand_concurrency_cap"
  end
  # resource path
  local_var_path = '/api/v2/synthetics/settings/on_demand_concurrency_cap'

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

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

  new_options = opts.merge(
    :operation => :set_on_demand_concurrency_cap,
    :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 => "V2"
  )

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

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

Edit a Network Path test.



754
755
756
757
# File 'lib/datadog_api_client/v2/api/synthetics_api.rb', line 754

def update_synthetics_network_test(public_id, body, opts = {})
  data, _status_code, _headers = update_synthetics_network_test_with_http_info(public_id, body, opts)
  data
end

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

Edit a Network Path test.

Parameters:

  • public_id (String)

    The public ID of the Network Path test to edit.

  • body (SyntheticsNetworkTestEditRequest)

    New Network Path test details to be saved.

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

    the optional parameters

Returns:



764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
# File 'lib/datadog_api_client/v2/api/synthetics_api.rb', line 764

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

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SyntheticsAPI.update_synthetics_network_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_synthetics_network_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_synthetics_network_test"
  end
  # resource path
  local_var_path = '/api/v2/synthetics/tests/network/{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] || 'SyntheticsNetworkTestResponse'

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

  new_options = opts.merge(
    :operation => :update_synthetics_network_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 => "V2"
  )

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