Exemple #1
0
def property(function):
    keys = 'fget', 'fset', 'fdel'
    func_locals = {'doc':function.__doc__}
    def probe_func(frame, event, arg):
        if event == 'return':
            locals = frame.f_locals
            func_locals.update(dict((k, locals.get(k)) for k in keys))
            sys.settrace(None)
        return probe_func
    sys.settrace(probe_func)
    function()
    return builtins.property(**func_locals)
Exemple #2
0
    def negative_assertion(name, prop=True):
        def method(self):
            builder = AssertionBuilder(negative=True)
            instance = builder(self)
            callable_args = getattr(self, '_callable_args', None)
            if callable_args:
                instance._callable_args = callable_args
            callable_kw = getattr(self, '_callable_kw', None)
            if callable_kw:
                instance._callable_kw = callable_kw
            return instance

        method.__name__ = name
        return (__builtin__.property(method) if prop else method(None))
Exemple #3
0
class link_properties(PybindBase):
    """
  This class was auto-generated by the PythonClass plugin for PYANG
  from YANG module brocade-common-def - based on the path /routing-system/ipv6/router/ospf/area/virtual-link/link-properties. Each member element of
  the container is represented as a class variable - with a specific
  YANG type.
  """
    __slots__ = (
        '_pybind_generated_by',
        '_path_helper',
        '_yang_name',
        '_rest_name',
        '_extmethods',
        '__link_interval_properties',
        '__authentication',
    )

    _yang_name = 'link-properties'
    _rest_name = ''

    _pybind_generated_by = 'container'

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

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

        extmethods = kwargs.pop("extmethods", None)
        if extmethods is False:
            self._extmethods = False
        elif extmethods is not None and isinstance(extmethods, dict):
            self._extmethods = extmethods
        elif hasattr(self, "_parent"):
            extmethods = getattr(self._parent, "_extmethods", None)
            self._extmethods = extmethods
        else:
            self._extmethods = False
        self.__authentication = YANGDynClass(
            base=authentication.authentication,
            is_container='container',
            presence=False,
            yang_name="authentication",
            rest_name="authentication",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            extensions={
                u'tailf-common': {
                    u'info': u'Authentication of OSPF messages',
                    u'cli-incomplete-no': None,
                    u'cli-incomplete-command': None
                }
            },
            namespace='urn:brocade.com:mgmt:brocade-ospfv3',
            defining_module='brocade-ospfv3',
            yang_type='container',
            is_config=True)
        self.__link_interval_properties = YANGDynClass(
            base=link_interval_properties.link_interval_properties,
            is_container='container',
            presence=False,
            yang_name="link-interval-properties",
            rest_name="",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            extensions={
                u'tailf-common': {
                    u'cli-drop-node-name': None,
                    u'cli-incomplete-no': None
                }
            },
            namespace='urn:brocade.com:mgmt:brocade-ospfv3',
            defining_module='brocade-ospfv3',
            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'routing-system', u'ipv6', u'router', u'ospf', u'area',
                u'virtual-link', u'link-properties'
            ]

    def _rest_path(self):
        if hasattr(self, "_parent"):
            if self._rest_name:
                return self._parent._rest_path() + [self._rest_name]
            else:
                return self._parent._rest_path()
        else:
            return [u'ipv6', u'router', u'ospf', u'area', u'virtual-link']

    def _get_link_interval_properties(self):
        """
    Getter method for link_interval_properties, mapped from YANG variable /routing_system/ipv6/router/ospf/area/virtual_link/link_properties/link_interval_properties (container)
    """
        return self.__link_interval_properties

    def _set_link_interval_properties(self, v, load=False):
        """
    Setter method for link_interval_properties, mapped from YANG variable /routing_system/ipv6/router/ospf/area/virtual_link/link_properties/link_interval_properties (container)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_link_interval_properties is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_link_interval_properties() directly.
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(
                v,
                base=link_interval_properties.link_interval_properties,
                is_container='container',
                presence=False,
                yang_name="link-interval-properties",
                rest_name="",
                parent=self,
                path_helper=self._path_helper,
                extmethods=self._extmethods,
                register_paths=True,
                extensions={
                    u'tailf-common': {
                        u'cli-drop-node-name': None,
                        u'cli-incomplete-no': None
                    }
                },
                namespace='urn:brocade.com:mgmt:brocade-ospfv3',
                defining_module='brocade-ospfv3',
                yang_type='container',
                is_config=True)
        except (TypeError, ValueError):
            raise ValueError({
                'error-string':
                """link_interval_properties must be of a type compatible with container""",
                'defined-type':
                "container",
                'generated-type':
                """YANGDynClass(base=link_interval_properties.link_interval_properties, is_container='container', presence=False, yang_name="link-interval-properties", rest_name="", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'cli-drop-node-name': None, u'cli-incomplete-no': None}}, namespace='urn:brocade.com:mgmt:brocade-ospfv3', defining_module='brocade-ospfv3', yang_type='container', is_config=True)""",
            })

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

    def _unset_link_interval_properties(self):
        self.__link_interval_properties = YANGDynClass(
            base=link_interval_properties.link_interval_properties,
            is_container='container',
            presence=False,
            yang_name="link-interval-properties",
            rest_name="",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            extensions={
                u'tailf-common': {
                    u'cli-drop-node-name': None,
                    u'cli-incomplete-no': None
                }
            },
            namespace='urn:brocade.com:mgmt:brocade-ospfv3',
            defining_module='brocade-ospfv3',
            yang_type='container',
            is_config=True)

    def _get_authentication(self):
        """
    Getter method for authentication, mapped from YANG variable /routing_system/ipv6/router/ospf/area/virtual_link/link_properties/authentication (container)

    YANG Description: Authentication of OSPF messages
    """
        return self.__authentication

    def _set_authentication(self, v, load=False):
        """
    Setter method for authentication, mapped from YANG variable /routing_system/ipv6/router/ospf/area/virtual_link/link_properties/authentication (container)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_authentication is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_authentication() directly.

    YANG Description: Authentication of OSPF messages
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(v,
                             base=authentication.authentication,
                             is_container='container',
                             presence=False,
                             yang_name="authentication",
                             rest_name="authentication",
                             parent=self,
                             path_helper=self._path_helper,
                             extmethods=self._extmethods,
                             register_paths=True,
                             extensions={
                                 u'tailf-common': {
                                     u'info':
                                     u'Authentication of OSPF messages',
                                     u'cli-incomplete-no': None,
                                     u'cli-incomplete-command': None
                                 }
                             },
                             namespace='urn:brocade.com:mgmt:brocade-ospfv3',
                             defining_module='brocade-ospfv3',
                             yang_type='container',
                             is_config=True)
        except (TypeError, ValueError):
            raise ValueError({
                'error-string':
                """authentication must be of a type compatible with container""",
                'defined-type':
                "container",
                'generated-type':
                """YANGDynClass(base=authentication.authentication, is_container='container', presence=False, yang_name="authentication", rest_name="authentication", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'info': u'Authentication of OSPF messages', u'cli-incomplete-no': None, u'cli-incomplete-command': None}}, namespace='urn:brocade.com:mgmt:brocade-ospfv3', defining_module='brocade-ospfv3', yang_type='container', is_config=True)""",
            })

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

    def _unset_authentication(self):
        self.__authentication = YANGDynClass(
            base=authentication.authentication,
            is_container='container',
            presence=False,
            yang_name="authentication",
            rest_name="authentication",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            extensions={
                u'tailf-common': {
                    u'info': u'Authentication of OSPF messages',
                    u'cli-incomplete-no': None,
                    u'cli-incomplete-command': None
                }
            },
            namespace='urn:brocade.com:mgmt:brocade-ospfv3',
            defining_module='brocade-ospfv3',
            yang_type='container',
            is_config=True)

    link_interval_properties = __builtin__.property(
        _get_link_interval_properties, _set_link_interval_properties)
    authentication = __builtin__.property(_get_authentication,
                                          _set_authentication)

    _pyangbind_elements = {
        'link_interval_properties': link_interval_properties,
        'authentication': authentication,
    }
Exemple #4
0
class ntp(PybindBase):
  """
  This class was auto-generated by the PythonClass plugin for PYANG
  from YANG module brocade-ntp - based on the path /ntp. Each member element of
  the container is represented as a class variable - with a specific
  YANG type.
  """
  __slots__ = ('_pybind_generated_by', '_path_helper', '_yang_name', '_rest_name', '_extmethods', '__server','__authentication_key','__peer','__source_ip','__disable','__authenticate','__trusted_key','__master',)

  _yang_name = 'ntp'
  _rest_name = 'ntp'

  _pybind_generated_by = 'container'

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

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

    extmethods = kwargs.pop("extmethods", None)
    if extmethods is False:
      self._extmethods = False
    elif extmethods is not None and isinstance(extmethods, dict):
      self._extmethods = extmethods
    elif hasattr(self, "_parent"):
      extmethods = getattr(self._parent, "_extmethods", None)
      self._extmethods = extmethods
    else:
      self._extmethods = False
    self.__authenticate = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="authenticate", rest_name="authenticate", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'info': u'Enable NTP authentication. Default = Disabled', u'cli-full-command': None, u'callpoint': u'ntp_auth_cp', u'sort-priority': u'32', u'cli-full-no': None}}, namespace='urn:brocade.com:mgmt:brocade-ntp', defining_module='brocade-ntp', yang_type='empty', is_config=True)
    self.__source_ip = YANGDynClass(base=RestrictedClassType(base_type=unicode,                                     restriction_type="dict_key",                                     restriction_arg={u'chassis-ip': {'value': 1}, u'mm-ip': {'value': 2}},), default=unicode("mm-ip"), is_leaf=True, yang_name="source-ip", rest_name="source-ip", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'info': u'Configure the source ip to be used for NTP', u'cli-full-command': None, u'callpoint': u'ntp_srcip_cp', u'sort-priority': u'33'}}, namespace='urn:brocade.com:mgmt:brocade-ntp', defining_module='brocade-ntp', yang_type='srcip_type', is_config=True)
    self.__server = YANGDynClass(base=YANGListType("ip",server.server, yang_name="server", rest_name="server", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='ip', extensions={u'tailf-common': {u'cli-suppress-key-sort': None, u'info': u'Configure NTP server', u'cli-no-key-completion': None, u'cli-suppress-mode': None, u'sort-priority': u'35', u'cli-suppress-list-no': None, u'cli-full-no': None, u'cli-compact-syntax': None, u'cli-suppress-key-abbreviation': None, u'callpoint': u'ntp-server'}}), is_container='list', yang_name="server", rest_name="server", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'cli-suppress-key-sort': None, u'info': u'Configure NTP server', u'cli-no-key-completion': None, u'cli-suppress-mode': None, u'sort-priority': u'35', u'cli-suppress-list-no': None, u'cli-full-no': None, u'cli-compact-syntax': None, u'cli-suppress-key-abbreviation': None, u'callpoint': u'ntp-server'}}, namespace='urn:brocade.com:mgmt:brocade-ntp', defining_module='brocade-ntp', yang_type='list', is_config=True)
    self.__trusted_key = YANGDynClass(base=TypedListType(allowed_type=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), restriction_dict={'range': [u'1 .. 65535']})), is_leaf=False, yang_name="trusted-key", rest_name="trusted-key", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'info': u'NTP trusted key', u'cli-full-command': None, u'callpoint': u'ntp_trust_cp', u'sort-priority': u'31', u'cli-full-no': None}}, namespace='urn:brocade.com:mgmt:brocade-ntp', defining_module='brocade-ntp', yang_type='trust-key', is_config=True)
    self.__disable = YANGDynClass(base=disable.disable, is_container='container', presence=False, yang_name="disable", rest_name="disable", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'info': u'Disabling NTP Server/Client mode', u'callpoint': u'ntp_disable_cp', u'sort-priority': u'29', u'cli-incomplete-command': None}}, namespace='urn:brocade.com:mgmt:brocade-ntp', defining_module='brocade-ntp', yang_type='container', is_config=True)
    self.__master = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), restriction_dict={'range': [u'2 .. 15']}), default=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32)(8), is_leaf=True, yang_name="master", rest_name="master", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'info': u'NTP Master', u'cli-full-command': None, u'callpoint': u'ntp_master_cp', u'sort-priority': u'34'}}, namespace='urn:brocade.com:mgmt:brocade-ntp', defining_module='brocade-ntp', yang_type='uint32', is_config=True)
    self.__peer = YANGDynClass(base=YANGListType("peer_ip",peer.peer, yang_name="peer", rest_name="peer", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='peer-ip', extensions={u'tailf-common': {u'cli-suppress-key-sort': None, u'info': u'Configure NTP peer', u'cli-no-key-completion': None, u'cli-suppress-mode': None, u'sort-priority': u'36', u'cli-suppress-list-no': None, u'cli-full-no': None, u'cli-compact-syntax': None, u'cli-suppress-key-abbreviation': None, u'callpoint': u'ntp-peer'}}), is_container='list', yang_name="peer", rest_name="peer", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'cli-suppress-key-sort': None, u'info': u'Configure NTP peer', u'cli-no-key-completion': None, u'cli-suppress-mode': None, u'sort-priority': u'36', u'cli-suppress-list-no': None, u'cli-full-no': None, u'cli-compact-syntax': None, u'cli-suppress-key-abbreviation': None, u'callpoint': u'ntp-peer'}}, namespace='urn:brocade.com:mgmt:brocade-ntp', defining_module='brocade-ntp', yang_type='list', is_config=True)
    self.__authentication_key = YANGDynClass(base=YANGListType("keyid",authentication_key.authentication_key, yang_name="authentication-key", rest_name="authentication-key", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='keyid', extensions={u'tailf-common': {u'cli-suppress-key-sort': None, u'info': u'authentication key', u'cli-no-key-completion': None, u'cli-suppress-mode': None, u'sort-priority': u'30', u'cli-suppress-list-no': None, u'cli-full-no': None, u'cli-compact-syntax': None, u'cli-suppress-key-abbreviation': None, u'cli-incomplete-command': None, u'callpoint': u'ntp-key'}}), is_container='list', yang_name="authentication-key", rest_name="authentication-key", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'cli-suppress-key-sort': None, u'info': u'authentication key', u'cli-no-key-completion': None, u'cli-suppress-mode': None, u'sort-priority': u'30', u'cli-suppress-list-no': None, u'cli-full-no': None, u'cli-compact-syntax': None, u'cli-suppress-key-abbreviation': None, u'cli-incomplete-command': None, u'callpoint': u'ntp-key'}}, namespace='urn:brocade.com:mgmt:brocade-ntp', defining_module='brocade-ntp', 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 [u'ntp']

  def _rest_path(self):
    if hasattr(self, "_parent"):
      if self._rest_name:
        return self._parent._rest_path()+[self._rest_name]
      else:
        return self._parent._rest_path()
    else:
      return [u'ntp']

  def _get_server(self):
    """
    Getter method for server, mapped from YANG variable /ntp/server (list)
    """
    return self.__server
      
  def _set_server(self, v, load=False):
    """
    Setter method for server, mapped from YANG variable /ntp/server (list)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_server is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_server() directly.
    """
    if hasattr(v, "_utype"):
      v = v._utype(v)
    try:
      t = YANGDynClass(v,base=YANGListType("ip",server.server, yang_name="server", rest_name="server", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='ip', extensions={u'tailf-common': {u'cli-suppress-key-sort': None, u'info': u'Configure NTP server', u'cli-no-key-completion': None, u'cli-suppress-mode': None, u'sort-priority': u'35', u'cli-suppress-list-no': None, u'cli-full-no': None, u'cli-compact-syntax': None, u'cli-suppress-key-abbreviation': None, u'callpoint': u'ntp-server'}}), is_container='list', yang_name="server", rest_name="server", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'cli-suppress-key-sort': None, u'info': u'Configure NTP server', u'cli-no-key-completion': None, u'cli-suppress-mode': None, u'sort-priority': u'35', u'cli-suppress-list-no': None, u'cli-full-no': None, u'cli-compact-syntax': None, u'cli-suppress-key-abbreviation': None, u'callpoint': u'ntp-server'}}, namespace='urn:brocade.com:mgmt:brocade-ntp', defining_module='brocade-ntp', yang_type='list', is_config=True)
    except (TypeError, ValueError):
      raise ValueError({
          'error-string': """server must be of a type compatible with list""",
          'defined-type': "list",
          'generated-type': """YANGDynClass(base=YANGListType("ip",server.server, yang_name="server", rest_name="server", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='ip', extensions={u'tailf-common': {u'cli-suppress-key-sort': None, u'info': u'Configure NTP server', u'cli-no-key-completion': None, u'cli-suppress-mode': None, u'sort-priority': u'35', u'cli-suppress-list-no': None, u'cli-full-no': None, u'cli-compact-syntax': None, u'cli-suppress-key-abbreviation': None, u'callpoint': u'ntp-server'}}), is_container='list', yang_name="server", rest_name="server", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'cli-suppress-key-sort': None, u'info': u'Configure NTP server', u'cli-no-key-completion': None, u'cli-suppress-mode': None, u'sort-priority': u'35', u'cli-suppress-list-no': None, u'cli-full-no': None, u'cli-compact-syntax': None, u'cli-suppress-key-abbreviation': None, u'callpoint': u'ntp-server'}}, namespace='urn:brocade.com:mgmt:brocade-ntp', defining_module='brocade-ntp', yang_type='list', is_config=True)""",
        })

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

  def _unset_server(self):
    self.__server = YANGDynClass(base=YANGListType("ip",server.server, yang_name="server", rest_name="server", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='ip', extensions={u'tailf-common': {u'cli-suppress-key-sort': None, u'info': u'Configure NTP server', u'cli-no-key-completion': None, u'cli-suppress-mode': None, u'sort-priority': u'35', u'cli-suppress-list-no': None, u'cli-full-no': None, u'cli-compact-syntax': None, u'cli-suppress-key-abbreviation': None, u'callpoint': u'ntp-server'}}), is_container='list', yang_name="server", rest_name="server", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'cli-suppress-key-sort': None, u'info': u'Configure NTP server', u'cli-no-key-completion': None, u'cli-suppress-mode': None, u'sort-priority': u'35', u'cli-suppress-list-no': None, u'cli-full-no': None, u'cli-compact-syntax': None, u'cli-suppress-key-abbreviation': None, u'callpoint': u'ntp-server'}}, namespace='urn:brocade.com:mgmt:brocade-ntp', defining_module='brocade-ntp', yang_type='list', is_config=True)


  def _get_authentication_key(self):
    """
    Getter method for authentication_key, mapped from YANG variable /ntp/authentication_key (list)
    """
    return self.__authentication_key
      
  def _set_authentication_key(self, v, load=False):
    """
    Setter method for authentication_key, mapped from YANG variable /ntp/authentication_key (list)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_authentication_key is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_authentication_key() directly.
    """
    if hasattr(v, "_utype"):
      v = v._utype(v)
    try:
      t = YANGDynClass(v,base=YANGListType("keyid",authentication_key.authentication_key, yang_name="authentication-key", rest_name="authentication-key", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='keyid', extensions={u'tailf-common': {u'cli-suppress-key-sort': None, u'info': u'authentication key', u'cli-no-key-completion': None, u'cli-suppress-mode': None, u'sort-priority': u'30', u'cli-suppress-list-no': None, u'cli-full-no': None, u'cli-compact-syntax': None, u'cli-suppress-key-abbreviation': None, u'cli-incomplete-command': None, u'callpoint': u'ntp-key'}}), is_container='list', yang_name="authentication-key", rest_name="authentication-key", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'cli-suppress-key-sort': None, u'info': u'authentication key', u'cli-no-key-completion': None, u'cli-suppress-mode': None, u'sort-priority': u'30', u'cli-suppress-list-no': None, u'cli-full-no': None, u'cli-compact-syntax': None, u'cli-suppress-key-abbreviation': None, u'cli-incomplete-command': None, u'callpoint': u'ntp-key'}}, namespace='urn:brocade.com:mgmt:brocade-ntp', defining_module='brocade-ntp', yang_type='list', is_config=True)
    except (TypeError, ValueError):
      raise ValueError({
          'error-string': """authentication_key must be of a type compatible with list""",
          'defined-type': "list",
          'generated-type': """YANGDynClass(base=YANGListType("keyid",authentication_key.authentication_key, yang_name="authentication-key", rest_name="authentication-key", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='keyid', extensions={u'tailf-common': {u'cli-suppress-key-sort': None, u'info': u'authentication key', u'cli-no-key-completion': None, u'cli-suppress-mode': None, u'sort-priority': u'30', u'cli-suppress-list-no': None, u'cli-full-no': None, u'cli-compact-syntax': None, u'cli-suppress-key-abbreviation': None, u'cli-incomplete-command': None, u'callpoint': u'ntp-key'}}), is_container='list', yang_name="authentication-key", rest_name="authentication-key", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'cli-suppress-key-sort': None, u'info': u'authentication key', u'cli-no-key-completion': None, u'cli-suppress-mode': None, u'sort-priority': u'30', u'cli-suppress-list-no': None, u'cli-full-no': None, u'cli-compact-syntax': None, u'cli-suppress-key-abbreviation': None, u'cli-incomplete-command': None, u'callpoint': u'ntp-key'}}, namespace='urn:brocade.com:mgmt:brocade-ntp', defining_module='brocade-ntp', yang_type='list', is_config=True)""",
        })

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

  def _unset_authentication_key(self):
    self.__authentication_key = YANGDynClass(base=YANGListType("keyid",authentication_key.authentication_key, yang_name="authentication-key", rest_name="authentication-key", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='keyid', extensions={u'tailf-common': {u'cli-suppress-key-sort': None, u'info': u'authentication key', u'cli-no-key-completion': None, u'cli-suppress-mode': None, u'sort-priority': u'30', u'cli-suppress-list-no': None, u'cli-full-no': None, u'cli-compact-syntax': None, u'cli-suppress-key-abbreviation': None, u'cli-incomplete-command': None, u'callpoint': u'ntp-key'}}), is_container='list', yang_name="authentication-key", rest_name="authentication-key", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'cli-suppress-key-sort': None, u'info': u'authentication key', u'cli-no-key-completion': None, u'cli-suppress-mode': None, u'sort-priority': u'30', u'cli-suppress-list-no': None, u'cli-full-no': None, u'cli-compact-syntax': None, u'cli-suppress-key-abbreviation': None, u'cli-incomplete-command': None, u'callpoint': u'ntp-key'}}, namespace='urn:brocade.com:mgmt:brocade-ntp', defining_module='brocade-ntp', yang_type='list', is_config=True)


  def _get_peer(self):
    """
    Getter method for peer, mapped from YANG variable /ntp/peer (list)
    """
    return self.__peer
      
  def _set_peer(self, v, load=False):
    """
    Setter method for peer, mapped from YANG variable /ntp/peer (list)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_peer is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_peer() directly.
    """
    if hasattr(v, "_utype"):
      v = v._utype(v)
    try:
      t = YANGDynClass(v,base=YANGListType("peer_ip",peer.peer, yang_name="peer", rest_name="peer", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='peer-ip', extensions={u'tailf-common': {u'cli-suppress-key-sort': None, u'info': u'Configure NTP peer', u'cli-no-key-completion': None, u'cli-suppress-mode': None, u'sort-priority': u'36', u'cli-suppress-list-no': None, u'cli-full-no': None, u'cli-compact-syntax': None, u'cli-suppress-key-abbreviation': None, u'callpoint': u'ntp-peer'}}), is_container='list', yang_name="peer", rest_name="peer", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'cli-suppress-key-sort': None, u'info': u'Configure NTP peer', u'cli-no-key-completion': None, u'cli-suppress-mode': None, u'sort-priority': u'36', u'cli-suppress-list-no': None, u'cli-full-no': None, u'cli-compact-syntax': None, u'cli-suppress-key-abbreviation': None, u'callpoint': u'ntp-peer'}}, namespace='urn:brocade.com:mgmt:brocade-ntp', defining_module='brocade-ntp', yang_type='list', is_config=True)
    except (TypeError, ValueError):
      raise ValueError({
          'error-string': """peer must be of a type compatible with list""",
          'defined-type': "list",
          'generated-type': """YANGDynClass(base=YANGListType("peer_ip",peer.peer, yang_name="peer", rest_name="peer", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='peer-ip', extensions={u'tailf-common': {u'cli-suppress-key-sort': None, u'info': u'Configure NTP peer', u'cli-no-key-completion': None, u'cli-suppress-mode': None, u'sort-priority': u'36', u'cli-suppress-list-no': None, u'cli-full-no': None, u'cli-compact-syntax': None, u'cli-suppress-key-abbreviation': None, u'callpoint': u'ntp-peer'}}), is_container='list', yang_name="peer", rest_name="peer", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'cli-suppress-key-sort': None, u'info': u'Configure NTP peer', u'cli-no-key-completion': None, u'cli-suppress-mode': None, u'sort-priority': u'36', u'cli-suppress-list-no': None, u'cli-full-no': None, u'cli-compact-syntax': None, u'cli-suppress-key-abbreviation': None, u'callpoint': u'ntp-peer'}}, namespace='urn:brocade.com:mgmt:brocade-ntp', defining_module='brocade-ntp', yang_type='list', is_config=True)""",
        })

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

  def _unset_peer(self):
    self.__peer = YANGDynClass(base=YANGListType("peer_ip",peer.peer, yang_name="peer", rest_name="peer", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='peer-ip', extensions={u'tailf-common': {u'cli-suppress-key-sort': None, u'info': u'Configure NTP peer', u'cli-no-key-completion': None, u'cli-suppress-mode': None, u'sort-priority': u'36', u'cli-suppress-list-no': None, u'cli-full-no': None, u'cli-compact-syntax': None, u'cli-suppress-key-abbreviation': None, u'callpoint': u'ntp-peer'}}), is_container='list', yang_name="peer", rest_name="peer", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'cli-suppress-key-sort': None, u'info': u'Configure NTP peer', u'cli-no-key-completion': None, u'cli-suppress-mode': None, u'sort-priority': u'36', u'cli-suppress-list-no': None, u'cli-full-no': None, u'cli-compact-syntax': None, u'cli-suppress-key-abbreviation': None, u'callpoint': u'ntp-peer'}}, namespace='urn:brocade.com:mgmt:brocade-ntp', defining_module='brocade-ntp', yang_type='list', is_config=True)


  def _get_source_ip(self):
    """
    Getter method for source_ip, mapped from YANG variable /ntp/source_ip (srcip_type)
    """
    return self.__source_ip
      
  def _set_source_ip(self, v, load=False):
    """
    Setter method for source_ip, mapped from YANG variable /ntp/source_ip (srcip_type)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_source_ip is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_source_ip() directly.
    """
    if hasattr(v, "_utype"):
      v = v._utype(v)
    try:
      t = YANGDynClass(v,base=RestrictedClassType(base_type=unicode,                                     restriction_type="dict_key",                                     restriction_arg={u'chassis-ip': {'value': 1}, u'mm-ip': {'value': 2}},), default=unicode("mm-ip"), is_leaf=True, yang_name="source-ip", rest_name="source-ip", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'info': u'Configure the source ip to be used for NTP', u'cli-full-command': None, u'callpoint': u'ntp_srcip_cp', u'sort-priority': u'33'}}, namespace='urn:brocade.com:mgmt:brocade-ntp', defining_module='brocade-ntp', yang_type='srcip_type', is_config=True)
    except (TypeError, ValueError):
      raise ValueError({
          'error-string': """source_ip must be of a type compatible with srcip_type""",
          'defined-type': "brocade-ntp:srcip_type",
          'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=unicode,                                     restriction_type="dict_key",                                     restriction_arg={u'chassis-ip': {'value': 1}, u'mm-ip': {'value': 2}},), default=unicode("mm-ip"), is_leaf=True, yang_name="source-ip", rest_name="source-ip", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'info': u'Configure the source ip to be used for NTP', u'cli-full-command': None, u'callpoint': u'ntp_srcip_cp', u'sort-priority': u'33'}}, namespace='urn:brocade.com:mgmt:brocade-ntp', defining_module='brocade-ntp', yang_type='srcip_type', is_config=True)""",
        })

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

  def _unset_source_ip(self):
    self.__source_ip = YANGDynClass(base=RestrictedClassType(base_type=unicode,                                     restriction_type="dict_key",                                     restriction_arg={u'chassis-ip': {'value': 1}, u'mm-ip': {'value': 2}},), default=unicode("mm-ip"), is_leaf=True, yang_name="source-ip", rest_name="source-ip", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'info': u'Configure the source ip to be used for NTP', u'cli-full-command': None, u'callpoint': u'ntp_srcip_cp', u'sort-priority': u'33'}}, namespace='urn:brocade.com:mgmt:brocade-ntp', defining_module='brocade-ntp', yang_type='srcip_type', is_config=True)


  def _get_disable(self):
    """
    Getter method for disable, mapped from YANG variable /ntp/disable (container)
    """
    return self.__disable
      
  def _set_disable(self, v, load=False):
    """
    Setter method for disable, mapped from YANG variable /ntp/disable (container)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_disable is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_disable() directly.
    """
    if hasattr(v, "_utype"):
      v = v._utype(v)
    try:
      t = YANGDynClass(v,base=disable.disable, is_container='container', presence=False, yang_name="disable", rest_name="disable", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'info': u'Disabling NTP Server/Client mode', u'callpoint': u'ntp_disable_cp', u'sort-priority': u'29', u'cli-incomplete-command': None}}, namespace='urn:brocade.com:mgmt:brocade-ntp', defining_module='brocade-ntp', yang_type='container', is_config=True)
    except (TypeError, ValueError):
      raise ValueError({
          'error-string': """disable must be of a type compatible with container""",
          'defined-type': "container",
          'generated-type': """YANGDynClass(base=disable.disable, is_container='container', presence=False, yang_name="disable", rest_name="disable", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'info': u'Disabling NTP Server/Client mode', u'callpoint': u'ntp_disable_cp', u'sort-priority': u'29', u'cli-incomplete-command': None}}, namespace='urn:brocade.com:mgmt:brocade-ntp', defining_module='brocade-ntp', yang_type='container', is_config=True)""",
        })

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

  def _unset_disable(self):
    self.__disable = YANGDynClass(base=disable.disable, is_container='container', presence=False, yang_name="disable", rest_name="disable", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'info': u'Disabling NTP Server/Client mode', u'callpoint': u'ntp_disable_cp', u'sort-priority': u'29', u'cli-incomplete-command': None}}, namespace='urn:brocade.com:mgmt:brocade-ntp', defining_module='brocade-ntp', yang_type='container', is_config=True)


  def _get_authenticate(self):
    """
    Getter method for authenticate, mapped from YANG variable /ntp/authenticate (empty)
    """
    return self.__authenticate
      
  def _set_authenticate(self, v, load=False):
    """
    Setter method for authenticate, mapped from YANG variable /ntp/authenticate (empty)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_authenticate is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_authenticate() directly.
    """
    if hasattr(v, "_utype"):
      v = v._utype(v)
    try:
      t = YANGDynClass(v,base=YANGBool, is_leaf=True, yang_name="authenticate", rest_name="authenticate", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'info': u'Enable NTP authentication. Default = Disabled', u'cli-full-command': None, u'callpoint': u'ntp_auth_cp', u'sort-priority': u'32', u'cli-full-no': None}}, namespace='urn:brocade.com:mgmt:brocade-ntp', defining_module='brocade-ntp', yang_type='empty', is_config=True)
    except (TypeError, ValueError):
      raise ValueError({
          'error-string': """authenticate must be of a type compatible with empty""",
          'defined-type': "empty",
          'generated-type': """YANGDynClass(base=YANGBool, is_leaf=True, yang_name="authenticate", rest_name="authenticate", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'info': u'Enable NTP authentication. Default = Disabled', u'cli-full-command': None, u'callpoint': u'ntp_auth_cp', u'sort-priority': u'32', u'cli-full-no': None}}, namespace='urn:brocade.com:mgmt:brocade-ntp', defining_module='brocade-ntp', yang_type='empty', is_config=True)""",
        })

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

  def _unset_authenticate(self):
    self.__authenticate = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="authenticate", rest_name="authenticate", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'info': u'Enable NTP authentication. Default = Disabled', u'cli-full-command': None, u'callpoint': u'ntp_auth_cp', u'sort-priority': u'32', u'cli-full-no': None}}, namespace='urn:brocade.com:mgmt:brocade-ntp', defining_module='brocade-ntp', yang_type='empty', is_config=True)


  def _get_trusted_key(self):
    """
    Getter method for trusted_key, mapped from YANG variable /ntp/trusted_key (trust-key)
    """
    return self.__trusted_key
      
  def _set_trusted_key(self, v, load=False):
    """
    Setter method for trusted_key, mapped from YANG variable /ntp/trusted_key (trust-key)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_trusted_key is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_trusted_key() directly.
    """
    if hasattr(v, "_utype"):
      v = v._utype(v)
    try:
      t = YANGDynClass(v,base=TypedListType(allowed_type=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), restriction_dict={'range': [u'1 .. 65535']})), is_leaf=False, yang_name="trusted-key", rest_name="trusted-key", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'info': u'NTP trusted key', u'cli-full-command': None, u'callpoint': u'ntp_trust_cp', u'sort-priority': u'31', u'cli-full-no': None}}, namespace='urn:brocade.com:mgmt:brocade-ntp', defining_module='brocade-ntp', yang_type='trust-key', is_config=True)
    except (TypeError, ValueError):
      raise ValueError({
          'error-string': """trusted_key must be of a type compatible with trust-key""",
          'defined-type': "brocade-ntp:trust-key",
          'generated-type': """YANGDynClass(base=TypedListType(allowed_type=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), restriction_dict={'range': [u'1 .. 65535']})), is_leaf=False, yang_name="trusted-key", rest_name="trusted-key", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'info': u'NTP trusted key', u'cli-full-command': None, u'callpoint': u'ntp_trust_cp', u'sort-priority': u'31', u'cli-full-no': None}}, namespace='urn:brocade.com:mgmt:brocade-ntp', defining_module='brocade-ntp', yang_type='trust-key', is_config=True)""",
        })

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

  def _unset_trusted_key(self):
    self.__trusted_key = YANGDynClass(base=TypedListType(allowed_type=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), restriction_dict={'range': [u'1 .. 65535']})), is_leaf=False, yang_name="trusted-key", rest_name="trusted-key", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'info': u'NTP trusted key', u'cli-full-command': None, u'callpoint': u'ntp_trust_cp', u'sort-priority': u'31', u'cli-full-no': None}}, namespace='urn:brocade.com:mgmt:brocade-ntp', defining_module='brocade-ntp', yang_type='trust-key', is_config=True)


  def _get_master(self):
    """
    Getter method for master, mapped from YANG variable /ntp/master (uint32)
    """
    return self.__master
      
  def _set_master(self, v, load=False):
    """
    Setter method for master, mapped from YANG variable /ntp/master (uint32)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_master is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_master() directly.
    """
    if hasattr(v, "_utype"):
      v = v._utype(v)
    try:
      t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), restriction_dict={'range': [u'2 .. 15']}), default=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32)(8), is_leaf=True, yang_name="master", rest_name="master", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'info': u'NTP Master', u'cli-full-command': None, u'callpoint': u'ntp_master_cp', u'sort-priority': u'34'}}, namespace='urn:brocade.com:mgmt:brocade-ntp', defining_module='brocade-ntp', yang_type='uint32', is_config=True)
    except (TypeError, ValueError):
      raise ValueError({
          'error-string': """master must be of a type compatible with uint32""",
          'defined-type': "uint32",
          'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), restriction_dict={'range': [u'2 .. 15']}), default=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32)(8), is_leaf=True, yang_name="master", rest_name="master", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'info': u'NTP Master', u'cli-full-command': None, u'callpoint': u'ntp_master_cp', u'sort-priority': u'34'}}, namespace='urn:brocade.com:mgmt:brocade-ntp', defining_module='brocade-ntp', yang_type='uint32', is_config=True)""",
        })

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

  def _unset_master(self):
    self.__master = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), restriction_dict={'range': [u'2 .. 15']}), default=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32)(8), is_leaf=True, yang_name="master", rest_name="master", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'info': u'NTP Master', u'cli-full-command': None, u'callpoint': u'ntp_master_cp', u'sort-priority': u'34'}}, namespace='urn:brocade.com:mgmt:brocade-ntp', defining_module='brocade-ntp', yang_type='uint32', is_config=True)

  server = __builtin__.property(_get_server, _set_server)
  authentication_key = __builtin__.property(_get_authentication_key, _set_authentication_key)
  peer = __builtin__.property(_get_peer, _set_peer)
  source_ip = __builtin__.property(_get_source_ip, _set_source_ip)
  disable = __builtin__.property(_get_disable, _set_disable)
  authenticate = __builtin__.property(_get_authenticate, _set_authenticate)
  trusted_key = __builtin__.property(_get_trusted_key, _set_trusted_key)
  master = __builtin__.property(_get_master, _set_master)


  _pyangbind_elements = {'server': server, 'authentication_key': authentication_key, 'peer': peer, 'source_ip': source_ip, 'disable': disable, 'authenticate': authenticate, 'trusted_key': trusted_key, 'master': master, }
Exemple #5
0
class match(PybindBase):
  """
  This class was auto-generated by the PythonClass plugin for PYANG
  from YANG module brocade-qos-mqc - based on the path /class-map/match. Each member element of
  the container is represented as a class variable - with a specific
  YANG type.
  """
  __slots__ = ('_pybind_generated_by', '_path_helper', '_yang_name', '_rest_name', '_extmethods', '__access_group','__vlan','__bridge_domain',)

  _yang_name = 'match'
  _rest_name = 'match'

  _pybind_generated_by = 'container'

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

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

    extmethods = kwargs.pop("extmethods", None)
    if extmethods is False:
      self._extmethods = False
    elif extmethods is not None and isinstance(extmethods, dict):
      self._extmethods = extmethods
    elif hasattr(self, "_parent"):
      extmethods = getattr(self._parent, "_extmethods", None)
      self._extmethods = extmethods
    else:
      self._extmethods = False
    self.__bridge_domain = YANGDynClass(base=bridge_domain.bridge_domain, is_container='container', presence=False, yang_name="bridge-domain", rest_name="bridge-domain", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'cli-compact-syntax': None, u'info': u'Configure Bridge-domain Id', u'cli-incomplete-no': None}}, namespace='urn:brocade.com:mgmt:brocade-qos-mqc', defining_module='brocade-qos-mqc', yang_type='container', is_config=True)
    self.__vlan = YANGDynClass(base=vlan.vlan, is_container='container', presence=False, yang_name="vlan", rest_name="vlan", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'cli-compact-syntax': None, u'info': u'Configure VLAN Id', u'cli-incomplete-no': None}}, namespace='urn:brocade.com:mgmt:brocade-qos-mqc', defining_module='brocade-qos-mqc', yang_type='container', is_config=True)
    self.__access_group = YANGDynClass(base=access_group.access_group, is_container='container', presence=False, yang_name="access-group", rest_name="access-group", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'cli-compact-syntax': None, u'info': u'Configure MAC/IP Access group', u'cli-incomplete-no': None}}, namespace='urn:brocade.com:mgmt:brocade-qos-mqc', defining_module='brocade-qos-mqc', 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'class-map', u'match']

  def _rest_path(self):
    if hasattr(self, "_parent"):
      if self._rest_name:
        return self._parent._rest_path()+[self._rest_name]
      else:
        return self._parent._rest_path()
    else:
      return [u'class-map', u'match']

  def _get_access_group(self):
    """
    Getter method for access_group, mapped from YANG variable /class_map/match/access_group (container)

    YANG Description: This provides the grouping of configuration
elements of MAC/IP access list.
    """
    return self.__access_group
      
  def _set_access_group(self, v, load=False):
    """
    Setter method for access_group, mapped from YANG variable /class_map/match/access_group (container)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_access_group is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_access_group() directly.

    YANG Description: This provides the grouping of configuration
elements of MAC/IP access list.
    """
    if hasattr(v, "_utype"):
      v = v._utype(v)
    try:
      t = YANGDynClass(v,base=access_group.access_group, is_container='container', presence=False, yang_name="access-group", rest_name="access-group", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'cli-compact-syntax': None, u'info': u'Configure MAC/IP Access group', u'cli-incomplete-no': None}}, namespace='urn:brocade.com:mgmt:brocade-qos-mqc', defining_module='brocade-qos-mqc', yang_type='container', is_config=True)
    except (TypeError, ValueError):
      raise ValueError({
          'error-string': """access_group must be of a type compatible with container""",
          'defined-type': "container",
          'generated-type': """YANGDynClass(base=access_group.access_group, is_container='container', presence=False, yang_name="access-group", rest_name="access-group", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'cli-compact-syntax': None, u'info': u'Configure MAC/IP Access group', u'cli-incomplete-no': None}}, namespace='urn:brocade.com:mgmt:brocade-qos-mqc', defining_module='brocade-qos-mqc', yang_type='container', is_config=True)""",
        })

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

  def _unset_access_group(self):
    self.__access_group = YANGDynClass(base=access_group.access_group, is_container='container', presence=False, yang_name="access-group", rest_name="access-group", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'cli-compact-syntax': None, u'info': u'Configure MAC/IP Access group', u'cli-incomplete-no': None}}, namespace='urn:brocade.com:mgmt:brocade-qos-mqc', defining_module='brocade-qos-mqc', yang_type='container', is_config=True)


  def _get_vlan(self):
    """
    Getter method for vlan, mapped from YANG variable /class_map/match/vlan (container)
    """
    return self.__vlan
      
  def _set_vlan(self, v, load=False):
    """
    Setter method for vlan, mapped from YANG variable /class_map/match/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.
    """
    if hasattr(v, "_utype"):
      v = v._utype(v)
    try:
      t = YANGDynClass(v,base=vlan.vlan, is_container='container', presence=False, yang_name="vlan", rest_name="vlan", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'cli-compact-syntax': None, u'info': u'Configure VLAN Id', u'cli-incomplete-no': None}}, namespace='urn:brocade.com:mgmt:brocade-qos-mqc', defining_module='brocade-qos-mqc', 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', presence=False, yang_name="vlan", rest_name="vlan", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'cli-compact-syntax': None, u'info': u'Configure VLAN Id', u'cli-incomplete-no': None}}, namespace='urn:brocade.com:mgmt:brocade-qos-mqc', defining_module='brocade-qos-mqc', 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', presence=False, yang_name="vlan", rest_name="vlan", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'cli-compact-syntax': None, u'info': u'Configure VLAN Id', u'cli-incomplete-no': None}}, namespace='urn:brocade.com:mgmt:brocade-qos-mqc', defining_module='brocade-qos-mqc', yang_type='container', is_config=True)


  def _get_bridge_domain(self):
    """
    Getter method for bridge_domain, mapped from YANG variable /class_map/match/bridge_domain (container)
    """
    return self.__bridge_domain
      
  def _set_bridge_domain(self, v, load=False):
    """
    Setter method for bridge_domain, mapped from YANG variable /class_map/match/bridge_domain (container)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_bridge_domain is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_bridge_domain() directly.
    """
    if hasattr(v, "_utype"):
      v = v._utype(v)
    try:
      t = YANGDynClass(v,base=bridge_domain.bridge_domain, is_container='container', presence=False, yang_name="bridge-domain", rest_name="bridge-domain", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'cli-compact-syntax': None, u'info': u'Configure Bridge-domain Id', u'cli-incomplete-no': None}}, namespace='urn:brocade.com:mgmt:brocade-qos-mqc', defining_module='brocade-qos-mqc', yang_type='container', is_config=True)
    except (TypeError, ValueError):
      raise ValueError({
          'error-string': """bridge_domain must be of a type compatible with container""",
          'defined-type': "container",
          'generated-type': """YANGDynClass(base=bridge_domain.bridge_domain, is_container='container', presence=False, yang_name="bridge-domain", rest_name="bridge-domain", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'cli-compact-syntax': None, u'info': u'Configure Bridge-domain Id', u'cli-incomplete-no': None}}, namespace='urn:brocade.com:mgmt:brocade-qos-mqc', defining_module='brocade-qos-mqc', yang_type='container', is_config=True)""",
        })

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

  def _unset_bridge_domain(self):
    self.__bridge_domain = YANGDynClass(base=bridge_domain.bridge_domain, is_container='container', presence=False, yang_name="bridge-domain", rest_name="bridge-domain", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'cli-compact-syntax': None, u'info': u'Configure Bridge-domain Id', u'cli-incomplete-no': None}}, namespace='urn:brocade.com:mgmt:brocade-qos-mqc', defining_module='brocade-qos-mqc', yang_type='container', is_config=True)

  access_group = __builtin__.property(_get_access_group, _set_access_group)
  vlan = __builtin__.property(_get_vlan, _set_vlan)
  bridge_domain = __builtin__.property(_get_bridge_domain, _set_bridge_domain)


  _pyangbind_elements = {'access_group': access_group, 'vlan': vlan, 'bridge_domain': bridge_domain, }
Exemple #6
0
class neighbor_route_map_direction_in(PybindBase):
  """
  This class was auto-generated by the PythonClass plugin for PYANG
  from YANG module brocade-common-def - based on the path /routing-system/router/router-bgp/address-family/ipv6/ipv6-unicast/af-ipv6-vrf/neighbor/af-ipv6-vrf-neighbor-address-holder/af-ipv6-neighbor-addr/neighbor-route-map/neighbor-route-map-direction-in. Each member element of
  the container is represented as a class variable - with a specific
  YANG type.
  """
  __slots__ = ('_pybind_generated_by', '_path_helper', '_yang_name', '_rest_name', '_extmethods', '__neighbor_route_map_name_direction_in',)

  _yang_name = 'neighbor-route-map-direction-in'
  _rest_name = 'in'

  _pybind_generated_by = 'container'

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

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

    extmethods = kwargs.pop("extmethods", None)
    if extmethods is False:
      self._extmethods = False
    elif extmethods is not None and isinstance(extmethods, dict):
      self._extmethods = extmethods
    elif hasattr(self, "_parent"):
      extmethods = getattr(self._parent, "_extmethods", None)
      self._extmethods = extmethods
    else:
      self._extmethods = False
    self.__neighbor_route_map_name_direction_in = YANGDynClass(base=RestrictedClassType(base_type=unicode, restriction_dict={'pattern': u'[a-zA-Z]{1}([-a-zA-Z0-9\\.\\\\\\\\@#\\+\\*\\(\\)=\\{~\\}%<>=$_\\[\\]\\|]{0,63})'}), is_leaf=True, yang_name="neighbor-route-map-name-direction-in", rest_name="neighbor-route-map-name-direction-in", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'cli-drop-node-name': None}}, namespace='urn:brocade.com:mgmt:brocade-bgp', defining_module='brocade-bgp', yang_type='common-def:name-string64', 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'routing-system', u'router', u'router-bgp', u'address-family', u'ipv6', u'ipv6-unicast', u'af-ipv6-vrf', u'neighbor', u'af-ipv6-vrf-neighbor-address-holder', u'af-ipv6-neighbor-addr', u'neighbor-route-map', u'neighbor-route-map-direction-in']

  def _rest_path(self):
    if hasattr(self, "_parent"):
      if self._rest_name:
        return self._parent._rest_path()+[self._rest_name]
      else:
        return self._parent._rest_path()
    else:
      return [u'router', u'bgp', u'address-family', u'ipv6', u'unicast', u'vrf', u'neighbor', u'af-ipv6-neighbor-addr', u'route-map', u'in']

  def _get_neighbor_route_map_name_direction_in(self):
    """
    Getter method for neighbor_route_map_name_direction_in, mapped from YANG variable /routing_system/router/router_bgp/address_family/ipv6/ipv6_unicast/af_ipv6_vrf/neighbor/af_ipv6_vrf_neighbor_address_holder/af_ipv6_neighbor_addr/neighbor_route_map/neighbor_route_map_direction_in/neighbor_route_map_name_direction_in (common-def:name-string64)
    """
    return self.__neighbor_route_map_name_direction_in
      
  def _set_neighbor_route_map_name_direction_in(self, v, load=False):
    """
    Setter method for neighbor_route_map_name_direction_in, mapped from YANG variable /routing_system/router/router_bgp/address_family/ipv6/ipv6_unicast/af_ipv6_vrf/neighbor/af_ipv6_vrf_neighbor_address_holder/af_ipv6_neighbor_addr/neighbor_route_map/neighbor_route_map_direction_in/neighbor_route_map_name_direction_in (common-def:name-string64)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_neighbor_route_map_name_direction_in is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_neighbor_route_map_name_direction_in() directly.
    """
    if hasattr(v, "_utype"):
      v = v._utype(v)
    try:
      t = YANGDynClass(v,base=RestrictedClassType(base_type=unicode, restriction_dict={'pattern': u'[a-zA-Z]{1}([-a-zA-Z0-9\\.\\\\\\\\@#\\+\\*\\(\\)=\\{~\\}%<>=$_\\[\\]\\|]{0,63})'}), is_leaf=True, yang_name="neighbor-route-map-name-direction-in", rest_name="neighbor-route-map-name-direction-in", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'cli-drop-node-name': None}}, namespace='urn:brocade.com:mgmt:brocade-bgp', defining_module='brocade-bgp', yang_type='common-def:name-string64', is_config=True)
    except (TypeError, ValueError):
      raise ValueError({
          'error-string': """neighbor_route_map_name_direction_in must be of a type compatible with common-def:name-string64""",
          'defined-type': "common-def:name-string64",
          'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=unicode, restriction_dict={'pattern': u'[a-zA-Z]{1}([-a-zA-Z0-9\\.\\\\\\\\@#\\+\\*\\(\\)=\\{~\\}%<>=$_\\[\\]\\|]{0,63})'}), is_leaf=True, yang_name="neighbor-route-map-name-direction-in", rest_name="neighbor-route-map-name-direction-in", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'cli-drop-node-name': None}}, namespace='urn:brocade.com:mgmt:brocade-bgp', defining_module='brocade-bgp', yang_type='common-def:name-string64', is_config=True)""",
        })

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

  def _unset_neighbor_route_map_name_direction_in(self):
    self.__neighbor_route_map_name_direction_in = YANGDynClass(base=RestrictedClassType(base_type=unicode, restriction_dict={'pattern': u'[a-zA-Z]{1}([-a-zA-Z0-9\\.\\\\\\\\@#\\+\\*\\(\\)=\\{~\\}%<>=$_\\[\\]\\|]{0,63})'}), is_leaf=True, yang_name="neighbor-route-map-name-direction-in", rest_name="neighbor-route-map-name-direction-in", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'cli-drop-node-name': None}}, namespace='urn:brocade.com:mgmt:brocade-bgp', defining_module='brocade-bgp', yang_type='common-def:name-string64', is_config=True)

  neighbor_route_map_name_direction_in = __builtin__.property(_get_neighbor_route_map_name_direction_in, _set_neighbor_route_map_name_direction_in)


  _pyangbind_elements = {'neighbor_route_map_name_direction_in': neighbor_route_map_name_direction_in, }
Exemple #7
0
class tlvs(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. Each member element of
  the container is represented as a class variable - with a specific
  YANG type.

  YANG Description: This container defines Link State PDU State TLVs.
  """
    __slots__ = (
        '_pybind_generated_by',
        '_path_helper',
        '_yang_name',
        '_extmethods',
        '__tlv',
    )

    _yang_name = 'tlvs'

    _pybind_generated_by = 'container'

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

        self._path_helper = False

        self._extmethods = False
        self.__tlv = YANGDynClass(
            base=YANGListType("type",
                              tlv.tlv,
                              yang_name="tlv",
                              parent=self,
                              is_container='list',
                              user_ordered=False,
                              path_helper=self._path_helper,
                              yang_keys='type',
                              extensions=None),
            is_container='list',
            yang_name="tlv",
            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 [
                u'network-instances', u'network-instance', u'protocols',
                u'protocol', u'isis', u'levels', u'level',
                u'link-state-database', u'lsp', u'tlvs'
            ]

    def _get_tlv(self):
        """
    Getter method for tlv, mapped from YANG variable /network_instances/network_instance/protocols/protocol/isis/levels/level/link_state_database/lsp/tlvs/tlv (list)

    YANG Description: List of TLV types in the LSDB for the specified LSP.
    """
        return self.__tlv

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

    YANG Description: List of TLV types in the LSDB for the specified LSP.
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(
                v,
                base=YANGListType("type",
                                  tlv.tlv,
                                  yang_name="tlv",
                                  parent=self,
                                  is_container='list',
                                  user_ordered=False,
                                  path_helper=self._path_helper,
                                  yang_keys='type',
                                  extensions=None),
                is_container='list',
                yang_name="tlv",
                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':
                """tlv must be of a type compatible with list""",
                'defined-type':
                "list",
                'generated-type':
                """YANGDynClass(base=YANGListType("type",tlv.tlv, yang_name="tlv", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='type', extensions=None), is_container='list', yang_name="tlv", 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.__tlv = t
        if hasattr(self, '_set'):
            self._set()

    def _unset_tlv(self):
        self.__tlv = YANGDynClass(
            base=YANGListType("type",
                              tlv.tlv,
                              yang_name="tlv",
                              parent=self,
                              is_container='list',
                              user_ordered=False,
                              path_helper=self._path_helper,
                              yang_keys='type',
                              extensions=None),
            is_container='list',
            yang_name="tlv",
            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)

    tlv = __builtin__.property(_get_tlv)

    _pyangbind_elements = {
        'tlv': tlv,
    }
Exemple #8
0
class lsp_admin_group(PybindBase):
  """
  This class was auto-generated by the PythonClass plugin for PYANG
  from YANG module brocade-mpls - based on the path /brocade_mpls_rpc/show-mpls-lsp-debug/output/lsp/show-mpls-lsp-debug-info/show-mpls-lsp-common-info/lsp-config-frr-admin-groups/lsp-admin-group. Each member element of
  the container is represented as a class variable - with a specific
  YANG type.
  """
  __slots__ = ('_pybind_generated_by', '_path_helper', '_yang_name', '_rest_name', '_extmethods', '__lsp_admin_group_exclude_any','__lsp_admin_group_include_any','__lsp_admin_group_include_all',)

  _yang_name = 'lsp-admin-group'
  _rest_name = ''

  _pybind_generated_by = 'container'

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

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

    extmethods = kwargs.pop("extmethods", None)
    if extmethods is False:
      self._extmethods = False
    elif extmethods is not None and isinstance(extmethods, dict):
      self._extmethods = extmethods
    elif hasattr(self, "_parent"):
      extmethods = getattr(self._parent, "_extmethods", None)
      self._extmethods = extmethods
    else:
      self._extmethods = False
    self.__lsp_admin_group_exclude_any = YANGDynClass(base=YANGListType("lsp_admin_group_exclude_any_group_id",lsp_admin_group_exclude_any.lsp_admin_group_exclude_any, yang_name="lsp-admin-group-exclude-any", rest_name="lsp-admin-group-exclude-any", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='lsp-admin-group-exclude-any-group-id', extensions=None), is_container='list', yang_name="lsp-admin-group-exclude-any", rest_name="lsp-admin-group-exclude-any", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=False, extensions=None, namespace='urn:brocade.com:mgmt:brocade-mpls', defining_module='brocade-mpls', yang_type='list', is_config=True)
    self.__lsp_admin_group_include_any = YANGDynClass(base=YANGListType("lsp_admin_group_include_any_group_id",lsp_admin_group_include_any.lsp_admin_group_include_any, yang_name="lsp-admin-group-include-any", rest_name="lsp-admin-group-include-any", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='lsp-admin-group-include-any-group-id', extensions=None), is_container='list', yang_name="lsp-admin-group-include-any", rest_name="lsp-admin-group-include-any", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=False, extensions=None, namespace='urn:brocade.com:mgmt:brocade-mpls', defining_module='brocade-mpls', yang_type='list', is_config=True)
    self.__lsp_admin_group_include_all = YANGDynClass(base=YANGListType("lsp_admin_group_include_all_group_id",lsp_admin_group_include_all.lsp_admin_group_include_all, yang_name="lsp-admin-group-include-all", rest_name="lsp-admin-group-include-all", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='lsp-admin-group-include-all-group-id', extensions=None), is_container='list', yang_name="lsp-admin-group-include-all", rest_name="lsp-admin-group-include-all", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=False, extensions=None, namespace='urn:brocade.com:mgmt:brocade-mpls', defining_module='brocade-mpls', 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 [u'brocade_mpls_rpc', u'show-mpls-lsp-debug', u'output', u'lsp', u'show-mpls-lsp-debug-info', u'show-mpls-lsp-common-info', u'lsp-config-frr-admin-groups', u'lsp-admin-group']

  def _rest_path(self):
    if hasattr(self, "_parent"):
      if self._rest_name:
        return self._parent._rest_path()+[self._rest_name]
      else:
        return self._parent._rest_path()
    else:
      return [u'show-mpls-lsp-debug', u'output', u'lsp', u'lsp-config-frr-admin-groups']

  def _get_lsp_admin_group_exclude_any(self):
    """
    Getter method for lsp_admin_group_exclude_any, mapped from YANG variable /brocade_mpls_rpc/show_mpls_lsp_debug/output/lsp/show_mpls_lsp_debug_info/show_mpls_lsp_common_info/lsp_config_frr_admin_groups/lsp_admin_group/lsp_admin_group_exclude_any (list)
    """
    return self.__lsp_admin_group_exclude_any
      
  def _set_lsp_admin_group_exclude_any(self, v, load=False):
    """
    Setter method for lsp_admin_group_exclude_any, mapped from YANG variable /brocade_mpls_rpc/show_mpls_lsp_debug/output/lsp/show_mpls_lsp_debug_info/show_mpls_lsp_common_info/lsp_config_frr_admin_groups/lsp_admin_group/lsp_admin_group_exclude_any (list)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_lsp_admin_group_exclude_any is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_lsp_admin_group_exclude_any() directly.
    """
    if hasattr(v, "_utype"):
      v = v._utype(v)
    try:
      t = YANGDynClass(v,base=YANGListType("lsp_admin_group_exclude_any_group_id",lsp_admin_group_exclude_any.lsp_admin_group_exclude_any, yang_name="lsp-admin-group-exclude-any", rest_name="lsp-admin-group-exclude-any", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='lsp-admin-group-exclude-any-group-id', extensions=None), is_container='list', yang_name="lsp-admin-group-exclude-any", rest_name="lsp-admin-group-exclude-any", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=False, extensions=None, namespace='urn:brocade.com:mgmt:brocade-mpls', defining_module='brocade-mpls', yang_type='list', is_config=True)
    except (TypeError, ValueError):
      raise ValueError({
          'error-string': """lsp_admin_group_exclude_any must be of a type compatible with list""",
          'defined-type': "list",
          'generated-type': """YANGDynClass(base=YANGListType("lsp_admin_group_exclude_any_group_id",lsp_admin_group_exclude_any.lsp_admin_group_exclude_any, yang_name="lsp-admin-group-exclude-any", rest_name="lsp-admin-group-exclude-any", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='lsp-admin-group-exclude-any-group-id', extensions=None), is_container='list', yang_name="lsp-admin-group-exclude-any", rest_name="lsp-admin-group-exclude-any", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=False, extensions=None, namespace='urn:brocade.com:mgmt:brocade-mpls', defining_module='brocade-mpls', yang_type='list', is_config=True)""",
        })

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

  def _unset_lsp_admin_group_exclude_any(self):
    self.__lsp_admin_group_exclude_any = YANGDynClass(base=YANGListType("lsp_admin_group_exclude_any_group_id",lsp_admin_group_exclude_any.lsp_admin_group_exclude_any, yang_name="lsp-admin-group-exclude-any", rest_name="lsp-admin-group-exclude-any", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='lsp-admin-group-exclude-any-group-id', extensions=None), is_container='list', yang_name="lsp-admin-group-exclude-any", rest_name="lsp-admin-group-exclude-any", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=False, extensions=None, namespace='urn:brocade.com:mgmt:brocade-mpls', defining_module='brocade-mpls', yang_type='list', is_config=True)


  def _get_lsp_admin_group_include_any(self):
    """
    Getter method for lsp_admin_group_include_any, mapped from YANG variable /brocade_mpls_rpc/show_mpls_lsp_debug/output/lsp/show_mpls_lsp_debug_info/show_mpls_lsp_common_info/lsp_config_frr_admin_groups/lsp_admin_group/lsp_admin_group_include_any (list)
    """
    return self.__lsp_admin_group_include_any
      
  def _set_lsp_admin_group_include_any(self, v, load=False):
    """
    Setter method for lsp_admin_group_include_any, mapped from YANG variable /brocade_mpls_rpc/show_mpls_lsp_debug/output/lsp/show_mpls_lsp_debug_info/show_mpls_lsp_common_info/lsp_config_frr_admin_groups/lsp_admin_group/lsp_admin_group_include_any (list)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_lsp_admin_group_include_any is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_lsp_admin_group_include_any() directly.
    """
    if hasattr(v, "_utype"):
      v = v._utype(v)
    try:
      t = YANGDynClass(v,base=YANGListType("lsp_admin_group_include_any_group_id",lsp_admin_group_include_any.lsp_admin_group_include_any, yang_name="lsp-admin-group-include-any", rest_name="lsp-admin-group-include-any", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='lsp-admin-group-include-any-group-id', extensions=None), is_container='list', yang_name="lsp-admin-group-include-any", rest_name="lsp-admin-group-include-any", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=False, extensions=None, namespace='urn:brocade.com:mgmt:brocade-mpls', defining_module='brocade-mpls', yang_type='list', is_config=True)
    except (TypeError, ValueError):
      raise ValueError({
          'error-string': """lsp_admin_group_include_any must be of a type compatible with list""",
          'defined-type': "list",
          'generated-type': """YANGDynClass(base=YANGListType("lsp_admin_group_include_any_group_id",lsp_admin_group_include_any.lsp_admin_group_include_any, yang_name="lsp-admin-group-include-any", rest_name="lsp-admin-group-include-any", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='lsp-admin-group-include-any-group-id', extensions=None), is_container='list', yang_name="lsp-admin-group-include-any", rest_name="lsp-admin-group-include-any", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=False, extensions=None, namespace='urn:brocade.com:mgmt:brocade-mpls', defining_module='brocade-mpls', yang_type='list', is_config=True)""",
        })

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

  def _unset_lsp_admin_group_include_any(self):
    self.__lsp_admin_group_include_any = YANGDynClass(base=YANGListType("lsp_admin_group_include_any_group_id",lsp_admin_group_include_any.lsp_admin_group_include_any, yang_name="lsp-admin-group-include-any", rest_name="lsp-admin-group-include-any", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='lsp-admin-group-include-any-group-id', extensions=None), is_container='list', yang_name="lsp-admin-group-include-any", rest_name="lsp-admin-group-include-any", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=False, extensions=None, namespace='urn:brocade.com:mgmt:brocade-mpls', defining_module='brocade-mpls', yang_type='list', is_config=True)


  def _get_lsp_admin_group_include_all(self):
    """
    Getter method for lsp_admin_group_include_all, mapped from YANG variable /brocade_mpls_rpc/show_mpls_lsp_debug/output/lsp/show_mpls_lsp_debug_info/show_mpls_lsp_common_info/lsp_config_frr_admin_groups/lsp_admin_group/lsp_admin_group_include_all (list)
    """
    return self.__lsp_admin_group_include_all
      
  def _set_lsp_admin_group_include_all(self, v, load=False):
    """
    Setter method for lsp_admin_group_include_all, mapped from YANG variable /brocade_mpls_rpc/show_mpls_lsp_debug/output/lsp/show_mpls_lsp_debug_info/show_mpls_lsp_common_info/lsp_config_frr_admin_groups/lsp_admin_group/lsp_admin_group_include_all (list)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_lsp_admin_group_include_all is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_lsp_admin_group_include_all() directly.
    """
    if hasattr(v, "_utype"):
      v = v._utype(v)
    try:
      t = YANGDynClass(v,base=YANGListType("lsp_admin_group_include_all_group_id",lsp_admin_group_include_all.lsp_admin_group_include_all, yang_name="lsp-admin-group-include-all", rest_name="lsp-admin-group-include-all", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='lsp-admin-group-include-all-group-id', extensions=None), is_container='list', yang_name="lsp-admin-group-include-all", rest_name="lsp-admin-group-include-all", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=False, extensions=None, namespace='urn:brocade.com:mgmt:brocade-mpls', defining_module='brocade-mpls', yang_type='list', is_config=True)
    except (TypeError, ValueError):
      raise ValueError({
          'error-string': """lsp_admin_group_include_all must be of a type compatible with list""",
          'defined-type': "list",
          'generated-type': """YANGDynClass(base=YANGListType("lsp_admin_group_include_all_group_id",lsp_admin_group_include_all.lsp_admin_group_include_all, yang_name="lsp-admin-group-include-all", rest_name="lsp-admin-group-include-all", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='lsp-admin-group-include-all-group-id', extensions=None), is_container='list', yang_name="lsp-admin-group-include-all", rest_name="lsp-admin-group-include-all", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=False, extensions=None, namespace='urn:brocade.com:mgmt:brocade-mpls', defining_module='brocade-mpls', yang_type='list', is_config=True)""",
        })

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

  def _unset_lsp_admin_group_include_all(self):
    self.__lsp_admin_group_include_all = YANGDynClass(base=YANGListType("lsp_admin_group_include_all_group_id",lsp_admin_group_include_all.lsp_admin_group_include_all, yang_name="lsp-admin-group-include-all", rest_name="lsp-admin-group-include-all", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='lsp-admin-group-include-all-group-id', extensions=None), is_container='list', yang_name="lsp-admin-group-include-all", rest_name="lsp-admin-group-include-all", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=False, extensions=None, namespace='urn:brocade.com:mgmt:brocade-mpls', defining_module='brocade-mpls', yang_type='list', is_config=True)

  lsp_admin_group_exclude_any = __builtin__.property(_get_lsp_admin_group_exclude_any, _set_lsp_admin_group_exclude_any)
  lsp_admin_group_include_any = __builtin__.property(_get_lsp_admin_group_include_any, _set_lsp_admin_group_include_any)
  lsp_admin_group_include_all = __builtin__.property(_get_lsp_admin_group_include_all, _set_lsp_admin_group_include_all)


  _pyangbind_elements = {'lsp_admin_group_exclude_any': lsp_admin_group_exclude_any, 'lsp_admin_group_include_any': lsp_admin_group_include_any, 'lsp_admin_group_include_all': lsp_admin_group_include_all, }
Exemple #9
0
class addresses(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/addresses. Each member element of
  the container is represented as a class variable - with a specific
  YANG type.

  YANG Description: Enclosing container for address list
  """
    __slots__ = (
        '_pybind_generated_by',
        '_path_helper',
        '_yang_name',
        '_extmethods',
        '__address',
    )

    _yang_name = 'addresses'

    _pybind_generated_by = 'container'

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

        self._path_helper = False

        self._extmethods = False
        self.__address = YANGDynClass(
            base=YANGListType("ip",
                              address.address,
                              yang_name="address",
                              parent=self,
                              is_container='list',
                              user_ordered=False,
                              path_helper=self._path_helper,
                              yang_keys='ip',
                              extensions=None),
            is_container='list',
            yang_name="address",
            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 [
                u'interfaces', u'interface', u'routed-vlan', u'ipv4',
                u'addresses'
            ]

    def _get_address(self):
        """
    Getter method for address, mapped from YANG variable /interfaces/interface/routed_vlan/ipv4/addresses/address (list)

    YANG Description: The list of configured IPv4 addresses on the interface.
    """
        return self.__address

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

    YANG Description: The list of configured IPv4 addresses on the interface.
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(
                v,
                base=YANGListType("ip",
                                  address.address,
                                  yang_name="address",
                                  parent=self,
                                  is_container='list',
                                  user_ordered=False,
                                  path_helper=self._path_helper,
                                  yang_keys='ip',
                                  extensions=None),
                is_container='list',
                yang_name="address",
                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':
                """address must be of a type compatible with list""",
                'defined-type':
                "list",
                'generated-type':
                """YANGDynClass(base=YANGListType("ip",address.address, yang_name="address", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='ip', extensions=None), is_container='list', yang_name="address", 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.__address = t
        if hasattr(self, '_set'):
            self._set()

    def _unset_address(self):
        self.__address = YANGDynClass(
            base=YANGListType("ip",
                              address.address,
                              yang_name="address",
                              parent=self,
                              is_container='list',
                              user_ordered=False,
                              path_helper=self._path_helper,
                              yang_keys='ip',
                              extensions=None),
            is_container='list',
            yang_name="address",
            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)

    address = __builtin__.property(_get_address, _set_address)

    _pyangbind_elements = {
        'address': address,
    }
Exemple #10
0
class state(PybindBase):
    """
  This class was auto-generated by the PythonClass plugin for PYANG
  from YANG module openconfig-bgp-global - based on the path /bgp/peer-groups/peer-group/use-multiple-paths/ibgp/state. Each member element of
  the container is represented as a class variable - with a specific
  YANG type.

  YANG Description: State information relating to iBGP multipath
  """
    __slots__ = (
        '_pybind_generated_by',
        '_path_helper',
        '_yang_name',
        '_extmethods',
        '__maximum_paths',
    )

    _yang_name = 'state'

    _pybind_generated_by = 'container'

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

        self._path_helper = False

        self._extmethods = False
        self.__maximum_paths = YANGDynClass(
            base=RestrictedClassType(
                base_type=long,
                restriction_dict={'range': ['0..4294967295']},
                int_size=32),
            default=RestrictedClassType(
                base_type=long,
                restriction_dict={'range': ['0..4294967295']},
                int_size=32)(1),
            is_leaf=True,
            yang_name="maximum-paths",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace='http://openconfig.net/yang/bgp',
            defining_module='openconfig-bgp',
            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 [
                u'bgp', u'peer-groups', u'peer-group', u'use-multiple-paths',
                u'ibgp', u'state'
            ]

    def _get_maximum_paths(self):
        """
    Getter method for maximum_paths, mapped from YANG variable /bgp/peer_groups/peer_group/use_multiple_paths/ibgp/state/maximum_paths (uint32)

    YANG Description: Maximum number of parallel paths to consider when using
iBGP multipath. The default is to use a single path
    """
        return self.__maximum_paths

    def _set_maximum_paths(self, v, load=False):
        """
    Setter method for maximum_paths, mapped from YANG variable /bgp/peer_groups/peer_group/use_multiple_paths/ibgp/state/maximum_paths (uint32)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_maximum_paths is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_maximum_paths() directly.

    YANG Description: Maximum number of parallel paths to consider when using
iBGP multipath. The default is to use a single path
    """
        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),
                             default=RestrictedClassType(
                                 base_type=long,
                                 restriction_dict={'range': ['0..4294967295']},
                                 int_size=32)(1),
                             is_leaf=True,
                             yang_name="maximum-paths",
                             parent=self,
                             path_helper=self._path_helper,
                             extmethods=self._extmethods,
                             register_paths=True,
                             namespace='http://openconfig.net/yang/bgp',
                             defining_module='openconfig-bgp',
                             yang_type='uint32',
                             is_config=False)
        except (TypeError, ValueError):
            raise ValueError({
                'error-string':
                """maximum_paths 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), default=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32)(1), is_leaf=True, yang_name="maximum-paths", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/bgp', defining_module='openconfig-bgp', yang_type='uint32', is_config=False)""",
            })

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

    def _unset_maximum_paths(self):
        self.__maximum_paths = YANGDynClass(
            base=RestrictedClassType(
                base_type=long,
                restriction_dict={'range': ['0..4294967295']},
                int_size=32),
            default=RestrictedClassType(
                base_type=long,
                restriction_dict={'range': ['0..4294967295']},
                int_size=32)(1),
            is_leaf=True,
            yang_name="maximum-paths",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace='http://openconfig.net/yang/bgp',
            defining_module='openconfig-bgp',
            yang_type='uint32',
            is_config=False)

    maximum_paths = __builtin__.property(_get_maximum_paths)

    _pyangbind_elements = {
        'maximum_paths': maximum_paths,
    }
Exemple #11
0
class activate(PybindBase):
    """
  This class was auto-generated by the PythonClass plugin for PYANG
  from YANG module brocade-event-handler - based on the path /event-handler/activate. Each member element of
  the container is represented as a class variable - with a specific
  YANG type.
  """
    __slots__ = (
        '_pybind_generated_by',
        '_path_helper',
        '_yang_name',
        '_rest_name',
        '_extmethods',
        '__name',
    )

    _yang_name = 'activate'
    _rest_name = 'activate'

    _pybind_generated_by = 'container'

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

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

        extmethods = kwargs.pop("extmethods", None)
        if extmethods is False:
            self._extmethods = False
        elif extmethods is not None and isinstance(extmethods, dict):
            self._extmethods = extmethods
        elif hasattr(self, "_parent"):
            extmethods = getattr(self._parent, "_extmethods", None)
            self._extmethods = extmethods
        else:
            self._extmethods = False
        self.__name = YANGDynClass(
            base=YANGListType("name",
                              name.name,
                              yang_name="name",
                              rest_name="name",
                              parent=self,
                              is_container='list',
                              user_ordered=False,
                              path_helper=self._path_helper,
                              yang_keys='name',
                              extensions={
                                  u'tailf-common': {
                                      u'cli-drop-node-name': None,
                                      u'cli-no-key-completion': None,
                                      u'cli-suppress-key-abbreviation': None,
                                      u'cli-no-match-completion': None,
                                      u'cli-suppress-list-no': None
                                  }
                              }),
            is_container='list',
            yang_name="name",
            rest_name="name",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            extensions={
                u'tailf-common': {
                    u'cli-drop-node-name': None,
                    u'cli-no-key-completion': None,
                    u'cli-suppress-key-abbreviation': None,
                    u'cli-no-match-completion': None,
                    u'cli-suppress-list-no': None
                }
            },
            namespace='urn:brocade.com:mgmt:brocade-event-handler',
            defining_module='brocade-event-handler',
            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 [u'event-handler', u'activate']

    def _rest_path(self):
        if hasattr(self, "_parent"):
            if self._rest_name:
                return self._parent._rest_path() + [self._rest_name]
            else:
                return self._parent._rest_path()
        else:
            return [u'event-handler', u'activate']

    def _get_name(self):
        """
    Getter method for name, mapped from YANG variable /event_handler/activate/name (list)
    """
        return self.__name

    def _set_name(self, v, load=False):
        """
    Setter method for name, mapped from YANG variable /event_handler/activate/name (list)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_name is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_name() directly.
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(
                v,
                base=YANGListType("name",
                                  name.name,
                                  yang_name="name",
                                  rest_name="name",
                                  parent=self,
                                  is_container='list',
                                  user_ordered=False,
                                  path_helper=self._path_helper,
                                  yang_keys='name',
                                  extensions={
                                      u'tailf-common': {
                                          u'cli-drop-node-name': None,
                                          u'cli-no-key-completion': None,
                                          u'cli-suppress-key-abbreviation':
                                          None,
                                          u'cli-no-match-completion': None,
                                          u'cli-suppress-list-no': None
                                      }
                                  }),
                is_container='list',
                yang_name="name",
                rest_name="name",
                parent=self,
                path_helper=self._path_helper,
                extmethods=self._extmethods,
                register_paths=True,
                extensions={
                    u'tailf-common': {
                        u'cli-drop-node-name': None,
                        u'cli-no-key-completion': None,
                        u'cli-suppress-key-abbreviation': None,
                        u'cli-no-match-completion': None,
                        u'cli-suppress-list-no': None
                    }
                },
                namespace='urn:brocade.com:mgmt:brocade-event-handler',
                defining_module='brocade-event-handler',
                yang_type='list',
                is_config=True)
        except (TypeError, ValueError):
            raise ValueError({
                'error-string':
                """name must be of a type compatible with list""",
                'defined-type':
                "list",
                'generated-type':
                """YANGDynClass(base=YANGListType("name",name.name, yang_name="name", rest_name="name", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='name', extensions={u'tailf-common': {u'cli-drop-node-name': None, u'cli-no-key-completion': None, u'cli-suppress-key-abbreviation': None, u'cli-no-match-completion': None, u'cli-suppress-list-no': None}}), is_container='list', yang_name="name", rest_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'cli-drop-node-name': None, u'cli-no-key-completion': None, u'cli-suppress-key-abbreviation': None, u'cli-no-match-completion': None, u'cli-suppress-list-no': None}}, namespace='urn:brocade.com:mgmt:brocade-event-handler', defining_module='brocade-event-handler', yang_type='list', is_config=True)""",
            })

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

    def _unset_name(self):
        self.__name = YANGDynClass(
            base=YANGListType("name",
                              name.name,
                              yang_name="name",
                              rest_name="name",
                              parent=self,
                              is_container='list',
                              user_ordered=False,
                              path_helper=self._path_helper,
                              yang_keys='name',
                              extensions={
                                  u'tailf-common': {
                                      u'cli-drop-node-name': None,
                                      u'cli-no-key-completion': None,
                                      u'cli-suppress-key-abbreviation': None,
                                      u'cli-no-match-completion': None,
                                      u'cli-suppress-list-no': None
                                  }
                              }),
            is_container='list',
            yang_name="name",
            rest_name="name",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            extensions={
                u'tailf-common': {
                    u'cli-drop-node-name': None,
                    u'cli-no-key-completion': None,
                    u'cli-suppress-key-abbreviation': None,
                    u'cli-no-match-completion': None,
                    u'cli-suppress-list-no': None
                }
            },
            namespace='urn:brocade.com:mgmt:brocade-event-handler',
            defining_module='brocade-event-handler',
            yang_type='list',
            is_config=True)

    name = __builtin__.property(_get_name, _set_name)

    _pyangbind_elements = {
        'name': name,
    }
Exemple #12
0
class inspection(PybindBase):
  """
  This class was auto-generated by the PythonClass plugin for PYANG
  from YANG module brocade-interface - based on the path /interface/hundredgigabitethernet/ip/arp-node-config/arp/inspection. Each member element of
  the container is represented as a class variable - with a specific
  YANG type.
  """
  __slots__ = ('_pybind_generated_by', '_path_helper', '_yang_name', '_rest_name', '_extmethods', '__trust',)

  _yang_name = 'inspection'
  _rest_name = 'inspection'

  _pybind_generated_by = 'container'

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

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

    extmethods = kwargs.pop("extmethods", None)
    if extmethods is False:
      self._extmethods = False
    elif extmethods is not None and isinstance(extmethods, dict):
      self._extmethods = extmethods
    elif hasattr(self, "_parent"):
      extmethods = getattr(self._parent, "_extmethods", None)
      self._extmethods = extmethods
    else:
      self._extmethods = False
    self.__trust = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="trust", rest_name="trust", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'info': u'Trusted Interface', u'cli-full-command': None}}, namespace='urn:brocade.com:mgmt:brocade-dai', defining_module='brocade-dai', yang_type='empty', 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'interface', u'hundredgigabitethernet', u'ip', u'arp-node-config', u'arp', u'inspection']

  def _rest_path(self):
    if hasattr(self, "_parent"):
      if self._rest_name:
        return self._parent._rest_path()+[self._rest_name]
      else:
        return self._parent._rest_path()
    else:
      return [u'interface', u'HundredGigabitEthernet', u'ip', u'arp', u'inspection']

  def _get_trust(self):
    """
    Getter method for trust, mapped from YANG variable /interface/hundredgigabitethernet/ip/arp_node_config/arp/inspection/trust (empty)
    """
    return self.__trust
      
  def _set_trust(self, v, load=False):
    """
    Setter method for trust, mapped from YANG variable /interface/hundredgigabitethernet/ip/arp_node_config/arp/inspection/trust (empty)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_trust is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_trust() directly.
    """
    if hasattr(v, "_utype"):
      v = v._utype(v)
    try:
      t = YANGDynClass(v,base=YANGBool, is_leaf=True, yang_name="trust", rest_name="trust", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'info': u'Trusted Interface', u'cli-full-command': None}}, namespace='urn:brocade.com:mgmt:brocade-dai', defining_module='brocade-dai', yang_type='empty', is_config=True)
    except (TypeError, ValueError):
      raise ValueError({
          'error-string': """trust must be of a type compatible with empty""",
          'defined-type': "empty",
          'generated-type': """YANGDynClass(base=YANGBool, is_leaf=True, yang_name="trust", rest_name="trust", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'info': u'Trusted Interface', u'cli-full-command': None}}, namespace='urn:brocade.com:mgmt:brocade-dai', defining_module='brocade-dai', yang_type='empty', is_config=True)""",
        })

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

  def _unset_trust(self):
    self.__trust = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="trust", rest_name="trust", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'info': u'Trusted Interface', u'cli-full-command': None}}, namespace='urn:brocade.com:mgmt:brocade-dai', defining_module='brocade-dai', yang_type='empty', is_config=True)

  trust = __builtin__.property(_get_trust, _set_trust)


  _pyangbind_elements = {'trust': trust, }
Exemple #13
0
class timers(PybindBase):
  """
  This class was auto-generated by the PythonClass plugin for PYANG
  from YANG module brocade-rbridge - based on the path /rbridge-id/router/router-bgp/address-family/ipv4/ipv4-unicast/af-vrf/neighbor/af-ipv4-vrf-neighbor-address-holder/af-ipv4-neighbor-addr/timers. Each member element of
  the container is represented as a class variable - with a specific
  YANG type.
  """
  __slots__ = ('_pybind_generated_by', '_path_helper', '_yang_name', '_rest_name', '_extmethods', '__nei_keep_alive','__nei_hold_time',)

  _yang_name = 'timers'
  _rest_name = 'timers'

  _pybind_generated_by = 'container'

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

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

    extmethods = kwargs.pop("extmethods", None)
    if extmethods is False:
      self._extmethods = False
    elif extmethods is not None and isinstance(extmethods, dict):
      self._extmethods = extmethods
    elif hasattr(self, "_parent"):
      extmethods = getattr(self._parent, "_extmethods", None)
      self._extmethods = extmethods
    else:
      self._extmethods = False
    self.__nei_keep_alive = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), restriction_dict={'range': [u'0..65535']}), is_leaf=True, yang_name="nei-keep-alive", rest_name="keep-alive", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'info': u'Keepalive interval', u'alt-name': u'keep-alive', u'cli-incomplete-command': None}}, namespace='urn:brocade.com:mgmt:brocade-bgp', defining_module='brocade-bgp', yang_type='nei-keep-alive', is_config=True)
    self.__nei_hold_time = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), restriction_dict={'range': [u'0..65535']}), is_leaf=True, yang_name="nei-hold-time", rest_name="hold-time", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'info': u'Hold-time value', u'alt-name': u'hold-time'}}, namespace='urn:brocade.com:mgmt:brocade-bgp', defining_module='brocade-bgp', yang_type='nei-hold-time', 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'rbridge-id', u'router', u'router-bgp', u'address-family', u'ipv4', u'ipv4-unicast', u'af-vrf', u'neighbor', u'af-ipv4-vrf-neighbor-address-holder', u'af-ipv4-neighbor-addr', u'timers']

  def _rest_path(self):
    if hasattr(self, "_parent"):
      if self._rest_name:
        return self._parent._rest_path()+[self._rest_name]
      else:
        return self._parent._rest_path()
    else:
      return [u'rbridge-id', u'router', u'bgp', u'address-family', u'ipv4', u'unicast', u'vrf', u'neighbor', u'af-ipv4-neighbor-addr', u'timers']

  def _get_nei_keep_alive(self):
    """
    Getter method for nei_keep_alive, mapped from YANG variable /rbridge_id/router/router_bgp/address_family/ipv4/ipv4_unicast/af_vrf/neighbor/af_ipv4_vrf_neighbor_address_holder/af_ipv4_neighbor_addr/timers/nei_keep_alive (nei-keep-alive)
    """
    return self.__nei_keep_alive
      
  def _set_nei_keep_alive(self, v, load=False):
    """
    Setter method for nei_keep_alive, mapped from YANG variable /rbridge_id/router/router_bgp/address_family/ipv4/ipv4_unicast/af_vrf/neighbor/af_ipv4_vrf_neighbor_address_holder/af_ipv4_neighbor_addr/timers/nei_keep_alive (nei-keep-alive)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_nei_keep_alive is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_nei_keep_alive() directly.
    """
    if hasattr(v, "_utype"):
      v = v._utype(v)
    try:
      t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), restriction_dict={'range': [u'0..65535']}), is_leaf=True, yang_name="nei-keep-alive", rest_name="keep-alive", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'info': u'Keepalive interval', u'alt-name': u'keep-alive', u'cli-incomplete-command': None}}, namespace='urn:brocade.com:mgmt:brocade-bgp', defining_module='brocade-bgp', yang_type='nei-keep-alive', is_config=True)
    except (TypeError, ValueError):
      raise ValueError({
          'error-string': """nei_keep_alive must be of a type compatible with nei-keep-alive""",
          'defined-type': "brocade-bgp:nei-keep-alive",
          'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), restriction_dict={'range': [u'0..65535']}), is_leaf=True, yang_name="nei-keep-alive", rest_name="keep-alive", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'info': u'Keepalive interval', u'alt-name': u'keep-alive', u'cli-incomplete-command': None}}, namespace='urn:brocade.com:mgmt:brocade-bgp', defining_module='brocade-bgp', yang_type='nei-keep-alive', is_config=True)""",
        })

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

  def _unset_nei_keep_alive(self):
    self.__nei_keep_alive = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), restriction_dict={'range': [u'0..65535']}), is_leaf=True, yang_name="nei-keep-alive", rest_name="keep-alive", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'info': u'Keepalive interval', u'alt-name': u'keep-alive', u'cli-incomplete-command': None}}, namespace='urn:brocade.com:mgmt:brocade-bgp', defining_module='brocade-bgp', yang_type='nei-keep-alive', is_config=True)


  def _get_nei_hold_time(self):
    """
    Getter method for nei_hold_time, mapped from YANG variable /rbridge_id/router/router_bgp/address_family/ipv4/ipv4_unicast/af_vrf/neighbor/af_ipv4_vrf_neighbor_address_holder/af_ipv4_neighbor_addr/timers/nei_hold_time (nei-hold-time)
    """
    return self.__nei_hold_time
      
  def _set_nei_hold_time(self, v, load=False):
    """
    Setter method for nei_hold_time, mapped from YANG variable /rbridge_id/router/router_bgp/address_family/ipv4/ipv4_unicast/af_vrf/neighbor/af_ipv4_vrf_neighbor_address_holder/af_ipv4_neighbor_addr/timers/nei_hold_time (nei-hold-time)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_nei_hold_time is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_nei_hold_time() directly.
    """
    if hasattr(v, "_utype"):
      v = v._utype(v)
    try:
      t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), restriction_dict={'range': [u'0..65535']}), is_leaf=True, yang_name="nei-hold-time", rest_name="hold-time", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'info': u'Hold-time value', u'alt-name': u'hold-time'}}, namespace='urn:brocade.com:mgmt:brocade-bgp', defining_module='brocade-bgp', yang_type='nei-hold-time', is_config=True)
    except (TypeError, ValueError):
      raise ValueError({
          'error-string': """nei_hold_time must be of a type compatible with nei-hold-time""",
          'defined-type': "brocade-bgp:nei-hold-time",
          'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), restriction_dict={'range': [u'0..65535']}), is_leaf=True, yang_name="nei-hold-time", rest_name="hold-time", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'info': u'Hold-time value', u'alt-name': u'hold-time'}}, namespace='urn:brocade.com:mgmt:brocade-bgp', defining_module='brocade-bgp', yang_type='nei-hold-time', is_config=True)""",
        })

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

  def _unset_nei_hold_time(self):
    self.__nei_hold_time = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), restriction_dict={'range': [u'0..65535']}), is_leaf=True, yang_name="nei-hold-time", rest_name="hold-time", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'info': u'Hold-time value', u'alt-name': u'hold-time'}}, namespace='urn:brocade.com:mgmt:brocade-bgp', defining_module='brocade-bgp', yang_type='nei-hold-time', is_config=True)

  nei_keep_alive = __builtin__.property(_get_nei_keep_alive, _set_nei_keep_alive)
  nei_hold_time = __builtin__.property(_get_nei_hold_time, _set_nei_hold_time)


  _pyangbind_elements = {'nei_keep_alive': nei_keep_alive, 'nei_hold_time': nei_hold_time, }
Exemple #14
0
class static(PybindBase):
    """
  This class was auto-generated by the PythonClass plugin for PYANG
  from YANG module brocade-rbridge - based on the path /rbridge-id/router/ospf/redistribute/static. Each member element of
  the container is represented as a class variable - with a specific
  YANG type.
  """
    __slots__ = (
        '_pybind_generated_by',
        '_path_helper',
        '_yang_name',
        '_rest_name',
        '_extmethods',
        '__static_route_map',
    )

    _yang_name = 'static'
    _rest_name = 'static'

    _pybind_generated_by = 'container'

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

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

        extmethods = kwargs.pop("extmethods", None)
        if extmethods is False:
            self._extmethods = False
        elif extmethods is not None and isinstance(extmethods, dict):
            self._extmethods = extmethods
        elif hasattr(self, "_parent"):
            extmethods = getattr(self._parent, "_extmethods", None)
            self._extmethods = extmethods
        else:
            self._extmethods = False
        self.__static_route_map = YANGDynClass(
            base=RestrictedClassType(
                base_type=unicode,
                restriction_dict={
                    'pattern':
                    u'[a-zA-Z]{1}([-a-zA-Z0-9\\.\\\\\\\\@#\\+\\*\\(\\)=\\{~\\}%<>=$_\\[\\]\\|]{0,62})'
                }),
            is_leaf=True,
            yang_name="static-route-map",
            rest_name="route-map",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            extensions={
                u'tailf-common': {
                    u'info': u'Route map reference',
                    u'alt-name': u'route-map'
                }
            },
            namespace='urn:brocade.com:mgmt:brocade-ospf',
            defining_module='brocade-ospf',
            yang_type='common-def:name-string63',
            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'rbridge-id', u'router', u'ospf', u'redistribute', u'static'
            ]

    def _rest_path(self):
        if hasattr(self, "_parent"):
            if self._rest_name:
                return self._parent._rest_path() + [self._rest_name]
            else:
                return self._parent._rest_path()
        else:
            return [
                u'rbridge-id', u'router', u'ospf', u'redistribute', u'static'
            ]

    def _get_static_route_map(self):
        """
    Getter method for static_route_map, mapped from YANG variable /rbridge_id/router/ospf/redistribute/static/static_route_map (common-def:name-string63)
    """
        return self.__static_route_map

    def _set_static_route_map(self, v, load=False):
        """
    Setter method for static_route_map, mapped from YANG variable /rbridge_id/router/ospf/redistribute/static/static_route_map (common-def:name-string63)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_static_route_map is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_static_route_map() directly.
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(
                v,
                base=RestrictedClassType(
                    base_type=unicode,
                    restriction_dict={
                        'pattern':
                        u'[a-zA-Z]{1}([-a-zA-Z0-9\\.\\\\\\\\@#\\+\\*\\(\\)=\\{~\\}%<>=$_\\[\\]\\|]{0,62})'
                    }),
                is_leaf=True,
                yang_name="static-route-map",
                rest_name="route-map",
                parent=self,
                path_helper=self._path_helper,
                extmethods=self._extmethods,
                register_paths=True,
                extensions={
                    u'tailf-common': {
                        u'info': u'Route map reference',
                        u'alt-name': u'route-map'
                    }
                },
                namespace='urn:brocade.com:mgmt:brocade-ospf',
                defining_module='brocade-ospf',
                yang_type='common-def:name-string63',
                is_config=True)
        except (TypeError, ValueError):
            raise ValueError({
                'error-string':
                """static_route_map must be of a type compatible with common-def:name-string63""",
                'defined-type':
                "common-def:name-string63",
                'generated-type':
                """YANGDynClass(base=RestrictedClassType(base_type=unicode, restriction_dict={'pattern': u'[a-zA-Z]{1}([-a-zA-Z0-9\\.\\\\\\\\@#\\+\\*\\(\\)=\\{~\\}%<>=$_\\[\\]\\|]{0,62})'}), is_leaf=True, yang_name="static-route-map", rest_name="route-map", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'info': u'Route map reference', u'alt-name': u'route-map'}}, namespace='urn:brocade.com:mgmt:brocade-ospf', defining_module='brocade-ospf', yang_type='common-def:name-string63', is_config=True)""",
            })

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

    def _unset_static_route_map(self):
        self.__static_route_map = YANGDynClass(
            base=RestrictedClassType(
                base_type=unicode,
                restriction_dict={
                    'pattern':
                    u'[a-zA-Z]{1}([-a-zA-Z0-9\\.\\\\\\\\@#\\+\\*\\(\\)=\\{~\\}%<>=$_\\[\\]\\|]{0,62})'
                }),
            is_leaf=True,
            yang_name="static-route-map",
            rest_name="route-map",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            extensions={
                u'tailf-common': {
                    u'info': u'Route map reference',
                    u'alt-name': u'route-map'
                }
            },
            namespace='urn:brocade.com:mgmt:brocade-ospf',
            defining_module='brocade-ospf',
            yang_type='common-def:name-string63',
            is_config=True)

    static_route_map = __builtin__.property(_get_static_route_map,
                                            _set_static_route_map)

    _pyangbind_elements = {
        'static_route_map': static_route_map,
    }
Exemple #15
0
class connectivity(PybindBase):
    """
  This class was auto-generated by the PythonClass plugin for PYANG
  from YANG module brocade-interface - based on the path /interface/tengigabitethernet/connectivity. Each member element of
  the container is represented as a class variable - with a specific
  YANG type.
  """
    __slots__ = (
        '_pybind_generated_by',
        '_path_helper',
        '_yang_name',
        '_rest_name',
        '_extmethods',
        '__deviceconnectivity',
    )

    _yang_name = 'connectivity'
    _rest_name = ''

    _pybind_generated_by = 'container'

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

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

        extmethods = kwargs.pop("extmethods", None)
        if extmethods is False:
            self._extmethods = False
        elif extmethods is not None and isinstance(extmethods, dict):
            self._extmethods = extmethods
        elif hasattr(self, "_parent"):
            extmethods = getattr(self._parent, "_extmethods", None)
            self._extmethods = extmethods
        else:
            self._extmethods = False
        self.__deviceconnectivity = YANGDynClass(
            base=RestrictedClassType(
                base_type=unicode,
                restriction_type="dict_key",
                restriction_arg={
                    u'NAS': {
                        'value': 2
                    },
                    u'None': {
                        'value': 0
                    },
                    u'iSCSI': {
                        'value': 1
                    },
                    u'DAS': {
                        'value': 3
                    }
                },
            ),
            default=unicode("None"),
            is_leaf=True,
            yang_name="deviceconnectivity",
            rest_name="deviceconnectivity",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            extensions={
                u'tailf-common': {
                    u'info': u'Device connectivity to IP storage device',
                    u'cli-suppress-no': None
                }
            },
            namespace='urn:brocade.com:mgmt:brocade-maps',
            defining_module='brocade-maps',
            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 [u'interface', u'tengigabitethernet', u'connectivity']

    def _rest_path(self):
        if hasattr(self, "_parent"):
            if self._rest_name:
                return self._parent._rest_path() + [self._rest_name]
            else:
                return self._parent._rest_path()
        else:
            return [u'interface', u'TenGigabitEthernet']

    def _get_deviceconnectivity(self):
        """
    Getter method for deviceconnectivity, mapped from YANG variable /interface/tengigabitethernet/connectivity/deviceconnectivity (enumeration)
    """
        return self.__deviceconnectivity

    def _set_deviceconnectivity(self, v, load=False):
        """
    Setter method for deviceconnectivity, mapped from YANG variable /interface/tengigabitethernet/connectivity/deviceconnectivity (enumeration)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_deviceconnectivity is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_deviceconnectivity() directly.
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(
                v,
                base=RestrictedClassType(
                    base_type=unicode,
                    restriction_type="dict_key",
                    restriction_arg={
                        u'NAS': {
                            'value': 2
                        },
                        u'None': {
                            'value': 0
                        },
                        u'iSCSI': {
                            'value': 1
                        },
                        u'DAS': {
                            'value': 3
                        }
                    },
                ),
                default=unicode("None"),
                is_leaf=True,
                yang_name="deviceconnectivity",
                rest_name="deviceconnectivity",
                parent=self,
                path_helper=self._path_helper,
                extmethods=self._extmethods,
                register_paths=True,
                extensions={
                    u'tailf-common': {
                        u'info': u'Device connectivity to IP storage device',
                        u'cli-suppress-no': None
                    }
                },
                namespace='urn:brocade.com:mgmt:brocade-maps',
                defining_module='brocade-maps',
                yang_type='enumeration',
                is_config=True)
        except (TypeError, ValueError):
            raise ValueError({
                'error-string':
                """deviceconnectivity must be of a type compatible with enumeration""",
                'defined-type':
                "brocade-maps:enumeration",
                'generated-type':
                """YANGDynClass(base=RestrictedClassType(base_type=unicode,                                     restriction_type="dict_key",                                     restriction_arg={u'NAS': {'value': 2}, u'None': {'value': 0}, u'iSCSI': {'value': 1}, u'DAS': {'value': 3}},), default=unicode("None"), is_leaf=True, yang_name="deviceconnectivity", rest_name="deviceconnectivity", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'info': u'Device connectivity to IP storage device', u'cli-suppress-no': None}}, namespace='urn:brocade.com:mgmt:brocade-maps', defining_module='brocade-maps', yang_type='enumeration', is_config=True)""",
            })

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

    def _unset_deviceconnectivity(self):
        self.__deviceconnectivity = YANGDynClass(
            base=RestrictedClassType(
                base_type=unicode,
                restriction_type="dict_key",
                restriction_arg={
                    u'NAS': {
                        'value': 2
                    },
                    u'None': {
                        'value': 0
                    },
                    u'iSCSI': {
                        'value': 1
                    },
                    u'DAS': {
                        'value': 3
                    }
                },
            ),
            default=unicode("None"),
            is_leaf=True,
            yang_name="deviceconnectivity",
            rest_name="deviceconnectivity",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            extensions={
                u'tailf-common': {
                    u'info': u'Device connectivity to IP storage device',
                    u'cli-suppress-no': None
                }
            },
            namespace='urn:brocade.com:mgmt:brocade-maps',
            defining_module='brocade-maps',
            yang_type='enumeration',
            is_config=True)

    deviceconnectivity = __builtin__.property(_get_deviceconnectivity,
                                              _set_deviceconnectivity)

    _pyangbind_elements = {
        'deviceconnectivity': deviceconnectivity,
    }
Exemple #16
0
class lacp(PybindBase):
  """
  This class was auto-generated by the PythonClass plugin for PYANG
  from YANG module brocade-interface - based on the path /interface/gigabitethernet/lacp. Each member element of
  the container is represented as a class variable - with a specific
  YANG type.
  """
  __slots__ = ('_pybind_generated_by', '_path_helper', '_yang_name', '_rest_name', '_extmethods', '__timeout','__std_port_priority','__default_up',)

  _yang_name = 'lacp'
  _rest_name = 'lacp'

  _pybind_generated_by = 'container'

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

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

    extmethods = kwargs.pop("extmethods", None)
    if extmethods is False:
      self._extmethods = False
    elif extmethods is not None and isinstance(extmethods, dict):
      self._extmethods = extmethods
    elif hasattr(self, "_parent"):
      extmethods = getattr(self._parent, "_extmethods", None)
      self._extmethods = extmethods
    else:
      self._extmethods = False
    self.__default_up = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="default-up", rest_name="default-up", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'cli-full-command': None, u'info': u'To bring up the interface in LACP default state '}}, namespace='urn:brocade.com:mgmt:brocade-lacp', defining_module='brocade-lacp', yang_type='empty', is_config=True)
    self.__timeout = YANGDynClass(base=RestrictedClassType(base_type=unicode,                                     restriction_type="dict_key",                                     restriction_arg={u'short': {'value': 1}, u'long': {'value': 2}},), is_leaf=True, yang_name="timeout", rest_name="timeout", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'info': u'Timeout commands', u'cli-full-command': None}}, namespace='urn:brocade.com:mgmt:brocade-lacp', defining_module='brocade-lacp', yang_type='enumeration', is_config=True)
    self.__std_port_priority = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), restriction_dict={'range': [u'1 .. 65535']}), default=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32)(32768), is_leaf=True, yang_name="std_port-priority", rest_name="port-priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'info': u'Port priority commands', u'cli-full-command': None, u'cli-full-no': None, u'alt-name': u'port-priority'}}, namespace='urn:brocade.com:mgmt:brocade-lacp', defining_module='brocade-lacp', yang_type='uint32', 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'interface', u'gigabitethernet', u'lacp']

  def _rest_path(self):
    if hasattr(self, "_parent"):
      if self._rest_name:
        return self._parent._rest_path()+[self._rest_name]
      else:
        return self._parent._rest_path()
    else:
      return [u'interface', u'GigabitEthernet', u'lacp']

  def _get_timeout(self):
    """
    Getter method for timeout, mapped from YANG variable /interface/gigabitethernet/lacp/timeout (enumeration)
    """
    return self.__timeout
      
  def _set_timeout(self, v, load=False):
    """
    Setter method for timeout, mapped from YANG variable /interface/gigabitethernet/lacp/timeout (enumeration)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_timeout is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_timeout() directly.
    """
    if hasattr(v, "_utype"):
      v = v._utype(v)
    try:
      t = YANGDynClass(v,base=RestrictedClassType(base_type=unicode,                                     restriction_type="dict_key",                                     restriction_arg={u'short': {'value': 1}, u'long': {'value': 2}},), is_leaf=True, yang_name="timeout", rest_name="timeout", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'info': u'Timeout commands', u'cli-full-command': None}}, namespace='urn:brocade.com:mgmt:brocade-lacp', defining_module='brocade-lacp', yang_type='enumeration', is_config=True)
    except (TypeError, ValueError):
      raise ValueError({
          'error-string': """timeout must be of a type compatible with enumeration""",
          'defined-type': "brocade-lacp:enumeration",
          'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=unicode,                                     restriction_type="dict_key",                                     restriction_arg={u'short': {'value': 1}, u'long': {'value': 2}},), is_leaf=True, yang_name="timeout", rest_name="timeout", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'info': u'Timeout commands', u'cli-full-command': None}}, namespace='urn:brocade.com:mgmt:brocade-lacp', defining_module='brocade-lacp', yang_type='enumeration', is_config=True)""",
        })

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

  def _unset_timeout(self):
    self.__timeout = YANGDynClass(base=RestrictedClassType(base_type=unicode,                                     restriction_type="dict_key",                                     restriction_arg={u'short': {'value': 1}, u'long': {'value': 2}},), is_leaf=True, yang_name="timeout", rest_name="timeout", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'info': u'Timeout commands', u'cli-full-command': None}}, namespace='urn:brocade.com:mgmt:brocade-lacp', defining_module='brocade-lacp', yang_type='enumeration', is_config=True)


  def _get_std_port_priority(self):
    """
    Getter method for std_port_priority, mapped from YANG variable /interface/gigabitethernet/lacp/std_port_priority (uint32)

    YANG Description: This command is used to configure port priority
    """
    return self.__std_port_priority
      
  def _set_std_port_priority(self, v, load=False):
    """
    Setter method for std_port_priority, mapped from YANG variable /interface/gigabitethernet/lacp/std_port_priority (uint32)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_std_port_priority is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_std_port_priority() directly.

    YANG Description: This command is used to configure port priority
    """
    if hasattr(v, "_utype"):
      v = v._utype(v)
    try:
      t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), restriction_dict={'range': [u'1 .. 65535']}), default=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32)(32768), is_leaf=True, yang_name="std_port-priority", rest_name="port-priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'info': u'Port priority commands', u'cli-full-command': None, u'cli-full-no': None, u'alt-name': u'port-priority'}}, namespace='urn:brocade.com:mgmt:brocade-lacp', defining_module='brocade-lacp', yang_type='uint32', is_config=True)
    except (TypeError, ValueError):
      raise ValueError({
          'error-string': """std_port_priority must be of a type compatible with uint32""",
          'defined-type': "uint32",
          'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), restriction_dict={'range': [u'1 .. 65535']}), default=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32)(32768), is_leaf=True, yang_name="std_port-priority", rest_name="port-priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'info': u'Port priority commands', u'cli-full-command': None, u'cli-full-no': None, u'alt-name': u'port-priority'}}, namespace='urn:brocade.com:mgmt:brocade-lacp', defining_module='brocade-lacp', yang_type='uint32', is_config=True)""",
        })

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

  def _unset_std_port_priority(self):
    self.__std_port_priority = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), restriction_dict={'range': [u'1 .. 65535']}), default=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32)(32768), is_leaf=True, yang_name="std_port-priority", rest_name="port-priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'info': u'Port priority commands', u'cli-full-command': None, u'cli-full-no': None, u'alt-name': u'port-priority'}}, namespace='urn:brocade.com:mgmt:brocade-lacp', defining_module='brocade-lacp', yang_type='uint32', is_config=True)


  def _get_default_up(self):
    """
    Getter method for default_up, mapped from YANG variable /interface/gigabitethernet/lacp/default_up (empty)
    """
    return self.__default_up
      
  def _set_default_up(self, v, load=False):
    """
    Setter method for default_up, mapped from YANG variable /interface/gigabitethernet/lacp/default_up (empty)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_default_up is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_default_up() directly.
    """
    if hasattr(v, "_utype"):
      v = v._utype(v)
    try:
      t = YANGDynClass(v,base=YANGBool, is_leaf=True, yang_name="default-up", rest_name="default-up", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'cli-full-command': None, u'info': u'To bring up the interface in LACP default state '}}, namespace='urn:brocade.com:mgmt:brocade-lacp', defining_module='brocade-lacp', yang_type='empty', is_config=True)
    except (TypeError, ValueError):
      raise ValueError({
          'error-string': """default_up must be of a type compatible with empty""",
          'defined-type': "empty",
          'generated-type': """YANGDynClass(base=YANGBool, is_leaf=True, yang_name="default-up", rest_name="default-up", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'cli-full-command': None, u'info': u'To bring up the interface in LACP default state '}}, namespace='urn:brocade.com:mgmt:brocade-lacp', defining_module='brocade-lacp', yang_type='empty', is_config=True)""",
        })

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

  def _unset_default_up(self):
    self.__default_up = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="default-up", rest_name="default-up", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'cli-full-command': None, u'info': u'To bring up the interface in LACP default state '}}, namespace='urn:brocade.com:mgmt:brocade-lacp', defining_module='brocade-lacp', yang_type='empty', is_config=True)

  timeout = __builtin__.property(_get_timeout, _set_timeout)
  std_port_priority = __builtin__.property(_get_std_port_priority, _set_std_port_priority)
  default_up = __builtin__.property(_get_default_up, _set_default_up)


  _pyangbind_elements = {'timeout': timeout, 'std_port_priority': std_port_priority, 'default_up': default_up, }
Exemple #17
0
class l3(PybindBase):
    """
  This class was auto-generated by the PythonClass plugin for PYANG
  from YANG module brocade-system-capabilities - based on the path /capabilities/l3. Each member element of
  the container is represented as a class variable - with a specific
  YANG type.
  """
    __slots__ = (
        '_pybind_generated_by',
        '_path_helper',
        '_yang_name',
        '_rest_name',
        '_extmethods',
        '__ip_mtu',
        '__vrrp_extended_group_phy',
    )

    _yang_name = 'l3'
    _rest_name = 'l3'

    _pybind_generated_by = 'container'

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

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

        extmethods = kwargs.pop("extmethods", None)
        if extmethods is False:
            self._extmethods = False
        elif extmethods is not None and isinstance(extmethods, dict):
            self._extmethods = extmethods
        elif hasattr(self, "_parent"):
            extmethods = getattr(self._parent, "_extmethods", None)
            self._extmethods = extmethods
        else:
            self._extmethods = False
        self.__ip_mtu = YANGDynClass(
            base=YANGBool,
            is_leaf=True,
            yang_name="ip_mtu",
            rest_name="ip_mtu",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace='urn:brocade.com:mgmt:brocade-system-capabilities',
            defining_module='brocade-system-capabilities',
            yang_type='boolean',
            is_config=False)
        self.__vrrp_extended_group_phy = YANGDynClass(
            base=YANGBool,
            is_leaf=True,
            yang_name="vrrp_extended_group_phy",
            rest_name="vrrp_extended_group_phy",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace='urn:brocade.com:mgmt:brocade-system-capabilities',
            defining_module='brocade-system-capabilities',
            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 [u'capabilities', u'l3']

    def _rest_path(self):
        if hasattr(self, "_parent"):
            if self._rest_name:
                return self._parent._rest_path() + [self._rest_name]
            else:
                return self._parent._rest_path()
        else:
            return [u'capabilities', u'l3']

    def _get_ip_mtu(self):
        """
    Getter method for ip_mtu, mapped from YANG variable /capabilities/l3/ip_mtu (boolean)
    """
        return self.__ip_mtu

    def _set_ip_mtu(self, v, load=False):
        """
    Setter method for ip_mtu, mapped from YANG variable /capabilities/l3/ip_mtu (boolean)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_ip_mtu is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_ip_mtu() directly.
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(
                v,
                base=YANGBool,
                is_leaf=True,
                yang_name="ip_mtu",
                rest_name="ip_mtu",
                parent=self,
                path_helper=self._path_helper,
                extmethods=self._extmethods,
                register_paths=True,
                namespace='urn:brocade.com:mgmt:brocade-system-capabilities',
                defining_module='brocade-system-capabilities',
                yang_type='boolean',
                is_config=False)
        except (TypeError, ValueError):
            raise ValueError({
                'error-string':
                """ip_mtu must be of a type compatible with boolean""",
                'defined-type':
                "boolean",
                'generated-type':
                """YANGDynClass(base=YANGBool, is_leaf=True, yang_name="ip_mtu", rest_name="ip_mtu", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:brocade.com:mgmt:brocade-system-capabilities', defining_module='brocade-system-capabilities', yang_type='boolean', is_config=False)""",
            })

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

    def _unset_ip_mtu(self):
        self.__ip_mtu = YANGDynClass(
            base=YANGBool,
            is_leaf=True,
            yang_name="ip_mtu",
            rest_name="ip_mtu",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace='urn:brocade.com:mgmt:brocade-system-capabilities',
            defining_module='brocade-system-capabilities',
            yang_type='boolean',
            is_config=False)

    def _get_vrrp_extended_group_phy(self):
        """
    Getter method for vrrp_extended_group_phy, mapped from YANG variable /capabilities/l3/vrrp_extended_group_phy (boolean)
    """
        return self.__vrrp_extended_group_phy

    def _set_vrrp_extended_group_phy(self, v, load=False):
        """
    Setter method for vrrp_extended_group_phy, mapped from YANG variable /capabilities/l3/vrrp_extended_group_phy (boolean)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_vrrp_extended_group_phy is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_vrrp_extended_group_phy() directly.
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(
                v,
                base=YANGBool,
                is_leaf=True,
                yang_name="vrrp_extended_group_phy",
                rest_name="vrrp_extended_group_phy",
                parent=self,
                path_helper=self._path_helper,
                extmethods=self._extmethods,
                register_paths=True,
                namespace='urn:brocade.com:mgmt:brocade-system-capabilities',
                defining_module='brocade-system-capabilities',
                yang_type='boolean',
                is_config=False)
        except (TypeError, ValueError):
            raise ValueError({
                'error-string':
                """vrrp_extended_group_phy must be of a type compatible with boolean""",
                'defined-type':
                "boolean",
                'generated-type':
                """YANGDynClass(base=YANGBool, is_leaf=True, yang_name="vrrp_extended_group_phy", rest_name="vrrp_extended_group_phy", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:brocade.com:mgmt:brocade-system-capabilities', defining_module='brocade-system-capabilities', yang_type='boolean', is_config=False)""",
            })

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

    def _unset_vrrp_extended_group_phy(self):
        self.__vrrp_extended_group_phy = YANGDynClass(
            base=YANGBool,
            is_leaf=True,
            yang_name="vrrp_extended_group_phy",
            rest_name="vrrp_extended_group_phy",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace='urn:brocade.com:mgmt:brocade-system-capabilities',
            defining_module='brocade-system-capabilities',
            yang_type='boolean',
            is_config=False)

    ip_mtu = __builtin__.property(_get_ip_mtu)
    vrrp_extended_group_phy = __builtin__.property(
        _get_vrrp_extended_group_phy)

    _pyangbind_elements = {
        'ip_mtu': ip_mtu,
        'vrrp_extended_group_phy': vrrp_extended_group_phy,
    }
Exemple #18
0
class vlan(PybindBase):
  """
  This class was auto-generated by the PythonClass plugin for PYANG
  from YANG module brocade-port-profile - based on the path /port-profile/vlan-profile/switchport/access/vlan. Each member element of
  the container is represented as a class variable - with a specific
  YANG type.

  YANG Description: This provides the grouping of Access VLAN 
configuration elements.
  """
  __slots__ = ('_pybind_generated_by', '_path_helper', '_yang_name', '_rest_name', '_extmethods', '__name',)

  _yang_name = 'vlan'
  _rest_name = 'vlan'

  _pybind_generated_by = 'container'

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

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

    extmethods = kwargs.pop("extmethods", None)
    if extmethods is False:
      self._extmethods = False
    elif extmethods is not None and isinstance(extmethods, dict):
      self._extmethods = extmethods
    elif hasattr(self, "_parent"):
      extmethods = getattr(self._parent, "_extmethods", None)
      self._extmethods = extmethods
    else:
      self._extmethods = False
    self.__name = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), restriction_dict={'range': [u'1..4090']}), is_leaf=True, yang_name="name", rest_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'cli-drop-node-name': None}}, namespace='urn:brocade.com:mgmt:brocade-port-profile', defining_module='brocade-port-profile', yang_type='interface:vlan-type', 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'port-profile', u'vlan-profile', u'switchport', u'access', u'vlan']

  def _rest_path(self):
    if hasattr(self, "_parent"):
      if self._rest_name:
        return self._parent._rest_path()+[self._rest_name]
      else:
        return self._parent._rest_path()
    else:
      return [u'port-profile', u'vlan-profile', u'switchport', u'access', u'vlan']

  def _get_name(self):
    """
    Getter method for name, mapped from YANG variable /port_profile/vlan_profile/switchport/access/vlan/name (interface:vlan-type)

    YANG Description: This specifies the Interface VLAN number.
    """
    return self.__name
      
  def _set_name(self, v, load=False):
    """
    Setter method for name, mapped from YANG variable /port_profile/vlan_profile/switchport/access/vlan/name (interface:vlan-type)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_name is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_name() directly.

    YANG Description: This specifies the Interface VLAN number.
    """
    if hasattr(v, "_utype"):
      v = v._utype(v)
    try:
      t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), restriction_dict={'range': [u'1..4090']}), is_leaf=True, yang_name="name", rest_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'cli-drop-node-name': None}}, namespace='urn:brocade.com:mgmt:brocade-port-profile', defining_module='brocade-port-profile', yang_type='interface:vlan-type', is_config=True)
    except (TypeError, ValueError):
      raise ValueError({
          'error-string': """name must be of a type compatible with interface:vlan-type""",
          'defined-type': "interface:vlan-type",
          'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), restriction_dict={'range': [u'1..4090']}), is_leaf=True, yang_name="name", rest_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'cli-drop-node-name': None}}, namespace='urn:brocade.com:mgmt:brocade-port-profile', defining_module='brocade-port-profile', yang_type='interface:vlan-type', is_config=True)""",
        })

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

  def _unset_name(self):
    self.__name = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), restriction_dict={'range': [u'1..4090']}), is_leaf=True, yang_name="name", rest_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'cli-drop-node-name': None}}, namespace='urn:brocade.com:mgmt:brocade-port-profile', defining_module='brocade-port-profile', yang_type='interface:vlan-type', is_config=True)

  name = __builtin__.property(_get_name, _set_name)


  _pyangbind_elements = {'name': name, }
Exemple #19
0
class vlan_groups(PybindBase):
    """
  This class was auto-generated by the PythonClass plugin for PYANG
  from YANG module brocade-mc-hms-operational - based on the path /igmp-snooping-state/igmp-snooping-vlans/igmp-snooping-vlans/vlan-groups. Each member element of
  the container is represented as a class variable - with a specific
  YANG type.

  YANG Description: Group information on an interface
  """
    __slots__ = (
        '_pybind_generated_by',
        '_path_helper',
        '_yang_name',
        '_rest_name',
        '_extmethods',
        '__grp_ip_addr',
        '__member_ports',
    )

    _yang_name = 'vlan-groups'
    _rest_name = 'vlan-groups'

    _pybind_generated_by = 'container'

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

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

        extmethods = kwargs.pop("extmethods", None)
        if extmethods is False:
            self._extmethods = False
        elif extmethods is not None and isinstance(extmethods, dict):
            self._extmethods = extmethods
        elif hasattr(self, "_parent"):
            extmethods = getattr(self._parent, "_extmethods", None)
            self._extmethods = extmethods
        else:
            self._extmethods = False
        self.__grp_ip_addr = YANGDynClass(
            base=RestrictedClassType(
                base_type=long,
                restriction_dict={'range': ['0..4294967295']},
                int_size=32),
            is_leaf=True,
            yang_name="grp-ip-addr",
            rest_name="grp-ip-addr",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            is_keyval=True,
            namespace='urn:brocade.com:mgmt:brocade-mc-hms-operational',
            defining_module='brocade-mc-hms-operational',
            yang_type='uint32',
            is_config=False)
        self.__member_ports = YANGDynClass(
            base=unicode,
            is_leaf=True,
            yang_name="member-ports",
            rest_name="member-ports",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace='urn:brocade.com:mgmt:brocade-mc-hms-operational',
            defining_module='brocade-mc-hms-operational',
            yang_type='string',
            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 [
                u'igmp-snooping-state', u'igmp-snooping-vlans',
                u'igmp-snooping-vlans', u'vlan-groups'
            ]

    def _rest_path(self):
        if hasattr(self, "_parent"):
            if self._rest_name:
                return self._parent._rest_path() + [self._rest_name]
            else:
                return self._parent._rest_path()
        else:
            return [
                u'igmp-snooping-state', u'igmp-snooping-vlans',
                u'igmp-snooping-vlans', u'vlan-groups'
            ]

    def _get_grp_ip_addr(self):
        """
    Getter method for grp_ip_addr, mapped from YANG variable /igmp_snooping_state/igmp_snooping_vlans/igmp_snooping_vlans/vlan_groups/grp_ip_addr (uint32)

    YANG Description: group address
    """
        return self.__grp_ip_addr

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

    YANG Description: group 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=RestrictedClassType(
                    base_type=long,
                    restriction_dict={'range': ['0..4294967295']},
                    int_size=32),
                is_leaf=True,
                yang_name="grp-ip-addr",
                rest_name="grp-ip-addr",
                parent=self,
                path_helper=self._path_helper,
                extmethods=self._extmethods,
                register_paths=True,
                is_keyval=True,
                namespace='urn:brocade.com:mgmt:brocade-mc-hms-operational',
                defining_module='brocade-mc-hms-operational',
                yang_type='uint32',
                is_config=False)
        except (TypeError, ValueError):
            raise ValueError({
                'error-string':
                """grp_ip_addr 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="grp-ip-addr", rest_name="grp-ip-addr", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:brocade.com:mgmt:brocade-mc-hms-operational', defining_module='brocade-mc-hms-operational', yang_type='uint32', is_config=False)""",
            })

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

    def _unset_grp_ip_addr(self):
        self.__grp_ip_addr = YANGDynClass(
            base=RestrictedClassType(
                base_type=long,
                restriction_dict={'range': ['0..4294967295']},
                int_size=32),
            is_leaf=True,
            yang_name="grp-ip-addr",
            rest_name="grp-ip-addr",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            is_keyval=True,
            namespace='urn:brocade.com:mgmt:brocade-mc-hms-operational',
            defining_module='brocade-mc-hms-operational',
            yang_type='uint32',
            is_config=False)

    def _get_member_ports(self):
        """
    Getter method for member_ports, mapped from YANG variable /igmp_snooping_state/igmp_snooping_vlans/igmp_snooping_vlans/vlan_groups/member_ports (string)

    YANG Description: group member ports
    """
        return self.__member_ports

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

    YANG Description: group member ports
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(
                v,
                base=unicode,
                is_leaf=True,
                yang_name="member-ports",
                rest_name="member-ports",
                parent=self,
                path_helper=self._path_helper,
                extmethods=self._extmethods,
                register_paths=True,
                namespace='urn:brocade.com:mgmt:brocade-mc-hms-operational',
                defining_module='brocade-mc-hms-operational',
                yang_type='string',
                is_config=False)
        except (TypeError, ValueError):
            raise ValueError({
                'error-string':
                """member_ports must be of a type compatible with string""",
                'defined-type':
                "string",
                'generated-type':
                """YANGDynClass(base=unicode, is_leaf=True, yang_name="member-ports", rest_name="member-ports", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:brocade.com:mgmt:brocade-mc-hms-operational', defining_module='brocade-mc-hms-operational', yang_type='string', is_config=False)""",
            })

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

    def _unset_member_ports(self):
        self.__member_ports = YANGDynClass(
            base=unicode,
            is_leaf=True,
            yang_name="member-ports",
            rest_name="member-ports",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace='urn:brocade.com:mgmt:brocade-mc-hms-operational',
            defining_module='brocade-mc-hms-operational',
            yang_type='string',
            is_config=False)

    grp_ip_addr = __builtin__.property(_get_grp_ip_addr)
    member_ports = __builtin__.property(_get_member_ports)

    _pyangbind_elements = {
        'grp_ip_addr': grp_ip_addr,
        'member_ports': member_ports,
    }
Exemple #20
0
class input(PybindBase):
    """
  This class was auto-generated by the PythonClass plugin for PYANG
  from YANG module brocade-maps-ext - based on the path /brocade_maps_ext_rpc/maps-get-rules/input. Each member element of
  the container is represented as a class variable - with a specific
  YANG type.
  """
    __slots__ = (
        '_pybind_generated_by',
        '_path_helper',
        '_yang_name',
        '_rest_name',
        '_extmethods',
        '__rbridge_id',
    )

    _yang_name = 'input'
    _rest_name = 'input'

    _pybind_generated_by = 'container'

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

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

        extmethods = kwargs.pop("extmethods", None)
        if extmethods is False:
            self._extmethods = False
        elif extmethods is not None and isinstance(extmethods, dict):
            self._extmethods = extmethods
        elif hasattr(self, "_parent"):
            extmethods = getattr(self._parent, "_extmethods", None)
            self._extmethods = extmethods
        else:
            self._extmethods = False
        self.__rbridge_id = YANGDynClass(
            base=[
                RestrictedClassType(base_type=RestrictedClassType(
                    base_type=long,
                    restriction_dict={'range': ['0..4294967295']},
                    int_size=32),
                                    restriction_dict={'range': [u'1..239']}),
                RestrictedClassType(base_type=unicode,
                                    restriction_dict={'pattern': u'all'}),
            ],
            is_leaf=True,
            yang_name="rbridge-id",
            rest_name="rbridge-id",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=False,
            namespace='urn:brocade.com:mgmt:brocade-maps-ext',
            defining_module='brocade-maps-ext',
            yang_type='common-def:rbridge-id-all-type',
            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'brocade_maps_ext_rpc', u'maps-get-rules', u'input']

    def _rest_path(self):
        if hasattr(self, "_parent"):
            if self._rest_name:
                return self._parent._rest_path() + [self._rest_name]
            else:
                return self._parent._rest_path()
        else:
            return [u'maps-get-rules', u'input']

    def _get_rbridge_id(self):
        """
    Getter method for rbridge_id, mapped from YANG variable /brocade_maps_ext_rpc/maps_get_rules/input/rbridge_id (common-def:rbridge-id-all-type)
    """
        return self.__rbridge_id

    def _set_rbridge_id(self, v, load=False):
        """
    Setter method for rbridge_id, mapped from YANG variable /brocade_maps_ext_rpc/maps_get_rules/input/rbridge_id (common-def:rbridge-id-all-type)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_rbridge_id is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_rbridge_id() directly.
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(
                v,
                base=[
                    RestrictedClassType(
                        base_type=RestrictedClassType(
                            base_type=long,
                            restriction_dict={'range': ['0..4294967295']},
                            int_size=32),
                        restriction_dict={'range': [u'1..239']}),
                    RestrictedClassType(base_type=unicode,
                                        restriction_dict={'pattern': u'all'}),
                ],
                is_leaf=True,
                yang_name="rbridge-id",
                rest_name="rbridge-id",
                parent=self,
                path_helper=self._path_helper,
                extmethods=self._extmethods,
                register_paths=False,
                namespace='urn:brocade.com:mgmt:brocade-maps-ext',
                defining_module='brocade-maps-ext',
                yang_type='common-def:rbridge-id-all-type',
                is_config=True)
        except (TypeError, ValueError):
            raise ValueError({
                'error-string':
                """rbridge_id must be of a type compatible with common-def:rbridge-id-all-type""",
                'defined-type':
                "common-def:rbridge-id-all-type",
                'generated-type':
                """YANGDynClass(base=[RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), restriction_dict={'range': [u'1..239']}),RestrictedClassType(base_type=unicode, restriction_dict={'pattern': u'all'}),], is_leaf=True, yang_name="rbridge-id", rest_name="rbridge-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=False, namespace='urn:brocade.com:mgmt:brocade-maps-ext', defining_module='brocade-maps-ext', yang_type='common-def:rbridge-id-all-type', is_config=True)""",
            })

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

    def _unset_rbridge_id(self):
        self.__rbridge_id = YANGDynClass(
            base=[
                RestrictedClassType(base_type=RestrictedClassType(
                    base_type=long,
                    restriction_dict={'range': ['0..4294967295']},
                    int_size=32),
                                    restriction_dict={'range': [u'1..239']}),
                RestrictedClassType(base_type=unicode,
                                    restriction_dict={'pattern': u'all'}),
            ],
            is_leaf=True,
            yang_name="rbridge-id",
            rest_name="rbridge-id",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=False,
            namespace='urn:brocade.com:mgmt:brocade-maps-ext',
            defining_module='brocade-maps-ext',
            yang_type='common-def:rbridge-id-all-type',
            is_config=True)

    rbridge_id = __builtin__.property(_get_rbridge_id, _set_rbridge_id)

    _pyangbind_elements = {
        'rbridge_id': rbridge_id,
    }
Exemple #21
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/levels/level/link-state-database/lsp/tlvs/tlv/mt-isis-neighbor-attribute/neighbors/neighbor/undefined-subtlvs/undefined-subtlv/state. Each member element of
  the container is represented as a class variable - with a specific
  YANG type.

  YANG Description: State parameters of the undefined sub-TLV.
  """
    __slots__ = (
        '_pybind_generated_by',
        '_path_helper',
        '_yang_name',
        '_extmethods',
        '__type',
        '__length',
        '__value',
    )

    _yang_name = 'state'

    _pybind_generated_by = 'container'

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

        self._path_helper = False

        self._extmethods = False
        self.__length = YANGDynClass(
            base=RestrictedClassType(base_type=int,
                                     restriction_dict={'range': ['0..255']},
                                     int_size=8),
            is_leaf=True,
            yang_name="length",
            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.__type = YANGDynClass(
            base=RestrictedClassType(base_type=int,
                                     restriction_dict={'range': ['0..255']},
                                     int_size=8),
            is_leaf=True,
            yang_name="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='uint8',
            is_config=False)
        self.__value = YANGDynClass(
            base=bitarray,
            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='binary',
            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 [
                u'network-instances', u'network-instance', u'protocols',
                u'protocol', u'isis', u'levels', u'level',
                u'link-state-database', u'lsp', u'tlvs', u'tlv',
                u'mt-isis-neighbor-attribute', u'neighbors', u'neighbor',
                u'undefined-subtlvs', u'undefined-subtlv', u'state'
            ]

    def _get_type(self):
        """
    Getter method for type, mapped from YANG variable /network_instances/network_instance/protocols/protocol/isis/levels/level/link_state_database/lsp/tlvs/tlv/mt_isis_neighbor_attribute/neighbors/neighbor/undefined_subtlvs/undefined_subtlv/state/type (uint8)

    YANG Description: TLV Type.
    """
        return self.__type

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

    YANG Description: TLV Type.
    """
        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="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='uint8',
                is_config=False)
        except (TypeError, ValueError):
            raise ValueError({
                'error-string':
                """type 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="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='uint8', is_config=False)""",
            })

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

    def _unset_type(self):
        self.__type = YANGDynClass(
            base=RestrictedClassType(base_type=int,
                                     restriction_dict={'range': ['0..255']},
                                     int_size=8),
            is_leaf=True,
            yang_name="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='uint8',
            is_config=False)

    def _get_length(self):
        """
    Getter method for length, mapped from YANG variable /network_instances/network_instance/protocols/protocol/isis/levels/level/link_state_database/lsp/tlvs/tlv/mt_isis_neighbor_attribute/neighbors/neighbor/undefined_subtlvs/undefined_subtlv/state/length (uint8)

    YANG Description: TLV length.
    """
        return self.__length

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

    YANG Description: TLV length.
    """
        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="length",
                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':
                """length 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="length", 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.__length = t
        if hasattr(self, '_set'):
            self._set()

    def _unset_length(self):
        self.__length = YANGDynClass(
            base=RestrictedClassType(base_type=int,
                                     restriction_dict={'range': ['0..255']},
                                     int_size=8),
            is_leaf=True,
            yang_name="length",
            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_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/mt_isis_neighbor_attribute/neighbors/neighbor/undefined_subtlvs/undefined_subtlv/state/value (binary)

    YANG Description: TLV 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/mt_isis_neighbor_attribute/neighbors/neighbor/undefined_subtlvs/undefined_subtlv/state/value (binary)
    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: TLV value.
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(
                v,
                base=bitarray,
                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='binary',
                is_config=False)
        except (TypeError, ValueError):
            raise ValueError({
                'error-string':
                """value must be of a type compatible with binary""",
                'defined-type':
                "binary",
                'generated-type':
                """YANGDynClass(base=bitarray, 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='binary', is_config=False)""",
            })

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

    def _unset_value(self):
        self.__value = YANGDynClass(
            base=bitarray,
            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='binary',
            is_config=False)

    type = __builtin__.property(_get_type)
    length = __builtin__.property(_get_length)
    value = __builtin__.property(_get_value)

    _pyangbind_elements = {
        'type': type,
        'length': length,
        'value': value,
    }
Exemple #22
0
class rpvst(PybindBase):
    """
  This class was auto-generated by the PythonClass plugin for PYANG
  from YANG module brocade-interface - based on the path /protocol/spanning-tree/rpvst. Each member element of
  the container is represented as a class variable - with a specific
  YANG type.
  """
    __slots__ = (
        '_pybind_generated_by',
        '_path_helper',
        '_yang_name',
        '_rest_name',
        '_extmethods',
        '__timer_config',
        '__description',
        '__bridge_priority',
        '__error_disable_timeout',
        '__port_channel',
        '__shutdown',
        '__vlan',
        '__transmit_holdcount',
    )

    _yang_name = 'rpvst'
    _rest_name = 'rpvst'

    _pybind_generated_by = 'container'

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

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

        extmethods = kwargs.pop("extmethods", None)
        if extmethods is False:
            self._extmethods = False
        elif extmethods is not None and isinstance(extmethods, dict):
            self._extmethods = extmethods
        elif hasattr(self, "_parent"):
            extmethods = getattr(self._parent, "_extmethods", None)
            self._extmethods = extmethods
        else:
            self._extmethods = False
        self.__description = YANGDynClass(
            base=RestrictedClassType(base_type=unicode,
                                     restriction_dict={'length': [u'0..64']}),
            default=unicode(""),
            is_leaf=True,
            yang_name="description",
            rest_name="description",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            extensions={
                u'tailf-common': {
                    u'info': u'Spanning tree description',
                    u'cli-multi-value': None,
                    u'cli-full-no': None
                }
            },
            namespace='urn:brocade.com:mgmt:brocade-xstp',
            defining_module='brocade-xstp',
            yang_type='string',
            is_config=True)
        self.__bridge_priority = YANGDynClass(
            base=RestrictedClassType(base_type=RestrictedClassType(
                base_type=long,
                restriction_dict={'range': ['0..4294967295']},
                int_size=32),
                                     restriction_dict={'range':
                                                       [u'0..61440']}),
            default=RestrictedClassType(
                base_type=long,
                restriction_dict={'range': ['0..4294967295']},
                int_size=32)(32768),
            is_leaf=True,
            yang_name="bridge-priority",
            rest_name="bridge-priority",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            extensions={
                u'tailf-common': {
                    u'cli-full-command': None,
                    u'info': u'Bridge priority commands',
                    u'cli-full-no': None
                }
            },
            namespace='urn:brocade.com:mgmt:brocade-xstp',
            defining_module='brocade-xstp',
            yang_type='uint32',
            is_config=True)
        self.__vlan = YANGDynClass(
            base=YANGListType("id",
                              vlan.vlan,
                              yang_name="vlan",
                              rest_name="vlan",
                              parent=self,
                              is_container='list',
                              user_ordered=False,
                              path_helper=self._path_helper,
                              yang_keys='id',
                              extensions={
                                  u'tailf-common': {
                                      u'info': u'VLAN ID',
                                      u'cli-no-key-completion': None,
                                      u'cli-suppress-mode': None,
                                      u'cli-incomplete-no': None,
                                      u'cli-incomplete-command': None,
                                      u'callpoint': u'vlan-bridge-config'
                                  }
                              }),
            is_container='list',
            yang_name="vlan",
            rest_name="vlan",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            extensions={
                u'tailf-common': {
                    u'info': u'VLAN ID',
                    u'cli-no-key-completion': None,
                    u'cli-suppress-mode': None,
                    u'cli-incomplete-no': None,
                    u'cli-incomplete-command': None,
                    u'callpoint': u'vlan-bridge-config'
                }
            },
            namespace='urn:brocade.com:mgmt:brocade-xstp',
            defining_module='brocade-xstp',
            yang_type='list',
            is_config=True)
        self.__error_disable_timeout = YANGDynClass(
            base=error_disable_timeout.error_disable_timeout,
            is_container='container',
            presence=False,
            yang_name="error-disable-timeout",
            rest_name="error-disable-timeout",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            extensions={
                u'tailf-common': {
                    u'info':
                    u'Set Error-disable-timeout for the spanning tree',
                    u'cli-incomplete-no': None
                }
            },
            namespace='urn:brocade.com:mgmt:brocade-xstp',
            defining_module='brocade-xstp',
            yang_type='container',
            is_config=True)
        self.__timer_config = YANGDynClass(
            base=timer_config.timer_config,
            is_container='container',
            presence=False,
            yang_name="timer-config",
            rest_name="",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            extensions={
                u'tailf-common': {
                    u'cli-compact-syntax': None,
                    u'cli-drop-node-name': None
                }
            },
            namespace='urn:brocade.com:mgmt:brocade-xstp',
            defining_module='brocade-xstp',
            yang_type='container',
            is_config=True)
        self.__shutdown = YANGDynClass(
            base=YANGBool,
            is_leaf=True,
            yang_name="shutdown",
            rest_name="shutdown",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            extensions={
                u'tailf-common': {
                    u'cli-full-command': None,
                    u'info': u'Turn off the spanning-tree protocol'
                }
            },
            namespace='urn:brocade.com:mgmt:brocade-xstp',
            defining_module='brocade-xstp',
            yang_type='empty',
            is_config=True)
        self.__transmit_holdcount = YANGDynClass(
            base=RestrictedClassType(base_type=RestrictedClassType(
                base_type=long,
                restriction_dict={'range': ['0..4294967295']},
                int_size=32),
                                     restriction_dict={'range': [u'1..10']}),
            default=RestrictedClassType(
                base_type=long,
                restriction_dict={'range': ['0..4294967295']},
                int_size=32)(6),
            is_leaf=True,
            yang_name="transmit-holdcount",
            rest_name="transmit-holdcount",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            extensions={
                u'tailf-common': {
                    u'info': u'Set Transmit hold count of the bridge',
                    u'cli-full-no': None
                }
            },
            namespace='urn:brocade.com:mgmt:brocade-xstp',
            defining_module='brocade-xstp',
            yang_type='uint32',
            is_config=True)
        self.__port_channel = YANGDynClass(
            base=port_channel.port_channel,
            is_container='container',
            presence=False,
            yang_name="port-channel",
            rest_name="port-channel",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            extensions={
                u'tailf-common': {
                    u'info':
                    u'Controls behaviour of port-channel for spanning-tree',
                    u'cli-incomplete-no': None
                }
            },
            namespace='urn:brocade.com:mgmt:brocade-xstp',
            defining_module='brocade-xstp',
            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'protocol', u'spanning-tree', u'rpvst']

    def _rest_path(self):
        if hasattr(self, "_parent"):
            if self._rest_name:
                return self._parent._rest_path() + [self._rest_name]
            else:
                return self._parent._rest_path()
        else:
            return [u'protocol', u'spanning-tree', u'rpvst']

    def _get_timer_config(self):
        """
    Getter method for timer_config, mapped from YANG variable /protocol/spanning_tree/rpvst/timer_config (container)
    """
        return self.__timer_config

    def _set_timer_config(self, v, load=False):
        """
    Setter method for timer_config, mapped from YANG variable /protocol/spanning_tree/rpvst/timer_config (container)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_timer_config is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_timer_config() directly.
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(v,
                             base=timer_config.timer_config,
                             is_container='container',
                             presence=False,
                             yang_name="timer-config",
                             rest_name="",
                             parent=self,
                             path_helper=self._path_helper,
                             extmethods=self._extmethods,
                             register_paths=True,
                             extensions={
                                 u'tailf-common': {
                                     u'cli-compact-syntax': None,
                                     u'cli-drop-node-name': None
                                 }
                             },
                             namespace='urn:brocade.com:mgmt:brocade-xstp',
                             defining_module='brocade-xstp',
                             yang_type='container',
                             is_config=True)
        except (TypeError, ValueError):
            raise ValueError({
                'error-string':
                """timer_config must be of a type compatible with container""",
                'defined-type':
                "container",
                'generated-type':
                """YANGDynClass(base=timer_config.timer_config, is_container='container', presence=False, yang_name="timer-config", rest_name="", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'cli-compact-syntax': None, u'cli-drop-node-name': None}}, namespace='urn:brocade.com:mgmt:brocade-xstp', defining_module='brocade-xstp', yang_type='container', is_config=True)""",
            })

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

    def _unset_timer_config(self):
        self.__timer_config = YANGDynClass(
            base=timer_config.timer_config,
            is_container='container',
            presence=False,
            yang_name="timer-config",
            rest_name="",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            extensions={
                u'tailf-common': {
                    u'cli-compact-syntax': None,
                    u'cli-drop-node-name': None
                }
            },
            namespace='urn:brocade.com:mgmt:brocade-xstp',
            defining_module='brocade-xstp',
            yang_type='container',
            is_config=True)

    def _get_description(self):
        """
    Getter method for description, mapped from YANG variable /protocol/spanning_tree/rpvst/description (string)
    """
        return self.__description

    def _set_description(self, v, load=False):
        """
    Setter method for description, mapped from YANG variable /protocol/spanning_tree/rpvst/description (string)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_description is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_description() directly.
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(v,
                             base=RestrictedClassType(
                                 base_type=unicode,
                                 restriction_dict={'length': [u'0..64']}),
                             default=unicode(""),
                             is_leaf=True,
                             yang_name="description",
                             rest_name="description",
                             parent=self,
                             path_helper=self._path_helper,
                             extmethods=self._extmethods,
                             register_paths=True,
                             extensions={
                                 u'tailf-common': {
                                     u'info': u'Spanning tree description',
                                     u'cli-multi-value': None,
                                     u'cli-full-no': None
                                 }
                             },
                             namespace='urn:brocade.com:mgmt:brocade-xstp',
                             defining_module='brocade-xstp',
                             yang_type='string',
                             is_config=True)
        except (TypeError, ValueError):
            raise ValueError({
                'error-string':
                """description must be of a type compatible with string""",
                'defined-type':
                "string",
                'generated-type':
                """YANGDynClass(base=RestrictedClassType(base_type=unicode, restriction_dict={'length': [u'0..64']}), default=unicode(""), is_leaf=True, yang_name="description", rest_name="description", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'info': u'Spanning tree description', u'cli-multi-value': None, u'cli-full-no': None}}, namespace='urn:brocade.com:mgmt:brocade-xstp', defining_module='brocade-xstp', yang_type='string', is_config=True)""",
            })

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

    def _unset_description(self):
        self.__description = YANGDynClass(
            base=RestrictedClassType(base_type=unicode,
                                     restriction_dict={'length': [u'0..64']}),
            default=unicode(""),
            is_leaf=True,
            yang_name="description",
            rest_name="description",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            extensions={
                u'tailf-common': {
                    u'info': u'Spanning tree description',
                    u'cli-multi-value': None,
                    u'cli-full-no': None
                }
            },
            namespace='urn:brocade.com:mgmt:brocade-xstp',
            defining_module='brocade-xstp',
            yang_type='string',
            is_config=True)

    def _get_bridge_priority(self):
        """
    Getter method for bridge_priority, mapped from YANG variable /protocol/spanning_tree/rpvst/bridge_priority (uint32)
    """
        return self.__bridge_priority

    def _set_bridge_priority(self, v, load=False):
        """
    Setter method for bridge_priority, mapped from YANG variable /protocol/spanning_tree/rpvst/bridge_priority (uint32)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_bridge_priority is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_bridge_priority() directly.
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(
                v,
                base=RestrictedClassType(
                    base_type=RestrictedClassType(
                        base_type=long,
                        restriction_dict={'range': ['0..4294967295']},
                        int_size=32),
                    restriction_dict={'range': [u'0..61440']}),
                default=RestrictedClassType(
                    base_type=long,
                    restriction_dict={'range': ['0..4294967295']},
                    int_size=32)(32768),
                is_leaf=True,
                yang_name="bridge-priority",
                rest_name="bridge-priority",
                parent=self,
                path_helper=self._path_helper,
                extmethods=self._extmethods,
                register_paths=True,
                extensions={
                    u'tailf-common': {
                        u'cli-full-command': None,
                        u'info': u'Bridge priority commands',
                        u'cli-full-no': None
                    }
                },
                namespace='urn:brocade.com:mgmt:brocade-xstp',
                defining_module='brocade-xstp',
                yang_type='uint32',
                is_config=True)
        except (TypeError, ValueError):
            raise ValueError({
                'error-string':
                """bridge_priority must be of a type compatible with uint32""",
                'defined-type':
                "uint32",
                'generated-type':
                """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), restriction_dict={'range': [u'0..61440']}), default=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32)(32768), is_leaf=True, yang_name="bridge-priority", rest_name="bridge-priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'cli-full-command': None, u'info': u'Bridge priority commands', u'cli-full-no': None}}, namespace='urn:brocade.com:mgmt:brocade-xstp', defining_module='brocade-xstp', yang_type='uint32', is_config=True)""",
            })

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

    def _unset_bridge_priority(self):
        self.__bridge_priority = YANGDynClass(
            base=RestrictedClassType(base_type=RestrictedClassType(
                base_type=long,
                restriction_dict={'range': ['0..4294967295']},
                int_size=32),
                                     restriction_dict={'range':
                                                       [u'0..61440']}),
            default=RestrictedClassType(
                base_type=long,
                restriction_dict={'range': ['0..4294967295']},
                int_size=32)(32768),
            is_leaf=True,
            yang_name="bridge-priority",
            rest_name="bridge-priority",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            extensions={
                u'tailf-common': {
                    u'cli-full-command': None,
                    u'info': u'Bridge priority commands',
                    u'cli-full-no': None
                }
            },
            namespace='urn:brocade.com:mgmt:brocade-xstp',
            defining_module='brocade-xstp',
            yang_type='uint32',
            is_config=True)

    def _get_error_disable_timeout(self):
        """
    Getter method for error_disable_timeout, mapped from YANG variable /protocol/spanning_tree/rpvst/error_disable_timeout (container)
    """
        return self.__error_disable_timeout

    def _set_error_disable_timeout(self, v, load=False):
        """
    Setter method for error_disable_timeout, mapped from YANG variable /protocol/spanning_tree/rpvst/error_disable_timeout (container)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_error_disable_timeout is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_error_disable_timeout() directly.
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(
                v,
                base=error_disable_timeout.error_disable_timeout,
                is_container='container',
                presence=False,
                yang_name="error-disable-timeout",
                rest_name="error-disable-timeout",
                parent=self,
                path_helper=self._path_helper,
                extmethods=self._extmethods,
                register_paths=True,
                extensions={
                    u'tailf-common': {
                        u'info':
                        u'Set Error-disable-timeout for the spanning tree',
                        u'cli-incomplete-no': None
                    }
                },
                namespace='urn:brocade.com:mgmt:brocade-xstp',
                defining_module='brocade-xstp',
                yang_type='container',
                is_config=True)
        except (TypeError, ValueError):
            raise ValueError({
                'error-string':
                """error_disable_timeout must be of a type compatible with container""",
                'defined-type':
                "container",
                'generated-type':
                """YANGDynClass(base=error_disable_timeout.error_disable_timeout, is_container='container', presence=False, yang_name="error-disable-timeout", rest_name="error-disable-timeout", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'info': u'Set Error-disable-timeout for the spanning tree', u'cli-incomplete-no': None}}, namespace='urn:brocade.com:mgmt:brocade-xstp', defining_module='brocade-xstp', yang_type='container', is_config=True)""",
            })

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

    def _unset_error_disable_timeout(self):
        self.__error_disable_timeout = YANGDynClass(
            base=error_disable_timeout.error_disable_timeout,
            is_container='container',
            presence=False,
            yang_name="error-disable-timeout",
            rest_name="error-disable-timeout",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            extensions={
                u'tailf-common': {
                    u'info':
                    u'Set Error-disable-timeout for the spanning tree',
                    u'cli-incomplete-no': None
                }
            },
            namespace='urn:brocade.com:mgmt:brocade-xstp',
            defining_module='brocade-xstp',
            yang_type='container',
            is_config=True)

    def _get_port_channel(self):
        """
    Getter method for port_channel, mapped from YANG variable /protocol/spanning_tree/rpvst/port_channel (container)
    """
        return self.__port_channel

    def _set_port_channel(self, v, load=False):
        """
    Setter method for port_channel, mapped from YANG variable /protocol/spanning_tree/rpvst/port_channel (container)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_port_channel is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_port_channel() directly.
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(
                v,
                base=port_channel.port_channel,
                is_container='container',
                presence=False,
                yang_name="port-channel",
                rest_name="port-channel",
                parent=self,
                path_helper=self._path_helper,
                extmethods=self._extmethods,
                register_paths=True,
                extensions={
                    u'tailf-common': {
                        u'info':
                        u'Controls behaviour of port-channel for spanning-tree',
                        u'cli-incomplete-no': None
                    }
                },
                namespace='urn:brocade.com:mgmt:brocade-xstp',
                defining_module='brocade-xstp',
                yang_type='container',
                is_config=True)
        except (TypeError, ValueError):
            raise ValueError({
                'error-string':
                """port_channel must be of a type compatible with container""",
                'defined-type':
                "container",
                'generated-type':
                """YANGDynClass(base=port_channel.port_channel, is_container='container', presence=False, yang_name="port-channel", rest_name="port-channel", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'info': u'Controls behaviour of port-channel for spanning-tree', u'cli-incomplete-no': None}}, namespace='urn:brocade.com:mgmt:brocade-xstp', defining_module='brocade-xstp', yang_type='container', is_config=True)""",
            })

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

    def _unset_port_channel(self):
        self.__port_channel = YANGDynClass(
            base=port_channel.port_channel,
            is_container='container',
            presence=False,
            yang_name="port-channel",
            rest_name="port-channel",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            extensions={
                u'tailf-common': {
                    u'info':
                    u'Controls behaviour of port-channel for spanning-tree',
                    u'cli-incomplete-no': None
                }
            },
            namespace='urn:brocade.com:mgmt:brocade-xstp',
            defining_module='brocade-xstp',
            yang_type='container',
            is_config=True)

    def _get_shutdown(self):
        """
    Getter method for shutdown, mapped from YANG variable /protocol/spanning_tree/rpvst/shutdown (empty)
    """
        return self.__shutdown

    def _set_shutdown(self, v, load=False):
        """
    Setter method for shutdown, mapped from YANG variable /protocol/spanning_tree/rpvst/shutdown (empty)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_shutdown is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_shutdown() directly.
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(v,
                             base=YANGBool,
                             is_leaf=True,
                             yang_name="shutdown",
                             rest_name="shutdown",
                             parent=self,
                             path_helper=self._path_helper,
                             extmethods=self._extmethods,
                             register_paths=True,
                             extensions={
                                 u'tailf-common': {
                                     u'cli-full-command':
                                     None,
                                     u'info':
                                     u'Turn off the spanning-tree protocol'
                                 }
                             },
                             namespace='urn:brocade.com:mgmt:brocade-xstp',
                             defining_module='brocade-xstp',
                             yang_type='empty',
                             is_config=True)
        except (TypeError, ValueError):
            raise ValueError({
                'error-string':
                """shutdown must be of a type compatible with empty""",
                'defined-type':
                "empty",
                'generated-type':
                """YANGDynClass(base=YANGBool, is_leaf=True, yang_name="shutdown", rest_name="shutdown", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'cli-full-command': None, u'info': u'Turn off the spanning-tree protocol'}}, namespace='urn:brocade.com:mgmt:brocade-xstp', defining_module='brocade-xstp', yang_type='empty', is_config=True)""",
            })

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

    def _unset_shutdown(self):
        self.__shutdown = YANGDynClass(
            base=YANGBool,
            is_leaf=True,
            yang_name="shutdown",
            rest_name="shutdown",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            extensions={
                u'tailf-common': {
                    u'cli-full-command': None,
                    u'info': u'Turn off the spanning-tree protocol'
                }
            },
            namespace='urn:brocade.com:mgmt:brocade-xstp',
            defining_module='brocade-xstp',
            yang_type='empty',
            is_config=True)

    def _get_vlan(self):
        """
    Getter method for vlan, mapped from YANG variable /protocol/spanning_tree/rpvst/vlan (list)
    """
        return self.__vlan

    def _set_vlan(self, v, load=False):
        """
    Setter method for vlan, mapped from YANG variable /protocol/spanning_tree/rpvst/vlan (list)
    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.
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(v,
                             base=YANGListType(
                                 "id",
                                 vlan.vlan,
                                 yang_name="vlan",
                                 rest_name="vlan",
                                 parent=self,
                                 is_container='list',
                                 user_ordered=False,
                                 path_helper=self._path_helper,
                                 yang_keys='id',
                                 extensions={
                                     u'tailf-common': {
                                         u'info': u'VLAN ID',
                                         u'cli-no-key-completion': None,
                                         u'cli-suppress-mode': None,
                                         u'cli-incomplete-no': None,
                                         u'cli-incomplete-command': None,
                                         u'callpoint': u'vlan-bridge-config'
                                     }
                                 }),
                             is_container='list',
                             yang_name="vlan",
                             rest_name="vlan",
                             parent=self,
                             path_helper=self._path_helper,
                             extmethods=self._extmethods,
                             register_paths=True,
                             extensions={
                                 u'tailf-common': {
                                     u'info': u'VLAN ID',
                                     u'cli-no-key-completion': None,
                                     u'cli-suppress-mode': None,
                                     u'cli-incomplete-no': None,
                                     u'cli-incomplete-command': None,
                                     u'callpoint': u'vlan-bridge-config'
                                 }
                             },
                             namespace='urn:brocade.com:mgmt:brocade-xstp',
                             defining_module='brocade-xstp',
                             yang_type='list',
                             is_config=True)
        except (TypeError, ValueError):
            raise ValueError({
                'error-string':
                """vlan must be of a type compatible with list""",
                'defined-type':
                "list",
                'generated-type':
                """YANGDynClass(base=YANGListType("id",vlan.vlan, yang_name="vlan", rest_name="vlan", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='id', extensions={u'tailf-common': {u'info': u'VLAN ID', u'cli-no-key-completion': None, u'cli-suppress-mode': None, u'cli-incomplete-no': None, u'cli-incomplete-command': None, u'callpoint': u'vlan-bridge-config'}}), is_container='list', yang_name="vlan", rest_name="vlan", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'info': u'VLAN ID', u'cli-no-key-completion': None, u'cli-suppress-mode': None, u'cli-incomplete-no': None, u'cli-incomplete-command': None, u'callpoint': u'vlan-bridge-config'}}, namespace='urn:brocade.com:mgmt:brocade-xstp', defining_module='brocade-xstp', yang_type='list', is_config=True)""",
            })

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

    def _unset_vlan(self):
        self.__vlan = YANGDynClass(
            base=YANGListType("id",
                              vlan.vlan,
                              yang_name="vlan",
                              rest_name="vlan",
                              parent=self,
                              is_container='list',
                              user_ordered=False,
                              path_helper=self._path_helper,
                              yang_keys='id',
                              extensions={
                                  u'tailf-common': {
                                      u'info': u'VLAN ID',
                                      u'cli-no-key-completion': None,
                                      u'cli-suppress-mode': None,
                                      u'cli-incomplete-no': None,
                                      u'cli-incomplete-command': None,
                                      u'callpoint': u'vlan-bridge-config'
                                  }
                              }),
            is_container='list',
            yang_name="vlan",
            rest_name="vlan",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            extensions={
                u'tailf-common': {
                    u'info': u'VLAN ID',
                    u'cli-no-key-completion': None,
                    u'cli-suppress-mode': None,
                    u'cli-incomplete-no': None,
                    u'cli-incomplete-command': None,
                    u'callpoint': u'vlan-bridge-config'
                }
            },
            namespace='urn:brocade.com:mgmt:brocade-xstp',
            defining_module='brocade-xstp',
            yang_type='list',
            is_config=True)

    def _get_transmit_holdcount(self):
        """
    Getter method for transmit_holdcount, mapped from YANG variable /protocol/spanning_tree/rpvst/transmit_holdcount (uint32)
    """
        return self.__transmit_holdcount

    def _set_transmit_holdcount(self, v, load=False):
        """
    Setter method for transmit_holdcount, mapped from YANG variable /protocol/spanning_tree/rpvst/transmit_holdcount (uint32)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_transmit_holdcount is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_transmit_holdcount() directly.
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(
                v,
                base=RestrictedClassType(
                    base_type=RestrictedClassType(
                        base_type=long,
                        restriction_dict={'range': ['0..4294967295']},
                        int_size=32),
                    restriction_dict={'range': [u'1..10']}),
                default=RestrictedClassType(
                    base_type=long,
                    restriction_dict={'range': ['0..4294967295']},
                    int_size=32)(6),
                is_leaf=True,
                yang_name="transmit-holdcount",
                rest_name="transmit-holdcount",
                parent=self,
                path_helper=self._path_helper,
                extmethods=self._extmethods,
                register_paths=True,
                extensions={
                    u'tailf-common': {
                        u'info': u'Set Transmit hold count of the bridge',
                        u'cli-full-no': None
                    }
                },
                namespace='urn:brocade.com:mgmt:brocade-xstp',
                defining_module='brocade-xstp',
                yang_type='uint32',
                is_config=True)
        except (TypeError, ValueError):
            raise ValueError({
                'error-string':
                """transmit_holdcount must be of a type compatible with uint32""",
                'defined-type':
                "uint32",
                'generated-type':
                """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), restriction_dict={'range': [u'1..10']}), default=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32)(6), is_leaf=True, yang_name="transmit-holdcount", rest_name="transmit-holdcount", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'info': u'Set Transmit hold count of the bridge', u'cli-full-no': None}}, namespace='urn:brocade.com:mgmt:brocade-xstp', defining_module='brocade-xstp', yang_type='uint32', is_config=True)""",
            })

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

    def _unset_transmit_holdcount(self):
        self.__transmit_holdcount = YANGDynClass(
            base=RestrictedClassType(base_type=RestrictedClassType(
                base_type=long,
                restriction_dict={'range': ['0..4294967295']},
                int_size=32),
                                     restriction_dict={'range': [u'1..10']}),
            default=RestrictedClassType(
                base_type=long,
                restriction_dict={'range': ['0..4294967295']},
                int_size=32)(6),
            is_leaf=True,
            yang_name="transmit-holdcount",
            rest_name="transmit-holdcount",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            extensions={
                u'tailf-common': {
                    u'info': u'Set Transmit hold count of the bridge',
                    u'cli-full-no': None
                }
            },
            namespace='urn:brocade.com:mgmt:brocade-xstp',
            defining_module='brocade-xstp',
            yang_type='uint32',
            is_config=True)

    timer_config = __builtin__.property(_get_timer_config, _set_timer_config)
    description = __builtin__.property(_get_description, _set_description)
    bridge_priority = __builtin__.property(_get_bridge_priority,
                                           _set_bridge_priority)
    error_disable_timeout = __builtin__.property(_get_error_disable_timeout,
                                                 _set_error_disable_timeout)
    port_channel = __builtin__.property(_get_port_channel, _set_port_channel)
    shutdown = __builtin__.property(_get_shutdown, _set_shutdown)
    vlan = __builtin__.property(_get_vlan, _set_vlan)
    transmit_holdcount = __builtin__.property(_get_transmit_holdcount,
                                              _set_transmit_holdcount)

    _pyangbind_elements = {
        'timer_config': timer_config,
        'description': description,
        'bridge_priority': bridge_priority,
        'error_disable_timeout': error_disable_timeout,
        'port_channel': port_channel,
        'shutdown': shutdown,
        'vlan': vlan,
        'transmit_holdcount': transmit_holdcount,
    }
Exemple #23
0
class chassis(PybindBase):
    """
  This class was auto-generated by the PythonClass plugin for PYANG
  from YANG module brocade-rbridge - based on the path /rbridge-id/chassis. Each member element of
  the container is represented as a class variable - with a specific
  YANG type.
  """
    __slots__ = (
        '_pybind_generated_by',
        '_path_helper',
        '_yang_name',
        '_rest_name',
        '_extmethods',
        '__virtual_ip',
        '__virtual_ipv6',
        '__oper_address',
    )

    _yang_name = 'chassis'
    _rest_name = 'chassis'

    _pybind_generated_by = 'container'

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

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

        extmethods = kwargs.pop("extmethods", None)
        if extmethods is False:
            self._extmethods = False
        elif extmethods is not None and isinstance(extmethods, dict):
            self._extmethods = extmethods
        elif hasattr(self, "_parent"):
            extmethods = getattr(self._parent, "_extmethods", None)
            self._extmethods = extmethods
        else:
            self._extmethods = False
        self.__oper_address = YANGDynClass(
            base=oper_address.oper_address,
            is_container='container',
            presence=False,
            yang_name="oper-address",
            rest_name="",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            extensions={u'tailf-common': {
                u'cli-drop-node-name': None
            }},
            namespace='urn:brocade.com:mgmt:brocade-chassis',
            defining_module='brocade-chassis',
            yang_type='container',
            is_config=True)
        self.__virtual_ipv6 = YANGDynClass(
            base=RestrictedClassType(
                base_type=unicode,
                restriction_dict={
                    'pattern':
                    u'((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(/(([0-9])|([0-9]{2})|(1[0-1][0-9])|(12[0-8])))'
                }),
            is_leaf=True,
            yang_name="virtual-ipv6",
            rest_name="virtual-ipv6",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            extensions={
                u'tailf-common': {
                    u'info': u'Chassis Virtual IPv6 address'
                }
            },
            namespace='urn:brocade.com:mgmt:brocade-chassis',
            defining_module='brocade-chassis',
            yang_type='common-def:ipv6-address-prefix',
            is_config=True)
        self.__virtual_ip = YANGDynClass(
            base=RestrictedClassType(
                base_type=unicode,
                restriction_dict={
                    'pattern':
                    u'(([1-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.)(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){2}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])/(([1-9])|([1-2][0-9])|(3[0-1]))'
                }),
            is_leaf=True,
            yang_name="virtual-ip",
            rest_name="virtual-ip",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            extensions={
                u'tailf-common': {
                    u'info': u'Chassis Virtual IPv4 address'
                }
            },
            namespace='urn:brocade.com:mgmt:brocade-chassis',
            defining_module='brocade-chassis',
            yang_type='common-def:ipv4-prefix-mask',
            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'rbridge-id', u'chassis']

    def _rest_path(self):
        if hasattr(self, "_parent"):
            if self._rest_name:
                return self._parent._rest_path() + [self._rest_name]
            else:
                return self._parent._rest_path()
        else:
            return [u'rbridge-id', u'chassis']

    def _get_virtual_ip(self):
        """
    Getter method for virtual_ip, mapped from YANG variable /rbridge_id/chassis/virtual_ip (common-def:ipv4-prefix-mask)
    """
        return self.__virtual_ip

    def _set_virtual_ip(self, v, load=False):
        """
    Setter method for virtual_ip, mapped from YANG variable /rbridge_id/chassis/virtual_ip (common-def:ipv4-prefix-mask)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_virtual_ip is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_virtual_ip() directly.
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(
                v,
                base=RestrictedClassType(
                    base_type=unicode,
                    restriction_dict={
                        'pattern':
                        u'(([1-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.)(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){2}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])/(([1-9])|([1-2][0-9])|(3[0-1]))'
                    }),
                is_leaf=True,
                yang_name="virtual-ip",
                rest_name="virtual-ip",
                parent=self,
                path_helper=self._path_helper,
                extmethods=self._extmethods,
                register_paths=True,
                extensions={
                    u'tailf-common': {
                        u'info': u'Chassis Virtual IPv4 address'
                    }
                },
                namespace='urn:brocade.com:mgmt:brocade-chassis',
                defining_module='brocade-chassis',
                yang_type='common-def:ipv4-prefix-mask',
                is_config=True)
        except (TypeError, ValueError):
            raise ValueError({
                'error-string':
                """virtual_ip must be of a type compatible with common-def:ipv4-prefix-mask""",
                'defined-type':
                "common-def:ipv4-prefix-mask",
                'generated-type':
                """YANGDynClass(base=RestrictedClassType(base_type=unicode, restriction_dict={'pattern': u'(([1-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.)(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){2}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])/(([1-9])|([1-2][0-9])|(3[0-1]))'}), is_leaf=True, yang_name="virtual-ip", rest_name="virtual-ip", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'info': u'Chassis Virtual IPv4 address'}}, namespace='urn:brocade.com:mgmt:brocade-chassis', defining_module='brocade-chassis', yang_type='common-def:ipv4-prefix-mask', is_config=True)""",
            })

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

    def _unset_virtual_ip(self):
        self.__virtual_ip = YANGDynClass(
            base=RestrictedClassType(
                base_type=unicode,
                restriction_dict={
                    'pattern':
                    u'(([1-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.)(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){2}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])/(([1-9])|([1-2][0-9])|(3[0-1]))'
                }),
            is_leaf=True,
            yang_name="virtual-ip",
            rest_name="virtual-ip",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            extensions={
                u'tailf-common': {
                    u'info': u'Chassis Virtual IPv4 address'
                }
            },
            namespace='urn:brocade.com:mgmt:brocade-chassis',
            defining_module='brocade-chassis',
            yang_type='common-def:ipv4-prefix-mask',
            is_config=True)

    def _get_virtual_ipv6(self):
        """
    Getter method for virtual_ipv6, mapped from YANG variable /rbridge_id/chassis/virtual_ipv6 (common-def:ipv6-address-prefix)
    """
        return self.__virtual_ipv6

    def _set_virtual_ipv6(self, v, load=False):
        """
    Setter method for virtual_ipv6, mapped from YANG variable /rbridge_id/chassis/virtual_ipv6 (common-def:ipv6-address-prefix)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_virtual_ipv6 is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_virtual_ipv6() directly.
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(
                v,
                base=RestrictedClassType(
                    base_type=unicode,
                    restriction_dict={
                        'pattern':
                        u'((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(/(([0-9])|([0-9]{2})|(1[0-1][0-9])|(12[0-8])))'
                    }),
                is_leaf=True,
                yang_name="virtual-ipv6",
                rest_name="virtual-ipv6",
                parent=self,
                path_helper=self._path_helper,
                extmethods=self._extmethods,
                register_paths=True,
                extensions={
                    u'tailf-common': {
                        u'info': u'Chassis Virtual IPv6 address'
                    }
                },
                namespace='urn:brocade.com:mgmt:brocade-chassis',
                defining_module='brocade-chassis',
                yang_type='common-def:ipv6-address-prefix',
                is_config=True)
        except (TypeError, ValueError):
            raise ValueError({
                'error-string':
                """virtual_ipv6 must be of a type compatible with common-def:ipv6-address-prefix""",
                'defined-type':
                "common-def:ipv6-address-prefix",
                'generated-type':
                """YANGDynClass(base=RestrictedClassType(base_type=unicode, restriction_dict={'pattern': u'((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(/(([0-9])|([0-9]{2})|(1[0-1][0-9])|(12[0-8])))'}), is_leaf=True, yang_name="virtual-ipv6", rest_name="virtual-ipv6", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'info': u'Chassis Virtual IPv6 address'}}, namespace='urn:brocade.com:mgmt:brocade-chassis', defining_module='brocade-chassis', yang_type='common-def:ipv6-address-prefix', is_config=True)""",
            })

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

    def _unset_virtual_ipv6(self):
        self.__virtual_ipv6 = YANGDynClass(
            base=RestrictedClassType(
                base_type=unicode,
                restriction_dict={
                    'pattern':
                    u'((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(/(([0-9])|([0-9]{2})|(1[0-1][0-9])|(12[0-8])))'
                }),
            is_leaf=True,
            yang_name="virtual-ipv6",
            rest_name="virtual-ipv6",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            extensions={
                u'tailf-common': {
                    u'info': u'Chassis Virtual IPv6 address'
                }
            },
            namespace='urn:brocade.com:mgmt:brocade-chassis',
            defining_module='brocade-chassis',
            yang_type='common-def:ipv6-address-prefix',
            is_config=True)

    def _get_oper_address(self):
        """
    Getter method for oper_address, mapped from YANG variable /rbridge_id/chassis/oper_address (container)
    """
        return self.__oper_address

    def _set_oper_address(self, v, load=False):
        """
    Setter method for oper_address, mapped from YANG variable /rbridge_id/chassis/oper_address (container)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_oper_address is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_oper_address() directly.
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(
                v,
                base=oper_address.oper_address,
                is_container='container',
                presence=False,
                yang_name="oper-address",
                rest_name="",
                parent=self,
                path_helper=self._path_helper,
                extmethods=self._extmethods,
                register_paths=True,
                extensions={u'tailf-common': {
                    u'cli-drop-node-name': None
                }},
                namespace='urn:brocade.com:mgmt:brocade-chassis',
                defining_module='brocade-chassis',
                yang_type='container',
                is_config=True)
        except (TypeError, ValueError):
            raise ValueError({
                'error-string':
                """oper_address must be of a type compatible with container""",
                'defined-type':
                "container",
                'generated-type':
                """YANGDynClass(base=oper_address.oper_address, is_container='container', presence=False, yang_name="oper-address", rest_name="", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'cli-drop-node-name': None}}, namespace='urn:brocade.com:mgmt:brocade-chassis', defining_module='brocade-chassis', yang_type='container', is_config=True)""",
            })

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

    def _unset_oper_address(self):
        self.__oper_address = YANGDynClass(
            base=oper_address.oper_address,
            is_container='container',
            presence=False,
            yang_name="oper-address",
            rest_name="",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            extensions={u'tailf-common': {
                u'cli-drop-node-name': None
            }},
            namespace='urn:brocade.com:mgmt:brocade-chassis',
            defining_module='brocade-chassis',
            yang_type='container',
            is_config=True)

    virtual_ip = __builtin__.property(_get_virtual_ip, _set_virtual_ip)
    virtual_ipv6 = __builtin__.property(_get_virtual_ipv6, _set_virtual_ipv6)
    oper_address = __builtin__.property(_get_oper_address, _set_oper_address)

    _pyangbind_elements = {
        'virtual_ip': virtual_ip,
        'virtual_ipv6': virtual_ipv6,
        'oper_address': oper_address,
    }
Exemple #24
0
class connected(PybindBase):
  """
  This class was auto-generated by the PythonClass plugin for PYANG
  from YANG module brocade-common-def - based on the path /routing-system/router/router-bgp/address-family/ipv6/ipv6-unicast/default-vrf/af-ipv6-uc-and-vrf-cmds-call-point-holder/redistribute/connected. Each member element of
  the container is represented as a class variable - with a specific
  YANG type.
  """
  __slots__ = ('_pybind_generated_by', '_path_helper', '_yang_name', '_rest_name', '_extmethods', '__redistribute_connected','__unicast_metric','__redistribute_route_map',)

  _yang_name = 'connected'
  _rest_name = 'connected'

  _pybind_generated_by = 'container'

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

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

    extmethods = kwargs.pop("extmethods", None)
    if extmethods is False:
      self._extmethods = False
    elif extmethods is not None and isinstance(extmethods, dict):
      self._extmethods = extmethods
    elif hasattr(self, "_parent"):
      extmethods = getattr(self._parent, "_extmethods", None)
      self._extmethods = extmethods
    else:
      self._extmethods = False
    self.__redistribute_connected = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="redistribute-connected", rest_name="redistribute-connected", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'cli-run-template': u'$(.?$(../unicast-metric?\\r:$(../redistribute-route-map?\\r:redistribute connected\n)):\\r)', u'cli-drop-node-name': None}}, namespace='urn:brocade.com:mgmt:brocade-bgp', defining_module='brocade-bgp', yang_type='empty', is_config=True)
    self.__unicast_metric = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), restriction_dict={'range': [u'1..4294967295']}), is_leaf=True, yang_name="unicast-metric", rest_name="metric", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'info': u'Metric for redistributed routes', u'cli-full-command': None, u'alt-name': u'metric'}}, namespace='urn:brocade.com:mgmt:brocade-bgp', defining_module='brocade-bgp', yang_type='conn-metric', is_config=True)
    self.__redistribute_route_map = YANGDynClass(base=RestrictedClassType(base_type=unicode, restriction_dict={'length': [u'1..63']}), is_leaf=True, yang_name="redistribute-route-map", rest_name="route-map", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'info': u'Route map reference', u'cli-full-command': None, u'alt-name': u'route-map'}}, namespace='urn:brocade.com:mgmt:brocade-bgp', defining_module='brocade-bgp', yang_type='rmap-type', 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'routing-system', u'router', u'router-bgp', u'address-family', u'ipv6', u'ipv6-unicast', u'default-vrf', u'af-ipv6-uc-and-vrf-cmds-call-point-holder', u'redistribute', u'connected']

  def _rest_path(self):
    if hasattr(self, "_parent"):
      if self._rest_name:
        return self._parent._rest_path()+[self._rest_name]
      else:
        return self._parent._rest_path()
    else:
      return [u'router', u'bgp', u'address-family', u'ipv6', u'unicast', u'redistribute', u'connected']

  def _get_redistribute_connected(self):
    """
    Getter method for redistribute_connected, mapped from YANG variable /routing_system/router/router_bgp/address_family/ipv6/ipv6_unicast/default_vrf/af_ipv6_uc_and_vrf_cmds_call_point_holder/redistribute/connected/redistribute_connected (empty)
    """
    return self.__redistribute_connected
      
  def _set_redistribute_connected(self, v, load=False):
    """
    Setter method for redistribute_connected, mapped from YANG variable /routing_system/router/router_bgp/address_family/ipv6/ipv6_unicast/default_vrf/af_ipv6_uc_and_vrf_cmds_call_point_holder/redistribute/connected/redistribute_connected (empty)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_redistribute_connected is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_redistribute_connected() directly.
    """
    if hasattr(v, "_utype"):
      v = v._utype(v)
    try:
      t = YANGDynClass(v,base=YANGBool, is_leaf=True, yang_name="redistribute-connected", rest_name="redistribute-connected", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'cli-run-template': u'$(.?$(../unicast-metric?\\r:$(../redistribute-route-map?\\r:redistribute connected\n)):\\r)', u'cli-drop-node-name': None}}, namespace='urn:brocade.com:mgmt:brocade-bgp', defining_module='brocade-bgp', yang_type='empty', is_config=True)
    except (TypeError, ValueError):
      raise ValueError({
          'error-string': """redistribute_connected must be of a type compatible with empty""",
          'defined-type': "empty",
          'generated-type': """YANGDynClass(base=YANGBool, is_leaf=True, yang_name="redistribute-connected", rest_name="redistribute-connected", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'cli-run-template': u'$(.?$(../unicast-metric?\\r:$(../redistribute-route-map?\\r:redistribute connected\n)):\\r)', u'cli-drop-node-name': None}}, namespace='urn:brocade.com:mgmt:brocade-bgp', defining_module='brocade-bgp', yang_type='empty', is_config=True)""",
        })

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

  def _unset_redistribute_connected(self):
    self.__redistribute_connected = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="redistribute-connected", rest_name="redistribute-connected", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'cli-run-template': u'$(.?$(../unicast-metric?\\r:$(../redistribute-route-map?\\r:redistribute connected\n)):\\r)', u'cli-drop-node-name': None}}, namespace='urn:brocade.com:mgmt:brocade-bgp', defining_module='brocade-bgp', yang_type='empty', is_config=True)


  def _get_unicast_metric(self):
    """
    Getter method for unicast_metric, mapped from YANG variable /routing_system/router/router_bgp/address_family/ipv6/ipv6_unicast/default_vrf/af_ipv6_uc_and_vrf_cmds_call_point_holder/redistribute/connected/unicast_metric (conn-metric)
    """
    return self.__unicast_metric
      
  def _set_unicast_metric(self, v, load=False):
    """
    Setter method for unicast_metric, mapped from YANG variable /routing_system/router/router_bgp/address_family/ipv6/ipv6_unicast/default_vrf/af_ipv6_uc_and_vrf_cmds_call_point_holder/redistribute/connected/unicast_metric (conn-metric)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_unicast_metric is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_unicast_metric() directly.
    """
    if hasattr(v, "_utype"):
      v = v._utype(v)
    try:
      t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), restriction_dict={'range': [u'1..4294967295']}), is_leaf=True, yang_name="unicast-metric", rest_name="metric", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'info': u'Metric for redistributed routes', u'cli-full-command': None, u'alt-name': u'metric'}}, namespace='urn:brocade.com:mgmt:brocade-bgp', defining_module='brocade-bgp', yang_type='conn-metric', is_config=True)
    except (TypeError, ValueError):
      raise ValueError({
          'error-string': """unicast_metric must be of a type compatible with conn-metric""",
          'defined-type': "brocade-bgp:conn-metric",
          'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), restriction_dict={'range': [u'1..4294967295']}), is_leaf=True, yang_name="unicast-metric", rest_name="metric", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'info': u'Metric for redistributed routes', u'cli-full-command': None, u'alt-name': u'metric'}}, namespace='urn:brocade.com:mgmt:brocade-bgp', defining_module='brocade-bgp', yang_type='conn-metric', is_config=True)""",
        })

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

  def _unset_unicast_metric(self):
    self.__unicast_metric = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), restriction_dict={'range': [u'1..4294967295']}), is_leaf=True, yang_name="unicast-metric", rest_name="metric", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'info': u'Metric for redistributed routes', u'cli-full-command': None, u'alt-name': u'metric'}}, namespace='urn:brocade.com:mgmt:brocade-bgp', defining_module='brocade-bgp', yang_type='conn-metric', is_config=True)


  def _get_redistribute_route_map(self):
    """
    Getter method for redistribute_route_map, mapped from YANG variable /routing_system/router/router_bgp/address_family/ipv6/ipv6_unicast/default_vrf/af_ipv6_uc_and_vrf_cmds_call_point_holder/redistribute/connected/redistribute_route_map (rmap-type)
    """
    return self.__redistribute_route_map
      
  def _set_redistribute_route_map(self, v, load=False):
    """
    Setter method for redistribute_route_map, mapped from YANG variable /routing_system/router/router_bgp/address_family/ipv6/ipv6_unicast/default_vrf/af_ipv6_uc_and_vrf_cmds_call_point_holder/redistribute/connected/redistribute_route_map (rmap-type)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_redistribute_route_map is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_redistribute_route_map() directly.
    """
    if hasattr(v, "_utype"):
      v = v._utype(v)
    try:
      t = YANGDynClass(v,base=RestrictedClassType(base_type=unicode, restriction_dict={'length': [u'1..63']}), is_leaf=True, yang_name="redistribute-route-map", rest_name="route-map", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'info': u'Route map reference', u'cli-full-command': None, u'alt-name': u'route-map'}}, namespace='urn:brocade.com:mgmt:brocade-bgp', defining_module='brocade-bgp', yang_type='rmap-type', is_config=True)
    except (TypeError, ValueError):
      raise ValueError({
          'error-string': """redistribute_route_map must be of a type compatible with rmap-type""",
          'defined-type': "brocade-bgp:rmap-type",
          'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=unicode, restriction_dict={'length': [u'1..63']}), is_leaf=True, yang_name="redistribute-route-map", rest_name="route-map", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'info': u'Route map reference', u'cli-full-command': None, u'alt-name': u'route-map'}}, namespace='urn:brocade.com:mgmt:brocade-bgp', defining_module='brocade-bgp', yang_type='rmap-type', is_config=True)""",
        })

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

  def _unset_redistribute_route_map(self):
    self.__redistribute_route_map = YANGDynClass(base=RestrictedClassType(base_type=unicode, restriction_dict={'length': [u'1..63']}), is_leaf=True, yang_name="redistribute-route-map", rest_name="route-map", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'info': u'Route map reference', u'cli-full-command': None, u'alt-name': u'route-map'}}, namespace='urn:brocade.com:mgmt:brocade-bgp', defining_module='brocade-bgp', yang_type='rmap-type', is_config=True)

  redistribute_connected = __builtin__.property(_get_redistribute_connected, _set_redistribute_connected)
  unicast_metric = __builtin__.property(_get_unicast_metric, _set_unicast_metric)
  redistribute_route_map = __builtin__.property(_get_redistribute_route_map, _set_redistribute_route_map)


  _pyangbind_elements = {'redistribute_connected': redistribute_connected, 'unicast_metric': unicast_metric, 'redistribute_route_map': redistribute_route_map, }
Exemple #25
0
class error_handling(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/error-handling. Each member element of
  the container is represented as a class variable - with a specific
  YANG type.

  YANG Description: Error handling parameters used for the BGP peer-group
  """
  __slots__ = ('_pybind_generated_by', '_path_helper', '_yang_name', '_extmethods', '__config','__state',)

  _yang_name = 'error-handling'

  _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=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)

    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'network-instances', u'network-instance', u'protocols', u'protocol', u'bgp', u'peer-groups', u'peer-group', u'error-handling']

  def _get_config(self):
    """
    Getter method for config, mapped from YANG variable /network_instances/network_instance/protocols/protocol/bgp/peer_groups/peer_group/error_handling/config (container)

    YANG Description: Configuration parameters enabling or modifying the
behavior or enhanced error handling mechanisms for the BGP
group
    """
    return self.__config
      
  def _set_config(self, v, load=False):
    """
    Setter method for config, mapped from YANG variable /network_instances/network_instance/protocols/protocol/bgp/peer_groups/peer_group/error_handling/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 enabling or modifying the
behavior or enhanced error handling mechanisms for the BGP
group
    """
    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/bgp/peer_groups/peer_group/error_handling/state (container)

    YANG Description: State information relating to enhanced error handling
mechanisms for the BGP group
    """
    return self.__state
      
  def _set_state(self, v, load=False):
    """
    Setter method for state, mapped from YANG variable /network_instances/network_instance/protocols/protocol/bgp/peer_groups/peer_group/error_handling/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 information relating to enhanced error handling
mechanisms for the BGP group
    """
    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 = {'config': config, 'state': state, }
Exemple #26
0
class evpn(PybindBase):
    """
  This class was auto-generated by the PythonClass plugin for PYANG
  from YANG module brocade-common-def - based on the path /routing-system/router/router-bgp/address-family/evpn. Each member element of
  the container is represented as a class variable - with a specific
  YANG type.
  """
    __slots__ = (
        '_pybind_generated_by',
        '_path_helper',
        '_yang_name',
        '_rest_name',
        '_extmethods',
        '__af_evpn_neighbor_address_holder',
    )

    _yang_name = 'evpn'
    _rest_name = 'evpn'

    _pybind_generated_by = 'container'

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

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

        extmethods = kwargs.pop("extmethods", None)
        if extmethods is False:
            self._extmethods = False
        elif extmethods is not None and isinstance(extmethods, dict):
            self._extmethods = extmethods
        elif hasattr(self, "_parent"):
            extmethods = getattr(self._parent, "_extmethods", None)
            self._extmethods = extmethods
        else:
            self._extmethods = False
        self.__af_evpn_neighbor_address_holder = YANGDynClass(
            base=af_evpn_neighbor_address_holder.
            af_evpn_neighbor_address_holder,
            is_container='container',
            presence=False,
            yang_name="af-evpn-neighbor-address-holder",
            rest_name="",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            extensions={u'tailf-common': {
                u'cli-drop-node-name': None
            }},
            namespace='urn:brocade.com:mgmt:brocade-bgp',
            defining_module='brocade-bgp',
            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'routing-system', u'router', u'router-bgp', u'address-family',
                u'evpn'
            ]

    def _rest_path(self):
        if hasattr(self, "_parent"):
            if self._rest_name:
                return self._parent._rest_path() + [self._rest_name]
            else:
                return self._parent._rest_path()
        else:
            return [u'router', u'bgp', u'address-family', u'evpn']

    def _get_af_evpn_neighbor_address_holder(self):
        """
    Getter method for af_evpn_neighbor_address_holder, mapped from YANG variable /routing_system/router/router_bgp/address_family/evpn/af_evpn_neighbor_address_holder (container)
    """
        return self.__af_evpn_neighbor_address_holder

    def _set_af_evpn_neighbor_address_holder(self, v, load=False):
        """
    Setter method for af_evpn_neighbor_address_holder, mapped from YANG variable /routing_system/router/router_bgp/address_family/evpn/af_evpn_neighbor_address_holder (container)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_af_evpn_neighbor_address_holder is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_af_evpn_neighbor_address_holder() directly.
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(
                v,
                base=af_evpn_neighbor_address_holder.
                af_evpn_neighbor_address_holder,
                is_container='container',
                presence=False,
                yang_name="af-evpn-neighbor-address-holder",
                rest_name="",
                parent=self,
                path_helper=self._path_helper,
                extmethods=self._extmethods,
                register_paths=True,
                extensions={u'tailf-common': {
                    u'cli-drop-node-name': None
                }},
                namespace='urn:brocade.com:mgmt:brocade-bgp',
                defining_module='brocade-bgp',
                yang_type='container',
                is_config=True)
        except (TypeError, ValueError):
            raise ValueError({
                'error-string':
                """af_evpn_neighbor_address_holder must be of a type compatible with container""",
                'defined-type':
                "container",
                'generated-type':
                """YANGDynClass(base=af_evpn_neighbor_address_holder.af_evpn_neighbor_address_holder, is_container='container', presence=False, yang_name="af-evpn-neighbor-address-holder", rest_name="", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'cli-drop-node-name': None}}, namespace='urn:brocade.com:mgmt:brocade-bgp', defining_module='brocade-bgp', yang_type='container', is_config=True)""",
            })

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

    def _unset_af_evpn_neighbor_address_holder(self):
        self.__af_evpn_neighbor_address_holder = YANGDynClass(
            base=af_evpn_neighbor_address_holder.
            af_evpn_neighbor_address_holder,
            is_container='container',
            presence=False,
            yang_name="af-evpn-neighbor-address-holder",
            rest_name="",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            extensions={u'tailf-common': {
                u'cli-drop-node-name': None
            }},
            namespace='urn:brocade.com:mgmt:brocade-bgp',
            defining_module='brocade-bgp',
            yang_type='container',
            is_config=True)

    af_evpn_neighbor_address_holder = __builtin__.property(
        _get_af_evpn_neighbor_address_holder,
        _set_af_evpn_neighbor_address_holder)

    _pyangbind_elements = {
        'af_evpn_neighbor_address_holder': af_evpn_neighbor_address_holder,
    }
Exemple #27
0
class ipsec(PybindBase):
    """
  This class was auto-generated by the PythonClass plugin for PYANG
  from YANG module brocade-rbridge - based on the path /rbridge-id/interface/ve/ipv6/interface-ospfv3-conf/authentication/ipsec. Each member element of
  the container is represented as a class variable - with a specific
  YANG type.

  YANG Description: Configure ipsec authentication for the interface
  """
    __slots__ = (
        '_pybind_generated_by',
        '_path_helper',
        '_yang_name',
        '_rest_name',
        '_extmethods',
        '__ipsec_authentication_disable',
        '__ifc_key_add_remove_interval',
    )

    _yang_name = 'ipsec'
    _rest_name = 'ipsec'

    _pybind_generated_by = 'container'

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

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

        extmethods = kwargs.pop("extmethods", None)
        if extmethods is False:
            self._extmethods = False
        elif extmethods is not None and isinstance(extmethods, dict):
            self._extmethods = extmethods
        elif hasattr(self, "_parent"):
            extmethods = getattr(self._parent, "_extmethods", None)
            self._extmethods = extmethods
        else:
            self._extmethods = False
        self.__ipsec_authentication_disable = YANGDynClass(
            base=YANGBool,
            is_leaf=True,
            yang_name="ipsec-authentication-disable",
            rest_name="disable",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            extensions={
                u'tailf-common': {
                    u'info': u'Disable ipsec authentication',
                    u'cli-full-command': None,
                    u'alt-name': u'disable'
                }
            },
            namespace='urn:brocade.com:mgmt:brocade-ospfv3',
            defining_module='brocade-ospfv3',
            yang_type='empty',
            is_config=True)
        self.__ifc_key_add_remove_interval = YANGDynClass(
            base=RestrictedClassType(base_type=RestrictedClassType(
                base_type=long,
                restriction_dict={'range': ['0..4294967295']},
                int_size=32),
                                     restriction_dict={'range':
                                                       [u'0..14400']}),
            is_leaf=True,
            yang_name="ifc-key-add-remove-interval",
            rest_name="key-add-remove-interval",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            extensions={
                u'tailf-common': {
                    u'cli-full-command': None,
                    u'info':
                    u'Configure OSPFv3 authentication key add/remove interval',
                    u'alt-name': u'key-add-remove-interval'
                }
            },
            namespace='urn:brocade.com:mgmt:brocade-ospfv3',
            defining_module='brocade-ospfv3',
            yang_type='common-def:time-interval-sec',
            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'rbridge-id', u'interface', u've', u'ipv6',
                u'interface-ospfv3-conf', u'authentication', u'ipsec'
            ]

    def _rest_path(self):
        if hasattr(self, "_parent"):
            if self._rest_name:
                return self._parent._rest_path() + [self._rest_name]
            else:
                return self._parent._rest_path()
        else:
            return [
                u'rbridge-id', u'interface', u'Ve', u'ipv6', u'ospf',
                u'authentication', u'ipsec'
            ]

    def _get_ipsec_authentication_disable(self):
        """
    Getter method for ipsec_authentication_disable, mapped from YANG variable /rbridge_id/interface/ve/ipv6/interface_ospfv3_conf/authentication/ipsec/ipsec_authentication_disable (empty)

    YANG Description: Disable ipsec authentication on the interface. For the purpose of troubleshooting, you can operationally disable IPsec on an interface using this command.This command disables IPsec on the interface whether its IPsec configuration is the area's IPsec configuration or is specific to that interface.
    """
        return self.__ipsec_authentication_disable

    def _set_ipsec_authentication_disable(self, v, load=False):
        """
    Setter method for ipsec_authentication_disable, mapped from YANG variable /rbridge_id/interface/ve/ipv6/interface_ospfv3_conf/authentication/ipsec/ipsec_authentication_disable (empty)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_ipsec_authentication_disable is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_ipsec_authentication_disable() directly.

    YANG Description: Disable ipsec authentication on the interface. For the purpose of troubleshooting, you can operationally disable IPsec on an interface using this command.This command disables IPsec on the interface whether its IPsec configuration is the area's IPsec configuration or is specific to that interface.
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(v,
                             base=YANGBool,
                             is_leaf=True,
                             yang_name="ipsec-authentication-disable",
                             rest_name="disable",
                             parent=self,
                             path_helper=self._path_helper,
                             extmethods=self._extmethods,
                             register_paths=True,
                             extensions={
                                 u'tailf-common': {
                                     u'info': u'Disable ipsec authentication',
                                     u'cli-full-command': None,
                                     u'alt-name': u'disable'
                                 }
                             },
                             namespace='urn:brocade.com:mgmt:brocade-ospfv3',
                             defining_module='brocade-ospfv3',
                             yang_type='empty',
                             is_config=True)
        except (TypeError, ValueError):
            raise ValueError({
                'error-string':
                """ipsec_authentication_disable must be of a type compatible with empty""",
                'defined-type':
                "empty",
                'generated-type':
                """YANGDynClass(base=YANGBool, is_leaf=True, yang_name="ipsec-authentication-disable", rest_name="disable", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'info': u'Disable ipsec authentication', u'cli-full-command': None, u'alt-name': u'disable'}}, namespace='urn:brocade.com:mgmt:brocade-ospfv3', defining_module='brocade-ospfv3', yang_type='empty', is_config=True)""",
            })

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

    def _unset_ipsec_authentication_disable(self):
        self.__ipsec_authentication_disable = YANGDynClass(
            base=YANGBool,
            is_leaf=True,
            yang_name="ipsec-authentication-disable",
            rest_name="disable",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            extensions={
                u'tailf-common': {
                    u'info': u'Disable ipsec authentication',
                    u'cli-full-command': None,
                    u'alt-name': u'disable'
                }
            },
            namespace='urn:brocade.com:mgmt:brocade-ospfv3',
            defining_module='brocade-ospfv3',
            yang_type='empty',
            is_config=True)

    def _get_ifc_key_add_remove_interval(self):
        """
    Getter method for ifc_key_add_remove_interval, mapped from YANG variable /rbridge_id/interface/ve/ipv6/interface_ospfv3_conf/authentication/ipsec/ifc_key_add_remove_interval (common-def:time-interval-sec)

    YANG Description: Used to determine the interval time when authentication addition and deletion will take effect
    """
        return self.__ifc_key_add_remove_interval

    def _set_ifc_key_add_remove_interval(self, v, load=False):
        """
    Setter method for ifc_key_add_remove_interval, mapped from YANG variable /rbridge_id/interface/ve/ipv6/interface_ospfv3_conf/authentication/ipsec/ifc_key_add_remove_interval (common-def:time-interval-sec)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_ifc_key_add_remove_interval is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_ifc_key_add_remove_interval() directly.

    YANG Description: Used to determine the interval time when authentication addition and deletion will take effect
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(
                v,
                base=RestrictedClassType(
                    base_type=RestrictedClassType(
                        base_type=long,
                        restriction_dict={'range': ['0..4294967295']},
                        int_size=32),
                    restriction_dict={'range': [u'0..14400']}),
                is_leaf=True,
                yang_name="ifc-key-add-remove-interval",
                rest_name="key-add-remove-interval",
                parent=self,
                path_helper=self._path_helper,
                extmethods=self._extmethods,
                register_paths=True,
                extensions={
                    u'tailf-common': {
                        u'cli-full-command': None,
                        u'info':
                        u'Configure OSPFv3 authentication key add/remove interval',
                        u'alt-name': u'key-add-remove-interval'
                    }
                },
                namespace='urn:brocade.com:mgmt:brocade-ospfv3',
                defining_module='brocade-ospfv3',
                yang_type='common-def:time-interval-sec',
                is_config=True)
        except (TypeError, ValueError):
            raise ValueError({
                'error-string':
                """ifc_key_add_remove_interval must be of a type compatible with common-def:time-interval-sec""",
                'defined-type':
                "common-def:time-interval-sec",
                'generated-type':
                """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), restriction_dict={'range': [u'0..14400']}), is_leaf=True, yang_name="ifc-key-add-remove-interval", rest_name="key-add-remove-interval", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'cli-full-command': None, u'info': u'Configure OSPFv3 authentication key add/remove interval', u'alt-name': u'key-add-remove-interval'}}, namespace='urn:brocade.com:mgmt:brocade-ospfv3', defining_module='brocade-ospfv3', yang_type='common-def:time-interval-sec', is_config=True)""",
            })

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

    def _unset_ifc_key_add_remove_interval(self):
        self.__ifc_key_add_remove_interval = YANGDynClass(
            base=RestrictedClassType(base_type=RestrictedClassType(
                base_type=long,
                restriction_dict={'range': ['0..4294967295']},
                int_size=32),
                                     restriction_dict={'range':
                                                       [u'0..14400']}),
            is_leaf=True,
            yang_name="ifc-key-add-remove-interval",
            rest_name="key-add-remove-interval",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            extensions={
                u'tailf-common': {
                    u'cli-full-command': None,
                    u'info':
                    u'Configure OSPFv3 authentication key add/remove interval',
                    u'alt-name': u'key-add-remove-interval'
                }
            },
            namespace='urn:brocade.com:mgmt:brocade-ospfv3',
            defining_module='brocade-ospfv3',
            yang_type='common-def:time-interval-sec',
            is_config=True)

    ipsec_authentication_disable = __builtin__.property(
        _get_ipsec_authentication_disable, _set_ipsec_authentication_disable)
    ifc_key_add_remove_interval = __builtin__.property(
        _get_ifc_key_add_remove_interval, _set_ifc_key_add_remove_interval)

    _pyangbind_elements = {
        'ipsec_authentication_disable': ipsec_authentication_disable,
        'ifc_key_add_remove_interval': ifc_key_add_remove_interval,
    }
Exemple #28
0
class ip(PybindBase):
    """
  This class was auto-generated by the PythonClass plugin for PYANG
  from YANG module brocade-interface - based on the path /interface/management/ip. Each member element of
  the container is represented as a class variable - with a specific
  YANG type.

  YANG Description: The IPv4 configurations for this management 
interface.
  """
    __slots__ = (
        '_pybind_generated_by',
        '_path_helper',
        '_yang_name',
        '_rest_name',
        '_extmethods',
        '__icmp',
        '__address',
        '__gateway',
        '__oper_address',
        '__oper_gateway_con',
        '__access_group',
    )

    _yang_name = 'ip'
    _rest_name = 'ip'

    _pybind_generated_by = 'container'

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

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

        extmethods = kwargs.pop("extmethods", None)
        if extmethods is False:
            self._extmethods = False
        elif extmethods is not None and isinstance(extmethods, dict):
            self._extmethods = extmethods
        elif hasattr(self, "_parent"):
            extmethods = getattr(self._parent, "_extmethods", None)
            self._extmethods = extmethods
        else:
            self._extmethods = False
        self.__oper_address = YANGDynClass(
            base=oper_address.oper_address,
            is_container='container',
            presence=False,
            yang_name="oper-address",
            rest_name="address",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            extensions={u'tailf-common': {
                u'alt-name': u'address'
            }},
            namespace='urn:brocade.com:mgmt:brocade-interface',
            defining_module='brocade-interface',
            yang_type='container',
            is_config=True)
        self.__oper_gateway_con = YANGDynClass(
            base=oper_gateway_con.oper_gateway_con,
            is_container='container',
            presence=False,
            yang_name="oper-gateway-con",
            rest_name="",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            extensions={u'tailf-common': {
                u'cli-drop-node-name': None
            }},
            namespace='urn:brocade.com:mgmt:brocade-interface',
            defining_module='brocade-interface',
            yang_type='container',
            is_config=True)
        self.__access_group = YANGDynClass(
            base=access_group.access_group,
            is_container='container',
            presence=False,
            yang_name="access-group",
            rest_name="access-group",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            extensions={
                u'tailf-common': {
                    u'info': u'Configure IP Access group',
                    u'sort-priority': u'113',
                    u'cli-compact-syntax': None,
                    u'cli-sequence-commands': None,
                    u'cli-incomplete-no': None,
                    u'callpoint': u'ip_acl_config_cp'
                }
            },
            namespace='urn:brocade.com:mgmt:brocade-ip-access-list',
            defining_module='brocade-ip-access-list',
            yang_type='container',
            is_config=True)
        self.__address = YANGDynClass(
            base=address.address,
            is_container='container',
            presence=False,
            yang_name="address",
            rest_name="address",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            extensions={
                u'tailf-common': {
                    u'info':
                    u'The IPv4 address configuration for this \nmanagement interface.'
                }
            },
            namespace='urn:brocade.com:mgmt:brocade-interface',
            defining_module='brocade-interface',
            yang_type='container',
            is_config=True)
        self.__icmp = YANGDynClass(
            base=icmp.icmp,
            is_container='container',
            presence=False,
            yang_name="icmp",
            rest_name="icmp",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            extensions={
                u'tailf-common': {
                    u'info': u'The ICMP control for this management interface.'
                }
            },
            namespace='urn:brocade.com:mgmt:brocade-interface',
            defining_module='brocade-interface',
            yang_type='container',
            is_config=True)
        self.__gateway = YANGDynClass(
            base=gateway.gateway,
            is_container='container',
            presence=False,
            yang_name="gateway",
            rest_name="",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            extensions={
                u'tailf-common': {
                    u'info':
                    u'The IP gateway configurations for this \nmanagement interface.',
                    u'cli-drop-node-name': None,
                    u'hidden': u'full'
                }
            },
            namespace='urn:brocade.com:mgmt:brocade-interface',
            defining_module='brocade-interface',
            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'interface', u'management', u'ip']

    def _rest_path(self):
        if hasattr(self, "_parent"):
            if self._rest_name:
                return self._parent._rest_path() + [self._rest_name]
            else:
                return self._parent._rest_path()
        else:
            return [u'interface', u'Management', u'ip']

    def _get_icmp(self):
        """
    Getter method for icmp, mapped from YANG variable /interface/management/ip/icmp (container)

    YANG Description: The ICMP control for this management interface.
    """
        return self.__icmp

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

    YANG Description: The ICMP control for this management interface.
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(
                v,
                base=icmp.icmp,
                is_container='container',
                presence=False,
                yang_name="icmp",
                rest_name="icmp",
                parent=self,
                path_helper=self._path_helper,
                extmethods=self._extmethods,
                register_paths=True,
                extensions={
                    u'tailf-common': {
                        u'info':
                        u'The ICMP control for this management interface.'
                    }
                },
                namespace='urn:brocade.com:mgmt:brocade-interface',
                defining_module='brocade-interface',
                yang_type='container',
                is_config=True)
        except (TypeError, ValueError):
            raise ValueError({
                'error-string':
                """icmp must be of a type compatible with container""",
                'defined-type':
                "container",
                'generated-type':
                """YANGDynClass(base=icmp.icmp, is_container='container', presence=False, yang_name="icmp", rest_name="icmp", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'info': u'The ICMP control for this management interface.'}}, namespace='urn:brocade.com:mgmt:brocade-interface', defining_module='brocade-interface', yang_type='container', is_config=True)""",
            })

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

    def _unset_icmp(self):
        self.__icmp = YANGDynClass(
            base=icmp.icmp,
            is_container='container',
            presence=False,
            yang_name="icmp",
            rest_name="icmp",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            extensions={
                u'tailf-common': {
                    u'info': u'The ICMP control for this management interface.'
                }
            },
            namespace='urn:brocade.com:mgmt:brocade-interface',
            defining_module='brocade-interface',
            yang_type='container',
            is_config=True)

    def _get_address(self):
        """
    Getter method for address, mapped from YANG variable /interface/management/ip/address (container)

    YANG Description: The IPv4 address configuration for this 
management interface.
    """
        return self.__address

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

    YANG Description: The IPv4 address configuration for this 
management interface.
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(
                v,
                base=address.address,
                is_container='container',
                presence=False,
                yang_name="address",
                rest_name="address",
                parent=self,
                path_helper=self._path_helper,
                extmethods=self._extmethods,
                register_paths=True,
                extensions={
                    u'tailf-common': {
                        u'info':
                        u'The IPv4 address configuration for this \nmanagement interface.'
                    }
                },
                namespace='urn:brocade.com:mgmt:brocade-interface',
                defining_module='brocade-interface',
                yang_type='container',
                is_config=True)
        except (TypeError, ValueError):
            raise ValueError({
                'error-string':
                """address must be of a type compatible with container""",
                'defined-type':
                "container",
                'generated-type':
                """YANGDynClass(base=address.address, is_container='container', presence=False, yang_name="address", rest_name="address", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'info': u'The IPv4 address configuration for this \nmanagement interface.'}}, namespace='urn:brocade.com:mgmt:brocade-interface', defining_module='brocade-interface', yang_type='container', is_config=True)""",
            })

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

    def _unset_address(self):
        self.__address = YANGDynClass(
            base=address.address,
            is_container='container',
            presence=False,
            yang_name="address",
            rest_name="address",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            extensions={
                u'tailf-common': {
                    u'info':
                    u'The IPv4 address configuration for this \nmanagement interface.'
                }
            },
            namespace='urn:brocade.com:mgmt:brocade-interface',
            defining_module='brocade-interface',
            yang_type='container',
            is_config=True)

    def _get_gateway(self):
        """
    Getter method for gateway, mapped from YANG variable /interface/management/ip/gateway (container)

    YANG Description: The IP gateway configurations for this 
management interface.
    """
        return self.__gateway

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

    YANG Description: The IP gateway configurations for this 
management interface.
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(
                v,
                base=gateway.gateway,
                is_container='container',
                presence=False,
                yang_name="gateway",
                rest_name="",
                parent=self,
                path_helper=self._path_helper,
                extmethods=self._extmethods,
                register_paths=True,
                extensions={
                    u'tailf-common': {
                        u'info':
                        u'The IP gateway configurations for this \nmanagement interface.',
                        u'cli-drop-node-name': None,
                        u'hidden': u'full'
                    }
                },
                namespace='urn:brocade.com:mgmt:brocade-interface',
                defining_module='brocade-interface',
                yang_type='container',
                is_config=True)
        except (TypeError, ValueError):
            raise ValueError({
                'error-string':
                """gateway must be of a type compatible with container""",
                'defined-type':
                "container",
                'generated-type':
                """YANGDynClass(base=gateway.gateway, is_container='container', presence=False, yang_name="gateway", rest_name="", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'info': u'The IP gateway configurations for this \nmanagement interface.', u'cli-drop-node-name': None, u'hidden': u'full'}}, namespace='urn:brocade.com:mgmt:brocade-interface', defining_module='brocade-interface', yang_type='container', is_config=True)""",
            })

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

    def _unset_gateway(self):
        self.__gateway = YANGDynClass(
            base=gateway.gateway,
            is_container='container',
            presence=False,
            yang_name="gateway",
            rest_name="",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            extensions={
                u'tailf-common': {
                    u'info':
                    u'The IP gateway configurations for this \nmanagement interface.',
                    u'cli-drop-node-name': None,
                    u'hidden': u'full'
                }
            },
            namespace='urn:brocade.com:mgmt:brocade-interface',
            defining_module='brocade-interface',
            yang_type='container',
            is_config=True)

    def _get_oper_address(self):
        """
    Getter method for oper_address, mapped from YANG variable /interface/management/ip/oper_address (container)
    """
        return self.__oper_address

    def _set_oper_address(self, v, load=False):
        """
    Setter method for oper_address, mapped from YANG variable /interface/management/ip/oper_address (container)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_oper_address is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_oper_address() directly.
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(
                v,
                base=oper_address.oper_address,
                is_container='container',
                presence=False,
                yang_name="oper-address",
                rest_name="address",
                parent=self,
                path_helper=self._path_helper,
                extmethods=self._extmethods,
                register_paths=True,
                extensions={u'tailf-common': {
                    u'alt-name': u'address'
                }},
                namespace='urn:brocade.com:mgmt:brocade-interface',
                defining_module='brocade-interface',
                yang_type='container',
                is_config=True)
        except (TypeError, ValueError):
            raise ValueError({
                'error-string':
                """oper_address must be of a type compatible with container""",
                'defined-type':
                "container",
                'generated-type':
                """YANGDynClass(base=oper_address.oper_address, is_container='container', presence=False, yang_name="oper-address", rest_name="address", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'alt-name': u'address'}}, namespace='urn:brocade.com:mgmt:brocade-interface', defining_module='brocade-interface', yang_type='container', is_config=True)""",
            })

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

    def _unset_oper_address(self):
        self.__oper_address = YANGDynClass(
            base=oper_address.oper_address,
            is_container='container',
            presence=False,
            yang_name="oper-address",
            rest_name="address",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            extensions={u'tailf-common': {
                u'alt-name': u'address'
            }},
            namespace='urn:brocade.com:mgmt:brocade-interface',
            defining_module='brocade-interface',
            yang_type='container',
            is_config=True)

    def _get_oper_gateway_con(self):
        """
    Getter method for oper_gateway_con, mapped from YANG variable /interface/management/ip/oper_gateway_con (container)
    """
        return self.__oper_gateway_con

    def _set_oper_gateway_con(self, v, load=False):
        """
    Setter method for oper_gateway_con, mapped from YANG variable /interface/management/ip/oper_gateway_con (container)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_oper_gateway_con is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_oper_gateway_con() directly.
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(
                v,
                base=oper_gateway_con.oper_gateway_con,
                is_container='container',
                presence=False,
                yang_name="oper-gateway-con",
                rest_name="",
                parent=self,
                path_helper=self._path_helper,
                extmethods=self._extmethods,
                register_paths=True,
                extensions={u'tailf-common': {
                    u'cli-drop-node-name': None
                }},
                namespace='urn:brocade.com:mgmt:brocade-interface',
                defining_module='brocade-interface',
                yang_type='container',
                is_config=True)
        except (TypeError, ValueError):
            raise ValueError({
                'error-string':
                """oper_gateway_con must be of a type compatible with container""",
                'defined-type':
                "container",
                'generated-type':
                """YANGDynClass(base=oper_gateway_con.oper_gateway_con, is_container='container', presence=False, yang_name="oper-gateway-con", rest_name="", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'cli-drop-node-name': None}}, namespace='urn:brocade.com:mgmt:brocade-interface', defining_module='brocade-interface', yang_type='container', is_config=True)""",
            })

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

    def _unset_oper_gateway_con(self):
        self.__oper_gateway_con = YANGDynClass(
            base=oper_gateway_con.oper_gateway_con,
            is_container='container',
            presence=False,
            yang_name="oper-gateway-con",
            rest_name="",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            extensions={u'tailf-common': {
                u'cli-drop-node-name': None
            }},
            namespace='urn:brocade.com:mgmt:brocade-interface',
            defining_module='brocade-interface',
            yang_type='container',
            is_config=True)

    def _get_access_group(self):
        """
    Getter method for access_group, mapped from YANG variable /interface/management/ip/access_group (container)
    """
        return self.__access_group

    def _set_access_group(self, v, load=False):
        """
    Setter method for access_group, mapped from YANG variable /interface/management/ip/access_group (container)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_access_group is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_access_group() directly.
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(
                v,
                base=access_group.access_group,
                is_container='container',
                presence=False,
                yang_name="access-group",
                rest_name="access-group",
                parent=self,
                path_helper=self._path_helper,
                extmethods=self._extmethods,
                register_paths=True,
                extensions={
                    u'tailf-common': {
                        u'info': u'Configure IP Access group',
                        u'sort-priority': u'113',
                        u'cli-compact-syntax': None,
                        u'cli-sequence-commands': None,
                        u'cli-incomplete-no': None,
                        u'callpoint': u'ip_acl_config_cp'
                    }
                },
                namespace='urn:brocade.com:mgmt:brocade-ip-access-list',
                defining_module='brocade-ip-access-list',
                yang_type='container',
                is_config=True)
        except (TypeError, ValueError):
            raise ValueError({
                'error-string':
                """access_group must be of a type compatible with container""",
                'defined-type':
                "container",
                'generated-type':
                """YANGDynClass(base=access_group.access_group, is_container='container', presence=False, yang_name="access-group", rest_name="access-group", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'info': u'Configure IP Access group', u'sort-priority': u'113', u'cli-compact-syntax': None, u'cli-sequence-commands': None, u'cli-incomplete-no': None, u'callpoint': u'ip_acl_config_cp'}}, namespace='urn:brocade.com:mgmt:brocade-ip-access-list', defining_module='brocade-ip-access-list', yang_type='container', is_config=True)""",
            })

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

    def _unset_access_group(self):
        self.__access_group = YANGDynClass(
            base=access_group.access_group,
            is_container='container',
            presence=False,
            yang_name="access-group",
            rest_name="access-group",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            extensions={
                u'tailf-common': {
                    u'info': u'Configure IP Access group',
                    u'sort-priority': u'113',
                    u'cli-compact-syntax': None,
                    u'cli-sequence-commands': None,
                    u'cli-incomplete-no': None,
                    u'callpoint': u'ip_acl_config_cp'
                }
            },
            namespace='urn:brocade.com:mgmt:brocade-ip-access-list',
            defining_module='brocade-ip-access-list',
            yang_type='container',
            is_config=True)

    icmp = __builtin__.property(_get_icmp, _set_icmp)
    address = __builtin__.property(_get_address, _set_address)
    gateway = __builtin__.property(_get_gateway, _set_gateway)
    oper_address = __builtin__.property(_get_oper_address, _set_oper_address)
    oper_gateway_con = __builtin__.property(_get_oper_gateway_con,
                                            _set_oper_gateway_con)
    access_group = __builtin__.property(_get_access_group, _set_access_group)

    _pyangbind_elements = {
        'icmp': icmp,
        'address': address,
        'gateway': gateway,
        'oper_address': oper_address,
        'oper_gateway_con': oper_gateway_con,
        'access_group': access_group,
    }
Exemple #29
0
class prefix_list(PybindBase):
    """
  This class was auto-generated by the PythonClass plugin for PYANG
  from YANG module brocade-common-def - based on the path /routing-system/router/router-bgp/address-family/vpnv4/vpnv4-unicast/af-vpnv4-neighbor-address-holder/af-vpnv4-neighbor/af-neighbor-capability/orf/prefix-list. Each member element of
  the container is represented as a class variable - with a specific
  YANG type.
  """
    __slots__ = (
        '_pybind_generated_by',
        '_path_helper',
        '_yang_name',
        '_rest_name',
        '_extmethods',
        '__prefixlist_status',
        '__prefixlist_send',
        '__prefixlist_receive',
    )

    _yang_name = 'prefix-list'
    _rest_name = 'prefix-list'

    _pybind_generated_by = 'container'

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

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

        extmethods = kwargs.pop("extmethods", None)
        if extmethods is False:
            self._extmethods = False
        elif extmethods is not None and isinstance(extmethods, dict):
            self._extmethods = extmethods
        elif hasattr(self, "_parent"):
            extmethods = getattr(self._parent, "_extmethods", None)
            self._extmethods = extmethods
        else:
            self._extmethods = False
        self.__prefixlist_status = YANGDynClass(
            base=YANGBool,
            is_leaf=True,
            yang_name="prefixlist-status",
            rest_name="prefixlist-status",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            extensions={
                u'tailf-common': {
                    u'cli-run-template':
                    u'$(.?$(../prefixlist-send?$(../prefixlist-receive?neighbor $(../../af-vpnv4-neighbor-address) capability orf prefixlist\n:\\r):\\r):\\r)',
                    u'cli-drop-node-name': None
                }
            },
            namespace='urn:brocade.com:mgmt:brocade-bgp',
            defining_module='brocade-bgp',
            yang_type='empty',
            is_config=True)
        self.__prefixlist_receive = YANGDynClass(
            base=YANGBool,
            is_leaf=True,
            yang_name="prefixlist-receive",
            rest_name="receive",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            extensions={
                u'tailf-common': {
                    u'cli-full-command': None,
                    u'cli-run-template':
                    u'$(.?$(../prefixlist-send?\\r:neighbor $(../../af-vpnv4-neighbor-address) capability orf prefixlist receive\n):\\r)',
                    u'alt-name': u'receive',
                    u'info':
                    u'Capability to RECEIVE the ORF from this neighbor'
                }
            },
            namespace='urn:brocade.com:mgmt:brocade-bgp',
            defining_module='brocade-bgp',
            yang_type='empty',
            is_config=True)
        self.__prefixlist_send = YANGDynClass(
            base=YANGBool,
            is_leaf=True,
            yang_name="prefixlist-send",
            rest_name="send",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            extensions={
                u'tailf-common': {
                    u'cli-full-command': None,
                    u'cli-run-template':
                    u'$(.?$(../prefixlist-receive?\\r:neighbor $(../../af-vpnv4-neighbor-address) capability orf prefixlist send\n):\\r)',
                    u'alt-name': u'send',
                    u'info': u'Capability to SEND the ORF to this neighbor'
                }
            },
            namespace='urn:brocade.com:mgmt:brocade-bgp',
            defining_module='brocade-bgp',
            yang_type='empty',
            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'routing-system', u'router', u'router-bgp', u'address-family',
                u'vpnv4', u'vpnv4-unicast',
                u'af-vpnv4-neighbor-address-holder', u'af-vpnv4-neighbor',
                u'af-neighbor-capability', u'orf', u'prefix-list'
            ]

    def _rest_path(self):
        if hasattr(self, "_parent"):
            if self._rest_name:
                return self._parent._rest_path() + [self._rest_name]
            else:
                return self._parent._rest_path()
        else:
            return [
                u'router', u'bgp', u'address-family', u'vpnv4', u'unicast',
                u'neighbor', u'capability', u'orf', u'prefix-list'
            ]

    def _get_prefixlist_status(self):
        """
    Getter method for prefixlist_status, mapped from YANG variable /routing_system/router/router_bgp/address_family/vpnv4/vpnv4_unicast/af_vpnv4_neighbor_address_holder/af_vpnv4_neighbor/af_neighbor_capability/orf/prefix_list/prefixlist_status (empty)

    YANG Description: This element will be set if either(or both) send,receive options are configured
    """
        return self.__prefixlist_status

    def _set_prefixlist_status(self, v, load=False):
        """
    Setter method for prefixlist_status, mapped from YANG variable /routing_system/router/router_bgp/address_family/vpnv4/vpnv4_unicast/af_vpnv4_neighbor_address_holder/af_vpnv4_neighbor/af_neighbor_capability/orf/prefix_list/prefixlist_status (empty)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_prefixlist_status is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_prefixlist_status() directly.

    YANG Description: This element will be set if either(or both) send,receive options are configured
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(
                v,
                base=YANGBool,
                is_leaf=True,
                yang_name="prefixlist-status",
                rest_name="prefixlist-status",
                parent=self,
                path_helper=self._path_helper,
                extmethods=self._extmethods,
                register_paths=True,
                extensions={
                    u'tailf-common': {
                        u'cli-run-template':
                        u'$(.?$(../prefixlist-send?$(../prefixlist-receive?neighbor $(../../af-vpnv4-neighbor-address) capability orf prefixlist\n:\\r):\\r):\\r)',
                        u'cli-drop-node-name': None
                    }
                },
                namespace='urn:brocade.com:mgmt:brocade-bgp',
                defining_module='brocade-bgp',
                yang_type='empty',
                is_config=True)
        except (TypeError, ValueError):
            raise ValueError({
                'error-string':
                """prefixlist_status must be of a type compatible with empty""",
                'defined-type':
                "empty",
                'generated-type':
                """YANGDynClass(base=YANGBool, is_leaf=True, yang_name="prefixlist-status", rest_name="prefixlist-status", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'cli-run-template': u'$(.?$(../prefixlist-send?$(../prefixlist-receive?neighbor $(../../af-vpnv4-neighbor-address) capability orf prefixlist\n:\\r):\\r):\\r)', u'cli-drop-node-name': None}}, namespace='urn:brocade.com:mgmt:brocade-bgp', defining_module='brocade-bgp', yang_type='empty', is_config=True)""",
            })

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

    def _unset_prefixlist_status(self):
        self.__prefixlist_status = YANGDynClass(
            base=YANGBool,
            is_leaf=True,
            yang_name="prefixlist-status",
            rest_name="prefixlist-status",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            extensions={
                u'tailf-common': {
                    u'cli-run-template':
                    u'$(.?$(../prefixlist-send?$(../prefixlist-receive?neighbor $(../../af-vpnv4-neighbor-address) capability orf prefixlist\n:\\r):\\r):\\r)',
                    u'cli-drop-node-name': None
                }
            },
            namespace='urn:brocade.com:mgmt:brocade-bgp',
            defining_module='brocade-bgp',
            yang_type='empty',
            is_config=True)

    def _get_prefixlist_send(self):
        """
    Getter method for prefixlist_send, mapped from YANG variable /routing_system/router/router_bgp/address_family/vpnv4/vpnv4_unicast/af_vpnv4_neighbor_address_holder/af_vpnv4_neighbor/af_neighbor_capability/orf/prefix_list/prefixlist_send (empty)

    YANG Description: Capability to SEND the ORF to this neighbor
    """
        return self.__prefixlist_send

    def _set_prefixlist_send(self, v, load=False):
        """
    Setter method for prefixlist_send, mapped from YANG variable /routing_system/router/router_bgp/address_family/vpnv4/vpnv4_unicast/af_vpnv4_neighbor_address_holder/af_vpnv4_neighbor/af_neighbor_capability/orf/prefix_list/prefixlist_send (empty)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_prefixlist_send is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_prefixlist_send() directly.

    YANG Description: Capability to SEND the ORF to this neighbor
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(
                v,
                base=YANGBool,
                is_leaf=True,
                yang_name="prefixlist-send",
                rest_name="send",
                parent=self,
                path_helper=self._path_helper,
                extmethods=self._extmethods,
                register_paths=True,
                extensions={
                    u'tailf-common': {
                        u'cli-full-command': None,
                        u'cli-run-template':
                        u'$(.?$(../prefixlist-receive?\\r:neighbor $(../../af-vpnv4-neighbor-address) capability orf prefixlist send\n):\\r)',
                        u'alt-name': u'send',
                        u'info': u'Capability to SEND the ORF to this neighbor'
                    }
                },
                namespace='urn:brocade.com:mgmt:brocade-bgp',
                defining_module='brocade-bgp',
                yang_type='empty',
                is_config=True)
        except (TypeError, ValueError):
            raise ValueError({
                'error-string':
                """prefixlist_send must be of a type compatible with empty""",
                'defined-type':
                "empty",
                'generated-type':
                """YANGDynClass(base=YANGBool, is_leaf=True, yang_name="prefixlist-send", rest_name="send", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'cli-full-command': None, u'cli-run-template': u'$(.?$(../prefixlist-receive?\\r:neighbor $(../../af-vpnv4-neighbor-address) capability orf prefixlist send\n):\\r)', u'alt-name': u'send', u'info': u'Capability to SEND the ORF to this neighbor'}}, namespace='urn:brocade.com:mgmt:brocade-bgp', defining_module='brocade-bgp', yang_type='empty', is_config=True)""",
            })

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

    def _unset_prefixlist_send(self):
        self.__prefixlist_send = YANGDynClass(
            base=YANGBool,
            is_leaf=True,
            yang_name="prefixlist-send",
            rest_name="send",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            extensions={
                u'tailf-common': {
                    u'cli-full-command': None,
                    u'cli-run-template':
                    u'$(.?$(../prefixlist-receive?\\r:neighbor $(../../af-vpnv4-neighbor-address) capability orf prefixlist send\n):\\r)',
                    u'alt-name': u'send',
                    u'info': u'Capability to SEND the ORF to this neighbor'
                }
            },
            namespace='urn:brocade.com:mgmt:brocade-bgp',
            defining_module='brocade-bgp',
            yang_type='empty',
            is_config=True)

    def _get_prefixlist_receive(self):
        """
    Getter method for prefixlist_receive, mapped from YANG variable /routing_system/router/router_bgp/address_family/vpnv4/vpnv4_unicast/af_vpnv4_neighbor_address_holder/af_vpnv4_neighbor/af_neighbor_capability/orf/prefix_list/prefixlist_receive (empty)

    YANG Description: Capability to RECEIVE the ORF from this neighbor
    """
        return self.__prefixlist_receive

    def _set_prefixlist_receive(self, v, load=False):
        """
    Setter method for prefixlist_receive, mapped from YANG variable /routing_system/router/router_bgp/address_family/vpnv4/vpnv4_unicast/af_vpnv4_neighbor_address_holder/af_vpnv4_neighbor/af_neighbor_capability/orf/prefix_list/prefixlist_receive (empty)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_prefixlist_receive is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_prefixlist_receive() directly.

    YANG Description: Capability to RECEIVE the ORF from this neighbor
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(
                v,
                base=YANGBool,
                is_leaf=True,
                yang_name="prefixlist-receive",
                rest_name="receive",
                parent=self,
                path_helper=self._path_helper,
                extmethods=self._extmethods,
                register_paths=True,
                extensions={
                    u'tailf-common': {
                        u'cli-full-command':
                        None,
                        u'cli-run-template':
                        u'$(.?$(../prefixlist-send?\\r:neighbor $(../../af-vpnv4-neighbor-address) capability orf prefixlist receive\n):\\r)',
                        u'alt-name':
                        u'receive',
                        u'info':
                        u'Capability to RECEIVE the ORF from this neighbor'
                    }
                },
                namespace='urn:brocade.com:mgmt:brocade-bgp',
                defining_module='brocade-bgp',
                yang_type='empty',
                is_config=True)
        except (TypeError, ValueError):
            raise ValueError({
                'error-string':
                """prefixlist_receive must be of a type compatible with empty""",
                'defined-type':
                "empty",
                'generated-type':
                """YANGDynClass(base=YANGBool, is_leaf=True, yang_name="prefixlist-receive", rest_name="receive", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'cli-full-command': None, u'cli-run-template': u'$(.?$(../prefixlist-send?\\r:neighbor $(../../af-vpnv4-neighbor-address) capability orf prefixlist receive\n):\\r)', u'alt-name': u'receive', u'info': u'Capability to RECEIVE the ORF from this neighbor'}}, namespace='urn:brocade.com:mgmt:brocade-bgp', defining_module='brocade-bgp', yang_type='empty', is_config=True)""",
            })

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

    def _unset_prefixlist_receive(self):
        self.__prefixlist_receive = YANGDynClass(
            base=YANGBool,
            is_leaf=True,
            yang_name="prefixlist-receive",
            rest_name="receive",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            extensions={
                u'tailf-common': {
                    u'cli-full-command': None,
                    u'cli-run-template':
                    u'$(.?$(../prefixlist-send?\\r:neighbor $(../../af-vpnv4-neighbor-address) capability orf prefixlist receive\n):\\r)',
                    u'alt-name': u'receive',
                    u'info':
                    u'Capability to RECEIVE the ORF from this neighbor'
                }
            },
            namespace='urn:brocade.com:mgmt:brocade-bgp',
            defining_module='brocade-bgp',
            yang_type='empty',
            is_config=True)

    prefixlist_status = __builtin__.property(_get_prefixlist_status,
                                             _set_prefixlist_status)
    prefixlist_send = __builtin__.property(_get_prefixlist_send,
                                           _set_prefixlist_send)
    prefixlist_receive = __builtin__.property(_get_prefixlist_receive,
                                              _set_prefixlist_receive)

    _pyangbind_elements = {
        'prefixlist_status': prefixlist_status,
        'prefixlist_send': prefixlist_send,
        'prefixlist_receive': prefixlist_receive,
    }
Exemple #30
0
class qos_mpls(PybindBase):
    """
  This class was auto-generated by the PythonClass plugin for PYANG
  from YANG module brocade-qos-mpls - based on the path /qos-mpls. Each member element of
  the container is represented as a class variable - with a specific
  YANG type.
  """
    __slots__ = (
        '_pybind_generated_by',
        '_path_helper',
        '_yang_name',
        '_rest_name',
        '_extmethods',
        '__map_',
        '__map_apply',
    )

    _yang_name = 'qos-mpls'
    _rest_name = 'qos-mpls'

    _pybind_generated_by = 'container'

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

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

        extmethods = kwargs.pop("extmethods", None)
        if extmethods is False:
            self._extmethods = False
        elif extmethods is not None and isinstance(extmethods, dict):
            self._extmethods = extmethods
        elif hasattr(self, "_parent"):
            extmethods = getattr(self._parent, "_extmethods", None)
            self._extmethods = extmethods
        else:
            self._extmethods = False
        self.__map_ = YANGDynClass(
            base=map_.map_,
            is_container='container',
            presence=False,
            yang_name="map",
            rest_name="map",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            extensions={u'tailf-common': {
                u'info': u'Configure MPLS QoS map'
            }},
            namespace='urn:brocade.com:mgmt:brocade-qos-mpls',
            defining_module='brocade-qos-mpls',
            yang_type='container',
            is_config=True)
        self.__map_apply = YANGDynClass(
            base=map_apply.map_apply,
            is_container='container',
            presence=False,
            yang_name="map-apply",
            rest_name="map-apply",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            extensions={
                u'tailf-common': {
                    u'info': u'Configure apply map',
                    u'callpoint': u'ApplyQosMplsCallpoint',
                    u'sort-priority': u'58'
                }
            },
            namespace='urn:brocade.com:mgmt:brocade-apply-qos-mpls',
            defining_module='brocade-apply-qos-mpls',
            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'qos-mpls']

    def _rest_path(self):
        if hasattr(self, "_parent"):
            if self._rest_name:
                return self._parent._rest_path() + [self._rest_name]
            else:
                return self._parent._rest_path()
        else:
            return [u'qos-mpls']

    def _get_map_(self):
        """
    Getter method for map_, mapped from YANG variable /qos_mpls/map (container)
    """
        return self.__map_

    def _set_map_(self, v, load=False):
        """
    Setter method for map_, mapped from YANG variable /qos_mpls/map (container)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_map_ is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_map_() directly.
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(v,
                             base=map_.map_,
                             is_container='container',
                             presence=False,
                             yang_name="map",
                             rest_name="map",
                             parent=self,
                             path_helper=self._path_helper,
                             extmethods=self._extmethods,
                             register_paths=True,
                             extensions={
                                 u'tailf-common': {
                                     u'info': u'Configure MPLS QoS map'
                                 }
                             },
                             namespace='urn:brocade.com:mgmt:brocade-qos-mpls',
                             defining_module='brocade-qos-mpls',
                             yang_type='container',
                             is_config=True)
        except (TypeError, ValueError):
            raise ValueError({
                'error-string':
                """map_ must be of a type compatible with container""",
                'defined-type':
                "container",
                'generated-type':
                """YANGDynClass(base=map_.map_, is_container='container', presence=False, yang_name="map", rest_name="map", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'info': u'Configure MPLS QoS map'}}, namespace='urn:brocade.com:mgmt:brocade-qos-mpls', defining_module='brocade-qos-mpls', yang_type='container', is_config=True)""",
            })

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

    def _unset_map_(self):
        self.__map_ = YANGDynClass(
            base=map_.map_,
            is_container='container',
            presence=False,
            yang_name="map",
            rest_name="map",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            extensions={u'tailf-common': {
                u'info': u'Configure MPLS QoS map'
            }},
            namespace='urn:brocade.com:mgmt:brocade-qos-mpls',
            defining_module='brocade-qos-mpls',
            yang_type='container',
            is_config=True)

    def _get_map_apply(self):
        """
    Getter method for map_apply, mapped from YANG variable /qos_mpls/map_apply (container)
    """
        return self.__map_apply

    def _set_map_apply(self, v, load=False):
        """
    Setter method for map_apply, mapped from YANG variable /qos_mpls/map_apply (container)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_map_apply is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_map_apply() directly.
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(
                v,
                base=map_apply.map_apply,
                is_container='container',
                presence=False,
                yang_name="map-apply",
                rest_name="map-apply",
                parent=self,
                path_helper=self._path_helper,
                extmethods=self._extmethods,
                register_paths=True,
                extensions={
                    u'tailf-common': {
                        u'info': u'Configure apply map',
                        u'callpoint': u'ApplyQosMplsCallpoint',
                        u'sort-priority': u'58'
                    }
                },
                namespace='urn:brocade.com:mgmt:brocade-apply-qos-mpls',
                defining_module='brocade-apply-qos-mpls',
                yang_type='container',
                is_config=True)
        except (TypeError, ValueError):
            raise ValueError({
                'error-string':
                """map_apply must be of a type compatible with container""",
                'defined-type':
                "container",
                'generated-type':
                """YANGDynClass(base=map_apply.map_apply, is_container='container', presence=False, yang_name="map-apply", rest_name="map-apply", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'info': u'Configure apply map', u'callpoint': u'ApplyQosMplsCallpoint', u'sort-priority': u'58'}}, namespace='urn:brocade.com:mgmt:brocade-apply-qos-mpls', defining_module='brocade-apply-qos-mpls', yang_type='container', is_config=True)""",
            })

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

    def _unset_map_apply(self):
        self.__map_apply = YANGDynClass(
            base=map_apply.map_apply,
            is_container='container',
            presence=False,
            yang_name="map-apply",
            rest_name="map-apply",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            extensions={
                u'tailf-common': {
                    u'info': u'Configure apply map',
                    u'callpoint': u'ApplyQosMplsCallpoint',
                    u'sort-priority': u'58'
                }
            },
            namespace='urn:brocade.com:mgmt:brocade-apply-qos-mpls',
            defining_module='brocade-apply-qos-mpls',
            yang_type='container',
            is_config=True)

    map_ = __builtin__.property(_get_map_, _set_map_)
    map_apply = __builtin__.property(_get_map_apply, _set_map_apply)

    _pyangbind_elements = {
        'map_': map_,
        'map_apply': map_apply,
    }
Exemple #31
0
 def make_prop(exp, is_none=False):
     return builtins.property(
         fget=lambda self: exp(self),
         fset=lambda self, other: None,
         fdel=lambda self, *args, **kwargs: None
     )
Exemple #32
0
class show_mpls_lsp_detail(PybindBase):
  """
  This class was auto-generated by the PythonClass plugin for PYANG
  from YANG module brocade-mpls - based on the path /brocade_mpls_rpc/show-mpls-lsp-detail. Each member element of
  the container is represented as a class variable - with a specific
  YANG type.
  """
  __slots__ = ('_pybind_generated_by', '_path_helper', '_yang_name', '_rest_name', '_extmethods', '__output',)

  _yang_name = 'show-mpls-lsp-detail'
  _rest_name = 'show-mpls-lsp-detail'

  _pybind_generated_by = 'container'

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

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

    extmethods = kwargs.pop("extmethods", None)
    if extmethods is False:
      self._extmethods = False
    elif extmethods is not None and isinstance(extmethods, dict):
      self._extmethods = extmethods
    elif hasattr(self, "_parent"):
      extmethods = getattr(self._parent, "_extmethods", None)
      self._extmethods = extmethods
    else:
      self._extmethods = False
    self.__output = YANGDynClass(base=output.output, is_leaf=True, yang_name="output", rest_name="output", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=False, extensions=None, namespace='urn:brocade.com:mgmt:brocade-mpls', defining_module='brocade-mpls', yang_type='output', 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'brocade_mpls_rpc', u'show-mpls-lsp-detail']

  def _rest_path(self):
    if hasattr(self, "_parent"):
      if self._rest_name:
        return self._parent._rest_path()+[self._rest_name]
      else:
        return self._parent._rest_path()
    else:
      return [u'show-mpls-lsp-detail']

  def _get_output(self):
    """
    Getter method for output, mapped from YANG variable /brocade_mpls_rpc/show_mpls_lsp_detail/output (output)
    """
    return self.__output
      
  def _set_output(self, v, load=False):
    """
    Setter method for output, mapped from YANG variable /brocade_mpls_rpc/show_mpls_lsp_detail/output (output)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_output is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_output() directly.
    """
    if hasattr(v, "_utype"):
      v = v._utype(v)
    try:
      t = YANGDynClass(v,base=output.output, is_leaf=True, yang_name="output", rest_name="output", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=False, extensions=None, namespace='urn:brocade.com:mgmt:brocade-mpls', defining_module='brocade-mpls', yang_type='output', is_config=True)
    except (TypeError, ValueError):
      raise ValueError({
          'error-string': """output must be of a type compatible with output""",
          'defined-type': "brocade-mpls:output",
          'generated-type': """YANGDynClass(base=output.output, is_leaf=True, yang_name="output", rest_name="output", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=False, extensions=None, namespace='urn:brocade.com:mgmt:brocade-mpls', defining_module='brocade-mpls', yang_type='output', is_config=True)""",
        })

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

  def _unset_output(self):
    self.__output = YANGDynClass(base=output.output, is_leaf=True, yang_name="output", rest_name="output", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=False, extensions=None, namespace='urn:brocade.com:mgmt:brocade-mpls', defining_module='brocade-mpls', yang_type='output', is_config=True)

  output = __builtin__.property(_get_output, _set_output)


  _pyangbind_elements = {'output': output, }
Exemple #33
0
def assertionproperty(func):
    return __builtin__.property(assertionmethod(func))
Exemple #34
0
class access(PybindBase):
    """
  This class was auto-generated by the PythonClass plugin for PYANG
  from YANG module brocade-interface - based on the path /interface/hundredgigabitethernet/switchport/access-mac-group-rspan-vlan-classification/access. Each member element of
  the container is represented as a class variable - with a specific
  YANG type.

  YANG Description: The access layer characteristics of this interface.
  """
    __slots__ = (
        '_pybind_generated_by',
        '_path_helper',
        '_yang_name',
        '_rest_name',
        '_extmethods',
        '__vlan',
    )

    _yang_name = 'access'
    _rest_name = 'access'

    _pybind_generated_by = 'container'

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

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

        extmethods = kwargs.pop("extmethods", None)
        if extmethods is False:
            self._extmethods = False
        elif extmethods is not None and isinstance(extmethods, dict):
            self._extmethods = extmethods
        elif hasattr(self, "_parent"):
            extmethods = getattr(self._parent, "_extmethods", None)
            self._extmethods = extmethods
        else:
            self._extmethods = False
        self.__vlan = YANGDynClass(
            base=YANGListType(
                "access_vlan_id access_mac_group",
                vlan.vlan,
                yang_name="vlan",
                rest_name="rspan-vlan",
                parent=self,
                is_container='list',
                user_ordered=False,
                path_helper=self._path_helper,
                yang_keys='access-vlan-id access-mac-group',
                extensions={
                    u'tailf-common': {
                        u'callpoint':
                        u'rspan-mac-group-vlan-classification-config-phy',
                        u'cli-suppress-list-no': None,
                        u'cli-no-key-completion': None,
                        u'cli-suppress-mode': None,
                        u'alt-name': u'rspan-vlan'
                    }
                }),
            is_container='list',
            yang_name="vlan",
            rest_name="rspan-vlan",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            extensions={
                u'tailf-common': {
                    u'callpoint':
                    u'rspan-mac-group-vlan-classification-config-phy',
                    u'cli-suppress-list-no': None,
                    u'cli-no-key-completion': None,
                    u'cli-suppress-mode': None,
                    u'alt-name': u'rspan-vlan'
                }
            },
            namespace='urn:brocade.com:mgmt:brocade-interface',
            defining_module='brocade-interface',
            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 [
                u'interface', u'hundredgigabitethernet', u'switchport',
                u'access-mac-group-rspan-vlan-classification', u'access'
            ]

    def _rest_path(self):
        if hasattr(self, "_parent"):
            if self._rest_name:
                return self._parent._rest_path() + [self._rest_name]
            else:
                return self._parent._rest_path()
        else:
            return [
                u'interface', u'HundredGigabitEthernet', u'switchport',
                u'access'
            ]

    def _get_vlan(self):
        """
    Getter method for vlan, mapped from YANG variable /interface/hundredgigabitethernet/switchport/access_mac_group_rspan_vlan_classification/access/vlan (list)
    """
        return self.__vlan

    def _set_vlan(self, v, load=False):
        """
    Setter method for vlan, mapped from YANG variable /interface/hundredgigabitethernet/switchport/access_mac_group_rspan_vlan_classification/access/vlan (list)
    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.
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(
                v,
                base=YANGListType(
                    "access_vlan_id access_mac_group",
                    vlan.vlan,
                    yang_name="vlan",
                    rest_name="rspan-vlan",
                    parent=self,
                    is_container='list',
                    user_ordered=False,
                    path_helper=self._path_helper,
                    yang_keys='access-vlan-id access-mac-group',
                    extensions={
                        u'tailf-common': {
                            u'callpoint':
                            u'rspan-mac-group-vlan-classification-config-phy',
                            u'cli-suppress-list-no': None,
                            u'cli-no-key-completion': None,
                            u'cli-suppress-mode': None,
                            u'alt-name': u'rspan-vlan'
                        }
                    }),
                is_container='list',
                yang_name="vlan",
                rest_name="rspan-vlan",
                parent=self,
                path_helper=self._path_helper,
                extmethods=self._extmethods,
                register_paths=True,
                extensions={
                    u'tailf-common': {
                        u'callpoint':
                        u'rspan-mac-group-vlan-classification-config-phy',
                        u'cli-suppress-list-no': None,
                        u'cli-no-key-completion': None,
                        u'cli-suppress-mode': None,
                        u'alt-name': u'rspan-vlan'
                    }
                },
                namespace='urn:brocade.com:mgmt:brocade-interface',
                defining_module='brocade-interface',
                yang_type='list',
                is_config=True)
        except (TypeError, ValueError):
            raise ValueError({
                'error-string':
                """vlan must be of a type compatible with list""",
                'defined-type':
                "list",
                'generated-type':
                """YANGDynClass(base=YANGListType("access_vlan_id access_mac_group",vlan.vlan, yang_name="vlan", rest_name="rspan-vlan", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='access-vlan-id access-mac-group', extensions={u'tailf-common': {u'callpoint': u'rspan-mac-group-vlan-classification-config-phy', u'cli-suppress-list-no': None, u'cli-no-key-completion': None, u'cli-suppress-mode': None, u'alt-name': u'rspan-vlan'}}), is_container='list', yang_name="vlan", rest_name="rspan-vlan", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'callpoint': u'rspan-mac-group-vlan-classification-config-phy', u'cli-suppress-list-no': None, u'cli-no-key-completion': None, u'cli-suppress-mode': None, u'alt-name': u'rspan-vlan'}}, namespace='urn:brocade.com:mgmt:brocade-interface', defining_module='brocade-interface', yang_type='list', is_config=True)""",
            })

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

    def _unset_vlan(self):
        self.__vlan = YANGDynClass(
            base=YANGListType(
                "access_vlan_id access_mac_group",
                vlan.vlan,
                yang_name="vlan",
                rest_name="rspan-vlan",
                parent=self,
                is_container='list',
                user_ordered=False,
                path_helper=self._path_helper,
                yang_keys='access-vlan-id access-mac-group',
                extensions={
                    u'tailf-common': {
                        u'callpoint':
                        u'rspan-mac-group-vlan-classification-config-phy',
                        u'cli-suppress-list-no': None,
                        u'cli-no-key-completion': None,
                        u'cli-suppress-mode': None,
                        u'alt-name': u'rspan-vlan'
                    }
                }),
            is_container='list',
            yang_name="vlan",
            rest_name="rspan-vlan",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            extensions={
                u'tailf-common': {
                    u'callpoint':
                    u'rspan-mac-group-vlan-classification-config-phy',
                    u'cli-suppress-list-no': None,
                    u'cli-no-key-completion': None,
                    u'cli-suppress-mode': None,
                    u'alt-name': u'rspan-vlan'
                }
            },
            namespace='urn:brocade.com:mgmt:brocade-interface',
            defining_module='brocade-interface',
            yang_type='list',
            is_config=True)

    vlan = __builtin__.property(_get_vlan, _set_vlan)

    _pyangbind_elements = {
        'vlan': vlan,
    }