Class: DependencyTracker::BomApi
- Inherits:
-
Object
- Object
- DependencyTracker::BomApi
- Defined in:
- lib/dependency-tracker-client/api/bom_api.rb
Instance Attribute Summary collapse
-
#api_client ⇒ Object
Returns the value of attribute api_client.
Instance Method Summary collapse
-
#export_component_as_cyclone_dx(uuid, opts = {}) ⇒ String
Returns dependency metadata for a specific component in CycloneDX format.
-
#export_component_as_cyclone_dx_with_http_info(uuid, opts = {}) ⇒ Array<(String, Integer, Hash)>
Returns dependency metadata for a specific component in CycloneDX format.
-
#export_components_as_cyclone_dx(opts = {}) ⇒ String
Returns dependency metadata for all components in CycloneDX format.
-
#export_components_as_cyclone_dx_with_http_info(opts = {}) ⇒ Array<(String, Integer, Hash)>
Returns dependency metadata for all components in CycloneDX format.
-
#export_project_as_cyclone_dx(uuid, opts = {}) ⇒ String
Returns dependency metadata for a project in CycloneDX format.
-
#export_project_as_cyclone_dx_with_http_info(uuid, opts = {}) ⇒ Array<(String, Integer, Hash)>
Returns dependency metadata for a project in CycloneDX format.
-
#initialize(api_client = ApiClient.default) ⇒ BomApi
constructor
A new instance of BomApi.
-
#is_token_being_processed(uuid, opts = {}) ⇒ nil
Determines if there are any tasks associated with the token that are being processed, or in the queue to be processed.
-
#is_token_being_processed_with_http_info(uuid, opts = {}) ⇒ Array<(nil, Integer, Hash)>
Determines if there are any tasks associated with the token that are being processed, or in the queue to be processed.
-
#upload_bom(opts = {}) ⇒ nil
Upload a supported bill of material format document Expects CycloneDX or SPDX (text or RDF) along and a valid project UUID.
-
#upload_bom1(opts = {}) ⇒ nil
Upload a supported bill of material format document Expects CycloneDX or SPDX (text or RDF) along and a valid project UUID.
-
#upload_bom1_with_http_info(opts = {}) ⇒ Array<(nil, Integer, Hash)>
Upload a supported bill of material format document Expects CycloneDX or SPDX (text or RDF) along and a valid project UUID.
-
#upload_bom_with_http_info(opts = {}) ⇒ Array<(nil, Integer, Hash)>
Upload a supported bill of material format document Expects CycloneDX or SPDX (text or RDF) along and a valid project UUID.
Constructor Details
#initialize(api_client = ApiClient.default) ⇒ BomApi
Returns a new instance of BomApi.
19 20 21 |
# File 'lib/dependency-tracker-client/api/bom_api.rb', line 19 def initialize(api_client = ApiClient.default) @api_client = api_client end |
Instance Attribute Details
#api_client ⇒ Object
Returns the value of attribute api_client.
17 18 19 |
# File 'lib/dependency-tracker-client/api/bom_api.rb', line 17 def api_client @api_client end |
Instance Method Details
#export_component_as_cyclone_dx(uuid, opts = {}) ⇒ String
Returns dependency metadata for a specific component in CycloneDX format
26 27 28 29 |
# 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 |
#export_component_as_cyclone_dx_with_http_info(uuid, opts = {}) ⇒ Array<(String, Integer, Hash)>
Returns dependency metadata for a specific component in CycloneDX format
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 |
# 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'] = 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, ) 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 |
#export_components_as_cyclone_dx(opts = {}) ⇒ String
Returns dependency metadata for all components in CycloneDX format
85 86 87 88 |
# 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 |
#export_components_as_cyclone_dx_with_http_info(opts = {}) ⇒ Array<(String, Integer, Hash)>
Returns dependency metadata for all components in CycloneDX format
93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 |
# 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'] = 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, ) 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 |
#export_project_as_cyclone_dx(uuid, opts = {}) ⇒ String
Returns dependency metadata for a project in CycloneDX format
140 141 142 143 |
# 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 |
#export_project_as_cyclone_dx_with_http_info(uuid, opts = {}) ⇒ Array<(String, Integer, Hash)>
Returns dependency metadata for a project in CycloneDX format
149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 |
# 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'] = 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, ) 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 |
#is_token_being_processed(uuid, opts = {}) ⇒ nil
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.
201 202 203 204 |
# 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 |
#is_token_being_processed_with_http_info(uuid, opts = {}) ⇒ Array<(nil, Integer, Hash)>
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.
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 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 |
# 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'] = 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, ) 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_bom(opts = {}) ⇒ nil
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.
264 265 266 267 |
# File 'lib/dependency-tracker-client/api/bom_api.rb', line 264 def upload_bom(opts = {}) upload_bom_with_http_info(opts) nil end |
#upload_bom1(opts = {}) ⇒ nil
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.
329 330 331 332 |
# File 'lib/dependency-tracker-client/api/bom_api.rb', line 329 def upload_bom1(opts = {}) upload_bom1_with_http_info(opts) nil end |
#upload_bom1_with_http_info(opts = {}) ⇒ Array<(nil, Integer, Hash)>
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.
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 371 372 373 374 375 376 377 378 379 380 |
# 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'] = 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, ) 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_bom_with_http_info(opts = {}) ⇒ Array<(nil, Integer, Hash)>
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.
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 311 312 313 314 315 316 317 318 319 320 321 322 |
# 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'] = 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, ) 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 |