Class: DatadogAPIClient::V2::SensitiveDataScannerAPI

Inherits:
Object
  • Object
show all
Defined in:
lib/datadog_api_client/v2/api/sensitive_data_scanner_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

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

Returns a new instance of SensitiveDataScannerAPI.



22
23
24
# File 'lib/datadog_api_client/v2/api/sensitive_data_scanner_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/sensitive_data_scanner_api.rb', line 20

def api_client
  @api_client
end

Instance Method Details

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

Create Scanning Group.



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

def create_scanning_group(body, opts = {})
  data, _status_code, _headers = create_scanning_group_with_http_info(body, opts)
  data
end

#create_scanning_group_with_http_info(body, opts = {}) ⇒ Array<(SensitiveDataScannerCreateGroupResponse, Integer, Hash)>

Create Scanning Group.

Create a scanning group. The request MAY include a configuration relationship. A rules relationship can be omitted entirely, but if it is included it MUST be null or an empty array (rules cannot be created at the same time). The new group will be ordered last within the configuration.

Parameters:

Returns:



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

def create_scanning_group_with_http_info(body, opts = {})

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SensitiveDataScannerAPI.create_scanning_group ...'
  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 SensitiveDataScannerAPI.create_scanning_group"
  end
  # resource path
  local_var_path = '/api/v2/sensitive-data-scanner/config/groups'

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

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

  new_options = opts.merge(
    :operation => :create_scanning_group,
    :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: SensitiveDataScannerAPI#create_scanning_group\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

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

Create Scanning Rule.



100
101
102
103
# File 'lib/datadog_api_client/v2/api/sensitive_data_scanner_api.rb', line 100

def create_scanning_rule(body, opts = {})
  data, _status_code, _headers = create_scanning_rule_with_http_info(body, opts)
  data
end

#create_scanning_rule_with_http_info(body, opts = {}) ⇒ Array<(SensitiveDataScannerCreateRuleResponse, Integer, Hash)>

Create Scanning Rule.

Create a scanning rule in a sensitive data scanner group, ordered last. The posted rule MUST include a group relationship. It MUST include either a standard_pattern relationship or a regex attribute, but not both. If included_attributes is empty or missing, we will scan all attributes except excluded_attributes. If both are missing, we will scan the whole event.

Parameters:

Returns:



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

def create_scanning_rule_with_http_info(body, opts = {})

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SensitiveDataScannerAPI.create_scanning_rule ...'
  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 SensitiveDataScannerAPI.create_scanning_rule"
  end
  # resource path
  local_var_path = '/api/v2/sensitive-data-scanner/config/rules'

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

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

  new_options = opts.merge(
    :operation => :create_scanning_rule,
    :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: SensitiveDataScannerAPI#create_scanning_rule\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#delete_scanning_group(group_id, body, opts = {}) ⇒ Object

Delete Scanning Group.



171
172
173
174
# File 'lib/datadog_api_client/v2/api/sensitive_data_scanner_api.rb', line 171

def delete_scanning_group(group_id, body, opts = {})
  data, _status_code, _headers = delete_scanning_group_with_http_info(group_id, body, opts)
  data
end

#delete_scanning_group_with_http_info(group_id, body, opts = {}) ⇒ Array<(SensitiveDataScannerGroupDeleteResponse, Integer, Hash)>

Delete Scanning Group.

Delete a given group.

Parameters:

Returns:



184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
# File 'lib/datadog_api_client/v2/api/sensitive_data_scanner_api.rb', line 184

def delete_scanning_group_with_http_info(group_id, body, opts = {})

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SensitiveDataScannerAPI.delete_scanning_group ...'
  end
  # verify the required parameter 'group_id' is set
  if @api_client.config.client_side_validation && group_id.nil?
    fail ArgumentError, "Missing the required parameter 'group_id' when calling SensitiveDataScannerAPI.delete_scanning_group"
  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 SensitiveDataScannerAPI.delete_scanning_group"
  end
  # resource path
  local_var_path = '/api/v2/sensitive-data-scanner/config/groups/{group_id}'.sub('{group_id}', CGI.escape(group_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] || 'SensitiveDataScannerGroupDeleteResponse'

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

  new_options = opts.merge(
    :operation => :delete_scanning_group,
    :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::Delete, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SensitiveDataScannerAPI#delete_scanning_group\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#delete_scanning_rule(rule_id, body, opts = {}) ⇒ Object

Delete Scanning Rule.



243
244
245
246
# File 'lib/datadog_api_client/v2/api/sensitive_data_scanner_api.rb', line 243

def delete_scanning_rule(rule_id, body, opts = {})
  data, _status_code, _headers = delete_scanning_rule_with_http_info(rule_id, body, opts)
  data
end

#delete_scanning_rule_with_http_info(rule_id, body, opts = {}) ⇒ Array<(SensitiveDataScannerRuleDeleteResponse, Integer, Hash)>

Delete Scanning Rule.

Delete a given rule.

Parameters:

Returns:



256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
# File 'lib/datadog_api_client/v2/api/sensitive_data_scanner_api.rb', line 256

def delete_scanning_rule_with_http_info(rule_id, body, opts = {})

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SensitiveDataScannerAPI.delete_scanning_rule ...'
  end
  # verify the required parameter 'rule_id' is set
  if @api_client.config.client_side_validation && rule_id.nil?
    fail ArgumentError, "Missing the required parameter 'rule_id' when calling SensitiveDataScannerAPI.delete_scanning_rule"
  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 SensitiveDataScannerAPI.delete_scanning_rule"
  end
  # resource path
  local_var_path = '/api/v2/sensitive-data-scanner/config/rules/{rule_id}'.sub('{rule_id}', CGI.escape(rule_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] || 'SensitiveDataScannerRuleDeleteResponse'

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

  new_options = opts.merge(
    :operation => :delete_scanning_rule,
    :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::Delete, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SensitiveDataScannerAPI#delete_scanning_rule\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_scanning_groups(opts = {}) ⇒ Object

List Scanning Groups.



315
316
317
318
# File 'lib/datadog_api_client/v2/api/sensitive_data_scanner_api.rb', line 315

def list_scanning_groups(opts = {})
  data, _status_code, _headers = list_scanning_groups_with_http_info(opts)
  data
end

#list_scanning_groups_with_http_info(opts = {}) ⇒ Array<(SensitiveDataScannerGetConfigResponse, Integer, Hash)>

List Scanning Groups.

List all the Scanning groups in your organization.

Parameters:

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

    the optional parameters

Returns:



326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
# File 'lib/datadog_api_client/v2/api/sensitive_data_scanner_api.rb', line 326

def list_scanning_groups_with_http_info(opts = {})

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SensitiveDataScannerAPI.list_scanning_groups ...'
  end
  # resource path
  local_var_path = '/api/v2/sensitive-data-scanner/config'

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

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

  new_options = opts.merge(
    :operation => :list_scanning_groups,
    :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: SensitiveDataScannerAPI#list_scanning_groups\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_standard_patterns(opts = {}) ⇒ Object

List standard patterns.



375
376
377
378
# File 'lib/datadog_api_client/v2/api/sensitive_data_scanner_api.rb', line 375

def list_standard_patterns(opts = {})
  data, _status_code, _headers = list_standard_patterns_with_http_info(opts)
  data
end

#list_standard_patterns_with_http_info(opts = {}) ⇒ Array<(SensitiveDataScannerStandardPatternsResponseData, Integer, Hash)>

List standard patterns.

Returns all standard patterns.

Parameters:

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

    the optional parameters

Returns:



386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
# File 'lib/datadog_api_client/v2/api/sensitive_data_scanner_api.rb', line 386

def list_standard_patterns_with_http_info(opts = {})

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SensitiveDataScannerAPI.list_standard_patterns ...'
  end
  # resource path
  local_var_path = '/api/v2/sensitive-data-scanner/config/standard-patterns'

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

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

  new_options = opts.merge(
    :operation => :list_standard_patterns,
    :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: SensitiveDataScannerAPI#list_standard_patterns\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

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

Reorder Groups.



435
436
437
438
# File 'lib/datadog_api_client/v2/api/sensitive_data_scanner_api.rb', line 435

def reorder_scanning_groups(body, opts = {})
  data, _status_code, _headers = reorder_scanning_groups_with_http_info(body, opts)
  data
end

#reorder_scanning_groups_with_http_info(body, opts = {}) ⇒ Array<(SensitiveDataScannerReorderGroupsResponse, Integer, Hash)>

Reorder Groups.

Reorder the list of groups.

Parameters:

Returns:



447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
# File 'lib/datadog_api_client/v2/api/sensitive_data_scanner_api.rb', line 447

def reorder_scanning_groups_with_http_info(body, opts = {})

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SensitiveDataScannerAPI.reorder_scanning_groups ...'
  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 SensitiveDataScannerAPI.reorder_scanning_groups"
  end
  # resource path
  local_var_path = '/api/v2/sensitive-data-scanner/config'

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

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

  new_options = opts.merge(
    :operation => :reorder_scanning_groups,
    :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: SensitiveDataScannerAPI#reorder_scanning_groups\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_scanning_group(group_id, body, opts = {}) ⇒ Object

Update Scanning Group.



502
503
504
505
# File 'lib/datadog_api_client/v2/api/sensitive_data_scanner_api.rb', line 502

def update_scanning_group(group_id, body, opts = {})
  data, _status_code, _headers = update_scanning_group_with_http_info(group_id, body, opts)
  data
end

#update_scanning_group_with_http_info(group_id, body, opts = {}) ⇒ Array<(SensitiveDataScannerGroupUpdateResponse, Integer, Hash)>

Update Scanning Group.

Update a group, including the order of the rules. Rules within the group are reordered by including a rules relationship. If the rules relationship is present, its data section MUST contain linkages for all of the rules currently in the group, and MUST NOT contain any others.

Parameters:

Returns:



518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
# File 'lib/datadog_api_client/v2/api/sensitive_data_scanner_api.rb', line 518

def update_scanning_group_with_http_info(group_id, body, opts = {})

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SensitiveDataScannerAPI.update_scanning_group ...'
  end
  # verify the required parameter 'group_id' is set
  if @api_client.config.client_side_validation && group_id.nil?
    fail ArgumentError, "Missing the required parameter 'group_id' when calling SensitiveDataScannerAPI.update_scanning_group"
  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 SensitiveDataScannerAPI.update_scanning_group"
  end
  # resource path
  local_var_path = '/api/v2/sensitive-data-scanner/config/groups/{group_id}'.sub('{group_id}', CGI.escape(group_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] || 'SensitiveDataScannerGroupUpdateResponse'

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

  new_options = opts.merge(
    :operation => :update_scanning_group,
    :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: SensitiveDataScannerAPI#update_scanning_group\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_scanning_rule(rule_id, body, opts = {}) ⇒ Object

Update Scanning Rule.



577
578
579
580
# File 'lib/datadog_api_client/v2/api/sensitive_data_scanner_api.rb', line 577

def update_scanning_rule(rule_id, body, opts = {})
  data, _status_code, _headers = update_scanning_rule_with_http_info(rule_id, body, opts)
  data
end

#update_scanning_rule_with_http_info(rule_id, body, opts = {}) ⇒ Array<(SensitiveDataScannerRuleUpdateResponse, Integer, Hash)>

Update Scanning Rule.

Update a scanning rule. The request body MUST NOT include a standard_pattern relationship, as that relationship is non-editable. Trying to edit the regex attribute of a rule with a standard_pattern relationship will also result in an error.

Parameters:

Returns:



593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
# File 'lib/datadog_api_client/v2/api/sensitive_data_scanner_api.rb', line 593

def update_scanning_rule_with_http_info(rule_id, body, opts = {})

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SensitiveDataScannerAPI.update_scanning_rule ...'
  end
  # verify the required parameter 'rule_id' is set
  if @api_client.config.client_side_validation && rule_id.nil?
    fail ArgumentError, "Missing the required parameter 'rule_id' when calling SensitiveDataScannerAPI.update_scanning_rule"
  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 SensitiveDataScannerAPI.update_scanning_rule"
  end
  # resource path
  local_var_path = '/api/v2/sensitive-data-scanner/config/rules/{rule_id}'.sub('{rule_id}', CGI.escape(rule_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] || 'SensitiveDataScannerRuleUpdateResponse'

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

  new_options = opts.merge(
    :operation => :update_scanning_rule,
    :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: SensitiveDataScannerAPI#update_scanning_rule\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end