[pve-devel] [PATCH manager 1/2] add vmid parameter to replication status

Dominik Csapak d.csapak at proxmox.com
Fri Jun 2 14:06:27 CEST 2017


so that one can limit the status list for one vm/ct

Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
---
this will be useful for the web interface
 PVE/API2/Replication.pm | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/PVE/API2/Replication.pm b/PVE/API2/Replication.pm
index 192a61bb..43839c43 100644
--- a/PVE/API2/Replication.pm
+++ b/PVE/API2/Replication.pm
@@ -57,6 +57,10 @@ __PACKAGE__->register_method ({
 	additionalProperties => 0,
 	properties => {
 	    node => get_standard_option('pve-node'),
+	    vmid => get_standard_option('pve-vmid', {
+		optional => 1,
+		description => "Only list replication jobs for this vmid.",
+	    }),
 	},
     },
     returns => {
@@ -80,6 +84,7 @@ __PACKAGE__->register_method ({
 	    my $d = $jobs->{$id};
 	    my $state = delete $d->{state};
 	    my $vmid = $d->{guest};
+	    next if defined($param->{vmid}) && $vmid != $param->{vmid};
 	    next if !$rpcenv->check($authuser, "/vms/$vmid", [ 'VM.Audit' ]);
 	    $d->{id} = $id;
 	    foreach my $k (qw(last_sync last_try fail_count error duration)) {
-- 
2.11.0





More information about the pve-devel mailing list