feat: expose infrastructure dependency inventory
Module Package Release / publish-packages (push) Successful in 12s
Module Package Release / publish-packages (push) Successful in 12s
This commit is contained in:
@@ -47,7 +47,10 @@ from govoplan_core.db.session import get_database
|
||||
from govoplan_core.settings import settings as core_settings
|
||||
|
||||
from govoplan_ops.backend.manifest import OPS_READ_SCOPES, OPS_RUN_SCOPES
|
||||
from govoplan_ops.backend.infrastructure import deployment_capability_status
|
||||
from govoplan_ops.backend.infrastructure import (
|
||||
deployment_capability_status,
|
||||
infrastructure_dependency_inventory,
|
||||
)
|
||||
|
||||
router = APIRouter(prefix="/ops", tags=["ops"])
|
||||
_module_check_cache: dict[str, tuple[float, dict[str, Any]]] = {}
|
||||
@@ -93,6 +96,20 @@ def run_ops_checks(
|
||||
return _ops_status_payload(request, force_module_checks=True)
|
||||
|
||||
|
||||
@router.get("/infrastructure/dependencies")
|
||||
def infrastructure_dependencies(
|
||||
request: Request,
|
||||
principal: ApiPrincipal = Depends(require_any_scope(*OPS_READ_SCOPES)),
|
||||
) -> dict[str, object]:
|
||||
"""Return a fresh, non-secret inventory for host deployment preflight."""
|
||||
|
||||
del principal
|
||||
return infrastructure_dependency_inventory(
|
||||
_registry(request),
|
||||
installation_id=core_settings.installation_id,
|
||||
).to_dict()
|
||||
|
||||
|
||||
@router.get("/runtime/nodes")
|
||||
def runtime_nodes(
|
||||
request: Request,
|
||||
|
||||
Reference in New Issue
Block a user