Create a Snapshot#
Create Snapshots
You can create snapshots with the CLI, Node.js API, HTTP Site API or GraphQL API.
calibre site create-snapshot --site=<site> --ref=<ref>import { Snapshot } from 'calibre'
await Snapshot.create({
site: '<site>',
ref: '<ref>'
})curl -X POST -H "Accept: application/json" \
https://calibreapp.com/api/sites/<site>/snapshots?secret=<secret>&ref=<ref>Example Response#
✔ Snapshot created: 1588{
"iid": 1588,
"ref": null,
"htmlUrl": "https://calibreapp.com/my-org/my-site/snapshots/1589",
"createdAt": "2018-01-01T16:20:00Z"
}{
"id": 62,
"generated_at": "2019-07-18T09:50:47Z",
"organisation_id": "calibre",
"site_id": "calibre",
"primary_region_id": "NorthVirginia",
"ref": null,
"client": "api",
"status": null,
"html_url": "https://calibreapp.com/calibre/calibre/snapshots/62",
"url": "https://calibreapp.com/api/sites/calibre/snapshots/62.json",
"created_at": "2019-07-18T09:50:46.966Z",
"pages": [
{
"uuid": "xxx-123-456-789-xxx",
"name": "Home",
"status": "scheduled",
"endpoint": "https://calibreapp.com",
"canonical": true,
"profile": "MotoG4, 3G connection",
"metrics": [],
"budget_alerts": null,
"artifacts": { "filmstrip": { "thumbs": [], "video": "" }, "har": "" }
},
{
"uuid": "xxx-123-456-789-xxx",
"name": "Home",
"status": "scheduled",
"endpoint": "https://calibreapp.com",
"canonical": true,
"profile": "Chrome Desktop",
"metrics": [],
"budget_alerts": null,
"artifacts": { "filmstrip": { "thumbs": [], "video": "" }, "har": "" }
}
]
}| Parameter | Required | Description |
|---|---|---|
| site | Yes | The site slug |
| ref | No | A reference identifier (e.g. commit SHA or version number) |
List Snapshots#
Read Sites
You can list Snapshots with the CLI, Node.js API, GraphQL API or by using the HTTP Site API.
calibre site snapshots --site=<site> --count=<count> --cursor=<cursor>import { Snapshot } from 'calibre'
await Snapshot.list({
site: '<site>',
count: <count>,
cursor: '<cursor>'
})curl -X GET -H "Accept: application/json" \
https://calibreapp.com/api/sites/<site>/snapshots?secret=<secret>Snapshot Status#
The status of the Snapshot will be one of:
scheduled: the Snapshot has been scheduled, no tests are running.running: at least one test is running.verifying: at least one test is being verified.errored: all tests completed, and at least one test errored or failed.completed: all tests completed successfully.
Download Snapshot artifacts#
Read Page Tests
For each Snapshot, Calibre stores the following information:
lighthouse.json- screenshots
- video render
- HAR file
- all other metrics and data available through the interface
You can download Snapshot artifacts with the CLI. Files will be saved to snapshot-artifacts directory.
CLI
calibre site download-snapshot-artifacts --site=<site> --id=<id>Delete a Snapshot#
Delete Snapshots
You can delete a Snapshot with the CLI, Node.js API or GraphQL API.
calibre site delete-snapshot --site=<site> --id-<id> --confirmimport { Snapshot } from 'calibre'
await Snapshot.destroy({
site: '<site>',
id: '<id>'
})Example Response#
✔ Snapshot deleted: 42{
"iid": 42
}Retrieve a Snapshot#
See the Retrieving Metrics guide for more details.