Skip to main content

Stop simulator

This endpoint stops a simulator with the specified Id. The get the id you can list all the simulators first with the get-drones endpoint. The stop request might take some seconds to be processed.

 POST /api/1.0/simulator/{simulatord}/stop

Response

Model: application/json


{
"status": <Boolean> True if the simulator stop request is accepted,
}

Example

const fetchData=async ()=>{
let j,response;
const serverResponse = await fetch(`/api/1.0/simulator/41/stop`, {
mode: "cors",
method: "POST",
referrer: "no-referrer",
headers: {"authorization": "Bearer " + token}
body: "",
})
if(!serverResponse.ok){
try {
switch (serverResponse.status){
case 400:
j = await serverResponse.json();
break;
case 403:
response = { message: "Forbidden access to data" };
case 404:
response = { message: "Address not found" };
default:
j = await serverResponse.json()
}
} catch (e) {
response = { message: "Error fetching data" };
}
}else{
j = await serverResponse.json()
}

response = { data:j };
const {data, message} = response
if(message) console.debug(message)
if(data) console.debug(data)
}
fetchData()

Answer:

{
"status: true,
}