f8d3cbdd59
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.
22 lines
1012 B
Markdown
22 lines
1012 B
Markdown
**Language / Язык:** [English](../../examples/go.md) | [Русский](go.md)
|
||
|
||
# Go
|
||
|
||
Использует стандартную библиотеку Go (`net/http`) против
|
||
`https://localhost` с Basic-auth сессией
|
||
(`vmware-api-session-id`).
|
||
|
||
```bash
|
||
cd examples/go
|
||
go run .
|
||
```
|
||
|
||
Переопределите значения по умолчанию через `VSPHERE_BASE`, `VSPHERE_USER`,
|
||
`VSPHERE_PASSWORD`, `VSPHERE_VM_NAME`. См. [`main.go`](../../../examples/go/main.go)
|
||
для потока session → list → create → power → wait-task → delete и вспомогательной
|
||
функции `waitTask`, которая опрашивает `GET /api/cis/tasks/{task}`.
|
||
|
||
Проверка TLS отключена в HTTP-клиенте только для локального самоподписанного
|
||
сертификата разработческого шлюза — не переиспользуйте такой transport против
|
||
реального vCenter.
|