Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.


The schedules API provides functionality that allows a administrator to add, delete or update schedules

Table of Contents

Section

Get all schedules

Lists all the schedules configured in the Aspire, this endpoint need the at least the ADMINISTRATOR role to be executed.

Panel
borderColorblack
bgColor#fafafb
GET /aspire/_api/schedules

Pagination query string parameters

Section

Get all schedules, filtered

Lists schedules configured in the Aspire, filtered by a specified criteria, this endpoint need the at least the OPERATOR role to be executed.

Panel
borderColorblack
bgColor#fafafb

POST /aspire/_api/schedules/getAll

Pagination query string parameters

Filters: The schedule filter definition here

Response

Code Block
languagejs
{
    "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"
            ],
            "crawl_mode": "full",
            "action": "start"
        }
    ]
}  

Status: 200

Section

Get a single schedule

Get information about a single schedule configured in Aspire, this endpoint need the at least the ADMINISTRATOR role to be executed.

Panel
borderColorblack
bgColor#fafafb

GET /aspire/_api/schedules/:id


Path Parameters

NameTypeRequiredDescription
idstringRequiredThe id of the schedule to return


Response

Code Block
languagejs
{
    "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"
        ],
        "crawl_mode": "full",
        "action": "start"
    }
}

Status: 200, 404




Section

Add schedule(s)

Add schedules to Aspire, this endpoint need the at least the ADMINISTRATOR role to be executed.

Panel
borderColorblack
bgColor#fafafb
POST /aspire/_api/schedules


Body Parameters 

NameTypeRequiredDescription
typestringRequired

The type of schedule to add

  • "time"
  • "sequence"
descriptionstringRequiredAn optional description of the schedule
actionstringOptional

The action to perform by the scheduled task

  • "start"
  • "stop"
  • "pause"
  • "resume"
crawl_modestringOptional

The type of crawl to perform by the scheduled task

  • "full"
  • "incremental"
  • "identity"

Other parameters passed in the request body will depend on the type of schedule being created. Some candidates are shown below:

NameTypeRequiredDescription
enabledbooleanOptionalWhether this schedule is enabled or not
scheduleTimeTypestringOptional

The type of the time based schedule

  • "hourly"
  • "daily"
  • "weekly"
  • "monthly"
  • "custom"
schedulestringOptionalthe cron like schedule for a time based schedule
afterstringOptionalthe id of the schedule after which this schedule should run (for a sequence based schedule)
seedsstringOptionalthe seed(s) this schedule applies to


Example 

Code Block
languagejs
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": ["AAABcIudWUd=", "AAABcIudWUe="],
  "action": "start",
  "crawl_mode": "incremental"
}]


Response Response TODO: check the schedule format

Code Block
languagejs
{
  "schedule": [{
    "id": "AAABcIueWU0",
    "type": "time",
    "description": "Weekly seeds"
    "enabled": true,
    "scheduleTimeType": "weekly",
    "schedule": "* * * * 1",
    "seeds": ["AAABcIueWUd=", "AAABcIueWUe="],
    "action": "start",
    "crawl_mode": "full"
   },
   {
    "id": "AAABcIueWU1",
    "type": "sequence",
    "description": "Rollup"
    "enabled": false,
    "after": "* * * * 1",
    "seeds": ["AAABcIudWUd=", "AAABcIudWUe="],
    "action": "start",
    "crawl_mode": "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 need the at least the ADMINISTRATOR role to be executed.

Panel
borderColorblack
bgColor#fafafb

PUT /aspire/_api/schedules/:id

PUT /aspire/_api/schedules


Path Parameters

NameTypeRequiredDescription
idstringRequiredThe identifier of the schedule to update


Body Parameters

NameTypeRequiredDescription
idstringRequiredThe identifier of the schedule to update
descriptionstringxAn optional description of the schedule
schedulestringxthe cron like schedule for a time based schedule
actionstringx

The action to perform by the scheduled task

  • "start"
  • "stop"
  • "pause"
  • "resume"
afterstringxthe id of the schedule after which this schedule should run (for a sequence based schedule)
crawl_modestringx

The type of crawl to perform by the scheduled task

  • "full"
  • "incremental"
  • "identity"
enabledbooleanxWhether this schedule is enabled or not
scheduleTimeTypestringx

The type of the time based schedule

  • "hourly"
  • "daily"
  • "weekly"
  • "monthly"
  • "custom"
seedsstringxthe seed(s) this schedule applies to

x - at least one field must be present


Example 

Code Block
languagejs
PUT /aspire/_api/schedules
{
  "AAABcIueWU0=": {
    "id": "AAABcIueWU0",
    "description": "Weekly seeds"
    "enabled": true,
    "scheduleTimeType": "weekly",
    "schedule": "* * * * 1",
    "seeds": ["AAABcIueWUd=", "AAABcIueWUe="],
    "action": "start",
    "crawl_mode": "full"
  },
  "AAABcIueWU1": {
    "id": "AAABcIueWU1",
    "description": "Rollup"
    "enabled": false,
    "schedule": "* * * * 1",
    "seeds": ["AAABcIudWUd=", "AAABcIudWUe="],
    "action": "start",
    "crawl_mode": "incremental"
  }
}


Response 

Code Block
languagejs
{"schedule":[{"updated":true,"id":"AAABcID5GBc="},{"updated":true,"id":"AAABcID5GBd="}]}

Status: 200, 404, 406



Section

Update schedules, filtered

Update schedules configured in the Aspire, filtered by a specified criteria, this endpoint need the at least the ADMINISTRATOR role to be executed.

Panel
borderColorblack
bgColor#fafafb

PUT /aspire/_api/schedules/updateAll

Filters: The schedule filter definition here

Update body parameter

Code Block
{
  "update" : {
    "description" : "DESCRIPTION",
    "schedule" : "SCHEDULE",
    "action" : "ACTION",
    "after" : "AFTER",
    "crawl_mode" : "CRAWL_MODE",
    "enabled" : "ENABLED",
    "scheduleTimeType" : "SCHEDULE_TIME_TYPE",
    "seeds" : ["SEED1", "SEED2", "SEED3", ...],
    "seeds.add" : ["SEED1", "SEED2", "SEED3", ...],
    "seeds.remove" : ["SEED1", "SEED2", "SEED3", ...],  }
}

Response

Code Block
languagejs
{
  "message": "update result response message"
}

Status: 200, 406

Section

Delete multiple schedules, filtered

Delete multiple schedules from Aspire, filtered by a specified criteria, this endpoint need the at least the ADMINISTRATOR role to be executed.

Panel
borderColorblack
bgColor#fafafb

POST /aspire/_api/schedules/deleteAll

Filters: The schedule filter definition here


Response

Code Block
languagejs
{
  "message": "optional response message"
}

Status: 200



Section

Delete schedules(s)

Delete one or more schedules from Aspire, this endpoint need the at least the ADMINISTRATOR role to be executed.

Panel
borderColorblack
bgColor#fafafb

DELETE /aspire/_api/schedules/:id

DELETE /aspire/_api/schedules

POST /aspire/_api/schedules/delete


Path Parameters and Query parameters

NameTypeRequiredDescription
idstringRequiredThe identifier(s) of the schedule(s) to delete


Body Parameter

NameTypeRequiredDescription
idsstringRequiredThe identifier(s) of the schedule(s) to delete


Examples

Code Block
languagejs
DELETE /aspire/_api/schedules/AAABcID5GBc

DELETE /aspire/_api/schedules?id=AAABcID5GBc&id=AAABcID5GBd

POST /aspire/_api/schedules/delete
{
  "ids":["AAABcID5GBc","AAABcID5GBd"]
}


Response

Code Block
languagejs
{
  "message": "delete result response message"
}

Status: 200, 404, 406

Section

Filters
Anchor
FiltersAnchor
FiltersAnchor

 Some endpoint queries require a filter. A filter is basically a JSON object with the following format:

Seed filter:

Code Block
languagejs
  "filter" : {
    "ids" : ["ID1", "ID2", "ID3", ...],
    "type" : "TYPE",
    "description" : "DESCRIPTION",
	"seeds" : ["SEED1", "SEED2", "SEED3", ...]
  }