/ESP8266-Proxmox-API

Control your Proxmox VMs with your ESP8266

Primary LanguageC++MIT LicenseMIT

ESP8266-Proxmox-API

Control your Proxmox VMs with your ESP8266

How to use:

  1. Create an API User on your Proxmox Machine (as shown below)
  2. Download Code, install the Libraries from the Library-Manager and Update the Variables
  3. 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

menu_permissions

  • Search in the Menu for Permissions. Then click on Users.

2. Create a new User on the Proxmox Machine

create_user

  • Give it a Name.
  • Choose "Proxmox VE authentication server" in the field "Realm".
  • Add a secure password.

3. Create a new API Token

create_apitoken

  • 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

image

  • 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

add_permission

  • Go in the Menu to Permissions
  • Click on Add and then on User Permissions

image

  • 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/