mirror of
https://github.com/hansjone/netx.git
synced 2026-10-11 12:53:17 +08:00
feat: initialize netx ops tool repository
Set up netx as a standalone git-managed project with isolated Python dependencies, alarm ingestion/query APIs, oclaw bridge integration, and ops-focused UI enhancements including history and raw field access. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
commit
f49c0b5bad
56 changed files with 6974 additions and 0 deletions
77
netx_api/schemas.py
Normal file
77
netx_api/schemas.py
Normal file
|
|
@ -0,0 +1,77 @@
|
|||
from __future__ import annotations
|
||||
|
||||
from datetime import datetime
|
||||
|
||||
from pydantic import BaseModel, Field
|
||||
|
||||
|
||||
class BatchSummary(BaseModel):
|
||||
batch_id: str
|
||||
total_rows: int
|
||||
success_rows: int
|
||||
failed_rows: int
|
||||
status: str
|
||||
created_at: datetime
|
||||
|
||||
|
||||
class AlarmItem(BaseModel):
|
||||
id: int
|
||||
batch_id: str
|
||||
row_no: int
|
||||
alarm_time: datetime
|
||||
severity_norm: str
|
||||
severity_raw: str
|
||||
ne_name: str
|
||||
alarm_code: str
|
||||
description: str
|
||||
ack_state: str
|
||||
|
||||
|
||||
class AlarmQueryResponse(BaseModel):
|
||||
total: int
|
||||
page: int
|
||||
page_size: int
|
||||
items: list[AlarmItem]
|
||||
|
||||
|
||||
class AlarmAggregateBucket(BaseModel):
|
||||
key: str
|
||||
count: int
|
||||
|
||||
|
||||
class AlarmAggregateResponse(BaseModel):
|
||||
group_by: str = Field(pattern="^(severity_norm|alarm_code|ne_name)$")
|
||||
buckets: list[AlarmAggregateBucket]
|
||||
|
||||
|
||||
class ImportJobItem(BaseModel):
|
||||
id: int
|
||||
kind: str
|
||||
file_name: str
|
||||
batch_id: str | None = None
|
||||
ok: bool
|
||||
summary: str
|
||||
created_at: datetime
|
||||
|
||||
|
||||
class ImportJobListResponse(BaseModel):
|
||||
items: list[ImportJobItem]
|
||||
|
||||
|
||||
class AiAnalyzeHistoryItem(BaseModel):
|
||||
id: int
|
||||
analysis_request_id: str = ""
|
||||
batch_id: str = ""
|
||||
question: str = ""
|
||||
filters: dict = Field(default_factory=dict)
|
||||
ok: bool
|
||||
answer: str = ""
|
||||
error: str = ""
|
||||
created_at: datetime
|
||||
|
||||
|
||||
class AiAnalyzeHistoryResponse(BaseModel):
|
||||
total: int
|
||||
page: int
|
||||
page_size: int
|
||||
items: list[AiAnalyzeHistoryItem]
|
||||
Loading…
Add table
Add a link
Reference in a new issue