ietf-netmod-yang

Non readable - YANG

心不动则不痛 提交于 2021-01-28 05:20:22
问题 There is a way to define non readable data in yang? module system{ leaf name{ type string; } leaf password{ type string; } } So in this case 'password' is the non readable data. 回答1: If you wish to make the data "unreadable", you can use binary built-in type, which enables you to set an arbitrary blob of bytes (base64 encoded) as the value for a leaf. Encrypted bytes included. leaf password { type binary; default "cGFzc3dvcmQ="; // <-- plain text "password" } 来源: https://stackoverflow.com

What's the difference between the include and import statement in NETCONF (.Yin/Yang files)

十年热恋 提交于 2020-07-07 05:43:34
问题 I understand that you can create a separate yang file (Something like a textual Convention to store syntax values for MIBS)and import it into another yang file to make the data more organised and structured, but I can't seem to understand what the include statement does differently? Does it "import" the entire file into the file that's including it - and if so would this be read before the file including it...? Please help :) 回答1: YANG relies heavily on a concept known as "namespaces", which

Parsing YANG Model in java

馋奶兔 提交于 2020-05-29 02:30:26
问题 How do I parse YANG models in java ? I need to convert the yang model into a xml format. I have already tried pyang. But since it is in python, it does not suite my requirement. 回答1: Yes, that's true. Use yang-parser-impl from Open daylight. It provides a yang parser and returns a set of parsed modules. Which you can further query to get more node objects. 回答2: The above API is valid for previous versions. Use the following API for the current version YangTextSchemaContextResolver

Yang parsing in JAVA

主宰稳场 提交于 2020-05-15 09:08:51
问题 I was looking to find a YANG parser and came across this question Parsing YANG Model in java I was wondering if there's any documentation for yang tools - API documentation or examples? 回答1: Try to check yangtools project in Opendaylight github. There is a folder named docs. If you try to compile it with maven, some documents will be created. I hope that they can help you. Regards 来源: https://stackoverflow.com/questions/26940723/yang-parsing-in-java

YANG: how to model nested lists configuration data without key

放肆的年华 提交于 2020-01-25 01:25:11
问题 I am trying to build YANG model for this configuration file that has lists without keys. However, Due to the necessity of key in YANG list, I wasn't able to build exact YANG model. Is there any idea how to represents list of list without key in YANG. The file includes acls in which there could be many acl like acl1, acl2 named by users and has rules as in the example below. acls: acl1: - rule: nw_src: 192.168.1.1/24 actions: allow: 1 - rule: actions: allow: 0 acl2: - rule: nw_src: 192.168.1.1

Netconf Notifications

断了今生、忘了曾经 提交于 2020-01-05 04:20:18
问题 RFC 5277 defines notification replay support. Just wondering what customer problems this notification replay can solve? What could be the need to scan through list of past notifications? At any point of time, controllers can always fire "get" RPC and determine current state. Any inputs on this are appreciated. 回答1: Notification replay is mostly required to sync NETCONF clients with servers without the need to do a full RPC. In some systems, the configuration + operational data becomes quite

usage of current vs ../ in yang xpath expressions

♀尐吖头ヾ 提交于 2019-12-31 05:06:47
问题 is the usage of .. and current() in the following snippet correct ? Meaning, there are times when current() and ../ are equivalent ? container c { leaf f1 { type string; } leaf f2 { type string; when "../f1 = 'abc'"; } leaf f3 { type string; when "current()/../f1 = 'abc'"; } } 回答1: The way you use current() in your example is correct, but redundant. current() returns the initial context node and since all expressions start with the initial context node in their contexts in makes no sense to

Conditional assignment of default values in yang

▼魔方 西西 提交于 2019-12-31 02:01:08
问题 I have two properties in a model: leaf protocol, leaf port. I want to specify that: if protocol = 'ssh' then default port value is 22, if protocol = 'http' then default port value is 80, etc. How do I express this in yang ? 回答1: There are no conditional default values in YANG - you need two default statements for two defaults with different values, and a single leaf may only have one default substatement. You can work around this, however. Perhaps by using a presence container instead of your