diff --git a/docs/backend-system/core-services/scheduler.md b/docs/backend-system/core-services/scheduler.md index f61f77cc7e..55cd23d989 100644 --- a/docs/backend-system/core-services/scheduler.md +++ b/docs/backend-system/core-services/scheduler.md @@ -45,7 +45,21 @@ The scheduler exposes a REST API on top of each plugin's base URL, that lets you ### `GET /.backstage/scheduler/v1/tasks` -Lists all tasks that the given plugin registered at startup, and their current states. The response shape is as follows: +Lists all tasks that the given plugin registered at startup, and their current states. + +For example, to list all scheduled tasks for the Catalog plugin: + +```sh +curl 'https:///api/catalog/.backstage/scheduler/v1/tasks' +``` + +You can try this out on the Backstage demo instance: + +```sh +curl 'https://demo.backstage.io/api/catalog/.backstage/scheduler/v1/tasks' +``` + +The response shape is as follows: ```json { @@ -118,6 +132,18 @@ The `workerState` shape is as follows: Schedules the given task ID for immediate execution, instead of waiting for its next scheduled time slot to arrive. +For example, to trigger a specific Catalog task: + +```bash +curl -X POST "https:///api/catalog/.backstage/scheduler/v1/tasks/InternalOpenApiDocumentationProvider:refresh/trigger" +``` + +A working example would be: + +```bash +curl -X POST "https://demo.backstage.io/api/catalog/.backstage/scheduler/v1/tasks/InternalOpenApiDocumentationProvider:refresh/trigger" +``` + Note that there can still be an additional small delay before a worker discovers that the task is due and actually picks it up. This typically takes less than a second, but it can vary.