ScheduledTask

更新时间:
复制 MD 格式

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

FieldTypeDescription
idStringThe ID of the scheduled reindexing task.
progressIntegerThe progress of the scheduled reindexing task.
statusIntegerThe status of the task. Valid values: 0 (running), 1 (paused), 2 (complete), 3 (idle). See Status and boolean fields.
lastRanTimestampInteger/nullThe timestamp of the last run. null if the task has never run.
typeStringThe 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.
runningBooleantrue when status is 0.
pausedBooleantrue when status is 1.
finishedBooleantrue when status is 2.
idleBooleantrue when status is 3.
cronStringThe cron expression that defines the schedule. For syntax details, see cron field in ScheduledTask.
enabledBooleanSpecifies whether the scheduled task is enabled.
appIdStringThe ID of the version.
appGroupIdStringThe ID of the application.
ownerIdStringThe ID of the owner.
lastScheduledTimestampInteger/nullThe timestamp of the last scheduled run. null if the task has never been scheduled.
forkedAppIdStringThe ID of the source version used as the base for reindexing. Applies to fork-type tasks.
appGroup.idStringThe ID of the application.
owner.idStringThe ID of the owner.
filterObjectThe conditions used to clear data. Applies to wipe-type tasks.
filter.fieldStringThe field that the task clears based on the expiration settings.
filter.daysIntegerThe expiration threshold. Valid values: 7–180. Unit: days.
filter.unitStringThe 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.

statusrunningpausedfinishedidle
0truefalsefalsefalse
1falsetruefalsefalse
2falsefalsetruefalse
3falsefalsefalsetrue