I'm trying to delete a firewall rule through the API by sending the digest with the HTTP Delete request. But I get an error saying: Unexpected content for method 'DELETE'
The digest can be used in a delete according to the docs to prevent modifying the firewall rules if they've been changed by someone else. This is good IMO since a change in the firewall rules mean that the positions of the rules may change and you risk deleting the wrong rule.
http://pve.proxmox.com/pve-docs/api-viewer/index.html
nodes -> {node} -> lxc -> {vmid} -> firewall -> rules -> {pos} -> DELETE
The parameters node, vmid and pos are part of the API URL. The digest is sent as: application/x-www-form-urlencoded
I'm suspecting that either the docs are wrong or that there is a bug in PVE. This is because:
1) the docs mentions that pos is an optional parameter which it's not since its part of the URL.
2) the source code shows it only allows HTTP POST and HTTP PUT requests to include application/x-www-form-urlencoded. See https://github.com/proxmox/pve-manager/blob/master/PVE/HTTPServer.pm#L1266
My question: Is it possible to delete a firewall rule through the API and include a digest in the delete request?
Or is there any other way to prevent a delete if the firewall rules has been changed?
The digest can be used in a delete according to the docs to prevent modifying the firewall rules if they've been changed by someone else. This is good IMO since a change in the firewall rules mean that the positions of the rules may change and you risk deleting the wrong rule.
http://pve.proxmox.com/pve-docs/api-viewer/index.html
nodes -> {node} -> lxc -> {vmid} -> firewall -> rules -> {pos} -> DELETE
The parameters node, vmid and pos are part of the API URL. The digest is sent as: application/x-www-form-urlencoded
I'm suspecting that either the docs are wrong or that there is a bug in PVE. This is because:
1) the docs mentions that pos is an optional parameter which it's not since its part of the URL.
2) the source code shows it only allows HTTP POST and HTTP PUT requests to include application/x-www-form-urlencoded. See https://github.com/proxmox/pve-manager/blob/master/PVE/HTTPServer.pm#L1266
My question: Is it possible to delete a firewall rule through the API and include a digest in the delete request?
Or is there any other way to prevent a delete if the firewall rules has been changed?