Get a run
curl --request GET \
--url https://{command_center_host}/api/v1/scenarios/{id}/runs/{reportId} \
--header 'Authorization: Bearer <token>'import requests
url = "https://{command_center_host}/api/v1/scenarios/{id}/runs/{reportId}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://{command_center_host}/api/v1/scenarios/{id}/runs/{reportId}', 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}/runs/{reportId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://{command_center_host}/api/v1/scenarios/{id}/runs/{reportId}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://{command_center_host}/api/v1/scenarios/{id}/runs/{reportId}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://{command_center_host}/api/v1/scenarios/{id}/runs/{reportId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"status": "created",
"execution_status": "queued",
"evaluation_status": "not_evaluated",
"passing": true,
"restore_failed": true,
"restore_status": "not_required",
"errors": [
"<string>"
],
"job_id": "<string>",
"workflow_id": "<string>",
"workflow_status": "<string>",
"steps": [
{
"name": "prepare:stop nginx",
"status": "<string>",
"error": "<string>",
"duration_ms": 123,
"record": "<unknown>"
}
]
}{
"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
Get a run
reportId is the run_id a launch answered with. Three independent states: whether the run got through, how it was graded, and whether the host was put back.
GET
/
api
/
v1
/
scenarios
/
{id}
/
runs
/
{reportId}
Get a run
curl --request GET \
--url https://{command_center_host}/api/v1/scenarios/{id}/runs/{reportId} \
--header 'Authorization: Bearer <token>'import requests
url = "https://{command_center_host}/api/v1/scenarios/{id}/runs/{reportId}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://{command_center_host}/api/v1/scenarios/{id}/runs/{reportId}', 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}/runs/{reportId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://{command_center_host}/api/v1/scenarios/{id}/runs/{reportId}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://{command_center_host}/api/v1/scenarios/{id}/runs/{reportId}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://{command_center_host}/api/v1/scenarios/{id}/runs/{reportId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"status": "created",
"execution_status": "queued",
"evaluation_status": "not_evaluated",
"passing": true,
"restore_failed": true,
"restore_status": "not_required",
"errors": [
"<string>"
],
"job_id": "<string>",
"workflow_id": "<string>",
"workflow_status": "<string>",
"steps": [
{
"name": "prepare:stop nginx",
"status": "<string>",
"error": "<string>",
"duration_ms": 123,
"record": "<unknown>"
}
]
}{
"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.
Response
The run, with its step records
Available options:
created, pending, queued, running, cancelling, completed, failed, cancelled Available options:
queued, running, completed, failed, cancelled, null Available options:
not_evaluated, passed, failed, unknown Available options:
not_required, pending, running, completed, failed, null Show child attributes
Show child attributes

