class DependencyTracker::VulnerabilityApi

Attributes

api_client[RW]

Public Class Methods

new(api_client = ApiClient.default) click to toggle source
# File lib/dependency-tracker-client/api/vulnerability_api.rb, line 19
def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Public Instance Methods

assign_vulnerability(source, vuln_id, component, opts = {}) click to toggle source

Assigns a vulnerability to a component @param source [String] The vulnerability source @param vuln_id [String] The vulnId @param component [String] The UUID of the component @param [Hash] opts the optional parameters @return [nil]

# 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 = {}) click to toggle source

Assigns a vulnerability to a component @param uuid [String] The UUID of the vulnerability @param component [String] The UUID of the component @param [Hash] opts the optional parameters @return [nil]

# 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 = {}) click to toggle source

Assigns a vulnerability to a component @param uuid [String] The UUID of the vulnerability @param component [String] The UUID of the component @param [Hash] opts the optional parameters @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers

# 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 = {}) click to toggle source

Assigns a vulnerability to a component @param source [String] The vulnerability source @param vuln_id [String] The vulnId @param component [String] The UUID of the component @param [Hash] opts the optional parameters @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers

# 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 = {}) click to toggle source

Creates a new vulnerability @param [Hash] opts the optional parameters @option opts [Vulnerability] :body @return [Vulnerability]

# 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 = {}) click to toggle source

Creates a new vulnerability @param [Hash] opts the optional parameters @option opts [Vulnerability] :body @return [Array<(Vulnerability, Integer, Hash)>] Vulnerability data, response status code and response headers

# 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 = {}) click to toggle source

Returns a list of all projects affected by a specific vulnerability @param source [String] @param vuln [String] @param [Hash] opts the optional parameters @return [Array<Project>]

# 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 = {}) click to toggle source

Returns a list of all projects affected by a specific vulnerability @param source [String] @param vuln [String] @param [Hash] opts the optional parameters @return [Array<(Array<Project>, Integer, Hash)>] Array<Project> data, response status code and response headers

# 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 = {}) click to toggle source

Returns a list of all vulnerabilities @param [Hash] opts the optional parameters @return [Array<Vulnerability>]

# 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 = {}) click to toggle source

Returns a list of all vulnerabilities @param [Hash] opts the optional parameters @return [Array<(Array<Vulnerability>, Integer, Hash)>] Array<Vulnerability> data, response status code and response headers

# 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 = {}) click to toggle source

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 @param ident [String] @param [Hash] opts the optional parameters @option opts [Boolean] :suppressed Optionally includes suppressed vulnerabilities @return [Array<Vulnerability>]

# 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 = {}) click to toggle source

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 @param ident [String] @param [Hash] opts the optional parameters @option opts [Boolean] :suppressed Optionally includes suppressed vulnerabilities @return [Array<(Array<Vulnerability>, Integer, Hash)>] Array<Vulnerability> data, response status code and response headers

# 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 = {}) click to toggle source

Returns a list of all vulnerabilities for a specific project @param uuid [String] @param [Hash] opts the optional parameters @option opts [Boolean] :suppressed Optionally includes suppressed vulnerabilities @return [Array<Vulnerability>]

# 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 = {}) click to toggle source

Returns a list of all vulnerabilities for a specific project @param uuid [String] @param [Hash] opts the optional parameters @option opts [Boolean] :suppressed Optionally includes suppressed vulnerabilities @return [Array<(Array<Vulnerability>, Integer, Hash)>] Array<Vulnerability> data, response status code and response headers

# 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 = {}) click to toggle source

Returns a specific vulnerability @param uuid [String] The UUID of the vulnerability @param [Hash] opts the optional parameters @return [Vulnerability]

# 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 = {}) click to toggle source

Returns a specific vulnerability @param uuid [String] The UUID of the vulnerability @param [Hash] opts the optional parameters @return [Array<(Vulnerability, Integer, Hash)>] Vulnerability data, response status code and response headers

# 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 = {}) click to toggle source

Returns a specific vulnerability @param source [String] @param vuln [String] @param [Hash] opts the optional parameters @return [Vulnerability]

# 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 = {}) click to toggle source

Returns a specific vulnerability @param source [String] @param vuln [String] @param [Hash] opts the optional parameters @return [Array<(Vulnerability, Integer, Hash)>] Vulnerability data, response status code and response headers

# 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 = {}) click to toggle source

Removes assignment of a vulnerability from a component @param source [String] The vulnerability source @param vuln_id [String] The vulnId @param component [String] The UUID of the component @param [Hash] opts the optional parameters @return [nil]

# 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 = {}) click to toggle source

Removes assignment of a vulnerability from a component @param uuid [String] The UUID of the vulnerability @param component [String] The UUID of the component @param [Hash] opts the optional parameters @return [nil]

# 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 = {}) click to toggle source

Removes assignment of a vulnerability from a component @param uuid [String] The UUID of the vulnerability @param component [String] The UUID of the component @param [Hash] opts the optional parameters @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers

# 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 = {}) click to toggle source

Removes assignment of a vulnerability from a component @param source [String] The vulnerability source @param vuln_id [String] The vulnId @param component [String] The UUID of the component @param [Hash] opts the optional parameters @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers

# 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 = {}) click to toggle source

Updates an internal vulnerability @param [Hash] opts the optional parameters @option opts [Vulnerability] :body @return [Project]

# 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 = {}) click to toggle source

Updates an internal vulnerability @param [Hash] opts the optional parameters @option opts [Vulnerability] :body @return [Array<(Project, Integer, Hash)>] Project data, response status code and response headers

# 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