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 this endpoint need the needs at least the ADMINISTRATOR role to be executed.
Pagination query string parameters Sorting query string parameters
Response
Status: 200 |
Section | ||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Get a single scheduleinformationThis endpoint needs at least Get information about a single schedule configured in Aspire, this endpoint need the at least the ADMINISTRATOR role to be executed.
Path Parameters
Response
Status: 200, 404 |
Section | ||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Add schedule(s)Add schedulesto AspireThis endpoint needs , this endpoint need the at least the ADMINISTRATOR role to be executed.
Body Parameters
The action to perform by the scheduled task
crawl_mode | string | Optional |
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 | |||||||||||||||||||||||||||||||||||
scheduleTimeType | 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) | |||||||||||||||||||||||||||||||||||
seeds | string | Optional | the seed(s) this schedule applies to |
| |||
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 |
Example
Code Block | ||
---|---|---|
| ||
POST /aspire/_api/schedules [{ "type": "time", "description": "Weekly seeds" "enabled": true, "scheduleTimeType": "weekly", "schedule": "* * * * 1", "seeds": ["AAABcIueWUd=", "AAABcIueWUe="], "action": "start", "crawl_mode": "full" }, { "type": "sequence", "description": "Rollup" "enabled": false, "after": "* * * * 1", "seeds": ["AAABcIudWUdAAABcIueWUd=", "AAABcIudWUeAAABcIueWUe="], "seedsFilter":{"tags":["tag1","tag2"]}, "action": "start", "crawl_modecrawlMode": "incrementalfull" }] |
Response TODO: check the schedule format
Code Block | ||
---|---|---|
| ||
{ "schedule": [{ , { "idtype": "AAABcIueWU0sequence", "typedescription": "timeRollup", "descriptionenabled": "Weekly seeds"false, "enabledstopOnFail": true, "scheduleTimeTypeafter": "weekly", 0 0 0 ? "schedule": "* *SUN * * 1", ", "completeThreshold": 0.65, "seeds": ["AAABcIueWUdAAABcIudWUd=", "AAABcIueWUeAAABcIudWUe="], "actionseedsFilter": {"start", "crawl_mode": "full" tags":["tag1","tag2"]}, { "id"action": "AAABcIueWU1start", "typecrawlMode": "sequenceincremental" }] |
Response
Code Block | ||||
---|---|---|---|---|
| ||||
{ , "descriptionschedule": "Rollup"[{ "enabledid": false"AAABcIueWU0", "aftertype": "* * * * 1time", "seedsdescription": ["AAABcIudWUd=", "AAABcIudWUe="],Weekly seeds" "actionenabled": "start"true, "crawl_modestopOnFail": "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
true,
"scheduleTimeType": "weekly",
"schedule": "0 0 0 ? * SUN *",
"completeThreshold": 0.65,
"seeds": ["AAABcIueWUd=", "AAABcIueWUe="],
"seedsFilter":{"tags":["tag1","tag2"]},
"action": "start",
"crawlMode": "full"
},
{
"id": "AAABcIueWU1",
"type": "sequence",
"description": "Rollup"
"enabled": false,
"stopOnFail": true,
"after": "0 0 0 ? * SUN *",
"completeThreshold": 0.65,
"seeds": ["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.
Path Parameters
Body Parameters
x - at least one field must be present Example
Response
Status: 200, 404, 406
|
Section | |||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Delete schedules(s)Delete one or more schedules from Aspire. This endpoint needs at least the ADMINISTRATOR role to be executed.
Path Parameters and Query parameters
Body Parameter
Examples
Response
Status: 200, 404, 406
|
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
Update schedule(s)Update schedules in Aspire, this endpoint need the at least the ADMINISTRATOR role to be executed.
Path Parameters | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Name | Type | Required | Description | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
id | string | Required | The identifier of the schedule to update | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Name | Type | Required | Description | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
id | string | Required | The identifier of the schedule to update | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
description | string | x | An optional description of the schedule | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
schedule | string | x | the cron like schedule for a time based schedule | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
action | string | x | The action to perform by the scheduled task
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
after | string | x | the id of the schedule after which this schedule should run (for a sequence based schedule) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
crawl_mode | string | x | The type of crawl to perform by the scheduled task
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
enabled | boolean | x | Whether this schedule is enabled or not | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
scheduleTimeType | string | x | The type of the time based schedule
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
seeds | string | x | the seed(s) this schedule applies to |
Code Block | |||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| |||||||||||||||||||||||||
PUT /aspire/_api/schedules
{
"AAABcIueWU0=": {
|
Response
Code Block | ||
---|---|---|
| ||
{"schedule":[{"updated":true,"id":"AAABcID5GBc="},{"updated":true,"id":"AAABcID5GBd="}]} |
Status: 200, 404, 406
Section | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Update schedules, filteredUpdate schedules configured in the Aspire, filtered by a specified criteria, this endpoint need the at least the ADMINISTRATOR role to be executed.
Filters: The schedule filter definition here
Response
Status: 200, 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.
Body Parameters
Examples Executes a single schedule
Executes multiple schedules
Response
Status: 200, 404 | ||||||||||||||||||||||||||||||||
Section |
Panel | ||||
---|---|---|---|---|
| ||||
|
Filters: The schedule filter definition here
Response
Code Block | ||
---|---|---|
| ||
{
"message": "optional response message"
} |
Status: 200
Delete one or more schedules from Aspire, this endpoint need the at least the ADMINISTRATOR role to be executed.
Panel | ||||
---|---|---|---|---|
| ||||
|
Path Parameters and Query parameters
Body Parameter
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
Some endpoint queries require a filter. A filter is basically a JSON object with the following format:
Seed filter:
language | js |
---|