Run a scenario
curl --request POST \
--url https://{command_center_host}/api/v1/scenarios/{id}/run \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"phases": [
"prepare",
"restore"
],
"host": "<string>",
"with_agent": false,
"gateway": "runner",
"main_engine": "<string>",
"secondary_engine": "<string>",
"gateway_engine": "<string>"
}
'import requests
url = "https://{command_center_host}/api/v1/scenarios/{id}/run"
payload = {
"phases": ["prepare", "restore"],
"host": "<string>",
"with_agent": False,
"gateway": "runner",
"main_engine": "<string>",
"secondary_engine": "<string>",
"gateway_engine": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
phases: ['prepare', 'restore'],
host: '<string>',
with_agent: false,
gateway: 'runner',
main_engine: '<string>',
secondary_engine: '<string>',
gateway_engine: '<string>'
})
};
fetch('https://{command_center_host}/api/v1/scenarios/{id}/run', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{command_center_host}/api/v1/scenarios/{id}/run",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'phases' => [
'prepare',
'restore'
],
'host' => '<string>',
'with_agent' => false,
'gateway' => 'runner',
'main_engine' => '<string>',
'secondary_engine' => '<string>',
'gateway_engine' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://{command_center_host}/api/v1/scenarios/{id}/run"
payload := strings.NewReader("{\n \"phases\": [\n \"prepare\",\n \"restore\"\n ],\n \"host\": \"<string>\",\n \"with_agent\": false,\n \"gateway\": \"runner\",\n \"main_engine\": \"<string>\",\n \"secondary_engine\": \"<string>\",\n \"gateway_engine\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://{command_center_host}/api/v1/scenarios/{id}/run")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"phases\": [\n \"prepare\",\n \"restore\"\n ],\n \"host\": \"<string>\",\n \"with_agent\": false,\n \"gateway\": \"runner\",\n \"main_engine\": \"<string>\",\n \"secondary_engine\": \"<string>\",\n \"gateway_engine\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{command_center_host}/api/v1/scenarios/{id}/run")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"phases\": [\n \"prepare\",\n \"restore\"\n ],\n \"host\": \"<string>\",\n \"with_agent\": false,\n \"gateway\": \"runner\",\n \"main_engine\": \"<string>\",\n \"secondary_engine\": \"<string>\",\n \"gateway_engine\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"run_id": "<string>",
"workflow_id": "wfl_7d3b9c2e-...",
"phases": [
"prepare"
],
"with_agent": true,
"host": "<string>",
"benchmark_id": "bch_0f4a6d1b-...",
"report_id": "scr_ca850e32-...",
"report_ids": [
"<string>"
]
}{
"code": "VALIDATION_FAILED",
"message": "Validation failed",
"request_id": "req_3702b7e7-...",
"field": "<string>",
"errors": [
{
"field": "<string>",
"message": "<string>"
}
],
"details": {}
}{
"code": "VALIDATION_FAILED",
"message": "Validation failed",
"request_id": "req_3702b7e7-...",
"field": "<string>",
"errors": [
{
"field": "<string>",
"message": "<string>"
}
],
"details": {}
}{
"code": "VALIDATION_FAILED",
"message": "Validation failed",
"request_id": "req_3702b7e7-...",
"field": "<string>",
"errors": [
{
"field": "<string>",
"message": "<string>"
}
],
"details": {}
}{
"code": "VALIDATION_FAILED",
"message": "Validation failed",
"request_id": "req_3702b7e7-...",
"field": "<string>",
"errors": [
{
"field": "<string>",
"message": "<string>"
}
],
"details": {}
}{
"code": "VALIDATION_FAILED",
"message": "Validation failed",
"request_id": "req_3702b7e7-...",
"field": "<string>",
"errors": [
{
"field": "<string>",
"message": "<string>"
}
],
"details": {}
}Scenarios
Run a scenario
Accepted, not finished: poll the run. with_agent: true is a graded run (setup, ticket to the agent, validation, restore) and answers with a report id; with_agent: false runs only the phases picked, with no verdict. A disabled scenario is refused.
POST
/
api
/
v1
/
scenarios
/
{id}
/
run
Run a scenario
curl --request POST \
--url https://{command_center_host}/api/v1/scenarios/{id}/run \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"phases": [
"prepare",
"restore"
],
"host": "<string>",
"with_agent": false,
"gateway": "runner",
"main_engine": "<string>",
"secondary_engine": "<string>",
"gateway_engine": "<string>"
}
'import requests
url = "https://{command_center_host}/api/v1/scenarios/{id}/run"
payload = {
"phases": ["prepare", "restore"],
"host": "<string>",
"with_agent": False,
"gateway": "runner",
"main_engine": "<string>",
"secondary_engine": "<string>",
"gateway_engine": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
phases: ['prepare', 'restore'],
host: '<string>',
with_agent: false,
gateway: 'runner',
main_engine: '<string>',
secondary_engine: '<string>',
gateway_engine: '<string>'
})
};
fetch('https://{command_center_host}/api/v1/scenarios/{id}/run', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{command_center_host}/api/v1/scenarios/{id}/run",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'phases' => [
'prepare',
'restore'
],
'host' => '<string>',
'with_agent' => false,
'gateway' => 'runner',
'main_engine' => '<string>',
'secondary_engine' => '<string>',
'gateway_engine' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://{command_center_host}/api/v1/scenarios/{id}/run"
payload := strings.NewReader("{\n \"phases\": [\n \"prepare\",\n \"restore\"\n ],\n \"host\": \"<string>\",\n \"with_agent\": false,\n \"gateway\": \"runner\",\n \"main_engine\": \"<string>\",\n \"secondary_engine\": \"<string>\",\n \"gateway_engine\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://{command_center_host}/api/v1/scenarios/{id}/run")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"phases\": [\n \"prepare\",\n \"restore\"\n ],\n \"host\": \"<string>\",\n \"with_agent\": false,\n \"gateway\": \"runner\",\n \"main_engine\": \"<string>\",\n \"secondary_engine\": \"<string>\",\n \"gateway_engine\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{command_center_host}/api/v1/scenarios/{id}/run")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"phases\": [\n \"prepare\",\n \"restore\"\n ],\n \"host\": \"<string>\",\n \"with_agent\": false,\n \"gateway\": \"runner\",\n \"main_engine\": \"<string>\",\n \"secondary_engine\": \"<string>\",\n \"gateway_engine\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"run_id": "<string>",
"workflow_id": "wfl_7d3b9c2e-...",
"phases": [
"prepare"
],
"with_agent": true,
"host": "<string>",
"benchmark_id": "bch_0f4a6d1b-...",
"report_id": "scr_ca850e32-...",
"report_ids": [
"<string>"
]
}{
"code": "VALIDATION_FAILED",
"message": "Validation failed",
"request_id": "req_3702b7e7-...",
"field": "<string>",
"errors": [
{
"field": "<string>",
"message": "<string>"
}
],
"details": {}
}{
"code": "VALIDATION_FAILED",
"message": "Validation failed",
"request_id": "req_3702b7e7-...",
"field": "<string>",
"errors": [
{
"field": "<string>",
"message": "<string>"
}
],
"details": {}
}{
"code": "VALIDATION_FAILED",
"message": "Validation failed",
"request_id": "req_3702b7e7-...",
"field": "<string>",
"errors": [
{
"field": "<string>",
"message": "<string>"
}
],
"details": {}
}{
"code": "VALIDATION_FAILED",
"message": "Validation failed",
"request_id": "req_3702b7e7-...",
"field": "<string>",
"errors": [
{
"field": "<string>",
"message": "<string>"
}
],
"details": {}
}{
"code": "VALIDATION_FAILED",
"message": "Validation failed",
"request_id": "req_3702b7e7-...",
"field": "<string>",
"errors": [
{
"field": "<string>",
"message": "<string>"
}
],
"details": {}
}Authorizations
An API key minted in Command Center (Settings -> API Keys), sent as Authorization: Bearer 2501_ak_.... A Command Center session cookie is also accepted.
Path Parameters
Body
application/json
Minimum array length:
1Available options:
prepare, restore Minimum string length:
1Available options:
runner, servicenow Minimum string length:
1Minimum string length:
1Minimum string length:
1Response
The launched run
What to poll and stop: the report id of a graded run, the workflow id of a phase run
Example:
"wfl_7d3b9c2e-..."
Available options:
prepare, restore Example:
"bch_0f4a6d1b-..."
Example:
"scr_ca850e32-..."

