This example shows you how to start multiple runbooks and their tasks, without needing to go into Cutover to manually start them.
1. List runbooks
Let’s start a runbook and start the first two tasks.
To identify the runbook ID, we can use the runbook URL or we can make an authenticated call to the List Runbooks endpoint.
The request URL to locate the runbook will look like this:
https://api.client_name.cutover.com/core/runbooks?query=Cutover+Instance+Deployment+-+V3.99
In this case, the runbook ID is 1885.
2. Start a runbook
We will use the Start a Runbook endpoint and execute the request body below:
{
"meta": {
"comms": "off",
"run_type": "live",
"rebaseline": true,
"shift_fixed_times": true
}
}
The API will start the runbook as shown in the image. As the first task is an auto start task type, it has been started automatically:
3. Get the runbook’s tasks
We're now looking to start the next task in the runbook. To identify the task IDs in the runbook, we can use the List Tasks in a Runbook endpoint.
The request URL to identify the task ID is shown below:
https://api.client_name.cutover.com/core/runbooks/1885/tasks
In this case, we are going to start task ID #23.
4. Start tasks
We can use the Start a Task endpoint, as shown in the request body below:
{
"meta": {
"override": true
}
}
From the screenshot below, we can see that task #23 has started and completed.
In order to start the next task, we will need to repeat steps 3 and 4.
Note: To start another runbook and its tasks, please repeat from step 1.