Storage

Resources related to storage.

Volume

The Volume resource represents ZFS pools and UFS volumes.

List resource

GET /api/v1.0/storage/volume/

Returns a list of all interfaces.

Example request:

GET /api/v1.0/storage/volume/ HTTP/1.1
Content-Type: application/json

Example response:

HTTP/1.1 200 OK
Vary: Accept
Content-Type: application/json

[
  {
          "status": "HEALTHY",
          "vol_guid": "8443409799014097611",
          "used": "192.0 KiB (0%)",
          "name": "tank",
          "used_pct": "0%",
          "used_si": "192.0 KiB",
          "id": 1,
          "vol_encryptkey": "",
          "vol_name": "tank",
          "is_decrypted": true,
          "avail_si": "4.9 GiB",
          "mountpoint": "/mnt/tank",
          "vol_encrypt": 0,
          "children": [],
          "total_si": "4.9 GiB"
  }
]
Query Parameters:
 
  • offset – offset number. default is 0
  • limit – limit number. default is 20
Response Headers:
 
  • Content-Type – content type of the response
Status Codes:
  • 200 – no error

Create resource

POST /api/v1.0/storage/volume/

Creates a new volume and returns the new volume object.

Example request:

POST /api/v1.0/storage/volume/ HTTP/1.1
Content-Type: application/json

  {
          "volume_name": "tank",
          "layout": [
                  {
                          "vdevtype": "stripe",
                          "disks": ["ada1", "ada2"]
                  }
          ]
  }

Example response:

HTTP/1.1 201 Created
Vary: Accept
Content-Type: application/json

  {
          "status": "HEALTHY",
          "vol_guid": "8443409799014097611",
          "used": "192.0 KiB (0%)",
          "name": "tank",
          "used_pct": "0%",
          "used_si": "192.0 KiB",
          "id": 1,
          "vol_encryptkey": "",
          "vol_name": "tank",
          "is_decrypted": true,
          "avail_si": "4.9 GiB",
          "mountpoint": "/mnt/tank",
          "vol_encrypt": 0,
          "children": [],
          "total_si": "4.9 GiB"
  }
JSON Parameters:
 
  • volume_name (string) – name of the volume
  • layout (list) – list of vdevs composed of “vdevtype” (stripe, mirror, raidz, raidz2, raidz3) and disks (list of disk names)
Request Headers:
 
  • Content-Type – the request content type
Response Headers:
 
  • Content-Type – the response content type
Status Codes:
  • 201 – no error

Delete resource

DELETE /api/v1.0/storage/volume/(int: id)/

Delete volume id.

Example request:

DELETE /api/v1.0/storage/volume/1/ HTTP/1.1
Content-Type: application/json

  {
          "destroy": true,
          "cascade": true,
  }

Example response:

HTTP/1.1 204 No Response
Vary: Accept
Content-Type: application/json
JSON Parameters:
 
  • destroy (boolean) – destroy the volume
  • cascade (boolean) – destroy the shares related to the volume
Status Codes:
  • 204 – no error

Datasets

POST /api/v1.0/storage/volume/(int:id|string:name)/datasets/

Create dataset for volume id.

Example request:

POST /api/v1.0/storage/volume/tank/datasets/ HTTP/1.1
Content-Type: application/json

{
  "name": "myds"
}

Example response:

HTTP/1.1 202 Accepted
Vary: Accept
Content-Type: application/json

{
  "atime": "on",
  "avail": 3848491008,
  "comments": "Test",
  "compression": "lz4",
  "dedup": "off",
  "inherit_props": [
    "compression",
    "aclinherit"
  ],
  "mountpoint": "/mnt/tank/myds",
  "name": "tank/myds",
  "pool": "tank",
  "quota": 0,
  "readonly": "off",
  "recordsize": 131072,
  "refer": 90112,
  "refquota": 0,
  "refreservation": 0,
  "reservation": 0,
  "used": 90112
}
JSON Parameters:
 
  • name (string) – name of the dataset
  • comments (string) – user comments for the dataset
  • compression (string) – compression level (lz4, gzip-[1-9], zle, lzjb)
  • dedup (string) – dedup (on, off, inherit)
  • atime (string) – access time (on, off, inherit)
  • readonly (string) – read only (on, off, inherit)
  • recordsize (string) – recodsize (512, 1K, 2K, 4K, 8k, 16K, 32K, 64K, 128K, 256K, 512K, 1024K)
  • case_sensitivity (string) – files case sensitivity (on, off, inherit)
  • quote (string) – quota for this dataset and all children
  • refquote (string) – quota for this dataset
  • reservation (string) – reserved space for this dataset and all children
  • refreservation (string) – reserved space for this dataset
  • readonly – read only (on, off, inherit)
Response Headers:
 
  • Content-Type – content type of the response
Status Codes:
  • 201 – no error
PUT /api/v1.0/storage/volume/(int:id|string:name)/datasets/myds/

Create dataset for volume id.

Example request:

POST /api/v1.0/storage/volume/tank/datasets/myds/ HTTP/1.1
Content-Type: application/json

{
  "comments": "Test DS"
}

Example response:

HTTP/1.1 202 Accepted
Vary: Accept
Content-Type: application/json

{
  "atime": "on",
  "avail": 3848491008,
  "comments": "Test DS",
  "compression": "lz4",
  "dedup": "off",
  "inherit_props": [
    "compression",
    "aclinherit"
  ],
  "mountpoint": "/mnt/tank/myds",
  "name": "tank/myds",
  "pool": "tank",
  "quota": 0,
  "readonly": "off",
  "recordsize": 131072,
  "refer": 90112,
  "refquota": 0,
  "refreservation": 0,
  "reservation": 0,
  "used": 90112
}
JSON Parameters:
 
  • name (string) – name of the dataset
  • comments (string) – user comments for the dataset
  • compression (string) – compression level (lz4, gzip-[1-9], zle, lzjb)
  • dedup (string) – dedup (on, off, inherit)
  • atime (string) – access time (on, off, inherit)
  • readonly (string) – read only (on, off, inherit)
  • recordsize (string) – recodsize (512, 1K, 2K, 4K, 8k, 16K, 32K, 64K, 128K, 256K, 512K, 1024K)
  • case_sensitivity (string) – files case sensitivity (on, off, inherit)
  • quote (string) – quota for this dataset and all children
  • refquote (string) – quota for this dataset
  • reservation (string) – reserved space for this dataset and all children
  • refreservation (string) – reserved space for this dataset
  • readonly – read only (on, off, inherit)
Response Headers:
 
  • Content-Type – content type of the response
Status Codes:
  • 201 – no error
GET /api/v1.0/storage/volume/(int:id|string:name)/datasets/

Get datasets for volume id.

Example request:

GET /api/v1.0/storage/volume/tank/datasets/ HTTP/1.1
Content-Type: application/json

Example response:

HTTP/1.1 200 OK
Vary: Accept
Content-Type: application/json

[
  {
    "atime": "on",
    "avail": 3850371072,
    "comments": "Test DS",
    "compression": "lz4",
    "dedup": "off",
    "inherit_props": [
      "compression",
      "aclinherit"
    ],
    "mountpoint": "/mnt/tank/myds",
    "name": "tank/myds",
    "pool": "tank",
    "quota": 0,
    "readonly": "off",
    "recordsize": 131072,
    "refer": 90112,
    "refquota": 0,
    "refreservation": 0,
    "reservation": 0,
    "used": 90112
  }
]
Response Headers:
 
  • Content-Type – content type of the response
Status Codes:
  • 200 – no error
DELETE /api/v1.0/storage/volume/(int:id|string:name)/datasets/(string: dsname)/

Delete dataset dsname of the volume id.

Example request:

DELETE /api/v1.0/storage/volume/tank/datasets/test/ HTTP/1.1
Content-Type: application/json

Example response:

HTTP/1.1 204 No Response
Vary: Accept
Content-Type: application/json
Response Headers:
 
  • Content-Type – content type of the response
Status Codes:
  • 204 – no error

Import

GET /api/v1.0/storage/volume_import/

Get list of importable volumes.

Example request:

GET /api/v1.0/storage/volume_import/ HTTP/1.1
Content-Type: application/json

Example response:

HTTP/1.1 200 OK
Vary: Accept
Content-Type: application/json

[
    {
        "disks": {
            "status": "ONLINE",
            "numVdevs": 1,
            "name": "test",
            "vdevs": [
                {
                    "status": "ONLINE",
                    "disks": [
                        {
                            "status": "ONLINE",
                            "name": "ada2p1"
                        }
                    ],
                    "type": "stripe",
                    "name": "stripe",
                    "numDisks": 1
                }
            ]
        },
        "log": null,
        "cache": null,
        "label": "test",
        "spare": null,
        "type": "zfs",
        "id": "test|15955869083029286480",
        "group_type": "none"
    }
]
Response Headers:
 
  • Content-Type – content type of the response
Status Codes:
  • 200 – no error
POST /api/v1.0/storage/volume_import/

Import volume.

Example request:

POST /api/v1.0/storage/volume_import/ HTTP/1.1
Content-Type: application/json

{
     "volume_id": "test|15955869083029286480"
}

Example response:

HTTP/1.1 202 Accepted
Vary: Accept
Content-Type: application/json

"Volume imported."
Response Headers:
 
  • Content-Type – content type of the response
Status Codes:
  • 202 – no error

ZFS Volumes

POST /api/v1.0/storage/volume/(int:id|string:name)/zvols/

Create zvol for volume id.

Example request:

POST /api/v1.0/storage/volume/tank/zvols/ HTTP/1.1
Content-Type: application/json

{
  "comments": "FreeNAS ZVOL",
  "name": "fnzvol",
  "volsize": "10M",
  "compression": "gzip-9",
  "sparse": true,
  "force": true,
  "blocksize": "4K"
}

Example response:

HTTP/1.1 202 Accepted
Vary: Accept
Content-Type: application/json

{
  "avail": 4059471872,
  "comments": "FreeNAS ZVOL",
  "compression": "gzip-9",
  "dedup": "off",
  "name": "fnzvol",
  "refer": 57344,
  "used": 57344,
  "volsize": 10485760
}
Response Headers:
 
  • Content-Type – content type of the response
Status Codes:
  • 201 – no error
GET /api/v1.0/storage/volume/(int:id|string:name)/zvols/

Get zvols for volume id.

Example request:

GET /api/v1.0/storage/volume/tank/zvols/ HTTP/1.1
Content-Type: application/json

Example response:

HTTP/1.1 202 Accepted
Vary: Accept
Content-Type: application/json

[{
  "name": "fnzvol",
  "comments": "FreeNAS ZVOL",
  "avail": 7286996992,
  "compression": "gzip-9",
  "dedup": "off",
  "refer": 57344,
  "used": 57344,
  "volsize": 10485760
}]
Response Headers:
 
  • Content-Type – content type of the response
Status Codes:
  • 200 – no error
PUT /api/v1.0/storage/volume/(int:id|string:name)/zvols/(string: name)/

Update zvol name for volume id.

Example request:

PUT /api/v1.0/storage/volume/tank/zvols/fnzvol/ HTTP/1.1
Content-Type: application/json

{
  "volsize": "20M"
}

Example response:

HTTP/1.1 200 OK
Vary: Accept
Content-Type: application/json

{
  "name": "fnzvol",
  "comments": "FreeNAS ZVOL",
  "avail": 7286996992,
  "compression": "gzip-9",
  "dedup": "off",
  "refer": 57344,
  "used": 57344,
  "volsize": 20971520
}
JSON Parameters:
 
  • compression (string) – type of compression
  • dedup (string) – on/off
  • volsize (string) – size of the zvol
Response Headers:
 
  • Content-Type – content type of the response
Status Codes:
  • 201 – no error
GET /api/v1.0/storage/volume/(int:id|string:name)/zvols/

Get zvols for volume id.

Example request:

GET /api/v1.0/storage/volume/tank/zvols/ HTTP/1.1
Content-Type: application/json

Example response:

HTTP/1.1 202 Accepted
Vary: Accept
Content-Type: application/json

[{
  "name": "myzvol",
  "volsize": 10485760
}]
Response Headers:
 
  • Content-Type – content type of the response
Status Codes:
  • 200 – no error
DELETE /api/v1.0/storage/volume/(int:id|string:name)/zvols/(string: name)/

Delete zvol name of the volume id.

Example request:

DELETE /api/v1.0/storage/volume/tank/zvols/myzvol/ HTTP/1.1
Content-Type: application/json

Example response:

HTTP/1.1 204 No Response
Vary: Accept
Content-Type: application/json
Response Headers:
 
  • Content-Type – content type of the response
Status Codes:
  • 204 – no error

Scrub

POST /api/v1.0/storage/volume/(int:id|string:name)/scrub/

Start scrub for volume id.

Example request:

POST /api/v1.0/storage/volume/tank/scrub/ HTTP/1.1
Content-Type: application/json

Example response:

HTTP/1.1 202 Accepted
Vary: Accept
Content-Type: application/json

Volume scrub started.
Response Headers:
 
  • Content-Type – content type of the response
Status Codes:
  • 202 – no error
DELETE /api/v1.0/storage/volume/(int:id|string:name)/scrub/

Stop scrub for volume id.

Example request:

DELETE /api/v1.0/storage/volume/tank/scrub/ HTTP/1.1
Content-Type: application/json

Example response:

HTTP/1.1 202 Accepted
Vary: Accept
Content-Type: application/json

Volume scrub stopped.
Response Headers:
 
  • Content-Type – content type of the response
Status Codes:
  • 202 – no error

Upgrade

POST /api/v1.0/storage/volume/(int:id|string:name)/upgrade/

Upgrade version of volume id.

Example request:

POST /api/v1.0/storage/volume/tank/upgrade/ HTTP/1.1
Content-Type: application/json

Example response:

HTTP/1.1 202 Accepted
Vary: Accept
Content-Type: application/json

Volume has been upgraded.
Response Headers:
 
  • Content-Type – content type of the response
Status Codes:
  • 202 – no error

Replace disk

POST /api/v1.0/storage/volume/(int:id|string:name)/replace/

Replace a disk of volume id.

Example request:

POST /api/v1.0/storage/volume/tank/replace/ HTTP/1.1
Content-Type: application/json

  {
          "label": "gptid/7c4dd4f1-1a1f-11e3-9786-080027c5e4f4",
          "replace_disk": "ada4"
  }

Example response:

HTTP/1.1 202 Accepted
Vary: Accept
Content-Type: application/json

Disk replacement started.
JSON Parameters:
 
  • label (string) – zfs label of the device
  • replace_disk (string) – name of the new disk
Response Headers:
 
  • Content-Type – content type of the response
Status Codes:
  • 200 – no error

Detach disk

POST /api/v1.0/storage/volume/(int:id|string:name)/detach/

Detach a disk of volume id.

Example request:

POST /api/v1.0/storage/volume/tank/detach/ HTTP/1.1
Content-Type: application/json

  {
          "label": "gptid/7c4dd4f1-1a1f-11e3-9786-080027c5e4f4",
  }

Example response:

HTTP/1.1 202 Accepted
Vary: Accept
Content-Type: application/json

Disk detached.
JSON Parameters:
 
  • label (string) – zfs label of the device
Response Headers:
 
  • Content-Type – content type of the response
Status Codes:
  • 200 – no error

Unlock

POST /api/v1.0/storage/volume/(int:id|string:name)/unlock/

Unlock encrypted volume id.

Example request:

POST /api/v1.0/storage/volume/tank/unlock/ HTTP/1.1
Content-Type: application/json

  {
          "passphrase": "mypassphrase",
  }

Example response:

HTTP/1.1 202 Accepted
Vary: Accept
Content-Type: application/json

Volume has been unlocked.
JSON Parameters:
 
  • passphrase (string) – passphrase to unlock the volume
Response Headers:
 
  • Content-Type – content type of the response
Status Codes:
  • 202 – no error

Lock

POST /api/v1.0/storage/volume/(int:id|string:name)/lock/

Lock encrypted volume id.

Example request:

POST /api/v1.0/storage/volume/tank/lock/ HTTP/1.1
Content-Type: application/json

Example response:

HTTP/1.1 202 Accepted
Vary: Accept
Content-Type: application/json

Volume has been locked.
Response Headers:
 
  • Content-Type – content type of the response
Status Codes:
  • 202 – no error

Recovery Key

POST /api/v1.0/storage/volume/(int:id|string:name)/recoverykey/

Add a recovery key for volume id.

Example request:

POST /api/v1.0/storage/volume/tank/recoverykey/ HTTP/1.1
Content-Type: application/json

Example response:

HTTP/1.1 202 Accepted
Vary: Accept
Content-Type: application/json

  {
          "message": "New recovery key has been added.",
          "content": "YWRhc2RzYWRhc2RzYWQ="
  }
Response Headers:
 
  • Content-Type – content type of the response
Status Codes:
  • 202 – no error
DELETE /api/v1.0/storage/volume/(int:id|string:name)/recoverykey/

Remove a recovery key for volume id.

Example request:

DELETE /api/v1.0/storage/volume/tank/recoverykey/ HTTP/1.1
Content-Type: application/json

Example response:

HTTP/1.1 204 No Response
Vary: Accept
Content-Type: application/json
Response Headers:
 
  • Content-Type – content type of the response
Status Codes:
  • 204 – no error

Status

GET /api/v1.0/storage/volume/(int:id|string:name)/status/

Get status of volume id.

Example request:

GET /api/v1.0/storage/volume/tank/status/ HTTP/1.1
Content-Type: application/json

Example response:

HTTP/1.1 200 OK
Vary: Accept
Content-Type: application/json

  {
          "status": "ONLINE",
          "name": "tank",
          "read": "0",
          "id": 1,
          "write": "0",
          "cksum": "0",
          "pk": "tank",
          "type": "root",
          "children": [{
                  "status": "ONLINE",
                  "name": "raidz1-0",
                  "read": "0",
                  "id": 100,
                  "write": "0",
                  "cksum": "0",
                  "type": "vdev",
                  "children": [{
                          "status": "ONLINE",
                          "name": "ada3p2",
                          "read": "0",
                          "label": "gptid/7cc54b3a-1a1f-11e3-9786-080027c5e4f4",
                          "write": "0",
                          "cksum": "0",
                          "id": 101,
                          "type": "dev",
                  },
                  {
                          "status": "ONLINE",
                          "name": "ada2p2",
                          "read": "0",
                          "label": "gptid/7c8bb013-1a1f-11e3-9786-080027c5e4f4",
                          "write": "0",
                          "cksum": "0",
                          "id": 102,
                          "type": "dev",
                  },
                  {
                          "status": "ONLINE",
                          "name": "ada1p2",
                          "read": "0",
                          "label": "gptid/7c4dd4f1-1a1f-11e3-9786-080027c5e4f4",
                          "write": "0",
                          "cksum": "0",
                          "id": 103,
                          "type": "dev",
                  }]
          }]
  }
Response Headers:
 
  • Content-Type – content type of the response
Status Codes:
  • 200 – no error

Dataset

The Dataset resource represents ZFS datasets.

List resource

GET /api/v1.0/storage/dataset/

Returns a list of all datasets.

Example request:

GET /api/v1.0/storage/dataset/ HTTP/1.1
Content-Type: application/json

Example response:

HTTP/1.1 200 OK
Vary: Accept
Content-Type: application/json

[
  {
    "atime": "on",
    "avail": 3850321920,
    "comments": "Test",
    "compression": "lz4",
    "dedup": "off",
    "inherit_props": [],
    "mountpoint": "/mnt/tank",
    "name": "tank",
    "pool": "tank",
    "quota": 0,
    "readonly": "off",
    "recordsize": 131072,
    "refer": 90112,
    "refquota": 0,
    "refreservation": 0,
    "reservation": 0,
    "used": 2358296576
  },
  {
    "atime": "on",
    "avail": 3850715136,
    "comments": null,
    "compression": "lz4",
    "dedup": "off",
    "inherit_props": [
      "compression",
      "aclinherit"
    ],
    "mountpoint": "/mnt/tank/myds",
    "name": "tank/myds",
    "pool": "tank",
    "quota": 0,
    "readonly": "off",
    "recordsize": 131072,
    "refer": 90112,
    "refquota": 0,
    "refreservation": 0,
    "reservation": 0,
    "used": 90112
  }
]
Query Parameters:
 
  • offset – offset number. default is 0
  • limit – limit number. default is 20
Response Headers:
 
  • Content-Type – content type of the response
Status Codes:
  • 200 – no error

Create resource

POST /api/v1.0/storage/dataset/(string: parent)/

Creates a dataset and returns the new object.

Example request:

POST /api/v1.0/storage/dataset/tank/ HTTP/1.1
Content-Type: application/json

{
  "name": "myds",
  "comment": "Test",
}

Example response:

HTTP/1.1 201 Created
Vary: Accept
Content-Type: application/json

{
  "atime": "on",
  "avail": 3848491008,
  "comments": "Test",
  "compression": "lz4",
  "dedup": "off",
  "inherit_props": [
    "compression",
    "aclinherit"
  ],
  "mountpoint": "/mnt/tank/myds",
  "name": "tank/myds",
  "pool": "tank",
  "quota": 0,
  "readonly": "off",
  "recordsize": 131072,
  "refer": 90112,
  "refquota": 0,
  "refreservation": 0,
  "reservation": 0,
  "used": 90112
}
JSON Parameters:
 
  • name (string) – name of the dataset
  • comments (string) – user comments for the dataset
  • compression (string) – compression level (lz4, gzip-[1-9], zle, lzjb)
  • dedup (string) – dedup (on, off, inherit)
  • atime (string) – access time (on, off, inherit)
  • readonly (string) – read only (on, off, inherit)
  • recordsize (string) – recodsize (512, 1K, 2K, 4K, 8k, 16K, 32K, 64K, 128K, 256K, 512K, 1024K)
  • case_sensitivity (string) – files case sensitivity (on, off, inherit)
  • quote (string) – quota for this dataset and all children
  • refquote (string) – quota for this dataset
  • reservation (string) – reserved space for this dataset and all children
  • refreservation (string) – reserved space for this dataset
  • readonly – read only (on, off, inherit)
Request Headers:
 
  • Content-Type – the request content type
Response Headers:
 
  • Content-Type – the response content type
Status Codes:
  • 201 – no error

Update resource

POST /api/v1.0/storage/dataset/(string: parent)/

Updates a dataset and returns the object.

Example request:

POST /api/v1.0/storage/dataset/tank/myds/ HTTP/1.1
Content-Type: application/json

{
  "comment": "Test DS",
}

Example response:

HTTP/1.1 202 Accepted
Vary: Accept
Content-Type: application/json

{
  "atime": "on",
  "avail": 3848491008,
  "comments": "Test DS",
  "compression": "lz4",
  "dedup": "off",
  "inherit_props": [
    "compression",
    "aclinherit"
  ],
  "mountpoint": "/mnt/tank/myds",
  "name": "tank/myds",
  "pool": "tank",
  "quota": 0,
  "readonly": "off",
  "recordsize": 131072,
  "refer": 90112,
  "refquota": 0,
  "refreservation": 0,
  "reservation": 0,
  "used": 90112
}
JSON Parameters:
 
  • name (string) – name of the dataset
  • comments (string) – user comments for the dataset
  • compression (string) – compression level (lz4, gzip-[1-9], zle, lzjb)
  • dedup (string) – dedup (on, off, inherit)
  • atime (string) – access time (on, off, inherit)
  • readonly (string) – read only (on, off, inherit)
  • recordsize (string) – recodsize (512, 1K, 2K, 4K, 8k, 16K, 32K, 64K, 128K, 256K, 512K, 1024K)
  • case_sensitivity (string) – files case sensitivity (on, off, inherit)
  • quote (string) – quota for this dataset and all children
  • refquote (string) – quota for this dataset
  • reservation (string) – reserved space for this dataset and all children
  • refreservation (string) – reserved space for this dataset
  • readonly – read only (on, off, inherit)
Request Headers:
 
  • Content-Type – the request content type
Response Headers:
 
  • Content-Type – the response content type
Status Codes:
  • 202 – no error

Delete resource

DELETE /api/v1.0/storage/dataset/(string: name)/

Delete dataset name.

Example request:

DELETE /api/v1.0/storage/dataset/tank/myds/ HTTP/1.1
Content-Type: application/json

Example response:

HTTP/1.1 204 No Response
Vary: Accept
Content-Type: application/json
Response Headers:
 
  • Content-Type – content type of the response
Status Codes:
  • 204 – no error

Snapshot

The Snapshot resource represents ZFS snapshots.

List resource

GET /api/v1.0/storage/snapshot/

Returns a list of all snapshots.

Example request:

GET /api/v1.0/storage/snapshot/ HTTP/1.1
Content-Type: application/json

Example response:

HTTP/1.1 200 OK
Vary: Accept
Content-Type: application/json

[
  {
  "filesystem": "tank/jails/.warden-template-pluginjail-9.2-RELEASE-x64",
  "fullname": "tank/jails/.warden-template-pluginjail-9.2-RELEASE-x64@clean",
  "id": "tank/jails/.warden-template-pluginjail-9.2-RELEASE-x64@clean",
  "mostrecent": true,
  "name": "clean",
  "parent_type": "filesystem",
  "refer": "482M",
  "used": "107K"
  }
]
Query Parameters:
 
  • offset – offset number. default is 0
  • limit – limit number. default is 20
Response Headers:
 
  • Content-Type – content type of the response
Status Codes:
  • 200 – no error

Create resource

POST /api/v1.0/storage/snapshot/

Creates a new snapshot and returns the new snapshot object.

Example request:

POST /api/v1.0/storage/snapshot/ HTTP/1.1
Content-Type: application/json

  {
          "dataset": "tank",
          "name": "test",
          "recursive": true
  }

Example response:

HTTP/1.1 201 Created
Vary: Accept
Content-Type: application/json

  {
          "filesystem": "tank",
          "fullname": "tank@test",
          "id": "tank@test",
          "mostrecent": true,
          "name": "test",
          "parent_type": "filesystem",
          "refer": "298K",
          "used": "0"
  }
JSON Parameters:
 
  • dataset (string) – name of dataset to snapshot
  • name (string) – name of the snapshot
  • recursive (boolean) – True if you want it to recursively snapshot the dataset
Request Headers:
 
  • Content-Type – the request content type
Response Headers:
 
  • Content-Type – the response content type
Status Codes:
  • 201 – no error

Delete resource

DELETE /api/v1.0/storage/snapshot/(string: id)/

Delete snapshot id.

Example request:

DELETE /api/v1.0/storage/snapshot/tank@test/ HTTP/1.1
Content-Type: application/json

Example response:

HTTP/1.1 204 No Response
Vary: Accept
Content-Type: application/json
Status Codes:
  • 204 – no error

Clone snapshot

POST /api/v1.0/storage/snapshot/tank%40test/clone/

Creates a clone from a snapshot.

Example request:

POST /api/v1.0/storage/snapshot/tank%40test/clone/ HTTP/1.1
Content-Type: application/json

  {
          "name": "tank/testclone"
  }

Example response:

HTTP/1.1 202 Accepted
Vary: Accept
Content-Type: application/json

  Snapshot cloned.
JSON Parameters:
 
  • name (string) – name/path of the clone
Request Headers:
 
  • Content-Type – the request content type
Response Headers:
 
  • Content-Type – the response content type
Status Codes:
  • 202 – no error

Rollback snapshot

POST /api/v1.0/storage/snapshot/tank%40test/rollback/

Rollback to a snapshot.

Example request:

POST /api/v1.0/storage/snapshot/tank%40test/rollback/ HTTP/1.1
Content-Type: application/json

  {
      "force": true
  }

Example response:

HTTP/1.1 202 Accepted
Vary: Accept
Content-Type: application/json

  Snapshot rolled back.
JSON Parameters:
 
  • name (string) – name/path of the clone
Request Headers:
 
  • Content-Type – the request content type
Response Headers:
 
  • Content-Type – the response content type
Status Codes:
  • 202 – no error

Task

The Task resource represents Periodic Snapshot Tasks for ZFS Volumes.

List resource

GET /api/v1.0/storage/task/

Returns a list of all periodic snapshot tasks.

Example request:

GET /api/v1.0/storage/task/ HTTP/1.1
Content-Type: application/json

Example response:

HTTP/1.1 200 OK
Vary: Accept
Content-Type: application/json

[
  {
          "task_ret_count": 2,
          "task_repeat_unit": "weekly",
          "task_enabled": true,
          "task_recursive": false,
          "task_end": "18:00:00",
          "task_interval": 60,
          "task_byweekday": "1,2,3,4,5",
          "task_begin": "09:00:00",
          "task_filesystem": "tank",
          "id": 1,
          "task_ret_unit": "week"
  }
]
Query Parameters:
 
  • offset – offset number. default is 0
  • limit – limit number. default is 20
Response Headers:
 
  • Content-Type – content type of the response
Status Codes:
  • 200 – no error

Create resource

POST /api/v1.0/storage/task/

Creates a new Task and returns the new Task object.

Example request:

POST /api/v1.0/storage/task/ HTTP/1.1
Content-Type: application/json

  {
          "task_filesystem": "tank",
          "task_recursive": false,
          "task_ret_unit": "week",
          "task_interval": 60,
  }

Example response:

HTTP/1.1 201 Created
Vary: Accept
Content-Type: application/json

  {
          "task_ret_count": 2,
          "task_repeat_unit": "weekly",
          "task_enabled": true,
          "task_recursive": false,
          "task_end": "18:00:00",
          "task_interval": 60,
          "task_byweekday": "1,2,3,4,5",
          "task_begin": "09:00:00",
          "task_filesystem": "tank",
          "id": 1,
          "task_ret_unit": "week"
  }
JSON Parameters:
 
  • task_repeat_unit (string) – daily, weekly
  • task_begin (string) – do not snapshot before
  • task_end (string) – do not snapshot after
  • task_filesystem (string) – name of the ZFS filesystem
  • task_ret_unit (string) – hour, day, week, month, year
  • task_byweekday (string) – days of week to snapshot, [1..7]
  • task_interval (integer) – how much time has been passed between two snapshot attempts [5, 10, 15, 30, 60, 120, 180, 240, 360, 720, 1440, 10080]
  • task_ret_count (integer) – snapshot lifetime value
  • task_enabled (boolean) – enabled task
  • task_recursive (boolean) – snapshot all children datasets recursively
Request Headers:
 
  • Content-Type – the request content type
Response Headers:
 
  • Content-Type – the response content type
Status Codes:
  • 201 – no error

Update resource

PUT /api/v1.0/storage/task/(int: id)/

Update Task id.

Example request:

PUT /api/v1.0/storage/task/1/ HTTP/1.1
Content-Type: application/json

  {
          "task_interval": 30
  }

Example response:

HTTP/1.1 200 OK
Vary: Accept
Content-Type: application/json

  {
          "task_ret_count": 2,
          "task_repeat_unit": "weekly",
          "task_enabled": true,
          "task_recursive": false,
          "task_end": "18:00:00",
          "task_interval": 30,
          "task_byweekday": "1,2,3,4,5",
          "task_begin": "09:00:00",
          "task_filesystem": "tank",
          "id": 1,
          "task_ret_unit": "week"
  }
JSON Parameters:
 
  • task_repeat_unit (string) – daily, weekly
  • task_begin (string) – do not snapshot before
  • task_end (string) – do not snapshot after
  • task_filesystem (string) – name of the ZFS filesystem
  • task_ret_unit (string) – hour, day, week, month, year
  • task_byweekday (string) – days of week to snapshot, [1..7]
  • task_interval (integer) – how much time has been passed between two snapshot attempts [5, 10, 15, 30, 60, 120, 180, 240, 360, 720, 1440, 10080]
  • task_ret_count (integer) – snapshot lifetime value
  • task_enabled (boolean) – enabled task
  • task_recursive (boolean) – snapshot all children datasets recursively
Request Headers:
 
  • Content-Type – the request content type
Response Headers:
 
  • Content-Type – the response content type
Status Codes:
  • 200 – no error

Delete resource

DELETE /api/v1.0/storage/task/(int: id)/

Delete Task id.

Example request:

DELETE /api/v1.0/storage/task/1/ HTTP/1.1
Content-Type: application/json

Example response:

HTTP/1.1 204 No Response
Vary: Accept
Content-Type: application/json
Status Codes:
  • 204 – no error

Replication

The Replication resource represents ZFS Replication tasks.

List resource

GET /api/v1.0/storage/replication/

Returns a list of all replications.

Example request:

GET /api/v1.0/storage/replication/ HTTP/1.1
Content-Type: application/json

Example response:

HTTP/1.1 200 OK
Vary: Accept
Content-Type: application/json

[
  {
          "repl_end": "23:59:00",
          "repl_remote_dedicateduser": null,
          "repl_userepl": false,
          "repl_limit": 0,
          "repl_remote_port": 22,
          "repl_remote_dedicateduser_enabled": false,
          "repl_begin": "00:00:00",
          "repl_filesystem": "tank",
          "repl_remote_cipher": "standard",
          "repl_remote_hostkey": "AAAA",
          "repl_enabled": true,
          "repl_compression": "lz4",
          "repl_remote_hostname": "testhost",
          "repl_lastsnapshot": "",
          "repl_status": "Waiting",
          "id": 1,
          "repl_zfs": "tank"
  }
]
Query Parameters:
 
  • offset – offset number. default is 0
  • limit – limit number. default is 20
Response Headers:
 
  • Content-Type – content type of the response
Status Codes:
  • 200 – no error

Create resource

POST /api/v1.0/storage/replication/

Creates a new Replication and returns the new Replication object.

Example request:

POST /api/v1.0/storage/replication/ HTTP/1.1
Content-Type: application/json

  {
          "repl_filesystem": "tank",
          "repl_zfs": "tank",
          "repl_remote_hostname": "testhost",
          "repl_remote_hostkey": "AAAA",
          "repl_remote_cipher": "standard"
  }

Example response:

HTTP/1.1 201 Created
Vary: Accept
Content-Type: application/json

  {
          "repl_end": "23:59:00",
          "repl_remote_dedicateduser": null,
          "repl_userepl": false,
          "repl_followdelete": false,
          "repl_limit": 0,
          "repl_remote_port": 22,
          "repl_remote_dedicateduser_enabled": false,
          "repl_begin": "00:00:00",
          "repl_filesystem": "tank",
          "repl_remote_cipher": "standard",
          "repl_remote_hostkey": "AAAA",
          "repl_enabled": true,
          "repl_compression": "lz4",
          "repl_remote_hostname": "testhost",
          "repl_lastsnapshot": "",
          "repl_status": "Waiting",
          "id": 1,
          "repl_zfs": "tank"
  }
JSON Parameters:
 
  • repl_enabled (boolean) – enable replication
  • repl_filesystem (string) – filesystem to replicate
  • repl_lastsnapshot (string) – last snapshot sent to remote side
  • repl_remote_mode (string) – MANUAL or SEMIAUTOMATIC
  • repl_remote_http_port (string) – HTTP port of remote for SEMIAUTOMATIC mode
  • repl_remote_https (boolean) – HTTPS (true|false) of remote for SEMIAUTOMATIC mode
  • repl_remote_token (boolean) – remote auth token for SEMIAUTOMATIC mode
  • repl_remote_hostname (string) – remote hostname
  • repl_remote_port (integer) – remote ssh port
  • repl_remote_hostkey (string) – remote ssh public key
  • repl_remote_cipher (string) – encryption cipher to use (standard, fast, disabled)
  • repl_remote_dedicateduser_enabled (boolean) – use dedicated user to replicate
  • repl_remote_dedicateduser (string) – dedicated user to replicate
  • repl_userepl (boolean) – recursively replicate on remote side
  • repl_followdelete (boolean) – delete stale snapshots on remote system which are no longer stored on host system
  • repl_compression (string) – replication stream compression
  • repl_status (string) – current status of the replication
  • repl_limit (integer) – limit the replication speed in KB/s
  • repl_begin (string) – do not start replication before
  • repl_end (string) – do not start replication after
Request Headers:
 
  • Content-Type – the request content type
Response Headers:
 
  • Content-Type – the response content type
Status Codes:
  • 201 – no error

Update resource

PUT /api/v1.0/storage/replication/(int: id)/

Update Replication id.

Example request:

PUT /api/v1.0/storage/replication/1/ HTTP/1.1
Content-Type: application/json

  {
          "repl_enabled": false
  }

Example response:

HTTP/1.1 200 OK
Vary: Accept
Content-Type: application/json

  {
          "repl_end": "23:59:00",
          "repl_remote_dedicateduser": null,
          "repl_userepl": false,
          "repl_followdelete": false,
          "repl_limit": 0,
          "repl_remote_port": 22,
          "repl_remote_dedicateduser_enabled": false,
          "repl_begin": "00:00:00",
          "repl_filesystem": "tank",
          "repl_remote_cipher": "standard",
          "repl_remote_hostkey": "AAAA",
          "repl_enabled": false,
          "repl_compression": "lz4",
          "repl_remote_hostname": "testhost",
          "repl_lastsnapshot": "",
          "repl_status": "Waiting",
          "id": 1,
          "repl_zfs": "tank"
  }
JSON Parameters:
 
  • repl_enabled (boolean) – enable replication
  • repl_filesystem (string) – filesystem to replicate
  • repl_lastsnapshot (string) – last snapshot sent to remote side
  • repl_remote_hostname (string) – remote hostname
  • repl_remote_port (integer) – remote ssh port
  • repl_remote_hostkey (string) – remote ssh public key
  • repl_remote_cipher (string) – encryption cipher to use (standard, fast, disabled)
  • repl_remote_dedicateduser_enabled (boolean) – use dedicated user to replicate
  • repl_remote_dedicateduser (string) – dedicated user to replicate
  • repl_userepl (boolean) – recursively replicate on remote side
  • repl_followdelete (boolean) – delete stale snapshots on remote system which are no longer stored on host system
  • repl_compression (string) – replication stream compression
  • repl_status (string) – current status of the replication
  • repl_limit (integer) – limit the replication speed in KB/s
  • repl_begin (string) – do not start replication before
  • repl_end (string) – do not start replication after
Request Headers:
 
  • Content-Type – the request content type
Response Headers:
 
  • Content-Type – the response content type
Status Codes:
  • 200 – no error

Delete resource

DELETE /api/v1.0/storage/replication/(int: id)/

Delete Replication id.

Example request:

DELETE /api/v1.0/storage/replication/1/ HTTP/1.1
Content-Type: application/json

Example response:

HTTP/1.1 204 No Response
Vary: Accept
Content-Type: application/json
Status Codes:
  • 204 – no error

Scrub

The Scrub resource represents Periodic Snapshot Scrubs for ZFS Volumes.

List resource

GET /api/v1.0/storage/scrub/

Returns a list of all scrubs.

Example request:

GET /api/v1.0/storage/scrub/ HTTP/1.1
Content-Type: application/json

Example response:

HTTP/1.1 200 OK
Vary: Accept
Content-Type: application/json

[
  {
          "scrub_threshold": 35,
          "scrub_dayweek": "7",
          "scrub_enabled": true,
          "scrub_minute": "00",
          "scrub_hour": "00",
          "scrub_month": "*",
          "scrub_daymonth": "*",
          "scrub_description": "",
          "id": 1,
          "scrub_volume": "tank"
  }
]
Query Parameters:
 
  • offset – offset number. default is 0
  • limit – limit number. default is 20
Response Headers:
 
  • Content-Type – content type of the response
Status Codes:
  • 200 – no error

Create resource

POST /api/v1.0/storage/scrub/

Creates a new Scrub and returns the new Scrub object.

Example request:

POST /api/v1.0/storage/scrub/ HTTP/1.1
Content-Type: application/json

  {
          "scrub_volume": 1,
          "scrub_dayweek": "7",
          "scrub_minute": "00",
          "scrub_hour": "00",
          "scrub_month": "*",
          "scrub_daymonth": "*"
  }

Example response:

HTTP/1.1 201 Created
Vary: Accept
Content-Type: application/json

  {
          "scrub_threshold": 35,
          "scrub_dayweek": "7",
          "scrub_enabled": true,
          "scrub_minute": "00",
          "scrub_hour": "00",
          "scrub_month": "*",
          "scrub_daymonth": "*",
          "scrub_description": "",
          "id": 1,
          "scrub_volume": "tank"
  }
JSON Parameters:
 
  • scrub_volume (integer) – id to volume object
  • scrub_threshold (integer) – determine how many days shall be between scrubs
  • scrub_description (string) – user description
  • scrub_minute (string) – values 0-59 allowed
  • scrub_hour (string) – values 0-23 allowed
  • scrub_daymonth (string) – day of month, values 1-31 allowed
  • scrub_month (string) – month
  • scrub_dayweek (string) – day of week
  • scrub_enabled (boolean) – scrub enabled
Request Headers:
 
  • Content-Type – the request content type
Response Headers:
 
  • Content-Type – the response content type
Status Codes:
  • 201 – no error

Update resource

PUT /api/v1.0/storage/scrub/(int: id)/

Update Scrub id.

Example request:

PUT /api/v1.0/storage/scrub/1/ HTTP/1.1
Content-Type: application/json

  {
          "scrub_dayweek": "6"
  }

Example response:

HTTP/1.1 200 OK
Vary: Accept
Content-Type: application/json

  {
          "scrub_threshold": 35,
          "scrub_dayweek": "6",
          "scrub_enabled": true,
          "scrub_minute": "00",
          "scrub_hour": "00",
          "scrub_month": "*",
          "scrub_daymonth": "*",
          "scrub_description": "",
          "id": 1,
          "scrub_volume": "tank"
  }
JSON Parameters:
 
  • scrub_volume (integer) – id to volume object
  • scrub_threshold (integer) – determine how many days shall be between scrubs
  • scrub_description (string) – user description
  • scrub_minute (string) – values 0-59 allowed
  • scrub_hour (string) – values 0-23 allowed
  • scrub_daymonth (string) – day of month, values 1-31 allowed
  • scrub_month (string) – month
  • scrub_dayweek (string) – day of week
  • scrub_enabled (boolean) – scrub enabled
Request Headers:
 
  • Content-Type – the request content type
Response Headers:
 
  • Content-Type – the response content type
Status Codes:
  • 200 – no error

Delete resource

DELETE /api/v1.0/storage/scrub/(int: id)/

Delete Scrub id.

Example request:

DELETE /api/v1.0/storage/scrub/1/ HTTP/1.1
Content-Type: application/json

Example response:

HTTP/1.1 204 No Response
Vary: Accept
Content-Type: application/json
Status Codes:
  • 204 – no error

Disk

The Disk resource represents available disks in the system.

List resource

GET /api/v1.0/storage/disk/

Returns a list of all disks.

Example request:

GET /api/v1.0/storage/disk/ HTTP/1.1
Content-Type: application/json

Example response:

HTTP/1.1 200 OK
Vary: Accept
Content-Type: application/json

[
  {
          "disk_acousticlevel": "Disabled",
          "disk_advpowermgmt": "Disabled",
          "disk_serial": "VBad9d9bb7-3d1d3bce",
          "disk_size": "4294967296",
          "disk_multipath_name": "",
          "disk_identifier": "{serial}VBad9d9bb7-3d1d3bce",
          "disk_togglesmart": true,
          "disk_hddstandby": "Always On",
          "disk_transfermode": "Auto",
          "disk_multipath_member": "",
          "disk_description": "",
          "disk_smartoptions": "",
          "disk_expiretime": null,
          "disk_name": "ada7"
  }
]
Query Parameters:
 
  • offset – offset number. default is 0
  • limit – limit number. default is 20
Response Headers:
 
  • Content-Type – content type of the response
Status Codes:
  • 200 – no error

Update resource

PUT /api/v1.0/storage/disk/(str: disk_identifier)/

Update Disk disk_identifier.

Example request:

PUT /api/v1.0/storage/disk/{serial}VBad9d9bb7-3d1d3bce/ HTTP/1.1
Content-Type: application/json

  {
          "disk_togglesmart": false
  }

Example response:

HTTP/1.1 200 OK
Vary: Accept
Content-Type: application/json

  {
          "disk_acousticlevel": "Disabled",
          "disk_advpowermgmt": "Disabled",
          "disk_serial": "VBad9d9bb7-3d1d3bce",
          "disk_size": "4294967296",
          "disk_multipath_name": "",
          "disk_identifier": "{serial}VBad9d9bb7-3d1d3bce",
          "disk_togglesmart": false,
          "disk_hddstandby": "Always On",
          "disk_transfermode": "Auto",
          "disk_multipath_member": "",
          "disk_description": "",
          "disk_smartoptions": "",
          "disk_expiretime": null,
          "disk_name": "ada7"
  }
JSON Parameters:
 
  • disk_description (string) – user description
  • disk_hddstandby (string) – Always On, 5, 10, 20, 30, 60, 120, 180, 240, 300, 330
  • disk_advpowermgmt (string) – Disabled, 1, 64, 127, 128. 192, 254
  • disk_acousticlevel (string) – Disabled, Minimum, Medium, Maximum
  • disk_togglesmart (boolean) – Enable S.M.A.R.T.
  • disk_smartoptions (string) – S.M.A.R.T. extra options
Request Headers:
 
  • Content-Type – the request content type
Response Headers:
 
  • Content-Type – the response content type
Status Codes:
  • 200 – no error

Permission

The Permission resource allows one to set mountpoints permissions.

Update resource

PUT /api/v1.0/storage/permission/

Update a mountpoint with the given permission.

Example request:

PUT /api/v1.0/storage/permission/ HTTP/1.1
Content-Type: application/json

  {
          "mp_path": "/mnt/tank",
          "mp_acl": "unix",
          "mp_mode": "755",
          "mp_user": "root",
          "mp_group": "wheel",
  }

Example response:

HTTP/1.1 202 Accepted
Vary: Accept
Content-Type: application/json

  Mount Point permissions successfully updated.
JSON Parameters:
 
  • mp_path (string) – mount point path to update
  • mp_acl (string) – type of acl (windows/unix)
  • mp_mode (string) – octal mode number for user, group and other
  • mp_user (string) – username
  • mp_group (string) – group
Request Headers:
 
  • Content-Type – the request content type
Response Headers:
 
  • Content-Type – the response content type
Status Codes:
  • 202 – no error

Update resource

PUT /api/v1.0/storage/task/(int: id)/

Update Task id.

Example request:

PUT /api/v1.0/storage/task/1/ HTTP/1.1
Content-Type: application/json

  {
          "task_interval": 30
  }

Example response:

HTTP/1.1 200 OK
Vary: Accept
Content-Type: application/json

  {
          "task_ret_count": 2,
          "task_repeat_unit": "weekly",
          "task_enabled": true,
          "task_recursive": false,
          "task_end": "18:00:00",
          "task_interval": 30,
          "task_byweekday": "1,2,3,4,5",
          "task_begin": "09:00:00",
          "task_filesystem": "tank",
          "id": 1,
          "task_ret_unit": "week"
  }
JSON Parameters:
 
  • task_repeat_unit (string) – daily, weekly
  • task_begin (string) – do not snapshot before
  • task_end (string) – do not snapshot after
  • task_filesystem (string) – name of the ZFS filesystem
  • task_ret_unit (string) – hour, day, week, month, year
  • task_byweekday (string) – days of week to snapshot, [1..7]
  • task_interval (integer) – how much time has been passed between two snapshot attempts [5, 10, 15, 30, 60, 120, 180, 240, 360, 720, 1440, 10080]
  • task_ret_count (integer) – snapshot lifetime value
  • task_enabled (boolean) – enabled task
  • task_recursive (boolean) – snapshot all children datasets recursively
Request Headers:
 
  • Content-Type – the request content type
Response Headers:
 
  • Content-Type – the response content type
Status Codes:
  • 200 – no error

Delete resource

DELETE /api/v1.0/storage/task/(int: id)/

Delete Task id.

Example request:

DELETE /api/v1.0/storage/task/1/ HTTP/1.1
Content-Type: application/json

Example response:

HTTP/1.1 204 No Response
Vary: Accept
Content-Type: application/json
Status Codes:
  • 204 – no error