brama subscription lease release¶
End one lease by its id, or every live lease of one session: the session's terminal ended, so its subscription carries one session fewer and the next lease can go there. Releasing what is not live is not an error: a release the caller repeats releases nothing and says so.
Invocation¶
brama subscription lease release (--lease-id <ID> | --session-id <ID>) (--gateway <ORIGIN> | --gateway-consumer <NAME>) [--bearer-role <ROLE>] [--agent <AGENT> --signing-role <ROLE#FIELD>] [--json]
| Input | Required/default | Meaning |
|---|---|---|
--lease-id <ID> | one of the two required | The lease to end, as take printed it. |
--session-id <ID> | one of the two required | The session whose every live lease ends. |
--gateway <ORIGIN> or --gateway-consumer <NAME> | one required | The gateway that holds the pool (DELETE /v1/subscription-pool/leases). The console bearer is read from stdin, or from the vault item playing --bearer-role. |
--agent <AGENT> --signing-role <ROLE#FIELD> | optional pair; neither defaults | Prove the caller that may end its own leases. Brama reads the signing secret from the vault for this request and never prints or transmits it. |
--json | optional; off | Print {released: [lease...]} instead of lines. |
Output and state¶
One line per lease released, then released <n>; or nothing was live under that name; nothing released. The gateway removes the released leases from its register.
Refusals¶
Naming neither a lease nor a session is refused by the parser before any request. A gateway refusal exits 1 and prints the HTTP status, request path and full response body, including a non-JSON error; an unreadable body is reported as such. 400 invalid_request when the body names nothing (a release names the lease id or the session_id whose leases end), 403 when a signed agent or an account holder names a lease another identity took (lease <id> was taken by another identity; <agent> may end only the leases it took, and nothing was released), 503 with the cause when the register cannot be read or written. The console bearer ends every lease. Without a gateway: a lease lives on the gateway that holds the pool: name --gateway or --gateway-consumer.
Signing requires both --agent and --signing-role ROLE#FIELD. A malformed coordinate or failed Stado credential lookup is refused before the request; an invalid signature or another agent's lease is refused by the gateway without changing the register.
The real console journey is tests/subscriptions/journeys/leases.sh; the signed cross-owner refusal and persisted final state are exercised by tests/subscriptions/leases/ownership.rs. See the command group or the CLI tree.