cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
2986
Views
0
Helpful
3
Replies

get-schema

ttdo
Level 1
Level 1

Hi,

I try to use Python inetconf API to get schema of open device box.

I keep getting empty data as return.  The messages exchanged with open box device as below

I think open device doesn't like xmlns="urn:ietf:params:xml:ns:yang:ietf-netconf-monitoring"/>, extra "/>

How do I get around this issue ?


Thanks

Executing CRUD read operation

=============Generating payload to send to device=============

<rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"><get xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">

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

</get>

</rpc>

=============Reply payload received from device=============

<?xml version="1.0" encoding="UTF-8"?>

<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="2">

  <data/>

</rpc-reply>

1 Accepted Solution

Accepted Solutions

einarnn
Cisco Employee
Cisco Employee

Please take a look at the documentation here:

http://ydk.cisco.com/py/docs/gen_doc_8a24df942f18e3e8d10f942723e7ccd22489d19e.html

you will need to pass in an instance of the “Input” class referred to on that page. You can click through to that class definition and find out what parameters need populated. There is also a code sample here:

ydk-py-samples/nc-execute-ietf-netconf-monitoring-20-ydk.py at master · CiscoDevNet/ydk-py-samples · GitHub

Cheers,

Einar

View solution in original post

3 Replies 3

einarnn
Cisco Employee
Cisco Employee

Thang,

The RPC you have sent is malformed. The get-schema RPC is its own RPC and should not be inside a get. Please see:

https://tools.ietf.org/html/rfc6022#section-3.1

...and the subsequent YANG model identifying that the module name is a mandatory parameter. The get was interpreting this as a request for something in the data tree that didn’t exist, and thus returned no data, a completely valid response per the Netconf/Yang RFCs.

Cheers,

Einar

Hi Einarl

How do I feed the input to YDK Python RPC class ?

Thanks

-Thang

einarnn
Cisco Employee
Cisco Employee

Please take a look at the documentation here:

http://ydk.cisco.com/py/docs/gen_doc_8a24df942f18e3e8d10f942723e7ccd22489d19e.html

you will need to pass in an instance of the “Input” class referred to on that page. You can click through to that class definition and find out what parameters need populated. There is also a code sample here:

ydk-py-samples/nc-execute-ietf-netconf-monitoring-20-ydk.py at master · CiscoDevNet/ydk-py-samples · GitHub

Cheers,

Einar