-# Copyright (c) 2010 Zmanda, Inc. All Rights Reserved.
+# Copyright (c) 2010-2012 Zmanda, Inc. All Rights Reserved.
#
-# This program is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License version 2 as published
-# by the Free Software Foundation.
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
);
}
+sub make_dump_xml
+{
+ my ($dle, $timestamp) = @_;
+
+ return make_xml_elt(
+ "dump",
+ sub {
+ return join( xml_nl(),
+ make_xml_elt("date", $timestamp),
+ map { make_try_xml($_) } @{$dle->{'dumps'}->{$timestamp}});
+ }
+ );
+}
+
sub make_dle_xml
{
my ( $hostname, $disk, $dle ) = @_;
return join( xml_nl(),
make_xml_elt( "hostname", $hostname ),
make_xml_elt( "disk", $disk ),
- ( defined $dle->{estimate} && %{ $dle->{estimate} } > 0 )
- ? make_estimate_xml( $dle->{estimate} )
- : (),
- exists $dle->{tries} ? map { make_try_xml($_) }
- @{ $dle->{tries} } : (),
- exists $dle->{parts} ? map { make_part_xml($_) }
- @{ $dle->{parts} } : () );
+ ( defined $dle->{estimate} && %{ $dle->{estimate} } > 0 )?
+ make_estimate_xml( $dle->{estimate} )
+ : (),
+ ( keys %{$dle->{'dumps'}} > 0 ) ?
+ map { make_dump_xml($dle, $_) } keys %{$dle->{'dumps'}}
+ : (),
+ exists $dle->{parts} ?
+ map { make_part_xml($_) } @{ $dle->{parts} }
+ : ()
+ );
}
);
}