Retrieve generated report according to the Job ID
curl --request GET \
--url https://{host}/api/tsa/v2/tsa/reports/{job_id}/{chunk_id} \
--header 'Authorization: <api-key>'import requests
url = "https://{host}/api/tsa/v2/tsa/reports/{job_id}/{chunk_id}"
headers = {"Authorization": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: '<api-key>'}};
fetch('https://{host}/api/tsa/v2/tsa/reports/{job_id}/{chunk_id}', 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://{host}/api/tsa/v2/tsa/reports/{job_id}/{chunk_id}",
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: <api-key>"
],
]);
$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://{host}/api/tsa/v2/tsa/reports/{job_id}/{chunk_id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://{host}/api/tsa/v2/tsa/reports/{job_id}/{chunk_id}")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://{host}/api/tsa/v2/tsa/reports/{job_id}/{chunk_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = '<api-key>'
response = http.request(request)
puts response.read_bodyusing RestSharp;
var options = new RestClientOptions("https://{host}/api/tsa/v2/tsa/reports/{job_id}/{chunk_id}");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("Authorization", "<api-key>");
var response = await client.GetAsync(request);
Console.WriteLine("{0}", response.Content);
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_WRITEDATA, stdout);
curl_easy_setopt(hnd, CURLOPT_URL, "https://{host}/api/tsa/v2/tsa/reports/{job_id}/{chunk_id}");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "Authorization: <api-key>");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);{
"job_id": "123",
"chunks": [
{
"chunk_id": "tsa-123-1",
"samples": [
{
"sample_id": 1,
"sample_status": [
{
"name": "Algorithm Sampling",
"completed_time": "2021-03-02T19:21:56.377727+00:00",
"status": "success"
}
],
"safe": true,
"sample_params": {
"lateral_distance": -3,
"longitudinal_distance": -5,
"relative_velocity": -2
},
"scenario_json_file_path": "/input/scenarios/scenario_tsa-123-1-1.json",
"kpi_results": {
"critical_lateral_events": 1,
"driven_distance": "637.120010"
},
"kpis_json_file_path": "/output/1/scenario_tsa-123-1-1.json"
}
]
}
],
"kpis": [
{
"name": "min_ttc",
"label": "Minimum time to collision",
"description": "Minimum value of Time to Collision during simulation",
"data_type": "double",
"unit": "s"
}
],
"parameters": [
{
"name": "velocity",
"label": "Relative Velocity",
"description": "velocity of the host",
"data_type": "double",
"unit": "m/s"
}
]
}Retrieve generated report according to the Job ID
GET
/
v2
/
tsa
/
reports
/
{job_id}
/
{chunk_id}
Retrieve generated report according to the Job ID
curl --request GET \
--url https://{host}/api/tsa/v2/tsa/reports/{job_id}/{chunk_id} \
--header 'Authorization: <api-key>'import requests
url = "https://{host}/api/tsa/v2/tsa/reports/{job_id}/{chunk_id}"
headers = {"Authorization": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: '<api-key>'}};
fetch('https://{host}/api/tsa/v2/tsa/reports/{job_id}/{chunk_id}', 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://{host}/api/tsa/v2/tsa/reports/{job_id}/{chunk_id}",
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: <api-key>"
],
]);
$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://{host}/api/tsa/v2/tsa/reports/{job_id}/{chunk_id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://{host}/api/tsa/v2/tsa/reports/{job_id}/{chunk_id}")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://{host}/api/tsa/v2/tsa/reports/{job_id}/{chunk_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = '<api-key>'
response = http.request(request)
puts response.read_bodyusing RestSharp;
var options = new RestClientOptions("https://{host}/api/tsa/v2/tsa/reports/{job_id}/{chunk_id}");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("Authorization", "<api-key>");
var response = await client.GetAsync(request);
Console.WriteLine("{0}", response.Content);
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_WRITEDATA, stdout);
curl_easy_setopt(hnd, CURLOPT_URL, "https://{host}/api/tsa/v2/tsa/reports/{job_id}/{chunk_id}");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "Authorization: <api-key>");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);{
"job_id": "123",
"chunks": [
{
"chunk_id": "tsa-123-1",
"samples": [
{
"sample_id": 1,
"sample_status": [
{
"name": "Algorithm Sampling",
"completed_time": "2021-03-02T19:21:56.377727+00:00",
"status": "success"
}
],
"safe": true,
"sample_params": {
"lateral_distance": -3,
"longitudinal_distance": -5,
"relative_velocity": -2
},
"scenario_json_file_path": "/input/scenarios/scenario_tsa-123-1-1.json",
"kpi_results": {
"critical_lateral_events": 1,
"driven_distance": "637.120010"
},
"kpis_json_file_path": "/output/1/scenario_tsa-123-1-1.json"
}
]
}
],
"kpis": [
{
"name": "min_ttc",
"label": "Minimum time to collision",
"description": "Minimum value of Time to Collision during simulation",
"data_type": "double",
"unit": "s"
}
],
"parameters": [
{
"name": "velocity",
"label": "Relative Velocity",
"description": "velocity of the host",
"data_type": "double",
"unit": "m/s"
}
]
}Path Parameters
Response
Success. The report for {job_id} has been retrieved.
Was this page helpful?