description => "Enable or disable the job.",
default => '1',
},
+ comment => {
+ optional => 1,
+ type => 'string',
+ description => "Description for the Job.",
+ maxLength => 512,
+ },
}),
},
returns => { type => 'null' },
description => "Enable or disable the job.",
default => '1',
},
+ comment => {
+ optional => 1,
+ type => 'string',
+ description => "Description for the Job.",
+ maxLength => 512,
+ },
}),
},
returns => { type => 'null' },
}
foreach my $k (@$delete) {
- if (!PVE::VZDump::option_exists($k)) {
+ if (!PVE::VZDump::option_exists($k) && $k ne 'comment') {
raise_param_exc({ delete => "unknown option '$k'" });
}
type => 'string', format => 'pve-calendar-event',
maxLength => 128,
},
+ comment => {
+ optional => 1,
+ type => 'string',
+ description => "Description for the Job.",
+ maxLength => 512,
+ },
},
};
$data->{id} = $id;
$data->{enabled} //= 1;
+
+ if (defined($data->{comment})) {
+ $data->{comment} = PVE::Tools::decode_text($data->{comment});
+ }
}
return $cfg;
return $plugin->encode_value($type, $key, $value);
}
+sub write_config {
+ my ($class, $filename, $cfg) = @_;
+
+ for my $job (values $cfg->{ids}->%*) {
+ if (defined($job->{comment})) {
+ $job->{comment} = PVE::Tools::encode_text($job->{comment});
+ }
+ }
+
+ $class->SUPER::write_config($filename, $cfg);
+}
+
sub run {
my ($class, $cfg) = @_;
# implement in subclass
my $options = {
enabled => { optional => 1 },
schedule => {},
+ comment => { optional => 1 },
};
foreach my $opt (keys %$props) {
if ($props->{$opt}->{optional}) {