lib/oci/file_storage/file_storage_client.rb
# Lists the mount target resources in the specified compartment.
#
# @param [String] compartment_id The [OCID](https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the compartment.
# @param [String] availability_domain The name of the availability domain.
#
#   Example: `Uocm:PHX-AD-1`
#
# @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 For list pagination. The maximum number of results per page,
#   or items to return in a paginated \"List\" call.
#   1 is the minimum, 1000 is the maximum.
#
#   For important details about how pagination works,
#   see [List Pagination](https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine).
#
#   Example: `500`
#    (default to 1000)
# @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/iaas/Content/API/Concepts/usingapi.htm#nine).
#    (default to none)
# @option opts [String] :display_name A user-friendly name. It does not have to be unique, and it is changeable.
#
#   Example: `My resource`
#    (default to none)
# @option opts [String] :export_set_id The [OCID](https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the export set. (default to none)
# @option opts [String] :lifecycle_state Filter results by the specified lifecycle state. Must be a valid
#   state for the resource type.
#
#   Allowed values are: CREATING, ACTIVE, DELETING, DELETED, FAILED
# @option opts [String] :id Filter results by [OCID](https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm). Must be an OCID of the correct type for
#   the resouce type.
#    (default to none)
# @option opts [String] :sort_by The field to sort by. You can choose either value, but not both.
#   By default, when you sort by time created, results are shown
#   in descending order. When you sort by display name, results are
#   shown in ascending order.
#    (default to TIMECREATED)
#   Allowed values are: TIMECREATED, DISPLAYNAME
# @option opts [String] :sort_order The sort order to use, either 'asc' or 'desc', where 'asc' is
#   ascending and 'desc' is descending. The default order is 'desc'
#   except for numeric values.
#    (default to DESC)
#   Allowed values are: ASC, DESC
# @option opts [String] :opc_request_id Unique 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 Array<{OCI::FileStorage::Models::MountTargetSummary MountTargetSummary}>
# @note Click [here](https://docs.cloud.oracle.com/en-us/iaas/tools/ruby-sdk-examples/latest/filestorage/list_mount_targets.rb.html) to see an example of how to use list_mount_targets API.
Lists the mount target resources in the specified compartment.
Lists the mount target resources in the specified compartment .
def list_mount_targets(compartment_id, availability_domain, opts = {})
      logger.debug 'Calling operation FileStorageClient#list_mount_targets.' if logger
      raise "Missing the required parameter 'compartment_id' when calling list_mount_targets." if compartment_id.nil?
      raise "Missing the required parameter 'availability_domain' when calling list_mount_targets." if availability_domain.nil?
      if opts[:lifecycle_state] && !%w[CREATING ACTIVE DELETING DELETED FAILED].include?(opts[:lifecycle_state])
        raise 'Invalid value for "lifecycle_state", must be one of CREATING, ACTIVE, DELETING, DELETED, FAILED.'
      end
      if opts[:sort_by] && !%w[TIMECREATED DISPLAYNAME].include?(opts[:sort_by])
        raise 'Invalid value for "sort_by", must be one of TIMECREATED, DISPLAYNAME.'
      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 = '/mountTargets'
      operation_signing_strategy = :standard
      query_params = {}
      query_params[:compartmentId] = compartment_id
      query_params[:availabilityDomain] = availability_domain
      query_params[:limit] = opts[:limit] if opts[:limit]
      query_params[:page] = opts[:page] if opts[:page]
      query_params[:displayName] = opts[:display_name] if opts[:display_name]
      query_params[:exportSetId] = opts[:export_set_id] if opts[:export_set_id]
      query_params[:lifecycleState] = opts[:lifecycle_state] if opts[:lifecycle_state]
      query_params[:id] = opts[:id] if opts[:id]
      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: 'FileStorageClient#list_mount_targets') 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::FileStorage::Models::MountTargetSummary>'
        )
      end
    end
def list_mount_targets ( compartment_id , availability_domain , opts = { } ) logger . debug 'Calling operation FileStorageClient#list_mount_targets.' if logger raise "Missing the required parameter 'compartment_id' when calling list_mount_targets." if compartment_id . nil? raise "Missing the required parameter 'availability_domain' when calling list_mount_targets." if availability_domain . nil? if opts [ :lifecycle_state ] && ! %w[ CREATING ACTIVE DELETING DELETED FAILED ] . include? ( opts [ :lifecycle_state ] ) raise 'Invalid value for "lifecycle_state", must be one of CREATING, ACTIVE, DELETING, DELETED, FAILED.' end if opts [ :sort_by ] && ! %w[ TIMECREATED DISPLAYNAME ] . include? ( opts [ :sort_by ] ) raise 'Invalid value for "sort_by", must be one of TIMECREATED, DISPLAYNAME.' 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 = '/mountTargets' operation_signing_strategy = :standard query_params = { } query_params [ :compartmentId ] = compartment_id query_params [ :availabilityDomain ] = availability_domain query_params [ :limit ] = opts [ :limit ] if opts [ :limit ] query_params [ :page ] = opts [ :page ] if opts [ :page ] query_params [ :displayName ] = opts [ :display_name ] if opts [ :display_name ] query_params [ :exportSetId ] = opts [ :export_set_id ] if opts [ :export_set_id ] query_params [ :lifecycleState ] = opts [ :lifecycle_state ] if opts [ :lifecycle_state ] query_params [ :id ] = opts [ :id ] if opts [ :id ] 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 : 'FileStorageClient#list_mount_targets' ) 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::FileStorage::Models::MountTargetSummary>' ) end end
Lists the mount target resources in the specified compartment.
Lists the mount target resources in the specified 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 Array<{OCI::FileStorage::Models::MountTargetSummary MountTargetSummary}>
A Response object with data of type Array< { OCI :: FileStorage :: Models :: MountTargetSummary MountTargetSummary } >
Response
compartment_id
availability_domain
opts
:opc_request_id Unique identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.
: opc_request_id Unique 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_mount_targets API.
Click [ here ] to see an example of how to use list_mount_targets API .