},
'comment' => {
description => 'Comment',
- type => 'string',
- optional => 1,
+ type => 'string',
+ optional => 1,
+ },
+ 'disable' => {
+ description => 'Show if this target is disabled',
+ type => 'boolean',
+ optional => 1,
+ default => 0,
+ },
+ 'origin' => {
+ description => 'Show if this entry was created by a user or was built-in',
+ type => 'string',
+ enum => [qw(user-created builtin modified-builtin)],
},
},
},
name => $target->{name},
comment => $target->{comment},
type => 'sendmail',
+ disable => $target->{disable},
+ origin => $target->{origin},
};
}
name => $target->{name},
comment => $target->{comment},
type => 'gotify',
+ disable => $target->{disable},
+ origin => $target->{origin},
};
}
name => $target->{name},
comment => $target->{comment},
type => 'smtp',
+ disable => $target->{disable},
+ origin => $target->{origin},
};
}
},
'comment' => {
description => 'Comment',
- type => 'string',
- optional => 1,
+ type => 'string',
+ optional => 1,
+ },
+ 'disable' => {
+ description => 'Disable this target',
+ type => 'boolean',
+ optional => 1,
+ default => 0,
},
};
type => 'array',
items => {
type => 'object',
- properties => $sendmail_properties,
+ properties => {
+ %$sendmail_properties,
+ 'origin' => {
+ description => 'Show if this entry was created by a user or was built-in',
+ type => 'string',
+ enum => [qw(user-created builtin modified-builtin)],
+ },
+ },
},
links => [ { rel => 'child', href => '{name}' } ],
},
my $from_address = extract_param($param, 'from-address');
my $author = extract_param($param, 'author');
my $comment = extract_param($param, 'comment');
+ my $disable = extract_param($param, 'disable');
eval {
PVE::Notify::lock_config(sub {
$from_address,
$author,
$comment,
+ $disable,
);
PVE::Notify::write_config($config);
my $from_address = extract_param($param, 'from-address');
my $author = extract_param($param, 'author');
my $comment = extract_param($param, 'comment');
+ my $disable = extract_param($param, 'disable');
my $delete = extract_param($param, 'delete');
my $digest = extract_param($param, 'digest');
$from_address,
$author,
$comment,
+ $disable,
$delete,
$digest,
);
},
'comment' => {
description => 'Comment',
- type => 'string',
- optional => 1,
+ type => 'string',
+ optional => 1,
+ },
+ 'disable' => {
+ description => 'Disable this target',
+ type => 'boolean',
+ optional => 1,
+ default => 0,
},
};
type => 'array',
items => {
type => 'object',
- properties => remove_protected_properties($gotify_properties, ['token']),
+ properties => {
+ % {remove_protected_properties($gotify_properties, ['token'])},
+ 'origin' => {
+ description => 'Show if this entry was created by a user or was built-in',
+ type => 'string',
+ enum => [qw(user-created builtin modified-builtin)],
+ },
+ },
},
links => [ { rel => 'child', href => '{name}' } ],
},
my $server = extract_param($param, 'server');
my $token = extract_param($param, 'token');
my $comment = extract_param($param, 'comment');
+ my $disable = extract_param($param, 'disable');
eval {
PVE::Notify::lock_config(sub {
$server,
$token,
$comment,
+ $disable,
);
PVE::Notify::write_config($config);
my $server = extract_param($param, 'server');
my $token = extract_param($param, 'token');
my $comment = extract_param($param, 'comment');
+ my $disable = extract_param($param, 'disable');
my $delete = extract_param($param, 'delete');
my $digest = extract_param($param, 'digest');
$server,
$token,
$comment,
+ $disable,
$delete,
$digest,
);
},
'comment' => {
description => 'Comment',
- type => 'string',
- optional => 1,
+ type => 'string',
+ optional => 1,
+ },
+ 'disable' => {
+ description => 'Disable this target',
+ type => 'boolean',
+ optional => 1,
+ default => 0,
},
};
type => 'array',
items => {
type => 'object',
- properties => $smtp_properties,
+ properties => {
+ %{ remove_protected_properties($smtp_properties, ['password']) },
+ 'origin' => {
+ description => 'Show if this entry was created by a user or was built-in',
+ type => 'string',
+ enum => [qw(user-created builtin modified-builtin)],
+ },
+ },
},
links => [ { rel => 'child', href => '{name}' } ],
},
my $from_address = extract_param($param, 'from-address');
my $author = extract_param($param, 'author');
my $comment = extract_param($param, 'comment');
+ my $disable = extract_param($param, 'disable');
eval {
PVE::Notify::lock_config(sub {
$from_address,
$author,
$comment,
+ $disable,
);
PVE::Notify::write_config($config);
my $from_address = extract_param($param, 'from-address');
my $author = extract_param($param, 'author');
my $comment = extract_param($param, 'comment');
+ my $disable = extract_param($param, 'disable');
my $delete = extract_param($param, 'delete');
my $digest = extract_param($param, 'digest');
$from_address,
$author,
$comment,
+ $disable,
$delete,
$digest,
);
},
'comment' => {
description => 'Comment',
- type => 'string',
- optional => 1,
+ type => 'string',
+ optional => 1,
+ },
+ 'disable' => {
+ description => 'Disable this matcher',
+ type => 'boolean',
+ optional => 1,
+ default => 0,
},
};
type => 'array',
items => {
type => 'object',
- properties => $matcher_properties,
+ properties => {
+ %$matcher_properties,
+ 'origin' => {
+ description => 'Show if this entry was created by a user or was built-in',
+ type => 'string',
+ enum => [qw(user-created builtin modified-builtin)],
+ },
+ }
},
links => [ { rel => 'child', href => '{name}' } ],
},
my $mode = extract_param($param, 'mode');
my $invert_match = extract_param($param, 'invert-match');
my $comment = extract_param($param, 'comment');
+ my $disable = extract_param($param, 'disable');
eval {
PVE::Notify::lock_config(sub {
$mode,
$invert_match,
$comment,
+ $disable,
);
PVE::Notify::write_config($config);
my $mode = extract_param($param, 'mode');
my $invert_match = extract_param($param, 'invert-match');
my $comment = extract_param($param, 'comment');
+ my $disable = extract_param($param, 'disable');
my $digest = extract_param($param, 'digest');
my $delete = extract_param($param, 'delete');
$mode,
$invert_match,
$comment,
+ $disable,
$delete,
$digest,
);