ESP8266-Proxmox-API
Control your Proxmox VMs with your ESP8266
How to use:
- Create an API User on your Proxmox Machine (as shown below)
- Download Code, install the Libraries from the Library-Manager and Update the Variables
- Have Fun!
Important:
More Information to the Permissions and API Commands can be found here: https://pve.proxmox.com/pve-docs/api-viewer/index.html This Code can only do POST, PUT or DELETE-Requests as the Proxmox API needs another type of Authetication for GET-Requests.
Extended Instructions:
1. Go to Datacenter
in the List on the left
- Search in the Menu for
Permissions
. Then click onUsers
.
2. Create a new User on the Proxmox Machine
- Give it a Name.
- Choose "Proxmox VE authentication server" in the field "Realm".
- Add a secure password.
3. Create a new API Token
- Go to
API Tokens
in the Menu - Insert the User you created.
- Give it an ID or Name.
- When you finished, click on
Add
and note the two secret values shown! Do not forget as this will never be shown again.
4. Create a Role
- Go to the Menu and Click
Roles
- Add a new Role
- Give it a Name
- Add the Permissions needed (for Example:
VM.PowerMgmt
is needed for Starting and Stopping a VM)
More Information to the Permissions can be found here: https://pve.proxmox.com/pve-docs/api-viewer/index.html
5. Add the Permission to the User and the API
- Go in the Menu to
Permissions
- Click on
Add
and then onUser Permissions
- Select the Path
/
, insert the User you created and insert the Role you created - Then click add and Repeat this process with
API Token Permission
6. Update Arduino Code
Now update the Variables in the Arduino Code and Execute it. It should work.
Credits
https://www.survivingwithandroid.com/invoke-https-rest-json-api-esp8266/