Preview replacing a data disk
POST/disks/array/replace/plan
Required role: admin. Only an account or token with the admin role can call this operation.
curl --request POST \
--header "Authorization: Bearer $HOSERVA_TOKEN" \
--header "Content-Type: application/json" \
--data @body.json \
"https://$HOSERVA_HOST:8008/api/v1/disks/array/replace/plan"
Computes the replace plan: the replacement's own identity (model, WWN or serial, size, its existing filesystem if any), the SnapRAID fix command that reconstructs the slot's contents after it is formatted, and the exact typed confirmation replaceDisk requires. Refuses (slot_disk_present) unless the slot's own recorded disk is genuinely gone — not merely unmounted, but absent from a fresh disk inventory by identity (a healthy disk goes through the upgrade flow instead) — and a replacement that would leave a parity disk smaller than the array's largest data disk. Refuses (disk_leaving_array, 409) a slot whose disk is still evacuating or already unlisted: the replacement would inherit that state. A slot that is evacuated or unpooled is allowed once the slot's own disk is genuinely missing, refused with slot_disk_present otherwise like any other slot — replace abandons the removal and rebuilds the disk's recorded files from parity. Read-only: nothing is formatted or persisted.
Request
Responses
- 200
- default
The replace plan.
An error response.