A Flask-based Server Interface to Provide REST APIs for Apache Zookeeper
This project wildlife (I got this name inspired from the meaning of Apache ZooKeeper), is a server interface, providing REST APIs for Apache ZooKeeper.
This project now can help you:
- Provide REST APIs (including GET/PUT/POST/DELETE) for other micro-services that utilize ZooKeeper cluster for configuration;
- Access all your ZooKeeper Clusters in one portal;
Support and bug-reports: https://github.com/dixudx/wildlife/issues?q=is%3Aopen+sort%3Acomments-desc
Project source code: https://github.com/dixudx/wildlife
Project documentation: https://readthedocs.org/projects/wildlife/
To install wildlife, simply run:
$ git clone https://github.com/dixudx/wildlife
$ cd wildlife
$ python setup.py install
To configure wildlife, simply:
$ cd /{your-site-packages}/wildlife/config
$ cp wildlife.yml.example wildlife.yml
And then modify your configurations accordingly.
After the configuration, you can start wildlife journey by running:
$ python rest.py
Please do NOT use "list", "data", "children" and "acls" as znodes names, which have been preserved for the REST APIs usage and may result in conflicts if using.
For more detailed inforamtion, please visit http://wildlife.readthedocs.org/en/latest/restapis.html
GET
hello page on wildlife REST APIs usages:
get all clusters info:
get the basic information of a specific cluster:
get the root children of a specific cluster:
get the znode data including the znodeStat:
http://[host]:[port]/wildlife/[cluster_name]/[znode]
e.g. http://localhost:5000/wildlife/cluster01/znode1/znode2/znode3
get the acls of a znode in a specific cluster:
get the children of a znode in a specific cluster:
http://[host]:[port]/wildlife/[cluster_name]/[znode]/children
e.g. http://localhost:5000/wildlife/cluster01/znode1/znode2/children
get only the data of a znode in a specific cluster:
http://[host]:[port]/wildlife/[cluster_name]/[znode]/data
e.g. http://localhost:5000/wildlife/cluster01/znode1/znode2/znode3/data
POST
create a znode in a specific cluster:
PUT
update the acls of a znode in a specific cluster:
http://[host]:[port]wildlife/<cluster_name>/<path:znode>/acls
update the znode data:
DELETE
delete the znode: