From 32035018267c18aa9bad699f69644d43284232bb Mon Sep 17 00:00:00 2001 From: xq2005 Date: Tue, 20 Mar 2012 09:16:06 +0000 Subject: [PATCH] add the REST API of gettab git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@11909 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/xCAT-wsapi/xcatws.cgi | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/xCAT-server/xCAT-wsapi/xcatws.cgi b/xCAT-server/xCAT-wsapi/xcatws.cgi index f4d091017..d70639991 100755 --- a/xCAT-server/xCAT-wsapi/xcatws.cgi +++ b/xCAT-server/xCAT-wsapi/xcatws.cgi @@ -14,7 +14,7 @@ use Data::Dumper; #all data input will be done from the common structure #turn on or off the debugging output -my $DEBUGGING = 1; +my $DEBUGGING = 0; my $VERSION = "2.7"; my $q = CGI->new; @@ -1242,17 +1242,27 @@ sub tablesHandler { #handle all gets if (isGet()) { - $request->{command} = 'tabdump'; - if (defined $q->param('desc')) { - push @args, '-d'; - } #table was specified if (defined $table) { - push @args, $table; - if (!defined $q->param('desc')) { - $formatType = 'splitCommas'; + if (defined($q->param('col'))) { + $request->{command} = 'gettab'; + push @args, $q->param('col') . '=' . $q->param('value'); + my @temparray = $q->param('attribute'); + foreach (@temparray) { + push @args, $table . '.' . $_; + } } + else { + $request->{command} = 'tabdump'; + push @args, $table; + if (!defined $q->param('desc')) { + $formatType = 'splitCommas'; + } + } + } + else { + $request->{command} = 'tabdump'; } } elsif (isPut() || isPatch()) {