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.
1.5 KiB
1.5 KiB
Language / Язык: English | Русский
Tasks
Long-running operations (power, clone, relocate, snapshot, OVF deploy, guest
customize) return a CIS-style task id:
app/vsphere/domain/tasks.py,
app/vsphere/rest/tasks.py.
Endpoints
| Method | Path | Notes |
|---|---|---|
| GET | /api/cis/tasks |
List recent tasks (most recent 200) |
| GET | /api/cis/tasks/{task} |
Status, progress, service/operation, result/error |
Client pattern
POST/DELETEmutation → read the task id from{ "task": "task-…" }(REST) or the SOAP*_TaskMoRef.- Poll
GET /api/cis/tasks/{task}untilstatusisSUCCEEDEDorFAILED. resultholds operation-specific output (for example{"vm": "vm-104"}on create/clone/deploy).
Highlights
- Task rows commit to
vsphere_tasks(id,description,status,service,operation,result,error,completed_at). progressis synthesized as50while running and100once terminal — this simulator does not model fractional progress.- The same task store backs both REST
/api/cis/tasksand SOAP task MoRefs, so a Terraform apply (SOAPCreateVM_Task) and a REST poll of the same id see consistent state. - Simulation durations honour
SIMULATION_TIME_SCALE(higher = faster simulated completion).
See API surface and Operations.