From 2f65463e87bf80ce9a30bc6c7d40130a03d265de Mon Sep 17 00:00:00 2001 From: xq2005 Date: Mon, 19 Mar 2012 08:50:55 +0000 Subject: [PATCH] REST API for image list git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@11892 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/xCAT-wsapi/xcatws.cgi | 37 ++++++------------------------- 1 file changed, 7 insertions(+), 30 deletions(-) diff --git a/xCAT-server/xCAT-wsapi/xcatws.cgi b/xCAT-server/xCAT-wsapi/xcatws.cgi index a43da13d7..1c4358c25 100755 --- a/xCAT-server/xCAT-wsapi/xcatws.cgi +++ b/xCAT-server/xCAT-wsapi/xcatws.cgi @@ -338,38 +338,16 @@ sub imagesHandler { if (defined($path[1])) { $image = $path[1]; } - else { - $image = $q->param('imageName'); - } if (isGet()) { + $request->{command} = 'lsdef'; + push @args, '-t', 'osimage'; if (defined $image) { - - #call chkosimage, but should only be used for AIX images - if ($q->param('checkAixImage')) { - $request->{command} = 'chkosimage'; - push @args, $image; - } - else { - $request->{command} = 'tabget'; - push @args, "imagename=$image"; - if (defined $q->param('field')) { - foreach ($q->param('field')) { - push @args, "osimage.$_"; - } - } - else { - foreach (@groupFields) { - push @args, "osimage.$_"; - } - } - } + push @args, '-o', $image; } - - #no image indicated, so list all - else { - $request->{command} = 'tabdump'; - push @args, 'osimage'; + if (defined($q->param('field'))) { + push @args, '-i'; + push @args, join(',', $q->param('field')); } } elsif (isPost()) { @@ -903,8 +881,7 @@ sub nodesHandler { } if (defined($elements{'rsyncfile'})) { push @args, '-F'; - push @args, $elements{ - 'rsyncfile'}; + push @args, $elements{'rsyncfile'}; } if (defined($elements{'preserve'})) { push @args, '-p';