/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"
}
]
}/v1/faults/{gateway}List gateway faults#
Faults a gateway injects
The faults the gateway injects on demand — the scenarios of a simulator, or those a hardware gateway declares (forced CAN errors, SpaceWire disconnection…) — and whether each is active (its faults verb): {"faults": [{name, description?, active}]}.
Path parameters
gatewayrequiredstring
Gateway instance (bench-can-1, sim-gw-1).
Responses
200The faults of the gateway.application/json
object
404No 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.
422The gateway injects no fault, 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/faults/<gateway>"import requests
BASE_URL = "http://localhost:8080"
gateway = "<gateway>" # Gateway instance (`bench-can-1`, `sim-gw-1`).
response = requests.get(f"{BASE_URL}/v1/faults/{gateway}")
response.raise_for_status()
print(response.json())let base_url = "http://localhost:8080";
let gateway = "<gateway>"; // Gateway instance (`bench-can-1`, `sim-gw-1`).
let response = reqwest::Client::new()
.get(format!("{base_url}/v1/faults/{gateway}"))
.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/faults/{gateway}/{fault}Switch gateway fault#
Switch a fault of a gateway on or off
Each change is published on stellar.sim.evt.<target> for every target of the gateway. A run schedules faults only where its environment allows them (fault_injection), never in in_orbit; this endpoint is the operator's own act.
Path parameters
gatewayrequiredstring
Gateway instance.
faultrequiredstring
Fault, as the gateway names it.
Request body application/jsonrequired
activerequiredboolean
Responses
200The reply of the gateway.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 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 the gateway injects none.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/faults/<gateway>/<fault>" \
-H "Content-Type: application/json" \
-d '{
"active": true
}'import requests
BASE_URL = "http://localhost:8080"
gateway = "<gateway>" # Gateway instance.
fault = "<fault>" # Fault, as the gateway names it.
response = requests.put(
f"{BASE_URL}/v1/faults/{gateway}/{fault}",
json={
"active": True,
},
)
response.raise_for_status()
print(response.json())let base_url = "http://localhost:8080";
let gateway = "<gateway>"; // Gateway instance.
let fault = "<fault>"; // Fault, as the gateway names it.
let response = reqwest::Client::new()
.put(format!("{base_url}/v1/faults/{gateway}/{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"
}
]
}