Expand lab seed tiers, OpenAPI PARAMS, and console DATA/Params UX.

This commit is contained in:
2026-07-18 08:46:39 +03:00
parent f8d3cbdd59
commit 63cc409424
71 changed files with 38380 additions and 796 deletions
+17 -3
View File
@@ -277,7 +277,14 @@ async def guest_customization_get(
) -> dict[str, Any]:
obj = await vm_ops.require_vm(database, vm)
customization = obj.props.get("customization")
return customization if isinstance(customization, dict) else {}
if isinstance(customization, dict) and customization:
return customization
# Seed / probe may wipe the field with POST {}; keep a non-empty lab view.
return {
"name": obj.name,
"status": "PENDING",
"spec": {"hostname": obj.name, "domain": "lab.local"},
}
@router.get("/api/vcenter/vm/{vm}/guest/networking")
@@ -352,6 +359,8 @@ async def guest_customization(
_: SessionInfo = Depends(require_privilege("VirtualMachine.Config.Rename")),
) -> dict[str, str]:
obj = await vm_ops.require_vm(database, vm)
if not isinstance(body, dict) or not body:
raise invalid_argument("customization spec is required")
props = dict(obj.props)
props["customization"] = body
await inventory.update_props(database, vm, props)
@@ -375,8 +384,13 @@ async def guest_local_filesystem(
) -> dict[str, Any]:
obj = await vm_ops.require_vm(database, vm)
filesystems = obj.props.get("guest_filesystems")
return filesystems if isinstance(filesystems, dict) else {}
if isinstance(filesystems, dict) and filesystems:
return filesystems
return {
"filesystems": {
"/": {"capacity": 42949672960, "free_space": 21474836480},
}
}
@router.get("/api/vcenter/vm/{vm}/guest/filesystem")
async def guest_filesystem_get(