mirror of
https://github.com/fusion44/blitz_api.git
synced 2026-08-14 12:02:46 +02:00
Make /system/health unauthenticated, compute real readiness from the shared startup state via build_health_info, and return 503 (body still a SystemHealthInfo) when a subsystem is not ready. Drop the now-dead per-backend get_system_health delegation. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
45 lines
1.3 KiB
Python
45 lines
1.3 KiB
Python
from abc import abstractmethod
|
|
from typing import Dict
|
|
|
|
from app.api.error_report.report import Report
|
|
from app.external.result_type.src.result.result import Err, Result
|
|
from app.system.models import (
|
|
ConnectionInfo,
|
|
LoginInput,
|
|
RawDebugLogData,
|
|
SystemInfo,
|
|
)
|
|
|
|
|
|
class SystemBase:
|
|
@abstractmethod
|
|
async def get_system_info(self) -> SystemInfo:
|
|
raise NotImplementedError()
|
|
|
|
@abstractmethod
|
|
async def shutdown(self, reboot: bool) -> bool:
|
|
raise NotImplementedError()
|
|
|
|
@abstractmethod
|
|
async def get_connection_info(self) -> Result[ConnectionInfo, Report]:
|
|
Err(Report("not implemented", error=NotImplementedError()))
|
|
|
|
@abstractmethod
|
|
async def login(self, i: LoginInput) -> Result[Dict[str, str], Report]:
|
|
Err(Report("not implemented", error=NotImplementedError()))
|
|
|
|
@abstractmethod
|
|
async def change_password(self, type: str, old_password: str, new_password: str):
|
|
raise NotImplementedError()
|
|
|
|
@abstractmethod
|
|
async def get_debug_logs_raw(self) -> RawDebugLogData:
|
|
raise NotImplementedError()
|
|
|
|
@abstractmethod
|
|
async def get_hardware_info(self) -> map:
|
|
raise NotImplementedError()
|
|
|
|
@abstractmethod
|
|
def get_hardware_info_yield_time(self) -> float:
|
|
raise NotImplementedError()
|