Class: SwaggerClient::VulnerabilityCheckApi

Inherits:
Object
  • Object
show all
Defined in:
lib/service/api/rapid7_insightvm_client/lib/swagger_client/api/vulnerability_check_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ VulnerabilityCheckApi

Returns a new instance of VulnerabilityCheckApi.



16
17
18
# File 'lib/service/api/rapid7_insightvm_client/lib/swagger_client/api/vulnerability_check_api.rb', line 16

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

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



14
15
16
# File 'lib/service/api/rapid7_insightvm_client/lib/swagger_client/api/vulnerability_check_api.rb', line 14

def api_client
  @api_client
end

Instance Method Details

#get_vulnerability_check_types(opts = {}) ⇒ ReferencesWithVulnerabilityCheckTypeIDLink

Check Types Returns the vulnerability check types. The type groups related vulnerability checks by their purpose, property, or related characteristic.

Parameters:

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

    the optional parameters

Returns:



23
24
25
26
# File 'lib/service/api/rapid7_insightvm_client/lib/swagger_client/api/vulnerability_check_api.rb', line 23

def get_vulnerability_check_types(opts = {})
  data, _status_code, _headers = get_vulnerability_check_types_with_http_info(opts)
  data
end

#get_vulnerability_check_types_with_http_info(opts = {}) ⇒ Array<(ReferencesWithVulnerabilityCheckTypeIDLink, Integer, Hash)>

Check Types Returns the vulnerability check types. The type groups related vulnerability checks by their purpose, property, or related characteristic.

Parameters:

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

    the optional parameters

Returns:



32
33
34
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
# File 'lib/service/api/rapid7_insightvm_client/lib/swagger_client/api/vulnerability_check_api.rb', line 32

def get_vulnerability_check_types_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: VulnerabilityCheckApi.get_vulnerability_check_types ...'
  end
  # resource path
  local_var_path = '/api/3/vulnerability_checks_types'

  # 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;charset=UTF-8'])

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

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

  return_type = opts[:return_type] || 'ReferencesWithVulnerabilityCheckTypeIDLink' 

  auth_names = opts[:auth_names] || []
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type)

  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: VulnerabilityCheckApi#get_vulnerability_check_types\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_vulnerability_checks(opts = {}) ⇒ PageOfVulnerabilityCheck

Checks Returns vulnerability checks. Optional search and filtering parameters may be supplied to refine the results. Searching allows full text search of the vulnerability details a check is related to.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :search (String)

    Vulnerability search term to find vulnerability checks for. e.g. &#x60;&quot;ssh&quot;&#x60;.

  • :safe (BOOLEAN)

    Whether to return vulnerability checks that are considered &quot;safe&quot; to run. Defaults to return safe and unsafe checks.

  • :potential (BOOLEAN)

    Whether to only return checks that result in potentially vulnerable results. Defaults to return all checks.

  • :requires_credentials (BOOLEAN)

    Whether to only return checks that require credentials in order to successfully execute. Defaults to return all checks.

  • :unique (BOOLEAN)

    Whether to only return checks that guarantee to be executed once-and-only once on a host resulting in a unique result. False returns checks that can result in multiple occurrences of the same vulnerability on a host.

  • :type (String)

    The type of vulnerability checks to return. See &lt;a href&#x3D;&quot;#operation/vulnerabilityCheckTypesUsingGET&quot;&gt;Check Types&lt;/a&gt; for all available types.

  • :page (Integer)

    The index of the page (zero-based) to retrieve. (default to 0)

  • :size (Integer)

    The number of records per page to retrieve. (default to 10)

  • :sort (Array<String>)

    The criteria to sort the records by, in the format: &#x60;property&#x60;. The default sort order is ascending. Multiple sort criteria can be specified using multiple sort query parameters.

Returns:



82
83
84
85
# File 'lib/service/api/rapid7_insightvm_client/lib/swagger_client/api/vulnerability_check_api.rb', line 82

def get_vulnerability_checks(opts = {})
  data, _status_code, _headers = get_vulnerability_checks_with_http_info(opts)
  data
end

#get_vulnerability_checks_for_vulnerability(site_idte_id, opts = {}) ⇒ ReferencesWithVulnerabilityCheckIDLink

Vulnerability Checks Returns the vulnerability checks that assess for a specific vulnerability during a scan.

Parameters:

  • id

    The identifier of the vulnerability.

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

    the optional parameters

Returns:



151
152
153
154
# File 'lib/service/api/rapid7_insightvm_client/lib/swagger_client/api/vulnerability_check_api.rb', line 151

def get_vulnerability_checks_for_vulnerability(site_idte_id, opts = {})
  data, _status_code, _headers = get_vulnerability_checks_for_vulnerability_with_http_info(site_idte_id, opts)
  data
end

#get_vulnerability_checks_for_vulnerability_with_http_info(site_idte_id, opts = {}) ⇒ Array<(ReferencesWithVulnerabilityCheckIDLink, Integer, Hash)>

Vulnerability Checks Returns the vulnerability checks that assess for a specific vulnerability during a scan.

Parameters:

  • id

    The identifier of the vulnerability.

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

    the optional parameters

Returns:



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
195
196
197
198
199
200
201
# File 'lib/service/api/rapid7_insightvm_client/lib/swagger_client/api/vulnerability_check_api.rb', line 161

def get_vulnerability_checks_for_vulnerability_with_http_info(site_idte_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: VulnerabilityCheckApi.get_vulnerability_checks_for_vulnerability ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && site_idte_id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling VulnerabilityCheckApi.get_vulnerability_checks_for_vulnerability"
  end
  # resource path
  local_var_path = '/api/3/vulnerabilities/{id}/checks'.sub('{' + 'id' + '}', site_idte_id.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;charset=UTF-8'])

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

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

  return_type = opts[:return_type] || 'ReferencesWithVulnerabilityCheckIDLink' 

  auth_names = opts[:auth_names] || []
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type)

  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: VulnerabilityCheckApi#get_vulnerability_checks_for_vulnerability\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_vulnerability_checks_with_http_info(opts = {}) ⇒ Array<(PageOfVulnerabilityCheck, Integer, Hash)>

Checks Returns vulnerability checks. Optional search and filtering parameters may be supplied to refine the results. Searching allows full text search of the vulnerability details a check is related to.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :search (String)

    Vulnerability search term to find vulnerability checks for. e.g. &#x60;&quot;ssh&quot;&#x60;.

  • :safe (BOOLEAN)

    Whether to return vulnerability checks that are considered &quot;safe&quot; to run. Defaults to return safe and unsafe checks.

  • :potential (BOOLEAN)

    Whether to only return checks that result in potentially vulnerable results. Defaults to return all checks.

  • :requires_credentials (BOOLEAN)

    Whether to only return checks that require credentials in order to successfully execute. Defaults to return all checks.

  • :unique (BOOLEAN)

    Whether to only return checks that guarantee to be executed once-and-only once on a host resulting in a unique result. False returns checks that can result in multiple occurrences of the same vulnerability on a host.

  • :type (String)

    The type of vulnerability checks to return. See &lt;a href&#x3D;&quot;#operation/vulnerabilityCheckTypesUsingGET&quot;&gt;Check Types&lt;/a&gt; for all available types.

  • :page (Integer)

    The index of the page (zero-based) to retrieve.

  • :size (Integer)

    The number of records per page to retrieve.

  • :sort (Array<String>)

    The criteria to sort the records by, in the format: &#x60;property&#x60;. The default sort order is ascending. Multiple sort criteria can be specified using multiple sort query parameters.

Returns:

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

    PageOfVulnerabilityCheck data, response status code and response headers



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
135
136
137
138
139
140
141
142
143
144
145
# File 'lib/service/api/rapid7_insightvm_client/lib/swagger_client/api/vulnerability_check_api.rb', line 100

def get_vulnerability_checks_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: VulnerabilityCheckApi.get_vulnerability_checks ...'
  end
  # resource path
  local_var_path = '/api/3/vulnerability_checks'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'search'] = opts[:'search'] if !opts[:'search'].nil?
  query_params[:'safe'] = opts[:'safe'] if !opts[:'safe'].nil?
  query_params[:'potential'] = opts[:'potential'] if !opts[:'potential'].nil?
  query_params[:'requiresCredentials'] = opts[:'requires_credentials'] if !opts[:'requires_credentials'].nil?
  query_params[:'unique'] = opts[:'unique'] if !opts[:'unique'].nil?
  query_params[:'type'] = opts[:'type'] if !opts[:'type'].nil?
  query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
  query_params[:'size'] = opts[:'size'] if !opts[:'size'].nil?
  query_params[:'sort'] = @api_client.build_collection_param(opts[:'sort'], :multi) if !opts[:'sort'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json;charset=UTF-8'])

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

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

  return_type = opts[:return_type] || 'PageOfVulnerabilityCheck' 

  auth_names = opts[:auth_names] || []
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type)

  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: VulnerabilityCheckApi#get_vulnerability_checks\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#vulnerability_check(site_idte_id, opts = {}) ⇒ VulnerabilityCheck

Check Returns the vulnerability check.

Parameters:

  • id

    The identifier of the vulnerability check.

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

    the optional parameters

Returns:



207
208
209
210
# File 'lib/service/api/rapid7_insightvm_client/lib/swagger_client/api/vulnerability_check_api.rb', line 207

def vulnerability_check(site_idte_id, opts = {})
  data, _status_code, _headers = vulnerability_check_with_http_info(site_idte_id, opts)
  data
end

#vulnerability_check_with_http_info(site_idte_id, opts = {}) ⇒ Array<(VulnerabilityCheck, Integer, Hash)>

Check Returns the vulnerability check.

Parameters:

  • id

    The identifier of the vulnerability check.

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

    the optional parameters

Returns:

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

    VulnerabilityCheck data, response status code and response headers



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
255
256
257
# File 'lib/service/api/rapid7_insightvm_client/lib/swagger_client/api/vulnerability_check_api.rb', line 217

def vulnerability_check_with_http_info(site_idte_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: VulnerabilityCheckApi.vulnerability_check ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && site_idte_id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling VulnerabilityCheckApi.vulnerability_check"
  end
  # resource path
  local_var_path = '/api/3/vulnerability_checks/{id}'.sub('{' + 'id' + '}', site_idte_id.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;charset=UTF-8'])

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

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

  return_type = opts[:return_type] || 'VulnerabilityCheck' 

  auth_names = opts[:auth_names] || []
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type)

  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: VulnerabilityCheckApi#vulnerability_check\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end