virgil:透過REST訪問Cassandra的開源框架

banq發表於2013-11-27
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修改過]

相關文章