__init__
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
"""Host installation endpoint backed by the existing UVM installer."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from fastapi import APIRouter, Depends
|
||||
|
||||
from ..api_models import InstallRequest, InstallResponse
|
||||
from ..app import Application
|
||||
from .dependencies import get_authorized_application
|
||||
|
||||
|
||||
router = APIRouter(tags=["installation"])
|
||||
|
||||
|
||||
@router.post("/install", response_model=InstallResponse)
|
||||
def install(
|
||||
request: InstallRequest,
|
||||
application: Application = Depends(get_authorized_application),
|
||||
) -> InstallResponse:
|
||||
firecracker, assets = application.installer.install(force_assets=request.force)
|
||||
application.state_store.initialize()
|
||||
return InstallResponse(
|
||||
firecracker=str(firecracker),
|
||||
kernel=str(assets.kernel),
|
||||
rootfs=str(assets.rootfs),
|
||||
)
|
||||
Reference in New Issue
Block a user