device_batch
Run commands or push configurations across multiple eNSP devices concurrently, with one device failure not affecting the rest. Supports shared command batches or per-device configs and reports per-device results.
Instructions
对多台设备并发执行命令或下发配置,单台失败不影响其他设备。
两种模式,commands 和 configs 必须且只能给一个:
commands:同一组命令打到所有选中设备,适合批量查询(display ...) 或统一配置片段。
configs:每台设备一份配置,写成 {"Core1": "sysname Core1\n...", "Core2": ...}, 键必须是拓扑里的设备名。
devices 省略表示拓扑里所有带 console 的设备;也可以给设备名、设备类别 (AR / LSW / FW / WLAN / CLIENT)或 "all" 混合使用,例如 ["FW1", "FW2", "LSW"]。
concurrency 是同时连几台,默认 4,范围 1–16。eNSP 的 console 端口本身能 承受并发,但一次开太多会拖慢设备启动较慢的那些,建议 4–8。
save 省略时按模式决定:commands 模式不保存(查询命令不需要), configs 模式保存。返回每台设备的 ok、执行条数、错误数和失败命令, 默认不回传全部回显;要看完整 results 就设 include_results=true。
所有命令同样会自动留痕,这次调用的命令在报告里归为同一个 batch。
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"topo_path": "<topo_path>"
},
"name": "device_batch"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| host | No | 127.0.0.1 | |
| save | No | ||
| configs | No | ||
| devices | No | ||
| commands | No | ||
| password | No | ||
| username | No | ||
| topo_path | Yes | ||
| concurrency | No | ||
| new_password | No | ||
| stop_on_error | No | ||
| include_results | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |