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

dmitrynovice

Active Member
Sep 18, 2018
18
0
41
34
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'
 

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!