lib/oci/oda/oda_client.rb
# Returns a page of work requests for the specified compartment.
#
# If the `opc-next-page` header appears in the response, then
# there are more items to retrieve. To get the next page in the subsequent
# GET request, include the header's value as the `page` query parameter.
#
# @param [String] compartment_id List the Digital Assistant instances that belong to this 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. This value is included in the opc-request-id response header.
# @option opts [String] :oda_instance_id List only the information for this Digital Assistant instance.
# @option opts [String] :page The page at which to start retrieving results.
#
#   You get this value from the `opc-next-page` header in a previous list request.
#   To retireve the first page, omit this query parameter.
#
#   Example: `MToxMA==`
#
# @option opts [Integer] :limit The maximum number of items to return per page. (default to 100)
# @option opts [String] :sort_by The field to sort by. You can specify only one sort order. If no value is specified, then the default is `TIME_ACCEPTED`.
#
#   The default sort order for the time fields is descending. The default order for `DISPLAYNAME` and `STATUS` is ascending.default: TIME_ACCEPTED
#    (default to TIME_ACCEPTED)
#   Allowed values are: OPERATION_TYPE, STATUS, TIME_ACCEPTED, TIME_STARTED, TIME_FINISHED
# @option opts [String] :sort_order Sort the results in this order, use either `ASC` (ascending) or `DESC` (descending).
#   Allowed values are: ASC, DESC
# @return [Response] A Response object with data of type Array<{OCI::Oda::Models::WorkRequestSummary WorkRequestSummary}>
# @note Click [here](https://docs.cloud.oracle.com/en-us/iaas/tools/ruby-sdk-examples/latest/oda/list_work_requests.rb.html) to see an example of how to use list_work_requests API.
Returns a page of work requests for the specified compartment.
If the `opc-next-page` header appears in the response, then
there are more items to retrieve. To get the next page in the subsequent
GET request, include the header's value as the `page` query parameter.
Returns a page of work requests for the specified compartment . If the ` opc - next - page ` header appears in the response then there are more items to retrieve . To get the next page in the subsequent GET request include the header ' s value as the ` page ` query parameter .
def list_work_requests(compartment_id, opts = {})
      logger.debug 'Calling operation OdaClient#list_work_requests.' if logger
      raise "Missing the required parameter 'compartment_id' when calling list_work_requests." if compartment_id.nil?
      if opts[:sort_by] && !%w[OPERATION_TYPE STATUS TIME_ACCEPTED TIME_STARTED TIME_FINISHED].include?(opts[:sort_by])
        raise 'Invalid value for "sort_by", must be one of OPERATION_TYPE, STATUS, TIME_ACCEPTED, TIME_STARTED, TIME_FINISHED.'
      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 = '/workRequests'
      operation_signing_strategy = :standard
      query_params = {}
      query_params[:compartmentId] = compartment_id
      query_params[:odaInstanceId] = opts[:oda_instance_id] if opts[:oda_instance_id]
      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: 'OdaClient#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: 'Array<OCI::Oda::Models::WorkRequestSummary>'
        )
      end
    end
def list_work_requests ( compartment_id , opts = { } ) logger . debug 'Calling operation OdaClient#list_work_requests.' if logger raise "Missing the required parameter 'compartment_id' when calling list_work_requests." if compartment_id . nil? if opts [ :sort_by ] && ! %w[ OPERATION_TYPE STATUS TIME_ACCEPTED TIME_STARTED TIME_FINISHED ] . include? ( opts [ :sort_by ] ) raise 'Invalid value for "sort_by", must be one of OPERATION_TYPE, STATUS, TIME_ACCEPTED, TIME_STARTED, TIME_FINISHED.' 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 = '/workRequests' operation_signing_strategy = :standard query_params = { } query_params [ :compartmentId ] = compartment_id query_params [ :odaInstanceId ] = opts [ :oda_instance_id ] if opts [ :oda_instance_id ] 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 : 'OdaClient#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 : 'Array<OCI::Oda::Models::WorkRequestSummary>' ) end end
Returns a page of work requests for the specified compartment.
Returns a page of work requests for 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::Oda::Models::WorkRequestSummary WorkRequestSummary}>
A Response object with data of type Array< { OCI :: Oda :: Models :: WorkRequestSummary WorkRequestSummary } >
Response
compartment_id
<not_specific>
opts
:sort_order Sort the results in this order, use either `ASC` (ascending) or `DESC` (descending). Allowed values are: ASC, DESC
: sort_order Sort the results in this order use either ` ASC ` ( ascending ) or ` DESC ` ( descending ) . Allowed values are : ASC DESC
<not_specific>
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 .