diff --git a/xCAT-server/lib/xcat/plugins/tabutils.pm b/xCAT-server/lib/xcat/plugins/tabutils.pm
index 64f182926..efd4a7805 100644
--- a/xCAT-server/lib/xcat/plugins/tabutils.pm
+++ b/xCAT-server/lib/xcat/plugins/tabutils.pm
@@ -58,6 +58,7 @@ sub handled_commands
getNodesAttribs => "tabutils",
setNodesAttribs1 => "tabutils",
delEntries => "tabutils",
+ getAttribs => "tabutils",
gennr => "tabutils"
};
}
@@ -160,6 +161,10 @@ sub process_request
{
return delEntries($request,$callback);
}
+ elsif ($command eq "getAttribs")
+ {
+ return getAttribs($request,$callback);
+ }
else
{
print "$command not implemented yet\n";
@@ -2283,6 +2288,15 @@ sub getAllEntries
}
# getNodesAttribs
# Read all the array of attributes for the noderange from the input table.
+#
+#PCM
+#getNodesAttribs
+#
+#blade01-blade02
+#groups
+#status
+#
+#
#
#
# nodename
@@ -2433,13 +2447,8 @@ sub delEntries
{
my $request = shift;
my $cb = shift;
- # my $node = $request->{node}; # added by Client.pm
- # my $noderange = $request->{noderange};
my $command = $request->{command}->[0];
my %rsp;
- # my $args = $request->{arg};
- # my $tables= $args->[0]->{table};
- # my $tables= $request->{table}->{name};
my $tables= $request->{table};
foreach my $table (@$tables) {
my $tablename = $table->{name}->[0];
@@ -2460,3 +2469,47 @@ sub delEntries
}
return;
}
+# getAttribs
+# Read all the array of attributes for the key from the input table.
+#
+#PCM
+#getAttribs
+#
+#
+# domain
+#
+#value
+#comments
+#
+#
+#
+#
+#{domain value}
+#This is a comment
+#
+sub getAttribs
+{
+ my $request = shift;
+ my $cb = shift;
+ my $command = $request->{command}->[0];
+ my $tablename = $request->{table}->[0];
+ my $attr = $request->{attrs};
+ my @attrs= @$attr;
+ my $tab=xCAT::Table->new($tablename);
+ my %rsp;
+ my %keyhash;
+ foreach my $k (keys %{$request->{keys}->[0]}) {
+ $keyhash{$k} = $request->{keys}->[0]->{$k}->[0];
+ }
+ my $recs = $tab->getAttribs(\%keyhash,\@attrs);
+
+ if ($recs) {
+ my %attrhash=%$recs;
+ foreach my $k (keys %attrhash) {
+
+ push @{$rsp{$k}}, $recs->{$k};
+ }
+ }
+ $cb->(\%rsp);
+ return;
+}