Snapshots endpoint

Snapshots documentation

Fetch all snapshots

snapshots(project_id[, params = None])
Parameters:
Returns:

Collection of snapshots

Example:

snapshots = client.snapshots('123.abc', {"page": 2, "limit": 1})
snapshots.items[0].snapshot_id # => 163512

Create a snapshot

create_snapshot(project_id[, params = None])
Parameters:
  • project_id (str) – ID of the project

  • params (dict) – (optional) Request params

Returns:

Snapshot model

Example:

snapshot = client.create_snapshot('123.abc', {"title": "Python snapshot"})
snapshot.title # => "Python snapshot"

Restore a snapshot

restore_snapshot(project_id, snapshot_id)

Note that the snapshot will be restored to the project copy, not to the initial project.

Example:

project = client.restore_snapshot('123.abc', 34567)
project.project_id != '123.abc' # => True
project.name # => "MyProject copy"

Delete a snapshot

delete_snapshot(project_id, snapshot_id)
Parameters:
  • project_id (str) – ID of the project

  • snapshot_id – ID of the snapshot to delete

Returns:

Dictionary with project ID and “snapshot_deleted” set to True

Rtype dict:

Example:

client.delete_snapshot('123.abc', 34567)