]> git.proxmox.com Git - pve-manager.git/commitdiff
task log: set default in the api call
authorDominik Csapak <d.csapak@proxmox.com>
Fri, 29 Jun 2018 08:20:21 +0000 (10:20 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Fri, 29 Jun 2018 08:31:23 +0000 (10:31 +0200)
we have the defaults documented here, so set them here too
otherwise if the default change in PVE::Tools, we probably forget to
update the api description

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
PVE/API2/Tasks.pm

index ec36f4b6f3ecb4c6976de261fae4640fb7d7641a..1395b6b95d32069cc9c9bf51e39509e73675ee58 100644 (file)
@@ -267,15 +267,17 @@ __PACKAGE__->register_method({
        my $rpcenv = PVE::RPCEnvironment::get();
        my $user = $rpcenv->get_user();
        my $node = $param->{node};
+       my $start = $param->{start} // 0;
+       my $limit = $param->{limit} // 50;
 
        if ($user ne $task->{user})  {
            $rpcenv->check($user, "/nodes/$node", [ 'Sys.Audit' ]);
        }
 
-       my ($count, $lines) = PVE::Tools::dump_logfile($filename, $param->{start}, $param->{limit});
+       my ($count, $lines) = PVE::Tools::dump_logfile($filename, $start, $limit);
 
        $rpcenv->set_result_attrib('total', $count);
-           
+
        return $lines;
     }});