Publish curated Unraid-AppOps-Gateway source from c61e0e1e292914893b40354f904f23dd9fd4a958
This commit is contained in:
1 parent
b47ce43436
commit
9b94d8d0f5
18 files changed
+1651
-75
No files matched your search
@@ -174,6 +174,7 @@ class DeploymentBrokerClient:
|
||||
secret: str,
|
||||
payload: dict[str, Any] | None = None,
|
||||
error_response_fields: frozenset[str] = frozenset(),
|
||||
request_timeout: httpx.Timeout | None = None,
|
||||
) -> dict[str, Any]:
|
||||
if not self.is_configured():
|
||||
return {"status": "missing_config", "reason": self.configuration_error()}
|
||||
@@ -194,7 +195,7 @@ class DeploymentBrokerClient:
|
||||
headers["Content-Type"] = "application/json"
|
||||
try:
|
||||
with httpx.Client(
|
||||
timeout=self.timeout_seconds,
|
||||
timeout=request_timeout or self.timeout_seconds,
|
||||
verify=self._verify_option(),
|
||||
) as client:
|
||||
response = client.request(method, f"{self.base_url}{path}", content=body, headers=headers)
|
||||
@@ -990,6 +991,17 @@ class DeploymentBrokerClient:
|
||||
secret=settings.mcp_token or "", payload={"reason": reason[:1000]},
|
||||
)
|
||||
|
||||
def runner_acceptance(self, *, reason: str, preflight: bool) -> dict[str, Any]:
|
||||
result = self._request(
|
||||
"POST", "/v1/appops/runner-acceptance/preflight" if preflight else "/v1/appops/runner-acceptance/quiesce",
|
||||
secret=settings.mcp_token or "", payload={"reason": reason[:1000]},
|
||||
request_timeout=httpx.Timeout(connect=5, write=5, pool=5, read=350),
|
||||
)
|
||||
if not preflight and result.get("status") in {"unreachable", "error", "rejected"}:
|
||||
return {"status": "unknown", "noMutation": False, "effectsPerformed": None,
|
||||
"blockers": ["maintenance_outcome_unknown"]}
|
||||
return result
|
||||
|
||||
def hub_migration_prepare_permissions(self, *, reason: str) -> dict[str, Any]:
|
||||
"""Prepare only the fixed Hub backup and controller-state permissions."""
|
||||
return self._request(
|
||||
|
||||
Reference in new issue
Block a user