[CONTROLLER-796] Restconf issue in ODL with remote Netconf device Created: 09/Sep/14  Updated: 19/Oct/17  Resolved: 17/Sep/14

Status: Resolved
Project: controller
Component/s: restconf
Affects Version/s: Helium
Fix Version/s: None

Type: Bug
Reporter: Ankit agarwal Assignee: Unassigned
Resolution: Cannot Reproduce Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Operating System: Linux
Platform: PC


Attachments: Text File first issue .txt    
External issue ID: 1767

 Description   

I am connecting to Remote Netconf Device and trying to make changes in configuration using ODL.

My Netconf device does not expose schema so have added yang schemas in ODL local and connector xml file as yang module capability.

When I try to use below Restconf url getting some exceptions,

1. http://localhost:8080/restconf/operational/opendaylight-inventory:nodes/node/m10schemanew/yang-ext:mount/

where m10schemanew is identifier for my device
Exception Stacktrace is attached in first issue.txt file

2. http://localhost:8080/restconf/config/opendaylight-inventory:nodes/node/m10schemanew/yang-ext:mount/configuration:configuration/system
with

PUT method and

input:
<system>
<host-name>FooBar123</host-name>
</system>

exception stack trace : Added in attached first issue.txt file in second point

Even though both the above url used to work in older version of ODL.

Please help me out to resolve this issue.



 Comments   
Comment by Ankit agarwal [ 09/Sep/14 ]

Attachment first issue .txt has been added with description: Exception Stack Trace for both Issues

Comment by Tony Tkacik [ 10/Sep/14 ]

Could you please investigate how correct Netconf request for your device look like?

ODL sended get request like this:

<rpc message-id="m-6" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
<get-config>
<source>
<running/>
</source>
<filter>
<configuration xmlns="http://xml.juniper.net/xnm/1.1/xnm"/>
</filter>
</get-config>
</rpc>

Where filter <configuration xmlns="http://xml.juniper.net/xnm/1.1/xnm"/>
is constructed from your YANG model and restconf URL:
/configuration:configuration

This means your model configuration has top level container configuration.

Netconf device reported back

<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" xmlns:junos="http://xml.juniper.net/junos/14.2I0/junos" message-id="m-6">
<rpc-error>
<error-type>protocol</error-type>
<error-tag>operation-failed</error-tag>
<error-severity>error</error-severity>
<error-message>syntax error, expecting <config-text/> or <configuration></error-message>
<error-info>
<bad-element>configuration</bad-element>
</error-info>
</rpc-error>
</rpc-reply>

So it seems
a) configuration element should contain additional information
b) configuration element is in wrong namespace.

Since I do not know implementation of Netconf device neither YANG model,
this are assumptions.

COuld you try to do only GET http://localhost:8080/restconf/operational/opendaylight-inventory:nodes/node/m10schemanew/yang-ext:mount/

Comment by Ankit agarwal [ 10/Sep/14 ]

Correct netconf request for my device is as follows,

<rpc message-id="m-0" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
<get-config>
<source>
<running/>
</source>
<filter xmlns:ns0="urn:ietf:params:xml:ns:netconf:base:1.0" ns0:type="subtree">
<configuration xmlns="http://yang.juniper.net/yang/1.1/jc">
<system/>
</configuration>
</filter>
</get-config>
</rpc>

Yes my device has top level container configuration and I have added yang schema source in cache/schema folder and in connector xml as yang-module-capability.

I already did try this operational url and logs for the same are there in attached file with first point Exception Stack trace for first issue

GET http://localhost:8080/restconf/operational/opendaylight-inventory:nodes/node/m10schemanew/yang-ext:mount/

Same device is working fine with older version of ODL but latest one has issues

Comment by Ankit agarwal [ 10/Sep/14 ]

Correction in above information is as follows

Correct netconf request for my device is as follows,

<rpc message-id="m-0" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
<get-config>
<source>
<running/>
</source>
<filter xmlns:ns0="urn:ietf:params:xml:ns:netconf:base:1.0" ns0:type="subtree">
<configuration xmlns="http://xml.juniper.net/xnm/1.1/xnm">
<system/>
</configuration>
</filter>
</get-config>
</rpc>

Comment by Tony Tkacik [ 12/Sep/14 ]

Does request

<rpc message-id="m-0" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
<get-config>
<source>
<running/>
</source>
<filter xmlns:ns0="urn:ietf:params:xml:ns:netconf:base:1.0" ns0:type="subtree">
<configuration xmlns:junos="http://xml.juniper.net/xnm/1.1/xnm">
</configuration>
</filter>
</get-config>
</rpc>

Works for you?

Because examples you showed are one level nested (equivalent of http://localhost:8080/restconf/config/opendaylight-inventory:nodes/node/m10schemanew/yang-ext:mount/configuration:configuration/system ).

Comment by Ankit agarwal [ 12/Sep/14 ]

Hi Tony,

Thanks for time.
You guessed it right there was issue in device OS so, so got it corrected and its working now we can close this bug now.

Generated at Wed Feb 07 19:53:53 UTC 2024 using Jira 8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d.