default => '*/15',
optional => 1,
},
+ source => {
+ description => "Source of the replication.",
+ type => 'string', format => 'pve-node',
+ optional => 1,
+ },
},
};
if defined($data->{comment});
}
- $class->SUPER::write_config($filename, $cfg);
+ return $class->SUPER::write_config($filename, $cfg);
}
sub new {
lock($code);
}
+sub swap_source_target_nolock {
+ my ($jobid) = @_;
+
+ my $cfg = __PACKAGE__->new();
+ my $job = $cfg->{ids}->{$jobid};
+ my $tmp = $job->{source};
+ $job->{source} = $job->{target};
+ $job->{target} = $tmp;
+ $cfg->write();
+
+ return $cfg->{ids}->{$jobid};
+}
+
package PVE::ReplicationConfig::Cluster;
use base qw(PVE::ReplicationConfig);
rate => { optional => 1 },
schedule => { optional => 1 },
remove_job => { optional => 1 },
+ source => { optional => 1 },
};
}