SchedulerResource Resource

Resource for managing the scheduler

GET /scheduler/jobs

List scheduler jobs

Request Parameters
name type description default constraints
active query If set to true, only active jobs will be returned. If set to false, only inactive jobs will be returned. If not set (default), all jobs will be returned.   boolean
failed query If set to true, only failed jobs will be returned. If set to false, only successful jobs will be returned (include jobs that were not yet executed). If not set (default), all jobs will be returned.   boolean
page query Returned page, if paging is used. Paging starts with 1 1 int
pageSize query Page size for paging. If this is set to -1 no paging is used (all matching items are returned). Setting this to 0 will return no items. -1 int
q query Query string for filtering    
sort query Comma separated list of sorted attributes. Each attribute name may be prefixed with + for sorting in ascending order or - for sorting in descending order name  
Response Codes
code condition
200 Jobs are returned.
401 No valid sid and session secret cookie were provided.
403 User has insufficient permissions on the scheduler.
Response Body
media type data type description
application/json JobsResponse (JSON) list of jobs

Example

Request
GET /scheduler/jobs
Content-Type: */*
Accept: application/json

                
...
                
              
Response
HTTP/1.1 200 OK
Content-Type: application/json

                
{
  "items" : [ { }, { } ],
  "hasMoreItems" : true,
  "numItems" : 12345,
  "perms" : {
    "property1" : [ "read", "updateform" ],
    "property2" : [ "edit", "formreport" ]
  },
  "stagingStatus" : {
    "property1" : {
      "packageName" : "...",
      "included" : true
    },
    "property2" : {
      "packageName" : "...",
      "included" : true
    }
  },
  "messages" : [ { }, { } ],
  "responseInfo" : {
    "responseCode" : "OK",
    "responseMessage" : "...",
    "property" : "..."
  }
}
                
              

PUT /scheduler/resume

Resume the scheduler

Response Codes
code condition
200 Scheduler is resumed.
405 Feature suspend_scheduler is not activated.
401 No valid sid and session secret cookie were provided.
403 User has insufficient permissions on the scheduler.
Response Body
media type data type description
application/json SchedulerStatusResponse (JSON) status

Example

Request
PUT /scheduler/resume
Content-Type: */*
Accept: application/json

                
...
                
              
Response
HTTP/1.1 200 OK
Content-Type: application/json

                
{
  "status" : "running",
  "executorStatus" : "RUNNING",
  "allowRun" : [ 12345, 12345 ],
  "messages" : [ { }, { } ],
  "responseInfo" : {
    "responseCode" : "OK",
    "responseMessage" : "...",
    "property" : "..."
  }
}
                
              

GET /scheduler/schedule

List scheduler schedules.
The result can be filtered by

  • id
  • name
  • description
  • taskId
and sorted by
  • id
  • name
  • description
  • taskId
  • cdate
  • edate

Request Parameters
name type description default constraints
page query Returned page, if paging is used. Paging starts with 1 1 int
pageSize query Page size for paging. If this is set to -1 no paging is used (all matching items are returned). Setting this to 0 will return no items. -1 int
perms query Flag to add permission information for the returned items. false boolean
q query Query string for filtering    
sort query Comma separated list of sorted attributes. Each attribute name may be prefixed with + for sorting in ascending order or - for sorting in descending order name  
Response Codes
code condition
401 No valid sid and session secret cookie were provided.
403 User has insufficient permissions on the scheduler.
200 The list of schedules is returned.
Response Body
media type data type description
application/json ScheduleListResponse (JSON) response containing a list of schedules

Example

Request
GET /scheduler/schedule
Content-Type: */*
Accept: application/json

                
...
                
              
Response
HTTP/1.1 200 OK
Content-Type: application/json

                
{
  "items" : [ { }, { } ],
  "hasMoreItems" : true,
  "numItems" : 12345,
  "perms" : {
    "property1" : [ "setperm", "publishpages" ],
    "property2" : [ "publish", "view" ]
  },
  "stagingStatus" : {
    "property1" : {
      "packageName" : "...",
      "included" : true
    },
    "property2" : {
      "packageName" : "...",
      "included" : true
    }
  },
  "messages" : [ { }, { } ],
  "responseInfo" : {
    "responseCode" : "OK",
    "responseMessage" : "...",
    "property" : "..."
  }
}
                
              

POST /scheduler/schedule

Create a new Schedule

Request Body
media type data type description
application/json ScheduleModel (JSON) schedule
Response Codes
code condition
401 No valid sid and session secret cookie were provided.
403 User has insufficient permissions on the scheduler.
201 The schedule was created
Response Body
media type data type description
application/json ScheduleResponse (JSON) response containing the created schedule

Example

Request
POST /scheduler/schedule
Content-Type: application/json
Accept: application/json

                
{
  "id" : 12345,
  "name" : "...",
  "description" : "...",
  "taskId" : 12345,
  "scheduleData" : {
    "type" : "followup",
    "startTimestamp" : 12345,
    "endTimestamp" : 12345,
    "interval" : {
      "value" : 12345,
      "unit" : "week"
    },
    "follow" : {
      "scheduleId" : [ 12345, 12345 ],
      "onlyAfterSuccess" : true
    }
  },
  "parallel" : true,
  "active" : true,
  "status" : "DUE",
  "notificationEmail" : [ "...", "..." ],
  "runs" : 12345,
  "averageTime" : 12345,
  "lastExecution" : {
    "id" : 12345,
    "scheduleId" : 12345,
    "startTime" : 12345,
    "endTime" : 12345,
    "duration" : 12345,
    "result" : true,
    "log" : "...",
    "running" : true
  },
  "creator" : {
    "id" : 12345,
    "firstName" : "...",
    "lastName" : "...",
    "description" : "...",
    "email" : "...",
    "groups" : [ {
      "id" : 12345,
      "name" : "...",
      "description" : "...",
      "children" : [ { }, { } ]
    }, {
      "id" : 12345,
      "name" : "...",
      "description" : "...",
      "children" : [ { }, { } ]
    } ],
    "login" : "...",
    "password" : "..."
  },
  "cdate" : 12345,
  "editor" : {
    "id" : 12345,
    "firstName" : "...",
    "lastName" : "...",
    "description" : "...",
    "email" : "...",
    "groups" : [ {
      "id" : 12345,
      "name" : "...",
      "description" : "...",
      "children" : [ { }, { } ]
    }, {
      "id" : 12345,
      "name" : "...",
      "description" : "...",
      "children" : [ { }, { } ]
    } ],
    "login" : "...",
    "password" : "..."
  },
  "edate" : 12345
}
                
              
Response
HTTP/1.1 201 Created
Content-Type: application/json

                
{
  "item" : { },
  "messages" : [ { }, { } ],
  "responseInfo" : {
    "responseCode" : "OK",
    "responseMessage" : "...",
    "property" : "..."
  }
}
                
              

GET /scheduler/status

Get the scheduler status and optionally restart the scheduler executor if it is not running.

Request Parameters
name type description constraints
fixExecutor query Whether to restart the scheduler executor if it is not running currently. required boolean
Response Codes
code condition
200 Scheduler status is returned.
401 No valid sid and session secret cookie were provided.
403 User has insufficient permissions on the scheduler.
Response Body
media type data type description
application/json SchedulerStatusResponse (JSON) status

Example

Request
GET /scheduler/status
Content-Type: */*
Accept: application/json

                
...
                
              
Response
HTTP/1.1 200 OK
Content-Type: application/json

                
{
  "status" : "suspended",
  "executorStatus" : "RUNNING",
  "allowRun" : [ 12345, 12345 ],
  "messages" : [ { }, { } ],
  "responseInfo" : {
    "responseCode" : "OK",
    "responseMessage" : "...",
    "property" : "..."
  }
}
                
              

PUT /scheduler/suspend

Suspend the scheduler

Request Body
media type data type description
application/json SuspendRequest (JSON) suspend request
Response Codes
code condition
200 Scheduler is suspended.
405 Feature suspend_scheduler is not activated.
401 No valid sid and session secret cookie were provided.
403 User has insufficient permissions on the scheduler.
Response Body
media type data type description
application/json SchedulerStatusResponse (JSON) status

Example

Request
PUT /scheduler/suspend
Content-Type: application/json
Accept: application/json

                
{
  "allowRun" : [ 12345, 12345 ]
}
                
              
Response
HTTP/1.1 200 OK
Content-Type: application/json

                
{
  "status" : "suspended",
  "executorStatus" : "NOT_RUNNING",
  "allowRun" : [ 12345, 12345 ],
  "messages" : [ { }, { } ],
  "responseInfo" : {
    "responseCode" : "OK",
    "responseMessage" : "...",
    "property" : "..."
  }
}
                
              

GET /scheduler/task

List scheduler tasks.
The result can be filtered by

  • id
  • name
  • description
  • command
and sorted by
  • id
  • name
  • description
  • command
  • cdate
  • edate

Request Parameters
name type description default constraints
page query Returned page, if paging is used. Paging starts with 1 1 int
pageSize query Page size for paging. If this is set to -1 no paging is used (all matching items are returned). Setting this to 0 will return no items. -1 int
perms query Flag to add permission information for the returned items. false boolean
q query Query string for filtering    
sort query Comma separated list of sorted attributes. Each attribute name may be prefixed with + for sorting in ascending order or - for sorting in descending order name  
Response Codes
code condition
401 No valid sid and session secret cookie were provided.
403 User has insufficient permissions on the scheduler.
200 The list of tasks is returned.
Response Body
media type data type description
application/json TaskListResponse (JSON) response containing a list of tasks

Example

Request
GET /scheduler/task
Content-Type: */*
Accept: application/json

                
...
                
              
Response
HTTP/1.1 200 OK
Content-Type: application/json

                
{
  "items" : [ { }, { } ],
  "hasMoreItems" : true,
  "numItems" : 12345,
  "perms" : {
    "property1" : [ "delete", "deleteform" ],
    "property2" : [ "updateitems", "inheritance" ]
  },
  "stagingStatus" : {
    "property1" : {
      "packageName" : "...",
      "included" : true
    },
    "property2" : {
      "packageName" : "...",
      "included" : true
    }
  },
  "messages" : [ { }, { } ],
  "responseInfo" : {
    "responseCode" : "OK",
    "responseMessage" : "...",
    "property" : "..."
  }
}
                
              

POST /scheduler/task

Create a new task

Request Body
media type data type description
application/json TaskModel (JSON) task
Response Codes
code condition
401 No valid sid and session secret cookie were provided.
403 User has insufficient permissions on the scheduler.
201 The task was created
Response Body
media type data type description
application/json TaskResponse (JSON) response containing the created task

Example

Request
POST /scheduler/task
Content-Type: application/json
Accept: application/json

                
{
  "id" : 12345,
  "name" : "...",
  "description" : "...",
  "command" : "...",
  "internal" : true,
  "creator" : {
    "id" : 12345,
    "firstName" : "...",
    "lastName" : "...",
    "description" : "...",
    "email" : "...",
    "groups" : [ {
      "id" : 12345,
      "name" : "...",
      "description" : "...",
      "children" : [ { }, { } ]
    }, {
      "id" : 12345,
      "name" : "...",
      "description" : "...",
      "children" : [ { }, { } ]
    } ],
    "login" : "...",
    "password" : "..."
  },
  "cdate" : 12345,
  "editor" : {
    "id" : 12345,
    "firstName" : "...",
    "lastName" : "...",
    "description" : "...",
    "email" : "...",
    "groups" : [ {
      "id" : 12345,
      "name" : "...",
      "description" : "...",
      "children" : [ { }, { } ]
    }, {
      "id" : 12345,
      "name" : "...",
      "description" : "...",
      "children" : [ { }, { } ]
    } ],
    "login" : "...",
    "password" : "..."
  },
  "edate" : 12345
}
                
              
Response
HTTP/1.1 201 Created
Content-Type: application/json

                
{
  "item" : { },
  "messages" : [ { }, { } ],
  "responseInfo" : {
    "responseCode" : "OK",
    "responseMessage" : "...",
    "property" : "..."
  }
}
                
              

GET /scheduler/execution/{id}

Load an execution

Request Parameters
name type description
id path execution ID
Response Codes
code condition
401 No valid sid and session secret cookie were provided.
403 User has insufficient permissions on the scheduler.
200 The schedule is returned
404 The schedule with given ID does not exist
Response Body
media type data type description
application/json ExecutionResponse (JSON) response containing the execution

Example

Request
GET /scheduler/execution/{id}
Content-Type: */*
Accept: application/json

                
...
                
              
Response
HTTP/1.1 200 OK
Content-Type: application/json

                
{
  "item" : { },
  "messages" : [ { }, { } ],
  "responseInfo" : {
    "responseCode" : "OK",
    "responseMessage" : "...",
    "property" : "..."
  }
}
                
              

DELETE /scheduler/schedule/{id}

Delete a schedule

Request Parameters
name type description
id path schedule ID
Response Codes
code condition
401 No valid sid and session secret cookie were provided.
403 User has insufficient permissions on the scheduler.
200 The schedule was deleted
404 The schedule with given ID does not exist
Response Body
media type data type description
application/json GenericResponse (JSON) response

Example

Request
DELETE /scheduler/schedule/{id}
Content-Type: */*
Accept: application/json

                
...
                
              
Response
HTTP/1.1 200 OK
Content-Type: application/json

                
{
  "messages" : [ { }, { } ],
  "responseInfo" : {
    "responseCode" : "OK",
    "responseMessage" : "...",
    "property" : "..."
  }
}
                
              

GET /scheduler/schedule/{id}

Load a schedule

Request Parameters
name type description
id path schedule ID
Response Codes
code condition
401 No valid sid and session secret cookie were provided.
403 User has insufficient permissions on the scheduler.
200 The schedule is returned
404 The schedule with given ID does not exist
Response Body
media type data type description
application/json ScheduleResponse (JSON) response containing the schedule

Example

Request
GET /scheduler/schedule/{id}
Content-Type: */*
Accept: application/json

                
...
                
              
Response
HTTP/1.1 200 OK
Content-Type: application/json

                
{
  "item" : { },
  "messages" : [ { }, { } ],
  "responseInfo" : {
    "responseCode" : "OK",
    "responseMessage" : "...",
    "property" : "..."
  }
}
                
              

PUT /scheduler/schedule/{id}

Update a schedule

Request Parameters
name type description
id path schedule ID
Request Body
media type data type description
application/json ScheduleModel (JSON) schedule to update
Response Codes
code condition
401 No valid sid and session secret cookie were provided.
403 User has insufficient permissions on the scheduler.
200 The schedule was updated
404 The schedule with given ID does not exist
Response Body
media type data type description
application/json ScheduleResponse (JSON) updated task

Example

Request
PUT /scheduler/schedule/{id}
Content-Type: application/json
Accept: application/json

                
{
  "id" : 12345,
  "name" : "...",
  "description" : "...",
  "taskId" : 12345,
  "scheduleData" : {
    "type" : "interval",
    "startTimestamp" : 12345,
    "endTimestamp" : 12345,
    "interval" : {
      "value" : 12345,
      "unit" : "minute"
    },
    "follow" : {
      "scheduleId" : [ 12345, 12345 ],
      "onlyAfterSuccess" : true
    }
  },
  "parallel" : true,
  "active" : true,
  "status" : "RUNNING",
  "notificationEmail" : [ "...", "..." ],
  "runs" : 12345,
  "averageTime" : 12345,
  "lastExecution" : {
    "id" : 12345,
    "scheduleId" : 12345,
    "startTime" : 12345,
    "endTime" : 12345,
    "duration" : 12345,
    "result" : true,
    "log" : "...",
    "running" : true
  },
  "creator" : {
    "id" : 12345,
    "firstName" : "...",
    "lastName" : "...",
    "description" : "...",
    "email" : "...",
    "groups" : [ {
      "id" : 12345,
      "name" : "...",
      "description" : "...",
      "children" : [ { }, { } ]
    }, {
      "id" : 12345,
      "name" : "...",
      "description" : "...",
      "children" : [ { }, { } ]
    } ],
    "login" : "...",
    "password" : "..."
  },
  "cdate" : 12345,
  "editor" : {
    "id" : 12345,
    "firstName" : "...",
    "lastName" : "...",
    "description" : "...",
    "email" : "...",
    "groups" : [ {
      "id" : 12345,
      "name" : "...",
      "description" : "...",
      "children" : [ { }, { } ]
    }, {
      "id" : 12345,
      "name" : "...",
      "description" : "...",
      "children" : [ { }, { } ]
    } ],
    "login" : "...",
    "password" : "..."
  },
  "edate" : 12345
}
                
              
Response
HTTP/1.1 200 OK
Content-Type: application/json

                
{
  "item" : { },
  "messages" : [ { }, { } ],
  "responseInfo" : {
    "responseCode" : "OK",
    "responseMessage" : "...",
    "property" : "..."
  }
}
                
              

DELETE /scheduler/task/{id}

Delete a task

Request Parameters
name type description
id path task ID
Response Codes
code condition
401 No valid sid and session secret cookie were provided.
403 User has insufficient permissions on the scheduler.
200 The task was deleted
404 The task with given ID does not exist
Response Body
media type data type description
application/json GenericResponse (JSON) response

Example

Request
DELETE /scheduler/task/{id}
Content-Type: */*
Accept: application/json

                
...
                
              
Response
HTTP/1.1 200 OK
Content-Type: application/json

                
{
  "messages" : [ { }, { } ],
  "responseInfo" : {
    "responseCode" : "OK",
    "responseMessage" : "...",
    "property" : "..."
  }
}
                
              

GET /scheduler/task/{id}

Load a task

Request Parameters
name type description
id path task ID
Response Codes
code condition
401 No valid sid and session secret cookie were provided.
403 User has insufficient permissions on the scheduler.
200 The task is returned
404 The task with given ID does not exist
Response Body
media type data type description
application/json TaskResponse (JSON) response containing the task

Example

Request
GET /scheduler/task/{id}
Content-Type: */*
Accept: application/json

                
...
                
              
Response
HTTP/1.1 200 OK
Content-Type: application/json

                
{
  "item" : { },
  "messages" : [ { }, { } ],
  "responseInfo" : {
    "responseCode" : "OK",
    "responseMessage" : "...",
    "property" : "..."
  }
}
                
              

PUT /scheduler/task/{id}

Update a task

Request Parameters
name type description
id path task ID
Request Body
media type data type description
application/json TaskModel (JSON) task data to update
Response Codes
code condition
401 No valid sid and session secret cookie were provided.
403 User has insufficient permissions on the scheduler.
200 The task was updated
404 The task with given ID does not exist
Response Body
media type data type description
application/json TaskResponse (JSON) updated task

Example

Request
PUT /scheduler/task/{id}
Content-Type: application/json
Accept: application/json

                
{
  "id" : 12345,
  "name" : "...",
  "description" : "...",
  "command" : "...",
  "internal" : true,
  "creator" : {
    "id" : 12345,
    "firstName" : "...",
    "lastName" : "...",
    "description" : "...",
    "email" : "...",
    "groups" : [ {
      "id" : 12345,
      "name" : "...",
      "description" : "...",
      "children" : [ { }, { } ]
    }, {
      "id" : 12345,
      "name" : "...",
      "description" : "...",
      "children" : [ { }, { } ]
    } ],
    "login" : "...",
    "password" : "..."
  },
  "cdate" : 12345,
  "editor" : {
    "id" : 12345,
    "firstName" : "...",
    "lastName" : "...",
    "description" : "...",
    "email" : "...",
    "groups" : [ {
      "id" : 12345,
      "name" : "...",
      "description" : "...",
      "children" : [ { }, { } ]
    }, {
      "id" : 12345,
      "name" : "...",
      "description" : "...",
      "children" : [ { }, { } ]
    } ],
    "login" : "...",
    "password" : "..."
  },
  "edate" : 12345
}
                
              
Response
HTTP/1.1 200 OK
Content-Type: application/json

                
{
  "item" : { },
  "messages" : [ { }, { } ],
  "responseInfo" : {
    "responseCode" : "OK",
    "responseMessage" : "...",
    "property" : "..."
  }
}
                
              

POST /scheduler/schedule/{id}/execute

Execute the specified schedule now.

There is no check if the schedule schould be executed, besides a check if it is active.

Request Parameters
name type description
id path The schedule to execute
Response Codes
code condition
401 No valid sid and session secret cookie were provided.
403 User has insufficient permissions on the scheduler.
200 Execution of the schedule was startet
404 The schedule with given ID does not exist
Response Body
media type data type description
application/json GenericResponse (JSON) response

Example

Request
POST /scheduler/schedule/{id}/execute
Content-Type: */*
Accept: application/json

                
...
                
              
Response
HTTP/1.1 200 OK
Content-Type: application/json

                
{
  "messages" : [ { }, { } ],
  "responseInfo" : {
    "responseCode" : "OK",
    "responseMessage" : "...",
    "property" : "..."
  }
}
                
              

GET /scheduler/schedule/{id}/execution

List all executions of the given schedule which match the filters.
The result can be filtered by

  • id
  • scheduleId
  • log
and sorted by
  • id
  • startTime
  • endTime
  • duration
  • result

Request Parameters
name type description default constraints
id path schedule ID    
failed query Filter for result status.

If set to true, only failed executions will be returned. If set to false, only successful executions will be returned (include executions that were not yet executed). If not set (default), all jobs will be returned.

  boolean
page query Returned page, if paging is used. Paging starts with 1 1 int
pageSize query Page size for paging. If this is set to -1 no paging is used (all matching items are returned). Setting this to 0 will return no items. -1 int
q query Query string for filtering    
sort query Comma separated list of sorted attributes. Each attribute name may be prefixed with + for sorting in ascending order or - for sorting in descending order name  
ts_max query Filter for maximum starting time.

Only executions which have been started before the given timestamp will be returned.

Note that if #timestampMax is less than #timestampMin it will be ignored.

  int
ts_min query Filter for minimum starting time.

Only executions which have been started after the given timestamp will be returned.

  int
Response Codes
code condition
401 No valid sid and session secret cookie were provided.
403 User has insufficient permissions on the scheduler.
200 The list of executions is returned.
Response Body
media type data type description
application/json ExecutionListResponse (JSON) Response containing the list of executions

Example

Request
GET /scheduler/schedule/{id}/execution
Content-Type: */*
Accept: application/json

                
...
                
              
Response
HTTP/1.1 200 OK
Content-Type: application/json

                
{
  "items" : [ { }, { } ],
  "hasMoreItems" : true,
  "numItems" : 12345,
  "perms" : {
    "property1" : [ "updateitems", "linkoverview" ],
    "property2" : [ "deletetemplates", "edit" ]
  },
  "stagingStatus" : {
    "property1" : {
      "packageName" : "...",
      "included" : true
    },
    "property2" : {
      "packageName" : "...",
      "included" : true
    }
  },
  "messages" : [ { }, { } ],
  "responseInfo" : {
    "responseCode" : "OK",
    "responseMessage" : "...",
    "property" : "..."
  }
}