set_server_state
Set an HAProxy server's admin state to ready, drain, or maint to adjust traffic handling, with dry-run preview and automatic undo of the previous state.
Instructions
[WRITE][risk=medium] Set an haproxy server's admin state (ready / drain / maint); reversible — the prior admin state is fetched first and the undo restores it.
drain finishes in-flight sessions but takes no new ones; maint removes the server immediately; ready returns it to rotation. On traefik/caddy this raises the support matrix's teaching error. Pass dry_run=True to preview.
Args: backend: Backend name (from list_services). server: Server name inside the backend (from list_upstreams). state: One of ready, drain, maint. dry_run: If True, preview without changing. target: Proxy target name from config; omit for the default.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| state | Yes | ||
| server | Yes | ||
| target | No | ||
| backend | Yes | ||
| dry_run | No |