drain_replica
Check whether a specific Ray Serve replica can be drained. Since REST API lacks per-replica drain, reports unavailability and directs you to scale down the deployment instead.
Instructions
[WRITE][risk=high] Drain one replica — NOT available over Ray's REST API.
Ray Serve exposes no per-replica drain endpoint (only the whole-cluster declarative config); individual-replica draining is a Python-API capability only. This tool refuses with a teaching error. To retire surplus replicas, scale the deployment down — the controller drains them gracefully. The dry_run preview reports the same unavailability rather than a false green.
Args: application: Serve application name. deployment: Deployment name. replica_id: Replica id (from replica_list). dry_run: If True, report availability without attempting a drain. target: Inference target name from config; omit for the default.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| target | No | ||
| dry_run | No | ||
| deployment | Yes | ||
| replica_id | Yes | ||
| application | Yes |