cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
189
Views
10
Helpful
2
Replies
ranjns
Cisco Employee

UM model flowspec

hi,
Can anyone help me with this,
this is w.r.t flowspec UM model.
please find the hirerarchy of the flow below.
af.local_install.interface_all = True
is suppose take a boolean value but it is throwing error.

Tried with all values . 

af = self.flowspec_cfg.AddressFamilies.AddressFamily()
af.local_install.interface_all = True
self.device.create(af)
** ydk.errors.YPYServiceError: Attempt to assign non YDK entity object of type bool to InterfaceAll

(Pdb)
af = self.flowspec_cfg.AddressFamilies.AddressFamily()
af.local_install.interface_all = Empty()
self.device.create(af)
** ydk.errors.YPYServiceError: Attempt to assign non YDK entity object of type Empty to InterfaceAll
(Pdb)
 

597_461_1.5.png

 

2 REPLIES 2
yangorelik
Participant

Provided information is not sufficient to give you definitive answer. First of all, the YANG model Cisco-IOS-XR-um-flowspec-cfg.yang is currently not available on the public GitHub repository. Could you please share this module to see clearly types of the nodes in the model.

Second, it is not clear to me what is the representation of self, please clarify. If possible, share the entire script, or at least complete part of it in relations to model building.

One error that I spot. Based on the picture of the model tree view, the node interface-all is a container and therefore, you cannot assign to it leaf values Empty() or True. In YDK all the containers in the model are instantiated with parent class container or list, except it is a presence container. If it is a presence container, you have to instantiate the class manually while building the model object. If you do not need to configure any leaf or leaf-list nodes under the container interface-all, simply remove the erroneous line.

Another error is instantiation of af object, you missed one container in the hierarchy. Also, when building model object, you always have to start from the top level container and specify all the list keys on the way down.

With these comments your script might look like this:

from ydk.models.cisco_ios_xr import Cisco_IOS_XR_um_flowspec_cfg as flowspec_cfg
flowspec = flowspec_cfg.Flowspec() # start from top level container
af = flowspec_cfg.Flowspec.AddressFamilies.AddressFamily()

af.af_name = 'ipv4' # must specify list element key
flowspec.address_families.address_family.append(af) # append the element to the list
self.device.create(af) # not sure how that is implemented in your script
Yan Gorelik
YDK Solutions

 

hi , please find the flow of the UM model below. 

1)Please find the location of cafy infra code for flowspec UM model in this location

/auto/cafy-bgl/release/21.04.11/rhel7-21.04.11/lib/python3.6/site-packages/ydk/models/cisco_ios_xr
Cisco_IOS_XR_um_router_isis_cfg.py

2) Interface-all is not just a container , but also a leaf (you can see in the image shared) so value should be given. Other models like isis have worked fine by giving true/ Empty. Also have tried with is_presence = True even that is not working

3) hierarchy of  local-install - > interface-all -> have declared it after address family itself . please find the code  - in location - /ws/ranjns-bgl/CAFY16.16/cafykit/lib/feature_lib/bgp/flowspec_xr_ydk.py ( code written for testing)

 

PLease let me know your feasible and free time , would like to have a sync up in this

 

UM_model.PNG

Content for Community-Ad

This widget could not be displayed.