Detach a cloud volume from a cloud instance

POST/v1/cloud_block_storage/volumes/{volume_id}/detach

If you want to detach a volume from an instance, make a POST request to the /v1/cloud_block_storage/volumes/{volume_id}/detach endpoint. Use the path parameter to specify a volume and a query parameter for the instance ID.

Authorization

bearerAuth
AuthorizationBearer <token>

In: header

Path Parameters

volume_id*string

A unique identifier of a volume.

Request Body

application/json

Response Body

application/json

application/json

application/json

curl -X POST "https://example.com/v1/cloud_block_storage/volumes/4zbq2dpr/detach" \  -H "Content-Type: application/json" \  -d '{    "instance_id": "Jxbojagw"  }'
{  "id": "4zbq2dpr",  "openstack_uuid": "2dffd521-b1a2-46ff-a57b-de99a96cb8c5",  "region_id": 0,  "region_code": "NL01",  "name": "name123",  "size": 1,  "status": "detaching",  "created_at": "2024-10-17T10:00:00Z",  "bootable": false,  "labels": {},  "attachments": [    {      "instance_id": "Jxbojagw",      "instance_name": "name124",      "device": "/dev/hdd0",      "id": "2dffd521-b1a2-46ff-a57b-de99a96cb8c5"    }  ],  "description": null}
{  "message": "Cannot 'detach_volume' instance task_state deleting",  "code": "INVALID_INSTANCE"}
{  "message": "Region in maintenance mode",  "code": "CLOUD_REGION_MAINTENANCE"}