mirror of
https://github.com/home-assistant/supervisor.git
synced 2025-10-23 10:39:39 +00:00

* Use Journal Export Format for host (advanced) logs Add methods for handling Journal Export Format and use it for fetching of host logs. This is foundation for colored streaming logs for other endpoints as well. * Make pylint happier - remove extra pass statement * Rewrite journal gateway tests to mock ClientResponse's StreamReader * Handle connection refused error when connecting to journal-gatewayd * Use SYSTEMD_JOURNAL_GATEWAYD_SOCKET global path also for connection * Use parsing algorithm suggested by @agners in review * Fix timestamps in formatting, always use UTC for now * Add tests for Accept header in host logs * Apply suggestions from @agners Co-authored-by: Stefan Agner <stefan@agner.ch> * Bail out of parsing earlier if field is not in required fields * Fix parsing issue discovered in the wild and add test case * Make verbose formatter more tolerant * Use some bytes' native functions for some minor optimizations * Move MalformedBinaryEntryError to exceptions module, add test for it --------- Co-authored-by: Stefan Agner <stefan@agner.ch>
72 lines
1.2 KiB
Python
72 lines
1.2 KiB
Python
"""Const for host."""
|
|
from enum import StrEnum
|
|
|
|
PARAM_BOOT_ID = "_BOOT_ID"
|
|
PARAM_FOLLOW = "follow"
|
|
PARAM_SYSLOG_IDENTIFIER = "SYSLOG_IDENTIFIER"
|
|
|
|
|
|
class InterfaceMethod(StrEnum):
|
|
"""Configuration of an interface."""
|
|
|
|
DISABLED = "disabled"
|
|
STATIC = "static"
|
|
AUTO = "auto"
|
|
|
|
|
|
class InterfaceType(StrEnum):
|
|
"""Configuration of an interface."""
|
|
|
|
ETHERNET = "ethernet"
|
|
WIRELESS = "wireless"
|
|
VLAN = "vlan"
|
|
|
|
|
|
class AuthMethod(StrEnum):
|
|
"""Authentication method."""
|
|
|
|
OPEN = "open"
|
|
WEP = "wep"
|
|
WPA_PSK = "wpa-psk"
|
|
|
|
|
|
class WifiMode(StrEnum):
|
|
"""Wifi mode."""
|
|
|
|
INFRASTRUCTURE = "infrastructure"
|
|
MESH = "mesh"
|
|
ADHOC = "adhoc"
|
|
AP = "ap"
|
|
|
|
|
|
class HostFeature(StrEnum):
|
|
"""Host feature."""
|
|
|
|
DISK = "disk"
|
|
HAOS = "haos"
|
|
HOSTNAME = "hostname"
|
|
JOURNAL = "journal"
|
|
MOUNT = "mount"
|
|
NETWORK = "network"
|
|
OS_AGENT = "os_agent"
|
|
REBOOT = "reboot"
|
|
RESOLVED = "resolved"
|
|
SERVICES = "services"
|
|
SHUTDOWN = "shutdown"
|
|
TIMEDATE = "timedate"
|
|
|
|
|
|
class LogFormat(StrEnum):
|
|
"""Log format."""
|
|
|
|
JOURNAL = "application/vnd.fdo.journal"
|
|
JSON = "application/json"
|
|
TEXT = "text/plain"
|
|
|
|
|
|
class LogFormatter(StrEnum):
|
|
"""Log formatter."""
|
|
|
|
PLAIN = "plain"
|
|
VERBOSE = "verbose"
|