Attach volume
Method | URI | Description |
---|---|---|
POST | /v2/{tenant_id}/servers/{server_id}/os-volume_attachments | Attaches a volume to the specified server. |
Normal response codes: 200
Request
This table shows the URI parameters for the attach volume request:
Name | Type | Description |
---|---|---|
{tenant_id} | String | Project ID |
{server_id} | UUID | The UUID for the server of interest to you. |
{volumeId} | String | ID of the volume to attach. |
{device} | String | Name of the device such as, /dev/vdb. Use "auto" for auto-assign (if supported). |
{volumeAttachment} | String | A dictionary representation of a volume attachment. |
This table shows the body parameters for the attach volume request:
Name | Type | Description |
---|---|---|
volumeId | String | ID of the volume to attach. |
device | String | Name of the device such as, /dev/vdb. Use "null" for auto-assign (if supported). |
Example. Attach volume: JSON request
{
"volumeAttachment": {
"volumeId": "a26887c6-c47b-4654-abb5-dfadf7d3f803",
"device": null
}
}
Response
Example. Attach volume: JSON response
{
"volumeAttachment": {
"device": "/dev/vdd",
"id": "a26887c6-c47b-4654-abb5-dfadf7d3f803",
"serverId": "0c92f3f6-c253-4c9b-bd43-e880a8d2eb0a",
"volumeId": "a26887c6-c47b-4654-abb5-dfadf7d3f803"
}
}