/v1/alarmsList alarms#
Alarms
The alarms not NORMAL or shelved, from stellar_alarms; every alarm recorded with all.
Query parameters
targetstring
Only the alarms of this target.
allboolean
Every alarm recorded, NORMAL included.
Responses
200Alarms, by key order.application/json
alarmsrequiredarray of Alarm
Alarms, by key order.
Alarm · 5 fields
alarmrequiredstring
Alarm: its name, or the measure of the limits.
componentrequiredstring
Component.
instancestring
Component instance.
targetrequiredstring
Target.
recordrequiredCurrent state.
AlarmRecord · 10 fields
active_since string
Start of the activation.
bystring
Operator of the last transition, when not the condition.
causeCause of the last transition.
changed_at string
Last transition.
previousState before the last transition.
seqrequiredinteger · uint64
Number of the last transition, from 1; the transition event bears it.
severityone of AlarmSeverity | null
Severity of the activation; kept while cleared and unacknowledged.
shelved_until string
End of the shelving: until then, the alarm triggers no reaction.
staterequiredState.
valueany
Value of the measure at the last transition, for the alarm of its limits.
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.
Request
curl "http://localhost:8080/v1/alarms"import requests
BASE_URL = "http://localhost:8080"
response = requests.get(f"{BASE_URL}/v1/alarms")
response.raise_for_status()
print(response.json())let base_url = "http://localhost:8080";
let response = reqwest::Client::new()
.get(format!("{base_url}/v1/alarms"))
.send()
.await?
.error_for_status()?;
let body: serde_json::Value = response.json().await?;
println!("{body:#}");Response
{
"alarms": [
{
"alarm": "string",
"component": "string",
"instance": "string",
"target": "string",
"record": {
"active_since": "string",
"by": "string",
"cause": null,
"changed_at": "string",
"previous": null,
"seq": 0,
"severity": null,
"shelved_until": "string",
"state": null,
"value": null
}
}
]
}{
"errors": [
{
"code": "string",
"message": "string",
"help": "string"
}
]
}/v1/alarms/watchWatch alarms#
Follow the alarm transitions (WebSocket)
Every transition from now, in order. Each message is an AlarmEvent.
Query parameters
targetstring
Only the transitions of this target.
Responses
101WebSocket: one AlarmEvent per message.application/json
alarmrequiredstring
Alarm: its name, or the measure of the limits.
atrequiredstring
Time of the transition.
bystring
Operator, for an acknowledgement or a shelving.
causerequiredCause.
componentrequiredstring
Component.
instancestring
Component instance.
previousrequiredState before.
seqrequiredinteger · uint64
Number of the transition.
severityone of AlarmSeverity | null
Severity of the activation.
shelved_until string
End of the shelving in progress.
staterequiredState after.
targetrequiredstring
Target.
valueany
Value of the measure, for the alarm of its limits.
404Invalid target.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.
Request
curl "http://localhost:8080/v1/alarms/watch"import requests
BASE_URL = "http://localhost:8080"
response = requests.get(f"{BASE_URL}/v1/alarms/watch")
response.raise_for_status()let base_url = "http://localhost:8080";
let response = reqwest::Client::new()
.get(format!("{base_url}/v1/alarms/watch"))
.send()
.await?
.error_for_status()?;Response
{
"alarm": "string",
"at": "string",
"by": "string",
"cause": "condition",
"component": "string",
"instance": "string",
"previous": "NORMAL",
"seq": 0,
"severity": "warning",
"shelved_until": "string",
"state": "NORMAL",
"target": "string",
"value": null
}{
"errors": [
{
"code": "string",
"message": "string",
"help": "string"
}
]
}{
"errors": [
{
"code": "string",
"message": "string",
"help": "string"
}
]
}/v1/alarms/{target}/{alarm}/{action}Command alarm#
Acknowledge, shelve or unshelve an alarm
acknowledge moves ACTIVE_UNACK to ACTIVE_ACK and CLEARED_UNACK to NORMAL; shelve silences the reactions of the alarm for a bounded duration (at most alarms.max_shelve); unshelve ends it. The command goes to the alarm service, traced with the identity of the operator.
Path parameters
targetrequiredstring
Target, as named in the topology (sim-1).
alarmrequiredstring
Alarm: tcu[TCU1].anode_voltage, or eps.undervoltage without instance.
actionrequiredstring
acknowledge, shelve or unshelve.
Request body application/json
For shelve only: its duration.
one of Shelve | null
Responses
400Invalid body, or no identity: api::anonymous.application/json
errorsrequiredarray of ErrorItem
Every error found.
ErrorItem · 3 fields
coderequiredstring
Stable code.
messagerequiredstring
Message for the operator.
helpstring
Suggested fix.
404Invalid target or alarm, or unknown command.application/json
errorsrequiredarray of ErrorItem
Every error found.
ErrorItem · 3 fields
coderequiredstring
Stable code.
messagerequiredstring
Message for the operator.
helpstring
Suggested fix.
409Refused: nothing to acknowledge, alarm not shelved or never recorded, duration out of bounds (alarm::refused).application/json
errorsrequiredarray of ErrorItem
Every error found.
ErrorItem · 3 fields
coderequiredstring
Stable code.
messagerequiredstring
Message for the operator.
helpstring
Suggested fix.
503No alarm service is running: alarm::no-service.application/json
errorsrequiredarray of ErrorItem
Every error found.
ErrorItem · 3 fields
coderequiredstring
Stable code.
messagerequiredstring
Message for the operator.
helpstring
Suggested fix.
504The alarm service did not answer: alarm::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 -X POST "http://localhost:8080/v1/alarms/<target>/<alarm>/<action>" \
-H "Content-Type: application/json" \
-d '{
"for": "30 min"
}' \
-o response.binimport requests
BASE_URL = "http://localhost:8080"
target = "<target>" # Target, as named in the topology (`sim-1`).
alarm = "<alarm>" # Alarm: `tcu[TCU1].anode_voltage`, or `eps.undervoltage` without instance.
action = "<action>" # `acknowledge`, `shelve` or `unshelve`.
response = requests.post(
f"{BASE_URL}/v1/alarms/{target}/{alarm}/{action}",
json={
"for": "30 min",
},
)
response.raise_for_status()
data = response.contentlet base_url = "http://localhost:8080";
let target = "<target>"; // Target, as named in the topology (`sim-1`).
let alarm = "<alarm>"; // Alarm: `tcu[TCU1].anode_voltage`, or `eps.undervoltage` without instance.
let action = "<action>"; // `acknowledge`, `shelve` or `unshelve`.
let response = reqwest::Client::new()
.post(format!("{base_url}/v1/alarms/{target}/{alarm}/{action}"))
.json(&serde_json::json!({
"for": "30 min"
}))
.send()
.await?
.error_for_status()?;
let bytes = response.bytes().await?;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"
}
]
}