lib/oci/opsi/operations_insights_client.rb
def summarize_database_insight_resource_usage(compartment_id, resource_metric, opts = {})
      logger.debug 'Calling operation OperationsInsightsClient#summarize_database_insight_resource_usage.' if logger

      raise "Missing the required parameter 'compartment_id' when calling summarize_database_insight_resource_usage." if compartment_id.nil?
      raise "Missing the required parameter 'resource_metric' when calling summarize_database_insight_resource_usage." if resource_metric.nil?


      database_type_allowable_values = %w[ADW-S ATP-S ADW-D ATP-D]
      if opts[:database_type] && !opts[:database_type].empty?
        opts[:database_type].each do |val_to_check|
          unless database_type_allowable_values.include?(val_to_check)
            raise 'Invalid value for "database_type", must be one of ADW-S, ATP-S, ADW-D, ATP-D.'
          end
        end
      end

      path = '/databaseInsights/resourceUsageSummary'
      operation_signing_strategy = :standard

      # rubocop:disable Style/NegatedIf
      # Query Params
      query_params = {}
      query_params[:compartmentId] = compartment_id
      query_params[:resourceMetric] = resource_metric
      query_params[:analysisTimeInterval] = opts[:analysis_time_interval] if opts[:analysis_time_interval]
      query_params[:timeIntervalStart] = opts[:time_interval_start] if opts[:time_interval_start]
      query_params[:timeIntervalEnd] = opts[:time_interval_end] if opts[:time_interval_end]
      query_params[:databaseType] = OCI::ApiClient.build_collection_params(opts[:database_type], :multi) if opts[:database_type] && !opts[:database_type].empty?
      query_params[:databaseId] = OCI::ApiClient.build_collection_params(opts[:database_id], :multi) if opts[:database_id] && !opts[:database_id].empty?
      query_params[:page] = opts[:page] if opts[:page]
      query_params[:percentile] = opts[:percentile] if opts[:percentile]

      # 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: 'OperationsInsightsClient#summarize_database_insight_resource_usage') 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::Opsi::Models::SummarizeDatabaseInsightResourceUsageAggregation'
        )
      end
      # rubocop:enable Metrics/BlockLength
    end
# A cumulative distribution function is used to rank the usage data points per database within the specified time period.
# For each database, the minimum data point with a ranking > the percentile value is included in the summation.
# Linear regression functions are used to calculate the usage change percentage.
#
# @param [String] compartment_id The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment.
# @param [String] resource_metric Filter by resource metric.
#   Supported values are CPU and STORAGE.
#
# @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] :analysis_time_interval Specify time period in ISO 8601 format with respect to current time.
#   Default is last 30 days represented by P30D.
#   If timeInterval is specified, then timeIntervalStart and timeIntervalEnd will be ignored.
#   Examples  P90D (last 90 days), P4W (last 4 weeks), P2M (last 2 months), P1Y (last 12 months), . Maximum value allowed is 25 months prior to current time (P25M).
#    (default to P30D)
# @option opts [DateTime] :time_interval_start Analysis start time in UTC in ISO 8601 format(inclusive).
#   Example 2019-10-30T00:00:00Z (yyyy-MM-ddThh:mm:ssZ).
#   The minimum allowed value is 2 years prior to the current day.
#   timeIntervalStart and timeIntervalEnd parameters are used together.
#   If analysisTimeInterval is specified, this parameter is ignored.
#
# @option opts [DateTime] :time_interval_end Analysis end time in UTC in ISO 8601 format(exclusive).
#   Example 2019-10-30T00:00:00Z (yyyy-MM-ddThh:mm:ssZ).
#   timeIntervalStart and timeIntervalEnd are used together.
#   If timeIntervalEnd is not specified, current time is used as timeIntervalEnd.
#
# @option opts [Array<String>] :database_type Filter by one or more database type.
#   Possible values are ADW-S, ATP-S, ADW-D, ATP-D
#    (default to [])
#   Allowed values are: ADW-S, ATP-S, ADW-D, ATP-D
# @option opts [Array<String>] :database_id Optional list of database [OCIDs](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm).
#    (default to [])
# @option opts [String] :page For list pagination. The value of the `opc-next-page` response header from
#   the previous \"List\" call. For important details about how pagination works,
#   see [List Pagination](https://docs.cloud.oracle.com/Content/API/Concepts/usingapi.htm#nine).
#
# @option opts [Integer] :percentile Percentile values of daily usage to be used for computing the aggregate resource usage.
#    (default to 90)
# @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::Opsi::Models::SummarizeDatabaseInsightResourceUsageAggregation SummarizeDatabaseInsightResourceUsageAggregation}
# @note Click [here](https://docs.cloud.oracle.com/en-us/iaas/tools/ruby-sdk-examples/latest/opsi/summarize_database_insight_resource_usage.rb.html) to see an example of how to use summarize_database_insight_resource_usage API.
A cumulative distribution function is used to rank the usage data points per database within the specified time period.
For each database, the minimum data point with a ranking > the percentile value is included in the summation.
Linear regression functions are used to calculate the usage change percentage.
A cumulative distribution function is used to rank the usage data points per database within the specified time period . For each database the minimum data point with a ranking > the percentile value is included in the summation . Linear regression functions are used to calculate the usage change percentage .
def summarize_database_insight_resource_usage(compartment_id, resource_metric, opts = {})
      logger.debug 'Calling operation OperationsInsightsClient#summarize_database_insight_resource_usage.' if logger
      raise "Missing the required parameter 'compartment_id' when calling summarize_database_insight_resource_usage." if compartment_id.nil?
      raise "Missing the required parameter 'resource_metric' when calling summarize_database_insight_resource_usage." if resource_metric.nil?
      database_type_allowable_values = %w[ADW-S ATP-S ADW-D ATP-D]
      if opts[:database_type] && !opts[:database_type].empty?
        opts[:database_type].each do |val_to_check|
          unless database_type_allowable_values.include?(val_to_check)
            raise 'Invalid value for "database_type", must be one of ADW-S, ATP-S, ADW-D, ATP-D.'
          end
        end
      end
      path = '/databaseInsights/resourceUsageSummary'
      operation_signing_strategy = :standard
      query_params = {}
      query_params[:compartmentId] = compartment_id
      query_params[:resourceMetric] = resource_metric
      query_params[:analysisTimeInterval] = opts[:analysis_time_interval] if opts[:analysis_time_interval]
      query_params[:timeIntervalStart] = opts[:time_interval_start] if opts[:time_interval_start]
      query_params[:timeIntervalEnd] = opts[:time_interval_end] if opts[:time_interval_end]
      query_params[:databaseType] = OCI::ApiClient.build_collection_params(opts[:database_type], :multi) if opts[:database_type] && !opts[:database_type].empty?
      query_params[:databaseId] = OCI::ApiClient.build_collection_params(opts[:database_id], :multi) if opts[:database_id] && !opts[:database_id].empty?
      query_params[:page] = opts[:page] if opts[:page]
      query_params[:percentile] = opts[:percentile] if opts[:percentile]
      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: 'OperationsInsightsClient#summarize_database_insight_resource_usage') 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::Opsi::Models::SummarizeDatabaseInsightResourceUsageAggregation'
        )
      end
    end
def summarize_database_insight_resource_usage ( compartment_id , resource_metric , opts = { } ) logger . debug 'Calling operation OperationsInsightsClient#summarize_database_insight_resource_usage.' if logger raise "Missing the required parameter 'compartment_id' when calling summarize_database_insight_resource_usage." if compartment_id . nil? raise "Missing the required parameter 'resource_metric' when calling summarize_database_insight_resource_usage." if resource_metric . nil? database_type_allowable_values = %w[ ADW-S ATP-S ADW-D ATP-D ] if opts [ :database_type ] && ! opts [ :database_type ] . empty? opts [ :database_type ] . each do | val_to_check | unless database_type_allowable_values . include? ( val_to_check ) raise 'Invalid value for "database_type", must be one of ADW-S, ATP-S, ADW-D, ATP-D.' end end end path = '/databaseInsights/resourceUsageSummary' operation_signing_strategy = :standard query_params = { } query_params [ :compartmentId ] = compartment_id query_params [ :resourceMetric ] = resource_metric query_params [ :analysisTimeInterval ] = opts [ :analysis_time_interval ] if opts [ :analysis_time_interval ] query_params [ :timeIntervalStart ] = opts [ :time_interval_start ] if opts [ :time_interval_start ] query_params [ :timeIntervalEnd ] = opts [ :time_interval_end ] if opts [ :time_interval_end ] query_params [ :databaseType ] = OCI :: ApiClient . build_collection_params ( opts [ :database_type ] , :multi ) if opts [ :database_type ] && ! opts [ :database_type ] . empty? query_params [ :databaseId ] = OCI :: ApiClient . build_collection_params ( opts [ :database_id ] , :multi ) if opts [ :database_id ] && ! opts [ :database_id ] . empty? query_params [ :page ] = opts [ :page ] if opts [ :page ] query_params [ :percentile ] = opts [ :percentile ] if opts [ :percentile ] 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 : 'OperationsInsightsClient#summarize_database_insight_resource_usage' ) 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::Opsi::Models::SummarizeDatabaseInsightResourceUsageAggregation' ) end end
A cumulative distribution function is used to rank the usage data points per database within the specified time period.
A cumulative distribution function is used to rank the usage data points per database within the specified time period .
# 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::Opsi::Models::SummarizeDatabaseInsightResourceUsageAggregation SummarizeDatabaseInsightResourceUsageAggregation}
A Response object with data of type { OCI :: Opsi :: Models :: SummarizeDatabaseInsightResourceUsageAggregation SummarizeDatabaseInsightResourceUsageAggregation }
Response
compartment_id
resource_metric
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 summarize_database_insight_resource_usage API.
Click [ here ] to see an example of how to use summarize_database_insight_resource_usage API .