Skip to main content

work_requests

Creates, updates, deletes, gets or lists a work_requests resource.

Overview​

Namework_requests
TypeResource
Idoci.logging.work_requests

Fields​

The following fields are returned by SELECT queries:

The work request details.

NameDatatypeDescription
idstringThe work request OCID. (example: ocid1.publicloggingworkrequest.oc1.iad.exampleuniqueID)
compartmentIdstringThe work request's compartment OCID. (example: ocid1.compartment.oc1..exampleuniqueID)
operationTypestringThe type of work the work request is doing. (CREATE_LOG, UPDATE_LOG, DELETE_LOG, MOVE_LOG, CREATE_LOG_GROUP, UPDATE_LOG_GROUP, DELETE_LOG_GROUP, MOVE_LOG_GROUP, CREATE_CONFIGURATION, UPDATE_CONFIGURATION, DELETE_CONFIGURATION, MOVE_CONFIGURATION) (example: LOG_CREATE, x-obmcs-top-level-enum: #/definitions/OperationTypes)
percentCompletenumber (float)Percentage of the request completed.
resourcesarrayThe resources this work request affects.
statusstringThe current status of the work request. (ACCEPTED, IN_PROGRESS, FAILED, SUCCEEDED, CANCELLING, CANCELED) (example: SUCCEEDED, x-obmcs-top-level-enum: #/definitions/OperationStatus)
timeAcceptedstring (date-time)The time the work request was accepted. (example: 2017-07-21T16:11:29Z)
timeFinishedstring (date-time)The time the work request was finished. (example: 2017-07-21T16:11:29Z)
timeStartedstring (date-time)The time the work request was started. (example: 2017-07-21T16:11:29Z)

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectworkRequestId, regionopc-request-idGets the details of the work request with the given ID.
listselectcompartmentId, regionstatus, id, opc-request-id, page, limit, sortOrder, sortByLists the work requests in a compartment.<br />
deletedeleteworkRequestId, regionif-match, opc-request-idCancel a work request that has not started yet.<br />

Parameters​

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
compartmentIdstringCompartment OCID to list resources in. See compartmentIdInSubtree for nested compartments traversal.
regionstringOCI region identifier (e.g. us-ashburn-1, ap-sydney-1); resolves from OCI_REGION when not supplied in the query. (default: us-ashburn-1, x-stackQL-envVar: OCI_REGION)
workRequestIdstringThe asynchronous request ID.
idstring<b>Filter</b> results by [OCID](/iaas/Content/API/Concepts/identifiers.htm). Must be an OCID of the correct type for the resource type.
if-matchstringFor optimistic concurrency control. In the PUT or DELETE call for a resource, set the if-match parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.
limitintegerWhen setting the page limit, specifies the maximum number of unfiltered records that can be fetched from the data store in one request. Filtering happens after the records are retrieved. Subsequent pages might include results that match the query criteria.
opc-request-idstringUnique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.
pagestringFor 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](/iaas/Content/API/Concepts/usingapi.htm#nine).
sortBystringSpecifies 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.
sortOrderstringThe sort order to use, whether 'asc' or 'desc'.
statusstringFilter results by work request status.

SELECT examples​

Gets the details of the work request with the given ID.

SELECT
id,
compartmentId,
operationType,
percentComplete,
resources,
status,
timeAccepted,
timeFinished,
timeStarted
FROM oci.logging.work_requests
WHERE workRequestId = '{{ workRequestId }}' -- required
AND region = '{{ region }}' -- required
AND opc-request-id = '{{ opc-request-id }}'
;

DELETE examples​

Cancel a work request that has not started yet.<br />

DELETE FROM oci.logging.work_requests
WHERE workRequestId = '{{ workRequestId }}' --required
AND region = '{{ region }}' --required
AND if-match = '{{ if-match }}'
AND opc-request-id = '{{ opc-request-id }}'
;