Delete group via api

zmen

Active Member
Nov 28, 2018
1
0
41
37
Hello.
Try to delete a group from datastore via api like:
1. curl -X DELETE https://x.x.x.x:8007/api2/json/admin/datastore/storename/groups/vm/666 -b PBSAuthCookie=xxxx
2. curl -X DELETE https://x.x.x.x:8007/api2/json/admin/datastore/storename/groups -b PBSAuthCookie=xxxx --header 'Content-Type: application/json' --data '{"data":[{"backup-id": "666","backup-type":"vm",}]}'
3. curl -X DELETE https://x.x.x.x:8007/api2/json/admin/datastore/storename/vm/666 -b PBSAuthCookie=xxxx
4. curl -X DELETE https://x.x.x.x:8007/api2/json/admin/datastore/storename/groups?backup-type=vm&backup-id=666 -b PBSAuthCookie=xxxx

All wrong. Can any one help me with it ?
 
the url would have to be
Code:
/api2/json/admin/datastore/STORENAME/groups?backup-type=TYPE&backup-id=ID&ns=NAMESPACE
as DELETE (as you correctly identified)

whats probably missing is the CSRFPrevention token that you get with the ticket calls, this is necessary for all non-GET operations

if you want to see a complete api call that works, check the browser debug console when deleting a group, in chrome you can even use the 'copy as curl' feature to get
a complete curl commandline for a specific request
 

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!