curl --request POST \
--url https://api.cloud.onidel.com/vm \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "vm-hostname",
"instance_type": "ea645d53-c0e5-406d-8863-9ecd4235be94",
"location": "Sydney",
"cpu": 2,
"ram": 4096,
"disk": 40,
"os": 2,
"snapshot_id": "53959c6e-73d5-4476-9b19-d78fb8efac2c",
"iso_id": "7c1f2a90-4b3d-4e21-9a8c-1d2e3f4a5b6c",
"team_id": "6484a164-d355-4947-ac2c-e8c09fb24fb0",
"ssh_keys": [
"a3f2e5d8-1234-4abc-9876-543210fedcba"
],
"vpcs": [
"f5a3e2d8-9876-4abc-1234-543210fedcba"
],
"firewall_group_id": "e4d3c2b1-5678-9abc-def0-fedcba098765",
"ipv6": false,
"disable_ssh_blocking": false,
"startup_script_id": "b7e3f1a2-5678-4def-abcd-123456789abc"
}
'import requests
url = "https://api.cloud.onidel.com/vm"
payload = {
"name": "vm-hostname",
"instance_type": "ea645d53-c0e5-406d-8863-9ecd4235be94",
"location": "Sydney",
"cpu": 2,
"ram": 4096,
"disk": 40,
"os": 2,
"snapshot_id": "53959c6e-73d5-4476-9b19-d78fb8efac2c",
"iso_id": "7c1f2a90-4b3d-4e21-9a8c-1d2e3f4a5b6c",
"team_id": "6484a164-d355-4947-ac2c-e8c09fb24fb0",
"ssh_keys": ["a3f2e5d8-1234-4abc-9876-543210fedcba"],
"vpcs": ["f5a3e2d8-9876-4abc-1234-543210fedcba"],
"firewall_group_id": "e4d3c2b1-5678-9abc-def0-fedcba098765",
"ipv6": False,
"disable_ssh_blocking": False,
"startup_script_id": "b7e3f1a2-5678-4def-abcd-123456789abc"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'vm-hostname',
instance_type: 'ea645d53-c0e5-406d-8863-9ecd4235be94',
location: 'Sydney',
cpu: 2,
ram: 4096,
disk: 40,
os: 2,
snapshot_id: '53959c6e-73d5-4476-9b19-d78fb8efac2c',
iso_id: '7c1f2a90-4b3d-4e21-9a8c-1d2e3f4a5b6c',
team_id: '6484a164-d355-4947-ac2c-e8c09fb24fb0',
ssh_keys: ['a3f2e5d8-1234-4abc-9876-543210fedcba'],
vpcs: ['f5a3e2d8-9876-4abc-1234-543210fedcba'],
firewall_group_id: 'e4d3c2b1-5678-9abc-def0-fedcba098765',
ipv6: false,
disable_ssh_blocking: false,
startup_script_id: 'b7e3f1a2-5678-4def-abcd-123456789abc'
})
};
fetch('https://api.cloud.onidel.com/vm', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.cloud.onidel.com/vm",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'vm-hostname',
'instance_type' => 'ea645d53-c0e5-406d-8863-9ecd4235be94',
'location' => 'Sydney',
'cpu' => 2,
'ram' => 4096,
'disk' => 40,
'os' => 2,
'snapshot_id' => '53959c6e-73d5-4476-9b19-d78fb8efac2c',
'iso_id' => '7c1f2a90-4b3d-4e21-9a8c-1d2e3f4a5b6c',
'team_id' => '6484a164-d355-4947-ac2c-e8c09fb24fb0',
'ssh_keys' => [
'a3f2e5d8-1234-4abc-9876-543210fedcba'
],
'vpcs' => [
'f5a3e2d8-9876-4abc-1234-543210fedcba'
],
'firewall_group_id' => 'e4d3c2b1-5678-9abc-def0-fedcba098765',
'ipv6' => false,
'disable_ssh_blocking' => false,
'startup_script_id' => 'b7e3f1a2-5678-4def-abcd-123456789abc'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.cloud.onidel.com/vm"
payload := strings.NewReader("{\n \"name\": \"vm-hostname\",\n \"instance_type\": \"ea645d53-c0e5-406d-8863-9ecd4235be94\",\n \"location\": \"Sydney\",\n \"cpu\": 2,\n \"ram\": 4096,\n \"disk\": 40,\n \"os\": 2,\n \"snapshot_id\": \"53959c6e-73d5-4476-9b19-d78fb8efac2c\",\n \"iso_id\": \"7c1f2a90-4b3d-4e21-9a8c-1d2e3f4a5b6c\",\n \"team_id\": \"6484a164-d355-4947-ac2c-e8c09fb24fb0\",\n \"ssh_keys\": [\n \"a3f2e5d8-1234-4abc-9876-543210fedcba\"\n ],\n \"vpcs\": [\n \"f5a3e2d8-9876-4abc-1234-543210fedcba\"\n ],\n \"firewall_group_id\": \"e4d3c2b1-5678-9abc-def0-fedcba098765\",\n \"ipv6\": false,\n \"disable_ssh_blocking\": false,\n \"startup_script_id\": \"b7e3f1a2-5678-4def-abcd-123456789abc\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.cloud.onidel.com/vm")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"vm-hostname\",\n \"instance_type\": \"ea645d53-c0e5-406d-8863-9ecd4235be94\",\n \"location\": \"Sydney\",\n \"cpu\": 2,\n \"ram\": 4096,\n \"disk\": 40,\n \"os\": 2,\n \"snapshot_id\": \"53959c6e-73d5-4476-9b19-d78fb8efac2c\",\n \"iso_id\": \"7c1f2a90-4b3d-4e21-9a8c-1d2e3f4a5b6c\",\n \"team_id\": \"6484a164-d355-4947-ac2c-e8c09fb24fb0\",\n \"ssh_keys\": [\n \"a3f2e5d8-1234-4abc-9876-543210fedcba\"\n ],\n \"vpcs\": [\n \"f5a3e2d8-9876-4abc-1234-543210fedcba\"\n ],\n \"firewall_group_id\": \"e4d3c2b1-5678-9abc-def0-fedcba098765\",\n \"ipv6\": false,\n \"disable_ssh_blocking\": false,\n \"startup_script_id\": \"b7e3f1a2-5678-4def-abcd-123456789abc\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.cloud.onidel.com/vm")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"vm-hostname\",\n \"instance_type\": \"ea645d53-c0e5-406d-8863-9ecd4235be94\",\n \"location\": \"Sydney\",\n \"cpu\": 2,\n \"ram\": 4096,\n \"disk\": 40,\n \"os\": 2,\n \"snapshot_id\": \"53959c6e-73d5-4476-9b19-d78fb8efac2c\",\n \"iso_id\": \"7c1f2a90-4b3d-4e21-9a8c-1d2e3f4a5b6c\",\n \"team_id\": \"6484a164-d355-4947-ac2c-e8c09fb24fb0\",\n \"ssh_keys\": [\n \"a3f2e5d8-1234-4abc-9876-543210fedcba\"\n ],\n \"vpcs\": [\n \"f5a3e2d8-9876-4abc-1234-543210fedcba\"\n ],\n \"firewall_group_id\": \"e4d3c2b1-5678-9abc-def0-fedcba098765\",\n \"ipv6\": false,\n \"disable_ssh_blocking\": false,\n \"startup_script_id\": \"b7e3f1a2-5678-4def-abcd-123456789abc\"\n}"
response = http.request(request)
puts response.read_bodyProvision a new VM
Provision a new VM
curl --request POST \
--url https://api.cloud.onidel.com/vm \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "vm-hostname",
"instance_type": "ea645d53-c0e5-406d-8863-9ecd4235be94",
"location": "Sydney",
"cpu": 2,
"ram": 4096,
"disk": 40,
"os": 2,
"snapshot_id": "53959c6e-73d5-4476-9b19-d78fb8efac2c",
"iso_id": "7c1f2a90-4b3d-4e21-9a8c-1d2e3f4a5b6c",
"team_id": "6484a164-d355-4947-ac2c-e8c09fb24fb0",
"ssh_keys": [
"a3f2e5d8-1234-4abc-9876-543210fedcba"
],
"vpcs": [
"f5a3e2d8-9876-4abc-1234-543210fedcba"
],
"firewall_group_id": "e4d3c2b1-5678-9abc-def0-fedcba098765",
"ipv6": false,
"disable_ssh_blocking": false,
"startup_script_id": "b7e3f1a2-5678-4def-abcd-123456789abc"
}
'import requests
url = "https://api.cloud.onidel.com/vm"
payload = {
"name": "vm-hostname",
"instance_type": "ea645d53-c0e5-406d-8863-9ecd4235be94",
"location": "Sydney",
"cpu": 2,
"ram": 4096,
"disk": 40,
"os": 2,
"snapshot_id": "53959c6e-73d5-4476-9b19-d78fb8efac2c",
"iso_id": "7c1f2a90-4b3d-4e21-9a8c-1d2e3f4a5b6c",
"team_id": "6484a164-d355-4947-ac2c-e8c09fb24fb0",
"ssh_keys": ["a3f2e5d8-1234-4abc-9876-543210fedcba"],
"vpcs": ["f5a3e2d8-9876-4abc-1234-543210fedcba"],
"firewall_group_id": "e4d3c2b1-5678-9abc-def0-fedcba098765",
"ipv6": False,
"disable_ssh_blocking": False,
"startup_script_id": "b7e3f1a2-5678-4def-abcd-123456789abc"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'vm-hostname',
instance_type: 'ea645d53-c0e5-406d-8863-9ecd4235be94',
location: 'Sydney',
cpu: 2,
ram: 4096,
disk: 40,
os: 2,
snapshot_id: '53959c6e-73d5-4476-9b19-d78fb8efac2c',
iso_id: '7c1f2a90-4b3d-4e21-9a8c-1d2e3f4a5b6c',
team_id: '6484a164-d355-4947-ac2c-e8c09fb24fb0',
ssh_keys: ['a3f2e5d8-1234-4abc-9876-543210fedcba'],
vpcs: ['f5a3e2d8-9876-4abc-1234-543210fedcba'],
firewall_group_id: 'e4d3c2b1-5678-9abc-def0-fedcba098765',
ipv6: false,
disable_ssh_blocking: false,
startup_script_id: 'b7e3f1a2-5678-4def-abcd-123456789abc'
})
};
fetch('https://api.cloud.onidel.com/vm', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.cloud.onidel.com/vm",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'vm-hostname',
'instance_type' => 'ea645d53-c0e5-406d-8863-9ecd4235be94',
'location' => 'Sydney',
'cpu' => 2,
'ram' => 4096,
'disk' => 40,
'os' => 2,
'snapshot_id' => '53959c6e-73d5-4476-9b19-d78fb8efac2c',
'iso_id' => '7c1f2a90-4b3d-4e21-9a8c-1d2e3f4a5b6c',
'team_id' => '6484a164-d355-4947-ac2c-e8c09fb24fb0',
'ssh_keys' => [
'a3f2e5d8-1234-4abc-9876-543210fedcba'
],
'vpcs' => [
'f5a3e2d8-9876-4abc-1234-543210fedcba'
],
'firewall_group_id' => 'e4d3c2b1-5678-9abc-def0-fedcba098765',
'ipv6' => false,
'disable_ssh_blocking' => false,
'startup_script_id' => 'b7e3f1a2-5678-4def-abcd-123456789abc'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.cloud.onidel.com/vm"
payload := strings.NewReader("{\n \"name\": \"vm-hostname\",\n \"instance_type\": \"ea645d53-c0e5-406d-8863-9ecd4235be94\",\n \"location\": \"Sydney\",\n \"cpu\": 2,\n \"ram\": 4096,\n \"disk\": 40,\n \"os\": 2,\n \"snapshot_id\": \"53959c6e-73d5-4476-9b19-d78fb8efac2c\",\n \"iso_id\": \"7c1f2a90-4b3d-4e21-9a8c-1d2e3f4a5b6c\",\n \"team_id\": \"6484a164-d355-4947-ac2c-e8c09fb24fb0\",\n \"ssh_keys\": [\n \"a3f2e5d8-1234-4abc-9876-543210fedcba\"\n ],\n \"vpcs\": [\n \"f5a3e2d8-9876-4abc-1234-543210fedcba\"\n ],\n \"firewall_group_id\": \"e4d3c2b1-5678-9abc-def0-fedcba098765\",\n \"ipv6\": false,\n \"disable_ssh_blocking\": false,\n \"startup_script_id\": \"b7e3f1a2-5678-4def-abcd-123456789abc\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.cloud.onidel.com/vm")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"vm-hostname\",\n \"instance_type\": \"ea645d53-c0e5-406d-8863-9ecd4235be94\",\n \"location\": \"Sydney\",\n \"cpu\": 2,\n \"ram\": 4096,\n \"disk\": 40,\n \"os\": 2,\n \"snapshot_id\": \"53959c6e-73d5-4476-9b19-d78fb8efac2c\",\n \"iso_id\": \"7c1f2a90-4b3d-4e21-9a8c-1d2e3f4a5b6c\",\n \"team_id\": \"6484a164-d355-4947-ac2c-e8c09fb24fb0\",\n \"ssh_keys\": [\n \"a3f2e5d8-1234-4abc-9876-543210fedcba\"\n ],\n \"vpcs\": [\n \"f5a3e2d8-9876-4abc-1234-543210fedcba\"\n ],\n \"firewall_group_id\": \"e4d3c2b1-5678-9abc-def0-fedcba098765\",\n \"ipv6\": false,\n \"disable_ssh_blocking\": false,\n \"startup_script_id\": \"b7e3f1a2-5678-4def-abcd-123456789abc\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.cloud.onidel.com/vm")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"vm-hostname\",\n \"instance_type\": \"ea645d53-c0e5-406d-8863-9ecd4235be94\",\n \"location\": \"Sydney\",\n \"cpu\": 2,\n \"ram\": 4096,\n \"disk\": 40,\n \"os\": 2,\n \"snapshot_id\": \"53959c6e-73d5-4476-9b19-d78fb8efac2c\",\n \"iso_id\": \"7c1f2a90-4b3d-4e21-9a8c-1d2e3f4a5b6c\",\n \"team_id\": \"6484a164-d355-4947-ac2c-e8c09fb24fb0\",\n \"ssh_keys\": [\n \"a3f2e5d8-1234-4abc-9876-543210fedcba\"\n ],\n \"vpcs\": [\n \"f5a3e2d8-9876-4abc-1234-543210fedcba\"\n ],\n \"firewall_group_id\": \"e4d3c2b1-5678-9abc-def0-fedcba098765\",\n \"ipv6\": false,\n \"disable_ssh_blocking\": false,\n \"startup_script_id\": \"b7e3f1a2-5678-4def-abcd-123456789abc\"\n}"
response = http.request(request)
puts response.read_bodyAuthorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
"vm-hostname"
hourly, monthly, quarterly, semiannually, annually, biennially, triennially "ea645d53-c0e5-406d-8863-9ecd4235be94"
"Sydney"
2
4096
40
OS template ID to deploy. Provide one of os, snapshot_id or iso_id.
2
Snapshot ID to deploy from. Provide one of os, snapshot_id or iso_id.
"53959c6e-73d5-4476-9b19-d78fb8efac2c"
Custom or system ISO ID to boot from (BYOI, no base image). Provide one of os, snapshot_id or iso_id.
"7c1f2a90-4b3d-4e21-9a8c-1d2e3f4a5b6c"
"6484a164-d355-4947-ac2c-e8c09fb24fb0"
List of SSH key IDs to be added to the VM for authentication
["a3f2e5d8-1234-4abc-9876-543210fedcba"]
List of VPC IDs to attach the VM to for private networking
["f5a3e2d8-9876-4abc-1234-543210fedcba"]
Firewall group ID to apply to the VM for security rules
"e4d3c2b1-5678-9abc-def0-fedcba098765"
Enable IPv6 for the VM (if available in the location)
false
Disable outgoing SSH blocking on the VM (allows outbound SSH connections on port 22)
false
Startup script ID to execute on first boot (only applies when deploying with OS or snapshot)
"b7e3f1a2-5678-4def-abcd-123456789abc"
Response
Successful operation