Return-Path: X-Original-To: apmail-hbase-user-archive@www.apache.org Delivered-To: apmail-hbase-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 46BF4DB8E for ; Wed, 8 Aug 2012 18:35:15 +0000 (UTC) Received: (qmail 95267 invoked by uid 500); 8 Aug 2012 18:35:13 -0000 Delivered-To: apmail-hbase-user-archive@hbase.apache.org Received: (qmail 95217 invoked by uid 500); 8 Aug 2012 18:35:13 -0000 Mailing-List: contact user-help@hbase.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@hbase.apache.org Delivered-To: mailing list user@hbase.apache.org Received: (qmail 95208 invoked by uid 99); 8 Aug 2012 18:35:13 -0000 Received: from minotaur.apache.org (HELO minotaur.apache.org) (140.211.11.9) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 08 Aug 2012 18:35:13 +0000 Received: from localhost (HELO mail-gg0-f169.google.com) (127.0.0.1) (smtp-auth username apurtell, mechanism plain) by minotaur.apache.org (qpsmtpd/0.29) with ESMTP; Wed, 08 Aug 2012 18:35:13 +0000 Received: by ggnf4 with SMTP id f4so1355847ggn.14 for ; Wed, 08 Aug 2012 11:35:12 -0700 (PDT) MIME-Version: 1.0 Received: by 10.50.182.161 with SMTP id ef1mr2012725igc.0.1344450911944; Wed, 08 Aug 2012 11:35:11 -0700 (PDT) Received: by 10.64.81.100 with HTTP; Wed, 8 Aug 2012 11:35:11 -0700 (PDT) In-Reply-To: References: Date: Wed, 8 Aug 2012 11:35:11 -0700 Message-ID: Subject: Re: Update table schema via REST From: Andrew Purtell To: user@hbase.apache.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Addressing for table creation or schema update (PUT or POST), schema query (GET), or delete (DELETE) path :=3D '/' / 'schema' So that should be /TransactionREST/schema However, I'd recommend that you not take administrative actions via the REST API. Use the HBase shell instead. Consider them DBA-type operations. - Andy On Wed, Aug 8, 2012 at 11:15 AM, Corbett Martin wrote: > According to the Stargate documentation (http://wiki.apache.org/hadoop/Hb= ase/Stargate) I should be able to perform a POST operation to perform a tab= le schema update. The docs say to supply a "well formed schema fragment" f= or a table schema update. My issue is the test code below always returns: > >

HTTP ERROR 405

>

Problem accessing /TransactionREST/. Reason: >

Method Not Allowed
> > What am I missing? I cannot find any errors in the log files. > > It's worth mentioning that I've been able to successfully create a table = via the REST api but now I want to use the api to make a table schema chang= e, like in this example I want to add a new column-family to a table. > > class AlterTableExampleREST { > > private static final String ALTER_TABLE =3D > "{\"name\":\"TransactionREST\",\"ColumnSchema\":[{\"name\":\"= foo\"}]}"; > > public void modifyTable() throws IOException { > // Setup a Cluster list adding all known REST server hosts > Cluster cluster =3D new Cluster(); > cluster.add("127.0.0.1", 8080); > // Create Client to handle HTTP communication > Client client =3D new Client(cluster); > Response response =3D client.post("/TransactionREST/", "appli= cation/json", > Bytes.toBytes(ALTER_TABLE)); > if(response !=3D null) { > System.out.println("response code: " + response.getCode= ()); > if(response.hasBody()) { > System.out.println("reponse body: " + Bytes.toStr= ing(response.getBody())); > } > } > } > } > > Thanks in advance! > > ________________________________ > This message and its contents (to include attachments) are the property o= f National Health Systems, Inc. and may contain confidential and proprietar= y information. This email and any files transmitted with it are intended so= lely for the use of the individual or entity to whom they are addressed. Yo= u are hereby notified that any unauthorized disclosure, copying, or distrib= ution of this message, or the taking of any unauthorized action based on in= formation contained herein is strictly prohibited. Unauthorized use of info= rmation contained herein may subject you to civil and criminal prosecution = and penalties. If you are not the intended recipient, you should delete thi= s message immediately and notify the sender immediately by telephone or by = replying to this transmission.