Пример #1
0
        class Members(Entity):
            """
            Enclosing container for list of member interfaces
            
            .. attribute:: member
            
            	List of references to interfaces / subinterfaces associated with the VLAN
            	**type**\: list of    :py:class:`Member <ydk.models.openconfig.openconfig_vlan.Vlans.Vlan.Members.Member>`
            
            

            """

            _prefix = 'oc-vlan'
            _revision = '2016-05-26'

            def __init__(self):
                super(Vlans.Vlan.Members, self).__init__()

                self.yang_name = "members"
                self.yang_parent_name = "vlan"

                self.member = YList(self)

            def __setattr__(self, name, value):
                self._check_monkey_patching_error(name, value)
                with _handle_type_error():
                    if name in self.__dict__ and isinstance(
                            self.__dict__[name], YList):
                        raise YPYModelError(
                            "Attempt to assign value of '{}' to YList ldata. "
                            "Please use list append or extend method.".format(
                                value))
                    if isinstance(value, Enum.YLeaf):
                        value = value.name
                    if name in () and name in self.__dict__:
                        if isinstance(value, YLeaf):
                            self.__dict__[name].set(value.get())
                        elif isinstance(value, YLeafList):
                            super(Vlans.Vlan.Members,
                                  self).__setattr__(name, value)
                        else:
                            self.__dict__[name].set(value)
                    else:
                        if hasattr(value, "parent") and name != "parent":
                            if hasattr(value, "is_presence_container"
                                       ) and value.is_presence_container:
                                value.parent = self
                            elif value.parent is None and value.yang_name in self._children_yang_names:
                                value.parent = self
                        super(Vlans.Vlan.Members,
                              self).__setattr__(name, value)

            class Member(Entity):
                """
                List of references to interfaces / subinterfaces
                associated with the VLAN.
                
                .. attribute:: interface_ref
                
                	Reference to an interface or subinterface
                	**type**\:   :py:class:`InterfaceRef <ydk.models.openconfig.openconfig_vlan.Vlans.Vlan.Members.Member.InterfaceRef>`
                
                

                """

                _prefix = 'oc-vlan'
                _revision = '2016-05-26'

                def __init__(self):
                    super(Vlans.Vlan.Members.Member, self).__init__()

                    self.yang_name = "member"
                    self.yang_parent_name = "members"

                    self.interface_ref = Vlans.Vlan.Members.Member.InterfaceRef(
                    )
                    self.interface_ref.parent = self
                    self._children_name_map["interface_ref"] = "interface-ref"
                    self._children_yang_names.add("interface-ref")

                class InterfaceRef(Entity):
                    """
                    Reference to an interface or subinterface
                    
                    .. attribute:: state
                    
                    	Operational state for interface\-ref
                    	**type**\:   :py:class:`State <ydk.models.openconfig.openconfig_vlan.Vlans.Vlan.Members.Member.InterfaceRef.State>`
                    
                    

                    """

                    _prefix = 'oc-vlan'
                    _revision = '2016-05-26'

                    def __init__(self):
                        super(Vlans.Vlan.Members.Member.InterfaceRef,
                              self).__init__()

                        self.yang_name = "interface-ref"
                        self.yang_parent_name = "member"

                        self.state = Vlans.Vlan.Members.Member.InterfaceRef.State(
                        )
                        self.state.parent = self
                        self._children_name_map["state"] = "state"
                        self._children_yang_names.add("state")

                    class State(Entity):
                        """
                        Operational state for interface\-ref
                        
                        .. attribute:: interface
                        
                        	Reference to a base interface.  If a reference to a subinterface is required, this leaf must be specified to indicate the base interface
                        	**type**\:  str
                        
                        	**refers to**\:  :py:class:`name <ydk.models.openconfig.openconfig_interfaces.Interfaces.Interface>`
                        
                        .. attribute:: subinterface
                        
                        	Reference to a subinterface \-\- this requires the base interface to be specified using the interface leaf in this container.  If only a reference to a base interface is requuired, this leaf should not be set
                        	**type**\:  int
                        
                        	**range:** 0..4294967295
                        
                        	**refers to**\:  :py:class:`index <ydk.models.openconfig.openconfig_interfaces.Interfaces.Interface.Subinterfaces.Subinterface>`
                        
                        

                        """

                        _prefix = 'oc-vlan'
                        _revision = '2016-05-26'

                        def __init__(self):
                            super(Vlans.Vlan.Members.Member.InterfaceRef.State,
                                  self).__init__()

                            self.yang_name = "state"
                            self.yang_parent_name = "interface-ref"

                            self.interface = YLeaf(YType.str, "interface")

                            self.subinterface = YLeaf(YType.str,
                                                      "subinterface")

                        def __setattr__(self, name, value):
                            self._check_monkey_patching_error(name, value)
                            with _handle_type_error():
                                if name in self.__dict__ and isinstance(
                                        self.__dict__[name], YList):
                                    raise YPYModelError(
                                        "Attempt to assign value of '{}' to YList ldata. "
                                        "Please use list append or extend method."
                                        .format(value))
                                if isinstance(value, Enum.YLeaf):
                                    value = value.name
                                if name in ("interface", "subinterface"
                                            ) and name in self.__dict__:
                                    if isinstance(value, YLeaf):
                                        self.__dict__[name].set(value.get())
                                    elif isinstance(value, YLeafList):
                                        super(
                                            Vlans.Vlan.Members.Member.
                                            InterfaceRef.State,
                                            self).__setattr__(name, value)
                                    else:
                                        self.__dict__[name].set(value)
                                else:
                                    if hasattr(value,
                                               "parent") and name != "parent":
                                        if hasattr(
                                                value, "is_presence_container"
                                        ) and value.is_presence_container:
                                            value.parent = self
                                        elif value.parent is None and value.yang_name in self._children_yang_names:
                                            value.parent = self
                                    super(
                                        Vlans.Vlan.Members.Member.InterfaceRef.
                                        State, self).__setattr__(name, value)

                        def has_data(self):
                            return (self.interface.is_set
                                    or self.subinterface.is_set)

                        def has_operation(self):
                            return (
                                self.yfilter != YFilter.not_set
                                or self.interface.yfilter != YFilter.not_set or
                                self.subinterface.yfilter != YFilter.not_set)

                        def get_segment_path(self):
                            path_buffer = ""
                            path_buffer = "state" + path_buffer

                            return path_buffer

                        def get_entity_path(self, ancestor):
                            path_buffer = ""
                            if (ancestor is None):
                                raise YPYModelError(
                                    "ancestor cannot be None as one of the ancestors is a list"
                                )
                            else:
                                path_buffer = _get_relative_entity_path(
                                    self, ancestor, path_buffer)

                            leaf_name_data = LeafDataList()
                            if (self.interface.is_set or
                                    self.interface.yfilter != YFilter.not_set):
                                leaf_name_data.append(
                                    self.interface.get_name_leafdata())
                            if (self.subinterface.is_set
                                    or self.subinterface.yfilter !=
                                    YFilter.not_set):
                                leaf_name_data.append(
                                    self.subinterface.get_name_leafdata())

                            entity_path = EntityPath(path_buffer,
                                                     leaf_name_data)
                            return entity_path

                        def get_child_by_name(self, child_yang_name,
                                              segment_path):
                            child = self._get_child_by_seg_name(
                                [child_yang_name, segment_path])
                            if child is not None:
                                return child

                            return None

                        def has_leaf_or_child_of_name(self, name):
                            if (name == "interface" or name == "subinterface"):
                                return True
                            return False

                        def set_value(self, value_path, value, name_space,
                                      name_space_prefix):
                            if (value_path == "interface"):
                                self.interface = value
                                self.interface.value_namespace = name_space
                                self.interface.value_namespace_prefix = name_space_prefix
                            if (value_path == "subinterface"):
                                self.subinterface = value
                                self.subinterface.value_namespace = name_space
                                self.subinterface.value_namespace_prefix = name_space_prefix

                    def has_data(self):
                        return (self.state is not None
                                and self.state.has_data())

                    def has_operation(self):
                        return (self.yfilter != YFilter.not_set
                                or (self.state is not None
                                    and self.state.has_operation()))

                    def get_segment_path(self):
                        path_buffer = ""
                        path_buffer = "interface-ref" + path_buffer

                        return path_buffer

                    def get_entity_path(self, ancestor):
                        path_buffer = ""
                        if (ancestor is None):
                            raise YPYModelError(
                                "ancestor cannot be None as one of the ancestors is a list"
                            )
                        else:
                            path_buffer = _get_relative_entity_path(
                                self, ancestor, path_buffer)

                        leaf_name_data = LeafDataList()

                        entity_path = EntityPath(path_buffer, leaf_name_data)
                        return entity_path

                    def get_child_by_name(self, child_yang_name, segment_path):
                        child = self._get_child_by_seg_name(
                            [child_yang_name, segment_path])
                        if child is not None:
                            return child

                        if (child_yang_name == "state"):
                            if (self.state is None):
                                self.state = Vlans.Vlan.Members.Member.InterfaceRef.State(
                                )
                                self.state.parent = self
                                self._children_name_map["state"] = "state"
                            return self.state

                        return None

                    def has_leaf_or_child_of_name(self, name):
                        if (name == "state"):
                            return True
                        return False

                    def set_value(self, value_path, value, name_space,
                                  name_space_prefix):
                        pass

                def has_data(self):
                    return (self.interface_ref is not None
                            and self.interface_ref.has_data())

                def has_operation(self):
                    return (self.yfilter != YFilter.not_set
                            or (self.interface_ref is not None
                                and self.interface_ref.has_operation()))

                def get_segment_path(self):
                    path_buffer = ""
                    path_buffer = "member" + path_buffer

                    return path_buffer

                def get_entity_path(self, ancestor):
                    path_buffer = ""
                    if (ancestor is None):
                        raise YPYModelError(
                            "ancestor cannot be None as one of the ancestors is a list"
                        )
                    else:
                        path_buffer = _get_relative_entity_path(
                            self, ancestor, path_buffer)

                    leaf_name_data = LeafDataList()

                    entity_path = EntityPath(path_buffer, leaf_name_data)
                    return entity_path

                def get_child_by_name(self, child_yang_name, segment_path):
                    child = self._get_child_by_seg_name(
                        [child_yang_name, segment_path])
                    if child is not None:
                        return child

                    if (child_yang_name == "interface-ref"):
                        if (self.interface_ref is None):
                            self.interface_ref = Vlans.Vlan.Members.Member.InterfaceRef(
                            )
                            self.interface_ref.parent = self
                            self._children_name_map[
                                "interface_ref"] = "interface-ref"
                        return self.interface_ref

                    return None

                def has_leaf_or_child_of_name(self, name):
                    if (name == "interface-ref"):
                        return True
                    return False

                def set_value(self, value_path, value, name_space,
                              name_space_prefix):
                    pass

            def has_data(self):
                for c in self.member:
                    if (c.has_data()):
                        return True
                return False

            def has_operation(self):
                for c in self.member:
                    if (c.has_operation()):
                        return True
                return self.yfilter != YFilter.not_set

            def get_segment_path(self):
                path_buffer = ""
                path_buffer = "members" + path_buffer

                return path_buffer

            def get_entity_path(self, ancestor):
                path_buffer = ""
                if (ancestor is None):
                    raise YPYModelError(
                        "ancestor cannot be None as one of the ancestors is a list"
                    )
                else:
                    path_buffer = _get_relative_entity_path(
                        self, ancestor, path_buffer)

                leaf_name_data = LeafDataList()

                entity_path = EntityPath(path_buffer, leaf_name_data)
                return entity_path

            def get_child_by_name(self, child_yang_name, segment_path):
                child = self._get_child_by_seg_name(
                    [child_yang_name, segment_path])
                if child is not None:
                    return child

                if (child_yang_name == "member"):
                    for c in self.member:
                        segment = c.get_segment_path()
                        if (segment_path == segment):
                            return c
                    c = Vlans.Vlan.Members.Member()
                    c.parent = self
                    local_reference_key = "ydk::seg::%s" % segment_path
                    self._local_refs[local_reference_key] = c
                    self.member.append(c)
                    return c

                return None

            def has_leaf_or_child_of_name(self, name):
                if (name == "member"):
                    return True
                return False

            def set_value(self, value_path, value, name_space,
                          name_space_prefix):
                pass
    class Ceextconfigregtable(Entity):
        """
        The ceExtConfigRegTable extends
        the ENTITY\-MIB entPhysicalTable.
        
        .. attribute:: ceextconfigregentry
        
        	A ceExtConfigRegTable entry extends a corresponding entPhysicalTable entry of class module which has a configuration register.  Entries are created by the agent at the system power\-up or module insertion.  Entries are removed when the module is reset or  removed
        	**type**\: list of    :py:class:`Ceextconfigregentry <ydk.models.cisco_ios_xe.CISCO_ENTITY_EXT_MIB.CiscoEntityExtMib.Ceextconfigregtable.Ceextconfigregentry>`
        
        

        """

        _prefix = 'CISCO-ENTITY-EXT-MIB'
        _revision = '2008-11-24'

        def __init__(self):
            super(CiscoEntityExtMib.Ceextconfigregtable, self).__init__()

            self.yang_name = "ceExtConfigRegTable"
            self.yang_parent_name = "CISCO-ENTITY-EXT-MIB"

            self.ceextconfigregentry = YList(self)

        def __setattr__(self, name, value):
            self._check_monkey_patching_error(name, value)
            with _handle_type_error():
                if name in self.__dict__ and isinstance(self.__dict__[name], YList):
                    raise YPYModelError("Attempt to assign value of '{}' to YList ldata. "
                                        "Please use list append or extend method."
                                        .format(value))
                if isinstance(value, Enum.YLeaf):
                    value = value.name
                if name in () and name in self.__dict__:
                    if isinstance(value, YLeaf):
                        self.__dict__[name].set(value.get())
                    elif isinstance(value, YLeafList):
                        super(CiscoEntityExtMib.Ceextconfigregtable, self).__setattr__(name, value)
                    else:
                        self.__dict__[name].set(value)
                else:
                    if hasattr(value, "parent") and name != "parent":
                        if hasattr(value, "is_presence_container") and value.is_presence_container:
                            value.parent = self
                        elif value.parent is None and value.yang_name in self._children_yang_names:
                            value.parent = self
                    super(CiscoEntityExtMib.Ceextconfigregtable, self).__setattr__(name, value)


        class Ceextconfigregentry(Entity):
            """
            A ceExtConfigRegTable entry extends
            a corresponding entPhysicalTable entry of class
            module which has a configuration register.
            
            Entries are created by the agent at the system power\-up
            or module insertion.
            
            Entries are removed when the module is reset or 
            removed.
            
            .. attribute:: entphysicalindex  <key>
            
            	
            	**type**\:  int
            
            	**range:** 1..2147483647
            
            	**refers to**\:  :py:class:`entphysicalindex <ydk.models.cisco_ios_xe.ENTITY_MIB.EntityMib.Entphysicaltable.Entphysicalentry>`
            
            .. attribute:: ceextconfigregister
            
            	The value of configuration register with which the processor module booted
            	**type**\:  str
            
            .. attribute:: ceextconfigregnext
            
            	The value of configuration register in the processor module at next reboot. Just after  the reboot this has the same value as  ceExtConfigRegister
            	**type**\:  str
            
            .. attribute:: ceextkickstartimagelist
            
            	The list of system kickstart images which can be used for booting
            	**type**\:  str
            
            	**length:** 0..255
            
            .. attribute:: ceextsysbootimagelist
            
            	The list of system boot images which can be used for booting
            	**type**\:  str
            
            	**length:** 0..255
            
            

            """

            _prefix = 'CISCO-ENTITY-EXT-MIB'
            _revision = '2008-11-24'

            def __init__(self):
                super(CiscoEntityExtMib.Ceextconfigregtable.Ceextconfigregentry, self).__init__()

                self.yang_name = "ceExtConfigRegEntry"
                self.yang_parent_name = "ceExtConfigRegTable"

                self.entphysicalindex = YLeaf(YType.str, "entPhysicalIndex")

                self.ceextconfigregister = YLeaf(YType.str, "ceExtConfigRegister")

                self.ceextconfigregnext = YLeaf(YType.str, "ceExtConfigRegNext")

                self.ceextkickstartimagelist = YLeaf(YType.str, "ceExtKickstartImageList")

                self.ceextsysbootimagelist = YLeaf(YType.str, "ceExtSysBootImageList")

            def __setattr__(self, name, value):
                self._check_monkey_patching_error(name, value)
                with _handle_type_error():
                    if name in self.__dict__ and isinstance(self.__dict__[name], YList):
                        raise YPYModelError("Attempt to assign value of '{}' to YList ldata. "
                                            "Please use list append or extend method."
                                            .format(value))
                    if isinstance(value, Enum.YLeaf):
                        value = value.name
                    if name in ("entphysicalindex",
                                "ceextconfigregister",
                                "ceextconfigregnext",
                                "ceextkickstartimagelist",
                                "ceextsysbootimagelist") and name in self.__dict__:
                        if isinstance(value, YLeaf):
                            self.__dict__[name].set(value.get())
                        elif isinstance(value, YLeafList):
                            super(CiscoEntityExtMib.Ceextconfigregtable.Ceextconfigregentry, self).__setattr__(name, value)
                        else:
                            self.__dict__[name].set(value)
                    else:
                        if hasattr(value, "parent") and name != "parent":
                            if hasattr(value, "is_presence_container") and value.is_presence_container:
                                value.parent = self
                            elif value.parent is None and value.yang_name in self._children_yang_names:
                                value.parent = self
                        super(CiscoEntityExtMib.Ceextconfigregtable.Ceextconfigregentry, self).__setattr__(name, value)

            def has_data(self):
                return (
                    self.entphysicalindex.is_set or
                    self.ceextconfigregister.is_set or
                    self.ceextconfigregnext.is_set or
                    self.ceextkickstartimagelist.is_set or
                    self.ceextsysbootimagelist.is_set)

            def has_operation(self):
                return (
                    self.yfilter != YFilter.not_set or
                    self.entphysicalindex.yfilter != YFilter.not_set or
                    self.ceextconfigregister.yfilter != YFilter.not_set or
                    self.ceextconfigregnext.yfilter != YFilter.not_set or
                    self.ceextkickstartimagelist.yfilter != YFilter.not_set or
                    self.ceextsysbootimagelist.yfilter != YFilter.not_set)

            def get_segment_path(self):
                path_buffer = ""
                path_buffer = "ceExtConfigRegEntry" + "[entPhysicalIndex='" + self.entphysicalindex.get() + "']" + path_buffer

                return path_buffer

            def get_entity_path(self, ancestor):
                path_buffer = ""
                if (ancestor is None):
                    path_buffer = "CISCO-ENTITY-EXT-MIB:CISCO-ENTITY-EXT-MIB/ceExtConfigRegTable/%s" % self.get_segment_path()
                else:
                    path_buffer = _get_relative_entity_path(self, ancestor, path_buffer)

                leaf_name_data = LeafDataList()
                if (self.entphysicalindex.is_set or self.entphysicalindex.yfilter != YFilter.not_set):
                    leaf_name_data.append(self.entphysicalindex.get_name_leafdata())
                if (self.ceextconfigregister.is_set or self.ceextconfigregister.yfilter != YFilter.not_set):
                    leaf_name_data.append(self.ceextconfigregister.get_name_leafdata())
                if (self.ceextconfigregnext.is_set or self.ceextconfigregnext.yfilter != YFilter.not_set):
                    leaf_name_data.append(self.ceextconfigregnext.get_name_leafdata())
                if (self.ceextkickstartimagelist.is_set or self.ceextkickstartimagelist.yfilter != YFilter.not_set):
                    leaf_name_data.append(self.ceextkickstartimagelist.get_name_leafdata())
                if (self.ceextsysbootimagelist.is_set or self.ceextsysbootimagelist.yfilter != YFilter.not_set):
                    leaf_name_data.append(self.ceextsysbootimagelist.get_name_leafdata())

                entity_path = EntityPath(path_buffer, leaf_name_data)
                return entity_path

            def get_child_by_name(self, child_yang_name, segment_path):
                child = self._get_child_by_seg_name([child_yang_name, segment_path])
                if child is not None:
                    return child

                return None

            def has_leaf_or_child_of_name(self, name):
                if(name == "entPhysicalIndex" or name == "ceExtConfigRegister" or name == "ceExtConfigRegNext" or name == "ceExtKickstartImageList" or name == "ceExtSysBootImageList"):
                    return True
                return False

            def set_value(self, value_path, value, name_space, name_space_prefix):
                if(value_path == "entPhysicalIndex"):
                    self.entphysicalindex = value
                    self.entphysicalindex.value_namespace = name_space
                    self.entphysicalindex.value_namespace_prefix = name_space_prefix
                if(value_path == "ceExtConfigRegister"):
                    self.ceextconfigregister = value
                    self.ceextconfigregister.value_namespace = name_space
                    self.ceextconfigregister.value_namespace_prefix = name_space_prefix
                if(value_path == "ceExtConfigRegNext"):
                    self.ceextconfigregnext = value
                    self.ceextconfigregnext.value_namespace = name_space
                    self.ceextconfigregnext.value_namespace_prefix = name_space_prefix
                if(value_path == "ceExtKickstartImageList"):
                    self.ceextkickstartimagelist = value
                    self.ceextkickstartimagelist.value_namespace = name_space
                    self.ceextkickstartimagelist.value_namespace_prefix = name_space_prefix
                if(value_path == "ceExtSysBootImageList"):
                    self.ceextsysbootimagelist = value
                    self.ceextsysbootimagelist.value_namespace = name_space
                    self.ceextsysbootimagelist.value_namespace_prefix = name_space_prefix

        def has_data(self):
            for c in self.ceextconfigregentry:
                if (c.has_data()):
                    return True
            return False

        def has_operation(self):
            for c in self.ceextconfigregentry:
                if (c.has_operation()):
                    return True
            return self.yfilter != YFilter.not_set

        def get_segment_path(self):
            path_buffer = ""
            path_buffer = "ceExtConfigRegTable" + path_buffer

            return path_buffer

        def get_entity_path(self, ancestor):
            path_buffer = ""
            if (ancestor is None):
                path_buffer = "CISCO-ENTITY-EXT-MIB:CISCO-ENTITY-EXT-MIB/%s" % self.get_segment_path()
            else:
                path_buffer = _get_relative_entity_path(self, ancestor, path_buffer)

            leaf_name_data = LeafDataList()

            entity_path = EntityPath(path_buffer, leaf_name_data)
            return entity_path

        def get_child_by_name(self, child_yang_name, segment_path):
            child = self._get_child_by_seg_name([child_yang_name, segment_path])
            if child is not None:
                return child

            if (child_yang_name == "ceExtConfigRegEntry"):
                for c in self.ceextconfigregentry:
                    segment = c.get_segment_path()
                    if (segment_path == segment):
                        return c
                c = CiscoEntityExtMib.Ceextconfigregtable.Ceextconfigregentry()
                c.parent = self
                local_reference_key = "ydk::seg::%s" % segment_path
                self._local_refs[local_reference_key] = c
                self.ceextconfigregentry.append(c)
                return c

            return None

        def has_leaf_or_child_of_name(self, name):
            if(name == "ceExtConfigRegEntry"):
                return True
            return False

        def set_value(self, value_path, value, name_space, name_space_prefix):
            pass
    class Ceextphysicalprocessortable(Entity):
        """
        The ceExtPhysicalProcessorTable extends
        the ENTITY\-MIB entPhysicalTable for modules
        (Non FRUs(Field Replacable Units) or FRUs).
        
        .. attribute:: ceextphysicalprocessorentry
        
        	A ceExtPhysicalProcessorTable entry extends a corresponding entPhysicalTable entry of class module(entPhysicalClass = 'module').  A processor module or line card which  has a processor will have an entry in this table.  A processor module or line card having multiple processors and is a SMP(Symmetric multi processor) system will have only  one entry corresponding to all the processors  since the resources defined below are shared.  A processor module or line card having multiple processors and is not an SMP system would register the processors as separate entities.  Entries are created by the agent at the system power\-up or module insertion.  Entries are removed when the module is reset or removed
        	**type**\: list of    :py:class:`Ceextphysicalprocessorentry <ydk.models.cisco_ios_xe.CISCO_ENTITY_EXT_MIB.CiscoEntityExtMib.Ceextphysicalprocessortable.Ceextphysicalprocessorentry>`
        
        

        """

        _prefix = 'CISCO-ENTITY-EXT-MIB'
        _revision = '2008-11-24'

        def __init__(self):
            super(CiscoEntityExtMib.Ceextphysicalprocessortable, self).__init__()

            self.yang_name = "ceExtPhysicalProcessorTable"
            self.yang_parent_name = "CISCO-ENTITY-EXT-MIB"

            self.ceextphysicalprocessorentry = YList(self)

        def __setattr__(self, name, value):
            self._check_monkey_patching_error(name, value)
            with _handle_type_error():
                if name in self.__dict__ and isinstance(self.__dict__[name], YList):
                    raise YPYModelError("Attempt to assign value of '{}' to YList ldata. "
                                        "Please use list append or extend method."
                                        .format(value))
                if isinstance(value, Enum.YLeaf):
                    value = value.name
                if name in () and name in self.__dict__:
                    if isinstance(value, YLeaf):
                        self.__dict__[name].set(value.get())
                    elif isinstance(value, YLeafList):
                        super(CiscoEntityExtMib.Ceextphysicalprocessortable, self).__setattr__(name, value)
                    else:
                        self.__dict__[name].set(value)
                else:
                    if hasattr(value, "parent") and name != "parent":
                        if hasattr(value, "is_presence_container") and value.is_presence_container:
                            value.parent = self
                        elif value.parent is None and value.yang_name in self._children_yang_names:
                            value.parent = self
                    super(CiscoEntityExtMib.Ceextphysicalprocessortable, self).__setattr__(name, value)


        class Ceextphysicalprocessorentry(Entity):
            """
            A ceExtPhysicalProcessorTable entry extends
            a corresponding entPhysicalTable entry of class
            module(entPhysicalClass = 'module').
            
            A processor module or line card which 
            has a processor will have an entry in
            this table.
            
            A processor module or line card having
            multiple processors and is a SMP(Symmetric
            multi processor) system will have only 
            one entry corresponding to all the processors 
            since the resources defined below are shared.
            
            A processor module or line card having
            multiple processors and is not an SMP system
            would register the processors as separate entities.
            
            Entries are created by the agent at the system power\-up
            or module insertion.
            
            Entries are removed when the module is reset or removed.
            
            .. attribute:: entphysicalindex  <key>
            
            	
            	**type**\:  int
            
            	**range:** 1..2147483647
            
            	**refers to**\:  :py:class:`entphysicalindex <ydk.models.cisco_ios_xe.ENTITY_MIB.EntityMib.Entphysicaltable.Entphysicalentry>`
            
            .. attribute:: ceexthcprocessorram
            
            	This object represents the total number of bytes of RAM available on the Processor. This object is a 64\-bit version of ceExtProcessorRam
            	**type**\:  int
            
            	**range:** 0..18446744073709551615
            
            	**units**\: bytes
            
            .. attribute:: ceextnvramsize
            
            	Total number of bytes of NVRAM in the entity.  A value of 0 for this object means the entity does not support NVRAM or NVRAM information  is not available
            	**type**\:  int
            
            	**range:** 0..4294967295
            
            	**units**\: bytes
            
            .. attribute:: ceextnvramused
            
            	Number of bytes of NVRAM in use. This object is irrelevant if ceExtNVRAMSize is 0
            	**type**\:  int
            
            	**range:** 0..4294967295
            
            	**units**\: bytes
            
            .. attribute:: ceextprocessorram
            
            	Total number of bytes of RAM available on the Processor
            	**type**\:  int
            
            	**range:** 0..4294967295
            
            	**units**\: bytes
            
            .. attribute:: ceextprocessorramoverflow
            
            	This object represents the upper 32\-bit of ceExtProcessorRam. This object needs to be supported only if the available RAM bytes exceeds 32\-bit, otherwise this object value would be set to 0
            	**type**\:  int
            
            	**range:** 0..4294967295
            
            	**units**\: bytes
            
            

            """

            _prefix = 'CISCO-ENTITY-EXT-MIB'
            _revision = '2008-11-24'

            def __init__(self):
                super(CiscoEntityExtMib.Ceextphysicalprocessortable.Ceextphysicalprocessorentry, self).__init__()

                self.yang_name = "ceExtPhysicalProcessorEntry"
                self.yang_parent_name = "ceExtPhysicalProcessorTable"

                self.entphysicalindex = YLeaf(YType.str, "entPhysicalIndex")

                self.ceexthcprocessorram = YLeaf(YType.uint64, "ceExtHCProcessorRam")

                self.ceextnvramsize = YLeaf(YType.uint32, "ceExtNVRAMSize")

                self.ceextnvramused = YLeaf(YType.uint32, "ceExtNVRAMUsed")

                self.ceextprocessorram = YLeaf(YType.uint32, "ceExtProcessorRam")

                self.ceextprocessorramoverflow = YLeaf(YType.uint32, "ceExtProcessorRamOverflow")

            def __setattr__(self, name, value):
                self._check_monkey_patching_error(name, value)
                with _handle_type_error():
                    if name in self.__dict__ and isinstance(self.__dict__[name], YList):
                        raise YPYModelError("Attempt to assign value of '{}' to YList ldata. "
                                            "Please use list append or extend method."
                                            .format(value))
                    if isinstance(value, Enum.YLeaf):
                        value = value.name
                    if name in ("entphysicalindex",
                                "ceexthcprocessorram",
                                "ceextnvramsize",
                                "ceextnvramused",
                                "ceextprocessorram",
                                "ceextprocessorramoverflow") and name in self.__dict__:
                        if isinstance(value, YLeaf):
                            self.__dict__[name].set(value.get())
                        elif isinstance(value, YLeafList):
                            super(CiscoEntityExtMib.Ceextphysicalprocessortable.Ceextphysicalprocessorentry, self).__setattr__(name, value)
                        else:
                            self.__dict__[name].set(value)
                    else:
                        if hasattr(value, "parent") and name != "parent":
                            if hasattr(value, "is_presence_container") and value.is_presence_container:
                                value.parent = self
                            elif value.parent is None and value.yang_name in self._children_yang_names:
                                value.parent = self
                        super(CiscoEntityExtMib.Ceextphysicalprocessortable.Ceextphysicalprocessorentry, self).__setattr__(name, value)

            def has_data(self):
                return (
                    self.entphysicalindex.is_set or
                    self.ceexthcprocessorram.is_set or
                    self.ceextnvramsize.is_set or
                    self.ceextnvramused.is_set or
                    self.ceextprocessorram.is_set or
                    self.ceextprocessorramoverflow.is_set)

            def has_operation(self):
                return (
                    self.yfilter != YFilter.not_set or
                    self.entphysicalindex.yfilter != YFilter.not_set or
                    self.ceexthcprocessorram.yfilter != YFilter.not_set or
                    self.ceextnvramsize.yfilter != YFilter.not_set or
                    self.ceextnvramused.yfilter != YFilter.not_set or
                    self.ceextprocessorram.yfilter != YFilter.not_set or
                    self.ceextprocessorramoverflow.yfilter != YFilter.not_set)

            def get_segment_path(self):
                path_buffer = ""
                path_buffer = "ceExtPhysicalProcessorEntry" + "[entPhysicalIndex='" + self.entphysicalindex.get() + "']" + path_buffer

                return path_buffer

            def get_entity_path(self, ancestor):
                path_buffer = ""
                if (ancestor is None):
                    path_buffer = "CISCO-ENTITY-EXT-MIB:CISCO-ENTITY-EXT-MIB/ceExtPhysicalProcessorTable/%s" % self.get_segment_path()
                else:
                    path_buffer = _get_relative_entity_path(self, ancestor, path_buffer)

                leaf_name_data = LeafDataList()
                if (self.entphysicalindex.is_set or self.entphysicalindex.yfilter != YFilter.not_set):
                    leaf_name_data.append(self.entphysicalindex.get_name_leafdata())
                if (self.ceexthcprocessorram.is_set or self.ceexthcprocessorram.yfilter != YFilter.not_set):
                    leaf_name_data.append(self.ceexthcprocessorram.get_name_leafdata())
                if (self.ceextnvramsize.is_set or self.ceextnvramsize.yfilter != YFilter.not_set):
                    leaf_name_data.append(self.ceextnvramsize.get_name_leafdata())
                if (self.ceextnvramused.is_set or self.ceextnvramused.yfilter != YFilter.not_set):
                    leaf_name_data.append(self.ceextnvramused.get_name_leafdata())
                if (self.ceextprocessorram.is_set or self.ceextprocessorram.yfilter != YFilter.not_set):
                    leaf_name_data.append(self.ceextprocessorram.get_name_leafdata())
                if (self.ceextprocessorramoverflow.is_set or self.ceextprocessorramoverflow.yfilter != YFilter.not_set):
                    leaf_name_data.append(self.ceextprocessorramoverflow.get_name_leafdata())

                entity_path = EntityPath(path_buffer, leaf_name_data)
                return entity_path

            def get_child_by_name(self, child_yang_name, segment_path):
                child = self._get_child_by_seg_name([child_yang_name, segment_path])
                if child is not None:
                    return child

                return None

            def has_leaf_or_child_of_name(self, name):
                if(name == "entPhysicalIndex" or name == "ceExtHCProcessorRam" or name == "ceExtNVRAMSize" or name == "ceExtNVRAMUsed" or name == "ceExtProcessorRam" or name == "ceExtProcessorRamOverflow"):
                    return True
                return False

            def set_value(self, value_path, value, name_space, name_space_prefix):
                if(value_path == "entPhysicalIndex"):
                    self.entphysicalindex = value
                    self.entphysicalindex.value_namespace = name_space
                    self.entphysicalindex.value_namespace_prefix = name_space_prefix
                if(value_path == "ceExtHCProcessorRam"):
                    self.ceexthcprocessorram = value
                    self.ceexthcprocessorram.value_namespace = name_space
                    self.ceexthcprocessorram.value_namespace_prefix = name_space_prefix
                if(value_path == "ceExtNVRAMSize"):
                    self.ceextnvramsize = value
                    self.ceextnvramsize.value_namespace = name_space
                    self.ceextnvramsize.value_namespace_prefix = name_space_prefix
                if(value_path == "ceExtNVRAMUsed"):
                    self.ceextnvramused = value
                    self.ceextnvramused.value_namespace = name_space
                    self.ceextnvramused.value_namespace_prefix = name_space_prefix
                if(value_path == "ceExtProcessorRam"):
                    self.ceextprocessorram = value
                    self.ceextprocessorram.value_namespace = name_space
                    self.ceextprocessorram.value_namespace_prefix = name_space_prefix
                if(value_path == "ceExtProcessorRamOverflow"):
                    self.ceextprocessorramoverflow = value
                    self.ceextprocessorramoverflow.value_namespace = name_space
                    self.ceextprocessorramoverflow.value_namespace_prefix = name_space_prefix

        def has_data(self):
            for c in self.ceextphysicalprocessorentry:
                if (c.has_data()):
                    return True
            return False

        def has_operation(self):
            for c in self.ceextphysicalprocessorentry:
                if (c.has_operation()):
                    return True
            return self.yfilter != YFilter.not_set

        def get_segment_path(self):
            path_buffer = ""
            path_buffer = "ceExtPhysicalProcessorTable" + path_buffer

            return path_buffer

        def get_entity_path(self, ancestor):
            path_buffer = ""
            if (ancestor is None):
                path_buffer = "CISCO-ENTITY-EXT-MIB:CISCO-ENTITY-EXT-MIB/%s" % self.get_segment_path()
            else:
                path_buffer = _get_relative_entity_path(self, ancestor, path_buffer)

            leaf_name_data = LeafDataList()

            entity_path = EntityPath(path_buffer, leaf_name_data)
            return entity_path

        def get_child_by_name(self, child_yang_name, segment_path):
            child = self._get_child_by_seg_name([child_yang_name, segment_path])
            if child is not None:
                return child

            if (child_yang_name == "ceExtPhysicalProcessorEntry"):
                for c in self.ceextphysicalprocessorentry:
                    segment = c.get_segment_path()
                    if (segment_path == segment):
                        return c
                c = CiscoEntityExtMib.Ceextphysicalprocessortable.Ceextphysicalprocessorentry()
                c.parent = self
                local_reference_key = "ydk::seg::%s" % segment_path
                self._local_refs[local_reference_key] = c
                self.ceextphysicalprocessorentry.append(c)
                return c

            return None

        def has_leaf_or_child_of_name(self, name):
            if(name == "ceExtPhysicalProcessorEntry"):
                return True
            return False

        def set_value(self, value_path, value, name_space, name_space_prefix):
            pass
Пример #4
0
    class LabelDatabases(Entity):
        """
        Table of label databases
        
        .. attribute:: label_database
        
        	A label database
        	**type**\: list of    :py:class:`LabelDatabase <ydk.models.cisco_ios_xr.Cisco_IOS_XR_mpls_lsd_cfg.MplsLsd.LabelDatabases.LabelDatabase>`
        
        

        """

        _prefix = 'mpls-lsd-cfg'
        _revision = '2015-11-09'

        def __init__(self):
            super(MplsLsd.LabelDatabases, self).__init__()

            self.yang_name = "label-databases"
            self.yang_parent_name = "mpls-lsd"

            self.label_database = YList(self)

        def __setattr__(self, name, value):
            self._check_monkey_patching_error(name, value)
            with _handle_type_error():
                if name in self.__dict__ and isinstance(self.__dict__[name], YList):
                    raise YPYModelError("Attempt to assign value of '{}' to YList ldata. "
                                        "Please use list append or extend method."
                                        .format(value))
                if isinstance(value, Enum.YLeaf):
                    value = value.name
                if name in () and name in self.__dict__:
                    if isinstance(value, YLeaf):
                        self.__dict__[name].set(value.get())
                    elif isinstance(value, YLeafList):
                        super(MplsLsd.LabelDatabases, self).__setattr__(name, value)
                    else:
                        self.__dict__[name].set(value)
                else:
                    if hasattr(value, "parent") and name != "parent":
                        if hasattr(value, "is_presence_container") and value.is_presence_container:
                            value.parent = self
                        elif value.parent is None and value.yang_name in self._children_yang_names:
                            value.parent = self
                    super(MplsLsd.LabelDatabases, self).__setattr__(name, value)


        class LabelDatabase(Entity):
            """
            A label database
            
            .. attribute:: label_database_id  <key>
            
            	Label database identifier
            	**type**\:  int
            
            	**range:** 0..4294967295
            
            .. attribute:: label_range
            
            	Label range
            	**type**\:   :py:class:`LabelRange <ydk.models.cisco_ios_xr.Cisco_IOS_XR_mpls_lsd_cfg.MplsLsd.LabelDatabases.LabelDatabase.LabelRange>`
            
            

            """

            _prefix = 'mpls-lsd-cfg'
            _revision = '2015-11-09'

            def __init__(self):
                super(MplsLsd.LabelDatabases.LabelDatabase, self).__init__()

                self.yang_name = "label-database"
                self.yang_parent_name = "label-databases"

                self.label_database_id = YLeaf(YType.uint32, "label-database-id")

                self.label_range = MplsLsd.LabelDatabases.LabelDatabase.LabelRange()
                self.label_range.parent = self
                self._children_name_map["label_range"] = "label-range"
                self._children_yang_names.add("label-range")

            def __setattr__(self, name, value):
                self._check_monkey_patching_error(name, value)
                with _handle_type_error():
                    if name in self.__dict__ and isinstance(self.__dict__[name], YList):
                        raise YPYModelError("Attempt to assign value of '{}' to YList ldata. "
                                            "Please use list append or extend method."
                                            .format(value))
                    if isinstance(value, Enum.YLeaf):
                        value = value.name
                    if name in ("label_database_id") and name in self.__dict__:
                        if isinstance(value, YLeaf):
                            self.__dict__[name].set(value.get())
                        elif isinstance(value, YLeafList):
                            super(MplsLsd.LabelDatabases.LabelDatabase, self).__setattr__(name, value)
                        else:
                            self.__dict__[name].set(value)
                    else:
                        if hasattr(value, "parent") and name != "parent":
                            if hasattr(value, "is_presence_container") and value.is_presence_container:
                                value.parent = self
                            elif value.parent is None and value.yang_name in self._children_yang_names:
                                value.parent = self
                        super(MplsLsd.LabelDatabases.LabelDatabase, self).__setattr__(name, value)


            class LabelRange(Entity):
                """
                Label range
                
                .. attribute:: max_static_value
                
                	Maximum static label value
                	**type**\:  int
                
                	**range:** 0..1048575
                
                .. attribute:: max_value
                
                	Maximum label value
                	**type**\:  int
                
                	**range:** 16000..1048575
                
                .. attribute:: min_static_value
                
                	Minimum static label value
                	**type**\:  int
                
                	**range:** 0..1048575
                
                .. attribute:: minvalue
                
                	Minimum label value
                	**type**\:  int
                
                	**range:** 16000..1048575
                
                

                """

                _prefix = 'mpls-lsd-cfg'
                _revision = '2015-11-09'

                def __init__(self):
                    super(MplsLsd.LabelDatabases.LabelDatabase.LabelRange, self).__init__()

                    self.yang_name = "label-range"
                    self.yang_parent_name = "label-database"

                    self.max_static_value = YLeaf(YType.uint32, "max-static-value")

                    self.max_value = YLeaf(YType.uint32, "max-value")

                    self.min_static_value = YLeaf(YType.uint32, "min-static-value")

                    self.minvalue = YLeaf(YType.uint32, "minvalue")

                def __setattr__(self, name, value):
                    self._check_monkey_patching_error(name, value)
                    with _handle_type_error():
                        if name in self.__dict__ and isinstance(self.__dict__[name], YList):
                            raise YPYModelError("Attempt to assign value of '{}' to YList ldata. "
                                                "Please use list append or extend method."
                                                .format(value))
                        if isinstance(value, Enum.YLeaf):
                            value = value.name
                        if name in ("max_static_value",
                                    "max_value",
                                    "min_static_value",
                                    "minvalue") and name in self.__dict__:
                            if isinstance(value, YLeaf):
                                self.__dict__[name].set(value.get())
                            elif isinstance(value, YLeafList):
                                super(MplsLsd.LabelDatabases.LabelDatabase.LabelRange, self).__setattr__(name, value)
                            else:
                                self.__dict__[name].set(value)
                        else:
                            if hasattr(value, "parent") and name != "parent":
                                if hasattr(value, "is_presence_container") and value.is_presence_container:
                                    value.parent = self
                                elif value.parent is None and value.yang_name in self._children_yang_names:
                                    value.parent = self
                            super(MplsLsd.LabelDatabases.LabelDatabase.LabelRange, self).__setattr__(name, value)

                def has_data(self):
                    return (
                        self.max_static_value.is_set or
                        self.max_value.is_set or
                        self.min_static_value.is_set or
                        self.minvalue.is_set)

                def has_operation(self):
                    return (
                        self.yfilter != YFilter.not_set or
                        self.max_static_value.yfilter != YFilter.not_set or
                        self.max_value.yfilter != YFilter.not_set or
                        self.min_static_value.yfilter != YFilter.not_set or
                        self.minvalue.yfilter != YFilter.not_set)

                def get_segment_path(self):
                    path_buffer = ""
                    path_buffer = "label-range" + path_buffer

                    return path_buffer

                def get_entity_path(self, ancestor):
                    path_buffer = ""
                    if (ancestor is None):
                        raise YPYModelError("ancestor cannot be None as one of the ancestors is a list")
                    else:
                        path_buffer = _get_relative_entity_path(self, ancestor, path_buffer)

                    leaf_name_data = LeafDataList()
                    if (self.max_static_value.is_set or self.max_static_value.yfilter != YFilter.not_set):
                        leaf_name_data.append(self.max_static_value.get_name_leafdata())
                    if (self.max_value.is_set or self.max_value.yfilter != YFilter.not_set):
                        leaf_name_data.append(self.max_value.get_name_leafdata())
                    if (self.min_static_value.is_set or self.min_static_value.yfilter != YFilter.not_set):
                        leaf_name_data.append(self.min_static_value.get_name_leafdata())
                    if (self.minvalue.is_set or self.minvalue.yfilter != YFilter.not_set):
                        leaf_name_data.append(self.minvalue.get_name_leafdata())

                    entity_path = EntityPath(path_buffer, leaf_name_data)
                    return entity_path

                def get_child_by_name(self, child_yang_name, segment_path):
                    child = self._get_child_by_seg_name([child_yang_name, segment_path])
                    if child is not None:
                        return child

                    return None

                def has_leaf_or_child_of_name(self, name):
                    if(name == "max-static-value" or name == "max-value" or name == "min-static-value" or name == "minvalue"):
                        return True
                    return False

                def set_value(self, value_path, value, name_space, name_space_prefix):
                    if(value_path == "max-static-value"):
                        self.max_static_value = value
                        self.max_static_value.value_namespace = name_space
                        self.max_static_value.value_namespace_prefix = name_space_prefix
                    if(value_path == "max-value"):
                        self.max_value = value
                        self.max_value.value_namespace = name_space
                        self.max_value.value_namespace_prefix = name_space_prefix
                    if(value_path == "min-static-value"):
                        self.min_static_value = value
                        self.min_static_value.value_namespace = name_space
                        self.min_static_value.value_namespace_prefix = name_space_prefix
                    if(value_path == "minvalue"):
                        self.minvalue = value
                        self.minvalue.value_namespace = name_space
                        self.minvalue.value_namespace_prefix = name_space_prefix

            def has_data(self):
                return (
                    self.label_database_id.is_set or
                    (self.label_range is not None and self.label_range.has_data()))

            def has_operation(self):
                return (
                    self.yfilter != YFilter.not_set or
                    self.label_database_id.yfilter != YFilter.not_set or
                    (self.label_range is not None and self.label_range.has_operation()))

            def get_segment_path(self):
                path_buffer = ""
                path_buffer = "label-database" + "[label-database-id='" + self.label_database_id.get() + "']" + path_buffer

                return path_buffer

            def get_entity_path(self, ancestor):
                path_buffer = ""
                if (ancestor is None):
                    path_buffer = "Cisco-IOS-XR-mpls-lsd-cfg:mpls-lsd/label-databases/%s" % self.get_segment_path()
                else:
                    path_buffer = _get_relative_entity_path(self, ancestor, path_buffer)

                leaf_name_data = LeafDataList()
                if (self.label_database_id.is_set or self.label_database_id.yfilter != YFilter.not_set):
                    leaf_name_data.append(self.label_database_id.get_name_leafdata())

                entity_path = EntityPath(path_buffer, leaf_name_data)
                return entity_path

            def get_child_by_name(self, child_yang_name, segment_path):
                child = self._get_child_by_seg_name([child_yang_name, segment_path])
                if child is not None:
                    return child

                if (child_yang_name == "label-range"):
                    if (self.label_range is None):
                        self.label_range = MplsLsd.LabelDatabases.LabelDatabase.LabelRange()
                        self.label_range.parent = self
                        self._children_name_map["label_range"] = "label-range"
                    return self.label_range

                return None

            def has_leaf_or_child_of_name(self, name):
                if(name == "label-range" or name == "label-database-id"):
                    return True
                return False

            def set_value(self, value_path, value, name_space, name_space_prefix):
                if(value_path == "label-database-id"):
                    self.label_database_id = value
                    self.label_database_id.value_namespace = name_space
                    self.label_database_id.value_namespace_prefix = name_space_prefix

        def has_data(self):
            for c in self.label_database:
                if (c.has_data()):
                    return True
            return False

        def has_operation(self):
            for c in self.label_database:
                if (c.has_operation()):
                    return True
            return self.yfilter != YFilter.not_set

        def get_segment_path(self):
            path_buffer = ""
            path_buffer = "label-databases" + path_buffer

            return path_buffer

        def get_entity_path(self, ancestor):
            path_buffer = ""
            if (ancestor is None):
                path_buffer = "Cisco-IOS-XR-mpls-lsd-cfg:mpls-lsd/%s" % self.get_segment_path()
            else:
                path_buffer = _get_relative_entity_path(self, ancestor, path_buffer)

            leaf_name_data = LeafDataList()

            entity_path = EntityPath(path_buffer, leaf_name_data)
            return entity_path

        def get_child_by_name(self, child_yang_name, segment_path):
            child = self._get_child_by_seg_name([child_yang_name, segment_path])
            if child is not None:
                return child

            if (child_yang_name == "label-database"):
                for c in self.label_database:
                    segment = c.get_segment_path()
                    if (segment_path == segment):
                        return c
                c = MplsLsd.LabelDatabases.LabelDatabase()
                c.parent = self
                local_reference_key = "ydk::seg::%s" % segment_path
                self._local_refs[local_reference_key] = c
                self.label_database.append(c)
                return c

            return None

        def has_leaf_or_child_of_name(self, name):
            if(name == "label-database"):
                return True
            return False

        def set_value(self, value_path, value, name_space, name_space_prefix):
            pass
    class Ikepolmaptable(Entity):
        """
        The IPSec Phase\-1 Internet Key Exchange Tunnel
        to Policy Mapping Table. There is one entry in
        this table for each active IPSec Phase\-1
        Tunnel.
        
        .. attribute:: ikepolmapentry
        
        	Each entry contains the attributes associated with mapping an active IPSec Phase\-1 IKE Tunnel to it's configured Policy definition
        	**type**\: list of    :py:class:`Ikepolmapentry <ydk.models.cisco_ios_xe.CISCO_IPSEC_POLICY_MAP_MIB.CiscoIpsecPolicyMapMib.Ikepolmaptable.Ikepolmapentry>`
        
        

        """

        _prefix = 'CISCO-IPSEC-POLICY-MAP-MIB'
        _revision = '2000-08-17'

        def __init__(self):
            super(CiscoIpsecPolicyMapMib.Ikepolmaptable, self).__init__()

            self.yang_name = "ikePolMapTable"
            self.yang_parent_name = "CISCO-IPSEC-POLICY-MAP-MIB"

            self.ikepolmapentry = YList(self)

        def __setattr__(self, name, value):
            self._check_monkey_patching_error(name, value)
            with _handle_type_error():
                if name in self.__dict__ and isinstance(self.__dict__[name], YList):
                    raise YPYModelError("Attempt to assign value of '{}' to YList ldata. "
                                        "Please use list append or extend method."
                                        .format(value))
                if isinstance(value, Enum.YLeaf):
                    value = value.name
                if name in () and name in self.__dict__:
                    if isinstance(value, YLeaf):
                        self.__dict__[name].set(value.get())
                    elif isinstance(value, YLeafList):
                        super(CiscoIpsecPolicyMapMib.Ikepolmaptable, self).__setattr__(name, value)
                    else:
                        self.__dict__[name].set(value)
                else:
                    if hasattr(value, "parent") and name != "parent":
                        if hasattr(value, "is_presence_container") and value.is_presence_container:
                            value.parent = self
                        elif value.parent is None and value.yang_name in self._children_yang_names:
                            value.parent = self
                    super(CiscoIpsecPolicyMapMib.Ikepolmaptable, self).__setattr__(name, value)


        class Ikepolmapentry(Entity):
            """
            Each entry contains the attributes associated
            with mapping an active IPSec Phase\-1 IKE Tunnel
            to it's configured Policy definition.
            
            .. attribute:: ikepolmaptunindex  <key>
            
            	The index of the IPSec Phase\-1 Tunnel to Policy Map Table.  The value of the index is the number used to represent this IPSec Phase\-1 Tunnel in the IPSec MIB (ikeTunIndex in the ikeTunnelTable)
            	**type**\:  int
            
            	**range:** 1..2147483647
            
            .. attribute:: ikepolmappolicynum
            
            	The number of the locally defined ISAKMP policy used to establish the IPSec IKE Phase\-1 Tunnel. This is the number which was used on the crypto command. For example, if the configuration command was\:   ==>  crypto isakmp policy 15  then the value of this object would be 15. If ISAKMP was not used to establish this tunnel, then the value of this object will be zero
            	**type**\:  int
            
            	**range:** 1..2147483647
            
            

            """

            _prefix = 'CISCO-IPSEC-POLICY-MAP-MIB'
            _revision = '2000-08-17'

            def __init__(self):
                super(CiscoIpsecPolicyMapMib.Ikepolmaptable.Ikepolmapentry, self).__init__()

                self.yang_name = "ikePolMapEntry"
                self.yang_parent_name = "ikePolMapTable"

                self.ikepolmaptunindex = YLeaf(YType.int32, "ikePolMapTunIndex")

                self.ikepolmappolicynum = YLeaf(YType.int32, "ikePolMapPolicyNum")

            def __setattr__(self, name, value):
                self._check_monkey_patching_error(name, value)
                with _handle_type_error():
                    if name in self.__dict__ and isinstance(self.__dict__[name], YList):
                        raise YPYModelError("Attempt to assign value of '{}' to YList ldata. "
                                            "Please use list append or extend method."
                                            .format(value))
                    if isinstance(value, Enum.YLeaf):
                        value = value.name
                    if name in ("ikepolmaptunindex",
                                "ikepolmappolicynum") and name in self.__dict__:
                        if isinstance(value, YLeaf):
                            self.__dict__[name].set(value.get())
                        elif isinstance(value, YLeafList):
                            super(CiscoIpsecPolicyMapMib.Ikepolmaptable.Ikepolmapentry, self).__setattr__(name, value)
                        else:
                            self.__dict__[name].set(value)
                    else:
                        if hasattr(value, "parent") and name != "parent":
                            if hasattr(value, "is_presence_container") and value.is_presence_container:
                                value.parent = self
                            elif value.parent is None and value.yang_name in self._children_yang_names:
                                value.parent = self
                        super(CiscoIpsecPolicyMapMib.Ikepolmaptable.Ikepolmapentry, self).__setattr__(name, value)

            def has_data(self):
                return (
                    self.ikepolmaptunindex.is_set or
                    self.ikepolmappolicynum.is_set)

            def has_operation(self):
                return (
                    self.yfilter != YFilter.not_set or
                    self.ikepolmaptunindex.yfilter != YFilter.not_set or
                    self.ikepolmappolicynum.yfilter != YFilter.not_set)

            def get_segment_path(self):
                path_buffer = ""
                path_buffer = "ikePolMapEntry" + "[ikePolMapTunIndex='" + self.ikepolmaptunindex.get() + "']" + path_buffer

                return path_buffer

            def get_entity_path(self, ancestor):
                path_buffer = ""
                if (ancestor is None):
                    path_buffer = "CISCO-IPSEC-POLICY-MAP-MIB:CISCO-IPSEC-POLICY-MAP-MIB/ikePolMapTable/%s" % self.get_segment_path()
                else:
                    path_buffer = _get_relative_entity_path(self, ancestor, path_buffer)

                leaf_name_data = LeafDataList()
                if (self.ikepolmaptunindex.is_set or self.ikepolmaptunindex.yfilter != YFilter.not_set):
                    leaf_name_data.append(self.ikepolmaptunindex.get_name_leafdata())
                if (self.ikepolmappolicynum.is_set or self.ikepolmappolicynum.yfilter != YFilter.not_set):
                    leaf_name_data.append(self.ikepolmappolicynum.get_name_leafdata())

                entity_path = EntityPath(path_buffer, leaf_name_data)
                return entity_path

            def get_child_by_name(self, child_yang_name, segment_path):
                child = self._get_child_by_seg_name([child_yang_name, segment_path])
                if child is not None:
                    return child

                return None

            def has_leaf_or_child_of_name(self, name):
                if(name == "ikePolMapTunIndex" or name == "ikePolMapPolicyNum"):
                    return True
                return False

            def set_value(self, value_path, value, name_space, name_space_prefix):
                if(value_path == "ikePolMapTunIndex"):
                    self.ikepolmaptunindex = value
                    self.ikepolmaptunindex.value_namespace = name_space
                    self.ikepolmaptunindex.value_namespace_prefix = name_space_prefix
                if(value_path == "ikePolMapPolicyNum"):
                    self.ikepolmappolicynum = value
                    self.ikepolmappolicynum.value_namespace = name_space
                    self.ikepolmappolicynum.value_namespace_prefix = name_space_prefix

        def has_data(self):
            for c in self.ikepolmapentry:
                if (c.has_data()):
                    return True
            return False

        def has_operation(self):
            for c in self.ikepolmapentry:
                if (c.has_operation()):
                    return True
            return self.yfilter != YFilter.not_set

        def get_segment_path(self):
            path_buffer = ""
            path_buffer = "ikePolMapTable" + path_buffer

            return path_buffer

        def get_entity_path(self, ancestor):
            path_buffer = ""
            if (ancestor is None):
                path_buffer = "CISCO-IPSEC-POLICY-MAP-MIB:CISCO-IPSEC-POLICY-MAP-MIB/%s" % self.get_segment_path()
            else:
                path_buffer = _get_relative_entity_path(self, ancestor, path_buffer)

            leaf_name_data = LeafDataList()

            entity_path = EntityPath(path_buffer, leaf_name_data)
            return entity_path

        def get_child_by_name(self, child_yang_name, segment_path):
            child = self._get_child_by_seg_name([child_yang_name, segment_path])
            if child is not None:
                return child

            if (child_yang_name == "ikePolMapEntry"):
                for c in self.ikepolmapentry:
                    segment = c.get_segment_path()
                    if (segment_path == segment):
                        return c
                c = CiscoIpsecPolicyMapMib.Ikepolmaptable.Ikepolmapentry()
                c.parent = self
                local_reference_key = "ydk::seg::%s" % segment_path
                self._local_refs[local_reference_key] = c
                self.ikepolmapentry.append(c)
                return c

            return None

        def has_leaf_or_child_of_name(self, name):
            if(name == "ikePolMapEntry"):
                return True
            return False

        def set_value(self, value_path, value, name_space, name_space_prefix):
            pass
Пример #6
0
    class CpuUtilization(Entity):
        """
        Processes CPU utilization information
        
        .. attribute:: node_name  <key>
        
        	Node name
        	**type**\:  str
        
        	**pattern:** ([a\-zA\-Z0\-9\_]\*\\d+/){1,2}([a\-zA\-Z0\-9\_]\*\\d+)
        
        .. attribute:: process_cpu
        
        	Per process CPU utilization
        	**type**\: list of    :py:class:`ProcessCpu <ydk.models.cisco_ios_xr.Cisco_IOS_XR_wdsysmon_fd_oper.SystemMonitoring.CpuUtilization.ProcessCpu>`
        
        .. attribute:: total_cpu_fifteen_minute
        
        	Total CPU utilization in past 15 minute
        	**type**\:  int
        
        	**range:** 0..4294967295
        
        .. attribute:: total_cpu_five_minute
        
        	Total CPU utilization in past 5 minute
        	**type**\:  int
        
        	**range:** 0..4294967295
        
        .. attribute:: total_cpu_one_minute
        
        	Total CPU utilization in past 1 minute
        	**type**\:  int
        
        	**range:** 0..4294967295
        
        

        """

        _prefix = 'wdsysmon-fd-oper'
        _revision = '2015-11-09'

        def __init__(self):
            super(SystemMonitoring.CpuUtilization, self).__init__()

            self.yang_name = "cpu-utilization"
            self.yang_parent_name = "system-monitoring"

            self.node_name = YLeaf(YType.str, "node-name")

            self.total_cpu_fifteen_minute = YLeaf(YType.uint32, "total-cpu-fifteen-minute")

            self.total_cpu_five_minute = YLeaf(YType.uint32, "total-cpu-five-minute")

            self.total_cpu_one_minute = YLeaf(YType.uint32, "total-cpu-one-minute")

            self.process_cpu = YList(self)

        def __setattr__(self, name, value):
            self._check_monkey_patching_error(name, value)
            with _handle_type_error():
                if name in self.__dict__ and isinstance(self.__dict__[name], YList):
                    raise YPYModelError("Attempt to assign value of '{}' to YList ldata. "
                                        "Please use list append or extend method."
                                        .format(value))
                if isinstance(value, Enum.YLeaf):
                    value = value.name
                if name in ("node_name",
                            "total_cpu_fifteen_minute",
                            "total_cpu_five_minute",
                            "total_cpu_one_minute") and name in self.__dict__:
                    if isinstance(value, YLeaf):
                        self.__dict__[name].set(value.get())
                    elif isinstance(value, YLeafList):
                        super(SystemMonitoring.CpuUtilization, self).__setattr__(name, value)
                    else:
                        self.__dict__[name].set(value)
                else:
                    if hasattr(value, "parent") and name != "parent":
                        if hasattr(value, "is_presence_container") and value.is_presence_container:
                            value.parent = self
                        elif value.parent is None and value.yang_name in self._children_yang_names:
                            value.parent = self
                    super(SystemMonitoring.CpuUtilization, self).__setattr__(name, value)


        class ProcessCpu(Entity):
            """
            Per process CPU utilization
            
            .. attribute:: process_cpu_fifteen_minute
            
            	Process CPU utilization in percent for past 15 minute
            	**type**\:  int
            
            	**range:** 0..4294967295
            
            	**units**\: percentage
            
            .. attribute:: process_cpu_five_minute
            
            	Process CPU utilization in percent for past 5 minute
            	**type**\:  int
            
            	**range:** 0..4294967295
            
            	**units**\: percentage
            
            .. attribute:: process_cpu_one_minute
            
            	Process CPU utilization in percent for past 1 minute
            	**type**\:  int
            
            	**range:** 0..4294967295
            
            	**units**\: percentage
            
            .. attribute:: process_id
            
            	Process ID
            	**type**\:  int
            
            	**range:** 0..4294967295
            
            .. attribute:: process_name
            
            	Process name
            	**type**\:  str
            
            

            """

            _prefix = 'wdsysmon-fd-oper'
            _revision = '2015-11-09'

            def __init__(self):
                super(SystemMonitoring.CpuUtilization.ProcessCpu, self).__init__()

                self.yang_name = "process-cpu"
                self.yang_parent_name = "cpu-utilization"

                self.process_cpu_fifteen_minute = YLeaf(YType.uint32, "process-cpu-fifteen-minute")

                self.process_cpu_five_minute = YLeaf(YType.uint32, "process-cpu-five-minute")

                self.process_cpu_one_minute = YLeaf(YType.uint32, "process-cpu-one-minute")

                self.process_id = YLeaf(YType.uint32, "process-id")

                self.process_name = YLeaf(YType.str, "process-name")

            def __setattr__(self, name, value):
                self._check_monkey_patching_error(name, value)
                with _handle_type_error():
                    if name in self.__dict__ and isinstance(self.__dict__[name], YList):
                        raise YPYModelError("Attempt to assign value of '{}' to YList ldata. "
                                            "Please use list append or extend method."
                                            .format(value))
                    if isinstance(value, Enum.YLeaf):
                        value = value.name
                    if name in ("process_cpu_fifteen_minute",
                                "process_cpu_five_minute",
                                "process_cpu_one_minute",
                                "process_id",
                                "process_name") and name in self.__dict__:
                        if isinstance(value, YLeaf):
                            self.__dict__[name].set(value.get())
                        elif isinstance(value, YLeafList):
                            super(SystemMonitoring.CpuUtilization.ProcessCpu, self).__setattr__(name, value)
                        else:
                            self.__dict__[name].set(value)
                    else:
                        if hasattr(value, "parent") and name != "parent":
                            if hasattr(value, "is_presence_container") and value.is_presence_container:
                                value.parent = self
                            elif value.parent is None and value.yang_name in self._children_yang_names:
                                value.parent = self
                        super(SystemMonitoring.CpuUtilization.ProcessCpu, self).__setattr__(name, value)

            def has_data(self):
                return (
                    self.process_cpu_fifteen_minute.is_set or
                    self.process_cpu_five_minute.is_set or
                    self.process_cpu_one_minute.is_set or
                    self.process_id.is_set or
                    self.process_name.is_set)

            def has_operation(self):
                return (
                    self.yfilter != YFilter.not_set or
                    self.process_cpu_fifteen_minute.yfilter != YFilter.not_set or
                    self.process_cpu_five_minute.yfilter != YFilter.not_set or
                    self.process_cpu_one_minute.yfilter != YFilter.not_set or
                    self.process_id.yfilter != YFilter.not_set or
                    self.process_name.yfilter != YFilter.not_set)

            def get_segment_path(self):
                path_buffer = ""
                path_buffer = "process-cpu" + path_buffer

                return path_buffer

            def get_entity_path(self, ancestor):
                path_buffer = ""
                if (ancestor is None):
                    raise YPYModelError("ancestor cannot be None as one of the ancestors is a list")
                else:
                    path_buffer = _get_relative_entity_path(self, ancestor, path_buffer)

                leaf_name_data = LeafDataList()
                if (self.process_cpu_fifteen_minute.is_set or self.process_cpu_fifteen_minute.yfilter != YFilter.not_set):
                    leaf_name_data.append(self.process_cpu_fifteen_minute.get_name_leafdata())
                if (self.process_cpu_five_minute.is_set or self.process_cpu_five_minute.yfilter != YFilter.not_set):
                    leaf_name_data.append(self.process_cpu_five_minute.get_name_leafdata())
                if (self.process_cpu_one_minute.is_set or self.process_cpu_one_minute.yfilter != YFilter.not_set):
                    leaf_name_data.append(self.process_cpu_one_minute.get_name_leafdata())
                if (self.process_id.is_set or self.process_id.yfilter != YFilter.not_set):
                    leaf_name_data.append(self.process_id.get_name_leafdata())
                if (self.process_name.is_set or self.process_name.yfilter != YFilter.not_set):
                    leaf_name_data.append(self.process_name.get_name_leafdata())

                entity_path = EntityPath(path_buffer, leaf_name_data)
                return entity_path

            def get_child_by_name(self, child_yang_name, segment_path):
                child = self._get_child_by_seg_name([child_yang_name, segment_path])
                if child is not None:
                    return child

                return None

            def has_leaf_or_child_of_name(self, name):
                if(name == "process-cpu-fifteen-minute" or name == "process-cpu-five-minute" or name == "process-cpu-one-minute" or name == "process-id" or name == "process-name"):
                    return True
                return False

            def set_value(self, value_path, value, name_space, name_space_prefix):
                if(value_path == "process-cpu-fifteen-minute"):
                    self.process_cpu_fifteen_minute = value
                    self.process_cpu_fifteen_minute.value_namespace = name_space
                    self.process_cpu_fifteen_minute.value_namespace_prefix = name_space_prefix
                if(value_path == "process-cpu-five-minute"):
                    self.process_cpu_five_minute = value
                    self.process_cpu_five_minute.value_namespace = name_space
                    self.process_cpu_five_minute.value_namespace_prefix = name_space_prefix
                if(value_path == "process-cpu-one-minute"):
                    self.process_cpu_one_minute = value
                    self.process_cpu_one_minute.value_namespace = name_space
                    self.process_cpu_one_minute.value_namespace_prefix = name_space_prefix
                if(value_path == "process-id"):
                    self.process_id = value
                    self.process_id.value_namespace = name_space
                    self.process_id.value_namespace_prefix = name_space_prefix
                if(value_path == "process-name"):
                    self.process_name = value
                    self.process_name.value_namespace = name_space
                    self.process_name.value_namespace_prefix = name_space_prefix

        def has_data(self):
            for c in self.process_cpu:
                if (c.has_data()):
                    return True
            return (
                self.node_name.is_set or
                self.total_cpu_fifteen_minute.is_set or
                self.total_cpu_five_minute.is_set or
                self.total_cpu_one_minute.is_set)

        def has_operation(self):
            for c in self.process_cpu:
                if (c.has_operation()):
                    return True
            return (
                self.yfilter != YFilter.not_set or
                self.node_name.yfilter != YFilter.not_set or
                self.total_cpu_fifteen_minute.yfilter != YFilter.not_set or
                self.total_cpu_five_minute.yfilter != YFilter.not_set or
                self.total_cpu_one_minute.yfilter != YFilter.not_set)

        def get_segment_path(self):
            path_buffer = ""
            path_buffer = "cpu-utilization" + "[node-name='" + self.node_name.get() + "']" + path_buffer

            return path_buffer

        def get_entity_path(self, ancestor):
            path_buffer = ""
            if (ancestor is None):
                path_buffer = "Cisco-IOS-XR-wdsysmon-fd-oper:system-monitoring/%s" % self.get_segment_path()
            else:
                path_buffer = _get_relative_entity_path(self, ancestor, path_buffer)

            leaf_name_data = LeafDataList()
            if (self.node_name.is_set or self.node_name.yfilter != YFilter.not_set):
                leaf_name_data.append(self.node_name.get_name_leafdata())
            if (self.total_cpu_fifteen_minute.is_set or self.total_cpu_fifteen_minute.yfilter != YFilter.not_set):
                leaf_name_data.append(self.total_cpu_fifteen_minute.get_name_leafdata())
            if (self.total_cpu_five_minute.is_set or self.total_cpu_five_minute.yfilter != YFilter.not_set):
                leaf_name_data.append(self.total_cpu_five_minute.get_name_leafdata())
            if (self.total_cpu_one_minute.is_set or self.total_cpu_one_minute.yfilter != YFilter.not_set):
                leaf_name_data.append(self.total_cpu_one_minute.get_name_leafdata())

            entity_path = EntityPath(path_buffer, leaf_name_data)
            return entity_path

        def get_child_by_name(self, child_yang_name, segment_path):
            child = self._get_child_by_seg_name([child_yang_name, segment_path])
            if child is not None:
                return child

            if (child_yang_name == "process-cpu"):
                for c in self.process_cpu:
                    segment = c.get_segment_path()
                    if (segment_path == segment):
                        return c
                c = SystemMonitoring.CpuUtilization.ProcessCpu()
                c.parent = self
                local_reference_key = "ydk::seg::%s" % segment_path
                self._local_refs[local_reference_key] = c
                self.process_cpu.append(c)
                return c

            return None

        def has_leaf_or_child_of_name(self, name):
            if(name == "process-cpu" or name == "node-name" or name == "total-cpu-fifteen-minute" or name == "total-cpu-five-minute" or name == "total-cpu-one-minute"):
                return True
            return False

        def set_value(self, value_path, value, name_space, name_space_prefix):
            if(value_path == "node-name"):
                self.node_name = value
                self.node_name.value_namespace = name_space
                self.node_name.value_namespace_prefix = name_space_prefix
            if(value_path == "total-cpu-fifteen-minute"):
                self.total_cpu_fifteen_minute = value
                self.total_cpu_fifteen_minute.value_namespace = name_space
                self.total_cpu_fifteen_minute.value_namespace_prefix = name_space_prefix
            if(value_path == "total-cpu-five-minute"):
                self.total_cpu_five_minute = value
                self.total_cpu_five_minute.value_namespace = name_space
                self.total_cpu_five_minute.value_namespace_prefix = name_space_prefix
            if(value_path == "total-cpu-one-minute"):
                self.total_cpu_one_minute = value
                self.total_cpu_one_minute.value_namespace = name_space
                self.total_cpu_one_minute.value_namespace_prefix = name_space_prefix
    class Ceesubinterfacetable(Entity):
        """
        This table provides the subinterface related information
        associated to the Ethernet\-like interfaces.
        
        The subinterface is a division of one physical interface into
        multiple logical interfaces. As an example of what a typical
        subinterface setup might look like on a device, a single
        Ethernet port such as GigabitEthernet0/0 would be subdivided
        into Gi0/0.1, Gi0/0.2, Gi0/0.3 and so on, each one performing as
        if it were a separate interface.
        
        .. attribute:: ceesubinterfaceentry
        
        	This table contains a row for each Ethernet\-like interface by it's ifTable ifIndex in the system, which supports the sub\-interface.  An entry is created by an agent, when it detects a Ethernet\-like interface is created in ifTable and it  can support sub\-interface.  An entry is deleted by an agent, when the ifTable entry associated to the Ethernet\-like interface is deleted. Typically, when the card is removed from the device
        	**type**\: list of    :py:class:`Ceesubinterfaceentry <ydk.models.cisco_ios_xe.CISCO_ETHERLIKE_EXT_MIB.CiscoEtherlikeExtMib.Ceesubinterfacetable.Ceesubinterfaceentry>`
        
        

        """

        _prefix = 'CISCO-ETHERLIKE-EXT-MIB'
        _revision = '2010-06-04'

        def __init__(self):
            super(CiscoEtherlikeExtMib.Ceesubinterfacetable, self).__init__()

            self.yang_name = "ceeSubInterfaceTable"
            self.yang_parent_name = "CISCO-ETHERLIKE-EXT-MIB"

            self.ceesubinterfaceentry = YList(self)

        def __setattr__(self, name, value):
            self._check_monkey_patching_error(name, value)
            with _handle_type_error():
                if name in self.__dict__ and isinstance(
                        self.__dict__[name], YList):
                    raise YPYModelError(
                        "Attempt to assign value of '{}' to YList ldata. "
                        "Please use list append or extend method.".format(
                            value))
                if isinstance(value, Enum.YLeaf):
                    value = value.name
                if name in () and name in self.__dict__:
                    if isinstance(value, YLeaf):
                        self.__dict__[name].set(value.get())
                    elif isinstance(value, YLeafList):
                        super(CiscoEtherlikeExtMib.Ceesubinterfacetable,
                              self).__setattr__(name, value)
                    else:
                        self.__dict__[name].set(value)
                else:
                    if hasattr(value, "parent") and name != "parent":
                        if hasattr(value, "is_presence_container"
                                   ) and value.is_presence_container:
                            value.parent = self
                        elif value.parent is None and value.yang_name in self._children_yang_names:
                            value.parent = self
                    super(CiscoEtherlikeExtMib.Ceesubinterfacetable,
                          self).__setattr__(name, value)

        class Ceesubinterfaceentry(Entity):
            """
            This table contains a row for each Ethernet\-like interface
            by it's ifTable ifIndex in the system, which supports the
            sub\-interface.
            
            An entry is created by an agent, when it detects a
            Ethernet\-like interface is created in ifTable and it 
            can support sub\-interface.
            
            An entry is deleted by an agent, when the ifTable entry
            associated to the Ethernet\-like interface is deleted.
            Typically, when the card is removed from the device.
            
            .. attribute:: ifindex  <key>
            
            	
            	**type**\:  int
            
            	**range:** 1..2147483647
            
            	**refers to**\:  :py:class:`ifindex <ydk.models.cisco_ios_xe.IF_MIB.IfMib.Iftable.Ifentry>`
            
            .. attribute:: ceesubinterfacecount
            
            	This object represents the number of subinterfaces created on a Ethernet\-like interface
            	**type**\:  int
            
            	**range:** 0..4294967295
            
            	**units**\: subifs
            
            

            """

            _prefix = 'CISCO-ETHERLIKE-EXT-MIB'
            _revision = '2010-06-04'

            def __init__(self):
                super(
                    CiscoEtherlikeExtMib.Ceesubinterfacetable.
                    Ceesubinterfaceentry, self).__init__()

                self.yang_name = "ceeSubInterfaceEntry"
                self.yang_parent_name = "ceeSubInterfaceTable"

                self.ifindex = YLeaf(YType.str, "ifIndex")

                self.ceesubinterfacecount = YLeaf(YType.uint32,
                                                  "ceeSubInterfaceCount")

            def __setattr__(self, name, value):
                self._check_monkey_patching_error(name, value)
                with _handle_type_error():
                    if name in self.__dict__ and isinstance(
                            self.__dict__[name], YList):
                        raise YPYModelError(
                            "Attempt to assign value of '{}' to YList ldata. "
                            "Please use list append or extend method.".format(
                                value))
                    if isinstance(value, Enum.YLeaf):
                        value = value.name
                    if name in ("ifindex", "ceesubinterfacecount"
                                ) and name in self.__dict__:
                        if isinstance(value, YLeaf):
                            self.__dict__[name].set(value.get())
                        elif isinstance(value, YLeafList):
                            super(
                                CiscoEtherlikeExtMib.Ceesubinterfacetable.
                                Ceesubinterfaceentry,
                                self).__setattr__(name, value)
                        else:
                            self.__dict__[name].set(value)
                    else:
                        if hasattr(value, "parent") and name != "parent":
                            if hasattr(value, "is_presence_container"
                                       ) and value.is_presence_container:
                                value.parent = self
                            elif value.parent is None and value.yang_name in self._children_yang_names:
                                value.parent = self
                        super(
                            CiscoEtherlikeExtMib.Ceesubinterfacetable.
                            Ceesubinterfaceentry,
                            self).__setattr__(name, value)

            def has_data(self):
                return (self.ifindex.is_set
                        or self.ceesubinterfacecount.is_set)

            def has_operation(self):
                return (self.yfilter != YFilter.not_set
                        or self.ifindex.yfilter != YFilter.not_set or
                        self.ceesubinterfacecount.yfilter != YFilter.not_set)

            def get_segment_path(self):
                path_buffer = ""
                path_buffer = "ceeSubInterfaceEntry" + "[ifIndex='" + self.ifindex.get(
                ) + "']" + path_buffer

                return path_buffer

            def get_entity_path(self, ancestor):
                path_buffer = ""
                if (ancestor is None):
                    path_buffer = "CISCO-ETHERLIKE-EXT-MIB:CISCO-ETHERLIKE-EXT-MIB/ceeSubInterfaceTable/%s" % self.get_segment_path(
                    )
                else:
                    path_buffer = _get_relative_entity_path(
                        self, ancestor, path_buffer)

                leaf_name_data = LeafDataList()
                if (self.ifindex.is_set
                        or self.ifindex.yfilter != YFilter.not_set):
                    leaf_name_data.append(self.ifindex.get_name_leafdata())
                if (self.ceesubinterfacecount.is_set or
                        self.ceesubinterfacecount.yfilter != YFilter.not_set):
                    leaf_name_data.append(
                        self.ceesubinterfacecount.get_name_leafdata())

                entity_path = EntityPath(path_buffer, leaf_name_data)
                return entity_path

            def get_child_by_name(self, child_yang_name, segment_path):
                child = self._get_child_by_seg_name(
                    [child_yang_name, segment_path])
                if child is not None:
                    return child

                return None

            def has_leaf_or_child_of_name(self, name):
                if (name == "ifIndex" or name == "ceeSubInterfaceCount"):
                    return True
                return False

            def set_value(self, value_path, value, name_space,
                          name_space_prefix):
                if (value_path == "ifIndex"):
                    self.ifindex = value
                    self.ifindex.value_namespace = name_space
                    self.ifindex.value_namespace_prefix = name_space_prefix
                if (value_path == "ceeSubInterfaceCount"):
                    self.ceesubinterfacecount = value
                    self.ceesubinterfacecount.value_namespace = name_space
                    self.ceesubinterfacecount.value_namespace_prefix = name_space_prefix

        def has_data(self):
            for c in self.ceesubinterfaceentry:
                if (c.has_data()):
                    return True
            return False

        def has_operation(self):
            for c in self.ceesubinterfaceentry:
                if (c.has_operation()):
                    return True
            return self.yfilter != YFilter.not_set

        def get_segment_path(self):
            path_buffer = ""
            path_buffer = "ceeSubInterfaceTable" + path_buffer

            return path_buffer

        def get_entity_path(self, ancestor):
            path_buffer = ""
            if (ancestor is None):
                path_buffer = "CISCO-ETHERLIKE-EXT-MIB:CISCO-ETHERLIKE-EXT-MIB/%s" % self.get_segment_path(
                )
            else:
                path_buffer = _get_relative_entity_path(
                    self, ancestor, path_buffer)

            leaf_name_data = LeafDataList()

            entity_path = EntityPath(path_buffer, leaf_name_data)
            return entity_path

        def get_child_by_name(self, child_yang_name, segment_path):
            child = self._get_child_by_seg_name(
                [child_yang_name, segment_path])
            if child is not None:
                return child

            if (child_yang_name == "ceeSubInterfaceEntry"):
                for c in self.ceesubinterfaceentry:
                    segment = c.get_segment_path()
                    if (segment_path == segment):
                        return c
                c = CiscoEtherlikeExtMib.Ceesubinterfacetable.Ceesubinterfaceentry(
                )
                c.parent = self
                local_reference_key = "ydk::seg::%s" % segment_path
                self._local_refs[local_reference_key] = c
                self.ceesubinterfaceentry.append(c)
                return c

            return None

        def has_leaf_or_child_of_name(self, name):
            if (name == "ceeSubInterfaceEntry"):
                return True
            return False

        def set_value(self, value_path, value, name_space, name_space_prefix):
            pass
Пример #8
0
class HardwareModule(Entity):
    """
    NCS1k HW module config
    
    .. attribute:: node
    
    	Node
    	**type**\: list of    :py:class:`Node <ydk.models.cisco_ios_xr.Cisco_IOS_XR_ncs1k_mxp_cfg.HardwareModule.Node>`
    
    

    """

    _prefix = 'ncs1k-mxp-cfg'
    _revision = '2015-11-09'

    def __init__(self):
        super(HardwareModule, self).__init__()
        self._top_entity = None

        self.yang_name = "hardware-module"
        self.yang_parent_name = "Cisco-IOS-XR-ncs1k-mxp-cfg"

        self.node = YList(self)

    def __setattr__(self, name, value):
        self._check_monkey_patching_error(name, value)
        with _handle_type_error():
            if name in self.__dict__ and isinstance(self.__dict__[name],
                                                    YList):
                raise YPYModelError(
                    "Attempt to assign value of '{}' to YList ldata. "
                    "Please use list append or extend method.".format(value))
            if isinstance(value, Enum.YLeaf):
                value = value.name
            if name in () and name in self.__dict__:
                if isinstance(value, YLeaf):
                    self.__dict__[name].set(value.get())
                elif isinstance(value, YLeafList):
                    super(HardwareModule, self).__setattr__(name, value)
                else:
                    self.__dict__[name].set(value)
            else:
                if hasattr(value, "parent") and name != "parent":
                    if hasattr(value, "is_presence_container"
                               ) and value.is_presence_container:
                        value.parent = self
                    elif value.parent is None and value.yang_name in self._children_yang_names:
                        value.parent = self
                super(HardwareModule, self).__setattr__(name, value)

    class Node(Entity):
        """
        Node
        
        .. attribute:: location  <key>
        
        	Fully qualified line card specification
        	**type**\:  str
        
        	**pattern:** [\\w\\\-\\.\:,\_@#%$\\+=\\\|;]+
        
        .. attribute:: slice
        
        	Slice to be Provisioned
        	**type**\: list of    :py:class:`Slice <ydk.models.cisco_ios_xr.Cisco_IOS_XR_ncs1k_mxp_cfg.HardwareModule.Node.Slice>`
        
        

        """

        _prefix = 'ncs1k-mxp-cfg'
        _revision = '2015-11-09'

        def __init__(self):
            super(HardwareModule.Node, self).__init__()

            self.yang_name = "node"
            self.yang_parent_name = "hardware-module"

            self.location = YLeaf(YType.str, "location")

            self.slice = YList(self)

        def __setattr__(self, name, value):
            self._check_monkey_patching_error(name, value)
            with _handle_type_error():
                if name in self.__dict__ and isinstance(
                        self.__dict__[name], YList):
                    raise YPYModelError(
                        "Attempt to assign value of '{}' to YList ldata. "
                        "Please use list append or extend method.".format(
                            value))
                if isinstance(value, Enum.YLeaf):
                    value = value.name
                if name in ("location") and name in self.__dict__:
                    if isinstance(value, YLeaf):
                        self.__dict__[name].set(value.get())
                    elif isinstance(value, YLeafList):
                        super(HardwareModule.Node,
                              self).__setattr__(name, value)
                    else:
                        self.__dict__[name].set(value)
                else:
                    if hasattr(value, "parent") and name != "parent":
                        if hasattr(value, "is_presence_container"
                                   ) and value.is_presence_container:
                            value.parent = self
                        elif value.parent is None and value.yang_name in self._children_yang_names:
                            value.parent = self
                    super(HardwareModule.Node, self).__setattr__(name, value)

        class Slice(Entity):
            """
            Slice to be Provisioned
            
            .. attribute:: slice_id  <key>
            
            	Set Slice
            	**type**\:  str
            
            	**pattern:** [\\w\\\-\\.\:,\_@#%$\\+=\\\|;]+
            
            .. attribute:: lldp
            
            	Drop LLDP Packets
            	**type**\:  bool
            
            .. attribute:: values
            
            	Data rates & FEC
            	**type**\:   :py:class:`Values <ydk.models.cisco_ios_xr.Cisco_IOS_XR_ncs1k_mxp_cfg.HardwareModule.Node.Slice.Values>`
            
            

            """

            _prefix = 'ncs1k-mxp-cfg'
            _revision = '2015-11-09'

            def __init__(self):
                super(HardwareModule.Node.Slice, self).__init__()

                self.yang_name = "slice"
                self.yang_parent_name = "node"

                self.slice_id = YLeaf(YType.str, "slice-id")

                self.lldp = YLeaf(YType.boolean, "lldp")

                self.values = HardwareModule.Node.Slice.Values()
                self.values.parent = self
                self._children_name_map["values"] = "values"
                self._children_yang_names.add("values")

            def __setattr__(self, name, value):
                self._check_monkey_patching_error(name, value)
                with _handle_type_error():
                    if name in self.__dict__ and isinstance(
                            self.__dict__[name], YList):
                        raise YPYModelError(
                            "Attempt to assign value of '{}' to YList ldata. "
                            "Please use list append or extend method.".format(
                                value))
                    if isinstance(value, Enum.YLeaf):
                        value = value.name
                    if name in ("slice_id", "lldp") and name in self.__dict__:
                        if isinstance(value, YLeaf):
                            self.__dict__[name].set(value.get())
                        elif isinstance(value, YLeafList):
                            super(HardwareModule.Node.Slice,
                                  self).__setattr__(name, value)
                        else:
                            self.__dict__[name].set(value)
                    else:
                        if hasattr(value, "parent") and name != "parent":
                            if hasattr(value, "is_presence_container"
                                       ) and value.is_presence_container:
                                value.parent = self
                            elif value.parent is None and value.yang_name in self._children_yang_names:
                                value.parent = self
                        super(HardwareModule.Node.Slice,
                              self).__setattr__(name, value)

            class Values(Entity):
                """
                Data rates & FEC
                
                .. attribute:: client_rate
                
                	Client Rate
                	**type**\:   :py:class:`ClientDataRate <ydk.models.cisco_ios_xr.Cisco_IOS_XR_ncs1k_mxp_cfg.ClientDataRate>`
                
                .. attribute:: encrypted
                
                	Encrypted
                	**type**\:  bool
                
                	**default value**\: false
                
                .. attribute:: fec
                
                	FEC
                	**type**\:   :py:class:`Fec <ydk.models.cisco_ios_xr.Cisco_IOS_XR_ncs1k_mxp_cfg.Fec>`
                
                .. attribute:: trunk_rate
                
                	TrunkRate
                	**type**\:   :py:class:`TrunkDataRate <ydk.models.cisco_ios_xr.Cisco_IOS_XR_ncs1k_mxp_cfg.TrunkDataRate>`
                
                

                """

                _prefix = 'ncs1k-mxp-cfg'
                _revision = '2015-11-09'

                def __init__(self):
                    super(HardwareModule.Node.Slice.Values, self).__init__()

                    self.yang_name = "values"
                    self.yang_parent_name = "slice"

                    self.client_rate = YLeaf(YType.enumeration, "client-rate")

                    self.encrypted = YLeaf(YType.boolean, "encrypted")

                    self.fec = YLeaf(YType.enumeration, "fec")

                    self.trunk_rate = YLeaf(YType.enumeration, "trunk-rate")

                def __setattr__(self, name, value):
                    self._check_monkey_patching_error(name, value)
                    with _handle_type_error():
                        if name in self.__dict__ and isinstance(
                                self.__dict__[name], YList):
                            raise YPYModelError(
                                "Attempt to assign value of '{}' to YList ldata. "
                                "Please use list append or extend method.".
                                format(value))
                        if isinstance(value, Enum.YLeaf):
                            value = value.name
                        if name in ("client_rate", "encrypted", "fec",
                                    "trunk_rate") and name in self.__dict__:
                            if isinstance(value, YLeaf):
                                self.__dict__[name].set(value.get())
                            elif isinstance(value, YLeafList):
                                super(HardwareModule.Node.Slice.Values,
                                      self).__setattr__(name, value)
                            else:
                                self.__dict__[name].set(value)
                        else:
                            if hasattr(value, "parent") and name != "parent":
                                if hasattr(value, "is_presence_container"
                                           ) and value.is_presence_container:
                                    value.parent = self
                                elif value.parent is None and value.yang_name in self._children_yang_names:
                                    value.parent = self
                            super(HardwareModule.Node.Slice.Values,
                                  self).__setattr__(name, value)

                def has_data(self):
                    return (self.client_rate.is_set or self.encrypted.is_set
                            or self.fec.is_set or self.trunk_rate.is_set)

                def has_operation(self):
                    return (self.yfilter != YFilter.not_set
                            or self.client_rate.yfilter != YFilter.not_set
                            or self.encrypted.yfilter != YFilter.not_set
                            or self.fec.yfilter != YFilter.not_set
                            or self.trunk_rate.yfilter != YFilter.not_set)

                def get_segment_path(self):
                    path_buffer = ""
                    path_buffer = "values" + path_buffer

                    return path_buffer

                def get_entity_path(self, ancestor):
                    path_buffer = ""
                    if (ancestor is None):
                        raise YPYModelError(
                            "ancestor cannot be None as one of the ancestors is a list"
                        )
                    else:
                        path_buffer = _get_relative_entity_path(
                            self, ancestor, path_buffer)

                    leaf_name_data = LeafDataList()
                    if (self.client_rate.is_set
                            or self.client_rate.yfilter != YFilter.not_set):
                        leaf_name_data.append(
                            self.client_rate.get_name_leafdata())
                    if (self.encrypted.is_set
                            or self.encrypted.yfilter != YFilter.not_set):
                        leaf_name_data.append(
                            self.encrypted.get_name_leafdata())
                    if (self.fec.is_set
                            or self.fec.yfilter != YFilter.not_set):
                        leaf_name_data.append(self.fec.get_name_leafdata())
                    if (self.trunk_rate.is_set
                            or self.trunk_rate.yfilter != YFilter.not_set):
                        leaf_name_data.append(
                            self.trunk_rate.get_name_leafdata())

                    entity_path = EntityPath(path_buffer, leaf_name_data)
                    return entity_path

                def get_child_by_name(self, child_yang_name, segment_path):
                    child = self._get_child_by_seg_name(
                        [child_yang_name, segment_path])
                    if child is not None:
                        return child

                    return None

                def has_leaf_or_child_of_name(self, name):
                    if (name == "client-rate" or name == "encrypted"
                            or name == "fec" or name == "trunk-rate"):
                        return True
                    return False

                def set_value(self, value_path, value, name_space,
                              name_space_prefix):
                    if (value_path == "client-rate"):
                        self.client_rate = value
                        self.client_rate.value_namespace = name_space
                        self.client_rate.value_namespace_prefix = name_space_prefix
                    if (value_path == "encrypted"):
                        self.encrypted = value
                        self.encrypted.value_namespace = name_space
                        self.encrypted.value_namespace_prefix = name_space_prefix
                    if (value_path == "fec"):
                        self.fec = value
                        self.fec.value_namespace = name_space
                        self.fec.value_namespace_prefix = name_space_prefix
                    if (value_path == "trunk-rate"):
                        self.trunk_rate = value
                        self.trunk_rate.value_namespace = name_space
                        self.trunk_rate.value_namespace_prefix = name_space_prefix

            def has_data(self):
                return (self.slice_id.is_set or self.lldp.is_set or
                        (self.values is not None and self.values.has_data()))

            def has_operation(self):
                return (self.yfilter != YFilter.not_set
                        or self.slice_id.yfilter != YFilter.not_set
                        or self.lldp.yfilter != YFilter.not_set
                        or (self.values is not None
                            and self.values.has_operation()))

            def get_segment_path(self):
                path_buffer = ""
                path_buffer = "slice" + "[slice-id='" + self.slice_id.get(
                ) + "']" + path_buffer

                return path_buffer

            def get_entity_path(self, ancestor):
                path_buffer = ""
                if (ancestor is None):
                    raise YPYModelError(
                        "ancestor cannot be None as one of the ancestors is a list"
                    )
                else:
                    path_buffer = _get_relative_entity_path(
                        self, ancestor, path_buffer)

                leaf_name_data = LeafDataList()
                if (self.slice_id.is_set
                        or self.slice_id.yfilter != YFilter.not_set):
                    leaf_name_data.append(self.slice_id.get_name_leafdata())
                if (self.lldp.is_set or self.lldp.yfilter != YFilter.not_set):
                    leaf_name_data.append(self.lldp.get_name_leafdata())

                entity_path = EntityPath(path_buffer, leaf_name_data)
                return entity_path

            def get_child_by_name(self, child_yang_name, segment_path):
                child = self._get_child_by_seg_name(
                    [child_yang_name, segment_path])
                if child is not None:
                    return child

                if (child_yang_name == "values"):
                    if (self.values is None):
                        self.values = HardwareModule.Node.Slice.Values()
                        self.values.parent = self
                        self._children_name_map["values"] = "values"
                    return self.values

                return None

            def has_leaf_or_child_of_name(self, name):
                if (name == "values" or name == "slice-id" or name == "lldp"):
                    return True
                return False

            def set_value(self, value_path, value, name_space,
                          name_space_prefix):
                if (value_path == "slice-id"):
                    self.slice_id = value
                    self.slice_id.value_namespace = name_space
                    self.slice_id.value_namespace_prefix = name_space_prefix
                if (value_path == "lldp"):
                    self.lldp = value
                    self.lldp.value_namespace = name_space
                    self.lldp.value_namespace_prefix = name_space_prefix

        def has_data(self):
            for c in self.slice:
                if (c.has_data()):
                    return True
            return self.location.is_set

        def has_operation(self):
            for c in self.slice:
                if (c.has_operation()):
                    return True
            return (self.yfilter != YFilter.not_set
                    or self.location.yfilter != YFilter.not_set)

        def get_segment_path(self):
            path_buffer = ""
            path_buffer = "node" + "[location='" + self.location.get(
            ) + "']" + path_buffer

            return path_buffer

        def get_entity_path(self, ancestor):
            path_buffer = ""
            if (ancestor is None):
                path_buffer = "Cisco-IOS-XR-ncs1k-mxp-cfg:hardware-module/%s" % self.get_segment_path(
                )
            else:
                path_buffer = _get_relative_entity_path(
                    self, ancestor, path_buffer)

            leaf_name_data = LeafDataList()
            if (self.location.is_set
                    or self.location.yfilter != YFilter.not_set):
                leaf_name_data.append(self.location.get_name_leafdata())

            entity_path = EntityPath(path_buffer, leaf_name_data)
            return entity_path

        def get_child_by_name(self, child_yang_name, segment_path):
            child = self._get_child_by_seg_name(
                [child_yang_name, segment_path])
            if child is not None:
                return child

            if (child_yang_name == "slice"):
                for c in self.slice:
                    segment = c.get_segment_path()
                    if (segment_path == segment):
                        return c
                c = HardwareModule.Node.Slice()
                c.parent = self
                local_reference_key = "ydk::seg::%s" % segment_path
                self._local_refs[local_reference_key] = c
                self.slice.append(c)
                return c

            return None

        def has_leaf_or_child_of_name(self, name):
            if (name == "slice" or name == "location"):
                return True
            return False

        def set_value(self, value_path, value, name_space, name_space_prefix):
            if (value_path == "location"):
                self.location = value
                self.location.value_namespace = name_space
                self.location.value_namespace_prefix = name_space_prefix

    def has_data(self):
        for c in self.node:
            if (c.has_data()):
                return True
        return False

    def has_operation(self):
        for c in self.node:
            if (c.has_operation()):
                return True
        return self.yfilter != YFilter.not_set

    def get_segment_path(self):
        path_buffer = ""
        path_buffer = "Cisco-IOS-XR-ncs1k-mxp-cfg:hardware-module" + path_buffer

        return path_buffer

    def get_entity_path(self, ancestor):
        path_buffer = ""
        if (not ancestor is None):
            raise YPYModelError("ancestor has to be None for top-level node")

        path_buffer = self.get_segment_path()
        leaf_name_data = LeafDataList()

        entity_path = EntityPath(path_buffer, leaf_name_data)
        return entity_path

    def get_child_by_name(self, child_yang_name, segment_path):
        child = self._get_child_by_seg_name([child_yang_name, segment_path])
        if child is not None:
            return child

        if (child_yang_name == "node"):
            for c in self.node:
                segment = c.get_segment_path()
                if (segment_path == segment):
                    return c
            c = HardwareModule.Node()
            c.parent = self
            local_reference_key = "ydk::seg::%s" % segment_path
            self._local_refs[local_reference_key] = c
            self.node.append(c)
            return c

        return None

    def has_leaf_or_child_of_name(self, name):
        if (name == "node"):
            return True
        return False

    def set_value(self, value_path, value, name_space, name_space_prefix):
        pass

    def clone_ptr(self):
        self._top_entity = HardwareModule()
        return self._top_entity
Пример #9
0
    class Vrfs(Entity):
        """
        VRFs for the virtual IPv6 addresses
        
        .. attribute:: vrf
        
        	A VRF for a virtual IPv6 address.  Specify 'default' for VRF default
        	**type**\: list of    :py:class:`Vrf <ydk.models.cisco_ios_xr.Cisco_IOS_XR_ipv6_smiap_cfg.Ipv6Virtual.Vrfs.Vrf>`
        
        

        """

        _prefix = 'ipv6-smiap-cfg'
        _revision = '2016-07-04'

        def __init__(self):
            super(Ipv6Virtual.Vrfs, self).__init__()

            self.yang_name = "vrfs"
            self.yang_parent_name = "ipv6-virtual"

            self.vrf = YList(self)

        def __setattr__(self, name, value):
            self._check_monkey_patching_error(name, value)
            with _handle_type_error():
                if name in self.__dict__ and isinstance(self.__dict__[name], YList):
                    raise YPYModelError("Attempt to assign value of '{}' to YList ldata. "
                                        "Please use list append or extend method."
                                        .format(value))
                if isinstance(value, Enum.YLeaf):
                    value = value.name
                if name in () and name in self.__dict__:
                    if isinstance(value, YLeaf):
                        self.__dict__[name].set(value.get())
                    elif isinstance(value, YLeafList):
                        super(Ipv6Virtual.Vrfs, self).__setattr__(name, value)
                    else:
                        self.__dict__[name].set(value)
                else:
                    if hasattr(value, "parent") and name != "parent":
                        if hasattr(value, "is_presence_container") and value.is_presence_container:
                            value.parent = self
                        elif value.parent is None and value.yang_name in self._children_yang_names:
                            value.parent = self
                    super(Ipv6Virtual.Vrfs, self).__setattr__(name, value)


        class Vrf(Entity):
            """
            A VRF for a virtual IPv6 address.  Specify
            'default' for VRF default
            
            .. attribute:: vrf_name  <key>
            
            	Name of VRF
            	**type**\:  str
            
            	**pattern:** [\\w\\\-\\.\:,\_@#%$\\+=\\\|;]+
            
            .. attribute:: address
            
            	IPv6 address and mask
            	**type**\:   :py:class:`Address <ydk.models.cisco_ios_xr.Cisco_IOS_XR_ipv6_smiap_cfg.Ipv6Virtual.Vrfs.Vrf.Address>`
            
            	**presence node**\: True
            
            

            """

            _prefix = 'ipv6-smiap-cfg'
            _revision = '2016-07-04'

            def __init__(self):
                super(Ipv6Virtual.Vrfs.Vrf, self).__init__()

                self.yang_name = "vrf"
                self.yang_parent_name = "vrfs"

                self.vrf_name = YLeaf(YType.str, "vrf-name")

                self.address = None
                self._children_name_map["address"] = "address"
                self._children_yang_names.add("address")

            def __setattr__(self, name, value):
                self._check_monkey_patching_error(name, value)
                with _handle_type_error():
                    if name in self.__dict__ and isinstance(self.__dict__[name], YList):
                        raise YPYModelError("Attempt to assign value of '{}' to YList ldata. "
                                            "Please use list append or extend method."
                                            .format(value))
                    if isinstance(value, Enum.YLeaf):
                        value = value.name
                    if name in ("vrf_name") and name in self.__dict__:
                        if isinstance(value, YLeaf):
                            self.__dict__[name].set(value.get())
                        elif isinstance(value, YLeafList):
                            super(Ipv6Virtual.Vrfs.Vrf, self).__setattr__(name, value)
                        else:
                            self.__dict__[name].set(value)
                    else:
                        if hasattr(value, "parent") and name != "parent":
                            if hasattr(value, "is_presence_container") and value.is_presence_container:
                                value.parent = self
                            elif value.parent is None and value.yang_name in self._children_yang_names:
                                value.parent = self
                        super(Ipv6Virtual.Vrfs.Vrf, self).__setattr__(name, value)


            class Address(Entity):
                """
                IPv6 address and mask
                
                .. attribute:: address
                
                	IPv6 address
                	**type**\:  str
                
                	**pattern:** ((\:\|[0\-9a\-fA\-F]{0,4})\:)([0\-9a\-fA\-F]{0,4}\:){0,5}((([0\-9a\-fA\-F]{0,4}\:)?(\:\|[0\-9a\-fA\-F]{0,4}))\|(((25[0\-5]\|2[0\-4][0\-9]\|[01]?[0\-9]?[0\-9])\\.){3}(25[0\-5]\|2[0\-4][0\-9]\|[01]?[0\-9]?[0\-9])))(%[\\p{N}\\p{L}]+)?
                
                	**mandatory**\: True
                
                .. attribute:: prefix_length
                
                	IPv6 address prefix length
                	**type**\:  int
                
                	**range:** 0..128
                
                	**mandatory**\: True
                
                

                This class is a :ref:`presence class<presence-class>`

                """

                _prefix = 'ipv6-smiap-cfg'
                _revision = '2016-07-04'

                def __init__(self):
                    super(Ipv6Virtual.Vrfs.Vrf.Address, self).__init__()

                    self.yang_name = "address"
                    self.yang_parent_name = "vrf"
                    self.is_presence_container = True

                    self.address = YLeaf(YType.str, "address")

                    self.prefix_length = YLeaf(YType.uint8, "prefix-length")

                def __setattr__(self, name, value):
                    self._check_monkey_patching_error(name, value)
                    with _handle_type_error():
                        if name in self.__dict__ and isinstance(self.__dict__[name], YList):
                            raise YPYModelError("Attempt to assign value of '{}' to YList ldata. "
                                                "Please use list append or extend method."
                                                .format(value))
                        if isinstance(value, Enum.YLeaf):
                            value = value.name
                        if name in ("address",
                                    "prefix_length") and name in self.__dict__:
                            if isinstance(value, YLeaf):
                                self.__dict__[name].set(value.get())
                            elif isinstance(value, YLeafList):
                                super(Ipv6Virtual.Vrfs.Vrf.Address, self).__setattr__(name, value)
                            else:
                                self.__dict__[name].set(value)
                        else:
                            if hasattr(value, "parent") and name != "parent":
                                if hasattr(value, "is_presence_container") and value.is_presence_container:
                                    value.parent = self
                                elif value.parent is None and value.yang_name in self._children_yang_names:
                                    value.parent = self
                            super(Ipv6Virtual.Vrfs.Vrf.Address, self).__setattr__(name, value)

                def has_data(self):
                    return (
                        self.address.is_set or
                        self.prefix_length.is_set)

                def has_operation(self):
                    return (
                        self.yfilter != YFilter.not_set or
                        self.address.yfilter != YFilter.not_set or
                        self.prefix_length.yfilter != YFilter.not_set)

                def get_segment_path(self):
                    path_buffer = ""
                    path_buffer = "address" + path_buffer

                    return path_buffer

                def get_entity_path(self, ancestor):
                    path_buffer = ""
                    if (ancestor is None):
                        raise YPYModelError("ancestor cannot be None as one of the ancestors is a list")
                    else:
                        path_buffer = _get_relative_entity_path(self, ancestor, path_buffer)

                    leaf_name_data = LeafDataList()
                    if (self.address.is_set or self.address.yfilter != YFilter.not_set):
                        leaf_name_data.append(self.address.get_name_leafdata())
                    if (self.prefix_length.is_set or self.prefix_length.yfilter != YFilter.not_set):
                        leaf_name_data.append(self.prefix_length.get_name_leafdata())

                    entity_path = EntityPath(path_buffer, leaf_name_data)
                    return entity_path

                def get_child_by_name(self, child_yang_name, segment_path):
                    child = self._get_child_by_seg_name([child_yang_name, segment_path])
                    if child is not None:
                        return child

                    return None

                def has_leaf_or_child_of_name(self, name):
                    if(name == "address" or name == "prefix-length"):
                        return True
                    return False

                def set_value(self, value_path, value, name_space, name_space_prefix):
                    if(value_path == "address"):
                        self.address = value
                        self.address.value_namespace = name_space
                        self.address.value_namespace_prefix = name_space_prefix
                    if(value_path == "prefix-length"):
                        self.prefix_length = value
                        self.prefix_length.value_namespace = name_space
                        self.prefix_length.value_namespace_prefix = name_space_prefix

            def has_data(self):
                return (
                    self.vrf_name.is_set or
                    (self.address is not None))

            def has_operation(self):
                return (
                    self.yfilter != YFilter.not_set or
                    self.vrf_name.yfilter != YFilter.not_set or
                    (self.address is not None and self.address.has_operation()))

            def get_segment_path(self):
                path_buffer = ""
                path_buffer = "vrf" + "[vrf-name='" + self.vrf_name.get() + "']" + path_buffer

                return path_buffer

            def get_entity_path(self, ancestor):
                path_buffer = ""
                if (ancestor is None):
                    path_buffer = "Cisco-IOS-XR-ipv6-smiap-cfg:ipv6-virtual/vrfs/%s" % self.get_segment_path()
                else:
                    path_buffer = _get_relative_entity_path(self, ancestor, path_buffer)

                leaf_name_data = LeafDataList()
                if (self.vrf_name.is_set or self.vrf_name.yfilter != YFilter.not_set):
                    leaf_name_data.append(self.vrf_name.get_name_leafdata())

                entity_path = EntityPath(path_buffer, leaf_name_data)
                return entity_path

            def get_child_by_name(self, child_yang_name, segment_path):
                child = self._get_child_by_seg_name([child_yang_name, segment_path])
                if child is not None:
                    return child

                if (child_yang_name == "address"):
                    if (self.address is None):
                        self.address = Ipv6Virtual.Vrfs.Vrf.Address()
                        self.address.parent = self
                        self._children_name_map["address"] = "address"
                    return self.address

                return None

            def has_leaf_or_child_of_name(self, name):
                if(name == "address" or name == "vrf-name"):
                    return True
                return False

            def set_value(self, value_path, value, name_space, name_space_prefix):
                if(value_path == "vrf-name"):
                    self.vrf_name = value
                    self.vrf_name.value_namespace = name_space
                    self.vrf_name.value_namespace_prefix = name_space_prefix

        def has_data(self):
            for c in self.vrf:
                if (c.has_data()):
                    return True
            return False

        def has_operation(self):
            for c in self.vrf:
                if (c.has_operation()):
                    return True
            return self.yfilter != YFilter.not_set

        def get_segment_path(self):
            path_buffer = ""
            path_buffer = "vrfs" + path_buffer

            return path_buffer

        def get_entity_path(self, ancestor):
            path_buffer = ""
            if (ancestor is None):
                path_buffer = "Cisco-IOS-XR-ipv6-smiap-cfg:ipv6-virtual/%s" % self.get_segment_path()
            else:
                path_buffer = _get_relative_entity_path(self, ancestor, path_buffer)

            leaf_name_data = LeafDataList()

            entity_path = EntityPath(path_buffer, leaf_name_data)
            return entity_path

        def get_child_by_name(self, child_yang_name, segment_path):
            child = self._get_child_by_seg_name([child_yang_name, segment_path])
            if child is not None:
                return child

            if (child_yang_name == "vrf"):
                for c in self.vrf:
                    segment = c.get_segment_path()
                    if (segment_path == segment):
                        return c
                c = Ipv6Virtual.Vrfs.Vrf()
                c.parent = self
                local_reference_key = "ydk::seg::%s" % segment_path
                self._local_refs[local_reference_key] = c
                self.vrf.append(c)
                return c

            return None

        def has_leaf_or_child_of_name(self, name):
            if(name == "vrf"):
                return True
            return False

        def set_value(self, value_path, value, name_space, name_space_prefix):
            pass
Пример #10
0
    class Policies(Entity):
        """
        Register an event manager policy
        
        .. attribute:: policy
        
        	Name of the policy file
        	**type**\: list of    :py:class:`Policy <ydk.models.cisco_ios_xr.Cisco_IOS_XR_ha_eem_cfg.EventManager.Policies.Policy>`
        
        

        """

        _prefix = 'ha-eem-cfg'
        _revision = '2015-07-30'

        def __init__(self):
            super(EventManager.Policies, self).__init__()

            self.yang_name = "policies"
            self.yang_parent_name = "event-manager"

            self.policy = YList(self)

        def __setattr__(self, name, value):
            self._check_monkey_patching_error(name, value)
            with _handle_type_error():
                if name in self.__dict__ and isinstance(
                        self.__dict__[name], YList):
                    raise YPYModelError(
                        "Attempt to assign value of '{}' to YList ldata. "
                        "Please use list append or extend method.".format(
                            value))
                if isinstance(value, Enum.YLeaf):
                    value = value.name
                if name in () and name in self.__dict__:
                    if isinstance(value, YLeaf):
                        self.__dict__[name].set(value.get())
                    elif isinstance(value, YLeafList):
                        super(EventManager.Policies,
                              self).__setattr__(name, value)
                    else:
                        self.__dict__[name].set(value)
                else:
                    if hasattr(value, "parent") and name != "parent":
                        if hasattr(value, "is_presence_container"
                                   ) and value.is_presence_container:
                            value.parent = self
                        elif value.parent is None and value.yang_name in self._children_yang_names:
                            value.parent = self
                    super(EventManager.Policies, self).__setattr__(name, value)

        class Policy(Entity):
            """
            Name of the policy file
            
            .. attribute:: policy_name  <key>
            
            	Name of the policy file
            	**type**\:  str
            
            	**pattern:** [\\w\\\-\\.\:,\_@#%$\\+=\\\|;]+
            
            .. attribute:: check_sum_value
            
            	CheckSum Value
            	**type**\:  str
            
            .. attribute:: checksum_type
            
            	Specify Embedded Event Manager policy checksum
            	**type**\:   :py:class:`EventManagerChecksum <ydk.models.cisco_ios_xr.Cisco_IOS_XR_ha_eem_cfg.EventManagerChecksum>`
            
            .. attribute:: persist_time
            
            	Time of validity (in seconds) for cached AAA taskmap of username (default is 3600)
            	**type**\:  int
            
            	**range:** 0..4294967295
            
            	**mandatory**\: True
            
            	**units**\: second
            
            .. attribute:: policy_security_level
            
            	Event Manager policy security Level
            	**type**\:   :py:class:`EventManagerPolicySec <ydk.models.cisco_ios_xr.Cisco_IOS_XR_ha_eem_cfg.EventManagerPolicySec>`
            
            .. attribute:: policy_security_mode
            
            	Specify Embedded Event Manager policy security mode
            	**type**\:   :py:class:`EventManagerPolicyMode <ydk.models.cisco_ios_xr.Cisco_IOS_XR_ha_eem_cfg.EventManagerPolicyMode>`
            
            .. attribute:: policy_type
            
            	Event manager type of this policy
            	**type**\:   :py:class:`EventManagerPolicy <ydk.models.cisco_ios_xr.Cisco_IOS_XR_ha_eem_cfg.EventManagerPolicy>`
            
            .. attribute:: username
            
            	A configured username
            	**type**\:  str
            
            	**mandatory**\: True
            
            

            """

            _prefix = 'ha-eem-cfg'
            _revision = '2015-07-30'

            def __init__(self):
                super(EventManager.Policies.Policy, self).__init__()

                self.yang_name = "policy"
                self.yang_parent_name = "policies"

                self.policy_name = YLeaf(YType.str, "policy-name")

                self.check_sum_value = YLeaf(YType.str, "check-sum-value")

                self.checksum_type = YLeaf(YType.enumeration, "checksum-type")

                self.persist_time = YLeaf(YType.uint32, "persist-time")

                self.policy_security_level = YLeaf(YType.enumeration,
                                                   "policy-security-level")

                self.policy_security_mode = YLeaf(YType.enumeration,
                                                  "policy-security-mode")

                self.policy_type = YLeaf(YType.enumeration, "policy-type")

                self.username = YLeaf(YType.str, "username")

            def __setattr__(self, name, value):
                self._check_monkey_patching_error(name, value)
                with _handle_type_error():
                    if name in self.__dict__ and isinstance(
                            self.__dict__[name], YList):
                        raise YPYModelError(
                            "Attempt to assign value of '{}' to YList ldata. "
                            "Please use list append or extend method.".format(
                                value))
                    if isinstance(value, Enum.YLeaf):
                        value = value.name
                    if name in ("policy_name", "check_sum_value",
                                "checksum_type", "persist_time",
                                "policy_security_level",
                                "policy_security_mode", "policy_type",
                                "username") and name in self.__dict__:
                        if isinstance(value, YLeaf):
                            self.__dict__[name].set(value.get())
                        elif isinstance(value, YLeafList):
                            super(EventManager.Policies.Policy,
                                  self).__setattr__(name, value)
                        else:
                            self.__dict__[name].set(value)
                    else:
                        if hasattr(value, "parent") and name != "parent":
                            if hasattr(value, "is_presence_container"
                                       ) and value.is_presence_container:
                                value.parent = self
                            elif value.parent is None and value.yang_name in self._children_yang_names:
                                value.parent = self
                        super(EventManager.Policies.Policy,
                              self).__setattr__(name, value)

            def has_data(self):
                return (self.policy_name.is_set or self.check_sum_value.is_set
                        or self.checksum_type.is_set
                        or self.persist_time.is_set
                        or self.policy_security_level.is_set
                        or self.policy_security_mode.is_set
                        or self.policy_type.is_set or self.username.is_set)

            def has_operation(self):
                return (self.yfilter != YFilter.not_set
                        or self.policy_name.yfilter != YFilter.not_set
                        or self.check_sum_value.yfilter != YFilter.not_set
                        or self.checksum_type.yfilter != YFilter.not_set
                        or self.persist_time.yfilter != YFilter.not_set or
                        self.policy_security_level.yfilter != YFilter.not_set
                        or self.policy_security_mode.yfilter != YFilter.not_set
                        or self.policy_type.yfilter != YFilter.not_set
                        or self.username.yfilter != YFilter.not_set)

            def get_segment_path(self):
                path_buffer = ""
                path_buffer = "policy" + "[policy-name='" + self.policy_name.get(
                ) + "']" + path_buffer

                return path_buffer

            def get_entity_path(self, ancestor):
                path_buffer = ""
                if (ancestor is None):
                    path_buffer = "Cisco-IOS-XR-ha-eem-cfg:event-manager/policies/%s" % self.get_segment_path(
                    )
                else:
                    path_buffer = _get_relative_entity_path(
                        self, ancestor, path_buffer)

                leaf_name_data = LeafDataList()
                if (self.policy_name.is_set
                        or self.policy_name.yfilter != YFilter.not_set):
                    leaf_name_data.append(self.policy_name.get_name_leafdata())
                if (self.check_sum_value.is_set
                        or self.check_sum_value.yfilter != YFilter.not_set):
                    leaf_name_data.append(
                        self.check_sum_value.get_name_leafdata())
                if (self.checksum_type.is_set
                        or self.checksum_type.yfilter != YFilter.not_set):
                    leaf_name_data.append(
                        self.checksum_type.get_name_leafdata())
                if (self.persist_time.is_set
                        or self.persist_time.yfilter != YFilter.not_set):
                    leaf_name_data.append(
                        self.persist_time.get_name_leafdata())
                if (self.policy_security_level.is_set or
                        self.policy_security_level.yfilter != YFilter.not_set):
                    leaf_name_data.append(
                        self.policy_security_level.get_name_leafdata())
                if (self.policy_security_mode.is_set or
                        self.policy_security_mode.yfilter != YFilter.not_set):
                    leaf_name_data.append(
                        self.policy_security_mode.get_name_leafdata())
                if (self.policy_type.is_set
                        or self.policy_type.yfilter != YFilter.not_set):
                    leaf_name_data.append(self.policy_type.get_name_leafdata())
                if (self.username.is_set
                        or self.username.yfilter != YFilter.not_set):
                    leaf_name_data.append(self.username.get_name_leafdata())

                entity_path = EntityPath(path_buffer, leaf_name_data)
                return entity_path

            def get_child_by_name(self, child_yang_name, segment_path):
                child = self._get_child_by_seg_name(
                    [child_yang_name, segment_path])
                if child is not None:
                    return child

                return None

            def has_leaf_or_child_of_name(self, name):
                if (name == "policy-name" or name == "check-sum-value"
                        or name == "checksum-type" or name == "persist-time"
                        or name == "policy-security-level"
                        or name == "policy-security-mode"
                        or name == "policy-type" or name == "username"):
                    return True
                return False

            def set_value(self, value_path, value, name_space,
                          name_space_prefix):
                if (value_path == "policy-name"):
                    self.policy_name = value
                    self.policy_name.value_namespace = name_space
                    self.policy_name.value_namespace_prefix = name_space_prefix
                if (value_path == "check-sum-value"):
                    self.check_sum_value = value
                    self.check_sum_value.value_namespace = name_space
                    self.check_sum_value.value_namespace_prefix = name_space_prefix
                if (value_path == "checksum-type"):
                    self.checksum_type = value
                    self.checksum_type.value_namespace = name_space
                    self.checksum_type.value_namespace_prefix = name_space_prefix
                if (value_path == "persist-time"):
                    self.persist_time = value
                    self.persist_time.value_namespace = name_space
                    self.persist_time.value_namespace_prefix = name_space_prefix
                if (value_path == "policy-security-level"):
                    self.policy_security_level = value
                    self.policy_security_level.value_namespace = name_space
                    self.policy_security_level.value_namespace_prefix = name_space_prefix
                if (value_path == "policy-security-mode"):
                    self.policy_security_mode = value
                    self.policy_security_mode.value_namespace = name_space
                    self.policy_security_mode.value_namespace_prefix = name_space_prefix
                if (value_path == "policy-type"):
                    self.policy_type = value
                    self.policy_type.value_namespace = name_space
                    self.policy_type.value_namespace_prefix = name_space_prefix
                if (value_path == "username"):
                    self.username = value
                    self.username.value_namespace = name_space
                    self.username.value_namespace_prefix = name_space_prefix

        def has_data(self):
            for c in self.policy:
                if (c.has_data()):
                    return True
            return False

        def has_operation(self):
            for c in self.policy:
                if (c.has_operation()):
                    return True
            return self.yfilter != YFilter.not_set

        def get_segment_path(self):
            path_buffer = ""
            path_buffer = "policies" + path_buffer

            return path_buffer

        def get_entity_path(self, ancestor):
            path_buffer = ""
            if (ancestor is None):
                path_buffer = "Cisco-IOS-XR-ha-eem-cfg:event-manager/%s" % self.get_segment_path(
                )
            else:
                path_buffer = _get_relative_entity_path(
                    self, ancestor, path_buffer)

            leaf_name_data = LeafDataList()

            entity_path = EntityPath(path_buffer, leaf_name_data)
            return entity_path

        def get_child_by_name(self, child_yang_name, segment_path):
            child = self._get_child_by_seg_name(
                [child_yang_name, segment_path])
            if child is not None:
                return child

            if (child_yang_name == "policy"):
                for c in self.policy:
                    segment = c.get_segment_path()
                    if (segment_path == segment):
                        return c
                c = EventManager.Policies.Policy()
                c.parent = self
                local_reference_key = "ydk::seg::%s" % segment_path
                self._local_refs[local_reference_key] = c
                self.policy.append(c)
                return c

            return None

        def has_leaf_or_child_of_name(self, name):
            if (name == "policy"):
                return True
            return False

        def set_value(self, value_path, value, name_space, name_space_prefix):
            pass
Пример #11
0
    class Environments(Entity):
        """
        Set an event manager global variable for event
        manager policies
        
        .. attribute:: environment
        
        	Name of the global variable
        	**type**\: list of    :py:class:`Environment <ydk.models.cisco_ios_xr.Cisco_IOS_XR_ha_eem_cfg.EventManager.Environments.Environment>`
        
        

        """

        _prefix = 'ha-eem-cfg'
        _revision = '2015-07-30'

        def __init__(self):
            super(EventManager.Environments, self).__init__()

            self.yang_name = "environments"
            self.yang_parent_name = "event-manager"

            self.environment = YList(self)

        def __setattr__(self, name, value):
            self._check_monkey_patching_error(name, value)
            with _handle_type_error():
                if name in self.__dict__ and isinstance(
                        self.__dict__[name], YList):
                    raise YPYModelError(
                        "Attempt to assign value of '{}' to YList ldata. "
                        "Please use list append or extend method.".format(
                            value))
                if isinstance(value, Enum.YLeaf):
                    value = value.name
                if name in () and name in self.__dict__:
                    if isinstance(value, YLeaf):
                        self.__dict__[name].set(value.get())
                    elif isinstance(value, YLeafList):
                        super(EventManager.Environments,
                              self).__setattr__(name, value)
                    else:
                        self.__dict__[name].set(value)
                else:
                    if hasattr(value, "parent") and name != "parent":
                        if hasattr(value, "is_presence_container"
                                   ) and value.is_presence_container:
                            value.parent = self
                        elif value.parent is None and value.yang_name in self._children_yang_names:
                            value.parent = self
                    super(EventManager.Environments,
                          self).__setattr__(name, value)

        class Environment(Entity):
            """
            Name of the global variable
            
            .. attribute:: environment_name  <key>
            
            	Name of the global variable
            	**type**\:  str
            
            	**pattern:** [\\w\\\-\\.\:,\_@#%$\\+=\\\|;]+
            
            .. attribute:: environment_value
            
            	Value of the global variable
            	**type**\:  str
            
            	**mandatory**\: True
            
            

            """

            _prefix = 'ha-eem-cfg'
            _revision = '2015-07-30'

            def __init__(self):
                super(EventManager.Environments.Environment, self).__init__()

                self.yang_name = "environment"
                self.yang_parent_name = "environments"

                self.environment_name = YLeaf(YType.str, "environment-name")

                self.environment_value = YLeaf(YType.str, "environment-value")

            def __setattr__(self, name, value):
                self._check_monkey_patching_error(name, value)
                with _handle_type_error():
                    if name in self.__dict__ and isinstance(
                            self.__dict__[name], YList):
                        raise YPYModelError(
                            "Attempt to assign value of '{}' to YList ldata. "
                            "Please use list append or extend method.".format(
                                value))
                    if isinstance(value, Enum.YLeaf):
                        value = value.name
                    if name in ("environment_name",
                                "environment_value") and name in self.__dict__:
                        if isinstance(value, YLeaf):
                            self.__dict__[name].set(value.get())
                        elif isinstance(value, YLeafList):
                            super(EventManager.Environments.Environment,
                                  self).__setattr__(name, value)
                        else:
                            self.__dict__[name].set(value)
                    else:
                        if hasattr(value, "parent") and name != "parent":
                            if hasattr(value, "is_presence_container"
                                       ) and value.is_presence_container:
                                value.parent = self
                            elif value.parent is None and value.yang_name in self._children_yang_names:
                                value.parent = self
                        super(EventManager.Environments.Environment,
                              self).__setattr__(name, value)

            def has_data(self):
                return (self.environment_name.is_set
                        or self.environment_value.is_set)

            def has_operation(self):
                return (self.yfilter != YFilter.not_set
                        or self.environment_name.yfilter != YFilter.not_set
                        or self.environment_value.yfilter != YFilter.not_set)

            def get_segment_path(self):
                path_buffer = ""
                path_buffer = "environment" + "[environment-name='" + self.environment_name.get(
                ) + "']" + path_buffer

                return path_buffer

            def get_entity_path(self, ancestor):
                path_buffer = ""
                if (ancestor is None):
                    path_buffer = "Cisco-IOS-XR-ha-eem-cfg:event-manager/environments/%s" % self.get_segment_path(
                    )
                else:
                    path_buffer = _get_relative_entity_path(
                        self, ancestor, path_buffer)

                leaf_name_data = LeafDataList()
                if (self.environment_name.is_set
                        or self.environment_name.yfilter != YFilter.not_set):
                    leaf_name_data.append(
                        self.environment_name.get_name_leafdata())
                if (self.environment_value.is_set
                        or self.environment_value.yfilter != YFilter.not_set):
                    leaf_name_data.append(
                        self.environment_value.get_name_leafdata())

                entity_path = EntityPath(path_buffer, leaf_name_data)
                return entity_path

            def get_child_by_name(self, child_yang_name, segment_path):
                child = self._get_child_by_seg_name(
                    [child_yang_name, segment_path])
                if child is not None:
                    return child

                return None

            def has_leaf_or_child_of_name(self, name):
                if (name == "environment-name" or name == "environment-value"):
                    return True
                return False

            def set_value(self, value_path, value, name_space,
                          name_space_prefix):
                if (value_path == "environment-name"):
                    self.environment_name = value
                    self.environment_name.value_namespace = name_space
                    self.environment_name.value_namespace_prefix = name_space_prefix
                if (value_path == "environment-value"):
                    self.environment_value = value
                    self.environment_value.value_namespace = name_space
                    self.environment_value.value_namespace_prefix = name_space_prefix

        def has_data(self):
            for c in self.environment:
                if (c.has_data()):
                    return True
            return False

        def has_operation(self):
            for c in self.environment:
                if (c.has_operation()):
                    return True
            return self.yfilter != YFilter.not_set

        def get_segment_path(self):
            path_buffer = ""
            path_buffer = "environments" + path_buffer

            return path_buffer

        def get_entity_path(self, ancestor):
            path_buffer = ""
            if (ancestor is None):
                path_buffer = "Cisco-IOS-XR-ha-eem-cfg:event-manager/%s" % self.get_segment_path(
                )
            else:
                path_buffer = _get_relative_entity_path(
                    self, ancestor, path_buffer)

            leaf_name_data = LeafDataList()

            entity_path = EntityPath(path_buffer, leaf_name_data)
            return entity_path

        def get_child_by_name(self, child_yang_name, segment_path):
            child = self._get_child_by_seg_name(
                [child_yang_name, segment_path])
            if child is not None:
                return child

            if (child_yang_name == "environment"):
                for c in self.environment:
                    segment = c.get_segment_path()
                    if (segment_path == segment):
                        return c
                c = EventManager.Environments.Environment()
                c.parent = self
                local_reference_key = "ydk::seg::%s" % segment_path
                self._local_refs[local_reference_key] = c
                self.environment.append(c)
                return c

            return None

        def has_leaf_or_child_of_name(self, name):
            if (name == "environment"):
                return True
            return False

        def set_value(self, value_path, value, name_space, name_space_prefix):
            pass
    class VrfNames(Entity):
        """
        VRF container
        
        .. attribute:: vrf_name
        
        	VRF name
        	**type**\: list of    :py:class:`VrfName <ydk.models.cisco_ios_xr.Cisco_IOS_XR_kim_tpa_cfg.Tpa.VrfNames.VrfName>`
        
        

        """

        _prefix = 'kim-tpa-cfg'
        _revision = '2015-11-09'

        def __init__(self):
            super(Tpa.VrfNames, self).__init__()

            self.yang_name = "vrf-names"
            self.yang_parent_name = "tpa"

            self.vrf_name = YList(self)

        def __setattr__(self, name, value):
            self._check_monkey_patching_error(name, value)
            with _handle_type_error():
                if name in self.__dict__ and isinstance(
                        self.__dict__[name], YList):
                    raise YPYModelError(
                        "Attempt to assign value of '{}' to YList ldata. "
                        "Please use list append or extend method.".format(
                            value))
                if isinstance(value, Enum.YLeaf):
                    value = value.name
                if name in () and name in self.__dict__:
                    if isinstance(value, YLeaf):
                        self.__dict__[name].set(value.get())
                    elif isinstance(value, YLeafList):
                        super(Tpa.VrfNames, self).__setattr__(name, value)
                    else:
                        self.__dict__[name].set(value)
                else:
                    if hasattr(value, "parent") and name != "parent":
                        if hasattr(value, "is_presence_container"
                                   ) and value.is_presence_container:
                            value.parent = self
                        elif value.parent is None and value.yang_name in self._children_yang_names:
                            value.parent = self
                    super(Tpa.VrfNames, self).__setattr__(name, value)

        class VrfName(Entity):
            """
            VRF name
            
            .. attribute:: vrf_name  <key>
            
            	VRF name
            	**type**\:  str
            
            	**length:** 1..32
            
            .. attribute:: address_family
            
            	Address family
            	**type**\:   :py:class:`AddressFamily <ydk.models.cisco_ios_xr.Cisco_IOS_XR_kim_tpa_cfg.Tpa.VrfNames.VrfName.AddressFamily>`
            
            .. attribute:: east_west_names
            
            	EastWest container
            	**type**\:   :py:class:`EastWestNames <ydk.models.cisco_ios_xr.Cisco_IOS_XR_kim_tpa_cfg.Tpa.VrfNames.VrfName.EastWestNames>`
            
            

            """

            _prefix = 'kim-tpa-cfg'
            _revision = '2015-11-09'

            def __init__(self):
                super(Tpa.VrfNames.VrfName, self).__init__()

                self.yang_name = "vrf-name"
                self.yang_parent_name = "vrf-names"

                self.vrf_name = YLeaf(YType.str, "vrf-name")

                self.address_family = Tpa.VrfNames.VrfName.AddressFamily()
                self.address_family.parent = self
                self._children_name_map["address_family"] = "address-family"
                self._children_yang_names.add("address-family")

                self.east_west_names = Tpa.VrfNames.VrfName.EastWestNames()
                self.east_west_names.parent = self
                self._children_name_map["east_west_names"] = "east-west-names"
                self._children_yang_names.add("east-west-names")

            def __setattr__(self, name, value):
                self._check_monkey_patching_error(name, value)
                with _handle_type_error():
                    if name in self.__dict__ and isinstance(
                            self.__dict__[name], YList):
                        raise YPYModelError(
                            "Attempt to assign value of '{}' to YList ldata. "
                            "Please use list append or extend method.".format(
                                value))
                    if isinstance(value, Enum.YLeaf):
                        value = value.name
                    if name in ("vrf_name") and name in self.__dict__:
                        if isinstance(value, YLeaf):
                            self.__dict__[name].set(value.get())
                        elif isinstance(value, YLeafList):
                            super(Tpa.VrfNames.VrfName,
                                  self).__setattr__(name, value)
                        else:
                            self.__dict__[name].set(value)
                    else:
                        if hasattr(value, "parent") and name != "parent":
                            if hasattr(value, "is_presence_container"
                                       ) and value.is_presence_container:
                                value.parent = self
                            elif value.parent is None and value.yang_name in self._children_yang_names:
                                value.parent = self
                        super(Tpa.VrfNames.VrfName,
                              self).__setattr__(name, value)

            class EastWestNames(Entity):
                """
                EastWest container
                
                .. attribute:: east_west_name
                
                	East West interface
                	**type**\: list of    :py:class:`EastWestName <ydk.models.cisco_ios_xr.Cisco_IOS_XR_kim_tpa_cfg.Tpa.VrfNames.VrfName.EastWestNames.EastWestName>`
                
                

                """

                _prefix = 'kim-tpa-cfg'
                _revision = '2015-11-09'

                def __init__(self):
                    super(Tpa.VrfNames.VrfName.EastWestNames, self).__init__()

                    self.yang_name = "east-west-names"
                    self.yang_parent_name = "vrf-name"

                    self.east_west_name = YList(self)

                def __setattr__(self, name, value):
                    self._check_monkey_patching_error(name, value)
                    with _handle_type_error():
                        if name in self.__dict__ and isinstance(
                                self.__dict__[name], YList):
                            raise YPYModelError(
                                "Attempt to assign value of '{}' to YList ldata. "
                                "Please use list append or extend method.".
                                format(value))
                        if isinstance(value, Enum.YLeaf):
                            value = value.name
                        if name in () and name in self.__dict__:
                            if isinstance(value, YLeaf):
                                self.__dict__[name].set(value.get())
                            elif isinstance(value, YLeafList):
                                super(Tpa.VrfNames.VrfName.EastWestNames,
                                      self).__setattr__(name, value)
                            else:
                                self.__dict__[name].set(value)
                        else:
                            if hasattr(value, "parent") and name != "parent":
                                if hasattr(value, "is_presence_container"
                                           ) and value.is_presence_container:
                                    value.parent = self
                                elif value.parent is None and value.yang_name in self._children_yang_names:
                                    value.parent = self
                            super(Tpa.VrfNames.VrfName.EastWestNames,
                                  self).__setattr__(name, value)

                class EastWestName(Entity):
                    """
                    East West interface
                    
                    .. attribute:: east_west_name  <key>
                    
                    	Interface
                    	**type**\:  str
                    
                    	**pattern:** [\\w\\\-\\.\:,\_@#%$\\+=\\\|;]+
                    
                    .. attribute:: interface
                    
                    	Interface
                    	**type**\:  str
                    
                    .. attribute:: vrf
                    
                    	VRF name
                    	**type**\:  str
                    
                    

                    """

                    _prefix = 'kim-tpa-cfg'
                    _revision = '2015-11-09'

                    def __init__(self):
                        super(Tpa.VrfNames.VrfName.EastWestNames.EastWestName,
                              self).__init__()

                        self.yang_name = "east-west-name"
                        self.yang_parent_name = "east-west-names"

                        self.east_west_name = YLeaf(YType.str,
                                                    "east-west-name")

                        self.interface = YLeaf(YType.str, "interface")

                        self.vrf = YLeaf(YType.str, "vrf")

                    def __setattr__(self, name, value):
                        self._check_monkey_patching_error(name, value)
                        with _handle_type_error():
                            if name in self.__dict__ and isinstance(
                                    self.__dict__[name], YList):
                                raise YPYModelError(
                                    "Attempt to assign value of '{}' to YList ldata. "
                                    "Please use list append or extend method.".
                                    format(value))
                            if isinstance(value, Enum.YLeaf):
                                value = value.name
                            if name in ("east_west_name", "interface",
                                        "vrf") and name in self.__dict__:
                                if isinstance(value, YLeaf):
                                    self.__dict__[name].set(value.get())
                                elif isinstance(value, YLeafList):
                                    super(
                                        Tpa.VrfNames.VrfName.EastWestNames.
                                        EastWestName,
                                        self).__setattr__(name, value)
                                else:
                                    self.__dict__[name].set(value)
                            else:
                                if hasattr(value,
                                           "parent") and name != "parent":
                                    if hasattr(
                                            value, "is_presence_container"
                                    ) and value.is_presence_container:
                                        value.parent = self
                                    elif value.parent is None and value.yang_name in self._children_yang_names:
                                        value.parent = self
                                super(
                                    Tpa.VrfNames.VrfName.EastWestNames.
                                    EastWestName,
                                    self).__setattr__(name, value)

                    def has_data(self):
                        return (self.east_west_name.is_set
                                or self.interface.is_set or self.vrf.is_set)

                    def has_operation(self):
                        return (self.yfilter != YFilter.not_set or
                                self.east_west_name.yfilter != YFilter.not_set
                                or self.interface.yfilter != YFilter.not_set
                                or self.vrf.yfilter != YFilter.not_set)

                    def get_segment_path(self):
                        path_buffer = ""
                        path_buffer = "east-west-name" + "[east-west-name='" + self.east_west_name.get(
                        ) + "']" + path_buffer

                        return path_buffer

                    def get_entity_path(self, ancestor):
                        path_buffer = ""
                        if (ancestor is None):
                            raise YPYModelError(
                                "ancestor cannot be None as one of the ancestors is a list"
                            )
                        else:
                            path_buffer = _get_relative_entity_path(
                                self, ancestor, path_buffer)

                        leaf_name_data = LeafDataList()
                        if (self.east_west_name.is_set
                                or self.east_west_name.yfilter !=
                                YFilter.not_set):
                            leaf_name_data.append(
                                self.east_west_name.get_name_leafdata())
                        if (self.interface.is_set
                                or self.interface.yfilter != YFilter.not_set):
                            leaf_name_data.append(
                                self.interface.get_name_leafdata())
                        if (self.vrf.is_set
                                or self.vrf.yfilter != YFilter.not_set):
                            leaf_name_data.append(self.vrf.get_name_leafdata())

                        entity_path = EntityPath(path_buffer, leaf_name_data)
                        return entity_path

                    def get_child_by_name(self, child_yang_name, segment_path):
                        child = self._get_child_by_seg_name(
                            [child_yang_name, segment_path])
                        if child is not None:
                            return child

                        return None

                    def has_leaf_or_child_of_name(self, name):
                        if (name == "east-west-name" or name == "interface"
                                or name == "vrf"):
                            return True
                        return False

                    def set_value(self, value_path, value, name_space,
                                  name_space_prefix):
                        if (value_path == "east-west-name"):
                            self.east_west_name = value
                            self.east_west_name.value_namespace = name_space
                            self.east_west_name.value_namespace_prefix = name_space_prefix
                        if (value_path == "interface"):
                            self.interface = value
                            self.interface.value_namespace = name_space
                            self.interface.value_namespace_prefix = name_space_prefix
                        if (value_path == "vrf"):
                            self.vrf = value
                            self.vrf.value_namespace = name_space
                            self.vrf.value_namespace_prefix = name_space_prefix

                def has_data(self):
                    for c in self.east_west_name:
                        if (c.has_data()):
                            return True
                    return False

                def has_operation(self):
                    for c in self.east_west_name:
                        if (c.has_operation()):
                            return True
                    return self.yfilter != YFilter.not_set

                def get_segment_path(self):
                    path_buffer = ""
                    path_buffer = "east-west-names" + path_buffer

                    return path_buffer

                def get_entity_path(self, ancestor):
                    path_buffer = ""
                    if (ancestor is None):
                        raise YPYModelError(
                            "ancestor cannot be None as one of the ancestors is a list"
                        )
                    else:
                        path_buffer = _get_relative_entity_path(
                            self, ancestor, path_buffer)

                    leaf_name_data = LeafDataList()

                    entity_path = EntityPath(path_buffer, leaf_name_data)
                    return entity_path

                def get_child_by_name(self, child_yang_name, segment_path):
                    child = self._get_child_by_seg_name(
                        [child_yang_name, segment_path])
                    if child is not None:
                        return child

                    if (child_yang_name == "east-west-name"):
                        for c in self.east_west_name:
                            segment = c.get_segment_path()
                            if (segment_path == segment):
                                return c
                        c = Tpa.VrfNames.VrfName.EastWestNames.EastWestName()
                        c.parent = self
                        local_reference_key = "ydk::seg::%s" % segment_path
                        self._local_refs[local_reference_key] = c
                        self.east_west_name.append(c)
                        return c

                    return None

                def has_leaf_or_child_of_name(self, name):
                    if (name == "east-west-name"):
                        return True
                    return False

                def set_value(self, value_path, value, name_space,
                              name_space_prefix):
                    pass

            class AddressFamily(Entity):
                """
                Address family
                
                .. attribute:: ipv4
                
                	IPv4 configuration
                	**type**\:   :py:class:`Ipv4 <ydk.models.cisco_ios_xr.Cisco_IOS_XR_kim_tpa_cfg.Tpa.VrfNames.VrfName.AddressFamily.Ipv4>`
                
                .. attribute:: ipv6
                
                	IPv6 configuration
                	**type**\:   :py:class:`Ipv6 <ydk.models.cisco_ios_xr.Cisco_IOS_XR_kim_tpa_cfg.Tpa.VrfNames.VrfName.AddressFamily.Ipv6>`
                
                

                """

                _prefix = 'kim-tpa-cfg'
                _revision = '2015-11-09'

                def __init__(self):
                    super(Tpa.VrfNames.VrfName.AddressFamily, self).__init__()

                    self.yang_name = "address-family"
                    self.yang_parent_name = "vrf-name"

                    self.ipv4 = Tpa.VrfNames.VrfName.AddressFamily.Ipv4()
                    self.ipv4.parent = self
                    self._children_name_map["ipv4"] = "ipv4"
                    self._children_yang_names.add("ipv4")

                    self.ipv6 = Tpa.VrfNames.VrfName.AddressFamily.Ipv6()
                    self.ipv6.parent = self
                    self._children_name_map["ipv6"] = "ipv6"
                    self._children_yang_names.add("ipv6")

                class Ipv6(Entity):
                    """
                    IPv6 configuration
                    
                    .. attribute:: default_route
                    
                    	Default interface used for routing
                    	**type**\:  str
                    
                    .. attribute:: update_source
                    
                    	Interface name for source address
                    	**type**\:  str
                    
                    	**pattern:** (([a\-zA\-Z0\-9\_]\*\\d+/){3,4}\\d+)\|(([a\-zA\-Z0\-9\_]\*\\d+/){3,4}\\d+\\.\\d+)\|(([a\-zA\-Z0\-9\_]\*\\d+/){2}([a\-zA\-Z0\-9\_]\*\\d+))\|(([a\-zA\-Z0\-9\_]\*\\d+/){2}([a\-zA\-Z0\-9\_]+))\|([a\-zA\-Z0\-9\_\-]\*\\d+)\|([a\-zA\-Z0\-9\_\-]\*\\d+\\.\\d+)\|(mpls)\|(dwdm)
                    
                    

                    """

                    _prefix = 'kim-tpa-cfg'
                    _revision = '2015-11-09'

                    def __init__(self):
                        super(Tpa.VrfNames.VrfName.AddressFamily.Ipv6,
                              self).__init__()

                        self.yang_name = "ipv6"
                        self.yang_parent_name = "address-family"

                        self.default_route = YLeaf(YType.str, "default-route")

                        self.update_source = YLeaf(YType.str, "update-source")

                    def __setattr__(self, name, value):
                        self._check_monkey_patching_error(name, value)
                        with _handle_type_error():
                            if name in self.__dict__ and isinstance(
                                    self.__dict__[name], YList):
                                raise YPYModelError(
                                    "Attempt to assign value of '{}' to YList ldata. "
                                    "Please use list append or extend method.".
                                    format(value))
                            if isinstance(value, Enum.YLeaf):
                                value = value.name
                            if name in ("default_route", "update_source"
                                        ) and name in self.__dict__:
                                if isinstance(value, YLeaf):
                                    self.__dict__[name].set(value.get())
                                elif isinstance(value, YLeafList):
                                    super(
                                        Tpa.VrfNames.VrfName.AddressFamily.
                                        Ipv6, self).__setattr__(name, value)
                                else:
                                    self.__dict__[name].set(value)
                            else:
                                if hasattr(value,
                                           "parent") and name != "parent":
                                    if hasattr(
                                            value, "is_presence_container"
                                    ) and value.is_presence_container:
                                        value.parent = self
                                    elif value.parent is None and value.yang_name in self._children_yang_names:
                                        value.parent = self
                                super(Tpa.VrfNames.VrfName.AddressFamily.Ipv6,
                                      self).__setattr__(name, value)

                    def has_data(self):
                        return (self.default_route.is_set
                                or self.update_source.is_set)

                    def has_operation(self):
                        return (
                            self.yfilter != YFilter.not_set
                            or self.default_route.yfilter != YFilter.not_set
                            or self.update_source.yfilter != YFilter.not_set)

                    def get_segment_path(self):
                        path_buffer = ""
                        path_buffer = "ipv6" + path_buffer

                        return path_buffer

                    def get_entity_path(self, ancestor):
                        path_buffer = ""
                        if (ancestor is None):
                            raise YPYModelError(
                                "ancestor cannot be None as one of the ancestors is a list"
                            )
                        else:
                            path_buffer = _get_relative_entity_path(
                                self, ancestor, path_buffer)

                        leaf_name_data = LeafDataList()
                        if (self.default_route.is_set or
                                self.default_route.yfilter != YFilter.not_set):
                            leaf_name_data.append(
                                self.default_route.get_name_leafdata())
                        if (self.update_source.is_set or
                                self.update_source.yfilter != YFilter.not_set):
                            leaf_name_data.append(
                                self.update_source.get_name_leafdata())

                        entity_path = EntityPath(path_buffer, leaf_name_data)
                        return entity_path

                    def get_child_by_name(self, child_yang_name, segment_path):
                        child = self._get_child_by_seg_name(
                            [child_yang_name, segment_path])
                        if child is not None:
                            return child

                        return None

                    def has_leaf_or_child_of_name(self, name):
                        if (name == "default-route"
                                or name == "update-source"):
                            return True
                        return False

                    def set_value(self, value_path, value, name_space,
                                  name_space_prefix):
                        if (value_path == "default-route"):
                            self.default_route = value
                            self.default_route.value_namespace = name_space
                            self.default_route.value_namespace_prefix = name_space_prefix
                        if (value_path == "update-source"):
                            self.update_source = value
                            self.update_source.value_namespace = name_space
                            self.update_source.value_namespace_prefix = name_space_prefix

                class Ipv4(Entity):
                    """
                    IPv4 configuration
                    
                    .. attribute:: default_route
                    
                    	Default interface used for routing
                    	**type**\:  str
                    
                    .. attribute:: update_source
                    
                    	Interface name for source address
                    	**type**\:  str
                    
                    	**pattern:** (([a\-zA\-Z0\-9\_]\*\\d+/){3,4}\\d+)\|(([a\-zA\-Z0\-9\_]\*\\d+/){3,4}\\d+\\.\\d+)\|(([a\-zA\-Z0\-9\_]\*\\d+/){2}([a\-zA\-Z0\-9\_]\*\\d+))\|(([a\-zA\-Z0\-9\_]\*\\d+/){2}([a\-zA\-Z0\-9\_]+))\|([a\-zA\-Z0\-9\_\-]\*\\d+)\|([a\-zA\-Z0\-9\_\-]\*\\d+\\.\\d+)\|(mpls)\|(dwdm)
                    
                    

                    """

                    _prefix = 'kim-tpa-cfg'
                    _revision = '2015-11-09'

                    def __init__(self):
                        super(Tpa.VrfNames.VrfName.AddressFamily.Ipv4,
                              self).__init__()

                        self.yang_name = "ipv4"
                        self.yang_parent_name = "address-family"

                        self.default_route = YLeaf(YType.str, "default-route")

                        self.update_source = YLeaf(YType.str, "update-source")

                    def __setattr__(self, name, value):
                        self._check_monkey_patching_error(name, value)
                        with _handle_type_error():
                            if name in self.__dict__ and isinstance(
                                    self.__dict__[name], YList):
                                raise YPYModelError(
                                    "Attempt to assign value of '{}' to YList ldata. "
                                    "Please use list append or extend method.".
                                    format(value))
                            if isinstance(value, Enum.YLeaf):
                                value = value.name
                            if name in ("default_route", "update_source"
                                        ) and name in self.__dict__:
                                if isinstance(value, YLeaf):
                                    self.__dict__[name].set(value.get())
                                elif isinstance(value, YLeafList):
                                    super(
                                        Tpa.VrfNames.VrfName.AddressFamily.
                                        Ipv4, self).__setattr__(name, value)
                                else:
                                    self.__dict__[name].set(value)
                            else:
                                if hasattr(value,
                                           "parent") and name != "parent":
                                    if hasattr(
                                            value, "is_presence_container"
                                    ) and value.is_presence_container:
                                        value.parent = self
                                    elif value.parent is None and value.yang_name in self._children_yang_names:
                                        value.parent = self
                                super(Tpa.VrfNames.VrfName.AddressFamily.Ipv4,
                                      self).__setattr__(name, value)

                    def has_data(self):
                        return (self.default_route.is_set
                                or self.update_source.is_set)

                    def has_operation(self):
                        return (
                            self.yfilter != YFilter.not_set
                            or self.default_route.yfilter != YFilter.not_set
                            or self.update_source.yfilter != YFilter.not_set)

                    def get_segment_path(self):
                        path_buffer = ""
                        path_buffer = "ipv4" + path_buffer

                        return path_buffer

                    def get_entity_path(self, ancestor):
                        path_buffer = ""
                        if (ancestor is None):
                            raise YPYModelError(
                                "ancestor cannot be None as one of the ancestors is a list"
                            )
                        else:
                            path_buffer = _get_relative_entity_path(
                                self, ancestor, path_buffer)

                        leaf_name_data = LeafDataList()
                        if (self.default_route.is_set or
                                self.default_route.yfilter != YFilter.not_set):
                            leaf_name_data.append(
                                self.default_route.get_name_leafdata())
                        if (self.update_source.is_set or
                                self.update_source.yfilter != YFilter.not_set):
                            leaf_name_data.append(
                                self.update_source.get_name_leafdata())

                        entity_path = EntityPath(path_buffer, leaf_name_data)
                        return entity_path

                    def get_child_by_name(self, child_yang_name, segment_path):
                        child = self._get_child_by_seg_name(
                            [child_yang_name, segment_path])
                        if child is not None:
                            return child

                        return None

                    def has_leaf_or_child_of_name(self, name):
                        if (name == "default-route"
                                or name == "update-source"):
                            return True
                        return False

                    def set_value(self, value_path, value, name_space,
                                  name_space_prefix):
                        if (value_path == "default-route"):
                            self.default_route = value
                            self.default_route.value_namespace = name_space
                            self.default_route.value_namespace_prefix = name_space_prefix
                        if (value_path == "update-source"):
                            self.update_source = value
                            self.update_source.value_namespace = name_space
                            self.update_source.value_namespace_prefix = name_space_prefix

                def has_data(self):
                    return ((self.ipv4 is not None and self.ipv4.has_data()) or
                            (self.ipv6 is not None and self.ipv6.has_data()))

                def has_operation(self):
                    return (self.yfilter != YFilter.not_set
                            or (self.ipv4 is not None
                                and self.ipv4.has_operation())
                            or (self.ipv6 is not None
                                and self.ipv6.has_operation()))

                def get_segment_path(self):
                    path_buffer = ""
                    path_buffer = "address-family" + path_buffer

                    return path_buffer

                def get_entity_path(self, ancestor):
                    path_buffer = ""
                    if (ancestor is None):
                        raise YPYModelError(
                            "ancestor cannot be None as one of the ancestors is a list"
                        )
                    else:
                        path_buffer = _get_relative_entity_path(
                            self, ancestor, path_buffer)

                    leaf_name_data = LeafDataList()

                    entity_path = EntityPath(path_buffer, leaf_name_data)
                    return entity_path

                def get_child_by_name(self, child_yang_name, segment_path):
                    child = self._get_child_by_seg_name(
                        [child_yang_name, segment_path])
                    if child is not None:
                        return child

                    if (child_yang_name == "ipv4"):
                        if (self.ipv4 is None):
                            self.ipv4 = Tpa.VrfNames.VrfName.AddressFamily.Ipv4(
                            )
                            self.ipv4.parent = self
                            self._children_name_map["ipv4"] = "ipv4"
                        return self.ipv4

                    if (child_yang_name == "ipv6"):
                        if (self.ipv6 is None):
                            self.ipv6 = Tpa.VrfNames.VrfName.AddressFamily.Ipv6(
                            )
                            self.ipv6.parent = self
                            self._children_name_map["ipv6"] = "ipv6"
                        return self.ipv6

                    return None

                def has_leaf_or_child_of_name(self, name):
                    if (name == "ipv4" or name == "ipv6"):
                        return True
                    return False

                def set_value(self, value_path, value, name_space,
                              name_space_prefix):
                    pass

            def has_data(self):
                return (self.vrf_name.is_set
                        or (self.address_family is not None
                            and self.address_family.has_data())
                        or (self.east_west_names is not None
                            and self.east_west_names.has_data()))

            def has_operation(self):
                return (self.yfilter != YFilter.not_set
                        or self.vrf_name.yfilter != YFilter.not_set
                        or (self.address_family is not None
                            and self.address_family.has_operation())
                        or (self.east_west_names is not None
                            and self.east_west_names.has_operation()))

            def get_segment_path(self):
                path_buffer = ""
                path_buffer = "vrf-name" + "[vrf-name='" + self.vrf_name.get(
                ) + "']" + path_buffer

                return path_buffer

            def get_entity_path(self, ancestor):
                path_buffer = ""
                if (ancestor is None):
                    path_buffer = "Cisco-IOS-XR-kim-tpa-cfg:tpa/vrf-names/%s" % self.get_segment_path(
                    )
                else:
                    path_buffer = _get_relative_entity_path(
                        self, ancestor, path_buffer)

                leaf_name_data = LeafDataList()
                if (self.vrf_name.is_set
                        or self.vrf_name.yfilter != YFilter.not_set):
                    leaf_name_data.append(self.vrf_name.get_name_leafdata())

                entity_path = EntityPath(path_buffer, leaf_name_data)
                return entity_path

            def get_child_by_name(self, child_yang_name, segment_path):
                child = self._get_child_by_seg_name(
                    [child_yang_name, segment_path])
                if child is not None:
                    return child

                if (child_yang_name == "address-family"):
                    if (self.address_family is None):
                        self.address_family = Tpa.VrfNames.VrfName.AddressFamily(
                        )
                        self.address_family.parent = self
                        self._children_name_map[
                            "address_family"] = "address-family"
                    return self.address_family

                if (child_yang_name == "east-west-names"):
                    if (self.east_west_names is None):
                        self.east_west_names = Tpa.VrfNames.VrfName.EastWestNames(
                        )
                        self.east_west_names.parent = self
                        self._children_name_map[
                            "east_west_names"] = "east-west-names"
                    return self.east_west_names

                return None

            def has_leaf_or_child_of_name(self, name):
                if (name == "address-family" or name == "east-west-names"
                        or name == "vrf-name"):
                    return True
                return False

            def set_value(self, value_path, value, name_space,
                          name_space_prefix):
                if (value_path == "vrf-name"):
                    self.vrf_name = value
                    self.vrf_name.value_namespace = name_space
                    self.vrf_name.value_namespace_prefix = name_space_prefix

        def has_data(self):
            for c in self.vrf_name:
                if (c.has_data()):
                    return True
            return False

        def has_operation(self):
            for c in self.vrf_name:
                if (c.has_operation()):
                    return True
            return self.yfilter != YFilter.not_set

        def get_segment_path(self):
            path_buffer = ""
            path_buffer = "vrf-names" + path_buffer

            return path_buffer

        def get_entity_path(self, ancestor):
            path_buffer = ""
            if (ancestor is None):
                path_buffer = "Cisco-IOS-XR-kim-tpa-cfg:tpa/%s" % self.get_segment_path(
                )
            else:
                path_buffer = _get_relative_entity_path(
                    self, ancestor, path_buffer)

            leaf_name_data = LeafDataList()

            entity_path = EntityPath(path_buffer, leaf_name_data)
            return entity_path

        def get_child_by_name(self, child_yang_name, segment_path):
            child = self._get_child_by_seg_name(
                [child_yang_name, segment_path])
            if child is not None:
                return child

            if (child_yang_name == "vrf-name"):
                for c in self.vrf_name:
                    segment = c.get_segment_path()
                    if (segment_path == segment):
                        return c
                c = Tpa.VrfNames.VrfName()
                c.parent = self
                local_reference_key = "ydk::seg::%s" % segment_path
                self._local_refs[local_reference_key] = c
                self.vrf_name.append(c)
                return c

            return None

        def has_leaf_or_child_of_name(self, name):
            if (name == "vrf-name"):
                return True
            return False

        def set_value(self, value_path, value, name_space, name_space_prefix):
            pass
            class EastWestNames(Entity):
                """
                EastWest container
                
                .. attribute:: east_west_name
                
                	East West interface
                	**type**\: list of    :py:class:`EastWestName <ydk.models.cisco_ios_xr.Cisco_IOS_XR_kim_tpa_cfg.Tpa.VrfNames.VrfName.EastWestNames.EastWestName>`
                
                

                """

                _prefix = 'kim-tpa-cfg'
                _revision = '2015-11-09'

                def __init__(self):
                    super(Tpa.VrfNames.VrfName.EastWestNames, self).__init__()

                    self.yang_name = "east-west-names"
                    self.yang_parent_name = "vrf-name"

                    self.east_west_name = YList(self)

                def __setattr__(self, name, value):
                    self._check_monkey_patching_error(name, value)
                    with _handle_type_error():
                        if name in self.__dict__ and isinstance(
                                self.__dict__[name], YList):
                            raise YPYModelError(
                                "Attempt to assign value of '{}' to YList ldata. "
                                "Please use list append or extend method.".
                                format(value))
                        if isinstance(value, Enum.YLeaf):
                            value = value.name
                        if name in () and name in self.__dict__:
                            if isinstance(value, YLeaf):
                                self.__dict__[name].set(value.get())
                            elif isinstance(value, YLeafList):
                                super(Tpa.VrfNames.VrfName.EastWestNames,
                                      self).__setattr__(name, value)
                            else:
                                self.__dict__[name].set(value)
                        else:
                            if hasattr(value, "parent") and name != "parent":
                                if hasattr(value, "is_presence_container"
                                           ) and value.is_presence_container:
                                    value.parent = self
                                elif value.parent is None and value.yang_name in self._children_yang_names:
                                    value.parent = self
                            super(Tpa.VrfNames.VrfName.EastWestNames,
                                  self).__setattr__(name, value)

                class EastWestName(Entity):
                    """
                    East West interface
                    
                    .. attribute:: east_west_name  <key>
                    
                    	Interface
                    	**type**\:  str
                    
                    	**pattern:** [\\w\\\-\\.\:,\_@#%$\\+=\\\|;]+
                    
                    .. attribute:: interface
                    
                    	Interface
                    	**type**\:  str
                    
                    .. attribute:: vrf
                    
                    	VRF name
                    	**type**\:  str
                    
                    

                    """

                    _prefix = 'kim-tpa-cfg'
                    _revision = '2015-11-09'

                    def __init__(self):
                        super(Tpa.VrfNames.VrfName.EastWestNames.EastWestName,
                              self).__init__()

                        self.yang_name = "east-west-name"
                        self.yang_parent_name = "east-west-names"

                        self.east_west_name = YLeaf(YType.str,
                                                    "east-west-name")

                        self.interface = YLeaf(YType.str, "interface")

                        self.vrf = YLeaf(YType.str, "vrf")

                    def __setattr__(self, name, value):
                        self._check_monkey_patching_error(name, value)
                        with _handle_type_error():
                            if name in self.__dict__ and isinstance(
                                    self.__dict__[name], YList):
                                raise YPYModelError(
                                    "Attempt to assign value of '{}' to YList ldata. "
                                    "Please use list append or extend method.".
                                    format(value))
                            if isinstance(value, Enum.YLeaf):
                                value = value.name
                            if name in ("east_west_name", "interface",
                                        "vrf") and name in self.__dict__:
                                if isinstance(value, YLeaf):
                                    self.__dict__[name].set(value.get())
                                elif isinstance(value, YLeafList):
                                    super(
                                        Tpa.VrfNames.VrfName.EastWestNames.
                                        EastWestName,
                                        self).__setattr__(name, value)
                                else:
                                    self.__dict__[name].set(value)
                            else:
                                if hasattr(value,
                                           "parent") and name != "parent":
                                    if hasattr(
                                            value, "is_presence_container"
                                    ) and value.is_presence_container:
                                        value.parent = self
                                    elif value.parent is None and value.yang_name in self._children_yang_names:
                                        value.parent = self
                                super(
                                    Tpa.VrfNames.VrfName.EastWestNames.
                                    EastWestName,
                                    self).__setattr__(name, value)

                    def has_data(self):
                        return (self.east_west_name.is_set
                                or self.interface.is_set or self.vrf.is_set)

                    def has_operation(self):
                        return (self.yfilter != YFilter.not_set or
                                self.east_west_name.yfilter != YFilter.not_set
                                or self.interface.yfilter != YFilter.not_set
                                or self.vrf.yfilter != YFilter.not_set)

                    def get_segment_path(self):
                        path_buffer = ""
                        path_buffer = "east-west-name" + "[east-west-name='" + self.east_west_name.get(
                        ) + "']" + path_buffer

                        return path_buffer

                    def get_entity_path(self, ancestor):
                        path_buffer = ""
                        if (ancestor is None):
                            raise YPYModelError(
                                "ancestor cannot be None as one of the ancestors is a list"
                            )
                        else:
                            path_buffer = _get_relative_entity_path(
                                self, ancestor, path_buffer)

                        leaf_name_data = LeafDataList()
                        if (self.east_west_name.is_set
                                or self.east_west_name.yfilter !=
                                YFilter.not_set):
                            leaf_name_data.append(
                                self.east_west_name.get_name_leafdata())
                        if (self.interface.is_set
                                or self.interface.yfilter != YFilter.not_set):
                            leaf_name_data.append(
                                self.interface.get_name_leafdata())
                        if (self.vrf.is_set
                                or self.vrf.yfilter != YFilter.not_set):
                            leaf_name_data.append(self.vrf.get_name_leafdata())

                        entity_path = EntityPath(path_buffer, leaf_name_data)
                        return entity_path

                    def get_child_by_name(self, child_yang_name, segment_path):
                        child = self._get_child_by_seg_name(
                            [child_yang_name, segment_path])
                        if child is not None:
                            return child

                        return None

                    def has_leaf_or_child_of_name(self, name):
                        if (name == "east-west-name" or name == "interface"
                                or name == "vrf"):
                            return True
                        return False

                    def set_value(self, value_path, value, name_space,
                                  name_space_prefix):
                        if (value_path == "east-west-name"):
                            self.east_west_name = value
                            self.east_west_name.value_namespace = name_space
                            self.east_west_name.value_namespace_prefix = name_space_prefix
                        if (value_path == "interface"):
                            self.interface = value
                            self.interface.value_namespace = name_space
                            self.interface.value_namespace_prefix = name_space_prefix
                        if (value_path == "vrf"):
                            self.vrf = value
                            self.vrf.value_namespace = name_space
                            self.vrf.value_namespace_prefix = name_space_prefix

                def has_data(self):
                    for c in self.east_west_name:
                        if (c.has_data()):
                            return True
                    return False

                def has_operation(self):
                    for c in self.east_west_name:
                        if (c.has_operation()):
                            return True
                    return self.yfilter != YFilter.not_set

                def get_segment_path(self):
                    path_buffer = ""
                    path_buffer = "east-west-names" + path_buffer

                    return path_buffer

                def get_entity_path(self, ancestor):
                    path_buffer = ""
                    if (ancestor is None):
                        raise YPYModelError(
                            "ancestor cannot be None as one of the ancestors is a list"
                        )
                    else:
                        path_buffer = _get_relative_entity_path(
                            self, ancestor, path_buffer)

                    leaf_name_data = LeafDataList()

                    entity_path = EntityPath(path_buffer, leaf_name_data)
                    return entity_path

                def get_child_by_name(self, child_yang_name, segment_path):
                    child = self._get_child_by_seg_name(
                        [child_yang_name, segment_path])
                    if child is not None:
                        return child

                    if (child_yang_name == "east-west-name"):
                        for c in self.east_west_name:
                            segment = c.get_segment_path()
                            if (segment_path == segment):
                                return c
                        c = Tpa.VrfNames.VrfName.EastWestNames.EastWestName()
                        c.parent = self
                        local_reference_key = "ydk::seg::%s" % segment_path
                        self._local_refs[local_reference_key] = c
                        self.east_west_name.append(c)
                        return c

                    return None

                def has_leaf_or_child_of_name(self, name):
                    if (name == "east-west-name"):
                        return True
                    return False

                def set_value(self, value_path, value, name_space,
                              name_space_prefix):
                    pass
    class Casnactivetable(Entity):
        """
        This table contains entries for active AAA accounting
        sessions in the system.
        
        .. attribute:: casnactiveentry
        
        	The information regarding a single accounting session.  Entries are created when a new accounting session is begun.  Entries are removed when the accounting session is ended.  Initiating termination of a session with the object casnDisconnect will cause removal of the entry when the session completes termination
        	**type**\: list of    :py:class:`Casnactiveentry <ydk.models.cisco_ios_xe.CISCO_AAA_SESSION_MIB.CiscoAaaSessionMib.Casnactivetable.Casnactiveentry>`
        
        

        """

        _prefix = 'CISCO-AAA-SESSION-MIB'
        _revision = '2006-03-21'

        def __init__(self):
            super(CiscoAaaSessionMib.Casnactivetable, self).__init__()

            self.yang_name = "casnActiveTable"
            self.yang_parent_name = "CISCO-AAA-SESSION-MIB"

            self.casnactiveentry = YList(self)

        def __setattr__(self, name, value):
            self._check_monkey_patching_error(name, value)
            with _handle_type_error():
                if name in self.__dict__ and isinstance(self.__dict__[name], YList):
                    raise YPYModelError("Attempt to assign value of '{}' to YList ldata. "
                                        "Please use list append or extend method."
                                        .format(value))
                if isinstance(value, Enum.YLeaf):
                    value = value.name
                if name in () and name in self.__dict__:
                    if isinstance(value, YLeaf):
                        self.__dict__[name].set(value.get())
                    elif isinstance(value, YLeafList):
                        super(CiscoAaaSessionMib.Casnactivetable, self).__setattr__(name, value)
                    else:
                        self.__dict__[name].set(value)
                else:
                    if hasattr(value, "parent") and name != "parent":
                        if hasattr(value, "is_presence_container") and value.is_presence_container:
                            value.parent = self
                        elif value.parent is None and value.yang_name in self._children_yang_names:
                            value.parent = self
                    super(CiscoAaaSessionMib.Casnactivetable, self).__setattr__(name, value)


        class Casnactiveentry(Entity):
            """
            The information regarding a single accounting session.
            
            Entries are created when a new accounting session
            is begun.
            
            Entries are removed when the accounting session
            is ended.
            
            Initiating termination of a session with the object
            casnDisconnect will cause removal of the entry when
            the session completes termination.
            
            .. attribute:: casnsessionid  <key>
            
            	This is the session identification used by the accounting protocol.  This value is unique to a session within the system, even if multiple accounting protocols are in use.  The value of this object corresponds to these accounting protocol attributes.    RADIUS\:  attribute 44, Acct\-Session\-Id    TACACS+\: attribute 'task\_id'
            	**type**\:  int
            
            	**range:** 1..4294967295
            
            .. attribute:: casncalltrackerid
            
            	The value of this object is the entry index in the CISCO\-CALL\-TRACKER\-MIB cctActiveTable of the call corresponding to this accounting session.  Using the value of this object to query the cctActiveTable will provide more detailed data regarding the session represented by this casnActiveEntry
            	**type**\:  int
            
            	**range:** 0..4294967295
            
            .. attribute:: casndisconnect
            
            	This object is used to terminate this session.  Setting the value to true(1) will initiate termination of this session.  The entry will be removed once the session has completed termination.  Once this object has been set to true(1), the session termination process can not be cancelled by setting the value false(2)
            	**type**\:  bool
            
            .. attribute:: casnidletime
            
            	The elapsed time that this session has been idle.  This is the time since the last user\-level data has been received or transmitted. Protocol level handshaking associated with the call is considered to be idle for this object
            	**type**\:  int
            
            	**range:** 0..4294967295
            
            	**units**\: seconds
            
            .. attribute:: casnipaddr
            
            	The IP address of the session or 0.0.0.0 if not applicable or unavailable.  RADIUS\:  attribute 8, Framed\-IP\-Address TACACS+\: attribute 'addr'
            	**type**\:  str
            
            	**pattern:** (([0\-9]\|[1\-9][0\-9]\|1[0\-9][0\-9]\|2[0\-4][0\-9]\|25[0\-5])\\.){3}([0\-9]\|[1\-9][0\-9]\|1[0\-9][0\-9]\|2[0\-4][0\-9]\|25[0\-5])(%[\\p{N}\\p{L}]+)?
            
            .. attribute:: casnnasport
            
            	The value of this object identifies a particular conceptual row associated with the session identified by casnSessionId.  The conceptual row that this object points to represents a port that is used to transport a session.  If the port transporting the session cannot be determined, the value of this object will be zeroDotZero.  For example, suppose a session is established using an ATM PVC.  If the ifIndex of the ATM interface is 7, and the  VPI/VCI values of the PVC are 1, 100 respectively, then the value of this object might be as follows\:         casnNasPort.15 = atmVclAdminStatus.7.1.100                    ^                      ^ ^  ^                    \|                      \| \|  \|    casnSessionId \-\-+                      \| \|  \|          ifIndex \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-+ \|  \|        atmVclVpi \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-+  \|        atmVclVci \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-+  where atmVclAdminStatus is the first accessible object of the atmVclTable of the ATM\-MIB
            	**type**\:  str
            
            	**pattern:** (([0\-1](\\.[1\-3]?[0\-9]))\|(2\\.(0\|([1\-9]\\d\*))))(\\.(0\|([1\-9]\\d\*)))\*
            
            .. attribute:: casnuserid
            
            	The User login ID or zero length string if unavailable.  The value of this object corresponds to these accounting protocol attributes.    RADIUS\:  attribute 1, User\-Name    TACACS+\: attribute 'user'
            	**type**\:  str
            
            	**length:** 0..255
            
            .. attribute:: casnvaiifindex
            
            	The ifIndex of the Virtual Access Interface (VAI) that is associated with the PPP session.  This interface may not be represented in the IF\-MIB in which case the value of this object will be zero
            	**type**\:  int
            
            	**range:** 0..2147483647
            
            

            """

            _prefix = 'CISCO-AAA-SESSION-MIB'
            _revision = '2006-03-21'

            def __init__(self):
                super(CiscoAaaSessionMib.Casnactivetable.Casnactiveentry, self).__init__()

                self.yang_name = "casnActiveEntry"
                self.yang_parent_name = "casnActiveTable"

                self.casnsessionid = YLeaf(YType.uint32, "casnSessionId")

                self.casncalltrackerid = YLeaf(YType.uint32, "casnCallTrackerId")

                self.casndisconnect = YLeaf(YType.boolean, "casnDisconnect")

                self.casnidletime = YLeaf(YType.uint32, "casnIdleTime")

                self.casnipaddr = YLeaf(YType.str, "casnIpAddr")

                self.casnnasport = YLeaf(YType.str, "casnNasPort")

                self.casnuserid = YLeaf(YType.str, "casnUserId")

                self.casnvaiifindex = YLeaf(YType.int32, "casnVaiIfIndex")

            def __setattr__(self, name, value):
                self._check_monkey_patching_error(name, value)
                with _handle_type_error():
                    if name in self.__dict__ and isinstance(self.__dict__[name], YList):
                        raise YPYModelError("Attempt to assign value of '{}' to YList ldata. "
                                            "Please use list append or extend method."
                                            .format(value))
                    if isinstance(value, Enum.YLeaf):
                        value = value.name
                    if name in ("casnsessionid",
                                "casncalltrackerid",
                                "casndisconnect",
                                "casnidletime",
                                "casnipaddr",
                                "casnnasport",
                                "casnuserid",
                                "casnvaiifindex") and name in self.__dict__:
                        if isinstance(value, YLeaf):
                            self.__dict__[name].set(value.get())
                        elif isinstance(value, YLeafList):
                            super(CiscoAaaSessionMib.Casnactivetable.Casnactiveentry, self).__setattr__(name, value)
                        else:
                            self.__dict__[name].set(value)
                    else:
                        if hasattr(value, "parent") and name != "parent":
                            if hasattr(value, "is_presence_container") and value.is_presence_container:
                                value.parent = self
                            elif value.parent is None and value.yang_name in self._children_yang_names:
                                value.parent = self
                        super(CiscoAaaSessionMib.Casnactivetable.Casnactiveentry, self).__setattr__(name, value)

            def has_data(self):
                return (
                    self.casnsessionid.is_set or
                    self.casncalltrackerid.is_set or
                    self.casndisconnect.is_set or
                    self.casnidletime.is_set or
                    self.casnipaddr.is_set or
                    self.casnnasport.is_set or
                    self.casnuserid.is_set or
                    self.casnvaiifindex.is_set)

            def has_operation(self):
                return (
                    self.yfilter != YFilter.not_set or
                    self.casnsessionid.yfilter != YFilter.not_set or
                    self.casncalltrackerid.yfilter != YFilter.not_set or
                    self.casndisconnect.yfilter != YFilter.not_set or
                    self.casnidletime.yfilter != YFilter.not_set or
                    self.casnipaddr.yfilter != YFilter.not_set or
                    self.casnnasport.yfilter != YFilter.not_set or
                    self.casnuserid.yfilter != YFilter.not_set or
                    self.casnvaiifindex.yfilter != YFilter.not_set)

            def get_segment_path(self):
                path_buffer = ""
                path_buffer = "casnActiveEntry" + "[casnSessionId='" + self.casnsessionid.get() + "']" + path_buffer

                return path_buffer

            def get_entity_path(self, ancestor):
                path_buffer = ""
                if (ancestor is None):
                    path_buffer = "CISCO-AAA-SESSION-MIB:CISCO-AAA-SESSION-MIB/casnActiveTable/%s" % self.get_segment_path()
                else:
                    path_buffer = _get_relative_entity_path(self, ancestor, path_buffer)

                leaf_name_data = LeafDataList()
                if (self.casnsessionid.is_set or self.casnsessionid.yfilter != YFilter.not_set):
                    leaf_name_data.append(self.casnsessionid.get_name_leafdata())
                if (self.casncalltrackerid.is_set or self.casncalltrackerid.yfilter != YFilter.not_set):
                    leaf_name_data.append(self.casncalltrackerid.get_name_leafdata())
                if (self.casndisconnect.is_set or self.casndisconnect.yfilter != YFilter.not_set):
                    leaf_name_data.append(self.casndisconnect.get_name_leafdata())
                if (self.casnidletime.is_set or self.casnidletime.yfilter != YFilter.not_set):
                    leaf_name_data.append(self.casnidletime.get_name_leafdata())
                if (self.casnipaddr.is_set or self.casnipaddr.yfilter != YFilter.not_set):
                    leaf_name_data.append(self.casnipaddr.get_name_leafdata())
                if (self.casnnasport.is_set or self.casnnasport.yfilter != YFilter.not_set):
                    leaf_name_data.append(self.casnnasport.get_name_leafdata())
                if (self.casnuserid.is_set or self.casnuserid.yfilter != YFilter.not_set):
                    leaf_name_data.append(self.casnuserid.get_name_leafdata())
                if (self.casnvaiifindex.is_set or self.casnvaiifindex.yfilter != YFilter.not_set):
                    leaf_name_data.append(self.casnvaiifindex.get_name_leafdata())

                entity_path = EntityPath(path_buffer, leaf_name_data)
                return entity_path

            def get_child_by_name(self, child_yang_name, segment_path):
                child = self._get_child_by_seg_name([child_yang_name, segment_path])
                if child is not None:
                    return child

                return None

            def has_leaf_or_child_of_name(self, name):
                if(name == "casnSessionId" or name == "casnCallTrackerId" or name == "casnDisconnect" or name == "casnIdleTime" or name == "casnIpAddr" or name == "casnNasPort" or name == "casnUserId" or name == "casnVaiIfIndex"):
                    return True
                return False

            def set_value(self, value_path, value, name_space, name_space_prefix):
                if(value_path == "casnSessionId"):
                    self.casnsessionid = value
                    self.casnsessionid.value_namespace = name_space
                    self.casnsessionid.value_namespace_prefix = name_space_prefix
                if(value_path == "casnCallTrackerId"):
                    self.casncalltrackerid = value
                    self.casncalltrackerid.value_namespace = name_space
                    self.casncalltrackerid.value_namespace_prefix = name_space_prefix
                if(value_path == "casnDisconnect"):
                    self.casndisconnect = value
                    self.casndisconnect.value_namespace = name_space
                    self.casndisconnect.value_namespace_prefix = name_space_prefix
                if(value_path == "casnIdleTime"):
                    self.casnidletime = value
                    self.casnidletime.value_namespace = name_space
                    self.casnidletime.value_namespace_prefix = name_space_prefix
                if(value_path == "casnIpAddr"):
                    self.casnipaddr = value
                    self.casnipaddr.value_namespace = name_space
                    self.casnipaddr.value_namespace_prefix = name_space_prefix
                if(value_path == "casnNasPort"):
                    self.casnnasport = value
                    self.casnnasport.value_namespace = name_space
                    self.casnnasport.value_namespace_prefix = name_space_prefix
                if(value_path == "casnUserId"):
                    self.casnuserid = value
                    self.casnuserid.value_namespace = name_space
                    self.casnuserid.value_namespace_prefix = name_space_prefix
                if(value_path == "casnVaiIfIndex"):
                    self.casnvaiifindex = value
                    self.casnvaiifindex.value_namespace = name_space
                    self.casnvaiifindex.value_namespace_prefix = name_space_prefix

        def has_data(self):
            for c in self.casnactiveentry:
                if (c.has_data()):
                    return True
            return False

        def has_operation(self):
            for c in self.casnactiveentry:
                if (c.has_operation()):
                    return True
            return self.yfilter != YFilter.not_set

        def get_segment_path(self):
            path_buffer = ""
            path_buffer = "casnActiveTable" + path_buffer

            return path_buffer

        def get_entity_path(self, ancestor):
            path_buffer = ""
            if (ancestor is None):
                path_buffer = "CISCO-AAA-SESSION-MIB:CISCO-AAA-SESSION-MIB/%s" % self.get_segment_path()
            else:
                path_buffer = _get_relative_entity_path(self, ancestor, path_buffer)

            leaf_name_data = LeafDataList()

            entity_path = EntityPath(path_buffer, leaf_name_data)
            return entity_path

        def get_child_by_name(self, child_yang_name, segment_path):
            child = self._get_child_by_seg_name([child_yang_name, segment_path])
            if child is not None:
                return child

            if (child_yang_name == "casnActiveEntry"):
                for c in self.casnactiveentry:
                    segment = c.get_segment_path()
                    if (segment_path == segment):
                        return c
                c = CiscoAaaSessionMib.Casnactivetable.Casnactiveentry()
                c.parent = self
                local_reference_key = "ydk::seg::%s" % segment_path
                self._local_refs[local_reference_key] = c
                self.casnactiveentry.append(c)
                return c

            return None

        def has_leaf_or_child_of_name(self, name):
            if(name == "casnActiveEntry"):
                return True
            return False

        def set_value(self, value_path, value, name_space, name_space_prefix):
            pass
Пример #15
0
        class Keies(Entity):
            """
            Configure a Key
            
            .. attribute:: key
            
            	Key Identifier
            	**type**\: list of    :py:class:`Key <ydk.models.cisco_ios_xr.Cisco_IOS_XR_lib_keychain_macsec_cfg.MacSecKeychains.MacSecKeychain.Keies.Key>`
            
            

            """

            _prefix = 'lib-keychain-macsec-cfg'
            _revision = '2015-11-09'

            def __init__(self):
                super(MacSecKeychains.MacSecKeychain.Keies, self).__init__()

                self.yang_name = "keies"
                self.yang_parent_name = "mac-sec-keychain"

                self.key = YList(self)

            def __setattr__(self, name, value):
                self._check_monkey_patching_error(name, value)
                with _handle_type_error():
                    if name in self.__dict__ and isinstance(self.__dict__[name], YList):
                        raise YPYModelError("Attempt to assign value of '{}' to YList ldata. "
                                            "Please use list append or extend method."
                                            .format(value))
                    if isinstance(value, Enum.YLeaf):
                        value = value.name
                    if name in () and name in self.__dict__:
                        if isinstance(value, YLeaf):
                            self.__dict__[name].set(value.get())
                        elif isinstance(value, YLeafList):
                            super(MacSecKeychains.MacSecKeychain.Keies, self).__setattr__(name, value)
                        else:
                            self.__dict__[name].set(value)
                    else:
                        if hasattr(value, "parent") and name != "parent":
                            if hasattr(value, "is_presence_container") and value.is_presence_container:
                                value.parent = self
                            elif value.parent is None and value.yang_name in self._children_yang_names:
                                value.parent = self
                        super(MacSecKeychains.MacSecKeychain.Keies, self).__setattr__(name, value)


            class Key(Entity):
                """
                Key Identifier
                
                .. attribute:: key_id  <key>
                
                	48\-bit Key identifier
                	**type**\:  str
                
                	**pattern:** [\\w\\\-\\.\:,\_@#%$\\+=\\\|;]+
                
                .. attribute:: key_string
                
                	Configure a clear text/encrypted Key string along with cryptographic algorithm
                	**type**\:   :py:class:`KeyString <ydk.models.cisco_ios_xr.Cisco_IOS_XR_lib_keychain_macsec_cfg.MacSecKeychains.MacSecKeychain.Keies.Key.KeyString>`
                
                	**presence node**\: True
                
                .. attribute:: lifetime
                
                	Configure a key Lifetime
                	**type**\:   :py:class:`Lifetime <ydk.models.cisco_ios_xr.Cisco_IOS_XR_lib_keychain_macsec_cfg.MacSecKeychains.MacSecKeychain.Keies.Key.Lifetime>`
                
                

                """

                _prefix = 'lib-keychain-macsec-cfg'
                _revision = '2015-11-09'

                def __init__(self):
                    super(MacSecKeychains.MacSecKeychain.Keies.Key, self).__init__()

                    self.yang_name = "key"
                    self.yang_parent_name = "keies"

                    self.key_id = YLeaf(YType.str, "key-id")

                    self.key_string = None
                    self._children_name_map["key_string"] = "key-string"
                    self._children_yang_names.add("key-string")

                    self.lifetime = MacSecKeychains.MacSecKeychain.Keies.Key.Lifetime()
                    self.lifetime.parent = self
                    self._children_name_map["lifetime"] = "lifetime"
                    self._children_yang_names.add("lifetime")

                def __setattr__(self, name, value):
                    self._check_monkey_patching_error(name, value)
                    with _handle_type_error():
                        if name in self.__dict__ and isinstance(self.__dict__[name], YList):
                            raise YPYModelError("Attempt to assign value of '{}' to YList ldata. "
                                                "Please use list append or extend method."
                                                .format(value))
                        if isinstance(value, Enum.YLeaf):
                            value = value.name
                        if name in ("key_id") and name in self.__dict__:
                            if isinstance(value, YLeaf):
                                self.__dict__[name].set(value.get())
                            elif isinstance(value, YLeafList):
                                super(MacSecKeychains.MacSecKeychain.Keies.Key, self).__setattr__(name, value)
                            else:
                                self.__dict__[name].set(value)
                        else:
                            if hasattr(value, "parent") and name != "parent":
                                if hasattr(value, "is_presence_container") and value.is_presence_container:
                                    value.parent = self
                                elif value.parent is None and value.yang_name in self._children_yang_names:
                                    value.parent = self
                            super(MacSecKeychains.MacSecKeychain.Keies.Key, self).__setattr__(name, value)


                class Lifetime(Entity):
                    """
                    Configure a key Lifetime
                    
                    .. attribute:: end_date
                    
                    	End Date
                    	**type**\:  int
                    
                    	**range:** 1..31
                    
                    .. attribute:: end_hour
                    
                    	End Hour
                    	**type**\:  int
                    
                    	**range:** 0..23
                    
                    .. attribute:: end_minutes
                    
                    	End Minutes
                    	**type**\:  int
                    
                    	**range:** 0..59
                    
                    	**units**\: minute
                    
                    .. attribute:: end_month
                    
                    	End Month
                    	**type**\:   :py:class:`MacSecKeyChainMonth <ydk.models.cisco_ios_xr.Cisco_IOS_XR_lib_keychain_macsec_cfg.MacSecKeyChainMonth>`
                    
                    .. attribute:: end_seconds
                    
                    	End Seconds
                    	**type**\:  int
                    
                    	**range:** 0..59
                    
                    	**units**\: second
                    
                    .. attribute:: end_year
                    
                    	End Year
                    	**type**\:  int
                    
                    	**range:** 1993..2035
                    
                    .. attribute:: infinite_flag
                    
                    	Infinite Lifetime flag
                    	**type**\:  bool
                    
                    .. attribute:: life_time
                    
                    	Lifetime duration in seconds
                    	**type**\:  int
                    
                    	**range:** 1..2147483647
                    
                    	**units**\: second
                    
                    .. attribute:: start_date
                    
                    	Start Date
                    	**type**\:  int
                    
                    	**range:** 1..31
                    
                    .. attribute:: start_hour
                    
                    	Start Hour
                    	**type**\:  int
                    
                    	**range:** 0..23
                    
                    .. attribute:: start_minutes
                    
                    	Start Minutes
                    	**type**\:  int
                    
                    	**range:** 0..59
                    
                    	**units**\: minute
                    
                    .. attribute:: start_month
                    
                    	Start Month
                    	**type**\:   :py:class:`MacSecKeyChainMonth <ydk.models.cisco_ios_xr.Cisco_IOS_XR_lib_keychain_macsec_cfg.MacSecKeyChainMonth>`
                    
                    .. attribute:: start_seconds
                    
                    	Start Seconds
                    	**type**\:  int
                    
                    	**range:** 0..59
                    
                    	**units**\: second
                    
                    .. attribute:: start_year
                    
                    	Start Year
                    	**type**\:  int
                    
                    	**range:** 1993..2035
                    
                    

                    """

                    _prefix = 'lib-keychain-macsec-cfg'
                    _revision = '2015-11-09'

                    def __init__(self):
                        super(MacSecKeychains.MacSecKeychain.Keies.Key.Lifetime, self).__init__()

                        self.yang_name = "lifetime"
                        self.yang_parent_name = "key"

                        self.end_date = YLeaf(YType.uint32, "end-date")

                        self.end_hour = YLeaf(YType.uint32, "end-hour")

                        self.end_minutes = YLeaf(YType.uint32, "end-minutes")

                        self.end_month = YLeaf(YType.enumeration, "end-month")

                        self.end_seconds = YLeaf(YType.uint32, "end-seconds")

                        self.end_year = YLeaf(YType.uint32, "end-year")

                        self.infinite_flag = YLeaf(YType.boolean, "infinite-flag")

                        self.life_time = YLeaf(YType.uint32, "life-time")

                        self.start_date = YLeaf(YType.uint32, "start-date")

                        self.start_hour = YLeaf(YType.uint32, "start-hour")

                        self.start_minutes = YLeaf(YType.uint32, "start-minutes")

                        self.start_month = YLeaf(YType.enumeration, "start-month")

                        self.start_seconds = YLeaf(YType.uint32, "start-seconds")

                        self.start_year = YLeaf(YType.uint32, "start-year")

                    def __setattr__(self, name, value):
                        self._check_monkey_patching_error(name, value)
                        with _handle_type_error():
                            if name in self.__dict__ and isinstance(self.__dict__[name], YList):
                                raise YPYModelError("Attempt to assign value of '{}' to YList ldata. "
                                                    "Please use list append or extend method."
                                                    .format(value))
                            if isinstance(value, Enum.YLeaf):
                                value = value.name
                            if name in ("end_date",
                                        "end_hour",
                                        "end_minutes",
                                        "end_month",
                                        "end_seconds",
                                        "end_year",
                                        "infinite_flag",
                                        "life_time",
                                        "start_date",
                                        "start_hour",
                                        "start_minutes",
                                        "start_month",
                                        "start_seconds",
                                        "start_year") and name in self.__dict__:
                                if isinstance(value, YLeaf):
                                    self.__dict__[name].set(value.get())
                                elif isinstance(value, YLeafList):
                                    super(MacSecKeychains.MacSecKeychain.Keies.Key.Lifetime, self).__setattr__(name, value)
                                else:
                                    self.__dict__[name].set(value)
                            else:
                                if hasattr(value, "parent") and name != "parent":
                                    if hasattr(value, "is_presence_container") and value.is_presence_container:
                                        value.parent = self
                                    elif value.parent is None and value.yang_name in self._children_yang_names:
                                        value.parent = self
                                super(MacSecKeychains.MacSecKeychain.Keies.Key.Lifetime, self).__setattr__(name, value)

                    def has_data(self):
                        return (
                            self.end_date.is_set or
                            self.end_hour.is_set or
                            self.end_minutes.is_set or
                            self.end_month.is_set or
                            self.end_seconds.is_set or
                            self.end_year.is_set or
                            self.infinite_flag.is_set or
                            self.life_time.is_set or
                            self.start_date.is_set or
                            self.start_hour.is_set or
                            self.start_minutes.is_set or
                            self.start_month.is_set or
                            self.start_seconds.is_set or
                            self.start_year.is_set)

                    def has_operation(self):
                        return (
                            self.yfilter != YFilter.not_set or
                            self.end_date.yfilter != YFilter.not_set or
                            self.end_hour.yfilter != YFilter.not_set or
                            self.end_minutes.yfilter != YFilter.not_set or
                            self.end_month.yfilter != YFilter.not_set or
                            self.end_seconds.yfilter != YFilter.not_set or
                            self.end_year.yfilter != YFilter.not_set or
                            self.infinite_flag.yfilter != YFilter.not_set or
                            self.life_time.yfilter != YFilter.not_set or
                            self.start_date.yfilter != YFilter.not_set or
                            self.start_hour.yfilter != YFilter.not_set or
                            self.start_minutes.yfilter != YFilter.not_set or
                            self.start_month.yfilter != YFilter.not_set or
                            self.start_seconds.yfilter != YFilter.not_set or
                            self.start_year.yfilter != YFilter.not_set)

                    def get_segment_path(self):
                        path_buffer = ""
                        path_buffer = "lifetime" + path_buffer

                        return path_buffer

                    def get_entity_path(self, ancestor):
                        path_buffer = ""
                        if (ancestor is None):
                            raise YPYModelError("ancestor cannot be None as one of the ancestors is a list")
                        else:
                            path_buffer = _get_relative_entity_path(self, ancestor, path_buffer)

                        leaf_name_data = LeafDataList()
                        if (self.end_date.is_set or self.end_date.yfilter != YFilter.not_set):
                            leaf_name_data.append(self.end_date.get_name_leafdata())
                        if (self.end_hour.is_set or self.end_hour.yfilter != YFilter.not_set):
                            leaf_name_data.append(self.end_hour.get_name_leafdata())
                        if (self.end_minutes.is_set or self.end_minutes.yfilter != YFilter.not_set):
                            leaf_name_data.append(self.end_minutes.get_name_leafdata())
                        if (self.end_month.is_set or self.end_month.yfilter != YFilter.not_set):
                            leaf_name_data.append(self.end_month.get_name_leafdata())
                        if (self.end_seconds.is_set or self.end_seconds.yfilter != YFilter.not_set):
                            leaf_name_data.append(self.end_seconds.get_name_leafdata())
                        if (self.end_year.is_set or self.end_year.yfilter != YFilter.not_set):
                            leaf_name_data.append(self.end_year.get_name_leafdata())
                        if (self.infinite_flag.is_set or self.infinite_flag.yfilter != YFilter.not_set):
                            leaf_name_data.append(self.infinite_flag.get_name_leafdata())
                        if (self.life_time.is_set or self.life_time.yfilter != YFilter.not_set):
                            leaf_name_data.append(self.life_time.get_name_leafdata())
                        if (self.start_date.is_set or self.start_date.yfilter != YFilter.not_set):
                            leaf_name_data.append(self.start_date.get_name_leafdata())
                        if (self.start_hour.is_set or self.start_hour.yfilter != YFilter.not_set):
                            leaf_name_data.append(self.start_hour.get_name_leafdata())
                        if (self.start_minutes.is_set or self.start_minutes.yfilter != YFilter.not_set):
                            leaf_name_data.append(self.start_minutes.get_name_leafdata())
                        if (self.start_month.is_set or self.start_month.yfilter != YFilter.not_set):
                            leaf_name_data.append(self.start_month.get_name_leafdata())
                        if (self.start_seconds.is_set or self.start_seconds.yfilter != YFilter.not_set):
                            leaf_name_data.append(self.start_seconds.get_name_leafdata())
                        if (self.start_year.is_set or self.start_year.yfilter != YFilter.not_set):
                            leaf_name_data.append(self.start_year.get_name_leafdata())

                        entity_path = EntityPath(path_buffer, leaf_name_data)
                        return entity_path

                    def get_child_by_name(self, child_yang_name, segment_path):
                        child = self._get_child_by_seg_name([child_yang_name, segment_path])
                        if child is not None:
                            return child

                        return None

                    def has_leaf_or_child_of_name(self, name):
                        if(name == "end-date" or name == "end-hour" or name == "end-minutes" or name == "end-month" or name == "end-seconds" or name == "end-year" or name == "infinite-flag" or name == "life-time" or name == "start-date" or name == "start-hour" or name == "start-minutes" or name == "start-month" or name == "start-seconds" or name == "start-year"):
                            return True
                        return False

                    def set_value(self, value_path, value, name_space, name_space_prefix):
                        if(value_path == "end-date"):
                            self.end_date = value
                            self.end_date.value_namespace = name_space
                            self.end_date.value_namespace_prefix = name_space_prefix
                        if(value_path == "end-hour"):
                            self.end_hour = value
                            self.end_hour.value_namespace = name_space
                            self.end_hour.value_namespace_prefix = name_space_prefix
                        if(value_path == "end-minutes"):
                            self.end_minutes = value
                            self.end_minutes.value_namespace = name_space
                            self.end_minutes.value_namespace_prefix = name_space_prefix
                        if(value_path == "end-month"):
                            self.end_month = value
                            self.end_month.value_namespace = name_space
                            self.end_month.value_namespace_prefix = name_space_prefix
                        if(value_path == "end-seconds"):
                            self.end_seconds = value
                            self.end_seconds.value_namespace = name_space
                            self.end_seconds.value_namespace_prefix = name_space_prefix
                        if(value_path == "end-year"):
                            self.end_year = value
                            self.end_year.value_namespace = name_space
                            self.end_year.value_namespace_prefix = name_space_prefix
                        if(value_path == "infinite-flag"):
                            self.infinite_flag = value
                            self.infinite_flag.value_namespace = name_space
                            self.infinite_flag.value_namespace_prefix = name_space_prefix
                        if(value_path == "life-time"):
                            self.life_time = value
                            self.life_time.value_namespace = name_space
                            self.life_time.value_namespace_prefix = name_space_prefix
                        if(value_path == "start-date"):
                            self.start_date = value
                            self.start_date.value_namespace = name_space
                            self.start_date.value_namespace_prefix = name_space_prefix
                        if(value_path == "start-hour"):
                            self.start_hour = value
                            self.start_hour.value_namespace = name_space
                            self.start_hour.value_namespace_prefix = name_space_prefix
                        if(value_path == "start-minutes"):
                            self.start_minutes = value
                            self.start_minutes.value_namespace = name_space
                            self.start_minutes.value_namespace_prefix = name_space_prefix
                        if(value_path == "start-month"):
                            self.start_month = value
                            self.start_month.value_namespace = name_space
                            self.start_month.value_namespace_prefix = name_space_prefix
                        if(value_path == "start-seconds"):
                            self.start_seconds = value
                            self.start_seconds.value_namespace = name_space
                            self.start_seconds.value_namespace_prefix = name_space_prefix
                        if(value_path == "start-year"):
                            self.start_year = value
                            self.start_year.value_namespace = name_space
                            self.start_year.value_namespace_prefix = name_space_prefix


                class KeyString(Entity):
                    """
                    Configure a clear text/encrypted Key string
                    along with cryptographic algorithm
                    
                    .. attribute:: cryptographic_algorithm
                    
                    	Cryptographic Algorithm
                    	**type**\:   :py:class:`MacSecCryptoAlg <ydk.models.cisco_ios_xr.Cisco_IOS_XR_lib_keychain_macsec_cfg.MacSecCryptoAlg>`
                    
                    	**mandatory**\: True
                    
                    .. attribute:: encryption_type
                    
                    	encryption type used to store key
                    	**type**\:  int
                    
                    	**range:** \-2147483648..2147483647
                    
                    	**default value**\: 0
                    
                    .. attribute:: string
                    
                    	Key String
                    	**type**\:  str
                    
                    	**pattern:** (!.+)\|([^!].+)
                    
                    	**mandatory**\: True
                    
                    

                    This class is a :ref:`presence class<presence-class>`

                    """

                    _prefix = 'lib-keychain-macsec-cfg'
                    _revision = '2015-11-09'

                    def __init__(self):
                        super(MacSecKeychains.MacSecKeychain.Keies.Key.KeyString, self).__init__()

                        self.yang_name = "key-string"
                        self.yang_parent_name = "key"
                        self.is_presence_container = True

                        self.cryptographic_algorithm = YLeaf(YType.enumeration, "cryptographic-algorithm")

                        self.encryption_type = YLeaf(YType.int32, "encryption-type")

                        self.string = YLeaf(YType.str, "string")

                    def __setattr__(self, name, value):
                        self._check_monkey_patching_error(name, value)
                        with _handle_type_error():
                            if name in self.__dict__ and isinstance(self.__dict__[name], YList):
                                raise YPYModelError("Attempt to assign value of '{}' to YList ldata. "
                                                    "Please use list append or extend method."
                                                    .format(value))
                            if isinstance(value, Enum.YLeaf):
                                value = value.name
                            if name in ("cryptographic_algorithm",
                                        "encryption_type",
                                        "string") and name in self.__dict__:
                                if isinstance(value, YLeaf):
                                    self.__dict__[name].set(value.get())
                                elif isinstance(value, YLeafList):
                                    super(MacSecKeychains.MacSecKeychain.Keies.Key.KeyString, self).__setattr__(name, value)
                                else:
                                    self.__dict__[name].set(value)
                            else:
                                if hasattr(value, "parent") and name != "parent":
                                    if hasattr(value, "is_presence_container") and value.is_presence_container:
                                        value.parent = self
                                    elif value.parent is None and value.yang_name in self._children_yang_names:
                                        value.parent = self
                                super(MacSecKeychains.MacSecKeychain.Keies.Key.KeyString, self).__setattr__(name, value)

                    def has_data(self):
                        return (
                            self.cryptographic_algorithm.is_set or
                            self.encryption_type.is_set or
                            self.string.is_set)

                    def has_operation(self):
                        return (
                            self.yfilter != YFilter.not_set or
                            self.cryptographic_algorithm.yfilter != YFilter.not_set or
                            self.encryption_type.yfilter != YFilter.not_set or
                            self.string.yfilter != YFilter.not_set)

                    def get_segment_path(self):
                        path_buffer = ""
                        path_buffer = "key-string" + path_buffer

                        return path_buffer

                    def get_entity_path(self, ancestor):
                        path_buffer = ""
                        if (ancestor is None):
                            raise YPYModelError("ancestor cannot be None as one of the ancestors is a list")
                        else:
                            path_buffer = _get_relative_entity_path(self, ancestor, path_buffer)

                        leaf_name_data = LeafDataList()
                        if (self.cryptographic_algorithm.is_set or self.cryptographic_algorithm.yfilter != YFilter.not_set):
                            leaf_name_data.append(self.cryptographic_algorithm.get_name_leafdata())
                        if (self.encryption_type.is_set or self.encryption_type.yfilter != YFilter.not_set):
                            leaf_name_data.append(self.encryption_type.get_name_leafdata())
                        if (self.string.is_set or self.string.yfilter != YFilter.not_set):
                            leaf_name_data.append(self.string.get_name_leafdata())

                        entity_path = EntityPath(path_buffer, leaf_name_data)
                        return entity_path

                    def get_child_by_name(self, child_yang_name, segment_path):
                        child = self._get_child_by_seg_name([child_yang_name, segment_path])
                        if child is not None:
                            return child

                        return None

                    def has_leaf_or_child_of_name(self, name):
                        if(name == "cryptographic-algorithm" or name == "encryption-type" or name == "string"):
                            return True
                        return False

                    def set_value(self, value_path, value, name_space, name_space_prefix):
                        if(value_path == "cryptographic-algorithm"):
                            self.cryptographic_algorithm = value
                            self.cryptographic_algorithm.value_namespace = name_space
                            self.cryptographic_algorithm.value_namespace_prefix = name_space_prefix
                        if(value_path == "encryption-type"):
                            self.encryption_type = value
                            self.encryption_type.value_namespace = name_space
                            self.encryption_type.value_namespace_prefix = name_space_prefix
                        if(value_path == "string"):
                            self.string = value
                            self.string.value_namespace = name_space
                            self.string.value_namespace_prefix = name_space_prefix

                def has_data(self):
                    return (
                        self.key_id.is_set or
                        (self.lifetime is not None and self.lifetime.has_data()) or
                        (self.key_string is not None))

                def has_operation(self):
                    return (
                        self.yfilter != YFilter.not_set or
                        self.key_id.yfilter != YFilter.not_set or
                        (self.key_string is not None and self.key_string.has_operation()) or
                        (self.lifetime is not None and self.lifetime.has_operation()))

                def get_segment_path(self):
                    path_buffer = ""
                    path_buffer = "key" + "[key-id='" + self.key_id.get() + "']" + path_buffer

                    return path_buffer

                def get_entity_path(self, ancestor):
                    path_buffer = ""
                    if (ancestor is None):
                        raise YPYModelError("ancestor cannot be None as one of the ancestors is a list")
                    else:
                        path_buffer = _get_relative_entity_path(self, ancestor, path_buffer)

                    leaf_name_data = LeafDataList()
                    if (self.key_id.is_set or self.key_id.yfilter != YFilter.not_set):
                        leaf_name_data.append(self.key_id.get_name_leafdata())

                    entity_path = EntityPath(path_buffer, leaf_name_data)
                    return entity_path

                def get_child_by_name(self, child_yang_name, segment_path):
                    child = self._get_child_by_seg_name([child_yang_name, segment_path])
                    if child is not None:
                        return child

                    if (child_yang_name == "key-string"):
                        if (self.key_string is None):
                            self.key_string = MacSecKeychains.MacSecKeychain.Keies.Key.KeyString()
                            self.key_string.parent = self
                            self._children_name_map["key_string"] = "key-string"
                        return self.key_string

                    if (child_yang_name == "lifetime"):
                        if (self.lifetime is None):
                            self.lifetime = MacSecKeychains.MacSecKeychain.Keies.Key.Lifetime()
                            self.lifetime.parent = self
                            self._children_name_map["lifetime"] = "lifetime"
                        return self.lifetime

                    return None

                def has_leaf_or_child_of_name(self, name):
                    if(name == "key-string" or name == "lifetime" or name == "key-id"):
                        return True
                    return False

                def set_value(self, value_path, value, name_space, name_space_prefix):
                    if(value_path == "key-id"):
                        self.key_id = value
                        self.key_id.value_namespace = name_space
                        self.key_id.value_namespace_prefix = name_space_prefix

            def has_data(self):
                for c in self.key:
                    if (c.has_data()):
                        return True
                return False

            def has_operation(self):
                for c in self.key:
                    if (c.has_operation()):
                        return True
                return self.yfilter != YFilter.not_set

            def get_segment_path(self):
                path_buffer = ""
                path_buffer = "keies" + path_buffer

                return path_buffer

            def get_entity_path(self, ancestor):
                path_buffer = ""
                if (ancestor is None):
                    raise YPYModelError("ancestor cannot be None as one of the ancestors is a list")
                else:
                    path_buffer = _get_relative_entity_path(self, ancestor, path_buffer)

                leaf_name_data = LeafDataList()

                entity_path = EntityPath(path_buffer, leaf_name_data)
                return entity_path

            def get_child_by_name(self, child_yang_name, segment_path):
                child = self._get_child_by_seg_name([child_yang_name, segment_path])
                if child is not None:
                    return child

                if (child_yang_name == "key"):
                    for c in self.key:
                        segment = c.get_segment_path()
                        if (segment_path == segment):
                            return c
                    c = MacSecKeychains.MacSecKeychain.Keies.Key()
                    c.parent = self
                    local_reference_key = "ydk::seg::%s" % segment_path
                    self._local_refs[local_reference_key] = c
                    self.key.append(c)
                    return c

                return None

            def has_leaf_or_child_of_name(self, name):
                if(name == "key"):
                    return True
                return False

            def set_value(self, value_path, value, name_space, name_space_prefix):
                pass
Пример #16
0
    class Sessions(Entity):
        """
        Monitor\-session configuration commands
        
        .. attribute:: session
        
        	Configuration for a particular Monitor Session
        	**type**\: list of    :py:class:`Session <ydk.models.cisco_ios_xr.Cisco_IOS_XR_Ethernet_SPAN_cfg.SpanMonitorSession.Sessions.Session>`
        
        

        """

        _prefix = 'ethernet-span-cfg'
        _revision = '2015-11-09'

        def __init__(self):
            super(SpanMonitorSession.Sessions, self).__init__()

            self.yang_name = "sessions"
            self.yang_parent_name = "span-monitor-session"

            self.session = YList(self)

        def __setattr__(self, name, value):
            self._check_monkey_patching_error(name, value)
            with _handle_type_error():
                if name in self.__dict__ and isinstance(
                        self.__dict__[name], YList):
                    raise YPYModelError(
                        "Attempt to assign value of '{}' to YList ldata. "
                        "Please use list append or extend method.".format(
                            value))
                if isinstance(value, Enum.YLeaf):
                    value = value.name
                if name in () and name in self.__dict__:
                    if isinstance(value, YLeaf):
                        self.__dict__[name].set(value.get())
                    elif isinstance(value, YLeafList):
                        super(SpanMonitorSession.Sessions,
                              self).__setattr__(name, value)
                    else:
                        self.__dict__[name].set(value)
                else:
                    if hasattr(value, "parent") and name != "parent":
                        if hasattr(value, "is_presence_container"
                                   ) and value.is_presence_container:
                            value.parent = self
                        elif value.parent is None and value.yang_name in self._children_yang_names:
                            value.parent = self
                    super(SpanMonitorSession.Sessions,
                          self).__setattr__(name, value)

        class Session(Entity):
            """
            Configuration for a particular Monitor Session
            
            .. attribute:: session  <key>
            
            	Session Name
            	**type**\:  str
            
            	**length:** 1..79
            
            .. attribute:: class_
            
            	Enable a Monitor Session.  Setting this item causes the Monitor Session to be created
            	**type**\:   :py:class:`SpanSessionClass <ydk.models.cisco_ios_xr.Cisco_IOS_XR_Ethernet_SPAN_datatypes.SpanSessionClass>`
            
            	**default value**\: ethernet
            
            .. attribute:: destination
            
            	Specify a destination
            	**type**\:   :py:class:`Destination <ydk.models.cisco_ios_xr.Cisco_IOS_XR_Ethernet_SPAN_cfg.SpanMonitorSession.Sessions.Session.Destination>`
            
            

            """

            _prefix = 'ethernet-span-cfg'
            _revision = '2015-11-09'

            def __init__(self):
                super(SpanMonitorSession.Sessions.Session, self).__init__()

                self.yang_name = "session"
                self.yang_parent_name = "sessions"

                self.session = YLeaf(YType.str, "session")

                self.class_ = YLeaf(YType.enumeration, "class")

                self.destination = SpanMonitorSession.Sessions.Session.Destination(
                )
                self.destination.parent = self
                self._children_name_map["destination"] = "destination"
                self._children_yang_names.add("destination")

            def __setattr__(self, name, value):
                self._check_monkey_patching_error(name, value)
                with _handle_type_error():
                    if name in self.__dict__ and isinstance(
                            self.__dict__[name], YList):
                        raise YPYModelError(
                            "Attempt to assign value of '{}' to YList ldata. "
                            "Please use list append or extend method.".format(
                                value))
                    if isinstance(value, Enum.YLeaf):
                        value = value.name
                    if name in ("session", "class_") and name in self.__dict__:
                        if isinstance(value, YLeaf):
                            self.__dict__[name].set(value.get())
                        elif isinstance(value, YLeafList):
                            super(SpanMonitorSession.Sessions.Session,
                                  self).__setattr__(name, value)
                        else:
                            self.__dict__[name].set(value)
                    else:
                        if hasattr(value, "parent") and name != "parent":
                            if hasattr(value, "is_presence_container"
                                       ) and value.is_presence_container:
                                value.parent = self
                            elif value.parent is None and value.yang_name in self._children_yang_names:
                                value.parent = self
                        super(SpanMonitorSession.Sessions.Session,
                              self).__setattr__(name, value)

            class Destination(Entity):
                """
                Specify a destination
                
                .. attribute:: destination_interface_name
                
                	Specify the destination interface name
                	**type**\:  str
                
                	**pattern:** (([a\-zA\-Z0\-9\_]\*\\d+/){3,4}\\d+)\|(([a\-zA\-Z0\-9\_]\*\\d+/){3,4}\\d+\\.\\d+)\|(([a\-zA\-Z0\-9\_]\*\\d+/){2}([a\-zA\-Z0\-9\_]\*\\d+))\|(([a\-zA\-Z0\-9\_]\*\\d+/){2}([a\-zA\-Z0\-9\_]+))\|([a\-zA\-Z0\-9\_\-]\*\\d+)\|([a\-zA\-Z0\-9\_\-]\*\\d+\\.\\d+)\|(mpls)\|(dwdm)
                
                .. attribute:: destination_ipv4_address
                
                	Specify the destination next\-hop IPv4 address
                	**type**\:  str
                
                	**pattern:** (([0\-9]\|[1\-9][0\-9]\|1[0\-9][0\-9]\|2[0\-4][0\-9]\|25[0\-5])\\.){3}([0\-9]\|[1\-9][0\-9]\|1[0\-9][0\-9]\|2[0\-4][0\-9]\|25[0\-5])(%[\\p{N}\\p{L}]+)?
                
                .. attribute:: destination_ipv6_address
                
                	Specify the destination next\-hop IPv6 address
                	**type**\:  str
                
                	**pattern:** ((\:\|[0\-9a\-fA\-F]{0,4})\:)([0\-9a\-fA\-F]{0,4}\:){0,5}((([0\-9a\-fA\-F]{0,4}\:)?(\:\|[0\-9a\-fA\-F]{0,4}))\|(((25[0\-5]\|2[0\-4][0\-9]\|[01]?[0\-9]?[0\-9])\\.){3}(25[0\-5]\|2[0\-4][0\-9]\|[01]?[0\-9]?[0\-9])))(%[\\p{N}\\p{L}]+)?
                
                .. attribute:: destination_type
                
                	Specify the type of destination
                	**type**\:   :py:class:`SpanDestination <ydk.models.cisco_ios_xr.Cisco_IOS_XR_Ethernet_SPAN_cfg.SpanDestination>`
                
                

                """

                _prefix = 'ethernet-span-cfg'
                _revision = '2015-11-09'

                def __init__(self):
                    super(SpanMonitorSession.Sessions.Session.Destination,
                          self).__init__()

                    self.yang_name = "destination"
                    self.yang_parent_name = "session"

                    self.destination_interface_name = YLeaf(
                        YType.str, "destination-interface-name")

                    self.destination_ipv4_address = YLeaf(
                        YType.str, "destination-ipv4-address")

                    self.destination_ipv6_address = YLeaf(
                        YType.str, "destination-ipv6-address")

                    self.destination_type = YLeaf(YType.enumeration,
                                                  "destination-type")

                def __setattr__(self, name, value):
                    self._check_monkey_patching_error(name, value)
                    with _handle_type_error():
                        if name in self.__dict__ and isinstance(
                                self.__dict__[name], YList):
                            raise YPYModelError(
                                "Attempt to assign value of '{}' to YList ldata. "
                                "Please use list append or extend method.".
                                format(value))
                        if isinstance(value, Enum.YLeaf):
                            value = value.name
                        if name in (
                                "destination_interface_name",
                                "destination_ipv4_address",
                                "destination_ipv6_address",
                                "destination_type") and name in self.__dict__:
                            if isinstance(value, YLeaf):
                                self.__dict__[name].set(value.get())
                            elif isinstance(value, YLeafList):
                                super(
                                    SpanMonitorSession.Sessions.Session.
                                    Destination,
                                    self).__setattr__(name, value)
                            else:
                                self.__dict__[name].set(value)
                        else:
                            if hasattr(value, "parent") and name != "parent":
                                if hasattr(value, "is_presence_container"
                                           ) and value.is_presence_container:
                                    value.parent = self
                                elif value.parent is None and value.yang_name in self._children_yang_names:
                                    value.parent = self
                            super(
                                SpanMonitorSession.Sessions.Session.
                                Destination, self).__setattr__(name, value)

                def has_data(self):
                    return (self.destination_interface_name.is_set
                            or self.destination_ipv4_address.is_set
                            or self.destination_ipv6_address.is_set
                            or self.destination_type.is_set)

                def has_operation(self):
                    return (self.yfilter != YFilter.not_set
                            or self.destination_interface_name.yfilter !=
                            YFilter.not_set
                            or self.destination_ipv4_address.yfilter !=
                            YFilter.not_set
                            or self.destination_ipv6_address.yfilter !=
                            YFilter.not_set or
                            self.destination_type.yfilter != YFilter.not_set)

                def get_segment_path(self):
                    path_buffer = ""
                    path_buffer = "destination" + path_buffer

                    return path_buffer

                def get_entity_path(self, ancestor):
                    path_buffer = ""
                    if (ancestor is None):
                        raise YPYModelError(
                            "ancestor cannot be None as one of the ancestors is a list"
                        )
                    else:
                        path_buffer = _get_relative_entity_path(
                            self, ancestor, path_buffer)

                    leaf_name_data = LeafDataList()
                    if (self.destination_interface_name.is_set
                            or self.destination_interface_name.yfilter !=
                            YFilter.not_set):
                        leaf_name_data.append(self.destination_interface_name.
                                              get_name_leafdata())
                    if (self.destination_ipv4_address.is_set
                            or self.destination_ipv4_address.yfilter !=
                            YFilter.not_set):
                        leaf_name_data.append(
                            self.destination_ipv4_address.get_name_leafdata())
                    if (self.destination_ipv6_address.is_set
                            or self.destination_ipv6_address.yfilter !=
                            YFilter.not_set):
                        leaf_name_data.append(
                            self.destination_ipv6_address.get_name_leafdata())
                    if (self.destination_type.is_set or
                            self.destination_type.yfilter != YFilter.not_set):
                        leaf_name_data.append(
                            self.destination_type.get_name_leafdata())

                    entity_path = EntityPath(path_buffer, leaf_name_data)
                    return entity_path

                def get_child_by_name(self, child_yang_name, segment_path):
                    child = self._get_child_by_seg_name(
                        [child_yang_name, segment_path])
                    if child is not None:
                        return child

                    return None

                def has_leaf_or_child_of_name(self, name):
                    if (name == "destination-interface-name"
                            or name == "destination-ipv4-address"
                            or name == "destination-ipv6-address"
                            or name == "destination-type"):
                        return True
                    return False

                def set_value(self, value_path, value, name_space,
                              name_space_prefix):
                    if (value_path == "destination-interface-name"):
                        self.destination_interface_name = value
                        self.destination_interface_name.value_namespace = name_space
                        self.destination_interface_name.value_namespace_prefix = name_space_prefix
                    if (value_path == "destination-ipv4-address"):
                        self.destination_ipv4_address = value
                        self.destination_ipv4_address.value_namespace = name_space
                        self.destination_ipv4_address.value_namespace_prefix = name_space_prefix
                    if (value_path == "destination-ipv6-address"):
                        self.destination_ipv6_address = value
                        self.destination_ipv6_address.value_namespace = name_space
                        self.destination_ipv6_address.value_namespace_prefix = name_space_prefix
                    if (value_path == "destination-type"):
                        self.destination_type = value
                        self.destination_type.value_namespace = name_space
                        self.destination_type.value_namespace_prefix = name_space_prefix

            def has_data(self):
                return (self.session.is_set or self.class_.is_set
                        or (self.destination is not None
                            and self.destination.has_data()))

            def has_operation(self):
                return (self.yfilter != YFilter.not_set
                        or self.session.yfilter != YFilter.not_set
                        or self.class_.yfilter != YFilter.not_set
                        or (self.destination is not None
                            and self.destination.has_operation()))

            def get_segment_path(self):
                path_buffer = ""
                path_buffer = "session" + "[session='" + self.session.get(
                ) + "']" + path_buffer

                return path_buffer

            def get_entity_path(self, ancestor):
                path_buffer = ""
                if (ancestor is None):
                    path_buffer = "Cisco-IOS-XR-Ethernet-SPAN-cfg:span-monitor-session/sessions/%s" % self.get_segment_path(
                    )
                else:
                    path_buffer = _get_relative_entity_path(
                        self, ancestor, path_buffer)

                leaf_name_data = LeafDataList()
                if (self.session.is_set
                        or self.session.yfilter != YFilter.not_set):
                    leaf_name_data.append(self.session.get_name_leafdata())
                if (self.class_.is_set
                        or self.class_.yfilter != YFilter.not_set):
                    leaf_name_data.append(self.class_.get_name_leafdata())

                entity_path = EntityPath(path_buffer, leaf_name_data)
                return entity_path

            def get_child_by_name(self, child_yang_name, segment_path):
                child = self._get_child_by_seg_name(
                    [child_yang_name, segment_path])
                if child is not None:
                    return child

                if (child_yang_name == "destination"):
                    if (self.destination is None):
                        self.destination = SpanMonitorSession.Sessions.Session.Destination(
                        )
                        self.destination.parent = self
                        self._children_name_map["destination"] = "destination"
                    return self.destination

                return None

            def has_leaf_or_child_of_name(self, name):
                if (name == "destination" or name == "session"
                        or name == "class"):
                    return True
                return False

            def set_value(self, value_path, value, name_space,
                          name_space_prefix):
                if (value_path == "session"):
                    self.session = value
                    self.session.value_namespace = name_space
                    self.session.value_namespace_prefix = name_space_prefix
                if (value_path == "class"):
                    self.class_ = value
                    self.class_.value_namespace = name_space
                    self.class_.value_namespace_prefix = name_space_prefix

        def has_data(self):
            for c in self.session:
                if (c.has_data()):
                    return True
            return False

        def has_operation(self):
            for c in self.session:
                if (c.has_operation()):
                    return True
            return self.yfilter != YFilter.not_set

        def get_segment_path(self):
            path_buffer = ""
            path_buffer = "sessions" + path_buffer

            return path_buffer

        def get_entity_path(self, ancestor):
            path_buffer = ""
            if (ancestor is None):
                path_buffer = "Cisco-IOS-XR-Ethernet-SPAN-cfg:span-monitor-session/%s" % self.get_segment_path(
                )
            else:
                path_buffer = _get_relative_entity_path(
                    self, ancestor, path_buffer)

            leaf_name_data = LeafDataList()

            entity_path = EntityPath(path_buffer, leaf_name_data)
            return entity_path

        def get_child_by_name(self, child_yang_name, segment_path):
            child = self._get_child_by_seg_name(
                [child_yang_name, segment_path])
            if child is not None:
                return child

            if (child_yang_name == "session"):
                for c in self.session:
                    segment = c.get_segment_path()
                    if (segment_path == segment):
                        return c
                c = SpanMonitorSession.Sessions.Session()
                c.parent = self
                local_reference_key = "ydk::seg::%s" % segment_path
                self._local_refs[local_reference_key] = c
                self.session.append(c)
                return c

            return None

        def has_leaf_or_child_of_name(self, name):
            if (name == "session"):
                return True
            return False

        def set_value(self, value_path, value, name_space, name_space_prefix):
            pass
Пример #17
0
    class Mappings(Entity):
        """
        Mapping Server
        
        .. attribute:: mapping
        
        	IP prefix to SID mapping
        	**type**\: list of    :py:class:`Mapping <ydk.models.cisco_ios_xr.Cisco_IOS_XR_segment_routing_ms_cfg.Sr.Mappings.Mapping>`
        
        

        """

        _prefix = 'segment-routing-ms-cfg'
        _revision = '2015-11-09'

        def __init__(self):
            super(Sr.Mappings, self).__init__()

            self.yang_name = "mappings"
            self.yang_parent_name = "sr"

            self.mapping = YList(self)

        def __setattr__(self, name, value):
            self._check_monkey_patching_error(name, value)
            with _handle_type_error():
                if name in self.__dict__ and isinstance(self.__dict__[name], YList):
                    raise YPYModelError("Attempt to assign value of '{}' to YList ldata. "
                                        "Please use list append or extend method."
                                        .format(value))
                if isinstance(value, Enum.YLeaf):
                    value = value.name
                if name in () and name in self.__dict__:
                    if isinstance(value, YLeaf):
                        self.__dict__[name].set(value.get())
                    elif isinstance(value, YLeafList):
                        super(Sr.Mappings, self).__setattr__(name, value)
                    else:
                        self.__dict__[name].set(value)
                else:
                    if hasattr(value, "parent") and name != "parent":
                        if hasattr(value, "is_presence_container") and value.is_presence_container:
                            value.parent = self
                        elif value.parent is None and value.yang_name in self._children_yang_names:
                            value.parent = self
                    super(Sr.Mappings, self).__setattr__(name, value)


        class Mapping(Entity):
            """
            IP prefix to SID mapping
            
            .. attribute:: af  <key>
            
            	Address Family
            	**type**\:  str
            
            	**pattern:** [\\w\\\-\\.\:,\_@#%$\\+=\\\|;]+
            
            .. attribute:: ip  <key>
            
            	IP prefix
            	**type**\:  str
            
            	**pattern:** [\\w\\\-\\.\:,\_@#%$\\+=\\\|;]+
            
            .. attribute:: mask  <key>
            
            	Mask
            	**type**\:  int
            
            	**range:** \-2147483648..2147483647
            
            .. attribute:: flag_attached
            
            	Enable/Disable Attached flag
            	**type**\:   :py:class:`SrmsMiFlag <ydk.models.cisco_ios_xr.Cisco_IOS_XR_segment_routing_ms_cfg.SrmsMiFlag>`
            
            .. attribute:: sid_range
            
            	Range (number of SIDs)
            	**type**\:  int
            
            	**range:** \-2147483648..2147483647
            
            .. attribute:: sid_start
            
            	Start of SID index range
            	**type**\:  int
            
            	**range:** 0..1048575
            
            

            """

            _prefix = 'segment-routing-ms-cfg'
            _revision = '2015-11-09'

            def __init__(self):
                super(Sr.Mappings.Mapping, self).__init__()

                self.yang_name = "mapping"
                self.yang_parent_name = "mappings"

                self.af = YLeaf(YType.str, "af")

                self.ip = YLeaf(YType.str, "ip")

                self.mask = YLeaf(YType.int32, "mask")

                self.flag_attached = YLeaf(YType.enumeration, "flag-attached")

                self.sid_range = YLeaf(YType.int32, "sid-range")

                self.sid_start = YLeaf(YType.uint32, "sid-start")

            def __setattr__(self, name, value):
                self._check_monkey_patching_error(name, value)
                with _handle_type_error():
                    if name in self.__dict__ and isinstance(self.__dict__[name], YList):
                        raise YPYModelError("Attempt to assign value of '{}' to YList ldata. "
                                            "Please use list append or extend method."
                                            .format(value))
                    if isinstance(value, Enum.YLeaf):
                        value = value.name
                    if name in ("af",
                                "ip",
                                "mask",
                                "flag_attached",
                                "sid_range",
                                "sid_start") and name in self.__dict__:
                        if isinstance(value, YLeaf):
                            self.__dict__[name].set(value.get())
                        elif isinstance(value, YLeafList):
                            super(Sr.Mappings.Mapping, self).__setattr__(name, value)
                        else:
                            self.__dict__[name].set(value)
                    else:
                        if hasattr(value, "parent") and name != "parent":
                            if hasattr(value, "is_presence_container") and value.is_presence_container:
                                value.parent = self
                            elif value.parent is None and value.yang_name in self._children_yang_names:
                                value.parent = self
                        super(Sr.Mappings.Mapping, self).__setattr__(name, value)

            def has_data(self):
                return (
                    self.af.is_set or
                    self.ip.is_set or
                    self.mask.is_set or
                    self.flag_attached.is_set or
                    self.sid_range.is_set or
                    self.sid_start.is_set)

            def has_operation(self):
                return (
                    self.yfilter != YFilter.not_set or
                    self.af.yfilter != YFilter.not_set or
                    self.ip.yfilter != YFilter.not_set or
                    self.mask.yfilter != YFilter.not_set or
                    self.flag_attached.yfilter != YFilter.not_set or
                    self.sid_range.yfilter != YFilter.not_set or
                    self.sid_start.yfilter != YFilter.not_set)

            def get_segment_path(self):
                path_buffer = ""
                path_buffer = "mapping" + "[af='" + self.af.get() + "']" + "[ip='" + self.ip.get() + "']" + "[mask='" + self.mask.get() + "']" + path_buffer

                return path_buffer

            def get_entity_path(self, ancestor):
                path_buffer = ""
                if (ancestor is None):
                    path_buffer = "Cisco-IOS-XR-segment-routing-ms-cfg:sr/mappings/%s" % self.get_segment_path()
                else:
                    path_buffer = _get_relative_entity_path(self, ancestor, path_buffer)

                leaf_name_data = LeafDataList()
                if (self.af.is_set or self.af.yfilter != YFilter.not_set):
                    leaf_name_data.append(self.af.get_name_leafdata())
                if (self.ip.is_set or self.ip.yfilter != YFilter.not_set):
                    leaf_name_data.append(self.ip.get_name_leafdata())
                if (self.mask.is_set or self.mask.yfilter != YFilter.not_set):
                    leaf_name_data.append(self.mask.get_name_leafdata())
                if (self.flag_attached.is_set or self.flag_attached.yfilter != YFilter.not_set):
                    leaf_name_data.append(self.flag_attached.get_name_leafdata())
                if (self.sid_range.is_set or self.sid_range.yfilter != YFilter.not_set):
                    leaf_name_data.append(self.sid_range.get_name_leafdata())
                if (self.sid_start.is_set or self.sid_start.yfilter != YFilter.not_set):
                    leaf_name_data.append(self.sid_start.get_name_leafdata())

                entity_path = EntityPath(path_buffer, leaf_name_data)
                return entity_path

            def get_child_by_name(self, child_yang_name, segment_path):
                child = self._get_child_by_seg_name([child_yang_name, segment_path])
                if child is not None:
                    return child

                return None

            def has_leaf_or_child_of_name(self, name):
                if(name == "af" or name == "ip" or name == "mask" or name == "flag-attached" or name == "sid-range" or name == "sid-start"):
                    return True
                return False

            def set_value(self, value_path, value, name_space, name_space_prefix):
                if(value_path == "af"):
                    self.af = value
                    self.af.value_namespace = name_space
                    self.af.value_namespace_prefix = name_space_prefix
                if(value_path == "ip"):
                    self.ip = value
                    self.ip.value_namespace = name_space
                    self.ip.value_namespace_prefix = name_space_prefix
                if(value_path == "mask"):
                    self.mask = value
                    self.mask.value_namespace = name_space
                    self.mask.value_namespace_prefix = name_space_prefix
                if(value_path == "flag-attached"):
                    self.flag_attached = value
                    self.flag_attached.value_namespace = name_space
                    self.flag_attached.value_namespace_prefix = name_space_prefix
                if(value_path == "sid-range"):
                    self.sid_range = value
                    self.sid_range.value_namespace = name_space
                    self.sid_range.value_namespace_prefix = name_space_prefix
                if(value_path == "sid-start"):
                    self.sid_start = value
                    self.sid_start.value_namespace = name_space
                    self.sid_start.value_namespace_prefix = name_space_prefix

        def has_data(self):
            for c in self.mapping:
                if (c.has_data()):
                    return True
            return False

        def has_operation(self):
            for c in self.mapping:
                if (c.has_operation()):
                    return True
            return self.yfilter != YFilter.not_set

        def get_segment_path(self):
            path_buffer = ""
            path_buffer = "mappings" + path_buffer

            return path_buffer

        def get_entity_path(self, ancestor):
            path_buffer = ""
            if (ancestor is None):
                path_buffer = "Cisco-IOS-XR-segment-routing-ms-cfg:sr/%s" % self.get_segment_path()
            else:
                path_buffer = _get_relative_entity_path(self, ancestor, path_buffer)

            leaf_name_data = LeafDataList()

            entity_path = EntityPath(path_buffer, leaf_name_data)
            return entity_path

        def get_child_by_name(self, child_yang_name, segment_path):
            child = self._get_child_by_seg_name([child_yang_name, segment_path])
            if child is not None:
                return child

            if (child_yang_name == "mapping"):
                for c in self.mapping:
                    segment = c.get_segment_path()
                    if (segment_path == segment):
                        return c
                c = Sr.Mappings.Mapping()
                c.parent = self
                local_reference_key = "ydk::seg::%s" % segment_path
                self._local_refs[local_reference_key] = c
                self.mapping.append(c)
                return c

            return None

        def has_leaf_or_child_of_name(self, name):
            if(name == "mapping"):
                return True
            return False

        def set_value(self, value_path, value, name_space, name_space_prefix):
            pass
Пример #18
0
    class Cbpaccttable(Entity):
        """
        The cbpAcctTable provides statistics about ingress and egress 
        traffic on an interface. This data could be used for purposes 
        like billing.
        
        .. attribute:: cbpacctentry
        
        	Each cbpAcctEntry provides statistics for traffic of interest on an ingress and/or egress interfaces. The traffic of interest  may be used for purposes like billing, and is referred to from  here on in the MIB by the term 'traffic\-type', which corresponds to cbpAcctTrafficIndex. Traffic\-types are configured by the user on a per interface basis.  The statistics include ingress packet counts, ingress octet counts, egress packet counts and egress octet counts. Entries  are created when traffic\-type is configured on an interface. Entries are deleted automatically when the user  removes the corresponding traffic\-type configuration from an interface
        	**type**\: list of    :py:class:`Cbpacctentry <ydk.models.cisco_ios_xe.CISCO_BGP_POLICY_ACCOUNTING_MIB.CiscoBgpPolicyAccountingMib.Cbpaccttable.Cbpacctentry>`
        
        

        """

        _prefix = 'CISCO-BGP-POLICY-ACCOUNTING-MIB'
        _revision = '2002-07-26'

        def __init__(self):
            super(CiscoBgpPolicyAccountingMib.Cbpaccttable, self).__init__()

            self.yang_name = "cbpAcctTable"
            self.yang_parent_name = "CISCO-BGP-POLICY-ACCOUNTING-MIB"

            self.cbpacctentry = YList(self)

        def __setattr__(self, name, value):
            self._check_monkey_patching_error(name, value)
            with _handle_type_error():
                if name in self.__dict__ and isinstance(
                        self.__dict__[name], YList):
                    raise YPYModelError(
                        "Attempt to assign value of '{}' to YList ldata. "
                        "Please use list append or extend method.".format(
                            value))
                if isinstance(value, Enum.YLeaf):
                    value = value.name
                if name in () and name in self.__dict__:
                    if isinstance(value, YLeaf):
                        self.__dict__[name].set(value.get())
                    elif isinstance(value, YLeafList):
                        super(CiscoBgpPolicyAccountingMib.Cbpaccttable,
                              self).__setattr__(name, value)
                    else:
                        self.__dict__[name].set(value)
                else:
                    if hasattr(value, "parent") and name != "parent":
                        if hasattr(value, "is_presence_container"
                                   ) and value.is_presence_container:
                            value.parent = self
                        elif value.parent is None and value.yang_name in self._children_yang_names:
                            value.parent = self
                    super(CiscoBgpPolicyAccountingMib.Cbpaccttable,
                          self).__setattr__(name, value)

        class Cbpacctentry(Entity):
            """
            Each cbpAcctEntry provides statistics for traffic of interest
            on an ingress and/or egress interfaces. The traffic of interest 
            may be used for purposes like billing, and is referred to from 
            here on in the MIB by the term 'traffic\-type', which corresponds
            to cbpAcctTrafficIndex. Traffic\-types are configured by the user
            on a per interface basis.
            
            The statistics include ingress packet counts, ingress octet
            counts, egress packet counts and egress octet counts. Entries 
            are created when traffic\-type is configured on an interface.
            Entries are deleted automatically when the user 
            removes the corresponding traffic\-type configuration from an
            interface.
            
            .. attribute:: ifindex  <key>
            
            	
            	**type**\:  int
            
            	**range:** 1..2147483647
            
            	**refers to**\:  :py:class:`ifindex <ydk.models.cisco_ios_xe.IF_MIB.IfMib.Iftable.Ifentry>`
            
            .. attribute:: cbpaccttrafficindex  <key>
            
            	An integer value greater than 0, that uniquely identifies a traffic\-type. The traffic\-type has no intrinsic meaning. It just means the traffic coming into an interface can be differentiated into different types. It is up to the user to give meaning to and configure the various traffic\-types on an  interface
            	**type**\:  int
            
            	**range:** 1..2147483647
            
            .. attribute:: cbpacctinoctetcount
            
            	The total number of octets received for a particular traffic\-type on an interface
            	**type**\:  int
            
            	**range:** 0..18446744073709551615
            
            .. attribute:: cbpacctinpacketcount
            
            	The total number of packets received for a particular traffic\-type on an interface
            	**type**\:  int
            
            	**range:** 0..18446744073709551615
            
            .. attribute:: cbpacctoutoctetcount
            
            	The total number of octets transmitted for a particular traffic\-type on an interface
            	**type**\:  int
            
            	**range:** 0..18446744073709551615
            
            .. attribute:: cbpacctoutpacketcount
            
            	The total number of packets transmitted for a particular traffic\-type on an interface
            	**type**\:  int
            
            	**range:** 0..18446744073709551615
            
            

            """

            _prefix = 'CISCO-BGP-POLICY-ACCOUNTING-MIB'
            _revision = '2002-07-26'

            def __init__(self):
                super(CiscoBgpPolicyAccountingMib.Cbpaccttable.Cbpacctentry,
                      self).__init__()

                self.yang_name = "cbpAcctEntry"
                self.yang_parent_name = "cbpAcctTable"

                self.ifindex = YLeaf(YType.str, "ifIndex")

                self.cbpaccttrafficindex = YLeaf(YType.int32,
                                                 "cbpAcctTrafficIndex")

                self.cbpacctinoctetcount = YLeaf(YType.uint64,
                                                 "cbpAcctInOctetCount")

                self.cbpacctinpacketcount = YLeaf(YType.uint64,
                                                  "cbpAcctInPacketCount")

                self.cbpacctoutoctetcount = YLeaf(YType.uint64,
                                                  "cbpAcctOutOctetCount")

                self.cbpacctoutpacketcount = YLeaf(YType.uint64,
                                                   "cbpAcctOutPacketCount")

            def __setattr__(self, name, value):
                self._check_monkey_patching_error(name, value)
                with _handle_type_error():
                    if name in self.__dict__ and isinstance(
                            self.__dict__[name], YList):
                        raise YPYModelError(
                            "Attempt to assign value of '{}' to YList ldata. "
                            "Please use list append or extend method.".format(
                                value))
                    if isinstance(value, Enum.YLeaf):
                        value = value.name
                    if name in ("ifindex", "cbpaccttrafficindex",
                                "cbpacctinoctetcount", "cbpacctinpacketcount",
                                "cbpacctoutoctetcount", "cbpacctoutpacketcount"
                                ) and name in self.__dict__:
                        if isinstance(value, YLeaf):
                            self.__dict__[name].set(value.get())
                        elif isinstance(value, YLeafList):
                            super(
                                CiscoBgpPolicyAccountingMib.Cbpaccttable.
                                Cbpacctentry, self).__setattr__(name, value)
                        else:
                            self.__dict__[name].set(value)
                    else:
                        if hasattr(value, "parent") and name != "parent":
                            if hasattr(value, "is_presence_container"
                                       ) and value.is_presence_container:
                                value.parent = self
                            elif value.parent is None and value.yang_name in self._children_yang_names:
                                value.parent = self
                        super(
                            CiscoBgpPolicyAccountingMib.Cbpaccttable.
                            Cbpacctentry, self).__setattr__(name, value)

            def has_data(self):
                return (self.ifindex.is_set or self.cbpaccttrafficindex.is_set
                        or self.cbpacctinoctetcount.is_set
                        or self.cbpacctinpacketcount.is_set
                        or self.cbpacctoutoctetcount.is_set
                        or self.cbpacctoutpacketcount.is_set)

            def has_operation(self):
                return (self.yfilter != YFilter.not_set
                        or self.ifindex.yfilter != YFilter.not_set
                        or self.cbpaccttrafficindex.yfilter != YFilter.not_set
                        or self.cbpacctinoctetcount.yfilter != YFilter.not_set
                        or self.cbpacctinpacketcount.yfilter != YFilter.not_set
                        or self.cbpacctoutoctetcount.yfilter != YFilter.not_set
                        or
                        self.cbpacctoutpacketcount.yfilter != YFilter.not_set)

            def get_segment_path(self):
                path_buffer = ""
                path_buffer = "cbpAcctEntry" + "[ifIndex='" + self.ifindex.get(
                ) + "']" + "[cbpAcctTrafficIndex='" + self.cbpaccttrafficindex.get(
                ) + "']" + path_buffer

                return path_buffer

            def get_entity_path(self, ancestor):
                path_buffer = ""
                if (ancestor is None):
                    path_buffer = "CISCO-BGP-POLICY-ACCOUNTING-MIB:CISCO-BGP-POLICY-ACCOUNTING-MIB/cbpAcctTable/%s" % self.get_segment_path(
                    )
                else:
                    path_buffer = _get_relative_entity_path(
                        self, ancestor, path_buffer)

                leaf_name_data = LeafDataList()
                if (self.ifindex.is_set
                        or self.ifindex.yfilter != YFilter.not_set):
                    leaf_name_data.append(self.ifindex.get_name_leafdata())
                if (self.cbpaccttrafficindex.is_set or
                        self.cbpaccttrafficindex.yfilter != YFilter.not_set):
                    leaf_name_data.append(
                        self.cbpaccttrafficindex.get_name_leafdata())
                if (self.cbpacctinoctetcount.is_set or
                        self.cbpacctinoctetcount.yfilter != YFilter.not_set):
                    leaf_name_data.append(
                        self.cbpacctinoctetcount.get_name_leafdata())
                if (self.cbpacctinpacketcount.is_set or
                        self.cbpacctinpacketcount.yfilter != YFilter.not_set):
                    leaf_name_data.append(
                        self.cbpacctinpacketcount.get_name_leafdata())
                if (self.cbpacctoutoctetcount.is_set or
                        self.cbpacctoutoctetcount.yfilter != YFilter.not_set):
                    leaf_name_data.append(
                        self.cbpacctoutoctetcount.get_name_leafdata())
                if (self.cbpacctoutpacketcount.is_set or
                        self.cbpacctoutpacketcount.yfilter != YFilter.not_set):
                    leaf_name_data.append(
                        self.cbpacctoutpacketcount.get_name_leafdata())

                entity_path = EntityPath(path_buffer, leaf_name_data)
                return entity_path

            def get_child_by_name(self, child_yang_name, segment_path):
                child = self._get_child_by_seg_name(
                    [child_yang_name, segment_path])
                if child is not None:
                    return child

                return None

            def has_leaf_or_child_of_name(self, name):
                if (name == "ifIndex" or name == "cbpAcctTrafficIndex"
                        or name == "cbpAcctInOctetCount"
                        or name == "cbpAcctInPacketCount"
                        or name == "cbpAcctOutOctetCount"
                        or name == "cbpAcctOutPacketCount"):
                    return True
                return False

            def set_value(self, value_path, value, name_space,
                          name_space_prefix):
                if (value_path == "ifIndex"):
                    self.ifindex = value
                    self.ifindex.value_namespace = name_space
                    self.ifindex.value_namespace_prefix = name_space_prefix
                if (value_path == "cbpAcctTrafficIndex"):
                    self.cbpaccttrafficindex = value
                    self.cbpaccttrafficindex.value_namespace = name_space
                    self.cbpaccttrafficindex.value_namespace_prefix = name_space_prefix
                if (value_path == "cbpAcctInOctetCount"):
                    self.cbpacctinoctetcount = value
                    self.cbpacctinoctetcount.value_namespace = name_space
                    self.cbpacctinoctetcount.value_namespace_prefix = name_space_prefix
                if (value_path == "cbpAcctInPacketCount"):
                    self.cbpacctinpacketcount = value
                    self.cbpacctinpacketcount.value_namespace = name_space
                    self.cbpacctinpacketcount.value_namespace_prefix = name_space_prefix
                if (value_path == "cbpAcctOutOctetCount"):
                    self.cbpacctoutoctetcount = value
                    self.cbpacctoutoctetcount.value_namespace = name_space
                    self.cbpacctoutoctetcount.value_namespace_prefix = name_space_prefix
                if (value_path == "cbpAcctOutPacketCount"):
                    self.cbpacctoutpacketcount = value
                    self.cbpacctoutpacketcount.value_namespace = name_space
                    self.cbpacctoutpacketcount.value_namespace_prefix = name_space_prefix

        def has_data(self):
            for c in self.cbpacctentry:
                if (c.has_data()):
                    return True
            return False

        def has_operation(self):
            for c in self.cbpacctentry:
                if (c.has_operation()):
                    return True
            return self.yfilter != YFilter.not_set

        def get_segment_path(self):
            path_buffer = ""
            path_buffer = "cbpAcctTable" + path_buffer

            return path_buffer

        def get_entity_path(self, ancestor):
            path_buffer = ""
            if (ancestor is None):
                path_buffer = "CISCO-BGP-POLICY-ACCOUNTING-MIB:CISCO-BGP-POLICY-ACCOUNTING-MIB/%s" % self.get_segment_path(
                )
            else:
                path_buffer = _get_relative_entity_path(
                    self, ancestor, path_buffer)

            leaf_name_data = LeafDataList()

            entity_path = EntityPath(path_buffer, leaf_name_data)
            return entity_path

        def get_child_by_name(self, child_yang_name, segment_path):
            child = self._get_child_by_seg_name(
                [child_yang_name, segment_path])
            if child is not None:
                return child

            if (child_yang_name == "cbpAcctEntry"):
                for c in self.cbpacctentry:
                    segment = c.get_segment_path()
                    if (segment_path == segment):
                        return c
                c = CiscoBgpPolicyAccountingMib.Cbpaccttable.Cbpacctentry()
                c.parent = self
                local_reference_key = "ydk::seg::%s" % segment_path
                self._local_refs[local_reference_key] = c
                self.cbpacctentry.append(c)
                return c

            return None

        def has_leaf_or_child_of_name(self, name):
            if (name == "cbpAcctEntry"):
                return True
            return False

        def set_value(self, value_path, value, name_space, name_space_prefix):
            pass
class Macsec(Entity):
    """
    MACSec MKA
    
    .. attribute:: policy
    
    	MACSec Policy
    	**type**\: list of    :py:class:`Policy <ydk.models.cisco_ios_xr.Cisco_IOS_XR_crypto_macsec_mka_cfg.Macsec.Policy>`
    
    

    """

    _prefix = 'crypto-macsec-mka-cfg'
    _revision = '2015-11-09'

    def __init__(self):
        super(Macsec, self).__init__()
        self._top_entity = None

        self.yang_name = "macsec"
        self.yang_parent_name = "Cisco-IOS-XR-crypto-macsec-mka-cfg"

        self.policy = YList(self)

    def __setattr__(self, name, value):
        self._check_monkey_patching_error(name, value)
        with _handle_type_error():
            if name in self.__dict__ and isinstance(self.__dict__[name],
                                                    YList):
                raise YPYModelError(
                    "Attempt to assign value of '{}' to YList ldata. "
                    "Please use list append or extend method.".format(value))
            if isinstance(value, Enum.YLeaf):
                value = value.name
            if name in () and name in self.__dict__:
                if isinstance(value, YLeaf):
                    self.__dict__[name].set(value.get())
                elif isinstance(value, YLeafList):
                    super(Macsec, self).__setattr__(name, value)
                else:
                    self.__dict__[name].set(value)
            else:
                if hasattr(value, "parent") and name != "parent":
                    if hasattr(value, "is_presence_container"
                               ) and value.is_presence_container:
                        value.parent = self
                    elif value.parent is None and value.yang_name in self._children_yang_names:
                        value.parent = self
                super(Macsec, self).__setattr__(name, value)

    class Policy(Entity):
        """
        MACSec Policy
        
        .. attribute:: name  <key>
        
        	Name of the Policy of maximum length 16
        	**type**\:  str
        
        	**length:** 1..16
        
        .. attribute:: cipher_suite
        
        	Cipher\-suite of Policy
        	**type**\:   :py:class:`MacsecMkaCipherSuite <ydk.models.cisco_ios_xr.Cisco_IOS_XR_crypto_macsec_mka_cfg.MacsecMkaCipherSuite>`
        
        .. attribute:: conf_offset
        
        	Conf\-Offset of Policy
        	**type**\:   :py:class:`MacsecMkaConfOffset <ydk.models.cisco_ios_xr.Cisco_IOS_XR_crypto_macsec_mka_cfg.MacsecMkaConfOffset>`
        
        .. attribute:: delay_protection
        
        	TRUE enables data delay protection
        	**type**\:  bool
        
        .. attribute:: include_icv_indicator
        
        	TRUE enables Include ICV Indicator paramset in MKPDU
        	**type**\:  bool
        
        .. attribute:: key_server_priority
        
        	Key\-Server\-Priority of Policy
        	**type**\:  int
        
        	**range:** 0..255
        
        .. attribute:: policy_exception
        
        	Macsec policy exception for packets to be in clear
        	**type**\:   :py:class:`MacsecMkaPolicyException <ydk.models.cisco_ios_xr.Cisco_IOS_XR_crypto_macsec_mka_cfg.MacsecMkaPolicyException>`
        
        .. attribute:: sak_rekey_interval
        
        	Interval after which key\-server generates new SAK for a Secured Session
        	**type**\:  int
        
        	**range:** 0..43200
        
        	**units**\: minute
        
        .. attribute:: security_policy
        
        	Security\-Policy of Policy
        	**type**\:   :py:class:`MacsecMkaSecurityPolicy <ydk.models.cisco_ios_xr.Cisco_IOS_XR_crypto_macsec_mka_cfg.MacsecMkaSecurityPolicy>`
        
        .. attribute:: vlan_tags_in_clear
        
        	VLAN\-Tags\-In\-Clear of Policy
        	**type**\:  int
        
        	**range:** 1..2
        
        .. attribute:: window_size
        
        	Window\-Size of Policy
        	**type**\:  int
        
        	**range:** 0..1024
        
        

        """

        _prefix = 'crypto-macsec-mka-cfg'
        _revision = '2015-11-09'

        def __init__(self):
            super(Macsec.Policy, self).__init__()

            self.yang_name = "policy"
            self.yang_parent_name = "macsec"

            self.name = YLeaf(YType.str, "name")

            self.cipher_suite = YLeaf(YType.enumeration, "cipher-suite")

            self.conf_offset = YLeaf(YType.enumeration, "conf-offset")

            self.delay_protection = YLeaf(YType.boolean, "delay-protection")

            self.include_icv_indicator = YLeaf(YType.boolean,
                                               "include-icv-indicator")

            self.key_server_priority = YLeaf(YType.uint32,
                                             "key-server-priority")

            self.policy_exception = YLeaf(YType.enumeration,
                                          "policy-exception")

            self.sak_rekey_interval = YLeaf(YType.uint32, "sak-rekey-interval")

            self.security_policy = YLeaf(YType.enumeration, "security-policy")

            self.vlan_tags_in_clear = YLeaf(YType.uint32, "vlan-tags-in-clear")

            self.window_size = YLeaf(YType.uint32, "window-size")

        def __setattr__(self, name, value):
            self._check_monkey_patching_error(name, value)
            with _handle_type_error():
                if name in self.__dict__ and isinstance(
                        self.__dict__[name], YList):
                    raise YPYModelError(
                        "Attempt to assign value of '{}' to YList ldata. "
                        "Please use list append or extend method.".format(
                            value))
                if isinstance(value, Enum.YLeaf):
                    value = value.name
                if name in ("name", "cipher_suite", "conf_offset",
                            "delay_protection", "include_icv_indicator",
                            "key_server_priority", "policy_exception",
                            "sak_rekey_interval", "security_policy",
                            "vlan_tags_in_clear",
                            "window_size") and name in self.__dict__:
                    if isinstance(value, YLeaf):
                        self.__dict__[name].set(value.get())
                    elif isinstance(value, YLeafList):
                        super(Macsec.Policy, self).__setattr__(name, value)
                    else:
                        self.__dict__[name].set(value)
                else:
                    if hasattr(value, "parent") and name != "parent":
                        if hasattr(value, "is_presence_container"
                                   ) and value.is_presence_container:
                            value.parent = self
                        elif value.parent is None and value.yang_name in self._children_yang_names:
                            value.parent = self
                    super(Macsec.Policy, self).__setattr__(name, value)

        def has_data(self):
            return (self.name.is_set or self.cipher_suite.is_set
                    or self.conf_offset.is_set or self.delay_protection.is_set
                    or self.include_icv_indicator.is_set
                    or self.key_server_priority.is_set
                    or self.policy_exception.is_set
                    or self.sak_rekey_interval.is_set
                    or self.security_policy.is_set
                    or self.vlan_tags_in_clear.is_set
                    or self.window_size.is_set)

        def has_operation(self):
            return (self.yfilter != YFilter.not_set
                    or self.name.yfilter != YFilter.not_set
                    or self.cipher_suite.yfilter != YFilter.not_set
                    or self.conf_offset.yfilter != YFilter.not_set
                    or self.delay_protection.yfilter != YFilter.not_set
                    or self.include_icv_indicator.yfilter != YFilter.not_set
                    or self.key_server_priority.yfilter != YFilter.not_set
                    or self.policy_exception.yfilter != YFilter.not_set
                    or self.sak_rekey_interval.yfilter != YFilter.not_set
                    or self.security_policy.yfilter != YFilter.not_set
                    or self.vlan_tags_in_clear.yfilter != YFilter.not_set
                    or self.window_size.yfilter != YFilter.not_set)

        def get_segment_path(self):
            path_buffer = ""
            path_buffer = "policy" + "[name='" + self.name.get(
            ) + "']" + path_buffer

            return path_buffer

        def get_entity_path(self, ancestor):
            path_buffer = ""
            if (ancestor is None):
                path_buffer = "Cisco-IOS-XR-crypto-macsec-mka-cfg:macsec/%s" % self.get_segment_path(
                )
            else:
                path_buffer = _get_relative_entity_path(
                    self, ancestor, path_buffer)

            leaf_name_data = LeafDataList()
            if (self.name.is_set or self.name.yfilter != YFilter.not_set):
                leaf_name_data.append(self.name.get_name_leafdata())
            if (self.cipher_suite.is_set
                    or self.cipher_suite.yfilter != YFilter.not_set):
                leaf_name_data.append(self.cipher_suite.get_name_leafdata())
            if (self.conf_offset.is_set
                    or self.conf_offset.yfilter != YFilter.not_set):
                leaf_name_data.append(self.conf_offset.get_name_leafdata())
            if (self.delay_protection.is_set
                    or self.delay_protection.yfilter != YFilter.not_set):
                leaf_name_data.append(
                    self.delay_protection.get_name_leafdata())
            if (self.include_icv_indicator.is_set
                    or self.include_icv_indicator.yfilter != YFilter.not_set):
                leaf_name_data.append(
                    self.include_icv_indicator.get_name_leafdata())
            if (self.key_server_priority.is_set
                    or self.key_server_priority.yfilter != YFilter.not_set):
                leaf_name_data.append(
                    self.key_server_priority.get_name_leafdata())
            if (self.policy_exception.is_set
                    or self.policy_exception.yfilter != YFilter.not_set):
                leaf_name_data.append(
                    self.policy_exception.get_name_leafdata())
            if (self.sak_rekey_interval.is_set
                    or self.sak_rekey_interval.yfilter != YFilter.not_set):
                leaf_name_data.append(
                    self.sak_rekey_interval.get_name_leafdata())
            if (self.security_policy.is_set
                    or self.security_policy.yfilter != YFilter.not_set):
                leaf_name_data.append(self.security_policy.get_name_leafdata())
            if (self.vlan_tags_in_clear.is_set
                    or self.vlan_tags_in_clear.yfilter != YFilter.not_set):
                leaf_name_data.append(
                    self.vlan_tags_in_clear.get_name_leafdata())
            if (self.window_size.is_set
                    or self.window_size.yfilter != YFilter.not_set):
                leaf_name_data.append(self.window_size.get_name_leafdata())

            entity_path = EntityPath(path_buffer, leaf_name_data)
            return entity_path

        def get_child_by_name(self, child_yang_name, segment_path):
            child = self._get_child_by_seg_name(
                [child_yang_name, segment_path])
            if child is not None:
                return child

            return None

        def has_leaf_or_child_of_name(self, name):
            if (name == "name" or name == "cipher-suite"
                    or name == "conf-offset" or name == "delay-protection"
                    or name == "include-icv-indicator"
                    or name == "key-server-priority"
                    or name == "policy-exception"
                    or name == "sak-rekey-interval"
                    or name == "security-policy"
                    or name == "vlan-tags-in-clear" or name == "window-size"):
                return True
            return False

        def set_value(self, value_path, value, name_space, name_space_prefix):
            if (value_path == "name"):
                self.name = value
                self.name.value_namespace = name_space
                self.name.value_namespace_prefix = name_space_prefix
            if (value_path == "cipher-suite"):
                self.cipher_suite = value
                self.cipher_suite.value_namespace = name_space
                self.cipher_suite.value_namespace_prefix = name_space_prefix
            if (value_path == "conf-offset"):
                self.conf_offset = value
                self.conf_offset.value_namespace = name_space
                self.conf_offset.value_namespace_prefix = name_space_prefix
            if (value_path == "delay-protection"):
                self.delay_protection = value
                self.delay_protection.value_namespace = name_space
                self.delay_protection.value_namespace_prefix = name_space_prefix
            if (value_path == "include-icv-indicator"):
                self.include_icv_indicator = value
                self.include_icv_indicator.value_namespace = name_space
                self.include_icv_indicator.value_namespace_prefix = name_space_prefix
            if (value_path == "key-server-priority"):
                self.key_server_priority = value
                self.key_server_priority.value_namespace = name_space
                self.key_server_priority.value_namespace_prefix = name_space_prefix
            if (value_path == "policy-exception"):
                self.policy_exception = value
                self.policy_exception.value_namespace = name_space
                self.policy_exception.value_namespace_prefix = name_space_prefix
            if (value_path == "sak-rekey-interval"):
                self.sak_rekey_interval = value
                self.sak_rekey_interval.value_namespace = name_space
                self.sak_rekey_interval.value_namespace_prefix = name_space_prefix
            if (value_path == "security-policy"):
                self.security_policy = value
                self.security_policy.value_namespace = name_space
                self.security_policy.value_namespace_prefix = name_space_prefix
            if (value_path == "vlan-tags-in-clear"):
                self.vlan_tags_in_clear = value
                self.vlan_tags_in_clear.value_namespace = name_space
                self.vlan_tags_in_clear.value_namespace_prefix = name_space_prefix
            if (value_path == "window-size"):
                self.window_size = value
                self.window_size.value_namespace = name_space
                self.window_size.value_namespace_prefix = name_space_prefix

    def has_data(self):
        for c in self.policy:
            if (c.has_data()):
                return True
        return False

    def has_operation(self):
        for c in self.policy:
            if (c.has_operation()):
                return True
        return self.yfilter != YFilter.not_set

    def get_segment_path(self):
        path_buffer = ""
        path_buffer = "Cisco-IOS-XR-crypto-macsec-mka-cfg:macsec" + path_buffer

        return path_buffer

    def get_entity_path(self, ancestor):
        path_buffer = ""
        if (not ancestor is None):
            raise YPYModelError("ancestor has to be None for top-level node")

        path_buffer = self.get_segment_path()
        leaf_name_data = LeafDataList()

        entity_path = EntityPath(path_buffer, leaf_name_data)
        return entity_path

    def get_child_by_name(self, child_yang_name, segment_path):
        child = self._get_child_by_seg_name([child_yang_name, segment_path])
        if child is not None:
            return child

        if (child_yang_name == "policy"):
            for c in self.policy:
                segment = c.get_segment_path()
                if (segment_path == segment):
                    return c
            c = Macsec.Policy()
            c.parent = self
            local_reference_key = "ydk::seg::%s" % segment_path
            self._local_refs[local_reference_key] = c
            self.policy.append(c)
            return c

        return None

    def has_leaf_or_child_of_name(self, name):
        if (name == "policy"):
            return True
        return False

    def set_value(self, value_path, value, name_space, name_space_prefix):
        pass

    def clone_ptr(self):
        self._top_entity = Macsec()
        return self._top_entity
Пример #20
0
    class CfmMeps(Entity):
        """
        
        
        .. attribute:: cfm_mep
        
        	The list of MEP entries in the system
        	**type**\: list of    :py:class:`CfmMep <ydk.models.cisco_ios_xe.Cisco_IOS_XE_cfm_oper.CfmStatistics.CfmMeps.CfmMep>`
        
        

        """

        _prefix = 'cfm-stats-ios-xe-oper'
        _revision = '2017-02-07'

        def __init__(self):
            super(CfmStatistics.CfmMeps, self).__init__()

            self.yang_name = "cfm-meps"
            self.yang_parent_name = "cfm-statistics"

            self.cfm_mep = YList(self)

        def __setattr__(self, name, value):
            self._check_monkey_patching_error(name, value)
            with _handle_type_error():
                if name in self.__dict__ and isinstance(
                        self.__dict__[name], YList):
                    raise YPYModelError(
                        "Attempt to assign value of '{}' to YList ldata. "
                        "Please use list append or extend method.".format(
                            value))
                if isinstance(value, Enum.YLeaf):
                    value = value.name
                if name in () and name in self.__dict__:
                    if isinstance(value, YLeaf):
                        self.__dict__[name].set(value.get())
                    elif isinstance(value, YLeafList):
                        super(CfmStatistics.CfmMeps,
                              self).__setattr__(name, value)
                    else:
                        self.__dict__[name].set(value)
                else:
                    if hasattr(value, "parent") and name != "parent":
                        if hasattr(value, "is_presence_container"
                                   ) and value.is_presence_container:
                            value.parent = self
                        elif value.parent is None and value.yang_name in self._children_yang_names:
                            value.parent = self
                    super(CfmStatistics.CfmMeps, self).__setattr__(name, value)

        class CfmMep(Entity):
            """
            The list of MEP entries in the system.
            
            .. attribute:: domain_name  <key>
            
            	The name of the Domain corresponding the the MEP
            	**type**\:  str
            
            .. attribute:: ma_name  <key>
            
            	The name of the MA corresponding the the MEP
            	**type**\:  str
            
            .. attribute:: mpid  <key>
            
            	ID of the MEP
            	**type**\:  int
            
            	**range:** 0..4294967295
            
            .. attribute:: ccm_seq_errors
            
            	The number of CCM sequence number errors detected
            	**type**\:  int
            
            	**range:** 0..18446744073709551615
            
            .. attribute:: ccm_transmitted
            
            	The number of CCMs transmitted from the local MEP
            	**type**\:  int
            
            	**range:** 0..18446744073709551615
            
            .. attribute:: last_cleared
            
            	
            	**type**\:   :py:class:`LastCleared <ydk.models.cisco_ios_xe.Cisco_IOS_XE_cfm_oper.CfmStatistics.CfmMeps.CfmMep.LastCleared>`
            
            .. attribute:: lbr_received_bad
            
            	The number of loopback reply packets received  with corrupted data pattern
            	**type**\:  int
            
            	**range:** 0..18446744073709551615
            
            .. attribute:: lbr_received_ok
            
            	The number of valid loopback reply packets received
            	**type**\:  int
            
            	**range:** 0..18446744073709551615
            
            .. attribute:: lbr_seq_errors
            
            	The number of loopback reply packets received  with sequence number errors
            	**type**\:  int
            
            	**range:** 0..18446744073709551615
            
            .. attribute:: lbr_transmitted
            
            	The number of loopback reply packets transmitted from the local MEP
            	**type**\:  int
            
            	**range:** 0..18446744073709551615
            
            .. attribute:: ltr_unexpected
            
            	The number of unexpected linktrace reply packets  received at this MEP
            	**type**\:  int
            
            	**range:** 0..18446744073709551615
            
            

            """

            _prefix = 'cfm-stats-ios-xe-oper'
            _revision = '2017-02-07'

            def __init__(self):
                super(CfmStatistics.CfmMeps.CfmMep, self).__init__()

                self.yang_name = "cfm-mep"
                self.yang_parent_name = "cfm-meps"

                self.domain_name = YLeaf(YType.str, "domain-name")

                self.ma_name = YLeaf(YType.str, "ma-name")

                self.mpid = YLeaf(YType.uint32, "mpid")

                self.ccm_seq_errors = YLeaf(YType.uint64, "ccm-seq-errors")

                self.ccm_transmitted = YLeaf(YType.uint64, "ccm-transmitted")

                self.lbr_received_bad = YLeaf(YType.uint64, "lbr-received-bad")

                self.lbr_received_ok = YLeaf(YType.uint64, "lbr-received-ok")

                self.lbr_seq_errors = YLeaf(YType.uint64, "lbr-seq-errors")

                self.lbr_transmitted = YLeaf(YType.uint64, "lbr-transmitted")

                self.ltr_unexpected = YLeaf(YType.uint64, "ltr-unexpected")

                self.last_cleared = CfmStatistics.CfmMeps.CfmMep.LastCleared()
                self.last_cleared.parent = self
                self._children_name_map["last_cleared"] = "last-cleared"
                self._children_yang_names.add("last-cleared")

            def __setattr__(self, name, value):
                self._check_monkey_patching_error(name, value)
                with _handle_type_error():
                    if name in self.__dict__ and isinstance(
                            self.__dict__[name], YList):
                        raise YPYModelError(
                            "Attempt to assign value of '{}' to YList ldata. "
                            "Please use list append or extend method.".format(
                                value))
                    if isinstance(value, Enum.YLeaf):
                        value = value.name
                    if name in ("domain_name", "ma_name", "mpid",
                                "ccm_seq_errors", "ccm_transmitted",
                                "lbr_received_bad", "lbr_received_ok",
                                "lbr_seq_errors", "lbr_transmitted",
                                "ltr_unexpected") and name in self.__dict__:
                        if isinstance(value, YLeaf):
                            self.__dict__[name].set(value.get())
                        elif isinstance(value, YLeafList):
                            super(CfmStatistics.CfmMeps.CfmMep,
                                  self).__setattr__(name, value)
                        else:
                            self.__dict__[name].set(value)
                    else:
                        if hasattr(value, "parent") and name != "parent":
                            if hasattr(value, "is_presence_container"
                                       ) and value.is_presence_container:
                                value.parent = self
                            elif value.parent is None and value.yang_name in self._children_yang_names:
                                value.parent = self
                        super(CfmStatistics.CfmMeps.CfmMep,
                              self).__setattr__(name, value)

            class LastCleared(Entity):
                """
                
                
                .. attribute:: never
                
                	
                	**type**\:  :py:class:`Empty<ydk.types.Empty>`
                
                .. attribute:: time
                
                	
                	**type**\:  str
                
                

                """

                _prefix = 'cfm-stats-ios-xe-oper'
                _revision = '2017-02-07'

                def __init__(self):
                    super(CfmStatistics.CfmMeps.CfmMep.LastCleared,
                          self).__init__()

                    self.yang_name = "last-cleared"
                    self.yang_parent_name = "cfm-mep"

                    self.never = YLeaf(YType.empty, "never")

                    self.time = YLeaf(YType.str, "time")

                def __setattr__(self, name, value):
                    self._check_monkey_patching_error(name, value)
                    with _handle_type_error():
                        if name in self.__dict__ and isinstance(
                                self.__dict__[name], YList):
                            raise YPYModelError(
                                "Attempt to assign value of '{}' to YList ldata. "
                                "Please use list append or extend method.".
                                format(value))
                        if isinstance(value, Enum.YLeaf):
                            value = value.name
                        if name in ("never", "time") and name in self.__dict__:
                            if isinstance(value, YLeaf):
                                self.__dict__[name].set(value.get())
                            elif isinstance(value, YLeafList):
                                super(CfmStatistics.CfmMeps.CfmMep.LastCleared,
                                      self).__setattr__(name, value)
                            else:
                                self.__dict__[name].set(value)
                        else:
                            if hasattr(value, "parent") and name != "parent":
                                if hasattr(value, "is_presence_container"
                                           ) and value.is_presence_container:
                                    value.parent = self
                                elif value.parent is None and value.yang_name in self._children_yang_names:
                                    value.parent = self
                            super(CfmStatistics.CfmMeps.CfmMep.LastCleared,
                                  self).__setattr__(name, value)

                def has_data(self):
                    return (self.never.is_set or self.time.is_set)

                def has_operation(self):
                    return (self.yfilter != YFilter.not_set
                            or self.never.yfilter != YFilter.not_set
                            or self.time.yfilter != YFilter.not_set)

                def get_segment_path(self):
                    path_buffer = ""
                    path_buffer = "last-cleared" + path_buffer

                    return path_buffer

                def get_entity_path(self, ancestor):
                    path_buffer = ""
                    if (ancestor is None):
                        raise YPYModelError(
                            "ancestor cannot be None as one of the ancestors is a list"
                        )
                    else:
                        path_buffer = _get_relative_entity_path(
                            self, ancestor, path_buffer)

                    leaf_name_data = LeafDataList()
                    if (self.never.is_set
                            or self.never.yfilter != YFilter.not_set):
                        leaf_name_data.append(self.never.get_name_leafdata())
                    if (self.time.is_set
                            or self.time.yfilter != YFilter.not_set):
                        leaf_name_data.append(self.time.get_name_leafdata())

                    entity_path = EntityPath(path_buffer, leaf_name_data)
                    return entity_path

                def get_child_by_name(self, child_yang_name, segment_path):
                    child = self._get_child_by_seg_name(
                        [child_yang_name, segment_path])
                    if child is not None:
                        return child

                    return None

                def has_leaf_or_child_of_name(self, name):
                    if (name == "never" or name == "time"):
                        return True
                    return False

                def set_value(self, value_path, value, name_space,
                              name_space_prefix):
                    if (value_path == "never"):
                        self.never = value
                        self.never.value_namespace = name_space
                        self.never.value_namespace_prefix = name_space_prefix
                    if (value_path == "time"):
                        self.time = value
                        self.time.value_namespace = name_space
                        self.time.value_namespace_prefix = name_space_prefix

            def has_data(self):
                return (self.domain_name.is_set or self.ma_name.is_set
                        or self.mpid.is_set or self.ccm_seq_errors.is_set
                        or self.ccm_transmitted.is_set
                        or self.lbr_received_bad.is_set
                        or self.lbr_received_ok.is_set
                        or self.lbr_seq_errors.is_set
                        or self.lbr_transmitted.is_set
                        or self.ltr_unexpected.is_set
                        or (self.last_cleared is not None
                            and self.last_cleared.has_data()))

            def has_operation(self):
                return (self.yfilter != YFilter.not_set
                        or self.domain_name.yfilter != YFilter.not_set
                        or self.ma_name.yfilter != YFilter.not_set
                        or self.mpid.yfilter != YFilter.not_set
                        or self.ccm_seq_errors.yfilter != YFilter.not_set
                        or self.ccm_transmitted.yfilter != YFilter.not_set
                        or self.lbr_received_bad.yfilter != YFilter.not_set
                        or self.lbr_received_ok.yfilter != YFilter.not_set
                        or self.lbr_seq_errors.yfilter != YFilter.not_set
                        or self.lbr_transmitted.yfilter != YFilter.not_set
                        or self.ltr_unexpected.yfilter != YFilter.not_set
                        or (self.last_cleared is not None
                            and self.last_cleared.has_operation()))

            def get_segment_path(self):
                path_buffer = ""
                path_buffer = "cfm-mep" + "[domain-name='" + self.domain_name.get(
                ) + "']" + "[ma-name='" + self.ma_name.get(
                ) + "']" + "[mpid='" + self.mpid.get() + "']" + path_buffer

                return path_buffer

            def get_entity_path(self, ancestor):
                path_buffer = ""
                if (ancestor is None):
                    path_buffer = "Cisco-IOS-XE-cfm-oper:cfm-statistics/cfm-meps/%s" % self.get_segment_path(
                    )
                else:
                    path_buffer = _get_relative_entity_path(
                        self, ancestor, path_buffer)

                leaf_name_data = LeafDataList()
                if (self.domain_name.is_set
                        or self.domain_name.yfilter != YFilter.not_set):
                    leaf_name_data.append(self.domain_name.get_name_leafdata())
                if (self.ma_name.is_set
                        or self.ma_name.yfilter != YFilter.not_set):
                    leaf_name_data.append(self.ma_name.get_name_leafdata())
                if (self.mpid.is_set or self.mpid.yfilter != YFilter.not_set):
                    leaf_name_data.append(self.mpid.get_name_leafdata())
                if (self.ccm_seq_errors.is_set
                        or self.ccm_seq_errors.yfilter != YFilter.not_set):
                    leaf_name_data.append(
                        self.ccm_seq_errors.get_name_leafdata())
                if (self.ccm_transmitted.is_set
                        or self.ccm_transmitted.yfilter != YFilter.not_set):
                    leaf_name_data.append(
                        self.ccm_transmitted.get_name_leafdata())
                if (self.lbr_received_bad.is_set
                        or self.lbr_received_bad.yfilter != YFilter.not_set):
                    leaf_name_data.append(
                        self.lbr_received_bad.get_name_leafdata())
                if (self.lbr_received_ok.is_set
                        or self.lbr_received_ok.yfilter != YFilter.not_set):
                    leaf_name_data.append(
                        self.lbr_received_ok.get_name_leafdata())
                if (self.lbr_seq_errors.is_set
                        or self.lbr_seq_errors.yfilter != YFilter.not_set):
                    leaf_name_data.append(
                        self.lbr_seq_errors.get_name_leafdata())
                if (self.lbr_transmitted.is_set
                        or self.lbr_transmitted.yfilter != YFilter.not_set):
                    leaf_name_data.append(
                        self.lbr_transmitted.get_name_leafdata())
                if (self.ltr_unexpected.is_set
                        or self.ltr_unexpected.yfilter != YFilter.not_set):
                    leaf_name_data.append(
                        self.ltr_unexpected.get_name_leafdata())

                entity_path = EntityPath(path_buffer, leaf_name_data)
                return entity_path

            def get_child_by_name(self, child_yang_name, segment_path):
                child = self._get_child_by_seg_name(
                    [child_yang_name, segment_path])
                if child is not None:
                    return child

                if (child_yang_name == "last-cleared"):
                    if (self.last_cleared is None):
                        self.last_cleared = CfmStatistics.CfmMeps.CfmMep.LastCleared(
                        )
                        self.last_cleared.parent = self
                        self._children_name_map[
                            "last_cleared"] = "last-cleared"
                    return self.last_cleared

                return None

            def has_leaf_or_child_of_name(self, name):
                if (name == "last-cleared" or name == "domain-name"
                        or name == "ma-name" or name == "mpid"
                        or name == "ccm-seq-errors"
                        or name == "ccm-transmitted"
                        or name == "lbr-received-bad"
                        or name == "lbr-received-ok"
                        or name == "lbr-seq-errors"
                        or name == "lbr-transmitted"
                        or name == "ltr-unexpected"):
                    return True
                return False

            def set_value(self, value_path, value, name_space,
                          name_space_prefix):
                if (value_path == "domain-name"):
                    self.domain_name = value
                    self.domain_name.value_namespace = name_space
                    self.domain_name.value_namespace_prefix = name_space_prefix
                if (value_path == "ma-name"):
                    self.ma_name = value
                    self.ma_name.value_namespace = name_space
                    self.ma_name.value_namespace_prefix = name_space_prefix
                if (value_path == "mpid"):
                    self.mpid = value
                    self.mpid.value_namespace = name_space
                    self.mpid.value_namespace_prefix = name_space_prefix
                if (value_path == "ccm-seq-errors"):
                    self.ccm_seq_errors = value
                    self.ccm_seq_errors.value_namespace = name_space
                    self.ccm_seq_errors.value_namespace_prefix = name_space_prefix
                if (value_path == "ccm-transmitted"):
                    self.ccm_transmitted = value
                    self.ccm_transmitted.value_namespace = name_space
                    self.ccm_transmitted.value_namespace_prefix = name_space_prefix
                if (value_path == "lbr-received-bad"):
                    self.lbr_received_bad = value
                    self.lbr_received_bad.value_namespace = name_space
                    self.lbr_received_bad.value_namespace_prefix = name_space_prefix
                if (value_path == "lbr-received-ok"):
                    self.lbr_received_ok = value
                    self.lbr_received_ok.value_namespace = name_space
                    self.lbr_received_ok.value_namespace_prefix = name_space_prefix
                if (value_path == "lbr-seq-errors"):
                    self.lbr_seq_errors = value
                    self.lbr_seq_errors.value_namespace = name_space
                    self.lbr_seq_errors.value_namespace_prefix = name_space_prefix
                if (value_path == "lbr-transmitted"):
                    self.lbr_transmitted = value
                    self.lbr_transmitted.value_namespace = name_space
                    self.lbr_transmitted.value_namespace_prefix = name_space_prefix
                if (value_path == "ltr-unexpected"):
                    self.ltr_unexpected = value
                    self.ltr_unexpected.value_namespace = name_space
                    self.ltr_unexpected.value_namespace_prefix = name_space_prefix

        def has_data(self):
            for c in self.cfm_mep:
                if (c.has_data()):
                    return True
            return False

        def has_operation(self):
            for c in self.cfm_mep:
                if (c.has_operation()):
                    return True
            return self.yfilter != YFilter.not_set

        def get_segment_path(self):
            path_buffer = ""
            path_buffer = "cfm-meps" + path_buffer

            return path_buffer

        def get_entity_path(self, ancestor):
            path_buffer = ""
            if (ancestor is None):
                path_buffer = "Cisco-IOS-XE-cfm-oper:cfm-statistics/%s" % self.get_segment_path(
                )
            else:
                path_buffer = _get_relative_entity_path(
                    self, ancestor, path_buffer)

            leaf_name_data = LeafDataList()

            entity_path = EntityPath(path_buffer, leaf_name_data)
            return entity_path

        def get_child_by_name(self, child_yang_name, segment_path):
            child = self._get_child_by_seg_name(
                [child_yang_name, segment_path])
            if child is not None:
                return child

            if (child_yang_name == "cfm-mep"):
                for c in self.cfm_mep:
                    segment = c.get_segment_path()
                    if (segment_path == segment):
                        return c
                c = CfmStatistics.CfmMeps.CfmMep()
                c.parent = self
                local_reference_key = "ydk::seg::%s" % segment_path
                self._local_refs[local_reference_key] = c
                self.cfm_mep.append(c)
                return c

            return None

        def has_leaf_or_child_of_name(self, name):
            if (name == "cfm-mep"):
                return True
            return False

        def set_value(self, value_path, value, name_space, name_space_prefix):
            pass
    class Ceedot3Pauseexttable(Entity):
        """
        A list of additional descriptive and status
        information about the MAC Control PAUSE 
        function on the ethernet\-like interfaces 
        attached to a particular system, in extension to
        dot3PauseTable in EtherLike\-MIB. There will be 
        one row in this table for each ethernet\-like 
        interface in the system which supports the MAC 
        Control PAUSE function.
        
        .. attribute:: ceedot3pauseextentry
        
        	An entry in the table, containing additional information about the MAC Control PAUSE function  on a single ethernet\-like interface, in extension  to dot3PauseEntry in Etherlike\-MIB
        	**type**\: list of    :py:class:`Ceedot3Pauseextentry <ydk.models.cisco_ios_xe.CISCO_ETHERLIKE_EXT_MIB.CiscoEtherlikeExtMib.Ceedot3Pauseexttable.Ceedot3Pauseextentry>`
        
        

        """

        _prefix = 'CISCO-ETHERLIKE-EXT-MIB'
        _revision = '2010-06-04'

        def __init__(self):
            super(CiscoEtherlikeExtMib.Ceedot3Pauseexttable, self).__init__()

            self.yang_name = "ceeDot3PauseExtTable"
            self.yang_parent_name = "CISCO-ETHERLIKE-EXT-MIB"

            self.ceedot3pauseextentry = YList(self)

        def __setattr__(self, name, value):
            self._check_monkey_patching_error(name, value)
            with _handle_type_error():
                if name in self.__dict__ and isinstance(
                        self.__dict__[name], YList):
                    raise YPYModelError(
                        "Attempt to assign value of '{}' to YList ldata. "
                        "Please use list append or extend method.".format(
                            value))
                if isinstance(value, Enum.YLeaf):
                    value = value.name
                if name in () and name in self.__dict__:
                    if isinstance(value, YLeaf):
                        self.__dict__[name].set(value.get())
                    elif isinstance(value, YLeafList):
                        super(CiscoEtherlikeExtMib.Ceedot3Pauseexttable,
                              self).__setattr__(name, value)
                    else:
                        self.__dict__[name].set(value)
                else:
                    if hasattr(value, "parent") and name != "parent":
                        if hasattr(value, "is_presence_container"
                                   ) and value.is_presence_container:
                            value.parent = self
                        elif value.parent is None and value.yang_name in self._children_yang_names:
                            value.parent = self
                    super(CiscoEtherlikeExtMib.Ceedot3Pauseexttable,
                          self).__setattr__(name, value)

        class Ceedot3Pauseextentry(Entity):
            """
            An entry in the table, containing additional
            information about the MAC Control PAUSE function 
            on a single ethernet\-like interface, in extension 
            to dot3PauseEntry in Etherlike\-MIB.
            
            .. attribute:: dot3statsindex  <key>
            
            	
            	**type**\:  int
            
            	**range:** 1..2147483647
            
            	**refers to**\:  :py:class:`dot3statsindex <ydk.models.cisco_ios_xe.EtherLike_MIB.EtherlikeMib.Dot3Statstable.Dot3Statsentry>`
            
            .. attribute:: ceedot3pauseextadminmode
            
            	Indicates preference to send or process pause frames on this interface. txDesired(0)  \-  indicates preference to send pause                   frames, but autonegotiates flow                   control. This bit can only be                   turned on when the corresponding                   instance of dot3PauseAdminMode                   has the value of 'enabledXmit' or                   'enabledXmitAndRcv'. rxDesired(1)  \-  indicates preference to process                   pause frames, but autonegotiates                   flow control. This bit can only be                   turned on when the corresponding                   instance of dot3PauseAdminMode                   has the value of 'enabledRcv' or                   'enabledXmitAndRcv'
            	**type**\:   :py:class:`Ceedot3Pauseextadminmode <ydk.models.cisco_ios_xe.CISCO_ETHERLIKE_EXT_MIB.CiscoEtherlikeExtMib.Ceedot3Pauseexttable.Ceedot3Pauseextentry.Ceedot3Pauseextadminmode>`
            
            .. attribute:: ceedot3pauseextopermode
            
            	Provides additional information about the flow control operational status on this interface. txDisagree(0) \- the transmit pause function on                  this interface is disabled due to                  disagreement from the far end on                  negotiation. rxDisagree(1) \- the receive pause function on                   this interface is disabled due to                  disagreement from the far end on                  negotiation. txDesired(2)  \- the transmit pause function on                  this interface is desired. rxDesired(3)  \- the receive pause function on                   this interface is desired
            	**type**\:   :py:class:`Ceedot3Pauseextopermode <ydk.models.cisco_ios_xe.CISCO_ETHERLIKE_EXT_MIB.CiscoEtherlikeExtMib.Ceedot3Pauseexttable.Ceedot3Pauseextentry.Ceedot3Pauseextopermode>`
            
            

            """

            _prefix = 'CISCO-ETHERLIKE-EXT-MIB'
            _revision = '2010-06-04'

            def __init__(self):
                super(
                    CiscoEtherlikeExtMib.Ceedot3Pauseexttable.
                    Ceedot3Pauseextentry, self).__init__()

                self.yang_name = "ceeDot3PauseExtEntry"
                self.yang_parent_name = "ceeDot3PauseExtTable"

                self.dot3statsindex = YLeaf(YType.str, "dot3StatsIndex")

                self.ceedot3pauseextadminmode = YLeaf(
                    YType.bits, "ceeDot3PauseExtAdminMode")

                self.ceedot3pauseextopermode = YLeaf(
                    YType.bits, "ceeDot3PauseExtOperMode")

            def __setattr__(self, name, value):
                self._check_monkey_patching_error(name, value)
                with _handle_type_error():
                    if name in self.__dict__ and isinstance(
                            self.__dict__[name], YList):
                        raise YPYModelError(
                            "Attempt to assign value of '{}' to YList ldata. "
                            "Please use list append or extend method.".format(
                                value))
                    if isinstance(value, Enum.YLeaf):
                        value = value.name
                    if name in ("dot3statsindex", "ceedot3pauseextadminmode",
                                "ceedot3pauseextopermode"
                                ) and name in self.__dict__:
                        if isinstance(value, YLeaf):
                            self.__dict__[name].set(value.get())
                        elif isinstance(value, YLeafList):
                            super(
                                CiscoEtherlikeExtMib.Ceedot3Pauseexttable.
                                Ceedot3Pauseextentry,
                                self).__setattr__(name, value)
                        else:
                            self.__dict__[name].set(value)
                    else:
                        if hasattr(value, "parent") and name != "parent":
                            if hasattr(value, "is_presence_container"
                                       ) and value.is_presence_container:
                                value.parent = self
                            elif value.parent is None and value.yang_name in self._children_yang_names:
                                value.parent = self
                        super(
                            CiscoEtherlikeExtMib.Ceedot3Pauseexttable.
                            Ceedot3Pauseextentry,
                            self).__setattr__(name, value)

            def has_data(self):
                return (self.dot3statsindex.is_set
                        or self.ceedot3pauseextadminmode.is_set
                        or self.ceedot3pauseextopermode.is_set)

            def has_operation(self):
                return (
                    self.yfilter != YFilter.not_set
                    or self.dot3statsindex.yfilter != YFilter.not_set
                    or self.ceedot3pauseextadminmode.yfilter != YFilter.not_set
                    or self.ceedot3pauseextopermode.yfilter != YFilter.not_set)

            def get_segment_path(self):
                path_buffer = ""
                path_buffer = "ceeDot3PauseExtEntry" + "[dot3StatsIndex='" + self.dot3statsindex.get(
                ) + "']" + path_buffer

                return path_buffer

            def get_entity_path(self, ancestor):
                path_buffer = ""
                if (ancestor is None):
                    path_buffer = "CISCO-ETHERLIKE-EXT-MIB:CISCO-ETHERLIKE-EXT-MIB/ceeDot3PauseExtTable/%s" % self.get_segment_path(
                    )
                else:
                    path_buffer = _get_relative_entity_path(
                        self, ancestor, path_buffer)

                leaf_name_data = LeafDataList()
                if (self.dot3statsindex.is_set
                        or self.dot3statsindex.yfilter != YFilter.not_set):
                    leaf_name_data.append(
                        self.dot3statsindex.get_name_leafdata())
                if (self.ceedot3pauseextadminmode.is_set
                        or self.ceedot3pauseextadminmode.yfilter !=
                        YFilter.not_set):
                    leaf_name_data.append(
                        self.ceedot3pauseextadminmode.get_name_leafdata())
                if (self.ceedot3pauseextopermode.is_set
                        or self.ceedot3pauseextopermode.yfilter !=
                        YFilter.not_set):
                    leaf_name_data.append(
                        self.ceedot3pauseextopermode.get_name_leafdata())

                entity_path = EntityPath(path_buffer, leaf_name_data)
                return entity_path

            def get_child_by_name(self, child_yang_name, segment_path):
                child = self._get_child_by_seg_name(
                    [child_yang_name, segment_path])
                if child is not None:
                    return child

                return None

            def has_leaf_or_child_of_name(self, name):
                if (name == "dot3StatsIndex"
                        or name == "ceeDot3PauseExtAdminMode"
                        or name == "ceeDot3PauseExtOperMode"):
                    return True
                return False

            def set_value(self, value_path, value, name_space,
                          name_space_prefix):
                if (value_path == "dot3StatsIndex"):
                    self.dot3statsindex = value
                    self.dot3statsindex.value_namespace = name_space
                    self.dot3statsindex.value_namespace_prefix = name_space_prefix
                if (value_path == "ceeDot3PauseExtAdminMode"):
                    self.ceedot3pauseextadminmode[value] = True
                if (value_path == "ceeDot3PauseExtOperMode"):
                    self.ceedot3pauseextopermode[value] = True

        def has_data(self):
            for c in self.ceedot3pauseextentry:
                if (c.has_data()):
                    return True
            return False

        def has_operation(self):
            for c in self.ceedot3pauseextentry:
                if (c.has_operation()):
                    return True
            return self.yfilter != YFilter.not_set

        def get_segment_path(self):
            path_buffer = ""
            path_buffer = "ceeDot3PauseExtTable" + path_buffer

            return path_buffer

        def get_entity_path(self, ancestor):
            path_buffer = ""
            if (ancestor is None):
                path_buffer = "CISCO-ETHERLIKE-EXT-MIB:CISCO-ETHERLIKE-EXT-MIB/%s" % self.get_segment_path(
                )
            else:
                path_buffer = _get_relative_entity_path(
                    self, ancestor, path_buffer)

            leaf_name_data = LeafDataList()

            entity_path = EntityPath(path_buffer, leaf_name_data)
            return entity_path

        def get_child_by_name(self, child_yang_name, segment_path):
            child = self._get_child_by_seg_name(
                [child_yang_name, segment_path])
            if child is not None:
                return child

            if (child_yang_name == "ceeDot3PauseExtEntry"):
                for c in self.ceedot3pauseextentry:
                    segment = c.get_segment_path()
                    if (segment_path == segment):
                        return c
                c = CiscoEtherlikeExtMib.Ceedot3Pauseexttable.Ceedot3Pauseextentry(
                )
                c.parent = self
                local_reference_key = "ydk::seg::%s" % segment_path
                self._local_refs[local_reference_key] = c
                self.ceedot3pauseextentry.append(c)
                return c

            return None

        def has_leaf_or_child_of_name(self, name):
            if (name == "ceeDot3PauseExtEntry"):
                return True
            return False

        def set_value(self, value_path, value, name_space, name_space_prefix):
            pass
    class Mplsldpentitygenericlrtable(Entity):
        """
        The MPLS LDP Entity Generic Label Range (LR)
        Table.
        
        The purpose of this table is to provide a mechanism
        for configurating a contiguous range of generic labels,
        or a 'label range' for LDP Entities.
        
        LDP Entities which use Generic Labels must have at least
        one entry in this table.  In other words, this table
        'extends' the mpldLdpEntityTable for Generic Labels.
        
        .. attribute:: mplsldpentitygenericlrentry
        
        	A row in the LDP Entity Generic Label Range (LR) Table.  One entry in this table contains information on a single range of labels represented by the configured Upper and Lower Bounds pairs.  NOTE\: there is NO corresponding LDP message which relates to the information in this table, however, this table does provide a way for a user to 'reserve' a generic label range.  NOTE\:  The ranges for a specific LDP Entity are UNIQUE and non\-overlapping.  A row will not be created unless a unique and non\-overlapping range is specified
        	**type**\: list of    :py:class:`Mplsldpentitygenericlrentry <ydk.models.cisco_ios_xe.MPLS_LDP_GENERIC_STD_MIB.MplsLdpGenericStdMib.Mplsldpentitygenericlrtable.Mplsldpentitygenericlrentry>`
        
        

        """

        _prefix = 'MPLS-LDP-GENERIC-STD-MIB'
        _revision = '2004-06-03'

        def __init__(self):
            super(MplsLdpGenericStdMib.Mplsldpentitygenericlrtable, self).__init__()

            self.yang_name = "mplsLdpEntityGenericLRTable"
            self.yang_parent_name = "MPLS-LDP-GENERIC-STD-MIB"

            self.mplsldpentitygenericlrentry = YList(self)

        def __setattr__(self, name, value):
            self._check_monkey_patching_error(name, value)
            with _handle_type_error():
                if name in self.__dict__ and isinstance(self.__dict__[name], YList):
                    raise YPYModelError("Attempt to assign value of '{}' to YList ldata. "
                                        "Please use list append or extend method."
                                        .format(value))
                if isinstance(value, Enum.YLeaf):
                    value = value.name
                if name in () and name in self.__dict__:
                    if isinstance(value, YLeaf):
                        self.__dict__[name].set(value.get())
                    elif isinstance(value, YLeafList):
                        super(MplsLdpGenericStdMib.Mplsldpentitygenericlrtable, self).__setattr__(name, value)
                    else:
                        self.__dict__[name].set(value)
                else:
                    if hasattr(value, "parent") and name != "parent":
                        if hasattr(value, "is_presence_container") and value.is_presence_container:
                            value.parent = self
                        elif value.parent is None and value.yang_name in self._children_yang_names:
                            value.parent = self
                    super(MplsLdpGenericStdMib.Mplsldpentitygenericlrtable, self).__setattr__(name, value)


        class Mplsldpentitygenericlrentry(Entity):
            """
            A row in the LDP Entity Generic Label
            Range (LR) Table.  One entry in this table contains
            information on a single range of labels
            represented by the configured Upper and Lower
            Bounds pairs.  NOTE\: there is NO corresponding
            LDP message which relates to the information
            in this table, however, this table does provide
            a way for a user to 'reserve' a generic label
            range.
            
            NOTE\:  The ranges for a specific LDP Entity
            are UNIQUE and non\-overlapping.
            
            A row will not be created unless a unique and
            non\-overlapping range is specified.
            
            .. attribute:: mplsldpentityldpid  <key>
            
            	
            	**type**\:  str
            
            	**refers to**\:  :py:class:`mplsldpentityldpid <ydk.models.cisco_ios_xe.MPLS_LDP_STD_MIB.MplsLdpStdMib.Mplsldpentitytable.Mplsldpentityentry>`
            
            .. attribute:: mplsldpentityindex  <key>
            
            	
            	**type**\:  int
            
            	**range:** 1..4294967295
            
            	**refers to**\:  :py:class:`mplsldpentityindex <ydk.models.cisco_ios_xe.MPLS_LDP_STD_MIB.MplsLdpStdMib.Mplsldpentitytable.Mplsldpentityentry>`
            
            .. attribute:: mplsldpentitygenericlrmin  <key>
            
            	The minimum label configured for this range
            	**type**\:  int
            
            	**range:** 0..1048575
            
            .. attribute:: mplsldpentitygenericlrmax  <key>
            
            	The maximum label configured for this range
            	**type**\:  int
            
            	**range:** 0..1048575
            
            .. attribute:: mplsldpentitygenericifindexorzero
            
            	This value represents either the InterfaceIndex of the 'ifLayer' where these Generic Label would be created,   or 0 (zero).  The value of zero means that the InterfaceIndex is not known.  However, if the InterfaceIndex is known, then it must be represented by this value.  If an InterfaceIndex becomes known, then the network management entity (e.g., SNMP agent) responsible for this object MUST change the value from 0 (zero) to the value of the InterfaceIndex
            	**type**\:  int
            
            	**range:** 0..2147483647
            
            .. attribute:: mplsldpentitygenericlabelspace
            
            	This value of this object is perPlatform(1), then this means that the label space type is per platform.  If this object is perInterface(2), then this means that the label space type is per Interface
            	**type**\:   :py:class:`Mplsldpentitygenericlabelspace <ydk.models.cisco_ios_xe.MPLS_LDP_GENERIC_STD_MIB.MplsLdpGenericStdMib.Mplsldpentitygenericlrtable.Mplsldpentitygenericlrentry.Mplsldpentitygenericlabelspace>`
            
            .. attribute:: mplsldpentitygenericlrrowstatus
            
            	The status of this conceptual row.  All writable objects in this row may be modified at any time, however, as described in  detail in the section entitled, 'Changing Values After Session Establishment', and again described in the DESCRIPTION clause of the mplsLdpEntityAdminStatus object, if a session has been initiated with a Peer, changing objects in this table will wreak havoc with the session and interrupt traffic. To repeat again\:  the recommended procedure is to set the mplsLdpEntityAdminStatus to down, thereby explicitly causing a session to be torn down. Then, change objects in this entry, then set the mplsLdpEntityAdminStatus to enable which enables a new session to be initiated.  There must exist at least one entry in this table for every LDP Entity that has a generic label configured
            	**type**\:   :py:class:`Rowstatus <ydk.models.cisco_ios_xe.SNMPv2_TC.Rowstatus>`
            
            .. attribute:: mplsldpentitygenericlrstoragetype
            
            	The storage type for this conceptual row. Conceptual rows having the value 'permanent(4)' need not allow write\-access to any columnar objects in the row
            	**type**\:   :py:class:`Storagetype <ydk.models.cisco_ios_xe.SNMPv2_TC.Storagetype>`
            
            

            """

            _prefix = 'MPLS-LDP-GENERIC-STD-MIB'
            _revision = '2004-06-03'

            def __init__(self):
                super(MplsLdpGenericStdMib.Mplsldpentitygenericlrtable.Mplsldpentitygenericlrentry, self).__init__()

                self.yang_name = "mplsLdpEntityGenericLREntry"
                self.yang_parent_name = "mplsLdpEntityGenericLRTable"

                self.mplsldpentityldpid = YLeaf(YType.str, "mplsLdpEntityLdpId")

                self.mplsldpentityindex = YLeaf(YType.str, "mplsLdpEntityIndex")

                self.mplsldpentitygenericlrmin = YLeaf(YType.uint32, "mplsLdpEntityGenericLRMin")

                self.mplsldpentitygenericlrmax = YLeaf(YType.uint32, "mplsLdpEntityGenericLRMax")

                self.mplsldpentitygenericifindexorzero = YLeaf(YType.int32, "mplsLdpEntityGenericIfIndexOrZero")

                self.mplsldpentitygenericlabelspace = YLeaf(YType.enumeration, "mplsLdpEntityGenericLabelSpace")

                self.mplsldpentitygenericlrrowstatus = YLeaf(YType.enumeration, "mplsLdpEntityGenericLRRowStatus")

                self.mplsldpentitygenericlrstoragetype = YLeaf(YType.enumeration, "mplsLdpEntityGenericLRStorageType")

            def __setattr__(self, name, value):
                self._check_monkey_patching_error(name, value)
                with _handle_type_error():
                    if name in self.__dict__ and isinstance(self.__dict__[name], YList):
                        raise YPYModelError("Attempt to assign value of '{}' to YList ldata. "
                                            "Please use list append or extend method."
                                            .format(value))
                    if isinstance(value, Enum.YLeaf):
                        value = value.name
                    if name in ("mplsldpentityldpid",
                                "mplsldpentityindex",
                                "mplsldpentitygenericlrmin",
                                "mplsldpentitygenericlrmax",
                                "mplsldpentitygenericifindexorzero",
                                "mplsldpentitygenericlabelspace",
                                "mplsldpentitygenericlrrowstatus",
                                "mplsldpentitygenericlrstoragetype") and name in self.__dict__:
                        if isinstance(value, YLeaf):
                            self.__dict__[name].set(value.get())
                        elif isinstance(value, YLeafList):
                            super(MplsLdpGenericStdMib.Mplsldpentitygenericlrtable.Mplsldpentitygenericlrentry, self).__setattr__(name, value)
                        else:
                            self.__dict__[name].set(value)
                    else:
                        if hasattr(value, "parent") and name != "parent":
                            if hasattr(value, "is_presence_container") and value.is_presence_container:
                                value.parent = self
                            elif value.parent is None and value.yang_name in self._children_yang_names:
                                value.parent = self
                        super(MplsLdpGenericStdMib.Mplsldpentitygenericlrtable.Mplsldpentitygenericlrentry, self).__setattr__(name, value)

            class Mplsldpentitygenericlabelspace(Enum):
                """
                Mplsldpentitygenericlabelspace

                This value of this object is perPlatform(1), then

                this means that the label space type is

                per platform.

                If this object is perInterface(2), then this

                means that the label space type is per Interface.

                .. data:: perPlatform = 1

                .. data:: perInterface = 2

                """

                perPlatform = Enum.YLeaf(1, "perPlatform")

                perInterface = Enum.YLeaf(2, "perInterface")


            def has_data(self):
                return (
                    self.mplsldpentityldpid.is_set or
                    self.mplsldpentityindex.is_set or
                    self.mplsldpentitygenericlrmin.is_set or
                    self.mplsldpentitygenericlrmax.is_set or
                    self.mplsldpentitygenericifindexorzero.is_set or
                    self.mplsldpentitygenericlabelspace.is_set or
                    self.mplsldpentitygenericlrrowstatus.is_set or
                    self.mplsldpentitygenericlrstoragetype.is_set)

            def has_operation(self):
                return (
                    self.yfilter != YFilter.not_set or
                    self.mplsldpentityldpid.yfilter != YFilter.not_set or
                    self.mplsldpentityindex.yfilter != YFilter.not_set or
                    self.mplsldpentitygenericlrmin.yfilter != YFilter.not_set or
                    self.mplsldpentitygenericlrmax.yfilter != YFilter.not_set or
                    self.mplsldpentitygenericifindexorzero.yfilter != YFilter.not_set or
                    self.mplsldpentitygenericlabelspace.yfilter != YFilter.not_set or
                    self.mplsldpentitygenericlrrowstatus.yfilter != YFilter.not_set or
                    self.mplsldpentitygenericlrstoragetype.yfilter != YFilter.not_set)

            def get_segment_path(self):
                path_buffer = ""
                path_buffer = "mplsLdpEntityGenericLREntry" + "[mplsLdpEntityLdpId='" + self.mplsldpentityldpid.get() + "']" + "[mplsLdpEntityIndex='" + self.mplsldpentityindex.get() + "']" + "[mplsLdpEntityGenericLRMin='" + self.mplsldpentitygenericlrmin.get() + "']" + "[mplsLdpEntityGenericLRMax='" + self.mplsldpentitygenericlrmax.get() + "']" + path_buffer

                return path_buffer

            def get_entity_path(self, ancestor):
                path_buffer = ""
                if (ancestor is None):
                    path_buffer = "MPLS-LDP-GENERIC-STD-MIB:MPLS-LDP-GENERIC-STD-MIB/mplsLdpEntityGenericLRTable/%s" % self.get_segment_path()
                else:
                    path_buffer = _get_relative_entity_path(self, ancestor, path_buffer)

                leaf_name_data = LeafDataList()
                if (self.mplsldpentityldpid.is_set or self.mplsldpentityldpid.yfilter != YFilter.not_set):
                    leaf_name_data.append(self.mplsldpentityldpid.get_name_leafdata())
                if (self.mplsldpentityindex.is_set or self.mplsldpentityindex.yfilter != YFilter.not_set):
                    leaf_name_data.append(self.mplsldpentityindex.get_name_leafdata())
                if (self.mplsldpentitygenericlrmin.is_set or self.mplsldpentitygenericlrmin.yfilter != YFilter.not_set):
                    leaf_name_data.append(self.mplsldpentitygenericlrmin.get_name_leafdata())
                if (self.mplsldpentitygenericlrmax.is_set or self.mplsldpentitygenericlrmax.yfilter != YFilter.not_set):
                    leaf_name_data.append(self.mplsldpentitygenericlrmax.get_name_leafdata())
                if (self.mplsldpentitygenericifindexorzero.is_set or self.mplsldpentitygenericifindexorzero.yfilter != YFilter.not_set):
                    leaf_name_data.append(self.mplsldpentitygenericifindexorzero.get_name_leafdata())
                if (self.mplsldpentitygenericlabelspace.is_set or self.mplsldpentitygenericlabelspace.yfilter != YFilter.not_set):
                    leaf_name_data.append(self.mplsldpentitygenericlabelspace.get_name_leafdata())
                if (self.mplsldpentitygenericlrrowstatus.is_set or self.mplsldpentitygenericlrrowstatus.yfilter != YFilter.not_set):
                    leaf_name_data.append(self.mplsldpentitygenericlrrowstatus.get_name_leafdata())
                if (self.mplsldpentitygenericlrstoragetype.is_set or self.mplsldpentitygenericlrstoragetype.yfilter != YFilter.not_set):
                    leaf_name_data.append(self.mplsldpentitygenericlrstoragetype.get_name_leafdata())

                entity_path = EntityPath(path_buffer, leaf_name_data)
                return entity_path

            def get_child_by_name(self, child_yang_name, segment_path):
                child = self._get_child_by_seg_name([child_yang_name, segment_path])
                if child is not None:
                    return child

                return None

            def has_leaf_or_child_of_name(self, name):
                if(name == "mplsLdpEntityLdpId" or name == "mplsLdpEntityIndex" or name == "mplsLdpEntityGenericLRMin" or name == "mplsLdpEntityGenericLRMax" or name == "mplsLdpEntityGenericIfIndexOrZero" or name == "mplsLdpEntityGenericLabelSpace" or name == "mplsLdpEntityGenericLRRowStatus" or name == "mplsLdpEntityGenericLRStorageType"):
                    return True
                return False

            def set_value(self, value_path, value, name_space, name_space_prefix):
                if(value_path == "mplsLdpEntityLdpId"):
                    self.mplsldpentityldpid = value
                    self.mplsldpentityldpid.value_namespace = name_space
                    self.mplsldpentityldpid.value_namespace_prefix = name_space_prefix
                if(value_path == "mplsLdpEntityIndex"):
                    self.mplsldpentityindex = value
                    self.mplsldpentityindex.value_namespace = name_space
                    self.mplsldpentityindex.value_namespace_prefix = name_space_prefix
                if(value_path == "mplsLdpEntityGenericLRMin"):
                    self.mplsldpentitygenericlrmin = value
                    self.mplsldpentitygenericlrmin.value_namespace = name_space
                    self.mplsldpentitygenericlrmin.value_namespace_prefix = name_space_prefix
                if(value_path == "mplsLdpEntityGenericLRMax"):
                    self.mplsldpentitygenericlrmax = value
                    self.mplsldpentitygenericlrmax.value_namespace = name_space
                    self.mplsldpentitygenericlrmax.value_namespace_prefix = name_space_prefix
                if(value_path == "mplsLdpEntityGenericIfIndexOrZero"):
                    self.mplsldpentitygenericifindexorzero = value
                    self.mplsldpentitygenericifindexorzero.value_namespace = name_space
                    self.mplsldpentitygenericifindexorzero.value_namespace_prefix = name_space_prefix
                if(value_path == "mplsLdpEntityGenericLabelSpace"):
                    self.mplsldpentitygenericlabelspace = value
                    self.mplsldpentitygenericlabelspace.value_namespace = name_space
                    self.mplsldpentitygenericlabelspace.value_namespace_prefix = name_space_prefix
                if(value_path == "mplsLdpEntityGenericLRRowStatus"):
                    self.mplsldpentitygenericlrrowstatus = value
                    self.mplsldpentitygenericlrrowstatus.value_namespace = name_space
                    self.mplsldpentitygenericlrrowstatus.value_namespace_prefix = name_space_prefix
                if(value_path == "mplsLdpEntityGenericLRStorageType"):
                    self.mplsldpentitygenericlrstoragetype = value
                    self.mplsldpentitygenericlrstoragetype.value_namespace = name_space
                    self.mplsldpentitygenericlrstoragetype.value_namespace_prefix = name_space_prefix

        def has_data(self):
            for c in self.mplsldpentitygenericlrentry:
                if (c.has_data()):
                    return True
            return False

        def has_operation(self):
            for c in self.mplsldpentitygenericlrentry:
                if (c.has_operation()):
                    return True
            return self.yfilter != YFilter.not_set

        def get_segment_path(self):
            path_buffer = ""
            path_buffer = "mplsLdpEntityGenericLRTable" + path_buffer

            return path_buffer

        def get_entity_path(self, ancestor):
            path_buffer = ""
            if (ancestor is None):
                path_buffer = "MPLS-LDP-GENERIC-STD-MIB:MPLS-LDP-GENERIC-STD-MIB/%s" % self.get_segment_path()
            else:
                path_buffer = _get_relative_entity_path(self, ancestor, path_buffer)

            leaf_name_data = LeafDataList()

            entity_path = EntityPath(path_buffer, leaf_name_data)
            return entity_path

        def get_child_by_name(self, child_yang_name, segment_path):
            child = self._get_child_by_seg_name([child_yang_name, segment_path])
            if child is not None:
                return child

            if (child_yang_name == "mplsLdpEntityGenericLREntry"):
                for c in self.mplsldpentitygenericlrentry:
                    segment = c.get_segment_path()
                    if (segment_path == segment):
                        return c
                c = MplsLdpGenericStdMib.Mplsldpentitygenericlrtable.Mplsldpentitygenericlrentry()
                c.parent = self
                local_reference_key = "ydk::seg::%s" % segment_path
                self._local_refs[local_reference_key] = c
                self.mplsldpentitygenericlrentry.append(c)
                return c

            return None

        def has_leaf_or_child_of_name(self, name):
            if(name == "mplsLdpEntityGenericLREntry"):
                return True
            return False

        def set_value(self, value_path, value, name_space, name_space_prefix):
            pass
    class Ipsecpolmaptable(Entity):
        """
        The IPSec Phase\-2 Tunnel to Policy Mapping Table.
        There is one entry in this table for each active
        IPSec Phase\-2 Tunnel.
        
        .. attribute:: ipsecpolmapentry
        
        	Each entry contains the attributes associated with mapping an active IPSec Phase\-2 Tunnel to its configured Policy definition
        	**type**\: list of    :py:class:`Ipsecpolmapentry <ydk.models.cisco_ios_xe.CISCO_IPSEC_POLICY_MAP_MIB.CiscoIpsecPolicyMapMib.Ipsecpolmaptable.Ipsecpolmapentry>`
        
        

        """

        _prefix = 'CISCO-IPSEC-POLICY-MAP-MIB'
        _revision = '2000-08-17'

        def __init__(self):
            super(CiscoIpsecPolicyMapMib.Ipsecpolmaptable, self).__init__()

            self.yang_name = "ipSecPolMapTable"
            self.yang_parent_name = "CISCO-IPSEC-POLICY-MAP-MIB"

            self.ipsecpolmapentry = YList(self)

        def __setattr__(self, name, value):
            self._check_monkey_patching_error(name, value)
            with _handle_type_error():
                if name in self.__dict__ and isinstance(self.__dict__[name], YList):
                    raise YPYModelError("Attempt to assign value of '{}' to YList ldata. "
                                        "Please use list append or extend method."
                                        .format(value))
                if isinstance(value, Enum.YLeaf):
                    value = value.name
                if name in () and name in self.__dict__:
                    if isinstance(value, YLeaf):
                        self.__dict__[name].set(value.get())
                    elif isinstance(value, YLeafList):
                        super(CiscoIpsecPolicyMapMib.Ipsecpolmaptable, self).__setattr__(name, value)
                    else:
                        self.__dict__[name].set(value)
                else:
                    if hasattr(value, "parent") and name != "parent":
                        if hasattr(value, "is_presence_container") and value.is_presence_container:
                            value.parent = self
                        elif value.parent is None and value.yang_name in self._children_yang_names:
                            value.parent = self
                    super(CiscoIpsecPolicyMapMib.Ipsecpolmaptable, self).__setattr__(name, value)


        class Ipsecpolmapentry(Entity):
            """
            Each entry contains the attributes associated
            with mapping an active IPSec Phase\-2 Tunnel
            to its configured Policy definition.
            
            .. attribute:: ipsecpolmaptunindex  <key>
            
            	The index of the IPSec Phase\-2 Tunnel to Policy Map Table. The value of the index is the number used to represent this IPSec Phase\-2 Tunnel in the IPSec MIB (ipSecTunIndex in the ipSecTunnelTable)
            	**type**\:  int
            
            	**range:** 1..2147483647
            
            .. attribute:: ipsecpolmapacestring
            
            	The value of this object is the access control  entry (ACE) within the ACL that caused this IPSec  tunnel to be established.   For instance, if an ACL defines access for two traffic streams (FTP and SNMP) as follows\:  access\-list 101 permit tcp 172.16.14.0 0.0.0.255                  172.16.16.0 0.0.0.255 eq ftp access\-list 101 permit udp 172.16.14.0 0.0.0.255                  host 172.16.16.1 eq 161   When associated with an IPSec policy, the second element of the ACL gives rise to an IPSec tunnel in the wake of SNMP traffic. The value of the object 'ipSecPolMapAceString' for the IPSec tunnel would be then the string 'access\-list 101 permit udp 172.16.14.0 0.0.0.255                  host 172.16.16.1 eq 161'
            	**type**\:  str
            
            .. attribute:: ipsecpolmapaclstring
            
            	The value of this object is the number or the name of the access control string (ACL)  that caused this IPSec tunnel to be established.   The ACL that causes an IPSec tunnel  to be established is referenced by the   cryptomap of the tunnel.   The ACL identifies the traffic that requires  protection as defined by the policy.   For instance, the ACL that requires FTP  traffic between local subnet 172.16.14.0 and a  remote subnet 172.16.16.0 to be protected  is defined as   ==>access\-list 101 permit tcp 172.16.14.0 0.0.0.255                   172.16.16.0 0.0.0.255 eq ftp   When this command causes an IPSec tunnel to be   established, the object 'ipSecPolMapAclString'   assumes the string value '101'.   If the ACL is a named list such as   ==> ip access\-list standard myAcl        permit 172.16.16.8 0.0.0.0   then the value of this MIB element corresponding to    IPSec tunnel that was created by this ACL would   be 'myAcl'
            	**type**\:  str
            
            .. attribute:: ipsecpolmapcryptomapname
            
            	The value of this object should be the name of  the IPSec Policy (cryptomap) as assigned by the  operator while configuring the policy of  the IPSec traffic.  For instance, on an IOS router, the if the command entered to configure the IPSec policy was   ==>  crypto map ftpPolicy 10 ipsec\-isakmp  then the value of this object would be 'ftpPolicy'
            	**type**\:  str
            
            .. attribute:: ipsecpolmapcryptomapnum
            
            	The value of this object should be the priority of the IPSec Policy (cryptomap) assigned by the  operator while configuring the policy of  this IPSec tunnel.  For instance, on an IOS router, the if the command entered to configure the IPSec policy was   ==>  crypto map ftpPolicy 10 ipsec\-isakmp  then the value of this object would be 10
            	**type**\:  int
            
            	**range:** 1..2147483647
            
            

            """

            _prefix = 'CISCO-IPSEC-POLICY-MAP-MIB'
            _revision = '2000-08-17'

            def __init__(self):
                super(CiscoIpsecPolicyMapMib.Ipsecpolmaptable.Ipsecpolmapentry, self).__init__()

                self.yang_name = "ipSecPolMapEntry"
                self.yang_parent_name = "ipSecPolMapTable"

                self.ipsecpolmaptunindex = YLeaf(YType.int32, "ipSecPolMapTunIndex")

                self.ipsecpolmapacestring = YLeaf(YType.str, "ipSecPolMapAceString")

                self.ipsecpolmapaclstring = YLeaf(YType.str, "ipSecPolMapAclString")

                self.ipsecpolmapcryptomapname = YLeaf(YType.str, "ipSecPolMapCryptoMapName")

                self.ipsecpolmapcryptomapnum = YLeaf(YType.int32, "ipSecPolMapCryptoMapNum")

            def __setattr__(self, name, value):
                self._check_monkey_patching_error(name, value)
                with _handle_type_error():
                    if name in self.__dict__ and isinstance(self.__dict__[name], YList):
                        raise YPYModelError("Attempt to assign value of '{}' to YList ldata. "
                                            "Please use list append or extend method."
                                            .format(value))
                    if isinstance(value, Enum.YLeaf):
                        value = value.name
                    if name in ("ipsecpolmaptunindex",
                                "ipsecpolmapacestring",
                                "ipsecpolmapaclstring",
                                "ipsecpolmapcryptomapname",
                                "ipsecpolmapcryptomapnum") and name in self.__dict__:
                        if isinstance(value, YLeaf):
                            self.__dict__[name].set(value.get())
                        elif isinstance(value, YLeafList):
                            super(CiscoIpsecPolicyMapMib.Ipsecpolmaptable.Ipsecpolmapentry, self).__setattr__(name, value)
                        else:
                            self.__dict__[name].set(value)
                    else:
                        if hasattr(value, "parent") and name != "parent":
                            if hasattr(value, "is_presence_container") and value.is_presence_container:
                                value.parent = self
                            elif value.parent is None and value.yang_name in self._children_yang_names:
                                value.parent = self
                        super(CiscoIpsecPolicyMapMib.Ipsecpolmaptable.Ipsecpolmapentry, self).__setattr__(name, value)

            def has_data(self):
                return (
                    self.ipsecpolmaptunindex.is_set or
                    self.ipsecpolmapacestring.is_set or
                    self.ipsecpolmapaclstring.is_set or
                    self.ipsecpolmapcryptomapname.is_set or
                    self.ipsecpolmapcryptomapnum.is_set)

            def has_operation(self):
                return (
                    self.yfilter != YFilter.not_set or
                    self.ipsecpolmaptunindex.yfilter != YFilter.not_set or
                    self.ipsecpolmapacestring.yfilter != YFilter.not_set or
                    self.ipsecpolmapaclstring.yfilter != YFilter.not_set or
                    self.ipsecpolmapcryptomapname.yfilter != YFilter.not_set or
                    self.ipsecpolmapcryptomapnum.yfilter != YFilter.not_set)

            def get_segment_path(self):
                path_buffer = ""
                path_buffer = "ipSecPolMapEntry" + "[ipSecPolMapTunIndex='" + self.ipsecpolmaptunindex.get() + "']" + path_buffer

                return path_buffer

            def get_entity_path(self, ancestor):
                path_buffer = ""
                if (ancestor is None):
                    path_buffer = "CISCO-IPSEC-POLICY-MAP-MIB:CISCO-IPSEC-POLICY-MAP-MIB/ipSecPolMapTable/%s" % self.get_segment_path()
                else:
                    path_buffer = _get_relative_entity_path(self, ancestor, path_buffer)

                leaf_name_data = LeafDataList()
                if (self.ipsecpolmaptunindex.is_set or self.ipsecpolmaptunindex.yfilter != YFilter.not_set):
                    leaf_name_data.append(self.ipsecpolmaptunindex.get_name_leafdata())
                if (self.ipsecpolmapacestring.is_set or self.ipsecpolmapacestring.yfilter != YFilter.not_set):
                    leaf_name_data.append(self.ipsecpolmapacestring.get_name_leafdata())
                if (self.ipsecpolmapaclstring.is_set or self.ipsecpolmapaclstring.yfilter != YFilter.not_set):
                    leaf_name_data.append(self.ipsecpolmapaclstring.get_name_leafdata())
                if (self.ipsecpolmapcryptomapname.is_set or self.ipsecpolmapcryptomapname.yfilter != YFilter.not_set):
                    leaf_name_data.append(self.ipsecpolmapcryptomapname.get_name_leafdata())
                if (self.ipsecpolmapcryptomapnum.is_set or self.ipsecpolmapcryptomapnum.yfilter != YFilter.not_set):
                    leaf_name_data.append(self.ipsecpolmapcryptomapnum.get_name_leafdata())

                entity_path = EntityPath(path_buffer, leaf_name_data)
                return entity_path

            def get_child_by_name(self, child_yang_name, segment_path):
                child = self._get_child_by_seg_name([child_yang_name, segment_path])
                if child is not None:
                    return child

                return None

            def has_leaf_or_child_of_name(self, name):
                if(name == "ipSecPolMapTunIndex" or name == "ipSecPolMapAceString" or name == "ipSecPolMapAclString" or name == "ipSecPolMapCryptoMapName" or name == "ipSecPolMapCryptoMapNum"):
                    return True
                return False

            def set_value(self, value_path, value, name_space, name_space_prefix):
                if(value_path == "ipSecPolMapTunIndex"):
                    self.ipsecpolmaptunindex = value
                    self.ipsecpolmaptunindex.value_namespace = name_space
                    self.ipsecpolmaptunindex.value_namespace_prefix = name_space_prefix
                if(value_path == "ipSecPolMapAceString"):
                    self.ipsecpolmapacestring = value
                    self.ipsecpolmapacestring.value_namespace = name_space
                    self.ipsecpolmapacestring.value_namespace_prefix = name_space_prefix
                if(value_path == "ipSecPolMapAclString"):
                    self.ipsecpolmapaclstring = value
                    self.ipsecpolmapaclstring.value_namespace = name_space
                    self.ipsecpolmapaclstring.value_namespace_prefix = name_space_prefix
                if(value_path == "ipSecPolMapCryptoMapName"):
                    self.ipsecpolmapcryptomapname = value
                    self.ipsecpolmapcryptomapname.value_namespace = name_space
                    self.ipsecpolmapcryptomapname.value_namespace_prefix = name_space_prefix
                if(value_path == "ipSecPolMapCryptoMapNum"):
                    self.ipsecpolmapcryptomapnum = value
                    self.ipsecpolmapcryptomapnum.value_namespace = name_space
                    self.ipsecpolmapcryptomapnum.value_namespace_prefix = name_space_prefix

        def has_data(self):
            for c in self.ipsecpolmapentry:
                if (c.has_data()):
                    return True
            return False

        def has_operation(self):
            for c in self.ipsecpolmapentry:
                if (c.has_operation()):
                    return True
            return self.yfilter != YFilter.not_set

        def get_segment_path(self):
            path_buffer = ""
            path_buffer = "ipSecPolMapTable" + path_buffer

            return path_buffer

        def get_entity_path(self, ancestor):
            path_buffer = ""
            if (ancestor is None):
                path_buffer = "CISCO-IPSEC-POLICY-MAP-MIB:CISCO-IPSEC-POLICY-MAP-MIB/%s" % self.get_segment_path()
            else:
                path_buffer = _get_relative_entity_path(self, ancestor, path_buffer)

            leaf_name_data = LeafDataList()

            entity_path = EntityPath(path_buffer, leaf_name_data)
            return entity_path

        def get_child_by_name(self, child_yang_name, segment_path):
            child = self._get_child_by_seg_name([child_yang_name, segment_path])
            if child is not None:
                return child

            if (child_yang_name == "ipSecPolMapEntry"):
                for c in self.ipsecpolmapentry:
                    segment = c.get_segment_path()
                    if (segment_path == segment):
                        return c
                c = CiscoIpsecPolicyMapMib.Ipsecpolmaptable.Ipsecpolmapentry()
                c.parent = self
                local_reference_key = "ydk::seg::%s" % segment_path
                self._local_refs[local_reference_key] = c
                self.ipsecpolmapentry.append(c)
                return c

            return None

        def has_leaf_or_child_of_name(self, name):
            if(name == "ipSecPolMapEntry"):
                return True
            return False

        def set_value(self, value_path, value, name_space, name_space_prefix):
            pass
    class PbtsForwardClassFallbacks(Entity):
        """
        PBTS class configuration
        
        .. attribute:: pbts_forward_class_fallback
        
        	Set PBTS class for fallback
        	**type**\: list of    :py:class:`PbtsForwardClassFallback <ydk.models.cisco_ios_xr.Cisco_IOS_XR_fib_common_cfg.Fib.PbtsForwardClassFallbacks.PbtsForwardClassFallback>`
        
        

        """

        _prefix = 'fib-common-cfg'
        _revision = '2017-01-20'

        def __init__(self):
            super(Fib.PbtsForwardClassFallbacks, self).__init__()

            self.yang_name = "pbts-forward-class-fallbacks"
            self.yang_parent_name = "fib"

            self.pbts_forward_class_fallback = YList(self)

        def __setattr__(self, name, value):
            self._check_monkey_patching_error(name, value)
            with _handle_type_error():
                if name in self.__dict__ and isinstance(
                        self.__dict__[name], YList):
                    raise YPYModelError(
                        "Attempt to assign value of '{}' to YList ldata. "
                        "Please use list append or extend method.".format(
                            value))
                if isinstance(value, Enum.YLeaf):
                    value = value.name
                if name in () and name in self.__dict__:
                    if isinstance(value, YLeaf):
                        self.__dict__[name].set(value.get())
                    elif isinstance(value, YLeafList):
                        super(Fib.PbtsForwardClassFallbacks,
                              self).__setattr__(name, value)
                    else:
                        self.__dict__[name].set(value)
                else:
                    if hasattr(value, "parent") and name != "parent":
                        if hasattr(value, "is_presence_container"
                                   ) and value.is_presence_container:
                            value.parent = self
                        elif value.parent is None and value.yang_name in self._children_yang_names:
                            value.parent = self
                    super(Fib.PbtsForwardClassFallbacks,
                          self).__setattr__(name, value)

        class PbtsForwardClassFallback(Entity):
            """
            Set PBTS class for fallback
            
            .. attribute:: forward_class_number  <key>
            
            	PBTS forward class number
            	**type**\: one of the below types:
            
            	**type**\:   :py:class:`FibPbtsForwardClass <ydk.models.cisco_ios_xr.Cisco_IOS_XR_fib_common_cfg.FibPbtsForwardClass>`
            
            
            ----
            	**type**\:  int
            
            	**range:** 0..8
            
            
            ----
            .. attribute:: fallback_class_number_array
            
            	Set PBTS fallback class number array
            	**type**\:  list of int
            
            	**range:** 0..7
            
            .. attribute:: fallback_type
            
            	Set PBTS fallback type
            	**type**\:   :py:class:`FibPbtsFallback <ydk.models.cisco_ios_xr.Cisco_IOS_XR_fib_common_cfg.FibPbtsFallback>`
            
            	**mandatory**\: True
            
            

            """

            _prefix = 'fib-common-cfg'
            _revision = '2017-01-20'

            def __init__(self):
                super(Fib.PbtsForwardClassFallbacks.PbtsForwardClassFallback,
                      self).__init__()

                self.yang_name = "pbts-forward-class-fallback"
                self.yang_parent_name = "pbts-forward-class-fallbacks"

                self.forward_class_number = YLeaf(YType.str,
                                                  "forward-class-number")

                self.fallback_class_number_array = YLeafList(
                    YType.uint32, "fallback-class-number-array")

                self.fallback_type = YLeaf(YType.enumeration, "fallback-type")

            def __setattr__(self, name, value):
                self._check_monkey_patching_error(name, value)
                with _handle_type_error():
                    if name in self.__dict__ and isinstance(
                            self.__dict__[name], YList):
                        raise YPYModelError(
                            "Attempt to assign value of '{}' to YList ldata. "
                            "Please use list append or extend method.".format(
                                value))
                    if isinstance(value, Enum.YLeaf):
                        value = value.name
                    if name in ("forward_class_number",
                                "fallback_class_number_array",
                                "fallback_type") and name in self.__dict__:
                        if isinstance(value, YLeaf):
                            self.__dict__[name].set(value.get())
                        elif isinstance(value, YLeafList):
                            super(
                                Fib.PbtsForwardClassFallbacks.
                                PbtsForwardClassFallback,
                                self).__setattr__(name, value)
                        else:
                            self.__dict__[name].set(value)
                    else:
                        if hasattr(value, "parent") and name != "parent":
                            if hasattr(value, "is_presence_container"
                                       ) and value.is_presence_container:
                                value.parent = self
                            elif value.parent is None and value.yang_name in self._children_yang_names:
                                value.parent = self
                        super(
                            Fib.PbtsForwardClassFallbacks.
                            PbtsForwardClassFallback,
                            self).__setattr__(name, value)

            def has_data(self):
                for leaf in self.fallback_class_number_array.getYLeafs():
                    if (leaf.yfilter != YFilter.not_set):
                        return True
                return (self.forward_class_number.is_set
                        or self.fallback_type.is_set)

            def has_operation(self):
                for leaf in self.fallback_class_number_array.getYLeafs():
                    if (leaf.is_set):
                        return True
                return (self.yfilter != YFilter.not_set
                        or self.forward_class_number.yfilter != YFilter.not_set
                        or self.fallback_class_number_array.yfilter !=
                        YFilter.not_set
                        or self.fallback_type.yfilter != YFilter.not_set)

            def get_segment_path(self):
                path_buffer = ""
                path_buffer = "pbts-forward-class-fallback" + "[forward-class-number='" + self.forward_class_number.get(
                ) + "']" + path_buffer

                return path_buffer

            def get_entity_path(self, ancestor):
                path_buffer = ""
                if (ancestor is None):
                    path_buffer = "Cisco-IOS-XR-fib-common-cfg:fib/pbts-forward-class-fallbacks/%s" % self.get_segment_path(
                    )
                else:
                    path_buffer = _get_relative_entity_path(
                        self, ancestor, path_buffer)

                leaf_name_data = LeafDataList()
                if (self.forward_class_number.is_set or
                        self.forward_class_number.yfilter != YFilter.not_set):
                    leaf_name_data.append(
                        self.forward_class_number.get_name_leafdata())
                if (self.fallback_type.is_set
                        or self.fallback_type.yfilter != YFilter.not_set):
                    leaf_name_data.append(
                        self.fallback_type.get_name_leafdata())

                leaf_name_data.extend(
                    self.fallback_class_number_array.get_name_leafdata())

                entity_path = EntityPath(path_buffer, leaf_name_data)
                return entity_path

            def get_child_by_name(self, child_yang_name, segment_path):
                child = self._get_child_by_seg_name(
                    [child_yang_name, segment_path])
                if child is not None:
                    return child

                return None

            def has_leaf_or_child_of_name(self, name):
                if (name == "forward-class-number"
                        or name == "fallback-class-number-array"
                        or name == "fallback-type"):
                    return True
                return False

            def set_value(self, value_path, value, name_space,
                          name_space_prefix):
                if (value_path == "forward-class-number"):
                    self.forward_class_number = value
                    self.forward_class_number.value_namespace = name_space
                    self.forward_class_number.value_namespace_prefix = name_space_prefix
                if (value_path == "fallback-class-number-array"):
                    self.fallback_class_number_array.append(value)
                if (value_path == "fallback-type"):
                    self.fallback_type = value
                    self.fallback_type.value_namespace = name_space
                    self.fallback_type.value_namespace_prefix = name_space_prefix

        def has_data(self):
            for c in self.pbts_forward_class_fallback:
                if (c.has_data()):
                    return True
            return False

        def has_operation(self):
            for c in self.pbts_forward_class_fallback:
                if (c.has_operation()):
                    return True
            return self.yfilter != YFilter.not_set

        def get_segment_path(self):
            path_buffer = ""
            path_buffer = "pbts-forward-class-fallbacks" + path_buffer

            return path_buffer

        def get_entity_path(self, ancestor):
            path_buffer = ""
            if (ancestor is None):
                path_buffer = "Cisco-IOS-XR-fib-common-cfg:fib/%s" % self.get_segment_path(
                )
            else:
                path_buffer = _get_relative_entity_path(
                    self, ancestor, path_buffer)

            leaf_name_data = LeafDataList()

            entity_path = EntityPath(path_buffer, leaf_name_data)
            return entity_path

        def get_child_by_name(self, child_yang_name, segment_path):
            child = self._get_child_by_seg_name(
                [child_yang_name, segment_path])
            if child is not None:
                return child

            if (child_yang_name == "pbts-forward-class-fallback"):
                for c in self.pbts_forward_class_fallback:
                    segment = c.get_segment_path()
                    if (segment_path == segment):
                        return c
                c = Fib.PbtsForwardClassFallbacks.PbtsForwardClassFallback()
                c.parent = self
                local_reference_key = "ydk::seg::%s" % segment_path
                self._local_refs[local_reference_key] = c
                self.pbts_forward_class_fallback.append(c)
                return c

            return None

        def has_leaf_or_child_of_name(self, name):
            if (name == "pbts-forward-class-fallback"):
                return True
            return False

        def set_value(self, value_path, value, name_space, name_space_prefix):
            pass
        class Stream(Entity):
            """
            Each entry describes an event stream supported by
            the server.
            
            .. attribute:: name  <key>
            
            	The stream name
            	**type**\:  str
            
            .. attribute:: access
            
            	The server will create an entry in this list for each encoding format that is supported for this stream. The media type 'text/event\-stream' is expected for all event streams. This list identifies the sub\-types supported for this stream
            	**type**\: list of    :py:class:`Access <ydk.models.ietf.ietf_restconf_monitoring.RestconfState.Streams.Stream.Access>`
            
            .. attribute:: description
            
            	Description of stream content
            	**type**\:  str
            
            .. attribute:: replay_log_creation_time
            
            	Indicates the time the replay log for this stream was created
            	**type**\:  str
            
            	**pattern:** \\d{4}\-\\d{2}\-\\d{2}T\\d{2}\:\\d{2}\:\\d{2}(\\.\\d+)?(Z\|[\\+\\\-]\\d{2}\:\\d{2})
            
            .. attribute:: replay_support
            
            	Indicates if replay buffer supported for this stream. If 'true', then the server MUST support the 'start\-time' and 'stop\-time' query parameters for this stream
            	**type**\:  bool
            
            	**default value**\: false
            
            

            """

            _prefix = 'rcmon'
            _revision = '2016-08-15'

            def __init__(self):
                super(RestconfState.Streams.Stream, self).__init__()

                self.yang_name = "stream"
                self.yang_parent_name = "streams"

                self.name = YLeaf(YType.str, "name")

                self.description = YLeaf(YType.str, "description")

                self.replay_log_creation_time = YLeaf(
                    YType.str, "replay-log-creation-time")

                self.replay_support = YLeaf(YType.boolean, "replay-support")

                self.access = YList(self)

            def __setattr__(self, name, value):
                self._check_monkey_patching_error(name, value)
                with _handle_type_error():
                    if name in self.__dict__ and isinstance(
                            self.__dict__[name], YList):
                        raise YPYModelError(
                            "Attempt to assign value of '{}' to YList ldata. "
                            "Please use list append or extend method.".format(
                                value))
                    if isinstance(value, Enum.YLeaf):
                        value = value.name
                    if name in ("name", "description",
                                "replay_log_creation_time",
                                "replay_support") and name in self.__dict__:
                        if isinstance(value, YLeaf):
                            self.__dict__[name].set(value.get())
                        elif isinstance(value, YLeafList):
                            super(RestconfState.Streams.Stream,
                                  self).__setattr__(name, value)
                        else:
                            self.__dict__[name].set(value)
                    else:
                        if hasattr(value, "parent") and name != "parent":
                            if hasattr(value, "is_presence_container"
                                       ) and value.is_presence_container:
                                value.parent = self
                            elif value.parent is None and value.yang_name in self._children_yang_names:
                                value.parent = self
                        super(RestconfState.Streams.Stream,
                              self).__setattr__(name, value)

            class Access(Entity):
                """
                The server will create an entry in this list for each
                encoding format that is supported for this stream.
                The media type 'text/event\-stream' is expected
                for all event streams. This list identifies the
                sub\-types supported for this stream.
                
                .. attribute:: encoding  <key>
                
                	This is the secondary encoding format within the 'text/event\-stream' encoding used by all streams. The type 'xml' is supported for XML encoding.  The type 'json' is supported for JSON encoding
                	**type**\:  str
                
                .. attribute:: location
                
                	Contains a URL that represents the entry point for establishing notification delivery via server sent events
                	**type**\:  str
                
                	**mandatory**\: True
                
                

                """

                _prefix = 'rcmon'
                _revision = '2016-08-15'

                def __init__(self):
                    super(RestconfState.Streams.Stream.Access, self).__init__()

                    self.yang_name = "access"
                    self.yang_parent_name = "stream"

                    self.encoding = YLeaf(YType.str, "encoding")

                    self.location = YLeaf(YType.str, "location")

                def __setattr__(self, name, value):
                    self._check_monkey_patching_error(name, value)
                    with _handle_type_error():
                        if name in self.__dict__ and isinstance(
                                self.__dict__[name], YList):
                            raise YPYModelError(
                                "Attempt to assign value of '{}' to YList ldata. "
                                "Please use list append or extend method.".
                                format(value))
                        if isinstance(value, Enum.YLeaf):
                            value = value.name
                        if name in ("encoding",
                                    "location") and name in self.__dict__:
                            if isinstance(value, YLeaf):
                                self.__dict__[name].set(value.get())
                            elif isinstance(value, YLeafList):
                                super(RestconfState.Streams.Stream.Access,
                                      self).__setattr__(name, value)
                            else:
                                self.__dict__[name].set(value)
                        else:
                            if hasattr(value, "parent") and name != "parent":
                                if hasattr(value, "is_presence_container"
                                           ) and value.is_presence_container:
                                    value.parent = self
                                elif value.parent is None and value.yang_name in self._children_yang_names:
                                    value.parent = self
                            super(RestconfState.Streams.Stream.Access,
                                  self).__setattr__(name, value)

                def has_data(self):
                    return (self.encoding.is_set or self.location.is_set)

                def has_operation(self):
                    return (self.yfilter != YFilter.not_set
                            or self.encoding.yfilter != YFilter.not_set
                            or self.location.yfilter != YFilter.not_set)

                def get_segment_path(self):
                    path_buffer = ""
                    path_buffer = "access" + "[encoding='" + self.encoding.get(
                    ) + "']" + path_buffer

                    return path_buffer

                def get_entity_path(self, ancestor):
                    path_buffer = ""
                    if (ancestor is None):
                        raise YPYModelError(
                            "ancestor cannot be None as one of the ancestors is a list"
                        )
                    else:
                        path_buffer = _get_relative_entity_path(
                            self, ancestor, path_buffer)

                    leaf_name_data = LeafDataList()
                    if (self.encoding.is_set
                            or self.encoding.yfilter != YFilter.not_set):
                        leaf_name_data.append(
                            self.encoding.get_name_leafdata())
                    if (self.location.is_set
                            or self.location.yfilter != YFilter.not_set):
                        leaf_name_data.append(
                            self.location.get_name_leafdata())

                    entity_path = EntityPath(path_buffer, leaf_name_data)
                    return entity_path

                def get_child_by_name(self, child_yang_name, segment_path):
                    child = self._get_child_by_seg_name(
                        [child_yang_name, segment_path])
                    if child is not None:
                        return child

                    return None

                def has_leaf_or_child_of_name(self, name):
                    if (name == "encoding" or name == "location"):
                        return True
                    return False

                def set_value(self, value_path, value, name_space,
                              name_space_prefix):
                    if (value_path == "encoding"):
                        self.encoding = value
                        self.encoding.value_namespace = name_space
                        self.encoding.value_namespace_prefix = name_space_prefix
                    if (value_path == "location"):
                        self.location = value
                        self.location.value_namespace = name_space
                        self.location.value_namespace_prefix = name_space_prefix

            def has_data(self):
                for c in self.access:
                    if (c.has_data()):
                        return True
                return (self.name.is_set or self.description.is_set
                        or self.replay_log_creation_time.is_set
                        or self.replay_support.is_set)

            def has_operation(self):
                for c in self.access:
                    if (c.has_operation()):
                        return True
                return (
                    self.yfilter != YFilter.not_set
                    or self.name.yfilter != YFilter.not_set
                    or self.description.yfilter != YFilter.not_set
                    or self.replay_log_creation_time.yfilter != YFilter.not_set
                    or self.replay_support.yfilter != YFilter.not_set)

            def get_segment_path(self):
                path_buffer = ""
                path_buffer = "stream" + "[name='" + self.name.get(
                ) + "']" + path_buffer

                return path_buffer

            def get_entity_path(self, ancestor):
                path_buffer = ""
                if (ancestor is None):
                    path_buffer = "ietf-restconf-monitoring:restconf-state/streams/%s" % self.get_segment_path(
                    )
                else:
                    path_buffer = _get_relative_entity_path(
                        self, ancestor, path_buffer)

                leaf_name_data = LeafDataList()
                if (self.name.is_set or self.name.yfilter != YFilter.not_set):
                    leaf_name_data.append(self.name.get_name_leafdata())
                if (self.description.is_set
                        or self.description.yfilter != YFilter.not_set):
                    leaf_name_data.append(self.description.get_name_leafdata())
                if (self.replay_log_creation_time.is_set
                        or self.replay_log_creation_time.yfilter !=
                        YFilter.not_set):
                    leaf_name_data.append(
                        self.replay_log_creation_time.get_name_leafdata())
                if (self.replay_support.is_set
                        or self.replay_support.yfilter != YFilter.not_set):
                    leaf_name_data.append(
                        self.replay_support.get_name_leafdata())

                entity_path = EntityPath(path_buffer, leaf_name_data)
                return entity_path

            def get_child_by_name(self, child_yang_name, segment_path):
                child = self._get_child_by_seg_name(
                    [child_yang_name, segment_path])
                if child is not None:
                    return child

                if (child_yang_name == "access"):
                    for c in self.access:
                        segment = c.get_segment_path()
                        if (segment_path == segment):
                            return c
                    c = RestconfState.Streams.Stream.Access()
                    c.parent = self
                    local_reference_key = "ydk::seg::%s" % segment_path
                    self._local_refs[local_reference_key] = c
                    self.access.append(c)
                    return c

                return None

            def has_leaf_or_child_of_name(self, name):
                if (name == "access" or name == "name" or name == "description"
                        or name == "replay-log-creation-time"
                        or name == "replay-support"):
                    return True
                return False

            def set_value(self, value_path, value, name_space,
                          name_space_prefix):
                if (value_path == "name"):
                    self.name = value
                    self.name.value_namespace = name_space
                    self.name.value_namespace_prefix = name_space_prefix
                if (value_path == "description"):
                    self.description = value
                    self.description.value_namespace = name_space
                    self.description.value_namespace_prefix = name_space_prefix
                if (value_path == "replay-log-creation-time"):
                    self.replay_log_creation_time = value
                    self.replay_log_creation_time.value_namespace = name_space
                    self.replay_log_creation_time.value_namespace_prefix = name_space_prefix
                if (value_path == "replay-support"):
                    self.replay_support = value
                    self.replay_support.value_namespace = name_space
                    self.replay_support.value_namespace_prefix = name_space_prefix
Пример #26
0
    class Profiles(Entity):
        """
        Table of SSRP Profiles
        
        .. attribute:: profile
        
        	SSRP Profile configuration
        	**type**\: list of    :py:class:`Profile <ydk.models.cisco_ios_xr.Cisco_IOS_XR_ppp_ma_ssrp_cfg.Ssrp.Profiles.Profile>`
        
        

        """

        _prefix = 'ppp-ma-ssrp-cfg'
        _revision = '2015-11-09'

        def __init__(self):
            super(Ssrp.Profiles, self).__init__()

            self.yang_name = "profiles"
            self.yang_parent_name = "ssrp"

            self.profile = YList(self)

        def __setattr__(self, name, value):
            self._check_monkey_patching_error(name, value)
            with _handle_type_error():
                if name in self.__dict__ and isinstance(
                        self.__dict__[name], YList):
                    raise YPYModelError(
                        "Attempt to assign value of '{}' to YList ldata. "
                        "Please use list append or extend method.".format(
                            value))
                if isinstance(value, Enum.YLeaf):
                    value = value.name
                if name in () and name in self.__dict__:
                    if isinstance(value, YLeaf):
                        self.__dict__[name].set(value.get())
                    elif isinstance(value, YLeafList):
                        super(Ssrp.Profiles, self).__setattr__(name, value)
                    else:
                        self.__dict__[name].set(value)
                else:
                    if hasattr(value, "parent") and name != "parent":
                        if hasattr(value, "is_presence_container"
                                   ) and value.is_presence_container:
                            value.parent = self
                        elif value.parent is None and value.yang_name in self._children_yang_names:
                            value.parent = self
                    super(Ssrp.Profiles, self).__setattr__(name, value)

        class Profile(Entity):
            """
            SSRP Profile configuration
            
            .. attribute:: name  <key>
            
            	The name of the profile
            	**type**\:  str
            
            	**pattern:** [\\w\\\-\\.\:,\_@#%$\\+=\\\|;]+
            
            .. attribute:: max_hops
            
            	This specifies the maximum number of hops for packets on the SSO channel
            	**type**\:  int
            
            	**range:** 1..255
            
            .. attribute:: peer_ipv4_address
            
            	This specifies the remote end's IPv4\-address for the SSO channel
            	**type**\:  str
            
            	**pattern:** (([0\-9]\|[1\-9][0\-9]\|1[0\-9][0\-9]\|2[0\-4][0\-9]\|25[0\-5])\\.){3}([0\-9]\|[1\-9][0\-9]\|1[0\-9][0\-9]\|2[0\-4][0\-9]\|25[0\-5])(%[\\p{N}\\p{L}]+)?
            
            

            """

            _prefix = 'ppp-ma-ssrp-cfg'
            _revision = '2015-11-09'

            def __init__(self):
                super(Ssrp.Profiles.Profile, self).__init__()

                self.yang_name = "profile"
                self.yang_parent_name = "profiles"

                self.name = YLeaf(YType.str, "name")

                self.max_hops = YLeaf(YType.uint32, "max-hops")

                self.peer_ipv4_address = YLeaf(YType.str, "peer-ipv4-address")

            def __setattr__(self, name, value):
                self._check_monkey_patching_error(name, value)
                with _handle_type_error():
                    if name in self.__dict__ and isinstance(
                            self.__dict__[name], YList):
                        raise YPYModelError(
                            "Attempt to assign value of '{}' to YList ldata. "
                            "Please use list append or extend method.".format(
                                value))
                    if isinstance(value, Enum.YLeaf):
                        value = value.name
                    if name in ("name", "max_hops",
                                "peer_ipv4_address") and name in self.__dict__:
                        if isinstance(value, YLeaf):
                            self.__dict__[name].set(value.get())
                        elif isinstance(value, YLeafList):
                            super(Ssrp.Profiles.Profile,
                                  self).__setattr__(name, value)
                        else:
                            self.__dict__[name].set(value)
                    else:
                        if hasattr(value, "parent") and name != "parent":
                            if hasattr(value, "is_presence_container"
                                       ) and value.is_presence_container:
                                value.parent = self
                            elif value.parent is None and value.yang_name in self._children_yang_names:
                                value.parent = self
                        super(Ssrp.Profiles.Profile,
                              self).__setattr__(name, value)

            def has_data(self):
                return (self.name.is_set or self.max_hops.is_set
                        or self.peer_ipv4_address.is_set)

            def has_operation(self):
                return (self.yfilter != YFilter.not_set
                        or self.name.yfilter != YFilter.not_set
                        or self.max_hops.yfilter != YFilter.not_set
                        or self.peer_ipv4_address.yfilter != YFilter.not_set)

            def get_segment_path(self):
                path_buffer = ""
                path_buffer = "profile" + "[name='" + self.name.get(
                ) + "']" + path_buffer

                return path_buffer

            def get_entity_path(self, ancestor):
                path_buffer = ""
                if (ancestor is None):
                    path_buffer = "Cisco-IOS-XR-ppp-ma-ssrp-cfg:ssrp/profiles/%s" % self.get_segment_path(
                    )
                else:
                    path_buffer = _get_relative_entity_path(
                        self, ancestor, path_buffer)

                leaf_name_data = LeafDataList()
                if (self.name.is_set or self.name.yfilter != YFilter.not_set):
                    leaf_name_data.append(self.name.get_name_leafdata())
                if (self.max_hops.is_set
                        or self.max_hops.yfilter != YFilter.not_set):
                    leaf_name_data.append(self.max_hops.get_name_leafdata())
                if (self.peer_ipv4_address.is_set
                        or self.peer_ipv4_address.yfilter != YFilter.not_set):
                    leaf_name_data.append(
                        self.peer_ipv4_address.get_name_leafdata())

                entity_path = EntityPath(path_buffer, leaf_name_data)
                return entity_path

            def get_child_by_name(self, child_yang_name, segment_path):
                child = self._get_child_by_seg_name(
                    [child_yang_name, segment_path])
                if child is not None:
                    return child

                return None

            def has_leaf_or_child_of_name(self, name):
                if (name == "name" or name == "max-hops"
                        or name == "peer-ipv4-address"):
                    return True
                return False

            def set_value(self, value_path, value, name_space,
                          name_space_prefix):
                if (value_path == "name"):
                    self.name = value
                    self.name.value_namespace = name_space
                    self.name.value_namespace_prefix = name_space_prefix
                if (value_path == "max-hops"):
                    self.max_hops = value
                    self.max_hops.value_namespace = name_space
                    self.max_hops.value_namespace_prefix = name_space_prefix
                if (value_path == "peer-ipv4-address"):
                    self.peer_ipv4_address = value
                    self.peer_ipv4_address.value_namespace = name_space
                    self.peer_ipv4_address.value_namespace_prefix = name_space_prefix

        def has_data(self):
            for c in self.profile:
                if (c.has_data()):
                    return True
            return False

        def has_operation(self):
            for c in self.profile:
                if (c.has_operation()):
                    return True
            return self.yfilter != YFilter.not_set

        def get_segment_path(self):
            path_buffer = ""
            path_buffer = "profiles" + path_buffer

            return path_buffer

        def get_entity_path(self, ancestor):
            path_buffer = ""
            if (ancestor is None):
                path_buffer = "Cisco-IOS-XR-ppp-ma-ssrp-cfg:ssrp/%s" % self.get_segment_path(
                )
            else:
                path_buffer = _get_relative_entity_path(
                    self, ancestor, path_buffer)

            leaf_name_data = LeafDataList()

            entity_path = EntityPath(path_buffer, leaf_name_data)
            return entity_path

        def get_child_by_name(self, child_yang_name, segment_path):
            child = self._get_child_by_seg_name(
                [child_yang_name, segment_path])
            if child is not None:
                return child

            if (child_yang_name == "profile"):
                for c in self.profile:
                    segment = c.get_segment_path()
                    if (segment_path == segment):
                        return c
                c = Ssrp.Profiles.Profile()
                c.parent = self
                local_reference_key = "ydk::seg::%s" % segment_path
                self._local_refs[local_reference_key] = c
                self.profile.append(c)
                return c

            return None

        def has_leaf_or_child_of_name(self, name):
            if (name == "profile"):
                return True
            return False

        def set_value(self, value_path, value, name_space, name_space_prefix):
            pass
Пример #27
0
    class Ceextentityledtable(Entity):
        """
        A table containing information of LED on an entity.
        
        .. attribute:: ceextentityledentry
        
        	An entry (conceptual row) in the ceExtEntityLEDTable, containing information about an LED on an entity, identified by  entPhysicalIndex
        	**type**\: list of    :py:class:`Ceextentityledentry <ydk.models.cisco_ios_xe.CISCO_ENTITY_EXT_MIB.CiscoEntityExtMib.Ceextentityledtable.Ceextentityledentry>`
        
        

        """

        _prefix = 'CISCO-ENTITY-EXT-MIB'
        _revision = '2008-11-24'

        def __init__(self):
            super(CiscoEntityExtMib.Ceextentityledtable, self).__init__()

            self.yang_name = "ceExtEntityLEDTable"
            self.yang_parent_name = "CISCO-ENTITY-EXT-MIB"

            self.ceextentityledentry = YList(self)

        def __setattr__(self, name, value):
            self._check_monkey_patching_error(name, value)
            with _handle_type_error():
                if name in self.__dict__ and isinstance(self.__dict__[name], YList):
                    raise YPYModelError("Attempt to assign value of '{}' to YList ldata. "
                                        "Please use list append or extend method."
                                        .format(value))
                if isinstance(value, Enum.YLeaf):
                    value = value.name
                if name in () and name in self.__dict__:
                    if isinstance(value, YLeaf):
                        self.__dict__[name].set(value.get())
                    elif isinstance(value, YLeafList):
                        super(CiscoEntityExtMib.Ceextentityledtable, self).__setattr__(name, value)
                    else:
                        self.__dict__[name].set(value)
                else:
                    if hasattr(value, "parent") and name != "parent":
                        if hasattr(value, "is_presence_container") and value.is_presence_container:
                            value.parent = self
                        elif value.parent is None and value.yang_name in self._children_yang_names:
                            value.parent = self
                    super(CiscoEntityExtMib.Ceextentityledtable, self).__setattr__(name, value)


        class Ceextentityledentry(Entity):
            """
            An entry (conceptual row) in the ceExtEntityLEDTable,
            containing information about an LED on an entity, identified by 
            entPhysicalIndex.
            
            .. attribute:: entphysicalindex  <key>
            
            	
            	**type**\:  int
            
            	**range:** 1..2147483647
            
            	**refers to**\:  :py:class:`entphysicalindex <ydk.models.cisco_ios_xe.ENTITY_MIB.EntityMib.Entphysicaltable.Entphysicalentry>`
            
            .. attribute:: ceextentityledtype  <key>
            
            	The type of LED on this entity. 'status' \- indicates the entity status. 'system' \- indicates the overall system status.  'active' \- the redundancy status of a module, for e.g.            supervisor module.  'power'  \- indicates sufficient power availability for all             modules. 'battery'\- indicates the battery status
            	**type**\:   :py:class:`Ceextentityledtype <ydk.models.cisco_ios_xe.CISCO_ENTITY_EXT_MIB.CiscoEntityExtMib.Ceextentityledtable.Ceextentityledentry.Ceextentityledtype>`
            
            .. attribute:: ceextentityledcolor
            
            	The color of the LED
            	**type**\:   :py:class:`Ceextentityledcolor <ydk.models.cisco_ios_xe.CISCO_ENTITY_EXT_MIB.CiscoEntityExtMib.Ceextentityledtable.Ceextentityledentry.Ceextentityledcolor>`
            
            

            """

            _prefix = 'CISCO-ENTITY-EXT-MIB'
            _revision = '2008-11-24'

            def __init__(self):
                super(CiscoEntityExtMib.Ceextentityledtable.Ceextentityledentry, self).__init__()

                self.yang_name = "ceExtEntityLEDEntry"
                self.yang_parent_name = "ceExtEntityLEDTable"

                self.entphysicalindex = YLeaf(YType.str, "entPhysicalIndex")

                self.ceextentityledtype = YLeaf(YType.enumeration, "ceExtEntityLEDType")

                self.ceextentityledcolor = YLeaf(YType.enumeration, "ceExtEntityLEDColor")

            def __setattr__(self, name, value):
                self._check_monkey_patching_error(name, value)
                with _handle_type_error():
                    if name in self.__dict__ and isinstance(self.__dict__[name], YList):
                        raise YPYModelError("Attempt to assign value of '{}' to YList ldata. "
                                            "Please use list append or extend method."
                                            .format(value))
                    if isinstance(value, Enum.YLeaf):
                        value = value.name
                    if name in ("entphysicalindex",
                                "ceextentityledtype",
                                "ceextentityledcolor") and name in self.__dict__:
                        if isinstance(value, YLeaf):
                            self.__dict__[name].set(value.get())
                        elif isinstance(value, YLeafList):
                            super(CiscoEntityExtMib.Ceextentityledtable.Ceextentityledentry, self).__setattr__(name, value)
                        else:
                            self.__dict__[name].set(value)
                    else:
                        if hasattr(value, "parent") and name != "parent":
                            if hasattr(value, "is_presence_container") and value.is_presence_container:
                                value.parent = self
                            elif value.parent is None and value.yang_name in self._children_yang_names:
                                value.parent = self
                        super(CiscoEntityExtMib.Ceextentityledtable.Ceextentityledentry, self).__setattr__(name, value)

            class Ceextentityledcolor(Enum):
                """
                Ceextentityledcolor

                The color of the LED.

                .. data:: off = 1

                .. data:: green = 2

                .. data:: amber = 3

                .. data:: red = 4

                """

                off = Enum.YLeaf(1, "off")

                green = Enum.YLeaf(2, "green")

                amber = Enum.YLeaf(3, "amber")

                red = Enum.YLeaf(4, "red")


            class Ceextentityledtype(Enum):
                """
                Ceextentityledtype

                The type of LED on this entity.

                'status' \- indicates the entity status.

                'system' \- indicates the overall system status. 

                'active' \- the redundancy status of a module, for e.g.

                           supervisor module. 

                'power'  \- indicates sufficient power availability for all 

                           modules.

                'battery'\- indicates the battery status.

                .. data:: status = 1

                .. data:: system = 2

                .. data:: active = 3

                .. data:: power = 4

                .. data:: battery = 5

                """

                status = Enum.YLeaf(1, "status")

                system = Enum.YLeaf(2, "system")

                active = Enum.YLeaf(3, "active")

                power = Enum.YLeaf(4, "power")

                battery = Enum.YLeaf(5, "battery")


            def has_data(self):
                return (
                    self.entphysicalindex.is_set or
                    self.ceextentityledtype.is_set or
                    self.ceextentityledcolor.is_set)

            def has_operation(self):
                return (
                    self.yfilter != YFilter.not_set or
                    self.entphysicalindex.yfilter != YFilter.not_set or
                    self.ceextentityledtype.yfilter != YFilter.not_set or
                    self.ceextentityledcolor.yfilter != YFilter.not_set)

            def get_segment_path(self):
                path_buffer = ""
                path_buffer = "ceExtEntityLEDEntry" + "[entPhysicalIndex='" + self.entphysicalindex.get() + "']" + "[ceExtEntityLEDType='" + self.ceextentityledtype.get() + "']" + path_buffer

                return path_buffer

            def get_entity_path(self, ancestor):
                path_buffer = ""
                if (ancestor is None):
                    path_buffer = "CISCO-ENTITY-EXT-MIB:CISCO-ENTITY-EXT-MIB/ceExtEntityLEDTable/%s" % self.get_segment_path()
                else:
                    path_buffer = _get_relative_entity_path(self, ancestor, path_buffer)

                leaf_name_data = LeafDataList()
                if (self.entphysicalindex.is_set or self.entphysicalindex.yfilter != YFilter.not_set):
                    leaf_name_data.append(self.entphysicalindex.get_name_leafdata())
                if (self.ceextentityledtype.is_set or self.ceextentityledtype.yfilter != YFilter.not_set):
                    leaf_name_data.append(self.ceextentityledtype.get_name_leafdata())
                if (self.ceextentityledcolor.is_set or self.ceextentityledcolor.yfilter != YFilter.not_set):
                    leaf_name_data.append(self.ceextentityledcolor.get_name_leafdata())

                entity_path = EntityPath(path_buffer, leaf_name_data)
                return entity_path

            def get_child_by_name(self, child_yang_name, segment_path):
                child = self._get_child_by_seg_name([child_yang_name, segment_path])
                if child is not None:
                    return child

                return None

            def has_leaf_or_child_of_name(self, name):
                if(name == "entPhysicalIndex" or name == "ceExtEntityLEDType" or name == "ceExtEntityLEDColor"):
                    return True
                return False

            def set_value(self, value_path, value, name_space, name_space_prefix):
                if(value_path == "entPhysicalIndex"):
                    self.entphysicalindex = value
                    self.entphysicalindex.value_namespace = name_space
                    self.entphysicalindex.value_namespace_prefix = name_space_prefix
                if(value_path == "ceExtEntityLEDType"):
                    self.ceextentityledtype = value
                    self.ceextentityledtype.value_namespace = name_space
                    self.ceextentityledtype.value_namespace_prefix = name_space_prefix
                if(value_path == "ceExtEntityLEDColor"):
                    self.ceextentityledcolor = value
                    self.ceextentityledcolor.value_namespace = name_space
                    self.ceextentityledcolor.value_namespace_prefix = name_space_prefix

        def has_data(self):
            for c in self.ceextentityledentry:
                if (c.has_data()):
                    return True
            return False

        def has_operation(self):
            for c in self.ceextentityledentry:
                if (c.has_operation()):
                    return True
            return self.yfilter != YFilter.not_set

        def get_segment_path(self):
            path_buffer = ""
            path_buffer = "ceExtEntityLEDTable" + path_buffer

            return path_buffer

        def get_entity_path(self, ancestor):
            path_buffer = ""
            if (ancestor is None):
                path_buffer = "CISCO-ENTITY-EXT-MIB:CISCO-ENTITY-EXT-MIB/%s" % self.get_segment_path()
            else:
                path_buffer = _get_relative_entity_path(self, ancestor, path_buffer)

            leaf_name_data = LeafDataList()

            entity_path = EntityPath(path_buffer, leaf_name_data)
            return entity_path

        def get_child_by_name(self, child_yang_name, segment_path):
            child = self._get_child_by_seg_name([child_yang_name, segment_path])
            if child is not None:
                return child

            if (child_yang_name == "ceExtEntityLEDEntry"):
                for c in self.ceextentityledentry:
                    segment = c.get_segment_path()
                    if (segment_path == segment):
                        return c
                c = CiscoEntityExtMib.Ceextentityledtable.Ceextentityledentry()
                c.parent = self
                local_reference_key = "ydk::seg::%s" % segment_path
                self._local_refs[local_reference_key] = c
                self.ceextentityledentry.append(c)
                return c

            return None

        def has_leaf_or_child_of_name(self, name):
            if(name == "ceExtEntityLEDEntry"):
                return True
            return False

        def set_value(self, value_path, value, name_space, name_space_prefix):
            pass
Пример #28
0
class InventoryConfigurations(Entity):
    """
    Configuration for inventory entities
    
    .. attribute:: entity_
    
    	Entity name
    	**type**\: list of    :py:class:`Entity_ <ydk.models.cisco_ios_xr.Cisco_IOS_XR_invmgr_cfg.InventoryConfigurations.Entity_>`
    
    

    """

    _prefix = 'invmgr-cfg'
    _revision = '2015-11-09'

    def __init__(self):
        super(InventoryConfigurations, self).__init__()
        self._top_entity = None

        self.yang_name = "inventory-configurations"
        self.yang_parent_name = "Cisco-IOS-XR-invmgr-cfg"

        self.entity_ = YList(self)

    def __setattr__(self, name, value):
        self._check_monkey_patching_error(name, value)
        with _handle_type_error():
            if name in self.__dict__ and isinstance(self.__dict__[name],
                                                    YList):
                raise YPYModelError(
                    "Attempt to assign value of '{}' to YList ldata. "
                    "Please use list append or extend method.".format(value))
            if isinstance(value, Enum.YLeaf):
                value = value.name
            if name in () and name in self.__dict__:
                if isinstance(value, YLeaf):
                    self.__dict__[name].set(value.get())
                elif isinstance(value, YLeafList):
                    super(InventoryConfigurations,
                          self).__setattr__(name, value)
                else:
                    self.__dict__[name].set(value)
            else:
                if hasattr(value, "parent") and name != "parent":
                    if hasattr(value, "is_presence_container"
                               ) and value.is_presence_container:
                        value.parent = self
                    elif value.parent is None and value.yang_name in self._children_yang_names:
                        value.parent = self
                super(InventoryConfigurations, self).__setattr__(name, value)

    class Entity_(Entity):
        """
        Entity name
        
        .. attribute:: name  <key>
        
        	Entity name
        	**type**\:  str
        
        	**pattern:** [\\w\\\-\\.\:,\_@#%$\\+=\\\|;]+
        
        .. attribute:: name_xr
        
        	Entity name
        	**type**\:  str
        
        	**mandatory**\: True
        
        

        """

        _prefix = 'invmgr-cfg'
        _revision = '2015-11-09'

        def __init__(self):
            super(InventoryConfigurations.Entity_, self).__init__()

            self.yang_name = "entity"
            self.yang_parent_name = "inventory-configurations"

            self.name = YLeaf(YType.str, "name")

            self.name_xr = YLeaf(YType.str, "name-xr")

        def __setattr__(self, name, value):
            self._check_monkey_patching_error(name, value)
            with _handle_type_error():
                if name in self.__dict__ and isinstance(
                        self.__dict__[name], YList):
                    raise YPYModelError(
                        "Attempt to assign value of '{}' to YList ldata. "
                        "Please use list append or extend method.".format(
                            value))
                if isinstance(value, Enum.YLeaf):
                    value = value.name
                if name in ("name", "name_xr") and name in self.__dict__:
                    if isinstance(value, YLeaf):
                        self.__dict__[name].set(value.get())
                    elif isinstance(value, YLeafList):
                        super(InventoryConfigurations.Entity_,
                              self).__setattr__(name, value)
                    else:
                        self.__dict__[name].set(value)
                else:
                    if hasattr(value, "parent") and name != "parent":
                        if hasattr(value, "is_presence_container"
                                   ) and value.is_presence_container:
                            value.parent = self
                        elif value.parent is None and value.yang_name in self._children_yang_names:
                            value.parent = self
                    super(InventoryConfigurations.Entity_,
                          self).__setattr__(name, value)

        def has_data(self):
            return (self.name.is_set or self.name_xr.is_set)

        def has_operation(self):
            return (self.yfilter != YFilter.not_set
                    or self.name.yfilter != YFilter.not_set
                    or self.name_xr.yfilter != YFilter.not_set)

        def get_segment_path(self):
            path_buffer = ""
            path_buffer = "entity" + "[name='" + self.name.get(
            ) + "']" + path_buffer

            return path_buffer

        def get_entity_path(self, ancestor):
            path_buffer = ""
            if (ancestor is None):
                path_buffer = "Cisco-IOS-XR-invmgr-cfg:inventory-configurations/%s" % self.get_segment_path(
                )
            else:
                path_buffer = _get_relative_entity_path(
                    self, ancestor, path_buffer)

            leaf_name_data = LeafDataList()
            if (self.name.is_set or self.name.yfilter != YFilter.not_set):
                leaf_name_data.append(self.name.get_name_leafdata())
            if (self.name_xr.is_set
                    or self.name_xr.yfilter != YFilter.not_set):
                leaf_name_data.append(self.name_xr.get_name_leafdata())

            entity_path = EntityPath(path_buffer, leaf_name_data)
            return entity_path

        def get_child_by_name(self, child_yang_name, segment_path):
            child = self._get_child_by_seg_name(
                [child_yang_name, segment_path])
            if child is not None:
                return child

            return None

        def has_leaf_or_child_of_name(self, name):
            if (name == "name" or name == "name-xr"):
                return True
            return False

        def set_value(self, value_path, value, name_space, name_space_prefix):
            if (value_path == "name"):
                self.name = value
                self.name.value_namespace = name_space
                self.name.value_namespace_prefix = name_space_prefix
            if (value_path == "name-xr"):
                self.name_xr = value
                self.name_xr.value_namespace = name_space
                self.name_xr.value_namespace_prefix = name_space_prefix

    def has_data(self):
        for c in self.entity_:
            if (c.has_data()):
                return True
        return False

    def has_operation(self):
        for c in self.entity_:
            if (c.has_operation()):
                return True
        return self.yfilter != YFilter.not_set

    def get_segment_path(self):
        path_buffer = ""
        path_buffer = "Cisco-IOS-XR-invmgr-cfg:inventory-configurations" + path_buffer

        return path_buffer

    def get_entity_path(self, ancestor):
        path_buffer = ""
        if (not ancestor is None):
            raise YPYModelError("ancestor has to be None for top-level node")

        path_buffer = self.get_segment_path()
        leaf_name_data = LeafDataList()

        entity_path = EntityPath(path_buffer, leaf_name_data)
        return entity_path

    def get_child_by_name(self, child_yang_name, segment_path):
        child = self._get_child_by_seg_name([child_yang_name, segment_path])
        if child is not None:
            return child

        if (child_yang_name == "entity"):
            for c in self.entity_:
                segment = c.get_segment_path()
                if (segment_path == segment):
                    return c
            c = InventoryConfigurations.Entity_()
            c.parent = self
            local_reference_key = "ydk::seg::%s" % segment_path
            self._local_refs[local_reference_key] = c
            self.entity_.append(c)
            return c

        return None

    def has_leaf_or_child_of_name(self, name):
        if (name == "entity"):
            return True
        return False

    def set_value(self, value_path, value, name_space, name_space_prefix):
        pass

    def clone_ptr(self):
        self._top_entity = InventoryConfigurations()
        return self._top_entity
        class Rack(Entity):
            """
            Rack name
            
            .. attribute:: name  <key>
            
            	Rack name
            	**type**\:  str
            
            	**pattern:** [\\w\\\-\\.\:,\_@#%$\\+=\\\|;]+
            
            .. attribute:: slot
            
            	Slot name
            	**type**\: list of    :py:class:`Slot <ydk.models.cisco_ios_xr.Cisco_IOS_XR_sdr_invmgr_oper.SdrInventory.Racks.Rack.Slot>`
            
            

            """

            _prefix = 'sdr-invmgr-oper'
            _revision = '2015-11-09'

            def __init__(self):
                super(SdrInventory.Racks.Rack, self).__init__()

                self.yang_name = "rack"
                self.yang_parent_name = "racks"

                self.name = YLeaf(YType.str, "name")

                self.slot = YList(self)

            def __setattr__(self, name, value):
                self._check_monkey_patching_error(name, value)
                with _handle_type_error():
                    if name in self.__dict__ and isinstance(self.__dict__[name], YList):
                        raise YPYModelError("Attempt to assign value of '{}' to YList ldata. "
                                            "Please use list append or extend method."
                                            .format(value))
                    if isinstance(value, Enum.YLeaf):
                        value = value.name
                    if name in ("name") and name in self.__dict__:
                        if isinstance(value, YLeaf):
                            self.__dict__[name].set(value.get())
                        elif isinstance(value, YLeafList):
                            super(SdrInventory.Racks.Rack, self).__setattr__(name, value)
                        else:
                            self.__dict__[name].set(value)
                    else:
                        if hasattr(value, "parent") and name != "parent":
                            if hasattr(value, "is_presence_container") and value.is_presence_container:
                                value.parent = self
                            elif value.parent is None and value.yang_name in self._children_yang_names:
                                value.parent = self
                        super(SdrInventory.Racks.Rack, self).__setattr__(name, value)


            class Slot(Entity):
                """
                Slot name
                
                .. attribute:: name  <key>
                
                	Slot name
                	**type**\:  str
                
                	**pattern:** [\\w\\\-\\.\:,\_@#%$\\+=\\\|;]+
                
                .. attribute:: card
                
                	Card
                	**type**\: list of    :py:class:`Card <ydk.models.cisco_ios_xr.Cisco_IOS_XR_sdr_invmgr_oper.SdrInventory.Racks.Rack.Slot.Card>`
                
                

                """

                _prefix = 'sdr-invmgr-oper'
                _revision = '2015-11-09'

                def __init__(self):
                    super(SdrInventory.Racks.Rack.Slot, self).__init__()

                    self.yang_name = "slot"
                    self.yang_parent_name = "rack"

                    self.name = YLeaf(YType.str, "name")

                    self.card = YList(self)

                def __setattr__(self, name, value):
                    self._check_monkey_patching_error(name, value)
                    with _handle_type_error():
                        if name in self.__dict__ and isinstance(self.__dict__[name], YList):
                            raise YPYModelError("Attempt to assign value of '{}' to YList ldata. "
                                                "Please use list append or extend method."
                                                .format(value))
                        if isinstance(value, Enum.YLeaf):
                            value = value.name
                        if name in ("name") and name in self.__dict__:
                            if isinstance(value, YLeaf):
                                self.__dict__[name].set(value.get())
                            elif isinstance(value, YLeafList):
                                super(SdrInventory.Racks.Rack.Slot, self).__setattr__(name, value)
                            else:
                                self.__dict__[name].set(value)
                        else:
                            if hasattr(value, "parent") and name != "parent":
                                if hasattr(value, "is_presence_container") and value.is_presence_container:
                                    value.parent = self
                                elif value.parent is None and value.yang_name in self._children_yang_names:
                                    value.parent = self
                            super(SdrInventory.Racks.Rack.Slot, self).__setattr__(name, value)


                class Card(Entity):
                    """
                    Card
                    
                    .. attribute:: name  <key>
                    
                    	Card
                    	**type**\:  str
                    
                    	**pattern:** [\\w\\\-\\.\:,\_@#%$\\+=\\\|;]+
                    
                    .. attribute:: attributes
                    
                    	Attributes
                    	**type**\:   :py:class:`Attributes <ydk.models.cisco_ios_xr.Cisco_IOS_XR_sdr_invmgr_oper.SdrInventory.Racks.Rack.Slot.Card.Attributes>`
                    
                    

                    """

                    _prefix = 'sdr-invmgr-oper'
                    _revision = '2015-11-09'

                    def __init__(self):
                        super(SdrInventory.Racks.Rack.Slot.Card, self).__init__()

                        self.yang_name = "card"
                        self.yang_parent_name = "slot"

                        self.name = YLeaf(YType.str, "name")

                        self.attributes = SdrInventory.Racks.Rack.Slot.Card.Attributes()
                        self.attributes.parent = self
                        self._children_name_map["attributes"] = "attributes"
                        self._children_yang_names.add("attributes")

                    def __setattr__(self, name, value):
                        self._check_monkey_patching_error(name, value)
                        with _handle_type_error():
                            if name in self.__dict__ and isinstance(self.__dict__[name], YList):
                                raise YPYModelError("Attempt to assign value of '{}' to YList ldata. "
                                                    "Please use list append or extend method."
                                                    .format(value))
                            if isinstance(value, Enum.YLeaf):
                                value = value.name
                            if name in ("name") and name in self.__dict__:
                                if isinstance(value, YLeaf):
                                    self.__dict__[name].set(value.get())
                                elif isinstance(value, YLeafList):
                                    super(SdrInventory.Racks.Rack.Slot.Card, self).__setattr__(name, value)
                                else:
                                    self.__dict__[name].set(value)
                            else:
                                if hasattr(value, "parent") and name != "parent":
                                    if hasattr(value, "is_presence_container") and value.is_presence_container:
                                        value.parent = self
                                    elif value.parent is None and value.yang_name in self._children_yang_names:
                                        value.parent = self
                                super(SdrInventory.Racks.Rack.Slot.Card, self).__setattr__(name, value)


                    class Attributes(Entity):
                        """
                        Attributes
                        
                        .. attribute:: card_admin_state
                        
                        	Card Admin State
                        	**type**\:  int
                        
                        	**range:** \-2147483648..2147483647
                        
                        	**default value**\: 0
                        
                        .. attribute:: card_state
                        
                        	CardState
                        	**type**\:  int
                        
                        	**range:** \-2147483648..2147483647
                        
                        	**default value**\: 0
                        
                        .. attribute:: card_state_string
                        
                        	Card State String
                        	**type**\:  str
                        
                        .. attribute:: card_type
                        
                        	CardType
                        	**type**\:  int
                        
                        	**range:** \-2147483648..2147483647
                        
                        	**default value**\: 0
                        
                        .. attribute:: card_type_string
                        
                        	Card Type String
                        	**type**\:  str
                        
                        .. attribute:: config_state
                        
                        	ConfigState
                        	**type**\:  int
                        
                        	**range:** \-2147483648..2147483647
                        
                        	**default value**\: 0
                        
                        .. attribute:: config_state_string
                        
                        	Config State String
                        	**type**\:  str
                        
                        .. attribute:: ctype
                        
                        	CType
                        	**type**\:  int
                        
                        	**range:** \-2147483648..2147483647
                        
                        	**default value**\: 0
                        
                        .. attribute:: monitor
                        
                        	Monitor
                        	**type**\:  int
                        
                        	**range:** \-2147483648..2147483647
                        
                        	**default value**\: 0
                        
                        .. attribute:: node_name_string
                        
                        	Node Name String
                        	**type**\:  str
                        
                        .. attribute:: pi_slot_number
                        
                        	Pi Slot Number
                        	**type**\:  int
                        
                        	**range:** \-2147483648..2147483647
                        
                        	**default value**\: 0
                        
                        .. attribute:: power
                        
                        	Power
                        	**type**\:  int
                        
                        	**range:** \-2147483648..2147483647
                        
                        	**default value**\: 0
                        
                        .. attribute:: shutdown
                        
                        	Shutdown
                        	**type**\:  int
                        
                        	**range:** \-2147483648..2147483647
                        
                        	**default value**\: 0
                        
                        .. attribute:: vm_state
                        
                        	VM State information
                        	**type**\:  int
                        
                        	**range:** \-2147483648..2147483647
                        
                        	**default value**\: 0
                        
                        

                        """

                        _prefix = 'sdr-invmgr-oper'
                        _revision = '2015-11-09'

                        def __init__(self):
                            super(SdrInventory.Racks.Rack.Slot.Card.Attributes, self).__init__()

                            self.yang_name = "attributes"
                            self.yang_parent_name = "card"

                            self.card_admin_state = YLeaf(YType.int32, "card-admin-state")

                            self.card_state = YLeaf(YType.int32, "card-state")

                            self.card_state_string = YLeaf(YType.str, "card-state-string")

                            self.card_type = YLeaf(YType.int32, "card-type")

                            self.card_type_string = YLeaf(YType.str, "card-type-string")

                            self.config_state = YLeaf(YType.int32, "config-state")

                            self.config_state_string = YLeaf(YType.str, "config-state-string")

                            self.ctype = YLeaf(YType.int32, "ctype")

                            self.monitor = YLeaf(YType.int32, "monitor")

                            self.node_name_string = YLeaf(YType.str, "node-name-string")

                            self.pi_slot_number = YLeaf(YType.int32, "pi-slot-number")

                            self.power = YLeaf(YType.int32, "power")

                            self.shutdown = YLeaf(YType.int32, "shutdown")

                            self.vm_state = YLeaf(YType.int32, "vm-state")

                        def __setattr__(self, name, value):
                            self._check_monkey_patching_error(name, value)
                            with _handle_type_error():
                                if name in self.__dict__ and isinstance(self.__dict__[name], YList):
                                    raise YPYModelError("Attempt to assign value of '{}' to YList ldata. "
                                                        "Please use list append or extend method."
                                                        .format(value))
                                if isinstance(value, Enum.YLeaf):
                                    value = value.name
                                if name in ("card_admin_state",
                                            "card_state",
                                            "card_state_string",
                                            "card_type",
                                            "card_type_string",
                                            "config_state",
                                            "config_state_string",
                                            "ctype",
                                            "monitor",
                                            "node_name_string",
                                            "pi_slot_number",
                                            "power",
                                            "shutdown",
                                            "vm_state") and name in self.__dict__:
                                    if isinstance(value, YLeaf):
                                        self.__dict__[name].set(value.get())
                                    elif isinstance(value, YLeafList):
                                        super(SdrInventory.Racks.Rack.Slot.Card.Attributes, self).__setattr__(name, value)
                                    else:
                                        self.__dict__[name].set(value)
                                else:
                                    if hasattr(value, "parent") and name != "parent":
                                        if hasattr(value, "is_presence_container") and value.is_presence_container:
                                            value.parent = self
                                        elif value.parent is None and value.yang_name in self._children_yang_names:
                                            value.parent = self
                                    super(SdrInventory.Racks.Rack.Slot.Card.Attributes, self).__setattr__(name, value)

                        def has_data(self):
                            return (
                                self.card_admin_state.is_set or
                                self.card_state.is_set or
                                self.card_state_string.is_set or
                                self.card_type.is_set or
                                self.card_type_string.is_set or
                                self.config_state.is_set or
                                self.config_state_string.is_set or
                                self.ctype.is_set or
                                self.monitor.is_set or
                                self.node_name_string.is_set or
                                self.pi_slot_number.is_set or
                                self.power.is_set or
                                self.shutdown.is_set or
                                self.vm_state.is_set)

                        def has_operation(self):
                            return (
                                self.yfilter != YFilter.not_set or
                                self.card_admin_state.yfilter != YFilter.not_set or
                                self.card_state.yfilter != YFilter.not_set or
                                self.card_state_string.yfilter != YFilter.not_set or
                                self.card_type.yfilter != YFilter.not_set or
                                self.card_type_string.yfilter != YFilter.not_set or
                                self.config_state.yfilter != YFilter.not_set or
                                self.config_state_string.yfilter != YFilter.not_set or
                                self.ctype.yfilter != YFilter.not_set or
                                self.monitor.yfilter != YFilter.not_set or
                                self.node_name_string.yfilter != YFilter.not_set or
                                self.pi_slot_number.yfilter != YFilter.not_set or
                                self.power.yfilter != YFilter.not_set or
                                self.shutdown.yfilter != YFilter.not_set or
                                self.vm_state.yfilter != YFilter.not_set)

                        def get_segment_path(self):
                            path_buffer = ""
                            path_buffer = "attributes" + path_buffer

                            return path_buffer

                        def get_entity_path(self, ancestor):
                            path_buffer = ""
                            if (ancestor is None):
                                raise YPYModelError("ancestor cannot be None as one of the ancestors is a list")
                            else:
                                path_buffer = _get_relative_entity_path(self, ancestor, path_buffer)

                            leaf_name_data = LeafDataList()
                            if (self.card_admin_state.is_set or self.card_admin_state.yfilter != YFilter.not_set):
                                leaf_name_data.append(self.card_admin_state.get_name_leafdata())
                            if (self.card_state.is_set or self.card_state.yfilter != YFilter.not_set):
                                leaf_name_data.append(self.card_state.get_name_leafdata())
                            if (self.card_state_string.is_set or self.card_state_string.yfilter != YFilter.not_set):
                                leaf_name_data.append(self.card_state_string.get_name_leafdata())
                            if (self.card_type.is_set or self.card_type.yfilter != YFilter.not_set):
                                leaf_name_data.append(self.card_type.get_name_leafdata())
                            if (self.card_type_string.is_set or self.card_type_string.yfilter != YFilter.not_set):
                                leaf_name_data.append(self.card_type_string.get_name_leafdata())
                            if (self.config_state.is_set or self.config_state.yfilter != YFilter.not_set):
                                leaf_name_data.append(self.config_state.get_name_leafdata())
                            if (self.config_state_string.is_set or self.config_state_string.yfilter != YFilter.not_set):
                                leaf_name_data.append(self.config_state_string.get_name_leafdata())
                            if (self.ctype.is_set or self.ctype.yfilter != YFilter.not_set):
                                leaf_name_data.append(self.ctype.get_name_leafdata())
                            if (self.monitor.is_set or self.monitor.yfilter != YFilter.not_set):
                                leaf_name_data.append(self.monitor.get_name_leafdata())
                            if (self.node_name_string.is_set or self.node_name_string.yfilter != YFilter.not_set):
                                leaf_name_data.append(self.node_name_string.get_name_leafdata())
                            if (self.pi_slot_number.is_set or self.pi_slot_number.yfilter != YFilter.not_set):
                                leaf_name_data.append(self.pi_slot_number.get_name_leafdata())
                            if (self.power.is_set or self.power.yfilter != YFilter.not_set):
                                leaf_name_data.append(self.power.get_name_leafdata())
                            if (self.shutdown.is_set or self.shutdown.yfilter != YFilter.not_set):
                                leaf_name_data.append(self.shutdown.get_name_leafdata())
                            if (self.vm_state.is_set or self.vm_state.yfilter != YFilter.not_set):
                                leaf_name_data.append(self.vm_state.get_name_leafdata())

                            entity_path = EntityPath(path_buffer, leaf_name_data)
                            return entity_path

                        def get_child_by_name(self, child_yang_name, segment_path):
                            child = self._get_child_by_seg_name([child_yang_name, segment_path])
                            if child is not None:
                                return child

                            return None

                        def has_leaf_or_child_of_name(self, name):
                            if(name == "card-admin-state" or name == "card-state" or name == "card-state-string" or name == "card-type" or name == "card-type-string" or name == "config-state" or name == "config-state-string" or name == "ctype" or name == "monitor" or name == "node-name-string" or name == "pi-slot-number" or name == "power" or name == "shutdown" or name == "vm-state"):
                                return True
                            return False

                        def set_value(self, value_path, value, name_space, name_space_prefix):
                            if(value_path == "card-admin-state"):
                                self.card_admin_state = value
                                self.card_admin_state.value_namespace = name_space
                                self.card_admin_state.value_namespace_prefix = name_space_prefix
                            if(value_path == "card-state"):
                                self.card_state = value
                                self.card_state.value_namespace = name_space
                                self.card_state.value_namespace_prefix = name_space_prefix
                            if(value_path == "card-state-string"):
                                self.card_state_string = value
                                self.card_state_string.value_namespace = name_space
                                self.card_state_string.value_namespace_prefix = name_space_prefix
                            if(value_path == "card-type"):
                                self.card_type = value
                                self.card_type.value_namespace = name_space
                                self.card_type.value_namespace_prefix = name_space_prefix
                            if(value_path == "card-type-string"):
                                self.card_type_string = value
                                self.card_type_string.value_namespace = name_space
                                self.card_type_string.value_namespace_prefix = name_space_prefix
                            if(value_path == "config-state"):
                                self.config_state = value
                                self.config_state.value_namespace = name_space
                                self.config_state.value_namespace_prefix = name_space_prefix
                            if(value_path == "config-state-string"):
                                self.config_state_string = value
                                self.config_state_string.value_namespace = name_space
                                self.config_state_string.value_namespace_prefix = name_space_prefix
                            if(value_path == "ctype"):
                                self.ctype = value
                                self.ctype.value_namespace = name_space
                                self.ctype.value_namespace_prefix = name_space_prefix
                            if(value_path == "monitor"):
                                self.monitor = value
                                self.monitor.value_namespace = name_space
                                self.monitor.value_namespace_prefix = name_space_prefix
                            if(value_path == "node-name-string"):
                                self.node_name_string = value
                                self.node_name_string.value_namespace = name_space
                                self.node_name_string.value_namespace_prefix = name_space_prefix
                            if(value_path == "pi-slot-number"):
                                self.pi_slot_number = value
                                self.pi_slot_number.value_namespace = name_space
                                self.pi_slot_number.value_namespace_prefix = name_space_prefix
                            if(value_path == "power"):
                                self.power = value
                                self.power.value_namespace = name_space
                                self.power.value_namespace_prefix = name_space_prefix
                            if(value_path == "shutdown"):
                                self.shutdown = value
                                self.shutdown.value_namespace = name_space
                                self.shutdown.value_namespace_prefix = name_space_prefix
                            if(value_path == "vm-state"):
                                self.vm_state = value
                                self.vm_state.value_namespace = name_space
                                self.vm_state.value_namespace_prefix = name_space_prefix

                    def has_data(self):
                        return (
                            self.name.is_set or
                            (self.attributes is not None and self.attributes.has_data()))

                    def has_operation(self):
                        return (
                            self.yfilter != YFilter.not_set or
                            self.name.yfilter != YFilter.not_set or
                            (self.attributes is not None and self.attributes.has_operation()))

                    def get_segment_path(self):
                        path_buffer = ""
                        path_buffer = "card" + "[name='" + self.name.get() + "']" + path_buffer

                        return path_buffer

                    def get_entity_path(self, ancestor):
                        path_buffer = ""
                        if (ancestor is None):
                            raise YPYModelError("ancestor cannot be None as one of the ancestors is a list")
                        else:
                            path_buffer = _get_relative_entity_path(self, ancestor, path_buffer)

                        leaf_name_data = LeafDataList()
                        if (self.name.is_set or self.name.yfilter != YFilter.not_set):
                            leaf_name_data.append(self.name.get_name_leafdata())

                        entity_path = EntityPath(path_buffer, leaf_name_data)
                        return entity_path

                    def get_child_by_name(self, child_yang_name, segment_path):
                        child = self._get_child_by_seg_name([child_yang_name, segment_path])
                        if child is not None:
                            return child

                        if (child_yang_name == "attributes"):
                            if (self.attributes is None):
                                self.attributes = SdrInventory.Racks.Rack.Slot.Card.Attributes()
                                self.attributes.parent = self
                                self._children_name_map["attributes"] = "attributes"
                            return self.attributes

                        return None

                    def has_leaf_or_child_of_name(self, name):
                        if(name == "attributes" or name == "name"):
                            return True
                        return False

                    def set_value(self, value_path, value, name_space, name_space_prefix):
                        if(value_path == "name"):
                            self.name = value
                            self.name.value_namespace = name_space
                            self.name.value_namespace_prefix = name_space_prefix

                def has_data(self):
                    for c in self.card:
                        if (c.has_data()):
                            return True
                    return self.name.is_set

                def has_operation(self):
                    for c in self.card:
                        if (c.has_operation()):
                            return True
                    return (
                        self.yfilter != YFilter.not_set or
                        self.name.yfilter != YFilter.not_set)

                def get_segment_path(self):
                    path_buffer = ""
                    path_buffer = "slot" + "[name='" + self.name.get() + "']" + path_buffer

                    return path_buffer

                def get_entity_path(self, ancestor):
                    path_buffer = ""
                    if (ancestor is None):
                        raise YPYModelError("ancestor cannot be None as one of the ancestors is a list")
                    else:
                        path_buffer = _get_relative_entity_path(self, ancestor, path_buffer)

                    leaf_name_data = LeafDataList()
                    if (self.name.is_set or self.name.yfilter != YFilter.not_set):
                        leaf_name_data.append(self.name.get_name_leafdata())

                    entity_path = EntityPath(path_buffer, leaf_name_data)
                    return entity_path

                def get_child_by_name(self, child_yang_name, segment_path):
                    child = self._get_child_by_seg_name([child_yang_name, segment_path])
                    if child is not None:
                        return child

                    if (child_yang_name == "card"):
                        for c in self.card:
                            segment = c.get_segment_path()
                            if (segment_path == segment):
                                return c
                        c = SdrInventory.Racks.Rack.Slot.Card()
                        c.parent = self
                        local_reference_key = "ydk::seg::%s" % segment_path
                        self._local_refs[local_reference_key] = c
                        self.card.append(c)
                        return c

                    return None

                def has_leaf_or_child_of_name(self, name):
                    if(name == "card" or name == "name"):
                        return True
                    return False

                def set_value(self, value_path, value, name_space, name_space_prefix):
                    if(value_path == "name"):
                        self.name = value
                        self.name.value_namespace = name_space
                        self.name.value_namespace_prefix = name_space_prefix

            def has_data(self):
                for c in self.slot:
                    if (c.has_data()):
                        return True
                return self.name.is_set

            def has_operation(self):
                for c in self.slot:
                    if (c.has_operation()):
                        return True
                return (
                    self.yfilter != YFilter.not_set or
                    self.name.yfilter != YFilter.not_set)

            def get_segment_path(self):
                path_buffer = ""
                path_buffer = "rack" + "[name='" + self.name.get() + "']" + path_buffer

                return path_buffer

            def get_entity_path(self, ancestor):
                path_buffer = ""
                if (ancestor is None):
                    path_buffer = "Cisco-IOS-XR-sdr-invmgr-oper:sdr-inventory/racks/%s" % self.get_segment_path()
                else:
                    path_buffer = _get_relative_entity_path(self, ancestor, path_buffer)

                leaf_name_data = LeafDataList()
                if (self.name.is_set or self.name.yfilter != YFilter.not_set):
                    leaf_name_data.append(self.name.get_name_leafdata())

                entity_path = EntityPath(path_buffer, leaf_name_data)
                return entity_path

            def get_child_by_name(self, child_yang_name, segment_path):
                child = self._get_child_by_seg_name([child_yang_name, segment_path])
                if child is not None:
                    return child

                if (child_yang_name == "slot"):
                    for c in self.slot:
                        segment = c.get_segment_path()
                        if (segment_path == segment):
                            return c
                    c = SdrInventory.Racks.Rack.Slot()
                    c.parent = self
                    local_reference_key = "ydk::seg::%s" % segment_path
                    self._local_refs[local_reference_key] = c
                    self.slot.append(c)
                    return c

                return None

            def has_leaf_or_child_of_name(self, name):
                if(name == "slot" or name == "name"):
                    return True
                return False

            def set_value(self, value_path, value, name_space, name_space_prefix):
                if(value_path == "name"):
                    self.name = value
                    self.name.value_namespace = name_space
                    self.name.value_namespace_prefix = name_space_prefix
Пример #30
0
class Vlans(Entity):
    """
    Container for VLAN configuration and state
    variables
    
    .. attribute:: vlan
    
    	Configured VLANs keyed by id
    	**type**\: list of    :py:class:`Vlan <ydk.models.openconfig.openconfig_vlan.Vlans.Vlan>`
    
    

    """

    _prefix = 'oc-vlan'
    _revision = '2016-05-26'

    def __init__(self):
        super(Vlans, self).__init__()
        self._top_entity = None

        self.yang_name = "vlans"
        self.yang_parent_name = "openconfig-vlan"

        self.vlan = YList(self)

    def __setattr__(self, name, value):
        self._check_monkey_patching_error(name, value)
        with _handle_type_error():
            if name in self.__dict__ and isinstance(self.__dict__[name],
                                                    YList):
                raise YPYModelError(
                    "Attempt to assign value of '{}' to YList ldata. "
                    "Please use list append or extend method.".format(value))
            if isinstance(value, Enum.YLeaf):
                value = value.name
            if name in () and name in self.__dict__:
                if isinstance(value, YLeaf):
                    self.__dict__[name].set(value.get())
                elif isinstance(value, YLeafList):
                    super(Vlans, self).__setattr__(name, value)
                else:
                    self.__dict__[name].set(value)
            else:
                if hasattr(value, "parent") and name != "parent":
                    if hasattr(value, "is_presence_container"
                               ) and value.is_presence_container:
                        value.parent = self
                    elif value.parent is None and value.yang_name in self._children_yang_names:
                        value.parent = self
                super(Vlans, self).__setattr__(name, value)

    class Vlan(Entity):
        """
        Configured VLANs keyed by id
        
        .. attribute:: vlan_id  <key>
        
        	references the configured vlan\-id
        	**type**\:  int
        
        	**range:** 1..4094
        
        	**refers to**\:  :py:class:`vlan_id <ydk.models.openconfig.openconfig_vlan.Vlans.Vlan.Config>`
        
        .. attribute:: config
        
        	Configuration parameters for VLANs
        	**type**\:   :py:class:`Config <ydk.models.openconfig.openconfig_vlan.Vlans.Vlan.Config>`
        
        .. attribute:: members
        
        	Enclosing container for list of member interfaces
        	**type**\:   :py:class:`Members <ydk.models.openconfig.openconfig_vlan.Vlans.Vlan.Members>`
        
        .. attribute:: state
        
        	State variables for VLANs
        	**type**\:   :py:class:`State <ydk.models.openconfig.openconfig_vlan.Vlans.Vlan.State>`
        
        

        """

        _prefix = 'oc-vlan'
        _revision = '2016-05-26'

        def __init__(self):
            super(Vlans.Vlan, self).__init__()

            self.yang_name = "vlan"
            self.yang_parent_name = "vlans"

            self.vlan_id = YLeaf(YType.str, "vlan-id")

            self.config = Vlans.Vlan.Config()
            self.config.parent = self
            self._children_name_map["config"] = "config"
            self._children_yang_names.add("config")

            self.members = Vlans.Vlan.Members()
            self.members.parent = self
            self._children_name_map["members"] = "members"
            self._children_yang_names.add("members")

            self.state = Vlans.Vlan.State()
            self.state.parent = self
            self._children_name_map["state"] = "state"
            self._children_yang_names.add("state")

        def __setattr__(self, name, value):
            self._check_monkey_patching_error(name, value)
            with _handle_type_error():
                if name in self.__dict__ and isinstance(
                        self.__dict__[name], YList):
                    raise YPYModelError(
                        "Attempt to assign value of '{}' to YList ldata. "
                        "Please use list append or extend method.".format(
                            value))
                if isinstance(value, Enum.YLeaf):
                    value = value.name
                if name in ("vlan_id") and name in self.__dict__:
                    if isinstance(value, YLeaf):
                        self.__dict__[name].set(value.get())
                    elif isinstance(value, YLeafList):
                        super(Vlans.Vlan, self).__setattr__(name, value)
                    else:
                        self.__dict__[name].set(value)
                else:
                    if hasattr(value, "parent") and name != "parent":
                        if hasattr(value, "is_presence_container"
                                   ) and value.is_presence_container:
                            value.parent = self
                        elif value.parent is None and value.yang_name in self._children_yang_names:
                            value.parent = self
                    super(Vlans.Vlan, self).__setattr__(name, value)

        class Config(Entity):
            """
            Configuration parameters for VLANs
            
            .. attribute:: name
            
            	Interface VLAN name
            	**type**\:  str
            
            .. attribute:: status
            
            	Admin state of the VLAN
            	**type**\:   :py:class:`Status <ydk.models.openconfig.openconfig_vlan.Vlans.Vlan.Config.Status>`
            
            	**default value**\: ACTIVE
            
            .. attribute:: tpid
            
            	Optionally set the tag protocol identifier field (TPID) that is accepted on the VLAN
            	**type**\:   :py:class:`Tpid_Types <ydk.models.openconfig.openconfig_vlan_types.Tpid_Types>`
            
            	**default value**\: oc-vlan-types:TPID_0x8100
            
            .. attribute:: vlan_id
            
            	Interface VLAN id
            	**type**\:  int
            
            	**range:** 1..4094
            
            

            """

            _prefix = 'oc-vlan'
            _revision = '2016-05-26'

            def __init__(self):
                super(Vlans.Vlan.Config, self).__init__()

                self.yang_name = "config"
                self.yang_parent_name = "vlan"

                self.name = YLeaf(YType.str, "name")

                self.status = YLeaf(YType.enumeration, "status")

                self.tpid = YLeaf(YType.identityref, "tpid")

                self.vlan_id = YLeaf(YType.uint16, "vlan-id")

            def __setattr__(self, name, value):
                self._check_monkey_patching_error(name, value)
                with _handle_type_error():
                    if name in self.__dict__ and isinstance(
                            self.__dict__[name], YList):
                        raise YPYModelError(
                            "Attempt to assign value of '{}' to YList ldata. "
                            "Please use list append or extend method.".format(
                                value))
                    if isinstance(value, Enum.YLeaf):
                        value = value.name
                    if name in ("name", "status", "tpid",
                                "vlan_id") and name in self.__dict__:
                        if isinstance(value, YLeaf):
                            self.__dict__[name].set(value.get())
                        elif isinstance(value, YLeafList):
                            super(Vlans.Vlan.Config,
                                  self).__setattr__(name, value)
                        else:
                            self.__dict__[name].set(value)
                    else:
                        if hasattr(value, "parent") and name != "parent":
                            if hasattr(value, "is_presence_container"
                                       ) and value.is_presence_container:
                                value.parent = self
                            elif value.parent is None and value.yang_name in self._children_yang_names:
                                value.parent = self
                        super(Vlans.Vlan.Config, self).__setattr__(name, value)

            class Status(Enum):
                """
                Status

                Admin state of the VLAN

                .. data:: ACTIVE = 0

                	VLAN is active

                .. data:: SUSPENDED = 1

                	VLAN is inactive / suspended

                """

                ACTIVE = Enum.YLeaf(0, "ACTIVE")

                SUSPENDED = Enum.YLeaf(1, "SUSPENDED")

            def has_data(self):
                return (self.name.is_set or self.status.is_set
                        or self.tpid.is_set or self.vlan_id.is_set)

            def has_operation(self):
                return (self.yfilter != YFilter.not_set
                        or self.name.yfilter != YFilter.not_set
                        or self.status.yfilter != YFilter.not_set
                        or self.tpid.yfilter != YFilter.not_set
                        or self.vlan_id.yfilter != YFilter.not_set)

            def get_segment_path(self):
                path_buffer = ""
                path_buffer = "config" + path_buffer

                return path_buffer

            def get_entity_path(self, ancestor):
                path_buffer = ""
                if (ancestor is None):
                    raise YPYModelError(
                        "ancestor cannot be None as one of the ancestors is a list"
                    )
                else:
                    path_buffer = _get_relative_entity_path(
                        self, ancestor, path_buffer)

                leaf_name_data = LeafDataList()
                if (self.name.is_set or self.name.yfilter != YFilter.not_set):
                    leaf_name_data.append(self.name.get_name_leafdata())
                if (self.status.is_set
                        or self.status.yfilter != YFilter.not_set):
                    leaf_name_data.append(self.status.get_name_leafdata())
                if (self.tpid.is_set or self.tpid.yfilter != YFilter.not_set):
                    leaf_name_data.append(self.tpid.get_name_leafdata())
                if (self.vlan_id.is_set
                        or self.vlan_id.yfilter != YFilter.not_set):
                    leaf_name_data.append(self.vlan_id.get_name_leafdata())

                entity_path = EntityPath(path_buffer, leaf_name_data)
                return entity_path

            def get_child_by_name(self, child_yang_name, segment_path):
                child = self._get_child_by_seg_name(
                    [child_yang_name, segment_path])
                if child is not None:
                    return child

                return None

            def has_leaf_or_child_of_name(self, name):
                if (name == "name" or name == "status" or name == "tpid"
                        or name == "vlan-id"):
                    return True
                return False

            def set_value(self, value_path, value, name_space,
                          name_space_prefix):
                if (value_path == "name"):
                    self.name = value
                    self.name.value_namespace = name_space
                    self.name.value_namespace_prefix = name_space_prefix
                if (value_path == "status"):
                    self.status = value
                    self.status.value_namespace = name_space
                    self.status.value_namespace_prefix = name_space_prefix
                if (value_path == "tpid"):
                    self.tpid = value
                    self.tpid.value_namespace = name_space
                    self.tpid.value_namespace_prefix = name_space_prefix
                if (value_path == "vlan-id"):
                    self.vlan_id = value
                    self.vlan_id.value_namespace = name_space
                    self.vlan_id.value_namespace_prefix = name_space_prefix

        class State(Entity):
            """
            State variables for VLANs
            
            .. attribute:: name
            
            	Interface VLAN name
            	**type**\:  str
            
            .. attribute:: status
            
            	Admin state of the VLAN
            	**type**\:   :py:class:`Status <ydk.models.openconfig.openconfig_vlan.Vlans.Vlan.State.Status>`
            
            	**default value**\: ACTIVE
            
            .. attribute:: tpid
            
            	Optionally set the tag protocol identifier field (TPID) that is accepted on the VLAN
            	**type**\:   :py:class:`Tpid_Types <ydk.models.openconfig.openconfig_vlan_types.Tpid_Types>`
            
            	**default value**\: oc-vlan-types:TPID_0x8100
            
            .. attribute:: vlan_id
            
            	Interface VLAN id
            	**type**\:  int
            
            	**range:** 1..4094
            
            

            """

            _prefix = 'oc-vlan'
            _revision = '2016-05-26'

            def __init__(self):
                super(Vlans.Vlan.State, self).__init__()

                self.yang_name = "state"
                self.yang_parent_name = "vlan"

                self.name = YLeaf(YType.str, "name")

                self.status = YLeaf(YType.enumeration, "status")

                self.tpid = YLeaf(YType.identityref, "tpid")

                self.vlan_id = YLeaf(YType.uint16, "vlan-id")

            def __setattr__(self, name, value):
                self._check_monkey_patching_error(name, value)
                with _handle_type_error():
                    if name in self.__dict__ and isinstance(
                            self.__dict__[name], YList):
                        raise YPYModelError(
                            "Attempt to assign value of '{}' to YList ldata. "
                            "Please use list append or extend method.".format(
                                value))
                    if isinstance(value, Enum.YLeaf):
                        value = value.name
                    if name in ("name", "status", "tpid",
                                "vlan_id") and name in self.__dict__:
                        if isinstance(value, YLeaf):
                            self.__dict__[name].set(value.get())
                        elif isinstance(value, YLeafList):
                            super(Vlans.Vlan.State,
                                  self).__setattr__(name, value)
                        else:
                            self.__dict__[name].set(value)
                    else:
                        if hasattr(value, "parent") and name != "parent":
                            if hasattr(value, "is_presence_container"
                                       ) and value.is_presence_container:
                                value.parent = self
                            elif value.parent is None and value.yang_name in self._children_yang_names:
                                value.parent = self
                        super(Vlans.Vlan.State, self).__setattr__(name, value)

            class Status(Enum):
                """
                Status

                Admin state of the VLAN

                .. data:: ACTIVE = 0

                	VLAN is active

                .. data:: SUSPENDED = 1

                	VLAN is inactive / suspended

                """

                ACTIVE = Enum.YLeaf(0, "ACTIVE")

                SUSPENDED = Enum.YLeaf(1, "SUSPENDED")

            def has_data(self):
                return (self.name.is_set or self.status.is_set
                        or self.tpid.is_set or self.vlan_id.is_set)

            def has_operation(self):
                return (self.yfilter != YFilter.not_set
                        or self.name.yfilter != YFilter.not_set
                        or self.status.yfilter != YFilter.not_set
                        or self.tpid.yfilter != YFilter.not_set
                        or self.vlan_id.yfilter != YFilter.not_set)

            def get_segment_path(self):
                path_buffer = ""
                path_buffer = "state" + path_buffer

                return path_buffer

            def get_entity_path(self, ancestor):
                path_buffer = ""
                if (ancestor is None):
                    raise YPYModelError(
                        "ancestor cannot be None as one of the ancestors is a list"
                    )
                else:
                    path_buffer = _get_relative_entity_path(
                        self, ancestor, path_buffer)

                leaf_name_data = LeafDataList()
                if (self.name.is_set or self.name.yfilter != YFilter.not_set):
                    leaf_name_data.append(self.name.get_name_leafdata())
                if (self.status.is_set
                        or self.status.yfilter != YFilter.not_set):
                    leaf_name_data.append(self.status.get_name_leafdata())
                if (self.tpid.is_set or self.tpid.yfilter != YFilter.not_set):
                    leaf_name_data.append(self.tpid.get_name_leafdata())
                if (self.vlan_id.is_set
                        or self.vlan_id.yfilter != YFilter.not_set):
                    leaf_name_data.append(self.vlan_id.get_name_leafdata())

                entity_path = EntityPath(path_buffer, leaf_name_data)
                return entity_path

            def get_child_by_name(self, child_yang_name, segment_path):
                child = self._get_child_by_seg_name(
                    [child_yang_name, segment_path])
                if child is not None:
                    return child

                return None

            def has_leaf_or_child_of_name(self, name):
                if (name == "name" or name == "status" or name == "tpid"
                        or name == "vlan-id"):
                    return True
                return False

            def set_value(self, value_path, value, name_space,
                          name_space_prefix):
                if (value_path == "name"):
                    self.name = value
                    self.name.value_namespace = name_space
                    self.name.value_namespace_prefix = name_space_prefix
                if (value_path == "status"):
                    self.status = value
                    self.status.value_namespace = name_space
                    self.status.value_namespace_prefix = name_space_prefix
                if (value_path == "tpid"):
                    self.tpid = value
                    self.tpid.value_namespace = name_space
                    self.tpid.value_namespace_prefix = name_space_prefix
                if (value_path == "vlan-id"):
                    self.vlan_id = value
                    self.vlan_id.value_namespace = name_space
                    self.vlan_id.value_namespace_prefix = name_space_prefix

        class Members(Entity):
            """
            Enclosing container for list of member interfaces
            
            .. attribute:: member
            
            	List of references to interfaces / subinterfaces associated with the VLAN
            	**type**\: list of    :py:class:`Member <ydk.models.openconfig.openconfig_vlan.Vlans.Vlan.Members.Member>`
            
            

            """

            _prefix = 'oc-vlan'
            _revision = '2016-05-26'

            def __init__(self):
                super(Vlans.Vlan.Members, self).__init__()

                self.yang_name = "members"
                self.yang_parent_name = "vlan"

                self.member = YList(self)

            def __setattr__(self, name, value):
                self._check_monkey_patching_error(name, value)
                with _handle_type_error():
                    if name in self.__dict__ and isinstance(
                            self.__dict__[name], YList):
                        raise YPYModelError(
                            "Attempt to assign value of '{}' to YList ldata. "
                            "Please use list append or extend method.".format(
                                value))
                    if isinstance(value, Enum.YLeaf):
                        value = value.name
                    if name in () and name in self.__dict__:
                        if isinstance(value, YLeaf):
                            self.__dict__[name].set(value.get())
                        elif isinstance(value, YLeafList):
                            super(Vlans.Vlan.Members,
                                  self).__setattr__(name, value)
                        else:
                            self.__dict__[name].set(value)
                    else:
                        if hasattr(value, "parent") and name != "parent":
                            if hasattr(value, "is_presence_container"
                                       ) and value.is_presence_container:
                                value.parent = self
                            elif value.parent is None and value.yang_name in self._children_yang_names:
                                value.parent = self
                        super(Vlans.Vlan.Members,
                              self).__setattr__(name, value)

            class Member(Entity):
                """
                List of references to interfaces / subinterfaces
                associated with the VLAN.
                
                .. attribute:: interface_ref
                
                	Reference to an interface or subinterface
                	**type**\:   :py:class:`InterfaceRef <ydk.models.openconfig.openconfig_vlan.Vlans.Vlan.Members.Member.InterfaceRef>`
                
                

                """

                _prefix = 'oc-vlan'
                _revision = '2016-05-26'

                def __init__(self):
                    super(Vlans.Vlan.Members.Member, self).__init__()

                    self.yang_name = "member"
                    self.yang_parent_name = "members"

                    self.interface_ref = Vlans.Vlan.Members.Member.InterfaceRef(
                    )
                    self.interface_ref.parent = self
                    self._children_name_map["interface_ref"] = "interface-ref"
                    self._children_yang_names.add("interface-ref")

                class InterfaceRef(Entity):
                    """
                    Reference to an interface or subinterface
                    
                    .. attribute:: state
                    
                    	Operational state for interface\-ref
                    	**type**\:   :py:class:`State <ydk.models.openconfig.openconfig_vlan.Vlans.Vlan.Members.Member.InterfaceRef.State>`
                    
                    

                    """

                    _prefix = 'oc-vlan'
                    _revision = '2016-05-26'

                    def __init__(self):
                        super(Vlans.Vlan.Members.Member.InterfaceRef,
                              self).__init__()

                        self.yang_name = "interface-ref"
                        self.yang_parent_name = "member"

                        self.state = Vlans.Vlan.Members.Member.InterfaceRef.State(
                        )
                        self.state.parent = self
                        self._children_name_map["state"] = "state"
                        self._children_yang_names.add("state")

                    class State(Entity):
                        """
                        Operational state for interface\-ref
                        
                        .. attribute:: interface
                        
                        	Reference to a base interface.  If a reference to a subinterface is required, this leaf must be specified to indicate the base interface
                        	**type**\:  str
                        
                        	**refers to**\:  :py:class:`name <ydk.models.openconfig.openconfig_interfaces.Interfaces.Interface>`
                        
                        .. attribute:: subinterface
                        
                        	Reference to a subinterface \-\- this requires the base interface to be specified using the interface leaf in this container.  If only a reference to a base interface is requuired, this leaf should not be set
                        	**type**\:  int
                        
                        	**range:** 0..4294967295
                        
                        	**refers to**\:  :py:class:`index <ydk.models.openconfig.openconfig_interfaces.Interfaces.Interface.Subinterfaces.Subinterface>`
                        
                        

                        """

                        _prefix = 'oc-vlan'
                        _revision = '2016-05-26'

                        def __init__(self):
                            super(Vlans.Vlan.Members.Member.InterfaceRef.State,
                                  self).__init__()

                            self.yang_name = "state"
                            self.yang_parent_name = "interface-ref"

                            self.interface = YLeaf(YType.str, "interface")

                            self.subinterface = YLeaf(YType.str,
                                                      "subinterface")

                        def __setattr__(self, name, value):
                            self._check_monkey_patching_error(name, value)
                            with _handle_type_error():
                                if name in self.__dict__ and isinstance(
                                        self.__dict__[name], YList):
                                    raise YPYModelError(
                                        "Attempt to assign value of '{}' to YList ldata. "
                                        "Please use list append or extend method."
                                        .format(value))
                                if isinstance(value, Enum.YLeaf):
                                    value = value.name
                                if name in ("interface", "subinterface"
                                            ) and name in self.__dict__:
                                    if isinstance(value, YLeaf):
                                        self.__dict__[name].set(value.get())
                                    elif isinstance(value, YLeafList):
                                        super(
                                            Vlans.Vlan.Members.Member.
                                            InterfaceRef.State,
                                            self).__setattr__(name, value)
                                    else:
                                        self.__dict__[name].set(value)
                                else:
                                    if hasattr(value,
                                               "parent") and name != "parent":
                                        if hasattr(
                                                value, "is_presence_container"
                                        ) and value.is_presence_container:
                                            value.parent = self
                                        elif value.parent is None and value.yang_name in self._children_yang_names:
                                            value.parent = self
                                    super(
                                        Vlans.Vlan.Members.Member.InterfaceRef.
                                        State, self).__setattr__(name, value)

                        def has_data(self):
                            return (self.interface.is_set
                                    or self.subinterface.is_set)

                        def has_operation(self):
                            return (
                                self.yfilter != YFilter.not_set
                                or self.interface.yfilter != YFilter.not_set or
                                self.subinterface.yfilter != YFilter.not_set)

                        def get_segment_path(self):
                            path_buffer = ""
                            path_buffer = "state" + path_buffer

                            return path_buffer

                        def get_entity_path(self, ancestor):
                            path_buffer = ""
                            if (ancestor is None):
                                raise YPYModelError(
                                    "ancestor cannot be None as one of the ancestors is a list"
                                )
                            else:
                                path_buffer = _get_relative_entity_path(
                                    self, ancestor, path_buffer)

                            leaf_name_data = LeafDataList()
                            if (self.interface.is_set or
                                    self.interface.yfilter != YFilter.not_set):
                                leaf_name_data.append(
                                    self.interface.get_name_leafdata())
                            if (self.subinterface.is_set
                                    or self.subinterface.yfilter !=
                                    YFilter.not_set):
                                leaf_name_data.append(
                                    self.subinterface.get_name_leafdata())

                            entity_path = EntityPath(path_buffer,
                                                     leaf_name_data)
                            return entity_path

                        def get_child_by_name(self, child_yang_name,
                                              segment_path):
                            child = self._get_child_by_seg_name(
                                [child_yang_name, segment_path])
                            if child is not None:
                                return child

                            return None

                        def has_leaf_or_child_of_name(self, name):
                            if (name == "interface" or name == "subinterface"):
                                return True
                            return False

                        def set_value(self, value_path, value, name_space,
                                      name_space_prefix):
                            if (value_path == "interface"):
                                self.interface = value
                                self.interface.value_namespace = name_space
                                self.interface.value_namespace_prefix = name_space_prefix
                            if (value_path == "subinterface"):
                                self.subinterface = value
                                self.subinterface.value_namespace = name_space
                                self.subinterface.value_namespace_prefix = name_space_prefix

                    def has_data(self):
                        return (self.state is not None
                                and self.state.has_data())

                    def has_operation(self):
                        return (self.yfilter != YFilter.not_set
                                or (self.state is not None
                                    and self.state.has_operation()))

                    def get_segment_path(self):
                        path_buffer = ""
                        path_buffer = "interface-ref" + path_buffer

                        return path_buffer

                    def get_entity_path(self, ancestor):
                        path_buffer = ""
                        if (ancestor is None):
                            raise YPYModelError(
                                "ancestor cannot be None as one of the ancestors is a list"
                            )
                        else:
                            path_buffer = _get_relative_entity_path(
                                self, ancestor, path_buffer)

                        leaf_name_data = LeafDataList()

                        entity_path = EntityPath(path_buffer, leaf_name_data)
                        return entity_path

                    def get_child_by_name(self, child_yang_name, segment_path):
                        child = self._get_child_by_seg_name(
                            [child_yang_name, segment_path])
                        if child is not None:
                            return child

                        if (child_yang_name == "state"):
                            if (self.state is None):
                                self.state = Vlans.Vlan.Members.Member.InterfaceRef.State(
                                )
                                self.state.parent = self
                                self._children_name_map["state"] = "state"
                            return self.state

                        return None

                    def has_leaf_or_child_of_name(self, name):
                        if (name == "state"):
                            return True
                        return False

                    def set_value(self, value_path, value, name_space,
                                  name_space_prefix):
                        pass

                def has_data(self):
                    return (self.interface_ref is not None
                            and self.interface_ref.has_data())

                def has_operation(self):
                    return (self.yfilter != YFilter.not_set
                            or (self.interface_ref is not None
                                and self.interface_ref.has_operation()))

                def get_segment_path(self):
                    path_buffer = ""
                    path_buffer = "member" + path_buffer

                    return path_buffer

                def get_entity_path(self, ancestor):
                    path_buffer = ""
                    if (ancestor is None):
                        raise YPYModelError(
                            "ancestor cannot be None as one of the ancestors is a list"
                        )
                    else:
                        path_buffer = _get_relative_entity_path(
                            self, ancestor, path_buffer)

                    leaf_name_data = LeafDataList()

                    entity_path = EntityPath(path_buffer, leaf_name_data)
                    return entity_path

                def get_child_by_name(self, child_yang_name, segment_path):
                    child = self._get_child_by_seg_name(
                        [child_yang_name, segment_path])
                    if child is not None:
                        return child

                    if (child_yang_name == "interface-ref"):
                        if (self.interface_ref is None):
                            self.interface_ref = Vlans.Vlan.Members.Member.InterfaceRef(
                            )
                            self.interface_ref.parent = self
                            self._children_name_map[
                                "interface_ref"] = "interface-ref"
                        return self.interface_ref

                    return None

                def has_leaf_or_child_of_name(self, name):
                    if (name == "interface-ref"):
                        return True
                    return False

                def set_value(self, value_path, value, name_space,
                              name_space_prefix):
                    pass

            def has_data(self):
                for c in self.member:
                    if (c.has_data()):
                        return True
                return False

            def has_operation(self):
                for c in self.member:
                    if (c.has_operation()):
                        return True
                return self.yfilter != YFilter.not_set

            def get_segment_path(self):
                path_buffer = ""
                path_buffer = "members" + path_buffer

                return path_buffer

            def get_entity_path(self, ancestor):
                path_buffer = ""
                if (ancestor is None):
                    raise YPYModelError(
                        "ancestor cannot be None as one of the ancestors is a list"
                    )
                else:
                    path_buffer = _get_relative_entity_path(
                        self, ancestor, path_buffer)

                leaf_name_data = LeafDataList()

                entity_path = EntityPath(path_buffer, leaf_name_data)
                return entity_path

            def get_child_by_name(self, child_yang_name, segment_path):
                child = self._get_child_by_seg_name(
                    [child_yang_name, segment_path])
                if child is not None:
                    return child

                if (child_yang_name == "member"):
                    for c in self.member:
                        segment = c.get_segment_path()
                        if (segment_path == segment):
                            return c
                    c = Vlans.Vlan.Members.Member()
                    c.parent = self
                    local_reference_key = "ydk::seg::%s" % segment_path
                    self._local_refs[local_reference_key] = c
                    self.member.append(c)
                    return c

                return None

            def has_leaf_or_child_of_name(self, name):
                if (name == "member"):
                    return True
                return False

            def set_value(self, value_path, value, name_space,
                          name_space_prefix):
                pass

        def has_data(self):
            return (self.vlan_id.is_set
                    or (self.config is not None and self.config.has_data())
                    or (self.members is not None and self.members.has_data())
                    or (self.state is not None and self.state.has_data()))

        def has_operation(self):
            return (self.yfilter != YFilter.not_set
                    or self.vlan_id.yfilter != YFilter.not_set or
                    (self.config is not None and self.config.has_operation())
                    or
                    (self.members is not None and self.members.has_operation())
                    or (self.state is not None and self.state.has_operation()))

        def get_segment_path(self):
            path_buffer = ""
            path_buffer = "vlan" + "[vlan-id='" + self.vlan_id.get(
            ) + "']" + path_buffer

            return path_buffer

        def get_entity_path(self, ancestor):
            path_buffer = ""
            if (ancestor is None):
                path_buffer = "openconfig-vlan:vlans/%s" % self.get_segment_path(
                )
            else:
                path_buffer = _get_relative_entity_path(
                    self, ancestor, path_buffer)

            leaf_name_data = LeafDataList()
            if (self.vlan_id.is_set
                    or self.vlan_id.yfilter != YFilter.not_set):
                leaf_name_data.append(self.vlan_id.get_name_leafdata())

            entity_path = EntityPath(path_buffer, leaf_name_data)
            return entity_path

        def get_child_by_name(self, child_yang_name, segment_path):
            child = self._get_child_by_seg_name(
                [child_yang_name, segment_path])
            if child is not None:
                return child

            if (child_yang_name == "config"):
                if (self.config is None):
                    self.config = Vlans.Vlan.Config()
                    self.config.parent = self
                    self._children_name_map["config"] = "config"
                return self.config

            if (child_yang_name == "members"):
                if (self.members is None):
                    self.members = Vlans.Vlan.Members()
                    self.members.parent = self
                    self._children_name_map["members"] = "members"
                return self.members

            if (child_yang_name == "state"):
                if (self.state is None):
                    self.state = Vlans.Vlan.State()
                    self.state.parent = self
                    self._children_name_map["state"] = "state"
                return self.state

            return None

        def has_leaf_or_child_of_name(self, name):
            if (name == "config" or name == "members" or name == "state"
                    or name == "vlan-id"):
                return True
            return False

        def set_value(self, value_path, value, name_space, name_space_prefix):
            if (value_path == "vlan-id"):
                self.vlan_id = value
                self.vlan_id.value_namespace = name_space
                self.vlan_id.value_namespace_prefix = name_space_prefix

    def has_data(self):
        for c in self.vlan:
            if (c.has_data()):
                return True
        return False

    def has_operation(self):
        for c in self.vlan:
            if (c.has_operation()):
                return True
        return self.yfilter != YFilter.not_set

    def get_segment_path(self):
        path_buffer = ""
        path_buffer = "openconfig-vlan:vlans" + path_buffer

        return path_buffer

    def get_entity_path(self, ancestor):
        path_buffer = ""
        if (not ancestor is None):
            raise YPYModelError("ancestor has to be None for top-level node")

        path_buffer = self.get_segment_path()
        leaf_name_data = LeafDataList()

        entity_path = EntityPath(path_buffer, leaf_name_data)
        return entity_path

    def get_child_by_name(self, child_yang_name, segment_path):
        child = self._get_child_by_seg_name([child_yang_name, segment_path])
        if child is not None:
            return child

        if (child_yang_name == "vlan"):
            for c in self.vlan:
                segment = c.get_segment_path()
                if (segment_path == segment):
                    return c
            c = Vlans.Vlan()
            c.parent = self
            local_reference_key = "ydk::seg::%s" % segment_path
            self._local_refs[local_reference_key] = c
            self.vlan.append(c)
            return c

        return None

    def has_leaf_or_child_of_name(self, name):
        if (name == "vlan"):
            return True
        return False

    def set_value(self, value_path, value, name_space, name_space_prefix):
        pass

    def clone_ptr(self):
        self._top_entity = Vlans()
        return self._top_entity