]>
Commit | Line | Data |
---|---|---|
76c35814 | 1 | package PVE::API2::Storage::Replication; |
663510b8 WL |
2 | |
3 | use warnings; | |
4 | use strict; | |
5 | ||
6 | use PVE::JSONSchema qw(get_standard_option); | |
7 | use PVE::ReplicationTools; | |
8 | ||
9 | use PVE::RESTHandler; | |
10 | ||
11 | use base qw(PVE::RESTHandler); | |
12 | ||
13 | __PACKAGE__->register_method ({ | |
07dff267 DM |
14 | name => 'index', |
15 | path => '', | |
16 | method => 'GET', | |
17 | permissions => { user => 'all' }, | |
18 | description => "Directory index.", | |
19 | parameters => { | |
20 | additionalProperties => 0, | |
21 | properties => { | |
22 | node => get_standard_option('pve-node'), | |
23 | }, | |
24 | }, | |
25 | returns => { | |
26 | type => 'array', | |
27 | items => { | |
28 | type => "object", | |
29 | properties => {}, | |
30 | }, | |
31 | links => [ { rel => 'child', href => "{name}" } ], | |
32 | }, | |
33 | code => sub { | |
34 | my ($param) = @_; | |
35 | ||
36 | return [ | |
37 | { name => 'jobs' }, | |
38 | ]; | |
39 | }}); | |
40 | ||
41 | ||
42 | __PACKAGE__->register_method ({ | |
43 | name => 'jobs', | |
44 | path => 'jobs', | |
663510b8 | 45 | method => 'GET', |
e0992d57 | 46 | description => "List replication jobs.", |
663510b8 WL |
47 | permissions => { |
48 | user => 'all', | |
49 | }, | |
50 | protected => 1, | |
51 | proxyto => 'node', | |
52 | parameters => { | |
53 | additionalProperties => 0, | |
54 | properties => { | |
55 | node => get_standard_option('pve-node'), | |
663510b8 WL |
56 | }, |
57 | }, | |
58 | returns => { type => 'object' }, | |
59 | code => sub { | |
60 | my ($param) = @_; | |
61 | ||
e0992d57 DM |
62 | return PVE::ReplicationTools::get_all_jobs(); |
63 | }}); | |
663510b8 WL |
64 | |
65 | 1; |