mirror of
https://github.com/hansjone/netx.git
synced 2026-10-19 01:53:18 +08:00
Scaffold vendor parser packages for cisco/huawei/h3c/juniper/nokia/ericsson.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
parent
d587bf7bb9
commit
24a1a853af
19 changed files with 324 additions and 4 deletions
22
netx_api/biz_state/parsers/cisco/__init__.py
Normal file
22
netx_api/biz_state/parsers/cisco/__init__.py
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
"""Cisco IOS / NX-OS / XR parsers.
|
||||
|
||||
LLDP already works via ``common.lldp_neighbors`` (profile ``parser_id=lldp_neighbors``).
|
||||
|
||||
Stub modules (not registered until implemented)::
|
||||
|
||||
interface_brief.py arp.py isis_adjacency.py nd6_cache.py bgp_peer.py
|
||||
|
||||
When ready, import and add to ``PARSERS``. If ``parser_id`` already exists for
|
||||
another vendor, prefer a vendor-dispatch in ``common/`` or a prefixed parser_id.
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Any, Callable
|
||||
|
||||
NormalizeFn = Callable[..., list[dict[str, Any]]]
|
||||
|
||||
# Do not register stubs yet — they raise NotImplementedError.
|
||||
PARSERS: dict[str, NormalizeFn] = {}
|
||||
|
||||
__all__ = ["PARSERS"]
|
||||
17
netx_api/biz_state/parsers/cisco/arp.py
Normal file
17
netx_api/biz_state/parsers/cisco/arp.py
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
"""Cisco: show ip arp / show arp — TODO implement."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Any
|
||||
|
||||
|
||||
def normalize_arp(
|
||||
*,
|
||||
raw_text: str,
|
||||
vendor: str = "",
|
||||
device_type: str = "",
|
||||
command: str = "",
|
||||
params: dict[str, str] | None = None,
|
||||
) -> list[dict[str, Any]]:
|
||||
_ = (raw_text, vendor, device_type, command, params)
|
||||
raise NotImplementedError("cisco arp parser not implemented yet")
|
||||
17
netx_api/biz_state/parsers/cisco/bgp_peer.py
Normal file
17
netx_api/biz_state/parsers/cisco/bgp_peer.py
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
"""Cisco: show bgp * summary / show ip bgp summary — TODO implement."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Any
|
||||
|
||||
|
||||
def normalize_bgp_peer(
|
||||
*,
|
||||
raw_text: str,
|
||||
vendor: str = "",
|
||||
device_type: str = "",
|
||||
command: str = "",
|
||||
params: dict[str, str] | None = None,
|
||||
) -> list[dict[str, Any]]:
|
||||
_ = (raw_text, vendor, device_type, command, params)
|
||||
raise NotImplementedError("cisco bgp_peer parser not implemented yet")
|
||||
17
netx_api/biz_state/parsers/cisco/interface_brief.py
Normal file
17
netx_api/biz_state/parsers/cisco/interface_brief.py
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
"""Cisco: show ip interface brief / show interfaces status — TODO implement."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Any
|
||||
|
||||
|
||||
def normalize_interface_brief(
|
||||
*,
|
||||
raw_text: str,
|
||||
vendor: str = "",
|
||||
device_type: str = "",
|
||||
command: str = "",
|
||||
params: dict[str, str] | None = None,
|
||||
) -> list[dict[str, Any]]:
|
||||
_ = (raw_text, vendor, device_type, command, params)
|
||||
raise NotImplementedError("cisco interface_brief parser not implemented yet")
|
||||
17
netx_api/biz_state/parsers/cisco/isis_adjacency.py
Normal file
17
netx_api/biz_state/parsers/cisco/isis_adjacency.py
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
"""Cisco: show isis neighbors / adjacency — TODO implement."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Any
|
||||
|
||||
|
||||
def normalize_isis_adjacency(
|
||||
*,
|
||||
raw_text: str,
|
||||
vendor: str = "",
|
||||
device_type: str = "",
|
||||
command: str = "",
|
||||
params: dict[str, str] | None = None,
|
||||
) -> list[dict[str, Any]]:
|
||||
_ = (raw_text, vendor, device_type, command, params)
|
||||
raise NotImplementedError("cisco isis_adjacency parser not implemented yet")
|
||||
17
netx_api/biz_state/parsers/cisco/nd6_cache.py
Normal file
17
netx_api/biz_state/parsers/cisco/nd6_cache.py
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
"""Cisco: show ipv6 neighbors — TODO implement."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Any
|
||||
|
||||
|
||||
def normalize_nd6_cache(
|
||||
*,
|
||||
raw_text: str,
|
||||
vendor: str = "",
|
||||
device_type: str = "",
|
||||
command: str = "",
|
||||
params: dict[str, str] | None = None,
|
||||
) -> list[dict[str, Any]]:
|
||||
_ = (raw_text, vendor, device_type, command, params)
|
||||
raise NotImplementedError("cisco nd6_cache parser not implemented yet")
|
||||
Loading…
Add table
Add a link
Reference in a new issue