Add NodeRange XML interface

git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@12837 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
lissav 2012-05-20 18:12:21 +00:00
parent bf6d469713
commit 36381d4170

View File

@ -60,6 +60,7 @@ sub handled_commands
delEntries => "tabutils",
getAttribs => "tabutils",
setAttribs => "tabutils",
NodeRange => "tabutils",
gennr => "tabutils"
};
}
@ -170,6 +171,10 @@ sub process_request
{
return setAttribs($request,$callback);
}
elsif ($command eq "NodeRange")
{
return NodeRange($request,$callback);
}
else
{
print "$command not implemented yet\n";
@ -2312,7 +2317,7 @@ sub getAllEntries
#
#<xcatresponse>
#<node>
#<name> nodename </name>
#<name>nodename</name>
#<attr1>value1</attr1>
#.
#.
@ -2548,7 +2553,6 @@ sub getAttribs
# <value>cluster.net</value>
# <comments>This is a comment</comments>
#</xcatrequest>
#</attr>
#
sub setAttribs
{
@ -2569,3 +2573,31 @@ sub setAttribs
$tab->setAttribs(\%keyhash,\%attrhash);
return;
}
# noderange
# Expands the input noderange into a list of nodes.
#<xcatrequest>
#<clienttype>PCM</clienttype>
#<command>noderange</command>
#<noderange>compute1-compute2</noderange>
#</xcatrequest>
#<xcatresponse>
#<node>nodename1</node>
# .
# .
#<node>nodenamern1</node>
#</xcatresponse>
sub NodeRange
{
my $request = shift;
my $cb = shift;
my $command = $request->{command}->[0];
my %rsp;
my $node=$request->{node};
my @nodes = @$node;
foreach my $node (@nodes){
push @{$rsp{"node"}}, $node;
}
$cb->(\%rsp);
return;
}