virgil:通过REST访问Cassandra的开源框架
hmsonline/virgil是一个Cassandra服务层,目标是通过REST访问基于Cassandra的Hadoop。提供了基于浏览器进行数据检查,对于主要的Cassandra功能提供REST接口。
如下:
Create Keyspace (playground)
curl -X PUT http://localhost:8080/virgil/data/playground/
Create Column Family (toys)
curl -X PUT http://localhost:8080/virgil/data/playground/toys/
Set a Row (rowkey = "swingset", columns [ foo:1, bar:22 ])
curl -X PUT http://localhost:8080/virgil/data/playground/toys/swingset -d "{\"foo\":\"1\",\"bar\":\"33\"}"
Update a Row (rowkey = "swingset", columns [ foo:1, bar:22 ])
Updates columns with new values or adds columns if they don't exist.
curl -X PATCH http://localhost:8080/virgil/data/playground/toys/swingset -d "{\"foo\":\"3\",\"erg\":\"42\"}"
Fetch Row (rowkey = "swingset")
curl -X GET http://localhost:8080/virgil/data/playground/toys/swingset/
Insert Column (rowkey = "swingset", columns [ snaf:lisa ])
curl -X PUT http://localhost:8080/virgil/data/playground/toys/swingset/snaf -d "lisa"
Delete Column (rowkey = "swingset")
curl -X DELETE http://localhost:8080/virgil/data/playground/toys/swingset/snaf
Delete Row
curl -X DELETE http://localhost:8080/virgil/data/playground/toys/swingset/
Delete Column Family
curl -X DELETE http://localhost:8080/virgil/data/playground/toys/
Delete Keyspace
curl -X DELETE http://localhost:8080/virgil/data/playground/
[该贴被banq于2013-11-27 14:48修改过]