Filesystem operations list and manage filesystem shares. All commands are scoped to a given storage pool or project.
{service_uri}/pools/{pool}/project/{project}
|
Each filesystem contains properties from the project and has the following filesystem-specific properties.
|
The list filesystems command shows all filesystems in a given pool or project.
Query Parameters - filter– A simple string match filter that requires a property within the project to contain the same filter string within its value.
|
Example Request:
GET /api/storage/v1/pools/gold/projects/proj-01/filesystems HTTP/1.1 Host: zfs-storage.example.com Accept: application/json
Successful request returns HTTP Status 200 (OK) along with an array of filesystem properties in JSON format.
Example Result:
HTTP/1.1 200 OK Content-Type: application/json { “filesystems”: [{ “name”: “filesystem-01”, “project”: “proj-01”, “pool”: “gold”, ... }, { “name”: “filesystem-02”, “project”: “proj-01”, “pool”: “gold”, ... }] }
A list of all filesystems across all pools and projects is also supported. In that case, the URI would be /api/storage/v1/filesystems.
Example Request (to get all filesystems with the "abcd" string as part of its properties):
GET /api/storage/v1/filesystems?filter=abcd HTTP/1.1 Host: zfs-storage.example.com Accept: application/json
The get filesystem command returns a single filesystem’s properties in a given pool or project.
|
Example Request (to list project named "proj-01"):
GET /api/storage/v1/pools/gold/projects/proj-01 HTTP/1.1 Host: zfs-storage.example.com Accept: application/json
Successful get returns HTTP Status 200 (OK) along with the filesystem properties in JSON format.
Example Response:
HTTP/1.1 200 OK Content-Type: application/json { "filesystem": { "logbias": "latency", "creation": "20130423T21:30:34", "nodestroy": false, "dedup": false, "sharenfs": "on", "sharesmb": "off", "mountpoint": "/export/grape", "snaplabel": "", "id": "424ca2ec-b3fa-df86-0000-000000000000", "readonly": false, "rrsrc_actions": [], "compression": "off", "sharetftp": "", "source": { "logbias": "default", "dedup": "default", "sharenfs": "inherited", "sharesmb": "off", "mountpoint": "inherited", "rrsrc_actions": "local", "compression": "default", "sharetftp": "inherited", "snapdir": "default", "aclmode": "default", "copies": "default", "aclinherit": "default", "shareftp": "inherited", "readonly": "default", "secondarycache": "default", "exported": "inherited", "vscan": "default", "reservation": "local", "atime": "default", "recordsize": "default", "checksum": "inherited", "sharesftp": "inherited", "nbmand": "default", "rstchown": "default" }, "snapdir": "hidden", "aclmode": "discard", "copies": 1, "aclinherit": "restricted", "shareftp": "", "canonical_name": "platinum/local/default/grape", "recordsize": 131072.0, "usage": { "available": 880395477504.0, "loading": false, "quota": 0.0, "snapshots": 18432.0, "compressratio": 100.0, "reservation": 0.0, "total": 50176.0, "data": 31744.0 }, "secondarycache": "all", "collection": "local", "exported": true, "vscan": false, "reservation": 0.0, "shadow": "none", "atime": true, "pool": "platinum", "quota_snap": true, "name": "grape", "checksum": "fletcher4", "project": "default", "sharesftp": "", "nbmand": false, "reservation_snap": true, "sharedav": "", "rstchown": true, "root_acl": { "owner@:cC:fd:deny", "everyone@:rw:fd:allow", "user:john:rw:allow", } "smbshareacl": { "owner@:cC:fd:deny", "everyone@:rw:fd:allow", "user:john:rw:allow", } }
The create filesystem command creates a filesystem with a given name residing in the given storage pool or project. The new filesystem with default properties is returned.
|
Request Parameters:
name - The filesystem name must be supplied to create a new filesystem.
filesystem properties – Any of the properties listed in filesystem properties or project properties can be set as initial values.
Example Request (to create a filesystem named "share-01" and owned by the user "joe"):
POST /api/storage/v1/pools/gold/projects/proj-01/filesystems HTTP/1.1 Host: zfs-storage.example.com Content-Type: application/json Accept: application/json { “name”: “share-01”, “root_user”: “joe” }
Successful creation returns HTTP Status 201 (Created) with the Location header containing the URI of the new filesystem. The body contains all filesystem properties in JSON format.
Example Response:
HTTP/1.1 201 Created Content-Type: application/json Location: /api/storage/v1/pools/gold/projects/proj-01/filesystems/share-01 { “filesystem”: { “name”: “share-01”, “pool”: “gold”, “collection”: “local”, “project”: “proj-01”, “root_user”: “joe” ... } }
The modify filesystem command changes the attributes of an existing filesystem. Successful response returns HTTP Status 202 (Accepted) and lists all filesystem properties.
Request Parameters - Filesystem Properties – Any of the filesystem or project properties can be modified.
|
Example Request (to change a filesystem name from "share-01" to "new-name" and change the owner to "nobody"):
PUT /api/storage/v1/pools/gold/projects/proj-01/filesystems/share-01 HTTP/1.1 Host: zfs-storage.example.com Content-Type: application/json Accept: application/json { “name”: “new-name”, “root_user”: “nobody”, }
Example Response:
HTTP/1.1 202 Accepted Content-Type: application/json Location: http://zfs-storage.example.com:215 /pools/gold/projects/proj-01/filesystems/share-01 { “filesystem”: { “name”: “new-name”, “pool”: “gold”, “collection”: “local”, “project”: “proj-01”, “root_user”: “nobody” ... } }
The delete filesystem command removes a single filesystem in a given pool or project.
|
To monitor the amount of space to be reclaimed in the storage pool, enter the GET command for pools/<pool>. Note the amount of space for property async_destroy_reclaim_space. When the operation has completed, 0 (zero) is displayed.
Example Request:
DELETE /api/storage/v1/pools/gold/projects/proj-01/filesystems/share-01 HTTP/1.1 Host: zfs-storage.example.com Accept: application/json
Successful delete returns HTTP Status 204 (No Content).
Example Response:
HTTP/1.1 204 No-Content
User or group quotas can be created or modified with POST or PUT requests, respectively. GET requests to filesystem use resources are used to get usage data per user or per group for the project.