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.
2.0 KiB
2.0 KiB
Language / Язык: English | Русский
Content library
Local content libraries, library items, upload/download sessions, and OVF
deploy:
app/vsphere/rest/content_rest.py,
nfc_rest.py,
app/vsphere/domain/content.py.
Endpoints
| Method | Path | Notes |
|---|---|---|
| GET | /api/content/library |
List library ids |
| POST | /api/content/local-library |
Create a local library |
| GET/POST | /api/content/library/item |
List / create items (?library_id=) |
| POST | /api/vcenter/ovf/library-item/{item_id} |
Deploy OVF item → new VirtualMachine + task |
| POST | /api/content/library/item/update-session[/{session_id}[/file]] |
Push-upload flow (Ansible/Terraform-style) |
| GET/POST | /api/content/library/item/download-session[/{session_id}[/file]] |
Pull-download flow |
| GET/PUT/POST | /nfc/{lease} | /nfc/{lease}/files/{filename} | /nfc/{lease}/complete |
HttpNfcLease-style transfer endpoints for the SOAP import path |
Highlights
- Libraries/items persist in
vsphere_libraries/vsphere_library_items; the seed creates two libraries ("Local Content", "Published Templates") with OVF-typed items (ubuntu-22.04,centos-stream-9,golden-image). - Update/download sessions persist in PostgreSQL (
vsphere_transfer_sessions, migration012) and model the file-transfer handshake — not a real byte-for-byte OVF/VMDK store. HttpNfcLease rows live invsphere_nfc_leases. deploy_ovf_from_librarycreates a realVirtualMachinerow and returns a task id, mirroring the SOAPImportVApp_Task/CreateImportSpec+HttpNfcLease*flow used by govc-styleovf.import.- Requires
ContentLibrary.CreateLocalLibrary/.AddLibraryItemto create, andVirtualMachine.Provisioning.DeployTemplateto deploy.
See SOAP / VIM for the HttpNfcLease progress/complete/abort operations used by upload-heavy clients.