lib/oci/logging/logging_management_client.rb
# Lists the work requests in a compartment.
#
# @param [String] compartment_id Compartment OCID to list resources in. See compartmentIdInSubtree
#        for nested compartments traversal.
#
# @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] :status Filter results by work request status.
# @option opts [String] :id <b>Filter</b> results by [OCID](https://docs.cloud.oracle.com/iaas/Content/API/Concepts/identifiers.htm). Must be an OCID of the correct type for the resource type.
#
# @option opts [String] :opc_request_id Unique Oracle-assigned identifier for the request. If you need to contact Oracle about
#   a particular request, please provide the request ID.
#
# @option opts [String] :page For list pagination. The value of the `opc-next-page` or `opc-previous-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).
#
# @option opts [Integer] :limit The maximum number of items to return in a paginated \"List\" call.
#    (default to 100)
# @option opts [String] :sort_order The sort order to use, whether 'asc' or 'desc'.
#
#   Allowed values are: ASC, DESC
# @option opts [String] :sort_by Specifies the field to sort by. Accepts only one field. By default, when you sort by time fields, results are shown in descending order. All other fields default to ascending order.
#
#   Allowed values are: operationType, status, timeAccepted
# @return [Response] A Response object with data of type Array<{OCI::Logging::Models::WorkRequestSummary WorkRequestSummary}>
# @note Click [here](https://docs.cloud.oracle.com/en-us/iaas/tools/ruby-sdk-examples/latest/logging/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, opts = {})
      logger.debug 'Calling operation LoggingManagementClient#list_work_requests.' if logger
      raise "Missing the required parameter 'compartment_id' when calling list_work_requests." if compartment_id.nil?
      if opts[:status] && !OCI::Logging::Models::OPERATION_STATUS_ENUM.include?(opts[:status])
        raise 'Invalid value for "status", must be one of the values in OCI::Logging::Models::OPERATION_STATUS_ENUM.'
      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
      if opts[:sort_by] && !%w[operationType status timeAccepted].include?(opts[:sort_by])
        raise 'Invalid value for "sort_by", must be one of operationType, status, timeAccepted.'
      end
      path = '/workRequests'
      operation_signing_strategy = :standard
      query_params = {}
      query_params[:compartmentId] = compartment_id
      query_params[:status] = opts[:status] if opts[:status]
      query_params[:id] = opts[:id] if opts[:id]
      query_params[:page] = opts[:page] if opts[:page]
      query_params[:limit] = opts[:limit] if opts[:limit]
      query_params[:sortOrder] = opts[:sort_order] if opts[:sort_order]
      query_params[:sortBy] = opts[:sort_by] if opts[:sort_by]
      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: 'LoggingManagementClient#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::Logging::Models::WorkRequestSummary>'
        )
      end
    end
def list_work_requests ( compartment_id , opts = { } ) logger . debug 'Calling operation LoggingManagementClient#list_work_requests.' if logger raise "Missing the required parameter 'compartment_id' when calling list_work_requests." if compartment_id . nil? if opts [ :status ] && ! OCI :: Logging :: Models :: OPERATION_STATUS_ENUM . include? ( opts [ :status ] ) raise 'Invalid value for "status", must be one of the values in OCI::Logging::Models::OPERATION_STATUS_ENUM.' 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 if opts [ :sort_by ] && ! %w[ operationType status timeAccepted ] . include? ( opts [ :sort_by ] ) raise 'Invalid value for "sort_by", must be one of operationType, status, timeAccepted.' end path = '/workRequests' operation_signing_strategy = :standard query_params = { } query_params [ :compartmentId ] = compartment_id query_params [ :status ] = opts [ :status ] if opts [ :status ] query_params [ :id ] = opts [ :id ] if opts [ :id ] query_params [ :page ] = opts [ :page ] if opts [ :page ] query_params [ :limit ] = opts [ :limit ] if opts [ :limit ] query_params [ :sortOrder ] = opts [ :sort_order ] if opts [ :sort_order ] query_params [ :sortBy ] = opts [ :sort_by ] if opts [ :sort_by ] 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 : 'LoggingManagementClient#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::Logging::Models::WorkRequestSummary>' ) 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 Array<{OCI::Logging::Models::WorkRequestSummary WorkRequestSummary}>
A Response object with data of type Array< { OCI :: Logging :: Models :: WorkRequestSummary WorkRequestSummary } >
Response
compartment_id
opts
:sort_by Specifies the field to sort by. Accepts only one field. By default, when you sort by time fields, results are shown in descending order. All other fields default to ascending order. Allowed values are: operationType, status, timeAccepted
: sort_by Specifies the field to sort by . Accepts only one field . By default when you sort by time fields results are shown in descending order . All other fields default to ascending order . Allowed values are : operationType status timeAccepted
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 .