Attaching a Disk to an ECS
Function
This API is used to attach a disk to an ECS.
URI
POST /v1/{project_id}/cloudservers/{server_id}/attachvolume
|
Parameter |
Mandatory |
Description |
|---|---|---|
|
project_id |
Yes |
Specifies the project ID. For details about how to obtain the ID, see Obtaining a Project ID. |
|
server_id |
Yes |
Specifies the ECS ID. |
Request
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
volumeAttachment |
Yes |
Object |
Specifies the disk attached to an ECS. |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
volumeId |
Yes |
String |
Specifies the ID of the disk to be attached. The value is in UUID format. |
|
device |
No |
String |
Indicates the disk device name.
NOTE:
|
Response
See Responses (Task).
Example Request
POST https://{endpoint}/v1/{project_id}/cloudservers/{server_id}/attachvolume
{
"volumeAttachment": {
"volumeId": "a26887c6-c47b-4654-abb5-dfadf7d3f803",
"device": "/dev/sda"
}
}
Example Response
{
"job_id": "70a599e0-31e7-49b7-b260-868f441e862b"
}
Returned Values
Error Codes
Last Article: Querying Information About the Disks Attached to an ECS
Next Article: Detaching an EVS Disk from an ECS
Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.