You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-commits@hadoop.apache.org by Apache Wiki <wi...@apache.org> on 2008/08/13 21:02:24 UTC

[Hadoop Wiki] Update of "Hbase/HbaseRest" by sishen

Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Hadoop Wiki" for change notification.

The following page has been changed by sishen:
http://wiki.apache.org/hadoop/Hbase/HbaseRest

------------------------------------------------------------------------------
  </tables>
  }}}
  
+ '''POST /'''
+     Create a table.    
+     Headers:
+         Content-type:
+             application/xml:    The client is sending the table metadata in an XML entity.
+     Returns:
+         HTTP 200 (OK) if the table could successfully be created.
      
  '''GET /[table_name]'''
      Retrieve metadata about the table. This includes column family descriptors.
@@ -72, +79 @@

  </table>
  }}}
  
+ '''PUT /[table_name]'''
+    Update the table schema.
+     Headers:
+         Content-type:
+             application/xml:    The client is sending the table metadata in an XML entity.
+     Returns:
+         HTTP 200 (OK) if the table could successfully be updated.
+ 
+ '''DELETE /[table_name]'''
+    Delete this table.
+    Returns:
+         HTTP 202 (Accepted) if the table could successfully be deleted.
+ 
+ '''POST /[table_name]/disable'''
+    Disable this table
+    Returns:
+         HTTP 202 (Accepted) if the table could successfully be disabled.
+ 
+ '''POST /[table_name]/enable'''
+    Enable this table
+    Returns:
+         HTTP 202 (Accepted) if the table could successfully be enabled.
  
  '''GET /[table_name]/regions'''
      Retrieve a list of the regions for this table so that you can efficiently split up the work (a la MapReduce).
@@ -226, +255 @@

  
  {{{
  cd $HBASE_HOME
- bin/hbase rest
+ bin/hbase rest start
  }}}
  
  Pass '''--help''' to see REST server usage. 
@@ -237, +266 @@

  
  
  == Examples using curl ==
+ 
+ Here is a POST of create table.
+ 
+ {{{
+ sishen@sishen-mac:~/Work/Personal/java/apache/hbase-trunk$curl -v -X POST -T - http://localhost:60050/api/
+ * About to connect() to localhost port 60050 (#0)
+ *   Trying ::1... connected
+ * Connected to localhost (::1) port 60050 (#0)
+ > POST /api/ HTTP/1.1
+ > User-Agent: curl/7.16.3 (powerpc-apple-darwin9.0) libcurl/7.16.3 OpenSSL/0.9.7l zlib/1.2.3
+ > Host: localhost:60050
+ > Accept: */*
+ > Transfer-Encoding: chunked
+ > Expect: 100-continue
+ > 
+ < HTTP/1.1 100 Continue
+ <?xml version="1.0" encoding="UTF-8"?>
+ <table>
+   <name>tables</name>
+   <columnfamilies>
+     <columnfamily>
+       <name>subscription</name>
+       <max-versions>2</max-versions>
+       <compression>NONE</compression>
+       <in-memory>false</in-memory>
+       <block-cache>true</block-cache>
+     </columnfamily>
+   </columnfamilies>
+ </table>
+ ^D
+ < HTTP/1.1 200 OK
+ < Date: Wed, 13 Aug 2008 18:59:38 GMT
+ < Server: Jetty/5.1.4 (Mac OS X/10.5.4 i386 java/1.5.0_13
+ < Content-Length: 0
+ < 
+ * Connection #0 to host localhost left intact
+ * Closing connection #0
+ }}}
+ 
+ Here is a POST of disable table.
+ 
+ {{{
+ sishen@sishen-mac:~/Work/Personal/java/apache/hbase-trunk$curl -v -X POST http://localhost:60050/api/tables/disable
+ * About to connect() to localhost port 60050 (#0)
+ *   Trying ::1... connected
+ * Connected to localhost (::1) port 60050 (#0)
+ > POST /api/tables/disable HTTP/1.1
+ > User-Agent: curl/7.16.3 (powerpc-apple-darwin9.0) libcurl/7.16.3 OpenSSL/0.9.7l zlib/1.2.3
+ > Host: localhost:60050
+ > Accept: */*
+ > 
+ < HTTP/1.1 202 Accepted
+ < Date: Wed, 13 Aug 2008 18:55:03 GMT
+ < Server: Jetty/5.1.4 (Mac OS X/10.5.4 i386 java/1.5.0_13
+ < Content-Length: 0
+ < 
+ * Connection #0 to host localhost left intact
+ * Closing connection #0
+ }}}
+ 
+ Here is a POST of enable table.
+ 
+ {{{
+ sishen@sishen-mac:~/Work/Personal/java/apache/hbase-trunk$curl -v -X POST http://localhost:60050/api/tables/enable
+ * About to connect() to localhost port 60050 (#0)
+ *   Trying ::1... connected
+ * Connected to localhost (::1) port 60050 (#0)
+ > POST /api/tables/enable HTTP/1.1
+ > User-Agent: curl/7.16.3 (powerpc-apple-darwin9.0) libcurl/7.16.3 OpenSSL/0.9.7l zlib/1.2.3
+ > Host: localhost:60050
+ > Accept: */*
+ > 
+ < HTTP/1.1 202 Accepted
+ < Date: Wed, 13 Aug 2008 18:56:20 GMT
+ < Server: Jetty/5.1.4 (Mac OS X/10.5.4 i386 java/1.5.0_13
+ < Content-Length: 0
+ < 
+ * Connection #0 to host localhost left intact
+ * Closing connection #0
+ }}}
+ 
+ Here is a DELETE of a table.
+ 
+ {{{
+ sishen@sishen-mac:~/Work/Personal/java/apache/hbase-trunk$curl -v -X DELETE http://localhost:60050/api/tables
+ * About to connect() to localhost port 60050 (#0)
+ *   Trying ::1... connected
+ * Connected to localhost (::1) port 60050 (#0)
+ > DELETE /api/tables HTTP/1.1
+ > User-Agent: curl/7.16.3 (powerpc-apple-darwin9.0) libcurl/7.16.3 OpenSSL/0.9.7l zlib/1.2.3
+ > Host: localhost:60050
+ > Accept: */*
+ > 
+ < HTTP/1.1 202 Accepted
+ < Date: Wed, 13 Aug 2008 18:57:41 GMT
+ < Server: Jetty/5.1.4 (Mac OS X/10.5.4 i386 java/1.5.0_13
+ < Content-Length: 0
+ < 
+ * Connection #0 to host localhost left intact
+ * Closing connection #0
+ }}}
  
  Here is a GET of a row.  Notice how values are Base64'd.