work_requests
Creates, updates, deletes, gets or lists a work_requests resource.
Overview​
| Name | work_requests |
| Type | Resource |
| Id | oci.object_storage.work_requests |
Fields​
The following fields are returned by SELECT queries:
- get
- list
The details of the work request.
| Name | Datatype | Description |
|---|---|---|
id | string | The id of the work request. |
compartmentId | string | The [OCID](/Content/General/Concepts/identifiers.htm) of the compartment that contains the work request. Work requests are scoped to the same compartment as the resource the work request affects. If the work request affects multiple resources and those resources are not in the same compartment, the OCID of the primary resource is used. For example, you can copy an object in a bucket in one compartment to a bucket in another compartment. In this case, the OCID of the source compartment is used. |
operationType | string | The type of work request. (COPY_OBJECT, REENCRYPT, PRIVATE_ENDPOINT_CREATE, PRIVATE_ENDPOINT_UPDATE, PRIVATE_ENDPOINT_DELETE) |
percentComplete | number (float) | Percentage of the work request completed. |
resources | array | |
status | string | The status of the specified work request. (ACCEPTED, IN_PROGRESS, FAILED, COMPLETED, CANCELING, CANCELED) |
timeAccepted | string (date-time) | The date and time the work request was created, as described in [RFC 3339](https:​//tools.ietf.org/html/rfc3339). |
timeFinished | string (date-time) | The date and time the work request was finished, as described in [RFC 3339](https:​//tools.ietf.org/html/rfc3339). |
timeStarted | string (date-time) | The date and time the work request was started, as described in [RFC 3339](https:​//tools.ietf.org/html/rfc3339). |
A summary of the status of a work request.
| Name | Datatype | Description |
|---|---|---|
id | string | The id of the work request. |
compartmentId | string | The [OCID](/Content/General/Concepts/identifiers.htm) of the compartment that contains the work request. Work requests are scoped to the same compartment as the resource the work request affects. If the work request affects multiple resources and those resources are not in the same compartment, the OCID of the primary resource is used. For example, you can copy an object in a bucket in one compartment to a bucket in another compartment. In this case, the OCID of the source compartment is used. |
operationType | string | The type of work request. (COPY_OBJECT, REENCRYPT, PRIVATE_ENDPOINT_CREATE, PRIVATE_ENDPOINT_UPDATE, PRIVATE_ENDPOINT_DELETE) |
percentComplete | number (float) | Percentage of the work request completed. |
resources | array | |
status | string | The status of a specified work request. (ACCEPTED, IN_PROGRESS, FAILED, COMPLETED, CANCELING, CANCELED) |
timeAccepted | string (date-time) | The date and time the work request was created, as described in [RFC 3339](https:​//tools.ietf.org/html/rfc3339). |
timeFinished | string (date-time) | The date and time the work request was finished, as described in [RFC 3339](https:​//tools.ietf.org/html/rfc3339). |
timeStarted | string (date-time) | The date and time the work request was started, as described in [RFC 3339](https:​//tools.ietf.org/html/rfc3339). |
Methods​
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | workRequestId, region | opc-client-request-id | Gets the status of the work request for the given ID. |
list | select | compartmentId, region | privateEndpointName, opc-client-request-id, page, limit | Lists the work requests in a compartment.<br /> |
cancel_work_request | exec | workRequestId, region | opc-client-request-id | Cancels a work request.<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 | The ID of the compartment in which to list buckets. |
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 ID of the asynchronous request. |
limit | integer | For list pagination. The maximum number of results per page, or items to return in a paginated "List" call. For important details about how pagination works, see [List Pagination](/iaas/Content/API/Concepts/usingapi.htm#nine). |
opc-client-request-id | string | The client request ID for tracing. |
page | string | For list pagination. The value of the opc-next-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). |
privateEndpointName | string | The name of the privateEndpoint for which to list work requests. |
SELECT examples​
- get
- list
Gets the status of the work request for the given ID.
SELECT
id,
compartmentId,
operationType,
percentComplete,
resources,
status,
timeAccepted,
timeFinished,
timeStarted
FROM oci.object_storage.work_requests
WHERE workRequestId = '{{ workRequestId }}' -- required
AND region = '{{ region }}' -- required
AND opc-client-request-id = '{{ opc-client-request-id }}'
;
Lists the work requests in a compartment.<br />
SELECT
id,
compartmentId,
operationType,
percentComplete,
resources,
status,
timeAccepted,
timeFinished,
timeStarted
FROM oci.object_storage.work_requests
WHERE compartmentId = '{{ compartmentId }}' -- required
AND region = '{{ region }}' -- required
AND privateEndpointName = '{{ privateEndpointName }}'
AND opc-client-request-id = '{{ opc-client-request-id }}'
AND page = '{{ page }}'
AND limit = '{{ limit }}'
;
Lifecycle Methods​
- cancel_work_request
Cancels a work request.<br />
EXEC oci.object_storage.work_requests.cancel_work_request
@workRequestId='{{ workRequestId }}' --required,
@region='{{ region }}' --required,
@opc-client-request-id='{{ opc-client-request-id }}'
;