1
0
mirror of https://github.com/checktheroads/hyperglass synced 2024-05-11 05:55:08 +00:00

25 lines
666 B
Python
Raw Normal View History

2021-09-11 00:47:01 -07:00
"""Device output plugins."""
# Standard Library
2021-09-12 18:27:33 -07:00
from typing import TYPE_CHECKING, Union, Sequence
2021-09-11 00:47:01 -07:00
# Local
2021-09-12 18:27:33 -07:00
from ._base import DirectivePlugin
2021-09-11 00:47:01 -07:00
if TYPE_CHECKING:
# Project
from hyperglass.models.config.devices import Device
from hyperglass.models.parsing.serialized import ParsedRoutes
OutputPluginReturn = Union[None, "ParsedRoutes", str]
2021-09-11 00:47:01 -07:00
2021-09-12 18:27:33 -07:00
class OutputPlugin(DirectivePlugin):
"""Plugin to interact with device command output."""
2021-09-11 00:47:01 -07:00
2021-09-12 18:27:33 -07:00
directive_ids: Sequence[str] = ()
def process(self, output: Union["ParsedRoutes", str], device: "Device") -> OutputPluginReturn:
"""Process or manipulate output from a device."""
return None