Showing results for 
Search instead for 
Did you mean: 
Cisco Employee

UM model flowspec

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
** ydk.errors.YPYServiceError: Attempt to assign non YDK entity object of type bool to InterfaceAll

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




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


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/ ( code written for testing)


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



Content for Community-Ad

This widget could not be displayed.