Diff Checkpoints
Lists the paths that changed between two checkpoints of a disk, one
entry per path. Both checkpoints must be on the same branch: pass
branch to diff a branch’s checkpoints, or omit it for the disk’s
root.
Each entry says how a path changed and gives its mode and size at
each checkpoint. An added path has only new, and a removed path
only old. Directories, symlinks, and special files are listed as
well as regular files. A renamed directory is one entry, plus one for
each path under it.
Entries don’t hold file contents. To read a file as it was at a
checkpoint, call GetObject on the
S3 API with
versionId set to the checkpoint’s name, in the bucket
{disk}.{branch} for a branch. The S3 API accepts the same API key
as a bearer token.
The diff comes in pages, in no path order. Pass next back as
continuation-token until a page has no next. A page can hold
fewer than max-keys entries, even none, and still not be the last.
Past max-keys, a page holds only more paths of the inode at its
end, such as a file’s other hard links.
If a checkpoint’s writes are still being flushed to storage, the
request fails with 503 and code checkpoint_not_flushed. Retry
until it succeeds.
curl --request GET \
--url https://control.green.us-east-1.aws.prod.archil.com/api/disks/{id}/checkpoints/{from}/diff/{to} \
--header 'Authorization: Bearer <token>'import requests
url = "https://control.green.us-east-1.aws.prod.archil.com/api/disks/{id}/checkpoints/{from}/diff/{to}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://control.green.us-east-1.aws.prod.archil.com/api/disks/{id}/checkpoints/{from}/diff/{to}', 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://control.green.us-east-1.aws.prod.archil.com/api/disks/{id}/checkpoints/{from}/diff/{to}",
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://control.green.us-east-1.aws.prod.archil.com/api/disks/{id}/checkpoints/{from}/diff/{to}"
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://control.green.us-east-1.aws.prod.archil.com/api/disks/{id}/checkpoints/{from}/diff/{to}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://control.green.us-east-1.aws.prod.archil.com/api/disks/{id}/checkpoints/{from}/diff/{to}")
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{
"success": true,
"data": {
"entries": [
{
"change": "modified",
"kind": "file",
"path": "config/app.yaml",
"old": {
"mode": 420,
"size": 1832
},
"new": {
"mode": 420,
"size": 1907
},
"changed": [
"metadata",
"data"
]
},
{
"change": "renamed",
"kind": "file",
"from": "schema.sql",
"path": "schema/base.sql",
"old": {
"mode": 420,
"size": 5120
},
"new": {
"mode": 420,
"size": 5120
},
"changed": [
"metadata"
]
},
{
"change": "added",
"kind": "file",
"path": "migrations/0042_add_index.sql",
"new": {
"mode": 420,
"size": 311
}
},
{
"change": "removed",
"kind": "file",
"path": "tmp/lock",
"old": {
"mode": 384,
"size": 0
}
}
],
"next": "4182"
}
}{
"success": false,
"error": "Invalid request parameters",
"code": "<string>"
}{
"success": false,
"error": "Invalid request parameters",
"code": "<string>"
}{
"success": false,
"error": "Invalid request parameters",
"code": "<string>"
}{
"success": false,
"error": "Invalid request parameters",
"code": "<string>"
}{
"success": false,
"error": "The checkpoint's writes are still being flushed. Please retry.",
"code": "checkpoint_not_flushed",
"data": {
"unflushedCommits": 12,
"oldestUnflushedSeconds": 3
}
}Path Parameters
Query Parameters
Was this page helpful?
curl --request GET \
--url https://control.green.us-east-1.aws.prod.archil.com/api/disks/{id}/checkpoints/{from}/diff/{to} \
--header 'Authorization: Bearer <token>'import requests
url = "https://control.green.us-east-1.aws.prod.archil.com/api/disks/{id}/checkpoints/{from}/diff/{to}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://control.green.us-east-1.aws.prod.archil.com/api/disks/{id}/checkpoints/{from}/diff/{to}', 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://control.green.us-east-1.aws.prod.archil.com/api/disks/{id}/checkpoints/{from}/diff/{to}",
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://control.green.us-east-1.aws.prod.archil.com/api/disks/{id}/checkpoints/{from}/diff/{to}"
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://control.green.us-east-1.aws.prod.archil.com/api/disks/{id}/checkpoints/{from}/diff/{to}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://control.green.us-east-1.aws.prod.archil.com/api/disks/{id}/checkpoints/{from}/diff/{to}")
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{
"success": true,
"data": {
"entries": [
{
"change": "modified",
"kind": "file",
"path": "config/app.yaml",
"old": {
"mode": 420,
"size": 1832
},
"new": {
"mode": 420,
"size": 1907
},
"changed": [
"metadata",
"data"
]
},
{
"change": "renamed",
"kind": "file",
"from": "schema.sql",
"path": "schema/base.sql",
"old": {
"mode": 420,
"size": 5120
},
"new": {
"mode": 420,
"size": 5120
},
"changed": [
"metadata"
]
},
{
"change": "added",
"kind": "file",
"path": "migrations/0042_add_index.sql",
"new": {
"mode": 420,
"size": 311
}
},
{
"change": "removed",
"kind": "file",
"path": "tmp/lock",
"old": {
"mode": 384,
"size": 0
}
}
],
"next": "4182"
}
}{
"success": false,
"error": "Invalid request parameters",
"code": "<string>"
}{
"success": false,
"error": "Invalid request parameters",
"code": "<string>"
}{
"success": false,
"error": "Invalid request parameters",
"code": "<string>"
}{
"success": false,
"error": "Invalid request parameters",
"code": "<string>"
}{
"success": false,
"error": "The checkpoint's writes are still being flushed. Please retry.",
"code": "checkpoint_not_flushed",
"data": {
"unflushedCommits": 12,
"oldestUnflushedSeconds": 3
}
}