Skip To Content
ArcGIS Developers
Dashboard

Update (Task)

Description

This operation allows you to edit and update the properties of a preexisting task. Updates that have been made to a task will go into affect during it's next scheduled execution.

Request parameters

ParameterDetails
title

The task's title.

Example

title=gpCleanerTask
type

The type of task. As of 10.9, the only task supported is the CleanGPJobs task type.

Values: CleanGPJobs

parameters

A JSON object of additional parameters that will be added to the task run request.

Example

parameters={}
itemId

The task item ID the scheduled task will be run against.

Example

itemId=d68b96a1-4c39-4914-8d97-d82842a71bed
startDate

The date, defined in Epoch milliseconds (Unix), of when the scheduled task will begin running.

Example

startDate=1589428800000
endDate

The date, defined in Epoch milliseconds (Unix), of when the scheduled tasks will stop running.

Example

endDate=1589428800000
minute

A valid CRON express (, - * /) that specifies the minute value for the task's schedule.

Example

minute=0
hour

A valid CRON express (, - * /) that specifies the hour value for the task's schedule.

Example

hour=*
dayOfMonth

A valid CRON express (, - * ? / L W C) that specifies the day of the month for the task's schedule.

Example

dayOfMonth=*
month

A valid CRON express (, - * /) that specifies the month for the task's schedule.

Example

month=*
dayOfWeek

A valid CRON express (, - * ? / L C #) that specifies the day of the week for the task's schedule.

Example

dayOfWeek=?
maxOccurences

The maximum number of occurrences this task should execute.

Example

maxOccurences=-1
f

The response format. The default format is html.

Values: html | json | pjson

Example usage

The following is a sample POST request for the update operation:

POST /context/admin/system/tasks/87b8a97828e647e8af5d634774b2b8a7/update HTTP/1.1
Host: organization.domain.com
Content-Type: application/x-www-form-urlencoded
Content-Length: []

title=gpCleanerTask&type=CleanGPJobs&parameters=&itemId=d68b96a1-4c39-4914-8d97-d82842a71bed&startDate=1589428800000&endDate=1589428800000&minute=0&hour=*&dayOfMonth=*&month=*&dayOfWeek=?&maxOccurences=30&f=pjson&token=m7zGSezM7znt6ZuIwr827imJxOTSDsjYujVdd7SiAQLYG1HmesG8EbSnTwCbiekEh0QwRdmeyp1hP63M60TPrdZQ2NzIg5G7qFaQh40MdiOCfh60-6oPKC2MNoqwdVDZ3srzreVZb66QofWXws8GMrKWkgP45A-2an5crKvReUo-pwvkzm68W87Q0yPJFA2Kww39UnMYNw-5qd2-Bt04VmkrqKI-lCbA-jFZY_UGzeGzNqnBGrjKuVB_q17HogMw

JSON Response example

{
  "generation": 5,
  "created": "Apr 21, 2021, 10:42:17 PM",
  "active": true,
  "ownerId": "c076e404cec9497488f008fc5b83e6fa",
  "type": "GP_JOBS_CLEANER_TASK_TYPE",
  "orgId": "0123456789ABCDEF",
  "cronSchedule": {
    "dayOfWeek": "?",
    "hour": "*",
    "month": "*",
    "dayOfMonth": "*",
    "minute": "0"
  },
  "cronExpression": "0 0 * * * ?",
  "itemId": "0a78247d-0d0d-4b69-a658-03104e15bd66",
  "runIntervalSeconds": 3600,
  "taskType": "CleanGPJobs",
  "taskState": "active",
  "taskTitle": "gpCleanerTask",
  "maxOccurrences": -1,
  "id": "2a1ba86743414f929c0c1f38b32f1c9c",
  "lastStart": "Apr 22, 2021, 3:00:00 AM",
  "updated": "Apr 21, 2021, 10:42:17 PM",
  "taskId": "2a1ba86743414f929c0c1f38b32f1c9c"
}