Publish curated Unraid-AppOps-Gateway source from a506550ef83ef2d81651e37c98a89f7ee330c730
This commit is contained in:
1 parent
2facb8de34
commit
767e66921e
68 files changed
+15924
-313
No files matched your search
@@ -551,6 +551,27 @@ class DeploymentBrokerClient:
|
||||
payload={"reason": reason[:1000]},
|
||||
)
|
||||
|
||||
def runner_fleet_specialize(self, *, reason: str) -> dict[str, Any]:
|
||||
"""Request the fixed protected-source CI specialization migration."""
|
||||
return self._request(
|
||||
"POST", "/v1/appops/runner-fleet/specialize",
|
||||
secret=settings.mcp_token or "", payload={"reason": reason[:1000]},
|
||||
)
|
||||
|
||||
def runner_statistics_configure(self, *, reason: str) -> dict[str, Any]:
|
||||
"""Provision the fixed independent read-only ProjectBrain capability."""
|
||||
return self._request(
|
||||
"POST", "/v1/appops/runner-statistics/configure",
|
||||
secret=settings.mcp_token or "", payload={"reason": reason[:1000]},
|
||||
)
|
||||
|
||||
def hub_migration_prepare_permissions(self, *, reason: str) -> dict[str, Any]:
|
||||
"""Prepare only the fixed Hub backup and controller-state permissions."""
|
||||
return self._request(
|
||||
"POST", "/v1/appops/hub-migration/prepare-permissions",
|
||||
secret=settings.mcp_token or "", payload={"reason": reason[:1000]},
|
||||
)
|
||||
|
||||
def runner_fleet_status(self) -> dict[str, Any]:
|
||||
"""Read the controller's private, bounded CI sandbox projection.
|
||||
|
||||
@@ -558,16 +579,25 @@ class DeploymentBrokerClient:
|
||||
derives the payload from fixed runner identities and its private DinD
|
||||
daemon; AppOps never receives a Docker socket or a cleanup selector.
|
||||
"""
|
||||
return self._runner_fleet_read("/v1/runner-fleet")
|
||||
|
||||
def runner_fleet_statistics(self) -> dict[str, Any]:
|
||||
"""Read the persisted profile projection without scheduling work."""
|
||||
return self._runner_fleet_read("/v1/runner-fleet/statistics", timeout_seconds=min(self.timeout_seconds, 5))
|
||||
|
||||
def _runner_fleet_read(self, path: str, *, timeout_seconds: float | None = None) -> dict[str, Any]:
|
||||
if path not in {"/v1/runner-fleet", "/v1/runner-fleet/statistics"}:
|
||||
return {"status": "unavailable", "reason": "runner_fleet_path_invalid"}
|
||||
if not self.is_configured():
|
||||
return {"status": "missing_config", "reason": self.configuration_error()}
|
||||
try:
|
||||
with httpx.Client(
|
||||
timeout=self.timeout_seconds,
|
||||
timeout=self.timeout_seconds if timeout_seconds is None else timeout_seconds,
|
||||
verify=self._verify_option(),
|
||||
follow_redirects=False,
|
||||
) as client, client.stream(
|
||||
"GET",
|
||||
f"{self.base_url}/v1/runner-fleet",
|
||||
f"{self.base_url}{path}",
|
||||
headers={"Accept": "application/json"},
|
||||
) as response:
|
||||
if response.status_code != 200:
|
||||
|
||||
Reference in new issue
Block a user