class DependencyTracker::BomApi
Attributes
Public Class Methods
# File lib/dependency-tracker-client/api/bom_api.rb, line 19 def initialize(api_client = ApiClient.default) @api_client = api_client end
Public Instance Methods
Returns dependency metadata for a specific component in CycloneDX format @param uuid [String] The UUID of the project to export @param [Hash] opts the optional parameters @return [String]
# File lib/dependency-tracker-client/api/bom_api.rb, line 26 def export_component_as_cyclone_dx(uuid, opts = {}) data, _status_code, _headers = export_component_as_cyclone_dx_with_http_info(uuid, opts) data end
Returns dependency metadata for a specific component in CycloneDX format @param uuid [String] The UUID of the project to export @param [Hash] opts the optional parameters @return [Array<(String, Integer, Hash)>] String data, response status code and response headers
# File lib/dependency-tracker-client/api/bom_api.rb, line 35 def export_component_as_cyclone_dx_with_http_info(uuid, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: BomApi.export_component_as_cyclone_dx ...' 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 BomApi.export_component_as_cyclone_dx" end # resource path local_var_path = '/v1/bom/cyclonedx/component/{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/xml']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] # return_type return_type = opts[:return_type] || 'String' # 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: BomApi#export_component_as_cyclone_dx\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Returns dependency metadata for all components in CycloneDX format @param [Hash] opts the optional parameters @return [String]
# File lib/dependency-tracker-client/api/bom_api.rb, line 85 def export_components_as_cyclone_dx(opts = {}) data, _status_code, _headers = export_components_as_cyclone_dx_with_http_info(opts) data end
Returns dependency metadata for all components in CycloneDX format @param [Hash] opts the optional parameters @return [Array<(String, Integer, Hash)>] String data, response status code and response headers
# File lib/dependency-tracker-client/api/bom_api.rb, line 93 def export_components_as_cyclone_dx_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: BomApi.export_components_as_cyclone_dx ...' end # resource path local_var_path = '/v1/bom/cyclonedx/components' # 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/xml']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] # return_type return_type = opts[:return_type] || 'String' # 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: BomApi#export_components_as_cyclone_dx\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Returns dependency metadata for a project in CycloneDX format @param uuid [String] The UUID of the project to export @param [Hash] opts the optional parameters @return [String]
# File lib/dependency-tracker-client/api/bom_api.rb, line 140 def export_project_as_cyclone_dx(uuid, opts = {}) data, _status_code, _headers = export_project_as_cyclone_dx_with_http_info(uuid, opts) data end
Returns dependency metadata for a project in CycloneDX format @param uuid [String] The UUID of the project to export @param [Hash] opts the optional parameters @return [Array<(String, Integer, Hash)>] String data, response status code and response headers
# File lib/dependency-tracker-client/api/bom_api.rb, line 149 def export_project_as_cyclone_dx_with_http_info(uuid, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: BomApi.export_project_as_cyclone_dx ...' 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 BomApi.export_project_as_cyclone_dx" end # resource path local_var_path = '/v1/bom/cyclonedx/project/{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/xml']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] # return_type return_type = opts[:return_type] || 'String' # 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: BomApi#export_project_as_cyclone_dx\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Determines if there are any tasks associated with the token that are being processed, or in the queue to be processed. This endpoint is intended to be used in conjunction with uploading a supported BOM document. Upon upload, a token will be returned. The token can then be queried using this endpoint to determine if any tasks (such as vulnerability analysis) is being performed on the BOM. A value of true indicates processing is occurring. A value of false indicates that no processing is occurring for the specified token. However, a value of false also does not confirm the token is valid, only that no processing is associated with the specified token. @param uuid [String] The UUID of the token to query @param [Hash] opts the optional parameters @return [nil]
# File lib/dependency-tracker-client/api/bom_api.rb, line 201 def is_token_being_processed(uuid, opts = {}) is_token_being_processed_with_http_info(uuid, opts) nil end
Determines if there are any tasks associated with the token that are being processed, or in the queue to be processed. This endpoint is intended to be used in conjunction with uploading a supported BOM document. Upon upload, a token will be returned. The token can then be queried using this endpoint to determine if any tasks (such as vulnerability analysis) is being performed on the BOM. A value of true indicates processing is occurring. A value of false indicates that no processing is occurring for the specified token. However, a value of false also does not confirm the token is valid, only that no processing is associated with the specified token. @param uuid [String] The UUID of the token to query @param [Hash] opts the optional parameters @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
# File lib/dependency-tracker-client/api/bom_api.rb, line 211 def is_token_being_processed_with_http_info(uuid, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: BomApi.is_token_being_processed ...' 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 BomApi.is_token_being_processed" end # resource path local_var_path = '/v1/bom/token/{uuid}'.sub('{' + 'uuid' + '}', CGI.escape(uuid.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(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: BomApi#is_token_being_processed\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Upload a supported bill of material format document Expects CycloneDX or SPDX (text or RDF) along and a valid project UUID. If a UUID is not specified, than the projectName and projectVersion must be specified. Optionally, if autoCreate is specified and 'true' and the project does not exist, the project will be created. In this scenario, the principal making the request will additionally need the PORTFOLIO_MANAGEMENT or PROJECT_CREATION_UPLOAD permission. @param [Hash] opts the optional parameters @option opts [String] :project @option opts [Boolean] :auto_create (default to false) @option opts [String] :project_name @option opts [String] :project_version @return [nil]
# File lib/dependency-tracker-client/api/bom_api.rb, line 264 def upload_bom(opts = {}) upload_bom_with_http_info(opts) nil end
Upload a supported bill of material format document Expects CycloneDX or SPDX (text or RDF) along and a valid project UUID. If a UUID is not specified, than the projectName and projectVersion must be specified. Optionally, if autoCreate is specified and 'true' and the project does not exist, the project will be created. In this scenario, the principal making the request will additionally need the PORTFOLIO_MANAGEMENT or PROJECT_CREATION_UPLOAD permission. @param [Hash] opts the optional parameters @option opts [BomSubmitRequest] :body @return [nil]
# File lib/dependency-tracker-client/api/bom_api.rb, line 329 def upload_bom1(opts = {}) upload_bom1_with_http_info(opts) nil end
Upload a supported bill of material format document Expects CycloneDX or SPDX (text or RDF) along and a valid project UUID. If a UUID is not specified, than the projectName and projectVersion must be specified. Optionally, if autoCreate is specified and 'true' and the project does not exist, the project will be created. In this scenario, the principal making the request will additionally need the PORTFOLIO_MANAGEMENT or PROJECT_CREATION_UPLOAD permission. @param [Hash] opts the optional parameters @option opts [BomSubmitRequest] :body @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
# File lib/dependency-tracker-client/api/bom_api.rb, line 339 def upload_bom1_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: BomApi.upload_bom1 ...' end # resource path local_var_path = '/v1/bom' # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # 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] # 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: BomApi#upload_bom1\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Upload a supported bill of material format document Expects CycloneDX or SPDX (text or RDF) along and a valid project UUID. If a UUID is not specified, than the projectName and projectVersion must be specified. Optionally, if autoCreate is specified and 'true' and the project does not exist, the project will be created. In this scenario, the principal making the request will additionally need the PORTFOLIO_MANAGEMENT or PROJECT_CREATION_UPLOAD permission. @param [Hash] opts the optional parameters @option opts [String] :project @option opts [Boolean] :auto_create @option opts [String] :project_name @option opts [String] :project_version @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
# File lib/dependency-tracker-client/api/bom_api.rb, line 277 def upload_bom_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: BomApi.upload_bom ...' end # resource path local_var_path = '/v1/bom' # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data']) # form parameters form_params = opts[:form_params] || {} form_params['project'] = opts[:'project'] if !opts[:'project'].nil? form_params['autoCreate'] = opts[:'auto_create'] if !opts[:'auto_create'].nil? form_params['projectName'] = opts[:'project_name'] if !opts[:'project_name'].nil? form_params['projectVersion'] = opts[:'project_version'] if !opts[:'project_version'].nil? # 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: BomApi#upload_bom\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end