Enable Firewall API call failed with 501 not implemented

Feb 2, 2023
6
0
1
Hei folks,
I am trying to enable VM firewall via API call using ansible URI module
Code:
- name: Enable firewall
  ansible.builtin.uri:
    url: "{{ proxmox_url }}:8006/api2/json/nodes/{{ node }}/qemu/{{ vmid }}/firewall/options"
    method: POST
    headers:
      Authorization: "PVEAPIToken={{ api_user }}!{{ api_token_id }}={{ api_token_secret }}"
    body_format: form-urlencoded
    body:
    - [ enable, true ]

but getting error:

Code:
"msg": "Status code was 501 and not [200]: HTTP Error 501: Method 'POST /nodes/node/qemu/111/firewall/options' not implemented"

Another similar api call for adding rules set /firewall/rules works just fine.

Tried with [ enable, 1 ] as well, but no change.


Any idea?
Thx!
 
I am pretty sure I did PUT at first place and got 501 as well.
Now I am getting
Code:
 "errors": {"enable": "type check ('boolean') failed - got 'True'"}}, "msg": "Status code was 400 and not [200]: HTTP Error 400: Parameter verification failed."

changed the body to [ enable, 1 ] seems to work.

Thanks!
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!