]> git.proxmox.com Git - pve-storage.git/commitdiff
remove outdated unused API2::Storage::Replication module
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Wed, 3 Oct 2018 14:58:55 +0000 (16:58 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Wed, 3 Oct 2018 14:58:57 +0000 (16:58 +0200)
this was not installed, had references to non-existing modules
(e.g., PVE::ReplicationTools) and the things it probably was intended
for are done in pve-manager, which has full access to all pve perl
libs and API methods (from a dependency POV)

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
PVE/API2/Storage/Replication.pm [deleted file]

diff --git a/PVE/API2/Storage/Replication.pm b/PVE/API2/Storage/Replication.pm
deleted file mode 100644 (file)
index 61de0b6..0000000
+++ /dev/null
@@ -1,114 +0,0 @@
-package PVE::API2::Storage::Replication;
-
-use warnings;
-use strict;
-
-use PVE::JSONSchema qw(get_standard_option);
-use PVE::RPCEnvironment;
-use PVE::ReplicationTools;
-
-use PVE::RESTHandler;
-
-use base qw(PVE::RESTHandler);
-
-__PACKAGE__->register_method ({
-    name => 'index',
-    path => '',
-    method => 'GET',
-    permissions => { user => 'all' },
-    description => "Directory index.",
-    parameters => {
-       additionalProperties => 0,
-       properties => {
-           node => get_standard_option('pve-node'),
-       },
-    },
-    returns => {
-       type => 'array',
-       items => {
-           type => "object",
-           properties => {},
-       },
-       links => [ { rel => 'child', href => "{name}" } ],
-    },
-    code => sub {
-       my ($param) = @_;
-
-       return [
-           { name => 'jobs' },
-       ];
-    }});
-
-
-__PACKAGE__->register_method ({
-    name => 'jobs',
-    path => 'jobs',
-    method => 'GET',
-    description => "List replication jobs.",
-    permissions => {
-       description => "Only list jobs where you have VM.Audit permissons on /vms/<vmid>.",
-       user => 'all',
-    },
-    protected => 1,
-    proxyto => 'node',
-    parameters => {
-       additionalProperties => 0,
-       properties => {
-           node => get_standard_option('pve-node'),
-       },
-    },
-    returns => {
-       type => 'array',
-       items => {
-           type => "object",
-           properties => {},
-       },
-       links => [ { rel => 'child', href => "{vmid}" } ],
-    },
-    code => sub {
-       my ($param) = @_;
-
-       my $rpcenv = PVE::RPCEnvironment::get();
-       my $authuser = $rpcenv->get_user();
-
-       my $jobs = PVE::ReplicationTools::get_all_jobs();
-
-       my $res = [];
-       foreach my $vmid (sort keys %$jobs) {
-           next if !$rpcenv->check($authuser, "/vms/$vmid", [ 'VM.Audit' ]);
-           my $job = $jobs->{$vmid};
-           $job->{vmid} = $vmid;
-           push @$res, $job;
-       }
-
-       return $res;
-    }});
-
-__PACKAGE__->register_method ({
-    name => 'destroy_job',
-    path => 'jobs/vmid',
-    method => 'DELETE',
-    description => "Destroy replication job.",
-    permissions => {
-       check => ['perm', '/vms/{vmid}', ['VM.Config.Disk']],
-    },
-    protected => 1,
-    parameters => {
-       additionalProperties => 0,
-       properties => {
-           vmid => {
-               description => "The VMID of the guest.",
-               type => 'string', format => 'pve-vmid',
-           },
-       },
-    },
-    returns => { type => 'null' },
-    code => sub {
-       my ($param) = @_;
-
-       PVE::ReplicationTools::destroy_replica($param->{vmid});
-
-       return undef;
-    }});
-
-1;