Files
inecs f8d3cbdd59 Initial commit: VMware vSphere API simulator scaffold.
Add the FastAPI app, PostgreSQL migrations, Docker/Helm packaging, API
contracts, docs, client examples, and the unit/integration/compatibility
test suite for local client and tooling labs without a real vCenter.
2026-07-18 04:42:11 +03:00

1.2 KiB

Language / Язык: English | Русский

Python — REST (requests / stdlib)

Raw HTTP against the vSphere REST gateway, no vendor SDK required.

pip install -r examples/python/requirements.txt
python examples/python/requests_cookbook.py

requests_cookbook.py demonstrates the shared session → create → wait-for-task → power on → wait → power off → delete flow using requests, with the session id carried as the vmware-api-session-id header.

For a dependency-free variant using only the standard library (urllib), see vsphere_rest_smoke.py:

python examples/python/vsphere_rest_smoke.py https://localhost

For a combined REST-create + SOAP-CreateVM_Task + guest-filesystem smoke, see vsphere_lifecycle.py:

VSPHERE_BASE=https://localhost python examples/python/vsphere_lifecycle.py

All three scripts default to administrator@vsphere.local / VMware1! and disable TLS verification for the local self-signed development gateway certificate only.