Database Reference
In-Depth Information
The preceding command returns the list of tables in HBase. To check the REST
server version and the JVM and OS details of the machine it is running on, use
the following command:
[root@localhost bin]# curl http://localhost:9999/version
rest 0.0.2 [JVM: Oracle Corporation 1.7.0_45-24.45-b08] [OS: Linux
2.6.32-358.23.2.el6.x86_64 amd64] [Server: jetty/6.1.26] [Jersey: 1.8]
The REST service supports multiple-type response formats such as plain, XML,
JSON, protocol buffer, and binary. These formats vary based on the value of the
content type request header. The different possible values for the content-type
are text/plain , text/xml , application/json , application/x-protobuf , and
application/octet-stream . The following are examples of how to use each
content type.
The plain format
The following is an example of how to use the plain format:
[root@localhost bin]# curl -H "Accept: text/plain" http://localhost:9999/
version
rest 0.0.2 [JVM: Oracle Corporation 1.7.0_45-24.45-b08] [OS: Linux
2.6.32-358.23.2.el6.x86_64 amd64] [Server: jetty/6.1.26] [Jersey: 1.8]
The XML format
The following is an example of how to use the XML format:
[root@localhost bin]# curl -H "Accept: text/xml" http://localhost:9999/
version
<?xml version="1.0" encoding="UTF-8" standalone="yes"?><Version
JVM="Oracle Corporation 1.7.0_45-24.45-b08" Jersey="1.8" OS="Linux
2.6.32-358.23.2.el6.x86_64 amd64" REST="0.0.2" Server="jetty/6.1.26"/>
The JSON format (deined as a key-value pair)
The following is an example of how to use the JSON format:
[root@localhost bin]# curl -H "Accept: application/json" http://
localhost:9999/version
{"REST":"0.0.2","JVM":"Oracle Corporation 1.7.0_45-24.45-b08","OS":"Linux
2.6.32-358.23.2.el6.x86_64 amd64","Server":"jetty/6.1.26","Jersey":"1.8
The protocol buffer format and binary decoders are primarily used to handle data in
the binary format and binary decoders are required if data conversion is required.
 
Search WWH ::




Custom Search