Skip to content

Commit ada791d

Browse files
committed
Merge branch 'dev' into master
2 parents 2e046b1 + 36fa64f commit ada791d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+3760
-32
lines changed

.github/workflows/docs.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: Documentation Build
2+
3+
on:
4+
push:
5+
branches: ["master"]
6+
paths:
7+
- "docs/**"
8+
- "mkdocs.yml"
9+
- ".readthedocs.yaml"
10+
- "pyproject.toml"
11+
pull_request:
12+
types: [opened, synchronize, reopened, ready_for_review]
13+
paths:
14+
- "docs/**"
15+
- "mkdocs.yml"
16+
- ".readthedocs.yaml"
17+
- "pyproject.toml"
18+
19+
jobs:
20+
build-docs:
21+
if: ${{ github.event_name != 'pull_request' || github.event.pull_request.draft == false }}
22+
runs-on: ubuntu-latest
23+
steps:
24+
- name: Checkout repository
25+
uses: actions/checkout@v4
26+
27+
- name: Set up Python
28+
uses: actions/setup-python@v5
29+
with:
30+
python-version: '3.12'
31+
32+
- name: Install dependencies
33+
run: |
34+
pip install --upgrade pip
35+
pip install -e ".[dev]"
36+
37+
- name: Verify MkDocs configuration
38+
run: mkdocs --version
39+
40+
- name: Build documentation
41+
run: mkdocs build --strict
42+
43+
- name: Upload documentation artifacts
44+
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
45+
uses: actions/upload-artifact@v4
46+
with:
47+
name: documentation
48+
path: site/
49+
retention-days: 7
50+

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,7 @@ docs-local/
3131
tests/
3232
site*
3333

34+
# Paramiko driver examples config
35+
examples/paramiko-driver/common.py
36+
3437

CHANGELOG.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Changelog
2+
3+
## [0.2.0] - 2025-11-09
4+
5+
### Added
6+
7+
- **Paramiko 驱动**: 新增 Paramiko 驱动,支持 Linux 服务器管理
8+
- 支持多种认证方式(密码、密钥文件、密钥内容)
9+
- 支持 SFTP 文件传输(上传/下载/断点续传)
10+
- 支持 SSH 代理/跳板机连接
11+
- 支持 sudo 权限执行和 PTY 模式
12+
13+
## [0.1.0] - 2025-7-04
14+
15+
### Added
16+
17+
- 初始版本发布
18+
- 支持 Netmiko、NAPALM、PyEAPI 驱动
19+
- 支持长连接技术、分布式架构、插件系统
20+
- 支持模板引擎(Jinja2、TextFSM、TTP)和 Webhook 通知
21+

README-zh.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ NetPulse 提供了强大的插件系统,支持多种功能扩展:
3232
* **设备驱动**:
3333
- 支持 Netmiko (Cisco/Huawei/Juniper等)
3434
- 支持 NAPALM (配置管理/状态检查)
35+
- 支持 PyEAPI (Arista EOS)
36+
- 支持 Paramiko (Linux服务器)
3537
- 支持自定义协议扩展
3638

3739
* **模板引擎**:

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ NetPulse offers a powerful plugin system supporting various functional extension
3232
* **Device Drivers**:
3333
- Netmiko support (Cisco/Huawei/Juniper etc.)
3434
- NAPALM support (Configuration management/State verification)
35+
- PyEAPI support (Arista EOS)
36+
- Paramiko support (Linux servers)
3537
- Custom protocol extension support
3638

3739
* **Template Engine**:

docs/en/api/api-overview.md

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ Device Operation API provides device query, configuration, and connection testin
8383
- Netmiko (SSH) - Universal SSH connection
8484
- NAPALM (multi-vendor) - Standardized interface
8585
- PyEAPI (Arista-specific) - HTTP/HTTPS API
86+
- Paramiko (SSH) - Linux server management
8687

8788
For detailed information, see: [Device Operation API](./device-api.md)
8889

@@ -129,6 +130,11 @@ For detailed information, see: [Job Management API](./job-api.md)
129130
- **Connection Method**: HTTP/HTTPS API
130131
- **Features**: Native API support, excellent performance
131132

133+
### Paramiko (Linux Servers)
134+
- **Device Types**: Linux servers (Ubuntu, CentOS, Debian, etc.)
135+
- **Connection Method**: SSH
136+
- **Features**: Native SSH, supports file transfer, proxy connections, sudo, etc.
137+
132138
## Queue Strategies
133139

134140
NetPulse supports two queue strategies, and the system will automatically select the appropriate strategy based on driver type:
@@ -140,12 +146,12 @@ NetPulse supports two queue strategies, and the system will automatically select
140146
- **Use Cases**: Frequent operations on the same device, need to maintain connection state
141147

142148
### FIFO Queue (fifo)
143-
- **Applicable Drivers**: PyEAPI (HTTP/HTTPS stateless connections)
149+
- **Applicable Drivers**: PyEAPI (HTTP/HTTPS stateless connections), Paramiko (Linux servers)
144150
- **Features**: First-in-first-out, new connection each time
145151
- **Advantages**: Simple and efficient, suitable for stateless operations
146-
- **Use Cases**: HTTP API calls, no need to maintain connection state
152+
- **Use Cases**: HTTP API calls, long-running tasks, no need to maintain connection state
147153

148-
> **Tip**: If `queue_strategy` is not specified, the system will automatically select based on driver type (Netmiko/NAPALM → `pinned`, PyEAPI → `fifo`)
154+
> **Tip**: If `queue_strategy` is not specified, the system will automatically select based on driver type (Netmiko/NAPALM → `pinned`, PyEAPI/Paramiko`fifo`)
149155
150156
## Core Parameters Quick Reference
151157

docs/en/api/device-api.md

Lines changed: 32 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@ Driver-specific parameters, vary by driver type and operation type. **Most scena
293293
}
294294
```
295295

296-
> **Detailed Parameter Description**: Please refer to driver-specific documentation ([Netmiko](../drivers/netmiko.md), [NAPALM](../drivers/napalm.md), [PyEAPI](../drivers/pyeapi.md))
296+
> **Detailed Parameter Description**: Please refer to driver-specific documentation ([Netmiko](../drivers/netmiko.md), [NAPALM](../drivers/napalm.md), [PyEAPI](../drivers/pyeapi.md), [Paramiko](../drivers/paramiko.md))
297297
298298
### options
299299

@@ -615,6 +615,36 @@ response = requests.post(
615615
}
616616
```
617617

618+
#### Paramiko (Linux Servers)
619+
620+
**Basic Connection Test**:
621+
```json
622+
{
623+
"driver": "paramiko",
624+
"connection_args": {
625+
"host": "192.168.1.100",
626+
"username": "admin",
627+
"password": "your_password",
628+
"port": 22,
629+
"timeout": 30.0
630+
}
631+
}
632+
```
633+
634+
**Key Authentication Example**:
635+
```json
636+
{
637+
"driver": "paramiko",
638+
"connection_args": {
639+
"host": "192.168.1.100",
640+
"username": "admin",
641+
"key_filename": "/path/to/private_key",
642+
"passphrase": "your_key_passphrase",
643+
"port": 22
644+
}
645+
}
646+
```
647+
618648
### Connection Parameter Description
619649

620650
**Netmiko Parameters**:
@@ -689,7 +719,7 @@ response = requests.post(
689719
690720
### Quick Tips
691721

692-
- **Driver Selection**: Netmiko (universal SSH), NAPALM (multi-vendor), PyEAPI (Arista-specific)
722+
- **Driver Selection**: Netmiko (universal SSH), NAPALM (multi-vendor), PyEAPI (Arista-specific), Paramiko (Linux servers)
693723
- **Queue Strategy**: Usually no need to specify, system will automatically select based on driver
694724
- **Error Handling**: Implement retry mechanism, record detailed error information
695725
- **Task Tracking**: Use `/job` interface to query task status, or use webhook callbacks

docs/en/architecture/architecture-overview.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ NetPulse improves system performance, availability, and scalability through the
289289
**Design Philosophy**: Extend functionality through plugin mechanism, drivers are one type of plugin.
290290

291291
**Supported Extensions**:
292-
- **Device Drivers**: Can add new device drivers (currently supports Netmiko, NAPALM, pyeAPI, etc.)
292+
- **Device Drivers**: Can add new device drivers (currently supports Netmiko, NAPALM, PyEAPI, Paramiko, etc.)
293293
- **Template Engines**: Can add new template formats (currently supports Jinja2, TextFSM, TTP, etc.)
294294
- **Scheduling Algorithms**: Can add new scheduling strategies (currently supports greedy, minimum load, etc.)
295295
- **Notification Mechanisms**: Can add new Webhook implementations

docs/en/architecture/driver-system.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
# Device Driver System
22

3-
NetPulse provides extensible driver support through its plugin system. Users can use the three built-in supported drivers, or develop custom drivers as needed.
3+
NetPulse provides extensible driver support through its plugin system. Users can use the four built-in supported drivers, or develop custom drivers as needed.
44

55
## Core Drivers
66

77
| Driver | Protocol | Vendor Support | Key Features | Dependencies |
88
|----------|---------------|-----------------------------|-------------------------------------------|-------------------|
99
| Netmiko | SSH/Telnet | 30+ vendors | CLI command execution, **SSH keepalive** | netmiko~=4.5.0 |
1010
| NAPALM | API/SSH | Multi-vendor (Cisco/Juniper/Arista) | Configuration management, state collection | napalm~=5.0.0 |
11-
| pyeAPI | HTTP/HTTPS | Arista EOS only | Native EOS API access, HTTP-based eAPI | pyeapi~=1.0.4 |
11+
| PyEAPI | HTTP/HTTPS | Arista EOS only | Native EOS API access, HTTP-based eAPI | pyeapi~=1.0.4 |
12+
| Paramiko | SSH | Linux servers | Native SSH, file transfer, proxy connections, sudo | paramiko~=3.0.0 |
1213

1314
## Specify Device Driver
1415

@@ -60,6 +61,12 @@ When using [Pinned Worker](./architecture-overview.md) with Netmiko driver, the
6061

6162
Users can configure SSH keepalive time through the `keepalive` parameter. When SSH keepalive fails, Pinned Worker will automatically exit. When tasks are sent again, a new Pinned Worker will be created to connect to the device.
6263

64+
## Paramiko
65+
66+
Paramiko driver is used to manage Linux servers in NetPulse, implemented based on native SSH protocol. Paramiko driver supports command execution, file transfer, proxy connections, sudo, and other advanced features, suitable for system monitoring, configuration management, software deployment, and other scenarios.
67+
68+
Paramiko driver defaults to FIFO queue strategy (short connection), suitable for long-running tasks and file transfer scenarios. Unlike Netmiko driver, Paramiko driver does not implement long connection reuse, and will disconnect after each task execution.
69+
6370
## Long Connection Technology
6471

6572
### Technology Overview

docs/en/architecture/plugin-system.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ graph TB
2323
Driver --> Netmiko[Netmiko Driver]
2424
Driver --> NAPALM[NAPALM Driver]
2525
Driver --> PyEAPI[PyEAPI Driver]
26+
Driver --> Paramiko[Paramiko Driver]
2627
Driver --> Custom[Custom Driver...]
2728
2829
style Plugin fill:#E6F4EA,stroke:#4B8B3B,stroke-width:3px
@@ -80,7 +81,7 @@ graph TD
8081
| **Name Attribute** | `driver_name` |
8182
| **Directory** | `netpulse/plugins/drivers/` |
8283
| **Global Variable** | `drivers` |
83-
| **Built-in Implementation** | Netmiko, NAPALM, pyeAPI |
84+
| **Built-in Implementation** | Netmiko, NAPALM, PyEAPI, Paramiko |
8485

8586
**Core Methods**:
8687
- `connect()`: Establish device connection

0 commit comments

Comments
 (0)