11-24-2020 07:33 PM
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?
11-25-2020 10:17 AM
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.
11-25-2020 09:51 PM
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.
11-26-2020 04:25 PM
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:
Good luck!!
fjm
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide