cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
542
Views
0
Helpful
1
Replies

YModelError: Could not create data node: queue-limit[1] : Schema node not found.. Path: queue-limit

arynair
Cisco Employee
Cisco Employee

Hi,

I am trying to configure QoS on iosxrv using the ydk-py

however, when applying queue-limit, I get an error from the system saying schema not found.

 

my code snippet:

#importing all required libraries here
from ydk.models.cisco_ios_xr import Cisco_IOS_XR_infra_policymgr_cfg as  xr_infra_policymgr_cfg
from ydk.services import CRUDService
from ydk.providers import NetconfServiceProvider
self.qos_config_obj = xr_infra_policymgr_cfg.PolicyManager()
#configure policy map
        policy_map_obj = self.qos_config_obj.policy_maps.PolicyMap()
        policy_map_obj.type = xr_infra_policymgr_cfg.PolicyMapType.qos
        policy_map_obj.name = policy_map1_name
        class_map_obj = policy_map_obj.PolicyMapRule()
        class_map_obj.class_name = self.pm1_class1_name
        class_map_obj.class_type = xr_infra_policymgr_cfg.PmapClassMapType.qos
        self.qos_config_obj.policy_maps.policy_map.append(policy_map_obj)
#priority level config------>WORKING
        
        class_map_obj.priority_level = 1
        policy_map_obj.policy_map_rule.append(class_map_obj)
        self.qos_config_obj.policy_maps.policy_map.append(policy_map_obj)
#que limit config
        que_lim_obj = class_map_obj.QueueLimit()
        que_lim_obj.value = 100
        que_lim_obj.unit = "us"
        policy_map_obj.policy_map_rule.append(que_lim_obj)
 
I am able to create policy map without error, but unable to push queue limit
I get following error:
2020-11-27 19:54:11,447 - ydk - INFO - Executing CRUD update operation on [Cisco-IOS-XR-infra-policymgr-cfg:policy-manager]
2020-11-27 19:54:11,448 - ydk - INFO - Executing 'edit-config' RPC on [Cisco-IOS-XR-infra-policymgr-cfg:policy-manager]
2020-11-27 19:54:11,455 - ydk - ERROR - Data is invalid according to the yang model. Libyang error: Schema node not found. Path: 'queue-limit'
2020-11-27 19:54:11,455 - ydk - ERROR - Data is invalid according to the yang model. Libyang error: Schema node not found. Path: 'queue-limit'
2020-11-27 19:54:11,455 - ydk - ERROR - Could not create data node: queue-limit[1] for path: 'queue-limit[1]', value: ''
Traceback (most recent call last):
File "master.py", line 233, in <module>
QOS_config_main(device_netconf,device_input)
File "master.py", line 201, in QOS_config_main
crud_service.update(device_netconf,qos_config_obj.qos_config_obj)
File "/usr/local/lib/python3.5/dist-packages/ydk/errors/error_handler.py", line 112, in helper
return func(self, provider, entity, *args, **kwargs)
File "/usr/local/lib/python3.5/dist-packages/ydk/services/crud_service.py", line 98, in update
return self._crud.update(provider, entity)
File "/usr/lib/python3.5/contextlib.py", line 77, in __exit__
self.gen.throw(type, value, traceback)
File "/usr/local/lib/python3.5/dist-packages/ydk/errors/error_handler.py", line 82, in handle_runtime_error
_raise(_exc)
File "/usr/local/lib/python3.5/dist-packages/ydk/errors/error_handler.py", line 54, in _raise
exec("raise exc from None")
File "<string>", line 1, in <module>
ydk.errors.YModelError: Could not create data node: queue-limit[1] : Schema node not found.. Path: queue-limit
2020-11-27 19:54:11,482 - ydk - INFO - Disconnected from device

please help me resolve this issue...i believe there is a mistake in the code somewhere
I am having issues with children of this class:
classPolicyManager.PolicyMaps.PolicyMap.PolicyMapRule
thanks,
arynair
 
1 Accepted Solution

Accepted Solutions

arynair
Cisco Employee
Cisco Employee

i had called the api in a wrong manner..issue solved by using:

class_map_obj.queue_limit.value = 100
class_map_obj.queue_limit.unit = "us"

View solution in original post

1 Reply 1

arynair
Cisco Employee
Cisco Employee

i had called the api in a wrong manner..issue solved by using:

class_map_obj.queue_limit.value = 100
class_map_obj.queue_limit.unit = "us"