Skip to content

Detach Volumes From Virtual Machine

Detaches one volume currently attached to a virtual machine. Include the virtual machine ID and volume id in the path to detach the specified volume from the designated virtual machine.

HTTP Request

DELETE {API_URL}/virtual-machines/{virtual_machine_id}/volumes/{volume_id}

Path parameters

ParametersRequirementsTypeDescription
virtual_machine_idRequiredstringThe ID of the virtual machine the volumes are being detached from.
volume_idRequiredstringThe unique identifier of the volumes to be detached from the virtual machine.

Reponse Attributes

status boolean

Indicates the status of the volume detachment request. A status of true indicates success. while false indicates an error.

message string

A message describing the status of the volume detachment.

data array

An object consisting of details on each of the volumes that remain attached to the virtual machine.

Example

Request

curl -X DELETE '{API_URL}/virtual-machines/{virtual_machine_id}/volumes/{volume_id}' \
-H 'Authorization: Bearer {ACCESS_TOKEN}' \
-H 'refresh-token: {REFRESH_TOKEN}' \
-H 'Content-Type: application/json'

Response

{
    "status": true,
    "message": "Detaching volume from virtual machine successful",
    "data": {
        "_id": "68959ac22b54490029aa2ce9",
        "volume_id": "689598902b54490029aa25c9",
        "status": "detaching"
    }
}