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

Does YDK server in the cisco-ios-xr deveice support concurrent request?

ElvisLou15831
Level 1
Level 1

Does YDK server in the cisco-ios-xr device support concurrent request?

 

Or it could only server one request at one time?

 

We have a background task to read the data from device periodically, with code snippet below:

from ydk.models.openconfig import openconfig_interfaces as oc_interfaces
from ydk.models.openconfig import openconfig_network_instance
from ydk.filters import YFilter
from ydk.services import CRUDService

provider = NetconfServiceProvider(address="203.3.224.129",
                                      port=830,
                                      username="admin",
                                      password="admin",
                                      protocol="ssh")

crud = CRUDService()

# read interface
interfaces = oc_interfaces.Interfaces()
result = crud.read(provider, interfaces).interface

and we do some other read operation with below code, it return an error.

#read vrf
networkInstances = openconfig_network_instance.NetworkInstances()
networkInstance = openconfig_network_instance.NetworkInstances.NetworkInstance()
networkInstance.name = "test"
networkInstance.config.name = "test"
result2 = crud.read(provider, networkInstance).config

RuntimeError: YClientError: Could not connect to 203.3.224.129: Session status: Undefined

 

Is this because the ydk server did not support concurrent request?

3 Replies 3

yangorelik
Spotlight
Spotlight

Hello Elvis

I though I have already give you the answers in previous discussions. Let me repeat.

1. The YDK is not a server. It is set of tools that helps programmer to write application.

2. The YDK provided client services for Netconf, Restconf, and gNMI protocols implement only synchronous communication with corresponding servers, and therefore do not support concurrent sessions to the same or multiple servers.

3. If there is a need for application to communicate with multiple servers simultaneously, then it should implement multithreading, where each YDK related process is completely enclosed in one thread. There must be no interactions between concurrent threads.

4. It is up to the Netconf, Restconf, and gNMI servers to support or not support concurrent sessions from multiple clients. Please refer to corresponding servers' documentation.

Yan Gorelik
YDK Solutions

Hi Yan Gorelik,

sorry for not describing my question clearly, what I mean is the point 4 of your reply.

where can i find the Netconf/Restconf/gNMI servers' documentation?

My device is cisco ASR9K.

Hello @ElvisLou15831,

 

You didn't mention the version of IOS XR that you're using, so I'll provide a link to get you started...

 

Here's the link to ASR9K Configuration Guides -- https://www.cisco.com/c/en/us/support/routers/asr-9000-series-aggregation-services-routers/products-installation-and-configuration-guides-list.html

 

Here's a programmability specific link that I found by starting at the page above.  The link is IOS XR 6.4.x-specific and provides information on the components needed to use Data Models along with protocols like NETCONF and gRPC:

https://www.cisco.com/c/en/us/td/docs/routers/asr9000/software/asr9k-r6-4/programmability/configuration/guide/b-programmability-cg-asr9000-64x/b-programmability-cg-asr9000-64x_chapter_011.html

 

Good luck!!

 

 

fjm

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: