REST API

The HTTP based API means you can control various aspects of Zetavault from external software you have written.

Integrated REST Client

You can test and get familiar with the API using any REST client. Or you can use the included web based client we've built.

Just visit /api on a Zetavault system to access the web based client.

Authentication

OAuth 2.0 is used for authentication.

This is the next evolution of the OAuth protocol which was originally created in 2006.

OAuth 2.0 focuses on client developer simplicity while providing specific authorization flows for web applications.

Example 1

Retrieve a list of ZFS volumes in the system. Customize the columns that are outputted to name, size and used.

GET /storage/zfs/datasets/volumes?columns=name,volsize,used
{
  "data": [
    {
      "name": "storage/vol1",
      "volsize": "5368709120",
      "used": "3221225472"
    },
    {
      "name": "storage/vol2",
      "volsize": "10737418240",
      "used": "12414980096"
    },
    {
      "name": "storage/vol3",
      "volsize": "6442450944",
      "used": "3221323776"
    }
  ]
}

Example 2

Create a ZFS snapshot.

POST /storage/zfs/datasets/snapshots/storage~vol1@snap

Example 3

Modify a ZFS dataset. Set the compression to LZ4 and turn off dedup.

PUT /storage/zfs/datasets/storage~vol1
{
"compression": "lz4",
"dedup": "off"
}

Example 4

Retrieve the status for a network interface.

GET /management/network/interfaces/status/eth1
{
  "data": {
    "name": "eth2",
    "up": true,
    "type": "physical",
    "mac": "a0:36:9f:0a:07:88",
    "address": "192.168.10.1",
    "broadcast": "192.168.10.255",
    "netmask": "255.255.255.0",
    "mtu": 9000,
    "speed": 10000,
    "driver": "ixgbe",
    "rx": 13289355833,
    "tx": 23729217800,
    "alias": "10g nfs",
    "roles": "NZ"
  }
}

Example 5

Retrieve the list of devices active in the SAN.

GET /services/san/status/devices
{
  "data": [
    {
      "id": 1,
      "name": "vol1",
      "size": 5000.00,
      "path": "/dev/zvol/storage/vol1",
      "mode": "RW",
      "blocksize": 512,
      "serial": "8usg15jq",
      "t10_id": "3875736731356a71",
      "ssd": false,
      "hot_remove": true
    },
    {
      "id": 2,
      "name": "raid",
      "size": 30000.00,
      "path": "/dev/disk/by-raid/lsi-00875471249cbe9b1dd0b12109b00506",
      "mode": "RW",
      "blocksize": 512,
      "serial": "00875471249cbe",
      "t10_id": "3030383735343731323439636265",
      "ssd": false,
      "hot_remove": true
    }
  ]
}