Create VM
curl --request POST \
--url https://api.mkinf.io/v0.1/projects/{id}/vms \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "mkinf-node-01",
"type": "l40s-48gb.1x",
"location": "us-east1-a",
"image": "ubuntu22.04-nvidia-pcie-docker",
"ssh_public_key": "ssh-rsa AAAAB..."
}
'import requests
url = "https://api.mkinf.io/v0.1/projects/{id}/vms"
payload = {
"name": "mkinf-node-01",
"type": "l40s-48gb.1x",
"location": "us-east1-a",
"image": "ubuntu22.04-nvidia-pcie-docker",
"ssh_public_key": "ssh-rsa AAAAB..."
}
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: 'mkinf-node-01',
type: 'l40s-48gb.1x',
location: 'us-east1-a',
image: 'ubuntu22.04-nvidia-pcie-docker',
ssh_public_key: 'ssh-rsa AAAAB...'
})
};
fetch('https://api.mkinf.io/v0.1/projects/{id}/vms', 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.mkinf.io/v0.1/projects/{id}/vms",
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' => 'mkinf-node-01',
'type' => 'l40s-48gb.1x',
'location' => 'us-east1-a',
'image' => 'ubuntu22.04-nvidia-pcie-docker',
'ssh_public_key' => 'ssh-rsa AAAAB...'
]),
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.mkinf.io/v0.1/projects/{id}/vms"
payload := strings.NewReader("{\n \"name\": \"mkinf-node-01\",\n \"type\": \"l40s-48gb.1x\",\n \"location\": \"us-east1-a\",\n \"image\": \"ubuntu22.04-nvidia-pcie-docker\",\n \"ssh_public_key\": \"ssh-rsa AAAAB...\"\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.mkinf.io/v0.1/projects/{id}/vms")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"mkinf-node-01\",\n \"type\": \"l40s-48gb.1x\",\n \"location\": \"us-east1-a\",\n \"image\": \"ubuntu22.04-nvidia-pcie-docker\",\n \"ssh_public_key\": \"ssh-rsa AAAAB...\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.mkinf.io/v0.1/projects/{id}/vms")
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\": \"mkinf-node-01\",\n \"type\": \"l40s-48gb.1x\",\n \"location\": \"us-east1-a\",\n \"image\": \"ubuntu22.04-nvidia-pcie-docker\",\n \"ssh_public_key\": \"ssh-rsa AAAAB...\"\n}"
response = http.request(request)
puts response.read_body{
"operation": {
"completed_at": "2021-12-03T19:59:34Z",
"metadata": {},
"operation_id": "F6EF489C-086E-458D-B812-7962964A28C9",
"result": {},
"started_at": "2021-12-03T19:58:34Z",
"state": "IN_PROGRESS"
}
}Virtual Machines
Create VM
Create a new VM instance
POST
/
projects
/
{id}
/
vms
Create VM
curl --request POST \
--url https://api.mkinf.io/v0.1/projects/{id}/vms \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "mkinf-node-01",
"type": "l40s-48gb.1x",
"location": "us-east1-a",
"image": "ubuntu22.04-nvidia-pcie-docker",
"ssh_public_key": "ssh-rsa AAAAB..."
}
'import requests
url = "https://api.mkinf.io/v0.1/projects/{id}/vms"
payload = {
"name": "mkinf-node-01",
"type": "l40s-48gb.1x",
"location": "us-east1-a",
"image": "ubuntu22.04-nvidia-pcie-docker",
"ssh_public_key": "ssh-rsa AAAAB..."
}
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: 'mkinf-node-01',
type: 'l40s-48gb.1x',
location: 'us-east1-a',
image: 'ubuntu22.04-nvidia-pcie-docker',
ssh_public_key: 'ssh-rsa AAAAB...'
})
};
fetch('https://api.mkinf.io/v0.1/projects/{id}/vms', 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.mkinf.io/v0.1/projects/{id}/vms",
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' => 'mkinf-node-01',
'type' => 'l40s-48gb.1x',
'location' => 'us-east1-a',
'image' => 'ubuntu22.04-nvidia-pcie-docker',
'ssh_public_key' => 'ssh-rsa AAAAB...'
]),
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.mkinf.io/v0.1/projects/{id}/vms"
payload := strings.NewReader("{\n \"name\": \"mkinf-node-01\",\n \"type\": \"l40s-48gb.1x\",\n \"location\": \"us-east1-a\",\n \"image\": \"ubuntu22.04-nvidia-pcie-docker\",\n \"ssh_public_key\": \"ssh-rsa AAAAB...\"\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.mkinf.io/v0.1/projects/{id}/vms")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"mkinf-node-01\",\n \"type\": \"l40s-48gb.1x\",\n \"location\": \"us-east1-a\",\n \"image\": \"ubuntu22.04-nvidia-pcie-docker\",\n \"ssh_public_key\": \"ssh-rsa AAAAB...\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.mkinf.io/v0.1/projects/{id}/vms")
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\": \"mkinf-node-01\",\n \"type\": \"l40s-48gb.1x\",\n \"location\": \"us-east1-a\",\n \"image\": \"ubuntu22.04-nvidia-pcie-docker\",\n \"ssh_public_key\": \"ssh-rsa AAAAB...\"\n}"
response = http.request(request)
puts response.read_body{
"operation": {
"completed_at": "2021-12-03T19:59:34Z",
"metadata": {},
"operation_id": "F6EF489C-086E-458D-B812-7962964A28C9",
"result": {},
"started_at": "2021-12-03T19:58:34Z",
"state": "IN_PROGRESS"
}
}Create a new VM instance in a project.
Required Parameters
name: VM nametype: VM type/sizelocation: Deployment locationssh_public_key: SSH public key for access
Optional Parameters
image: OS image namedisks: Additional disk configurationsstartup_script: Script to run on startupshutdown_script: Script to run on shutdown
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Project id
Body
application/json
Response
200 - application/json
Show child attributes
Show child attributes
⌘I