/v1/sim/{gateway}/faultsList faults#
Faults of a simulated target
The fault scenarios of the simulation played by the gateway, and whether each is active (its faults verb).
Path parameters
gatewayrequiredstring
Gateway instance of the simulated target (sim-gw-1).
Responses
200The reply of the simulator.application/json
object
404No simulated gateway answers: sim::unknown-gateway.application/json
errorsrequiredarray of ErrorItem
Every error found.
ErrorItem · 3 fields
coderequiredstring
Stable code.
messagerequiredstring
Message for the operator.
helpstring
Suggested fix.
422Not a simulated gateway, or refused: sim::not-simulated, sim::refused.application/json
errorsrequiredarray of ErrorItem
Every error found.
ErrorItem · 3 fields
coderequiredstring
Stable code.
messagerequiredstring
Message for the operator.
helpstring
Suggested fix.
503The MCS bus (NATS) is unavailable: api::unavailable.application/json
errorsrequiredarray of ErrorItem
Every error found.
ErrorItem · 3 fields
coderequiredstring
Stable code.
messagerequiredstring
Message for the operator.
helpstring
Suggested fix.
504The gateway did not answer: sim::timeout.application/json
errorsrequiredarray of ErrorItem
Every error found.
ErrorItem · 3 fields
coderequiredstring
Stable code.
messagerequiredstring
Message for the operator.
helpstring
Suggested fix.
Request
curl "http://localhost:8080/v1/sim/<gateway>/faults"import requests
BASE_URL = "http://localhost:8080"
gateway = "<gateway>" # Gateway instance of the simulated target (`sim-gw-1`).
response = requests.get(f"{BASE_URL}/v1/sim/{gateway}/faults")
response.raise_for_status()
print(response.json())let base_url = "http://localhost:8080";
let gateway = "<gateway>"; // Gateway instance of the simulated target (`sim-gw-1`).
let response = reqwest::Client::new()
.get(format!("{base_url}/v1/sim/{gateway}/faults"))
.send()
.await?
.error_for_status()?;
let body: serde_json::Value = response.json().await?;
println!("{body:#}");Response
{}{
"errors": [
{
"code": "string",
"message": "string",
"help": "string"
}
]
}{
"errors": [
{
"code": "string",
"message": "string",
"help": "string"
}
]
}{
"errors": [
{
"code": "string",
"message": "string",
"help": "string"
}
]
}{
"errors": [
{
"code": "string",
"message": "string",
"help": "string"
}
]
}/v1/sim/{gateway}/faults/{fault}Switch fault#
Switch a fault on or off
While a fault is active, its values replace those of the model of the simulation. Each change is published on stellar.sim.evt.<target>, so that reports show the faults active during a run.
Path parameters
gatewayrequiredstring
Gateway instance of the simulated target.
faultrequiredstring
Fault, as named in the simulation.
Request body application/jsonrequired
activerequiredboolean
Responses
200The reply of the simulator.application/json
object
400Invalid body.application/json
errorsrequiredarray of ErrorItem
Every error found.
ErrorItem · 3 fields
coderequiredstring
Stable code.
messagerequiredstring
Message for the operator.
helpstring
Suggested fix.
404No simulated gateway answers.application/json
errorsrequiredarray of ErrorItem
Every error found.
ErrorItem · 3 fields
coderequiredstring
Stable code.
messagerequiredstring
Message for the operator.
helpstring
Suggested fix.
422Unknown fault, or not a simulated gateway.application/json
errorsrequiredarray of ErrorItem
Every error found.
ErrorItem · 3 fields
coderequiredstring
Stable code.
messagerequiredstring
Message for the operator.
helpstring
Suggested fix.
503The MCS bus (NATS) is unavailable: api::unavailable.application/json
errorsrequiredarray of ErrorItem
Every error found.
ErrorItem · 3 fields
coderequiredstring
Stable code.
messagerequiredstring
Message for the operator.
helpstring
Suggested fix.
504The gateway did not answer.application/json
errorsrequiredarray of ErrorItem
Every error found.
ErrorItem · 3 fields
coderequiredstring
Stable code.
messagerequiredstring
Message for the operator.
helpstring
Suggested fix.
Request
curl -X PUT "http://localhost:8080/v1/sim/<gateway>/faults/<fault>" \
-H "Content-Type: application/json" \
-d '{
"active": true
}'import requests
BASE_URL = "http://localhost:8080"
gateway = "<gateway>" # Gateway instance of the simulated target.
fault = "<fault>" # Fault, as named in the simulation.
response = requests.put(
f"{BASE_URL}/v1/sim/{gateway}/faults/{fault}",
json={
"active": True,
},
)
response.raise_for_status()
print(response.json())let base_url = "http://localhost:8080";
let gateway = "<gateway>"; // Gateway instance of the simulated target.
let fault = "<fault>"; // Fault, as named in the simulation.
let response = reqwest::Client::new()
.put(format!("{base_url}/v1/sim/{gateway}/faults/{fault}"))
.json(&serde_json::json!({
"active": true
}))
.send()
.await?
.error_for_status()?;
let body: serde_json::Value = response.json().await?;
println!("{body:#}");Response
{}{
"errors": [
{
"code": "string",
"message": "string",
"help": "string"
}
]
}{
"errors": [
{
"code": "string",
"message": "string",
"help": "string"
}
]
}{
"errors": [
{
"code": "string",
"message": "string",
"help": "string"
}
]
}{
"errors": [
{
"code": "string",
"message": "string",
"help": "string"
}
]
}{
"errors": [
{
"code": "string",
"message": "string",
"help": "string"
}
]
}