netx/netx_api/collection_schemas.py
oliver 042c015045 feat(ops): add managed NE management and batch CLI collection
Introduce workbench operations for multi-vendor NE CRUD/connect-test and Netmiko batch collection with job lifecycle controls, log downloads, and paginated run filters.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-27 23:34:29 +08:00

41 lines
837 B
Python

from __future__ import annotations
from datetime import datetime
from pydantic import BaseModel, Field
class CollectionJobCreate(BaseModel):
title: str = ""
commands: str = Field(min_length=1)
ne_ids: list[str] = Field(min_length=1)
class CollectionRunOut(BaseModel):
id: str
job_id: str
ne_id: str
ne_name: str
ne_ip: str
status: str
message: str
output_rel_path: str
has_output: bool
started_at: datetime | None
ended_at: datetime | None
class CollectionJobOut(BaseModel):
id: str
title: str
commands: str
status: str
ne_count: int
success_count: int
fail_count: int
output_count: int = 0
error_message: str
created_at: datetime
started_at: datetime | None
ended_at: datetime | None
last_run_at: datetime | None = None