topo_add_devices
Add devices to a Huawei eNSP topology file, specifying model, name, count, position, and settings with automatic console port assignment.
Instructions
往拓扑里批量加设备。
Args: path: .topo 文件路径。 devices: 设备列表,每项支持这些字段:
- model(必填):型号,见 list_models。
- name:设备名,省略则按 eNSP 习惯自动编号(S5700 叫 LSW1、
AR2220 叫 AR1,重名自动往后排)。
- count:一次加几台,默认 1;配合省略 name 可以批量生成。
- x / y:画布坐标,省略则先堆在原点,之后跑 topo_layout 自动摆开。
- settings:终端类设备的初始参数,PC/Server 可填
{"ip": "...", "mask": "...", "gateway": "..."},
AP 可填 {"mac": "...", "sn": "..."}。具体字段见
list_models 返回的 settingsFields。
举例:[{"model": "S5700", "name": "Core", "count": 2},
{"model": "PC", "settings": {"ip": "192.168.1.10"}}]console 端口会自动从 2000 起顺序分配,不会和已有设备冲突。
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | ||
| devices | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |