https://github.com/nibalizer/nodenta
Curl based zfs management using node.js
https://github.com/nibalizer/nodenta
Last synced: 3 days ago
JSON representation
Curl based zfs management using node.js
- Host: GitHub
- URL: https://github.com/nibalizer/nodenta
- Owner: nibalizer
- License: other
- Created: 2013-12-10T07:15:39.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2013-12-28T21:43:06.000Z (over 12 years ago)
- Last Synced: 2025-03-02T10:17:53.867Z (over 1 year ago)
- Language: JavaScript
- Size: 145 KB
- Stars: 4
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
nodenta
=======
A node app to consume REST calls and make ZFS/NFS changes on the host system.
System Requirements
===================
This has been developed on FreeBSD. In theory, any system with both zfs and node should work. Nodenta doesn't know how to ask for sudo permissions, and so must be run as root for now.
Installation and use
====================
git clone https://github.com/nibalizer/nodenta.git
cd nodenta
npm install
node app.js
api endpoints
=============
list
----
Lists zfs filesystems.
curl -H "Content-Type: application/json" http://127.0.0.1:3000/list
Example response:
[
{
"name": "picombinator",
"used": 201728,
"avail": 983547510784,
"refer": 32768,
"mountpoint": "/picombinator"
},
{
"name": "picombinator/nibalizer",
"used": 64512,
"avail": 983547510784,
"refer": 32768,
"mountpoint": "/picombinator/nibalizer"
},
{
"name": "picombinator/nibalizer/science",
"used": 31744,
"avail": 10737418240,
"refer": 31744,
"mountpoint": "/picombinator/nibalizer/science"
}
]
create
------
Creates zfs filesystems
curl -d '{"filesystem": "picombinator/nibalizer/science"}' \
-H "Content-Type: application/json" \
http://127.0.0.1:3000/api/1/create
Example response:
Creating zfs filesystem
destroy
-------
Destroys zfs filesystems
curl -d '{"filesystem": "picombinator/nibalizer/test"}' \
-H "Content-Type: application/json" \
http://127.0.0.1:3000/api/1/destroy
Example response:
Destroying zfs filesystem
get
---
Gets a property from a filesystem
curl -d '{"filesystem": "picombinator/nibalizer/science", \
"property": "quota"}' -H "Content-Type: application/json" \
http://127.0.0.1:3000/api/1/get
Example response:
{
"name": "picombinator/nibalizer/science",
"property": "quota",
"value": "10737418240",
"source": "local"
}
set
---
Sets a property on a filesystem
curl -d '{"filesystem": "picombinator/nibalizer/science", \
"property": "quota", "value": "10737418240"}' -H \
"Content-Type: application/json" \
http://127.0.0.1:3000/api/1/set
Example response
No response
Contributing
============
Please contribute! Right now things are simple but more advanced control should be possible.
Copyright
=========
Copyright 2013 Spencer Krum
License
=======
Apache 2