lib/oci/os_management/os_management_client.rb
def search_software_packages(opts = {})
      logger.debug 'Calling operation OsManagementClient#search_software_packages.' if logger


      if opts[:sort_order] && !%w[ASC DESC].include?(opts[:sort_order])
        raise 'Invalid value for "sort_order", must be one of ASC, DESC.'
      end

      if opts[:sort_by] && !%w[TIMECREATED DISPLAYNAME].include?(opts[:sort_by])
        raise 'Invalid value for "sort_by", must be one of TIMECREATED, DISPLAYNAME.'
      end

      path = '/softwareSources/softwarePackages'
      operation_signing_strategy = :standard

      # rubocop:disable Style/NegatedIf
      # Query Params
      query_params = {}
      query_params[:softwarePackageName] = opts[:software_package_name] if opts[:software_package_name]
      query_params[:displayName] = opts[:display_name] if opts[:display_name]
      query_params[:cveName] = opts[:cve_name] if opts[:cve_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 = {}
      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]
      # rubocop:enable Style/NegatedIf

      post_body = nil

      # rubocop:disable Metrics/BlockLength
      OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'OsManagementClient#search_software_packages') 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: 'Array<OCI::OsManagement::Models::SoftwarePackageSearchSummary>'
        )
      end
      # rubocop:enable Metrics/BlockLength
    end
# Searches all of the available Software Sources and returns any/all Software Packages matching
# the search criteria.
#
# @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] :software_package_name the identifier for the software package (not an OCID)
# @option opts [String] :display_name A user-friendly name. Does not have to be unique, and it's changeable.
#
#   Example: `My new resource`
#
# @option opts [String] :cve_name The name of the CVE as published.
#   Example: `CVE-2006-4535`
#
# @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 DESC)
#   Allowed values are: ASC, DESC
# @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)
#   Allowed values are: TIMECREATED, DISPLAYNAME
# @option opts [String] :opc_request_id The client request ID for tracing.
# @return [Response] A Response object with data of type Array<{OCI::OsManagement::Models::SoftwarePackageSearchSummary SoftwarePackageSearchSummary}>
# @note Click [here](https://docs.cloud.oracle.com/en-us/iaas/tools/ruby-sdk-examples/latest/osmanagement/search_software_packages.rb.html) to see an example of how to use search_software_packages API.
Searches all of the available Software Sources and returns any/all Software Packages matching
the search criteria.
Searches all of the available Software Sources and returns any / all Software Packages matching the search criteria .
def search_software_packages(opts = {})
      logger.debug 'Calling operation OsManagementClient#search_software_packages.' if logger
      if opts[:sort_order] && !%w[ASC DESC].include?(opts[:sort_order])
        raise 'Invalid value for "sort_order", must be one of ASC, DESC.'
      end
      if opts[:sort_by] && !%w[TIMECREATED DISPLAYNAME].include?(opts[:sort_by])
        raise 'Invalid value for "sort_by", must be one of TIMECREATED, DISPLAYNAME.'
      end
      path = '/softwareSources/softwarePackages'
      operation_signing_strategy = :standard
      query_params = {}
      query_params[:softwarePackageName] = opts[:software_package_name] if opts[:software_package_name]
      query_params[:displayName] = opts[:display_name] if opts[:display_name]
      query_params[:cveName] = opts[:cve_name] if opts[:cve_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: 'OsManagementClient#search_software_packages') 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: 'Array<OCI::OsManagement::Models::SoftwarePackageSearchSummary>'
        )
      end
    end
def search_software_packages ( opts = { } ) logger . debug 'Calling operation OsManagementClient#search_software_packages.' if logger if opts [ :sort_order ] && ! %w[ ASC DESC ] . include? ( opts [ :sort_order ] ) raise 'Invalid value for "sort_order", must be one of ASC, DESC.' end if opts [ :sort_by ] && ! %w[ TIMECREATED DISPLAYNAME ] . include? ( opts [ :sort_by ] ) raise 'Invalid value for "sort_by", must be one of TIMECREATED, DISPLAYNAME.' end path = '/softwareSources/softwarePackages' operation_signing_strategy = :standard query_params = { } query_params [ :softwarePackageName ] = opts [ :software_package_name ] if opts [ :software_package_name ] query_params [ :displayName ] = opts [ :display_name ] if opts [ :display_name ] query_params [ :cveName ] = opts [ :cve_name ] if opts [ :cve_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 : 'OsManagementClient#search_software_packages' ) 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 : 'Array<OCI::OsManagement::Models::SoftwarePackageSearchSummary>' ) end end
Searches all of the available Software Sources and returns any/all Software Packages matching
the search criteria.
Searches all of the available Software Sources and returns any / all Software Packages matching the search criteria .
# 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 Array<{OCI::OsManagement::Models::SoftwarePackageSearchSummary SoftwarePackageSearchSummary}>
A Response object with data of type Array< { OCI :: OsManagement :: Models :: SoftwarePackageSearchSummary SoftwarePackageSearchSummary } >
Response
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 search_software_packages API.
Click [ here ] to see an example of how to use search_software_packages API .