[SOLVED] How to remove network interface using Proxmox API?

dmitrynovice

Active Member
Sep 18, 2018
18
0
41
35
Hello.

I can add network interface using this command:

Bash:
curl -X PUT -k -b PVEAuthCookie= -H "CSRFPreventionToken:" -d net24=model%3Dvirtio%2Cbridge%3Dvmbr3334 https://192.168.1.222:8006/api2/json/nodes/node1/qemu/177/config -H 'Authorization: PVEAPIToken=root@pam!api_token=9d6824c0-a1c9-453e-8524-9ce179120c3e'

Interface may be deleted via pvesh:

Bash:
pvesh set /nodes/node1/qemu/177/config --delete net24

The question is how to delete network interface using API?

Proxmox version 7.3-3
 
Thank you!
It's working great.

I will add example for future readers:

Bash:
curl -X PUT -k -b PVEAuthCookie= -H "CSRFPreventionToken:" -d delete=net24 https://192.168.1.222:8006/api2/json/nodes/node1/qemu/177/config -H 'Authorization: PVEAPIToken=root@pam!api_token=9d6824c0-a1c9-453e-8524-9ce179120c3e'

#or several interfaces if needed

curl -X PUT -k -b PVEAuthCookie= -H "CSRFPreventionToken:" -d delete=net20,net21 https://192.168.1.222:8006/api2/json/nodes/node1/qemu/177/config -H 'Authorization: PVEAPIToken=root@pam!api_token=9d6824c0-a1c9-453e-8524-9ce179120c3e'