set_server_weight
Set an HAProxy server's load-balancing weight to control traffic, with dry-run and undo for safe reversible changes.
Instructions
[WRITE][risk=medium] Set an haproxy server's load-balancing weight (0-256); reversible — the prior weight is fetched first and the undo restores it.
Weight 0 stops new traffic to the server without a state change. 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). weight: New weight, 0-256. dry_run: If True, preview without changing. target: Proxy target name from config; omit for the default.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| server | Yes | ||
| target | No | ||
| weight | Yes | ||
| backend | Yes | ||
| dry_run | No |