Overview
Query tasks readable by callers by name, type, and display status. Supports pagination and sorting.
API details
Constraints
The SOP_TASK:READ permission is required. The results only include SOP tasks that can be read by the caller.
Request path
GET /api/v2/sop/tasks
Request parameters
Parameter |
Location |
Type |
Required |
Default Value |
Description |
|---|---|---|---|---|---|
| name | Query | String | No | - | Task name keyword, which must be included in the match. |
| displayStatus | Query | StringArray | No | - | Status set, which can be passed repeatedly or separated by commas:NOT_STARTED、WAITING_CONFIRM、RUNNING、FAILED、COMPLETED. |
| sopType | Query | StringArray | No | - | Collection of SOP types, which can be passed repeatedly or separated by commas. |
| sortBy | Query | String | No | - | START_TIME(start time of execution) orFINISH_TIME(End time of execution); if not provided, tasks are sorted in descending order by task ID. |
| sortOrder | Query | String | No | DESC |
DESCDESC,ASCAscending order. |
| page | Query | Integer | No | 1 |
The page number, starting from 1. |
| size | Query | Integer | No | 5 |
Number of items per page. Default maximum value:5000. |
| sort | Query | String | No | id,DESC |
Pageable native sorting; only applicable when not specified.sortByIt is used when... |
Response parameters
Parameter |
Type |
Description |
|
|---|---|---|---|
| successful | Boolean | Returns 0 on success.true. |
|
| data.contents | Array | The task array on the current page. | |
| data.contents[].id | Long | Task ID. | |
| data.contents[].name | String | Task name. | |
| data.contents[].sopType | String | SOP type code. | |
| data.contents[].sopTypeDisplayName | String | The display name of the SOP type in the current locale. | |
| data.contents[].creator | String | Username of the creator. | |
| data.contents[].createTime | Datetime | The time when the task was created. | |
| data.contents[].displayStatus | String | Derived Status:NOT_STARTED、WAITING_CONFIRM、RUNNING、FAILEDorCOMPLETED. |
|
| data.contents[].displayStatusName | String | The status display name in the current locale. | |
| data.contents[].targetSummary.displayText | String | Summary text for the target. | |
| data.contents[].targetSummary.kind | String | Target category. | |
| data.contents[].targetSummary.details[] | Array | Summary details, each containinglabelandvalue. |
|
| data.contents[].executionId | Long \ | null | The execution instance ID when it is started. If not started, the value isnull. |
| data.contents[].startTime | Datetime \ | null | Execution start time. For tasks that have not started, this field isnull. |
| data.contents[].finishTime | Datetime \ | null | End/Failed execution time; if not ended, it isnull. |
| data.contents[].progress.completedSteps | Integer | Number of successfully completed enablement steps; Not Started:0. |
|
| data.contents[].progress.totalSteps | Integer | Total number of steps to enable. | |
| data.contents[].progress.steps[] | Array | Displays the brief progress of the enablement steps. | |
| data.contents[].progress.steps[].stepIndex | Integer | Step number. | |
| data.contents[].progress.steps[].stepKey | String | Unique identifier of the step. | |
| data.contents[].progress.steps[].stepName | String | Step display name. | |
| data.contents[].progress.steps[].status | String | PENDING、RUNNING、SUCCESSFULorFAILED; Not startedPENDING. |
|
| data.contents[].progress.steps[].autoRun | Boolean | Automatic execution switch. | |
| data.contents[].progress.steps[].editable | Boolean | Whether to allow adjustment of the auto-execution switch. | |
| data.page.totalElements | Long | Total number of records that meet the criteria. | |
| data.page.totalPages | Integer | Total number of pages. | |
| data.page.number | Integer | Current page number, starting from 1. | |
| data.page.size | Integer | The size of the current page. | |
| timestamp | Datetime | The time taken by the server to create the response. | |
| duration | Long | The time consumed by the server for processing, in milliseconds. | |
| status | Integer | HTTP status code. In case of success, it is200. |
|
| traceId | String | Request link ID, used for log troubleshooting. |
