cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
4667
Views
0
Helpful
4
Replies

Error Adding Node to ODL via RESTCONF

brfoster
Cisco Employee
Cisco Employee

Team,

I made a script for interfacing with ODL BORON release RESTCONF interface for adding a node.  I'm getting an error as shown below.  Any idea what is wrong?

(ydk-py-venv) [gibson@rickenbacker yangtesting]$ python addnode_odl.py

hello from Python 2.7.12 (default, Jun 29 2016, 15:48:48)

[GCC 4.4.7 20120313 (Red Hat 4.4.7-17)]

The REST URL is http://192.168.5.101:8181/restconf/config/network-topology:network-topology/topology/topology-netconf/node/controller-config/yang-ext:mount/config:modules

The XML POST body is...

"<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>iosxrv-1</name>

  <address xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:connector:netconf">192.168.0.1</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">cisco</username>

  <password xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:connector:netconf">cisco</password>

  <tcp-only xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:connector:netconf">false</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>"

400

application/xml

<?xml version="1.0" ?>

<errors xmlns="urn:ietf:params:xml:ns:yang:ietf-restconf">

<error>

        <error-type>protocol</error-type>

        <error-tag>malformed-message</error-tag>

        <error-message>Error parsing input: Content is not allowed in prolog.</error-message>

</error>

</errors>

(ydk-py-venv) [gibson@rickenbacker yangtesting]$

4 Replies 4

brfoster
Cisco Employee
Cisco Employee

UPDATE

I had extra quotes around the XML body that was causing the POST to fail.

Now, when I query the RESTCONF interface...

http://192.168.5.101:8181/restconf/config/network-topology:network-topology/topology/topology-netconf/node/controller-config/yang-ext:mount/config:modules

<module>

<type>x:sal-netconf-connector</type>

<name>iosxrv-1</name>

<tcp-only>false</tcp-only>

<event-executor>

        <type>x:netty-event-executor</type>

        <name>global-event-executor</name>

</event-executor>

<keepalive-executor>

        <type>x:scheduled-threadpool</type>

        <name>global-netconf-ssh-scheduled-executor</name>

</keepalive-executor>

<sleep-factor>1.5</sleep-factor>

<max-connection-attempts>0</max-connection-attempts>

<dom-registry>

        <type>x:dom-broker-osgi-registry</type>

        <name>dom-broker</name>

</dom-registry>

<client-dispatcher>

        <type>x:netconf-client-dispatcher</type>

        <name>global-netconf-dispatcher</name>

</client-dispatcher>

<concurrent-rpc-limit>0</concurrent-rpc-limit>

<schema-cache-directory>schema</schema-cache-directory>

<between-attempts-timeout-millis>2000</between-attempts-timeout-millis>

<port>830</port>

<connection-timeout-millis>20000</connection-timeout-millis>

<username>cisco</username>

<password>cisco</password>

<processing-executor>

        <type>x:threadpool</type>

        <name>global-netconf-processing-executor</name>

</processing-executor>

<binding-registry>

        <type>x:binding-broker-osgi-registry</type>

        <name>binding-osgi-broker</name>

</binding-registry>

<keepalive-delay>120</keepalive-delay>

<default-request-timeout-millis>60000</default-request-timeout-millis>

<address>192.168.0.1</address>

<reconnect-on-changed-schema>false</reconnect-on-changed-schema>

</module>

However, when I open DLUX and select "nodes" I do not see the element listed.

UPDATE

I examined the logs for ODL (data/logs/karaf.log) and I can see ODL is trying to make a NETCONF connection but it is having trouble retrieving the YANG schema.  Does IOS-XR support this?  I didn't have this issue with the Beryllium release.

Error reply from remote device, request: <rpc message-id="m-85" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">

<get-schema xmlns="urn:ietf:params:xml:ns:yang:ietf-netconf-monitoring">

<identifier>Cisco-IOS-XR-lpts-pre-ifib-oper-sub1</identifier>

<version>2016-02-22</version>

<format>yang</format>

</get-schema>

</rpc>

, response: <rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="m-85">

<rpc-error>

  <error-type>application</error-type>

  <error-tag>operation-failed</error-tag>

  <error-severity>error</error-severity>

</rpc-error>

</rpc-reply>

RemoteDevice{iosxrv-1}: YANG schema was not successfully retrieved for RevisionSourceIdentifier [name=Cisco-IOS-XR-lpts-pre-ifib-oper-sub1@2016-02-22]. Errors: [RpcError [message=, severity=ERROR, errorType=APPLICATION, tag=operation-failed, applicationTag=null, info=, cause=null]]

Unable to build schema context, unsatisfied imports {RevisionSourceIdentifier [name=cisco-xr-netconf-monitoring-deviations@2016-02-16]=[ModuleImportImpl [name=ietf-netconf-monitoring, revision=null, semanticVersion=0.0.0]], RevisionSourceIdentifier [name=Cisco-IOS-XR-ha-eem-policy-oper@2016-02-05]=[ModuleImportImpl [name=Cisco-IOS-XR-ha-eem-policy-oper-sub1, revision=2016-02-05

Just tried with Beryllium and same issue

RemoteDevice{iosxrv-1}: YANG schema was not successfully retrieved for SourceIdentifier [name=Cisco-IOS-XR-lpts-pre-ifib-oper-sub1@2016-02-22]. Errors: [RpcError [message=, severity=ERROR, errorType=APPLICATION, tag=operation-failed, applicationTag=null, info=, cause=null]]

what release of XRv are you using?  That can sometimes be an issue...

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: