Skip to content
CassandraRestfulAPI project exposes the cassandra data tables 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. #IIITHyderabad #CloudComput…
HTML Python Shell
Branch: master
Clone or download
Latest commit d781bf6 Jul 8, 2017
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
Documentation Updated Documents Dec 7, 2015
templates Fixed bugs Dec 7, 2015
README.md Update Readme Jul 8, 2017
addnode.sh Added few api for node - add a node and list nodes Nov 21, 2015
main.py Fixed bugs Dec 7, 2015

README.md

CassandraRestfulAPI

=====================

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

You can’t perform that action at this time.