=====================
Description
CassandraRestfulAPI project exposes the cassandra data tables and nodes with the help of Restful API's. The project follows the standard Restful API rules. This project is developed as Major project of the Cloud Computing course by Team 15. The project is developed using Python Driver provided by Datastax using Flask framework.
Installation
Flask
$ sudo pip install Flask
Cassandra
Follow these steps to install Cassandra
Python Cassandra Driver
Follow these steps to install python cassandra driver Python Driver Cassandra
Other Dependencies
sudo pip install flask-mongoengine
sudo pip install -U flask_paginate
Run the code
First is to start cassandra. Second is to run flask i.e python main.py
. Go to https:127:0.0.1:5000/ and use the following API's.
API's
--- Nodes ---
List all the nodes
[GET] http://127.0.0.1:5000/nodes/
Get info of a node
[GET] http://127.0.0.1:5000/nodes/nodeid
Creates a new node
[POST] http://127.0.0.1:5000/nodes/
Body
* { 'username' : username , 'password' : password, 'ip' : ip }
Delete a node
[DELETE] http://127.0.0.1:5000/nodes/nodeid
Body
* { 'username' : username , 'password' : password }
--- Keyspaces ---
List all the Keyspaces
[GET] http://127.0.0.1:5000/keyspaces/
Get Info about a keyspace
[GET] http://127.0.0.1:5000/keyspaces/keyspaceid
Creates a new keyspace
[POST] http://127.0.0.1:5000/keyspaces/
Body
* { 'name' : name , 'replicationFactor' : number }
Updates the keyspace
[PUT] http://127.0.0.1:5000/keyspaces/keyspaceid
Body
* { 'replicationFactor' : number }
Deletes the keyspace
[DELETE] http://127.0.0.1:5000/keyspaces/keyspaceid
--- Column Family ---
List all the column families of a keyspace
[GET] http://127.0.0.1:5000/keyspace/keyspaceid/columnfamilys/
Get info of a column family
[GET] http://127.0.0.1:5000/keyspace/keyspaceid/columnfamilys/columnfamilyid
Creates a new column family
[POST] http://127.0.0.1:5000/keyspace/keyspaceid/columnfamilys/
Body
* { 'name' : name }
Delete a column family
[DELETE] http://127.0.0.1:5000/keyspace/keyspaceid/columnfamilys/columnfamilyid
--- Row Entries ---
List all the rows
[GET] http://127.0.0.1:5000/keyspace/keyspaceid/columnfamilys/columnfamilyid/entrys/
Get Info about a row
[GET] http://127.0.0.1:5000/keyspace/keyspaceid/columnfamilys/columnfamilyid/entrys/entryname
Creates a new row
[POST] http://127.0.0.1:5000/keyspace/keyspaceid/columnfamilys/columnfamilyid/entrys/
Body
* { 'field1' : field name , 'field1_type' : field data type .... }
Deletes the row
[DELETE] http://127.0.0.1:5000/keyspace/keyspaceid/columnfamilys/columnfamilyid/entrys/entryname
######Note:- 10.1.36.68 is the seed ######Note:- In delete node code, path is the directory where cassandra is installed
##More Info
Mail :- rohitsakala@gmail.com