Attach a cloud volume to a cloud instance

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

Use a POST request to /v1/cloud_block_storage/volumes/{volume_id}/attach for attaching a volume to the instance. The volume ID has to be specified in the path parameter; the instance ID should be mentioned in the query parameter.

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

application/json

curl -X POST "https://example.com/v1/cloud_block_storage/volumes/MvbmOeYA/attach" \  -H "Content-Type: application/json" \  -d '{    "instance_id": "pmbk5ezJ"  }'
{  "id": "MvbmOeYA",  "openstack_uuid": "21a3ceb3-c0ed-411d-80dd-ff2ceaa3898d",  "region_id": 0,  "region_code": "NL01",  "name": "name115",  "size": 1,  "status": "attaching",  "created_at": "2024-10-17T10:00:00Z",  "bootable": false,  "labels": {},  "attachments": [    {      "instance_id": "pmbk5ezJ",      "instance_name": "name116",      "device": "/dev/hdd0",      "id": "21a3ceb3-c0ed-411d-80dd-ff2ceaa3898d"    }  ],  "description": null}
{  "message": "Volume state is not valid for the requested action",  "code": "INVALID_VOLUME"}
{  "message": "Validation failed",  "code": "UNPROCESSABLE_ENTITY",  "errors": {    "instance_id": "in different region"  }}
{  "message": "Region in maintenance mode",  "code": "CLOUD_REGION_MAINTENANCE"}