mirror of
https://github.com/hansjone/netx.git
synced 2026-10-09 04:20:45 +08:00
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>
41 lines
837 B
Python
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
|