PUT
/api/v1/block_storage/{block_id}/vm/attach/
curl --request PUT \ --url 'https://api.e2enetworks.com/myaccount/api/v1/block_storage/{block_id}/vm/attach/?project_id=<PROJECT_ID>&apikey=<API_KEY>&location=<LOCATION>' \ --header 'Authorization: Bearer <API_TOKEN>' \ --header 'Content-Type: application/json' \ --data '"{\n \"vm_id\": {{vm_id}}\n}"'import requests
response = requests.put( "https://api.e2enetworks.com/myaccount/api/v1/block_storage/{block_id}/vm/attach/", params={"project_id": "<PROJECT_ID>", "apikey": "<API_KEY>", "location": "<LOCATION>"}, headers={"Authorization": "Bearer <API_TOKEN>"}, json="{\n \"vm_id\": {{vm_id}}\n}",)print(response.json())const url = new URL("https://api.e2enetworks.com/myaccount/api/v1/block_storage/{block_id}/vm/attach/");url.search = new URLSearchParams({ project_id: "<PROJECT_ID>", apikey: "<API_KEY>", location: "<LOCATION>" });
const response = await fetch(url, { method: "PUT", headers: { "Authorization": "Bearer <API_TOKEN>", "Content-Type": "application/json" }, body: JSON.stringify("{\n \"vm_id\": {{vm_id}}\n}"),});console.log(await response.json());curl --request PUT \ --url 'https://api.e2enetworks.com/myaccount/api/v1/block_storage/{block_id}/vm/attach/?project_id=<PROJECT_ID>&location=<LOCATION>&apikey=<API_KEY>' \ --header 'Authorization: Bearer <API_TOKEN>' \ --header 'Content-Type: application/json' \ --data '{ "vm_id": 100157}'import requests
response = requests.put( "https://api.e2enetworks.com/myaccount/api/v1/block_storage/{block_id}/vm/attach/", params={"project_id": "<PROJECT_ID>", "location": "<LOCATION>", "apikey": "<API_KEY>"}, headers={"Authorization": "Bearer <API_TOKEN>"}, json={ "vm_id": 100157, },)print(response.json())const url = new URL("https://api.e2enetworks.com/myaccount/api/v1/block_storage/{block_id}/vm/attach/");url.search = new URLSearchParams({ project_id: "<PROJECT_ID>", location: "<LOCATION>", apikey: "<API_KEY>" });
const response = await fetch(url, { method: "PUT", headers: { "Authorization": "Bearer <API_TOKEN>", "Content-Type": "application/json" }, body: JSON.stringify({ "vm_id": 100157 }),});console.log(await response.json());Attach Volume and Attach Volume to Node share this request; the body you send decides which one runs.
Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”block_id
required
string
Path parameter block_id.
Query Parameters
Section titled “Query Parameters”project_id
required
integer
Identifier of the project to scope the request to. Required integer project ID.
Example
<PROJECT_ID>apikey
required
string
API key used to authenticate the request
Example
<API_KEY>location
required
string
Specifies the target location for attaching the volume
Example
<LOCATION>Request Body
Section titled “Request Body”Responses
Section titled “Responses”Successful response
Media typeapplication/json
object
code
HTTP status code indicating the result of the attach volume request
integer
data
object
image_id
Unique identifier of the attached image
integer
vm_id
Identifier of the virtual machine
integer
errors
object
message
Human-readable status message for the attach volume operation.
string
Example
{ "code": 200, "data": { "image_id": 1234, "vm_id": 1234 }, "message": "Block Storage is Attached to VM."}