| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495 |
- """
- Status and Health Command Classes
- This module implements commands for system status and health monitoring.
- """
- from typing import Optional, Dict, Any
- from dataclasses import dataclass, field
- from .base import TrixyCommand, CommandResponse, ValidationError
- @dataclass
- class StatusRequestCommand(TrixyCommand):
- """Command to request system status."""
-
- status_type: str = field(default="general")
- target_component: str = field(default="all")
-
- def validate(self) -> bool:
- return True
-
- def get_command_name(self) -> str:
- return "StatusRequestCommand"
- @dataclass
- class HealthCheckCommand(TrixyCommand):
- """Command to perform health check."""
-
- check_type: str = field(default="basic")
-
- def validate(self) -> bool:
- return True
-
- def get_command_name(self) -> str:
- return "HealthCheckCommand"
- @dataclass
- class SystemInfoCommand(TrixyCommand):
- """Command to request system information."""
-
- info_type: str = field(default="general")
-
- def validate(self) -> bool:
- return True
-
- def get_command_name(self) -> str:
- return "SystemInfoCommand"
- @dataclass
- class StatusRequestResponse(CommandResponse):
- """Response to status request command."""
-
- status_data: Dict[str, Any] = field(default_factory=dict)
-
- def validate(self) -> bool:
- return True
-
- def get_response_name(self) -> str:
- return "StatusRequestResponse"
- @dataclass
- class HealthCheckResponse(CommandResponse):
- """Response to health check command."""
-
- health_status: str = field(default="unknown")
- health_data: Dict[str, Any] = field(default_factory=dict)
-
- def validate(self) -> bool:
- return True
-
- def get_response_name(self) -> str:
- return "HealthCheckResponse"
- @dataclass
- class SystemInfoResponse(CommandResponse):
- """Response to system info command."""
-
- system_info: Dict[str, Any] = field(default_factory=dict)
-
- def validate(self) -> bool:
- return True
-
- def get_response_name(self) -> str:
- return "SystemInfoResponse"
- __all__ = [
- "StatusRequestCommand", "HealthCheckCommand", "SystemInfoCommand",
- "StatusRequestResponse", "HealthCheckResponse", "SystemInfoResponse"
- ]
|