Attach volume to VM
POST
/api/v1/volume/attach
const url = 'https://console.cloudlogics.com/api/v1/volume/attach';const options = { method: 'POST', headers: {Authorization: '<Authorization>', 'Content-Type': 'application/json'}, body: '{"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/attach \ --header 'Authorization: <Authorization>' \ --header 'Content-Type: application/json' \ --data '{ "vm_id": "example", "volume_id": "example" }'Attach a volume to a virtual machine
Authorizations
Section titled “Authorizations”Request Body
Section titled “Request Body”Attach volume request
Media typeapplication/json
object
vm_id
string
volume_id
string
Examplegenerated
{ "vm_id": "example", "volume_id": "example"}Responses
Section titled “Responses”Volume attached
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 }}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 }}