REST API: support keyword ALLRESOURCES for GET nodes,networks,osimage,policy

This commit is contained in:
daniceexi 2014-06-03 05:03:04 -04:00
parent ce8f3c0599
commit b78515b8bc

View File

@ -1414,7 +1414,7 @@ sub defout {
}
else { # just an attribute of the current node
if (! $nodename) { error('improperly formatted lsdef output from xcatd', $STATUS_TEAPOT); }
my ($attr, $val) = $l =~ /^\s*(\S+?)=(.*)$/;
my ($attr, $val) = $l =~ /^\s*(\S+.*?)=(.*)$/;
if (!defined($attr)) { error('improperly formatted lsdef output from xcatd', $STATUS_TEAPOT); }
$json->{$nodename}->{$attr} = $val;
}
@ -1645,7 +1645,14 @@ sub defhdl {
# push the object name - node/noderange
if (defined ($urilayers[1])) {
push @args, ('-o', $urilayers[1]);
if ($urilayers[1] eq "ALLRESOURCES") {
unless (isGET()) {
error("Keyword ALLRESOURCES is only supported for GET Action.",$STATUS_NOT_FOUND);
}
push @args, '-l';
} else {
push @args, ('-o', $urilayers[1]);
}
}
# For the put/post which specifies attributes like mgt=ipmi groups=all