]> git.proxmox.com Git - pve-firewall.git/blobdiff - src/PVE/API2/Firewall/Host.pm
bump version to 5.0.7
[pve-firewall.git] / src / PVE / API2 / Firewall / Host.pm
index b66ca55e553e981af0161802a578ed6c6434a116..0432de2224b7713ef787ff52ac996beebbaa2837 100644 (file)
@@ -118,7 +118,7 @@ __PACKAGE__->register_method({
     code => sub {
        my ($param) = @_;
 
-       PVE::Firewall::lock_hostfw_conf(10, sub {
+       PVE::Firewall::lock_hostfw_conf(undef, 10, sub {
            my $cluster_conf = PVE::Firewall::load_clusterfw_conf();
            my $hostfw_conf = PVE::Firewall::load_hostfw_conf($cluster_conf);
 
@@ -172,6 +172,18 @@ __PACKAGE__->register_method({
                minimum => 0,
                optional => 1,
            },
+           since => {
+               type => 'integer',
+               minimum => 0,
+               description => "Display log since this UNIX epoch.",
+               optional => 1,
+           },
+           until => {
+               type => 'integer',
+               minimum => 0,
+               description => "Display log until this UNIX epoch.",
+               optional => 1,
+           },
        },
     },
     returns => {
@@ -196,8 +208,10 @@ __PACKAGE__->register_method({
        my $rpcenv = PVE::RPCEnvironment::get();
        my $user = $rpcenv->get_user();
        my $node = $param->{node};
+       my $filename = "/var/log/pve-firewall.log";
 
-       my ($count, $lines) = PVE::Tools::dump_logfile("/var/log/pve-firewall.log", $param->{start}, $param->{limit});
+       my ($count, $lines) = PVE::Firewall::Helpers::dump_fw_logfile(
+           $filename, $param, undef);
 
        $rpcenv->set_result_attrib('total', $count);