- URL:
- https://<root>/system/tasks/createTask
- Methods:
POST
- Required Capability:
- Access allowed only with the default administrator role
- Version Introduced:
- 10.9.1
Description
The create
operation creates scheduled tasks for a deployment that run automatically. Once the task has been created, it can be updated using the Update operation. In addition, scheduled tasks can be disabled, reenabled, and deleted using other operations in the ArcGIS Enterprise Administrator API. This operation supports the following tasks:
- Creating scheduled tasks to create backups of your deployment of ArcGIS Enterprise on Kubernetes
- Creating scheduled tasks to perform and generate health check reports for your organization
Request parameters
Parameter | Details |
---|---|
(Optional) | The title of the task. Example
|
(Required) | The task type. Starting at 11.4, this parameter can specify either Example
|
(Required) | A JSON object of additional parameters that will be added to the task run request. For more information on the required properties for Example
|
(Optional) | The date, defined in epoch milliseconds (Unix time), the task will begin running. Example
|
(Optional) | The date, defined in epoch milliseconds (Unix time), the task will stop running. Example
|
(Required) | A valid CRON expression ( Example
|
(Required) | A valid CRON expression ( Example
|
(Required) | A valid CRON expression ( Example
|
(Required) | A valid CRON expression ( Example
|
(Required) | A valid CRON expression ( Example
|
(Optional) | The maximum number of occurrences the task will execute. Example
|
| The response format. The default format is Values: |
Task parameters
The table below outlines the required properties for parameters
and which task type (either Create
or Create
) the properties are required for.
Property | Details |
---|---|
| The prefix of the backup or health check report name, which is appended with the date the backup or health check report was created. |
| This property only applies when a scheduled task's type is |
| This property only applies when a scheduled task's type is |
| This property only applies when a scheduled task's type is |
| This property only applies when a scheduled task's type is |
| JSON array that determines when the scheduled task starts, if it is recurring, and the retention information for the backup or health check report. The following properties are required for both
|
CRON expressions
Special characters and wildcards can be used to customize scheduled jobs. The following table lists the supported characters:
Character | Details |
---|---|
| Specifies all values. |
| No specific value for |
| A range. |
| A list of additional values. |
| Specifies increments. |
| The nth day name of the month (applies only to |
| The last day of the week or month. |
| The weekday (Monday-Friday) nearest the given day (applies only to |
| The last weekday of the month. |
The following table shows sample schedules and how they translate to CRON values for the minute
, hour
, day
, month
, and day
parameters:
Schedule | minute | hour | dayOfMonth | month | dayOfWeek |
---|---|---|---|---|---|
Hourly at 15 minutes past the hour | 15 | * | * | * | ? |
Every four hours during weekdays | 0 | */4 | ? | * | 1-5 |
Weekly on Sundays at 12:00 p.m. | 0 | 12 | ? | * | 7 |
Twice a month on the 1st and 15th at 12:00 a.m. | 0 | 0 | 1,15 | * | ? |
Last Friday of every month at 10:00 p.m. | 0 | 22 | ? | * | 6L |
Last day of the month at 10:00 p.m. | 0 | 22 | L | * | ? |
Last weekday of the month at 6:00 p.m. | 0 | 18 | LW | * | ? |
Closest weekday to the 15th of each month at midnight | 0 | 0 | 15W | * | ? |
Example usages
The following is a sample POST request for the create
operation that demonstrates scheduling a Create
task that will run weekly on Sundays at 12:00 a.m.:
POST /context/admin/system/tasks/createTask HTTP/1.1
Host: organization.domain.com
Content-Type: application/x-www-form-urlencoded
Content-Length: []
title=backups&type=CreateBackup¶meters={"name": "myBackup","passcode": "myPassword","storeName": "backups","metaData": {"recurring": false,"startTime": "04:00","retention": {"type": "day","value": 14}},"retentionOffset": 1209600000}&startDate=1589428800000&endDate=1589428800000&minute=0&hour=0&dayOfMonth=?&month=*&dayOfWeek=7&maxOccurrences=1&f=pjson&token=<token>
JSON Response examples
The sample response below is returned for a Create
task:
{
"name": "schedule1",
"passcode": "{crypt}3ngE7lQuQGDfaiab4uogjg==",
"storeName": "default",
"itemId": "",
"metaData": {
"recurring": true,
"startTime":" 20:00",
"retention": {
"type": "day",
"value": 14
}
},
"retentionOffset": 1209600000
}
The sample response below is returned for a Create
task:
{
"task": {
"generation": 0,
"active": true,
"ownerId": "0db8f0e0b5cd474e838bf45b9ad5d741",
"type": "CREATE_HEALTHCHECK_REPORT_TASK_TYPE",
"orgId": "0123456789ABCDEF",
"cronSchedule": {
"dayOfWeek": "?",
"hour": "17",
"month": "*",
"dayOfMonth": "*/1",
"minute": "32"
},
"cronExpression": "0 32 17 */1 * ?",
"runIntervalSeconds": 0,
"taskType": "CreateHealthCheckReports",
"taskTitle": "DailyReport",
"maxOccurrences": -1,
"id": "961d54be9fe14500be6c0b573d33f011",
"parameters": {
"itemId": "",
"metaData": {
"recurring": true,
"startTime": "17:32",
"retention": {
"type": "day",
"value": 14
}
},
"retentionOffset": 1209600000,
"name": "DailyReport",
"suiteIds": "BSHC-001"
},
"taskId": "961d54be9fe14500be6c0b573d33f011",
"startDate": 1731087120000
},
"status": "success"
}