Publish curated Unraid-AppOps-Gateway source from ba66029223865607deddc234e283c11127324eb8
This commit is contained in:
1 parent
820244dbb3
commit
8dd4b40252
52 files changed
+11814
-288
No files matched your search
@@ -214,9 +214,7 @@ class DeploymentBrokerClient:
|
||||
}
|
||||
for field in error_response_fields:
|
||||
value = decoded.get(field)
|
||||
if isinstance(value, str) and len(value) <= 256:
|
||||
rejected[field] = value
|
||||
elif field == "noMutation" and isinstance(value, bool):
|
||||
if isinstance(value, str) and len(value) <= 256 or field == "noMutation" and isinstance(value, bool):
|
||||
rejected[field] = value
|
||||
return rejected
|
||||
return {"status": str(decoded.get("status") or "ok"), **decoded}
|
||||
@@ -279,6 +277,33 @@ class DeploymentBrokerClient:
|
||||
"reason": reason, "expectedCurrentRevision": expected_current_revision},
|
||||
)
|
||||
|
||||
def hub_component_operation(self, stage: str, payload: dict[str, Any]) -> dict[str, Any]:
|
||||
"""Only closed, signed component-promotion endpoints; never caller commands."""
|
||||
if stage not in {"baseline", "preflight", "apply", "status"}:
|
||||
raise ValueError("component promotion stage is invalid")
|
||||
return self._request(
|
||||
"POST", f"/v1/appops/hub-components/{stage}",
|
||||
secret=settings.mcp_token or "", payload=payload,
|
||||
error_response_fields=frozenset({"planId", "planDigest", "noMutation"}),
|
||||
)
|
||||
|
||||
def hub_auto_apply(self, payload: dict[str, Any], *, preflight: bool = False) -> dict[str, Any]:
|
||||
return self._request(
|
||||
"POST", "/v1/appops/registered-targets/auto-apply" + ("/preflight" if preflight else ""),
|
||||
secret=settings.mcp_token or "", payload=payload,
|
||||
error_response_fields=frozenset({"noMutation"}),
|
||||
)
|
||||
|
||||
def registered_legacy_operation(self, stage: str, payload: dict[str, Any]) -> dict[str, Any]:
|
||||
"""Signed fixed-stage metadata adoption/recovery for existing registered targets."""
|
||||
if stage not in {"baseline", "preflight", "adopt", "status", "rollback", "delivery"}:
|
||||
raise ValueError("registered legacy stage is invalid")
|
||||
return self._request(
|
||||
"POST", f"/v1/appops/registered-legacy/{stage}",
|
||||
secret=settings.mcp_token or "", payload=payload,
|
||||
error_response_fields=frozenset({"noMutation"}),
|
||||
)
|
||||
|
||||
def appops_self_upgrade_apply(
|
||||
self, revision: str, reason: str, expected_current_revision: str | None,
|
||||
preflight_sha256: str, idempotency_key: str,
|
||||
|
||||
Reference in new issue
Block a user