Add ZTE status metrics (ISIS/IF/ARP/ND6/BGP) for monitor and compare.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
oliver 2026-09-17 21:11:40 +08:00
parent fe34319d65
commit 2f0c9eb1da
10 changed files with 823 additions and 1 deletions

View file

@ -145,6 +145,26 @@ class BizStateVrfRouteSummary(Base):
collected_at: Mapped[datetime] = mapped_column(DateTime, default=utcnow_naive, index=True)
class BizStateMetricRow(Base):
"""Generic structured rows for tabular status metrics (ISIS/ARP/BGP/…)."""
__tablename__ = "biz_state_metric_row"
__table_args__ = (
Index("ix_biz_state_metric_row_batch_metric", "batch_id", "metric_id"),
Index("ix_biz_state_metric_row_batch_metric_seq", "batch_id", "metric_id", "seq"),
)
id: Mapped[str] = mapped_column(String(64), primary_key=True, default=lambda: uuid4().hex)
batch_id: Mapped[str] = mapped_column(String(64), default="", index=True)
batch_command_id: Mapped[str] = mapped_column(String(64), default="", index=True)
task_id: Mapped[str] = mapped_column(String(64), default="", index=True)
ne_id: Mapped[str] = mapped_column(String(128), default="", index=True)
metric_id: Mapped[str] = mapped_column(String(64), default="", index=True)
seq: Mapped[int] = mapped_column(Integer, default=0)
data_json: Mapped[dict] = mapped_column(_JsonType, default=dict)
collected_at: Mapped[datetime] = mapped_column(DateTime, default=utcnow_naive, index=True)
class BizStateEvent(Base):
__tablename__ = "biz_state_event"