Snapshots

Snapshots allow you to create a read-only archive of files at a specific point in time. You can define a snapshot, add files to it, and then finalize it. Once finalized, the snapshot’s contents are immutable.

Each snapshot may have an expiration date. When the expiration date is reached, the snapshot is automatically deleted from the Files.com platform.

List Snapshots

Command

files-cli snapshots list

Output

Outputs a list of Snapshot objects according to the output format.

Authorization Requirement

Available to all authenticated keys or sessions.

Additional Arguments

Example Request

files-cli snapshots list

Show Snapshot

Command

files-cli snapshots find

Output

Outputs a Snapshot object according to the output format.

Authorization Requirement

Available to all authenticated keys or sessions.

Flags

FlagDescription
--id=
int64
Required
Snapshot ID.

Example Request

files-cli snapshots find \
  --id=1

Create Snapshot

Command

files-cli snapshots create

Output

Outputs a Snapshot object according to the output format.

Authorization Requirement

Available to all authenticated keys or sessions.

Flags

FlagDefaultDescription
--expires-at=
string
When the snapshot expires.
--name=
string
A name for the snapshot.
--paths=
array(string)
An array of paths to add to the snapshot.
--workspace-id=
int64
0Workspace ID. 0 means the default workspace.

Example Request

files-cli snapshots create \
  --expires-at="2000-01-01T01:00:00Z"

Finalize Snapshot

Command

files-cli snapshots finalize

Output

No output is returned.

Authorization Requirement

Available to all authenticated keys or sessions.

Flags

FlagDescription
--id=
int64
Required
Snapshot ID.

Example Request

files-cli snapshots finalize \
  --id=1

Update Snapshot

Command

files-cli snapshots update

Output

Outputs a Snapshot object according to the output format.

Authorization Requirement

Available to all authenticated keys or sessions.

Flags

FlagDescription
--id=
int64
Required
Snapshot ID.
--expires-at=
string
When the snapshot expires.
--name=
string
A name for the snapshot.
--paths=
array(string)
An array of paths to add to the snapshot.

Example Request

files-cli snapshots update \
  --id=1 \
  --expires-at="2000-01-01T01:00:00Z"

Delete Snapshot

Command

files-cli snapshots delete

Output

No output is returned.

Authorization Requirement

Available to all authenticated keys or sessions.

Flags

FlagDescription
--id=
int64
Required
Snapshot ID.

Example Request

files-cli snapshots delete \
  --id=1

The Snapshot Object

Some of the commands above return a Snapshot object. The attributes of this object are listed below.

AttributeDescription
id
int64
The snapshot's unique ID.
expires_at
date-time
When the snapshot expires.
finalized_at
date-time
When the snapshot was finalized.
name
string
A name for the snapshot.
user_id
int64
The user that created this snapshot, if applicable.
bundle_id
int64
The bundle using this snapshot, if applicable.
workspace_id
int64
Workspace ID. 0 means the default workspace.