Watch
0
0
Fork
You've already forked hyperhive
0

swarmctl: agent set-state declares an agent's wanted state

Wraps PUT /api/hives/{hive}/agents/{agent}/state, the route the swarm UI's
state menu uses. States come from swarm_wire::wanted::AgentState; destroyed
needs --yes.

Closes #6159
This commit is contained in:
atlas 2026-11-07 03:58:39 +01:00 • committed by mara
commit 71d360c9d2

View file

@ -133,6 +133,19 @@ agent's forge token and mints it if it's missing or stale. The controller
already does this for every agent with a store identity at start and every
five minutes; this verb skips the wait. Queues and returns.
## `agent set-state`
```console
# swarmctl agent set-state ruth --hive alpha paused
declared agent "ruth" paused on hive "alpha"; the hive converges on its own clock
```
`PUT /api/hives/{hive}/agents/{agent}/state` on the swarm-controller, the route
the swarm UI's state menu uses. The values are `swarm_wire::wanted::AgentState`'s:
`up`, `offline`, `paused`, `destroyed`. It never creates an agent: the controller
refuses an agent the swarm hasn't declared on that hive. `destroyed` can't be
undone, so it needs `--yes`.
## `forge make-admin`
```console