コード例 #1
0
 def __init__(self):
     self.parent = None
     self.vrf_summary = YList()
     self.vrf_summary.parent = self
     self.vrf_summary.name = 'vrf_summary'
コード例 #2
0
 def __init__(self):
     self.cpu_utilization = YList()
     self.cpu_utilization.parent = self
     self.cpu_utilization.name = 'cpu_utilization'
コード例 #3
0
 def __init__(self):
     self.parent = None
     self.access = YList()
     self.access.parent = self
     self.access.name = 'access'
コード例 #4
0
        def __init__(self):
            super(VrrpOperData.VrrpOperState, self).__init__()

            self.yang_name = "vrrp-oper-state"
            self.yang_parent_name = "vrrp-oper-data"
            self.is_top_level_class = False
            self.has_list_ancestor = False
            self.ylist_key_names = ['if_number', 'group_id', 'addr_type']
            self._child_classes = OrderedDict([
                ("track-list", ("track_list",
                                VrrpOperData.VrrpOperState.TrackList))
            ])
            self._leafs = OrderedDict([
                ('if_number', (YLeaf(YType.uint32, 'if-number'), ['int'])),
                ('group_id', (YLeaf(YType.uint32, 'group-id'), ['int'])),
                ('addr_type', (YLeaf(YType.enumeration, 'addr-type'), [
                    ('ydk.models.cisco_ios_xe.Cisco_IOS_XE_common_types',
                     'AddrType', '')
                ])),
                ('version', (YLeaf(YType.enumeration, 'version'), [
                    ('ydk.models.cisco_ios_xe.Cisco_IOS_XE_vrrp_oper',
                     'ProtoVersion', '')
                ])),
                ('virtual_ip', (YLeaf(YType.str, 'virtual-ip'), ['str',
                                                                 'str'])),
                ('if_name', (YLeaf(YType.str, 'if-name'), ['str'])),
                ('vrrp_state', (YLeaf(YType.enumeration, 'vrrp-state'), [
                    ('ydk.models.cisco_ios_xe.Cisco_IOS_XE_vrrp_oper',
                     'VrrpProtoState', '')
                ])),
                ('virtual_mac', (YLeaf(YType.str, 'virtual-mac'), ['str'])),
                ('master_ip', (YLeaf(YType.str, 'master-ip'), ['str', 'str'])),
                ('is_owner', (YLeaf(YType.boolean, 'is-owner'), ['bool'])),
                ('priority', (YLeaf(YType.uint32, 'priority'), ['int'])),
                ('advertisement_timer',
                 (YLeaf(YType.uint32, 'advertisement-timer'), ['int'])),
                ('master_down_timer', (YLeaf(YType.uint32,
                                             'master-down-timer'), ['int'])),
                ('skew_time', (YLeaf(YType.uint32, 'skew-time'), ['int'])),
                ('preempt', (YLeaf(YType.boolean, 'preempt'), ['bool'])),
                ('master_transitions', (YLeaf(YType.uint32,
                                              'master-transitions'), ['int'])),
                ('new_master_reason',
                 (YLeaf(YType.enumeration, 'new-master-reason'),
                  [('ydk.models.cisco_ios_xe.Cisco_IOS_XE_vrrp_oper',
                    'MasterReason', '')])),
                ('last_state_change_time',
                 (YLeaf(YType.str, 'last-state-change-time'), ['str'])),
                ('adv_interval_errors',
                 (YLeaf(YType.uint32, 'adv-interval-errors'), ['int'])),
                ('ip_ttl_errors', (YLeaf(YType.uint32,
                                         'ip-ttl-errors'), ['int'])),
                ('rcvd_pri_zero_pak', (YLeaf(YType.uint32,
                                             'rcvd-pri-zero-pak'), ['int'])),
                ('sent_pri_zero_pak', (YLeaf(YType.uint32,
                                             'sent-pri-zero-pak'), ['int'])),
                ('rcvd_invalid_type_pak',
                 (YLeaf(YType.uint32, 'rcvd-invalid-type-pak'), ['int'])),
                ('addr_list_errors', (YLeaf(YType.uint32,
                                            'addr-list-errors'), ['int'])),
                ('pak_len_errors', (YLeaf(YType.uint32,
                                          'pak-len-errors'), ['int'])),
                ('discontinuity_time', (YLeaf(YType.str,
                                              'discontinuity-time'), ['str'])),
                ('advertisement_sent', (YLeaf(YType.uint32,
                                              'advertisement-sent'), ['int'])),
                ('advertisement_rcvd', (YLeaf(YType.uint32,
                                              'advertisement-rcvd'), ['int'])),
                ('omp_state', (YLeaf(YType.enumeration, 'omp-state'), [
                    ('ydk.models.cisco_ios_xe.Cisco_IOS_XE_vrrp_oper',
                     'OmpStateUpdown', '')
                ])),
                ('secondary_vip_addresses',
                 (YLeafList(YType.str,
                            'secondary-vip-addresses'), ['str', 'str'])),
            ])
            self.if_number = None
            self.group_id = None
            self.addr_type = None
            self.version = None
            self.virtual_ip = None
            self.if_name = None
            self.vrrp_state = None
            self.virtual_mac = None
            self.master_ip = None
            self.is_owner = None
            self.priority = None
            self.advertisement_timer = None
            self.master_down_timer = None
            self.skew_time = None
            self.preempt = None
            self.master_transitions = None
            self.new_master_reason = None
            self.last_state_change_time = None
            self.adv_interval_errors = None
            self.ip_ttl_errors = None
            self.rcvd_pri_zero_pak = None
            self.sent_pri_zero_pak = None
            self.rcvd_invalid_type_pak = None
            self.addr_list_errors = None
            self.pak_len_errors = None
            self.discontinuity_time = None
            self.advertisement_sent = None
            self.advertisement_rcvd = None
            self.omp_state = None
            self.secondary_vip_addresses = []

            self.track_list = YList(self)
            self._segment_path = lambda: "vrrp-oper-state" + "[if-number='" + str(
                self.if_number) + "']" + "[group-id='" + str(
                    self.group_id) + "']" + "[addr-type='" + str(self.addr_type
                                                                 ) + "']"
            self._absolute_path = lambda: "Cisco-IOS-XE-vrrp-oper:vrrp-oper-data/%s" % self._segment_path(
            )
            self._is_frozen = True
コード例 #5
0
 def __init__(self):
     self.node = YList()
     self.node.parent = self
     self.node.name = 'node'
コード例 #6
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
コード例 #7
0
 def __init__(self):
     self.parent = None
     self.multi_path_include = YList()
     self.multi_path_include.parent = self
     self.multi_path_include.name = 'multi_path_include'
コード例 #8
0
 def __init__(self):
     self.parent = None
     self.interface_name = None
     self.protocol = YList()
     self.protocol.parent = self
     self.protocol.name = 'protocol'
コード例 #9
0
 def __init__(self):
     self.group = YList()
     self.group.parent = self
     self.group.name = 'group'
コード例 #10
0
 def __init__(self):
     self.parent = None
     self.username = YList()
     self.username.parent = self
     self.username.name = 'username'
コード例 #11
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
コード例 #12
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
コード例 #13
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
コード例 #14
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
コード例 #15
0
 def __init__(self):
     self.parent = None
     self.interface_summary_data = YList()
     self.interface_summary_data.parent = self
     self.interface_summary_data.name = 'interface_summary_data'
コード例 #16
0
 def __init__(self):
     self.parent = None
     self.exec_ = YList()
     self.exec_.parent = self
     self.exec_.name = 'exec_'
コード例 #17
0
 def __init__(self):
     self.parent = None
     self.controller = YList()
     self.controller.parent = self
     self.controller.name = 'controller'
コード例 #18
0
 def __init__(self):
     self.parent = None
     self.configuration = YList()
     self.configuration.parent = self
     self.configuration.name = 'configuration'
コード例 #19
0
 def __init__(self):
     self.parent = None
     self.interface = YList()
     self.interface.parent = self
     self.interface.name = 'interface'
コード例 #20
0
 def __init__(self):
     self.parent = None
     self.all = YList()
     self.all.parent = self
     self.all.name = 'all'
コード例 #21
0
            def __init__(self):
                if sys.version_info > (3, ):
                    super().__init__()
                else:
                    super(Processes.AllLocations.Name, self).__init__()

                self.yang_name = "name"
                self.yang_parent_name = "all-locations"
                self.is_top_level_class = False
                self.has_list_ancestor = True
                self.ylist_key_names = ['proc_name', 'instance_id']
                self._child_classes = OrderedDict([
                    ("services", ("services",
                                  Processes.AllLocations.Name.Services))
                ])
                self._leafs = OrderedDict([
                    ('proc_name', (YLeaf(YType.str, 'proc-name'), ['str'])),
                    ('instance_id', (YLeaf(YType.uint32,
                                           'instance-id'), ['int'])),
                    ('path', (YLeaf(YType.str, 'path'), ['str'])),
                    ('startup_file', (YLeaf(YType.str,
                                            'startup-file'), ['str'])),
                    ('startup_mode',
                     (YLeaf(YType.enumeration, 'startup-mode'),
                      [('ydk.models.cisco_ios_xr.Cisco_IOS_XR_sysadmin_pm',
                        'StartupMode', '')])),
                    ('heart_beat_timeout',
                     (YLeaf(YType.uint32, 'heart-beat-timeout'), ['int'])),
                    ('last_heart_beat_time',
                     (YLeaf(YType.str, 'last-heart-beat-time'), ['str'])),
                    ('max_restarts', (YLeaf(YType.uint32,
                                            'max-restarts'), ['int'])),
                    ('respawn_reset_timer',
                     (YLeaf(YType.uint32, 'respawn-reset-timer'), ['int'])),
                    ('mandatory', (YLeaf(YType.boolean,
                                         'mandatory'), ['bool'])),
                    ('maint_mode', (YLeaf(YType.boolean,
                                          'maint-mode'), ['bool'])),
                    ('args', (YLeaf(YType.str, 'args'), ['str'])),
                    ('proc_state', (YLeaf(YType.enumeration, 'proc-state'), [
                        ('ydk.models.cisco_ios_xr.Cisco_IOS_XR_sysadmin_pm',
                         'ProcessState', '')
                    ])),
                    ('pid', (YLeaf(YType.int32, 'pid'), ['int'])),
                    ('proc_aborted', (YLeaf(YType.boolean,
                                            'proc-aborted'), ['bool'])),
                    ('exit_status', (YLeaf(YType.str,
                                           'exit-status'), ['str'])),
                    ('respawns', (YLeaf(YType.int32, 'respawns'), ['int'])),
                    ('start_time', (YLeaf(YType.str, 'start-time'), ['str'])),
                    ('ready_time', (YLeaf(YType.str, 'ready-time'), ['str'])),
                    ('last_exit_time', (YLeaf(YType.str,
                                              'last-exit-time'), ['str'])),
                ])
                self.proc_name = None
                self.instance_id = None
                self.path = None
                self.startup_file = None
                self.startup_mode = None
                self.heart_beat_timeout = None
                self.last_heart_beat_time = None
                self.max_restarts = None
                self.respawn_reset_timer = None
                self.mandatory = None
                self.maint_mode = None
                self.args = None
                self.proc_state = None
                self.pid = None
                self.proc_aborted = None
                self.exit_status = None
                self.respawns = None
                self.start_time = None
                self.ready_time = None
                self.last_exit_time = None

                self.services = YList(self)
                self._segment_path = lambda: "name" + "[proc-name='" + str(
                    self.proc_name) + "']" + "[instance-id='" + str(
                        self.instance_id) + "']"
                self._is_frozen = True
コード例 #22
0
 def __init__(self):
     self.parent = None
     self.client = YList()
     self.client.parent = self
     self.client.name = 'client'
コード例 #23
0
                def __init__(self):
                    super(MemorySummary.Nodes.Node.Detail, self).__init__()

                    self.yang_name = "detail"
                    self.yang_parent_name = "node"
                    self.is_top_level_class = False
                    self.has_list_ancestor = True
                    self.ylist_key_names = []
                    self._child_classes = OrderedDict([
                        ("shared-window",
                         ("shared_window",
                          MemorySummary.Nodes.Node.Detail.SharedWindow))
                    ])
                    self._leafs = OrderedDict([
                        ('page_size', (YLeaf(YType.uint32,
                                             'page-size'), ['int'])),
                        ('ram_memory', (YLeaf(YType.uint64,
                                              'ram-memory'), ['int'])),
                        ('free_physical_memory',
                         (YLeaf(YType.uint64,
                                'free-physical-memory'), ['int'])),
                        ('private_physical_memory',
                         (YLeaf(YType.uint64,
                                'private-physical-memory'), ['int'])),
                        ('system_ram_memory',
                         (YLeaf(YType.uint64, 'system-ram-memory'), ['int'])),
                        ('free_application_memory',
                         (YLeaf(YType.uint64,
                                'free-application-memory'), ['int'])),
                        ('image_memory', (YLeaf(YType.uint64,
                                                'image-memory'), ['int'])),
                        ('boot_ram_size', (YLeaf(YType.uint64,
                                                 'boot-ram-size'), ['int'])),
                        ('reserved_memory',
                         (YLeaf(YType.uint64, 'reserved-memory'), ['int'])),
                        ('io_memory', (YLeaf(YType.uint64,
                                             'io-memory'), ['int'])),
                        ('flash_system', (YLeaf(YType.uint64,
                                                'flash-system'), ['int'])),
                        ('total_shared_window', (YLeaf(YType.uint64,
                                                       'total-shared-window'),
                                                 ['int'])),
                        ('allocated_memory',
                         (YLeaf(YType.uint64, 'allocated-memory'), ['int'])),
                        ('program_text', (YLeaf(YType.uint64,
                                                'program-text'), ['int'])),
                        ('program_data', (YLeaf(YType.uint64,
                                                'program-data'), ['int'])),
                        ('program_stack', (YLeaf(YType.uint64,
                                                 'program-stack'), ['int'])),
                        ('total_used', (YLeaf(YType.uint64,
                                              'total-used'), ['int'])),
                    ])
                    self.page_size = None
                    self.ram_memory = None
                    self.free_physical_memory = None
                    self.private_physical_memory = None
                    self.system_ram_memory = None
                    self.free_application_memory = None
                    self.image_memory = None
                    self.boot_ram_size = None
                    self.reserved_memory = None
                    self.io_memory = None
                    self.flash_system = None
                    self.total_shared_window = None
                    self.allocated_memory = None
                    self.program_text = None
                    self.program_data = None
                    self.program_stack = None
                    self.total_used = None

                    self.shared_window = YList(self)
                    self._segment_path = lambda: "detail"
                    self._is_frozen = True
コード例 #24
0
 def __init__(self):
     self.parent = None
     self.client_name = None
     self.client_data = YList()
     self.client_data.parent = self
     self.client_data.name = 'client_data'
コード例 #25
0
 def __init__(self):
     self.parent = None
     self.node_name = None
     self.reboot_history = YList()
     self.reboot_history.parent = self
     self.reboot_history.name = 'reboot_history'
コード例 #26
0
        def __init__(self):
            super(NetconfYang.CiscoIa, self).__init__()

            self.yang_name = "cisco-ia"
            self.yang_parent_name = "netconf-yang"
            self.is_top_level_class = False
            self.has_list_ancestor = False
            self.ylist_key_names = []
            self._child_container_classes = OrderedDict([
                ("snmp-trap-control", ("snmp_trap_control",
                                       NetconfYang.CiscoIa.SnmpTrapControl)),
                ("logging", ("logging", NetconfYang.CiscoIa.Logging)),
                ("blocking", ("blocking", NetconfYang.CiscoIa.Blocking))
            ])
            self._child_list_classes = OrderedDict([
                ("preserve-ned-path", ("preserve_ned_path",
                                       NetconfYang.CiscoIa.PreserveNedPath)),
                ("parser-msg-ignore", ("parser_msg_ignore",
                                       NetconfYang.CiscoIa.ParserMsgIgnore)),
                ("conf-parser-msg-ignore",
                 ("conf_parser_msg_ignore",
                  NetconfYang.CiscoIa.ConfParserMsgIgnore)),
                ("full-sync-cli", ("full_sync_cli",
                                   NetconfYang.CiscoIa.FullSyncCli)),
                ("conf-full-sync-cli", ("conf_full_sync_cli",
                                        NetconfYang.CiscoIa.ConfFullSyncCli))
            ])
            self._leafs = OrderedDict([
                ('auto_sync', YLeaf(YType.enumeration, 'auto-sync')),
                ('init_sync', YLeaf(YType.enumeration, 'init-sync')),
                ('intelligent_sync', YLeaf(YType.boolean, 'intelligent-sync')),
                ('message_diag_level', YLeaf(YType.int16,
                                             'message-diag-level')),
                ('max_diag_messages_saved',
                 YLeaf(YType.int16, 'max-diag-messages-saved')),
                ('post_sync_acl_process',
                 YLeaf(YType.boolean, 'post-sync-acl-process')),
                ('config_change_delay',
                 YLeaf(YType.int16, 'config-change-delay')),
                ('process_missing_prc',
                 YLeaf(YType.boolean, 'process-missing-prc')),
                ('snmp_community_string',
                 YLeaf(YType.str, 'snmp-community-string')),
                ('preserve_paths_enabled',
                 YLeaf(YType.boolean, 'preserve-paths-enabled')),
                ('nes_ttynum', YLeaf(YType.int16, 'nes-ttynum')),
                ('restored', YLeaf(YType.boolean, 'restored')),
            ])
            self.auto_sync = None
            self.init_sync = None
            self.intelligent_sync = None
            self.message_diag_level = None
            self.max_diag_messages_saved = None
            self.post_sync_acl_process = None
            self.config_change_delay = None
            self.process_missing_prc = None
            self.snmp_community_string = None
            self.preserve_paths_enabled = None
            self.nes_ttynum = None
            self.restored = None

            self.snmp_trap_control = NetconfYang.CiscoIa.SnmpTrapControl()
            self.snmp_trap_control.parent = self
            self._children_name_map["snmp_trap_control"] = "snmp-trap-control"
            self._children_yang_names.add("snmp-trap-control")

            self.logging = NetconfYang.CiscoIa.Logging()
            self.logging.parent = self
            self._children_name_map["logging"] = "logging"
            self._children_yang_names.add("logging")

            self.blocking = NetconfYang.CiscoIa.Blocking()
            self.blocking.parent = self
            self._children_name_map["blocking"] = "blocking"
            self._children_yang_names.add("blocking")

            self.preserve_ned_path = YList(self)
            self.parser_msg_ignore = YList(self)
            self.conf_parser_msg_ignore = YList(self)
            self.full_sync_cli = YList(self)
            self.conf_full_sync_cli = YList(self)
            self._segment_path = lambda: "cisco-ia:cisco-ia"
            self._absolute_path = lambda: "cisco-self-mgmt:netconf-yang/%s" % self._segment_path(
            )
コード例 #27
0
 def __init__(self):
     self.parent = None
     self.access_list_entry = YList()
     self.access_list_entry.parent = self
     self.access_list_entry.name = 'access_list_entry'
コード例 #28
0
 def __init__(self):
     self.parent = None
     self.interface_detail = YList()
     self.interface_detail.parent = self
     self.interface_detail.name = 'interface_detail'
コード例 #29
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
コード例 #30
0
 def __init__(self):
     self.parent = None
     self.network = YList()
     self.network.parent = self
     self.network.name = 'network'