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:
parent
06b303aff2
commit
71d360c9d2
1 changed files with 187 additions and 1 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue