Hi,
I've came up with a working Python script to get all snapshots for specific VMs.
This is the snippet to GET all snapshots for a certain VM (working!):
If I add the following to CREATE a snapshot, I get an error 500 (YES, snapname is certainly a string):
Can you tell me what I'm missing? Thanks for your time, have a nice day!
I've came up with a working Python script to get all snapshots for specific VMs.
This is the snippet to GET all snapshots for a certain VM (working!):
Python:
api_node = proxmox_api + "/json/nodes/" + proxmox_node + "/qemu/" + node_id + "/snapshot"
proxmox_api_auth = "PVEAPIToken=" + proxmox_apikey_owner + "!" + "snapshot=" + proxmox_apikey
headers = {
'Content-Type': 'application/json',
'Authorization': proxmox_api_auth,
}
api_response = requests.get(api_node, headers=headers, verify=False)
If I add the following to CREATE a snapshot, I get an error 500 (YES, snapname is certainly a string):
Python:
data = {
'snapname': next_snapshot_name,
}
api_response = requests.post(api_node, headers=headers, data=data, verify=False)
Can you tell me what I'm missing? Thanks for your time, have a nice day!