topo_connect
Connect multiple devices in a Huawei eNSP topology file with automatic port selection and interface type detection. Specify links with optional ports and line types, receiving clear errors on conflicts.
Instructions
批量连线。
Args: path: .topo 文件路径。 links: 链路列表,每项支持:
- from / to(必填):两端设备名。
- fromPort / toPort:接口名("GE0/0/1"、"GigabitEthernet0/0/1"
都认)或接口序号。省略则自动挑该设备第一个空闲口。
- lineType:线型,默认按接口类型自动判断(串口给 Serial,
其余给 Copper)。也可显式写 Copper / Fiber / Serial。
举例:[{"from": "Core1", "to": "Core2", "fromPort": "GE0/0/1",
"toPort": "GE0/0/1"},
{"from": "Core1", "to": "PC1"}]一个接口只能连一条线,重复占用会直接报错并指出是哪个口。
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | ||
| links | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |