List VMs
curl --request GET \
--url https://api.mkinf.io/v0.1/projects/{id}/vms \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.mkinf.io/v0.1/projects/{id}/vms"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
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 => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.mkinf.io/v0.1/projects/{id}/vms"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.mkinf.io/v0.1/projects/{id}/vms")
.header("Authorization", "Bearer <token>")
.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::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"items": [
{
"id": "b3e571f6-c87d-4135-8081-ab219e92544e",
"project_id": "3291380a-19e9-4892-a139-2fa92aa740e2",
"type": "l40s-48gb.1x",
"state": "STATE_RUNNING",
"ssh_destination": ":0",
"created_at": "2024-06-16T15:52:41Z",
"updated_at": "2024-06-16T15:52:53Z",
"name": "mkinf-node",
"location": "us-east1-a",
"commitment_period": 0,
"commitment_end": "",
"disks": [
{
"id": "52822513-e425-4be9-8dd8-5c21d561ce11",
"name": "OS-disk-b3e571f6-c87d-4135-8081-ab219e92544e",
"type": "persistent-ssd",
"size": "128GiB",
"location": "vaeq-cu",
"block_size": 0,
"created_at": "2024-06-16T15:52:43Z",
"updated_at": "2024-06-16T15:52:44Z",
"serial_number": "B74EEFE8EFA0988490E",
"attachment_type": "os",
"mode": "read-write"
}
],
"network_interfaces": [
{
"id": "fdf58fb1-0185-40f2-aa20-b620e8a8562d",
"name": "default-network-interface",
"network": "695b751c-2eaa-4e8b-8eb2-84cb367a69fe",
"subnet": "7ceecd34-2631-4857-ad82-ceb9dfd09425",
"interface_type": "Ethernet",
"mac_address": "2e:2f:ae:ef:ae:16",
"ips": [
{
"private_ipv4": {
"address": "172.27.23.237"
},
"public_ipv4": {
"address": "204.52.24.84",
"id": "e130674a-c05e-4345-b8a4-7928c6649574",
"type": "dynamic"
}
}
]
}
],
"host_channel_adapters": [],
"virtualization_features": {
"nested_virtualization": false
},
"instance_template_id": "",
"instance_group_id": "",
"reservation_id": ""
}
],
"next_page_token": "",
"prev_page_token": ""
}Virtual Machines
List VMs
List all the VM instances you have access to
GET
/
projects
/
{id}
/
vms
List VMs
curl --request GET \
--url https://api.mkinf.io/v0.1/projects/{id}/vms \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.mkinf.io/v0.1/projects/{id}/vms"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
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 => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.mkinf.io/v0.1/projects/{id}/vms"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.mkinf.io/v0.1/projects/{id}/vms")
.header("Authorization", "Bearer <token>")
.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::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"items": [
{
"id": "b3e571f6-c87d-4135-8081-ab219e92544e",
"project_id": "3291380a-19e9-4892-a139-2fa92aa740e2",
"type": "l40s-48gb.1x",
"state": "STATE_RUNNING",
"ssh_destination": ":0",
"created_at": "2024-06-16T15:52:41Z",
"updated_at": "2024-06-16T15:52:53Z",
"name": "mkinf-node",
"location": "us-east1-a",
"commitment_period": 0,
"commitment_end": "",
"disks": [
{
"id": "52822513-e425-4be9-8dd8-5c21d561ce11",
"name": "OS-disk-b3e571f6-c87d-4135-8081-ab219e92544e",
"type": "persistent-ssd",
"size": "128GiB",
"location": "vaeq-cu",
"block_size": 0,
"created_at": "2024-06-16T15:52:43Z",
"updated_at": "2024-06-16T15:52:44Z",
"serial_number": "B74EEFE8EFA0988490E",
"attachment_type": "os",
"mode": "read-write"
}
],
"network_interfaces": [
{
"id": "fdf58fb1-0185-40f2-aa20-b620e8a8562d",
"name": "default-network-interface",
"network": "695b751c-2eaa-4e8b-8eb2-84cb367a69fe",
"subnet": "7ceecd34-2631-4857-ad82-ceb9dfd09425",
"interface_type": "Ethernet",
"mac_address": "2e:2f:ae:ef:ae:16",
"ips": [
{
"private_ipv4": {
"address": "172.27.23.237"
},
"public_ipv4": {
"address": "204.52.24.84",
"id": "e130674a-c05e-4345-b8a4-7928c6649574",
"type": "dynamic"
}
}
]
}
],
"host_channel_adapters": [],
"virtualization_features": {
"nested_virtualization": false
},
"instance_template_id": "",
"instance_group_id": "",
"reservation_id": ""
}
],
"next_page_token": "",
"prev_page_token": ""
}List all VM instances in a project. Supports filtering by various parameters.
Query Parameters
ids: Filter by specific VM IDsnames: Filter by VM namestypes: Filter by VM typeslocations: Filter by locationsstates: Filter by VM stateslimit: Maximum number of resultssort: Sort fieldnext_token: Token for next pageprev_token: Token for previous page
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Project id
Query Parameters
VM ids
VM names
VM types
Locations
VM status
Limit
Sort
Next page
Prev page
⌘I