lib/oci/mysql/mysqlaas_client.rb
# Lists the Configurations available when creating a DB System.
#
# This may include DEFAULT configurations per Shape and CUSTOM configurations.
#
# The default sort order is a multi-part sort by:
#   - shapeName, ascending
#   - DEFAULT-before-CUSTOM
#   - displayName ascending
#
# @param [String] compartment_id The compartment [OCID](https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm).
# @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 Customer-defined unique identifier for the request. If you need to
#   contact Oracle about a specific request, please provide the request
#   ID that you supplied in this header with the request.
#
# @option opts [String] :configuration_id The requested Configuration instance.
# @option opts [String] :lifecycle_state Configuration Lifecycle State (default to AVAILABLE)
# @option opts [Array<String>] :type The requested Configuration types. (default to [DEFAULT])
#   Allowed values are: DEFAULT, CUSTOM
# @option opts [String] :display_name A filter to return only the resource matching the given display name exactly.
# @option opts [String] :shape_name The requested Shape name.
# @option opts [String] :sort_by The field to sort by. Only one sort order may be provided. Time fields are default ordered as descending. Display name is default ordered as ascending.
#    (default to timeCreated)
#   Allowed values are: displayName, shapeName, timeCreated, timeUpdated
# @option opts [String] :sort_order The sort order to use (ASC or DESC). (default to ASC)
#   Allowed values are: ASC, DESC
# @option opts [Integer] :limit The maximum number of items to return in a paginated list call. For information about pagination, see
#   [List Pagination](https://docs.cloud.oracle.com/#API/Concepts/usingapi.htm#List_Pagination).
#    (default to 100)
# @option opts [String] :page The value of the `opc-next-page` or `opc-prev-page` response header from
#   the previous list call. For information about pagination, see [List
#   Pagination](https://docs.cloud.oracle.com/#API/Concepts/usingapi.htm#List_Pagination).
#
# @return [Response] A Response object with data of type Array<{OCI::Mysql::Models::ConfigurationSummary ConfigurationSummary}>
# @note Click [here](https://docs.cloud.oracle.com/en-us/iaas/tools/ruby-sdk-examples/latest/mysql/list_configurations.rb.html) to see an example of how to use list_configurations API.
Lists the Configurations available when creating a DB System.
This may include DEFAULT configurations per Shape and CUSTOM configurations.

The default sort order is a multi-part sort by:
shapeName, ascending
DEFAULT-before-CUSTOM
displayName ascending
Lists the Configurations available when creating a DB System . This may include DEFAULT configurations per Shape and CUSTOM configurations . The default sort order is a multi - part sort by : shapeName ascending DEFAULT - before - CUSTOM displayName ascending
def list_configurations(compartment_id, opts = {})
      logger.debug 'Calling operation MysqlaasClient#list_configurations.' if logger
      raise "Missing the required parameter 'compartment_id' when calling list_configurations." if compartment_id.nil?
      if opts[:lifecycle_state] && !OCI::Mysql::Models::Configuration::LIFECYCLE_STATE_ENUM.include?(opts[:lifecycle_state])
        raise 'Invalid value for "lifecycle_state", must be one of the values in OCI::Mysql::Models::Configuration::LIFECYCLE_STATE_ENUM.'
      end
      type_allowable_values = %w[DEFAULT CUSTOM]
      if opts[:type] && !opts[:type].empty?
        opts[:type].each do |val_to_check|
          unless type_allowable_values.include?(val_to_check)
            raise 'Invalid value for "type", must be one of DEFAULT, CUSTOM.'
          end
        end
      end
      if opts[:sort_by] && !%w[displayName shapeName timeCreated timeUpdated].include?(opts[:sort_by])
        raise 'Invalid value for "sort_by", must be one of displayName, shapeName, timeCreated, timeUpdated.'
      end
      if opts[:sort_order] && !%w[ASC DESC].include?(opts[:sort_order])
        raise 'Invalid value for "sort_order", must be one of ASC, DESC.'
      end
      path = '/configurations'
      operation_signing_strategy = :standard
      query_params = {}
      query_params[:compartmentId] = compartment_id
      query_params[:configurationId] = opts[:configuration_id] if opts[:configuration_id]
      query_params[:lifecycleState] = opts[:lifecycle_state] if opts[:lifecycle_state]
      query_params[:type] = OCI::ApiClient.build_collection_params(opts[:type], :multi) if opts[:type] && !opts[:type].empty?
      query_params[:displayName] = opts[:display_name] if opts[:display_name]
      query_params[:shapeName] = opts[:shape_name] if opts[:shape_name]
      query_params[:sortBy] = opts[:sort_by] if opts[:sort_by]
      query_params[:sortOrder] = opts[:sort_order] if opts[:sort_order]
      query_params[:limit] = opts[:limit] if opts[:limit]
      query_params[:page] = opts[:page] if opts[:page]
      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: 'MysqlaasClient#list_configurations') 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::Mysql::Models::ConfigurationSummary>'
        )
      end
    end
def list_configurations ( compartment_id , opts = { } ) logger . debug 'Calling operation MysqlaasClient#list_configurations.' if logger raise "Missing the required parameter 'compartment_id' when calling list_configurations." if compartment_id . nil? if opts [ :lifecycle_state ] && ! OCI :: Mysql :: Models :: Configuration :: LIFECYCLE_STATE_ENUM . include? ( opts [ :lifecycle_state ] ) raise 'Invalid value for "lifecycle_state", must be one of the values in OCI::Mysql::Models::Configuration::LIFECYCLE_STATE_ENUM.' end type_allowable_values = %w[ DEFAULT CUSTOM ] if opts [ :type ] && ! opts [ :type ] . empty? opts [ :type ] . each do | val_to_check | unless type_allowable_values . include? ( val_to_check ) raise 'Invalid value for "type", must be one of DEFAULT, CUSTOM.' end end end if opts [ :sort_by ] && ! %w[ displayName shapeName timeCreated timeUpdated ] . include? ( opts [ :sort_by ] ) raise 'Invalid value for "sort_by", must be one of displayName, shapeName, timeCreated, timeUpdated.' end if opts [ :sort_order ] && ! %w[ ASC DESC ] . include? ( opts [ :sort_order ] ) raise 'Invalid value for "sort_order", must be one of ASC, DESC.' end path = '/configurations' operation_signing_strategy = :standard query_params = { } query_params [ :compartmentId ] = compartment_id query_params [ :configurationId ] = opts [ :configuration_id ] if opts [ :configuration_id ] query_params [ :lifecycleState ] = opts [ :lifecycle_state ] if opts [ :lifecycle_state ] query_params [ :type ] = OCI :: ApiClient . build_collection_params ( opts [ :type ] , :multi ) if opts [ :type ] && ! opts [ :type ] . empty? query_params [ :displayName ] = opts [ :display_name ] if opts [ :display_name ] query_params [ :shapeName ] = opts [ :shape_name ] if opts [ :shape_name ] query_params [ :sortBy ] = opts [ :sort_by ] if opts [ :sort_by ] query_params [ :sortOrder ] = opts [ :sort_order ] if opts [ :sort_order ] query_params [ :limit ] = opts [ :limit ] if opts [ :limit ] query_params [ :page ] = opts [ :page ] if opts [ :page ] 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 : 'MysqlaasClient#list_configurations' ) 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::Mysql::Models::ConfigurationSummary>' ) end end
Lists the Configurations available when creating a DB System.
Lists the Configurations available when creating a DB System .
# 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::Mysql::Models::ConfigurationSummary ConfigurationSummary}>
A Response object with data of type Array< { OCI :: Mysql :: Models :: ConfigurationSummary ConfigurationSummary } >
Response
compartment_id
opts
:page The value of the `opc-next-page` or `opc-prev-page` response header from the previous list call. For information about pagination, see [List Pagination].
: page The value of the ` opc - next - page ` or ` opc - prev - page ` response header from the previous list call . For information about pagination see [ List Pagination ] .
opts the optional parameters
opts the optional parameters
note
Click [here] to see an example of how to use list_configurations API.
Click [ here ] to see an example of how to use list_configurations API .