mirror of
https://github.com/thatmattlove/hyperglass.git
synced 2026-01-17 08:48:05 +00:00
24 lines
666 B
Python
24 lines
666 B
Python
"""Device output plugins."""
|
|
|
|
# Standard Library
|
|
from typing import TYPE_CHECKING, Union, Sequence
|
|
|
|
# Local
|
|
from ._base import DirectivePlugin
|
|
|
|
if TYPE_CHECKING:
|
|
# Project
|
|
from hyperglass.models.config.devices import Device
|
|
from hyperglass.models.parsing.serialized import ParsedRoutes
|
|
|
|
OutputPluginReturn = Union[None, "ParsedRoutes", str]
|
|
|
|
|
|
class OutputPlugin(DirectivePlugin):
|
|
"""Plugin to interact with device command output."""
|
|
|
|
directive_ids: Sequence[str] = ()
|
|
|
|
def process(self, output: Union["ParsedRoutes", str], device: "Device") -> OutputPluginReturn:
|
|
"""Process or manipulate output from a device."""
|
|
return None
|