Ошибка пропуска данных при монтировании OpenDayLight Oxygen Netconf - PullRequest
0 голосов
/ 08 мая 2018

Я использую кислородную линию ODL для подключения сервера netopeer (хост NETCONF) с помощью приведенной ниже команды curl.Я вижу, что возвращается следующая ошибка.Могу ли я знать, что именно не так?Сервер netopeer поддерживает мониторинг netconf.

{"errors": {"error": [{"error-type": "protocol", "error-tag": " data-missing"," error-message ":" Точка монтирования не существует . "}]}}

curl -H "Content-Type: application/xml" -u admin:admin -X POST -d "<?xml version=\"1.0\" encoding=\"UTF-8\"> <module xmlns="urn:opendaylight:params:xml:ns:yang:controller:config"> <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:connector:netconf">prefix:sal netconf-connector</type> <name>netopeer</name> <address xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:connector:netconf">192.168.56.101</address> <port xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:connector:netconf">830</port> <username xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:connector:netconf">netopeer-server</username> <password xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:connector:netconf">pass</password> <tcp-only xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:connector:netconf">true</tcp-only> <event-executor xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:connector:netconf"> <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:netty">prefix:netty-event-executor</type> <name>global-event-executor</name> </event-executor> <binding-registry xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:connector:netconf"> <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding">prefix:binding-broker-osgi-registry</type> <name>binding-osgi-broker</name> </binding-registry> <dom-registry xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:connector:netconf"> <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom">prefix:dom-broker-osgi-registry</type> <name>dom-broker</name> </dom-registry> <client-dispatcher xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:connector:netconf"> <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:config:netconf">prefix:netconf-client-dispatcher</type> <name>global-netconf-dispatcher</name> </client-dispatcher> <processing-executor xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:connector:netconf"> <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:threadpool">prefix:threadpool</type> <name>global-netconf-processing-executor</name> </processing-executor> <keepalive-executor xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:connector:netconf"> <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:threadpool">prefix:scheduled-threadpool</type> <name>global-netconf-ssh-scheduled-executor</name> </keepalive-executor> </module>" http://localhost:8181/restconf/config/network-topology:network-topology/topology/topology-netconf/node/controller-config/yang-ext:mount/config:modules

Я попробовал предложенные изменения.Не могли бы вы сказать мне, что не так с входом?Я не вижу ничего очевидного!

curl -H "Content-Type: application/xml" -u admin:admin -X PUT -d "<?xml version=\"1.0\" encoding=\"UTF-8\"><node xmlns=\"urn:TBD:params:xml:ns:yang:network-topology\">
<node-id>netopeer</node-id>
<host xmlns=\"urn:opendaylight:netconf-node-topology\">192.168.56.101</host>
<port xmlns=\"urn:opendaylight:netconf-node-topology\">830</port>
<username xmlns=\"urn:opendaylight:netconf-node-topology\">netopeergui</username>
<password xmlns=\"urn:opendaylight:netconf-node-topology\">netopeergui</password>
<tcp-only xmlns=\"urn:opendaylight:netconf-node-topology\">false</tcp-only>
</node>" http://localhost:8181/restconf/config/network-topology:network-topology/topology/topology-netconf/node/netopeer
{"errors":{"error":[{"error-type":"protocol","error-tag":"malformed-message","error-message":"**Error parsing input: A pseudo attribute name is expected.** ","error-info":"A pseudo attribute name is expected. "}]}}shrikanth@mds:~/Applications/karaf-0.8.1/bin$

Это сработало после добавления?в теге xml, как показано ниже

curl -H "Content-Type: application/xml" -u admin:admin -X PUT -d "<?xml version=\"1.0\" encoding=\"UTF-8\"?><node xmlns=\"urn:TBD:params:xml:ns:yang:network-topology\">
    <node-id>netopeer</node-id>
    <host xmlns=\"urn:opendaylight:netconf-node-topology\">192.168.56.101</host>
    <port xmlns=\"urn:opendaylight:netconf-node-topology\">830</port>
    <username xmlns=\"urn:opendaylight:netconf-node-topology\">netopeergui</username>
    <password xmlns=\"urn:opendaylight:netconf-node-topology\">netopeergui</password>
    <tcp-only xmlns=\"urn:opendaylight:netconf-node-topology\">false</tcp-only>
    </node>" http://localhost:8181/restconf/config/network-topology:network-topology/topology/topology-netconf/node/netopeer

1 Ответ

0 голосов
/ 09 мая 2018

Это похоже на старый способ монтирования устройств через подсистему конфигурации, вы можете попробовать этот более новый API: http://docs.opendaylight.org/en/stable-oxygen/user-guide/netconf-user-guide.html#netconf-connector-configuration-with-md-sal

...