The schedules API provides functionality that allows a administrator to add, delete or update schedules
Lists all the schedules configured in the Aspire, this endpoint need the at least the ADMINISTRATOR role to be executed.
GET /aspire/_api/schedules
Pagination query string parameters
Sorting query string parameters
Lists schedules configured in the Aspire, filtered by a specified criteria, this endpoint need the at least the OPERATOR role to be executed.
POST /aspire/_api/schedules/getAll
Pagination query string parameters
Response
{ "count": { "totalItems": 1 }, "schedule": [ { "id": "258962bd-1ad0-4881-af16-ed7774857ab5", "type": "time", "description": "Test schedules", "enabled": "true", "schedule": "0 3 1/5 ? * *", "after": "pepo", "seeds": [ "81e23e44-4952-4938-8b1c-67b9101a3aad", "09db4593-ce57-4edd-9e24-1dc0d8dc4e24" ], "crawlMode": "full", "action": "start" } ] }
Status: 200
Get information about a single schedule configured in Aspire, this endpoint need the at least the ADMINISTRATOR role to be executed.
GET /aspire/_api/schedules/:id
Path Parameters
Name | Type | Required | Description |
---|---|---|---|
id | string | Required | The id of the schedule to return |
Response
{ "schedule": { "id": "258962bd-1ad0-4881-af16-ed7774857ab5", "type": "time", "description": "Test schedules", "enabled": "true", "schedule": "0 3 1/5 ? * *", "after": "pepo", "seeds": [ "81e23e44-4952-4938-8b1c-67b9101a3aad", "09db4593-ce57-4edd-9e24-1dc0d8dc4e24" ], "crawlMode": "full", "action": "start" } }
Status: 200, 404
Add schedules to Aspire, this endpoint need the at least the ADMINISTRATOR role to be executed.
POST /aspire/_api/schedules
Body Parameters
Name | Type | Required | Description |
---|---|---|---|
type | string | Required | The type of schedule to add
|
description | string | Required | Description of the schedule |
seeds | string | Optional | the seed(s) this schedule applies to (If we do not insert seeds the schedule is useful just for testing purposes) |
seedsFilter | string | Optional | The filter for finding seeds this schedules applies to. JSON format follows the format of the filter for seeds. If the above "seeds" parameter has been used than the "seedsFilter" will be ignored when the schedule starts. |
action | string | Required if seeds are used | The action to perform by the scheduled task
|
crawlMode | string | Required if seeds are used and action = start | The type of crawl to perform by the scheduled task
|
enabled | boolean | Optional | Whether this schedule is enabled or not. Defaults to false if omitted. |
Other parameters passed in the request body will depend on the type of schedule being created. Some candidates are shown below:
Name | Type | Required | Description |
---|---|---|---|
schedule | string | Required if type is "time" | the cron like schedule for a time based schedule |
scheduleTimeType | string | Required for UI if type is "time" | The type of the time based schedule
|
after | string | Required if type is "sequence" | the id of the schedule after which this schedule should run |
Example
POST /aspire/_api/schedules [{ "type": "time", "description": "Weekly seeds" "enabled": true, "scheduleTimeType": "weekly", "schedule": "0 0 0 ? * SUN *", "seeds": ["AAABcIueWUd=", "AAABcIueWUe="], "seedsFilter":"{\"filter\":\"tags\":[\"tag1\",\"tag2\"]}}", "action": "start", "crawlMode": "full" }, { "type": "sequence", "description": "Rollup" "enabled": false, "after": "0 0 0 ? * SUN *", "seeds": ["AAABcIudWUd=", "AAABcIudWUe="], "seedsFilter":"{\"filter\":\"tags\":[\"tag1\",\"tag2\"]}}", "action": "start", "crawlMode": "incremental" }]
Response
{ "schedule": [{ "id": "AAABcIueWU0", "type": "time", "description": "Weekly seeds" "enabled": true, "scheduleTimeType": "weekly", "schedule": "0 0 0 ? * SUN *", "seeds": ["AAABcIueWUd=", "AAABcIueWUe="], "seedsFilter":"{\"filter\":\"tags\":[\"tag1\",\"tag2\"]}}", "action": "start", "crawlMode": "full" }, { "id": "AAABcIueWU1", "type": "sequence", "description": "Rollup" "enabled": false, "after": "0 0 0 ? * SUN *", "seeds": ["AAABcIudWUd=", "AAABcIudWUe="], "seedsFilter":"{\"filter\":\"tags\":[\"tag1\",\"tag2\"]}}", "action": "start", "crawlMode": "incremental" }] }
See Response Body for details regarding the response body returned where multiple items are affected with some (or all) returning errors
Status: 201, 406
Update schedules in Aspire, this endpoint need the at least the ADMINISTRATOR role to be executed.
PUT /aspire/_api/schedules/:id
PUT /aspire/_api/schedules
Path Parameters
Name | Type | Required | Description |
---|---|---|---|
id | string | Required | The identifier of the schedule to update |
Body Parameters
Name | Type | Required | Description |
---|---|---|---|
id | string | Required | The identifier of the schedule to update |
(see add schedule) | x |
x - at least one field must be present
Example
PUT /aspire/_api/schedules { "AAABcIueWU0=": { "id": "AAABcIueWU0", "description": "Weekly seeds" "enabled": true, "scheduleTimeType": "weekly", "schedule": "0 0 0 ? * SUN *", "seeds": ["AAABcIueWUd=", "AAABcIueWUe="], "seedsFilter":"{\"filter\":\"tags\":[\"tag1\",\"tag2\"]}}", "action": "start", "crawlMode": "full" }, "AAABcIueWU1": { "id": "AAABcIueWU1", "description": "Rollup" "enabled": false, "schedule": "0 0 0 ? * SUN *", "seeds": ["AAABcIudWUd=", "AAABcIudWUe="], "seedsFilter":"{\"filter\":\"tags\":[\"tag1\",\"tag2\"]}}", "action": "start", "crawlMode": "incremental" } }
Response
{"schedule":[{"updated":true,"id":"AAABcID5GBc="},{"updated":true,"id":"AAABcID5GBd="}]}
Status: 200, 404, 406
Update schedules configured in the Aspire, filtered by a specified criteria, this endpoint need the at least the ADMINISTRATOR role to be executed.
PUT /aspire/_api/schedules/updateAll
Filters: The schedule filter definition here
{ "update" : { "description" : "DESCRIPTION", "schedule" : "SCHEDULE", "action" : "ACTION", "after" : "AFTER", "crawlMode" : "crawlMode", "enabled" : "ENABLED", "scheduleTimeType" : "SCHEDULE_TIME_TYPE", "seeds" : ["SEED1", "SEED2", "SEED3", ...], "seedsFilter":"{\"filter\":\"tags\":[\"tag1\",\"tag2\"]}}", "seeds.add" : ["SEED1", "SEED2", "SEED3", ...], "seeds.remove" : ["SEED1", "SEED2", "SEED3", ...], } }
Response
{ "message": "update result response message" }
Status: 200, 406
Delete multiple schedules from Aspire, filtered by a specified criteria, this endpoint need the at least the ADMINISTRATOR role to be executed.
Delete one or more schedules from Aspire, this endpoint need the at least the ADMINISTRATOR role to be executed.
DELETE /aspire/_api/schedules/:id
DELETE /aspire/_api/schedules
POST /aspire/_api/schedules/delete
Path Parameters and Query parameters
Name | Type | Required | Description |
---|---|---|---|
id | string | Required | The identifier(s) of the schedule(s) to delete |
Body Parameter
Name | Type | Required | Description |
---|---|---|---|
ids | string | Required | The identifier(s) of the schedule(s) to delete |
Examples
DELETE /aspire/_api/schedules/AAABcID5GBc DELETE /aspire/_api/schedules?id=AAABcID5GBc&id=AAABcID5GBd POST /aspire/_api/schedules/delete { "ids":["AAABcID5GBc","AAABcID5GBd"] }
Response
{ "message": "delete result response message" }
Status: 200, 404, 406
Some endpoint queries require a filter. A filter is basically a JSON object with the following format:
Schedule filter:
{ "filter" : { "ids" : ["ID1", "ID2", "ID3", ...], "type" : "TYPE", "description" : "DESCRIPTION", "seeds" : ["SEED1", "SEED2", "SEED3", ...] } }
Execute schedules, either sequence or time based, in Aspire. This endpoint needs at least an ADMINISTRATOR role to be executed.
POST /aspire/_api/schedules/execute
Body Parameters
Name | Type | Required | Description |
---|---|---|---|
id | string | Required | The id of the schedule |
Examples
Executes a single schedule
{ "id" : "AAABcIueWU1" }
Executes multiple schedules
{ "id" : ["AAABcIueWU1", "AAABcIueWU2"] }
Response
{ "AAABcIueWU1": { "status": "success" }, "AAABcIueWU2": { "status": "failed" } }
Status: 200, 404