API Command CURL Python

rbnxt18

New Member
Feb 12, 2022
2
0
1
29
Hello,

i tried to implement the shutdown api call into a python program but i have no idea how to properly build the syntax.
The command runs fine on linux bash but i cannot find suitable arguments for python.

curl 'https://myhost.local:8006/api2/extjs/nodes/myhost/status' -H 'Authorization: PVEAPIToken=xxx@pam!xx=xxx' -H 'Content-Type: application/x-www-form-urlencoded' --data 'command=shutdown' --insecure


How to specify the authorization, as it is no classic username:password setup?
How to specify the "insecure"

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!