work_requests
Creates, updates, deletes, gets or lists a work_requests resource.
Overview​
| Name | work_requests |
| Type | Resource |
| Id | oci.logging.work_requests |
Fields​
The following fields are returned by SELECT queries:
- get
- list
The work request details.
| Name | Datatype | Description |
|---|---|---|
id | string | The work request OCID. (example: ocid1.publicloggingworkrequest.oc1.iad.exampleuniqueID) |
compartmentId | string | The work request's compartment OCID. (example: ocid1.compartment.oc1..exampleuniqueID) |
operationType | string | The 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) |
percentComplete | number (float) | Percentage of the request completed. |
resources | array | The resources this work request affects. |
status | string | The current status of the work request. (ACCEPTED, IN_PROGRESS, FAILED, SUCCEEDED, CANCELLING, CANCELED) (example: SUCCEEDED, x-obmcs-top-level-enum: #/definitions/OperationStatus) |
timeAccepted | string (date-time) | The time the work request was accepted. (example: 2017-07-21T16:11:29Z) |
timeFinished | string (date-time) | The time the work request was finished. (example: 2017-07-21T16:11:29Z) |
timeStarted | string (date-time) | The time the work request was started. (example: 2017-07-21T16:11:29Z) |
A summary of a work request.
| Name | Datatype | Description |
|---|---|---|
id | string | The OCID of the work request. (example: ocid1.publicloggingworkrequest.oc1.iad.exampleuniqueID) |
compartmentId | string | The OCID of the work request's compartment. (example: ocid1.compartment.oc1..exampleuniqueID) |
operationType | string | The 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) |
percentComplete | number (float) | Percentage of the request completed. |
resources | array | The resources this work request affects. |
status | string | The current status of the work request. (ACCEPTED, IN_PROGRESS, FAILED, SUCCEEDED, CANCELLING, CANCELED) (example: SUCCEEDED, x-obmcs-top-level-enum: #/definitions/OperationStatus) |
timeAccepted | string (date-time) | The time the work request was accepted. (example: 2017-07-21T16:11:29Z) |
timeFinished | string (date-time) | The time the work request was finished. (example: 2017-07-21T16:11:29Z) |
timeStarted | string (date-time) | The time the work request was started. (example: 2017-07-21T16:11:29Z) |
Methods​
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | workRequestId, region | opc-request-id | Gets the details of the work request with the given ID. |
list | select | compartmentId, region | status, id, opc-request-id, page, limit, sortOrder, sortBy | Lists the work requests in a compartment.<br /> |
delete | delete | workRequestId, region | if-match, opc-request-id | Cancel 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.
| Name | Datatype | Description |
|---|---|---|
compartmentId | string | Compartment OCID to list resources in. See compartmentIdInSubtree for nested compartments traversal. |
region | string | OCI 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) |
workRequestId | string | The asynchronous request ID. |
id | string | <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-match | string | For 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. |
limit | integer | When 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-id | string | Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. |
page | string | 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](/iaas/Content/API/Concepts/usingapi.htm#nine). |
sortBy | string | 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. |
sortOrder | string | The sort order to use, whether 'asc' or 'desc'. |
status | string | Filter results by work request status. |
SELECT examples​
- get
- list
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 }}'
;
Lists the work requests in a compartment.<br />
SELECT
id,
compartmentId,
operationType,
percentComplete,
resources,
status,
timeAccepted,
timeFinished,
timeStarted
FROM oci.logging.work_requests
WHERE compartmentId = '{{ compartmentId }}' -- required
AND region = '{{ region }}' -- required
AND status = '{{ status }}'
AND id = '{{ id }}'
AND opc-request-id = '{{ opc-request-id }}'
AND page = '{{ page }}'
AND limit = '{{ limit }}'
AND sortOrder = '{{ sortOrder }}'
AND sortBy = '{{ sortBy }}'
;
DELETE examples​
- delete
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 }}'
;