Get clock sync status
curl --request GET \
--url https://{identifier}.sandbox.tensorlake.ai/api/v1/clock-sync \
--header 'Authorization: Bearer <token>'import requests
url = "https://{identifier}.sandbox.tensorlake.ai/api/v1/clock-sync"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://{identifier}.sandbox.tensorlake.ai/api/v1/clock-sync', 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://{identifier}.sandbox.tensorlake.ai/api/v1/clock-sync",
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://{identifier}.sandbox.tensorlake.ai/api/v1/clock-sync"
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://{identifier}.sandbox.tensorlake.ai/api/v1/clock-sync")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://{identifier}.sandbox.tensorlake.ai/api/v1/clock-sync")
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{
"enabled": true,
"configurable": true
}{
"error": "Sandbox 'parked-agent' is suspended and automatic resume is disabled; resume it explicitly before sending traffic.",
"code": "SANDBOX_AUTO_RESUME_DISABLED"
}Runtime Metadata
Get clock sync status
Check whether built-in host wall-clock sync is enabled and configurable inside a sandbox.
GET
/
api
/
v1
/
clock-sync
Get clock sync status
curl --request GET \
--url https://{identifier}.sandbox.tensorlake.ai/api/v1/clock-sync \
--header 'Authorization: Bearer <token>'import requests
url = "https://{identifier}.sandbox.tensorlake.ai/api/v1/clock-sync"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://{identifier}.sandbox.tensorlake.ai/api/v1/clock-sync', 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://{identifier}.sandbox.tensorlake.ai/api/v1/clock-sync",
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://{identifier}.sandbox.tensorlake.ai/api/v1/clock-sync"
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://{identifier}.sandbox.tensorlake.ai/api/v1/clock-sync")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://{identifier}.sandbox.tensorlake.ai/api/v1/clock-sync")
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{
"enabled": true,
"configurable": true
}{
"error": "Sandbox 'parked-agent' is suspended and automatic resume is disabled; resume it explicitly before sending traffic.",
"code": "SANDBOX_AUTO_RESUME_DISABLED"
}Query the current status of the sandbox daemon’s built-in wall-clock syncer. For details on how
This requests the current wall-clock sync status from the sandbox daemon with
CLOCK_MONOTONIC, CLOCK_BOOTTIME, and CLOCK_REALTIME behave across suspend and resume, see How clocks work in sandboxes.
Example request
SetSANDBOX_URL to the sandbox_url returned by Get Sandbox and authenticate with your Tensorlake API key:
curl "${SANDBOX_URL%/}/api/v1/clock-sync" \
-H "Authorization: Bearer $TENSORLAKE_API_KEY"
Cache-Control: no-store.
Response fields
The response describes both whether host UTC syncing is active and whether this runtime lets you change it:enabled:truewhen host wall-clock syncing is active (including runtimes where the host clock is authoritative, such as gVisor), orfalsewhen disabled or unavailableconfigurable:trueon VM sandboxes with/dev/ptp0(KVM virtual PTP) andCAP_SYS_TIME, orfalsewhen mutations are rejected with501 Not Implementedreason: present whenconfigurableisfalseto explain why wall-clock sync can’t be toggled
Authorizations
Response
Current wall-clock sync status
Was this page helpful?