Pcornel
Browse topics
Options
Recent
Favorites
Virtualization · Technical reference

APIs

Direct answer

Hypervisor APIs (vSphere API, Hyper-V WMI/PowerShell, libvirt, Proxmox REST, cloud provider APIs) expose VM, network and storage operations to scripts and tools; authenticate with a scoped service account and use the API's task status to confirm results.

When to use this

Use this when scripting or integrating with vSphere, Hyper-V, libvirt or Proxmox through their APIs, or when an API call fails or returns unexpected data.

First 30 seconds

1. APIs enable automation and integration.

2. Use tokens with minimal privileges.

3. Verify TLS.

4. Rate limits and timeouts.

5. Log API use.

Operational verification

client → authenticated API → management service

Context & applicabilityCommon mistakes · platform/version boundaries
Platform / version applicability
virtualization
applies
Structured applicability is explicit Topic metadata; it does not infer compatibility beyond the stored rows.
At a glance

Operational reference

Fast context before you go deeper.

Platformvirtualization
Scope / prerequisiteUse this when scripting or integrating with vSphere, Hyper-V, libvirt or Proxmox through their APIs, or when an API cal…
What next?3 suggested next steps
Evidence1
On this pageJump to a specific section
Operational workflow

Verification & Troubleshooting

Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.

2 steps Observe → verify → isolate → change minimally → repeat the original test.
ObservedRecord what the original test actually shows

Capture the concrete output, symptom, packet, log or counter before changing anything.

Step 1 Checks Verify boundary
  • Token works (curl returns 200).
  • Permissions limited to needed paths.
  • Task status polled until complete.
Step 2 Common mistakes Narrow the fault
  • Using admin accounts for API scripts instead of scoped tokens.
  • Ignoring asynchronous tasks — check the task result, not only the API response.
  • Not handling rate limits and session expiry.
Evidence references

Evidence · 1 on this Topic

Expected observations and documentation recipes are reference material. Record actual output, device identity, scope and time before claiming a verified result.

observation · 1
Key points
  • HTTP 200 on a task ≠ the task succeeded.
  • API permissions follow the service account's roles.
  • API versions differ between platform releases.
Key checks
  • curl -s -H 'Authorization: PVEAPIToken=<user>@pam!<id>=<secret>' https://<host>:8006/api2/json/version — Proxmox API
  • Invoke-RestMethod https://vcenter/api/session -Method Post -Credential $c — vCenter REST
  • virsh -c qemu+ssh://<host>/system list — libvirt remote API
ReferenceWhy it matters1 section · depth on demand

In depth

Virtualization APIs:

PlatformAPIAccess
vSphereREST (vSphere Automation API), SOAP (vim)PowerCLI, govc, pyVmomi, Terraform
Hyper-VWMI/CIM (root\virtualization\v2), PowerShell modulePowerShell remoting, WAC
Proxmox VEREST https://host:8006/api2/jsonpvesh, API tokens, proxmoxer, Terraform
libvirtlibvirt API (C, Python bindings), virshSSH/TLS transports
pvesh get /cluster/resources --type vm --output-format json
curl -sk -H 'Authorization: PVEAPIToken=automation@pve!ci=<secret>' https://pve1:8006/api2/json/nodes
govc vm.info -json app01
ReferenceImportant terms & boundaries2 sections · depth on demand

APIs per platform

PlatformAPI
vSphereREST API, PowerCLI, pyVmomi
Hyper-VPowerShell / WMI (CIM)
ProxmoxREST (/api2/json), pvesh
KVMlibvirt API (virsh, python-libvirt)

Use tokens with limited privileges.

Example calls

curl -k -H 'Authorization: PVEAPIToken=user@pam!automation=TOKEN' https://pve:8006/api2/json/nodes
Invoke-RestMethod -Uri https://vcenter/api/vcenter/vm -Headers @{'vmware-api-session-id'=$sid}

Documented example, not captured output.

Source basisSource attribution states what this section is based on; it is not independent proof that the current environment matches it.
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Technical verification history

Verification history & basis

When and against what this Topic was checked. Later text edits do not count as a new check.

2026-09-14 · vendor docvirtualization current

Authoritative/upstream documentation reviewed for bounded claims in Automation → APIs. Documentation verification only; this is not observed lab or production Evidence.

Basis: https://libvirt.org/html/index.html · confidence 94%
Confirmation

Confirm action

Continue?