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.3 KiB
2.3 KiB
Language / Язык: English | Русский
Content library
Локальные content libraries, library items, upload/download sessions и OVF
deploy:
app/vsphere/rest/content_rest.py,
nfc_rest.py,
app/vsphere/domain/content.py.
Эндпоинты
| Метод | Путь | Заметки |
|---|---|---|
| GET | /api/content/library |
Список library ids |
| POST | /api/content/local-library |
Создать local library |
| GET/POST | /api/content/library/item |
Список / create items (?library_id=) |
| POST | /api/vcenter/ovf/library-item/{item_id} |
Deploy OVF item → новая VirtualMachine + task |
| POST | /api/content/library/item/update-session[/{session_id}[/file]] |
Поток push-upload (стиль Ansible/Terraform) |
| GET/POST | /api/content/library/item/download-session[/{session_id}[/file]] |
Поток pull-download |
| GET/PUT/POST | /nfc/{lease} | /nfc/{lease}/files/{filename} | /nfc/{lease}/complete |
Эндпоинты transfer в стиле HttpNfcLease для SOAP import path |
Основные моменты
- Libraries/items живут в
vsphere_libraries/vsphere_library_items; seed создаёт две libraries («Local Content», «Published Templates») с OVF-typed items (ubuntu-22.04,centos-stream-9,golden-image). - Update/download sessions живут в PostgreSQL (
vsphere_transfer_sessions, миграция012) и моделируют handshake передачи файлов — не реальное byte-for-byte хранилище OVF/VMDK. Строки HttpNfcLease — вvsphere_nfc_leases. deploy_ovf_from_libraryсоздаёт реальную строкуVirtualMachineи возвращает task id, зеркаля SOAP-потокImportVApp_Task/CreateImportSpec+HttpNfcLease*, используемый govc-styleovf.import.- Для create нужны
ContentLibrary.CreateLocalLibrary/.AddLibraryItem, для deploy —VirtualMachine.Provisioning.DeployTemplate.
Операции HttpNfcLease progress/complete/abort для upload-heavy клиентов — SOAP / VIM.