Automating Snapshots


Create snapshot

Required API Permission: Create Snapshots

You can create snapshosts with the CLI, Node.js API, HTTP Site API or GraphQL API.

1calibre site create-snapshot --site=<site> --ref=<ref>
Example Response
1✔ Snapshot created: 1588
ParameterRequiredDescription
siteYesSite slug, found in site settings
refNoSets a reference to the snapshot

List snapshots

Required API Permission: Read Sites

You can list snapshots with the CLI, Node.js API, GraphQL API or by using the HTTP Site API.

1calibre site snapshots --site=<site> --count=<count> --cursor=<cursor>
Example Response
15 snapshots
2ID | URL | REF | CLIENT | STATUS
342 | http://localhost:3000/calibre/calibre/snapshots/42 | | api | Completed 9:00pm 3-Jul-2019
441 | http://localhost:3000/calibre/calibre/snapshots/41 | | api | Completed 10:00am 3-Jul-2019
540 | http://localhost:3000/calibre/calibre/snapshots/40 | | api | Completed 5:00pm 2-Jul-2019
639 | http://localhost:3000/calibre/calibre/snapshots/39 | | api | Completed 4:00pm 2-Jul-2019
738 | http://localhost:3000/calibre/calibre/snapshots/38 | | api | Completed 8:00pm 1-Jul-2019
8To see snapshots after 38, run: calibre site snapshots --site=calibre --cursor=MjU
ParameterRequiredDescription
siteYesSite slug, found in site settings
countNoThe number of records to return, maximum: 500
cursorNoThe cursor to fetch records after

Delete snapshot

Required API Permission: Delete Snapshots

You can delete a snapshot with the CLI, Node.js API or GraphQL API.

1calibre site delete-snapshot --site=<site> --id-<id> --confirm
Example Response
1✔ Snapshot deleted: 42
ParameterRequiredDescription
siteYesSite slug, found in site settings
idYesThe id of the snapshot

Retrieve snapshot

You can retrieve a snapshot with the HTTP Site API.

1curl -X GET -H "Accept: application/json" \
2https://calibreapp.com/api/sites/<site>/snapshots/<id>?secret=<secret>
Example Response
1{
2 "id": 62,
3 "generated_at": "2019-07-18T10:06:47Z",
4 "organisation_id": "calibre",
5 "site_id": "calibre",
6 "primary_region_id": "local",
7 "ref": null,
8 "client": "api",
9 "status": null,
10 "html_url": "http://localhost:3000/calibre/calibre/snapshots/62",
11 "url": "http://localhost:3000/api/sites/calibre/snapshots/62.json",
12 "created_at": "2019-07-18T09:50:46.966Z",
13 "pages": [
14 {
15 "id": "home",
16 "name": "Home",
17 "status": "scheduled",
18 "endpoint": "https://calibreapp.com",
19 "canonical": true,
20 "profile": "MotoG4, 3G connection",
21 "metrics": [],
22 "budget_alerts": null,
23 "artifacts": { "filmstrip": { "thumbs": [], "video": "" }, "har": "" }
24 },
25 {
26 "id": "home",
27 "name": "Home",
28 "status": "scheduled",
29 "endpoint": "https://calibreapp.com",
30 "canonical": true,
31 "profile": "Chrome Desktop",
32 "metrics": [],
33 "budget_alerts": null,
34 "artifacts": { "filmstrip": { "thumbs": [], "video": "" }, "har": "" }
35 }
36 ]
37}
ParameterRequiredDescription
siteYesSite slug, found in site settings
idYesThe id of the snapshot

Related Articles