]> git.proxmox.com Git - pve-container.git/commitdiff
snapshot list: define return properties
authorDietmar Maurer <dietmar@proxmox.com>
Wed, 1 Aug 2018 11:38:24 +0000 (13:38 +0200)
committerDietmar Maurer <dietmar@proxmox.com>
Wed, 1 Aug 2018 11:40:44 +0000 (13:40 +0200)
Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
src/PVE/API2/LXC/Snapshot.pm

index edccbf4a2844784a959fc7901c56e0dc4cf1125b..db41954ecbcdb5195a2480cf9566929d3858b7b9 100644 (file)
@@ -39,7 +39,27 @@ __PACKAGE__->register_method({
        type => 'array',
        items => {
            type => "object",
-           properties => {},
+           properties => {
+               name => {
+                   description => "Snapshot identifier. Value 'current' identifies the current VM.",
+                   type => 'string',
+               },
+               description => {
+                   description => "Snapshot description.",
+                   type => 'string',
+               },
+               snaptime => {
+                   description => "Snapshot creation time",
+                   type => 'integer',
+                   renderer => 'timestamp',
+                   optional => 1,
+               },
+               parent => {
+                   description => "Parent snapshot identifier.",
+                   type => 'string',
+                   optional => 1,
+               },
+           },
        },
        links => [ { rel => 'child', href => "{name}" } ],
     },
@@ -66,7 +86,12 @@ __PACKAGE__->register_method({
        }
 
        my $running = PVE::LXC::check_running($vmid) ? 1 : 0;
-       my $current = { name => 'current', digest => $conf->{digest}, running => $running };
+       my $current = {
+           name => 'current',
+           digest => $conf->{digest},
+           running => $running,
+           description => "You are here!",
+       };
        $current->{parent} = $conf->{parent} if defined($conf->{parent});
 
        push @$res, $current;