Creates a scheduled task for an OpenSearch application.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
opensearch:CreateScheduledTask |
create |
*ScheduledTask
|
None | None |
Request syntax
POST /v4/openapi/app-groups/{appGroupIdentity}/scheduled-tasks HTTP/1.1
Path Parameters
|
Parameter |
Type |
Required |
Description |
Example |
| appGroupIdentity |
string |
Yes |
The application name. |
my_app_group_name |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| body | ScheduledTask |
No |
The request body. |
Request body
| Field | Type | Required | Example | Description |
| type | String | Yes | "wipe" | The type of the scheduled task. Valid values: - wipe: data cleanup. - fork: data import with index rebuild. - reindex: index rebuild. - clear: data clearing. |
| cron | String | Yes | "10 20 * * 1,2,3,4,5" | The cron expression for the schedule. For more information, see ScheduledTask scheduling rules. |
| enabled | Boolean | Yes | true | Specifies whether to enable the scheduled task. |
| appStrategy | String | No | delete-idle | The strategy for creating a new version. Valid values: - delete-idle: If two versions already exist, delete the non-online version first, and then create a new version. - need-slot: If only one version exists, directly create a new version. |
| filter | Object | No | The data cleanup conditions. | |
| filter.days | Integer | Yes | 7 | The number of expiration days. Valid values: 7 to 180. |
| filter.unit | String | Yes | "s" | The unit of the expiration time. Valid values: - s: seconds. - ms: milliseconds. |
| filter.field | String | No | "cate_id" | The expiration field. |
| runNow | Boolean | No | false | Specifies whether to run the task immediately. Default value: false. |
| permanent | Boolean | No | true | Specifies whether to persist the task. Default value: true. |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
|||
| result |
object |
The scheduled task information. For more information, see ScheduledTask. |
{} |
| requestId |
string |
The request ID. |
ABCDEFGH |
Examples
Success response
JSON format
{
"result": {},
"requestId": "ABCDEFGH"
}
Error codes
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.