Class: SwaggerClient::ScanApi
- Inherits:
-
Object
- Object
- SwaggerClient::ScanApi
- Defined in:
- lib/service/api/rapid7_insightvm_client/lib/swagger_client/api/scan_api.rb
Instance Attribute Summary collapse
-
#api_client ⇒ Object
Returns the value of attribute api_client.
Instance Method Summary collapse
-
#get_scan(site_idte_id, opts = {}) ⇒ Scan
Scan Returns the specified scan.
-
#get_scan_with_http_info(site_idte_id, opts = {}) ⇒ Array<(Scan, Integer, Hash)>
Scan Returns the specified scan.
-
#get_scans(opts = {}) ⇒ PageOfGlobalScan
Scans Returns all scans.
-
#get_scans_with_http_info(opts = {}) ⇒ Array<(PageOfGlobalScan, Integer, Hash)>
Scans Returns all scans.
-
#get_site_scans(site_idte_id, opts = {}) ⇒ PageOfScan
Site Scans Returns the scans for the specified site.
-
#get_site_scans_with_http_info(site_idte_id, opts = {}) ⇒ Array<(PageOfScan, Integer, Hash)>
Site Scans Returns the scans for the specified site.
-
#initialize(api_client = ApiClient.default) ⇒ ScanApi
constructor
A new instance of ScanApi.
-
#set_scan_status(site_idte_id, status, opts = {}) ⇒ Links
Scan Status Updates the scan status.
-
#set_scan_status_with_http_info(site_idte_id, status, opts = {}) ⇒ Array<(Links, Integer, Hash)>
Scan Status Updates the scan status.
-
#start_scan(site_idte_id, opts = {}) ⇒ CreatedReferenceScanIDLink
Site Scans Starts a scan for the specified site.
-
#start_scan_with_http_info(site_idte_id, opts = {}) ⇒ Array<(CreatedReferenceScanIDLink, Integer, Hash)>
Site Scans Starts a scan for the specified site.
Constructor Details
#initialize(api_client = ApiClient.default) ⇒ ScanApi
Returns a new instance of ScanApi.
16 17 18 |
# File 'lib/service/api/rapid7_insightvm_client/lib/swagger_client/api/scan_api.rb', line 16 def initialize(api_client = ApiClient.default) @api_client = api_client end |
Instance Attribute Details
#api_client ⇒ Object
Returns the value of attribute api_client.
14 15 16 |
# File 'lib/service/api/rapid7_insightvm_client/lib/swagger_client/api/scan_api.rb', line 14 def api_client @api_client end |
Instance Method Details
#get_scan(site_idte_id, opts = {}) ⇒ Scan
Scan Returns the specified scan.
24 25 26 27 |
# File 'lib/service/api/rapid7_insightvm_client/lib/swagger_client/api/scan_api.rb', line 24 def get_scan(site_idte_id, opts = {}) data, _status_code, _headers = get_scan_with_http_info(site_idte_id, opts) data end |
#get_scan_with_http_info(site_idte_id, opts = {}) ⇒ Array<(Scan, Integer, Hash)>
Scan Returns the specified scan.
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 69 70 71 72 73 74 |
# File 'lib/service/api/rapid7_insightvm_client/lib/swagger_client/api/scan_api.rb', line 34 def get_scan_with_http_info(site_idte_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ScanApi.get_scan ...' 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 ScanApi.get_scan" end # resource path local_var_path = '/api/3/scans/{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] || 'Scan' 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: ScanApi#get_scan\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_scans(opts = {}) ⇒ PageOfGlobalScan
Scans Returns all scans.
83 84 85 86 |
# File 'lib/service/api/rapid7_insightvm_client/lib/swagger_client/api/scan_api.rb', line 83 def get_scans(opts = {}) data, _status_code, _headers = get_scans_with_http_info(opts) data end |
#get_scans_with_http_info(opts = {}) ⇒ Array<(PageOfGlobalScan, Integer, Hash)>
Scans Returns all scans.
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 135 136 |
# File 'lib/service/api/rapid7_insightvm_client/lib/swagger_client/api/scan_api.rb', line 96 def get_scans_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ScanApi.get_scans ...' end # resource path local_var_path = '/api/3/scans' # query parameters query_params = opts[:query_params] || {} query_params[:'active'] = opts[:'active'] if !opts[:'active'].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] || 'PageOfGlobalScan' 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: ScanApi#get_scans\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_site_scans(site_idte_id, opts = {}) ⇒ PageOfScan
Site Scans Returns the scans for the specified site.
146 147 148 149 |
# File 'lib/service/api/rapid7_insightvm_client/lib/swagger_client/api/scan_api.rb', line 146 def get_site_scans(site_idte_id, opts = {}) data, _status_code, _headers = get_site_scans_with_http_info(site_idte_id, opts) data end |
#get_site_scans_with_http_info(site_idte_id, opts = {}) ⇒ Array<(PageOfScan, Integer, Hash)>
Site Scans Returns the scans for the specified site.
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 195 196 197 198 199 200 201 202 203 204 |
# File 'lib/service/api/rapid7_insightvm_client/lib/swagger_client/api/scan_api.rb', line 160 def get_site_scans_with_http_info(site_idte_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ScanApi.get_site_scans ...' 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 ScanApi.get_site_scans" end # resource path local_var_path = '/api/3/sites/{id}/scans'.sub('{' + 'id' + '}', site_idte_id.to_s) # query parameters query_params = opts[:query_params] || {} query_params[:'active'] = opts[:'active'] if !opts[:'active'].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] || 'PageOfScan' 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: ScanApi#get_site_scans\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#set_scan_status(site_idte_id, status, opts = {}) ⇒ Links
Scan Status Updates the scan status. Can pause, resume, and stop scans using this resource. In order to stop a scan the scan must be running or paused. In order to resume a scan the scan must be paused. In order to pause a scan the scan must be running.
211 212 213 214 |
# File 'lib/service/api/rapid7_insightvm_client/lib/swagger_client/api/scan_api.rb', line 211 def set_scan_status(site_idte_id, status, opts = {}) data, _status_code, _headers = set_scan_status_with_http_info(site_idte_id, status, opts) data end |
#set_scan_status_with_http_info(site_idte_id, status, opts = {}) ⇒ Array<(Links, Integer, Hash)>
Scan Status Updates the scan status. Can pause, resume, and stop scans using this resource. In order to stop a scan the scan must be running or paused. In order to resume a scan the scan must be paused. In order to pause a scan the scan must be running.
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 258 259 260 261 262 263 264 265 266 267 268 269 270 |
# File 'lib/service/api/rapid7_insightvm_client/lib/swagger_client/api/scan_api.rb', line 222 def set_scan_status_with_http_info(site_idte_id, status, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ScanApi.set_scan_status ...' 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 ScanApi.set_scan_status" end # verify the required parameter 'status' is set if @api_client.config.client_side_validation && status.nil? fail ArgumentError, "Missing the required parameter 'status' when calling ScanApi.set_scan_status" end # verify enum value if @api_client.config.client_side_validation && !['pause', 'stop', 'resume'].include?(status) fail ArgumentError, "invalid value for 'status', must be one of pause, stop, resume" end # resource path local_var_path = '/api/3/scans/{id}/{status}'.sub('{' + 'id' + '}', site_idte_id.to_s).sub('{' + 'status' + '}', status.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] || 'Links' auth_names = opts[:auth_names] || [] data, status_code, headers = @api_client.call_api(:POST, 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: ScanApi#set_scan_status\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#start_scan(site_idte_id, opts = {}) ⇒ CreatedReferenceScanIDLink
Site Scans Starts a scan for the specified site.
278 279 280 281 |
# File 'lib/service/api/rapid7_insightvm_client/lib/swagger_client/api/scan_api.rb', line 278 def start_scan(site_idte_id, opts = {}) data, _status_code, _headers = start_scan_with_http_info(site_idte_id, opts) data end |
#start_scan_with_http_info(site_idte_id, opts = {}) ⇒ Array<(CreatedReferenceScanIDLink, Integer, Hash)>
Site Scans Starts a scan for the specified site.
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 323 324 325 326 327 328 329 330 331 332 333 |
# File 'lib/service/api/rapid7_insightvm_client/lib/swagger_client/api/scan_api.rb', line 290 def start_scan_with_http_info(site_idte_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ScanApi.start_scan ...' 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 ScanApi.start_scan" end # resource path local_var_path = '/api/3/sites/{id}/scans'.sub('{' + 'id' + '}', site_idte_id.to_s) # query parameters query_params = opts[:query_params] || {} query_params[:'overrideBlackout'] = opts[:'override_blackout'] if !opts[:'override_blackout'].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']) # 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 = opts[:return_type] || 'CreatedReferenceScanIDLink' auth_names = opts[:auth_names] || [] data, status_code, headers = @api_client.call_api(:POST, 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: ScanApi#start_scan\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |