Created
March 22, 2022 14:46
-
-
Save FunDeckHermit/a1b4ec358f037578765e12f22b261ac1 to your computer and use it in GitHub Desktop.
Proxmox switch from Home Assistant
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- platform: command_line | |
switches: | |
proxmox_lxc: | |
command_on: "curl -X POST 'https://10.0.0.1:8006/api2/json/nodes/pve/lxc/102/status/start' -H 'Authorization: PVEAPIToken=USER@REALM!TOKENID=UUID' -H 'Content-Type: application/x-www-form-urlencoded'" | |
command_off: "curl -X POST 'https://10.0.0.1:8006/api2/json/nodes/pve/lxc/102/status/stop' -H 'Authorization: PVEAPIToken=USER@REALM!TOKENID=UUID' -H 'Content-Type: application/x-www-form-urlencoded'" | |
command_state: "curl -X GET 'https://10.0.0.1:8006/api2/json/nodes/pve/lxc/102/status/current' -H 'Authorization: PVEAPIToken=USER@REALM!TOKENID=UUID' -H 'Content-Type: application/x-www-form-urlencoded' 2>&1 | grep -oc 'running'" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment