dependency-tracker-client 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/Gemfile +9 -0
- data/LICENSE +201 -0
- data/README.md +276 -0
- data/Rakefile +10 -0
- data/dependency-tracker-client.gemspec +39 -0
- data/docs/About.md +25 -0
- data/docs/Analysis.md +21 -0
- data/docs/AnalysisApi.md +177 -0
- data/docs/AnalysisComment.md +21 -0
- data/docs/AnalysisRequest.md +27 -0
- data/docs/ApiKey.md +17 -0
- data/docs/BadgeApi.md +102 -0
- data/docs/BodyPart.md +31 -0
- data/docs/BomApi.md +335 -0
- data/docs/BomSubmitRequest.md +25 -0
- data/docs/CalculatorApi.md +61 -0
- data/docs/CloneProjectRequest.md +19 -0
- data/docs/Component.md +69 -0
- data/docs/ComponentApi.md +373 -0
- data/docs/ComponentMetrics.md +43 -0
- data/docs/ConfigProperty.md +25 -0
- data/docs/ConfigPropertyApi.md +167 -0
- data/docs/ContentDisposition.md +29 -0
- data/docs/Cwe.md +19 -0
- data/docs/CweApi.md +110 -0
- data/docs/DefaultApi.md +434 -0
- data/docs/Dependency.md +27 -0
- data/docs/DependencyApi.md +222 -0
- data/docs/DependencyMetrics.md +45 -0
- data/docs/DependencyRequest.md +21 -0
- data/docs/Finding.md +23 -0
- data/docs/FindingApi.md +113 -0
- data/docs/FormDataBodyPart.md +39 -0
- data/docs/FormDataContentDisposition.md +31 -0
- data/docs/FormDataMultiPart.md +35 -0
- data/docs/Framework.md +23 -0
- data/docs/IdentifiableObject.md +17 -0
- data/docs/LdapApi.md +220 -0
- data/docs/LdapUser.md +25 -0
- data/docs/License.md +37 -0
- data/docs/LicenseApi.md +159 -0
- data/docs/ManagedUser.md +37 -0
- data/docs/MappedLdapGroup.md +19 -0
- data/docs/MappedLdapGroupRequest.md +19 -0
- data/docs/MediaType.md +25 -0
- data/docs/MetricsApi.md +922 -0
- data/docs/MultiPart.md +33 -0
- data/docs/NotificationPublisher.md +29 -0
- data/docs/NotificationRule.md +35 -0
- data/docs/PackageURL.md +29 -0
- data/docs/ParameterizedHeader.md +19 -0
- data/docs/Permission.md +19 -0
- data/docs/PermissionApi.md +279 -0
- data/docs/PortfolioMetrics.md +53 -0
- data/docs/Project.md +43 -0
- data/docs/ProjectApi.md +445 -0
- data/docs/ProjectMetrics.md +47 -0
- data/docs/ProjectProperty.md +27 -0
- data/docs/ProjectPropertyApi.md +232 -0
- data/docs/Repository.md +29 -0
- data/docs/RepositoryApi.md +325 -0
- data/docs/RepositoryMetaComponent.md +27 -0
- data/docs/Score.md +23 -0
- data/docs/SearchApi.md +120 -0
- data/docs/SearchResult.md +17 -0
- data/docs/Tag.md +19 -0
- data/docs/Team.md +29 -0
- data/docs/TeamApi.md +432 -0
- data/docs/UserApi.md +715 -0
- data/docs/UserPrincipal.md +27 -0
- data/docs/VersionApi.md +52 -0
- data/docs/Vulnerability.md +69 -0
- data/docs/VulnerabilityApi.md +666 -0
- data/docs/VulnerabilityMetrics.md +23 -0
- data/docs/VulnerableSoftware.md +69 -0
- data/lib/dependency-tracker-client/api/analysis_api.rb +209 -0
- data/lib/dependency-tracker-client/api/badge_api.rb +148 -0
- data/lib/dependency-tracker-client/api/bom_api.rb +382 -0
- data/lib/dependency-tracker-client/api/calculator_api.rb +83 -0
- data/lib/dependency-tracker-client/api/component_api.rb +422 -0
- data/lib/dependency-tracker-client/api/config_property_api.rb +192 -0
- data/lib/dependency-tracker-client/api/cwe_api.rb +136 -0
- data/lib/dependency-tracker-client/api/default_api.rb +491 -0
- data/lib/dependency-tracker-client/api/dependency_api.rb +254 -0
- data/lib/dependency-tracker-client/api/finding_api.rb +140 -0
- data/lib/dependency-tracker-client/api/ldap_api.rb +254 -0
- data/lib/dependency-tracker-client/api/license_api.rb +190 -0
- data/lib/dependency-tracker-client/api/metrics_api.rb +1086 -0
- data/lib/dependency-tracker-client/api/permission_api.rb +342 -0
- data/lib/dependency-tracker-client/api/project_api.rb +504 -0
- data/lib/dependency-tracker-client/api/project_property_api.rb +274 -0
- data/lib/dependency-tracker-client/api/repository_api.rb +376 -0
- data/lib/dependency-tracker-client/api/search_api.rb +143 -0
- data/lib/dependency-tracker-client/api/team_api.rb +486 -0
- data/lib/dependency-tracker-client/api/user_api.rb +796 -0
- data/lib/dependency-tracker-client/api/version_api.rb +78 -0
- data/lib/dependency-tracker-client/api/vulnerability_api.rb +780 -0
- data/lib/dependency-tracker-client/api_client.rb +388 -0
- data/lib/dependency-tracker-client/api_error.rb +57 -0
- data/lib/dependency-tracker-client/configuration.rb +261 -0
- data/lib/dependency-tracker-client/models/about.rb +242 -0
- data/lib/dependency-tracker-client/models/analysis.rb +265 -0
- data/lib/dependency-tracker-client/models/analysis_comment.rb +234 -0
- data/lib/dependency-tracker-client/models/analysis_request.rb +371 -0
- data/lib/dependency-tracker-client/models/api_key.rb +250 -0
- data/lib/dependency-tracker-client/models/body_part.rb +273 -0
- data/lib/dependency-tracker-client/models/bom_submit_request.rb +328 -0
- data/lib/dependency-tracker-client/models/clone_project_request.rb +267 -0
- data/lib/dependency-tracker-client/models/component.rb +900 -0
- data/lib/dependency-tracker-client/models/component_metrics.rb +338 -0
- data/lib/dependency-tracker-client/models/config_property.rb +421 -0
- data/lib/dependency-tracker-client/models/content_disposition.rb +262 -0
- data/lib/dependency-tracker-client/models/cwe.rb +259 -0
- data/lib/dependency-tracker-client/models/dependency.rb +266 -0
- data/lib/dependency-tracker-client/models/dependency_metrics.rb +352 -0
- data/lib/dependency-tracker-client/models/dependency_request.rb +257 -0
- data/lib/dependency-tracker-client/models/finding.rb +239 -0
- data/lib/dependency-tracker-client/models/form_data_body_part.rb +309 -0
- data/lib/dependency-tracker-client/models/form_data_content_disposition.rb +271 -0
- data/lib/dependency-tracker-client/models/form_data_multi_part.rb +295 -0
- data/lib/dependency-tracker-client/models/framework.rb +233 -0
- data/lib/dependency-tracker-client/models/identifiable_object.rb +206 -0
- data/lib/dependency-tracker-client/models/ldap_user.rb +351 -0
- data/lib/dependency-tracker-client/models/license.rb +373 -0
- data/lib/dependency-tracker-client/models/managed_user.rb +480 -0
- data/lib/dependency-tracker-client/models/mapped_ldap_group.rb +255 -0
- data/lib/dependency-tracker-client/models/mapped_ldap_group_request.rb +267 -0
- data/lib/dependency-tracker-client/models/media_type.rb +244 -0
- data/lib/dependency-tracker-client/models/multi_part.rb +284 -0
- data/lib/dependency-tracker-client/models/notification_publisher.rb +388 -0
- data/lib/dependency-tracker-client/models/notification_rule.rb +426 -0
- data/lib/dependency-tracker-client/models/package_url.rb +262 -0
- data/lib/dependency-tracker-client/models/parameterized_header.rb +217 -0
- data/lib/dependency-tracker-client/models/permission.rb +250 -0
- data/lib/dependency-tracker-client/models/portfolio_metrics.rb +378 -0
- data/lib/dependency-tracker-client/models/project.rb +420 -0
- data/lib/dependency-tracker-client/models/project_metrics.rb +356 -0
- data/lib/dependency-tracker-client/models/project_property.rb +430 -0
- data/lib/dependency-tracker-client/models/repository.rb +319 -0
- data/lib/dependency-tracker-client/models/repository_meta_component.rb +305 -0
- data/lib/dependency-tracker-client/models/score.rb +233 -0
- data/lib/dependency-tracker-client/models/search_result.rb +208 -0
- data/lib/dependency-tracker-client/models/tag.rb +252 -0
- data/lib/dependency-tracker-client/models/team.rb +310 -0
- data/lib/dependency-tracker-client/models/user_principal.rb +255 -0
- data/lib/dependency-tracker-client/models/vulnerability.rb +729 -0
- data/lib/dependency-tracker-client/models/vulnerability_metrics.rb +238 -0
- data/lib/dependency-tracker-client/models/vulnerable_software.rb +442 -0
- data/lib/dependency-tracker-client/version.rb +15 -0
- data/lib/dependency-tracker-client.rb +109 -0
- data/pkg/dependency-tracker-client-1.0.0.gem +0 -0
- data/spec/api/analysis_api_spec.rb +70 -0
- data/spec/api/badge_api_spec.rb +58 -0
- data/spec/api/bom_api_spec.rb +106 -0
- data/spec/api/calculator_api_spec.rb +46 -0
- data/spec/api/component_api_spec.rb +110 -0
- data/spec/api/config_property_api_spec.rb +67 -0
- data/spec/api/cwe_api_spec.rb +56 -0
- data/spec/api/default_api_spec.rb +123 -0
- data/spec/api/dependency_api_spec.rb +79 -0
- data/spec/api/finding_api_spec.rb +57 -0
- data/spec/api/ldap_api_spec.rb +79 -0
- data/spec/api/license_api_spec.rb +66 -0
- data/spec/api/metrics_api_spec.rb +233 -0
- data/spec/api/permission_api_spec.rb +94 -0
- data/spec/api/project_api_spec.rb +126 -0
- data/spec/api/project_property_api_spec.rb +82 -0
- data/spec/api/repository_api_spec.rb +100 -0
- data/spec/api/search_api_spec.rb +59 -0
- data/spec/api/team_api_spec.rb +122 -0
- data/spec/api/user_api_spec.rb +183 -0
- data/spec/api/version_api_spec.rb +46 -0
- data/spec/api/vulnerability_api_spec.rb +177 -0
- data/spec/api_client_spec.rb +226 -0
- data/spec/configuration_spec.rb +42 -0
- data/spec/models/about_spec.rb +65 -0
- data/spec/models/analysis_comment_spec.rb +53 -0
- data/spec/models/analysis_request_spec.rb +75 -0
- data/spec/models/analysis_spec.rb +57 -0
- data/spec/models/api_key_spec.rb +41 -0
- data/spec/models/body_part_spec.rb +83 -0
- data/spec/models/bom_submit_request_spec.rb +65 -0
- data/spec/models/clone_project_request_spec.rb +47 -0
- data/spec/models/component_metrics_spec.rb +119 -0
- data/spec/models/component_spec.rb +201 -0
- data/spec/models/config_property_spec.rb +69 -0
- data/spec/models/content_disposition_spec.rb +77 -0
- data/spec/models/cwe_spec.rb +47 -0
- data/spec/models/dependency_metrics_spec.rb +125 -0
- data/spec/models/dependency_request_spec.rb +53 -0
- data/spec/models/dependency_spec.rb +71 -0
- data/spec/models/finding_spec.rb +59 -0
- data/spec/models/form_data_body_part_spec.rb +107 -0
- data/spec/models/form_data_content_disposition_spec.rb +83 -0
- data/spec/models/form_data_multi_part_spec.rb +95 -0
- data/spec/models/framework_spec.rb +59 -0
- data/spec/models/identifiable_object_spec.rb +41 -0
- data/spec/models/ldap_user_spec.rb +65 -0
- data/spec/models/license_spec.rb +101 -0
- data/spec/models/managed_user_spec.rb +101 -0
- data/spec/models/mapped_ldap_group_request_spec.rb +47 -0
- data/spec/models/mapped_ldap_group_spec.rb +47 -0
- data/spec/models/media_type_spec.rb +65 -0
- data/spec/models/multi_part_spec.rb +89 -0
- data/spec/models/notification_publisher_spec.rb +77 -0
- data/spec/models/notification_rule_spec.rb +107 -0
- data/spec/models/package_url_spec.rb +77 -0
- data/spec/models/parameterized_header_spec.rb +47 -0
- data/spec/models/permission_spec.rb +47 -0
- data/spec/models/portfolio_metrics_spec.rb +149 -0
- data/spec/models/project_metrics_spec.rb +131 -0
- data/spec/models/project_property_spec.rb +75 -0
- data/spec/models/project_spec.rb +119 -0
- data/spec/models/repository_meta_component_spec.rb +75 -0
- data/spec/models/repository_spec.rb +81 -0
- data/spec/models/score_spec.rb +59 -0
- data/spec/models/search_result_spec.rb +41 -0
- data/spec/models/tag_spec.rb +47 -0
- data/spec/models/team_spec.rb +77 -0
- data/spec/models/user_principal_spec.rb +71 -0
- data/spec/models/vulnerability_metrics_spec.rb +59 -0
- data/spec/models/vulnerability_spec.rb +201 -0
- data/spec/models/vulnerable_software_spec.rb +197 -0
- data/spec/spec_helper.rb +111 -0
- data/tmp/tmp.rb +11 -0
- metadata +402 -0
@@ -0,0 +1,780 @@
|
|
1
|
+
=begin
|
2
|
+
#Dependency-Track API
|
3
|
+
|
4
|
+
#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
5
|
+
|
6
|
+
The version of the OpenAPI document: 3.8.0
|
7
|
+
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 4.3.1
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'cgi'
|
14
|
+
|
15
|
+
module DependencyTracker
|
16
|
+
class VulnerabilityApi
|
17
|
+
attr_accessor :api_client
|
18
|
+
|
19
|
+
def initialize(api_client = ApiClient.default)
|
20
|
+
@api_client = api_client
|
21
|
+
end
|
22
|
+
# Assigns a vulnerability to a component
|
23
|
+
# @param source [String] The vulnerability source
|
24
|
+
# @param vuln_id [String] The vulnId
|
25
|
+
# @param component [String] The UUID of the component
|
26
|
+
# @param [Hash] opts the optional parameters
|
27
|
+
# @return [nil]
|
28
|
+
def assign_vulnerability(source, vuln_id, component, opts = {})
|
29
|
+
assign_vulnerability_with_http_info(source, vuln_id, component, opts)
|
30
|
+
nil
|
31
|
+
end
|
32
|
+
|
33
|
+
# Assigns a vulnerability to a component
|
34
|
+
# @param source [String] The vulnerability source
|
35
|
+
# @param vuln_id [String] The vulnId
|
36
|
+
# @param component [String] The UUID of the component
|
37
|
+
# @param [Hash] opts the optional parameters
|
38
|
+
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
|
39
|
+
def assign_vulnerability_with_http_info(source, vuln_id, component, opts = {})
|
40
|
+
if @api_client.config.debugging
|
41
|
+
@api_client.config.logger.debug 'Calling API: VulnerabilityApi.assign_vulnerability ...'
|
42
|
+
end
|
43
|
+
# verify the required parameter 'source' is set
|
44
|
+
if @api_client.config.client_side_validation && source.nil?
|
45
|
+
fail ArgumentError, "Missing the required parameter 'source' when calling VulnerabilityApi.assign_vulnerability"
|
46
|
+
end
|
47
|
+
# verify the required parameter 'vuln_id' is set
|
48
|
+
if @api_client.config.client_side_validation && vuln_id.nil?
|
49
|
+
fail ArgumentError, "Missing the required parameter 'vuln_id' when calling VulnerabilityApi.assign_vulnerability"
|
50
|
+
end
|
51
|
+
# verify the required parameter 'component' is set
|
52
|
+
if @api_client.config.client_side_validation && component.nil?
|
53
|
+
fail ArgumentError, "Missing the required parameter 'component' when calling VulnerabilityApi.assign_vulnerability"
|
54
|
+
end
|
55
|
+
# resource path
|
56
|
+
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))
|
57
|
+
|
58
|
+
# query parameters
|
59
|
+
query_params = opts[:query_params] || {}
|
60
|
+
|
61
|
+
# header parameters
|
62
|
+
header_params = opts[:header_params] || {}
|
63
|
+
|
64
|
+
# form parameters
|
65
|
+
form_params = opts[:form_params] || {}
|
66
|
+
|
67
|
+
# http body (model)
|
68
|
+
post_body = opts[:body]
|
69
|
+
|
70
|
+
# return_type
|
71
|
+
return_type = opts[:return_type]
|
72
|
+
|
73
|
+
# auth_names
|
74
|
+
auth_names = opts[:auth_names] || ['X-Api-Key']
|
75
|
+
|
76
|
+
new_options = opts.merge(
|
77
|
+
:header_params => header_params,
|
78
|
+
:query_params => query_params,
|
79
|
+
:form_params => form_params,
|
80
|
+
:body => post_body,
|
81
|
+
:auth_names => auth_names,
|
82
|
+
:return_type => return_type
|
83
|
+
)
|
84
|
+
|
85
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
86
|
+
if @api_client.config.debugging
|
87
|
+
@api_client.config.logger.debug "API called: VulnerabilityApi#assign_vulnerability\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
88
|
+
end
|
89
|
+
return data, status_code, headers
|
90
|
+
end
|
91
|
+
|
92
|
+
# Assigns a vulnerability to a component
|
93
|
+
# @param uuid [String] The UUID of the vulnerability
|
94
|
+
# @param component [String] The UUID of the component
|
95
|
+
# @param [Hash] opts the optional parameters
|
96
|
+
# @return [nil]
|
97
|
+
def assign_vulnerability1(uuid, component, opts = {})
|
98
|
+
assign_vulnerability1_with_http_info(uuid, component, opts)
|
99
|
+
nil
|
100
|
+
end
|
101
|
+
|
102
|
+
# Assigns a vulnerability to a component
|
103
|
+
# @param uuid [String] The UUID of the vulnerability
|
104
|
+
# @param component [String] The UUID of the component
|
105
|
+
# @param [Hash] opts the optional parameters
|
106
|
+
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
|
107
|
+
def assign_vulnerability1_with_http_info(uuid, component, opts = {})
|
108
|
+
if @api_client.config.debugging
|
109
|
+
@api_client.config.logger.debug 'Calling API: VulnerabilityApi.assign_vulnerability1 ...'
|
110
|
+
end
|
111
|
+
# verify the required parameter 'uuid' is set
|
112
|
+
if @api_client.config.client_side_validation && uuid.nil?
|
113
|
+
fail ArgumentError, "Missing the required parameter 'uuid' when calling VulnerabilityApi.assign_vulnerability1"
|
114
|
+
end
|
115
|
+
# verify the required parameter 'component' is set
|
116
|
+
if @api_client.config.client_side_validation && component.nil?
|
117
|
+
fail ArgumentError, "Missing the required parameter 'component' when calling VulnerabilityApi.assign_vulnerability1"
|
118
|
+
end
|
119
|
+
# resource path
|
120
|
+
local_var_path = '/v1/vulnerability/{uuid}/component/{component}'.sub('{' + 'uuid' + '}', CGI.escape(uuid.to_s)).sub('{' + 'component' + '}', CGI.escape(component.to_s))
|
121
|
+
|
122
|
+
# query parameters
|
123
|
+
query_params = opts[:query_params] || {}
|
124
|
+
|
125
|
+
# header parameters
|
126
|
+
header_params = opts[:header_params] || {}
|
127
|
+
|
128
|
+
# form parameters
|
129
|
+
form_params = opts[:form_params] || {}
|
130
|
+
|
131
|
+
# http body (model)
|
132
|
+
post_body = opts[:body]
|
133
|
+
|
134
|
+
# return_type
|
135
|
+
return_type = opts[:return_type]
|
136
|
+
|
137
|
+
# auth_names
|
138
|
+
auth_names = opts[:auth_names] || ['X-Api-Key']
|
139
|
+
|
140
|
+
new_options = opts.merge(
|
141
|
+
:header_params => header_params,
|
142
|
+
:query_params => query_params,
|
143
|
+
:form_params => form_params,
|
144
|
+
:body => post_body,
|
145
|
+
:auth_names => auth_names,
|
146
|
+
:return_type => return_type
|
147
|
+
)
|
148
|
+
|
149
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
150
|
+
if @api_client.config.debugging
|
151
|
+
@api_client.config.logger.debug "API called: VulnerabilityApi#assign_vulnerability1\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
152
|
+
end
|
153
|
+
return data, status_code, headers
|
154
|
+
end
|
155
|
+
|
156
|
+
# Creates a new vulnerability
|
157
|
+
# @param [Hash] opts the optional parameters
|
158
|
+
# @option opts [Vulnerability] :body
|
159
|
+
# @return [Vulnerability]
|
160
|
+
def create_vulnerability(opts = {})
|
161
|
+
data, _status_code, _headers = create_vulnerability_with_http_info(opts)
|
162
|
+
data
|
163
|
+
end
|
164
|
+
|
165
|
+
# Creates a new vulnerability
|
166
|
+
# @param [Hash] opts the optional parameters
|
167
|
+
# @option opts [Vulnerability] :body
|
168
|
+
# @return [Array<(Vulnerability, Integer, Hash)>] Vulnerability data, response status code and response headers
|
169
|
+
def create_vulnerability_with_http_info(opts = {})
|
170
|
+
if @api_client.config.debugging
|
171
|
+
@api_client.config.logger.debug 'Calling API: VulnerabilityApi.create_vulnerability ...'
|
172
|
+
end
|
173
|
+
# resource path
|
174
|
+
local_var_path = '/v1/vulnerability'
|
175
|
+
|
176
|
+
# query parameters
|
177
|
+
query_params = opts[:query_params] || {}
|
178
|
+
|
179
|
+
# header parameters
|
180
|
+
header_params = opts[:header_params] || {}
|
181
|
+
# HTTP header 'Accept' (if needed)
|
182
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
183
|
+
# HTTP header 'Content-Type'
|
184
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
185
|
+
|
186
|
+
# form parameters
|
187
|
+
form_params = opts[:form_params] || {}
|
188
|
+
|
189
|
+
# http body (model)
|
190
|
+
post_body = opts[:body] || @api_client.object_to_http_body(opts[:'body'])
|
191
|
+
|
192
|
+
# return_type
|
193
|
+
return_type = opts[:return_type] || 'Vulnerability'
|
194
|
+
|
195
|
+
# auth_names
|
196
|
+
auth_names = opts[:auth_names] || ['X-Api-Key']
|
197
|
+
|
198
|
+
new_options = opts.merge(
|
199
|
+
:header_params => header_params,
|
200
|
+
:query_params => query_params,
|
201
|
+
:form_params => form_params,
|
202
|
+
:body => post_body,
|
203
|
+
:auth_names => auth_names,
|
204
|
+
:return_type => return_type
|
205
|
+
)
|
206
|
+
|
207
|
+
data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
|
208
|
+
if @api_client.config.debugging
|
209
|
+
@api_client.config.logger.debug "API called: VulnerabilityApi#create_vulnerability\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
210
|
+
end
|
211
|
+
return data, status_code, headers
|
212
|
+
end
|
213
|
+
|
214
|
+
# Returns a list of all projects affected by a specific vulnerability
|
215
|
+
# @param source [String]
|
216
|
+
# @param vuln [String]
|
217
|
+
# @param [Hash] opts the optional parameters
|
218
|
+
# @return [Array<Project>]
|
219
|
+
def get_affected_project(source, vuln, opts = {})
|
220
|
+
data, _status_code, _headers = get_affected_project_with_http_info(source, vuln, opts)
|
221
|
+
data
|
222
|
+
end
|
223
|
+
|
224
|
+
# Returns a list of all projects affected by a specific vulnerability
|
225
|
+
# @param source [String]
|
226
|
+
# @param vuln [String]
|
227
|
+
# @param [Hash] opts the optional parameters
|
228
|
+
# @return [Array<(Array<Project>, Integer, Hash)>] Array<Project> data, response status code and response headers
|
229
|
+
def get_affected_project_with_http_info(source, vuln, opts = {})
|
230
|
+
if @api_client.config.debugging
|
231
|
+
@api_client.config.logger.debug 'Calling API: VulnerabilityApi.get_affected_project ...'
|
232
|
+
end
|
233
|
+
# verify the required parameter 'source' is set
|
234
|
+
if @api_client.config.client_side_validation && source.nil?
|
235
|
+
fail ArgumentError, "Missing the required parameter 'source' when calling VulnerabilityApi.get_affected_project"
|
236
|
+
end
|
237
|
+
# verify the required parameter 'vuln' is set
|
238
|
+
if @api_client.config.client_side_validation && vuln.nil?
|
239
|
+
fail ArgumentError, "Missing the required parameter 'vuln' when calling VulnerabilityApi.get_affected_project"
|
240
|
+
end
|
241
|
+
# resource path
|
242
|
+
local_var_path = '/v1/vulnerability/source/{source}/vuln/{vuln}/projects'.sub('{' + 'source' + '}', CGI.escape(source.to_s)).sub('{' + 'vuln' + '}', CGI.escape(vuln.to_s))
|
243
|
+
|
244
|
+
# query parameters
|
245
|
+
query_params = opts[:query_params] || {}
|
246
|
+
|
247
|
+
# header parameters
|
248
|
+
header_params = opts[:header_params] || {}
|
249
|
+
# HTTP header 'Accept' (if needed)
|
250
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
251
|
+
|
252
|
+
# form parameters
|
253
|
+
form_params = opts[:form_params] || {}
|
254
|
+
|
255
|
+
# http body (model)
|
256
|
+
post_body = opts[:body]
|
257
|
+
|
258
|
+
# return_type
|
259
|
+
return_type = opts[:return_type] || 'Array<Project>'
|
260
|
+
|
261
|
+
# auth_names
|
262
|
+
auth_names = opts[:auth_names] || ['X-Api-Key']
|
263
|
+
|
264
|
+
new_options = opts.merge(
|
265
|
+
:header_params => header_params,
|
266
|
+
:query_params => query_params,
|
267
|
+
:form_params => form_params,
|
268
|
+
:body => post_body,
|
269
|
+
:auth_names => auth_names,
|
270
|
+
:return_type => return_type
|
271
|
+
)
|
272
|
+
|
273
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
274
|
+
if @api_client.config.debugging
|
275
|
+
@api_client.config.logger.debug "API called: VulnerabilityApi#get_affected_project\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
276
|
+
end
|
277
|
+
return data, status_code, headers
|
278
|
+
end
|
279
|
+
|
280
|
+
# Returns a list of all vulnerabilities
|
281
|
+
# @param [Hash] opts the optional parameters
|
282
|
+
# @return [Array<Vulnerability>]
|
283
|
+
def get_all_vulnerabilities(opts = {})
|
284
|
+
data, _status_code, _headers = get_all_vulnerabilities_with_http_info(opts)
|
285
|
+
data
|
286
|
+
end
|
287
|
+
|
288
|
+
# Returns a list of all vulnerabilities
|
289
|
+
# @param [Hash] opts the optional parameters
|
290
|
+
# @return [Array<(Array<Vulnerability>, Integer, Hash)>] Array<Vulnerability> data, response status code and response headers
|
291
|
+
def get_all_vulnerabilities_with_http_info(opts = {})
|
292
|
+
if @api_client.config.debugging
|
293
|
+
@api_client.config.logger.debug 'Calling API: VulnerabilityApi.get_all_vulnerabilities ...'
|
294
|
+
end
|
295
|
+
# resource path
|
296
|
+
local_var_path = '/v1/vulnerability'
|
297
|
+
|
298
|
+
# query parameters
|
299
|
+
query_params = opts[:query_params] || {}
|
300
|
+
|
301
|
+
# header parameters
|
302
|
+
header_params = opts[:header_params] || {}
|
303
|
+
# HTTP header 'Accept' (if needed)
|
304
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
305
|
+
|
306
|
+
# form parameters
|
307
|
+
form_params = opts[:form_params] || {}
|
308
|
+
|
309
|
+
# http body (model)
|
310
|
+
post_body = opts[:body]
|
311
|
+
|
312
|
+
# return_type
|
313
|
+
return_type = opts[:return_type] || 'Array<Vulnerability>'
|
314
|
+
|
315
|
+
# auth_names
|
316
|
+
auth_names = opts[:auth_names] || ['X-Api-Key']
|
317
|
+
|
318
|
+
new_options = opts.merge(
|
319
|
+
:header_params => header_params,
|
320
|
+
:query_params => query_params,
|
321
|
+
:form_params => form_params,
|
322
|
+
:body => post_body,
|
323
|
+
:auth_names => auth_names,
|
324
|
+
:return_type => return_type
|
325
|
+
)
|
326
|
+
|
327
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
328
|
+
if @api_client.config.debugging
|
329
|
+
@api_client.config.logger.debug "API called: VulnerabilityApi#get_all_vulnerabilities\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
330
|
+
end
|
331
|
+
return data, status_code, headers
|
332
|
+
end
|
333
|
+
|
334
|
+
# Returns a list of all vulnerabilities for a specific component
|
335
|
+
# A valid UUID of the component may be specified, or the MD5 or SHA1 hash of the component
|
336
|
+
# @param ident [String]
|
337
|
+
# @param [Hash] opts the optional parameters
|
338
|
+
# @option opts [Boolean] :suppressed Optionally includes suppressed vulnerabilities
|
339
|
+
# @return [Array<Vulnerability>]
|
340
|
+
def get_vulnerabilities_by_component(ident, opts = {})
|
341
|
+
data, _status_code, _headers = get_vulnerabilities_by_component_with_http_info(ident, opts)
|
342
|
+
data
|
343
|
+
end
|
344
|
+
|
345
|
+
# Returns a list of all vulnerabilities for a specific component
|
346
|
+
# A valid UUID of the component may be specified, or the MD5 or SHA1 hash of the component
|
347
|
+
# @param ident [String]
|
348
|
+
# @param [Hash] opts the optional parameters
|
349
|
+
# @option opts [Boolean] :suppressed Optionally includes suppressed vulnerabilities
|
350
|
+
# @return [Array<(Array<Vulnerability>, Integer, Hash)>] Array<Vulnerability> data, response status code and response headers
|
351
|
+
def get_vulnerabilities_by_component_with_http_info(ident, opts = {})
|
352
|
+
if @api_client.config.debugging
|
353
|
+
@api_client.config.logger.debug 'Calling API: VulnerabilityApi.get_vulnerabilities_by_component ...'
|
354
|
+
end
|
355
|
+
# verify the required parameter 'ident' is set
|
356
|
+
if @api_client.config.client_side_validation && ident.nil?
|
357
|
+
fail ArgumentError, "Missing the required parameter 'ident' when calling VulnerabilityApi.get_vulnerabilities_by_component"
|
358
|
+
end
|
359
|
+
# resource path
|
360
|
+
local_var_path = '/v1/vulnerability/component/{ident}'.sub('{' + 'ident' + '}', CGI.escape(ident.to_s))
|
361
|
+
|
362
|
+
# query parameters
|
363
|
+
query_params = opts[:query_params] || {}
|
364
|
+
query_params[:'suppressed'] = opts[:'suppressed'] if !opts[:'suppressed'].nil?
|
365
|
+
|
366
|
+
# header parameters
|
367
|
+
header_params = opts[:header_params] || {}
|
368
|
+
# HTTP header 'Accept' (if needed)
|
369
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
370
|
+
|
371
|
+
# form parameters
|
372
|
+
form_params = opts[:form_params] || {}
|
373
|
+
|
374
|
+
# http body (model)
|
375
|
+
post_body = opts[:body]
|
376
|
+
|
377
|
+
# return_type
|
378
|
+
return_type = opts[:return_type] || 'Array<Vulnerability>'
|
379
|
+
|
380
|
+
# auth_names
|
381
|
+
auth_names = opts[:auth_names] || ['X-Api-Key']
|
382
|
+
|
383
|
+
new_options = opts.merge(
|
384
|
+
:header_params => header_params,
|
385
|
+
:query_params => query_params,
|
386
|
+
:form_params => form_params,
|
387
|
+
:body => post_body,
|
388
|
+
:auth_names => auth_names,
|
389
|
+
:return_type => return_type
|
390
|
+
)
|
391
|
+
|
392
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
393
|
+
if @api_client.config.debugging
|
394
|
+
@api_client.config.logger.debug "API called: VulnerabilityApi#get_vulnerabilities_by_component\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
395
|
+
end
|
396
|
+
return data, status_code, headers
|
397
|
+
end
|
398
|
+
|
399
|
+
# Returns a list of all vulnerabilities for a specific project
|
400
|
+
# @param uuid [String]
|
401
|
+
# @param [Hash] opts the optional parameters
|
402
|
+
# @option opts [Boolean] :suppressed Optionally includes suppressed vulnerabilities
|
403
|
+
# @return [Array<Vulnerability>]
|
404
|
+
def get_vulnerabilities_by_project(uuid, opts = {})
|
405
|
+
data, _status_code, _headers = get_vulnerabilities_by_project_with_http_info(uuid, opts)
|
406
|
+
data
|
407
|
+
end
|
408
|
+
|
409
|
+
# Returns a list of all vulnerabilities for a specific project
|
410
|
+
# @param uuid [String]
|
411
|
+
# @param [Hash] opts the optional parameters
|
412
|
+
# @option opts [Boolean] :suppressed Optionally includes suppressed vulnerabilities
|
413
|
+
# @return [Array<(Array<Vulnerability>, Integer, Hash)>] Array<Vulnerability> data, response status code and response headers
|
414
|
+
def get_vulnerabilities_by_project_with_http_info(uuid, opts = {})
|
415
|
+
if @api_client.config.debugging
|
416
|
+
@api_client.config.logger.debug 'Calling API: VulnerabilityApi.get_vulnerabilities_by_project ...'
|
417
|
+
end
|
418
|
+
# verify the required parameter 'uuid' is set
|
419
|
+
if @api_client.config.client_side_validation && uuid.nil?
|
420
|
+
fail ArgumentError, "Missing the required parameter 'uuid' when calling VulnerabilityApi.get_vulnerabilities_by_project"
|
421
|
+
end
|
422
|
+
# resource path
|
423
|
+
local_var_path = '/v1/vulnerability/project/{uuid}'.sub('{' + 'uuid' + '}', CGI.escape(uuid.to_s))
|
424
|
+
|
425
|
+
# query parameters
|
426
|
+
query_params = opts[:query_params] || {}
|
427
|
+
query_params[:'suppressed'] = opts[:'suppressed'] if !opts[:'suppressed'].nil?
|
428
|
+
|
429
|
+
# header parameters
|
430
|
+
header_params = opts[:header_params] || {}
|
431
|
+
# HTTP header 'Accept' (if needed)
|
432
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
433
|
+
|
434
|
+
# form parameters
|
435
|
+
form_params = opts[:form_params] || {}
|
436
|
+
|
437
|
+
# http body (model)
|
438
|
+
post_body = opts[:body]
|
439
|
+
|
440
|
+
# return_type
|
441
|
+
return_type = opts[:return_type] || 'Array<Vulnerability>'
|
442
|
+
|
443
|
+
# auth_names
|
444
|
+
auth_names = opts[:auth_names] || ['X-Api-Key']
|
445
|
+
|
446
|
+
new_options = opts.merge(
|
447
|
+
:header_params => header_params,
|
448
|
+
:query_params => query_params,
|
449
|
+
:form_params => form_params,
|
450
|
+
:body => post_body,
|
451
|
+
:auth_names => auth_names,
|
452
|
+
:return_type => return_type
|
453
|
+
)
|
454
|
+
|
455
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
456
|
+
if @api_client.config.debugging
|
457
|
+
@api_client.config.logger.debug "API called: VulnerabilityApi#get_vulnerabilities_by_project\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
458
|
+
end
|
459
|
+
return data, status_code, headers
|
460
|
+
end
|
461
|
+
|
462
|
+
# Returns a specific vulnerability
|
463
|
+
# @param uuid [String] The UUID of the vulnerability
|
464
|
+
# @param [Hash] opts the optional parameters
|
465
|
+
# @return [Vulnerability]
|
466
|
+
def get_vulnerability_by_uuid(uuid, opts = {})
|
467
|
+
data, _status_code, _headers = get_vulnerability_by_uuid_with_http_info(uuid, opts)
|
468
|
+
data
|
469
|
+
end
|
470
|
+
|
471
|
+
# Returns a specific vulnerability
|
472
|
+
# @param uuid [String] The UUID of the vulnerability
|
473
|
+
# @param [Hash] opts the optional parameters
|
474
|
+
# @return [Array<(Vulnerability, Integer, Hash)>] Vulnerability data, response status code and response headers
|
475
|
+
def get_vulnerability_by_uuid_with_http_info(uuid, opts = {})
|
476
|
+
if @api_client.config.debugging
|
477
|
+
@api_client.config.logger.debug 'Calling API: VulnerabilityApi.get_vulnerability_by_uuid ...'
|
478
|
+
end
|
479
|
+
# verify the required parameter 'uuid' is set
|
480
|
+
if @api_client.config.client_side_validation && uuid.nil?
|
481
|
+
fail ArgumentError, "Missing the required parameter 'uuid' when calling VulnerabilityApi.get_vulnerability_by_uuid"
|
482
|
+
end
|
483
|
+
# resource path
|
484
|
+
local_var_path = '/v1/vulnerability/{uuid}'.sub('{' + 'uuid' + '}', CGI.escape(uuid.to_s))
|
485
|
+
|
486
|
+
# query parameters
|
487
|
+
query_params = opts[:query_params] || {}
|
488
|
+
|
489
|
+
# header parameters
|
490
|
+
header_params = opts[:header_params] || {}
|
491
|
+
# HTTP header 'Accept' (if needed)
|
492
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
493
|
+
|
494
|
+
# form parameters
|
495
|
+
form_params = opts[:form_params] || {}
|
496
|
+
|
497
|
+
# http body (model)
|
498
|
+
post_body = opts[:body]
|
499
|
+
|
500
|
+
# return_type
|
501
|
+
return_type = opts[:return_type] || 'Vulnerability'
|
502
|
+
|
503
|
+
# auth_names
|
504
|
+
auth_names = opts[:auth_names] || ['X-Api-Key']
|
505
|
+
|
506
|
+
new_options = opts.merge(
|
507
|
+
:header_params => header_params,
|
508
|
+
:query_params => query_params,
|
509
|
+
:form_params => form_params,
|
510
|
+
:body => post_body,
|
511
|
+
:auth_names => auth_names,
|
512
|
+
:return_type => return_type
|
513
|
+
)
|
514
|
+
|
515
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
516
|
+
if @api_client.config.debugging
|
517
|
+
@api_client.config.logger.debug "API called: VulnerabilityApi#get_vulnerability_by_uuid\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
518
|
+
end
|
519
|
+
return data, status_code, headers
|
520
|
+
end
|
521
|
+
|
522
|
+
# Returns a specific vulnerability
|
523
|
+
# @param source [String]
|
524
|
+
# @param vuln [String]
|
525
|
+
# @param [Hash] opts the optional parameters
|
526
|
+
# @return [Vulnerability]
|
527
|
+
def get_vulnerability_by_vuln_id(source, vuln, opts = {})
|
528
|
+
data, _status_code, _headers = get_vulnerability_by_vuln_id_with_http_info(source, vuln, opts)
|
529
|
+
data
|
530
|
+
end
|
531
|
+
|
532
|
+
# Returns a specific vulnerability
|
533
|
+
# @param source [String]
|
534
|
+
# @param vuln [String]
|
535
|
+
# @param [Hash] opts the optional parameters
|
536
|
+
# @return [Array<(Vulnerability, Integer, Hash)>] Vulnerability data, response status code and response headers
|
537
|
+
def get_vulnerability_by_vuln_id_with_http_info(source, vuln, opts = {})
|
538
|
+
if @api_client.config.debugging
|
539
|
+
@api_client.config.logger.debug 'Calling API: VulnerabilityApi.get_vulnerability_by_vuln_id ...'
|
540
|
+
end
|
541
|
+
# verify the required parameter 'source' is set
|
542
|
+
if @api_client.config.client_side_validation && source.nil?
|
543
|
+
fail ArgumentError, "Missing the required parameter 'source' when calling VulnerabilityApi.get_vulnerability_by_vuln_id"
|
544
|
+
end
|
545
|
+
# verify the required parameter 'vuln' is set
|
546
|
+
if @api_client.config.client_side_validation && vuln.nil?
|
547
|
+
fail ArgumentError, "Missing the required parameter 'vuln' when calling VulnerabilityApi.get_vulnerability_by_vuln_id"
|
548
|
+
end
|
549
|
+
# resource path
|
550
|
+
local_var_path = '/v1/vulnerability/source/{source}/vuln/{vuln}'.sub('{' + 'source' + '}', CGI.escape(source.to_s)).sub('{' + 'vuln' + '}', CGI.escape(vuln.to_s))
|
551
|
+
|
552
|
+
# query parameters
|
553
|
+
query_params = opts[:query_params] || {}
|
554
|
+
|
555
|
+
# header parameters
|
556
|
+
header_params = opts[:header_params] || {}
|
557
|
+
# HTTP header 'Accept' (if needed)
|
558
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
559
|
+
|
560
|
+
# form parameters
|
561
|
+
form_params = opts[:form_params] || {}
|
562
|
+
|
563
|
+
# http body (model)
|
564
|
+
post_body = opts[:body]
|
565
|
+
|
566
|
+
# return_type
|
567
|
+
return_type = opts[:return_type] || 'Vulnerability'
|
568
|
+
|
569
|
+
# auth_names
|
570
|
+
auth_names = opts[:auth_names] || ['X-Api-Key']
|
571
|
+
|
572
|
+
new_options = opts.merge(
|
573
|
+
:header_params => header_params,
|
574
|
+
:query_params => query_params,
|
575
|
+
:form_params => form_params,
|
576
|
+
:body => post_body,
|
577
|
+
:auth_names => auth_names,
|
578
|
+
:return_type => return_type
|
579
|
+
)
|
580
|
+
|
581
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
582
|
+
if @api_client.config.debugging
|
583
|
+
@api_client.config.logger.debug "API called: VulnerabilityApi#get_vulnerability_by_vuln_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
584
|
+
end
|
585
|
+
return data, status_code, headers
|
586
|
+
end
|
587
|
+
|
588
|
+
# Removes assignment of a vulnerability from a component
|
589
|
+
# @param source [String] The vulnerability source
|
590
|
+
# @param vuln_id [String] The vulnId
|
591
|
+
# @param component [String] The UUID of the component
|
592
|
+
# @param [Hash] opts the optional parameters
|
593
|
+
# @return [nil]
|
594
|
+
def unassign_vulnerability(source, vuln_id, component, opts = {})
|
595
|
+
unassign_vulnerability_with_http_info(source, vuln_id, component, opts)
|
596
|
+
nil
|
597
|
+
end
|
598
|
+
|
599
|
+
# Removes assignment of a vulnerability from a component
|
600
|
+
# @param source [String] The vulnerability source
|
601
|
+
# @param vuln_id [String] The vulnId
|
602
|
+
# @param component [String] The UUID of the component
|
603
|
+
# @param [Hash] opts the optional parameters
|
604
|
+
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
|
605
|
+
def unassign_vulnerability_with_http_info(source, vuln_id, component, opts = {})
|
606
|
+
if @api_client.config.debugging
|
607
|
+
@api_client.config.logger.debug 'Calling API: VulnerabilityApi.unassign_vulnerability ...'
|
608
|
+
end
|
609
|
+
# verify the required parameter 'source' is set
|
610
|
+
if @api_client.config.client_side_validation && source.nil?
|
611
|
+
fail ArgumentError, "Missing the required parameter 'source' when calling VulnerabilityApi.unassign_vulnerability"
|
612
|
+
end
|
613
|
+
# verify the required parameter 'vuln_id' is set
|
614
|
+
if @api_client.config.client_side_validation && vuln_id.nil?
|
615
|
+
fail ArgumentError, "Missing the required parameter 'vuln_id' when calling VulnerabilityApi.unassign_vulnerability"
|
616
|
+
end
|
617
|
+
# verify the required parameter 'component' is set
|
618
|
+
if @api_client.config.client_side_validation && component.nil?
|
619
|
+
fail ArgumentError, "Missing the required parameter 'component' when calling VulnerabilityApi.unassign_vulnerability"
|
620
|
+
end
|
621
|
+
# resource path
|
622
|
+
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))
|
623
|
+
|
624
|
+
# query parameters
|
625
|
+
query_params = opts[:query_params] || {}
|
626
|
+
|
627
|
+
# header parameters
|
628
|
+
header_params = opts[:header_params] || {}
|
629
|
+
|
630
|
+
# form parameters
|
631
|
+
form_params = opts[:form_params] || {}
|
632
|
+
|
633
|
+
# http body (model)
|
634
|
+
post_body = opts[:body]
|
635
|
+
|
636
|
+
# return_type
|
637
|
+
return_type = opts[:return_type]
|
638
|
+
|
639
|
+
# auth_names
|
640
|
+
auth_names = opts[:auth_names] || ['X-Api-Key']
|
641
|
+
|
642
|
+
new_options = opts.merge(
|
643
|
+
:header_params => header_params,
|
644
|
+
:query_params => query_params,
|
645
|
+
:form_params => form_params,
|
646
|
+
:body => post_body,
|
647
|
+
:auth_names => auth_names,
|
648
|
+
:return_type => return_type
|
649
|
+
)
|
650
|
+
|
651
|
+
data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
|
652
|
+
if @api_client.config.debugging
|
653
|
+
@api_client.config.logger.debug "API called: VulnerabilityApi#unassign_vulnerability\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
654
|
+
end
|
655
|
+
return data, status_code, headers
|
656
|
+
end
|
657
|
+
|
658
|
+
# Removes assignment of a vulnerability from a component
|
659
|
+
# @param uuid [String] The UUID of the vulnerability
|
660
|
+
# @param component [String] The UUID of the component
|
661
|
+
# @param [Hash] opts the optional parameters
|
662
|
+
# @return [nil]
|
663
|
+
def unassign_vulnerability1(uuid, component, opts = {})
|
664
|
+
unassign_vulnerability1_with_http_info(uuid, component, opts)
|
665
|
+
nil
|
666
|
+
end
|
667
|
+
|
668
|
+
# Removes assignment of a vulnerability from a component
|
669
|
+
# @param uuid [String] The UUID of the vulnerability
|
670
|
+
# @param component [String] The UUID of the component
|
671
|
+
# @param [Hash] opts the optional parameters
|
672
|
+
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
|
673
|
+
def unassign_vulnerability1_with_http_info(uuid, component, opts = {})
|
674
|
+
if @api_client.config.debugging
|
675
|
+
@api_client.config.logger.debug 'Calling API: VulnerabilityApi.unassign_vulnerability1 ...'
|
676
|
+
end
|
677
|
+
# verify the required parameter 'uuid' is set
|
678
|
+
if @api_client.config.client_side_validation && uuid.nil?
|
679
|
+
fail ArgumentError, "Missing the required parameter 'uuid' when calling VulnerabilityApi.unassign_vulnerability1"
|
680
|
+
end
|
681
|
+
# verify the required parameter 'component' is set
|
682
|
+
if @api_client.config.client_side_validation && component.nil?
|
683
|
+
fail ArgumentError, "Missing the required parameter 'component' when calling VulnerabilityApi.unassign_vulnerability1"
|
684
|
+
end
|
685
|
+
# resource path
|
686
|
+
local_var_path = '/v1/vulnerability/{uuid}/component/{component}'.sub('{' + 'uuid' + '}', CGI.escape(uuid.to_s)).sub('{' + 'component' + '}', CGI.escape(component.to_s))
|
687
|
+
|
688
|
+
# query parameters
|
689
|
+
query_params = opts[:query_params] || {}
|
690
|
+
|
691
|
+
# header parameters
|
692
|
+
header_params = opts[:header_params] || {}
|
693
|
+
|
694
|
+
# form parameters
|
695
|
+
form_params = opts[:form_params] || {}
|
696
|
+
|
697
|
+
# http body (model)
|
698
|
+
post_body = opts[:body]
|
699
|
+
|
700
|
+
# return_type
|
701
|
+
return_type = opts[:return_type]
|
702
|
+
|
703
|
+
# auth_names
|
704
|
+
auth_names = opts[:auth_names] || ['X-Api-Key']
|
705
|
+
|
706
|
+
new_options = opts.merge(
|
707
|
+
:header_params => header_params,
|
708
|
+
:query_params => query_params,
|
709
|
+
:form_params => form_params,
|
710
|
+
:body => post_body,
|
711
|
+
:auth_names => auth_names,
|
712
|
+
:return_type => return_type
|
713
|
+
)
|
714
|
+
|
715
|
+
data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
|
716
|
+
if @api_client.config.debugging
|
717
|
+
@api_client.config.logger.debug "API called: VulnerabilityApi#unassign_vulnerability1\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
718
|
+
end
|
719
|
+
return data, status_code, headers
|
720
|
+
end
|
721
|
+
|
722
|
+
# Updates an internal vulnerability
|
723
|
+
# @param [Hash] opts the optional parameters
|
724
|
+
# @option opts [Vulnerability] :body
|
725
|
+
# @return [Project]
|
726
|
+
def update_vulnerability(opts = {})
|
727
|
+
data, _status_code, _headers = update_vulnerability_with_http_info(opts)
|
728
|
+
data
|
729
|
+
end
|
730
|
+
|
731
|
+
# Updates an internal vulnerability
|
732
|
+
# @param [Hash] opts the optional parameters
|
733
|
+
# @option opts [Vulnerability] :body
|
734
|
+
# @return [Array<(Project, Integer, Hash)>] Project data, response status code and response headers
|
735
|
+
def update_vulnerability_with_http_info(opts = {})
|
736
|
+
if @api_client.config.debugging
|
737
|
+
@api_client.config.logger.debug 'Calling API: VulnerabilityApi.update_vulnerability ...'
|
738
|
+
end
|
739
|
+
# resource path
|
740
|
+
local_var_path = '/v1/vulnerability'
|
741
|
+
|
742
|
+
# query parameters
|
743
|
+
query_params = opts[:query_params] || {}
|
744
|
+
|
745
|
+
# header parameters
|
746
|
+
header_params = opts[:header_params] || {}
|
747
|
+
# HTTP header 'Accept' (if needed)
|
748
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
749
|
+
# HTTP header 'Content-Type'
|
750
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
751
|
+
|
752
|
+
# form parameters
|
753
|
+
form_params = opts[:form_params] || {}
|
754
|
+
|
755
|
+
# http body (model)
|
756
|
+
post_body = opts[:body] || @api_client.object_to_http_body(opts[:'body'])
|
757
|
+
|
758
|
+
# return_type
|
759
|
+
return_type = opts[:return_type] || 'Project'
|
760
|
+
|
761
|
+
# auth_names
|
762
|
+
auth_names = opts[:auth_names] || ['X-Api-Key']
|
763
|
+
|
764
|
+
new_options = opts.merge(
|
765
|
+
:header_params => header_params,
|
766
|
+
:query_params => query_params,
|
767
|
+
:form_params => form_params,
|
768
|
+
:body => post_body,
|
769
|
+
:auth_names => auth_names,
|
770
|
+
:return_type => return_type
|
771
|
+
)
|
772
|
+
|
773
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
774
|
+
if @api_client.config.debugging
|
775
|
+
@api_client.config.logger.debug "API called: VulnerabilityApi#update_vulnerability\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
776
|
+
end
|
777
|
+
return data, status_code, headers
|
778
|
+
end
|
779
|
+
end
|
780
|
+
end
|