Ejemplo n.º 1
0
    def __init__(self, *args, **kwargs):

        self._path_helper = False

        self._extmethods = False
        self.__enable = YANGDynClass(
            base=YANGBool,
            default=YANGBool("true"),
            is_leaf=True,
            yang_name="enable",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/system",
            defining_module="openconfig-system",
            yang_type="boolean",
            is_config=True,
        )
        self.__protocol_version = YANGDynClass(
            base=RestrictedClassType(
                base_type=six.text_type,
                restriction_type="dict_key",
                restriction_arg={
                    "V2": {},
                    "V1": {},
                    "V1_V2": {}
                },
            ),
            default=six.text_type("V2"),
            is_leaf=True,
            yang_name="protocol-version",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/system",
            defining_module="openconfig-system",
            yang_type="enumeration",
            is_config=True,
        )
        self.__timeout = YANGDynClass(
            base=RestrictedClassType(base_type=int,
                                     restriction_dict={"range": ["0..65535"]},
                                     int_size=16),
            is_leaf=True,
            yang_name="timeout",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/system",
            defining_module="openconfig-system",
            yang_type="uint16",
            is_config=True,
        )
        self.__rate_limit = YANGDynClass(
            base=RestrictedClassType(base_type=int,
                                     restriction_dict={"range": ["0..65535"]},
                                     int_size=16),
            is_leaf=True,
            yang_name="rate-limit",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/system",
            defining_module="openconfig-system",
            yang_type="uint16",
            is_config=True,
        )
        self.__session_limit = YANGDynClass(
            base=RestrictedClassType(base_type=int,
                                     restriction_dict={"range": ["0..65535"]},
                                     int_size=16),
            is_leaf=True,
            yang_name="session-limit",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/system",
            defining_module="openconfig-system",
            yang_type="uint16",
            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)
Ejemplo n.º 2
0
    def __init__(self, *args, **kwargs):

        self._path_helper = False

        self._extmethods = False
        self.__index = 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)(0),
            is_leaf=True,
            yang_name="index",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace='http://openconfig.net/yang/interfaces',
            defining_module='openconfig-interfaces',
            yang_type='uint32',
            is_config=True)
        self.__enabled = YANGDynClass(
            base=YANGBool,
            default=YANGBool("true"),
            is_leaf=True,
            yang_name="enabled",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace='http://openconfig.net/yang/interfaces',
            defining_module='openconfig-interfaces',
            yang_type='boolean',
            is_config=True)
        self.__name = YANGDynClass(
            base=unicode,
            is_leaf=True,
            yang_name="name",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace='http://openconfig.net/yang/interfaces',
            defining_module='openconfig-interfaces',
            yang_type='string',
            is_config=True)
        self.__description = YANGDynClass(
            base=unicode,
            is_leaf=True,
            yang_name="description",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace='http://openconfig.net/yang/interfaces',
            defining_module='openconfig-interfaces',
            yang_type='string',
            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)
Ejemplo n.º 3
0
 def _unset_auto_negotiate(self):
   self.__auto_negotiate = YANGDynClass(base=YANGBool, default=YANGBool("true"), is_leaf=True, yang_name="auto-negotiate", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces/ethernet', defining_module='openconfig-if-ethernet', yang_type='boolean', is_config=True)
Ejemplo n.º 4
0
    def __init__(self, *args, **kwargs):

        self._path_helper = False

        self._extmethods = False
        self.__allow_multiple_as = YANGDynClass(
            base=YANGBool,
            default=YANGBool("false"),
            is_leaf=True,
            yang_name="allow-multiple-as",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="boolean",
            is_config=True,
        )
        self.__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/network-instance",
            defining_module="openconfig-network-instance",
            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)
Ejemplo n.º 5
0
 def _unset_prevent_teardown(self):
   self.__prevent_teardown = YANGDynClass(base=YANGBool, default=YANGBool("false"), is_leaf=True, yang_name="prevent-teardown", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='boolean', is_config=False)
Ejemplo n.º 6
0
    def __init__(self, *args, **kwargs):

        self._path_helper = False

        self._extmethods = False
        self.__enabled = YANGDynClass(
            base=YANGBool,
            default=YANGBool("false"),
            is_leaf=True,
            yang_name="enabled",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="boolean",
            is_config=False,
        )
        self.__interface_id = YANGDynClass(
            base=six.text_type,
            is_leaf=True,
            yang_name="interface-id",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="oc-if:interface-id",
            is_config=False,
        )
        self.__passive = YANGDynClass(
            base=YANGBool,
            default=YANGBool("false"),
            is_leaf=True,
            yang_name="passive",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="boolean",
            is_config=False,
        )
        self.__hello_padding = YANGDynClass(
            base=RestrictedClassType(
                base_type=six.text_type,
                restriction_type="dict_key",
                restriction_arg={
                    "STRICT": {}, "LOOSE": {}, "ADAPTIVE": {}, "DISABLE": {}
                },
            ),
            is_leaf=True,
            yang_name="hello-padding",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="oc-isis-types:hello-padding-type",
            is_config=False,
        )
        self.__circuit_type = YANGDynClass(
            base=RestrictedClassType(
                base_type=six.text_type,
                restriction_type="dict_key",
                restriction_arg={"POINT_TO_POINT": {}, "BROADCAST": {}},
            ),
            is_leaf=True,
            yang_name="circuit-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="oc-isis-types:circuit-type",
            is_config=False,
        )

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

        self._path_helper = False

        self._extmethods = False
        self.__route_reflector_cluster_id = YANGDynClass(
            base=[
                RestrictedClassType(
                    base_type=long,
                    restriction_dict={"range": ["0..4294967295"]},
                    int_size=32,
                ),
                RestrictedClassType(
                    base_type=six.text_type,
                    restriction_dict={
                        "pattern":
                        "^(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])$"
                    },
                ),
            ],
            is_leaf=True,
            yang_name="route-reflector-cluster-id",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="oc-bgp-types:rr-cluster-id-type",
            is_config=False,
        )
        self.__route_reflector_client = YANGDynClass(
            base=YANGBool,
            default=YANGBool("false"),
            is_leaf=True,
            yang_name="route-reflector-client",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="boolean",
            is_config=False,
        )

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

        self._path_helper = False

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

        load = kwargs.pop("load", None)
        if args:
            if len(args) > 1:
                raise TypeError(
                    "cannot create a YANG container with >1 argument")
            all_attr = True
            for e in self._pyangbind_elements:
                if not hasattr(args[0], e):
                    all_attr = False
                    break
            if not all_attr:
                raise ValueError(
                    "Supplied object did not have the correct attributes")
            for e in self._pyangbind_elements:
                nobj = getattr(args[0], e)
                if nobj._changed() is False:
                    continue
                setmethod = getattr(self, "_set_%s" % e)
                if load is None:
                    setmethod(getattr(args[0], e))
                else:
                    setmethod(getattr(args[0], e), load=load)
Ejemplo n.º 9
0
    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.__slot_id = YANGDynClass(
            base=RestrictedClassType(base_type=RestrictedClassType(
                base_type=int,
                restriction_dict={'range': ['0..65535']},
                int_size=16),
                                     restriction_dict={'range':
                                                       [u'0..65535']}),
            is_leaf=True,
            yang_name="slot-id",
            rest_name="clear-slot-id",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=False,
            extensions={
                u'tailf-common': {
                    u'info': u'clear all voq statistics for selected slot',
                    u'alt-name': u'clear-slot-id'
                }
            },
            namespace='urn:brocade.com:mgmt:brocade-tm-stats',
            defining_module='brocade-tm-stats',
            yang_type='common-def:lc-number-type',
            is_config=True)
        self.__clear_tm_voq_slot_egress_port_all = YANGDynClass(
            base=YANGBool,
            default=YANGBool("true"),
            is_leaf=True,
            yang_name="clear-tm-voq-slot-egress-port-all",
            rest_name="clear-slot-id-egr-all",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=False,
            extensions={
                u'tailf-common': {
                    u'info': u'clear all voq statistics for selected slot',
                    u'alt-name': u'clear-slot-id-egr-all'
                }
            },
            namespace='urn:brocade.com:mgmt:brocade-tm-stats',
            defining_module='brocade-tm-stats',
            yang_type='boolean',
            is_config=True)

        load = kwargs.pop("load", None)
        if args:
            if len(args) > 1:
                raise TypeError(
                    "cannot create a YANG container with >1 argument")
            all_attr = True
            for e in self._pyangbind_elements:
                if not hasattr(args[0], e):
                    all_attr = False
                    break
            if not all_attr:
                raise ValueError(
                    "Supplied object did not have the correct attributes")
            for e in self._pyangbind_elements:
                nobj = getattr(args[0], e)
                if nobj._changed() is False:
                    continue
                setmethod = getattr(self, "_set_%s" % e)
                if load is None:
                    setmethod(getattr(args[0], e))
                else:
                    setmethod(getattr(args[0], e), load=load)
Ejemplo n.º 10
0
    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.__encryption_level = YANGDynClass(
            base=RestrictedClassType(
                base_type=unicode,
                restriction_type="dict_key",
                restriction_arg={
                    u'0': {
                        'value': 0
                    },
                    u'7': {
                        'value': 7
                    }
                },
            ),
            is_leaf=True,
            yang_name="encryption-level",
            rest_name="encryption-level",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            extensions={
                u'tailf-common': {
                    u'info':
                    u'Level of encryption of the password\n(default=0)',
                    u'cli-suppress-no': None
                }
            },
            namespace='urn:brocade.com:mgmt:brocade-aaa',
            defining_module='brocade-aaa',
            yang_type='enumeration',
            is_config=True)
        self.__enable = YANGDynClass(
            base=YANGBool,
            default=YANGBool("true"),
            is_leaf=True,
            yang_name="enable",
            rest_name="enable",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            extensions={
                u'tailf-common': {
                    u'info':
                    u'Represents whether the user account is enabled\n(default=true)',
                    u'cli-suppress-no': None
                }
            },
            namespace='urn:brocade.com:mgmt:brocade-aaa',
            defining_module='brocade-aaa',
            yang_type='username-enable',
            is_config=True)
        self.__name = YANGDynClass(
            base=RestrictedClassType(base_type=unicode,
                                     restriction_dict={'length':
                                                       [u'1 .. 40']}),
            is_leaf=True,
            yang_name="name",
            rest_name="name",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            is_keyval=True,
            namespace='urn:brocade.com:mgmt:brocade-aaa',
            defining_module='brocade-aaa',
            yang_type='string',
            is_config=True)
        self.__access_time = YANGDynClass(
            base=unicode,
            default=unicode(""),
            is_leaf=True,
            yang_name="access-time",
            rest_name="access-time",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            extensions={
                u'tailf-common': {
                    u'info':
                    u'Granting user access for configured time period from',
                    u'cli-suppress-no': None
                }
            },
            namespace='urn:brocade.com:mgmt:brocade-aaa',
            defining_module='brocade-aaa',
            yang_type='string',
            is_config=True)
        self.__user_password = YANGDynClass(
            base=RestrictedClassType(base_type=unicode,
                                     restriction_dict={'length': [u'8..40']}),
            is_leaf=True,
            yang_name="user-password",
            rest_name="password",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            extensions={
                u'tailf-common': {
                    u'info': u'Password of the user',
                    u'alt-name': u'password'
                }
            },
            namespace='urn:brocade.com:mgmt:brocade-aaa',
            defining_module='brocade-aaa',
            yang_type='user-passwd',
            is_config=True)
        self.__expire = YANGDynClass(
            base=RestrictedClassType(
                base_type=unicode,
                restriction_dict={
                    'pattern':
                    u'((19(0[2-9]|[1-9][0-9])|20([012][0-9]|3[0-7]))-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01]))|never',
                    'length': [u'0 .. 10']
                }),
            default=unicode("never"),
            is_leaf=True,
            yang_name="expire",
            rest_name="expire",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            extensions={
                u'tailf-common': {
                    u'info':
                    u'Date until when the password will remain valid after being updated\n(default=never)',
                    u'cli-suppress-no': None
                }
            },
            namespace='urn:brocade.com:mgmt:brocade-aaa',
            defining_module='brocade-aaa',
            yang_type='date',
            is_config=True)
        self.__role = YANGDynClass(
            base=RestrictedClassType(base_type=unicode,
                                     restriction_dict={'length':
                                                       [u'4 .. 32']}),
            is_leaf=True,
            yang_name="role",
            rest_name="role",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            extensions={u'tailf-common': {
                u'info': u'Role of the user'
            }},
            namespace='urn:brocade.com:mgmt:brocade-aaa',
            defining_module='brocade-aaa',
            yang_type='string',
            is_config=True)
        self.__end_time = YANGDynClass(
            base=unicode,
            default=unicode(""),
            is_leaf=True,
            yang_name="end-time",
            rest_name="to",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            extensions={
                u'tailf-common': {
                    u'info': u'To time period granting user access',
                    u'alt-name': u'to',
                    u'cli-suppress-no': None,
                    u'display-when': u'(../access-time)'
                }
            },
            namespace='urn:brocade.com:mgmt:brocade-aaa',
            defining_module='brocade-aaa',
            yang_type='string',
            is_config=True)
        self.__desc = YANGDynClass(
            base=RestrictedClassType(base_type=unicode,
                                     restriction_dict={'length':
                                                       [u'0 .. 64']}),
            default=unicode(""),
            is_leaf=True,
            yang_name="desc",
            rest_name="desc",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            extensions={
                u'tailf-common': {
                    u'info': u"Description of the user (default='')",
                    u'cli-suppress-no': None
                }
            },
            namespace='urn:brocade.com:mgmt:brocade-aaa',
            defining_module='brocade-aaa',
            yang_type='string',
            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)
Ejemplo n.º 11
0
    def __init__(self, *args, **kwargs):

        self._path_helper = False

        self._extmethods = False
        self.__type = YANGDynClass(
            base=RestrictedClassType(
                base_type=six.text_type,
                restriction_type="dict_key",
                restriction_arg={
                    "IPV4_SEGMENT": {
                        "@module": "openconfig-ospf-types",
                        "@namespace": "http://openconfig.net/yang/ospf-types",
                    },
                    "oc-ospf-types:IPV4_SEGMENT": {
                        "@module": "openconfig-ospf-types",
                        "@namespace": "http://openconfig.net/yang/ospf-types",
                    },
                    "oc-ospft:IPV4_SEGMENT": {
                        "@module": "openconfig-ospf-types",
                        "@namespace": "http://openconfig.net/yang/ospf-types",
                    },
                    "UNNUMBERED_INTERFACE_SEGMENT": {
                        "@module": "openconfig-ospf-types",
                        "@namespace": "http://openconfig.net/yang/ospf-types",
                    },
                    "oc-ospf-types:UNNUMBERED_INTERFACE_SEGMENT": {
                        "@module": "openconfig-ospf-types",
                        "@namespace": "http://openconfig.net/yang/ospf-types",
                    },
                    "oc-ospft:UNNUMBERED_INTERFACE_SEGMENT": {
                        "@module": "openconfig-ospf-types",
                        "@namespace": "http://openconfig.net/yang/ospf-types",
                    },
                },
            ),
            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="identityref",
            is_config=False,
        )
        self.__loose = YANGDynClass(
            base=YANGBool,
            default=YANGBool("false"),
            is_leaf=True,
            yang_name="loose",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="boolean",
            is_config=False,
        )

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

        self._path_helper = False

        self._extmethods = False
        self.__discard = YANGDynClass(
            base=YANGBool,
            default=YANGBool("false"),
            is_leaf=True,
            yang_name="discard",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace='http://openconfig.net/yang/network-instance',
            defining_module='openconfig-network-instance',
            yang_type='boolean',
            is_config=False)
        self.__prefix = YANGDynClass(
            base=[
                RestrictedClassType(
                    base_type=unicode,
                    restriction_dict={
                        'pattern':
                        u'(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])/(([0-9])|([1-2][0-9])|(3[0-2]))'
                    }),
                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="prefix",
            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='inet:ip-prefix',
            is_config=False)
        self.__set_tag = YANGDynClass(
            base=[
                RestrictedClassType(
                    base_type=long,
                    restriction_dict={'range': ['0..4294967295']},
                    int_size=32),
                RestrictedClassType(base_type=unicode,
                                    restriction_dict={
                                        'pattern':
                                        u'([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'
                                    }),
            ],
            is_leaf=True,
            yang_name="set-tag",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace='http://openconfig.net/yang/network-instance',
            defining_module='openconfig-network-instance',
            yang_type='oc-pt:tag-type',
            is_config=False)

        load = kwargs.pop("load", None)
        if args:
            if len(args) > 1:
                raise TypeError(
                    "cannot create a YANG container with >1 argument")
            all_attr = True
            for e in self._pyangbind_elements:
                if not hasattr(args[0], e):
                    all_attr = False
                    break
            if not all_attr:
                raise ValueError(
                    "Supplied object did not have the correct attributes")
            for e in self._pyangbind_elements:
                nobj = getattr(args[0], e)
                if nobj._changed() is False:
                    continue
                setmethod = getattr(self, "_set_%s" % e)
                if load is None:
                    setmethod(getattr(args[0], e))
                else:
                    setmethod(getattr(args[0], e), load=load)
Ejemplo n.º 13
0
def main():
  try:
    opts, args = getopt.getopt(sys.argv[1:], "k", ["keepfiles"])
  except getopt.GetoptError as e:
    print str(e)
    sys.exit(127)

  k = False
  for o, a in opts:
    if o in ["-k", "--keepfiles"]:
      k = True

  pythonpath = os.environ.get("PATH_TO_PYBIND_TEST_PYTHON") if \
                os.environ.get('PATH_TO_PYBIND_TEST_PYTHON') is not None \
                  else sys.executable
  pyangpath = os.environ.get('PYANGPATH') if \
                os.environ.get('PYANGPATH') is not None else False
  pyangbindpath = os.environ.get('PYANGBINDPATH') if \
                os.environ.get('PYANGBINDPATH') is not None else False
  assert pyangpath is not False, "could not find path to pyang"
  assert pyangbindpath is not False, "could not resolve pyangbind directory"

  OC = "https://raw.githubusercontent.com/openconfig/" + \
            "public/master/release/models/"
  RFC = "https://raw.githubusercontent.com/robshakir/" + \
            "yang/master/standard/ietf/RFC/"
  FETCH_FILES = [
                  (OC + "openconfig-extensions.yang", "include"),
                  (OC + "openconfig-types.yang", "include"),
                  (OC + "types/openconfig-yang-types.yang", "include"),
                  (OC + "types/openconfig-inet-types.yang", "include"),
                  (OC + "interfaces/openconfig-interfaces.yang", "openconfig"),
                  (RFC + "ietf-inet-types.yang", "include"),
                  (RFC + "ietf-yang-types.yang", "include"),
                ]

  this_dir = os.path.dirname(os.path.realpath(__file__))
  del_dirs = []
  for fn in FETCH_FILES:
    wrdir = os.path.join(this_dir, fn[1])
    if not os.path.exists(wrdir):
      os.mkdir(wrdir)
    if wrdir not in del_dirs:
      del_dirs.append(wrdir)
    wrpath = os.path.join(this_dir, fn[1], fn[0].split("/")[-1])
    if not os.path.exists(wrpath):
      got = False
      count = 0
      for i in range(0,4):
        response = requests.get(fn[0])
        if response.status_code != 200:
          time.sleep(2)
        else:
          got = True
          f = open(wrpath, 'w')
          f.write(response.content)
          f.close()
          break
      assert got is True, "Could not get file %s from GitHub (response: %s)" \
                % (response.status_code, fn[0])

  files_str = " ".join([os.path.join(this_dir, "openconfig", i) for i in
                        os.listdir(os.path.join(this_dir, "openconfig"))])

  cmd = "%s " % pythonpath
  cmd += "%s --plugindir %s/pyangbind/plugin" % (pyangpath, pyangbindpath)
  cmd += " -f pybind --split-class-dir %s/ocbind" % this_dir
  cmd += " -p %s" % this_dir
  cmd += " -p %s" % os.path.join(this_dir, "include")
  cmd += " --use-xpathhelper "
  cmd += files_str
  os.system(cmd)

  from ocbind import openconfig_interfaces

  for fn in os.listdir(os.path.join(this_dir, "json")):
    jobj = json.load(open(os.path.join(this_dir, "json", fn), 'r'))
    parameters = re.sub('interfaces\_ph:(?P<pathhelper>[a-zA-Z]+)\-flt:(?P<filter>[a-zA-Z]+)\-m:(?P<mode>[a-zA-Z]+)\.json', 
                        '\g<pathhelper>||\g<filter>||\g<mode>', fn).split("||")
    path_helper,filter,mode = YANGBool(parameters[0]), YANGBool(parameters[1]), parameters[2]

    if path_helper:
      ph = YANGPathHelper()
      i = openconfig_interfaces(path_helper=ph)
    else:
      i = openconfig_interfaces()

    i.interfaces.interface.add("eth0")

    jstr = json.loads(dumps(i, filter=bool(filter), mode=mode))
    sys.stdout.flush()

    assert jstr == jobj, "Generated JSON did not match expected object for %s" % fn \
            + " %s != %s" % (jstr, jobj)

    passed = True
    try:
      jstr = json.loads(json.dumps(pybindIETFJSONEncoder.generate_element(i), cls=pybindIETFJSONEncoder))
    except Exception as e:
      passed = False

    assert passed, "Serialisation test for object with pybindIETFJSONEncoder threw an error"

    jstr = json.loads(json.dumps(i, cls=pybindJSONEncoder))

  if not k:
    del_dirs.append(os.path.join(this_dir, "ocbind"))
    for dirname in del_dirs:
      for root, dirs, files in os.walk(os.path.join(dirname), topdown=False):
        for name in files:
          os.remove(os.path.join(root, name))
        for name in dirs:
          os.rmdir(os.path.join(root, name))
      os.rmdir(dirname)
Ejemplo n.º 14
0
    def __init__(self, *args, **kwargs):

        self._path_helper = False

        self._extmethods = False
        self.__tcp_mss = YANGDynClass(
            base=RestrictedClassType(
                base_type=int, restriction_dict={"range": ["0..65535"]}, int_size=16
            ),
            is_leaf=True,
            yang_name="tcp-mss",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="uint16",
            is_config=True,
        )
        self.__mtu_discovery = YANGDynClass(
            base=YANGBool,
            default=YANGBool("false"),
            is_leaf=True,
            yang_name="mtu-discovery",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="boolean",
            is_config=True,
        )
        self.__passive_mode = YANGDynClass(
            base=YANGBool,
            default=YANGBool("false"),
            is_leaf=True,
            yang_name="passive-mode",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="boolean",
            is_config=True,
        )
        self.__local_address = YANGDynClass(
            base=[
                RestrictedClassType(
                    base_type=six.text_type,
                    restriction_dict={
                        "pattern": "^(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])$"
                    },
                ),
                RestrictedClassType(
                    base_type=six.text_type,
                    restriction_dict={
                        "pattern": "^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$"
                    },
                ),
                six.text_type,
            ],
            is_leaf=True,
            yang_name="local-address",
            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="union",
            is_config=True,
        )

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

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

        self._extmethods = False
        self.__enabled = YANGDynClass(
            base=YANGBool,
            default=YANGBool("true"),
            is_leaf=True,
            yang_name="enabled",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace='http://openconfig.net/yang/interfaces/ip',
            defining_module='openconfig-if-ip',
            yang_type='boolean',
            is_config=False)
        self.__mtu = YANGDynClass(
            base=RestrictedClassType(base_type=RestrictedClassType(
                base_type=int,
                restriction_dict={'range': ['0..65535']},
                int_size=16),
                                     restriction_dict={'range': ['68..max']}),
            is_leaf=True,
            yang_name="mtu",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace='http://openconfig.net/yang/interfaces/ip',
            defining_module='openconfig-if-ip',
            yang_type='uint16',
            is_config=False)
        self.__dhcp_client = YANGDynClass(
            base=YANGBool,
            default=YANGBool("false"),
            is_leaf=True,
            yang_name="dhcp-client",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace='http://openconfig.net/yang/interfaces/ip',
            defining_module='openconfig-if-ip',
            yang_type='boolean',
            is_config=False)
        self.__counters = YANGDynClass(
            base=counters.counters,
            is_container='container',
            yang_name="counters",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            extensions=None,
            namespace='http://openconfig.net/yang/interfaces/ip',
            defining_module='openconfig-if-ip',
            yang_type='container',
            is_config=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)
Ejemplo n.º 16
0
 def _unset_treat_as_withdraw(self):
   self.__treat_as_withdraw = YANGDynClass(base=YANGBool, default=YANGBool("false"), is_leaf=True, yang_name="treat-as-withdraw", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='boolean', is_config=False)
Ejemplo n.º 17
0
    def __init__(self, *args, **kwargs):

        self._path_helper = False

        self._extmethods = False
        self.__current_priority = YANGDynClass(
            base=RestrictedClassType(base_type=int,
                                     restriction_dict={'range': ['0..255']},
                                     int_size=8),
            is_leaf=True,
            yang_name="current-priority",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace='http://openconfig.net/yang/interfaces/ip',
            defining_module='openconfig-if-ip',
            yang_type='uint8',
            is_config=False)
        self.__virtual_address = YANGDynClass(
            base=TypedListType(allowed_type=[
                RestrictedClassType(
                    base_type=unicode,
                    restriction_dict={
                        'pattern':
                        u'(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\\p{N}\\p{L}]+)?'
                    }),
                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])))(%[\\p{N}\\p{L}]+)?'
                    }),
            ]),
            is_leaf=False,
            yang_name="virtual-address",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace='http://openconfig.net/yang/interfaces/ip',
            defining_module='openconfig-if-ip',
            yang_type='inet:ip-address',
            is_config=False)
        self.__priority = YANGDynClass(
            base=RestrictedClassType(base_type=RestrictedClassType(
                base_type=int,
                restriction_dict={'range': ['0..255']},
                int_size=8),
                                     restriction_dict={'range': [u'1..254']}),
            default=RestrictedClassType(base_type=int,
                                        restriction_dict={'range': ['0..255']},
                                        int_size=8)(100),
            is_leaf=True,
            yang_name="priority",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace='http://openconfig.net/yang/interfaces/ip',
            defining_module='openconfig-if-ip',
            yang_type='uint8',
            is_config=False)
        self.__preempt = YANGDynClass(
            base=YANGBool,
            default=YANGBool("true"),
            is_leaf=True,
            yang_name="preempt",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace='http://openconfig.net/yang/interfaces/ip',
            defining_module='openconfig-if-ip',
            yang_type='boolean',
            is_config=False)
        self.__advertisement_interval = YANGDynClass(
            base=RestrictedClassType(base_type=RestrictedClassType(
                base_type=int,
                restriction_dict={'range': ['0..65535']},
                int_size=16),
                                     restriction_dict={'range': [u'1..4095']}),
            default=RestrictedClassType(
                base_type=int,
                restriction_dict={'range': ['0..65535']},
                int_size=16)(100),
            is_leaf=True,
            yang_name="advertisement-interval",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace='http://openconfig.net/yang/interfaces/ip',
            defining_module='openconfig-if-ip',
            yang_type='uint16',
            is_config=False)
        self.__virtual_router_id = YANGDynClass(
            base=RestrictedClassType(base_type=RestrictedClassType(
                base_type=int,
                restriction_dict={'range': ['0..255']},
                int_size=8),
                                     restriction_dict={'range': [u'1..255']}),
            is_leaf=True,
            yang_name="virtual-router-id",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace='http://openconfig.net/yang/interfaces/ip',
            defining_module='openconfig-if-ip',
            yang_type='uint8',
            is_config=False)
        self.__preempt_delay = YANGDynClass(
            base=RestrictedClassType(base_type=RestrictedClassType(
                base_type=int,
                restriction_dict={'range': ['0..65535']},
                int_size=16),
                                     restriction_dict={'range': [u'0..3600']}),
            default=RestrictedClassType(
                base_type=int,
                restriction_dict={'range': ['0..65535']},
                int_size=16)(0),
            is_leaf=True,
            yang_name="preempt-delay",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace='http://openconfig.net/yang/interfaces/ip',
            defining_module='openconfig-if-ip',
            yang_type='uint16',
            is_config=False)
        self.__accept_mode = YANGDynClass(
            base=YANGBool,
            default=YANGBool("false"),
            is_leaf=True,
            yang_name="accept-mode",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace='http://openconfig.net/yang/interfaces/ip',
            defining_module='openconfig-if-ip',
            yang_type='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)
Ejemplo n.º 18
0
    def __init__(self, *args, **kwargs):

        self._path_helper = False

        self._extmethods = False
        self.__refresh_reduction = YANGDynClass(
            base=YANGBool,
            default=YANGBool("true"),
            is_leaf=True,
            yang_name="refresh-reduction",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace='http://openconfig.net/yang/network-instance',
            defining_module='openconfig-network-instance',
            yang_type='boolean',
            is_config=False)
        self.__hello_interval = YANGDynClass(
            base=RestrictedClassType(
                base_type=RestrictedClassType(
                    base_type=int,
                    restriction_dict={'range': ['0..65535']},
                    int_size=16),
                restriction_dict={'range': [u'1000..60000']}),
            default=RestrictedClassType(
                base_type=int,
                restriction_dict={'range': ['0..65535']},
                int_size=16)(9000),
            is_leaf=True,
            yang_name="hello-interval",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace='http://openconfig.net/yang/network-instance',
            defining_module='openconfig-network-instance',
            yang_type='uint16',
            is_config=False)

        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)
Ejemplo n.º 19
0
 def _unset_enabled(self):
   self.__enabled = YANGDynClass(base=YANGBool, default=YANGBool("true"), is_leaf=True, yang_name="enabled", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='boolean', is_config=True)
Ejemplo n.º 20
0
    def __init__(self, *args, **kwargs):

        self._path_helper = False

        self._extmethods = False
        self.__enabled = YANGDynClass(
            base=YANGBool,
            default=YANGBool("false"),
            is_leaf=True,
            yang_name="enabled",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="boolean",
            is_config=False,
        )
        self.__underflow_threshold = YANGDynClass(
            base=RestrictedClassType(
                base_type=RestrictedClassType(
                    base_type=int,
                    restriction_dict={"range": ["0..255"]},
                    int_size=8),
                restriction_dict={"range": ["0..100"]},
            ),
            is_leaf=True,
            yang_name="underflow-threshold",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="oc-types:percentage",
            is_config=False,
        )
        self.__trigger_event_count = YANGDynClass(
            base=RestrictedClassType(base_type=int,
                                     restriction_dict={"range": ["0..65535"]},
                                     int_size=16),
            is_leaf=True,
            yang_name="trigger-event-count",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="uint16",
            is_config=False,
        )

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

        self._path_helper = False

        self._extmethods = False
        self.__mac_address = YANGDynClass(
            base=RestrictedClassType(
                base_type=six.text_type,
                restriction_dict={
                    "pattern": "[0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){5}"
                },
            ),
            is_leaf=True,
            yang_name="mac-address",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/interfaces/ethernet",
            defining_module="openconfig-if-ethernet",
            yang_type="yang:mac-address",
            is_config=True,
        )
        self.__auto_negotiate = YANGDynClass(
            base=YANGBool,
            default=YANGBool("true"),
            is_leaf=True,
            yang_name="auto-negotiate",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/interfaces/ethernet",
            defining_module="openconfig-if-ethernet",
            yang_type="boolean",
            is_config=True,
        )
        self.__duplex_mode = YANGDynClass(
            base=RestrictedClassType(
                base_type=six.text_type,
                restriction_type="dict_key",
                restriction_arg={
                    "FULL": {},
                    "HALF": {}
                },
            ),
            is_leaf=True,
            yang_name="duplex-mode",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/interfaces/ethernet",
            defining_module="openconfig-if-ethernet",
            yang_type="enumeration",
            is_config=True,
        )
        self.__port_speed = YANGDynClass(
            base=RestrictedClassType(
                base_type=six.text_type,
                restriction_type="dict_key",
                restriction_arg={
                    "SPEED_10MB": {
                        "@module":
                        "openconfig-if-ethernet",
                        "@namespace":
                        "http://openconfig.net/yang/interfaces/ethernet",
                    },
                    "oc-eth:SPEED_10MB": {
                        "@module":
                        "openconfig-if-ethernet",
                        "@namespace":
                        "http://openconfig.net/yang/interfaces/ethernet",
                    },
                    "SPEED_100MB": {
                        "@module":
                        "openconfig-if-ethernet",
                        "@namespace":
                        "http://openconfig.net/yang/interfaces/ethernet",
                    },
                    "oc-eth:SPEED_100MB": {
                        "@module":
                        "openconfig-if-ethernet",
                        "@namespace":
                        "http://openconfig.net/yang/interfaces/ethernet",
                    },
                    "SPEED_1GB": {
                        "@module":
                        "openconfig-if-ethernet",
                        "@namespace":
                        "http://openconfig.net/yang/interfaces/ethernet",
                    },
                    "oc-eth:SPEED_1GB": {
                        "@module":
                        "openconfig-if-ethernet",
                        "@namespace":
                        "http://openconfig.net/yang/interfaces/ethernet",
                    },
                    "SPEED_10GB": {
                        "@module":
                        "openconfig-if-ethernet",
                        "@namespace":
                        "http://openconfig.net/yang/interfaces/ethernet",
                    },
                    "oc-eth:SPEED_10GB": {
                        "@module":
                        "openconfig-if-ethernet",
                        "@namespace":
                        "http://openconfig.net/yang/interfaces/ethernet",
                    },
                    "SPEED_25GB": {
                        "@module":
                        "openconfig-if-ethernet",
                        "@namespace":
                        "http://openconfig.net/yang/interfaces/ethernet",
                    },
                    "oc-eth:SPEED_25GB": {
                        "@module":
                        "openconfig-if-ethernet",
                        "@namespace":
                        "http://openconfig.net/yang/interfaces/ethernet",
                    },
                    "SPEED_40GB": {
                        "@module":
                        "openconfig-if-ethernet",
                        "@namespace":
                        "http://openconfig.net/yang/interfaces/ethernet",
                    },
                    "oc-eth:SPEED_40GB": {
                        "@module":
                        "openconfig-if-ethernet",
                        "@namespace":
                        "http://openconfig.net/yang/interfaces/ethernet",
                    },
                    "SPEED_50GB": {
                        "@module":
                        "openconfig-if-ethernet",
                        "@namespace":
                        "http://openconfig.net/yang/interfaces/ethernet",
                    },
                    "oc-eth:SPEED_50GB": {
                        "@module":
                        "openconfig-if-ethernet",
                        "@namespace":
                        "http://openconfig.net/yang/interfaces/ethernet",
                    },
                    "SPEED_100GB": {
                        "@module":
                        "openconfig-if-ethernet",
                        "@namespace":
                        "http://openconfig.net/yang/interfaces/ethernet",
                    },
                    "oc-eth:SPEED_100GB": {
                        "@module":
                        "openconfig-if-ethernet",
                        "@namespace":
                        "http://openconfig.net/yang/interfaces/ethernet",
                    },
                    "SPEED_UNKNOWN": {
                        "@module":
                        "openconfig-if-ethernet",
                        "@namespace":
                        "http://openconfig.net/yang/interfaces/ethernet",
                    },
                    "oc-eth:SPEED_UNKNOWN": {
                        "@module":
                        "openconfig-if-ethernet",
                        "@namespace":
                        "http://openconfig.net/yang/interfaces/ethernet",
                    },
                },
            ),
            is_leaf=True,
            yang_name="port-speed",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/interfaces/ethernet",
            defining_module="openconfig-if-ethernet",
            yang_type="identityref",
            is_config=True,
        )
        self.__enable_flow_control = YANGDynClass(
            base=YANGBool,
            default=YANGBool("false"),
            is_leaf=True,
            yang_name="enable-flow-control",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/interfaces/ethernet",
            defining_module="openconfig-if-ethernet",
            yang_type="boolean",
            is_config=True,
        )
        self.__aggregate_id = YANGDynClass(
            base=six.text_type,
            is_leaf=True,
            yang_name="aggregate-id",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/interfaces/aggregate",
            defining_module="openconfig-if-aggregate",
            yang_type="leafref",
            is_config=True,
        )

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

        self._path_helper = False

        self._extmethods = False
        self.__enabled = YANGDynClass(
            base=YANGBool,
            default=YANGBool("false"),
            is_leaf=True,
            yang_name="enabled",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="boolean",
            is_config=False,
        )
        self.__level_number = YANGDynClass(
            base=RestrictedClassType(
                base_type=RestrictedClassType(
                    base_type=int,
                    restriction_dict={"range": ["0..255"]},
                    int_size=8),
                restriction_dict={"range": ["1..2"]},
            ),
            is_leaf=True,
            yang_name="level-number",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="oc-isis-types:level-number",
            is_config=False,
        )
        self.__metric_style = YANGDynClass(
            base=RestrictedClassType(
                base_type=six.text_type,
                restriction_type="dict_key",
                restriction_arg={
                    "NARROW_METRIC": {},
                    "WIDE_METRIC": {}
                },
            ),
            is_leaf=True,
            yang_name="metric-style",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="oc-isis-types:metric-style",
            is_config=False,
        )
        self.__authentication_check = YANGDynClass(
            base=YANGBool,
            default=YANGBool("true"),
            is_leaf=True,
            yang_name="authentication-check",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="boolean",
            is_config=False,
        )

        load = kwargs.pop("load", None)
        if args:
            if len(args) > 1:
                raise TypeError(
                    "cannot create a YANG container with >1 argument")
            all_attr = True
            for e in self._pyangbind_elements:
                if not hasattr(args[0], e):
                    all_attr = False
                    break
            if not all_attr:
                raise ValueError(
                    "Supplied object did not have the correct attributes")
            for e in self._pyangbind_elements:
                nobj = getattr(args[0], e)
                if nobj._changed() is False:
                    continue
                setmethod = getattr(self, "_set_%s" % e)
                if load is None:
                    setmethod(getattr(args[0], e))
                else:
                    setmethod(getattr(args[0], e), load=load)
Ejemplo n.º 23
0
 def _unset_allow_multiple_as(self):
   self.__allow_multiple_as = YANGDynClass(base=YANGBool, default=YANGBool("false"), is_leaf=True, yang_name="allow-multiple-as", 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='boolean', is_config=False)
Ejemplo n.º 24
0
 def _unset_suppress(self):
   self.__suppress = YANGDynClass(base=YANGBool, default=YANGBool("false"), is_leaf=True, yang_name="suppress", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces/ip', defining_module='openconfig-if-ip', yang_type='boolean', is_config=False)
Ejemplo n.º 25
0
    def __init__(self, *args, **kwargs):

        self._path_helper = False

        self._extmethods = False
        self.__enabled = YANGDynClass(
            base=YANGBool,
            default=YANGBool("true"),
            is_leaf=True,
            yang_name="enabled",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/interfaces/ip",
            defining_module="openconfig-if-ip",
            yang_type="boolean",
            is_config=False,
        )
        self.__mtu = YANGDynClass(
            base=RestrictedClassType(
                base_type=RestrictedClassType(
                    base_type=long,
                    restriction_dict={"range": ["0..4294967295"]},
                    int_size=32,
                ),
                restriction_dict={"range": ["1280..max"]},
            ),
            is_leaf=True,
            yang_name="mtu",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/interfaces/ip",
            defining_module="openconfig-if-ip",
            yang_type="uint32",
            is_config=False,
        )
        self.__dup_addr_detect_transmits = 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="dup-addr-detect-transmits",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/interfaces/ip",
            defining_module="openconfig-if-ip",
            yang_type="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 __init__(self, *args, **kwargs):

        self._path_helper = False

        self._extmethods = False
        self.__name = YANGDynClass(
            base=six.text_type,
            is_leaf=True,
            yang_name="name",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            is_keyval=True,
            namespace='urn:ietf:params:xml:ns:yang:ietf-network-instance',
            defining_module='ietf-network-instance',
            yang_type='string',
            is_config=True)
        self.__enabled = YANGDynClass(
            base=YANGBool,
            default=YANGBool("true"),
            is_leaf=True,
            yang_name="enabled",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace='urn:ietf:params:xml:ns:yang:ietf-network-instance',
            defining_module='ietf-network-instance',
            yang_type='boolean',
            is_config=True)
        self.__description = YANGDynClass(
            base=six.text_type,
            is_leaf=True,
            yang_name="description",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace='urn:ietf:params:xml:ns:yang:ietf-network-instance',
            defining_module='ietf-network-instance',
            yang_type='string',
            is_config=True)
        self.__root_type = YANGDynClass(
            base=
            yc_root_type_ietf_network_instance__network_instances_network_instance_root_type,
            is_container='container',
            yang_name="root-type",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            extensions=None,
            namespace='urn:ietf:params:xml:ns:yang:ietf-network-instance',
            defining_module='ietf-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)
Ejemplo n.º 27
0
    def __init__(self, *args, **kwargs):

        self._path_helper = False

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

        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)
Ejemplo n.º 28
0
    def __init__(self, *args, **kwargs):

        self._path_helper = False

        self._extmethods = False
        self.__name = YANGDynClass(
            base=six.text_type,
            is_leaf=True,
            yang_name="name",
            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="string",
            is_config=False,
        )
        self.__sid_selection_mode = YANGDynClass(
            base=RestrictedClassType(
                base_type=six.text_type,
                restriction_type="dict_key",
                restriction_arg={
                    "ADJ_SID_ONLY": {},
                    "MIXED_MODE": {}
                },
            ),
            default=six.text_type("MIXED_MODE"),
            is_leaf=True,
            yang_name="sid-selection-mode",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="enumeration",
            is_config=False,
        )
        self.__sid_protection_required = YANGDynClass(
            base=YANGBool,
            default=YANGBool("false"),
            is_leaf=True,
            yang_name="sid-protection-required",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="boolean",
            is_config=False,
        )

        load = kwargs.pop("load", None)
        if args:
            if len(args) > 1:
                raise TypeError(
                    "cannot create a YANG container with >1 argument")
            all_attr = True
            for e in self._pyangbind_elements:
                if not hasattr(args[0], e):
                    all_attr = False
                    break
            if not all_attr:
                raise ValueError(
                    "Supplied object did not have the correct attributes")
            for e in self._pyangbind_elements:
                nobj = getattr(args[0], e)
                if nobj._changed() is False:
                    continue
                setmethod = getattr(self, "_set_%s" % e)
                if load is None:
                    setmethod(getattr(args[0], e))
                else:
                    setmethod(getattr(args[0], e), load=load)
Ejemplo n.º 29
0
 def _unset_enable_flow_control(self):
   self.__enable_flow_control = YANGDynClass(base=YANGBool, default=YANGBool("false"), is_leaf=True, yang_name="enable-flow-control", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces/ethernet', defining_module='openconfig-if-ethernet', yang_type='boolean', is_config=True)
Ejemplo n.º 30
0
    def __init__(self, *args, **kwargs):

        self._path_helper = False

        self._extmethods = False
        self.__receive = YANGDynClass(
            base=YANGBool,
            default=YANGBool("false"),
            is_leaf=True,
            yang_name="receive",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="boolean",
            is_config=False,
        )
        self.__send_max = YANGDynClass(
            base=RestrictedClassType(base_type=int,
                                     restriction_dict={"range": ["0..255"]},
                                     int_size=8),
            is_leaf=True,
            yang_name="send-max",
            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.__eligible_prefix_policy = YANGDynClass(
            base=six.text_type,
            is_leaf=True,
            yang_name="eligible-prefix-policy",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="leafref",
            is_config=False,
        )

        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)