Statuses
Create, set, find, and delete statuses, and read their notifications.
A status is a named record of the current condition of one thing, such as “Tank pressure”. Arc automations, scripts, tasks, and people set statuses, and the Synnax Console shows each change as a notification. Statuses are the base of alarms in Synnax.
Set a status
Setting a status with a key that already exists replaces the whole status. Give every field each time, or the fields that you leave out become empty.
Console
Python
TypeScript
Arc
- Run the “Create status” command from the command palette, or click in the statuses toolbar or the status explorer.
- Enter a name, then select a Variant and enter a Message.
- Optional: select labels.
- Click Create.
import synnax as sy
client.statuses.set(
sy.Status(
key="tank-pressure",
name="Tank pressure",
variant="warning",
message="Above 600 psi",
description="Vent the tank before you continue.",
)
)await client.statuses.set({
key: "tank-pressure",
name: "Tank pressure",
variant: "warning",
message: "Above 600 psi",
description: "Vent the tank before you continue.",
});An Arc automation sets a status when a condition
is true. status.set finds the status by its key or its name, and creates it when none
matches:
import status
tank_pressure > 600.0 => status.set{
key_or_name="tank-pressure",
variant="warning",
message="Tank pressure is above 600 psi",
}To set the status once for each change, and to clear it, see Arc alarms.
Find statuses
Console
Python
TypeScript
Press S or click on the left side of the Console to open the statuses toolbar. It shows your favorite statuses with their variant, name, message, labels, and the time since their last change.
To see every status, run the “Open status explorer” command, or click the explore button in the statuses toolbar. In the explorer, search by name and filter by label and by variant.
status = client.statuses.retrieve(key="tank-pressure")
errors = client.statuses.retrieve(variants=["error"])const status = await client.statuses.retrieve("tank-pressure");Rename, favorite, or delete statuses
Console
Python
TypeScript
In the status explorer, right-click one or more statuses and select:
- Rename -> change the name.
- Favorite or Unfavorite -> add them to the statuses toolbar or remove them.
- Copy diagnostics -> copy the details to the clipboard.
- Delete -> delete them, after you confirm.
client.statuses.rename("tank-pressure", "Main tank pressure")
client.statuses.delete("tank-pressure")await client.statuses.rename("tank-pressure", "Main tank pressure");
await client.statuses.delete("tank-pressure");Notifications
When a status changes, the Console shows a notification in the corner of the window.
- The Console shows notifications only while it is connected to the Core.
- A notification closes 7 seconds after the time of the status.
- The Console shows one notification for each status key. A new change replaces it.
- Different statuses with the same name, variant, message, and description merge into one notification with a count.
- The Console shows up to four notifications. Click +N more to see the rest, and Clear all to close them.
- When you close a notification, the Console does not show that status again until you restart it.
Tasks, Drivers, and devices set statuses too. The Console does not show their success, loading, and disabled statuses, so routine changes do not fill the screen.