使用APIExplorer,我尝试将RESTCONF设备连接到Opendaylight。不幸的是,它的Hello消息没有读入到capabilities列表中。
我让Opendaylight Neon运行每个名称中有"restconf“或"netconf”的功能。操作系统为Ubuntu 18.04。为了模拟netconf设备,我使用了docker镜像中的netopeer2 (benjaminsh/netopeer2)。
我确信我拥有正确的ODL IP,因为我能够连接和接收拓扑数据。此外,我确信我的模拟设备会给出hello消息,因为我可以在尝试SSH进入它时看到它。
我使用以下命令启动docker容器:
sudo docker run -it --name netopeer2 -p 1831:830 --rm benjaminsh/netopeer2:latest我通过这个REST命令添加netconf设备:
post /restconf/operations/netconf-node-topology:create-device
{
"netconf-node-topology:input": {
"netconf-node-topology:pass-through": {},
"key-based": {
"netconf-node-topology:key-id": "netconf",
"netconf-node-topology:username": "netconf"
},
"netconf-node-topology:host": "192.168.56.2",
"netconf-node-topology:port": "830",
"netconf-node-topology:tcp-only": "false",
"netconf-node-topology:reconnect-on-changed-schema": "false",
"netconf-node-topology:connection-timeout-millis": "20000",
"netconf-node-topology:max-connection-attempts": "0",
"netconf-node-topology:between-attempts-timeout-millis": "2000",
"netconf-node-topology:sleep-factor": "1.5",
"netconf-node-topology:keepalive-delay": "120",
"netconf-node-topology:node-id": "new-netconf-device"
}
}之后,我尝试使用下面的REST命令访问收到的hello消息中的功能:
get /restconf/config/network-topology:network-topology/topology/topology-netconf/node/new-netconf-device/netconf-node-topology:odl-hello-message-capabilities我希望看到odl-hello-message-capabilites中的功能,但它只是说明数据模型内容不存在。
发布于 2019-06-14 20:44:28
我找到了一个解决方案,我想在其他人遇到类似问题的情况下发布:
在opendaylight中查看日志时,我发现在尝试连接到该设备时存在JAVA应用程序错误。即使将netconf连接器添加到数据中,它也不能通信。
诀窍是将"key-auth“改为"login-pw”。新的REST命令:
post /restconf/operations/netconf-node-topology:create-device
{
"netconf-node-topology:input": {
"netconf-node-topology:pass-through": {},
"login-password": {
"netconf-node-topology:username": "netconf",
"netconf-node-topology:password": "netconf"
},
"netconf-node-topology:host": "192.168.56.2",
"netconf-node-topology:port": "1831",
"netconf-node-topology:tcp-only": "false",
"netconf-node-topology:reconnect-on-changed-schema": "false",
"netconf-node-topology:connection-timeout-millis": "20000",
"netconf-node-topology:max-connection-attempts": "0",
"netconf-node-topology:between-attempts-timeout-millis": "2000",
"netconf-node-topology:sleep-factor": "1.5",
"netconf-node-topology:keepalive-delay": "120",
"netconf-node-topology:node-id": "new-netconf-device"
}
}功能已经具备了:
get /restconf/operational/network-topology:network-topology https://stackoverflow.com/questions/56595484
复制相似问题