Snapshots

A snapshot is a point-in-time frozen copy of your local filesystem data.

Basic Operations

Snapshot may be listed, found, created, and destroyed from the API.

List Snapshots

Send this request to get back a list of all snapshots.

Request Object

+ URL
  /api/v2/snapshot

+ Method
  GET

+ Headers
  Content-Type: application/json
  token: ThisIsNotARealTokenGenerateYourOwnToken

+ Body
  {}

Response Object

The response will be an array of all snapshots

+ Headers
  X-Powered-By: OpenDrives
  Access-Control-Allow-Origin: *
  Content-Type: application/json; charset=utf-8

+ Body
  [
    {
      "name": "C01/C01@od-backup-HoldTest-20200919-115907",
      "used": 0,
      "refer": 31568009625,
      "mountpoint": "-",
      "userrefs": 0,
      "created": "Sat Sep 19 11:59 2020",
      "guid": "4818110842961919660",
      "fs": "C01/C01",
      "time": "115907",
      "date": "20200919",
      "service": "od-backup-HoldTest.service"
    },
    {
      "name": "C01/a_-_--_----_@od-backup-HoldTest-20200919-115907",
      "used": 0,
      "refer": 24576,
      "mountpoint": "-",
      "userrefs": 0,
      "created": "Sat Sep 19 11:59 2020",
      "guid": "1816984970525674838",
      "fs": "C01/a_-_--_----_",
      "time": "115907",
      "date": "20200919",
      "service": "od-backup-HoldTest.service"
    },
    {
      "name": "C01/C01@od-backup-HoldTest-20200919-115807",
      "used": 0,
      "refer": 31568009625,
      "mountpoint": "-",
      "userrefs": 0,
      "created": "Sat Sep 19 11:58 2020",
      "guid": "17021946417192191770",
      "fs": "C01/C01",
      "time": "115807",
      "date": "20200919",
      "service": "od-backup-HoldTest.service"
    }
  ]

Find Snapshots

You can formulate a request to find snapshots matching a certain label or filesystem.

Request Object

+ URL
  /api/v2/snapshot/find

+ Method
  POST

+ Parameters
  fs (string, required, Body) - the filesystem to find snapshots on
  label (string, optional, Body) - a string to match on the snapshot's name field

+ Headers
  Content-Type: application/json
  token: ThisIsNotARealTokenGenerateYourOwnToken

+ Body
  {
    "fs": "C01/C01",
    "label": "HoldTest"
  }

Response Object

The response will be an array of snapshots matching your find query.

+ Headers
  X-Powered-By: OpenDrives
  Access-Control-Allow-Origin: *
  Content-Type: application/json; charset=utf-8

+ Body
  [
    {
      "name": "C01/C01@od-backup-HoldTest-20200919-115907",
      "created": "Sat Sep 19 11:59 2020",
      "fs": "C01/C01",
      "time": "115907",
      "date": "20200919",
      "label": "od-backup-HoldTest"
    },
    {
      "name": "C01/C01@od-backup-HoldTest-20200919-115807",
      "created": "Sat Sep 19 11:58 2020",
      "fs": "C01/C01",
      "time": "115807",
      "date": "20200919",
      "label": "od-backup-HoldTest"
    },
    {
      "name": "C01/C01@od-backup-HoldTest-20200919-115707",
      "created": "Sat Sep 19 11:57 2020",
      "fs": "C01/C01",
      "time": "115707",
      "date": "20200919",
      "label": "od-backup-HoldTest"
    },
    {
      "name": "C01/C01@od-backup-HoldTest-20200919-115607",
      "created": "Sat Sep 19 11:56 2020",
      "fs": "C01/C01",
      "time": "115607",
      "date": "20200919",
      "label": "od-backup-HoldTest"
    },
    {
      "name": "C01/C01@od-backup-HoldTest-20200919-115507",
      "created": "Sat Sep 19 11:55 2020",
      "fs": "C01/C01",
      "time": "115507",
      "date": "20200919",
      "label": "od-backup-HoldTest"
    },
    {
      "name": "C01/C01@od-backup-HoldTest-20200919-115407",
      "created": "Sat Sep 19 11:54 2020",
      "fs": "C01/C01",
      "time": "115407",
      "date": "20200919",
      "label": "od-backup-HoldTest"
    },
    {
      "name": "C01/C01@od-backup-HoldTest-20200919-115307",
      "created": "Sat Sep 19 11:53 2020",
      "fs": "C01/C01",
      "time": "115307",
      "date": "20200919",
      "label": "od-backup-HoldTest"
    },
    {
      "name": "C01/C01@od-backup-HoldTest-20200919-115207",
      "created": "Sat Sep 19 11:52 2020",
      "fs": "C01/C01",
      "time": "115207",
      "date": "20200919",
      "label": "od-backup-HoldTest"
    }
  ]

Most Recent Snapshots

You can formulate a request to find the most recent snapshots matching a certain label or filesystem.

Request Object

+ URL
  /api/v2/snapshot/most_recent

+ Method
  POST

+ Parameters
  fs (string, required, Body) - the filesystem to find snapshots on
  label (string, optional, Body) - a string to match on the snapshot's name field

+ Headers
  Content-Type: application/json
  token: ThisIsNotARealTokenGenerateYourOwnToken

+ Body
  {
    "fs": "C01/C01",
    "label": "HoldTest"
  }

Response Object

The response will be an object of the most recent snapshot matching your find query.

+ Headers
  X-Powered-By: OpenDrives
  Access-Control-Allow-Origin: *
  Content-Type: application/json; charset=utf-8

+ Body
  {
    "name": "C01/C01@od-backup-HoldTest-20200919-115907",
    "creation": "2020-09-19T18:59:00.000Z"
  }

View Snapshot Details

You can formulate a request to find details of a snapshot by name

Request Object

+ URL
  /api/v2/snapshot/details

+ Method
  POST

+ Parameters
  snapshotName (string, required, Body) - the name of the snapshot

+ Headers
  Content-Type: application/json
  token: ThisIsNotARealTokenGenerateYourOwnToken

+ Body
  {
    "snapshotName": "C01/C01@od-backup-HoldTest-20200919-115907"
  }

Response Object

The response will be an an array containing the object representing the snapshot you requested details on.

+ Headers
  X-Powered-By: OpenDrives
  Access-Control-Allow-Origin: *
  Content-Type: application/json; charset=utf-8

+ Body
  [
    {
      "name": "C01/C01@od-backup-HoldTest-20200919-115907",
      "used": "0B",
      "avail": "-",
      "refer": "29.4G",
      "mountpoint": "-",
      "userrefs": "0",
      "created": "Sat Sep 19 11:59 2020",
      "guid": "4818110842961919660",
      "fs": "C01/C01",
      "time": "115907",
      "date": "20200919",
      "label": "od-backup-HoldTest"
    }
  ]

Create a Snapshot

Creating a snapshot creates a 'marker' in time that you can revert to or send off for data replication.

Request Object

+ URL
  /api/v2/snapshot/create

+ Method
  POST

+ Parameters
  fs (string, required, Body) - the filesystem to create a snapshots on
  label (string, required, Body) - a label for the snapshot

+ Headers
  Content-Type: application/json
  token: ThisIsNotARealTokenGenerateYourOwnToken

+ Body
  {
    "fs":"C01/C01",
    "label":"testSnap"
  }

Response Object

The response will be the name of your new snapshot

+ Headers
  X-Powered-By: OpenDrives
  Access-Control-Allow-Origin: *
  Content-Type: application/json; charset=utf-8

+ Body
  "C01/C01@testSnap-20200925-135123"

Destroy a Snapshot

Destroying a snapshot removes the 'marker' in time you have previously created.

Request Object

+ URL
  /api/v2/snapshot/destroy

+ Method
  POST

+ Parameters
  snapshot (string, required, Body) - the name of the snapshot to remove

+ Headers
  Content-Type: application/json
  token: ThisIsNotARealTokenGenerateYourOwnToken

+ Body
  {
    "snapshot": "C01/C01@testSnap-20200925-135123"
  }

Response Object

The response will be a confirmation of your snapshot name

+ Headers
  X-Powered-By: OpenDrives
  Access-Control-Allow-Origin: *
  Content-Type: application/json; charset=utf-8

+ Body
  {
    "snapshot": "C01/C01@testSnap-20200925-135123"
  }

Advanced Operations

Snapshot may be 'locked' or 'unlocked'. A locked snapshot may not be destroyed without first unlocking it. You may also view the differences between two snapshots or a snapshot and the live filesystem.

Lock a Snapshot

Locking a snapshot disallows someone from destroying it without first unlocking it

Request Object

+ URL
  /api/v2/snapshot/hold

+ Method
  POST

+ Parameters
  snapshot (string, required, Body) - the name of the snapshot to hold

+ Headers
  Content-Type: application/json
  token: ThisIsNotARealTokenGenerateYourOwnToken

+ Body
  {
    "snapshot": "C01/C01@lockTest-20200925-135734"
  }

Response Object

The response will be a confirmation of your snapshot that you locked

+ Headers
  X-Powered-By: OpenDrives
  Access-Control-Allow-Origin: *
  Content-Type: application/json; charset=utf-8

+ Body
  {
    "snapshot": "C01/C01@lockTest-20200925-135734"
  }

Unlock a Snapshot

Unlocking a snapshot allows someone to destroy it.

Request Object

+ URL
  /api/v2/snapshot/release

+ Method
  POST

+ Parameters
  snapshot (string, required, Body) - the name of the snapshot to release

+ Headers
  Content-Type: application/json
  token: ThisIsNotARealTokenGenerateYourOwnToken

+ Body
  {
    "snapshot": "C01/C01@lockTest-20200925-135734"
  }

Response Object

The response will be a confirmation of your snapshot that you unlocked

+ Headers
  X-Powered-By: OpenDrives
  Access-Control-Allow-Origin: *
  Content-Type: application/json; charset=utf-8

+ Body
  {
    "snapshot": "C01/C01@lockTest-20200925-135734"
  }

View differences of Snapshots

You may compare two snapshots together, or a snapshot and the live filesystem

Request Object

+ URL
  /api/v2/snapshot/diff

+ Method
  POST

+ Parameters
  snapshot (string, required, Body) - the name of the snapshot to compare
  reference (string, optional, Body) - the snapshot or filesystem to reference against

+ Headers
  Content-Type: application/json
  token: ThisIsNotARealTokenGenerateYourOwnToken

+ Body
  {
    "snapshot": "C01/C01@lockTest-20200925-135734",
    "reference": "C01/C01"
  }

Response Object

The response will be a breakdown of all changes

+ Headers
  X-Powered-By: OpenDrives
  Access-Control-Allow-Origin: *
  Content-Type: application/json; charset=utf-8

+ Body
  [
    {
      "change_time": "1601067709.659362939",
      "change_type": "M",
      "file_type": "/",
      "file_name": "/C01/C01/"
    },
    {
      "change_time": "1601067706.123424794",
      "change_type": "+",
      "file_type": "F",
      "file_name": "/C01/C01/new_file.txt"
    },
    {
      "change_time": "1601067729.683012667",
      "change_type": "+",
      "file_type": "F",
      "file_name": "/C01/C01/new_directory/1.txt"
    },
    {
      "change_time": "1601067720.979164923",
      "change_type": "+",
      "file_type": "F",
      "file_name": "/C01/C01/new_directory/2.txt"
    },
    {
      "change_time": "1601067729.683012667",
      "change_type": "+",
      "file_type": "/",
      "file_name": "/C01/C01/new_directory"
    }
  ]