lib/oci/management_agent/management_agent_client.rb
def list_availability_histories(management_agent_id, opts = {})
      logger.debug 'Calling operation ManagementAgentClient#list_availability_histories.' if logger

      raise "Missing the required parameter 'management_agent_id' when calling list_availability_histories." if management_agent_id.nil?

      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[timeAvailabilityStatusStarted].include?(opts[:sort_by])
        raise 'Invalid value for "sort_by", must be one of timeAvailabilityStatusStarted.'
      end
      raise "Parameter value for 'management_agent_id' must not be blank" if OCI::Internal::Util.blank_string?(management_agent_id)

      path = '/managementAgents/{managementAgentId}/availabilityHistories'.sub('{managementAgentId}', management_agent_id.to_s)
      operation_signing_strategy = :standard

      # rubocop:disable Style/NegatedIf
      # Query Params
      query_params = {}
      query_params[:timeAvailabilityStatusEndedGreaterThan] = opts[:time_availability_status_ended_greater_than] if opts[:time_availability_status_ended_greater_than]
      query_params[:timeAvailabilityStatusStartedLessThan] = opts[:time_availability_status_started_less_than] if opts[:time_availability_status_started_less_than]
      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: 'ManagementAgentClient#list_availability_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: 'Array<OCI::ManagementAgent::Models::AvailabilityHistorySummary>'
        )
      end
      # rubocop:enable Metrics/BlockLength
    end
# Lists the availability history records of Management Agent
# @param [String] management_agent_id Unique Management Agent identifier
# @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] :opc_request_id The client request ID for tracing.
# @option opts [DateTime] :time_availability_status_ended_greater_than Filter to limit the availability history results to that of time after the input time including the boundary record.
#   Defaulted to current date minus one year.
#   The date and time to be given as described in [RFC 3339](https://tools.ietf.org/rfc/rfc3339), section 14.29.
#
# @option opts [DateTime] :time_availability_status_started_less_than Filter to limit the availability history results to that of time before the input time including the boundary record
#   Defaulted to current date.
#   The date and time to be given as described in [RFC 3339](https://tools.ietf.org/rfc/rfc3339), section 14.29.
#
# @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. Default order for timeAvailabilityStatusStarted is descending.
#    (default to timeAvailabilityStatusStarted)
#   Allowed values are: timeAvailabilityStatusStarted
# @return [Response] A Response object with data of type Array<{OCI::ManagementAgent::Models::AvailabilityHistorySummary AvailabilityHistorySummary}>
# @note Click [here](https://docs.cloud.oracle.com/en-us/iaas/tools/ruby-sdk-examples/latest/managementagent/list_availability_histories.rb.html) to see an example of how to use list_availability_histories API.
Lists the availability history records of Management Agent
Lists the availability history records of Management Agent
def list_availability_histories(management_agent_id, opts = {})
      logger.debug 'Calling operation ManagementAgentClient#list_availability_histories.' if logger
      raise "Missing the required parameter 'management_agent_id' when calling list_availability_histories." if management_agent_id.nil?
      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[timeAvailabilityStatusStarted].include?(opts[:sort_by])
        raise 'Invalid value for "sort_by", must be one of timeAvailabilityStatusStarted.'
      end
      raise "Parameter value for 'management_agent_id' must not be blank" if OCI::Internal::Util.blank_string?(management_agent_id)
      path = '/managementAgents/{managementAgentId}/availabilityHistories'.sub('{managementAgentId}', management_agent_id.to_s)
      operation_signing_strategy = :standard
      query_params = {}
      query_params[:timeAvailabilityStatusEndedGreaterThan] = opts[:time_availability_status_ended_greater_than] if opts[:time_availability_status_ended_greater_than]
      query_params[:timeAvailabilityStatusStartedLessThan] = opts[:time_availability_status_started_less_than] if opts[:time_availability_status_started_less_than]
      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: 'ManagementAgentClient#list_availability_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: 'Array<OCI::ManagementAgent::Models::AvailabilityHistorySummary>'
        )
      end
    end
def list_availability_histories ( management_agent_id , opts = { } ) logger . debug 'Calling operation ManagementAgentClient#list_availability_histories.' if logger raise "Missing the required parameter 'management_agent_id' when calling list_availability_histories." if management_agent_id . nil? 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[ timeAvailabilityStatusStarted ] . include? ( opts [ :sort_by ] ) raise 'Invalid value for "sort_by", must be one of timeAvailabilityStatusStarted.' end raise "Parameter value for 'management_agent_id' must not be blank" if OCI :: Internal :: Util . blank_string? ( management_agent_id ) path = '/managementAgents/{managementAgentId}/availabilityHistories' . sub ( '{managementAgentId}' , management_agent_id . to_s ) operation_signing_strategy = :standard query_params = { } query_params [ :timeAvailabilityStatusEndedGreaterThan ] = opts [ :time_availability_status_ended_greater_than ] if opts [ :time_availability_status_ended_greater_than ] query_params [ :timeAvailabilityStatusStartedLessThan ] = opts [ :time_availability_status_started_less_than ] if opts [ :time_availability_status_started_less_than ] 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 : 'ManagementAgentClient#list_availability_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 : 'Array<OCI::ManagementAgent::Models::AvailabilityHistorySummary>' ) end end
Lists the availability history records of Management Agent
Lists the availability history records of Management Agent
# 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::ManagementAgent::Models::AvailabilityHistorySummary AvailabilityHistorySummary}>
A Response object with data of type Array< { OCI :: ManagementAgent :: Models :: AvailabilityHistorySummary AvailabilityHistorySummary } >
Response
management_agent_id
opts
:sort_by The field to sort by. Default order for timeAvailabilityStatusStarted is descending. (default to timeAvailabilityStatusStarted) Allowed values are: timeAvailabilityStatusStarted
: sort_by The field to sort by . Default order for timeAvailabilityStatusStarted is descending . ( default to timeAvailabilityStatusStarted ) Allowed values are : timeAvailabilityStatusStarted
opts the optional parameters
opts the optional parameters
note
Click [here] to see an example of how to use list_availability_histories API.
Click [ here ] to see an example of how to use list_availability_histories API .