List instances
curl --request GET \
--url https://compute.nks.europe-west4.nscale.com/api/v2/instances \
--header 'Authorization: Bearer <token>'import requests
url = "https://compute.nks.europe-west4.nscale.com/api/v2/instances"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://compute.nks.europe-west4.nscale.com/api/v2/instances', 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://compute.nks.europe-west4.nscale.com/api/v2/instances",
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://compute.nks.europe-west4.nscale.com/api/v2/instances"
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://compute.nks.europe-west4.nscale.com/api/v2/instances")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://compute.nks.europe-west4.nscale.com/api/v2/instances")
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[
{
"metadata": {
"id": "c7568e2d-f9ab-453d-9a3a-51375f78426b",
"name": "my-host",
"organizationId": "d4600d6e-e965-4b44-a808-84fb2fa36702",
"projectId": "cae219d7-10e5-4601-8c2c-ee7e066b93ce",
"creationTime": "2023-07-31T10:45:45Z",
"provisioningStatus": "provisioned",
"healthStatus": "healthy"
},
"spec": {
"flavorId": "c7568e2d-f9ab-453d-9a3a-51375f78426b",
"imageId": "a10e30e8-006a-48e6-a3c7-3c9416891f31",
"networking": {
"publicIP": true,
"securityGroups": [
"dd5954af-1d71-4abf-bb16-5729c7163886"
]
}
},
"status": {
"regionId": "bb518c64-6856-4d67-a799-314ba668649f",
"networkId": "b059b3e6-9ae5-42b7-94b4-f42fb7a6baee",
"privateIP": "192.168.0.3",
"publicIP": "183.45.68.162",
"powerState": "Running"
}
}
]{
"error": "invalid_request",
"error_description": "request body invalid"
}{
"error": "access_denied",
"error_description": "authentication failed"
}{
"error": "forbidden",
"error_description": "user credentials do not have the required privileges"
}{
"error": "not_found",
"error_description": "the requested resource does not exist"
}{
"error": "server_error",
"error_description": "failed to token claim"
}Instances
List instances
List compute instances.
GET
/
api
/
v2
/
instances
List instances
curl --request GET \
--url https://compute.nks.europe-west4.nscale.com/api/v2/instances \
--header 'Authorization: Bearer <token>'import requests
url = "https://compute.nks.europe-west4.nscale.com/api/v2/instances"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://compute.nks.europe-west4.nscale.com/api/v2/instances', 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://compute.nks.europe-west4.nscale.com/api/v2/instances",
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://compute.nks.europe-west4.nscale.com/api/v2/instances"
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://compute.nks.europe-west4.nscale.com/api/v2/instances")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://compute.nks.europe-west4.nscale.com/api/v2/instances")
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[
{
"metadata": {
"id": "c7568e2d-f9ab-453d-9a3a-51375f78426b",
"name": "my-host",
"organizationId": "d4600d6e-e965-4b44-a808-84fb2fa36702",
"projectId": "cae219d7-10e5-4601-8c2c-ee7e066b93ce",
"creationTime": "2023-07-31T10:45:45Z",
"provisioningStatus": "provisioned",
"healthStatus": "healthy"
},
"spec": {
"flavorId": "c7568e2d-f9ab-453d-9a3a-51375f78426b",
"imageId": "a10e30e8-006a-48e6-a3c7-3c9416891f31",
"networking": {
"publicIP": true,
"securityGroups": [
"dd5954af-1d71-4abf-bb16-5729c7163886"
]
}
},
"status": {
"regionId": "bb518c64-6856-4d67-a799-314ba668649f",
"networkId": "b059b3e6-9ae5-42b7-94b4-f42fb7a6baee",
"privateIP": "192.168.0.3",
"publicIP": "183.45.68.162",
"powerState": "Running"
}
}
]{
"error": "invalid_request",
"error_description": "request body invalid"
}{
"error": "access_denied",
"error_description": "authentication failed"
}{
"error": "forbidden",
"error_description": "user credentials do not have the required privileges"
}{
"error": "not_found",
"error_description": "the requested resource does not exist"
}{
"error": "server_error",
"error_description": "failed to token claim"
}Authorizations
Operation requires OAuth 2.0 bearer token authentication.
Query Parameters
A set of tags to match against resources in the form "name=value", thus when encoded you get "?tag=foo%3Dcat&tag=bar%3Ddog".
Allows resources to be filtered by organization.
Allows resources to be filtered by project.
Allows resources to be filtered by region.
Allows resources to be filtered by network.
Was this page helpful?
⌘I