Structure of an Operation
An operation is described by the fields shown in the following table:| Attributes | Type | Description |
|---|---|---|
op_id | Number | Unique identifier of the operation |
method | String | Type of operation: add, upd, del, or multiple |
resource | String | Resource being operated on (e.g., images) |
num_total | Number | Total number of items in the operation |
num_good | Number | Number of items successfully processed |
num_bad | Number | Number of items that failed to process |
is_started | Boolean | Whether the operation has started execution |
all_good | Boolean | Whether all items were successfully processed |
do_wait | Boolean | Whether the operation was executed in synchronous mode |
do_urgent | Boolean | Whether the operation was prioritized in the queue |
do_strict | Boolean | Whether strict mode was enabled for the operation |
idle_ms | Number | Time in milliseconds the operation waited before starting |
exec_ms | Number | Time in milliseconds the operation took to execute |
created_at | String | Timestamp when the operation was created |
started_at | String | Timestamp when the operation started execution |
finished_at | String | Timestamp when the operation finished |
errors | Array | List of errors that occurred during processing |
- Retrieve all tasks for a given tenant
- Fetch detailed information about a specific task
- Cancel a scheduled task
Operations Endpoints
Check Operation Status (GET /ops/{op_id})
Given a GET /ops/{op_id} request with the header API-Key: <api-key>, you can retrieve the status of a specific operation for a particular tenant.
Request Example
Response
The response will be a JSON object containing the operation details, including the fields described in the table without theop_id field, which is the one you queried. The errors field will contain any errors that occurred during the operation, if applicable.
Receive operation status (Response code: 200)
Here you can see an example of response JSON object:See all operations (GET /ops)
This endpoint is the simplest, since you only need to send the access API key to the Wesog server; using that, the system can identify the tenant making the request and return all operations they’ve performed.
When requesting all operations, no additional parameters beyond the API key in the request header are required, and the server responds with a JSON-formatted list of Operation objects, containing the various parameters shown in the table at the beginning of this section.
Request Example
Abort current running operation (DELETE /ops/{op_id})
Once a task is started, even if it was indicated to run asynchronously, it may be necessary to abort it. To do this, a DELETE /ops/{op_id} call can be made, sending the header API-Key: <api-key>, and the Wesog server will cancel the operation if it has not yet finished.