class Harbor1Client::ScannersApi
Attributes
Public Class Methods
# File lib/harbor1_client/api/scanners_api.rb, line 19 def initialize(api_client = ApiClient.default) @api_client = api_client end
Public Instance Methods
Get scanner registration candidates for configurating project level scanner Retrieve the system configured scanner registrations as candidates of setting project level scanner. @param project_id The project identifier. @param [Hash] opts the optional parameters @return [Array<ScannerRegistration>]
# File lib/harbor1_client/api/scanners_api.rb, line 27 def projects_project_id_scanner_candidates_get(project_id, opts = {}) data, _status_code, _headers = projects_project_id_scanner_candidates_get_with_http_info(project_id, opts) data end
Get scanner registration candidates for configurating project level scanner Retrieve the system configured scanner registrations as candidates of setting project level scanner. @param project_id The project identifier. @param [Hash] opts the optional parameters @return [Array<(Array<ScannerRegistration>, Fixnum, Hash)>] Array<ScannerRegistration> data, response status code and response headers
# File lib/harbor1_client/api/scanners_api.rb, line 37 def projects_project_id_scanner_candidates_get_with_http_info(project_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ScannersApi.projects_project_id_scanner_candidates_get ...' end # verify the required parameter 'project_id' is set if @api_client.config.client_side_validation && project_id.nil? fail ArgumentError, "Missing the required parameter 'project_id' when calling ScannersApi.projects_project_id_scanner_candidates_get" end # resource path local_var_path = '/projects/{project_id}/scanner/candidates'.sub('{' + 'project_id' + '}', project_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/plain']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['basicAuth'] 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 => 'Array<ScannerRegistration>') if @api_client.config.debugging @api_client.config.logger.debug "API called: ScannersApi#projects_project_id_scanner_candidates_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Get project level scanner Get the scanner registration of the specified project. If no scanner registration is configured for the specified project, the system default scanner registration will be returned. @param project_id The project identifier. @param [Hash] opts the optional parameters @return [ScannerRegistration]
# File lib/harbor1_client/api/scanners_api.rb, line 81 def projects_project_id_scanner_get(project_id, opts = {}) data, _status_code, _headers = projects_project_id_scanner_get_with_http_info(project_id, opts) data end
Get project level scanner Get the scanner registration of the specified project. If no scanner registration is configured for the specified project, the system default scanner registration will be returned. @param project_id The project identifier. @param [Hash] opts the optional parameters @return [Array<(ScannerRegistration
, Fixnum, Hash)>] ScannerRegistration
data, response status code and response headers
# File lib/harbor1_client/api/scanners_api.rb, line 91 def projects_project_id_scanner_get_with_http_info(project_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ScannersApi.projects_project_id_scanner_get ...' end # verify the required parameter 'project_id' is set if @api_client.config.client_side_validation && project_id.nil? fail ArgumentError, "Missing the required parameter 'project_id' when calling ScannersApi.projects_project_id_scanner_get" end # resource path local_var_path = '/projects/{project_id}/scanner'.sub('{' + 'project_id' + '}', project_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/plain']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['basicAuth'] 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 => 'ScannerRegistration') if @api_client.config.debugging @api_client.config.logger.debug "API called: ScannersApi#projects_project_id_scanner_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Configure scanner for the specified project Set one of the system configured scanner registration as the indepndent scanner of the specified project. @param project_id The project identifier. @param payload @param [Hash] opts the optional parameters @return [nil]
# File lib/harbor1_client/api/scanners_api.rb, line 136 def projects_project_id_scanner_put(project_id, payload, opts = {}) projects_project_id_scanner_put_with_http_info(project_id, payload, opts) nil end
Configure scanner for the specified project Set one of the system configured scanner registration as the indepndent scanner of the specified project. @param project_id The project identifier. @param payload @param [Hash] opts the optional parameters @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
# File lib/harbor1_client/api/scanners_api.rb, line 147 def projects_project_id_scanner_put_with_http_info(project_id, payload, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ScannersApi.projects_project_id_scanner_put ...' end # verify the required parameter 'project_id' is set if @api_client.config.client_side_validation && project_id.nil? fail ArgumentError, "Missing the required parameter 'project_id' when calling ScannersApi.projects_project_id_scanner_put" end # verify the required parameter 'payload' is set if @api_client.config.client_side_validation && payload.nil? fail ArgumentError, "Missing the required parameter 'payload' when calling ScannersApi.projects_project_id_scanner_put" end # resource path local_var_path = '/projects/{project_id}/scanner'.sub('{' + 'project_id' + '}', project_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/plain']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(payload) auth_names = ['basicAuth'] data, status_code, headers = @api_client.call_api(:PUT, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names) if @api_client.config.debugging @api_client.config.logger.debug "API called: ScannersApi#projects_project_id_scanner_put\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
List scanner registrations Returns a list of currently configured scanner registrations. @param [Hash] opts the optional parameters @return [Array<ScannerRegistration>]
# File lib/harbor1_client/api/scanners_api.rb, line 193 def scanners_get(opts = {}) data, _status_code, _headers = scanners_get_with_http_info(opts) data end
List scanner registrations Returns a list of currently configured scanner registrations. @param [Hash] opts the optional parameters @return [Array<(Array<ScannerRegistration>, Fixnum, Hash)>] Array<ScannerRegistration> data, response status code and response headers
# File lib/harbor1_client/api/scanners_api.rb, line 202 def scanners_get_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ScannersApi.scanners_get ...' end # resource path local_var_path = '/scanners' # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/plain']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['basicAuth'] 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 => 'Array<ScannerRegistration>') if @api_client.config.debugging @api_client.config.logger.debug "API called: ScannersApi#scanners_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Tests scanner registration settings Pings scanner adapter to test endpoint URL and authorization settings. @param settings A scanner registration settings to be tested. @param [Hash] opts the optional parameters @return [nil]
# File lib/harbor1_client/api/scanners_api.rb, line 242 def scanners_ping_post(settings, opts = {}) scanners_ping_post_with_http_info(settings, opts) nil end
Tests scanner registration settings Pings scanner adapter to test endpoint URL and authorization settings. @param settings A scanner registration settings to be tested. @param [Hash] opts the optional parameters @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
# File lib/harbor1_client/api/scanners_api.rb, line 252 def scanners_ping_post_with_http_info(settings, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ScannersApi.scanners_ping_post ...' end # verify the required parameter 'settings' is set if @api_client.config.client_side_validation && settings.nil? fail ArgumentError, "Missing the required parameter 'settings' when calling ScannersApi.scanners_ping_post" end # resource path local_var_path = '/scanners/ping' # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/plain']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(settings) auth_names = ['basicAuth'] 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) if @api_client.config.debugging @api_client.config.logger.debug "API called: ScannersApi#scanners_ping_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Create a scanner registration Creats a new scanner registration with the given data. @param registration A scanner registration to be created. @param [Hash] opts the optional parameters @return [nil]
# File lib/harbor1_client/api/scanners_api.rb, line 295 def scanners_post(registration, opts = {}) scanners_post_with_http_info(registration, opts) nil end
Create a scanner registration Creats a new scanner registration with the given data. @param registration A scanner registration to be created. @param [Hash] opts the optional parameters @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
# File lib/harbor1_client/api/scanners_api.rb, line 305 def scanners_post_with_http_info(registration, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ScannersApi.scanners_post ...' end # verify the required parameter 'registration' is set if @api_client.config.client_side_validation && registration.nil? fail ArgumentError, "Missing the required parameter 'registration' when calling ScannersApi.scanners_post" end # resource path local_var_path = '/scanners' # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/plain']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(registration) auth_names = ['basicAuth'] 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) if @api_client.config.debugging @api_client.config.logger.debug "API called: ScannersApi#scanners_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Delete a scanner registration Deletes the specified scanner registration. @param registration_id The scanner registration identifier. @param [Hash] opts the optional parameters @return [ScannerRegistration]
# File lib/harbor1_client/api/scanners_api.rb, line 348 def scanners_registration_id_delete(registration_id, opts = {}) data, _status_code, _headers = scanners_registration_id_delete_with_http_info(registration_id, opts) data end
Delete a scanner registration Deletes the specified scanner registration. @param registration_id The scanner registration identifier. @param [Hash] opts the optional parameters @return [Array<(ScannerRegistration
, Fixnum, Hash)>] ScannerRegistration
data, response status code and response headers
# File lib/harbor1_client/api/scanners_api.rb, line 358 def scanners_registration_id_delete_with_http_info(registration_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ScannersApi.scanners_registration_id_delete ...' end # verify the required parameter 'registration_id' is set if @api_client.config.client_side_validation && registration_id.nil? fail ArgumentError, "Missing the required parameter 'registration_id' when calling ScannersApi.scanners_registration_id_delete" end # resource path local_var_path = '/scanners/{registration_id}'.sub('{' + 'registration_id' + '}', registration_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/plain']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['basicAuth'] data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'ScannerRegistration') if @api_client.config.debugging @api_client.config.logger.debug "API called: ScannersApi#scanners_registration_id_delete\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Get a scanner registration details Retruns the details of the specified scanner registration. @param registration_id The scanner registration identifer. @param [Hash] opts the optional parameters @return [ScannerRegistration]
# File lib/harbor1_client/api/scanners_api.rb, line 402 def scanners_registration_id_get(registration_id, opts = {}) data, _status_code, _headers = scanners_registration_id_get_with_http_info(registration_id, opts) data end
Get a scanner registration details Retruns the details of the specified scanner registration. @param registration_id The scanner registration identifer. @param [Hash] opts the optional parameters @return [Array<(ScannerRegistration
, Fixnum, Hash)>] ScannerRegistration
data, response status code and response headers
# File lib/harbor1_client/api/scanners_api.rb, line 412 def scanners_registration_id_get_with_http_info(registration_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ScannersApi.scanners_registration_id_get ...' end # verify the required parameter 'registration_id' is set if @api_client.config.client_side_validation && registration_id.nil? fail ArgumentError, "Missing the required parameter 'registration_id' when calling ScannersApi.scanners_registration_id_get" end # resource path local_var_path = '/scanners/{registration_id}'.sub('{' + 'registration_id' + '}', registration_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/plain']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['basicAuth'] 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 => 'ScannerRegistration') if @api_client.config.debugging @api_client.config.logger.debug "API called: ScannersApi#scanners_registration_id_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Get the metadata of the specified scanner registration Get the metadata of the specified scanner registration, including the capabilities and customzied properties. @param registration_id The scanner registration identifier. @param [Hash] opts the optional parameters @return [ScannerAdapterMetadata]
# File lib/harbor1_client/api/scanners_api.rb, line 456 def scanners_registration_id_metadata_get(registration_id, opts = {}) data, _status_code, _headers = scanners_registration_id_metadata_get_with_http_info(registration_id, opts) data end
Get the metadata of the specified scanner registration Get the metadata of the specified scanner registration, including the capabilities and customzied properties. @param registration_id The scanner registration identifier. @param [Hash] opts the optional parameters @return [Array<(ScannerAdapterMetadata
, Fixnum, Hash)>] ScannerAdapterMetadata
data, response status code and response headers
# File lib/harbor1_client/api/scanners_api.rb, line 466 def scanners_registration_id_metadata_get_with_http_info(registration_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ScannersApi.scanners_registration_id_metadata_get ...' end # verify the required parameter 'registration_id' is set if @api_client.config.client_side_validation && registration_id.nil? fail ArgumentError, "Missing the required parameter 'registration_id' when calling ScannersApi.scanners_registration_id_metadata_get" end # resource path local_var_path = '/scanners/{registration_id}/metadata'.sub('{' + 'registration_id' + '}', registration_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/plain']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['basicAuth'] 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 => 'ScannerAdapterMetadata') if @api_client.config.debugging @api_client.config.logger.debug "API called: ScannersApi#scanners_registration_id_metadata_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Set system default scanner registration Set the specified scanner registration as the system default one. @param registration_id The scanner registration identifier. @param payload @param [Hash] opts the optional parameters @return [nil]
# File lib/harbor1_client/api/scanners_api.rb, line 511 def scanners_registration_id_patch(registration_id, payload, opts = {}) scanners_registration_id_patch_with_http_info(registration_id, payload, opts) nil end
Set system default scanner registration Set the specified scanner registration as the system default one. @param registration_id The scanner registration identifier. @param payload @param [Hash] opts the optional parameters @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
# File lib/harbor1_client/api/scanners_api.rb, line 522 def scanners_registration_id_patch_with_http_info(registration_id, payload, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ScannersApi.scanners_registration_id_patch ...' end # verify the required parameter 'registration_id' is set if @api_client.config.client_side_validation && registration_id.nil? fail ArgumentError, "Missing the required parameter 'registration_id' when calling ScannersApi.scanners_registration_id_patch" end # verify the required parameter 'payload' is set if @api_client.config.client_side_validation && payload.nil? fail ArgumentError, "Missing the required parameter 'payload' when calling ScannersApi.scanners_registration_id_patch" end # resource path local_var_path = '/scanners/{registration_id}'.sub('{' + 'registration_id' + '}', registration_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/plain']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(payload) auth_names = ['basicAuth'] data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names) if @api_client.config.debugging @api_client.config.logger.debug "API called: ScannersApi#scanners_registration_id_patch\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Update a scanner registration Updates the specified scanner registration. @param registration_id The scanner registration identifier. @param registration A scanner registraiton to be updated. @param [Hash] opts the optional parameters @return [nil]
# File lib/harbor1_client/api/scanners_api.rb, line 570 def scanners_registration_id_put(registration_id, registration, opts = {}) scanners_registration_id_put_with_http_info(registration_id, registration, opts) nil end
Update a scanner registration Updates the specified scanner registration. @param registration_id The scanner registration identifier. @param registration A scanner registraiton to be updated. @param [Hash] opts the optional parameters @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
# File lib/harbor1_client/api/scanners_api.rb, line 581 def scanners_registration_id_put_with_http_info(registration_id, registration, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ScannersApi.scanners_registration_id_put ...' end # verify the required parameter 'registration_id' is set if @api_client.config.client_side_validation && registration_id.nil? fail ArgumentError, "Missing the required parameter 'registration_id' when calling ScannersApi.scanners_registration_id_put" end # verify the required parameter 'registration' is set if @api_client.config.client_side_validation && registration.nil? fail ArgumentError, "Missing the required parameter 'registration' when calling ScannersApi.scanners_registration_id_put" end # resource path local_var_path = '/scanners/{registration_id}'.sub('{' + 'registration_id' + '}', registration_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/plain']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(registration) auth_names = ['basicAuth'] data, status_code, headers = @api_client.call_api(:PUT, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names) if @api_client.config.debugging @api_client.config.logger.debug "API called: ScannersApi#scanners_registration_id_put\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end