lib/oci/database_management/db_management_client.rb
def list_managed_databases(compartment_id, opts = {})
      logger.debug 'Calling operation DbManagementClient#list_managed_databases.' if logger

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

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

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

      path = '/managedDatabases'
      operation_signing_strategy = :standard

      # rubocop:disable Style/NegatedIf
      # Query Params
      query_params = {}
      query_params[:compartmentId] = compartment_id
      query_params[:id] = opts[:id] if opts[:id]
      query_params[:name] = opts[:name] if opts[:name]
      query_params[:page] = opts[:page] if opts[:page]
      query_params[:limit] = opts[:limit] if opts[:limit]
      query_params[:sortBy] = opts[:sort_by] if opts[:sort_by]
      query_params[:sortOrder] = opts[:sort_order] if opts[:sort_order]

      # 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: 'DbManagementClient#list_managed_databases') 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::DatabaseManagement::Models::ManagedDatabaseCollection'
        )
      end
      # rubocop:enable Metrics/BlockLength
    end
# Gets the Managed Database for a specific ID or the list of Managed Databases in a specific compartment.
# Managed Databases can also be filtered based on the name parameter. Only one of the parameters, ID or name
# should be provided. If none of these parameters is provided, all the Managed Databases in the compartment are listed.
#
# @param [String] compartment_id The [OCID](https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) 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 [String] :opc_request_id The client request ID for tracing.
# @option opts [String] :id The identifier of the resource.
# @option opts [String] :name A filter to return only resources that match the entire name.
# @option opts [String] :page The page token representing the page, from where the next set of paginated results
#   are retrieved. This is usually retrieved from a previous list call.
#
# @option opts [Integer] :limit The maximum number of records returned in paginated response. (default to 10)
# @option opts [String] :sort_by The field to sort information by. Only one sortOrder can be used. The default sort order
#   for \u2018TIMECREATED\u2019 is descending and the default sort order for \u2018NAME\u2019 is ascending.
#   The \u2018NAME\u2019 sort order is case-sensitive.
#    (default to TIMECREATED)
#   Allowed values are: TIMECREATED, NAME
# @option opts [String] :sort_order The option to sort information in ascending (\u2018ASC\u2019) or descending (\u2018DESC\u2019) order. (default to ASC)
# @return [Response] A Response object with data of type {OCI::DatabaseManagement::Models::ManagedDatabaseCollection ManagedDatabaseCollection}
# @note Click [here](https://docs.cloud.oracle.com/en-us/iaas/tools/ruby-sdk-examples/latest/databasemanagement/list_managed_databases.rb.html) to see an example of how to use list_managed_databases API.
Gets the Managed Database for a specific ID or the list of Managed Databases in a specific compartment.
Managed Databases can also be filtered based on the name parameter. Only one of the parameters, ID or name
should be provided. If none of these parameters is provided, all the Managed Databases in the compartment are listed.
Gets the Managed Database for a specific ID or the list of Managed Databases in a specific compartment . Managed Databases can also be filtered based on the name parameter . Only one of the parameters ID or name should be provided . If none of these parameters is provided all the Managed Databases in the compartment are listed .
def list_managed_databases(compartment_id, opts = {})
      logger.debug 'Calling operation DbManagementClient#list_managed_databases.' if logger
      raise "Missing the required parameter 'compartment_id' when calling list_managed_databases." if compartment_id.nil?
      if opts[:sort_by] && !%w[TIMECREATED NAME].include?(opts[:sort_by])
        raise 'Invalid value for "sort_by", must be one of TIMECREATED, NAME.'
      end
      if opts[:sort_order] && !OCI::DatabaseManagement::Models::SORT_ORDERS_ENUM.include?(opts[:sort_order])
        raise 'Invalid value for "sort_order", must be one of the values in OCI::DatabaseManagement::Models::SORT_ORDERS_ENUM.'
      end
      path = '/managedDatabases'
      operation_signing_strategy = :standard
      query_params = {}
      query_params[:compartmentId] = compartment_id
      query_params[:id] = opts[:id] if opts[:id]
      query_params[:name] = opts[:name] if opts[:name]
      query_params[:page] = opts[:page] if opts[:page]
      query_params[:limit] = opts[:limit] if opts[:limit]
      query_params[:sortBy] = opts[:sort_by] if opts[:sort_by]
      query_params[:sortOrder] = opts[:sort_order] if opts[:sort_order]
      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: 'DbManagementClient#list_managed_databases') 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::DatabaseManagement::Models::ManagedDatabaseCollection'
        )
      end
    end
def list_managed_databases ( compartment_id , opts = { } ) logger . debug 'Calling operation DbManagementClient#list_managed_databases.' if logger raise "Missing the required parameter 'compartment_id' when calling list_managed_databases." if compartment_id . nil? if opts [ :sort_by ] && ! %w[ TIMECREATED NAME ] . include? ( opts [ :sort_by ] ) raise 'Invalid value for "sort_by", must be one of TIMECREATED, NAME.' end if opts [ :sort_order ] && ! OCI :: DatabaseManagement :: Models :: SORT_ORDERS_ENUM . include? ( opts [ :sort_order ] ) raise 'Invalid value for "sort_order", must be one of the values in OCI::DatabaseManagement::Models::SORT_ORDERS_ENUM.' end path = '/managedDatabases' operation_signing_strategy = :standard query_params = { } query_params [ :compartmentId ] = compartment_id query_params [ :id ] = opts [ :id ] if opts [ :id ] query_params [ :name ] = opts [ :name ] if opts [ :name ] query_params [ :page ] = opts [ :page ] if opts [ :page ] query_params [ :limit ] = opts [ :limit ] if opts [ :limit ] query_params [ :sortBy ] = opts [ :sort_by ] if opts [ :sort_by ] query_params [ :sortOrder ] = opts [ :sort_order ] if opts [ :sort_order ] 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 : 'DbManagementClient#list_managed_databases' ) 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::DatabaseManagement::Models::ManagedDatabaseCollection' ) end end
Gets the Managed Database for a specific ID or the list of Managed Databases in a specific compartment.
Gets the Managed Database for a specific ID or the list of Managed Databases in a specific compartment .
# 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::DatabaseManagement::Models::ManagedDatabaseCollection ManagedDatabaseCollection}
A Response object with data of type { OCI :: DatabaseManagement :: Models :: ManagedDatabaseCollection ManagedDatabaseCollection }
Response
compartment_id
opts
:sort_order The option to sort information in ascending (\u2018ASC\u2019) or descending (\u2018DESC\u2019) order. (default to ASC)
: sort_order The option to sort information in ascending ( \ u2018ASC \ u2019 ) or descending ( \ u2018DESC \ u2019 ) order . ( default to ASC )
opts the optional parameters
opts the optional parameters
note
Click [here] to see an example of how to use list_managed_databases API.
Click [ here ] to see an example of how to use list_managed_databases API .