Class: DependencyTracker::VulnerabilityApi

Inherits:
Object
  • Object
show all
Defined in:
lib/dependency-tracker-client/api/vulnerability_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ VulnerabilityApi

Returns a new instance of VulnerabilityApi.



19
20
21
# File 'lib/dependency-tracker-client/api/vulnerability_api.rb', line 19

def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



17
18
19
# File 'lib/dependency-tracker-client/api/vulnerability_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#assign_vulnerability(source, vuln_id, component, opts = {}) ⇒ nil

Assigns a vulnerability to a component

Parameters:

  • source (String)

    The vulnerability source

  • vuln_id (String)

    The vulnId

  • component (String)

    The UUID of the component

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

    the optional parameters

Returns:

  • (nil)


28
29
30
31
# File 'lib/dependency-tracker-client/api/vulnerability_api.rb', line 28

def assign_vulnerability(source, vuln_id, component, opts = {})
  assign_vulnerability_with_http_info(source, vuln_id, component, opts)
  nil
end

#assign_vulnerability1(uuid, component, opts = {}) ⇒ nil

Assigns a vulnerability to a component

Parameters:

  • uuid (String)

    The UUID of the vulnerability

  • component (String)

    The UUID of the component

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

    the optional parameters

Returns:

  • (nil)


97
98
99
100
# File 'lib/dependency-tracker-client/api/vulnerability_api.rb', line 97

def assign_vulnerability1(uuid, component, opts = {})
  assign_vulnerability1_with_http_info(uuid, component, opts)
  nil
end

#assign_vulnerability1_with_http_info(uuid, component, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Assigns a vulnerability to a component

Parameters:

  • uuid (String)

    The UUID of the vulnerability

  • component (String)

    The UUID of the component

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



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
153
154
# File 'lib/dependency-tracker-client/api/vulnerability_api.rb', line 107

def assign_vulnerability1_with_http_info(uuid, component, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: VulnerabilityApi.assign_vulnerability1 ...'
  end
  # verify the required parameter 'uuid' is set
  if @api_client.config.client_side_validation && uuid.nil?
    fail ArgumentError, "Missing the required parameter 'uuid' when calling VulnerabilityApi.assign_vulnerability1"
  end
  # verify the required parameter 'component' is set
  if @api_client.config.client_side_validation && component.nil?
    fail ArgumentError, "Missing the required parameter 'component' when calling VulnerabilityApi.assign_vulnerability1"
  end
  # resource path
  local_var_path = '/v1/vulnerability/{uuid}/component/{component}'.sub('{' + 'uuid' + '}', CGI.escape(uuid.to_s)).sub('{' + 'component' + '}', CGI.escape(component.to_s))

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

  # header parameters
  header_params = opts[:header_params] || {}

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

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

  # return_type
  return_type = opts[:return_type] 

  # auth_names
  auth_names = opts[:auth_names] || ['X-Api-Key']

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

#assign_vulnerability_with_http_info(source, vuln_id, component, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Assigns a vulnerability to a component

Parameters:

  • source (String)

    The vulnerability source

  • vuln_id (String)

    The vulnId

  • component (String)

    The UUID of the component

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



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
89
90
# File 'lib/dependency-tracker-client/api/vulnerability_api.rb', line 39

def assign_vulnerability_with_http_info(source, vuln_id, component, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: VulnerabilityApi.assign_vulnerability ...'
  end
  # verify the required parameter 'source' is set
  if @api_client.config.client_side_validation && source.nil?
    fail ArgumentError, "Missing the required parameter 'source' when calling VulnerabilityApi.assign_vulnerability"
  end
  # verify the required parameter 'vuln_id' is set
  if @api_client.config.client_side_validation && vuln_id.nil?
    fail ArgumentError, "Missing the required parameter 'vuln_id' when calling VulnerabilityApi.assign_vulnerability"
  end
  # verify the required parameter 'component' is set
  if @api_client.config.client_side_validation && component.nil?
    fail ArgumentError, "Missing the required parameter 'component' when calling VulnerabilityApi.assign_vulnerability"
  end
  # resource path
  local_var_path = '/v1/vulnerability/source/{source}/vuln/{vulnId}/component/{component}'.sub('{' + 'source' + '}', CGI.escape(source.to_s)).sub('{' + 'vulnId' + '}', CGI.escape(vuln_id.to_s)).sub('{' + 'component' + '}', CGI.escape(component.to_s))

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

  # header parameters
  header_params = opts[:header_params] || {}

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

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

  # return_type
  return_type = opts[:return_type] 

  # auth_names
  auth_names = opts[:auth_names] || ['X-Api-Key']

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

#create_vulnerability(opts = {}) ⇒ Vulnerability

Creates a new vulnerability

Parameters:

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

    the optional parameters

Options Hash (opts):

Returns:



160
161
162
163
# File 'lib/dependency-tracker-client/api/vulnerability_api.rb', line 160

def create_vulnerability(opts = {})
  data, _status_code, _headers = create_vulnerability_with_http_info(opts)
  data
end

#create_vulnerability_with_http_info(opts = {}) ⇒ Array<(Vulnerability, Integer, Hash)>

Creates a new vulnerability

Parameters:

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

    the optional parameters

Options Hash (opts):

Returns:

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

    Vulnerability data, response status code and response headers



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
# File 'lib/dependency-tracker-client/api/vulnerability_api.rb', line 169

def create_vulnerability_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: VulnerabilityApi.create_vulnerability ...'
  end
  # resource path
  local_var_path = '/v1/vulnerability'

  # 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[:body] || @api_client.object_to_http_body(opts[:'body']) 

  # return_type
  return_type = opts[:return_type] || 'Vulnerability' 

  # auth_names
  auth_names = opts[:auth_names] || ['X-Api-Key']

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

#get_affected_project(source, vuln, opts = {}) ⇒ Array<Project>

Returns a list of all projects affected by a specific vulnerability

Parameters:

  • source (String)
  • vuln (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



219
220
221
222
# File 'lib/dependency-tracker-client/api/vulnerability_api.rb', line 219

def get_affected_project(source, vuln, opts = {})
  data, _status_code, _headers = get_affected_project_with_http_info(source, vuln, opts)
  data
end

#get_affected_project_with_http_info(source, vuln, opts = {}) ⇒ Array<(Array<Project>, Integer, Hash)>

Returns a list of all projects affected by a specific vulnerability

Parameters:

  • source (String)
  • vuln (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

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

    Array<Project> data, response status code and response headers



229
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
# File 'lib/dependency-tracker-client/api/vulnerability_api.rb', line 229

def get_affected_project_with_http_info(source, vuln, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: VulnerabilityApi.get_affected_project ...'
  end
  # verify the required parameter 'source' is set
  if @api_client.config.client_side_validation && source.nil?
    fail ArgumentError, "Missing the required parameter 'source' when calling VulnerabilityApi.get_affected_project"
  end
  # verify the required parameter 'vuln' is set
  if @api_client.config.client_side_validation && vuln.nil?
    fail ArgumentError, "Missing the required parameter 'vuln' when calling VulnerabilityApi.get_affected_project"
  end
  # resource path
  local_var_path = '/v1/vulnerability/source/{source}/vuln/{vuln}/projects'.sub('{' + 'source' + '}', CGI.escape(source.to_s)).sub('{' + 'vuln' + '}', CGI.escape(vuln.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[:body] 

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

  # auth_names
  auth_names = opts[:auth_names] || ['X-Api-Key']

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

#get_all_vulnerabilities(opts = {}) ⇒ Array<Vulnerability>

Returns a list of all vulnerabilities

Parameters:

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

    the optional parameters

Returns:



283
284
285
286
# File 'lib/dependency-tracker-client/api/vulnerability_api.rb', line 283

def get_all_vulnerabilities(opts = {})
  data, _status_code, _headers = get_all_vulnerabilities_with_http_info(opts)
  data
end

#get_all_vulnerabilities_with_http_info(opts = {}) ⇒ Array<(Array<Vulnerability>, Integer, Hash)>

Returns a list of all vulnerabilities

Parameters:

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

    the optional parameters

Returns:

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

    Array<Vulnerability> data, response status code and response headers



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
324
325
326
327
328
329
330
331
332
# File 'lib/dependency-tracker-client/api/vulnerability_api.rb', line 291

def get_all_vulnerabilities_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: VulnerabilityApi.get_all_vulnerabilities ...'
  end
  # resource path
  local_var_path = '/v1/vulnerability'

  # 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[:body] 

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

  # auth_names
  auth_names = opts[:auth_names] || ['X-Api-Key']

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

#get_vulnerabilities_by_component(ident, opts = {}) ⇒ Array<Vulnerability>

Returns a list of all vulnerabilities for a specific component A valid UUID of the component may be specified, or the MD5 or SHA1 hash of the component

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :suppressed (Boolean)

    Optionally includes suppressed vulnerabilities

Returns:



340
341
342
343
# File 'lib/dependency-tracker-client/api/vulnerability_api.rb', line 340

def get_vulnerabilities_by_component(ident, opts = {})
  data, _status_code, _headers = get_vulnerabilities_by_component_with_http_info(ident, opts)
  data
end

#get_vulnerabilities_by_component_with_http_info(ident, opts = {}) ⇒ Array<(Array<Vulnerability>, Integer, Hash)>

Returns a list of all vulnerabilities for a specific component A valid UUID of the component may be specified, or the MD5 or SHA1 hash of the component

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :suppressed (Boolean)

    Optionally includes suppressed vulnerabilities

Returns:

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

    Array<Vulnerability> data, response status code and response headers



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
397
# File 'lib/dependency-tracker-client/api/vulnerability_api.rb', line 351

def get_vulnerabilities_by_component_with_http_info(ident, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: VulnerabilityApi.get_vulnerabilities_by_component ...'
  end
  # verify the required parameter 'ident' is set
  if @api_client.config.client_side_validation && ident.nil?
    fail ArgumentError, "Missing the required parameter 'ident' when calling VulnerabilityApi.get_vulnerabilities_by_component"
  end
  # resource path
  local_var_path = '/v1/vulnerability/component/{ident}'.sub('{' + 'ident' + '}', CGI.escape(ident.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'suppressed'] = opts[:'suppressed'] if !opts[:'suppressed'].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[:body] 

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

  # auth_names
  auth_names = opts[:auth_names] || ['X-Api-Key']

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

#get_vulnerabilities_by_project(uuid, opts = {}) ⇒ Array<Vulnerability>

Returns a list of all vulnerabilities for a specific project

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :suppressed (Boolean)

    Optionally includes suppressed vulnerabilities

Returns:



404
405
406
407
# File 'lib/dependency-tracker-client/api/vulnerability_api.rb', line 404

def get_vulnerabilities_by_project(uuid, opts = {})
  data, _status_code, _headers = get_vulnerabilities_by_project_with_http_info(uuid, opts)
  data
end

#get_vulnerabilities_by_project_with_http_info(uuid, opts = {}) ⇒ Array<(Array<Vulnerability>, Integer, Hash)>

Returns a list of all vulnerabilities for a specific project

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :suppressed (Boolean)

    Optionally includes suppressed vulnerabilities

Returns:

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

    Array<Vulnerability> data, response status code and response headers



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
# File 'lib/dependency-tracker-client/api/vulnerability_api.rb', line 414

def get_vulnerabilities_by_project_with_http_info(uuid, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: VulnerabilityApi.get_vulnerabilities_by_project ...'
  end
  # verify the required parameter 'uuid' is set
  if @api_client.config.client_side_validation && uuid.nil?
    fail ArgumentError, "Missing the required parameter 'uuid' when calling VulnerabilityApi.get_vulnerabilities_by_project"
  end
  # resource path
  local_var_path = '/v1/vulnerability/project/{uuid}'.sub('{' + 'uuid' + '}', CGI.escape(uuid.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'suppressed'] = opts[:'suppressed'] if !opts[:'suppressed'].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[:body] 

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

  # auth_names
  auth_names = opts[:auth_names] || ['X-Api-Key']

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

#get_vulnerability_by_uuid(uuid, opts = {}) ⇒ Vulnerability

Returns a specific vulnerability

Parameters:

  • uuid (String)

    The UUID of the vulnerability

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

    the optional parameters

Returns:



466
467
468
469
# File 'lib/dependency-tracker-client/api/vulnerability_api.rb', line 466

def get_vulnerability_by_uuid(uuid, opts = {})
  data, _status_code, _headers = get_vulnerability_by_uuid_with_http_info(uuid, opts)
  data
end

#get_vulnerability_by_uuid_with_http_info(uuid, opts = {}) ⇒ Array<(Vulnerability, Integer, Hash)>

Returns a specific vulnerability

Parameters:

  • uuid (String)

    The UUID of the vulnerability

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

    the optional parameters

Returns:

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

    Vulnerability data, response status code and response headers



475
476
477
478
479
480
481
482
483
484
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
# File 'lib/dependency-tracker-client/api/vulnerability_api.rb', line 475

def get_vulnerability_by_uuid_with_http_info(uuid, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: VulnerabilityApi.get_vulnerability_by_uuid ...'
  end
  # verify the required parameter 'uuid' is set
  if @api_client.config.client_side_validation && uuid.nil?
    fail ArgumentError, "Missing the required parameter 'uuid' when calling VulnerabilityApi.get_vulnerability_by_uuid"
  end
  # resource path
  local_var_path = '/v1/vulnerability/{uuid}'.sub('{' + 'uuid' + '}', CGI.escape(uuid.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[:body] 

  # return_type
  return_type = opts[:return_type] || 'Vulnerability' 

  # auth_names
  auth_names = opts[:auth_names] || ['X-Api-Key']

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

#get_vulnerability_by_vuln_id(source, vuln, opts = {}) ⇒ Vulnerability

Returns a specific vulnerability

Parameters:

  • source (String)
  • vuln (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



527
528
529
530
# File 'lib/dependency-tracker-client/api/vulnerability_api.rb', line 527

def get_vulnerability_by_vuln_id(source, vuln, opts = {})
  data, _status_code, _headers = get_vulnerability_by_vuln_id_with_http_info(source, vuln, opts)
  data
end

#get_vulnerability_by_vuln_id_with_http_info(source, vuln, opts = {}) ⇒ Array<(Vulnerability, Integer, Hash)>

Returns a specific vulnerability

Parameters:

  • source (String)
  • vuln (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

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

    Vulnerability data, response status code and response headers



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
573
574
575
576
577
578
579
580
581
582
583
584
585
586
# File 'lib/dependency-tracker-client/api/vulnerability_api.rb', line 537

def get_vulnerability_by_vuln_id_with_http_info(source, vuln, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: VulnerabilityApi.get_vulnerability_by_vuln_id ...'
  end
  # verify the required parameter 'source' is set
  if @api_client.config.client_side_validation && source.nil?
    fail ArgumentError, "Missing the required parameter 'source' when calling VulnerabilityApi.get_vulnerability_by_vuln_id"
  end
  # verify the required parameter 'vuln' is set
  if @api_client.config.client_side_validation && vuln.nil?
    fail ArgumentError, "Missing the required parameter 'vuln' when calling VulnerabilityApi.get_vulnerability_by_vuln_id"
  end
  # resource path
  local_var_path = '/v1/vulnerability/source/{source}/vuln/{vuln}'.sub('{' + 'source' + '}', CGI.escape(source.to_s)).sub('{' + 'vuln' + '}', CGI.escape(vuln.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[:body] 

  # return_type
  return_type = opts[:return_type] || 'Vulnerability' 

  # auth_names
  auth_names = opts[:auth_names] || ['X-Api-Key']

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

#unassign_vulnerability(source, vuln_id, component, opts = {}) ⇒ nil

Removes assignment of a vulnerability from a component

Parameters:

  • source (String)

    The vulnerability source

  • vuln_id (String)

    The vulnId

  • component (String)

    The UUID of the component

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

    the optional parameters

Returns:

  • (nil)


594
595
596
597
# File 'lib/dependency-tracker-client/api/vulnerability_api.rb', line 594

def unassign_vulnerability(source, vuln_id, component, opts = {})
  unassign_vulnerability_with_http_info(source, vuln_id, component, opts)
  nil
end

#unassign_vulnerability1(uuid, component, opts = {}) ⇒ nil

Removes assignment of a vulnerability from a component

Parameters:

  • uuid (String)

    The UUID of the vulnerability

  • component (String)

    The UUID of the component

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

    the optional parameters

Returns:

  • (nil)


663
664
665
666
# File 'lib/dependency-tracker-client/api/vulnerability_api.rb', line 663

def unassign_vulnerability1(uuid, component, opts = {})
  unassign_vulnerability1_with_http_info(uuid, component, opts)
  nil
end

#unassign_vulnerability1_with_http_info(uuid, component, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Removes assignment of a vulnerability from a component

Parameters:

  • uuid (String)

    The UUID of the vulnerability

  • component (String)

    The UUID of the component

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



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
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
# File 'lib/dependency-tracker-client/api/vulnerability_api.rb', line 673

def unassign_vulnerability1_with_http_info(uuid, component, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: VulnerabilityApi.unassign_vulnerability1 ...'
  end
  # verify the required parameter 'uuid' is set
  if @api_client.config.client_side_validation && uuid.nil?
    fail ArgumentError, "Missing the required parameter 'uuid' when calling VulnerabilityApi.unassign_vulnerability1"
  end
  # verify the required parameter 'component' is set
  if @api_client.config.client_side_validation && component.nil?
    fail ArgumentError, "Missing the required parameter 'component' when calling VulnerabilityApi.unassign_vulnerability1"
  end
  # resource path
  local_var_path = '/v1/vulnerability/{uuid}/component/{component}'.sub('{' + 'uuid' + '}', CGI.escape(uuid.to_s)).sub('{' + 'component' + '}', CGI.escape(component.to_s))

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

  # header parameters
  header_params = opts[:header_params] || {}

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

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

  # return_type
  return_type = opts[:return_type] 

  # auth_names
  auth_names = opts[:auth_names] || ['X-Api-Key']

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

#unassign_vulnerability_with_http_info(source, vuln_id, component, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Removes assignment of a vulnerability from a component

Parameters:

  • source (String)

    The vulnerability source

  • vuln_id (String)

    The vulnId

  • component (String)

    The UUID of the component

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



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
648
649
650
651
652
653
654
655
656
# File 'lib/dependency-tracker-client/api/vulnerability_api.rb', line 605

def unassign_vulnerability_with_http_info(source, vuln_id, component, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: VulnerabilityApi.unassign_vulnerability ...'
  end
  # verify the required parameter 'source' is set
  if @api_client.config.client_side_validation && source.nil?
    fail ArgumentError, "Missing the required parameter 'source' when calling VulnerabilityApi.unassign_vulnerability"
  end
  # verify the required parameter 'vuln_id' is set
  if @api_client.config.client_side_validation && vuln_id.nil?
    fail ArgumentError, "Missing the required parameter 'vuln_id' when calling VulnerabilityApi.unassign_vulnerability"
  end
  # verify the required parameter 'component' is set
  if @api_client.config.client_side_validation && component.nil?
    fail ArgumentError, "Missing the required parameter 'component' when calling VulnerabilityApi.unassign_vulnerability"
  end
  # resource path
  local_var_path = '/v1/vulnerability/source/{source}/vuln/{vulnId}/component/{component}'.sub('{' + 'source' + '}', CGI.escape(source.to_s)).sub('{' + 'vulnId' + '}', CGI.escape(vuln_id.to_s)).sub('{' + 'component' + '}', CGI.escape(component.to_s))

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

  # header parameters
  header_params = opts[:header_params] || {}

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

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

  # return_type
  return_type = opts[:return_type] 

  # auth_names
  auth_names = opts[:auth_names] || ['X-Api-Key']

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

#update_vulnerability(opts = {}) ⇒ Project

Updates an internal vulnerability

Parameters:

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

    the optional parameters

Options Hash (opts):

Returns:



726
727
728
729
# File 'lib/dependency-tracker-client/api/vulnerability_api.rb', line 726

def update_vulnerability(opts = {})
  data, _status_code, _headers = update_vulnerability_with_http_info(opts)
  data
end

#update_vulnerability_with_http_info(opts = {}) ⇒ Array<(Project, Integer, Hash)>

Updates an internal vulnerability

Parameters:

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

    the optional parameters

Options Hash (opts):

Returns:

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

    Project data, response status code and response headers



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
# File 'lib/dependency-tracker-client/api/vulnerability_api.rb', line 735

def update_vulnerability_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: VulnerabilityApi.update_vulnerability ...'
  end
  # resource path
  local_var_path = '/v1/vulnerability'

  # 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[:body] || @api_client.object_to_http_body(opts[:'body']) 

  # return_type
  return_type = opts[:return_type] || 'Project' 

  # auth_names
  auth_names = opts[:auth_names] || ['X-Api-Key']

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