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

issue with retrieving of schema

aligang1988
Level 4
Level 4

Hi
I could generate bundle using ydk-gen 3rd party vendor yang models without facing any obvious problems.
Then I imported it, made small testing code(attached) and faced and issue.

As it seem from debug (attached), crud  tries to download yang-model in order to validate payload against it. It makes several iterations and then returns error
ydk.errors.YInvalidArgumentError:  Path is invalid: configuration:configuration

However pasting of below-listed rpc over ssh returned yang model

ssh 192.168.2.11 -p 830 -l ali -s netconf

Password:

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

  <get-schema>

    <module>configuration</module>

  </get-schema>

</rpc>

Q: Could you please explain how crud composes rpc to fetch schemes (it seems it tries to put "configuration:confguration" between "module" tags instead of "configuration"). Is it possible to influence on this logic somehow or disable this sort of validation ?

Thanks a lot !

1 Accepted Solution

Accepted Solutions

abhirame
Cisco Employee
Cisco Employee

It appears that the device does not support the get-schema RPC. Can you please copy all the device yang models to the below directory:

/home/alex-limonov/.ydk/192.168.2.11_830

The other option is to pass in a different folder location of the yang models in the repo parameter of NetconfServiceProvider: http://ydk.cisco.com/py/docs/api/providers/netconf_provider.html#ydk.providers.NetconfServiceProvider

View solution in original post

4 Replies 4

abhirame
Cisco Employee
Cisco Employee

It appears that the device does not support the get-schema RPC. Can you please copy all the device yang models to the below directory:

/home/alex-limonov/.ydk/192.168.2.11_830

The other option is to pass in a different folder location of the yang models in the repo parameter of NetconfServiceProvider: http://ydk.cisco.com/py/docs/api/providers/netconf_provider.html#ydk.providers.NetconfServiceProvider

aligang1988
Level 4
Level 4

Thanks for you responce
Actually I could send get-schema RPC over SSH (simple openssh connection) !
i used such command :
cat get-schema_request.xml | ssh 192.168.2.11 -p 830  -l ali -s netconf  >> get-schema_responce.xml (respective  .xml files are in attachement)

That makes me think that get-schema RPC was processed normally by device.

What is little bit strange:   
When test-code is executed  there is  no get-schema-rpc message in debug, only  comments, that it tries to fetch schema from device (however hello messages bodies do present and another ydk specific debugs do present).Libssh and libnetconf were rebuilt to provide logging.

Is there option to check that get-schema rpc was actually sent ? Because right now it is not really obvious

From the other hand, manual specifying of repo with .yang files breaks a knot, but I would like to understand why my code can not fetch and resolve yang models directly from device

Small update:

I  have slightly modified test code and ran it over XR platform.
Below is displayed respective debug and it does content get-schema-rpc body

  1. Connected to 192.168.2.12 on port 22 using ssh with timeout of -1
  2. Executing CRUD update operation on [Cisco-IOS-XR-ifmgr-cfg:interface-configurations]
  3. Getting new modules for ydk:update
  4. Getting new modules for ydk:update
  5. Loading Module 'ydk' Revision ''
  6. Cache hit Module 'ydk' Revision ''
  7. Getting new modules for Cisco-IOS-XR-ifmgr-cfg:interface-configurations
  8. Getting new modules for Cisco-IOS-XR-ifmgr-cfg:interface-configurations
  9. Loading Module 'Cisco-IOS-XR-ifmgr-cfg' Revision ''
  10. Getting module Cisco-IOS-XR-ifmgr-cfg submodule none
  11. Looking for file in folder: /home/alex-limonov/.ydk/192.168.2.12_22
  12. Opening file /home/alex-limonov/.ydk/192.168.2.12_22/Cisco-IOS-XR-ifmgr-cfg.yang
  13. Path found with rev: false. Path without rev: false
  14. Getting module using get-schema Cisco-IOS-XR-ifmgr-cfg
  15. Trace: Missing message-id in rpc.
  16. Netconf SSH Client: sending rpc
  17. Trace: Writing message (session 2665454158): <?xml version="1.0"?>
  18. <rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="1">
  19.   <get-schema xmlns="urn:ietf:params:xml:ns:yang:ietf-netconf-monitoring">
  20.     <identifier>Cisco-IOS-XR-ifmgr-cfg</identifier>
  21.     <format>yang</format>
  22.   </get-schema>
  23. </rpc>


This is extract from initial debug, it looks pretty similar to previous one until string 15. It says "Cannot find model with module_name: configuration module_rev"

  1. Connected to 192.168.2.11 on port 830 using ssh with timeout of -1
  2. Executing CRUD create operation on [configuration:configuration]

  3. Getting new modules for ydk:create
  4. Getting new modules for ydk:create
  5. Loading Module 'ydk' Revision ''
  6. Cache hit Module 'ydk' Revision ''
  7. Getting new modules for configuration:configuration
  8. Getting new modules for configuration:configuration
  9. Loading Module 'configuration' Revision ''
  10. Getting module configuration submodule none
  11. Looking for file in folder: /home/alex-limonov/.ydk/192.168.2.11_830
  12. Opening file /home/alex-limonov/.ydk/192.168.2.11_830/configuration.yang
  13. Path found with rev: false. Path without rev: false
  14. Getting module using get-schema configuration
  15. Cannot find model with module_name: configuration module_rev:
  16. Debug: Searching for "configuration" in /home/alex-limonov/.ydk/192.168.2.11_830.
  17. Debug: Searching for "configuration" in /home/alex-limonov/ydk/trash.
  18. Data is invalid according to the yang model. Error details: Data model "configuration" not found.




Q: Could you please explain, what actually it tries to check here ?

Thanks !

Sorry. It looks like though the device supports get-schema, it does not advertise the support for the corresponding model "ietf-netconf-monitoring" in the capabilities in the hello message. This needs to be fixed on the device side