Пример #1
0
def property(f):
  _self = object()
  _temp = object()
  _name = f.__name__
  def property_getter(self):
    try:
      dictvalue = self.__dict__[_name]
    except KeyError:
      self.__dict__[_name] = _temp # placeholder for detection of cyclic dependencies
      value = f(self)
      self.__dict__[_name] = value if value is not self else _self
    else:
      assert dictvalue is not _temp, 'attribute {!r} requested during construction'.format(_name)
      value = dictvalue if dictvalue is not _self else self
    return value
  def property_setter(self, value):
    assert _name not in self.__dict__, 'attempting to set attribute {!r} twice'.format(_name)
    self.__dict__[_name] = value if value is not self else _self
  return builtins.property(fget=property_getter, fset=property_setter)
Пример #2
0
class state(PybindBase):
    """
  This class was auto-generated by the PythonClass plugin for PYANG
  from YANG module openconfig-interfaces - based on the path /interfaces/interface/routed-vlan/ipv6/unnumbered/state. Each member element of
  the container is represented as a class variable - with a specific
  YANG type.

  YANG Description: Operational state data for unnumbered interfaces
  """
    __slots__ = (
        '_path_helper',
        '_extmethods',
        '__enabled',
    )

    _yang_name = 'state'
    _yang_namespace = 'http://openconfig.net/yang/interfaces'

    _pybind_generated_by = 'container'

    def __init__(self, *args, **kwargs):

        self._path_helper = False

        self._extmethods = False
        self.__enabled = YANGDynClass(
            base=YANGBool,
            default=YANGBool("false"),
            is_leaf=True,
            yang_name="enabled",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace='http://openconfig.net/yang/interfaces/ip',
            defining_module='openconfig-if-ip',
            yang_type='boolean',
            is_config=False)

        load = kwargs.pop("load", None)
        if args:
            if len(args) > 1:
                raise TypeError(
                    "cannot create a YANG container with >1 argument")
            all_attr = True
            for e in self._pyangbind_elements:
                if not hasattr(args[0], e):
                    all_attr = False
                    break
            if not all_attr:
                raise ValueError(
                    "Supplied object did not have the correct attributes")
            for e in self._pyangbind_elements:
                nobj = getattr(args[0], e)
                if nobj._changed() is False:
                    continue
                setmethod = getattr(self, "_set_%s" % e)
                if load is None:
                    setmethod(getattr(args[0], e))
                else:
                    setmethod(getattr(args[0], e), load=load)

    def _path(self):
        if hasattr(self, "_parent"):
            return self._parent._path() + [self._yang_name]
        else:
            return [
                'interfaces', 'interface', 'routed-vlan', 'ipv6', 'unnumbered',
                'state'
            ]

    def _get_enabled(self):
        """
    Getter method for enabled, mapped from YANG variable /interfaces/interface/routed_vlan/ipv6/unnumbered/state/enabled (boolean)

    YANG Description: Indicates that the subinterface is unnumbered.  By default
the subinterface is numbered, i.e., expected to have an
IP address configuration.
    """
        return self.__enabled

    def _set_enabled(self, v, load=False):
        """
    Setter method for enabled, mapped from YANG variable /interfaces/interface/routed_vlan/ipv6/unnumbered/state/enabled (boolean)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_enabled is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_enabled() directly.

    YANG Description: Indicates that the subinterface is unnumbered.  By default
the subinterface is numbered, i.e., expected to have an
IP address configuration.
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(
                v,
                base=YANGBool,
                default=YANGBool("false"),
                is_leaf=True,
                yang_name="enabled",
                parent=self,
                path_helper=self._path_helper,
                extmethods=self._extmethods,
                register_paths=True,
                namespace='http://openconfig.net/yang/interfaces/ip',
                defining_module='openconfig-if-ip',
                yang_type='boolean',
                is_config=False)
        except (TypeError, ValueError):
            raise ValueError({
                'error-string':
                """enabled must be of a type compatible with boolean""",
                'defined-type':
                "boolean",
                'generated-type':
                """YANGDynClass(base=YANGBool, default=YANGBool("false"), is_leaf=True, yang_name="enabled", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces/ip', defining_module='openconfig-if-ip', yang_type='boolean', is_config=False)""",
            })

        self.__enabled = t
        if hasattr(self, '_set'):
            self._set()

    def _unset_enabled(self):
        self.__enabled = YANGDynClass(
            base=YANGBool,
            default=YANGBool("false"),
            is_leaf=True,
            yang_name="enabled",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace='http://openconfig.net/yang/interfaces/ip',
            defining_module='openconfig-if-ip',
            yang_type='boolean',
            is_config=False)

    enabled = __builtin__.property(_get_enabled)

    _pyangbind_elements = OrderedDict([
        ('enabled', enabled),
    ])
Пример #3
0
class config(PybindBase):
    """
  This class was auto-generated by the PythonClass plugin for PYANG
  from YANG module openconfig-network-instance-l2 - based on the path /network-instances/network-instance/mpls/signaling-protocols/segment-routing/interfaces/interface/interface-ref/config. Each member element of
  the container is represented as a class variable - with a specific
  YANG type.

  YANG Description: Configured reference to interface / subinterface
  """
    __slots__ = ("_path_helper", "_extmethods", "__interface",
                 "__subinterface")

    _yang_name = "config"

    _pybind_generated_by = "container"

    def __init__(self, *args, **kwargs):

        self._path_helper = False

        self._extmethods = False
        self.__interface = YANGDynClass(
            base=six.text_type,
            is_leaf=True,
            yang_name="interface",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="leafref",
            is_config=True,
        )
        self.__subinterface = YANGDynClass(
            base=six.text_type,
            is_leaf=True,
            yang_name="subinterface",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="leafref",
            is_config=True,
        )

        load = kwargs.pop("load", None)
        if args:
            if len(args) > 1:
                raise TypeError(
                    "cannot create a YANG container with >1 argument")
            all_attr = True
            for e in self._pyangbind_elements:
                if not hasattr(args[0], e):
                    all_attr = False
                    break
            if not all_attr:
                raise ValueError(
                    "Supplied object did not have the correct attributes")
            for e in self._pyangbind_elements:
                nobj = getattr(args[0], e)
                if nobj._changed() is False:
                    continue
                setmethod = getattr(self, "_set_%s" % e)
                if load is None:
                    setmethod(getattr(args[0], e))
                else:
                    setmethod(getattr(args[0], e), load=load)

    def _path(self):
        if hasattr(self, "_parent"):
            return self._parent._path() + [self._yang_name]
        else:
            return [
                "network-instances",
                "network-instance",
                "mpls",
                "signaling-protocols",
                "segment-routing",
                "interfaces",
                "interface",
                "interface-ref",
                "config",
            ]

    def _get_interface(self):
        """
    Getter method for interface, mapped from YANG variable /network_instances/network_instance/mpls/signaling_protocols/segment_routing/interfaces/interface/interface_ref/config/interface (leafref)

    YANG Description: Reference to a base interface.  If a reference to a
subinterface is required, this leaf must be specified
to indicate the base interface.
    """
        return self.__interface

    def _set_interface(self, v, load=False):
        """
    Setter method for interface, mapped from YANG variable /network_instances/network_instance/mpls/signaling_protocols/segment_routing/interfaces/interface/interface_ref/config/interface (leafref)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_interface is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_interface() directly.

    YANG Description: Reference to a base interface.  If a reference to a
subinterface is required, this leaf must be specified
to indicate the base interface.
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(
                v,
                base=six.text_type,
                is_leaf=True,
                yang_name="interface",
                parent=self,
                path_helper=self._path_helper,
                extmethods=self._extmethods,
                register_paths=True,
                namespace="http://openconfig.net/yang/network-instance",
                defining_module="openconfig-network-instance",
                yang_type="leafref",
                is_config=True,
            )
        except (TypeError, ValueError):
            raise ValueError({
                "error-string":
                """interface must be of a type compatible with leafref""",
                "defined-type":
                "leafref",
                "generated-type":
                """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="interface", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='leafref', is_config=True)""",
            })

        self.__interface = t
        if hasattr(self, "_set"):
            self._set()

    def _unset_interface(self):
        self.__interface = YANGDynClass(
            base=six.text_type,
            is_leaf=True,
            yang_name="interface",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="leafref",
            is_config=True,
        )

    def _get_subinterface(self):
        """
    Getter method for subinterface, mapped from YANG variable /network_instances/network_instance/mpls/signaling_protocols/segment_routing/interfaces/interface/interface_ref/config/subinterface (leafref)

    YANG Description: Reference to a subinterface -- this requires the base
interface to be specified using the interface leaf in
this container.  If only a reference to a base interface
is requuired, this leaf should not be set.
    """
        return self.__subinterface

    def _set_subinterface(self, v, load=False):
        """
    Setter method for subinterface, mapped from YANG variable /network_instances/network_instance/mpls/signaling_protocols/segment_routing/interfaces/interface/interface_ref/config/subinterface (leafref)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_subinterface is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_subinterface() directly.

    YANG Description: Reference to a subinterface -- this requires the base
interface to be specified using the interface leaf in
this container.  If only a reference to a base interface
is requuired, this leaf should not be set.
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(
                v,
                base=six.text_type,
                is_leaf=True,
                yang_name="subinterface",
                parent=self,
                path_helper=self._path_helper,
                extmethods=self._extmethods,
                register_paths=True,
                namespace="http://openconfig.net/yang/network-instance",
                defining_module="openconfig-network-instance",
                yang_type="leafref",
                is_config=True,
            )
        except (TypeError, ValueError):
            raise ValueError({
                "error-string":
                """subinterface must be of a type compatible with leafref""",
                "defined-type":
                "leafref",
                "generated-type":
                """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="subinterface", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='leafref', is_config=True)""",
            })

        self.__subinterface = t
        if hasattr(self, "_set"):
            self._set()

    def _unset_subinterface(self):
        self.__subinterface = YANGDynClass(
            base=six.text_type,
            is_leaf=True,
            yang_name="subinterface",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="leafref",
            is_config=True,
        )

    interface = __builtin__.property(_get_interface, _set_interface)
    subinterface = __builtin__.property(_get_subinterface, _set_subinterface)

    _pyangbind_elements = OrderedDict([("interface", interface),
                                       ("subinterface", subinterface)])
Пример #4
0
class next_hop(PybindBase):
    """
  This class was auto-generated by the PythonClass plugin for PYANG
  from YANG module openconfig-network-instance-l2 - based on the path /network-instances/network-instance/afts/aft/entries/entry/next-hops/next-hop. Each member element of
  the container is represented as a class variable - with a specific
  YANG type.

  YANG Description: A next-hop associated with the forwarding instance. The
entries within the next-hop list should only reflect
next-hops that are actively used by the local system.
That is to say inactive, backup or FRR next-hops should
not be included within this list.
  """
    __slots__ = (
        "_path_helper",
        "_extmethods",
        "__index",
        "__config",
        "__state",
        "__interface_ref",
    )

    _yang_name = "next-hop"

    _pybind_generated_by = "container"

    def __init__(self, *args, **kwargs):

        self._path_helper = False

        self._extmethods = False
        self.__index = YANGDynClass(
            base=six.text_type,
            is_leaf=True,
            yang_name="index",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            is_keyval=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="leafref",
            is_config=True,
        )
        self.__config = YANGDynClass(
            base=config.config,
            is_container="container",
            yang_name="config",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            extensions=None,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="container",
            is_config=True,
        )
        self.__state = YANGDynClass(
            base=state.state,
            is_container="container",
            yang_name="state",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            extensions=None,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="container",
            is_config=True,
        )
        self.__interface_ref = YANGDynClass(
            base=interface_ref.interface_ref,
            is_container="container",
            yang_name="interface-ref",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            extensions=None,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="container",
            is_config=True,
        )

        load = kwargs.pop("load", None)
        if args:
            if len(args) > 1:
                raise TypeError(
                    "cannot create a YANG container with >1 argument")
            all_attr = True
            for e in self._pyangbind_elements:
                if not hasattr(args[0], e):
                    all_attr = False
                    break
            if not all_attr:
                raise ValueError(
                    "Supplied object did not have the correct attributes")
            for e in self._pyangbind_elements:
                nobj = getattr(args[0], e)
                if nobj._changed() is False:
                    continue
                setmethod = getattr(self, "_set_%s" % e)
                if load is None:
                    setmethod(getattr(args[0], e))
                else:
                    setmethod(getattr(args[0], e), load=load)

    def _path(self):
        if hasattr(self, "_parent"):
            return self._parent._path() + [self._yang_name]
        else:
            return [
                "network-instances",
                "network-instance",
                "afts",
                "aft",
                "entries",
                "entry",
                "next-hops",
                "next-hop",
            ]

    def _get_index(self):
        """
    Getter method for index, mapped from YANG variable /network_instances/network_instance/afts/aft/entries/entry/next_hops/next_hop/index (leafref)

    YANG Description: A unique index identifying the next-hop entry for the
AFT entry
    """
        return self.__index

    def _set_index(self, v, load=False):
        """
    Setter method for index, mapped from YANG variable /network_instances/network_instance/afts/aft/entries/entry/next_hops/next_hop/index (leafref)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_index is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_index() directly.

    YANG Description: A unique index identifying the next-hop entry for the
AFT entry
    """
        parent = getattr(self, "_parent", None)
        if parent is not None and load is False:
            raise AttributeError("Cannot set keys directly when" +
                                 " within an instantiated list")

        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(
                v,
                base=six.text_type,
                is_leaf=True,
                yang_name="index",
                parent=self,
                path_helper=self._path_helper,
                extmethods=self._extmethods,
                register_paths=True,
                is_keyval=True,
                namespace="http://openconfig.net/yang/network-instance",
                defining_module="openconfig-network-instance",
                yang_type="leafref",
                is_config=True,
            )
        except (TypeError, ValueError):
            raise ValueError({
                "error-string":
                """index must be of a type compatible with leafref""",
                "defined-type":
                "leafref",
                "generated-type":
                """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='leafref', is_config=True)""",
            })

        self.__index = t
        if hasattr(self, "_set"):
            self._set()

    def _unset_index(self):
        self.__index = YANGDynClass(
            base=six.text_type,
            is_leaf=True,
            yang_name="index",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            is_keyval=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="leafref",
            is_config=True,
        )

    def _get_config(self):
        """
    Getter method for config, mapped from YANG variable /network_instances/network_instance/afts/aft/entries/entry/next_hops/next_hop/config (container)

    YANG Description: Configuration parameters relating to the AFT next-hop
entry
    """
        return self.__config

    def _set_config(self, v, load=False):
        """
    Setter method for config, mapped from YANG variable /network_instances/network_instance/afts/aft/entries/entry/next_hops/next_hop/config (container)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_config is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_config() directly.

    YANG Description: Configuration parameters relating to the AFT next-hop
entry
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(
                v,
                base=config.config,
                is_container="container",
                yang_name="config",
                parent=self,
                path_helper=self._path_helper,
                extmethods=self._extmethods,
                register_paths=True,
                extensions=None,
                namespace="http://openconfig.net/yang/network-instance",
                defining_module="openconfig-network-instance",
                yang_type="container",
                is_config=True,
            )
        except (TypeError, ValueError):
            raise ValueError({
                "error-string":
                """config must be of a type compatible with container""",
                "defined-type":
                "container",
                "generated-type":
                """YANGDynClass(base=config.config, is_container='container', yang_name="config", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='container', is_config=True)""",
            })

        self.__config = t
        if hasattr(self, "_set"):
            self._set()

    def _unset_config(self):
        self.__config = YANGDynClass(
            base=config.config,
            is_container="container",
            yang_name="config",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            extensions=None,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="container",
            is_config=True,
        )

    def _get_state(self):
        """
    Getter method for state, mapped from YANG variable /network_instances/network_instance/afts/aft/entries/entry/next_hops/next_hop/state (container)

    YANG Description: Operational state parameters relating to the AFT
next-hop entry
    """
        return self.__state

    def _set_state(self, v, load=False):
        """
    Setter method for state, mapped from YANG variable /network_instances/network_instance/afts/aft/entries/entry/next_hops/next_hop/state (container)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_state is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_state() directly.

    YANG Description: Operational state parameters relating to the AFT
next-hop entry
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(
                v,
                base=state.state,
                is_container="container",
                yang_name="state",
                parent=self,
                path_helper=self._path_helper,
                extmethods=self._extmethods,
                register_paths=True,
                extensions=None,
                namespace="http://openconfig.net/yang/network-instance",
                defining_module="openconfig-network-instance",
                yang_type="container",
                is_config=True,
            )
        except (TypeError, ValueError):
            raise ValueError({
                "error-string":
                """state must be of a type compatible with container""",
                "defined-type":
                "container",
                "generated-type":
                """YANGDynClass(base=state.state, is_container='container', yang_name="state", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='container', is_config=True)""",
            })

        self.__state = t
        if hasattr(self, "_set"):
            self._set()

    def _unset_state(self):
        self.__state = YANGDynClass(
            base=state.state,
            is_container="container",
            yang_name="state",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            extensions=None,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="container",
            is_config=True,
        )

    def _get_interface_ref(self):
        """
    Getter method for interface_ref, mapped from YANG variable /network_instances/network_instance/afts/aft/entries/entry/next_hops/next_hop/interface_ref (container)

    YANG Description: Reference to an interface or subinterface
    """
        return self.__interface_ref

    def _set_interface_ref(self, v, load=False):
        """
    Setter method for interface_ref, mapped from YANG variable /network_instances/network_instance/afts/aft/entries/entry/next_hops/next_hop/interface_ref (container)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_interface_ref is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_interface_ref() directly.

    YANG Description: Reference to an interface or subinterface
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(
                v,
                base=interface_ref.interface_ref,
                is_container="container",
                yang_name="interface-ref",
                parent=self,
                path_helper=self._path_helper,
                extmethods=self._extmethods,
                register_paths=True,
                extensions=None,
                namespace="http://openconfig.net/yang/network-instance",
                defining_module="openconfig-network-instance",
                yang_type="container",
                is_config=True,
            )
        except (TypeError, ValueError):
            raise ValueError({
                "error-string":
                """interface_ref must be of a type compatible with container""",
                "defined-type":
                "container",
                "generated-type":
                """YANGDynClass(base=interface_ref.interface_ref, is_container='container', yang_name="interface-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='container', is_config=True)""",
            })

        self.__interface_ref = t
        if hasattr(self, "_set"):
            self._set()

    def _unset_interface_ref(self):
        self.__interface_ref = YANGDynClass(
            base=interface_ref.interface_ref,
            is_container="container",
            yang_name="interface-ref",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            extensions=None,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="container",
            is_config=True,
        )

    index = __builtin__.property(_get_index, _set_index)
    config = __builtin__.property(_get_config, _set_config)
    state = __builtin__.property(_get_state, _set_state)
    interface_ref = __builtin__.property(_get_interface_ref,
                                         _set_interface_ref)

    _pyangbind_elements = OrderedDict([
        ("index", index),
        ("config", config),
        ("state", state),
        ("interface_ref", interface_ref),
    ])
Пример #5
0
class state(PybindBase):
    """
  This class was auto-generated by the PythonClass plugin for PYANG
  from YANG module openconfig-interfaces - based on the path /interfaces/interface/subinterfaces/subinterface/vlan/ingress-mapping/state. Each member element of
  the container is represented as a class variable - with a specific
  YANG type.

  YANG Description: State for ingress VLAN and label behaviors for packets
that arrive on this subinterface.
  """
    __slots__ = (
        '_path_helper',
        '_extmethods',
        '__vlan_stack_action',
        '__vlan_id',
        '__tpid',
    )

    _yang_name = 'state'
    _yang_namespace = 'http://openconfig.net/yang/interfaces'

    _pybind_generated_by = 'container'

    def __init__(self, *args, **kwargs):

        self._path_helper = False

        self._extmethods = False
        self.__vlan_stack_action = YANGDynClass(
            base=RestrictedClassType(
                base_type=six.text_type,
                restriction_type="dict_key",
                restriction_arg={
                    'PUSH': {},
                    'POP': {},
                    'SWAP': {}
                },
            ),
            is_leaf=True,
            yang_name="vlan-stack-action",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace='http://openconfig.net/yang/vlan',
            defining_module='openconfig-vlan',
            yang_type='oc-vlan-types:vlan-stack-action',
            is_config=False)
        self.__vlan_id = YANGDynClass(
            base=RestrictedClassType(base_type=RestrictedClassType(
                base_type=int,
                restriction_dict={'range': ['0..65535']},
                int_size=16),
                                     restriction_dict={'range': ['1..4094']}),
            is_leaf=True,
            yang_name="vlan-id",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace='http://openconfig.net/yang/vlan',
            defining_module='openconfig-vlan',
            yang_type='oc-vlan-types:vlan-id',
            is_config=False)
        self.__tpid = YANGDynClass(base=RestrictedClassType(
            base_type=six.text_type,
            restriction_type="dict_key",
            restriction_arg={
                'TPID_0X8100': {
                    '@module': 'openconfig-vlan-types',
                    '@namespace': 'http://openconfig.net/yang/vlan-types'
                },
                'oc-vlan-types:TPID_0X8100': {
                    '@module': 'openconfig-vlan-types',
                    '@namespace': 'http://openconfig.net/yang/vlan-types'
                },
                'TPID_0X88A8': {
                    '@module': 'openconfig-vlan-types',
                    '@namespace': 'http://openconfig.net/yang/vlan-types'
                },
                'oc-vlan-types:TPID_0X88A8': {
                    '@module': 'openconfig-vlan-types',
                    '@namespace': 'http://openconfig.net/yang/vlan-types'
                },
                'TPID_0X9100': {
                    '@module': 'openconfig-vlan-types',
                    '@namespace': 'http://openconfig.net/yang/vlan-types'
                },
                'oc-vlan-types:TPID_0X9100': {
                    '@module': 'openconfig-vlan-types',
                    '@namespace': 'http://openconfig.net/yang/vlan-types'
                },
                'TPID_0X9200': {
                    '@module': 'openconfig-vlan-types',
                    '@namespace': 'http://openconfig.net/yang/vlan-types'
                },
                'oc-vlan-types:TPID_0X9200': {
                    '@module': 'openconfig-vlan-types',
                    '@namespace': 'http://openconfig.net/yang/vlan-types'
                },
                'TPID_ANY': {
                    '@module': 'openconfig-vlan-types',
                    '@namespace': 'http://openconfig.net/yang/vlan-types'
                },
                'oc-vlan-types:TPID_ANY': {
                    '@module': 'openconfig-vlan-types',
                    '@namespace': 'http://openconfig.net/yang/vlan-types'
                }
            },
        ),
                                   is_leaf=True,
                                   yang_name="tpid",
                                   parent=self,
                                   path_helper=self._path_helper,
                                   extmethods=self._extmethods,
                                   register_paths=True,
                                   namespace='http://openconfig.net/yang/vlan',
                                   defining_module='openconfig-vlan',
                                   yang_type='identityref',
                                   is_config=False)

        load = kwargs.pop("load", None)
        if args:
            if len(args) > 1:
                raise TypeError(
                    "cannot create a YANG container with >1 argument")
            all_attr = True
            for e in self._pyangbind_elements:
                if not hasattr(args[0], e):
                    all_attr = False
                    break
            if not all_attr:
                raise ValueError(
                    "Supplied object did not have the correct attributes")
            for e in self._pyangbind_elements:
                nobj = getattr(args[0], e)
                if nobj._changed() is False:
                    continue
                setmethod = getattr(self, "_set_%s" % e)
                if load is None:
                    setmethod(getattr(args[0], e))
                else:
                    setmethod(getattr(args[0], e), load=load)

    def _path(self):
        if hasattr(self, "_parent"):
            return self._parent._path() + [self._yang_name]
        else:
            return [
                'interfaces', 'interface', 'subinterfaces', 'subinterface',
                'vlan', 'ingress-mapping', 'state'
            ]

    def _get_vlan_stack_action(self):
        """
    Getter method for vlan_stack_action, mapped from YANG variable /interfaces/interface/subinterfaces/subinterface/vlan/ingress_mapping/state/vlan_stack_action (oc-vlan-types:vlan-stack-action)

    YANG Description: The action to take on the VLAN stack of a packet. This is
optionally used in conjunction with adjacent leaves to override
the values of the action.
    """
        return self.__vlan_stack_action

    def _set_vlan_stack_action(self, v, load=False):
        """
    Setter method for vlan_stack_action, mapped from YANG variable /interfaces/interface/subinterfaces/subinterface/vlan/ingress_mapping/state/vlan_stack_action (oc-vlan-types:vlan-stack-action)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_vlan_stack_action is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_vlan_stack_action() directly.

    YANG Description: The action to take on the VLAN stack of a packet. This is
optionally used in conjunction with adjacent leaves to override
the values of the action.
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(v,
                             base=RestrictedClassType(
                                 base_type=six.text_type,
                                 restriction_type="dict_key",
                                 restriction_arg={
                                     'PUSH': {},
                                     'POP': {},
                                     'SWAP': {}
                                 },
                             ),
                             is_leaf=True,
                             yang_name="vlan-stack-action",
                             parent=self,
                             path_helper=self._path_helper,
                             extmethods=self._extmethods,
                             register_paths=True,
                             namespace='http://openconfig.net/yang/vlan',
                             defining_module='openconfig-vlan',
                             yang_type='oc-vlan-types:vlan-stack-action',
                             is_config=False)
        except (TypeError, ValueError):
            raise ValueError({
                'error-string':
                """vlan_stack_action must be of a type compatible with oc-vlan-types:vlan-stack-action""",
                'defined-type':
                "oc-vlan-types:vlan-stack-action",
                'generated-type':
                """YANGDynClass(base=RestrictedClassType(base_type=six.text_type,                                     restriction_type="dict_key",                                     restriction_arg={'PUSH': {}, 'POP': {}, 'SWAP': {}},), is_leaf=True, yang_name="vlan-stack-action", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/vlan', defining_module='openconfig-vlan', yang_type='oc-vlan-types:vlan-stack-action', is_config=False)""",
            })

        self.__vlan_stack_action = t
        if hasattr(self, '_set'):
            self._set()

    def _unset_vlan_stack_action(self):
        self.__vlan_stack_action = YANGDynClass(
            base=RestrictedClassType(
                base_type=six.text_type,
                restriction_type="dict_key",
                restriction_arg={
                    'PUSH': {},
                    'POP': {},
                    'SWAP': {}
                },
            ),
            is_leaf=True,
            yang_name="vlan-stack-action",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace='http://openconfig.net/yang/vlan',
            defining_module='openconfig-vlan',
            yang_type='oc-vlan-types:vlan-stack-action',
            is_config=False)

    def _get_vlan_id(self):
        """
    Getter method for vlan_id, mapped from YANG variable /interfaces/interface/subinterfaces/subinterface/vlan/ingress_mapping/state/vlan_id (oc-vlan-types:vlan-id)

    YANG Description: Optionally specifies a fixed VLAN identifier that is used by the
action configured in 'vlan-stack-action'. For example, if the action
is 'PUSH' then this VLAN identifier is added to the the stack.
This value must be non-zero if the 'vlan-stack-action' is one of
'PUSH' or 'SWAP'.
    """
        return self.__vlan_id

    def _set_vlan_id(self, v, load=False):
        """
    Setter method for vlan_id, mapped from YANG variable /interfaces/interface/subinterfaces/subinterface/vlan/ingress_mapping/state/vlan_id (oc-vlan-types:vlan-id)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_vlan_id is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_vlan_id() directly.

    YANG Description: Optionally specifies a fixed VLAN identifier that is used by the
action configured in 'vlan-stack-action'. For example, if the action
is 'PUSH' then this VLAN identifier is added to the the stack.
This value must be non-zero if the 'vlan-stack-action' is one of
'PUSH' or 'SWAP'.
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(v,
                             base=RestrictedClassType(
                                 base_type=RestrictedClassType(
                                     base_type=int,
                                     restriction_dict={'range': ['0..65535']},
                                     int_size=16),
                                 restriction_dict={'range': ['1..4094']}),
                             is_leaf=True,
                             yang_name="vlan-id",
                             parent=self,
                             path_helper=self._path_helper,
                             extmethods=self._extmethods,
                             register_paths=True,
                             namespace='http://openconfig.net/yang/vlan',
                             defining_module='openconfig-vlan',
                             yang_type='oc-vlan-types:vlan-id',
                             is_config=False)
        except (TypeError, ValueError):
            raise ValueError({
                'error-string':
                """vlan_id must be of a type compatible with oc-vlan-types:vlan-id""",
                'defined-type':
                "oc-vlan-types:vlan-id",
                'generated-type':
                """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}), is_leaf=True, yang_name="vlan-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/vlan', defining_module='openconfig-vlan', yang_type='oc-vlan-types:vlan-id', is_config=False)""",
            })

        self.__vlan_id = t
        if hasattr(self, '_set'):
            self._set()

    def _unset_vlan_id(self):
        self.__vlan_id = YANGDynClass(
            base=RestrictedClassType(base_type=RestrictedClassType(
                base_type=int,
                restriction_dict={'range': ['0..65535']},
                int_size=16),
                                     restriction_dict={'range': ['1..4094']}),
            is_leaf=True,
            yang_name="vlan-id",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace='http://openconfig.net/yang/vlan',
            defining_module='openconfig-vlan',
            yang_type='oc-vlan-types:vlan-id',
            is_config=False)

    def _get_tpid(self):
        """
    Getter method for tpid, mapped from YANG variable /interfaces/interface/subinterfaces/subinterface/vlan/ingress_mapping/state/tpid (identityref)

    YANG Description: Optionally override the tag protocol identifier field (TPID) that
is used by the action configured by 'vlan-stack-action' when
modifying the VLAN stack.
    """
        return self.__tpid

    def _set_tpid(self, v, load=False):
        """
    Setter method for tpid, mapped from YANG variable /interfaces/interface/subinterfaces/subinterface/vlan/ingress_mapping/state/tpid (identityref)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_tpid is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_tpid() directly.

    YANG Description: Optionally override the tag protocol identifier field (TPID) that
is used by the action configured by 'vlan-stack-action' when
modifying the VLAN stack.
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(
                v,
                base=RestrictedClassType(
                    base_type=six.text_type,
                    restriction_type="dict_key",
                    restriction_arg={
                        'TPID_0X8100': {
                            '@module': 'openconfig-vlan-types',
                            '@namespace':
                            'http://openconfig.net/yang/vlan-types'
                        },
                        'oc-vlan-types:TPID_0X8100': {
                            '@module': 'openconfig-vlan-types',
                            '@namespace':
                            'http://openconfig.net/yang/vlan-types'
                        },
                        'TPID_0X88A8': {
                            '@module': 'openconfig-vlan-types',
                            '@namespace':
                            'http://openconfig.net/yang/vlan-types'
                        },
                        'oc-vlan-types:TPID_0X88A8': {
                            '@module': 'openconfig-vlan-types',
                            '@namespace':
                            'http://openconfig.net/yang/vlan-types'
                        },
                        'TPID_0X9100': {
                            '@module': 'openconfig-vlan-types',
                            '@namespace':
                            'http://openconfig.net/yang/vlan-types'
                        },
                        'oc-vlan-types:TPID_0X9100': {
                            '@module': 'openconfig-vlan-types',
                            '@namespace':
                            'http://openconfig.net/yang/vlan-types'
                        },
                        'TPID_0X9200': {
                            '@module': 'openconfig-vlan-types',
                            '@namespace':
                            'http://openconfig.net/yang/vlan-types'
                        },
                        'oc-vlan-types:TPID_0X9200': {
                            '@module': 'openconfig-vlan-types',
                            '@namespace':
                            'http://openconfig.net/yang/vlan-types'
                        },
                        'TPID_ANY': {
                            '@module': 'openconfig-vlan-types',
                            '@namespace':
                            'http://openconfig.net/yang/vlan-types'
                        },
                        'oc-vlan-types:TPID_ANY': {
                            '@module': 'openconfig-vlan-types',
                            '@namespace':
                            'http://openconfig.net/yang/vlan-types'
                        }
                    },
                ),
                is_leaf=True,
                yang_name="tpid",
                parent=self,
                path_helper=self._path_helper,
                extmethods=self._extmethods,
                register_paths=True,
                namespace='http://openconfig.net/yang/vlan',
                defining_module='openconfig-vlan',
                yang_type='identityref',
                is_config=False)
        except (TypeError, ValueError):
            raise ValueError({
                'error-string':
                """tpid must be of a type compatible with identityref""",
                'defined-type':
                "openconfig-vlan:identityref",
                'generated-type':
                """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'TPID_0X8100': {'@module': 'openconfig-vlan-types', '@namespace': 'http://openconfig.net/yang/vlan-types'}, 'oc-vlan-types:TPID_0X8100': {'@module': 'openconfig-vlan-types', '@namespace': 'http://openconfig.net/yang/vlan-types'}, 'TPID_0X88A8': {'@module': 'openconfig-vlan-types', '@namespace': 'http://openconfig.net/yang/vlan-types'}, 'oc-vlan-types:TPID_0X88A8': {'@module': 'openconfig-vlan-types', '@namespace': 'http://openconfig.net/yang/vlan-types'}, 'TPID_0X9100': {'@module': 'openconfig-vlan-types', '@namespace': 'http://openconfig.net/yang/vlan-types'}, 'oc-vlan-types:TPID_0X9100': {'@module': 'openconfig-vlan-types', '@namespace': 'http://openconfig.net/yang/vlan-types'}, 'TPID_0X9200': {'@module': 'openconfig-vlan-types', '@namespace': 'http://openconfig.net/yang/vlan-types'}, 'oc-vlan-types:TPID_0X9200': {'@module': 'openconfig-vlan-types', '@namespace': 'http://openconfig.net/yang/vlan-types'}, 'TPID_ANY': {'@module': 'openconfig-vlan-types', '@namespace': 'http://openconfig.net/yang/vlan-types'}, 'oc-vlan-types:TPID_ANY': {'@module': 'openconfig-vlan-types', '@namespace': 'http://openconfig.net/yang/vlan-types'}},), is_leaf=True, yang_name="tpid", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/vlan', defining_module='openconfig-vlan', yang_type='identityref', is_config=False)""",
            })

        self.__tpid = t
        if hasattr(self, '_set'):
            self._set()

    def _unset_tpid(self):
        self.__tpid = YANGDynClass(base=RestrictedClassType(
            base_type=six.text_type,
            restriction_type="dict_key",
            restriction_arg={
                'TPID_0X8100': {
                    '@module': 'openconfig-vlan-types',
                    '@namespace': 'http://openconfig.net/yang/vlan-types'
                },
                'oc-vlan-types:TPID_0X8100': {
                    '@module': 'openconfig-vlan-types',
                    '@namespace': 'http://openconfig.net/yang/vlan-types'
                },
                'TPID_0X88A8': {
                    '@module': 'openconfig-vlan-types',
                    '@namespace': 'http://openconfig.net/yang/vlan-types'
                },
                'oc-vlan-types:TPID_0X88A8': {
                    '@module': 'openconfig-vlan-types',
                    '@namespace': 'http://openconfig.net/yang/vlan-types'
                },
                'TPID_0X9100': {
                    '@module': 'openconfig-vlan-types',
                    '@namespace': 'http://openconfig.net/yang/vlan-types'
                },
                'oc-vlan-types:TPID_0X9100': {
                    '@module': 'openconfig-vlan-types',
                    '@namespace': 'http://openconfig.net/yang/vlan-types'
                },
                'TPID_0X9200': {
                    '@module': 'openconfig-vlan-types',
                    '@namespace': 'http://openconfig.net/yang/vlan-types'
                },
                'oc-vlan-types:TPID_0X9200': {
                    '@module': 'openconfig-vlan-types',
                    '@namespace': 'http://openconfig.net/yang/vlan-types'
                },
                'TPID_ANY': {
                    '@module': 'openconfig-vlan-types',
                    '@namespace': 'http://openconfig.net/yang/vlan-types'
                },
                'oc-vlan-types:TPID_ANY': {
                    '@module': 'openconfig-vlan-types',
                    '@namespace': 'http://openconfig.net/yang/vlan-types'
                }
            },
        ),
                                   is_leaf=True,
                                   yang_name="tpid",
                                   parent=self,
                                   path_helper=self._path_helper,
                                   extmethods=self._extmethods,
                                   register_paths=True,
                                   namespace='http://openconfig.net/yang/vlan',
                                   defining_module='openconfig-vlan',
                                   yang_type='identityref',
                                   is_config=False)

    vlan_stack_action = __builtin__.property(_get_vlan_stack_action)
    vlan_id = __builtin__.property(_get_vlan_id)
    tpid = __builtin__.property(_get_tpid)

    _pyangbind_elements = OrderedDict([
        ('vlan_stack_action', vlan_stack_action),
        ('vlan_id', vlan_id),
        ('tpid', tpid),
    ])
Пример #6
0
class state(PybindBase):
    """
  This class was auto-generated by the PythonClass plugin for PYANG
  from YANG module openconfig-network-instance-l2 - based on the path /network-instances/network-instance/protocols/protocol/isis/interfaces/interface/timers/state. Each member element of
  the container is represented as a class variable - with a specific
  YANG type.

  YANG Description: This container defines state information for ISIS interface timers.
  """
    __slots__ = ("_path_helper", "_extmethods", "__csnp_interval",
                 "__lsp_pacing_interval")

    _yang_name = "state"

    _pybind_generated_by = "container"

    def __init__(self, *args, **kwargs):

        self._path_helper = False

        self._extmethods = False
        self.__csnp_interval = YANGDynClass(
            base=RestrictedClassType(base_type=int,
                                     restriction_dict={"range": ["0..65535"]},
                                     int_size=16),
            is_leaf=True,
            yang_name="csnp-interval",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="uint16",
            is_config=False,
        )
        self.__lsp_pacing_interval = YANGDynClass(
            base=RestrictedClassType(
                base_type=long,
                restriction_dict={"range": ["0..18446744073709551615"]},
                int_size=64,
            ),
            is_leaf=True,
            yang_name="lsp-pacing-interval",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="uint64",
            is_config=False,
        )

        load = kwargs.pop("load", None)
        if args:
            if len(args) > 1:
                raise TypeError(
                    "cannot create a YANG container with >1 argument")
            all_attr = True
            for e in self._pyangbind_elements:
                if not hasattr(args[0], e):
                    all_attr = False
                    break
            if not all_attr:
                raise ValueError(
                    "Supplied object did not have the correct attributes")
            for e in self._pyangbind_elements:
                nobj = getattr(args[0], e)
                if nobj._changed() is False:
                    continue
                setmethod = getattr(self, "_set_%s" % e)
                if load is None:
                    setmethod(getattr(args[0], e))
                else:
                    setmethod(getattr(args[0], e), load=load)

    def _path(self):
        if hasattr(self, "_parent"):
            return self._parent._path() + [self._yang_name]
        else:
            return [
                "network-instances",
                "network-instance",
                "protocols",
                "protocol",
                "isis",
                "interfaces",
                "interface",
                "timers",
                "state",
            ]

    def _get_csnp_interval(self):
        """
    Getter method for csnp_interval, mapped from YANG variable /network_instances/network_instance/protocols/protocol/isis/interfaces/interface/timers/state/csnp_interval (uint16)

    YANG Description: The interval, specified in seconds, at which periodic CSNP packets
should be transmitted by the local IS.
    """
        return self.__csnp_interval

    def _set_csnp_interval(self, v, load=False):
        """
    Setter method for csnp_interval, mapped from YANG variable /network_instances/network_instance/protocols/protocol/isis/interfaces/interface/timers/state/csnp_interval (uint16)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_csnp_interval is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_csnp_interval() directly.

    YANG Description: The interval, specified in seconds, at which periodic CSNP packets
should be transmitted by the local IS.
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(
                v,
                base=RestrictedClassType(
                    base_type=int,
                    restriction_dict={"range": ["0..65535"]},
                    int_size=16),
                is_leaf=True,
                yang_name="csnp-interval",
                parent=self,
                path_helper=self._path_helper,
                extmethods=self._extmethods,
                register_paths=True,
                namespace="http://openconfig.net/yang/network-instance",
                defining_module="openconfig-network-instance",
                yang_type="uint16",
                is_config=False,
            )
        except (TypeError, ValueError):
            raise ValueError({
                "error-string":
                """csnp_interval must be of a type compatible with uint16""",
                "defined-type":
                "uint16",
                "generated-type":
                """YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), is_leaf=True, yang_name="csnp-interval", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='uint16', is_config=False)""",
            })

        self.__csnp_interval = t
        if hasattr(self, "_set"):
            self._set()

    def _unset_csnp_interval(self):
        self.__csnp_interval = YANGDynClass(
            base=RestrictedClassType(base_type=int,
                                     restriction_dict={"range": ["0..65535"]},
                                     int_size=16),
            is_leaf=True,
            yang_name="csnp-interval",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="uint16",
            is_config=False,
        )

    def _get_lsp_pacing_interval(self):
        """
    Getter method for lsp_pacing_interval, mapped from YANG variable /network_instances/network_instance/protocols/protocol/isis/interfaces/interface/timers/state/lsp_pacing_interval (uint64)

    YANG Description: The interval interval in milliseconds between the
detection of topology change and when the SPF algorithm runs.
    """
        return self.__lsp_pacing_interval

    def _set_lsp_pacing_interval(self, v, load=False):
        """
    Setter method for lsp_pacing_interval, mapped from YANG variable /network_instances/network_instance/protocols/protocol/isis/interfaces/interface/timers/state/lsp_pacing_interval (uint64)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_lsp_pacing_interval is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_lsp_pacing_interval() directly.

    YANG Description: The interval interval in milliseconds between the
detection of topology change and when the SPF algorithm runs.
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(
                v,
                base=RestrictedClassType(
                    base_type=long,
                    restriction_dict={"range": ["0..18446744073709551615"]},
                    int_size=64,
                ),
                is_leaf=True,
                yang_name="lsp-pacing-interval",
                parent=self,
                path_helper=self._path_helper,
                extmethods=self._extmethods,
                register_paths=True,
                namespace="http://openconfig.net/yang/network-instance",
                defining_module="openconfig-network-instance",
                yang_type="uint64",
                is_config=False,
            )
        except (TypeError, ValueError):
            raise ValueError({
                "error-string":
                """lsp_pacing_interval must be of a type compatible with uint64""",
                "defined-type":
                "uint64",
                "generated-type":
                """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range':  ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="lsp-pacing-interval", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='uint64', is_config=False)""",
            })

        self.__lsp_pacing_interval = t
        if hasattr(self, "_set"):
            self._set()

    def _unset_lsp_pacing_interval(self):
        self.__lsp_pacing_interval = YANGDynClass(
            base=RestrictedClassType(
                base_type=long,
                restriction_dict={"range": ["0..18446744073709551615"]},
                int_size=64,
            ),
            is_leaf=True,
            yang_name="lsp-pacing-interval",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="uint64",
            is_config=False,
        )

    csnp_interval = __builtin__.property(_get_csnp_interval)
    lsp_pacing_interval = __builtin__.property(_get_lsp_pacing_interval)

    _pyangbind_elements = OrderedDict([("csnp_interval", csnp_interval),
                                       ("lsp_pacing_interval",
                                        lsp_pacing_interval)])
Пример #7
0
class state(PybindBase):
    """
  This class was auto-generated by the PythonClass plugin for PYANG
  from YANG module openconfig-network-instance-l2 - based on the path /network-instances/network-instance/protocols/protocol/bgp/neighbors/neighbor/afi-safis/afi-safi/apply-policy/state. Each member element of
  the container is represented as a class variable - with a specific
  YANG type.

  YANG Description: Operational state for routing policy
  """
    __slots__ = (
        "_path_helper",
        "_extmethods",
        "__import_policy",
        "__default_import_policy",
        "__export_policy",
        "__default_export_policy",
    )

    _yang_name = "state"

    _pybind_generated_by = "container"

    def __init__(self, *args, **kwargs):

        self._path_helper = False

        self._extmethods = False
        self.__import_policy = YANGDynClass(
            base=TypedListType(allowed_type=six.text_type),
            is_leaf=False,
            yang_name="import-policy",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="leafref",
            is_config=False,
        )
        self.__default_import_policy = YANGDynClass(
            base=RestrictedClassType(
                base_type=six.text_type,
                restriction_type="dict_key",
                restriction_arg={
                    "ACCEPT_ROUTE": {},
                    "REJECT_ROUTE": {}
                },
            ),
            default=six.text_type("REJECT_ROUTE"),
            is_leaf=True,
            yang_name="default-import-policy",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="default-policy-type",
            is_config=False,
        )
        self.__export_policy = YANGDynClass(
            base=TypedListType(allowed_type=six.text_type),
            is_leaf=False,
            yang_name="export-policy",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="leafref",
            is_config=False,
        )
        self.__default_export_policy = YANGDynClass(
            base=RestrictedClassType(
                base_type=six.text_type,
                restriction_type="dict_key",
                restriction_arg={
                    "ACCEPT_ROUTE": {},
                    "REJECT_ROUTE": {}
                },
            ),
            default=six.text_type("REJECT_ROUTE"),
            is_leaf=True,
            yang_name="default-export-policy",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="default-policy-type",
            is_config=False,
        )

        load = kwargs.pop("load", None)
        if args:
            if len(args) > 1:
                raise TypeError(
                    "cannot create a YANG container with >1 argument")
            all_attr = True
            for e in self._pyangbind_elements:
                if not hasattr(args[0], e):
                    all_attr = False
                    break
            if not all_attr:
                raise ValueError(
                    "Supplied object did not have the correct attributes")
            for e in self._pyangbind_elements:
                nobj = getattr(args[0], e)
                if nobj._changed() is False:
                    continue
                setmethod = getattr(self, "_set_%s" % e)
                if load is None:
                    setmethod(getattr(args[0], e))
                else:
                    setmethod(getattr(args[0], e), load=load)

    def _path(self):
        if hasattr(self, "_parent"):
            return self._parent._path() + [self._yang_name]
        else:
            return [
                "network-instances",
                "network-instance",
                "protocols",
                "protocol",
                "bgp",
                "neighbors",
                "neighbor",
                "afi-safis",
                "afi-safi",
                "apply-policy",
                "state",
            ]

    def _get_import_policy(self):
        """
    Getter method for import_policy, mapped from YANG variable /network_instances/network_instance/protocols/protocol/bgp/neighbors/neighbor/afi_safis/afi_safi/apply_policy/state/import_policy (leafref)

    YANG Description: list of policy names in sequence to be applied on
receiving a routing update in the current context, e.g.,
for the current peer group, neighbor, address family,
etc.
    """
        return self.__import_policy

    def _set_import_policy(self, v, load=False):
        """
    Setter method for import_policy, mapped from YANG variable /network_instances/network_instance/protocols/protocol/bgp/neighbors/neighbor/afi_safis/afi_safi/apply_policy/state/import_policy (leafref)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_import_policy is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_import_policy() directly.

    YANG Description: list of policy names in sequence to be applied on
receiving a routing update in the current context, e.g.,
for the current peer group, neighbor, address family,
etc.
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(
                v,
                base=TypedListType(allowed_type=six.text_type),
                is_leaf=False,
                yang_name="import-policy",
                parent=self,
                path_helper=self._path_helper,
                extmethods=self._extmethods,
                register_paths=True,
                namespace="http://openconfig.net/yang/network-instance",
                defining_module="openconfig-network-instance",
                yang_type="leafref",
                is_config=False,
            )
        except (TypeError, ValueError):
            raise ValueError({
                "error-string":
                """import_policy must be of a type compatible with leafref""",
                "defined-type":
                "leafref",
                "generated-type":
                """YANGDynClass(base=TypedListType(allowed_type=six.text_type), is_leaf=False, yang_name="import-policy", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='leafref', is_config=False)""",
            })

        self.__import_policy = t
        if hasattr(self, "_set"):
            self._set()

    def _unset_import_policy(self):
        self.__import_policy = YANGDynClass(
            base=TypedListType(allowed_type=six.text_type),
            is_leaf=False,
            yang_name="import-policy",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="leafref",
            is_config=False,
        )

    def _get_default_import_policy(self):
        """
    Getter method for default_import_policy, mapped from YANG variable /network_instances/network_instance/protocols/protocol/bgp/neighbors/neighbor/afi_safis/afi_safi/apply_policy/state/default_import_policy (default-policy-type)

    YANG Description: explicitly set a default policy if no policy definition
in the import policy chain is satisfied.
    """
        return self.__default_import_policy

    def _set_default_import_policy(self, v, load=False):
        """
    Setter method for default_import_policy, mapped from YANG variable /network_instances/network_instance/protocols/protocol/bgp/neighbors/neighbor/afi_safis/afi_safi/apply_policy/state/default_import_policy (default-policy-type)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_default_import_policy is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_default_import_policy() directly.

    YANG Description: explicitly set a default policy if no policy definition
in the import policy chain is satisfied.
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(
                v,
                base=RestrictedClassType(
                    base_type=six.text_type,
                    restriction_type="dict_key",
                    restriction_arg={
                        "ACCEPT_ROUTE": {},
                        "REJECT_ROUTE": {}
                    },
                ),
                default=six.text_type("REJECT_ROUTE"),
                is_leaf=True,
                yang_name="default-import-policy",
                parent=self,
                path_helper=self._path_helper,
                extmethods=self._extmethods,
                register_paths=True,
                namespace="http://openconfig.net/yang/network-instance",
                defining_module="openconfig-network-instance",
                yang_type="default-policy-type",
                is_config=False,
            )
        except (TypeError, ValueError):
            raise ValueError({
                "error-string":
                """default_import_policy must be of a type compatible with default-policy-type""",
                "defined-type":
                "openconfig-network-instance:default-policy-type",
                "generated-type":
                """YANGDynClass(base=RestrictedClassType(base_type=six.text_type,                                     restriction_type="dict_key",                                     restriction_arg={'ACCEPT_ROUTE': {}, 'REJECT_ROUTE': {}},), default=six.text_type("REJECT_ROUTE"), is_leaf=True, yang_name="default-import-policy", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='default-policy-type', is_config=False)""",
            })

        self.__default_import_policy = t
        if hasattr(self, "_set"):
            self._set()

    def _unset_default_import_policy(self):
        self.__default_import_policy = YANGDynClass(
            base=RestrictedClassType(
                base_type=six.text_type,
                restriction_type="dict_key",
                restriction_arg={
                    "ACCEPT_ROUTE": {},
                    "REJECT_ROUTE": {}
                },
            ),
            default=six.text_type("REJECT_ROUTE"),
            is_leaf=True,
            yang_name="default-import-policy",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="default-policy-type",
            is_config=False,
        )

    def _get_export_policy(self):
        """
    Getter method for export_policy, mapped from YANG variable /network_instances/network_instance/protocols/protocol/bgp/neighbors/neighbor/afi_safis/afi_safi/apply_policy/state/export_policy (leafref)

    YANG Description: list of policy names in sequence to be applied on
sending a routing update in the current context, e.g.,
for the current peer group, neighbor, address family,
etc.
    """
        return self.__export_policy

    def _set_export_policy(self, v, load=False):
        """
    Setter method for export_policy, mapped from YANG variable /network_instances/network_instance/protocols/protocol/bgp/neighbors/neighbor/afi_safis/afi_safi/apply_policy/state/export_policy (leafref)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_export_policy is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_export_policy() directly.

    YANG Description: list of policy names in sequence to be applied on
sending a routing update in the current context, e.g.,
for the current peer group, neighbor, address family,
etc.
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(
                v,
                base=TypedListType(allowed_type=six.text_type),
                is_leaf=False,
                yang_name="export-policy",
                parent=self,
                path_helper=self._path_helper,
                extmethods=self._extmethods,
                register_paths=True,
                namespace="http://openconfig.net/yang/network-instance",
                defining_module="openconfig-network-instance",
                yang_type="leafref",
                is_config=False,
            )
        except (TypeError, ValueError):
            raise ValueError({
                "error-string":
                """export_policy must be of a type compatible with leafref""",
                "defined-type":
                "leafref",
                "generated-type":
                """YANGDynClass(base=TypedListType(allowed_type=six.text_type), is_leaf=False, yang_name="export-policy", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='leafref', is_config=False)""",
            })

        self.__export_policy = t
        if hasattr(self, "_set"):
            self._set()

    def _unset_export_policy(self):
        self.__export_policy = YANGDynClass(
            base=TypedListType(allowed_type=six.text_type),
            is_leaf=False,
            yang_name="export-policy",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="leafref",
            is_config=False,
        )

    def _get_default_export_policy(self):
        """
    Getter method for default_export_policy, mapped from YANG variable /network_instances/network_instance/protocols/protocol/bgp/neighbors/neighbor/afi_safis/afi_safi/apply_policy/state/default_export_policy (default-policy-type)

    YANG Description: explicitly set a default policy if no policy definition
in the export policy chain is satisfied.
    """
        return self.__default_export_policy

    def _set_default_export_policy(self, v, load=False):
        """
    Setter method for default_export_policy, mapped from YANG variable /network_instances/network_instance/protocols/protocol/bgp/neighbors/neighbor/afi_safis/afi_safi/apply_policy/state/default_export_policy (default-policy-type)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_default_export_policy is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_default_export_policy() directly.

    YANG Description: explicitly set a default policy if no policy definition
in the export policy chain is satisfied.
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(
                v,
                base=RestrictedClassType(
                    base_type=six.text_type,
                    restriction_type="dict_key",
                    restriction_arg={
                        "ACCEPT_ROUTE": {},
                        "REJECT_ROUTE": {}
                    },
                ),
                default=six.text_type("REJECT_ROUTE"),
                is_leaf=True,
                yang_name="default-export-policy",
                parent=self,
                path_helper=self._path_helper,
                extmethods=self._extmethods,
                register_paths=True,
                namespace="http://openconfig.net/yang/network-instance",
                defining_module="openconfig-network-instance",
                yang_type="default-policy-type",
                is_config=False,
            )
        except (TypeError, ValueError):
            raise ValueError({
                "error-string":
                """default_export_policy must be of a type compatible with default-policy-type""",
                "defined-type":
                "openconfig-network-instance:default-policy-type",
                "generated-type":
                """YANGDynClass(base=RestrictedClassType(base_type=six.text_type,                                     restriction_type="dict_key",                                     restriction_arg={'ACCEPT_ROUTE': {}, 'REJECT_ROUTE': {}},), default=six.text_type("REJECT_ROUTE"), is_leaf=True, yang_name="default-export-policy", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='default-policy-type', is_config=False)""",
            })

        self.__default_export_policy = t
        if hasattr(self, "_set"):
            self._set()

    def _unset_default_export_policy(self):
        self.__default_export_policy = YANGDynClass(
            base=RestrictedClassType(
                base_type=six.text_type,
                restriction_type="dict_key",
                restriction_arg={
                    "ACCEPT_ROUTE": {},
                    "REJECT_ROUTE": {}
                },
            ),
            default=six.text_type("REJECT_ROUTE"),
            is_leaf=True,
            yang_name="default-export-policy",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="default-policy-type",
            is_config=False,
        )

    import_policy = __builtin__.property(_get_import_policy)
    default_import_policy = __builtin__.property(_get_default_import_policy)
    export_policy = __builtin__.property(_get_export_policy)
    default_export_policy = __builtin__.property(_get_default_export_policy)

    _pyangbind_elements = OrderedDict([
        ("import_policy", import_policy),
        ("default_import_policy", default_import_policy),
        ("export_policy", export_policy),
        ("default_export_policy", default_export_policy),
    ])
Пример #8
0
class state(PybindBase):
    """
  This class was auto-generated by the PythonClass plugin for PYANG
  from YANG module openconfig-network-instance-l2 - based on the path /network-instances/network-instance/mpls/te-global-attributes/te-lsp-timers/state. Each member element of
  the container is represented as a class variable - with a specific
  YANG type.

  YANG Description: State related to timers for TE LSPs
  """
    __slots__ = (
        "_path_helper",
        "_extmethods",
        "__install_delay",
        "__cleanup_delay",
        "__reoptimize_timer",
    )

    _yang_name = "state"

    _pybind_generated_by = "container"

    def __init__(self, *args, **kwargs):

        self._path_helper = False

        self._extmethods = False
        self.__install_delay = YANGDynClass(
            base=RestrictedClassType(
                base_type=RestrictedClassType(
                    base_type=int,
                    restriction_dict={"range": ["0..65535"]},
                    int_size=16),
                restriction_dict={"range": ["0..3600"]},
            ),
            is_leaf=True,
            yang_name="install-delay",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="uint16",
            is_config=False,
        )
        self.__cleanup_delay = YANGDynClass(
            base=RestrictedClassType(base_type=int,
                                     restriction_dict={"range": ["0..65535"]},
                                     int_size=16),
            is_leaf=True,
            yang_name="cleanup-delay",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="uint16",
            is_config=False,
        )
        self.__reoptimize_timer = YANGDynClass(
            base=RestrictedClassType(base_type=int,
                                     restriction_dict={"range": ["0..65535"]},
                                     int_size=16),
            is_leaf=True,
            yang_name="reoptimize-timer",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="uint16",
            is_config=False,
        )

        load = kwargs.pop("load", None)
        if args:
            if len(args) > 1:
                raise TypeError(
                    "cannot create a YANG container with >1 argument")
            all_attr = True
            for e in self._pyangbind_elements:
                if not hasattr(args[0], e):
                    all_attr = False
                    break
            if not all_attr:
                raise ValueError(
                    "Supplied object did not have the correct attributes")
            for e in self._pyangbind_elements:
                nobj = getattr(args[0], e)
                if nobj._changed() is False:
                    continue
                setmethod = getattr(self, "_set_%s" % e)
                if load is None:
                    setmethod(getattr(args[0], e))
                else:
                    setmethod(getattr(args[0], e), load=load)

    def _path(self):
        if hasattr(self, "_parent"):
            return self._parent._path() + [self._yang_name]
        else:
            return [
                "network-instances",
                "network-instance",
                "mpls",
                "te-global-attributes",
                "te-lsp-timers",
                "state",
            ]

    def _get_install_delay(self):
        """
    Getter method for install_delay, mapped from YANG variable /network_instances/network_instance/mpls/te_global_attributes/te_lsp_timers/state/install_delay (uint16)

    YANG Description: delay the use of newly installed te lsp for a
specified amount of time.
    """
        return self.__install_delay

    def _set_install_delay(self, v, load=False):
        """
    Setter method for install_delay, mapped from YANG variable /network_instances/network_instance/mpls/te_global_attributes/te_lsp_timers/state/install_delay (uint16)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_install_delay is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_install_delay() directly.

    YANG Description: delay the use of newly installed te lsp for a
specified amount of time.
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(
                v,
                base=RestrictedClassType(
                    base_type=RestrictedClassType(
                        base_type=int,
                        restriction_dict={"range": ["0..65535"]},
                        int_size=16,
                    ),
                    restriction_dict={"range": ["0..3600"]},
                ),
                is_leaf=True,
                yang_name="install-delay",
                parent=self,
                path_helper=self._path_helper,
                extmethods=self._extmethods,
                register_paths=True,
                namespace="http://openconfig.net/yang/network-instance",
                defining_module="openconfig-network-instance",
                yang_type="uint16",
                is_config=False,
            )
        except (TypeError, ValueError):
            raise ValueError({
                "error-string":
                """install_delay must be of a type compatible with uint16""",
                "defined-type":
                "uint16",
                "generated-type":
                """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['0..3600']}), is_leaf=True, yang_name="install-delay", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='uint16', is_config=False)""",
            })

        self.__install_delay = t
        if hasattr(self, "_set"):
            self._set()

    def _unset_install_delay(self):
        self.__install_delay = YANGDynClass(
            base=RestrictedClassType(
                base_type=RestrictedClassType(
                    base_type=int,
                    restriction_dict={"range": ["0..65535"]},
                    int_size=16),
                restriction_dict={"range": ["0..3600"]},
            ),
            is_leaf=True,
            yang_name="install-delay",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="uint16",
            is_config=False,
        )

    def _get_cleanup_delay(self):
        """
    Getter method for cleanup_delay, mapped from YANG variable /network_instances/network_instance/mpls/te_global_attributes/te_lsp_timers/state/cleanup_delay (uint16)

    YANG Description: delay the removal of old te lsp for a specified
amount of time
    """
        return self.__cleanup_delay

    def _set_cleanup_delay(self, v, load=False):
        """
    Setter method for cleanup_delay, mapped from YANG variable /network_instances/network_instance/mpls/te_global_attributes/te_lsp_timers/state/cleanup_delay (uint16)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_cleanup_delay is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_cleanup_delay() directly.

    YANG Description: delay the removal of old te lsp for a specified
amount of time
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(
                v,
                base=RestrictedClassType(
                    base_type=int,
                    restriction_dict={"range": ["0..65535"]},
                    int_size=16),
                is_leaf=True,
                yang_name="cleanup-delay",
                parent=self,
                path_helper=self._path_helper,
                extmethods=self._extmethods,
                register_paths=True,
                namespace="http://openconfig.net/yang/network-instance",
                defining_module="openconfig-network-instance",
                yang_type="uint16",
                is_config=False,
            )
        except (TypeError, ValueError):
            raise ValueError({
                "error-string":
                """cleanup_delay must be of a type compatible with uint16""",
                "defined-type":
                "uint16",
                "generated-type":
                """YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), is_leaf=True, yang_name="cleanup-delay", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='uint16', is_config=False)""",
            })

        self.__cleanup_delay = t
        if hasattr(self, "_set"):
            self._set()

    def _unset_cleanup_delay(self):
        self.__cleanup_delay = YANGDynClass(
            base=RestrictedClassType(base_type=int,
                                     restriction_dict={"range": ["0..65535"]},
                                     int_size=16),
            is_leaf=True,
            yang_name="cleanup-delay",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="uint16",
            is_config=False,
        )

    def _get_reoptimize_timer(self):
        """
    Getter method for reoptimize_timer, mapped from YANG variable /network_instances/network_instance/mpls/te_global_attributes/te_lsp_timers/state/reoptimize_timer (uint16)

    YANG Description: frequency of reoptimization of
a traffic engineered LSP
    """
        return self.__reoptimize_timer

    def _set_reoptimize_timer(self, v, load=False):
        """
    Setter method for reoptimize_timer, mapped from YANG variable /network_instances/network_instance/mpls/te_global_attributes/te_lsp_timers/state/reoptimize_timer (uint16)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_reoptimize_timer is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_reoptimize_timer() directly.

    YANG Description: frequency of reoptimization of
a traffic engineered LSP
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(
                v,
                base=RestrictedClassType(
                    base_type=int,
                    restriction_dict={"range": ["0..65535"]},
                    int_size=16),
                is_leaf=True,
                yang_name="reoptimize-timer",
                parent=self,
                path_helper=self._path_helper,
                extmethods=self._extmethods,
                register_paths=True,
                namespace="http://openconfig.net/yang/network-instance",
                defining_module="openconfig-network-instance",
                yang_type="uint16",
                is_config=False,
            )
        except (TypeError, ValueError):
            raise ValueError({
                "error-string":
                """reoptimize_timer must be of a type compatible with uint16""",
                "defined-type":
                "uint16",
                "generated-type":
                """YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), is_leaf=True, yang_name="reoptimize-timer", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='uint16', is_config=False)""",
            })

        self.__reoptimize_timer = t
        if hasattr(self, "_set"):
            self._set()

    def _unset_reoptimize_timer(self):
        self.__reoptimize_timer = YANGDynClass(
            base=RestrictedClassType(base_type=int,
                                     restriction_dict={"range": ["0..65535"]},
                                     int_size=16),
            is_leaf=True,
            yang_name="reoptimize-timer",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="uint16",
            is_config=False,
        )

    install_delay = __builtin__.property(_get_install_delay)
    cleanup_delay = __builtin__.property(_get_cleanup_delay)
    reoptimize_timer = __builtin__.property(_get_reoptimize_timer)

    _pyangbind_elements = OrderedDict([
        ("install_delay", install_delay),
        ("cleanup_delay", cleanup_delay),
        ("reoptimize_timer", reoptimize_timer),
    ])
Пример #9
0
class prefixes(PybindBase):
    """
  This class was auto-generated by the PythonClass plugin for PYANG
  from YANG module openconfig-network-instance-l2 - based on the path /network-instances/network-instance/protocols/protocol/bgp/neighbors/neighbor/afi-safis/afi-safi/state/prefixes. Each member element of
  the container is represented as a class variable - with a specific
  YANG type.

  YANG Description: Prefix counters for the BGP session
  """
    __slots__ = ("_path_helper", "_extmethods", "__received", "__sent",
                 "__installed")

    _yang_name = "prefixes"

    _pybind_generated_by = "container"

    def __init__(self, *args, **kwargs):

        self._path_helper = False

        self._extmethods = False
        self.__received = YANGDynClass(
            base=RestrictedClassType(
                base_type=long,
                restriction_dict={"range": ["0..4294967295"]},
                int_size=32,
            ),
            is_leaf=True,
            yang_name="received",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="uint32",
            is_config=False,
        )
        self.__sent = YANGDynClass(
            base=RestrictedClassType(
                base_type=long,
                restriction_dict={"range": ["0..4294967295"]},
                int_size=32,
            ),
            is_leaf=True,
            yang_name="sent",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="uint32",
            is_config=False,
        )
        self.__installed = YANGDynClass(
            base=RestrictedClassType(
                base_type=long,
                restriction_dict={"range": ["0..4294967295"]},
                int_size=32,
            ),
            is_leaf=True,
            yang_name="installed",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="uint32",
            is_config=False,
        )

        load = kwargs.pop("load", None)
        if args:
            if len(args) > 1:
                raise TypeError(
                    "cannot create a YANG container with >1 argument")
            all_attr = True
            for e in self._pyangbind_elements:
                if not hasattr(args[0], e):
                    all_attr = False
                    break
            if not all_attr:
                raise ValueError(
                    "Supplied object did not have the correct attributes")
            for e in self._pyangbind_elements:
                nobj = getattr(args[0], e)
                if nobj._changed() is False:
                    continue
                setmethod = getattr(self, "_set_%s" % e)
                if load is None:
                    setmethod(getattr(args[0], e))
                else:
                    setmethod(getattr(args[0], e), load=load)

    def _path(self):
        if hasattr(self, "_parent"):
            return self._parent._path() + [self._yang_name]
        else:
            return [
                "network-instances",
                "network-instance",
                "protocols",
                "protocol",
                "bgp",
                "neighbors",
                "neighbor",
                "afi-safis",
                "afi-safi",
                "state",
                "prefixes",
            ]

    def _get_received(self):
        """
    Getter method for received, mapped from YANG variable /network_instances/network_instance/protocols/protocol/bgp/neighbors/neighbor/afi_safis/afi_safi/state/prefixes/received (uint32)

    YANG Description: The number of prefixes received from the neighbor
    """
        return self.__received

    def _set_received(self, v, load=False):
        """
    Setter method for received, mapped from YANG variable /network_instances/network_instance/protocols/protocol/bgp/neighbors/neighbor/afi_safis/afi_safi/state/prefixes/received (uint32)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_received is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_received() directly.

    YANG Description: The number of prefixes received from the neighbor
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(
                v,
                base=RestrictedClassType(
                    base_type=long,
                    restriction_dict={"range": ["0..4294967295"]},
                    int_size=32,
                ),
                is_leaf=True,
                yang_name="received",
                parent=self,
                path_helper=self._path_helper,
                extmethods=self._extmethods,
                register_paths=True,
                namespace="http://openconfig.net/yang/network-instance",
                defining_module="openconfig-network-instance",
                yang_type="uint32",
                is_config=False,
            )
        except (TypeError, ValueError):
            raise ValueError({
                "error-string":
                """received must be of a type compatible with uint32""",
                "defined-type":
                "uint32",
                "generated-type":
                """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="received", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='uint32', is_config=False)""",
            })

        self.__received = t
        if hasattr(self, "_set"):
            self._set()

    def _unset_received(self):
        self.__received = YANGDynClass(
            base=RestrictedClassType(
                base_type=long,
                restriction_dict={"range": ["0..4294967295"]},
                int_size=32,
            ),
            is_leaf=True,
            yang_name="received",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="uint32",
            is_config=False,
        )

    def _get_sent(self):
        """
    Getter method for sent, mapped from YANG variable /network_instances/network_instance/protocols/protocol/bgp/neighbors/neighbor/afi_safis/afi_safi/state/prefixes/sent (uint32)

    YANG Description: The number of prefixes advertised to the neighbor
    """
        return self.__sent

    def _set_sent(self, v, load=False):
        """
    Setter method for sent, mapped from YANG variable /network_instances/network_instance/protocols/protocol/bgp/neighbors/neighbor/afi_safis/afi_safi/state/prefixes/sent (uint32)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_sent is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_sent() directly.

    YANG Description: The number of prefixes advertised to the neighbor
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(
                v,
                base=RestrictedClassType(
                    base_type=long,
                    restriction_dict={"range": ["0..4294967295"]},
                    int_size=32,
                ),
                is_leaf=True,
                yang_name="sent",
                parent=self,
                path_helper=self._path_helper,
                extmethods=self._extmethods,
                register_paths=True,
                namespace="http://openconfig.net/yang/network-instance",
                defining_module="openconfig-network-instance",
                yang_type="uint32",
                is_config=False,
            )
        except (TypeError, ValueError):
            raise ValueError({
                "error-string":
                """sent must be of a type compatible with uint32""",
                "defined-type":
                "uint32",
                "generated-type":
                """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="sent", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='uint32', is_config=False)""",
            })

        self.__sent = t
        if hasattr(self, "_set"):
            self._set()

    def _unset_sent(self):
        self.__sent = YANGDynClass(
            base=RestrictedClassType(
                base_type=long,
                restriction_dict={"range": ["0..4294967295"]},
                int_size=32,
            ),
            is_leaf=True,
            yang_name="sent",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="uint32",
            is_config=False,
        )

    def _get_installed(self):
        """
    Getter method for installed, mapped from YANG variable /network_instances/network_instance/protocols/protocol/bgp/neighbors/neighbor/afi_safis/afi_safi/state/prefixes/installed (uint32)

    YANG Description: The number of advertised prefixes installed in the
Loc-RIB
    """
        return self.__installed

    def _set_installed(self, v, load=False):
        """
    Setter method for installed, mapped from YANG variable /network_instances/network_instance/protocols/protocol/bgp/neighbors/neighbor/afi_safis/afi_safi/state/prefixes/installed (uint32)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_installed is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_installed() directly.

    YANG Description: The number of advertised prefixes installed in the
Loc-RIB
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(
                v,
                base=RestrictedClassType(
                    base_type=long,
                    restriction_dict={"range": ["0..4294967295"]},
                    int_size=32,
                ),
                is_leaf=True,
                yang_name="installed",
                parent=self,
                path_helper=self._path_helper,
                extmethods=self._extmethods,
                register_paths=True,
                namespace="http://openconfig.net/yang/network-instance",
                defining_module="openconfig-network-instance",
                yang_type="uint32",
                is_config=False,
            )
        except (TypeError, ValueError):
            raise ValueError({
                "error-string":
                """installed must be of a type compatible with uint32""",
                "defined-type":
                "uint32",
                "generated-type":
                """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="installed", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='uint32', is_config=False)""",
            })

        self.__installed = t
        if hasattr(self, "_set"):
            self._set()

    def _unset_installed(self):
        self.__installed = YANGDynClass(
            base=RestrictedClassType(
                base_type=long,
                restriction_dict={"range": ["0..4294967295"]},
                int_size=32,
            ),
            is_leaf=True,
            yang_name="installed",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="uint32",
            is_config=False,
        )

    received = __builtin__.property(_get_received)
    sent = __builtin__.property(_get_sent)
    installed = __builtin__.property(_get_installed)

    _pyangbind_elements = OrderedDict([("received", received), ("sent", sent),
                                       ("installed", installed)])
Пример #10
0
class config(PybindBase):
  """
  This class was auto-generated by the PythonClass plugin for PYANG
  from YANG module openconfig-interfaces - based on the path /interfaces/interface/routed-vlan/ipv4/proxy-arp/config. Each member element of
  the container is represented as a class variable - with a specific
  YANG type.

  YANG Description: Configuration parameters for proxy ARP
  """
  __slots__ = ('_path_helper', '_extmethods', '__mode',)

  _yang_name = 'config'

  _pybind_generated_by = 'container'

  def __init__(self, *args, **kwargs):

    helper = kwargs.pop("path_helper", None)
    if helper is False:
      self._path_helper = False
    elif helper is not None and isinstance(helper, xpathhelper.YANGPathHelper):
      self._path_helper = helper
    elif hasattr(self, "_parent"):
      helper = getattr(self._parent, "_path_helper", False)
      self._path_helper = helper
    else:
      self._path_helper = False

    self._extmethods = False
    self.__mode = YANGDynClass(base=RestrictedClassType(base_type=six.text_type,                                     restriction_type="dict_key",                                     restriction_arg={'DISABLE': {}, 'REMOTE_ONLY': {}, 'ALL': {}},), default=six.text_type("DISABLE"), is_leaf=True, yang_name="mode", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces/ip', defining_module='openconfig-if-ip', yang_type='enumeration', is_config=True)

    load = kwargs.pop("load", None)
    if args:
      if len(args) > 1:
        raise TypeError("cannot create a YANG container with >1 argument")
      all_attr = True
      for e in self._pyangbind_elements:
        if not hasattr(args[0], e):
          all_attr = False
          break
      if not all_attr:
        raise ValueError("Supplied object did not have the correct attributes")
      for e in self._pyangbind_elements:
        nobj = getattr(args[0], e)
        if nobj._changed() is False:
          continue
        setmethod = getattr(self, "_set_%s" % e)
        if load is None:
          setmethod(getattr(args[0], e))
        else:
          setmethod(getattr(args[0], e), load=load)

  def _path(self):
    if hasattr(self, "_parent"):
      return self._parent._path()+[self._yang_name]
    else:
      return ['interfaces', 'interface', 'routed-vlan', 'ipv4', 'proxy-arp', 'config']

  def _get_mode(self):
    """
    Getter method for mode, mapped from YANG variable /interfaces/interface/routed_vlan/ipv4/proxy_arp/config/mode (enumeration)

    YANG Description: When set to a value other than DISABLE, the local system should
respond to ARP requests that are for target addresses other than
those that are configured on the local subinterface using its own
MAC address as the target hardware address. If the REMOTE_ONLY
value is specified, replies are only sent when the target address
falls outside the locally configured subnets on the interface,
whereas with the ALL value, all requests, regardless of their
target address are replied to.
    """
    return self.__mode
      
  def _set_mode(self, v, load=False):
    """
    Setter method for mode, mapped from YANG variable /interfaces/interface/routed_vlan/ipv4/proxy_arp/config/mode (enumeration)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_mode is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_mode() directly.

    YANG Description: When set to a value other than DISABLE, the local system should
respond to ARP requests that are for target addresses other than
those that are configured on the local subinterface using its own
MAC address as the target hardware address. If the REMOTE_ONLY
value is specified, replies are only sent when the target address
falls outside the locally configured subnets on the interface,
whereas with the ALL value, all requests, regardless of their
target address are replied to.
    """
    if hasattr(v, "_utype"):
      v = v._utype(v)
    try:
      t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type,                                     restriction_type="dict_key",                                     restriction_arg={'DISABLE': {}, 'REMOTE_ONLY': {}, 'ALL': {}},), default=six.text_type("DISABLE"), is_leaf=True, yang_name="mode", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces/ip', defining_module='openconfig-if-ip', yang_type='enumeration', is_config=True)
    except (TypeError, ValueError):
      raise ValueError({
          'error-string': """mode must be of a type compatible with enumeration""",
          'defined-type': "openconfig-if-ip:enumeration",
          'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type,                                     restriction_type="dict_key",                                     restriction_arg={'DISABLE': {}, 'REMOTE_ONLY': {}, 'ALL': {}},), default=six.text_type("DISABLE"), is_leaf=True, yang_name="mode", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces/ip', defining_module='openconfig-if-ip', yang_type='enumeration', is_config=True)""",
        })

    self.__mode = t
    if hasattr(self, '_set'):
      self._set()

  def _unset_mode(self):
    self.__mode = YANGDynClass(base=RestrictedClassType(base_type=six.text_type,                                     restriction_type="dict_key",                                     restriction_arg={'DISABLE': {}, 'REMOTE_ONLY': {}, 'ALL': {}},), default=six.text_type("DISABLE"), is_leaf=True, yang_name="mode", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces/ip', defining_module='openconfig-if-ip', yang_type='enumeration', is_config=True)

  mode = __builtin__.property(_get_mode, _set_mode)


  _pyangbind_elements = OrderedDict([('mode', mode), ])
Пример #11
0
class undefined_subtlvs(PybindBase):
    """
  This class was auto-generated by the PythonClass plugin for PYANG
  from YANG module openconfig-network-instance - based on the path /network-instances/network-instance/protocols/protocol/isis/levels/level/link-state-database/lsp/tlvs/tlv/mt-ipv4-reachability/prefixes/prefix/undefined-subtlvs. Each member element of
  the container is represented as a class variable - with a specific
  YANG type.

  YANG Description: This container describes undefined ISIS TLVs.
  """
    __slots__ = ("_path_helper", "_extmethods", "__undefined_subtlv")

    _yang_name = "undefined-subtlvs"

    _pybind_generated_by = "container"

    def __init__(self, *args, **kwargs):

        self._path_helper = False

        self._extmethods = False
        self.__undefined_subtlv = YANGDynClass(
            base=YANGListType(
                "type",
                undefined_subtlv.undefined_subtlv,
                yang_name="undefined-subtlv",
                parent=self,
                is_container="list",
                user_ordered=False,
                path_helper=self._path_helper,
                yang_keys="type",
                extensions=None,
            ),
            is_container="list",
            yang_name="undefined-subtlv",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            extensions=None,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="list",
            is_config=False,
        )

        load = kwargs.pop("load", None)
        if args:
            if len(args) > 1:
                raise TypeError(
                    "cannot create a YANG container with >1 argument")
            all_attr = True
            for e in self._pyangbind_elements:
                if not hasattr(args[0], e):
                    all_attr = False
                    break
            if not all_attr:
                raise ValueError(
                    "Supplied object did not have the correct attributes")
            for e in self._pyangbind_elements:
                nobj = getattr(args[0], e)
                if nobj._changed() is False:
                    continue
                setmethod = getattr(self, "_set_%s" % e)
                if load is None:
                    setmethod(getattr(args[0], e))
                else:
                    setmethod(getattr(args[0], e), load=load)

    def _path(self):
        if hasattr(self, "_parent"):
            return self._parent._path() + [self._yang_name]
        else:
            return [
                "network-instances",
                "network-instance",
                "protocols",
                "protocol",
                "isis",
                "levels",
                "level",
                "link-state-database",
                "lsp",
                "tlvs",
                "tlv",
                "mt-ipv4-reachability",
                "prefixes",
                "prefix",
                "undefined-subtlvs",
            ]

    def _get_undefined_subtlv(self):
        """
    Getter method for undefined_subtlv, mapped from YANG variable /network_instances/network_instance/protocols/protocol/isis/levels/level/link_state_database/lsp/tlvs/tlv/mt_ipv4_reachability/prefixes/prefix/undefined_subtlvs/undefined_subtlv (list)

    YANG Description: Sub-TLVs that are not defined in the model or not recognised by
system.
    """
        return self.__undefined_subtlv

    def _set_undefined_subtlv(self, v, load=False):
        """
    Setter method for undefined_subtlv, mapped from YANG variable /network_instances/network_instance/protocols/protocol/isis/levels/level/link_state_database/lsp/tlvs/tlv/mt_ipv4_reachability/prefixes/prefix/undefined_subtlvs/undefined_subtlv (list)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_undefined_subtlv is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_undefined_subtlv() directly.

    YANG Description: Sub-TLVs that are not defined in the model or not recognised by
system.
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(
                v,
                base=YANGListType(
                    "type",
                    undefined_subtlv.undefined_subtlv,
                    yang_name="undefined-subtlv",
                    parent=self,
                    is_container="list",
                    user_ordered=False,
                    path_helper=self._path_helper,
                    yang_keys="type",
                    extensions=None,
                ),
                is_container="list",
                yang_name="undefined-subtlv",
                parent=self,
                path_helper=self._path_helper,
                extmethods=self._extmethods,
                register_paths=True,
                extensions=None,
                namespace="http://openconfig.net/yang/network-instance",
                defining_module="openconfig-network-instance",
                yang_type="list",
                is_config=False,
            )
        except (TypeError, ValueError):
            raise ValueError({
                "error-string":
                """undefined_subtlv must be of a type compatible with list""",
                "defined-type":
                "list",
                "generated-type":
                """YANGDynClass(base=YANGListType("type",undefined_subtlv.undefined_subtlv, yang_name="undefined-subtlv", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='type', extensions=None), is_container='list', yang_name="undefined-subtlv", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='list', is_config=False)""",
            })

        self.__undefined_subtlv = t
        if hasattr(self, "_set"):
            self._set()

    def _unset_undefined_subtlv(self):
        self.__undefined_subtlv = YANGDynClass(
            base=YANGListType(
                "type",
                undefined_subtlv.undefined_subtlv,
                yang_name="undefined-subtlv",
                parent=self,
                is_container="list",
                user_ordered=False,
                path_helper=self._path_helper,
                yang_keys="type",
                extensions=None,
            ),
            is_container="list",
            yang_name="undefined-subtlv",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            extensions=None,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="list",
            is_config=False,
        )

    undefined_subtlv = __builtin__.property(_get_undefined_subtlv)

    _pyangbind_elements = OrderedDict([("undefined_subtlv", undefined_subtlv)])
Пример #12
0
class nssa_external_lsa(PybindBase):
    """
  This class was auto-generated by the PythonClass plugin for PYANG
  from YANG module openconfig-network-instance-l2 - based on the path /network-instances/network-instance/protocols/protocol/ospfv2/areas/area/lsdb/lsa-types/lsa-type/lsas/lsa/nssa-external-lsa. Each member element of
  the container is represented as a class variable - with a specific
  YANG type.

  YANG Description: Contents of the NSSA External LSA
  """
    __slots__ = ("_path_helper", "_extmethods", "__state",
                 "__types_of_service")

    _yang_name = "nssa-external-lsa"

    _pybind_generated_by = "container"

    def __init__(self, *args, **kwargs):

        self._path_helper = False

        self._extmethods = False
        self.__state = YANGDynClass(
            base=state.state,
            is_container="container",
            yang_name="state",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            extensions=None,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="container",
            is_config=False,
        )
        self.__types_of_service = YANGDynClass(
            base=types_of_service.types_of_service,
            is_container="container",
            yang_name="types-of-service",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            extensions=None,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="container",
            is_config=False,
        )

        load = kwargs.pop("load", None)
        if args:
            if len(args) > 1:
                raise TypeError(
                    "cannot create a YANG container with >1 argument")
            all_attr = True
            for e in self._pyangbind_elements:
                if not hasattr(args[0], e):
                    all_attr = False
                    break
            if not all_attr:
                raise ValueError(
                    "Supplied object did not have the correct attributes")
            for e in self._pyangbind_elements:
                nobj = getattr(args[0], e)
                if nobj._changed() is False:
                    continue
                setmethod = getattr(self, "_set_%s" % e)
                if load is None:
                    setmethod(getattr(args[0], e))
                else:
                    setmethod(getattr(args[0], e), load=load)

    def _path(self):
        if hasattr(self, "_parent"):
            return self._parent._path() + [self._yang_name]
        else:
            return [
                "network-instances",
                "network-instance",
                "protocols",
                "protocol",
                "ospfv2",
                "areas",
                "area",
                "lsdb",
                "lsa-types",
                "lsa-type",
                "lsas",
                "lsa",
                "nssa-external-lsa",
            ]

    def _get_state(self):
        """
    Getter method for state, mapped from YANG variable /network_instances/network_instance/protocols/protocol/ospfv2/areas/area/lsdb/lsa_types/lsa_type/lsas/lsa/nssa_external_lsa/state (container)

    YANG Description: State parameters for the AS external LSA
    """
        return self.__state

    def _set_state(self, v, load=False):
        """
    Setter method for state, mapped from YANG variable /network_instances/network_instance/protocols/protocol/ospfv2/areas/area/lsdb/lsa_types/lsa_type/lsas/lsa/nssa_external_lsa/state (container)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_state is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_state() directly.

    YANG Description: State parameters for the AS external LSA
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(
                v,
                base=state.state,
                is_container="container",
                yang_name="state",
                parent=self,
                path_helper=self._path_helper,
                extmethods=self._extmethods,
                register_paths=True,
                extensions=None,
                namespace="http://openconfig.net/yang/network-instance",
                defining_module="openconfig-network-instance",
                yang_type="container",
                is_config=False,
            )
        except (TypeError, ValueError):
            raise ValueError({
                "error-string":
                """state must be of a type compatible with container""",
                "defined-type":
                "container",
                "generated-type":
                """YANGDynClass(base=state.state, is_container='container', yang_name="state", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='container', is_config=False)""",
            })

        self.__state = t
        if hasattr(self, "_set"):
            self._set()

    def _unset_state(self):
        self.__state = YANGDynClass(
            base=state.state,
            is_container="container",
            yang_name="state",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            extensions=None,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="container",
            is_config=False,
        )

    def _get_types_of_service(self):
        """
    Getter method for types_of_service, mapped from YANG variable /network_instances/network_instance/protocols/protocol/ospfv2/areas/area/lsdb/lsa_types/lsa_type/lsas/lsa/nssa_external_lsa/types_of_service (container)

    YANG Description: Breakdown of the NSSA External LSA contents specifying multiple
TOS values
    """
        return self.__types_of_service

    def _set_types_of_service(self, v, load=False):
        """
    Setter method for types_of_service, mapped from YANG variable /network_instances/network_instance/protocols/protocol/ospfv2/areas/area/lsdb/lsa_types/lsa_type/lsas/lsa/nssa_external_lsa/types_of_service (container)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_types_of_service is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_types_of_service() directly.

    YANG Description: Breakdown of the NSSA External LSA contents specifying multiple
TOS values
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(
                v,
                base=types_of_service.types_of_service,
                is_container="container",
                yang_name="types-of-service",
                parent=self,
                path_helper=self._path_helper,
                extmethods=self._extmethods,
                register_paths=True,
                extensions=None,
                namespace="http://openconfig.net/yang/network-instance",
                defining_module="openconfig-network-instance",
                yang_type="container",
                is_config=False,
            )
        except (TypeError, ValueError):
            raise ValueError({
                "error-string":
                """types_of_service must be of a type compatible with container""",
                "defined-type":
                "container",
                "generated-type":
                """YANGDynClass(base=types_of_service.types_of_service, is_container='container', yang_name="types-of-service", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='container', is_config=False)""",
            })

        self.__types_of_service = t
        if hasattr(self, "_set"):
            self._set()

    def _unset_types_of_service(self):
        self.__types_of_service = YANGDynClass(
            base=types_of_service.types_of_service,
            is_container="container",
            yang_name="types-of-service",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            extensions=None,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="container",
            is_config=False,
        )

    state = __builtin__.property(_get_state)
    types_of_service = __builtin__.property(_get_types_of_service)

    _pyangbind_elements = OrderedDict([("state", state),
                                       ("types_of_service", types_of_service)])
Пример #13
0
class config(PybindBase):
    """
  This class was auto-generated by the PythonClass plugin for PYANG
  from YANG module openconfig-network-instance-l2 - based on the path /network-instances/network-instance/protocols/protocol/bgp/peer-groups/peer-group/graceful-restart/config. Each member element of
  the container is represented as a class variable - with a specific
  YANG type.

  YANG Description: Configuration parameters relating to graceful-restart
  """
    __slots__ = (
        "_path_helper",
        "_extmethods",
        "__enabled",
        "__restart_time",
        "__stale_routes_time",
        "__helper_only",
    )

    _yang_name = "config"

    _pybind_generated_by = "container"

    def __init__(self, *args, **kwargs):

        self._path_helper = False

        self._extmethods = False
        self.__enabled = YANGDynClass(
            base=YANGBool,
            is_leaf=True,
            yang_name="enabled",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="boolean",
            is_config=True,
        )
        self.__restart_time = YANGDynClass(
            base=RestrictedClassType(
                base_type=RestrictedClassType(
                    base_type=int,
                    restriction_dict={"range": ["0..65535"]},
                    int_size=16),
                restriction_dict={"range": ["0..4096"]},
            ),
            is_leaf=True,
            yang_name="restart-time",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="uint16",
            is_config=True,
        )
        self.__stale_routes_time = YANGDynClass(
            base=RestrictedPrecisionDecimalType(precision=2),
            is_leaf=True,
            yang_name="stale-routes-time",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="decimal64",
            is_config=True,
        )
        self.__helper_only = YANGDynClass(
            base=YANGBool,
            is_leaf=True,
            yang_name="helper-only",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="boolean",
            is_config=True,
        )

        load = kwargs.pop("load", None)
        if args:
            if len(args) > 1:
                raise TypeError(
                    "cannot create a YANG container with >1 argument")
            all_attr = True
            for e in self._pyangbind_elements:
                if not hasattr(args[0], e):
                    all_attr = False
                    break
            if not all_attr:
                raise ValueError(
                    "Supplied object did not have the correct attributes")
            for e in self._pyangbind_elements:
                nobj = getattr(args[0], e)
                if nobj._changed() is False:
                    continue
                setmethod = getattr(self, "_set_%s" % e)
                if load is None:
                    setmethod(getattr(args[0], e))
                else:
                    setmethod(getattr(args[0], e), load=load)

    def _path(self):
        if hasattr(self, "_parent"):
            return self._parent._path() + [self._yang_name]
        else:
            return [
                "network-instances",
                "network-instance",
                "protocols",
                "protocol",
                "bgp",
                "peer-groups",
                "peer-group",
                "graceful-restart",
                "config",
            ]

    def _get_enabled(self):
        """
    Getter method for enabled, mapped from YANG variable /network_instances/network_instance/protocols/protocol/bgp/peer_groups/peer_group/graceful_restart/config/enabled (boolean)

    YANG Description: Enable or disable the graceful-restart capability.
    """
        return self.__enabled

    def _set_enabled(self, v, load=False):
        """
    Setter method for enabled, mapped from YANG variable /network_instances/network_instance/protocols/protocol/bgp/peer_groups/peer_group/graceful_restart/config/enabled (boolean)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_enabled is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_enabled() directly.

    YANG Description: Enable or disable the graceful-restart capability.
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(
                v,
                base=YANGBool,
                is_leaf=True,
                yang_name="enabled",
                parent=self,
                path_helper=self._path_helper,
                extmethods=self._extmethods,
                register_paths=True,
                namespace="http://openconfig.net/yang/network-instance",
                defining_module="openconfig-network-instance",
                yang_type="boolean",
                is_config=True,
            )
        except (TypeError, ValueError):
            raise ValueError({
                "error-string":
                """enabled must be of a type compatible with boolean""",
                "defined-type":
                "boolean",
                "generated-type":
                """YANGDynClass(base=YANGBool, is_leaf=True, yang_name="enabled", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='boolean', is_config=True)""",
            })

        self.__enabled = t
        if hasattr(self, "_set"):
            self._set()

    def _unset_enabled(self):
        self.__enabled = YANGDynClass(
            base=YANGBool,
            is_leaf=True,
            yang_name="enabled",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="boolean",
            is_config=True,
        )

    def _get_restart_time(self):
        """
    Getter method for restart_time, mapped from YANG variable /network_instances/network_instance/protocols/protocol/bgp/peer_groups/peer_group/graceful_restart/config/restart_time (uint16)

    YANG Description: Estimated time (in seconds) for the local BGP speaker to
restart a session. This value is advertise in the graceful
restart BGP capability.  This is a 12-bit value, referred to
as Restart Time in RFC4724.  Per RFC4724, the suggested
default value is <= the hold-time value.
    """
        return self.__restart_time

    def _set_restart_time(self, v, load=False):
        """
    Setter method for restart_time, mapped from YANG variable /network_instances/network_instance/protocols/protocol/bgp/peer_groups/peer_group/graceful_restart/config/restart_time (uint16)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_restart_time is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_restart_time() directly.

    YANG Description: Estimated time (in seconds) for the local BGP speaker to
restart a session. This value is advertise in the graceful
restart BGP capability.  This is a 12-bit value, referred to
as Restart Time in RFC4724.  Per RFC4724, the suggested
default value is <= the hold-time value.
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(
                v,
                base=RestrictedClassType(
                    base_type=RestrictedClassType(
                        base_type=int,
                        restriction_dict={"range": ["0..65535"]},
                        int_size=16,
                    ),
                    restriction_dict={"range": ["0..4096"]},
                ),
                is_leaf=True,
                yang_name="restart-time",
                parent=self,
                path_helper=self._path_helper,
                extmethods=self._extmethods,
                register_paths=True,
                namespace="http://openconfig.net/yang/network-instance",
                defining_module="openconfig-network-instance",
                yang_type="uint16",
                is_config=True,
            )
        except (TypeError, ValueError):
            raise ValueError({
                "error-string":
                """restart_time must be of a type compatible with uint16""",
                "defined-type":
                "uint16",
                "generated-type":
                """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['0..4096']}), is_leaf=True, yang_name="restart-time", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='uint16', is_config=True)""",
            })

        self.__restart_time = t
        if hasattr(self, "_set"):
            self._set()

    def _unset_restart_time(self):
        self.__restart_time = YANGDynClass(
            base=RestrictedClassType(
                base_type=RestrictedClassType(
                    base_type=int,
                    restriction_dict={"range": ["0..65535"]},
                    int_size=16),
                restriction_dict={"range": ["0..4096"]},
            ),
            is_leaf=True,
            yang_name="restart-time",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="uint16",
            is_config=True,
        )

    def _get_stale_routes_time(self):
        """
    Getter method for stale_routes_time, mapped from YANG variable /network_instances/network_instance/protocols/protocol/bgp/peer_groups/peer_group/graceful_restart/config/stale_routes_time (decimal64)

    YANG Description: An upper-bound on the time thate stale routes will be
retained by a router after a session is restarted. If an
End-of-RIB (EOR) marker is received prior to this timer
expiring stale-routes will be flushed upon its receipt - if
no EOR is received, then when this timer expires stale paths
will be purged. This timer is referred to as the
Selection_Deferral_Timer in RFC4724
    """
        return self.__stale_routes_time

    def _set_stale_routes_time(self, v, load=False):
        """
    Setter method for stale_routes_time, mapped from YANG variable /network_instances/network_instance/protocols/protocol/bgp/peer_groups/peer_group/graceful_restart/config/stale_routes_time (decimal64)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_stale_routes_time is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_stale_routes_time() directly.

    YANG Description: An upper-bound on the time thate stale routes will be
retained by a router after a session is restarted. If an
End-of-RIB (EOR) marker is received prior to this timer
expiring stale-routes will be flushed upon its receipt - if
no EOR is received, then when this timer expires stale paths
will be purged. This timer is referred to as the
Selection_Deferral_Timer in RFC4724
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(
                v,
                base=RestrictedPrecisionDecimalType(precision=2),
                is_leaf=True,
                yang_name="stale-routes-time",
                parent=self,
                path_helper=self._path_helper,
                extmethods=self._extmethods,
                register_paths=True,
                namespace="http://openconfig.net/yang/network-instance",
                defining_module="openconfig-network-instance",
                yang_type="decimal64",
                is_config=True,
            )
        except (TypeError, ValueError):
            raise ValueError({
                "error-string":
                """stale_routes_time must be of a type compatible with decimal64""",
                "defined-type":
                "decimal64",
                "generated-type":
                """YANGDynClass(base=RestrictedPrecisionDecimalType(precision=2), is_leaf=True, yang_name="stale-routes-time", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='decimal64', is_config=True)""",
            })

        self.__stale_routes_time = t
        if hasattr(self, "_set"):
            self._set()

    def _unset_stale_routes_time(self):
        self.__stale_routes_time = YANGDynClass(
            base=RestrictedPrecisionDecimalType(precision=2),
            is_leaf=True,
            yang_name="stale-routes-time",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="decimal64",
            is_config=True,
        )

    def _get_helper_only(self):
        """
    Getter method for helper_only, mapped from YANG variable /network_instances/network_instance/protocols/protocol/bgp/peer_groups/peer_group/graceful_restart/config/helper_only (boolean)

    YANG Description: Enable graceful-restart in helper mode only. When this
leaf is set, the local system does not retain forwarding
its own state during a restart, but supports procedures
for the receiving speaker, as defined in RFC4724.
    """
        return self.__helper_only

    def _set_helper_only(self, v, load=False):
        """
    Setter method for helper_only, mapped from YANG variable /network_instances/network_instance/protocols/protocol/bgp/peer_groups/peer_group/graceful_restart/config/helper_only (boolean)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_helper_only is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_helper_only() directly.

    YANG Description: Enable graceful-restart in helper mode only. When this
leaf is set, the local system does not retain forwarding
its own state during a restart, but supports procedures
for the receiving speaker, as defined in RFC4724.
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(
                v,
                base=YANGBool,
                is_leaf=True,
                yang_name="helper-only",
                parent=self,
                path_helper=self._path_helper,
                extmethods=self._extmethods,
                register_paths=True,
                namespace="http://openconfig.net/yang/network-instance",
                defining_module="openconfig-network-instance",
                yang_type="boolean",
                is_config=True,
            )
        except (TypeError, ValueError):
            raise ValueError({
                "error-string":
                """helper_only must be of a type compatible with boolean""",
                "defined-type":
                "boolean",
                "generated-type":
                """YANGDynClass(base=YANGBool, is_leaf=True, yang_name="helper-only", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='boolean', is_config=True)""",
            })

        self.__helper_only = t
        if hasattr(self, "_set"):
            self._set()

    def _unset_helper_only(self):
        self.__helper_only = YANGDynClass(
            base=YANGBool,
            is_leaf=True,
            yang_name="helper-only",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="boolean",
            is_config=True,
        )

    enabled = __builtin__.property(_get_enabled, _set_enabled)
    restart_time = __builtin__.property(_get_restart_time, _set_restart_time)
    stale_routes_time = __builtin__.property(_get_stale_routes_time,
                                             _set_stale_routes_time)
    helper_only = __builtin__.property(_get_helper_only, _set_helper_only)

    _pyangbind_elements = OrderedDict([
        ("enabled", enabled),
        ("restart_time", restart_time),
        ("stale_routes_time", stale_routes_time),
        ("helper_only", helper_only),
    ])
Пример #14
0
class state(PybindBase):
    """
  This class was auto-generated by the PythonClass plugin for PYANG
  from YANG module openconfig-network-instance-l2 - based on the path /network-instances/network-instance/protocols/protocol/isis/levels/level/link-state-database/lsp/tlvs/tlv/isis-neighbor-attribute/neighbors/neighbor/subTLVs/subTLVs/lan-adjacency-sid/sid/state. Each member element of
  the container is represented as a class variable - with a specific
  YANG type.

  YANG Description: State parameters of LAN Adjacency-SID.
  """
    __slots__ = ("_path_helper", "_extmethods", "__value", "__flags",
                 "__weight", "__neighbor_id")

    _yang_name = "state"

    _pybind_generated_by = "container"

    def __init__(self, *args, **kwargs):

        self._path_helper = False

        self._extmethods = False
        self.__value = YANGDynClass(
            base=RestrictedClassType(
                base_type=long,
                restriction_dict={"range": ["0..4294967295"]},
                int_size=32,
            ),
            is_leaf=True,
            yang_name="value",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="uint32",
            is_config=False,
        )
        self.__flags = YANGDynClass(
            base=TypedListType(allowed_type=RestrictedClassType(
                base_type=six.text_type,
                restriction_type="dict_key",
                restriction_arg={
                    "ADDRESS_FAMILY": {},
                    "BACKUP": {},
                    "VALUE": {},
                    "LOCAL": {},
                    "SET": {},
                },
            )),
            is_leaf=False,
            yang_name="flags",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="enumeration",
            is_config=False,
        )
        self.__weight = YANGDynClass(
            base=RestrictedClassType(base_type=int,
                                     restriction_dict={"range": ["0..255"]},
                                     int_size=8),
            is_leaf=True,
            yang_name="weight",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="uint8",
            is_config=False,
        )
        self.__neighbor_id = YANGDynClass(
            base=RestrictedClassType(
                base_type=six.text_type,
                restriction_dict={
                    "pattern":
                    "[0-9A-Fa-f]{4}\\.[0-9A-Fa-f]{4}\\.[0-9A-Fa-f]{4}"
                },
            ),
            is_leaf=True,
            yang_name="neighbor-id",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="oc-isis-types:system-id",
            is_config=False,
        )

        load = kwargs.pop("load", None)
        if args:
            if len(args) > 1:
                raise TypeError(
                    "cannot create a YANG container with >1 argument")
            all_attr = True
            for e in self._pyangbind_elements:
                if not hasattr(args[0], e):
                    all_attr = False
                    break
            if not all_attr:
                raise ValueError(
                    "Supplied object did not have the correct attributes")
            for e in self._pyangbind_elements:
                nobj = getattr(args[0], e)
                if nobj._changed() is False:
                    continue
                setmethod = getattr(self, "_set_%s" % e)
                if load is None:
                    setmethod(getattr(args[0], e))
                else:
                    setmethod(getattr(args[0], e), load=load)

    def _path(self):
        if hasattr(self, "_parent"):
            return self._parent._path() + [self._yang_name]
        else:
            return [
                "network-instances",
                "network-instance",
                "protocols",
                "protocol",
                "isis",
                "levels",
                "level",
                "link-state-database",
                "lsp",
                "tlvs",
                "tlv",
                "isis-neighbor-attribute",
                "neighbors",
                "neighbor",
                "subTLVs",
                "subTLVs",
                "lan-adjacency-sid",
                "sid",
                "state",
            ]

    def _get_value(self):
        """
    Getter method for value, mapped from YANG variable /network_instances/network_instance/protocols/protocol/isis/levels/level/link_state_database/lsp/tlvs/tlv/isis_neighbor_attribute/neighbors/neighbor/subTLVs/subTLVs/lan_adjacency_sid/sid/state/value (uint32)

    YANG Description: LAN Adjacency-SID value.
    """
        return self.__value

    def _set_value(self, v, load=False):
        """
    Setter method for value, mapped from YANG variable /network_instances/network_instance/protocols/protocol/isis/levels/level/link_state_database/lsp/tlvs/tlv/isis_neighbor_attribute/neighbors/neighbor/subTLVs/subTLVs/lan_adjacency_sid/sid/state/value (uint32)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_value is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_value() directly.

    YANG Description: LAN Adjacency-SID value.
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(
                v,
                base=RestrictedClassType(
                    base_type=long,
                    restriction_dict={"range": ["0..4294967295"]},
                    int_size=32,
                ),
                is_leaf=True,
                yang_name="value",
                parent=self,
                path_helper=self._path_helper,
                extmethods=self._extmethods,
                register_paths=True,
                namespace="http://openconfig.net/yang/network-instance",
                defining_module="openconfig-network-instance",
                yang_type="uint32",
                is_config=False,
            )
        except (TypeError, ValueError):
            raise ValueError({
                "error-string":
                """value must be of a type compatible with uint32""",
                "defined-type":
                "uint32",
                "generated-type":
                """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='uint32', is_config=False)""",
            })

        self.__value = t
        if hasattr(self, "_set"):
            self._set()

    def _unset_value(self):
        self.__value = YANGDynClass(
            base=RestrictedClassType(
                base_type=long,
                restriction_dict={"range": ["0..4294967295"]},
                int_size=32,
            ),
            is_leaf=True,
            yang_name="value",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="uint32",
            is_config=False,
        )

    def _get_flags(self):
        """
    Getter method for flags, mapped from YANG variable /network_instances/network_instance/protocols/protocol/isis/levels/level/link_state_database/lsp/tlvs/tlv/isis_neighbor_attribute/neighbors/neighbor/subTLVs/subTLVs/lan_adjacency_sid/sid/state/flags (enumeration)

    YANG Description: Flags associated with LAN-Adj-Segment-ID.
    """
        return self.__flags

    def _set_flags(self, v, load=False):
        """
    Setter method for flags, mapped from YANG variable /network_instances/network_instance/protocols/protocol/isis/levels/level/link_state_database/lsp/tlvs/tlv/isis_neighbor_attribute/neighbors/neighbor/subTLVs/subTLVs/lan_adjacency_sid/sid/state/flags (enumeration)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_flags is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_flags() directly.

    YANG Description: Flags associated with LAN-Adj-Segment-ID.
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(
                v,
                base=TypedListType(allowed_type=RestrictedClassType(
                    base_type=six.text_type,
                    restriction_type="dict_key",
                    restriction_arg={
                        "ADDRESS_FAMILY": {},
                        "BACKUP": {},
                        "VALUE": {},
                        "LOCAL": {},
                        "SET": {},
                    },
                )),
                is_leaf=False,
                yang_name="flags",
                parent=self,
                path_helper=self._path_helper,
                extmethods=self._extmethods,
                register_paths=True,
                namespace="http://openconfig.net/yang/network-instance",
                defining_module="openconfig-network-instance",
                yang_type="enumeration",
                is_config=False,
            )
        except (TypeError, ValueError):
            raise ValueError({
                "error-string":
                """flags must be of a type compatible with enumeration""",
                "defined-type":
                "openconfig-network-instance:enumeration",
                "generated-type":
                """YANGDynClass(base=TypedListType(allowed_type=RestrictedClassType(base_type=six.text_type,                                     restriction_type="dict_key",                                     restriction_arg={'ADDRESS_FAMILY': {}, 'BACKUP': {}, 'VALUE': {}, 'LOCAL': {}, 'SET': {}},)), is_leaf=False, yang_name="flags", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='enumeration', is_config=False)""",
            })

        self.__flags = t
        if hasattr(self, "_set"):
            self._set()

    def _unset_flags(self):
        self.__flags = YANGDynClass(
            base=TypedListType(allowed_type=RestrictedClassType(
                base_type=six.text_type,
                restriction_type="dict_key",
                restriction_arg={
                    "ADDRESS_FAMILY": {},
                    "BACKUP": {},
                    "VALUE": {},
                    "LOCAL": {},
                    "SET": {},
                },
            )),
            is_leaf=False,
            yang_name="flags",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="enumeration",
            is_config=False,
        )

    def _get_weight(self):
        """
    Getter method for weight, mapped from YANG variable /network_instances/network_instance/protocols/protocol/isis/levels/level/link_state_database/lsp/tlvs/tlv/isis_neighbor_attribute/neighbors/neighbor/subTLVs/subTLVs/lan_adjacency_sid/sid/state/weight (uint8)

    YANG Description: Value that represents the weight of the Adj-SID for the purpose
of load balancing.
    """
        return self.__weight

    def _set_weight(self, v, load=False):
        """
    Setter method for weight, mapped from YANG variable /network_instances/network_instance/protocols/protocol/isis/levels/level/link_state_database/lsp/tlvs/tlv/isis_neighbor_attribute/neighbors/neighbor/subTLVs/subTLVs/lan_adjacency_sid/sid/state/weight (uint8)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_weight is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_weight() directly.

    YANG Description: Value that represents the weight of the Adj-SID for the purpose
of load balancing.
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(
                v,
                base=RestrictedClassType(
                    base_type=int,
                    restriction_dict={"range": ["0..255"]},
                    int_size=8),
                is_leaf=True,
                yang_name="weight",
                parent=self,
                path_helper=self._path_helper,
                extmethods=self._extmethods,
                register_paths=True,
                namespace="http://openconfig.net/yang/network-instance",
                defining_module="openconfig-network-instance",
                yang_type="uint8",
                is_config=False,
            )
        except (TypeError, ValueError):
            raise ValueError({
                "error-string":
                """weight must be of a type compatible with uint8""",
                "defined-type":
                "uint8",
                "generated-type":
                """YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), is_leaf=True, yang_name="weight", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='uint8', is_config=False)""",
            })

        self.__weight = t
        if hasattr(self, "_set"):
            self._set()

    def _unset_weight(self):
        self.__weight = YANGDynClass(
            base=RestrictedClassType(base_type=int,
                                     restriction_dict={"range": ["0..255"]},
                                     int_size=8),
            is_leaf=True,
            yang_name="weight",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="uint8",
            is_config=False,
        )

    def _get_neighbor_id(self):
        """
    Getter method for neighbor_id, mapped from YANG variable /network_instances/network_instance/protocols/protocol/isis/levels/level/link_state_database/lsp/tlvs/tlv/isis_neighbor_attribute/neighbors/neighbor/subTLVs/subTLVs/lan_adjacency_sid/sid/state/neighbor_id (oc-isis-types:system-id)

    YANG Description: System ID of the neighbor associated with the LAN-Adj-Segment-ID
value.
    """
        return self.__neighbor_id

    def _set_neighbor_id(self, v, load=False):
        """
    Setter method for neighbor_id, mapped from YANG variable /network_instances/network_instance/protocols/protocol/isis/levels/level/link_state_database/lsp/tlvs/tlv/isis_neighbor_attribute/neighbors/neighbor/subTLVs/subTLVs/lan_adjacency_sid/sid/state/neighbor_id (oc-isis-types:system-id)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_neighbor_id is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_neighbor_id() directly.

    YANG Description: System ID of the neighbor associated with the LAN-Adj-Segment-ID
value.
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(
                v,
                base=RestrictedClassType(
                    base_type=six.text_type,
                    restriction_dict={
                        "pattern":
                        "[0-9A-Fa-f]{4}\\.[0-9A-Fa-f]{4}\\.[0-9A-Fa-f]{4}"
                    },
                ),
                is_leaf=True,
                yang_name="neighbor-id",
                parent=self,
                path_helper=self._path_helper,
                extmethods=self._extmethods,
                register_paths=True,
                namespace="http://openconfig.net/yang/network-instance",
                defining_module="openconfig-network-instance",
                yang_type="oc-isis-types:system-id",
                is_config=False,
            )
        except (TypeError, ValueError):
            raise ValueError({
                "error-string":
                """neighbor_id must be of a type compatible with oc-isis-types:system-id""",
                "defined-type":
                "oc-isis-types:system-id",
                "generated-type":
                """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '[0-9A-Fa-f]{4}\\.[0-9A-Fa-f]{4}\\.[0-9A-Fa-f]{4}'}), is_leaf=True, yang_name="neighbor-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='oc-isis-types:system-id', is_config=False)""",
            })

        self.__neighbor_id = t
        if hasattr(self, "_set"):
            self._set()

    def _unset_neighbor_id(self):
        self.__neighbor_id = YANGDynClass(
            base=RestrictedClassType(
                base_type=six.text_type,
                restriction_dict={
                    "pattern":
                    "[0-9A-Fa-f]{4}\\.[0-9A-Fa-f]{4}\\.[0-9A-Fa-f]{4}"
                },
            ),
            is_leaf=True,
            yang_name="neighbor-id",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="oc-isis-types:system-id",
            is_config=False,
        )

    value = __builtin__.property(_get_value)
    flags = __builtin__.property(_get_flags)
    weight = __builtin__.property(_get_weight)
    neighbor_id = __builtin__.property(_get_neighbor_id)

    _pyangbind_elements = OrderedDict([
        ("value", value),
        ("flags", flags),
        ("weight", weight),
        ("neighbor_id", neighbor_id),
    ])
Пример #15
0
class aggregate_sid_counters(PybindBase):
    """
  This class was auto-generated by the PythonClass plugin for PYANG
  from YANG module openconfig-network-instance - based on the path /network-instances/network-instance/mpls/signaling-protocols/segment-routing/aggregate-sid-counters. Each member element of
  the container is represented as a class variable - with a specific
  YANG type.

  YANG Description: Per-SID counters aggregated across all interfaces on the local system
  """
    __slots__ = ("_path_helper", "_extmethods", "__aggregate_sid_counter")

    _yang_name = "aggregate-sid-counters"

    _pybind_generated_by = "container"

    def __init__(self, *args, **kwargs):

        self._path_helper = False

        self._extmethods = False
        self.__aggregate_sid_counter = YANGDynClass(
            base=YANGListType(
                "mpls_label",
                aggregate_sid_counter.aggregate_sid_counter,
                yang_name="aggregate-sid-counter",
                parent=self,
                is_container="list",
                user_ordered=False,
                path_helper=self._path_helper,
                yang_keys="mpls-label",
                extensions=None,
            ),
            is_container="list",
            yang_name="aggregate-sid-counter",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            extensions=None,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="list",
            is_config=True,
        )

        load = kwargs.pop("load", None)
        if args:
            if len(args) > 1:
                raise TypeError("cannot create a YANG container with >1 argument")
            all_attr = True
            for e in self._pyangbind_elements:
                if not hasattr(args[0], e):
                    all_attr = False
                    break
            if not all_attr:
                raise ValueError("Supplied object did not have the correct attributes")
            for e in self._pyangbind_elements:
                nobj = getattr(args[0], e)
                if nobj._changed() is False:
                    continue
                setmethod = getattr(self, "_set_%s" % e)
                if load is None:
                    setmethod(getattr(args[0], e))
                else:
                    setmethod(getattr(args[0], e), load=load)

    def _path(self):
        if hasattr(self, "_parent"):
            return self._parent._path() + [self._yang_name]
        else:
            return [
                "network-instances",
                "network-instance",
                "mpls",
                "signaling-protocols",
                "segment-routing",
                "aggregate-sid-counters",
            ]

    def _get_aggregate_sid_counter(self):
        """
    Getter method for aggregate_sid_counter, mapped from YANG variable /network_instances/network_instance/mpls/signaling_protocols/segment_routing/aggregate_sid_counters/aggregate_sid_counter (list)

    YANG Description: Counters aggregated across all of the interfaces of the local
system corresponding to traffic received or forwarded with a
particular SID
    """
        return self.__aggregate_sid_counter

    def _set_aggregate_sid_counter(self, v, load=False):
        """
    Setter method for aggregate_sid_counter, mapped from YANG variable /network_instances/network_instance/mpls/signaling_protocols/segment_routing/aggregate_sid_counters/aggregate_sid_counter (list)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_aggregate_sid_counter is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_aggregate_sid_counter() directly.

    YANG Description: Counters aggregated across all of the interfaces of the local
system corresponding to traffic received or forwarded with a
particular SID
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(
                v,
                base=YANGListType(
                    "mpls_label",
                    aggregate_sid_counter.aggregate_sid_counter,
                    yang_name="aggregate-sid-counter",
                    parent=self,
                    is_container="list",
                    user_ordered=False,
                    path_helper=self._path_helper,
                    yang_keys="mpls-label",
                    extensions=None,
                ),
                is_container="list",
                yang_name="aggregate-sid-counter",
                parent=self,
                path_helper=self._path_helper,
                extmethods=self._extmethods,
                register_paths=True,
                extensions=None,
                namespace="http://openconfig.net/yang/network-instance",
                defining_module="openconfig-network-instance",
                yang_type="list",
                is_config=True,
            )
        except (TypeError, ValueError):
            raise ValueError(
                {
                    "error-string": """aggregate_sid_counter must be of a type compatible with list""",
                    "defined-type": "list",
                    "generated-type": """YANGDynClass(base=YANGListType("mpls_label",aggregate_sid_counter.aggregate_sid_counter, yang_name="aggregate-sid-counter", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='mpls-label', extensions=None), is_container='list', yang_name="aggregate-sid-counter", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='list', is_config=True)""",
                }
            )

        self.__aggregate_sid_counter = t
        if hasattr(self, "_set"):
            self._set()

    def _unset_aggregate_sid_counter(self):
        self.__aggregate_sid_counter = YANGDynClass(
            base=YANGListType(
                "mpls_label",
                aggregate_sid_counter.aggregate_sid_counter,
                yang_name="aggregate-sid-counter",
                parent=self,
                is_container="list",
                user_ordered=False,
                path_helper=self._path_helper,
                yang_keys="mpls-label",
                extensions=None,
            ),
            is_container="list",
            yang_name="aggregate-sid-counter",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            extensions=None,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="list",
            is_config=True,
        )

    aggregate_sid_counter = __builtin__.property(
        _get_aggregate_sid_counter, _set_aggregate_sid_counter
    )

    _pyangbind_elements = OrderedDict(
        [("aggregate_sid_counter", aggregate_sid_counter)]
    )
Пример #16
0
class state(PybindBase):
    """
  This class was auto-generated by the PythonClass plugin for PYANG
  from YANG module openconfig-network-instance-l2 - based on the path /network-instances/network-instance/mpls/lsps/constrained-path/tunnels/tunnel/bandwidth/state. Each member element of
  the container is represented as a class variable - with a specific
  YANG type.

  YANG Description: State parameters related to bandwidth
configuration of TE tunnels
  """
    __slots__ = (
        "_path_helper",
        "_extmethods",
        "__specification_type",
        "__set_bandwidth",
        "__signaled_bandwidth",
    )

    _yang_name = "state"

    _pybind_generated_by = "container"

    def __init__(self, *args, **kwargs):

        self._path_helper = False

        self._extmethods = False
        self.__specification_type = YANGDynClass(
            base=RestrictedClassType(
                base_type=six.text_type,
                restriction_type="dict_key",
                restriction_arg={
                    "SPECIFIED": {},
                    "AUTO": {}
                },
            ),
            default=six.text_type("SPECIFIED"),
            is_leaf=True,
            yang_name="specification-type",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="te-bandwidth-type",
            is_config=False,
        )
        self.__set_bandwidth = YANGDynClass(
            base=RestrictedClassType(
                base_type=long,
                restriction_dict={"range": ["0..18446744073709551615"]},
                int_size=64,
            ),
            is_leaf=True,
            yang_name="set-bandwidth",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="oc-mplst:bandwidth-kbps",
            is_config=False,
        )
        self.__signaled_bandwidth = YANGDynClass(
            base=RestrictedClassType(
                base_type=long,
                restriction_dict={"range": ["0..18446744073709551615"]},
                int_size=64,
            ),
            is_leaf=True,
            yang_name="signaled-bandwidth",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="oc-mplst:bandwidth-kbps",
            is_config=False,
        )

        load = kwargs.pop("load", None)
        if args:
            if len(args) > 1:
                raise TypeError(
                    "cannot create a YANG container with >1 argument")
            all_attr = True
            for e in self._pyangbind_elements:
                if not hasattr(args[0], e):
                    all_attr = False
                    break
            if not all_attr:
                raise ValueError(
                    "Supplied object did not have the correct attributes")
            for e in self._pyangbind_elements:
                nobj = getattr(args[0], e)
                if nobj._changed() is False:
                    continue
                setmethod = getattr(self, "_set_%s" % e)
                if load is None:
                    setmethod(getattr(args[0], e))
                else:
                    setmethod(getattr(args[0], e), load=load)

    def _path(self):
        if hasattr(self, "_parent"):
            return self._parent._path() + [self._yang_name]
        else:
            return [
                "network-instances",
                "network-instance",
                "mpls",
                "lsps",
                "constrained-path",
                "tunnels",
                "tunnel",
                "bandwidth",
                "state",
            ]

    def _get_specification_type(self):
        """
    Getter method for specification_type, mapped from YANG variable /network_instances/network_instance/mpls/lsps/constrained_path/tunnels/tunnel/bandwidth/state/specification_type (te-bandwidth-type)

    YANG Description: The method used for settign the bandwidth, either explicitly
specified or configured
    """
        return self.__specification_type

    def _set_specification_type(self, v, load=False):
        """
    Setter method for specification_type, mapped from YANG variable /network_instances/network_instance/mpls/lsps/constrained_path/tunnels/tunnel/bandwidth/state/specification_type (te-bandwidth-type)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_specification_type is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_specification_type() directly.

    YANG Description: The method used for settign the bandwidth, either explicitly
specified or configured
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(
                v,
                base=RestrictedClassType(
                    base_type=six.text_type,
                    restriction_type="dict_key",
                    restriction_arg={
                        "SPECIFIED": {},
                        "AUTO": {}
                    },
                ),
                default=six.text_type("SPECIFIED"),
                is_leaf=True,
                yang_name="specification-type",
                parent=self,
                path_helper=self._path_helper,
                extmethods=self._extmethods,
                register_paths=True,
                namespace="http://openconfig.net/yang/network-instance",
                defining_module="openconfig-network-instance",
                yang_type="te-bandwidth-type",
                is_config=False,
            )
        except (TypeError, ValueError):
            raise ValueError({
                "error-string":
                """specification_type must be of a type compatible with te-bandwidth-type""",
                "defined-type":
                "openconfig-network-instance:te-bandwidth-type",
                "generated-type":
                """YANGDynClass(base=RestrictedClassType(base_type=six.text_type,                                     restriction_type="dict_key",                                     restriction_arg={'SPECIFIED': {}, 'AUTO': {}},), default=six.text_type("SPECIFIED"), is_leaf=True, yang_name="specification-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='te-bandwidth-type', is_config=False)""",
            })

        self.__specification_type = t
        if hasattr(self, "_set"):
            self._set()

    def _unset_specification_type(self):
        self.__specification_type = YANGDynClass(
            base=RestrictedClassType(
                base_type=six.text_type,
                restriction_type="dict_key",
                restriction_arg={
                    "SPECIFIED": {},
                    "AUTO": {}
                },
            ),
            default=six.text_type("SPECIFIED"),
            is_leaf=True,
            yang_name="specification-type",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="te-bandwidth-type",
            is_config=False,
        )

    def _get_set_bandwidth(self):
        """
    Getter method for set_bandwidth, mapped from YANG variable /network_instances/network_instance/mpls/lsps/constrained_path/tunnels/tunnel/bandwidth/state/set_bandwidth (oc-mplst:bandwidth-kbps)

    YANG Description: set bandwidth explicitly, e.g., using
offline calculation
    """
        return self.__set_bandwidth

    def _set_set_bandwidth(self, v, load=False):
        """
    Setter method for set_bandwidth, mapped from YANG variable /network_instances/network_instance/mpls/lsps/constrained_path/tunnels/tunnel/bandwidth/state/set_bandwidth (oc-mplst:bandwidth-kbps)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_set_bandwidth is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_set_bandwidth() directly.

    YANG Description: set bandwidth explicitly, e.g., using
offline calculation
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(
                v,
                base=RestrictedClassType(
                    base_type=long,
                    restriction_dict={"range": ["0..18446744073709551615"]},
                    int_size=64,
                ),
                is_leaf=True,
                yang_name="set-bandwidth",
                parent=self,
                path_helper=self._path_helper,
                extmethods=self._extmethods,
                register_paths=True,
                namespace="http://openconfig.net/yang/network-instance",
                defining_module="openconfig-network-instance",
                yang_type="oc-mplst:bandwidth-kbps",
                is_config=False,
            )
        except (TypeError, ValueError):
            raise ValueError({
                "error-string":
                """set_bandwidth must be of a type compatible with oc-mplst:bandwidth-kbps""",
                "defined-type":
                "oc-mplst:bandwidth-kbps",
                "generated-type":
                """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range':  ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="set-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='oc-mplst:bandwidth-kbps', is_config=False)""",
            })

        self.__set_bandwidth = t
        if hasattr(self, "_set"):
            self._set()

    def _unset_set_bandwidth(self):
        self.__set_bandwidth = YANGDynClass(
            base=RestrictedClassType(
                base_type=long,
                restriction_dict={"range": ["0..18446744073709551615"]},
                int_size=64,
            ),
            is_leaf=True,
            yang_name="set-bandwidth",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="oc-mplst:bandwidth-kbps",
            is_config=False,
        )

    def _get_signaled_bandwidth(self):
        """
    Getter method for signaled_bandwidth, mapped from YANG variable /network_instances/network_instance/mpls/lsps/constrained_path/tunnels/tunnel/bandwidth/state/signaled_bandwidth (oc-mplst:bandwidth-kbps)

    YANG Description: The currently signaled bandwidth of the LSP. In the case where
the bandwidth is specified explicitly, then this will match the
value of the set-bandwidth leaf; in cases where the bandwidth is
dynamically computed by the system, the current value of the
bandwidth should be reflected.
    """
        return self.__signaled_bandwidth

    def _set_signaled_bandwidth(self, v, load=False):
        """
    Setter method for signaled_bandwidth, mapped from YANG variable /network_instances/network_instance/mpls/lsps/constrained_path/tunnels/tunnel/bandwidth/state/signaled_bandwidth (oc-mplst:bandwidth-kbps)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_signaled_bandwidth is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_signaled_bandwidth() directly.

    YANG Description: The currently signaled bandwidth of the LSP. In the case where
the bandwidth is specified explicitly, then this will match the
value of the set-bandwidth leaf; in cases where the bandwidth is
dynamically computed by the system, the current value of the
bandwidth should be reflected.
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(
                v,
                base=RestrictedClassType(
                    base_type=long,
                    restriction_dict={"range": ["0..18446744073709551615"]},
                    int_size=64,
                ),
                is_leaf=True,
                yang_name="signaled-bandwidth",
                parent=self,
                path_helper=self._path_helper,
                extmethods=self._extmethods,
                register_paths=True,
                namespace="http://openconfig.net/yang/network-instance",
                defining_module="openconfig-network-instance",
                yang_type="oc-mplst:bandwidth-kbps",
                is_config=False,
            )
        except (TypeError, ValueError):
            raise ValueError({
                "error-string":
                """signaled_bandwidth must be of a type compatible with oc-mplst:bandwidth-kbps""",
                "defined-type":
                "oc-mplst:bandwidth-kbps",
                "generated-type":
                """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range':  ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="signaled-bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='oc-mplst:bandwidth-kbps', is_config=False)""",
            })

        self.__signaled_bandwidth = t
        if hasattr(self, "_set"):
            self._set()

    def _unset_signaled_bandwidth(self):
        self.__signaled_bandwidth = YANGDynClass(
            base=RestrictedClassType(
                base_type=long,
                restriction_dict={"range": ["0..18446744073709551615"]},
                int_size=64,
            ),
            is_leaf=True,
            yang_name="signaled-bandwidth",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="oc-mplst:bandwidth-kbps",
            is_config=False,
        )

    specification_type = __builtin__.property(_get_specification_type)
    set_bandwidth = __builtin__.property(_get_set_bandwidth)
    signaled_bandwidth = __builtin__.property(_get_signaled_bandwidth)

    _pyangbind_elements = OrderedDict([
        ("specification_type", specification_type),
        ("set_bandwidth", set_bandwidth),
        ("signaled_bandwidth", signaled_bandwidth),
    ])
Пример #17
0
class config(PybindBase):
  """
  This class was auto-generated by the PythonClass plugin for PYANG
  from YANG module openconfig-interfaces - based on the path /interfaces/interface/subinterfaces/subinterface/ipv4/neighbors/neighbor/config. Each member element of
  the container is represented as a class variable - with a specific
  YANG type.

  YANG Description: Configuration data for each configured IPv4
address on the interface
  """
  __slots__ = ('_path_helper', '_extmethods', '__ip','__link_layer_address',)

  _yang_name = 'config'
  _yang_namespace = 'http://openconfig.net/yang/interfaces'

  _pybind_generated_by = 'container'

  def __init__(self, *args, **kwargs):

    self._path_helper = False

    self._extmethods = False
    self.__ip = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'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])'}), is_leaf=True, yang_name="ip", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces/ip', defining_module='openconfig-if-ip', yang_type='oc-inet:ipv4-address', is_config=True)
    self.__link_layer_address = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '^([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?$'}), is_leaf=True, yang_name="link-layer-address", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces/ip', defining_module='openconfig-if-ip', yang_type='oc-yang:phys-address', is_config=True)

    load = kwargs.pop("load", None)
    if args:
      if len(args) > 1:
        raise TypeError("cannot create a YANG container with >1 argument")
      all_attr = True
      for e in self._pyangbind_elements:
        if not hasattr(args[0], e):
          all_attr = False
          break
      if not all_attr:
        raise ValueError("Supplied object did not have the correct attributes")
      for e in self._pyangbind_elements:
        nobj = getattr(args[0], e)
        if nobj._changed() is False:
          continue
        setmethod = getattr(self, "_set_%s" % e)
        if load is None:
          setmethod(getattr(args[0], e))
        else:
          setmethod(getattr(args[0], e), load=load)

  def _path(self):
    if hasattr(self, "_parent"):
      return self._parent._path()+[self._yang_name]
    else:
      return ['interfaces', 'interface', 'subinterfaces', 'subinterface', 'ipv4', 'neighbors', 'neighbor', 'config']

  def _get_ip(self):
    """
    Getter method for ip, mapped from YANG variable /interfaces/interface/subinterfaces/subinterface/ipv4/neighbors/neighbor/config/ip (oc-inet:ipv4-address)

    YANG Description: The IPv4 address of the neighbor node.
    """
    return self.__ip
      
  def _set_ip(self, v, load=False):
    """
    Setter method for ip, mapped from YANG variable /interfaces/interface/subinterfaces/subinterface/ipv4/neighbors/neighbor/config/ip (oc-inet:ipv4-address)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_ip is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_ip() directly.

    YANG Description: The IPv4 address of the neighbor node.
    """
    if hasattr(v, "_utype"):
      v = v._utype(v)
    try:
      t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'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])'}), is_leaf=True, yang_name="ip", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces/ip', defining_module='openconfig-if-ip', yang_type='oc-inet:ipv4-address', is_config=True)
    except (TypeError, ValueError):
      raise ValueError({
          'error-string': """ip must be of a type compatible with oc-inet:ipv4-address""",
          'defined-type': "oc-inet:ipv4-address",
          'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'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])'}), is_leaf=True, yang_name="ip", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces/ip', defining_module='openconfig-if-ip', yang_type='oc-inet:ipv4-address', is_config=True)""",
        })

    self.__ip = t
    if hasattr(self, '_set'):
      self._set()

  def _unset_ip(self):
    self.__ip = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'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])'}), is_leaf=True, yang_name="ip", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces/ip', defining_module='openconfig-if-ip', yang_type='oc-inet:ipv4-address', is_config=True)


  def _get_link_layer_address(self):
    """
    Getter method for link_layer_address, mapped from YANG variable /interfaces/interface/subinterfaces/subinterface/ipv4/neighbors/neighbor/config/link_layer_address (oc-yang:phys-address)

    YANG Description: The link-layer address of the neighbor node.
    """
    return self.__link_layer_address
      
  def _set_link_layer_address(self, v, load=False):
    """
    Setter method for link_layer_address, mapped from YANG variable /interfaces/interface/subinterfaces/subinterface/ipv4/neighbors/neighbor/config/link_layer_address (oc-yang:phys-address)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_link_layer_address is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_link_layer_address() directly.

    YANG Description: The link-layer address of the neighbor node.
    """
    if hasattr(v, "_utype"):
      v = v._utype(v)
    try:
      t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '^([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?$'}), is_leaf=True, yang_name="link-layer-address", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces/ip', defining_module='openconfig-if-ip', yang_type='oc-yang:phys-address', is_config=True)
    except (TypeError, ValueError):
      raise ValueError({
          'error-string': """link_layer_address must be of a type compatible with oc-yang:phys-address""",
          'defined-type': "oc-yang:phys-address",
          'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '^([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?$'}), is_leaf=True, yang_name="link-layer-address", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces/ip', defining_module='openconfig-if-ip', yang_type='oc-yang:phys-address', is_config=True)""",
        })

    self.__link_layer_address = t
    if hasattr(self, '_set'):
      self._set()

  def _unset_link_layer_address(self):
    self.__link_layer_address = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '^([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?$'}), is_leaf=True, yang_name="link-layer-address", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces/ip', defining_module='openconfig-if-ip', yang_type='oc-yang:phys-address', is_config=True)

  ip = __builtin__.property(_get_ip, _set_ip)
  link_layer_address = __builtin__.property(_get_link_layer_address, _set_link_layer_address)


  _pyangbind_elements = OrderedDict([('ip', ip), ('link_layer_address', link_layer_address), ])
Пример #18
0
class state(PybindBase):
    """
  This class was auto-generated by the PythonClass plugin for PYANG
  from YANG module openconfig-network-instance - based on the path /network-instances/network-instance/protocols/protocol/isis/interfaces/interface/bfd/state. Each member element of
  the container is represented as a class variable - with a specific
  YANG type.

  YANG Description: This container defines BFD state information.
  """
    __slots__ = ("_path_helper", "_extmethods", "__bfd_tlv")

    _yang_name = "state"

    _pybind_generated_by = "container"

    def __init__(self, *args, **kwargs):

        self._path_helper = False

        self._extmethods = False
        self.__bfd_tlv = YANGDynClass(
            base=YANGBool,
            is_leaf=True,
            yang_name="bfd-tlv",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="boolean",
            is_config=False,
        )

        load = kwargs.pop("load", None)
        if args:
            if len(args) > 1:
                raise TypeError(
                    "cannot create a YANG container with >1 argument")
            all_attr = True
            for e in self._pyangbind_elements:
                if not hasattr(args[0], e):
                    all_attr = False
                    break
            if not all_attr:
                raise ValueError(
                    "Supplied object did not have the correct attributes")
            for e in self._pyangbind_elements:
                nobj = getattr(args[0], e)
                if nobj._changed() is False:
                    continue
                setmethod = getattr(self, "_set_%s" % e)
                if load is None:
                    setmethod(getattr(args[0], e))
                else:
                    setmethod(getattr(args[0], e), load=load)

    def _path(self):
        if hasattr(self, "_parent"):
            return self._parent._path() + [self._yang_name]
        else:
            return [
                "network-instances",
                "network-instance",
                "protocols",
                "protocol",
                "isis",
                "interfaces",
                "interface",
                "bfd",
                "state",
            ]

    def _get_bfd_tlv(self):
        """
    Getter method for bfd_tlv, mapped from YANG variable /network_instances/network_instance/protocols/protocol/isis/interfaces/interface/bfd/state/bfd_tlv (boolean)

    YANG Description: When set to true, BFD TLV is used. This enables support for the IS-IS
BFD TLV options, which specify that a BFD session must be established
before an IS-IS adjacency can transition to the established state.
This option should be enabled on all IS-IS neighbors on a shared
interface.
    """
        return self.__bfd_tlv

    def _set_bfd_tlv(self, v, load=False):
        """
    Setter method for bfd_tlv, mapped from YANG variable /network_instances/network_instance/protocols/protocol/isis/interfaces/interface/bfd/state/bfd_tlv (boolean)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_bfd_tlv is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_bfd_tlv() directly.

    YANG Description: When set to true, BFD TLV is used. This enables support for the IS-IS
BFD TLV options, which specify that a BFD session must be established
before an IS-IS adjacency can transition to the established state.
This option should be enabled on all IS-IS neighbors on a shared
interface.
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(
                v,
                base=YANGBool,
                is_leaf=True,
                yang_name="bfd-tlv",
                parent=self,
                path_helper=self._path_helper,
                extmethods=self._extmethods,
                register_paths=True,
                namespace="http://openconfig.net/yang/network-instance",
                defining_module="openconfig-network-instance",
                yang_type="boolean",
                is_config=False,
            )
        except (TypeError, ValueError):
            raise ValueError({
                "error-string":
                """bfd_tlv must be of a type compatible with boolean""",
                "defined-type":
                "boolean",
                "generated-type":
                """YANGDynClass(base=YANGBool, is_leaf=True, yang_name="bfd-tlv", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='boolean', is_config=False)""",
            })

        self.__bfd_tlv = t
        if hasattr(self, "_set"):
            self._set()

    def _unset_bfd_tlv(self):
        self.__bfd_tlv = YANGDynClass(
            base=YANGBool,
            is_leaf=True,
            yang_name="bfd-tlv",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="boolean",
            is_config=False,
        )

    bfd_tlv = __builtin__.property(_get_bfd_tlv)

    _pyangbind_elements = OrderedDict([("bfd_tlv", bfd_tlv)])
Пример #19
0
class subinterface(PybindBase):
    """
  This class was auto-generated by the PythonClass plugin for PYANG
  from YANG module openconfig-interfaces - based on the path /interfaces/interface/subinterfaces/subinterface. Each member element of
  the container is represented as a class variable - with a specific
  YANG type.

  YANG Description: The list of subinterfaces (logical interfaces) associated
with a physical interface
  """
    __slots__ = (
        "_path_helper",
        "_extmethods",
        "__index",
        "__config",
        "__state",
        "__vlan",
        "__ipv4",
        "__ipv6",
    )

    _yang_name = "subinterface"

    _pybind_generated_by = "container"

    def __init__(self, *args, **kwargs):

        self._path_helper = False

        self._extmethods = False
        self.__index = YANGDynClass(
            base=six.text_type,
            is_leaf=True,
            yang_name="index",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            is_keyval=True,
            namespace="http://openconfig.net/yang/interfaces",
            defining_module="openconfig-interfaces",
            yang_type="leafref",
            is_config=True,
        )
        self.__config = YANGDynClass(
            base=config.config,
            is_container="container",
            yang_name="config",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            extensions=None,
            namespace="http://openconfig.net/yang/interfaces",
            defining_module="openconfig-interfaces",
            yang_type="container",
            is_config=True,
        )
        self.__state = YANGDynClass(
            base=state.state,
            is_container="container",
            yang_name="state",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            extensions=None,
            namespace="http://openconfig.net/yang/interfaces",
            defining_module="openconfig-interfaces",
            yang_type="container",
            is_config=True,
        )
        self.__vlan = YANGDynClass(
            base=vlan.vlan,
            is_container="container",
            yang_name="vlan",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            extensions=None,
            namespace="http://openconfig.net/yang/vlan",
            defining_module="openconfig-vlan",
            yang_type="container",
            is_config=True,
        )
        self.__ipv4 = YANGDynClass(
            base=ipv4.ipv4,
            is_container="container",
            yang_name="ipv4",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            extensions=None,
            namespace="http://openconfig.net/yang/interfaces/ip",
            defining_module="openconfig-if-ip",
            yang_type="container",
            is_config=True,
        )
        self.__ipv6 = YANGDynClass(
            base=ipv6.ipv6,
            is_container="container",
            yang_name="ipv6",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            extensions=None,
            namespace="http://openconfig.net/yang/interfaces/ip",
            defining_module="openconfig-if-ip",
            yang_type="container",
            is_config=True,
        )

        load = kwargs.pop("load", None)
        if args:
            if len(args) > 1:
                raise TypeError(
                    "cannot create a YANG container with >1 argument")
            all_attr = True
            for e in self._pyangbind_elements:
                if not hasattr(args[0], e):
                    all_attr = False
                    break
            if not all_attr:
                raise ValueError(
                    "Supplied object did not have the correct attributes")
            for e in self._pyangbind_elements:
                nobj = getattr(args[0], e)
                if nobj._changed() is False:
                    continue
                setmethod = getattr(self, "_set_%s" % e)
                if load is None:
                    setmethod(getattr(args[0], e))
                else:
                    setmethod(getattr(args[0], e), load=load)

    def _path(self):
        if hasattr(self, "_parent"):
            return self._parent._path() + [self._yang_name]
        else:
            return ["interfaces", "interface", "subinterfaces", "subinterface"]

    def _get_index(self):
        """
    Getter method for index, mapped from YANG variable /interfaces/interface/subinterfaces/subinterface/index (leafref)

    YANG Description: The index number of the subinterface -- used to address
the logical interface
    """
        return self.__index

    def _set_index(self, v, load=False):
        """
    Setter method for index, mapped from YANG variable /interfaces/interface/subinterfaces/subinterface/index (leafref)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_index is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_index() directly.

    YANG Description: The index number of the subinterface -- used to address
the logical interface
    """
        parent = getattr(self, "_parent", None)
        if parent is not None and load is False:
            raise AttributeError("Cannot set keys directly when" +
                                 " within an instantiated list")

        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(
                v,
                base=six.text_type,
                is_leaf=True,
                yang_name="index",
                parent=self,
                path_helper=self._path_helper,
                extmethods=self._extmethods,
                register_paths=True,
                is_keyval=True,
                namespace="http://openconfig.net/yang/interfaces",
                defining_module="openconfig-interfaces",
                yang_type="leafref",
                is_config=True,
            )
        except (TypeError, ValueError):
            raise ValueError({
                "error-string":
                """index must be of a type compatible with leafref""",
                "defined-type":
                "leafref",
                "generated-type":
                """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='leafref', is_config=True)""",
            })

        self.__index = t
        if hasattr(self, "_set"):
            self._set()

    def _unset_index(self):
        self.__index = YANGDynClass(
            base=six.text_type,
            is_leaf=True,
            yang_name="index",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            is_keyval=True,
            namespace="http://openconfig.net/yang/interfaces",
            defining_module="openconfig-interfaces",
            yang_type="leafref",
            is_config=True,
        )

    def _get_config(self):
        """
    Getter method for config, mapped from YANG variable /interfaces/interface/subinterfaces/subinterface/config (container)

    YANG Description: Configurable items at the subinterface level
    """
        return self.__config

    def _set_config(self, v, load=False):
        """
    Setter method for config, mapped from YANG variable /interfaces/interface/subinterfaces/subinterface/config (container)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_config is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_config() directly.

    YANG Description: Configurable items at the subinterface level
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(
                v,
                base=config.config,
                is_container="container",
                yang_name="config",
                parent=self,
                path_helper=self._path_helper,
                extmethods=self._extmethods,
                register_paths=True,
                extensions=None,
                namespace="http://openconfig.net/yang/interfaces",
                defining_module="openconfig-interfaces",
                yang_type="container",
                is_config=True,
            )
        except (TypeError, ValueError):
            raise ValueError({
                "error-string":
                """config must be of a type compatible with container""",
                "defined-type":
                "container",
                "generated-type":
                """YANGDynClass(base=config.config, is_container='container', yang_name="config", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='container', is_config=True)""",
            })

        self.__config = t
        if hasattr(self, "_set"):
            self._set()

    def _unset_config(self):
        self.__config = YANGDynClass(
            base=config.config,
            is_container="container",
            yang_name="config",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            extensions=None,
            namespace="http://openconfig.net/yang/interfaces",
            defining_module="openconfig-interfaces",
            yang_type="container",
            is_config=True,
        )

    def _get_state(self):
        """
    Getter method for state, mapped from YANG variable /interfaces/interface/subinterfaces/subinterface/state (container)

    YANG Description: Operational state data for logical interfaces
    """
        return self.__state

    def _set_state(self, v, load=False):
        """
    Setter method for state, mapped from YANG variable /interfaces/interface/subinterfaces/subinterface/state (container)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_state is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_state() directly.

    YANG Description: Operational state data for logical interfaces
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(
                v,
                base=state.state,
                is_container="container",
                yang_name="state",
                parent=self,
                path_helper=self._path_helper,
                extmethods=self._extmethods,
                register_paths=True,
                extensions=None,
                namespace="http://openconfig.net/yang/interfaces",
                defining_module="openconfig-interfaces",
                yang_type="container",
                is_config=True,
            )
        except (TypeError, ValueError):
            raise ValueError({
                "error-string":
                """state must be of a type compatible with container""",
                "defined-type":
                "container",
                "generated-type":
                """YANGDynClass(base=state.state, is_container='container', yang_name="state", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='container', is_config=True)""",
            })

        self.__state = t
        if hasattr(self, "_set"):
            self._set()

    def _unset_state(self):
        self.__state = YANGDynClass(
            base=state.state,
            is_container="container",
            yang_name="state",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            extensions=None,
            namespace="http://openconfig.net/yang/interfaces",
            defining_module="openconfig-interfaces",
            yang_type="container",
            is_config=True,
        )

    def _get_vlan(self):
        """
    Getter method for vlan, mapped from YANG variable /interfaces/interface/subinterfaces/subinterface/vlan (container)

    YANG Description: Enclosing container for VLAN interface-specific
data on subinterfaces
    """
        return self.__vlan

    def _set_vlan(self, v, load=False):
        """
    Setter method for vlan, mapped from YANG variable /interfaces/interface/subinterfaces/subinterface/vlan (container)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_vlan is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_vlan() directly.

    YANG Description: Enclosing container for VLAN interface-specific
data on subinterfaces
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(
                v,
                base=vlan.vlan,
                is_container="container",
                yang_name="vlan",
                parent=self,
                path_helper=self._path_helper,
                extmethods=self._extmethods,
                register_paths=True,
                extensions=None,
                namespace="http://openconfig.net/yang/vlan",
                defining_module="openconfig-vlan",
                yang_type="container",
                is_config=True,
            )
        except (TypeError, ValueError):
            raise ValueError({
                "error-string":
                """vlan must be of a type compatible with container""",
                "defined-type":
                "container",
                "generated-type":
                """YANGDynClass(base=vlan.vlan, is_container='container', yang_name="vlan", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/vlan', defining_module='openconfig-vlan', yang_type='container', is_config=True)""",
            })

        self.__vlan = t
        if hasattr(self, "_set"):
            self._set()

    def _unset_vlan(self):
        self.__vlan = YANGDynClass(
            base=vlan.vlan,
            is_container="container",
            yang_name="vlan",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            extensions=None,
            namespace="http://openconfig.net/yang/vlan",
            defining_module="openconfig-vlan",
            yang_type="container",
            is_config=True,
        )

    def _get_ipv4(self):
        """
    Getter method for ipv4, mapped from YANG variable /interfaces/interface/subinterfaces/subinterface/ipv4 (container)

    YANG Description: Parameters for the IPv4 address family.
    """
        return self.__ipv4

    def _set_ipv4(self, v, load=False):
        """
    Setter method for ipv4, mapped from YANG variable /interfaces/interface/subinterfaces/subinterface/ipv4 (container)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_ipv4 is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_ipv4() directly.

    YANG Description: Parameters for the IPv4 address family.
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(
                v,
                base=ipv4.ipv4,
                is_container="container",
                yang_name="ipv4",
                parent=self,
                path_helper=self._path_helper,
                extmethods=self._extmethods,
                register_paths=True,
                extensions=None,
                namespace="http://openconfig.net/yang/interfaces/ip",
                defining_module="openconfig-if-ip",
                yang_type="container",
                is_config=True,
            )
        except (TypeError, ValueError):
            raise ValueError({
                "error-string":
                """ipv4 must be of a type compatible with container""",
                "defined-type":
                "container",
                "generated-type":
                """YANGDynClass(base=ipv4.ipv4, is_container='container', yang_name="ipv4", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/interfaces/ip', defining_module='openconfig-if-ip', yang_type='container', is_config=True)""",
            })

        self.__ipv4 = t
        if hasattr(self, "_set"):
            self._set()

    def _unset_ipv4(self):
        self.__ipv4 = YANGDynClass(
            base=ipv4.ipv4,
            is_container="container",
            yang_name="ipv4",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            extensions=None,
            namespace="http://openconfig.net/yang/interfaces/ip",
            defining_module="openconfig-if-ip",
            yang_type="container",
            is_config=True,
        )

    def _get_ipv6(self):
        """
    Getter method for ipv6, mapped from YANG variable /interfaces/interface/subinterfaces/subinterface/ipv6 (container)

    YANG Description: Parameters for the IPv6 address family.
    """
        return self.__ipv6

    def _set_ipv6(self, v, load=False):
        """
    Setter method for ipv6, mapped from YANG variable /interfaces/interface/subinterfaces/subinterface/ipv6 (container)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_ipv6 is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_ipv6() directly.

    YANG Description: Parameters for the IPv6 address family.
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(
                v,
                base=ipv6.ipv6,
                is_container="container",
                yang_name="ipv6",
                parent=self,
                path_helper=self._path_helper,
                extmethods=self._extmethods,
                register_paths=True,
                extensions=None,
                namespace="http://openconfig.net/yang/interfaces/ip",
                defining_module="openconfig-if-ip",
                yang_type="container",
                is_config=True,
            )
        except (TypeError, ValueError):
            raise ValueError({
                "error-string":
                """ipv6 must be of a type compatible with container""",
                "defined-type":
                "container",
                "generated-type":
                """YANGDynClass(base=ipv6.ipv6, is_container='container', yang_name="ipv6", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/interfaces/ip', defining_module='openconfig-if-ip', yang_type='container', is_config=True)""",
            })

        self.__ipv6 = t
        if hasattr(self, "_set"):
            self._set()

    def _unset_ipv6(self):
        self.__ipv6 = YANGDynClass(
            base=ipv6.ipv6,
            is_container="container",
            yang_name="ipv6",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            extensions=None,
            namespace="http://openconfig.net/yang/interfaces/ip",
            defining_module="openconfig-if-ip",
            yang_type="container",
            is_config=True,
        )

    index = __builtin__.property(_get_index, _set_index)
    config = __builtin__.property(_get_config, _set_config)
    state = __builtin__.property(_get_state, _set_state)
    vlan = __builtin__.property(_get_vlan, _set_vlan)
    ipv4 = __builtin__.property(_get_ipv4, _set_ipv4)
    ipv6 = __builtin__.property(_get_ipv6, _set_ipv6)

    _pyangbind_elements = OrderedDict([
        ("index", index),
        ("config", config),
        ("state", state),
        ("vlan", vlan),
        ("ipv4", ipv4),
        ("ipv6", ipv6),
    ])
Пример #20
0
class bfd(PybindBase):
    """
  This class was auto-generated by the PythonClass plugin for PYANG
  from YANG module openconfig-network-instance - based on the path /network-instances/network-instance/protocols/protocol/isis/interfaces/interface/bfd. Each member element of
  the container is represented as a class variable - with a specific
  YANG type.

  YANG Description: This container defines BFD.
  """
    __slots__ = ("_path_helper", "_extmethods", "__config", "__state")

    _yang_name = "bfd"

    _pybind_generated_by = "container"

    def __init__(self, *args, **kwargs):

        self._path_helper = False

        self._extmethods = False
        self.__config = YANGDynClass(
            base=config.config,
            is_container="container",
            yang_name="config",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            extensions=None,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="container",
            is_config=True,
        )
        self.__state = YANGDynClass(
            base=state.state,
            is_container="container",
            yang_name="state",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            extensions=None,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="container",
            is_config=True,
        )

        load = kwargs.pop("load", None)
        if args:
            if len(args) > 1:
                raise TypeError(
                    "cannot create a YANG container with >1 argument")
            all_attr = True
            for e in self._pyangbind_elements:
                if not hasattr(args[0], e):
                    all_attr = False
                    break
            if not all_attr:
                raise ValueError(
                    "Supplied object did not have the correct attributes")
            for e in self._pyangbind_elements:
                nobj = getattr(args[0], e)
                if nobj._changed() is False:
                    continue
                setmethod = getattr(self, "_set_%s" % e)
                if load is None:
                    setmethod(getattr(args[0], e))
                else:
                    setmethod(getattr(args[0], e), load=load)

    def _path(self):
        if hasattr(self, "_parent"):
            return self._parent._path() + [self._yang_name]
        else:
            return [
                "network-instances",
                "network-instance",
                "protocols",
                "protocol",
                "isis",
                "interfaces",
                "interface",
                "bfd",
            ]

    def _get_config(self):
        """
    Getter method for config, mapped from YANG variable /network_instances/network_instance/protocols/protocol/isis/interfaces/interface/bfd/config (container)

    YANG Description: This container defines BFD configuration parameters.
    """
        return self.__config

    def _set_config(self, v, load=False):
        """
    Setter method for config, mapped from YANG variable /network_instances/network_instance/protocols/protocol/isis/interfaces/interface/bfd/config (container)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_config is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_config() directly.

    YANG Description: This container defines BFD configuration parameters.
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(
                v,
                base=config.config,
                is_container="container",
                yang_name="config",
                parent=self,
                path_helper=self._path_helper,
                extmethods=self._extmethods,
                register_paths=True,
                extensions=None,
                namespace="http://openconfig.net/yang/network-instance",
                defining_module="openconfig-network-instance",
                yang_type="container",
                is_config=True,
            )
        except (TypeError, ValueError):
            raise ValueError({
                "error-string":
                """config must be of a type compatible with container""",
                "defined-type":
                "container",
                "generated-type":
                """YANGDynClass(base=config.config, is_container='container', yang_name="config", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='container', is_config=True)""",
            })

        self.__config = t
        if hasattr(self, "_set"):
            self._set()

    def _unset_config(self):
        self.__config = YANGDynClass(
            base=config.config,
            is_container="container",
            yang_name="config",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            extensions=None,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="container",
            is_config=True,
        )

    def _get_state(self):
        """
    Getter method for state, mapped from YANG variable /network_instances/network_instance/protocols/protocol/isis/interfaces/interface/bfd/state (container)

    YANG Description: This container defines BFD state information.
    """
        return self.__state

    def _set_state(self, v, load=False):
        """
    Setter method for state, mapped from YANG variable /network_instances/network_instance/protocols/protocol/isis/interfaces/interface/bfd/state (container)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_state is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_state() directly.

    YANG Description: This container defines BFD state information.
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(
                v,
                base=state.state,
                is_container="container",
                yang_name="state",
                parent=self,
                path_helper=self._path_helper,
                extmethods=self._extmethods,
                register_paths=True,
                extensions=None,
                namespace="http://openconfig.net/yang/network-instance",
                defining_module="openconfig-network-instance",
                yang_type="container",
                is_config=True,
            )
        except (TypeError, ValueError):
            raise ValueError({
                "error-string":
                """state must be of a type compatible with container""",
                "defined-type":
                "container",
                "generated-type":
                """YANGDynClass(base=state.state, is_container='container', yang_name="state", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='container', is_config=True)""",
            })

        self.__state = t
        if hasattr(self, "_set"):
            self._set()

    def _unset_state(self):
        self.__state = YANGDynClass(
            base=state.state,
            is_container="container",
            yang_name="state",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            extensions=None,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="container",
            is_config=True,
        )

    config = __builtin__.property(_get_config, _set_config)
    state = __builtin__.property(_get_state, _set_state)

    _pyangbind_elements = OrderedDict([("config", config), ("state", state)])
Пример #21
0
class config(PybindBase):
    """
  This class was auto-generated by the PythonClass plugin for PYANG
  from YANG module openconfig-interfaces - based on the path /interfaces/interface/subinterfaces/subinterface/vlan/config. Each member element of
  the container is represented as a class variable - with a specific
  YANG type.

  YANG Description: Configuration parameters for VLANs
  """
    __slots__ = (
        '_path_helper',
        '_extmethods',
        '__vlan_id',
    )

    _yang_name = 'config'

    _pybind_generated_by = 'container'

    def __init__(self, *args, **kwargs):

        helper = kwargs.pop("path_helper", None)
        if helper is False:
            self._path_helper = False
        elif helper is not None and isinstance(helper,
                                               xpathhelper.YANGPathHelper):
            self._path_helper = helper
        elif hasattr(self, "_parent"):
            helper = getattr(self._parent, "_path_helper", False)
            self._path_helper = helper
        else:
            self._path_helper = False

        self._extmethods = False
        self.__vlan_id = YANGDynClass(base=[
            RestrictedClassType(base_type=RestrictedClassType(
                base_type=int,
                restriction_dict={'range': ['0..65535']},
                int_size=16),
                                restriction_dict={'range': ['1..4094']}),
            RestrictedClassType(
                base_type=six.text_type,
                restriction_dict={
                    'pattern':
                    '^(409[0-4]|40[0-8][0-9]|[1-3][0-9]{3}|[1-9][0-9]{1,2}|[1-9])\\.((409[0-4]|40[0-8][0-9]|[1-3][0-9]{3}|[1-9][0-9]{1,2}|[1-9])|\\*)$'
                }),
        ],
                                      is_leaf=True,
                                      yang_name="vlan-id",
                                      parent=self,
                                      path_helper=self._path_helper,
                                      extmethods=self._extmethods,
                                      register_paths=True,
                                      namespace=
                                      'http://openconfig.net/yang/vlan',
                                      defining_module='openconfig-vlan',
                                      yang_type='union',
                                      is_config=True)

        load = kwargs.pop("load", None)
        if args:
            if len(args) > 1:
                raise TypeError(
                    "cannot create a YANG container with >1 argument")
            all_attr = True
            for e in self._pyangbind_elements:
                if not hasattr(args[0], e):
                    all_attr = False
                    break
            if not all_attr:
                raise ValueError(
                    "Supplied object did not have the correct attributes")
            for e in self._pyangbind_elements:
                nobj = getattr(args[0], e)
                if nobj._changed() is False:
                    continue
                setmethod = getattr(self, "_set_%s" % e)
                if load is None:
                    setmethod(getattr(args[0], e))
                else:
                    setmethod(getattr(args[0], e), load=load)

    def _path(self):
        if hasattr(self, "_parent"):
            return self._parent._path() + [self._yang_name]
        else:
            return [
                'interfaces', 'interface', 'subinterfaces', 'subinterface',
                'vlan', 'config'
            ]

    def _get_vlan_id(self):
        """
    Getter method for vlan_id, mapped from YANG variable /interfaces/interface/subinterfaces/subinterface/vlan/config/vlan_id (union)

    YANG Description: VLAN id for the subinterface -- specified inline for the
case of a local VLAN.  The id is scoped to the
subinterface, and could be repeated on different
subinterfaces.
    """
        return self.__vlan_id

    def _set_vlan_id(self, v, load=False):
        """
    Setter method for vlan_id, mapped from YANG variable /interfaces/interface/subinterfaces/subinterface/vlan/config/vlan_id (union)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_vlan_id is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_vlan_id() directly.

    YANG Description: VLAN id for the subinterface -- specified inline for the
case of a local VLAN.  The id is scoped to the
subinterface, and could be repeated on different
subinterfaces.
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(
                v,
                base=[
                    RestrictedClassType(
                        base_type=RestrictedClassType(
                            base_type=int,
                            restriction_dict={'range': ['0..65535']},
                            int_size=16),
                        restriction_dict={'range': ['1..4094']}),
                    RestrictedClassType(
                        base_type=six.text_type,
                        restriction_dict={
                            'pattern':
                            '^(409[0-4]|40[0-8][0-9]|[1-3][0-9]{3}|[1-9][0-9]{1,2}|[1-9])\\.((409[0-4]|40[0-8][0-9]|[1-3][0-9]{3}|[1-9][0-9]{1,2}|[1-9])|\\*)$'
                        }),
                ],
                is_leaf=True,
                yang_name="vlan-id",
                parent=self,
                path_helper=self._path_helper,
                extmethods=self._extmethods,
                register_paths=True,
                namespace='http://openconfig.net/yang/vlan',
                defining_module='openconfig-vlan',
                yang_type='union',
                is_config=True)
        except (TypeError, ValueError):
            raise ValueError({
                'error-string':
                """vlan_id must be of a type compatible with union""",
                'defined-type':
                "openconfig-vlan:union",
                'generated-type':
                """YANGDynClass(base=[RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..4094']}),RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '^(409[0-4]|40[0-8][0-9]|[1-3][0-9]{3}|[1-9][0-9]{1,2}|[1-9])\\.((409[0-4]|40[0-8][0-9]|[1-3][0-9]{3}|[1-9][0-9]{1,2}|[1-9])|\\*)$'}),], is_leaf=True, yang_name="vlan-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/vlan', defining_module='openconfig-vlan', yang_type='union', is_config=True)""",
            })

        self.__vlan_id = t
        if hasattr(self, '_set'):
            self._set()

    def _unset_vlan_id(self):
        self.__vlan_id = YANGDynClass(base=[
            RestrictedClassType(base_type=RestrictedClassType(
                base_type=int,
                restriction_dict={'range': ['0..65535']},
                int_size=16),
                                restriction_dict={'range': ['1..4094']}),
            RestrictedClassType(
                base_type=six.text_type,
                restriction_dict={
                    'pattern':
                    '^(409[0-4]|40[0-8][0-9]|[1-3][0-9]{3}|[1-9][0-9]{1,2}|[1-9])\\.((409[0-4]|40[0-8][0-9]|[1-3][0-9]{3}|[1-9][0-9]{1,2}|[1-9])|\\*)$'
                }),
        ],
                                      is_leaf=True,
                                      yang_name="vlan-id",
                                      parent=self,
                                      path_helper=self._path_helper,
                                      extmethods=self._extmethods,
                                      register_paths=True,
                                      namespace=
                                      'http://openconfig.net/yang/vlan',
                                      defining_module='openconfig-vlan',
                                      yang_type='union',
                                      is_config=True)

    vlan_id = __builtin__.property(_get_vlan_id, _set_vlan_id)

    _pyangbind_elements = OrderedDict([
        ('vlan_id', vlan_id),
    ])
Пример #22
0
class selectors(PybindBase):
  """
  This class was auto-generated by the PythonClass plugin for PYANG
  from YANG module openconfig-system - based on the path /system/logging/remote-servers/remote-server/selectors. Each member element of
  the container is represented as a class variable - with a specific
  YANG type.

  YANG Description: Enclosing container 
  """
  __slots__ = ('_path_helper', '_extmethods', '__selector',)

  _yang_name = 'selectors'

  _pybind_generated_by = 'container'

  def __init__(self, *args, **kwargs):

    helper = kwargs.pop("path_helper", None)
    if helper is False:
      self._path_helper = False
    elif helper is not None and isinstance(helper, xpathhelper.YANGPathHelper):
      self._path_helper = helper
    elif hasattr(self, "_parent"):
      helper = getattr(self._parent, "_path_helper", False)
      self._path_helper = helper
    else:
      self._path_helper = False

    self._extmethods = False
    self.__selector = YANGDynClass(base=YANGListType("facility severity",selector.selector, yang_name="selector", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='facility severity', extensions=None), is_container='list', yang_name="selector", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/system', defining_module='openconfig-system', yang_type='list', is_config=True)

    load = kwargs.pop("load", None)
    if args:
      if len(args) > 1:
        raise TypeError("cannot create a YANG container with >1 argument")
      all_attr = True
      for e in self._pyangbind_elements:
        if not hasattr(args[0], e):
          all_attr = False
          break
      if not all_attr:
        raise ValueError("Supplied object did not have the correct attributes")
      for e in self._pyangbind_elements:
        nobj = getattr(args[0], e)
        if nobj._changed() is False:
          continue
        setmethod = getattr(self, "_set_%s" % e)
        if load is None:
          setmethod(getattr(args[0], e))
        else:
          setmethod(getattr(args[0], e), load=load)

  def _path(self):
    if hasattr(self, "_parent"):
      return self._parent._path()+[self._yang_name]
    else:
      return ['system', 'logging', 'remote-servers', 'remote-server', 'selectors']

  def _get_selector(self):
    """
    Getter method for selector, mapped from YANG variable /system/logging/remote_servers/remote_server/selectors/selector (list)

    YANG Description: List of selectors for log messages
    """
    return self.__selector
      
  def _set_selector(self, v, load=False):
    """
    Setter method for selector, mapped from YANG variable /system/logging/remote_servers/remote_server/selectors/selector (list)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_selector is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_selector() directly.

    YANG Description: List of selectors for log messages
    """
    if hasattr(v, "_utype"):
      v = v._utype(v)
    try:
      t = YANGDynClass(v,base=YANGListType("facility severity",selector.selector, yang_name="selector", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='facility severity', extensions=None), is_container='list', yang_name="selector", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/system', defining_module='openconfig-system', yang_type='list', is_config=True)
    except (TypeError, ValueError):
      raise ValueError({
          'error-string': """selector must be of a type compatible with list""",
          'defined-type': "list",
          'generated-type': """YANGDynClass(base=YANGListType("facility severity",selector.selector, yang_name="selector", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='facility severity', extensions=None), is_container='list', yang_name="selector", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/system', defining_module='openconfig-system', yang_type='list', is_config=True)""",
        })

    self.__selector = t
    if hasattr(self, '_set'):
      self._set()

  def _unset_selector(self):
    self.__selector = YANGDynClass(base=YANGListType("facility severity",selector.selector, yang_name="selector", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='facility severity', extensions=None), is_container='list', yang_name="selector", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/system', defining_module='openconfig-system', yang_type='list', is_config=True)

  selector = __builtin__.property(_get_selector, _set_selector)


  _pyangbind_elements = OrderedDict([('selector', selector), ])
Пример #23
0
class next_hops(PybindBase):
    """
  This class was auto-generated by the PythonClass plugin for PYANG
  from YANG module openconfig-network-instance - based on the path /network-instances/network-instance/protocols/protocol/static-routes/static/next-hops. Each member element of
  the container is represented as a class variable - with a specific
  YANG type.

  YANG Description: Configuration and state parameters relating to the
next-hops that are to be utilised for the static
route being specified
  """
    __slots__ = ("_path_helper", "_extmethods", "__next_hop")

    _yang_name = "next-hops"

    _pybind_generated_by = "container"

    def __init__(self, *args, **kwargs):

        self._path_helper = False

        self._extmethods = False
        self.__next_hop = YANGDynClass(
            base=YANGListType(
                "index",
                next_hop.next_hop,
                yang_name="next-hop",
                parent=self,
                is_container="list",
                user_ordered=False,
                path_helper=self._path_helper,
                yang_keys="index",
                extensions=None,
            ),
            is_container="list",
            yang_name="next-hop",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            extensions=None,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="list",
            is_config=True,
        )

        load = kwargs.pop("load", None)
        if args:
            if len(args) > 1:
                raise TypeError(
                    "cannot create a YANG container with >1 argument")
            all_attr = True
            for e in self._pyangbind_elements:
                if not hasattr(args[0], e):
                    all_attr = False
                    break
            if not all_attr:
                raise ValueError(
                    "Supplied object did not have the correct attributes")
            for e in self._pyangbind_elements:
                nobj = getattr(args[0], e)
                if nobj._changed() is False:
                    continue
                setmethod = getattr(self, "_set_%s" % e)
                if load is None:
                    setmethod(getattr(args[0], e))
                else:
                    setmethod(getattr(args[0], e), load=load)

    def _path(self):
        if hasattr(self, "_parent"):
            return self._parent._path() + [self._yang_name]
        else:
            return [
                "network-instances",
                "network-instance",
                "protocols",
                "protocol",
                "static-routes",
                "static",
                "next-hops",
            ]

    def _get_next_hop(self):
        """
    Getter method for next_hop, mapped from YANG variable /network_instances/network_instance/protocols/protocol/static_routes/static/next_hops/next_hop (list)

    YANG Description: A list of next-hops to be utilised for the static
route being specified.
    """
        return self.__next_hop

    def _set_next_hop(self, v, load=False):
        """
    Setter method for next_hop, mapped from YANG variable /network_instances/network_instance/protocols/protocol/static_routes/static/next_hops/next_hop (list)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_next_hop is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_next_hop() directly.

    YANG Description: A list of next-hops to be utilised for the static
route being specified.
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(
                v,
                base=YANGListType(
                    "index",
                    next_hop.next_hop,
                    yang_name="next-hop",
                    parent=self,
                    is_container="list",
                    user_ordered=False,
                    path_helper=self._path_helper,
                    yang_keys="index",
                    extensions=None,
                ),
                is_container="list",
                yang_name="next-hop",
                parent=self,
                path_helper=self._path_helper,
                extmethods=self._extmethods,
                register_paths=True,
                extensions=None,
                namespace="http://openconfig.net/yang/network-instance",
                defining_module="openconfig-network-instance",
                yang_type="list",
                is_config=True,
            )
        except (TypeError, ValueError):
            raise ValueError({
                "error-string":
                """next_hop must be of a type compatible with list""",
                "defined-type":
                "list",
                "generated-type":
                """YANGDynClass(base=YANGListType("index",next_hop.next_hop, yang_name="next-hop", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='index', extensions=None), is_container='list', yang_name="next-hop", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='list', is_config=True)""",
            })

        self.__next_hop = t
        if hasattr(self, "_set"):
            self._set()

    def _unset_next_hop(self):
        self.__next_hop = YANGDynClass(
            base=YANGListType(
                "index",
                next_hop.next_hop,
                yang_name="next-hop",
                parent=self,
                is_container="list",
                user_ordered=False,
                path_helper=self._path_helper,
                yang_keys="index",
                extensions=None,
            ),
            is_container="list",
            yang_name="next-hop",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            extensions=None,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="list",
            is_config=True,
        )

    next_hop = __builtin__.property(_get_next_hop, _set_next_hop)

    _pyangbind_elements = OrderedDict([("next_hop", next_hop)])
Пример #24
0
class config(PybindBase):
  """
  This class was auto-generated by the PythonClass plugin for PYANG
  from YANG module openconfig-interfaces - based on the path /interfaces/interface/routed-vlan/ipv6/addresses/address/vrrp/vrrp-group/interface-tracking/config. Each member element of
  the container is represented as a class variable - with a specific
  YANG type.

  YANG Description: Configuration data for VRRP interface tracking
  """
  __slots__ = ('_path_helper', '_extmethods', '__track_interface','__priority_decrement',)

  _yang_name = 'config'

  _pybind_generated_by = 'container'

  def __init__(self, *args, **kwargs):

    helper = kwargs.pop("path_helper", None)
    if helper is False:
      self._path_helper = False
    elif helper is not None and isinstance(helper, xpathhelper.YANGPathHelper):
      self._path_helper = helper
    elif hasattr(self, "_parent"):
      helper = getattr(self._parent, "_path_helper", False)
      self._path_helper = helper
    else:
      self._path_helper = False

    self._extmethods = False
    self.__track_interface = YANGDynClass(base=TypedListType(allowed_type=ReferenceType(referenced_path='/oc-if:interfaces/oc-if:interface/oc-if:name',caller=self._path() + ['track-interface'], path_helper=self._path_helper, require_instance=True)), is_leaf=True, yang_name="track-interface", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces/ip', defining_module='openconfig-if-ip', yang_type='leafref', is_config=True)
    self.__priority_decrement = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..254']}), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8)(0), is_leaf=True, yang_name="priority-decrement", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces/ip', defining_module='openconfig-if-ip', yang_type='uint8', is_config=True)

    load = kwargs.pop("load", None)
    if args:
      if len(args) > 1:
        raise TypeError("cannot create a YANG container with >1 argument")
      all_attr = True
      for e in self._pyangbind_elements:
        if not hasattr(args[0], e):
          all_attr = False
          break
      if not all_attr:
        raise ValueError("Supplied object did not have the correct attributes")
      for e in self._pyangbind_elements:
        nobj = getattr(args[0], e)
        if nobj._changed() is False:
          continue
        setmethod = getattr(self, "_set_%s" % e)
        if load is None:
          setmethod(getattr(args[0], e))
        else:
          setmethod(getattr(args[0], e), load=load)

  def _path(self):
    if hasattr(self, "_parent"):
      return self._parent._path()+[self._yang_name]
    else:
      return ['interfaces', 'interface', 'routed-vlan', 'ipv6', 'addresses', 'address', 'vrrp', 'vrrp-group', 'interface-tracking', 'config']

  def _get_track_interface(self):
    """
    Getter method for track_interface, mapped from YANG variable /interfaces/interface/routed_vlan/ipv6/addresses/address/vrrp/vrrp_group/interface_tracking/config/track_interface (leafref)

    YANG Description: Sets a list of one or more interfaces that should
be tracked for up/down events to dynamically change the
priority state of the VRRP group, and potentially
change the mastership if the tracked interface going
down lowers the priority sufficiently.  Any of the tracked
interfaces going down will cause the priority to be lowered.
Some implementations may only support a single
tracked interface.
    """
    return self.__track_interface
      
  def _set_track_interface(self, v, load=False):
    """
    Setter method for track_interface, mapped from YANG variable /interfaces/interface/routed_vlan/ipv6/addresses/address/vrrp/vrrp_group/interface_tracking/config/track_interface (leafref)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_track_interface is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_track_interface() directly.

    YANG Description: Sets a list of one or more interfaces that should
be tracked for up/down events to dynamically change the
priority state of the VRRP group, and potentially
change the mastership if the tracked interface going
down lowers the priority sufficiently.  Any of the tracked
interfaces going down will cause the priority to be lowered.
Some implementations may only support a single
tracked interface.
    """
    if hasattr(v, "_utype"):
      v = v._utype(v)
    try:
      t = YANGDynClass(v,base=TypedListType(allowed_type=ReferenceType(referenced_path='/oc-if:interfaces/oc-if:interface/oc-if:name',caller=self._path() + ['track-interface'], path_helper=self._path_helper, require_instance=True)), is_leaf=True, yang_name="track-interface", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces/ip', defining_module='openconfig-if-ip', yang_type='leafref', is_config=True)
    except (TypeError, ValueError):
      raise ValueError({
          'error-string': """track_interface must be of a type compatible with leafref""",
          'defined-type': "leafref",
          'generated-type': """YANGDynClass(base=TypedListType(allowed_type=ReferenceType(referenced_path='/oc-if:interfaces/oc-if:interface/oc-if:name',caller=self._path() + ['track-interface'], path_helper=self._path_helper, require_instance=True)), is_leaf=True, yang_name="track-interface", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces/ip', defining_module='openconfig-if-ip', yang_type='leafref', is_config=True)""",
        })

    self.__track_interface = t
    if hasattr(self, '_set'):
      self._set()

  def _unset_track_interface(self):
    self.__track_interface = YANGDynClass(base=TypedListType(allowed_type=ReferenceType(referenced_path='/oc-if:interfaces/oc-if:interface/oc-if:name',caller=self._path() + ['track-interface'], path_helper=self._path_helper, require_instance=True)), is_leaf=True, yang_name="track-interface", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces/ip', defining_module='openconfig-if-ip', yang_type='leafref', is_config=True)


  def _get_priority_decrement(self):
    """
    Getter method for priority_decrement, mapped from YANG variable /interfaces/interface/routed_vlan/ipv6/addresses/address/vrrp/vrrp_group/interface_tracking/config/priority_decrement (uint8)

    YANG Description: Set the value to subtract from priority when
the tracked interface goes down
    """
    return self.__priority_decrement
      
  def _set_priority_decrement(self, v, load=False):
    """
    Setter method for priority_decrement, mapped from YANG variable /interfaces/interface/routed_vlan/ipv6/addresses/address/vrrp/vrrp_group/interface_tracking/config/priority_decrement (uint8)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_priority_decrement is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_priority_decrement() directly.

    YANG Description: Set the value to subtract from priority when
the tracked interface goes down
    """
    if hasattr(v, "_utype"):
      v = v._utype(v)
    try:
      t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..254']}), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8)(0), is_leaf=True, yang_name="priority-decrement", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces/ip', defining_module='openconfig-if-ip', yang_type='uint8', is_config=True)
    except (TypeError, ValueError):
      raise ValueError({
          'error-string': """priority_decrement must be of a type compatible with uint8""",
          'defined-type': "uint8",
          'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..254']}), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8)(0), is_leaf=True, yang_name="priority-decrement", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces/ip', defining_module='openconfig-if-ip', yang_type='uint8', is_config=True)""",
        })

    self.__priority_decrement = t
    if hasattr(self, '_set'):
      self._set()

  def _unset_priority_decrement(self):
    self.__priority_decrement = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..254']}), default=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8)(0), is_leaf=True, yang_name="priority-decrement", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces/ip', defining_module='openconfig-if-ip', yang_type='uint8', is_config=True)

  track_interface = __builtin__.property(_get_track_interface, _set_track_interface)
  priority_decrement = __builtin__.property(_get_priority_decrement, _set_priority_decrement)


  _pyangbind_elements = OrderedDict([('track_interface', track_interface), ('priority_decrement', priority_decrement), ])
Пример #25
0
class state(PybindBase):
    """
  This class was auto-generated by the PythonClass plugin for PYANG
  from YANG module openconfig-network-instance-l2 - based on the path /network-instances/network-instance/mpls/signaling-protocols/rsvp-te/global/graceful-restart/state. Each member element of
  the container is represented as a class variable - with a specific
  YANG type.

  YANG Description: State information associated with
RSVP graceful-restart
  """
    __slots__ = ("_path_helper", "_extmethods", "__enable", "__restart_time",
                 "__recovery_time")

    _yang_name = "state"

    _pybind_generated_by = "container"

    def __init__(self, *args, **kwargs):

        self._path_helper = False

        self._extmethods = False
        self.__enable = YANGDynClass(
            base=YANGBool,
            default=YANGBool("false"),
            is_leaf=True,
            yang_name="enable",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="boolean",
            is_config=False,
        )
        self.__restart_time = YANGDynClass(
            base=RestrictedClassType(
                base_type=long,
                restriction_dict={"range": ["0..4294967295"]},
                int_size=32,
            ),
            is_leaf=True,
            yang_name="restart-time",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="uint32",
            is_config=False,
        )
        self.__recovery_time = YANGDynClass(
            base=RestrictedClassType(
                base_type=long,
                restriction_dict={"range": ["0..4294967295"]},
                int_size=32,
            ),
            is_leaf=True,
            yang_name="recovery-time",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="uint32",
            is_config=False,
        )

        load = kwargs.pop("load", None)
        if args:
            if len(args) > 1:
                raise TypeError(
                    "cannot create a YANG container with >1 argument")
            all_attr = True
            for e in self._pyangbind_elements:
                if not hasattr(args[0], e):
                    all_attr = False
                    break
            if not all_attr:
                raise ValueError(
                    "Supplied object did not have the correct attributes")
            for e in self._pyangbind_elements:
                nobj = getattr(args[0], e)
                if nobj._changed() is False:
                    continue
                setmethod = getattr(self, "_set_%s" % e)
                if load is None:
                    setmethod(getattr(args[0], e))
                else:
                    setmethod(getattr(args[0], e), load=load)

    def _path(self):
        if hasattr(self, "_parent"):
            return self._parent._path() + [self._yang_name]
        else:
            return [
                "network-instances",
                "network-instance",
                "mpls",
                "signaling-protocols",
                "rsvp-te",
                "global",
                "graceful-restart",
                "state",
            ]

    def _get_enable(self):
        """
    Getter method for enable, mapped from YANG variable /network_instances/network_instance/mpls/signaling_protocols/rsvp_te/global/graceful_restart/state/enable (boolean)

    YANG Description: Enables graceful restart on the node.
    """
        return self.__enable

    def _set_enable(self, v, load=False):
        """
    Setter method for enable, mapped from YANG variable /network_instances/network_instance/mpls/signaling_protocols/rsvp_te/global/graceful_restart/state/enable (boolean)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_enable is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_enable() directly.

    YANG Description: Enables graceful restart on the node.
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(
                v,
                base=YANGBool,
                default=YANGBool("false"),
                is_leaf=True,
                yang_name="enable",
                parent=self,
                path_helper=self._path_helper,
                extmethods=self._extmethods,
                register_paths=True,
                namespace="http://openconfig.net/yang/network-instance",
                defining_module="openconfig-network-instance",
                yang_type="boolean",
                is_config=False,
            )
        except (TypeError, ValueError):
            raise ValueError({
                "error-string":
                """enable must be of a type compatible with boolean""",
                "defined-type":
                "boolean",
                "generated-type":
                """YANGDynClass(base=YANGBool, default=YANGBool("false"), is_leaf=True, yang_name="enable", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='boolean', is_config=False)""",
            })

        self.__enable = t
        if hasattr(self, "_set"):
            self._set()

    def _unset_enable(self):
        self.__enable = YANGDynClass(
            base=YANGBool,
            default=YANGBool("false"),
            is_leaf=True,
            yang_name="enable",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="boolean",
            is_config=False,
        )

    def _get_restart_time(self):
        """
    Getter method for restart_time, mapped from YANG variable /network_instances/network_instance/mpls/signaling_protocols/rsvp_te/global/graceful_restart/state/restart_time (uint32)

    YANG Description: Graceful restart time (seconds).
    """
        return self.__restart_time

    def _set_restart_time(self, v, load=False):
        """
    Setter method for restart_time, mapped from YANG variable /network_instances/network_instance/mpls/signaling_protocols/rsvp_te/global/graceful_restart/state/restart_time (uint32)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_restart_time is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_restart_time() directly.

    YANG Description: Graceful restart time (seconds).
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(
                v,
                base=RestrictedClassType(
                    base_type=long,
                    restriction_dict={"range": ["0..4294967295"]},
                    int_size=32,
                ),
                is_leaf=True,
                yang_name="restart-time",
                parent=self,
                path_helper=self._path_helper,
                extmethods=self._extmethods,
                register_paths=True,
                namespace="http://openconfig.net/yang/network-instance",
                defining_module="openconfig-network-instance",
                yang_type="uint32",
                is_config=False,
            )
        except (TypeError, ValueError):
            raise ValueError({
                "error-string":
                """restart_time must be of a type compatible with uint32""",
                "defined-type":
                "uint32",
                "generated-type":
                """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="restart-time", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='uint32', is_config=False)""",
            })

        self.__restart_time = t
        if hasattr(self, "_set"):
            self._set()

    def _unset_restart_time(self):
        self.__restart_time = YANGDynClass(
            base=RestrictedClassType(
                base_type=long,
                restriction_dict={"range": ["0..4294967295"]},
                int_size=32,
            ),
            is_leaf=True,
            yang_name="restart-time",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="uint32",
            is_config=False,
        )

    def _get_recovery_time(self):
        """
    Getter method for recovery_time, mapped from YANG variable /network_instances/network_instance/mpls/signaling_protocols/rsvp_te/global/graceful_restart/state/recovery_time (uint32)

    YANG Description: RSVP state recovery time
    """
        return self.__recovery_time

    def _set_recovery_time(self, v, load=False):
        """
    Setter method for recovery_time, mapped from YANG variable /network_instances/network_instance/mpls/signaling_protocols/rsvp_te/global/graceful_restart/state/recovery_time (uint32)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_recovery_time is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_recovery_time() directly.

    YANG Description: RSVP state recovery time
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(
                v,
                base=RestrictedClassType(
                    base_type=long,
                    restriction_dict={"range": ["0..4294967295"]},
                    int_size=32,
                ),
                is_leaf=True,
                yang_name="recovery-time",
                parent=self,
                path_helper=self._path_helper,
                extmethods=self._extmethods,
                register_paths=True,
                namespace="http://openconfig.net/yang/network-instance",
                defining_module="openconfig-network-instance",
                yang_type="uint32",
                is_config=False,
            )
        except (TypeError, ValueError):
            raise ValueError({
                "error-string":
                """recovery_time must be of a type compatible with uint32""",
                "defined-type":
                "uint32",
                "generated-type":
                """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="recovery-time", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='uint32', is_config=False)""",
            })

        self.__recovery_time = t
        if hasattr(self, "_set"):
            self._set()

    def _unset_recovery_time(self):
        self.__recovery_time = YANGDynClass(
            base=RestrictedClassType(
                base_type=long,
                restriction_dict={"range": ["0..4294967295"]},
                int_size=32,
            ),
            is_leaf=True,
            yang_name="recovery-time",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="uint32",
            is_config=False,
        )

    enable = __builtin__.property(_get_enable)
    restart_time = __builtin__.property(_get_restart_time)
    recovery_time = __builtin__.property(_get_recovery_time)

    _pyangbind_elements = OrderedDict([
        ("enable", enable),
        ("restart_time", restart_time),
        ("recovery_time", recovery_time),
    ])
Пример #26
0
class state(PybindBase):
    """
  This class was auto-generated by the PythonClass plugin for PYANG
  from YANG module openconfig-network-instance-l2 - based on the path /network-instances/network-instance/protocols/protocol/bgp/peer-groups/peer-group/afi-safis/afi-safi/l2vpn-vpls/prefix-limit/state. Each member element of
  the container is represented as a class variable - with a specific
  YANG type.

  YANG Description: State information relating to the prefix-limit for the
AFI-SAFI
  """
    __slots__ = (
        "_path_helper",
        "_extmethods",
        "__max_prefixes",
        "__prevent_teardown",
        "__shutdown_threshold_pct",
        "__restart_timer",
    )

    _yang_name = "state"

    _pybind_generated_by = "container"

    def __init__(self, *args, **kwargs):

        self._path_helper = False

        self._extmethods = False
        self.__max_prefixes = YANGDynClass(
            base=RestrictedClassType(
                base_type=long,
                restriction_dict={"range": ["0..4294967295"]},
                int_size=32,
            ),
            is_leaf=True,
            yang_name="max-prefixes",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="uint32",
            is_config=False,
        )
        self.__prevent_teardown = YANGDynClass(
            base=YANGBool,
            default=YANGBool("false"),
            is_leaf=True,
            yang_name="prevent-teardown",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="boolean",
            is_config=False,
        )
        self.__shutdown_threshold_pct = YANGDynClass(
            base=RestrictedClassType(
                base_type=RestrictedClassType(
                    base_type=int, restriction_dict={"range": ["0..255"]}, int_size=8
                ),
                restriction_dict={"range": ["0..100"]},
            ),
            is_leaf=True,
            yang_name="shutdown-threshold-pct",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="oc-types:percentage",
            is_config=False,
        )
        self.__restart_timer = YANGDynClass(
            base=RestrictedPrecisionDecimalType(precision=2),
            is_leaf=True,
            yang_name="restart-timer",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="decimal64",
            is_config=False,
        )

        load = kwargs.pop("load", None)
        if args:
            if len(args) > 1:
                raise TypeError("cannot create a YANG container with >1 argument")
            all_attr = True
            for e in self._pyangbind_elements:
                if not hasattr(args[0], e):
                    all_attr = False
                    break
            if not all_attr:
                raise ValueError("Supplied object did not have the correct attributes")
            for e in self._pyangbind_elements:
                nobj = getattr(args[0], e)
                if nobj._changed() is False:
                    continue
                setmethod = getattr(self, "_set_%s" % e)
                if load is None:
                    setmethod(getattr(args[0], e))
                else:
                    setmethod(getattr(args[0], e), load=load)

    def _path(self):
        if hasattr(self, "_parent"):
            return self._parent._path() + [self._yang_name]
        else:
            return [
                "network-instances",
                "network-instance",
                "protocols",
                "protocol",
                "bgp",
                "peer-groups",
                "peer-group",
                "afi-safis",
                "afi-safi",
                "l2vpn-vpls",
                "prefix-limit",
                "state",
            ]

    def _get_max_prefixes(self):
        """
    Getter method for max_prefixes, mapped from YANG variable /network_instances/network_instance/protocols/protocol/bgp/peer_groups/peer_group/afi_safis/afi_safi/l2vpn_vpls/prefix_limit/state/max_prefixes (uint32)

    YANG Description: Maximum number of prefixes that will be accepted
from the neighbour
    """
        return self.__max_prefixes

    def _set_max_prefixes(self, v, load=False):
        """
    Setter method for max_prefixes, mapped from YANG variable /network_instances/network_instance/protocols/protocol/bgp/peer_groups/peer_group/afi_safis/afi_safi/l2vpn_vpls/prefix_limit/state/max_prefixes (uint32)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_max_prefixes is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_max_prefixes() directly.

    YANG Description: Maximum number of prefixes that will be accepted
from the neighbour
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(
                v,
                base=RestrictedClassType(
                    base_type=long,
                    restriction_dict={"range": ["0..4294967295"]},
                    int_size=32,
                ),
                is_leaf=True,
                yang_name="max-prefixes",
                parent=self,
                path_helper=self._path_helper,
                extmethods=self._extmethods,
                register_paths=True,
                namespace="http://openconfig.net/yang/network-instance",
                defining_module="openconfig-network-instance",
                yang_type="uint32",
                is_config=False,
            )
        except (TypeError, ValueError):
            raise ValueError(
                {
                    "error-string": """max_prefixes must be of a type compatible with uint32""",
                    "defined-type": "uint32",
                    "generated-type": """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="max-prefixes", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='uint32', is_config=False)""",
                }
            )

        self.__max_prefixes = t
        if hasattr(self, "_set"):
            self._set()

    def _unset_max_prefixes(self):
        self.__max_prefixes = YANGDynClass(
            base=RestrictedClassType(
                base_type=long,
                restriction_dict={"range": ["0..4294967295"]},
                int_size=32,
            ),
            is_leaf=True,
            yang_name="max-prefixes",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="uint32",
            is_config=False,
        )

    def _get_prevent_teardown(self):
        """
    Getter method for prevent_teardown, mapped from YANG variable /network_instances/network_instance/protocols/protocol/bgp/peer_groups/peer_group/afi_safis/afi_safi/l2vpn_vpls/prefix_limit/state/prevent_teardown (boolean)

    YANG Description: Do not tear down the BGP session when the maximum
prefix limit is exceeded, but rather only log a
warning. The default of this leaf is false, such
that when it is not specified, the session is torn
down.
    """
        return self.__prevent_teardown

    def _set_prevent_teardown(self, v, load=False):
        """
    Setter method for prevent_teardown, mapped from YANG variable /network_instances/network_instance/protocols/protocol/bgp/peer_groups/peer_group/afi_safis/afi_safi/l2vpn_vpls/prefix_limit/state/prevent_teardown (boolean)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_prevent_teardown is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_prevent_teardown() directly.

    YANG Description: Do not tear down the BGP session when the maximum
prefix limit is exceeded, but rather only log a
warning. The default of this leaf is false, such
that when it is not specified, the session is torn
down.
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(
                v,
                base=YANGBool,
                default=YANGBool("false"),
                is_leaf=True,
                yang_name="prevent-teardown",
                parent=self,
                path_helper=self._path_helper,
                extmethods=self._extmethods,
                register_paths=True,
                namespace="http://openconfig.net/yang/network-instance",
                defining_module="openconfig-network-instance",
                yang_type="boolean",
                is_config=False,
            )
        except (TypeError, ValueError):
            raise ValueError(
                {
                    "error-string": """prevent_teardown must be of a type compatible with boolean""",
                    "defined-type": "boolean",
                    "generated-type": """YANGDynClass(base=YANGBool, default=YANGBool("false"), is_leaf=True, yang_name="prevent-teardown", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='boolean', is_config=False)""",
                }
            )

        self.__prevent_teardown = t
        if hasattr(self, "_set"):
            self._set()

    def _unset_prevent_teardown(self):
        self.__prevent_teardown = YANGDynClass(
            base=YANGBool,
            default=YANGBool("false"),
            is_leaf=True,
            yang_name="prevent-teardown",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="boolean",
            is_config=False,
        )

    def _get_shutdown_threshold_pct(self):
        """
    Getter method for shutdown_threshold_pct, mapped from YANG variable /network_instances/network_instance/protocols/protocol/bgp/peer_groups/peer_group/afi_safis/afi_safi/l2vpn_vpls/prefix_limit/state/shutdown_threshold_pct (oc-types:percentage)

    YANG Description: Threshold on number of prefixes that can be received
from a neighbour before generation of warning messages
or log entries. Expressed as a percentage of
max-prefixes
    """
        return self.__shutdown_threshold_pct

    def _set_shutdown_threshold_pct(self, v, load=False):
        """
    Setter method for shutdown_threshold_pct, mapped from YANG variable /network_instances/network_instance/protocols/protocol/bgp/peer_groups/peer_group/afi_safis/afi_safi/l2vpn_vpls/prefix_limit/state/shutdown_threshold_pct (oc-types:percentage)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_shutdown_threshold_pct is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_shutdown_threshold_pct() directly.

    YANG Description: Threshold on number of prefixes that can be received
from a neighbour before generation of warning messages
or log entries. Expressed as a percentage of
max-prefixes
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(
                v,
                base=RestrictedClassType(
                    base_type=RestrictedClassType(
                        base_type=int,
                        restriction_dict={"range": ["0..255"]},
                        int_size=8,
                    ),
                    restriction_dict={"range": ["0..100"]},
                ),
                is_leaf=True,
                yang_name="shutdown-threshold-pct",
                parent=self,
                path_helper=self._path_helper,
                extmethods=self._extmethods,
                register_paths=True,
                namespace="http://openconfig.net/yang/network-instance",
                defining_module="openconfig-network-instance",
                yang_type="oc-types:percentage",
                is_config=False,
            )
        except (TypeError, ValueError):
            raise ValueError(
                {
                    "error-string": """shutdown_threshold_pct must be of a type compatible with oc-types:percentage""",
                    "defined-type": "oc-types:percentage",
                    "generated-type": """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..100']}), is_leaf=True, yang_name="shutdown-threshold-pct", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='oc-types:percentage', is_config=False)""",
                }
            )

        self.__shutdown_threshold_pct = t
        if hasattr(self, "_set"):
            self._set()

    def _unset_shutdown_threshold_pct(self):
        self.__shutdown_threshold_pct = YANGDynClass(
            base=RestrictedClassType(
                base_type=RestrictedClassType(
                    base_type=int, restriction_dict={"range": ["0..255"]}, int_size=8
                ),
                restriction_dict={"range": ["0..100"]},
            ),
            is_leaf=True,
            yang_name="shutdown-threshold-pct",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="oc-types:percentage",
            is_config=False,
        )

    def _get_restart_timer(self):
        """
    Getter method for restart_timer, mapped from YANG variable /network_instances/network_instance/protocols/protocol/bgp/peer_groups/peer_group/afi_safis/afi_safi/l2vpn_vpls/prefix_limit/state/restart_timer (decimal64)

    YANG Description: Time interval in seconds after which the BGP session
is re-established after being torn down due to exceeding
the max-prefix limit.
    """
        return self.__restart_timer

    def _set_restart_timer(self, v, load=False):
        """
    Setter method for restart_timer, mapped from YANG variable /network_instances/network_instance/protocols/protocol/bgp/peer_groups/peer_group/afi_safis/afi_safi/l2vpn_vpls/prefix_limit/state/restart_timer (decimal64)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_restart_timer is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_restart_timer() directly.

    YANG Description: Time interval in seconds after which the BGP session
is re-established after being torn down due to exceeding
the max-prefix limit.
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(
                v,
                base=RestrictedPrecisionDecimalType(precision=2),
                is_leaf=True,
                yang_name="restart-timer",
                parent=self,
                path_helper=self._path_helper,
                extmethods=self._extmethods,
                register_paths=True,
                namespace="http://openconfig.net/yang/network-instance",
                defining_module="openconfig-network-instance",
                yang_type="decimal64",
                is_config=False,
            )
        except (TypeError, ValueError):
            raise ValueError(
                {
                    "error-string": """restart_timer must be of a type compatible with decimal64""",
                    "defined-type": "decimal64",
                    "generated-type": """YANGDynClass(base=RestrictedPrecisionDecimalType(precision=2), is_leaf=True, yang_name="restart-timer", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='decimal64', is_config=False)""",
                }
            )

        self.__restart_timer = t
        if hasattr(self, "_set"):
            self._set()

    def _unset_restart_timer(self):
        self.__restart_timer = YANGDynClass(
            base=RestrictedPrecisionDecimalType(precision=2),
            is_leaf=True,
            yang_name="restart-timer",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="decimal64",
            is_config=False,
        )

    max_prefixes = __builtin__.property(_get_max_prefixes)
    prevent_teardown = __builtin__.property(_get_prevent_teardown)
    shutdown_threshold_pct = __builtin__.property(_get_shutdown_threshold_pct)
    restart_timer = __builtin__.property(_get_restart_timer)

    _pyangbind_elements = OrderedDict(
        [
            ("max_prefixes", max_prefixes),
            ("prevent_teardown", prevent_teardown),
            ("shutdown_threshold_pct", shutdown_threshold_pct),
            ("restart_timer", restart_timer),
        ]
    )
Пример #27
0
class address(PybindBase):
    """
  This class was auto-generated by the PythonClass plugin for PYANG
  from YANG module openconfig-interfaces - based on the path /interfaces/interface/subinterfaces/subinterface/ipv6/addresses/address. Each member element of
  the container is represented as a class variable - with a specific
  YANG type.

  YANG Description: The list of configured IPv6 addresses on the interface.
  """
    __slots__ = (
        '_path_helper',
        '_extmethods',
        '__ip',
        '__config',
        '__state',
        '__vrrp',
    )

    _yang_name = 'address'
    _yang_namespace = 'http://openconfig.net/yang/interfaces'

    _pybind_generated_by = 'container'

    def __init__(self, *args, **kwargs):

        self._path_helper = False

        self._extmethods = False
        self.__ip = YANGDynClass(
            base=six.text_type,
            is_leaf=True,
            yang_name="ip",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            is_keyval=True,
            namespace='http://openconfig.net/yang/interfaces/ip',
            defining_module='openconfig-if-ip',
            yang_type='leafref',
            is_config=True)
        self.__config = YANGDynClass(
            base=config.config,
            is_container='container',
            yang_name="config",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            extensions=None,
            namespace='http://openconfig.net/yang/interfaces/ip',
            defining_module='openconfig-if-ip',
            yang_type='container',
            is_config=True)
        self.__state = YANGDynClass(
            base=state.state,
            is_container='container',
            yang_name="state",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            extensions=None,
            namespace='http://openconfig.net/yang/interfaces/ip',
            defining_module='openconfig-if-ip',
            yang_type='container',
            is_config=True)
        self.__vrrp = YANGDynClass(
            base=vrrp.vrrp,
            is_container='container',
            yang_name="vrrp",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            extensions=None,
            namespace='http://openconfig.net/yang/interfaces/ip',
            defining_module='openconfig-if-ip',
            yang_type='container',
            is_config=True)

        load = kwargs.pop("load", None)
        if args:
            if len(args) > 1:
                raise TypeError(
                    "cannot create a YANG container with >1 argument")
            all_attr = True
            for e in self._pyangbind_elements:
                if not hasattr(args[0], e):
                    all_attr = False
                    break
            if not all_attr:
                raise ValueError(
                    "Supplied object did not have the correct attributes")
            for e in self._pyangbind_elements:
                nobj = getattr(args[0], e)
                if nobj._changed() is False:
                    continue
                setmethod = getattr(self, "_set_%s" % e)
                if load is None:
                    setmethod(getattr(args[0], e))
                else:
                    setmethod(getattr(args[0], e), load=load)

    def _path(self):
        if hasattr(self, "_parent"):
            return self._parent._path() + [self._yang_name]
        else:
            return [
                'interfaces', 'interface', 'subinterfaces', 'subinterface',
                'ipv6', 'addresses', 'address'
            ]

    def _get_ip(self):
        """
    Getter method for ip, mapped from YANG variable /interfaces/interface/subinterfaces/subinterface/ipv6/addresses/address/ip (leafref)

    YANG Description: References the configured IP address
    """
        return self.__ip

    def _set_ip(self, v, load=False):
        """
    Setter method for ip, mapped from YANG variable /interfaces/interface/subinterfaces/subinterface/ipv6/addresses/address/ip (leafref)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_ip is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_ip() directly.

    YANG Description: References the configured IP address
    """
        parent = getattr(self, "_parent", None)
        if parent is not None and load is False:
            raise AttributeError("Cannot set keys directly when" +
                                 " within an instantiated list")

        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(
                v,
                base=six.text_type,
                is_leaf=True,
                yang_name="ip",
                parent=self,
                path_helper=self._path_helper,
                extmethods=self._extmethods,
                register_paths=True,
                is_keyval=True,
                namespace='http://openconfig.net/yang/interfaces/ip',
                defining_module='openconfig-if-ip',
                yang_type='leafref',
                is_config=True)
        except (TypeError, ValueError):
            raise ValueError({
                'error-string':
                """ip must be of a type compatible with leafref""",
                'defined-type':
                "leafref",
                'generated-type':
                """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="ip", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='http://openconfig.net/yang/interfaces/ip', defining_module='openconfig-if-ip', yang_type='leafref', is_config=True)""",
            })

        self.__ip = t
        if hasattr(self, '_set'):
            self._set()

    def _unset_ip(self):
        self.__ip = YANGDynClass(
            base=six.text_type,
            is_leaf=True,
            yang_name="ip",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            is_keyval=True,
            namespace='http://openconfig.net/yang/interfaces/ip',
            defining_module='openconfig-if-ip',
            yang_type='leafref',
            is_config=True)

    def _get_config(self):
        """
    Getter method for config, mapped from YANG variable /interfaces/interface/subinterfaces/subinterface/ipv6/addresses/address/config (container)

    YANG Description: Configuration data for each IPv6 address on
the interface
    """
        return self.__config

    def _set_config(self, v, load=False):
        """
    Setter method for config, mapped from YANG variable /interfaces/interface/subinterfaces/subinterface/ipv6/addresses/address/config (container)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_config is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_config() directly.

    YANG Description: Configuration data for each IPv6 address on
the interface
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(
                v,
                base=config.config,
                is_container='container',
                yang_name="config",
                parent=self,
                path_helper=self._path_helper,
                extmethods=self._extmethods,
                register_paths=True,
                extensions=None,
                namespace='http://openconfig.net/yang/interfaces/ip',
                defining_module='openconfig-if-ip',
                yang_type='container',
                is_config=True)
        except (TypeError, ValueError):
            raise ValueError({
                'error-string':
                """config must be of a type compatible with container""",
                'defined-type':
                "container",
                'generated-type':
                """YANGDynClass(base=config.config, is_container='container', yang_name="config", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/interfaces/ip', defining_module='openconfig-if-ip', yang_type='container', is_config=True)""",
            })

        self.__config = t
        if hasattr(self, '_set'):
            self._set()

    def _unset_config(self):
        self.__config = YANGDynClass(
            base=config.config,
            is_container='container',
            yang_name="config",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            extensions=None,
            namespace='http://openconfig.net/yang/interfaces/ip',
            defining_module='openconfig-if-ip',
            yang_type='container',
            is_config=True)

    def _get_state(self):
        """
    Getter method for state, mapped from YANG variable /interfaces/interface/subinterfaces/subinterface/ipv6/addresses/address/state (container)

    YANG Description: State data for each IPv6 address on the
interface
    """
        return self.__state

    def _set_state(self, v, load=False):
        """
    Setter method for state, mapped from YANG variable /interfaces/interface/subinterfaces/subinterface/ipv6/addresses/address/state (container)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_state is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_state() directly.

    YANG Description: State data for each IPv6 address on the
interface
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(
                v,
                base=state.state,
                is_container='container',
                yang_name="state",
                parent=self,
                path_helper=self._path_helper,
                extmethods=self._extmethods,
                register_paths=True,
                extensions=None,
                namespace='http://openconfig.net/yang/interfaces/ip',
                defining_module='openconfig-if-ip',
                yang_type='container',
                is_config=True)
        except (TypeError, ValueError):
            raise ValueError({
                'error-string':
                """state must be of a type compatible with container""",
                'defined-type':
                "container",
                'generated-type':
                """YANGDynClass(base=state.state, is_container='container', yang_name="state", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/interfaces/ip', defining_module='openconfig-if-ip', yang_type='container', is_config=True)""",
            })

        self.__state = t
        if hasattr(self, '_set'):
            self._set()

    def _unset_state(self):
        self.__state = YANGDynClass(
            base=state.state,
            is_container='container',
            yang_name="state",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            extensions=None,
            namespace='http://openconfig.net/yang/interfaces/ip',
            defining_module='openconfig-if-ip',
            yang_type='container',
            is_config=True)

    def _get_vrrp(self):
        """
    Getter method for vrrp, mapped from YANG variable /interfaces/interface/subinterfaces/subinterface/ipv6/addresses/address/vrrp (container)

    YANG Description: Enclosing container for VRRP groups handled by this
IP interface
    """
        return self.__vrrp

    def _set_vrrp(self, v, load=False):
        """
    Setter method for vrrp, mapped from YANG variable /interfaces/interface/subinterfaces/subinterface/ipv6/addresses/address/vrrp (container)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_vrrp is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_vrrp() directly.

    YANG Description: Enclosing container for VRRP groups handled by this
IP interface
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(
                v,
                base=vrrp.vrrp,
                is_container='container',
                yang_name="vrrp",
                parent=self,
                path_helper=self._path_helper,
                extmethods=self._extmethods,
                register_paths=True,
                extensions=None,
                namespace='http://openconfig.net/yang/interfaces/ip',
                defining_module='openconfig-if-ip',
                yang_type='container',
                is_config=True)
        except (TypeError, ValueError):
            raise ValueError({
                'error-string':
                """vrrp must be of a type compatible with container""",
                'defined-type':
                "container",
                'generated-type':
                """YANGDynClass(base=vrrp.vrrp, is_container='container', yang_name="vrrp", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/interfaces/ip', defining_module='openconfig-if-ip', yang_type='container', is_config=True)""",
            })

        self.__vrrp = t
        if hasattr(self, '_set'):
            self._set()

    def _unset_vrrp(self):
        self.__vrrp = YANGDynClass(
            base=vrrp.vrrp,
            is_container='container',
            yang_name="vrrp",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            extensions=None,
            namespace='http://openconfig.net/yang/interfaces/ip',
            defining_module='openconfig-if-ip',
            yang_type='container',
            is_config=True)

    ip = __builtin__.property(_get_ip, _set_ip)
    config = __builtin__.property(_get_config, _set_config)
    state = __builtin__.property(_get_state, _set_state)
    vrrp = __builtin__.property(_get_vrrp, _set_vrrp)

    _pyangbind_elements = OrderedDict([
        ('ip', ip),
        ('config', config),
        ('state', state),
        ('vrrp', vrrp),
    ])
Пример #28
0
class lan_adjacency_sid(PybindBase):
    """
  This class was auto-generated by the PythonClass plugin for PYANG
  from YANG module openconfig-network-instance - based on the path /network-instances/network-instance/protocols/protocol/isis/levels/level/link-state-database/lsp/tlvs/tlv/mt-isn/neighbors/neighbor/subTLVs/subTLVs/lan-adjacency-sid. Each member element of
  the container is represented as a class variable - with a specific
  YANG type.

  YANG Description: This container defines segment routing extensions for prefixes.
  """
    __slots__ = ("_path_helper", "_extmethods", "__sid")

    _yang_name = "lan-adjacency-sid"

    _pybind_generated_by = "container"

    def __init__(self, *args, **kwargs):

        self._path_helper = False

        self._extmethods = False
        self.__sid = YANGDynClass(
            base=YANGListType(
                False,
                sid.sid,
                yang_name="sid",
                parent=self,
                is_container="list",
                user_ordered=False,
                path_helper=self._path_helper,
                yang_keys="False",
                extensions=None,
            ),
            is_container="list",
            yang_name="sid",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            extensions=None,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="list",
            is_config=False,
        )

        load = kwargs.pop("load", None)
        if args:
            if len(args) > 1:
                raise TypeError(
                    "cannot create a YANG container with >1 argument")
            all_attr = True
            for e in self._pyangbind_elements:
                if not hasattr(args[0], e):
                    all_attr = False
                    break
            if not all_attr:
                raise ValueError(
                    "Supplied object did not have the correct attributes")
            for e in self._pyangbind_elements:
                nobj = getattr(args[0], e)
                if nobj._changed() is False:
                    continue
                setmethod = getattr(self, "_set_%s" % e)
                if load is None:
                    setmethod(getattr(args[0], e))
                else:
                    setmethod(getattr(args[0], e), load=load)

    def _path(self):
        if hasattr(self, "_parent"):
            return self._parent._path() + [self._yang_name]
        else:
            return [
                "network-instances",
                "network-instance",
                "protocols",
                "protocol",
                "isis",
                "levels",
                "level",
                "link-state-database",
                "lsp",
                "tlvs",
                "tlv",
                "mt-isn",
                "neighbors",
                "neighbor",
                "subTLVs",
                "subTLVs",
                "lan-adjacency-sid",
            ]

    def _get_sid(self):
        """
    Getter method for sid, mapped from YANG variable /network_instances/network_instance/protocols/protocol/isis/levels/level/link_state_database/lsp/tlvs/tlv/mt_isn/neighbors/neighbor/subTLVs/subTLVs/lan_adjacency_sid/sid (list)

    YANG Description: Adjacency Segment-IDs List. An IGP-Adjacency Segment is an IGP
segment attached to a unidirectional adjacency or a set of
unidirectional adjacencies. By default, an IGP-Adjacency Segment is
local to the node which advertises it.
    """
        return self.__sid

    def _set_sid(self, v, load=False):
        """
    Setter method for sid, mapped from YANG variable /network_instances/network_instance/protocols/protocol/isis/levels/level/link_state_database/lsp/tlvs/tlv/mt_isn/neighbors/neighbor/subTLVs/subTLVs/lan_adjacency_sid/sid (list)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_sid is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_sid() directly.

    YANG Description: Adjacency Segment-IDs List. An IGP-Adjacency Segment is an IGP
segment attached to a unidirectional adjacency or a set of
unidirectional adjacencies. By default, an IGP-Adjacency Segment is
local to the node which advertises it.
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(
                v,
                base=YANGListType(
                    False,
                    sid.sid,
                    yang_name="sid",
                    parent=self,
                    is_container="list",
                    user_ordered=False,
                    path_helper=self._path_helper,
                    yang_keys="False",
                    extensions=None,
                ),
                is_container="list",
                yang_name="sid",
                parent=self,
                path_helper=self._path_helper,
                extmethods=self._extmethods,
                register_paths=True,
                extensions=None,
                namespace="http://openconfig.net/yang/network-instance",
                defining_module="openconfig-network-instance",
                yang_type="list",
                is_config=False,
            )
        except (TypeError, ValueError):
            raise ValueError({
                "error-string":
                """sid must be of a type compatible with list""",
                "defined-type":
                "list",
                "generated-type":
                """YANGDynClass(base=YANGListType(False,sid.sid, yang_name="sid", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='False', extensions=None), is_container='list', yang_name="sid", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='list', is_config=False)""",
            })

        self.__sid = t
        if hasattr(self, "_set"):
            self._set()

    def _unset_sid(self):
        self.__sid = YANGDynClass(
            base=YANGListType(
                False,
                sid.sid,
                yang_name="sid",
                parent=self,
                is_container="list",
                user_ordered=False,
                path_helper=self._path_helper,
                yang_keys="False",
                extensions=None,
            ),
            is_container="list",
            yang_name="sid",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            extensions=None,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="list",
            is_config=False,
        )

    sid = __builtin__.property(_get_sid)

    _pyangbind_elements = OrderedDict([("sid", sid)])
Пример #29
0
class config(PybindBase):
    """
  This class was auto-generated by the PythonClass plugin for PYANG
  from YANG module openconfig-network-instance-l2 - based on the path /network-instances/network-instance/protocols/protocol/bgp/peer-groups/peer-group/timers/config. Each member element of
  the container is represented as a class variable - with a specific
  YANG type.

  YANG Description: Configuration parameters relating to timers used for the
BGP neighbor or peer group
  """
    __slots__ = (
        "_path_helper",
        "_extmethods",
        "__connect_retry",
        "__hold_time",
        "__keepalive_interval",
        "__minimum_advertisement_interval",
    )

    _yang_name = "config"

    _pybind_generated_by = "container"

    def __init__(self, *args, **kwargs):

        self._path_helper = False

        self._extmethods = False
        self.__connect_retry = YANGDynClass(
            base=RestrictedPrecisionDecimalType(precision=2),
            default=Decimal(30),
            is_leaf=True,
            yang_name="connect-retry",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="decimal64",
            is_config=True,
        )
        self.__hold_time = YANGDynClass(
            base=RestrictedPrecisionDecimalType(precision=2),
            default=Decimal(90),
            is_leaf=True,
            yang_name="hold-time",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="decimal64",
            is_config=True,
        )
        self.__keepalive_interval = YANGDynClass(
            base=RestrictedPrecisionDecimalType(precision=2),
            default=Decimal(30),
            is_leaf=True,
            yang_name="keepalive-interval",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="decimal64",
            is_config=True,
        )
        self.__minimum_advertisement_interval = YANGDynClass(
            base=RestrictedPrecisionDecimalType(precision=2),
            default=Decimal(30),
            is_leaf=True,
            yang_name="minimum-advertisement-interval",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="decimal64",
            is_config=True,
        )

        load = kwargs.pop("load", None)
        if args:
            if len(args) > 1:
                raise TypeError(
                    "cannot create a YANG container with >1 argument")
            all_attr = True
            for e in self._pyangbind_elements:
                if not hasattr(args[0], e):
                    all_attr = False
                    break
            if not all_attr:
                raise ValueError(
                    "Supplied object did not have the correct attributes")
            for e in self._pyangbind_elements:
                nobj = getattr(args[0], e)
                if nobj._changed() is False:
                    continue
                setmethod = getattr(self, "_set_%s" % e)
                if load is None:
                    setmethod(getattr(args[0], e))
                else:
                    setmethod(getattr(args[0], e), load=load)

    def _path(self):
        if hasattr(self, "_parent"):
            return self._parent._path() + [self._yang_name]
        else:
            return [
                "network-instances",
                "network-instance",
                "protocols",
                "protocol",
                "bgp",
                "peer-groups",
                "peer-group",
                "timers",
                "config",
            ]

    def _get_connect_retry(self):
        """
    Getter method for connect_retry, mapped from YANG variable /network_instances/network_instance/protocols/protocol/bgp/peer_groups/peer_group/timers/config/connect_retry (decimal64)

    YANG Description: Time interval in seconds between attempts to establish a
session with the peer.
    """
        return self.__connect_retry

    def _set_connect_retry(self, v, load=False):
        """
    Setter method for connect_retry, mapped from YANG variable /network_instances/network_instance/protocols/protocol/bgp/peer_groups/peer_group/timers/config/connect_retry (decimal64)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_connect_retry is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_connect_retry() directly.

    YANG Description: Time interval in seconds between attempts to establish a
session with the peer.
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(
                v,
                base=RestrictedPrecisionDecimalType(precision=2),
                default=Decimal(30),
                is_leaf=True,
                yang_name="connect-retry",
                parent=self,
                path_helper=self._path_helper,
                extmethods=self._extmethods,
                register_paths=True,
                namespace="http://openconfig.net/yang/network-instance",
                defining_module="openconfig-network-instance",
                yang_type="decimal64",
                is_config=True,
            )
        except (TypeError, ValueError):
            raise ValueError({
                "error-string":
                """connect_retry must be of a type compatible with decimal64""",
                "defined-type":
                "decimal64",
                "generated-type":
                """YANGDynClass(base=RestrictedPrecisionDecimalType(precision=2), default=Decimal(30), is_leaf=True, yang_name="connect-retry", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='decimal64', is_config=True)""",
            })

        self.__connect_retry = t
        if hasattr(self, "_set"):
            self._set()

    def _unset_connect_retry(self):
        self.__connect_retry = YANGDynClass(
            base=RestrictedPrecisionDecimalType(precision=2),
            default=Decimal(30),
            is_leaf=True,
            yang_name="connect-retry",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="decimal64",
            is_config=True,
        )

    def _get_hold_time(self):
        """
    Getter method for hold_time, mapped from YANG variable /network_instances/network_instance/protocols/protocol/bgp/peer_groups/peer_group/timers/config/hold_time (decimal64)

    YANG Description: Time interval in seconds that a BGP session will be
considered active in the absence of keepalive or other
messages from the peer.  The hold-time is typically
set to 3x the keepalive-interval.
    """
        return self.__hold_time

    def _set_hold_time(self, v, load=False):
        """
    Setter method for hold_time, mapped from YANG variable /network_instances/network_instance/protocols/protocol/bgp/peer_groups/peer_group/timers/config/hold_time (decimal64)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_hold_time is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_hold_time() directly.

    YANG Description: Time interval in seconds that a BGP session will be
considered active in the absence of keepalive or other
messages from the peer.  The hold-time is typically
set to 3x the keepalive-interval.
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(
                v,
                base=RestrictedPrecisionDecimalType(precision=2),
                default=Decimal(90),
                is_leaf=True,
                yang_name="hold-time",
                parent=self,
                path_helper=self._path_helper,
                extmethods=self._extmethods,
                register_paths=True,
                namespace="http://openconfig.net/yang/network-instance",
                defining_module="openconfig-network-instance",
                yang_type="decimal64",
                is_config=True,
            )
        except (TypeError, ValueError):
            raise ValueError({
                "error-string":
                """hold_time must be of a type compatible with decimal64""",
                "defined-type":
                "decimal64",
                "generated-type":
                """YANGDynClass(base=RestrictedPrecisionDecimalType(precision=2), default=Decimal(90), is_leaf=True, yang_name="hold-time", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='decimal64', is_config=True)""",
            })

        self.__hold_time = t
        if hasattr(self, "_set"):
            self._set()

    def _unset_hold_time(self):
        self.__hold_time = YANGDynClass(
            base=RestrictedPrecisionDecimalType(precision=2),
            default=Decimal(90),
            is_leaf=True,
            yang_name="hold-time",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="decimal64",
            is_config=True,
        )

    def _get_keepalive_interval(self):
        """
    Getter method for keepalive_interval, mapped from YANG variable /network_instances/network_instance/protocols/protocol/bgp/peer_groups/peer_group/timers/config/keepalive_interval (decimal64)

    YANG Description: Time interval in seconds between transmission of keepalive
messages to the neighbor.  Typically set to 1/3 the
hold-time.
    """
        return self.__keepalive_interval

    def _set_keepalive_interval(self, v, load=False):
        """
    Setter method for keepalive_interval, mapped from YANG variable /network_instances/network_instance/protocols/protocol/bgp/peer_groups/peer_group/timers/config/keepalive_interval (decimal64)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_keepalive_interval is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_keepalive_interval() directly.

    YANG Description: Time interval in seconds between transmission of keepalive
messages to the neighbor.  Typically set to 1/3 the
hold-time.
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(
                v,
                base=RestrictedPrecisionDecimalType(precision=2),
                default=Decimal(30),
                is_leaf=True,
                yang_name="keepalive-interval",
                parent=self,
                path_helper=self._path_helper,
                extmethods=self._extmethods,
                register_paths=True,
                namespace="http://openconfig.net/yang/network-instance",
                defining_module="openconfig-network-instance",
                yang_type="decimal64",
                is_config=True,
            )
        except (TypeError, ValueError):
            raise ValueError({
                "error-string":
                """keepalive_interval must be of a type compatible with decimal64""",
                "defined-type":
                "decimal64",
                "generated-type":
                """YANGDynClass(base=RestrictedPrecisionDecimalType(precision=2), default=Decimal(30), is_leaf=True, yang_name="keepalive-interval", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='decimal64', is_config=True)""",
            })

        self.__keepalive_interval = t
        if hasattr(self, "_set"):
            self._set()

    def _unset_keepalive_interval(self):
        self.__keepalive_interval = YANGDynClass(
            base=RestrictedPrecisionDecimalType(precision=2),
            default=Decimal(30),
            is_leaf=True,
            yang_name="keepalive-interval",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="decimal64",
            is_config=True,
        )

    def _get_minimum_advertisement_interval(self):
        """
    Getter method for minimum_advertisement_interval, mapped from YANG variable /network_instances/network_instance/protocols/protocol/bgp/peer_groups/peer_group/timers/config/minimum_advertisement_interval (decimal64)

    YANG Description: Minimum time which must elapse between subsequent UPDATE
messages relating to a common set of NLRI being transmitted
to a peer. This timer is referred to as
MinRouteAdvertisementIntervalTimer by RFC 4721 and serves to
reduce the number of UPDATE messages transmitted when a
particular set of NLRI exhibit instability.
    """
        return self.__minimum_advertisement_interval

    def _set_minimum_advertisement_interval(self, v, load=False):
        """
    Setter method for minimum_advertisement_interval, mapped from YANG variable /network_instances/network_instance/protocols/protocol/bgp/peer_groups/peer_group/timers/config/minimum_advertisement_interval (decimal64)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_minimum_advertisement_interval is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_minimum_advertisement_interval() directly.

    YANG Description: Minimum time which must elapse between subsequent UPDATE
messages relating to a common set of NLRI being transmitted
to a peer. This timer is referred to as
MinRouteAdvertisementIntervalTimer by RFC 4721 and serves to
reduce the number of UPDATE messages transmitted when a
particular set of NLRI exhibit instability.
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(
                v,
                base=RestrictedPrecisionDecimalType(precision=2),
                default=Decimal(30),
                is_leaf=True,
                yang_name="minimum-advertisement-interval",
                parent=self,
                path_helper=self._path_helper,
                extmethods=self._extmethods,
                register_paths=True,
                namespace="http://openconfig.net/yang/network-instance",
                defining_module="openconfig-network-instance",
                yang_type="decimal64",
                is_config=True,
            )
        except (TypeError, ValueError):
            raise ValueError({
                "error-string":
                """minimum_advertisement_interval must be of a type compatible with decimal64""",
                "defined-type":
                "decimal64",
                "generated-type":
                """YANGDynClass(base=RestrictedPrecisionDecimalType(precision=2), default=Decimal(30), is_leaf=True, yang_name="minimum-advertisement-interval", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='decimal64', is_config=True)""",
            })

        self.__minimum_advertisement_interval = t
        if hasattr(self, "_set"):
            self._set()

    def _unset_minimum_advertisement_interval(self):
        self.__minimum_advertisement_interval = YANGDynClass(
            base=RestrictedPrecisionDecimalType(precision=2),
            default=Decimal(30),
            is_leaf=True,
            yang_name="minimum-advertisement-interval",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="decimal64",
            is_config=True,
        )

    connect_retry = __builtin__.property(_get_connect_retry,
                                         _set_connect_retry)
    hold_time = __builtin__.property(_get_hold_time, _set_hold_time)
    keepalive_interval = __builtin__.property(_get_keepalive_interval,
                                              _set_keepalive_interval)
    minimum_advertisement_interval = __builtin__.property(
        _get_minimum_advertisement_interval,
        _set_minimum_advertisement_interval)

    _pyangbind_elements = OrderedDict([
        ("connect_retry", connect_retry),
        ("hold_time", hold_time),
        ("keepalive_interval", keepalive_interval),
        ("minimum_advertisement_interval", minimum_advertisement_interval),
    ])
Пример #30
0
class vrrp(PybindBase):
    """
  This class was auto-generated by the PythonClass plugin for PYANG
  from YANG module openconfig-interfaces - based on the path /interfaces/interface/subinterfaces/subinterface/ipv6/addresses/address/vrrp. Each member element of
  the container is represented as a class variable - with a specific
  YANG type.

  YANG Description: Enclosing container for VRRP groups handled by this
IP interface
  """
    __slots__ = ("_path_helper", "_extmethods", "__vrrp_group")

    _yang_name = "vrrp"

    _pybind_generated_by = "container"

    def __init__(self, *args, **kwargs):

        self._path_helper = False

        self._extmethods = False
        self.__vrrp_group = YANGDynClass(
            base=YANGListType(
                "virtual_router_id",
                vrrp_group.vrrp_group,
                yang_name="vrrp-group",
                parent=self,
                is_container="list",
                user_ordered=False,
                path_helper=self._path_helper,
                yang_keys="virtual-router-id",
                extensions=None,
            ),
            is_container="list",
            yang_name="vrrp-group",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            extensions=None,
            namespace="http://openconfig.net/yang/interfaces/ip",
            defining_module="openconfig-if-ip",
            yang_type="list",
            is_config=True,
        )

        load = kwargs.pop("load", None)
        if args:
            if len(args) > 1:
                raise TypeError(
                    "cannot create a YANG container with >1 argument")
            all_attr = True
            for e in self._pyangbind_elements:
                if not hasattr(args[0], e):
                    all_attr = False
                    break
            if not all_attr:
                raise ValueError(
                    "Supplied object did not have the correct attributes")
            for e in self._pyangbind_elements:
                nobj = getattr(args[0], e)
                if nobj._changed() is False:
                    continue
                setmethod = getattr(self, "_set_%s" % e)
                if load is None:
                    setmethod(getattr(args[0], e))
                else:
                    setmethod(getattr(args[0], e), load=load)

    def _path(self):
        if hasattr(self, "_parent"):
            return self._parent._path() + [self._yang_name]
        else:
            return [
                "interfaces",
                "interface",
                "subinterfaces",
                "subinterface",
                "ipv6",
                "addresses",
                "address",
                "vrrp",
            ]

    def _get_vrrp_group(self):
        """
    Getter method for vrrp_group, mapped from YANG variable /interfaces/interface/subinterfaces/subinterface/ipv6/addresses/address/vrrp/vrrp_group (list)

    YANG Description: List of VRRP groups, keyed by virtual router id
    """
        return self.__vrrp_group

    def _set_vrrp_group(self, v, load=False):
        """
    Setter method for vrrp_group, mapped from YANG variable /interfaces/interface/subinterfaces/subinterface/ipv6/addresses/address/vrrp/vrrp_group (list)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_vrrp_group is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_vrrp_group() directly.

    YANG Description: List of VRRP groups, keyed by virtual router id
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(
                v,
                base=YANGListType(
                    "virtual_router_id",
                    vrrp_group.vrrp_group,
                    yang_name="vrrp-group",
                    parent=self,
                    is_container="list",
                    user_ordered=False,
                    path_helper=self._path_helper,
                    yang_keys="virtual-router-id",
                    extensions=None,
                ),
                is_container="list",
                yang_name="vrrp-group",
                parent=self,
                path_helper=self._path_helper,
                extmethods=self._extmethods,
                register_paths=True,
                extensions=None,
                namespace="http://openconfig.net/yang/interfaces/ip",
                defining_module="openconfig-if-ip",
                yang_type="list",
                is_config=True,
            )
        except (TypeError, ValueError):
            raise ValueError({
                "error-string":
                """vrrp_group must be of a type compatible with list""",
                "defined-type":
                "list",
                "generated-type":
                """YANGDynClass(base=YANGListType("virtual_router_id",vrrp_group.vrrp_group, yang_name="vrrp-group", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='virtual-router-id', extensions=None), is_container='list', yang_name="vrrp-group", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/interfaces/ip', defining_module='openconfig-if-ip', yang_type='list', is_config=True)""",
            })

        self.__vrrp_group = t
        if hasattr(self, "_set"):
            self._set()

    def _unset_vrrp_group(self):
        self.__vrrp_group = YANGDynClass(
            base=YANGListType(
                "virtual_router_id",
                vrrp_group.vrrp_group,
                yang_name="vrrp-group",
                parent=self,
                is_container="list",
                user_ordered=False,
                path_helper=self._path_helper,
                yang_keys="virtual-router-id",
                extensions=None,
            ),
            is_container="list",
            yang_name="vrrp-group",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            extensions=None,
            namespace="http://openconfig.net/yang/interfaces/ip",
            defining_module="openconfig-if-ip",
            yang_type="list",
            is_config=True,
        )

    vrrp_group = __builtin__.property(_get_vrrp_group, _set_vrrp_group)

    _pyangbind_elements = OrderedDict([("vrrp_group", vrrp_group)])
Пример #31
0
class subinterface(PybindBase):
    """
  This class was auto-generated by the PythonClass plugin for PYANG
  from YANG module openconfig-interfaces - based on the path /interfaces/interface/subinterfaces/subinterface. Each member element of
  the container is represented as a class variable - with a specific
  YANG type.

  YANG Description: The list of subinterfaces (logical interfaces) associated
with a physical interface
  """
    __slots__ = (
        '_pybind_generated_by',
        '_path_helper',
        '_yang_name',
        '_extmethods',
        '__index',
        '__config',
        '__state',
    )

    _yang_name = 'subinterface'

    _pybind_generated_by = 'container'

    def __init__(self, *args, **kwargs):

        self._path_helper = False

        self._extmethods = False
        self.__index = YANGDynClass(
            base=unicode,
            is_leaf=True,
            yang_name="index",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            is_keyval=True,
            namespace='http://openconfig.net/yang/interfaces',
            defining_module='openconfig-interfaces',
            yang_type='leafref',
            is_config=True)
        self.__state = YANGDynClass(
            base=state.state,
            is_container='container',
            yang_name="state",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            extensions=None,
            namespace='http://openconfig.net/yang/interfaces',
            defining_module='openconfig-interfaces',
            yang_type='container',
            is_config=True)
        self.__config = YANGDynClass(
            base=config.config,
            is_container='container',
            yang_name="config",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            extensions=None,
            namespace='http://openconfig.net/yang/interfaces',
            defining_module='openconfig-interfaces',
            yang_type='container',
            is_config=True)

        load = kwargs.pop("load", None)
        if args:
            if len(args) > 1:
                raise TypeError(
                    "cannot create a YANG container with >1 argument")
            all_attr = True
            for e in self._pyangbind_elements:
                if not hasattr(args[0], e):
                    all_attr = False
                    break
            if not all_attr:
                raise ValueError(
                    "Supplied object did not have the correct attributes")
            for e in self._pyangbind_elements:
                nobj = getattr(args[0], e)
                if nobj._changed() is False:
                    continue
                setmethod = getattr(self, "_set_%s" % e)
                if load is None:
                    setmethod(getattr(args[0], e))
                else:
                    setmethod(getattr(args[0], e), load=load)

    def _path(self):
        if hasattr(self, "_parent"):
            return self._parent._path() + [self._yang_name]
        else:
            return [
                u'interfaces', u'interface', u'subinterfaces', u'subinterface'
            ]

    def _get_index(self):
        """
    Getter method for index, mapped from YANG variable /interfaces/interface/subinterfaces/subinterface/index (leafref)

    YANG Description: The index number of the subinterface -- used to address
the logical interface
    """
        return self.__index

    def _set_index(self, v, load=False):
        """
    Setter method for index, mapped from YANG variable /interfaces/interface/subinterfaces/subinterface/index (leafref)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_index is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_index() directly.

    YANG Description: The index number of the subinterface -- used to address
the logical interface
    """
        parent = getattr(self, "_parent", None)
        if parent is not None and load is False:
            raise AttributeError("Cannot set keys directly when" +
                                 " within an instantiated list")

        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(v,
                             base=unicode,
                             is_leaf=True,
                             yang_name="index",
                             parent=self,
                             path_helper=self._path_helper,
                             extmethods=self._extmethods,
                             register_paths=True,
                             is_keyval=True,
                             namespace='http://openconfig.net/yang/interfaces',
                             defining_module='openconfig-interfaces',
                             yang_type='leafref',
                             is_config=True)
        except (TypeError, ValueError):
            raise ValueError({
                'error-string':
                """index must be of a type compatible with leafref""",
                'defined-type':
                "leafref",
                'generated-type':
                """YANGDynClass(base=unicode, is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='leafref', is_config=True)""",
            })

        self.__index = t
        if hasattr(self, '_set'):
            self._set()

    def _unset_index(self):
        self.__index = YANGDynClass(
            base=unicode,
            is_leaf=True,
            yang_name="index",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            is_keyval=True,
            namespace='http://openconfig.net/yang/interfaces',
            defining_module='openconfig-interfaces',
            yang_type='leafref',
            is_config=True)

    def _get_config(self):
        """
    Getter method for config, mapped from YANG variable /interfaces/interface/subinterfaces/subinterface/config (container)

    YANG Description: Configurable items at the subinterface level
    """
        return self.__config

    def _set_config(self, v, load=False):
        """
    Setter method for config, mapped from YANG variable /interfaces/interface/subinterfaces/subinterface/config (container)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_config is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_config() directly.

    YANG Description: Configurable items at the subinterface level
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(v,
                             base=config.config,
                             is_container='container',
                             yang_name="config",
                             parent=self,
                             path_helper=self._path_helper,
                             extmethods=self._extmethods,
                             register_paths=True,
                             extensions=None,
                             namespace='http://openconfig.net/yang/interfaces',
                             defining_module='openconfig-interfaces',
                             yang_type='container',
                             is_config=True)
        except (TypeError, ValueError):
            raise ValueError({
                'error-string':
                """config must be of a type compatible with container""",
                'defined-type':
                "container",
                'generated-type':
                """YANGDynClass(base=config.config, is_container='container', yang_name="config", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='container', is_config=True)""",
            })

        self.__config = t
        if hasattr(self, '_set'):
            self._set()

    def _unset_config(self):
        self.__config = YANGDynClass(
            base=config.config,
            is_container='container',
            yang_name="config",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            extensions=None,
            namespace='http://openconfig.net/yang/interfaces',
            defining_module='openconfig-interfaces',
            yang_type='container',
            is_config=True)

    def _get_state(self):
        """
    Getter method for state, mapped from YANG variable /interfaces/interface/subinterfaces/subinterface/state (container)

    YANG Description: Operational state data for logical interfaces
    """
        return self.__state

    def _set_state(self, v, load=False):
        """
    Setter method for state, mapped from YANG variable /interfaces/interface/subinterfaces/subinterface/state (container)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_state is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_state() directly.

    YANG Description: Operational state data for logical interfaces
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(v,
                             base=state.state,
                             is_container='container',
                             yang_name="state",
                             parent=self,
                             path_helper=self._path_helper,
                             extmethods=self._extmethods,
                             register_paths=True,
                             extensions=None,
                             namespace='http://openconfig.net/yang/interfaces',
                             defining_module='openconfig-interfaces',
                             yang_type='container',
                             is_config=True)
        except (TypeError, ValueError):
            raise ValueError({
                'error-string':
                """state must be of a type compatible with container""",
                'defined-type':
                "container",
                'generated-type':
                """YANGDynClass(base=state.state, is_container='container', yang_name="state", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='container', is_config=True)""",
            })

        self.__state = t
        if hasattr(self, '_set'):
            self._set()

    def _unset_state(self):
        self.__state = YANGDynClass(
            base=state.state,
            is_container='container',
            yang_name="state",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            extensions=None,
            namespace='http://openconfig.net/yang/interfaces',
            defining_module='openconfig-interfaces',
            yang_type='container',
            is_config=True)

    index = __builtin__.property(_get_index, _set_index)
    config = __builtin__.property(_get_config, _set_config)
    state = __builtin__.property(_get_state, _set_state)

    _pyangbind_elements = {
        'index': index,
        'config': config,
        'state': state,
    }