Pcornel
Automation · Proxmox Automation

Proxmox API

Cheat sheet · https://pcornel.dk/topic.php?topic=5721

Back to the Topic

Answer

The Proxmox VE API is a REST API at https://host:8006/api2/json covering nodes, VMs, containers, storage and clusters. Use API tokens with limited privileges for automation.

Remember

  • API at https://host:8006/api2/json.
  • Use API tokens with limited privileges.
  • Many calls return a task UPID.

First checks

  • pvesh get /cluster/resources --type vm — VMs via API
  • pvesh get /nodes/<node>/tasks/<upid>/status — task status
  • pveum user token list <user> — tokens

Verify in this order

request → token auth → API → task UPID → status

Where it usually breaks

Client payload/auth → HTTP transport → endpoint validation/policy → request accepted → queued/job execution → target mutation → effective state → consumer workload.

Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=5721

Confirmation

Confirm action

Continue?