Detach volume from VM
POST
/api/v1/volume/detach
const url = 'https://console.cloudlogics.com/api/v1/volume/detach';const options = { method: 'POST', headers: {Authorization: '<Authorization>', 'Content-Type': 'application/json'}, body: '{"flush_confirmed":true,"vm_id":"example","volume_id":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://console.cloudlogics.com/api/v1/volume/detach \ --header 'Authorization: <Authorization>' \ --header 'Content-Type: application/json' \ --data '{ "flush_confirmed": true, "vm_id": "example", "volume_id": "example" }'Detach a volume from a virtual machine Requires flush_confirmed=true: the volume must be unmounted inside the guest first, as the platform cannot flush it remotely.
Authorizations
Section titled “Authorizations”Request Body
Section titled “Request Body”Detach volume request
Media typeapplication/json
object
flush_confirmed
FlushConfirmed is the caller’s statement that the volume has been unmounted, or at least synced, inside the guest. The portal collects it with a confirmation dialog, the same way it does for deletes.
boolean
vm_id
string
volume_id
string
Examplegenerated
{ "flush_confirmed": true, "vm_id": "example", "volume_id": "example"}Responses
Section titled “Responses”Volume detached
Media typeapplication/json
string
Examplegenerated
exampleBad request
Media typeapplication/json
object
data
error
object
code
integer
message
string
page
object
next
string
prev
string
total_size
integer
Examplegenerated
{ "data": "example", "error": { "code": 1, "message": "example" }, "page": { "next": "example", "prev": "example", "total_size": 1 }}Volume or virtual machine not found in this project
Media typeapplication/json
object
data
error
object
code
integer
message
string
page
object
next
string
prev
string
total_size
integer
Examplegenerated
{ "data": "example", "error": { "code": 1, "message": "example" }, "page": { "next": "example", "prev": "example", "total_size": 1 }}Flush not confirmed
Media typeapplication/json
object
data
error
object
code
integer
message
string
page
object
next
string
prev
string
total_size
integer
Examplegenerated
{ "data": "example", "error": { "code": 1, "message": "example" }, "page": { "next": "example", "prev": "example", "total_size": 1 }}Internal server error
Media typeapplication/json
object
data
error
object
code
integer
message
string
page
object
next
string
prev
string
total_size
integer
Examplegenerated
{ "data": "example", "error": { "code": 1, "message": "example" }, "page": { "next": "example", "prev": "example", "total_size": 1 }}