ietf-netmod-yang

Pyang support for Yang 1.1

走远了吗. 提交于 2019-12-24 11:54:17
问题 In our Application we use Pyang (pyang 1.7.3) for our Yang support. As of today our Application is complaint to RFC 6020, Yang 1.0. We would like to upgrade our Application to Support Yang 1.1, RFC7950. Any idea is Pyang 1.7.3 compatible with Yang 1.1? What is the stable release of Pyang wrt Yang 1.1 support? 回答1: It's been quite some time since I actively tracked pyang progress, but at that time it had most of 1.1 implemented - with the exception of the new definition contribution mechanism

Is it legal to GET all list instances in RESTCONF?

前提是你 提交于 2019-12-24 07:16:28
问题 Given the following YANG definitions, in module test : list machine { key "name"; leaf "name" { type string; } } and in data tree: "machine" : [ { "name": "a" }, { "name": "b" }, { "name": "c" } ] I want to know if the following request conforming to RESTCONF? GET /restconf/data/test/machine This request is expected to return all the list instances. I have this question because I don't have a clear understanding of the words from RESTCONF. In RESTCONF 3.5.3, If a data node in the path

Why does pyang validation allow to define a list without a valid key if the list is in a grouping?

此生再无相见时 提交于 2019-12-24 05:54:08
问题 The RFC6020 says: The "key" statement [...] takes as an argument a string that specifies a space-separated list of leaf identifiers of this list. [...] Each such leaf identifier MUST refer to a child leaf of the list. The leafs can be defined directly in substatements to the list, or in groupings used in the list. Despite this fact it is possible to successfully validate the below grouping in pyang: grouping my-grouping { list my-list-in-a-grouping { key there-is-no-such-leaf; } } If the list

understand YANG and its goals

白昼怎懂夜的黑 提交于 2019-12-22 11:23:11
问题 I've read https://en.wikipedia.org/wiki/YANG but still having problems to understand the practical use of YANG , and the benefits it provides. As I understand, it now is used not only by NETCONF, as was originally designed. YANG is not a language in a common sense, as C or python for instance, i.e. whatever we write in YANG is not compiled or translated; as I understand is is used as a reference model for a higher level library or application. Then the question is how does the high level code

How to exclude module name in leaf value of Identityref during ODL validation?

痴心易碎 提交于 2019-12-13 03:22:54
问题 I have YANG model and JSON object which will be verified by ODL (see bellow). I need to exclude module name from JSON to verify. When I exclude module name from identityref ("type": "center-car-sale-type:sedan") and send only identityref name ("type": "sedan") ODL throw exception that this identityref is not found. I want to send object without module name because "module name" + "identityref name" leads to mix metadata and instance. How can I set up ODL validation to avoid module name in

Regex to filter '*' and '?' special character in yang model

微笑、不失礼 提交于 2019-12-13 02:59:44
问题 I am trying to create a regex in yang model to not allow * and ? characters. String * and ? should not be allowed as input. .e.g. - abc* - should be okay - * - is not okay and should be rejected Similarly string ("?") should be rejected. Tried my hand with regex '[^ ?]+' which is rejecting any string with any occurrence of * and ?. .e.g abc*, *abc, * and ? all of them are rejected. 回答1: YANG uses the XML Schema (XSD) flavor of regular expressions, but this case would be similar in most

Is it legal to POST/PUT/PATCH list and leaf-list in RESTCONF?

♀尐吖头ヾ 提交于 2019-12-11 05:24:26
问题 This is a follow-up question of this post. From @predi's answer I know that it is legal to GET a URL whose target resource is a list or leaf-list and DELETE can't use such URL. That is to say, given the following YANG definitions: list machine { key "name"; leaf "name" { type string; } } The request GET /restconf/data/test/machine is legal. The request DELETE /restconf/data/test/machine is illegal. I want to confirm if other methods like POST , PUT or PATCH can use list or leaf-list as URL

Xpath current() in Yang

旧时模样 提交于 2019-12-11 03:08:33
问题 I have a leaf defined in Yang as: leaf test-must { type int32; description "Test must"; must "current() > 0" { error-message "test-must value should be > 0"; } } Looks like the underlying library, libxml2 , I use does not recognize current() when this is evaluated and returns error: error: xmlXPathCompOpEval: function current not found error: Unregistered function Are there any alternatives to current() ? Or where do I find definition for current() and register it? As an alternative I tried

XPath current() for Yang

若如初见. 提交于 2019-12-11 00:22:25
问题 This is my follow up question for Xpath current() in Yang After the earlier discussion, I implemented a customized function current() for libxml2 with implementation shown below. The function works fine as expected when it evaluates Xpath expressions like: leaf test-string { type string; must "current() > 0"; } But when more complex expressions are involved like Xpath expresion "interface[name=current()/supporting-interface]/type = 'optical'", it does not seem to be working fine. Anything I

JSON encoding of payload to RESTCONF server for multiple resources creation

邮差的信 提交于 2019-12-08 07:35:34
问题 Is it possible to send a single request of creating multiple resources at the top-level to a RESTCONF server? For example, consider the following YANG module: module example-foomod { namespace "http://example.com/foomod"; prefix "foomod"; container top { container under1{ leaf foo { type uint8; } } container under2{ leaf bar { type uint8; } } } } Can I send the following request to create two resources one time? Or Must I create one resource at a time? POST /restconf/data/example-foomod:top