API Command CURL Python

rbnxt18

New Member
Feb 12, 2022
2
0
1
30
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