Create a manual file storage snapshot
curl --request POST \
--url https://region.nks.europe-west4.nscale.com/api/v2/filestorage/{filestorageID}/snapshots \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"metadata": {
"name": "<string>",
"description": "<string>",
"tags": [
{
"name": "<string>",
"value": "<string>"
}
]
},
"spec": {
"expirationTime": "2030-01-01T00:00:00.000Z",
"protectedPath": "datasets/model"
}
}
'import requests
url = "https://region.nks.europe-west4.nscale.com/api/v2/filestorage/{filestorageID}/snapshots"
payload = {
"metadata": {
"name": "<string>",
"description": "<string>",
"tags": [
{
"name": "<string>",
"value": "<string>"
}
]
},
"spec": {
"expirationTime": "2030-01-01T00:00:00.000Z",
"protectedPath": "datasets/model"
}
}
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: '<string>',
description: '<string>',
tags: [{name: '<string>', value: '<string>'}]
},
spec: {expirationTime: '2030-01-01T00:00:00.000Z', protectedPath: 'datasets/model'}
})
};
fetch('https://region.nks.europe-west4.nscale.com/api/v2/filestorage/{filestorageID}/snapshots', 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://region.nks.europe-west4.nscale.com/api/v2/filestorage/{filestorageID}/snapshots",
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' => '<string>',
'description' => '<string>',
'tags' => [
[
'name' => '<string>',
'value' => '<string>'
]
]
],
'spec' => [
'expirationTime' => '2030-01-01T00:00:00.000Z',
'protectedPath' => 'datasets/model'
]
]),
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://region.nks.europe-west4.nscale.com/api/v2/filestorage/{filestorageID}/snapshots"
payload := strings.NewReader("{\n \"metadata\": {\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"tags\": [\n {\n \"name\": \"<string>\",\n \"value\": \"<string>\"\n }\n ]\n },\n \"spec\": {\n \"expirationTime\": \"2030-01-01T00:00:00.000Z\",\n \"protectedPath\": \"datasets/model\"\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://region.nks.europe-west4.nscale.com/api/v2/filestorage/{filestorageID}/snapshots")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"metadata\": {\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"tags\": [\n {\n \"name\": \"<string>\",\n \"value\": \"<string>\"\n }\n ]\n },\n \"spec\": {\n \"expirationTime\": \"2030-01-01T00:00:00.000Z\",\n \"protectedPath\": \"datasets/model\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://region.nks.europe-west4.nscale.com/api/v2/filestorage/{filestorageID}/snapshots")
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\": \"<string>\",\n \"description\": \"<string>\",\n \"tags\": [\n {\n \"name\": \"<string>\",\n \"value\": \"<string>\"\n }\n ]\n },\n \"spec\": {\n \"expirationTime\": \"2030-01-01T00:00:00.000Z\",\n \"protectedPath\": \"datasets/model\"\n }\n}"
response = http.request(request)
puts response.read_body{
"metadata": {
"name": "<string>",
"id": "<string>",
"creationTime": "2023-11-07T05:31:56Z",
"provisioningStatus": "unknown",
"healthStatus": "unknown",
"organizationId": "<string>",
"projectId": "<string>",
"description": "<string>",
"tags": [
{
"name": "<string>",
"value": "<string>"
}
],
"createdBy": "<string>",
"modifiedTime": "2023-11-07T05:31:56Z",
"modifiedBy": "<string>",
"deletionTime": "2023-11-07T05:31:56Z"
},
"spec": {
"fileStorageId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"expirationTime": "2023-11-07T05:31:56Z",
"protectedPath": "<string>"
},
"status": {
"snapshotTime": "2023-11-07T05:31:56Z",
"absoluteProtectedPath": "<string>"
}
}{
"error": "invalid_request",
"error_description": "request body invalid",
"trace_id": "57bc14d9bd461f0b5a72db830149b67a"
}{
"error": "access_denied",
"error_description": "authentication failed",
"trace_id": "57bc14d9bd461f0b5a72db830149b67a"
}{
"error": "forbidden",
"error_description": "user credentials do not have the required privileges",
"trace_id": "57bc14d9bd461f0b5a72db830149b67a"
}{
"error": "not_found",
"error_description": "the requested resource does not exist",
"trace_id": "57bc14d9bd461f0b5a72db830149b67a"
}{
"error": "conflict",
"error_description": "a resource with the same name already exists",
"trace_id": "57bc14d9bd461f0b5a72db830149b67a"
}{
"error": "unprocessable_content",
"error_description": "the request body was in the wrong format",
"trace_id": "57bc14d9bd461f0b5a72db830149b67a"
}{
"error": "server_error",
"error_description": "failed to token claim",
"trace_id": "57bc14d9bd461f0b5a72db830149b67a"
}File storage snapshots
Create a manual file storage snapshot
Create a Manual Snapshot under a File Storage. Returns the complete pending resource. A deleting parent conflicts.
POST
/
api
/
v2
/
filestorage
/
{filestorageID}
/
snapshots
Create a manual file storage snapshot
curl --request POST \
--url https://region.nks.europe-west4.nscale.com/api/v2/filestorage/{filestorageID}/snapshots \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"metadata": {
"name": "<string>",
"description": "<string>",
"tags": [
{
"name": "<string>",
"value": "<string>"
}
]
},
"spec": {
"expirationTime": "2030-01-01T00:00:00.000Z",
"protectedPath": "datasets/model"
}
}
'import requests
url = "https://region.nks.europe-west4.nscale.com/api/v2/filestorage/{filestorageID}/snapshots"
payload = {
"metadata": {
"name": "<string>",
"description": "<string>",
"tags": [
{
"name": "<string>",
"value": "<string>"
}
]
},
"spec": {
"expirationTime": "2030-01-01T00:00:00.000Z",
"protectedPath": "datasets/model"
}
}
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: '<string>',
description: '<string>',
tags: [{name: '<string>', value: '<string>'}]
},
spec: {expirationTime: '2030-01-01T00:00:00.000Z', protectedPath: 'datasets/model'}
})
};
fetch('https://region.nks.europe-west4.nscale.com/api/v2/filestorage/{filestorageID}/snapshots', 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://region.nks.europe-west4.nscale.com/api/v2/filestorage/{filestorageID}/snapshots",
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' => '<string>',
'description' => '<string>',
'tags' => [
[
'name' => '<string>',
'value' => '<string>'
]
]
],
'spec' => [
'expirationTime' => '2030-01-01T00:00:00.000Z',
'protectedPath' => 'datasets/model'
]
]),
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://region.nks.europe-west4.nscale.com/api/v2/filestorage/{filestorageID}/snapshots"
payload := strings.NewReader("{\n \"metadata\": {\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"tags\": [\n {\n \"name\": \"<string>\",\n \"value\": \"<string>\"\n }\n ]\n },\n \"spec\": {\n \"expirationTime\": \"2030-01-01T00:00:00.000Z\",\n \"protectedPath\": \"datasets/model\"\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://region.nks.europe-west4.nscale.com/api/v2/filestorage/{filestorageID}/snapshots")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"metadata\": {\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"tags\": [\n {\n \"name\": \"<string>\",\n \"value\": \"<string>\"\n }\n ]\n },\n \"spec\": {\n \"expirationTime\": \"2030-01-01T00:00:00.000Z\",\n \"protectedPath\": \"datasets/model\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://region.nks.europe-west4.nscale.com/api/v2/filestorage/{filestorageID}/snapshots")
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\": \"<string>\",\n \"description\": \"<string>\",\n \"tags\": [\n {\n \"name\": \"<string>\",\n \"value\": \"<string>\"\n }\n ]\n },\n \"spec\": {\n \"expirationTime\": \"2030-01-01T00:00:00.000Z\",\n \"protectedPath\": \"datasets/model\"\n }\n}"
response = http.request(request)
puts response.read_body{
"metadata": {
"name": "<string>",
"id": "<string>",
"creationTime": "2023-11-07T05:31:56Z",
"provisioningStatus": "unknown",
"healthStatus": "unknown",
"organizationId": "<string>",
"projectId": "<string>",
"description": "<string>",
"tags": [
{
"name": "<string>",
"value": "<string>"
}
],
"createdBy": "<string>",
"modifiedTime": "2023-11-07T05:31:56Z",
"modifiedBy": "<string>",
"deletionTime": "2023-11-07T05:31:56Z"
},
"spec": {
"fileStorageId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"expirationTime": "2023-11-07T05:31:56Z",
"protectedPath": "<string>"
},
"status": {
"snapshotTime": "2023-11-07T05:31:56Z",
"absoluteProtectedPath": "<string>"
}
}{
"error": "invalid_request",
"error_description": "request body invalid",
"trace_id": "57bc14d9bd461f0b5a72db830149b67a"
}{
"error": "access_denied",
"error_description": "authentication failed",
"trace_id": "57bc14d9bd461f0b5a72db830149b67a"
}{
"error": "forbidden",
"error_description": "user credentials do not have the required privileges",
"trace_id": "57bc14d9bd461f0b5a72db830149b67a"
}{
"error": "not_found",
"error_description": "the requested resource does not exist",
"trace_id": "57bc14d9bd461f0b5a72db830149b67a"
}{
"error": "conflict",
"error_description": "a resource with the same name already exists",
"trace_id": "57bc14d9bd461f0b5a72db830149b67a"
}{
"error": "unprocessable_content",
"error_description": "the request body was in the wrong format",
"trace_id": "57bc14d9bd461f0b5a72db830149b67a"
}{
"error": "server_error",
"error_description": "failed to token claim",
"trace_id": "57bc14d9bd461f0b5a72db830149b67a"
}Authorizations
Body
application/json
Response
A Manual File Storage Snapshot.
A manual file storage snapshot. Health and snapshot details record capture readiness, not current availability.
Was this page helpful?