curl --request POST \
--url https://compute.nks.europe-west4.nscale.com/api/v2/instances/{instanceID}/snapshot \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"metadata": {
"name": "my-instance-snapshot"
}
}
'import requests
url = "https://compute.nks.europe-west4.nscale.com/api/v2/instances/{instanceID}/snapshot"
payload = { "metadata": { "name": "my-instance-snapshot" } }
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({metadata: {name: 'my-instance-snapshot'}})
};
fetch('https://compute.nks.europe-west4.nscale.com/api/v2/instances/{instanceID}/snapshot', 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/{instanceID}/snapshot",
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([
'metadata' => [
'name' => 'my-instance-snapshot'
]
]),
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://compute.nks.europe-west4.nscale.com/api/v2/instances/{instanceID}/snapshot"
payload := strings.NewReader("{\n \"metadata\": {\n \"name\": \"my-instance-snapshot\"\n }\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://compute.nks.europe-west4.nscale.com/api/v2/instances/{instanceID}/snapshot")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"metadata\": {\n \"name\": \"my-instance-snapshot\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://compute.nks.europe-west4.nscale.com/api/v2/instances/{instanceID}/snapshot")
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 \"metadata\": {\n \"name\": \"my-instance-snapshot\"\n }\n}"
response = http.request(request)
puts response.read_body{
"metadata": {
"id": "a64f9269-36e0-4312-b8d1-52d93d569b7b",
"name": "ubu2204-v1.25.6-gpu-525.85.05-7ced4154",
"creationTime": "2023-02-22T12:04:13Z"
},
"spec": {
"architecture": "x86_64",
"sizeGiB": 10,
"virtualization": "virtualized",
"os": {
"kernel": "linux",
"family": "debian",
"distro": "ubuntu",
"variant": "server",
"codename": "noble",
"version": "24.04"
},
"softwareVersions": {
"kubernetes": "v1.25.6"
},
"gpu": {
"vendor": "NVIDIA",
"driver": "525.85.05",
"models": [
"A100",
"H100",
"H200"
]
}
},
"status": {
"state": "ready"
}
}{
"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"
}Snapshot instance
Take a snapshot of an instance and create an image from it.
curl --request POST \
--url https://compute.nks.europe-west4.nscale.com/api/v2/instances/{instanceID}/snapshot \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"metadata": {
"name": "my-instance-snapshot"
}
}
'import requests
url = "https://compute.nks.europe-west4.nscale.com/api/v2/instances/{instanceID}/snapshot"
payload = { "metadata": { "name": "my-instance-snapshot" } }
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({metadata: {name: 'my-instance-snapshot'}})
};
fetch('https://compute.nks.europe-west4.nscale.com/api/v2/instances/{instanceID}/snapshot', 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/{instanceID}/snapshot",
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([
'metadata' => [
'name' => 'my-instance-snapshot'
]
]),
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://compute.nks.europe-west4.nscale.com/api/v2/instances/{instanceID}/snapshot"
payload := strings.NewReader("{\n \"metadata\": {\n \"name\": \"my-instance-snapshot\"\n }\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://compute.nks.europe-west4.nscale.com/api/v2/instances/{instanceID}/snapshot")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"metadata\": {\n \"name\": \"my-instance-snapshot\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://compute.nks.europe-west4.nscale.com/api/v2/instances/{instanceID}/snapshot")
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 \"metadata\": {\n \"name\": \"my-instance-snapshot\"\n }\n}"
response = http.request(request)
puts response.read_body{
"metadata": {
"id": "a64f9269-36e0-4312-b8d1-52d93d569b7b",
"name": "ubu2204-v1.25.6-gpu-525.85.05-7ced4154",
"creationTime": "2023-02-22T12:04:13Z"
},
"spec": {
"architecture": "x86_64",
"sizeGiB": 10,
"virtualization": "virtualized",
"os": {
"kernel": "linux",
"family": "debian",
"distro": "ubuntu",
"variant": "server",
"codename": "noble",
"version": "24.04"
},
"softwareVersions": {
"kubernetes": "v1.25.6"
},
"gpu": {
"vendor": "NVIDIA",
"driver": "525.85.05",
"models": [
"A100",
"H100",
"H200"
]
}
},
"status": {
"state": "ready"
}
}{
"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.
Path Parameters
The instance ID. A Kubernetes name. Must be a valid DNS containing only lower case characters, numbers or hyphens, start and end with a character or number, and be at most 63 characters in length.
1 - 63Body
A request to snapshot an instance.
A compute instance snapshot request.
Metadata required for all API resource reads and writes.
Show child attributes
Show child attributes
Response
An image that can be used on this platform.
An image.
This metadata is for resources that just exist, and don't require any provisioning and health status, but benefit from a standardized metadata format.
Show child attributes
Show child attributes
An image.
Show child attributes
Show child attributes
The image's status.
Show child attributes
Show child attributes
Was this page helpful?