771
Views
0
Helpful
1
Replies
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-30-2020 01:05 AM - edited 11-30-2020 02:08 AM
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
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:
class
PolicyManager.PolicyMaps.PolicyMap.
PolicyMapRule
thanks,
arynair
Solved! Go to Solution.
Labels:
- Labels:
-
YANG Development Kit (YDK)
1 Accepted Solution
Accepted Solutions
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-30-2020 02:30 AM
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"
1 Reply 1
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-30-2020 02:30 AM
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"
