Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jersobh/zfs-resty
Rest API for zfspool
https://github.com/jersobh/zfs-resty
filesystem python rest-api zfs zfspool zfssa
Last synced: 3 months ago
JSON representation
Rest API for zfspool
- Host: GitHub
- URL: https://github.com/jersobh/zfs-resty
- Owner: jersobh
- License: mit
- Created: 2018-11-01T14:31:10.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2024-04-19T08:14:15.000Z (7 months ago)
- Last Synced: 2024-05-17T23:33:01.771Z (6 months ago)
- Topics: filesystem, python, rest-api, zfs, zfspool, zfssa
- Language: Python
- Homepage:
- Size: 160 KB
- Stars: 16
- Watchers: 4
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
- awesome-starred - jersobh/zfs-resty - Rest API for zfspool (rest-api)
README
![alt text](https://raw.githubusercontent.com/jersobh/zfs-resty/master/logo.png "Logo")
## Rest API for ZFS
### Usage
**Must be run with root privileges**
All parameters are json parameters. Eg.:
{
"username": "admin",
"password": "admin"
}#### Endpoints
##### /auth
Authentication endpoint. Returns a token to be used on Authorization header.
method: **POST**
params:
- username: system username
- password: user's password##### /create-pool
Create a zfs pool
method: **POST**
params:
- name: Pool name##### /delete-pool
Delete a pool
method: **POST**
params:
- name: Pool name##### /devices
Get available devices devices
method: **GET**##### /status
method: **GET**##### /io-status
method: **GET**##### /add-disk
Add a new disk to pool
method: **POST**
params:
- pool: Pool name
- device: device path eg.: /dev/sdx##### /add-spare-disk
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##### /replace-disk
method: **POST**
params:
- pool: Pool name
- old_device: device path eg.: /dev/sdx
- new_device: device path eg.: /dev/sdx##### /mountpoint
method: **POST**
params:
- mountpoint: mountpoint path eg.: /path/to/mountpoint
- pool: Pool name#### Authentication
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: ".#### Args
```
-p, --port: set the http port (default 8089)
-s, --safe: true/false, (default false) Allow only local network ip's
```#### Install requirements and run
```
$ pip install -r requirements.txt
$ sudo python zfs-resty.py```