HBase Rest API
Start/Stop rest service
./hbase-daemon.sh start rest -p 9081
./hbase-daemon.sh stop rest -p 9081
Examples
http://localhost:9081/version
http://localhost:9081/<table_name>/schema
http://localhost:9081/<table_name>/<row_key>
// 创建test表
curl -v -X PUT 'http://localhost:9081/test/schema' -H "Accept: application/json" -H "Content-
Type: application/json" -d '{"@name":"test","ColumnSchema":[{"name":"data"}]}'
//插入数据
TABLE='test'
FAMILY='data'
KEY=$(echo 'row1' | tr -d "\n" | base64)
COLUMN=$(echo 'data:test' | tr -d "\n" | base64)
DATA=$(echo 'some data' | tr -d "\n" | base64)
curl -v -X PUT 'http://localhost:9081/test/row1/data:test' -H "Accept: application/json" -H
"Content-Type: application/json" -d '{"Row":[{"key":"'$KEY'","Cell":[{"column":"'$COLUMN'",
"$":"'$DATA'"}]}]}'
curl -v -X GET 'http://localhost:9081/test/row1/' -H "Accept: application/json"
curl -v -X DELETE 'http://localhost:9081/test/schema' -H "Accept: application/json"