The ScheduledTask object represents a scheduled reindexing task for an OpenSearch application.
The filter object controls which data the task clears during a wipe-type run.
Example
{
"id": "cfd5ebe9-bcdd-11ea-a58d-98039b07e4ec",
"progress": 0,
"status": 3,
"lastRanTimestamp": null,
"type": "wipe",
"running": false,
"paused": false,
"finished": false,
"idle": true,
"created": 1593747144,
"updated": 1593747144,
"cron": "0 0 * * 1,2,3,4,5,6,7",
"enabled": true,
"appId": null,
"appGroupId": "100303899",
"ownerId": "84",
"lastScheduledTimestamp": null,
"forkedAppId": "",
"appGroup": {
"id": "100303899"
},
"owner": {
"id": "84"
},
"filter": {
"field": "title",
"days": 30,
"unit": "s"
}
}Fields
| Field | Type | Description |
|---|---|---|
id | String | The ID of the scheduled reindexing task. |
progress | Integer | The progress of the scheduled reindexing task. |
status | Integer | The status of the task. Valid values: 0 (running), 1 (paused), 2 (complete), 3 (idle). See Status and boolean fields. |
lastRanTimestamp | Integer/null | The timestamp of the last run. null if the task has never run. |
type | String | The type of the scheduled task. Valid values: wipe (clears data based on filter conditions), fork (automatically reindexes by copying from a source version), check-status (checks the application status), index (manually triggered reindexing), app. |
running | Boolean | true when status is 0. |
paused | Boolean | true when status is 1. |
finished | Boolean | true when status is 2. |
idle | Boolean | true when status is 3. |
cron | String | The cron expression that defines the schedule. For syntax details, see cron field in ScheduledTask. |
enabled | Boolean | Specifies whether the scheduled task is enabled. |
appId | String | The ID of the version. |
appGroupId | String | The ID of the application. |
ownerId | String | The ID of the owner. |
lastScheduledTimestamp | Integer/null | The timestamp of the last scheduled run. null if the task has never been scheduled. |
forkedAppId | String | The ID of the source version used as the base for reindexing. Applies to fork-type tasks. |
appGroup.id | String | The ID of the application. |
owner.id | String | The ID of the owner. |
filter | Object | The conditions used to clear data. Applies to wipe-type tasks. |
filter.field | String | The field that the task clears based on the expiration settings. |
filter.days | Integer | The expiration threshold. Valid values: 7–180. Unit: days. |
filter.unit | String | The unit of the expiration time of the field. Valid values: s (seconds), ms (milliseconds). |
Status and boolean fields
The four boolean fields—running, paused, finished, and idle—mirror the integer status field. Use status for programmatic checks; the boolean fields offer convenience aliases.
status | running | paused | finished | idle |
|---|---|---|---|---|
0 | true | false | false | false |
1 | false | true | false | false |
2 | false | false | true | false |
3 | false | false | false | true |
该文章对您有帮助吗?