示例#1
0
    def _to_real_list_type(self, elems, member, entity):

        if isinstance(elems, list):
            results = YLeafList()
            results.parent = entity
            results.name = member.presentation_name
            for elem in elems:
                result = XmlDecoder._to_real_type_helper(elem, member, entity)
                results.append(result)
            return results
        else:
            return XmlDecoder._to_real_type_helper(elems[0], member, entity)
        def __init__(self):
            super(Install.Repository, self).__init__()

            self.yang_name = "repository"
            self.yang_parent_name = "install"
            self.is_top_level_class = False
            self.has_list_ancestor = False
            self.ylist_key_names = []
            self._child_classes = OrderedDict([
                ("all", ("all", Install.Repository.All))
            ])
            self._leafs = OrderedDict([
                ('si_repository_output',
                 YLeafList(YType.str, 'si_repository_output')),
            ])
            self.si_repository_output = []

            self.all = Install.Repository.All()
            self.all.parent = self
            self._children_name_map["all"] = "all"
            self._segment_path = lambda: "repository"
            self._absolute_path = lambda: "Cisco-IOS-XR-sysadmin-instmgr-oper:install/%s" % self._segment_path(
            )
        def __init__(self):
            super(Install.Inactive, self).__init__()

            self.yang_name = "inactive"
            self.yang_parent_name = "install"
            self.is_top_level_class = False
            self.has_list_ancestor = False
            self.ylist_key_names = []
            self._child_classes = OrderedDict([
                ("summary", ("summary", Install.Inactive.Summary))
            ])
            self._leafs = OrderedDict([
                ('si_inactive_output',
                 YLeafList(YType.str, 'si_inactive_output')),
            ])
            self.si_inactive_output = []

            self.summary = Install.Inactive.Summary()
            self.summary.parent = self
            self._children_name_map["summary"] = "summary"
            self._segment_path = lambda: "inactive"
            self._absolute_path = lambda: "Cisco-IOS-XR-sysadmin-instmgr-oper:install/%s" % self._segment_path(
            )
示例#4
0
        def __init__(self):
            super(Nacm.RuleList, self).__init__()

            self.yang_name = "rule-list"
            self.yang_parent_name = "nacm"
            self.is_top_level_class = False
            self.has_list_ancestor = False
            self.ylist_key_names = ['name']
            self._child_classes = OrderedDict([("rule", ("rule",
                                                         Nacm.RuleList.Rule))])
            self._leafs = OrderedDict([
                ('name', (YLeaf(YType.str, 'name'), ['str'])),
                ('group', (YLeafList(YType.str, 'group'), ['str', 'str'])),
            ])
            self.name = None
            self.group = []

            self.rule = YList(self)
            self._segment_path = lambda: "rule-list" + "[name='" + str(
                self.name) + "']"
            self._absolute_path = lambda: "ietf-netconf-acm:nacm/%s" % self._segment_path(
            )
            self._is_frozen = True
            def __init__(self):
                super(Install.Log.Reverse, self).__init__()

                self.yang_name = "reverse"
                self.yang_parent_name = "log"
                self.is_top_level_class = False
                self.has_list_ancestor = False
                self.ylist_key_names = []
                self._child_classes = OrderedDict([
                    ("detail", ("detail", Install.Log.Reverse.Detail))
                ])
                self._leafs = OrderedDict([
                    ('si_log_reverse_output',
                     YLeafList(YType.str, 'si_log_reverse_output')),
                ])
                self.si_log_reverse_output = []

                self.detail = Install.Log.Reverse.Detail()
                self.detail.parent = self
                self._children_name_map["detail"] = "detail"
                self._segment_path = lambda: "reverse"
                self._absolute_path = lambda: "Cisco-IOS-XR-sysadmin-instmgr-oper:install/log/%s" % self._segment_path(
                )
示例#6
0
        def __init__(self):
            super(StartQuery.Input, self).__init__()

            self.yang_name = "input"
            self.yang_parent_name = "start-query"
            self.is_top_level_class = False
            self.has_list_ancestor = False
            self._child_container_classes = {}
            self._child_list_classes = {"select" : ("select", StartQuery.Input.Select)}

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

            self.sort_by = YLeafList(YType.str, "sort-by")

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

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

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

            self.select = YList(self)
            self._segment_path = lambda: "input"
            self._absolute_path = lambda: "tailf-netconf-query:start-query/%s" % self._segment_path()
示例#7
0
        def __init__(self):
            super(ModulesState.Module, self).__init__()

            self.yang_name = "module"
            self.yang_parent_name = "modules-state"
            self.is_top_level_class = False
            self.has_list_ancestor = False
            self.ylist_key_names = ['name', 'revision']
            self._child_classes = OrderedDict([
                ("deviation", ("deviation", ModulesState.Module.Deviation)),
                ("submodule", ("submodule", ModulesState.Module.Submodule))
            ])
            self._leafs = OrderedDict([
                ('name', (YLeaf(YType.str, 'name'), ['str'])),
                ('revision', (YLeaf(YType.str, 'revision'), ['str', 'str'])),
                ('schema', (YLeaf(YType.str, 'schema'), ['str'])),
                ('namespace', (YLeaf(YType.str, 'namespace'), ['str'])),
                ('feature', (YLeafList(YType.str, 'feature'), ['str'])),
                ('conformance_type',
                 (YLeaf(YType.enumeration, 'conformance-type'),
                  [('ydk.models.ietf.ietf_yang_library', 'ModulesState',
                    'Module.ConformanceType')])),
            ])
            self.name = None
            self.revision = None
            self.schema = None
            self.namespace = None
            self.feature = []
            self.conformance_type = None

            self.deviation = YList(self)
            self.submodule = YList(self)
            self._segment_path = lambda: "module" + "[name='" + str(
                self.name) + "']" + "[revision='" + str(self.revision) + "']"
            self._absolute_path = lambda: "ietf-yang-library:modules-state/%s" % self._segment_path(
            )
            self._is_frozen = True
示例#8
0
            def __init__(self):
                super(NetconfState.Schemas.Schema, self).__init__()

                self.yang_name = "schema"
                self.yang_parent_name = "schemas"
                self.is_top_level_class = False
                self.has_list_ancestor = False
                self._child_container_classes = {}
                self._child_list_classes = {}

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

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

                self.format = YLeaf(YType.identityref, "format")

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

                self.location = YLeafList(YType.str, "location")
                self._segment_path = lambda: "schema" + "[identifier='" + self.identifier.get(
                ) + "']" + "[version='" + self.version.get(
                ) + "']" + "[format='" + self.format.get() + "']"
                self._absolute_path = lambda: "ietf-netconf-monitoring:netconf-state/schemas/%s" % self._segment_path(
                )
示例#9
0
                def __init__(self):
                    if sys.version_info > (3,):
                        super().__init__()
                    else:
                        super(IpDomain.Vrfs.Vrf.Server, self).__init__()

                    self.yang_name = "server"
                    self.yang_parent_name = "vrf"
                    self.is_top_level_class = False
                    self.has_list_ancestor = True
                    self.ylist_key_names = []
                    self._child_classes = OrderedDict([("server-address", ("server_address", IpDomain.Vrfs.Vrf.Server.ServerAddress))])
                    self._leafs = OrderedDict([
                        ('domain_lookup', (YLeaf(YType.enumeration, 'domain-lookup'), [('ydk.models.cisco_ios_xr.Cisco_IOS_XR_ip_domain_oper', 'ServerDomainLkup', '')])),
                        ('domain_name', (YLeaf(YType.str, 'domain-name'), ['str'])),
                        ('domain', (YLeafList(YType.str, 'domain'), ['str'])),
                    ])
                    self.domain_lookup = None
                    self.domain_name = None
                    self.domain = []

                    self.server_address = YList(self)
                    self._segment_path = lambda: "server"
                    self._is_frozen = True
示例#10
0
            def __init__(self):
                super(ImmediateQuery.Input.Select, self).__init__()

                self.yang_name = "select"
                self.yang_parent_name = "input"
                self.is_top_level_class = False
                self.has_list_ancestor = False
                self.ylist_key_names = []
                self._child_classes = OrderedDict([])
                self._leafs = OrderedDict([
                    ('label', (YLeaf(YType.str, 'label'), ['str'])),
                    ('expression', (YLeaf(YType.str, 'expression'), ['str'])),
                    ('result_type',
                     (YLeafList(YType.enumeration, 'result-type'),
                      [('ydk.models.cisco_ios_xe.tailf_netconf_query',
                        'ImmediateQuery', 'Input.Select.ResultType')])),
                ])
                self.label = None
                self.expression = None
                self.result_type = []
                self._segment_path = lambda: "select"
                self._absolute_path = lambda: "tailf-netconf-query:immediate-query/input/%s" % self._segment_path(
                )
                self._is_frozen = True
示例#11
0
            def __init__(self):
                if sys.version_info > (3, ):
                    super().__init__()
                else:
                    super(Nacm.Groups.Group, self).__init__()

                self.yang_name = "group"
                self.yang_parent_name = "groups"
                self.is_top_level_class = False
                self.has_list_ancestor = False
                self.ylist_key_names = ['group_name']
                self._child_classes = OrderedDict([])
                self._leafs = OrderedDict([
                    ('group_name', (YLeaf(YType.str, 'group-name'), ['str'])),
                    ('user_name', (YLeafList(YType.str,
                                             'user-name'), ['str'])),
                ])
                self.group_name = None
                self.user_name = []
                self._segment_path = lambda: "group" + "[group-name='" + str(
                    self.group_name) + "']"
                self._absolute_path = lambda: "Cisco-IOS-XR-aaa-nacm-cfg:nacm/groups/%s" % self._segment_path(
                )
                self._is_frozen = True
示例#12
0
                    def __init__(self):
                        super(Ssespan.Nodes.Node.SpanMirrInfos.SpanMirrInfo,
                              self).__init__()

                        self.yang_name = "span-mirr-info"
                        self.yang_parent_name = "span-mirr-infos"
                        self.is_top_level_class = False
                        self.has_list_ancestor = True
                        self._child_container_classes = {}
                        self._child_list_classes = {}

                        self.intf_name = YLeaf(YType.str, "intf-name")

                        self.src_ifh = YLeaf(YType.uint32, "src-ifh")

                        self.intf_name_xr = YLeaf(YType.str, "intf-name-xr")

                        self.v4_acl_flag = YLeaf(YType.uint32, "v4-acl-flag")

                        self.v6_acl_flag = YLeaf(YType.uint32, "v6-acl-flag")

                        self.gre_acl_flag = YLeaf(YType.uint32, "gre-acl-flag")

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

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

                        self.gre_state = YLeaf(YType.uint32, "gre-state")

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

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

                        self.gre_sessid = YLeaf(YType.uint32, "gre-sessid")

                        self.v4dst_type = YLeaf(YType.uint32, "v4dst-type")

                        self.v6dst_type = YLeaf(YType.uint32, "v6dst-type")

                        self.gredst_type = YLeaf(YType.uint32, "gredst-type")

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

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

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

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

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

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

                        self.np_umask = YLeaf(YType.uint32, "np-umask")

                        self.uidb = YLeafList(YType.uint32, "uidb")

                        self.sft_hw_data = YLeafList(YType.uint32,
                                                     "sft-hw-data")
                        self._segment_path = lambda: "span-mirr-info" + "[intf-name='" + self.intf_name.get(
                        ) + "']"
        def __init__(self):
            super(FlowMonitors.FlowMonitorStatistics, self).__init__()

            self.yang_name = "flow-monitor-statistics"
            self.yang_parent_name = "flow-monitors"
            self.is_top_level_class = False
            self.has_list_ancestor = False
            self.ylist_key_names = ['monitor_name']
            self._child_classes = OrderedDict([
                ("cache-data", ("cache_data",
                                FlowMonitors.FlowMonitorStatistics.CacheData))
            ])
            self._leafs = OrderedDict([
                ('monitor_name', (YLeaf(YType.str, 'monitor-name'), ['str'])),
                ('description', (YLeaf(YType.str, 'description'), ['str'])),
                ('record_name', (YLeaf(YType.str, 'record-name'), ['str'])),
                ('active_flow_exporter',
                 (YLeafList(YType.str, 'active-flow-exporter'), ['str'])),
                ('inactive_flow_exporter',
                 (YLeafList(YType.str, 'inactive-flow-exporter'), ['str'])),
                ('invalid_packet_counts',
                 (YLeaf(YType.uint64, 'invalid-packet-counts'), ['int'])),
                ('transaction_end_ager_enabled',
                 (YLeaf(YType.boolean,
                        'transaction-end-ager-enabled'), ['bool'])),
                ('protocol_dist_configured',
                 (YLeaf(YType.str, 'protocol-dist-configured'), ['str'])),
                ('size_dist_configured',
                 (YLeaf(YType.str, 'size-dist-configured'), ['str'])),
                ('inactive_timer', (YLeaf(YType.uint32,
                                          'inactive-timer'), ['int'])),
                ('active_timer', (YLeaf(YType.uint32,
                                        'active-timer'), ['int'])),
                ('update_timeout', (YLeaf(YType.uint32,
                                          'update-timeout'), ['int'])),
                ('synchronized_timeout',
                 (YLeaf(YType.uint32, 'synchronized-timeout'), ['int'])),
                ('export_spread_interval',
                 (YLeaf(YType.uint32, 'export-spread-interval'), ['int'])),
                ('immediate_timeout', (YLeaf(YType.uint32,
                                             'immediate-timeout'), ['int'])),
            ])
            self.monitor_name = None
            self.description = None
            self.record_name = None
            self.active_flow_exporter = []
            self.inactive_flow_exporter = []
            self.invalid_packet_counts = None
            self.transaction_end_ager_enabled = None
            self.protocol_dist_configured = None
            self.size_dist_configured = None
            self.inactive_timer = None
            self.active_timer = None
            self.update_timeout = None
            self.synchronized_timeout = None
            self.export_spread_interval = None
            self.immediate_timeout = None

            self.cache_data = FlowMonitors.FlowMonitorStatistics.CacheData()
            self.cache_data.parent = self
            self._children_name_map["cache_data"] = "cache-data"
            self._segment_path = lambda: "flow-monitor-statistics" + "[monitor-name='" + str(
                self.monitor_name) + "']"
            self._absolute_path = lambda: "Cisco-IOS-XE-flow-monitor-oper:flow-monitors/%s" % self._segment_path(
            )
            self._is_frozen = True
        class PbtsForwardClassFallback(Entity):
            """
            Set PBTS class for fallback
            
            .. attribute:: forward_class_number  <key>
            
            	PBTS forward class number
            	**type**\: one of the below types:
            
            	**type**\:   :py:class:`FibPbtsForwardClass <ydk.models.cisco_ios_xr.Cisco_IOS_XR_fib_common_cfg.FibPbtsForwardClass>`
            
            
            ----
            	**type**\:  int
            
            	**range:** 0..8
            
            
            ----
            .. attribute:: fallback_class_number_array
            
            	Set PBTS fallback class number array
            	**type**\:  list of int
            
            	**range:** 0..7
            
            .. attribute:: fallback_type
            
            	Set PBTS fallback type
            	**type**\:   :py:class:`FibPbtsFallback <ydk.models.cisco_ios_xr.Cisco_IOS_XR_fib_common_cfg.FibPbtsFallback>`
            
            	**mandatory**\: True
            
            

            """

            _prefix = 'fib-common-cfg'
            _revision = '2017-01-20'

            def __init__(self):
                super(Fib.PbtsForwardClassFallbacks.PbtsForwardClassFallback,
                      self).__init__()

                self.yang_name = "pbts-forward-class-fallback"
                self.yang_parent_name = "pbts-forward-class-fallbacks"

                self.forward_class_number = YLeaf(YType.str,
                                                  "forward-class-number")

                self.fallback_class_number_array = YLeafList(
                    YType.uint32, "fallback-class-number-array")

                self.fallback_type = YLeaf(YType.enumeration, "fallback-type")

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

            def has_data(self):
                for leaf in self.fallback_class_number_array.getYLeafs():
                    if (leaf.yfilter != YFilter.not_set):
                        return True
                return (self.forward_class_number.is_set
                        or self.fallback_type.is_set)

            def has_operation(self):
                for leaf in self.fallback_class_number_array.getYLeafs():
                    if (leaf.is_set):
                        return True
                return (self.yfilter != YFilter.not_set
                        or self.forward_class_number.yfilter != YFilter.not_set
                        or self.fallback_class_number_array.yfilter !=
                        YFilter.not_set
                        or self.fallback_type.yfilter != YFilter.not_set)

            def get_segment_path(self):
                path_buffer = ""
                path_buffer = "pbts-forward-class-fallback" + "[forward-class-number='" + self.forward_class_number.get(
                ) + "']" + path_buffer

                return path_buffer

            def get_entity_path(self, ancestor):
                path_buffer = ""
                if (ancestor is None):
                    path_buffer = "Cisco-IOS-XR-fib-common-cfg:fib/pbts-forward-class-fallbacks/%s" % self.get_segment_path(
                    )
                else:
                    path_buffer = _get_relative_entity_path(
                        self, ancestor, path_buffer)

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

                leaf_name_data.extend(
                    self.fallback_class_number_array.get_name_leafdata())

                entity_path = EntityPath(path_buffer, leaf_name_data)
                return entity_path

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

                return None

            def has_leaf_or_child_of_name(self, name):
                if (name == "forward-class-number"
                        or name == "fallback-class-number-array"
                        or name == "fallback-type"):
                    return True
                return False

            def set_value(self, value_path, value, name_space,
                          name_space_prefix):
                if (value_path == "forward-class-number"):
                    self.forward_class_number = value
                    self.forward_class_number.value_namespace = name_space
                    self.forward_class_number.value_namespace_prefix = name_space_prefix
                if (value_path == "fallback-class-number-array"):
                    self.fallback_class_number_array.append(value)
                if (value_path == "fallback-type"):
                    self.fallback_type = value
                    self.fallback_type.value_namespace = name_space
                    self.fallback_type.value_namespace_prefix = name_space_prefix
示例#15
0
                    def __init__(self):
                        super(PppoeEa.Nodes.Node.InterfaceIds.InterfaceId,
                              self).__init__()

                        self.yang_name = "interface-id"
                        self.yang_parent_name = "interface-ids"
                        self.is_top_level_class = False
                        self.has_list_ancestor = True
                        self.ylist_key_names = ['interface_name']
                        self._child_classes = OrderedDict([
                            ("peer-mac", ("peer_mac", PppoeEa.Nodes.Node.
                                          InterfaceIds.InterfaceId.PeerMac)),
                            ("local-mac", ("local_mac", PppoeEa.Nodes.Node.
                                           InterfaceIds.InterfaceId.LocalMac)),
                            ("srgv-mac", ("srgv_mac", PppoeEa.Nodes.Node.
                                          InterfaceIds.InterfaceId.SrgvMac))
                        ])
                        self._leafs = OrderedDict([
                            ('interface_name',
                             (YLeaf(YType.str, 'interface-name'), ['str'])),
                            ('interface', (YLeaf(YType.str,
                                                 'interface'), ['str'])),
                            ('session_id', (YLeaf(YType.uint16,
                                                  'session-id'), ['int'])),
                            ('parent_interface',
                             (YLeaf(YType.str, 'parent-interface'), ['str'])),
                            ('is_priority_set', (YLeaf(YType.boolean,
                                                       'is-priority-set'),
                                                 ['bool'])),
                            ('priority', (YLeaf(YType.uint8,
                                                'priority'), ['int'])),
                            ('is_in_sync', (YLeaf(YType.boolean,
                                                  'is-in-sync'), ['bool'])),
                            ('is_platform_created',
                             (YLeaf(YType.boolean,
                                    'is-platform-created'), ['bool'])),
                            ('vlanid', (YLeafList(YType.uint16,
                                                  'vlanid'), ['int'])),
                        ])
                        self.interface_name = None
                        self.interface = None
                        self.session_id = None
                        self.parent_interface = None
                        self.is_priority_set = None
                        self.priority = None
                        self.is_in_sync = None
                        self.is_platform_created = None
                        self.vlanid = []

                        self.peer_mac = PppoeEa.Nodes.Node.InterfaceIds.InterfaceId.PeerMac(
                        )
                        self.peer_mac.parent = self
                        self._children_name_map["peer_mac"] = "peer-mac"

                        self.local_mac = PppoeEa.Nodes.Node.InterfaceIds.InterfaceId.LocalMac(
                        )
                        self.local_mac.parent = self
                        self._children_name_map["local_mac"] = "local-mac"

                        self.srgv_mac = PppoeEa.Nodes.Node.InterfaceIds.InterfaceId.SrgvMac(
                        )
                        self.srgv_mac.parent = self
                        self._children_name_map["srgv_mac"] = "srgv-mac"
                        self._segment_path = lambda: "interface-id" + "[interface-name='" + str(
                            self.interface_name) + "']"
                        self._is_frozen = True
示例#16
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
示例#17
0
                    def __init__(self):
                        super(Ssespan.Nodes.Node.SpanMirrInfos.SpanMirrInfo,
                              self).__init__()

                        self.yang_name = "span-mirr-info"
                        self.yang_parent_name = "span-mirr-infos"
                        self.is_top_level_class = False
                        self.has_list_ancestor = True
                        self.ylist_key_names = ['intf_name']
                        self._child_classes = OrderedDict([])
                        self._leafs = OrderedDict([
                            ('intf_name', (YLeaf(YType.str,
                                                 'intf-name'), ['str'])),
                            ('src_ifh', (YLeaf(YType.uint32,
                                               'src-ifh'), ['int'])),
                            ('intf_name_xr', (YLeaf(YType.str,
                                                    'intf-name-xr'), ['str'])),
                            ('v4_acl_flag', (YLeaf(YType.uint32,
                                                   'v4-acl-flag'), ['int'])),
                            ('v6_acl_flag', (YLeaf(YType.uint32,
                                                   'v6-acl-flag'), ['int'])),
                            ('gre_acl_flag', (YLeaf(YType.uint32,
                                                    'gre-acl-flag'), ['int'])),
                            ('v4state', (YLeaf(YType.uint32,
                                               'v4state'), ['int'])),
                            ('v6state', (YLeaf(YType.uint32,
                                               'v6state'), ['int'])),
                            ('gre_state', (YLeaf(YType.uint32,
                                                 'gre-state'), ['int'])),
                            ('v4sessid', (YLeaf(YType.uint32,
                                                'v4sessid'), ['int'])),
                            ('v6sessid', (YLeaf(YType.uint32,
                                                'v6sessid'), ['int'])),
                            ('gre_sessid', (YLeaf(YType.uint32,
                                                  'gre-sessid'), ['int'])),
                            ('v4dst_type', (YLeaf(YType.uint32,
                                                  'v4dst-type'), ['int'])),
                            ('v6dst_type', (YLeaf(YType.uint32,
                                                  'v6dst-type'), ['int'])),
                            ('gredst_type', (YLeaf(YType.uint32,
                                                   'gredst-type'), ['int'])),
                            ('v4statsptr', (YLeaf(YType.uint32,
                                                  'v4statsptr'), ['int'])),
                            ('v6statsptr', (YLeaf(YType.uint32,
                                                  'v6statsptr'), ['int'])),
                            ('grev4statsptr',
                             (YLeaf(YType.uint32, 'grev4statsptr'), ['int'])),
                            ('grev6statsptr',
                             (YLeaf(YType.uint32, 'grev6statsptr'), ['int'])),
                            ('mplsv4stats', (YLeaf(YType.uint32,
                                                   'mplsv4stats'), ['int'])),
                            ('mplsv6pkts', (YLeaf(YType.uint32,
                                                  'mplsv6pkts'), ['int'])),
                            ('np_umask', (YLeaf(YType.uint32,
                                                'np-umask'), ['int'])),
                            ('uidb', (YLeafList(YType.uint32,
                                                'uidb'), ['int'])),
                            ('sft_hw_data', (YLeafList(YType.uint32,
                                                       'sft-hw-data'), ['int'
                                                                        ])),
                        ])
                        self.intf_name = None
                        self.src_ifh = None
                        self.intf_name_xr = None
                        self.v4_acl_flag = None
                        self.v6_acl_flag = None
                        self.gre_acl_flag = None
                        self.v4state = None
                        self.v6state = None
                        self.gre_state = None
                        self.v4sessid = None
                        self.v6sessid = None
                        self.gre_sessid = None
                        self.v4dst_type = None
                        self.v6dst_type = None
                        self.gredst_type = None
                        self.v4statsptr = None
                        self.v6statsptr = None
                        self.grev4statsptr = None
                        self.grev6statsptr = None
                        self.mplsv4stats = None
                        self.mplsv6pkts = None
                        self.np_umask = None
                        self.uidb = []
                        self.sft_hw_data = []
                        self._segment_path = lambda: "span-mirr-info" + "[intf-name='" + str(
                            self.intf_name) + "']"
                        self._is_frozen = True
示例#18
0
 def __init__(self):
     self.parent = None
     self.capability = YLeafList()
     self.capability.parent = self
     self.capability.name = 'capability'
示例#19
0
 def __init__(self):
     self.parent = None
     self.name = None
     self.user_name = YLeafList()
     self.user_name.parent = self
     self.user_name.name = 'user_name'
示例#20
0
 def __init__(self):
     self.parent = None
     self.precedence = YLeafList()
     self.precedence.parent = self
     self.precedence.name = 'precedence'
示例#21
0
 def __init__(self):
     self.parent = None
     self.host_name = None
     self.address = YLeafList()
     self.address.parent = self
     self.address.name = 'address'
示例#22
0
                    class SumData(Entity):
                        """
                        sum data
                        
                        .. attribute:: crc_err_count
                        
                        	crc err count
                        	**type**\:  int
                        
                        	**range:** 0..4294967295
                        
                        .. attribute:: gen_err_count
                        
                        	gen err count
                        	**type**\:  int
                        
                        	**range:** 0..4294967295
                        
                        .. attribute:: instance
                        
                        	instance
                        	**type**\:  int
                        
                        	**range:** 0..4294967295
                        
                        .. attribute:: mbe_err_count
                        
                        	mbe err count
                        	**type**\:  int
                        
                        	**range:** 0..4294967295
                        
                        .. attribute:: node_key
                        
                        	node key
                        	**type**\:  list of int
                        
                        	**range:** 0..4294967295
                        
                        .. attribute:: num_nodes
                        
                        	num nodes
                        	**type**\:  int
                        
                        	**range:** 0..4294967295
                        
                        .. attribute:: par_err_count
                        
                        	par err count
                        	**type**\:  int
                        
                        	**range:** 0..4294967295
                        
                        .. attribute:: reset_err_count
                        
                        	reset err count
                        	**type**\:  int
                        
                        	**range:** 0..4294967295
                        
                        .. attribute:: sbe_err_count
                        
                        	sbe err count
                        	**type**\:  int
                        
                        	**range:** 0..4294967295
                        
                        

                        """

                        _prefix = 'asr9k-asic-errors-oper'
                        _revision = '2015-11-09'

                        def __init__(self):
                            super(AsicErrorStats.Nodes.Node.Counts.Count.SumData, self).__init__()

                            self.yang_name = "sum-data"
                            self.yang_parent_name = "count"

                            self.crc_err_count = YLeaf(YType.uint32, "crc-err-count")

                            self.gen_err_count = YLeaf(YType.uint32, "gen-err-count")

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

                            self.mbe_err_count = YLeaf(YType.uint32, "mbe-err-count")

                            self.node_key = YLeafList(YType.uint32, "node-key")

                            self.num_nodes = YLeaf(YType.uint32, "num-nodes")

                            self.par_err_count = YLeaf(YType.uint32, "par-err-count")

                            self.reset_err_count = YLeaf(YType.uint32, "reset-err-count")

                            self.sbe_err_count = YLeaf(YType.uint32, "sbe-err-count")

                        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 ("crc_err_count",
                                            "gen_err_count",
                                            "instance",
                                            "mbe_err_count",
                                            "node_key",
                                            "num_nodes",
                                            "par_err_count",
                                            "reset_err_count",
                                            "sbe_err_count") and name in self.__dict__:
                                    if isinstance(value, YLeaf):
                                        self.__dict__[name].set(value.get())
                                    elif isinstance(value, YLeafList):
                                        super(AsicErrorStats.Nodes.Node.Counts.Count.SumData, 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(AsicErrorStats.Nodes.Node.Counts.Count.SumData, self).__setattr__(name, value)

                        def has_data(self):
                            for leaf in self.node_key.getYLeafs():
                                if (leaf.yfilter != YFilter.not_set):
                                    return True
                            return (
                                self.crc_err_count.is_set or
                                self.gen_err_count.is_set or
                                self.instance.is_set or
                                self.mbe_err_count.is_set or
                                self.num_nodes.is_set or
                                self.par_err_count.is_set or
                                self.reset_err_count.is_set or
                                self.sbe_err_count.is_set)

                        def has_operation(self):
                            for leaf in self.node_key.getYLeafs():
                                if (leaf.is_set):
                                    return True
                            return (
                                self.yfilter != YFilter.not_set or
                                self.crc_err_count.yfilter != YFilter.not_set or
                                self.gen_err_count.yfilter != YFilter.not_set or
                                self.instance.yfilter != YFilter.not_set or
                                self.mbe_err_count.yfilter != YFilter.not_set or
                                self.node_key.yfilter != YFilter.not_set or
                                self.num_nodes.yfilter != YFilter.not_set or
                                self.par_err_count.yfilter != YFilter.not_set or
                                self.reset_err_count.yfilter != YFilter.not_set or
                                self.sbe_err_count.yfilter != YFilter.not_set)

                        def get_segment_path(self):
                            path_buffer = ""
                            path_buffer = "sum-data" + 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.crc_err_count.is_set or self.crc_err_count.yfilter != YFilter.not_set):
                                leaf_name_data.append(self.crc_err_count.get_name_leafdata())
                            if (self.gen_err_count.is_set or self.gen_err_count.yfilter != YFilter.not_set):
                                leaf_name_data.append(self.gen_err_count.get_name_leafdata())
                            if (self.instance.is_set or self.instance.yfilter != YFilter.not_set):
                                leaf_name_data.append(self.instance.get_name_leafdata())
                            if (self.mbe_err_count.is_set or self.mbe_err_count.yfilter != YFilter.not_set):
                                leaf_name_data.append(self.mbe_err_count.get_name_leafdata())
                            if (self.num_nodes.is_set or self.num_nodes.yfilter != YFilter.not_set):
                                leaf_name_data.append(self.num_nodes.get_name_leafdata())
                            if (self.par_err_count.is_set or self.par_err_count.yfilter != YFilter.not_set):
                                leaf_name_data.append(self.par_err_count.get_name_leafdata())
                            if (self.reset_err_count.is_set or self.reset_err_count.yfilter != YFilter.not_set):
                                leaf_name_data.append(self.reset_err_count.get_name_leafdata())
                            if (self.sbe_err_count.is_set or self.sbe_err_count.yfilter != YFilter.not_set):
                                leaf_name_data.append(self.sbe_err_count.get_name_leafdata())

                            leaf_name_data.extend(self.node_key.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 == "crc-err-count" or name == "gen-err-count" or name == "instance" or name == "mbe-err-count" or name == "node-key" or name == "num-nodes" or name == "par-err-count" or name == "reset-err-count" or name == "sbe-err-count"):
                                return True
                            return False

                        def set_value(self, value_path, value, name_space, name_space_prefix):
                            if(value_path == "crc-err-count"):
                                self.crc_err_count = value
                                self.crc_err_count.value_namespace = name_space
                                self.crc_err_count.value_namespace_prefix = name_space_prefix
                            if(value_path == "gen-err-count"):
                                self.gen_err_count = value
                                self.gen_err_count.value_namespace = name_space
                                self.gen_err_count.value_namespace_prefix = name_space_prefix
                            if(value_path == "instance"):
                                self.instance = value
                                self.instance.value_namespace = name_space
                                self.instance.value_namespace_prefix = name_space_prefix
                            if(value_path == "mbe-err-count"):
                                self.mbe_err_count = value
                                self.mbe_err_count.value_namespace = name_space
                                self.mbe_err_count.value_namespace_prefix = name_space_prefix
                            if(value_path == "node-key"):
                                self.node_key.append(value)
                            if(value_path == "num-nodes"):
                                self.num_nodes = value
                                self.num_nodes.value_namespace = name_space
                                self.num_nodes.value_namespace_prefix = name_space_prefix
                            if(value_path == "par-err-count"):
                                self.par_err_count = value
                                self.par_err_count.value_namespace = name_space
                                self.par_err_count.value_namespace_prefix = name_space_prefix
                            if(value_path == "reset-err-count"):
                                self.reset_err_count = value
                                self.reset_err_count.value_namespace = name_space
                                self.reset_err_count.value_namespace_prefix = name_space_prefix
                            if(value_path == "sbe-err-count"):
                                self.sbe_err_count = value
                                self.sbe_err_count.value_namespace = name_space
                                self.sbe_err_count.value_namespace_prefix = name_space_prefix
示例#23
0
        def __init__(self):
            super(NatData.IpNatStatistics, self).__init__()

            self.yang_name = "ip-nat-statistics"
            self.yang_parent_name = "nat-data"
            self.is_top_level_class = False
            self.has_list_ancestor = False
            self.ylist_key_names = []
            self._child_classes = OrderedDict([])
            self.is_presence_container = True
            self._leafs = OrderedDict([
                ('initialized', YLeaf(YType.boolean, 'initialized')),
                ('entries', YLeaf(YType.uint64, 'entries')),
                ('statics', YLeaf(YType.uint64, 'statics')),
                ('statics_sorted', YLeafList(YType.uint64, 'statics-sorted')),
                ('flows', YLeaf(YType.uint64, 'flows')),
                ('insides', YLeaf(YType.uint64, 'insides')),
                ('outsides', YLeaf(YType.uint64, 'outsides')),
                ('entry_timeouts', YLeaf(YType.uint64, 'entry-timeouts')),
                ('hits', YLeaf(YType.uint64, 'hits')),
                ('misses', YLeaf(YType.uint64, 'misses')),
                ('interrupt_switched', YLeaf(YType.uint64,
                                             'interrupt-switched')),
                ('packets_punted', YLeaf(YType.uint64, 'packets-punted')),
                ('frag_pak_count', YLeaf(YType.uint64, 'frag-pak-count')),
                ('pool_stats_drop', YLeaf(YType.uint64, 'pool-stats-drop')),
                ('mapping_stats_drop', YLeaf(YType.uint64,
                                             'mapping-stats-drop')),
                ('portlist_req_fail', YLeaf(YType.uint64,
                                            'portlist-req-fail')),
                ('ipalias_add_fail', YLeaf(YType.uint64, 'ipalias-add-fail')),
                ('limit_entry_add_fail',
                 YLeaf(YType.uint64, 'limit-entry-add-fail')),
                ('in2out_drops', YLeaf(YType.uint64, 'in2out-drops')),
                ('out2in_drops', YLeaf(YType.uint64, 'out2in-drops')),
                ('mib_addr_binds', YLeaf(YType.uint32, 'mib-addr-binds')),
                ('mib_addport_binds', YLeaf(YType.uint32,
                                            'mib-addport-binds')),
            ])
            self.initialized = None
            self.entries = None
            self.statics = None
            self.statics_sorted = []
            self.flows = None
            self.insides = None
            self.outsides = None
            self.entry_timeouts = None
            self.hits = None
            self.misses = None
            self.interrupt_switched = None
            self.packets_punted = None
            self.frag_pak_count = None
            self.pool_stats_drop = None
            self.mapping_stats_drop = None
            self.portlist_req_fail = None
            self.ipalias_add_fail = None
            self.limit_entry_add_fail = None
            self.in2out_drops = None
            self.out2in_drops = None
            self.mib_addr_binds = None
            self.mib_addport_binds = None
            self._segment_path = lambda: "ip-nat-statistics"
            self._absolute_path = lambda: "Cisco-IOS-XE-nat-oper:nat-data/%s" % self._segment_path(
            )
    class Capabilities(Entity):
        """
        Contains a list of protocol capability URIs
        
        .. attribute:: capability
        
        	A RESTCONF protocol capability URI
        	**type**\:  list of str
        
        

        """

        _prefix = 'rcmon'
        _revision = '2016-08-15'

        def __init__(self):
            super(RestconfState.Capabilities, self).__init__()

            self.yang_name = "capabilities"
            self.yang_parent_name = "restconf-state"

            self.capability = YLeafList(YType.str, "capability")

        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 ("capability") and name in self.__dict__:
                    if isinstance(value, YLeaf):
                        self.__dict__[name].set(value.get())
                    elif isinstance(value, YLeafList):
                        super(RestconfState.Capabilities,
                              self).__setattr__(name, value)
                    else:
                        self.__dict__[name].set(value)
                else:
                    if hasattr(value, "parent") and name != "parent":
                        if hasattr(value, "is_presence_container"
                                   ) and value.is_presence_container:
                            value.parent = self
                        elif value.parent is None and value.yang_name in self._children_yang_names:
                            value.parent = self
                    super(RestconfState.Capabilities,
                          self).__setattr__(name, value)

        def has_data(self):
            for leaf in self.capability.getYLeafs():
                if (leaf.yfilter != YFilter.not_set):
                    return True
            return False

        def has_operation(self):
            for leaf in self.capability.getYLeafs():
                if (leaf.is_set):
                    return True
            return (self.yfilter != YFilter.not_set
                    or self.capability.yfilter != YFilter.not_set)

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

            return path_buffer

        def get_entity_path(self, ancestor):
            path_buffer = ""
            if (ancestor is None):
                path_buffer = "ietf-restconf-monitoring:restconf-state/%s" % self.get_segment_path(
                )
            else:
                path_buffer = _get_relative_entity_path(
                    self, ancestor, path_buffer)

            leaf_name_data = LeafDataList()

            leaf_name_data.extend(self.capability.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 == "capability"):
                return True
            return False

        def set_value(self, value_path, value, name_space, name_space_prefix):
            if (value_path == "capability"):
                self.capability.append(value)
示例#25
0
                    def __init__(self):
                        super(Ssespan.Nodes.Node.SpanSessInfos.SpanSessInfo,
                              self).__init__()

                        self.yang_name = "span-sess-info"
                        self.yang_parent_name = "span-sess-infos"
                        self.is_top_level_class = False
                        self.has_list_ancestor = True
                        self.ylist_key_names = ['session_id', 'session_class']
                        self._child_classes = OrderedDict([])
                        self._leafs = OrderedDict([
                            ('session_id', (YLeaf(YType.uint32,
                                                  'session-id'), ['int'])),
                            ('session_class',
                             (YLeaf(YType.uint32, 'session-class'), ['int'])),
                            ('valid', (YLeaf(YType.uint8, 'valid'), ['int'])),
                            ('id', (YLeaf(YType.uint32, 'id'), ['int'])),
                            ('state', (YLeaf(YType.uint32, 'state'), ['int'])),
                            ('class_', (YLeaf(YType.uint32,
                                              'class'), ['int'])),
                            ('ifhandle', (YLeaf(YType.uint32,
                                                'ifhandle'), ['int'])),
                            ('mode', (YLeaf(YType.uint32, 'mode'), ['int'])),
                            ('ip_type', (YLeaf(YType.uint32,
                                               'ip-type'), ['int'])),
                            ('vrf_id', (YLeaf(YType.uint32,
                                              'vrf-id'), ['int'])),
                            ('tos_bit', (YLeaf(YType.uint32,
                                               'tos-bit'), ['int'])),
                            ('tos_bit_copied',
                             (YLeaf(YType.uint32, 'tos-bit-copied'), ['int'])),
                            ('ttl', (YLeaf(YType.uint32, 'ttl'), ['int'])),
                            ('dfbit', (YLeaf(YType.uint32, 'dfbit'), ['int'])),
                            ('src_ip', (YLeafList(YType.uint32,
                                                  'src-ip'), ['int'])),
                            ('dst_ip', (YLeafList(YType.uint32,
                                                  'dst-ip'), ['int'])),
                            ('sdt_hw_data', (YLeafList(YType.uint32,
                                                       'sdt-hw-data'), ['int'
                                                                        ])),
                        ])
                        self.session_id = None
                        self.session_class = None
                        self.valid = None
                        self.id = None
                        self.state = None
                        self.class_ = None
                        self.ifhandle = None
                        self.mode = None
                        self.ip_type = None
                        self.vrf_id = None
                        self.tos_bit = None
                        self.tos_bit_copied = None
                        self.ttl = None
                        self.dfbit = None
                        self.src_ip = []
                        self.dst_ip = []
                        self.sdt_hw_data = []
                        self._segment_path = lambda: "span-sess-info" + "[session-id='" + str(
                            self.session_id) + "']" + "[session-class='" + str(
                                self.session_class) + "']"
                        self._is_frozen = True
 def __init__(self):
     self.parent = None
     self.host_alias = YLeafList()
     self.host_alias.parent = self
     self.host_alias.name = 'host_alias'
示例#27
0
    class Module(Entity):
        """
        Each entry represents one revision of one module
        currently supported by the server.
        
        .. attribute:: name  <key>
        
        	The YANG module or submodule name
        	**type**\:  str
        
        	**pattern:** [a\-zA\-Z\_][a\-zA\-Z0\-9\\\-\_.]\*
        
        .. attribute:: revision  <key>
        
        	The YANG module or submodule revision date. A zero\-length string is used if no revision statement is present in the YANG module or submodule
        	**type**\: one of the below types:
        
        	**type**\:  str
        
        	**pattern:** \\d{4}\-\\d{2}\-\\d{2}
        
        
        ----
        	**type**\:  str
        
        	**length:** 0
        
        
        ----
        .. attribute:: conformance_type
        
        	Indicates the type of conformance the server is claiming for the YANG module identified by this entry
        	**type**\:   :py:class:`ConformanceType <ydk.models.ietf.ietf_yang_library.ModulesState.Module.ConformanceType>`
        
        	**mandatory**\: True
        
        .. attribute:: deviation
        
        	List of YANG deviation module names and revisions used by this server to modify the conformance of the module associated with this entry.  Note that the same module can be used for deviations for multiple modules, so the same entry MAY appear within multiple 'module' entries.  The deviation module MUST be present in the 'module' list, with the same name and revision values. The 'conformance\-type' value will be 'implement' for the deviation module
        	**type**\: list of    :py:class:`Deviation <ydk.models.ietf.ietf_yang_library.ModulesState.Module.Deviation>`
        
        .. attribute:: feature
        
        	List of YANG feature names from this module that are supported by the server, regardless of whether they are defined in the module or any included submodule
        	**type**\:  list of str
        
        	**pattern:** [a\-zA\-Z\_][a\-zA\-Z0\-9\\\-\_.]\*
        
        .. attribute:: namespace
        
        	The XML namespace identifier for this module
        	**type**\:  str
        
        	**mandatory**\: True
        
        .. attribute:: schema
        
        	Contains a URL that represents the YANG schema resource for this module or submodule.  This leaf will only be present if there is a URL available for retrieval of the schema for this entry
        	**type**\:  str
        
        .. attribute:: submodule
        
        	Each entry represents one submodule within the parent module
        	**type**\: list of    :py:class:`Submodule <ydk.models.ietf.ietf_yang_library.ModulesState.Module.Submodule>`
        
        

        """

        _prefix = 'yanglib'
        _revision = '2016-06-21'

        def __init__(self):
            super(ModulesState.Module, self).__init__()

            self.yang_name = "module"
            self.yang_parent_name = "modules-state"

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

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

            self.conformance_type = YLeaf(YType.enumeration,
                                          "conformance-type")

            self.feature = YLeafList(YType.str, "feature")

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

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

            self.deviation = YList(self)
            self.submodule = YList(self)

        def __setattr__(self, name, value):
            self._check_monkey_patching_error(name, value)
            with _handle_type_error():
                if name in self.__dict__ and isinstance(
                        self.__dict__[name], YList):
                    raise YPYModelError(
                        "Attempt to assign value of '{}' to YList ldata. "
                        "Please use list append or extend method.".format(
                            value))
                if isinstance(value, Enum.YLeaf):
                    value = value.name
                if name in ("name", "revision", "conformance_type", "feature",
                            "namespace", "schema") and name in self.__dict__:
                    if isinstance(value, YLeaf):
                        self.__dict__[name].set(value.get())
                    elif isinstance(value, YLeafList):
                        super(ModulesState.Module,
                              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(ModulesState.Module, self).__setattr__(name, value)

        class ConformanceType(Enum):
            """
            ConformanceType

            Indicates the type of conformance the server is claiming

            for the YANG module identified by this entry.

            .. data:: implement = 0

            	Indicates that the server implements one or more

            	protocol-accessible objects defined in the YANG module

            	identified in this entry.  This includes deviation

            	statements defined in the module.

            	For YANG version 1.1 modules, there is at most one

            	module entry with conformance type 'implement' for a

            	particular module name, since YANG 1.1 requires that,

            	at most, one revision of a module is implemented.

            	For YANG version 1 modules, there SHOULD NOT be more

            	than one module entry for a particular module name.

            .. data:: import_ = 1

            	Indicates that the server imports reusable definitions

            	from the specified revision of the module but does

            	not implement any protocol-accessible objects from

            	this revision.

            	Multiple module entries for the same module name MAY

            	exist.  This can occur if multiple modules import the

            	same module but specify different revision dates in

            	the import statements.

            """

            implement = Enum.YLeaf(0, "implement")

            import_ = Enum.YLeaf(1, "import")

        class Deviation(Entity):
            """
            List of YANG deviation module names and revisions
            used by this server to modify the conformance of
            the module associated with this entry.  Note that
            the same module can be used for deviations for
            multiple modules, so the same entry MAY appear
            within multiple 'module' entries.
            
            The deviation module MUST be present in the 'module'
            list, with the same name and revision values.
            The 'conformance\-type' value will be 'implement' for
            the deviation module.
            
            .. attribute:: name  <key>
            
            	The YANG module or submodule name
            	**type**\:  str
            
            	**pattern:** [a\-zA\-Z\_][a\-zA\-Z0\-9\\\-\_.]\*
            
            .. attribute:: revision  <key>
            
            	The YANG module or submodule revision date. A zero\-length string is used if no revision statement is present in the YANG module or submodule
            	**type**\: one of the below types:
            
            	**type**\:  str
            
            	**pattern:** \\d{4}\-\\d{2}\-\\d{2}
            
            
            ----
            	**type**\:  str
            
            	**length:** 0
            
            
            ----
            

            """

            _prefix = 'yanglib'
            _revision = '2016-06-21'

            def __init__(self):
                super(ModulesState.Module.Deviation, self).__init__()

                self.yang_name = "deviation"
                self.yang_parent_name = "module"

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

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

            def __setattr__(self, name, value):
                self._check_monkey_patching_error(name, value)
                with _handle_type_error():
                    if name in self.__dict__ and isinstance(
                            self.__dict__[name], YList):
                        raise YPYModelError(
                            "Attempt to assign value of '{}' to YList ldata. "
                            "Please use list append or extend method.".format(
                                value))
                    if isinstance(value, Enum.YLeaf):
                        value = value.name
                    if name in ("name", "revision") and name in self.__dict__:
                        if isinstance(value, YLeaf):
                            self.__dict__[name].set(value.get())
                        elif isinstance(value, YLeafList):
                            super(ModulesState.Module.Deviation,
                                  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(ModulesState.Module.Deviation,
                              self).__setattr__(name, value)

            def has_data(self):
                return (self.name.is_set or self.revision.is_set)

            def has_operation(self):
                return (self.yfilter != YFilter.not_set
                        or self.name.yfilter != YFilter.not_set
                        or self.revision.yfilter != YFilter.not_set)

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

                return path_buffer

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

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

                entity_path = EntityPath(path_buffer, leaf_name_data)
                return entity_path

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

                return None

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

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

        class Submodule(Entity):
            """
            Each entry represents one submodule within the
            parent module.
            
            .. attribute:: name  <key>
            
            	The YANG module or submodule name
            	**type**\:  str
            
            	**pattern:** [a\-zA\-Z\_][a\-zA\-Z0\-9\\\-\_.]\*
            
            .. attribute:: revision  <key>
            
            	The YANG module or submodule revision date. A zero\-length string is used if no revision statement is present in the YANG module or submodule
            	**type**\: one of the below types:
            
            	**type**\:  str
            
            	**pattern:** \\d{4}\-\\d{2}\-\\d{2}
            
            
            ----
            	**type**\:  str
            
            	**length:** 0
            
            
            ----
            .. attribute:: schema
            
            	Contains a URL that represents the YANG schema resource for this module or submodule.  This leaf will only be present if there is a URL available for retrieval of the schema for this entry
            	**type**\:  str
            
            

            """

            _prefix = 'yanglib'
            _revision = '2016-06-21'

            def __init__(self):
                super(ModulesState.Module.Submodule, self).__init__()

                self.yang_name = "submodule"
                self.yang_parent_name = "module"

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

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

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

            def __setattr__(self, name, value):
                self._check_monkey_patching_error(name, value)
                with _handle_type_error():
                    if name in self.__dict__ and isinstance(
                            self.__dict__[name], YList):
                        raise YPYModelError(
                            "Attempt to assign value of '{}' to YList ldata. "
                            "Please use list append or extend method.".format(
                                value))
                    if isinstance(value, Enum.YLeaf):
                        value = value.name
                    if name in ("name", "revision",
                                "schema") and name in self.__dict__:
                        if isinstance(value, YLeaf):
                            self.__dict__[name].set(value.get())
                        elif isinstance(value, YLeafList):
                            super(ModulesState.Module.Submodule,
                                  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(ModulesState.Module.Submodule,
                              self).__setattr__(name, value)

            def has_data(self):
                return (self.name.is_set or self.revision.is_set
                        or self.schema.is_set)

            def has_operation(self):
                return (self.yfilter != YFilter.not_set
                        or self.name.yfilter != YFilter.not_set
                        or self.revision.yfilter != YFilter.not_set
                        or self.schema.yfilter != YFilter.not_set)

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

                return path_buffer

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

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

                entity_path = EntityPath(path_buffer, leaf_name_data)
                return entity_path

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

                return None

            def has_leaf_or_child_of_name(self, name):
                if (name == "name" or name == "revision" or name == "schema"):
                    return True
                return False

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

        def has_data(self):
            for c in self.deviation:
                if (c.has_data()):
                    return True
            for c in self.submodule:
                if (c.has_data()):
                    return True
            for leaf in self.feature.getYLeafs():
                if (leaf.yfilter != YFilter.not_set):
                    return True
            return (self.name.is_set or self.revision.is_set
                    or self.conformance_type.is_set or self.namespace.is_set
                    or self.schema.is_set)

        def has_operation(self):
            for c in self.deviation:
                if (c.has_operation()):
                    return True
            for c in self.submodule:
                if (c.has_operation()):
                    return True
            for leaf in self.feature.getYLeafs():
                if (leaf.is_set):
                    return True
            return (self.yfilter != YFilter.not_set
                    or self.name.yfilter != YFilter.not_set
                    or self.revision.yfilter != YFilter.not_set
                    or self.conformance_type.yfilter != YFilter.not_set
                    or self.feature.yfilter != YFilter.not_set
                    or self.namespace.yfilter != YFilter.not_set
                    or self.schema.yfilter != YFilter.not_set)

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

            return path_buffer

        def get_entity_path(self, ancestor):
            path_buffer = ""
            if (ancestor is None):
                path_buffer = "ietf-yang-library:modules-state/%s" % self.get_segment_path(
                )
            else:
                path_buffer = _get_relative_entity_path(
                    self, ancestor, path_buffer)

            leaf_name_data = LeafDataList()
            if (self.name.is_set or self.name.yfilter != YFilter.not_set):
                leaf_name_data.append(self.name.get_name_leafdata())
            if (self.revision.is_set
                    or self.revision.yfilter != YFilter.not_set):
                leaf_name_data.append(self.revision.get_name_leafdata())
            if (self.conformance_type.is_set
                    or self.conformance_type.yfilter != YFilter.not_set):
                leaf_name_data.append(
                    self.conformance_type.get_name_leafdata())
            if (self.namespace.is_set
                    or self.namespace.yfilter != YFilter.not_set):
                leaf_name_data.append(self.namespace.get_name_leafdata())
            if (self.schema.is_set or self.schema.yfilter != YFilter.not_set):
                leaf_name_data.append(self.schema.get_name_leafdata())

            leaf_name_data.extend(self.feature.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 == "deviation"):
                for c in self.deviation:
                    segment = c.get_segment_path()
                    if (segment_path == segment):
                        return c
                c = ModulesState.Module.Deviation()
                c.parent = self
                local_reference_key = "ydk::seg::%s" % segment_path
                self._local_refs[local_reference_key] = c
                self.deviation.append(c)
                return c

            if (child_yang_name == "submodule"):
                for c in self.submodule:
                    segment = c.get_segment_path()
                    if (segment_path == segment):
                        return c
                c = ModulesState.Module.Submodule()
                c.parent = self
                local_reference_key = "ydk::seg::%s" % segment_path
                self._local_refs[local_reference_key] = c
                self.submodule.append(c)
                return c

            return None

        def has_leaf_or_child_of_name(self, name):
            if (name == "deviation" or name == "submodule" or name == "name"
                    or name == "revision" or name == "conformance-type"
                    or name == "feature" or name == "namespace"
                    or name == "schema"):
                return True
            return False

        def set_value(self, value_path, value, name_space, name_space_prefix):
            if (value_path == "name"):
                self.name = value
                self.name.value_namespace = name_space
                self.name.value_namespace_prefix = name_space_prefix
            if (value_path == "revision"):
                self.revision = value
                self.revision.value_namespace = name_space
                self.revision.value_namespace_prefix = name_space_prefix
            if (value_path == "conformance-type"):
                self.conformance_type = value
                self.conformance_type.value_namespace = name_space
                self.conformance_type.value_namespace_prefix = name_space_prefix
            if (value_path == "feature"):
                self.feature.append(value)
            if (value_path == "namespace"):
                self.namespace = value
                self.namespace.value_namespace = name_space
                self.namespace.value_namespace_prefix = name_space_prefix
            if (value_path == "schema"):
                self.schema = value
                self.schema.value_namespace = name_space
                self.schema.value_namespace_prefix = name_space_prefix