Must be run with root privileges
All parameters are json parameters. Eg.:
{
"username": "admin",
"password": "admin"
}
Authentication endpoint. Returns a token to be used on Authorization header.
method: POST
params:
- username: system username
- password: user's password
Create a zfs pool
method: POST
params:
- name: Pool name
Delete a pool
method: POST
params:
- name: Pool name
Get available devices devices
method: GET
method: GET
method: GET
Add a new disk to pool
method: POST
params:
- pool: Pool name
- device: device path eg.: /dev/sdx
Add a spare disk that will be used in place of a corrupted disk
method: POST
params:
- pool: Pool name
- device: device path eg.: /dev/sdx
method: POST
params:
- pool: Pool name
- old_device: device path eg.: /dev/sdx
- new_device: device path eg.: /dev/sdx
method: POST
params:
- mountpoint: mountpoint path eg.: /path/to/mountpoint
- pool: Pool name
ZFS-Resty uses JWT. To authenticate send a POST request to /auth. A token will be returned and should be sent for all request's headers as "Authorization: ".
-p, --port: set the http port (default 8089)
-s, --safe: true/false, (default false) Allow only local network ip's
$ pip install -r requirements.txt
$ sudo python zfs-resty.py <args>