- if ($param->{delete}) {
- foreach my $opt (PVE::Tools::split_list($param->{delete})) {
- raise_param_exc({ delete => "no such option '$opt'" })
- if !$option_properties->{$opt};
- delete $vmfw_conf->{options}->{$opt};
- }
- }
-
- if (defined($param->{enable})) {
- $param->{enable} = $param->{enable} ? 1 : 0;
- }
-
- foreach my $k (keys %$option_properties) {
- next if !defined($param->{$k});
- $vmfw_conf->{options}->{$k} = $param->{$k};
- }
-
- PVE::Firewall::save_vmfw_conf($param->{vmid}, $vmfw_conf);
-
- return undef;
- }});
-
-__PACKAGE__->register_method({
- name => 'log',
- path => 'log',
- method => 'GET',
- description => "Read firewall log",
- proxyto => 'node',
- permissions => {
- check => ['perm', '/vms/{vmid}', [ 'VM.Console' ]],
- },
- protected => 1,
- parameters => {
- additionalProperties => 0,
- properties => {
- node => get_standard_option('pve-node'),
- vmid => get_standard_option('pve-vmid'),
- start => {
- type => 'integer',
- minimum => 0,
- optional => 1,
- },
- limit => {
- type => 'integer',
- minimum => 0,
- optional => 1,
+
+ $class->register_method({
+ name => 'get_options',
+ path => 'options',
+ method => 'GET',
+ description => "Get VM firewall options.",
+ proxyto => 'node',
+ parameters => {
+ additionalProperties => 0,
+ properties => {
+ node => get_standard_option('pve-node'),
+ vmid => get_standard_option('pve-vmid'),