lib/oci/blockchain/blockchain_platform_client.rb
# Lists the work requests in a compartment.
#
# @param [String] compartment_id The ID of the compartment in which to list resources.
# @param [String] blockchain_platform_id Unique service 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] :sort_order The sort order to use, either 'asc' or 'desc'. (default to ASC)
#   Allowed values are: ASC, DESC
# @option opts [String] :sort_by The field to sort by. Only one sort order may be provided. Default order for TIMESTARTED is descending. Default order for WORKREQUESTID is ascending. If no value is specified TIMESTARTED is default.
#    (default to timeStarted)
#   Allowed values are: timeStarted, workRequestId
# @option opts [String] :opc_request_id The client request ID for tracing.
# @option opts [String] :page The page at which to start retrieving results.
# @option opts [Integer] :limit The maximum number of items to return. (default to 10)
# @return [Response] A Response object with data of type {OCI::Blockchain::Models::WorkRequestCollection WorkRequestCollection}
# @note Click [here](https://docs.cloud.oracle.com/en-us/iaas/tools/ruby-sdk-examples/latest/blockchain/list_work_requests.rb.html) to see an example of how to use list_work_requests API.
Lists the work requests in a compartment.
Lists the work requests in a compartment .
def list_work_requests(compartment_id, blockchain_platform_id, opts = {})
      logger.debug 'Calling operation BlockchainPlatformClient#list_work_requests.' if logger
      raise "Missing the required parameter 'compartment_id' when calling list_work_requests." if compartment_id.nil?
      raise "Missing the required parameter 'blockchain_platform_id' when calling list_work_requests." if blockchain_platform_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[timeStarted workRequestId].include?(opts[:sort_by])
        raise 'Invalid value for "sort_by", must be one of timeStarted, workRequestId.'
      end
      path = '/workRequests'
      operation_signing_strategy = :standard
      query_params = {}
      query_params[:compartmentId] = compartment_id
      query_params[:blockchainPlatformId] = blockchain_platform_id
      query_params[:sortOrder] = opts[:sort_order] if opts[:sort_order]
      query_params[:sortBy] = opts[:sort_by] if opts[:sort_by]
      query_params[:page] = opts[:page] if opts[:page]
      query_params[:limit] = opts[:limit] if opts[:limit]
      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: 'BlockchainPlatformClient#list_work_requests') 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::Blockchain::Models::WorkRequestCollection'
        )
      end
    end
def list_work_requests ( compartment_id , blockchain_platform_id , opts = { } ) logger . debug 'Calling operation BlockchainPlatformClient#list_work_requests.' if logger raise "Missing the required parameter 'compartment_id' when calling list_work_requests." if compartment_id . nil? raise "Missing the required parameter 'blockchain_platform_id' when calling list_work_requests." if blockchain_platform_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[ timeStarted workRequestId ] . include? ( opts [ :sort_by ] ) raise 'Invalid value for "sort_by", must be one of timeStarted, workRequestId.' end path = '/workRequests' operation_signing_strategy = :standard query_params = { } query_params [ :compartmentId ] = compartment_id query_params [ :blockchainPlatformId ] = blockchain_platform_id query_params [ :sortOrder ] = opts [ :sort_order ] if opts [ :sort_order ] query_params [ :sortBy ] = opts [ :sort_by ] if opts [ :sort_by ] query_params [ :page ] = opts [ :page ] if opts [ :page ] query_params [ :limit ] = opts [ :limit ] if opts [ :limit ] 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 : 'BlockchainPlatformClient#list_work_requests' ) 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::Blockchain::Models::WorkRequestCollection' ) end end
Lists the work requests in a compartment.
Lists the work requests in a 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::Blockchain::Models::WorkRequestCollection WorkRequestCollection}
A Response object with data of type { OCI :: Blockchain :: Models :: WorkRequestCollection WorkRequestCollection }
Response
compartment_id
blockchain_platform_id
opts
:limit The maximum number of items to return. (default to 10)
: limit The maximum number of items to return . ( default to 10 )
opts the optional parameters
opts the optional parameters
note
Click [here] to see an example of how to use list_work_requests API.
Click [ here ] to see an example of how to use list_work_requests API .