Publish curated Unraid-AppOps-Gateway source from 4f99d8f6ea4fb8ae105b83570344b25fa05c31fd
This commit is contained in:
1 parent
27a33107a3
commit
f50d6e8c2c
14 files changed
+1178
-21
No files matched your search
@@ -27,6 +27,7 @@ from .db.models import AppSetting, AuditEvent
|
||||
from .db.session import engine
|
||||
from .schemas.deployment import DeploymentPlanV1
|
||||
from .schemas.enrollment import EnrollmentPlanV1
|
||||
from .schemas.forge_bootstrap import ForgeBootstrapPreflightV1
|
||||
from .services import knowledge_service, mcp_operations, safety_center_service
|
||||
from .services.action_execution import mcp_execution_supported
|
||||
from .services.action_registry import ACTION_RISK, ACTIONS, action_capability
|
||||
@@ -653,8 +654,26 @@ def cancel_job(jobId: str) -> dict[str, Any]:
|
||||
@appops_mcp.tool(name="deployment.preflight", annotations=_READ_ONLY_TOOL)
|
||||
@_tracked("deployment.preflight")
|
||||
def deployment_preflight(plan: dict[str, Any], idempotencyKey: str) -> dict[str, Any]:
|
||||
"""Validate one strict DeploymentPlanV1 without touching application runtime state."""
|
||||
"""Validate a strict V1 plan or fixed Forge bootstrap profile read-only."""
|
||||
try:
|
||||
if plan.get("api_version") == "itworx.forge-bootstrap-preflight/v1":
|
||||
from .services.forge_bootstrap_preflight import (
|
||||
ForgeBootstrapPreflightService,
|
||||
)
|
||||
|
||||
profile = ForgeBootstrapPreflightV1.model_validate(plan)
|
||||
with Session(engine) as session:
|
||||
return _json(
|
||||
ForgeBootstrapPreflightService().preflight(
|
||||
session, profile, idempotency_key=idempotencyKey
|
||||
)
|
||||
)
|
||||
if "api_version" in plan:
|
||||
return {
|
||||
"status": "invalid",
|
||||
"executed": False,
|
||||
"reason": "Unsupported deployment.preflight profile discriminator.",
|
||||
}
|
||||
typed_plan = DeploymentPlanV1.model_validate(plan)
|
||||
with Session(engine) as session:
|
||||
return _json(
|
||||
|
||||
Reference in new issue
Block a user