mirror of
https://github.com/hansjone/netx.git
synced 2026-10-11 05:43:20 +08:00
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>
This commit is contained in:
parent
282dbe75af
commit
042c015045
36 changed files with 3695 additions and 17 deletions
41
netx_api/collection_schemas.py
Normal file
41
netx_api/collection_schemas.py
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
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
|
||||
Loading…
Add table
Add a link
Reference in a new issue