lib/oci/vulnerability_scanning/vulnerability_scanning_client.rb
# Retrieves a list of HostScanRecipeSummary objects in a compartment. A recipe determines the types of security issues that you want scanned, and how often to scan.
#
# @param [String] compartment_id The ID of the compartment in which to list resources.
# @param [Hash] opts the optional parameters
# @option opts [OCI::Retry::RetryConfig] :retry_config The retry configuration to apply to this operation. If no key is provided then the service-level
#   retry configuration defined by {#retry_config} will be used. If an explicit `nil` value is provided then the operation will not retry
# @option opts [String] :lifecycle_state A filter to return only resources whose lifecycleState matches the given lifecycleState.
# @option opts [String] :display_name A filter to return only resources that match the entire display name given.
# @option opts [Integer] :limit The maximum number of items to return. (default to 10)
# @option opts [String] :page The page token representing the page at which to start retrieving results. This is usually retrieved from a previous list call.
# @option opts [String] :sort_order The sort order to use, either 'ASC' or 'DESC'. (default to ASC)
# @option opts [String] :sort_by The field to sort by. Only one sort order may be provided. Default order for timeCreated is descending. Default order for displayName is ascending. If no value is specified timeCreated is default.
#    (default to timeCreated)
# @option opts [String] :opc_request_id The client request ID for tracing.
# @return [Response] A Response object with data of type {OCI::VulnerabilityScanning::Models::HostScanRecipeSummaryCollection HostScanRecipeSummaryCollection}
# @note Click [here](https://docs.cloud.oracle.com/en-us/iaas/tools/ruby-sdk-examples/latest/vulnerabilityscanning/list_host_scan_recipes.rb.html) to see an example of how to use list_host_scan_recipes API.
Retrieves a list of HostScanRecipeSummary objects in a compartment. A recipe determines the types of security issues that you want scanned, and how often to scan.
Retrieves a list of HostScanRecipeSummary objects in a compartment . A recipe determines the types of security issues that you want scanned and how often to scan .
def list_host_scan_recipes(compartment_id, opts = {})
      logger.debug 'Calling operation VulnerabilityScanningClient#list_host_scan_recipes.' if logger
      raise "Missing the required parameter 'compartment_id' when calling list_host_scan_recipes." if compartment_id.nil?
      if opts[:lifecycle_state] && !OCI::VulnerabilityScanning::Models::LIFECYCLE_STATE_ENUM.include?(opts[:lifecycle_state])
        raise 'Invalid value for "lifecycle_state", must be one of the values in OCI::VulnerabilityScanning::Models::LIFECYCLE_STATE_ENUM.'
      end
      if opts[:sort_order] && !OCI::VulnerabilityScanning::Models::SORT_ORDER_ENUM.include?(opts[:sort_order])
        raise 'Invalid value for "sort_order", must be one of the values in OCI::VulnerabilityScanning::Models::SORT_ORDER_ENUM.'
      end
      if opts[:sort_by] && !OCI::VulnerabilityScanning::Models::SORT_BY_ENUM.include?(opts[:sort_by])
        raise 'Invalid value for "sort_by", must be one of the values in OCI::VulnerabilityScanning::Models::SORT_BY_ENUM.'
      end
      path = '/hostScanRecipes'
      operation_signing_strategy = :standard
      query_params = {}
      query_params[:compartmentId] = compartment_id
      query_params[:lifecycleState] = opts[:lifecycle_state] if opts[:lifecycle_state]
      query_params[:displayName] = opts[:display_name] if opts[:display_name]
      query_params[:limit] = opts[:limit] if opts[:limit]
      query_params[:page] = opts[:page] if opts[:page]
      query_params[:sortOrder] = opts[:sort_order] if opts[:sort_order]
      query_params[:sortBy] = opts[:sort_by] if opts[:sort_by]
      header_params = {}
      header_params[:accept] = 'application/json'
      header_params[:'content-type'] = 'application/json'
      header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
      post_body = nil
      OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'VulnerabilityScanningClient#list_host_scan_recipes') do
        @api_client.call_api(
          :GET,
          path,
          endpoint,
          header_params: header_params,
          query_params: query_params,
          operation_signing_strategy: operation_signing_strategy,
          body: post_body,
          return_type: 'OCI::VulnerabilityScanning::Models::HostScanRecipeSummaryCollection'
        )
      end
    end
def list_host_scan_recipes ( compartment_id , opts = { } ) logger . debug 'Calling operation VulnerabilityScanningClient#list_host_scan_recipes.' if logger raise "Missing the required parameter 'compartment_id' when calling list_host_scan_recipes." if compartment_id . nil? if opts [ :lifecycle_state ] && ! OCI :: VulnerabilityScanning :: Models :: LIFECYCLE_STATE_ENUM . include? ( opts [ :lifecycle_state ] ) raise 'Invalid value for "lifecycle_state", must be one of the values in OCI::VulnerabilityScanning::Models::LIFECYCLE_STATE_ENUM.' end if opts [ :sort_order ] && ! OCI :: VulnerabilityScanning :: Models :: SORT_ORDER_ENUM . include? ( opts [ :sort_order ] ) raise 'Invalid value for "sort_order", must be one of the values in OCI::VulnerabilityScanning::Models::SORT_ORDER_ENUM.' end if opts [ :sort_by ] && ! OCI :: VulnerabilityScanning :: Models :: SORT_BY_ENUM . include? ( opts [ :sort_by ] ) raise 'Invalid value for "sort_by", must be one of the values in OCI::VulnerabilityScanning::Models::SORT_BY_ENUM.' end path = '/hostScanRecipes' operation_signing_strategy = :standard query_params = { } query_params [ :compartmentId ] = compartment_id query_params [ :lifecycleState ] = opts [ :lifecycle_state ] if opts [ :lifecycle_state ] query_params [ :displayName ] = opts [ :display_name ] if opts [ :display_name ] query_params [ :limit ] = opts [ :limit ] if opts [ :limit ] query_params [ :page ] = opts [ :page ] if opts [ :page ] query_params [ :sortOrder ] = opts [ :sort_order ] if opts [ :sort_order ] query_params [ :sortBy ] = opts [ :sort_by ] if opts [ :sort_by ] header_params = { } header_params [ :accept ] = 'application/json' header_params [ :' content-type ' ] = 'application/json' header_params [ :' opc-request-id ' ] = opts [ :opc_request_id ] if opts [ :opc_request_id ] post_body = nil OCI :: Retry . make_retrying_call ( applicable_retry_config ( opts ) , call_name : 'VulnerabilityScanningClient#list_host_scan_recipes' ) do @api_client . call_api ( :GET , path , endpoint , header_params : header_params , query_params : query_params , operation_signing_strategy : operation_signing_strategy , body : post_body , return_type : 'OCI::VulnerabilityScanning::Models::HostScanRecipeSummaryCollection' ) end end
Retrieves a list of HostScanRecipeSummary objects in a compartment.
Retrieves a list of HostScanRecipeSummary objects in a compartment .
# rubocop:disable Style/NegatedIf # Query Params # Header Params # rubocop:enable Style/NegatedIf # rubocop:disable Metrics/BlockLength # rubocop:enable Metrics/BlockLength
A Response object with data of type {OCI::VulnerabilityScanning::Models::HostScanRecipeSummaryCollection HostScanRecipeSummaryCollection}
A Response object with data of type { OCI :: VulnerabilityScanning :: Models :: HostScanRecipeSummaryCollection HostScanRecipeSummaryCollection }
Response
compartment_id
opts
:opc_request_id The client request ID for tracing.
: opc_request_id The client request ID for tracing .
opts the optional parameters
opts the optional parameters
note
Click [here] to see an example of how to use list_host_scan_recipes API.
Click [ here ] to see an example of how to use list_host_scan_recipes API .