diff --git a/xCAT-server/lib/xcat/plugins/tabutils.pm b/xCAT-server/lib/xcat/plugins/tabutils.pm
index 03c99ec74..743c17a5e 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",
getTablesAllNodeAttribs => "tabutils",
getTablesNodesAttribs => "tabutils",
+ getTablesAllRowAttribs => "tabutils",
setNodesAttribs => "tabutils",
delEntries => "tabutils",
getAttribs => "tabutils",
@@ -165,6 +166,10 @@ sub process_request
{
return getTablesNodesAttribs($request,$callback);
}
+ elsif ($command eq "getTablesAllRowAttribs")
+ {
+ return getTablesAllRowAttribs($request,$callback);
+ }
elsif ($command eq "setNodesAttribs")
{
return setNodesAttribs($request,$callback);
@@ -2568,6 +2573,100 @@ sub getTablesNodesAttribs
$cb->(\%rsp);
return;
}
+# getTablesALLRowAttribs
+# Read all the rows from the input non-Node key'd
+# tables and get the input attributes
+# or get ALL attributes, if the word ALL is used.
+#
+#PCM
+#getTablesALLRowAttribs
+#
+#osimage
+#imagename
+#synclists
+#
+#
+# .
+# .
+# .
+#
+#
+#
+#
+#osimage
+#
+#value1
+#
+#
+#.
+#.
+#
+#
+#
+#linuximage
+#
+#value
+#value
+#.
+#.
+#
+#
+#.
+#.
+#
+#
+#
+#.
+#.
+#
+sub getTablesAllRowAttribs
+{
+ my $request = shift;
+ my $cb = shift;
+ my $command = $request->{command}->[0];
+ my %rsp;
+
+ # process each table in the request
+ my $tables = $request->{table};
+ foreach my $tabhash (@$tables) {
+
+ my $tablename = $tabhash->{tablename}->[0];
+ my $attr = $tabhash->{attr};
+ my @attrs=@$attr;
+ my $tab=xCAT::Table->new($tablename);
+ my %noderecs;
+ # build the table name record
+ @{$noderecs{table}->[0]->{tablename}} = $tablename;
+ # if request for ALL attributes
+ if (grep (/ALL/,@attrs)) { # read the schema and build array of all attrs
+ @attrs=();
+ my $schema = xCAT::Table->getTableSchema($tablename);
+ my $desc = $schema->{descriptions};
+ foreach my $c (@{$schema->{cols}}) {
+ # my $space = (length($c)<7 ? "\t\t" : "\t");
+ push @attrs, $c;
+ }
+ }
+ # read all the attributes in this table
+ my @recs = $tab->getAllAttribs(@attrs);
+ my %tblrecs;
+ foreach my $rec (@recs) {
+ my %datseg=();
+ foreach my $key (keys %$rec) {
+ $datseg{$key} = $rec->{$key};
+ }
+ push @{$tblrecs{table}->[0]->{row}}, \%datseg;
+ }
+ push @{$rsp{"table"}}, @{$tblrecs{table}};
+ } # end of all table processing
+ # for checkin XML created
+ # my $xmlrec=XMLout(\%rsp,RootName=>'xcatresponse',NoAttr=>1,KeyAttr=>[]);
+ $cb->(\%rsp);
+ return;
+}
#
# setNodesAttribs
# Sets Nodes attributes for noderange for each of the tables supplied