lib/oci/optimizer/optimizer_client.rb
def list_histories(compartment_id, compartment_id_in_subtree, opts = {})
      logger.debug 'Calling operation OptimizerClient#list_histories.' if logger

      raise "Missing the required parameter 'compartment_id' when calling list_histories." if compartment_id.nil?
      raise "Missing the required parameter 'compartment_id_in_subtree' when calling list_histories." if compartment_id_in_subtree.nil?

      if opts[:sort_order] && !OCI::Optimizer::Models::SORT_ORDER_ENUM.include?(opts[:sort_order])
        raise 'Invalid value for "sort_order", must be one of the values in OCI::Optimizer::Models::SORT_ORDER_ENUM.'
      end

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

      if opts[:lifecycle_state] && !OCI::Optimizer::Models::LIFECYCLE_STATE_ENUM.include?(opts[:lifecycle_state])
        raise 'Invalid value for "lifecycle_state", must be one of the values in OCI::Optimizer::Models::LIFECYCLE_STATE_ENUM.'
      end

      if opts[:status] && !OCI::Optimizer::Models::STATUS_ENUM.include?(opts[:status])
        raise 'Invalid value for "status", must be one of the values in OCI::Optimizer::Models::STATUS_ENUM.'
      end

      path = '/histories'
      operation_signing_strategy = :standard

      # rubocop:disable Style/NegatedIf
      # Query Params
      query_params = {}
      query_params[:compartmentId] = compartment_id
      query_params[:compartmentIdInSubtree] = compartment_id_in_subtree
      query_params[:name] = opts[:name] if opts[:name]
      query_params[:recommendationName] = opts[:recommendation_name] if opts[:recommendation_name]
      query_params[:recommendationId] = opts[:recommendation_id] if opts[:recommendation_id]
      query_params[:resourceType] = opts[:resource_type] if opts[:resource_type]
      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]
      query_params[:lifecycleState] = opts[:lifecycle_state] if opts[:lifecycle_state]
      query_params[:status] = opts[:status] if opts[:status]

      # 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: 'OptimizerClient#list_histories') 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::Optimizer::Models::HistoryCollection'
        )
      end
      # rubocop:enable Metrics/BlockLength
    end
# Lists changes to the recommendations based on user activity.
# For example, lists when recommendations have been implemented, dismissed, postponed, or reactivated.
#
# @param [String] compartment_id The OCID of the compartment.
# @param [BOOLEAN] compartment_id_in_subtree When set to true, the hierarchy of compartments is traversed and all compartments and subcompartments in the tenancy are returned depending on the the setting of `accessLevel`.
#
#   Can only be set to true when performing ListCompartments on the tenancy (root compartment).
#
# @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] :name Optional. A filter that returns results that match the name specified.
# @option opts [String] :recommendation_name Optional. A filter that returns results that match the recommendation name specified.
# @option opts [String] :recommendation_id The unique OCID associated with the recommendation.
# @option opts [String] :resource_type Optional. A filter that returns results that match the resource type specified.
# @option opts [Integer] :limit The maximum number of items to return in a paginated \"List\" call. (default to 10)
# @option opts [String] :page The value of the `opc-next-page` response header from the previous \"List\" call.
#
# @option opts [String] :sort_order The sort order to use, either ascending (`ASC`) or descending (`DESC`).
# @option opts [String] :sort_by The field to sort by. You can provide one sort order (`sortOrder`). Default order for TIMECREATED is descending. Default order for NAME is ascending. The NAME sort order is case sensitive.
#
#   Allowed values are: NAME, TIMECREATED
# @option opts [String] :lifecycle_state A filter that returns results that match the lifecycle state specified.
#
# @option opts [String] :status A filter that returns recommendations that match the status specified.
#
# @option opts [String] :opc_request_id Unique Oracle-assigned identifier for the request.
#   If you need to contact Oracle about a particular request, please provide the request ID.
#
# @return [Response] A Response object with data of type {OCI::Optimizer::Models::HistoryCollection HistoryCollection}
# @note Click [here](https://docs.cloud.oracle.com/en-us/iaas/tools/ruby-sdk-examples/latest/optimizer/list_histories.rb.html) to see an example of how to use list_histories API.
Lists changes to the recommendations based on user activity.
For example, lists when recommendations have been implemented, dismissed, postponed, or reactivated.
Lists changes to the recommendations based on user activity . For example lists when recommendations have been implemented dismissed postponed or reactivated .
def list_histories(compartment_id, compartment_id_in_subtree, opts = {})
      logger.debug 'Calling operation OptimizerClient#list_histories.' if logger
      raise "Missing the required parameter 'compartment_id' when calling list_histories." if compartment_id.nil?
      raise "Missing the required parameter 'compartment_id_in_subtree' when calling list_histories." if compartment_id_in_subtree.nil?
      if opts[:sort_order] && !OCI::Optimizer::Models::SORT_ORDER_ENUM.include?(opts[:sort_order])
        raise 'Invalid value for "sort_order", must be one of the values in OCI::Optimizer::Models::SORT_ORDER_ENUM.'
      end
      if opts[:sort_by] && !%w[NAME TIMECREATED].include?(opts[:sort_by])
        raise 'Invalid value for "sort_by", must be one of NAME, TIMECREATED.'
      end
      if opts[:lifecycle_state] && !OCI::Optimizer::Models::LIFECYCLE_STATE_ENUM.include?(opts[:lifecycle_state])
        raise 'Invalid value for "lifecycle_state", must be one of the values in OCI::Optimizer::Models::LIFECYCLE_STATE_ENUM.'
      end
      if opts[:status] && !OCI::Optimizer::Models::STATUS_ENUM.include?(opts[:status])
        raise 'Invalid value for "status", must be one of the values in OCI::Optimizer::Models::STATUS_ENUM.'
      end
      path = '/histories'
      operation_signing_strategy = :standard
      query_params = {}
      query_params[:compartmentId] = compartment_id
      query_params[:compartmentIdInSubtree] = compartment_id_in_subtree
      query_params[:name] = opts[:name] if opts[:name]
      query_params[:recommendationName] = opts[:recommendation_name] if opts[:recommendation_name]
      query_params[:recommendationId] = opts[:recommendation_id] if opts[:recommendation_id]
      query_params[:resourceType] = opts[:resource_type] if opts[:resource_type]
      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]
      query_params[:lifecycleState] = opts[:lifecycle_state] if opts[:lifecycle_state]
      query_params[:status] = opts[:status] if opts[:status]
      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: 'OptimizerClient#list_histories') 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::Optimizer::Models::HistoryCollection'
        )
      end
    end
def list_histories ( compartment_id , compartment_id_in_subtree , opts = { } ) logger . debug 'Calling operation OptimizerClient#list_histories.' if logger raise "Missing the required parameter 'compartment_id' when calling list_histories." if compartment_id . nil? raise "Missing the required parameter 'compartment_id_in_subtree' when calling list_histories." if compartment_id_in_subtree . nil? if opts [ :sort_order ] && ! OCI :: Optimizer :: Models :: SORT_ORDER_ENUM . include? ( opts [ :sort_order ] ) raise 'Invalid value for "sort_order", must be one of the values in OCI::Optimizer::Models::SORT_ORDER_ENUM.' end if opts [ :sort_by ] && ! %w[ NAME TIMECREATED ] . include? ( opts [ :sort_by ] ) raise 'Invalid value for "sort_by", must be one of NAME, TIMECREATED.' end if opts [ :lifecycle_state ] && ! OCI :: Optimizer :: Models :: LIFECYCLE_STATE_ENUM . include? ( opts [ :lifecycle_state ] ) raise 'Invalid value for "lifecycle_state", must be one of the values in OCI::Optimizer::Models::LIFECYCLE_STATE_ENUM.' end if opts [ :status ] && ! OCI :: Optimizer :: Models :: STATUS_ENUM . include? ( opts [ :status ] ) raise 'Invalid value for "status", must be one of the values in OCI::Optimizer::Models::STATUS_ENUM.' end path = '/histories' operation_signing_strategy = :standard query_params = { } query_params [ :compartmentId ] = compartment_id query_params [ :compartmentIdInSubtree ] = compartment_id_in_subtree query_params [ :name ] = opts [ :name ] if opts [ :name ] query_params [ :recommendationName ] = opts [ :recommendation_name ] if opts [ :recommendation_name ] query_params [ :recommendationId ] = opts [ :recommendation_id ] if opts [ :recommendation_id ] query_params [ :resourceType ] = opts [ :resource_type ] if opts [ :resource_type ] 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 ] query_params [ :lifecycleState ] = opts [ :lifecycle_state ] if opts [ :lifecycle_state ] query_params [ :status ] = opts [ :status ] if opts [ :status ] 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 : 'OptimizerClient#list_histories' ) 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::Optimizer::Models::HistoryCollection' ) end end
Lists changes to the recommendations based on user activity.
Lists changes to the recommendations based on user activity .
# 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::Optimizer::Models::HistoryCollection HistoryCollection}
A Response object with data of type { OCI :: Optimizer :: Models :: HistoryCollection HistoryCollection }
Response
compartment_id
compartment_id_in_subtree
opts
:opc_request_id Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.
: opc_request_id Unique Oracle - assigned identifier for the request . If you need to contact Oracle about a particular request please provide the request ID .
opts the optional parameters
opts the optional parameters
note
Click [here] to see an example of how to use list_histories API.
Click [ here ] to see an example of how to use list_histories API .