lib/oci/optimizer/optimizer_client.rb
# Lists the Cloud Advisor enrollment statuses.
#
# @param [String] compartment_id The OCID of the 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 [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 results that match the Cloud Advisor enrollment 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::EnrollmentStatusCollection EnrollmentStatusCollection}
# @note Click [here](https://docs.cloud.oracle.com/en-us/iaas/tools/ruby-sdk-examples/latest/optimizer/list_enrollment_statuses.rb.html) to see an example of how to use list_enrollment_statuses API.
Lists the Cloud Advisor enrollment statuses.
Lists the Cloud Advisor enrollment statuses .
def list_enrollment_statuses(compartment_id, opts = {})
      logger.debug 'Calling operation OptimizerClient#list_enrollment_statuses.' if logger
      raise "Missing the required parameter 'compartment_id' when calling list_enrollment_statuses." if compartment_id.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::OPTIMIZER_ENROLLMENT_STATUS_ENUM.include?(opts[:status])
        raise 'Invalid value for "status", must be one of the values in OCI::Optimizer::Models::OPTIMIZER_ENROLLMENT_STATUS_ENUM.'
      end
      path = '/enrollmentStatus'
      operation_signing_strategy = :standard
      query_params = {}
      query_params[:compartmentId] = compartment_id
      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_enrollment_statuses') 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::EnrollmentStatusCollection'
        )
      end
    end
def list_enrollment_statuses ( compartment_id , opts = { } ) logger . debug 'Calling operation OptimizerClient#list_enrollment_statuses.' if logger raise "Missing the required parameter 'compartment_id' when calling list_enrollment_statuses." if compartment_id . 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 :: OPTIMIZER_ENROLLMENT_STATUS_ENUM . include? ( opts [ :status ] ) raise 'Invalid value for "status", must be one of the values in OCI::Optimizer::Models::OPTIMIZER_ENROLLMENT_STATUS_ENUM.' end path = '/enrollmentStatus' operation_signing_strategy = :standard query_params = { } query_params [ :compartmentId ] = compartment_id 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_enrollment_statuses' ) 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::EnrollmentStatusCollection' ) end end
Lists the Cloud Advisor enrollment statuses.
Lists the Cloud Advisor enrollment statuses .
# 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::EnrollmentStatusCollection EnrollmentStatusCollection}
A Response object with data of type { OCI :: Optimizer :: Models :: EnrollmentStatusCollection EnrollmentStatusCollection }
Response
compartment_id
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_enrollment_statuses API.
Click [ here ] to see an example of how to use list_enrollment_statuses API .