Snapshots
Get a snapshot by name
Retrieve a managed disk snapshot by its organization-unique name.
GET
/
v1
/
snapshots
/
by-name
/
{name}
Get a snapshot by name
curl --request GET \
--url https://api.microsandbox.dev/v1/snapshots/by-name/{name} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.microsandbox.dev/v1/snapshots/by-name/{name}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.microsandbox.dev/v1/snapshots/by-name/{name}', 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.microsandbox.dev/v1/snapshots/by-name/{name}",
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.microsandbox.dev/v1/snapshots/by-name/{name}"
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.microsandbox.dev/v1/snapshots/by-name/{name}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.microsandbox.dev/v1/snapshots/by-name/{name}")
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{
"created_at": "2023-11-07T05:31:56Z",
"digest": "<string>",
"labels": {},
"location": {
"id": "<string>",
"type": "managed"
},
"manifest": {
"artifact": "<string>",
"created_at": "<string>",
"extensions": {},
"image": {
"manifest_digest": "<string>",
"ref": "<string>"
},
"labels": {},
"requires": [
"<string>"
],
"schema": 1,
"scope": "disk",
"state": {
"format": "raw",
"fstype": "<string>",
"upper": {
"file": "<string>",
"size_bytes": 1,
"integrity": {
"algorithm": "sha256",
"digest": "<string>"
}
},
"kind": "file"
},
"parent": "<string>",
"source_sandbox": "<string>"
},
"name": "<string>",
"size_bytes": 1,
"kind": "disk",
"sandbox_id": "<string>"
}{
"error": {
"code": "invalid_api_key",
"message": "unauthorized",
"details": null
}
}{
"error": {
"code": "sandbox_not_found",
"message": "resource not found",
"details": null
}
}Authorizations
Organization API key (msb_…) - org-scoped programmatic access.
Path Parameters
Managed snapshot name
Response
Managed snapshot
Wire shape of a completed cloud snapshot.
Creation timestamp.
Snapshot identity: the sha256: digest of the canonical descriptor.
User-defined labels stored on the snapshot.
Show child attributes
Show child attributes
Where the snapshot artifact resides.
- Option 1
- Option 2
Show child attributes
Show child attributes
Canonical snapshot descriptor.
Show child attributes
Show child attributes
Snapshot name.
Stored payload size in bytes.
Required range:
x >= 0Available options:
disk Identifier of the sandbox the snapshot was captured from, when known.
Was this page helpful?
⌘I
Get a snapshot by name
curl --request GET \
--url https://api.microsandbox.dev/v1/snapshots/by-name/{name} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.microsandbox.dev/v1/snapshots/by-name/{name}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.microsandbox.dev/v1/snapshots/by-name/{name}', 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.microsandbox.dev/v1/snapshots/by-name/{name}",
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.microsandbox.dev/v1/snapshots/by-name/{name}"
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.microsandbox.dev/v1/snapshots/by-name/{name}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.microsandbox.dev/v1/snapshots/by-name/{name}")
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{
"created_at": "2023-11-07T05:31:56Z",
"digest": "<string>",
"labels": {},
"location": {
"id": "<string>",
"type": "managed"
},
"manifest": {
"artifact": "<string>",
"created_at": "<string>",
"extensions": {},
"image": {
"manifest_digest": "<string>",
"ref": "<string>"
},
"labels": {},
"requires": [
"<string>"
],
"schema": 1,
"scope": "disk",
"state": {
"format": "raw",
"fstype": "<string>",
"upper": {
"file": "<string>",
"size_bytes": 1,
"integrity": {
"algorithm": "sha256",
"digest": "<string>"
}
},
"kind": "file"
},
"parent": "<string>",
"source_sandbox": "<string>"
},
"name": "<string>",
"size_bytes": 1,
"kind": "disk",
"sandbox_id": "<string>"
}{
"error": {
"code": "invalid_api_key",
"message": "unauthorized",
"details": null
}
}{
"error": {
"code": "sandbox_not_found",
"message": "resource not found",
"details": null
}
}