# 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](https://docs.synnaxlabs.com/reference/alarms) in Synnax.

## Set a status

Setting a status with a key that already exists replaces every field except its labels. Give every other field each time, or the fields that you leave out become empty.

**Console**

1. Run the “Create status” command from the [command palette](https://docs.synnaxlabs.com/reference/get-started/ui-overview#search-and-command-palette), or click in the statuses toolbar or the status explorer.
2. Enter a name, then select a **Variant** and enter a **Message**.
3. Optional: select labels.
4. Click **Create**.

[](https://synnax.nyc3.cdn.digitaloceanspaces.com/docs/console/statuses/create/a657f5956868-dark.mp4#t=0.001)

**Python**

```python
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.",
    )
)
```

**TypeScript**

```typescript
await client.statuses.set({
  key: "tank-pressure",
  name: "Tank pressure",
  variant: "warning",
  message: "Above 600 psi",
  description: "Vent the tank before you continue.",
});
```

**Arc**

An [Arc automation](https://docs.synnaxlabs.com/reference/control/arc) 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:

```arc
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](https://docs.synnaxlabs.com/reference/alarms/arc).

## Find statuses

**Console**

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.

**Python**

```python
status = client.statuses.retrieve(key="tank-pressure")
errors = client.statuses.retrieve(variant="error")
tank = client.statuses.retrieve(search_term="tank", limit=10)
```

**TypeScript**

```typescript
const status = await client.statuses.retrieve("tank-pressure");
const errors = await client.statuses.retrieve({ variant: "error" });
const tank = await client.statuses.retrieve({ searchTerm: "tank", limit: 10 });
```

## Rename, favorite, or delete statuses

**Console**

In the status explorer, right-click one or more statuses and select:

* **Rename** -> change the name of one status.
* **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.

**Python**

```python
client.statuses.rename("tank-pressure", "Main tank pressure")
client.statuses.delete("tank-pressure")
```

**TypeScript**

```typescript
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 Console gets 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, devices, and calculated channels set statuses too. The Console shows only their warnings and errors, and only for things that are in use:

* A device is in use when it is configured.
* A Driver scanner, which looks for one kind of device, is in use when its Driver has a configured device of that kind.
* Every other task, each Driver, and each calculated channel is always in use.

A warning from a task, device, or Driver shows only if it does not clear within 5 seconds.

When you send a command to a task, such as start or stop, the Console shows the answer unless it is a success, loading, or disabled status.

## Reference

### Fields

| Field       | Required | Description                                                                                                     |
| ----------- | -------- | --------------------------------------------------------------------------------------------------------------- |
| Key         |          | The unique ID of the status. Synnax makes one when you leave it out.                                            |
| Name        |          | What the status is about, such as “Tank pressure”.                                                              |
| Variant     |          | The kind of condition. See [variants](https://docs.synnaxlabs.com/reference/alarms/statuses#variants).          |
| Message     |          | What happened, or the current state, in one short line.                                                         |
| Description |          | Why, and what to do now, in full sentences.                                                                     |
| Time        |          | The time of the change. The default is now.                                                                     |
| Details     |          | Extra data in JSON, such as the value that set off the alarm.                                                   |
| Labels      |          | Labels that group related statuses. See [labels](https://docs.synnaxlabs.com/reference/alarms/statuses#labels). |

### Labels

Labels group related statuses. Give a status its labels when you create it: select them in the Console, or set `labels` in code. A later set keeps the stored labels. To change the labels of a status that exists, use the label client:

**Python**

```python
client.labels.label(sy.status.resource_id("tank-pressure"), label.key)
```

**TypeScript**

```typescript
await client.labels.label(status.resourceID("tank-pressure"), [label.key]);
```

### Variants

| Variant  | Use it for                                      |
| -------- | ----------------------------------------------- |
| Success  | A nominal condition, or a problem that cleared. |
| Info     | Information that needs no action.               |
| Warning  | A condition that needs attention.               |
| Error    | A failure or a condition out of limits.         |
| Loading  | An operation that is in progress.               |
| Disabled | A part of the system that is not active.        |
