The schedules API provides functionality that allows a an administrator to add, delete or update schedules
Easy Heading Free | ||||
---|---|---|---|---|
| ||||
Section | |||||||
---|---|---|---|---|---|---|---|
Get all schedulesLists all the schedules configured in the Aspire, this endpoint needs at least the ADMINISTRATOR role to be executed.
Query String Parameters | |||||||
Name | Type | Required | Description | ||||
from | integer | Optional | Indicates the initial page to be retrieved | ||||
size | integer | Optional | Specifies the size of results page | ||||
sortBy | string | Optional | Field by which results are sorted | ||||
sortMode | string | Optional | Sort mode
| ||||
expand | string | Optional | List of fields to expand, * will expand everything |
Section | |||||||
---|---|---|---|---|---|---|---|
Get all schedules, filteredLists schedules configured in Aspire, filtered by the specified criteria, this endpoint needs at least the OPERATOR role to be executed.
Pagination query string parameters |
Response
Code Block | ||||
---|---|---|---|---|
| ||||
{
"count": |
Response
Code Block | ||
---|---|---|
| ||
{ "schedule": [{ "idtotalItems": "AAABcID5GBc=",1 "type": "time"}, "descriptionschedule": "Weekend[ after office", "running": false, { "enabled": true, "seedid": ["AAABcIueWUd="258962bd-1ad0-4881-af16-ed7774857ab5", "AAABcIueWUe="], "properties": { "actiontype": "starttime", "crawlTypedescription": "incrementalTest schedules", "scheduleTypeenabled": "customtrue", "schedule": "* *0 3 1/5 ? * * 1", "last "after": 123456789"pepo", "next "seeds": 123456789[ }, { "id": "AAABcID5GBc=81e23e44-4952-4938-8b1c-67b9101a3aad", "type": "sequence", "description": "Sequential schedule", 09db4593-ce57-4edd-9e24-1dc0d8dc4e24" "running": false], "enabled": true, "seedcrawlMode": ["AAABcIueWUd=", "AAABcIueWUe=full"], "properties": { "action": "start", "crawlType": "incremental",} ] } "afterSchedule": "AAABcID5GBc=", "last": 123456789 } }, ... ], "from": 100, "size": 10, "sortBy": "id", "sortMode": "asc", "totalItems": 10000, "message": "optional response message" } |
Status
Status: 200
Section | ||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Get a single schedule informationThis endpoint needs at least the ADMINISTRATOR role to be executed.
Path Parameters
Response
Status: 200, 404 |
Section | ||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Add schedule(s) to AspireThis endpoint needs at least the ADMINISTRATOR role to be executed.
Get all schedules, filteredLists schedules configured in the Aspire, filtered by a specified criteria
Query String ParametersBody Parameters
Optional | Indicates the initial page to be retrieved | size | integer | Optional | Specifies the size of results page | sortBy | string | Optional | Field by which results are sorted | sortMode | string | Optional | Sort mode
expand | string | Optional | List of fields to expand, * will expand everything | Body Parameters | |||||||||||||||
Name | Type | Required | Description | |||||||||||||||||||||||||||||
filter | JSON | Required | Filters retrieved schedules. Check the filter definition here |
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, then 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:
|
completeThreshold | number | Optional | Percentage of seeds to complete their crawl before continuing with the next schedule in the sequence. The value is a number up to 1. E.g. 0.69 means 69 %. Default is 1. |
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 |
stopOnFail | boolean | Required if type is "sequence" | Whether this schedule sequence will stop if the previous schedule crawl fails is enabled or not. Defaults to false if omitted. |
Example
Code Block | ||||
---|---|---|---|---|
| ||||
POST /aspire/_api/schedules
[{
"type": "time",
"description": "Weekly seeds"
"enabled": true,
"stopOnFail": true,
"scheduleTimeType": "weekly",
"schedule": "0 0 0 ? * SUN *",
"completeThreshold": 0.65,
"seeds": ["AAABcIueWUd=", "AAABcIueWUe="],
"seedsFilter":{"tags":["tag1","tag2"]},
"action": "start",
"crawlMode": "full"
},
{
"type": "sequence",
"description": "Rollup"
"enabled": false,
"stopOnFail": true,
"after": "0 0 0 ? * SUN * |
Response
Code Block | ||
---|---|---|
| ||
{ "schedule": [{ "id": "AAABcID5GBc=", "type": "time", "description": "Weekend after office", "running": false, "enabled": true, "seed": ["AAABcIueWUd=", "AAABcIueWUe="], "properties": { "action": "start", "crawlType": "incremental", "scheduleType": "custom", "schedule": "* * * * 1", "last": 123456789, "next": 123456789 } }, { "id": "AAABcID5GBc=", "type": "sequence", "description": "Sequential schedule", "running": false, "enabled": true, "seed": ["AAABcIueWUd=", "AAABcIueWUe="], "properties": { "action": "start", "crawlType": "incremental", "completeThreshold": 0.65, "afterScheduleseeds": ["AAABcID5GBcAAABcIudWUd=", "AAABcIudWUe="], "last": 123456789 } "seedsFilter":{"tags":["tag1","tag2"]}, ... ]"action": "start", "fromcrawlMode": 100,"incremental" }] |
Response
Code Block | ||||
---|---|---|---|---|
| ||||
{ "sizeschedule": 10,[{ "sortByid": "idAAABcIueWU0", "sortModetype": "asctime", "totalItemsdescription": 10000,"Weekly seeds" "enabled": true, "stopOnFail": true, "messagescheduleTimeType": "optional response message" } |
Status
Get information about a single schedule configured in Aspire
Panel | ||||
---|---|---|---|---|
| ||||
|
Query String Parameters
Response
Code Block | ||
---|---|---|
| ||
{ "schedule": { "id": "AAABcID5GBc=", "type": "time","weekly", "schedule": "0 0 0 ? * SUN *", "completeThreshold": 0.65, "seeds": ["AAABcIueWUd=", "AAABcIueWUe="], "descriptionseedsFilter": "Weekend after office", "running": false{"tags":["tag1","tag2"]}, "enabledaction": true"start", "seedcrawlMode": ["AAABcIueWUd=", "AAABcIueWUe="]full" }, "properties": { "actionid": "startAAABcIueWU1", "crawlTypetype": "incrementalsequence", "scheduleTypedescription": "customRollup", "scheduleenabled": "*false, * * * 1"stopOnFail": true, "lastafter": 123456789 "0 0 0 ? * SUN *", "nextcompleteThreshold": 1234567890.65, }, "messageseeds": ["optional response message" } |
Status
AAABcIudWUd=", "AAABcIudWUe="],
"seedsFilter":{"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
Section | ||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Update schedule(s)Update schedules in Aspire. This endpoint needs at least the ADMINISTRATOR role to be executed. | ||||||||||||||||||||||||||||||||||||||
Section | ||||||||||||||||||||||||||||||||||||||
Add schedulesAdd schedules to Aspire
Body Parameters
Path Parameters
Body Parameters
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 | |||||||||||||||||||||||||||||||||||
enabled | boolean | Optional | Whether this schedule is enabled or not | |||||||||||||||||||||||||||||||||||
scheduleType | string | Optional | The type of the time based schedule
| |||||||||||||||||||||||||||||||||||
schedule | string | Optional | the cron like schedule for a time based schedule | |||||||||||||||||||||||||||||||||||
after | string | Optional | the id of the schedule after which this schedule should run (for a sequence based schedule) | |||||||||||||||||||||||||||||||||||
seed | string | Optional | the seed(s) this schedule applies to |
to update | |||
(see add schedule) | x |
x - at least one field must be present
Example
Code Block | ||||
---|---|---|---|---|
| ||||
PUT /aspire/_api/schedules
{
"AAABcIueWU0=": {
"id": "AAABcIueWU0",
"description": "Weekly seeds"
"enabled": true,
"stopOnFail": true,
"scheduleTimeType": "weekly",
"schedule": "0 0 0 ? * SUN *",
"seeds": ["AAABcIueWUd=", "AAABcIueWUe="],
"seedsFilter":{"tags":["tag1","tag2"]},
"action": "start",
"crawlMode": "full"
},
"AAABcIueWU1": {
"id": "AAABcIueWU1",
"description": "Rollup"
"enabled": false,
"stopOnFail": true,
"schedule": "0 0 0 ? * SUN *",
"seeds |
Example
Code Block | ||
---|---|---|
| ||
POST /aspire/_api/schedules [{ "type": "time", "description": "Weekly seeds" "enabled": true, "scheduleType": "weekly", "schedule": "* * * * 1", "seed": ["AAABcIueWUd=", "AAABcIueWUe="], "action": "start", "crawlType": "full" }, { "type": "sequence", "description": "Rollup" "enabled": false, "after": "* * * * 1", "seed": ["AAABcIudWUd=", "AAABcIudWUe="], "actionseedsFilter":{"tags":["tag1","tag2"]}, "action": "start", "crawlTypecrawlMode": "incremental" }] } |
ResponseResponse
Code Block | ||||
---|---|---|---|---|
| ||||
{ "schedule": [{ "updated":true,"id": "AAABcIueWU0AAABcID5GBc="}, "type{"updated": true,"time", "description": "Weekly seeds" "enabled": true, "scheduleType": "weekly", "schedule": "* * * * 1", "seed": ["AAABcIueWUd=", "AAABcIueWUe="],id":"AAABcID5GBd="}]} |
Status: 200, 404, 406
Section | ||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Update schedules, filteredUpdate schedules configured in the Aspire, filtered by specified criteria. This endpoint needs at least the ADMINISTRATOR role to be executed.
Filters: Check the schedule filter definition here.
|
Status
Response
Status: 200, 406 |
Section | |||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Delete schedules(s)Delete one or more schedules from Aspire. This endpoint needs at least the ADMINISTRATOR role to be executed Update schedulesUpdate schedules in Aspire.
Body Parameters
Path Parameters and Query parameters
Body Parameter
Other parameters passed in the request body will depend on the type of schedule being created - see Add schedule(s) above Example
Response
Status | |||||||||||||||||||||||||||||||||||||||||||||
Response code | Description | ||||||||||||||||||||||||||||||||||||||||||||
200 | Success | ||||||||||||||||||||||||||||||||||||||||||||
404 | Not found - a given schedule identifier was not found | ||||||||||||||||||||||||||||||||||||||||||||
406 | Not acceptable - there was an issue validating the input | ||||||||||||||||||||||||||||||||||||||||||||
Section |
Panel | ||||
---|---|---|---|---|
| ||||
|
Body Parameters
Response
Code Block | ||
---|---|---|
| ||
{
"message": "optional response message"
} |
See Response Body for details regrading the response body returned where multiple items are affected with some (or all) returning errors
(s) to delete |
Examples
Code Block | ||||
---|---|---|---|---|
| ||||
DELETE /aspire/_api/schedules/AAABcID5GBc
DELETE /aspire/_api/schedules?id=AAABcID5GBc&id=AAABcID5GBd
POST /aspire/_api/schedules/delete
{
"ids":["AAABcID5GBc","AAABcID5GBd"]
}
|
Response
Code Block | ||||
---|---|---|---|---|
| ||||
{
"message": "delete result response message"
} |
Status: 200, 404, 406
Section | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Delete multiple schedules, filteredDelete multiple schedules from Aspire, filtered by a specified criteria. This endpoint needs at least the ADMINISTRATOR role to be executed.
Filters: See the schedule filter definition here. Response
Status: 200 |
Section | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Export schedule(s)Export one or more schedule from Aspire, this endpoint needs at least the OPERATOR role to be executed.
Path Parameters and Query parameters
Body Parameter
Examples
Response
Status: 200, 404, 406
|
Section |
---|
ImportThe import usage can be found here |
Section | |||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Filters
Some endpoint queries require a filter. A filter is basically a JSON object with the following format: Schedule filter:
|
Section | |||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Execute schedulesExecute schedules, either sequence or time based. This endpoint needs at least an ADMINISTRATOR role to be executed | |||||||||||||||||||||||||||||||
Response code | Description | ||||||||||||||||||||||||||||||
200 | Success | ||||||||||||||||||||||||||||||
404 | Not found - a given credential identifier was not found | ||||||||||||||||||||||||||||||
406 | Not acceptable - there was an issue validating the input | ||||||||||||||||||||||||||||||
Section | |||||||||||||||||||||||||||||||
Delete single scheduleDelete a single schedule from Aspire.
Query String Body Parameters
Example
Response
Examples Executes a single schedule
Status | |||||||||||||||||||||||||||||||
Response code | Description | ||||||||||||||||||||||||||||||
200 | Success | ||||||||||||||||||||||||||||||
404 | Not found - a given schedule identifier was not found | ||||||||||||||||||||||||||||||
406 | Not acceptable - there was an issue validating the input | ||||||||||||||||||||||||||||||
Section | |||||||||||||||||||||||||||||||
Executes multiple schedules
Response Filters Anchor | | FiltersAnchor | FiltersAnchor |
Code Block | ||||
---|---|---|---|---|
| ||||
{ "filterAAABcIueWU1" : { "ids" : ["ID1", "ID2status",: "ID3", ...],success" }, "typeAAABcIueWU2" : "TYPE", { "description" : "DESCRIPTION", "running"status": "true|falsefailed" } | ||||
Note | ||||
} |
Status: 200, 404