Files
vmware-api-simulator/docs/ru/examples/python-requests.md
T
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.5 KiB
Raw Blame History

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

Python — REST (requests / stdlib)

Сырой HTTP к REST-шлюзу vSphere без vendor SDK.

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

requests_cookbook.py демонстрирует общий поток session → create → wait-for-task → power on → wait → power off → delete с помощью requests; идентификатор сессии передаётся в заголовке vmware-api-session-id.

Для варианта без внешних зависимостей, только на стандартной библиотеке (urllib), см. vsphere_rest_smoke.py:

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

Для комбинированного smoke REST-create + SOAP-CreateVM_Task + guest-filesystem см. vsphere_lifecycle.py:

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

Все три скрипта по умолчанию используют administrator@vsphere.local / VMware1! и отключают проверку TLS только для локального самоподписанного сертификата разработческого шлюза.