diff options
author | 2023-01-05 09:31:25 -0500 | |
---|---|---|
committer | 2023-01-05 09:31:25 -0500 | |
commit | d4d6fbd430eb502cce6cb01a667ec799d487a510 (patch) | |
tree | aea94837cd313f27f68e625d2b8277960fdf7af6 /netconf/restconf/restconf-nb-bierman02/src/test/resources | |
parent | d0508aaeb7af3f29095d1d0ef7dbf69af18f0d99 (diff) |
Seed code for biermann restconf
Seed initial code from OpenDaylight netconf project for
Biermann draft version of restconf API
Issue-ID: CCSDK-3783
Signed-off-by: Dan Timoney <dtimoney@att.com>
Change-Id: I8a1ad2050ee7addbb480f01bd448922803bff31f
Diffstat (limited to 'netconf/restconf/restconf-nb-bierman02/src/test/resources')
280 files changed, 27487 insertions, 0 deletions
diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/common/augment/json/dataa.json b/netconf/restconf/restconf-nb-bierman02/src/test/resources/common/augment/json/dataa.json new file mode 100644 index 0000000..6097bd1 --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/common/augment/json/dataa.json @@ -0,0 +1,7 @@ +{ + "main:cont":{ + "augment-main-a:cont1":{ + "lf11":"lf11 value from a" + } + } +}
\ No newline at end of file diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/common/augment/json/datab.json b/netconf/restconf/restconf-nb-bierman02/src/test/resources/common/augment/json/datab.json new file mode 100644 index 0000000..297584a --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/common/augment/json/datab.json @@ -0,0 +1,7 @@ +{ + "main:cont":{ + "augment-main-b:cont1":{ + "lf11":"lf11 value from b" + } + } +}
\ No newline at end of file diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/common/augment/xml/dataa.xml b/netconf/restconf/restconf-nb-bierman02/src/test/resources/common/augment/xml/dataa.xml new file mode 100644 index 0000000..97c5ae5 --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/common/augment/xml/dataa.xml @@ -0,0 +1,5 @@ +<cont xmlns="ns:main"> + <cont1 xmlns="ns:augment:main:a"> + <lf11>lf11 value for a</lf11> + </cont1> +</cont>
\ No newline at end of file diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/common/augment/xml/datab.xml b/netconf/restconf/restconf-nb-bierman02/src/test/resources/common/augment/xml/datab.xml new file mode 100644 index 0000000..b7696ca --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/common/augment/xml/datab.xml @@ -0,0 +1,5 @@ +<cont xmlns="ns:main"> + <cont1 xmlns="ns:augment:main:b"> + <lf11>lf11 value for b</lf11> + </cont1> +</cont>
\ No newline at end of file diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/common/augment/yang/augment-main-a.yang b/netconf/restconf/restconf-nb-bierman02/src/test/resources/common/augment/yang/augment-main-a.yang new file mode 100644 index 0000000..aa3bf3f --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/common/augment/yang/augment-main-a.yang @@ -0,0 +1,20 @@ +module augment-main-a { + namespace "ns:augment:main:a"; + prefix "aumaa"; + + + import main {prefix mn; revision-date 2014-01-21;} + + + revision "2014-01-21" { + } + + augment "/mn:cont" { + container cont1 { + leaf lf11 { + type string; + } + } + } + +} diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/common/augment/yang/augment-main-b.yang b/netconf/restconf/restconf-nb-bierman02/src/test/resources/common/augment/yang/augment-main-b.yang new file mode 100644 index 0000000..dcf493d --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/common/augment/yang/augment-main-b.yang @@ -0,0 +1,20 @@ +module augment-main-b { + namespace "ns:augment:main:b"; + prefix "aumab"; + + + import main {prefix mn; revision-date 2014-01-21;} + + + revision "2014-01-21" { + } + + augment "/mn:cont" { + container cont1 { + leaf lf11 { + type string; + } + } + } + +} diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/common/augment/yang/main.yang b/netconf/restconf/restconf-nb-bierman02/src/test/resources/common/augment/yang/main.yang new file mode 100644 index 0000000..e291722 --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/common/augment/yang/main.yang @@ -0,0 +1,10 @@ +module main { + namespace "ns:main"; + prefix "ma"; + + revision "2014-01-21" { + } + + container cont { + } +}
\ No newline at end of file diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/datastore-and-scope-specification/opendaylight-inventory.yang b/netconf/restconf/restconf-nb-bierman02/src/test/resources/datastore-and-scope-specification/opendaylight-inventory.yang new file mode 100644 index 0000000..e4247be --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/datastore-and-scope-specification/opendaylight-inventory.yang @@ -0,0 +1,19 @@ +module opendaylight-inventory { + namespace "urn:opendaylight:inventory"; + prefix inv; + + revision "2013-08-19" { + description "Initial revision of Inventory model"; + } + + + container nodes { + list node { + key "id"; + leaf id { + type string; + } + } + } + +} diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/datastore-and-scope-specification/sal-remote-augment.yang b/netconf/restconf/restconf-nb-bierman02/src/test/resources/datastore-and-scope-specification/sal-remote-augment.yang new file mode 100644 index 0000000..cdc8c69 --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/datastore-and-scope-specification/sal-remote-augment.yang @@ -0,0 +1,39 @@ +module sal-remote-augment { + + yang-version 1; + namespace "urn:sal:restconf:event:subscription"; + prefix "salrmt-aug-ev-subscr"; + + import sal-remote {prefix salrmt; revision-date "2014-01-14";} + + description + "Added input parameters to rpc create-data-change-event-subscription"; + + revision "2014-07-08" { + } + + augment "/salrmt:create-data-change-event-subscription/salrmt:input" { + leaf datastore { + type enumeration { + enum OPERATIONAL; + enum CONFIGURATION; + } + } + leaf scope { + type enumeration { + enum BASE; + enum ONE; + enum SUBTREE; + } + } + leaf notification-output-type { + type enumeration { + enum JSON; + enum XML; + } + default "XML"; + description "Input parameter which type of output will be parsed on notification"; + } + } + +} diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/datastore-and-scope-specification/sal-remote@2014-01-14.yang b/netconf/restconf/restconf-nb-bierman02/src/test/resources/datastore-and-scope-specification/sal-remote@2014-01-14.yang new file mode 100644 index 0000000..d12e252 --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/datastore-and-scope-specification/sal-remote@2014-01-14.yang @@ -0,0 +1,98 @@ +module sal-remote { + + yang-version 1; + namespace "urn:opendaylight:params:xml:ns:yang:controller:md:sal:remote"; + prefix "sal-remote"; + + + organization "Cisco Systems, Inc."; + contact "Martin Bobak <mbobak@cisco.com>"; + + description + "This module contains the definition of methods related to + sal remote model. + + Copyright (c)2013 Cisco Systems, Inc. All rights reserved. + + This program and the accompanying materials are made available + under the terms of the Eclipse Public License v1.0 which + accompanies this distribution, and is available at + http://www.eclipse.org/legal/epl-v10.html"; + + revision "2014-01-14" { + description + "Initial revision"; + } + + + typedef q-name { + type string; + reference + "http://www.w3.org/TR/2004/REC-xmlschema-2-20041028/#QName"; + } + + rpc create-data-change-event-subscription { + input { + leaf path { + type instance-identifier; + description "Subtree path. "; + } + } + output { + leaf stream-name { + type string; + description "Notification stream name."; + } + } + } + + notification data-changed-notification { + description "Data change notification."; + list data-change-event { + key path; + leaf path { + type instance-identifier; + } + leaf store { + type enumeration { + enum config; + enum operation; + } + } + leaf operation { + type enumeration { + enum created; + enum updated; + enum deleted; + } + } + anyxml data{ + description "DataObject "; + } + } + } + + rpc create-notification-stream { + input { + leaf-list notifications { + type q-name; + description "Notification QNames"; + } + } + output { + leaf notification-stream-identifier { + type string; + description "Unique notification stream identifier, in which notifications will be propagated"; + } + } + } + + rpc begin-transaction{ + output{ + anyxml data-modification-transaction{ + description "DataModificationTransaction xml"; + } + } + } + +}
\ No newline at end of file diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/decoding-exception/yang/number.yang b/netconf/restconf/restconf-nb-bierman02/src/test/resources/decoding-exception/yang/number.yang new file mode 100644 index 0000000..c463882 --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/decoding-exception/yang/number.yang @@ -0,0 +1,17 @@ + module number { + + namespace "number"; + prefix "number"; + + revision 2014-04-24 { + } + + + + container cont { + leaf lf { + type uint8; + } + + } + } diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/equal-data-node-names/equal-name-data-for-container.json b/netconf/restconf/restconf-nb-bierman02/src/test/resources/equal-data-node-names/equal-name-data-for-container.json new file mode 100644 index 0000000..78b097d --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/equal-data-node-names/equal-name-data-for-container.json @@ -0,0 +1,16 @@ +{ + "cont":{ + "cont1":[ + { + "lst11":{ + "lf111":"value1" + } + }, + { + "lst11":{ + "lf111":"value2" + } + } + ] + } +}
\ No newline at end of file diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/equal-data-node-names/equal-name-data-for-container.xml b/netconf/restconf/restconf-nb-bierman02/src/test/resources/equal-data-node-names/equal-name-data-for-container.xml new file mode 100644 index 0000000..26a1f5f --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/equal-data-node-names/equal-name-data-for-container.xml @@ -0,0 +1,12 @@ +<cont> + <cont1> + <lst11> + <lf111>value1</lf111> + </lst11> + </cont1> + <cont1> + <lst11> + <lf111>value1</lf111> + </lst11> + </cont1> +</cont>
\ No newline at end of file diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/equal-data-node-names/equal-name-data-for-leaf.json b/netconf/restconf/restconf-nb-bierman02/src/test/resources/equal-data-node-names/equal-name-data-for-leaf.json new file mode 100644 index 0000000..d0a9fd4 --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/equal-data-node-names/equal-name-data-for-leaf.json @@ -0,0 +1,15 @@ +{ + "cont":{ + "cont1":{ + "lst11":[ + { + "lf111":"value1", + "lf111":"value2" + }, + { + "lf111":"value3" + } + ] + } + } +}
\ No newline at end of file diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/equal-data-node-names/equal-name-data-for-leaf.xml b/netconf/restconf/restconf-nb-bierman02/src/test/resources/equal-data-node-names/equal-name-data-for-leaf.xml new file mode 100644 index 0000000..4221c2d --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/equal-data-node-names/equal-name-data-for-leaf.xml @@ -0,0 +1,11 @@ +<cont> + <cont1> + <lst11> + <lf111>value1</lf111>, + <lf111>value2</lf111>, + </lst11> + <lst11> + <lf111>value3</lf111>, + </lst11> + </cont1> +</cont>
\ No newline at end of file diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/equal-data-node-names/yang/equal-data-node-names.yang b/netconf/restconf/restconf-nb-bierman02/src/test/resources/equal-data-node-names/yang/equal-data-node-names.yang new file mode 100644 index 0000000..3a3653a --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/equal-data-node-names/yang/equal-data-node-names.yang @@ -0,0 +1,18 @@ +/* bug 1204 */ +module equal-data-node-names { + namespace "ns:equal:data:node:names"; + + prefix "eqdanona"; + revision 2014-06-26 { + } + + container cont { + container cont1 { + list lst11 { + leaf lf111 { + type string; + } + } + } + } +}
\ No newline at end of file diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/foo-xml-test/foo.xml b/netconf/restconf/restconf-nb-bierman02/src/test/resources/foo-xml-test/foo.xml new file mode 100644 index 0000000..96b69c4 --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/foo-xml-test/foo.xml @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="UTF-8"?>
+<top-level-list xmlns="foo">
+ <key-leaf>key-value</key-leaf>
+ <ordinary-leaf>leaf-value</ordinary-leaf>
+</top-level-list>
\ No newline at end of file diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/foo-xml-test/yang/foo.yang b/netconf/restconf/restconf-nb-bierman02/src/test/resources/foo-xml-test/yang/foo.yang new file mode 100644 index 0000000..ceed3d9 --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/foo-xml-test/yang/foo.yang @@ -0,0 +1,18 @@ +module foo {
+ namespace foo;
+ prefix foo;
+
+ revision 2017-08-09;
+
+ list top-level-list {
+ key key-leaf;
+
+ leaf key-leaf {
+ type string;
+ }
+
+ leaf ordinary-leaf {
+ type string;
+ }
+ }
+}
\ No newline at end of file diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/full-versions/make-toast-rpc-input.json b/netconf/restconf/restconf-nb-bierman02/src/test/resources/full-versions/make-toast-rpc-input.json new file mode 100644 index 0000000..1bba146 --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/full-versions/make-toast-rpc-input.json @@ -0,0 +1,7 @@ +{ + "input" : + { + "toaster:toasterDoneness" : "10", + "toaster:toasterToastType": "wheat-bread" + } +}
\ No newline at end of file diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/full-versions/test-data2/data-rpc-input.json b/netconf/restconf/restconf-nb-bierman02/src/test/resources/full-versions/test-data2/data-rpc-input.json new file mode 100644 index 0000000..0eae37a --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/full-versions/test-data2/data-rpc-input.json @@ -0,0 +1,10 @@ +{ + "test-module:input":{ + "cont":{ + "cont1":{ + "lf11":"lf1 data", + "lf12":"lf2 data" + } + } + } +}
\ No newline at end of file diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/full-versions/test-data2/data-rpc-input.xml b/netconf/restconf/restconf-nb-bierman02/src/test/resources/full-versions/test-data2/data-rpc-input.xml new file mode 100644 index 0000000..fb9726d --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/full-versions/test-data2/data-rpc-input.xml @@ -0,0 +1,8 @@ +<input xmlns="test:module"> + <cont> + <cont1> + <lf11>lf1 data</lf11> + <lf12>lf2 data</lf12> + </cont1> + </cont> +</input>
\ No newline at end of file diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/full-versions/test-data2/data2.xml b/netconf/restconf/restconf-nb-bierman02/src/test/resources/full-versions/test-data2/data2.xml new file mode 100644 index 0000000..db2f4e9 --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/full-versions/test-data2/data2.xml @@ -0,0 +1,6 @@ +<cont xmlns="test:module"> + <cont1> + <lf11>lf1 data</lf11> + <lf12>lf2 data</lf12> + </cont1> +</cont> diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/full-versions/test-data2/data3.xml b/netconf/restconf/restconf-nb-bierman02/src/test/resources/full-versions/test-data2/data3.xml new file mode 100644 index 0000000..b7b05d1 --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/full-versions/test-data2/data3.xml @@ -0,0 +1,4 @@ +<cont1 xmlns="test:module"> + <lf11>lf1 data</lf11> + <lf12>lf2 data</lf12> +</cont1> diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/full-versions/test-data2/data4.xml b/netconf/restconf/restconf-nb-bierman02/src/test/resources/full-versions/test-data2/data4.xml new file mode 100644 index 0000000..3ce6741 --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/full-versions/test-data2/data4.xml @@ -0,0 +1,6 @@ + +<cont1 xmlns="test:module"> + <lf11>lf1 data</lf11> + <lf12>lf2 data</lf12> +</cont1> + diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/full-versions/test-data2/data5.xml b/netconf/restconf/restconf-nb-bierman02/src/test/resources/full-versions/test-data2/data5.xml new file mode 100644 index 0000000..89aa782 --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/full-versions/test-data2/data5.xml @@ -0,0 +1,8 @@ +<interfaces xmlns="test:module"> + <class> + <name>John</name> + <address>F.C.I 43</address> + <email>j@j</email> + </class> +</interfaces> + diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/full-versions/test-data2/data6.xml b/netconf/restconf/restconf-nb-bierman02/src/test/resources/full-versions/test-data2/data6.xml new file mode 100644 index 0000000..7feb6bf --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/full-versions/test-data2/data6.xml @@ -0,0 +1,6 @@ +<class xmlns="test:module"> + <name>John</name> + <address>F.C.I 43</address> + <email>j@j</email> +</class> + diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/full-versions/test-data2/data7.xml b/netconf/restconf/restconf-nb-bierman02/src/test/resources/full-versions/test-data2/data7.xml new file mode 100644 index 0000000..4374277 --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/full-versions/test-data2/data7.xml @@ -0,0 +1,8 @@ +<data xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"> + <cont xmlns="test:module"> + <cont1> + <lf11>lf1 data</lf11> + <lf12>lf2 data</lf12> + </cont1> + </cont> +</data>
\ No newline at end of file diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/full-versions/test-module/test-module.yang b/netconf/restconf/restconf-nb-bierman02/src/test/resources/full-versions/test-module/test-module.yang new file mode 100644 index 0000000..2cc78b3 --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/full-versions/test-module/test-module.yang @@ -0,0 +1,101 @@ +module test-module { + namespace "test:module"; + prefix tstmod; + + revision 2014-01-09 { + } + + identity module-type { + } + + identity test-identity { + } + + container interfaces { + container class { + leaf name { + type string; + } + leaf address { + type string; + } + leaf email { + type string; + } + } + } + + container cont { + container cont1 { + leaf lf11 { + type string; + } + leaf lf12 { + type string; + } + } + list lst1 { + key "lf11"; + leaf lf11 { + type string; + } + } + } + + container modules { + list module { + key "type name"; + leaf name { + type string; + mandatory true; + } + + leaf type { + type identityref { + base module-type; + } + mandatory true; + } + + leaf data { + type string; + } + } + } + + list lst-with-composite-key { + key "key1 key2"; + leaf key1 { + type string; + } + leaf key2 { + type uint8; + } + } + + rpc no-payload-rpc-test { + output { + container cont-output { + } + } + } + + rpc rpc-test { + input { + container cont { + container cont1 { + leaf lf11 { + type string; + } + leaf lf12 { + type string; + } + } + } + } + output { + container cont-output { + } + } + } +}
\ No newline at end of file diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/full-versions/testCont1Data.json b/netconf/restconf/restconf-nb-bierman02/src/test/resources/full-versions/testCont1Data.json new file mode 100644 index 0000000..c7554f7 --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/full-versions/testCont1Data.json @@ -0,0 +1,6 @@ +{ + "cont1": { + "lf11": "lf11 data", + "lf12": "lf12 data" + } +}
\ No newline at end of file diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/full-versions/testCont1DataPatch.json b/netconf/restconf/restconf-nb-bierman02/src/test/resources/full-versions/testCont1DataPatch.json new file mode 100644 index 0000000..a8d6799 --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/full-versions/testCont1DataPatch.json @@ -0,0 +1,20 @@ +{ + "ietf-restconf:yang-patch" : { + "patch-id" : "0", + "edit" : [ + { + "edit-id" : "edit1", + "operation" : "create", + "target" : "", + "value" : + { + "cont1": + { + "lf11": "lf11 data", + "lf12": "lf12 data" + } + } + } + ] + } +}
\ No newline at end of file diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/full-versions/testData.json b/netconf/restconf/restconf-nb-bierman02/src/test/resources/full-versions/testData.json new file mode 100644 index 0000000..a736067 --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/full-versions/testData.json @@ -0,0 +1,92 @@ +{ + "interfaces": { + "interface": [ + { + "name": "eth0", + "type": "ethernetCsmacd", + "enabled": false + }, + { + "name": "eth1", + "type": "ethernetCsmacd", + "enabled": true, + "vlan-tagging": true + }, + { + "name": "eth1.10", + "type": "l2vlan", + "enabled": true, + "base-interface": "eth1", + "vlan-id": 10 + }, + { + "name": "lo1", + "type": "softwareLoopback", + "enabled": true + } + ] + }, + "interfaces-state": { + "interface": [ + { + "name": "eth0", + "type": "ethernetCsmacd", + "admin-status": "down", + "oper-status": "down", + "if-index": 2, + "phys-address": "00:01:02:03:04:05", + "statistics": { + "discontinuity-time": "2013-04-01T03:00:00+00:00" + } + }, + { + "name": "eth1", + "type": "ethernetCsmacd", + "admin-status": "up", + "oper-status": "up", + "if-index": 7, + "phys-address": "00:01:02:03:04:06", + "higher-layer-if": [ + "eth1.10" + ], + "statistics": { + "discontinuity-time": "2013-04-01T03:00:00+00:00" + } + }, + { + "name": "eth1.10", + "type": "l2vlan", + "admin-status": "up", + "oper-status": "up", + "if-index": 9, + "lower-layer-if": [ + "eth1" + ], + "statistics": { + "discontinuity-time": "2013-04-01T03:00:00+00:00" + } + }, + { + "name": "eth2", + "type": "ethernetCsmacd", + "admin-status": "down", + "oper-status": "down", + "if-index": 8, + "phys-address": "00:01:02:03:04:07", + "statistics": { + "discontinuity-time": "2013-04-01T03:00:00+00:00" + } + }, + { + "name": "lo1", + "type": "softwareLoopback", + "admin-status": "up", + "oper-status": "up", + "if-index": 1, + "statistics": { + "discontinuity-time": "2013-04-01T03:00:00+00:00" + } + } + ] + } +}
\ No newline at end of file diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/full-versions/testData.xml b/netconf/restconf/restconf-nb-bierman02/src/test/resources/full-versions/testData.xml new file mode 100644 index 0000000..bdd9c10 --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/full-versions/testData.xml @@ -0,0 +1,120 @@ +<rpc-reply + xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" + message-id="101"> + <data> + + <interfaces + xmlns="urn:ietf:params:xml:ns:yang:ietf-interfaces" + xmlns:vlan="http://example.com/vlan"> + + <interface> + <name>eth0</name> + <type>ethernetCsmacd</type> + <enabled>false</enabled> + </interface> + + <interface> + <name>eth1</name> + <type>ethernetCsmacd</type> + <enabled>true</enabled> + <vlan:vlan-tagging>true</vlan:vlan-tagging> + </interface> + + <interface> + <name>eth1.10</name> + <type>l2vlan</type> + <enabled>true</enabled> + <vlan:base-interface>eth1</vlan:base-interface> + <vlan:vlan-id>10</vlan:vlan-id> + </interface> + + <interface> + <name>lo1</name> + <type>softwareLoopback</type> + <enabled>true</enabled> + </interface> + + </interfaces> + + <interfaces-state + xmlns="urn:ietf:params:xml:ns:yang:ietf-interfaces"> + + <interface> + <name>eth0</name> + <type>ethernetCsmacd</type> + <admin-status>down</admin-status> + <oper-status>down</oper-status> + <if-index>2</if-index> + <phys-address>00:01:02:03:04:05</phys-address> + <statistics> + <discontinuity-time> + 2013-04-01T03:00:00+00:00 + </discontinuity-time> + <!-- counters now shown here --> + </statistics> + </interface> + + <interface> + <name>eth1</name> + <type>ethernetCsmacd</type> + <admin-status>up</admin-status> + <oper-status>up</oper-status> + <if-index>7</if-index> + <phys-address>00:01:02:03:04:06</phys-address> + <higher-layer-if>eth1.10</higher-layer-if> + <statistics> + <discontinuity-time> + 2013-04-01T03:00:00+00:00 + </discontinuity-time> + <!-- counters now shown here --> + </statistics> + </interface> + + <interface> + <name>eth1.10</name> + <type>l2vlan</type> + <admin-status>up</admin-status> + <oper-status>up</oper-status> + <if-index>9</if-index> + <lower-layer-if>eth1</lower-layer-if> + <statistics> + <discontinuity-time> + 2013-04-01T03:00:00+00:00 + </discontinuity-time> + <!-- counters now shown here --> + </statistics> + </interface> + + <!-- This interface is not configured --> + <interface> + <name>eth2</name> + <type>ethernetCsmacd</type> + <admin-status>down</admin-status> + <oper-status>down</oper-status> + <if-index>8</if-index> + <phys-address>00:01:02:03:04:07</phys-address> + <statistics> + <discontinuity-time> + 2013-04-01T03:00:00+00:00 + </discontinuity-time> + <!-- counters now shown here --> + </statistics> + </interface> + + <interface> + <name>lo1</name> + <type>softwareLoopback</type> + <admin-status>up</admin-status> + <oper-status>up</oper-status> + <if-index>1</if-index> + <statistics> + <discontinuity-time> + 2013-04-01T03:00:00+00:00 + </discontinuity-time> + <!-- counters now shown here --> + </statistics> + </interface> + + </interfaces-state> + </data> +</rpc-reply>
\ No newline at end of file diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/full-versions/yangs/ex-vlan.yang b/netconf/restconf/restconf-nb-bierman02/src/test/resources/full-versions/yangs/ex-vlan.yang new file mode 100644 index 0000000..59369ad --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/full-versions/yangs/ex-vlan.yang @@ -0,0 +1,47 @@ +module ex-vlan { + namespace "http://example.com/vlan"; + prefix "vlan"; + + import ietf-interfaces { + prefix if; + } + + revision 2013-10-22 { + description + "Initial revision."; + reference + "RFC A YANG Data Model for Interface Management draft-ietf-netmod-interfaces-cfg-12 - Appendix C"; + } + + augment "/if:interfaces/if:interface" { + when "if:type = 'ethernetCsmacd' or + if:type = 'ieee8023adLag'"; + leaf vlan-tagging { + type boolean; + default false; + } + } + + augment "/if:interfaces/if:interface" { + when "if:type = 'l2vlan'"; + + leaf base-interface { + type if:interface-ref; + must "/if:interfaces/if:interface[if:name = current()]" + + "/vlan:vlan-tagging = 'true'" { + description + "The base interface must have vlan tagging enabled."; + } + } + leaf vlan-id { + type uint16 { + range "1..4094"; + } + must "../base-interface" { + description + "If a vlan-id is defined, a base-interface must + be specified."; + } + } + } +}
\ No newline at end of file diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/full-versions/yangs/iana-if-type.yang b/netconf/restconf/restconf-nb-bierman02/src/test/resources/full-versions/yangs/iana-if-type.yang new file mode 100644 index 0000000..7bd0003 --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/full-versions/yangs/iana-if-type.yang @@ -0,0 +1,1517 @@ +module iana-if-type { + namespace "urn:ietf:params:xml:ns:yang:iana-if-type"; + prefix ianaift; + + organization "IANA"; + contact + " Internet Assigned Numbers Authority + + Postal: ICANN + 4676 Admiralty Way, Suite 330 + Marina del Rey, CA 90292 + + Tel: +1 310 823 9358 + E-Mail: iana&iana.org"; + description + "This YANG module defines the iana-if-type typedef, which + contains YANG definitions for IANA-registered interface types. + + This YANG module is maintained by IANA, and reflects the + 'ifType definitions' registry. + + The latest revision of this YANG module can be obtained from + the IANA web site. + + Copyright (c) 2011 IETF Trust and the persons identified as + authors of the code. All rights reserved. + + Redistribution and use in source and binary forms, with or + without modification, is permitted pursuant to, and subject + to the license terms contained in, the Simplified BSD License + set forth in Section 4.c of the IETF Trust's Legal Provisions + Relating to IETF Documents + (http://trustee.ietf.org/license-info). + + This version of this YANG module is part of RFC XXXX; see + the RFC itself for full legal notices."; + // RFC Ed.: replace XXXX with actual RFC number and remove this + // note. + + // RFC Ed.: update the date below with the date of RFC publication + // and remove this note. + revision 2013-07-04 { + description + "Initial revision."; + reference + "RFC XXXX: IANA Interface Type YANG Module"; + } + + typedef iana-if-type { + type enumeration { + enum "other" { + value 1; + description + "None of the following"; + } + enum "regular1822" { + value 2; + } + enum "hdh1822" { + value 3; + } + enum "ddnX25" { + value 4; + } + enum "rfc877x25" { + value 5; + reference + "RFC 1382 - SNMP MIB Extension for the X.25 Packet Layer"; + } + enum "ethernetCsmacd" { + value 6; + description + "For all ethernet-like interfaces, regardless of speed, + as per RFC3635."; + reference + "RFC 3635 - Definitions of Managed Objects for the + Ethernet-like Interface Types."; + } + enum "iso88023Csmacd" { + value 7; + status deprecated; + description + "Deprecated via RFC3635. + Use ethernetCsmacd(6) instead."; + reference + "RFC 3635 - Definitions of Managed Objects for the + Ethernet-like Interface Types."; + } + enum "iso88024TokenBus" { + value 8; + } + enum "iso88025TokenRing" { + value 9; + } + enum "iso88026Man" { + value 10; + } + enum "starLan" { + value 11; + status deprecated; + description + "Deprecated via RFC3635. + Use ethernetCsmacd(6) instead."; + reference + "RFC 3635 - Definitions of Managed Objects for the + Ethernet-like Interface Types."; + } + enum "proteon10Mbit" { + value 12; + } + enum "proteon80Mbit" { + value 13; + } + enum "hyperchannel" { + value 14; + } + enum "fddi" { + value 15; + reference + "RFC 1512 - FDDI Management Information Base"; + } + enum "lapb" { + value 16; + reference + "RFC 1381 - SNMP MIB Extension for X.25 LAPB"; + } + enum "sdlc" { + value 17; + } + enum "ds1" { + value 18; + description + "DS1-MIB"; + reference + "RFC 4805 - Definitions of Managed Objects for the + DS1, J1, E1, DS2, and E2 Interface Types"; + } + enum "e1" { + value 19; + status obsolete; + description + "Obsolete see DS1-MIB"; + reference + "RFC 4805 - Definitions of Managed Objects for the + DS1, J1, E1, DS2, and E2 Interface Types"; + } + enum "basicISDN" { + value 20; + description + "see also RFC2127"; + } + enum "primaryISDN" { + value 21; + } + enum "propPointToPointSerial" { + value 22; + description + "proprietary serial"; + } + enum "ppp" { + value 23; + } + enum "softwareLoopback" { + value 24; + } + enum "eon" { + value 25; + description + "CLNP over IP"; + } + enum "ethernet3Mbit" { + value 26; + } + enum "nsip" { + value 27; + description + "XNS over IP"; + } + enum "slip" { + value 28; + description + "generic SLIP"; + } + enum "ultra" { + value 29; + description + "ULTRA technologies"; + } + enum "ds3" { + value 30; + description + "DS3-MIB"; + reference + "RFC 3896 - Definitions of Managed Objects for the + DS3/E3 Interface Type"; + } + enum "sip" { + value 31; + description + "SMDS, coffee"; + reference + "RFC 1694 - Definitions of Managed Objects for SMDS + Interfaces using SMIv2"; + } + enum "frameRelay" { + value 32; + description + "DTE only."; + reference + "RFC 2115 - Management Information Base for Frame Relay + DTEs Using SMIv2"; + } + enum "rs232" { + value 33; + reference + "RFC 1659 - Definitions of Managed Objects for RS-232-like + Hardware Devices using SMIv2"; + } + enum "para" { + value 34; + description + "parallel-port"; + reference + "RFC 1660 - Definitions of Managed Objects for + Parallel-printer-like Hardware Devices using + SMIv2"; + } + enum "arcnet" { + value 35; + description + "arcnet"; + } + enum "arcnetPlus" { + value 36; + description + "arcnet plus"; + } + enum "atm" { + value 37; + description + "ATM cells"; + } + enum "miox25" { + value 38; + reference + "RFC 1461 - SNMP MIB extension for Multiprotocol + Interconnect over X.25"; + } + enum "sonet" { + value 39; + description + "SONET or SDH"; + } + enum "x25ple" { + value 40; + reference + "RFC 2127 - ISDN Management Information Base using SMIv2"; + } + enum "iso88022llc" { + value 41; + } + enum "localTalk" { + value 42; + } + enum "smdsDxi" { + value 43; + } + enum "frameRelayService" { + value 44; + description + "FRNETSERV-MIB"; + reference + "RFC 2954 - Definitions of Managed Objects for Frame + Relay Service"; + } + enum "v35" { + value 45; + } + enum "hssi" { + value 46; + } + enum "hippi" { + value 47; + } + enum "modem" { + value 48; + description + "Generic modem"; + } + enum "aal5" { + value 49; + description + "AAL5 over ATM"; + } + enum "sonetPath" { + value 50; + } + enum "sonetVT" { + value 51; + } + enum "smdsIcip" { + value 52; + description + "SMDS InterCarrier Interface"; + } + enum "propVirtual" { + value 53; + description + "proprietary virtual/internal"; + reference + "RFC 2863 - The Interfaces Group MIB"; + } + enum "propMultiplexor" { + value 54; + description + "proprietary multiplexing"; + reference + "RFC 2863 - The Interfaces Group MIB"; + } + enum "ieee80212" { + value 55; + description + "100BaseVG"; + } + enum "fibreChannel" { + value 56; + description + "Fibre Channel"; + } + enum "hippiInterface" { + value 57; + description + "HIPPI interfaces"; + } + enum "frameRelayInterconnect" { + value 58; + status obsolete; + description + "Obsolete use either + frameRelay(32) or frameRelayService(44)."; + } + enum "aflane8023" { + value 59; + description + "ATM Emulated LAN for 802.3"; + } + enum "aflane8025" { + value 60; + description + "ATM Emulated LAN for 802.5"; + } + enum "cctEmul" { + value 61; + description + "ATM Emulated circuit"; + } + enum "fastEther" { + value 62; + status deprecated; + description + "Obsoleted via RFC3635. + ethernetCsmacd(6) should be used instead"; + reference + "RFC 3635 - Definitions of Managed Objects for the + Ethernet-like Interface Types."; + } + enum "isdn" { + value 63; + description + "ISDN and X.25"; + reference + "RFC 1356 - Multiprotocol Interconnect on X.25 and ISDN + in the Packet Mode"; + } + enum "v11" { + value 64; + description + "CCITT V.11/X.21"; + } + enum "v36" { + value 65; + description + "CCITT V.36"; + } + enum "g703at64k" { + value 66; + description + "CCITT G703 at 64Kbps"; + } + enum "g703at2mb" { + value 67; + status obsolete; + description + "Obsolete see DS1-MIB"; + } + enum "qllc" { + value 68; + description + "SNA QLLC"; + } + enum "fastEtherFX" { + value 69; + status deprecated; + description + "Obsoleted via RFC3635 + ethernetCsmacd(6) should be used instead"; + reference + "RFC 3635 - Definitions of Managed Objects for the + Ethernet-like Interface Types."; + } + enum "channel" { + value 70; + description + "channel"; + } + enum "ieee80211" { + value 71; + description + "radio spread spectrum"; + } + enum "ibm370parChan" { + value 72; + description + "IBM System 360/370 OEMI Channel"; + } + enum "escon" { + value 73; + description + "IBM Enterprise Systems Connection"; + } + enum "dlsw" { + value 74; + description + "Data Link Switching"; + } + enum "isdns" { + value 75; + description + "ISDN S/T interface"; + } + enum "isdnu" { + value 76; + description + "ISDN U interface"; + } + enum "lapd" { + value 77; + description + "Link Access Protocol D"; + } + enum "ipSwitch" { + value 78; + description + "IP Switching Objects"; + } + enum "rsrb" { + value 79; + description + "Remote Source Route Bridging"; + } + enum "atmLogical" { + value 80; + description + "ATM Logical Port"; + reference + "RFC 3606 - Definitions of Supplemental Managed Objects + for ATM Interface"; + } + enum "ds0" { + value 81; + description + "Digital Signal Level 0"; + reference + "RFC 2494 - Definitions of Managed Objects for the DS0 + and DS0 Bundle Interface Type"; + } + enum "ds0Bundle" { + value 82; + description + "group of ds0s on the same ds1"; + reference + "RFC 2494 - Definitions of Managed Objects for the DS0 + and DS0 Bundle Interface Type"; + } + enum "bsc" { + value 83; + description + "Bisynchronous Protocol"; + } + enum "async" { + value 84; + description + "Asynchronous Protocol"; + } + enum "cnr" { + value 85; + description + "Combat Net Radio"; + } + enum "iso88025Dtr" { + value 86; + description + "ISO 802.5r DTR"; + } + enum "eplrs" { + value 87; + description + "Ext Pos Loc Report Sys"; + } + enum "arap" { + value 88; + description + "Appletalk Remote Access Protocol"; + } + enum "propCnls" { + value 89; + description + "Proprietary Connectionless Protocol"; + } + enum "hostPad" { + value 90; + description + "CCITT-ITU X.29 PAD Protocol"; + } + enum "termPad" { + value 91; + description + "CCITT-ITU X.3 PAD Facility"; + } + enum "frameRelayMPI" { + value 92; + description + "Multiproto Interconnect over FR"; + } + enum "x213" { + value 93; + description + "CCITT-ITU X213"; + } + enum "adsl" { + value 94; + description + "Asymmetric Digital Subscriber Loop"; + } + enum "radsl" { + value 95; + description + "Rate-Adapt. Digital Subscriber Loop"; + } + enum "sdsl" { + value 96; + description + "Symmetric Digital Subscriber Loop"; + } + enum "vdsl" { + value 97; + description + "Very H-Speed Digital Subscrib. Loop"; + } + enum "iso88025CRFPInt" { + value 98; + description + "ISO 802.5 CRFP"; + } + enum "myrinet" { + value 99; + description + "Myricom Myrinet"; + } + enum "voiceEM" { + value 100; + description + "voice recEive and transMit"; + } + enum "voiceFXO" { + value 101; + description + "voice Foreign Exchange Office"; + } + enum "voiceFXS" { + value 102; + description + "voice Foreign Exchange Station"; + } + enum "voiceEncap" { + value 103; + description + "voice encapsulation"; + } + enum "voiceOverIp" { + value 104; + description + "voice over IP encapsulation"; + } + enum "atmDxi" { + value 105; + description + "ATM DXI"; + } + enum "atmFuni" { + value 106; + description + "ATM FUNI"; + } + enum "atmIma" { + value 107; + description + "ATM IMA"; + } + enum "pppMultilinkBundle" { + value 108; + description + "PPP Multilink Bundle"; + } + enum "ipOverCdlc" { + value 109; + description + "IBM ipOverCdlc"; + } + enum "ipOverClaw" { + value 110; + description + "IBM Common Link Access to Workstn"; + } + enum "stackToStack" { + value 111; + description + "IBM stackToStack"; + } + enum "virtualIpAddress" { + value 112; + description + "IBM VIPA"; + } + enum "mpc" { + value 113; + description + "IBM multi-protocol channel support"; + } + enum "ipOverAtm" { + value 114; + description + "IBM ipOverAtm"; + reference + "RFC 2320 - Definitions of Managed Objects for Classical IP + and ARP Over ATM Using SMIv2 (IPOA-MIB)"; + } + enum "iso88025Fiber" { + value 115; + description + "ISO 802.5j Fiber Token Ring"; + } + enum "tdlc" { + value 116; + description + "IBM twinaxial data link control"; + } + enum "gigabitEthernet" { + value 117; + status deprecated; + description + "Obsoleted via RFC3635 + ethernetCsmacd(6) should be used instead"; + reference + "RFC 3635 - Definitions of Managed Objects for the + Ethernet-like Interface Types."; + } + enum "hdlc" { + value 118; + description + "HDLC"; + } + enum "lapf" { + value 119; + description + "LAP F"; + } + enum "v37" { + value 120; + description + "V.37"; + } + enum "x25mlp" { + value 121; + description + "Multi-Link Protocol"; + } + enum "x25huntGroup" { + value 122; + description + "X25 Hunt Group"; + } + enum "transpHdlc" { + value 123; + description + "Transp HDLC"; + } + enum "interleave" { + value 124; + description + "Interleave channel"; + } + enum "fast" { + value 125; + description + "Fast channel"; + } + enum "ip" { + value 126; + description + "IP (for APPN HPR in IP networks)"; + } + enum "docsCableMaclayer" { + value 127; + description + "CATV Mac Layer"; + } + enum "docsCableDownstream" { + value 128; + description + "CATV Downstream interface"; + } + enum "docsCableUpstream" { + value 129; + description + "CATV Upstream interface"; + } + enum "a12MppSwitch" { + value 130; + description + "Avalon Parallel Processor"; + } + enum "tunnel" { + value 131; + description + "Encapsulation interface"; + } + enum "coffee" { + value 132; + description + "coffee pot"; + reference + "RFC 2325 - Coffee MIB"; + } + enum "ces" { + value 133; + description + "Circuit Emulation Service"; + } + enum "atmSubInterface" { + value 134; + description + "ATM Sub Interface"; + } + enum "l2vlan" { + value 135; + description + "Layer 2 Virtual LAN using 802.1Q"; + } + enum "l3ipvlan" { + value 136; + description + "Layer 3 Virtual LAN using IP"; + } + enum "l3ipxvlan" { + value 137; + description + "Layer 3 Virtual LAN using IPX"; + } + enum "digitalPowerline" { + value 138; + description + "IP over Power Lines"; + } + enum "mediaMailOverIp" { + value 139; + description + "Multimedia Mail over IP"; + } + enum "dtm" { + value 140; + description + "Dynamic syncronous Transfer Mode"; + } + enum "dcn" { + value 141; + description + "Data Communications Network"; + } + enum "ipForward" { + value 142; + description + "IP Forwarding Interface"; + } + enum "msdsl" { + value 143; + description + "Multi-rate Symmetric DSL"; + } + enum "ieee1394" { + value 144; + description + "IEEE1394 High Performance Serial Bus"; + } + enum "if-gsn" { + value 145; + description + "HIPPI-6400"; + } + enum "dvbRccMacLayer" { + value 146; + description + "DVB-RCC MAC Layer"; + } + enum "dvbRccDownstream" { + value 147; + description + "DVB-RCC Downstream Channel"; + } + enum "dvbRccUpstream" { + value 148; + description + "DVB-RCC Upstream Channel"; + } + enum "atmVirtual" { + value 149; + description + "ATM Virtual Interface"; + } + enum "mplsTunnel" { + value 150; + description + "MPLS Tunnel Virtual Interface"; + } + enum "srp" { + value 151; + description + "Spatial Reuse Protocol"; + } + enum "voiceOverAtm" { + value 152; + description + "Voice Over ATM"; + } + enum "voiceOverFrameRelay" { + value 153; + description + "Voice Over Frame Relay"; + } + enum "idsl" { + value 154; + description + "Digital Subscriber Loop over ISDN"; + } + enum "compositeLink" { + value 155; + description + "Avici Composite Link Interface"; + } + enum "ss7SigLink" { + value 156; + description + "SS7 Signaling Link"; + } + enum "propWirelessP2P" { + value 157; + description + "Prop. P2P wireless interface"; + } + enum "frForward" { + value 158; + description + "Frame Forward Interface"; + } + enum "rfc1483" { + value 159; + description + "Multiprotocol over ATM AAL5"; + reference + "RFC 1483 - Multiprotocol Encapsulation over ATM + Adaptation Layer 5"; + } + enum "usb" { + value 160; + description + "USB Interface"; + } + enum "ieee8023adLag" { + value 161; + description + "IEEE 802.3ad Link Aggregate"; + } + enum "bgppolicyaccounting" { + value 162; + description + "BGP Policy Accounting"; + } + enum "frf16MfrBundle" { + value 163; + description + "FRF .16 Multilink Frame Relay"; + } + enum "h323Gatekeeper" { + value 164; + description + "H323 Gatekeeper"; + } + enum "h323Proxy" { + value 165; + description + "H323 Voice and Video Proxy"; + } + enum "mpls" { + value 166; + description + "MPLS"; + } + enum "mfSigLink" { + value 167; + description + "Multi-frequency signaling link"; + } + enum "hdsl2" { + value 168; + description + "High Bit-Rate DSL - 2nd generation"; + } + enum "shdsl" { + value 169; + description + "Multirate HDSL2"; + } + enum "ds1FDL" { + value 170; + description + "Facility Data Link 4Kbps on a DS1"; + } + enum "pos" { + value 171; + description + "Packet over SONET/SDH Interface"; + } + enum "dvbAsiIn" { + value 172; + description + "DVB-ASI Input"; + } + enum "dvbAsiOut" { + value 173; + description + "DVB-ASI Output"; + } + enum "plc" { + value 174; + description + "Power Line Communtications"; + } + enum "nfas" { + value 175; + description + "Non Facility Associated Signaling"; + } + enum "tr008" { + value 176; + description + "TR008"; + } + enum "gr303RDT" { + value 177; + description + "Remote Digital Terminal"; + } + enum "gr303IDT" { + value 178; + description + "Integrated Digital Terminal"; + } + enum "isup" { + value 179; + description + "ISUP"; + } + enum "propDocsWirelessMaclayer" { + value 180; + description + "Cisco proprietary Maclayer"; + } + enum "propDocsWirelessDownstream" { + value 181; + description + "Cisco proprietary Downstream"; + } + enum "propDocsWirelessUpstream" { + value 182; + description + "Cisco proprietary Upstream"; + } + enum "hiperlan2" { + value 183; + description + "HIPERLAN Type 2 Radio Interface"; + } + enum "propBWAp2Mp" { + value 184; + description + "PropBroadbandWirelessAccesspt2multipt use of this value + for IEEE 802.16 WMAN interfaces as per IEEE Std 802.16f + is deprecated and ieee80216WMAN(237) should be used + instead."; + } + enum "sonetOverheadChannel" { + value 185; + description + "SONET Overhead Channel"; + } + enum "digitalWrapperOverheadChannel" { + value 186; + description + "Digital Wrapper"; + } + enum "aal2" { + value 187; + description + "ATM adaptation layer 2"; + } + enum "radioMAC" { + value 188; + description + "MAC layer over radio links"; + } + enum "atmRadio" { + value 189; + description + "ATM over radio links"; + } + enum "imt" { + value 190; + description + "Inter Machine Trunks"; + } + enum "mvl" { + value 191; + description + "Multiple Virtual Lines DSL"; + } + enum "reachDSL" { + value 192; + description + "Long Reach DSL"; + } + enum "frDlciEndPt" { + value 193; + description + "Frame Relay DLCI End Point"; + } + enum "atmVciEndPt" { + value 194; + description + "ATM VCI End Point"; + } + enum "opticalChannel" { + value 195; + description + "Optical Channel"; + } + enum "opticalTransport" { + value 196; + description + "Optical Transport"; + } + enum "propAtm" { + value 197; + description + "Proprietary ATM"; + } + enum "voiceOverCable" { + value 198; + description + "Voice Over Cable Interface"; + } + enum "infiniband" { + value 199; + description + "Infiniband"; + } + enum "teLink" { + value 200; + description + "TE Link"; + } + enum "q2931" { + value 201; + description + "Q.2931"; + } + enum "virtualTg" { + value 202; + description + "Virtual Trunk Group"; + } + enum "sipTg" { + value 203; + description + "SIP Trunk Group"; + } + enum "sipSig" { + value 204; + description + "SIP Signaling"; + } + enum "docsCableUpstreamChannel" { + value 205; + description + "CATV Upstream Channel"; + } + enum "econet" { + value 206; + description + "Acorn Econet"; + } + enum "pon155" { + value 207; + description + "FSAN 155Mb Symetrical PON interface"; + } + enum "pon622" { + value 208; + description + "FSAN622Mb Symetrical PON interface"; + } + enum "bridge" { + value 209; + description + "Transparent bridge interface"; + } + enum "linegroup" { + value 210; + description + "Interface common to multiple lines"; + } + enum "voiceEMFGD" { + value 211; + description + "voice E&M Feature Group D"; + } + enum "voiceFGDEANA" { + value 212; + description + "voice FGD Exchange Access North American"; + } + enum "voiceDID" { + value 213; + description + "voice Direct Inward Dialing"; + } + enum "mpegTransport" { + value 214; + description + "MPEG transport interface"; + } + enum "sixToFour" { + value 215; + status deprecated; + description + "6to4 interface (DEPRECATED)"; + reference + "RFC 4087 - IP Tunnel MIB"; + } + enum "gtp" { + value 216; + description + "GTP (GPRS Tunneling Protocol)"; + } + enum "pdnEtherLoop1" { + value 217; + description + "Paradyne EtherLoop 1"; + } + enum "pdnEtherLoop2" { + value 218; + description + "Paradyne EtherLoop 2"; + } + enum "opticalChannelGroup" { + value 219; + description + "Optical Channel Group"; + } + enum "homepna" { + value 220; + description + "HomePNA ITU-T G.989"; + } + enum "gfp" { + value 221; + description + "Generic Framing Procedure (GFP)"; + } + enum "ciscoISLvlan" { + value 222; + description + "Layer 2 Virtual LAN using Cisco ISL"; + } + enum "actelisMetaLOOP" { + value 223; + description + "Acteleis proprietary MetaLOOP High Speed Link"; + } + enum "fcipLink" { + value 224; + description + "FCIP Link"; + } + enum "rpr" { + value 225; + description + "Resilient Packet Ring Interface Type"; + } + enum "qam" { + value 226; + description + "RF Qam Interface"; + } + enum "lmp" { + value 227; + description + "Link Management Protocol"; + reference + "RFC 4327 - Link Management Protocol (LMP) Management + Information Base (MIB)"; + } + enum "cblVectaStar" { + value 228; + description + "Cambridge Broadband Networks Limited VectaStar"; + } + enum "docsCableMCmtsDownstream" { + value 229; + description + "CATV Modular CMTS Downstream Interface"; + } + enum "adsl2" { + value 230; + status deprecated; + description + "Asymmetric Digital Subscriber Loop Version 2 + (DEPRECATED/OBSOLETED - please use adsl2plus(238) + instead)"; + reference + "RFC 4706 - Definitions of Managed Objects for Asymmetric + Digital Subscriber Line 2 (ADSL2)"; + } + enum "macSecControlledIF" { + value 231; + description + "MACSecControlled"; + } + enum "macSecUncontrolledIF" { + value 232; + description + "MACSecUncontrolled"; + } + enum "aviciOpticalEther" { + value 233; + description + "Avici Optical Ethernet Aggregate"; + } + enum "atmbond" { + value 234; + description + "atmbond"; + } + enum "voiceFGDOS" { + value 235; + description + "voice FGD Operator Services"; + } + enum "mocaVersion1" { + value 236; + description + "MultiMedia over Coax Alliance (MoCA) Interface + as documented in information provided privately to IANA"; + } + enum "ieee80216WMAN" { + value 237; + description + "IEEE 802.16 WMAN interface"; + } + enum "adsl2plus" { + value 238; + description + "Asymmetric Digital Subscriber Loop Version 2, + Version 2 Plus and all variants"; + } + enum "dvbRcsMacLayer" { + value 239; + description + "DVB-RCS MAC Layer"; + reference + "RFC 5728 - The SatLabs Group DVB-RCS MIB"; + } + enum "dvbTdm" { + value 240; + description + "DVB Satellite TDM"; + reference + "RFC 5728 - The SatLabs Group DVB-RCS MIB"; + } + enum "dvbRcsTdma" { + value 241; + description + "DVB-RCS TDMA"; + reference + "RFC 5728 - The SatLabs Group DVB-RCS MIB"; + } + enum "x86Laps" { + value 242; + description + "LAPS based on ITU-T X.86/Y.1323"; + } + enum "wwanPP" { + value 243; + description + "3GPP WWAN"; + } + enum "wwanPP2" { + value 244; + description + "3GPP2 WWAN"; + } + enum "voiceEBS" { + value 245; + description + "voice P-phone EBS physical interface"; + } + enum "ifPwType" { + value 246; + description + "Pseudowire interface type"; + reference + "RFC 5601 - Pseudowire (PW) Management Information Base"; + } + enum "ilan" { + value 247; + description + "Internal LAN on a bridge per IEEE 802.1ap"; + } + enum "pip" { + value 248; + description + "Provider Instance Port on a bridge per IEEE 802.1ah PBB"; + } + enum "aluELP" { + value 249; + description + "Alcatel-Lucent Ethernet Link Protection"; + } + enum "gpon" { + value 250; + description + "Gigabit-capable passive optical networks (G-PON) as per + ITU-T G.948"; + } + enum "vdsl2" { + value 251; + description + "Very high speed digital subscriber line Version 2 + (as per ITU-T Recommendation G.993.2)"; + reference + "RFC 5650 - Definitions of Managed Objects for Very High + Speed Digital Subscriber Line 2 (VDSL2)"; + } + enum "capwapDot11Profile" { + value 252; + description + "WLAN Profile Interface"; + reference + "RFC 5834 - Control and Provisioning of Wireless Access + Points (CAPWAP) Protocol Binding MIB for + IEEE 802.11"; + } + enum "capwapDot11Bss" { + value 253; + description + "WLAN BSS Interface"; + reference + "RFC 5834 - Control and Provisioning of Wireless Access + Points (CAPWAP) Protocol Binding MIB for + IEEE 802.11"; + } + enum "capwapWtpVirtualRadio" { + value 254; + description + "WTP Virtual Radio Interface"; + reference + "RFC 5833 - Control and Provisioning of Wireless Access + Points (CAPWAP) Protocol Base MIB"; + } + enum "bits" { + value 255; + description + "bitsport"; + } + enum "docsCableUpstreamRfPort" { + value 256; + description + "DOCSIS CATV Upstream RF Port"; + } + enum "cableDownstreamRfPort" { + value 257; + description + "CATV downstream RF port"; + } + enum "vmwareVirtualNic" { + value 258; + description + "VMware Virtual Network Interface"; + } + enum "ieee802154" { + value 259; + description + "IEEE 802.15.4 WPAN interface"; + reference + "IEEE 802.15.4-2006"; + } + enum "otnOdu" { + value 260; + description + "OTN Optical Data Unit"; + } + enum "otnOtu" { + value 261; + description + "OTN Optical channel Transport Unit"; + } + enum "ifVfiType" { + value 262; + description + "VPLS Forwarding Instance Interface Type"; + } + enum "g9981" { + value 263; + description + "G.998.1 bonded interface"; + } + enum "g9982" { + value 264; + description + "G.998.2 bonded interface"; + } + enum "g9983" { + value 265; + description + "G.998.3 bonded interface"; + } + enum "aluEpon" { + value 266; + description + "Ethernet Passive Optical Networks (E-PON)"; + } + enum "aluEponOnu" { + value 267; + description + "EPON Optical Network Unit"; + } + enum "aluEponPhysicalUni" { + value 268; + description + "EPON physical User to Network interface"; + } + enum "aluEponLogicalLink" { + value 269; + description + "The emulation of a point-to-point link over the EPON + layer"; + } + enum "aluGponOnu" { + value 270; + description + "GPON Optical Network Unit"; + reference + "ITU-T G.984.2"; + } + enum "aluGponPhysicalUni" { + value 271; + description + "GPON physical User to Network interface"; + reference + "ITU-T G.984.2"; + } + enum "vmwareNicTeam" { + value 272; + description + "VMware NIC Team"; + } + // value 273 reserved by IANA + } + description + "This data type is used as the syntax of the 'type' + leaf in the 'interface' list in the YANG module + ietf-interface. + + The definition of this typedef with the + addition of newly assigned values is published + periodically by the IANA, in either the Assigned + Numbers RFC, or some derivative of it specific to + Internet Network Management number assignments. (The + latest arrangements can be obtained by contacting the + IANA.) + + Requests for new values should be made to IANA via + email (iana&iana.org)."; + reference + "IANA ifType definitions registry. + <http://www.iana.org/assignments/smi-numbers>"; + } +}
\ No newline at end of file diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/full-versions/yangs/ietf-interfaces@2013-07-04.yang b/netconf/restconf/restconf-nb-bierman02/src/test/resources/full-versions/yangs/ietf-interfaces@2013-07-04.yang new file mode 100644 index 0000000..9db753c --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/full-versions/yangs/ietf-interfaces@2013-07-04.yang @@ -0,0 +1,673 @@ +module ietf-interfaces { + + namespace "urn:ietf:params:xml:ns:yang:ietf-interfaces"; + prefix if; + + import ietf-yang-types { + prefix yang; + } + import iana-if-type { + prefix ianaift; + } + + organization + "IETF NETMOD (NETCONF Data Modeling Language) Working Group"; + + contact + "WG Web: <http://tools.ietf.org/wg/netmod/> + WG List: <mailto:netmod@ietf.org> + + WG Chair: David Kessens + <mailto:david.kessens@nsn.com> + + WG Chair: Juergen Schoenwaelder + <mailto:j.schoenwaelder@jacobs-university.de> + + Editor: Martin Bjorklund + <mailto:mbj@tail-f.com>"; + + description + "This module contains a collection of YANG definitions for + managing network interfaces. + + Copyright (c) 2013 IETF Trust and the persons identified as + authors of the code. All rights reserved. + + Redistribution and use in source and binary forms, with or + without modification, is permitted pursuant to, and subject + to the license terms contained in, the Simplified BSD License + set forth in Section 4.c of the IETF Trust's Legal Provisions + Relating to IETF Documents + (http://trustee.ietf.org/license-info). + + This version of this YANG module is part of RFC XXXX; see + the RFC itself for full legal notices."; + + // RFC Ed.: replace XXXX with actual RFC number and remove this + // note. + + // RFC Ed.: update the date below with the date of RFC publication + // and remove this note. + revision 2013-07-04 { + description + "Initial revision."; + reference + "RFC XXXX: A YANG Data Model for Interface Management"; + } + + /* Typedefs */ + + typedef interface-ref { + type leafref { + path "/if:interfaces/if:interface/if:name"; + } + description + "This type is used by data models that need to reference + configured interfaces."; + } + + typedef interface-state-ref { + type leafref { + path "/if:interfaces-state/if:interface/if:name"; + } + description + "This type is used by data models that need to reference + the operationally present interfaces."; + } + + /* Features */ + + feature arbitrary-names { + description + "This feature indicates that the device allows user-controlled + interfaces to be named arbitrarily."; + } + + feature pre-provisioning { + description + "This feature indicates that the device supports + pre-provisioning of interface configuration, i.e., it is + possible to configure an interface whose physical interface + hardware is not present on the device."; + } + + feature if-mib { + description + "This feature indicates that the device implements IF-MIB."; + reference + "RFC 2863: The Interfaces Group MIB"; + } + + /* Data nodes */ + + container interfaces { + description + "Interface configuration parameters."; + + list interface { + key "name"; + + description + "The list of configured interfaces on the device. + + The operational state of an interface is available in the + /interfaces-state/interface list. If the configuration of a + system-controlled interface cannot be used by the system + (e.g., the interface hardware present does not match the + interface type), then the configuration is not applied to + the system-controlled interface shown in the + /interfaces-state/interface list. If the the configuration + of a user-controlled interface cannot be used by the system, + the configured interface is not instantiated in the + /interfaces-state/interface list."; + + leaf name { + type string; + description + "The name of the interface. + + A device MAY restrict the allowed values for this leaf, + possibly depending on the type of the interface. + + For system-controlled interfaces, this leaf is the + device-specific name of the interface. The 'config false' + list /interfaces-state/interface contains the currently + existing interfaces on the device. + + If a client tries to create configuration for a + system-controlled interface that is not present in the + /interfaces-state/interface list, the server MAY reject + the request, if the implementation does not support + pre-provisioning of interfaces, or if the name refers to + an interface that can never exist in the system. A + NETCONF server MUST reply with an rpc-error with the + error-tag 'invalid-value' in this case. + + If the device supports pre-provisioning of interface + configuration, the feature 'pre-provisioning' is + advertised. + + If the device allows arbitrarily named user-controlled + interfaces, the feature 'arbitrary-names' is advertised. + + When a configured user-controlled interface is created by + the system, it is instantiated with the same name in the + /interface-state/interface list. Since the name in that + list MAY be mapped to ifName by an implementation, such an + implementation MUST restrict the allowed values for this + leaf so that it matches the restrictions of ifName. + + If a NETCONF server that implements this restriction is + sent a value that doesn't match the restriction, it MUST + reply with an rpc-error with the error-tag + 'invalid-value'."; + } + + leaf description { + type string; + description + "A textual description of the interface. + + This leaf MAY be mapped to ifAlias by an implementation. + Such an implementation MUST restrict the allowed values + for this leaf so that it matches the restrictions of + ifAlias. + + If a NETCONF server that implements this restriction is + sent a value that doesn't match the restriction, it MUST + reply with an rpc-error with the error-tag + 'invalid-value'. + + Since ifAlias is defined to be stored in non-volatile + storage, the MIB implementation MUST map ifAlias to the + value of 'description' in the persistently stored + datastore. + + Specifically, if the device supports ':startup', when + ifAlias is read the device MUST return the value of + 'description' in the 'startup' datastore, and when it is + written, it MUST be written to the 'running' and 'startup' + datastores. Note that it is up to the implementation if + it modifies this single leaf in 'startup', or if it + performs an implicit copy-config from 'running' to + 'startup'. + + If the device does not support ':startup', ifAlias MUST + be mapped to the 'description' leaf in the 'running' + datastore."; + reference + "RFC 2863: The Interfaces Group MIB - ifAlias"; + } + + leaf type { + type ianaift:iana-if-type; + mandatory true; + description + "The type of the interface. + + When an interface entry is created, a server MAY + initialize the type leaf with a valid value, e.g., if it + is possible to derive the type from the name of the + interface. + + If a client tries to set the type of an interface to a + value that can never be used by the system, e.g., if the + type is not supported or if the type does not match the + name of the interface, the server MUST reject the request. + A NETCONF server MUST reply with an rpc-error with the + error-tag 'invalid-value' in this case."; + reference + "RFC 2863: The Interfaces Group MIB - ifType"; + } + + leaf enabled { + type boolean; + default "true"; + description + "This leaf contains the configured, desired state of the + interface. + + Systems that implement the IF-MIB use the value of this + leaf in the 'running' datastore to set + IF-MIB.ifAdminStatus to 'up' or 'down' after an ifEntry + has been initialized, as described in RFC 2863. + + Changes in this leaf in the 'running' datastore are + reflected in ifAdminStatus, but if ifAdminStatus is + changed over SNMP, this leaf is not affected."; + reference + "RFC 2863: The Interfaces Group MIB - ifAdminStatus"; + } + + leaf link-up-down-trap-enable { + if-feature if-mib; + type enumeration { + enum enabled { + value 1; + } + enum disabled { + value 2; + } + } + description + "Controls whether linkUp/linkDown SNMP notifications + should be generated for this interface. + + If this node is not configured, the value 'enabled' is + operationally used by the server for interfaces which do + not operate on top of any other interface (i.e., there are + no 'lower-layer-if' entries), and 'disabled' otherwise."; + reference + "RFC 2863: The Interfaces Group MIB - + ifLinkUpDownTrapEnable"; + } + } + } + + container interfaces-state { + config false; + description + "Data nodes for the operational state of interfaces."; + + list interface { + key "name"; + + description + "The list of interfaces on the device. + + System-controlled interfaces created by the system are + always present in this list, whether they are configured or + not."; + + leaf name { + type string; + description + "The name of the interface. + + This leaf MAY be mapped to ifName by an implementation."; + reference + "RFC 2863: The Interfaces Group MIB - ifName"; + } + + leaf type { + type ianaift:iana-if-type; + mandatory true; + description + "The type of the interface."; + reference + "RFC 2863: The Interfaces Group MIB - ifType"; + } + + leaf admin-status { + if-feature if-mib; + type enumeration { + enum up { + value 1; + description + "Ready to pass packets."; + } + enum down { + value 2; + description + "Not ready to pass packets and not in some test mode."; + } + enum testing { + value 3; + description + "In some test mode."; + } + } + mandatory true; + description + "The desired state of the interface. + + This leaf has the same read semantics as ifAdminStatus."; + reference + "RFC 2863: The Interfaces Group MIB - ifAdminStatus"; + } + + leaf oper-status { + type enumeration { + enum up { + value 1; + description + "Ready to pass packets."; + } + enum down { + value 2; + description + "The interface does not pass any packets."; + } + enum testing { + value 3; + description + "In some test mode. No operational packets can + be passed."; + } + enum unknown { + value 4; + description + "Status cannot be determined for some reason."; + } + enum dormant { + value 5; + description + "Waiting for some external event."; + } + enum not-present { + value 6; + description + "Some component (typically hardware) is missing."; + } + enum lower-layer-down { + value 7; + description + "Down due to state of lower-layer interface(s)."; + } + } + mandatory true; + description + "The current operational state of the interface. + + This leaf has the same semantics as ifOperStatus."; + reference + "RFC 2863: The Interfaces Group MIB - ifOperStatus"; + } + + leaf last-change { + type yang:date-and-time; + description + "The time the interface entered its current operational + state. If the current state was entered prior to the + last re-initialization of the local network management + subsystem, then this node is not present."; + reference + "RFC 2863: The Interfaces Group MIB - ifLastChange"; + } + + leaf if-index { + if-feature if-mib; + type int32 { + range "1..2147483647"; + } + mandatory true; + description + "The ifIndex value for the ifEntry represented by this + interface."; + reference + "RFC 2863: The Interfaces Group MIB - ifIndex"; + } + + leaf phys-address { + type yang:phys-address; + description + "The interface's address at its protocol sub-layer. For + example, for an 802.x interface, this object normally + contains a MAC address. The interface's media-specific + modules must define the bit and byte ordering and the + format of the value of this object. For interfaces that do + not have such an address (e.g., a serial line), this node + is not present."; + reference + "RFC 2863: The Interfaces Group MIB - ifPhysAddress"; + } + + leaf-list higher-layer-if { + type interface-state-ref; + description + "A list of references to interfaces layered on top of this + interface."; + reference + "RFC 2863: The Interfaces Group MIB - ifStackTable"; + } + + leaf-list lower-layer-if { + type interface-state-ref; + description + "A list of references to interfaces layered underneath this + interface."; + reference + "RFC 2863: The Interfaces Group MIB - ifStackTable"; + } + + leaf speed { + type yang:gauge64; + units "bits / second"; + description + "An estimate of the interface's current bandwidth in bits + per second. For interfaces that do not vary in + bandwidth or for those where no accurate estimation can + be made, this node should contain the nominal bandwidth. + For interfaces that have no concept of bandwidth, this + node is not present."; + reference + "RFC 2863: The Interfaces Group MIB - + ifSpeed, ifHighSpeed"; + } + + container statistics { + description + "A collection of interface-related statistics objects."; + + leaf discontinuity-time { + type yang:date-and-time; + mandatory true; + description + "The time on the most recent occasion at which any one or + more of this interface's counters suffered a + discontinuity. If no such discontinuities have occurred + since the last re-initialization of the local management + subsystem, then this node contains the time the local + management subsystem re-initialized itself."; + } + + leaf in-octets { + type yang:counter64; + description + "The total number of octets received on the interface, + including framing characters. + + Discontinuities in the value of this counter can occur + at re-initialization of the management system, and at + other times as indicated by the value of + 'discontinuity-time'."; + reference + "RFC 2863: The Interfaces Group MIB - ifHCInOctets"; + } + leaf in-unicast-pkts { + type yang:counter64; + description + "The number of packets, delivered by this sub-layer to a + higher (sub-)layer, which were not addressed to a + multicast or broadcast address at this sub-layer. + + Discontinuities in the value of this counter can occur + at re-initialization of the management system, and at + other times as indicated by the value of + 'discontinuity-time'."; + reference + "RFC 2863: The Interfaces Group MIB - ifHCInUcastPkts"; + } + leaf in-broadcast-pkts { + type yang:counter64; + description + "The number of packets, delivered by this sub-layer to a + higher (sub-)layer, which were addressed to a broadcast + address at this sub-layer. + + Discontinuities in the value of this counter can occur + at re-initialization of the management system, and at + other times as indicated by the value of + 'discontinuity-time'."; + reference + "RFC 2863: The Interfaces Group MIB - + ifHCInBroadcastPkts"; + } + leaf in-multicast-pkts { + type yang:counter64; + description + "The number of packets, delivered by this sub-layer to a + higher (sub-)layer, which were addressed to a multicast + address at this sub-layer. For a MAC layer protocol, + this includes both Group and Functional addresses. + + Discontinuities in the value of this counter can occur + at re-initialization of the management system, and at + other times as indicated by the value of + 'discontinuity-time'."; + reference + "RFC 2863: The Interfaces Group MIB - + ifHCInMulticastPkts"; + } + leaf in-discards { + type yang:counter32; + description + "The number of inbound packets which were chosen to be + discarded even though no errors had been detected to + prevent their being deliverable to a higher-layer + protocol. One possible reason for discarding such a + packet could be to free up buffer space. + + Discontinuities in the value of this counter can occur + at re-initialization of the management system, and at + other times as indicated by the value of + 'discontinuity-time'."; + reference + "RFC 2863: The Interfaces Group MIB - ifInDiscards"; + } + leaf in-errors { + type yang:counter32; + description + "For packet-oriented interfaces, the number of inbound + packets that contained errors preventing them from being + deliverable to a higher-layer protocol. For character- + oriented or fixed-length interfaces, the number of + inbound transmission units that contained errors + preventing them from being deliverable to a higher-layer + protocol. + + Discontinuities in the value of this counter can occur + at re-initialization of the management system, and at + other times as indicated by the value of + 'discontinuity-time'."; + reference + "RFC 2863: The Interfaces Group MIB - ifInErrors"; + } + leaf in-unknown-protos { + type yang:counter32; + description + "For packet-oriented interfaces, the number of packets + received via the interface which were discarded because + of an unknown or unsupported protocol. For + character-oriented or fixed-length interfaces that + support protocol multiplexing the number of transmission + units received via the interface which were discarded + because of an unknown or unsupported protocol. For any + interface that does not support protocol multiplexing, + this counter is not present. + Discontinuities in the value of this counter can occur + at re-initialization of the management system, and at + other times as indicated by the value of + 'discontinuity-time'."; + reference + "RFC 2863: The Interfaces Group MIB - ifInUnknownProtos"; + } + + leaf out-octets { + type yang:counter64; + description + "The total number of octets transmitted out of the + interface, including framing characters. + + Discontinuities in the value of this counter can occur + at re-initialization of the management system, and at + other times as indicated by the value of + 'discontinuity-time'."; + reference + "RFC 2863: The Interfaces Group MIB - ifHCOutOctets"; + } + leaf out-unicast-pkts { + type yang:counter64; + description + "The total number of packets that higher-level protocols + requested be transmitted, and which were not addressed + to a multicast or broadcast address at this sub-layer, + including those that were discarded or not sent. + + Discontinuities in the value of this counter can occur + at re-initialization of the management system, and at + other times as indicated by the value of + 'discontinuity-time'."; + reference + "RFC 2863: The Interfaces Group MIB - ifHCOutUcastPkts"; + } + leaf out-broadcast-pkts { + type yang:counter64; + description + "The total number of packets that higher-level protocols + requested be transmitted, and which were addressed to a + broadcast address at this sub-layer, including those + that were discarded or not sent. + + Discontinuities in the value of this counter can occur + at re-initialization of the management system, and at + other times as indicated by the value of + 'discontinuity-time'."; + reference + "RFC 2863: The Interfaces Group MIB - + ifHCOutBroadcastPkts"; + } + leaf out-multicast-pkts { + type yang:counter64; + description + "The total number of packets that higher-level protocols + requested be transmitted, and which were addressed to a + multicast address at this sub-layer, including those + that were discarded or not sent. For a MAC layer + protocol, this includes both Group and Functional + addresses. + + Discontinuities in the value of this counter can occur + at re-initialization of the management system, and at + other times as indicated by the value of + 'discontinuity-time'."; + reference + "RFC 2863: The Interfaces Group MIB - + ifHCOutMulticastPkts"; + } + leaf out-discards { + type yang:counter32; + description + "The number of outbound packets which were chosen to be + discarded even though no errors had been detected to + prevent their being transmitted. One possible reason + for discarding such a packet could be to free up buffer + space. + + Discontinuities in the value of this counter can occur + at re-initialization of the management system, and at + other times as indicated by the value of + 'discontinuity-time'."; + reference + "RFC 2863: The Interfaces Group MIB - ifOutDiscards"; + } + leaf out-errors { + type yang:counter32; + description + "For packet-oriented interfaces, the number of outbound + packets that could not be transmitted because of errors. + For character-oriented or fixed-length interfaces, the + number of outbound transmission units that could not be + transmitted because of errors. + + Discontinuities in the value of this counter can occur + at re-initialization of the management system, and at + other times as indicated by the value of + 'discontinuity-time'."; + reference + "RFC 2863: The Interfaces Group MIB - ifOutErrors"; + } + } + } + } +}
\ No newline at end of file diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/full-versions/yangs/ietf-yang-types@2013-05-16.yang b/netconf/restconf/restconf-nb-bierman02/src/test/resources/full-versions/yangs/ietf-yang-types@2013-05-16.yang new file mode 100644 index 0000000..6c82d9d --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/full-versions/yangs/ietf-yang-types@2013-05-16.yang @@ -0,0 +1,471 @@ +module ietf-yang-types { + + namespace "urn:ietf:params:xml:ns:yang:ietf-yang-types"; + prefix "yang"; + + organization + "IETF NETMOD (NETCONF Data Modeling Language) Working Group"; + + contact + "WG Web: <http://tools.ietf.org/wg/netmod/> + WG List: <mailto:netmod@ietf.org> + + WG Chair: David Kessens + <mailto:david.kessens@nsn.com> + + WG Chair: Juergen Schoenwaelder + <mailto:j.schoenwaelder@jacobs-university.de> + + Editor: Juergen Schoenwaelder + <mailto:j.schoenwaelder@jacobs-university.de>"; + + description + "This module contains a collection of generally useful derived + YANG data types. + + Copyright (c) 2013 IETF Trust and the persons identified as + authors of the code. All rights reserved. + + Redistribution and use in source and binary forms, with or + without modification, is permitted pursuant to, and subject + to the license terms contained in, the Simplified BSD License + set forth in Section 4.c of the IETF Trust's Legal Provisions + Relating to IETF Documents + (http://trustee.ietf.org/license-info). + + This version of this YANG module is part of RFC XXXX; see + the RFC itself for full legal notices."; + + revision 2013-05-16 { + description + "This revision adds the following new data types: + - yang-identifier + - hex-string + - uuid + - dotted-quad"; + reference + "RFC XXXX: Common YANG Data Types"; + } + + revision 2010-09-24 { + description + "Initial revision."; + reference + "RFC 6021: Common YANG Data Types"; + } + + /*** collection of counter and gauge types ***/ + + typedef counter32 { + type uint32; + description + "The counter32 type represents a non-negative integer + that monotonically increases until it reaches a + maximum value of 2^32-1 (4294967295 decimal), when it + wraps around and starts increasing again from zero. + + Counters have no defined 'initial' value, and thus, a + single value of a counter has (in general) no information + content. Discontinuities in the monotonically increasing + value normally occur at re-initialization of the + management system, and at other times as specified in the + description of a schema node using this type. If such + other times can occur, for example, the creation of + a schema node of type counter32 at times other than + re-initialization, then a corresponding schema node + should be defined, with an appropriate type, to indicate + the last discontinuity. + + The counter32 type should not be used for configuration + schema nodes. A default statement SHOULD NOT be used in + combination with the type counter32. + + In the value set and its semantics, this type is equivalent + to the Counter32 type of the SMIv2."; + reference + "RFC 2578: Structure of Management Information Version 2 + (SMIv2)"; + } + + typedef zero-based-counter32 { + type yang:counter32; + default "0"; + description + "The zero-based-counter32 type represents a counter32 + that has the defined 'initial' value zero. + + A schema node of this type will be set to zero (0) on creation + and will thereafter increase monotonically until it reaches + a maximum value of 2^32-1 (4294967295 decimal), when it + wraps around and starts increasing again from zero. + + Provided that an application discovers a new schema node + of this type within the minimum time to wrap, it can use the + 'initial' value as a delta. It is important for a management + station to be aware of this minimum time and the actual time + between polls, and to discard data if the actual time is too + long or there is no defined minimum time. + + In the value set and its semantics, this type is equivalent + to the ZeroBasedCounter32 textual convention of the SMIv2."; + reference + "RFC 4502: Remote Network Monitoring Management Information + Base Version 2"; + } + + typedef counter64 { + type uint64; + description + "The counter64 type represents a non-negative integer + that monotonically increases until it reaches a + maximum value of 2^64-1 (18446744073709551615 decimal), + when it wraps around and starts increasing again from zero. + + Counters have no defined 'initial' value, and thus, a + single value of a counter has (in general) no information + content. Discontinuities in the monotonically increasing + value normally occur at re-initialization of the + management system, and at other times as specified in the + description of a schema node using this type. If such + other times can occur, for example, the creation of + a schema node of type counter64 at times other than + re-initialization, then a corresponding schema node + should be defined, with an appropriate type, to indicate + the last discontinuity. + + The counter64 type should not be used for configuration + schema nodes. A default statement SHOULD NOT be used in + combination with the type counter64. + + In the value set and its semantics, this type is equivalent + to the Counter64 type of the SMIv2."; + reference + "RFC 2578: Structure of Management Information Version 2 + (SMIv2)"; + } + + typedef zero-based-counter64 { + type yang:counter64; + default "0"; + description + "The zero-based-counter64 type represents a counter64 that + has the defined 'initial' value zero. + + A schema node of this type will be set to zero (0) on creation + and will thereafter increase monotonically until it reaches + a maximum value of 2^64-1 (18446744073709551615 decimal), + when it wraps around and starts increasing again from zero. + + Provided that an application discovers a new schema node + of this type within the minimum time to wrap, it can use the + 'initial' value as a delta. It is important for a management + station to be aware of this minimum time and the actual time + between polls, and to discard data if the actual time is too + long or there is no defined minimum time. + + In the value set and its semantics, this type is equivalent + to the ZeroBasedCounter64 textual convention of the SMIv2."; + reference + "RFC 2856: Textual Conventions for Additional High Capacity + Data Types"; + } + + typedef gauge32 { + type uint32; + description + "The gauge32 type represents a non-negative integer, which + may increase or decrease, but shall never exceed a maximum + value, nor fall below a minimum value. The maximum value + cannot be greater than 2^32-1 (4294967295 decimal), and + the minimum value cannot be smaller than 0. The value of + a gauge32 has its maximum value whenever the information + being modeled is greater than or equal to its maximum + value, and has its minimum value whenever the information + being modeled is smaller than or equal to its minimum value. + If the information being modeled subsequently decreases + below (increases above) the maximum (minimum) value, the + gauge32 also decreases (increases). + + In the value set and its semantics, this type is equivalent + to the Gauge32 type of the SMIv2."; + reference + "RFC 2578: Structure of Management Information Version 2 + (SMIv2)"; + } + + typedef gauge64 { + type uint64; + description + "The gauge64 type represents a non-negative integer, which + may increase or decrease, but shall never exceed a maximum + value, nor fall below a minimum value. The maximum value + cannot be greater than 2^64-1 (18446744073709551615), and + the minimum value cannot be smaller than 0. The value of + a gauge64 has its maximum value whenever the information + being modeled is greater than or equal to its maximum + value, and has its minimum value whenever the information + being modeled is smaller than or equal to its minimum value. + If the information being modeled subsequently decreases + below (increases above) the maximum (minimum) value, the + gauge64 also decreases (increases). + + In the value set and its semantics, this type is equivalent + to the CounterBasedGauge64 SMIv2 textual convention defined + in RFC 2856"; + reference + "RFC 2856: Textual Conventions for Additional High Capacity + Data Types"; + } + + /*** collection of identifier related types ***/ + + typedef object-identifier { + type string { + pattern '(([0-1](\.[1-3]?[0-9]))|(2\.(0|([1-9]\d*))))' + + '(\.(0|([1-9]\d*)))*'; + } + description + "The object-identifier type represents administratively + assigned names in a registration-hierarchical-name tree. + + Values of this type are denoted as a sequence of numerical + non-negative sub-identifier values. Each sub-identifier + value MUST NOT exceed 2^32-1 (4294967295). Sub-identifiers + are separated by single dots and without any intermediate + whitespace. + + The ASN.1 standard restricts the value space of the first + sub-identifier to 0, 1, or 2. Furthermore, the value space + of the second sub-identifier is restricted to the range + 0 to 39 if the first sub-identifier is 0 or 1. Finally, + the ASN.1 standard requires that an object identifier + has always at least two sub-identifier. The pattern + captures these restrictions. + + Although the number of sub-identifiers is not limited, + module designers should realize that there may be + implementations that stick with the SMIv2 limit of 128 + sub-identifiers. + + This type is a superset of the SMIv2 OBJECT IDENTIFIER type + since it is not restricted to 128 sub-identifiers. Hence, + this type SHOULD NOT be used to represent the SMIv2 OBJECT + IDENTIFIER type, the object-identifier-128 type SHOULD be + used instead."; + reference + "ISO9834-1: Information technology -- Open Systems + Interconnection -- Procedures for the operation of OSI + Registration Authorities: General procedures and top + arcs of the ASN.1 Object Identifier tree"; + } + + typedef object-identifier-128 { + type object-identifier { + pattern '\d*(\.\d*){1,127}'; + } + description + "This type represents object-identifiers restricted to 128 + sub-identifiers. + + In the value set and its semantics, this type is equivalent + to the OBJECT IDENTIFIER type of the SMIv2."; + reference + "RFC 2578: Structure of Management Information Version 2 + (SMIv2)"; + } + + typedef yang-identifier { + type string { + length "1..max"; + pattern '[a-zA-Z_][a-zA-Z0-9\-_.]*'; + pattern '.|..|[^xX].*|.[^mM].*|..[^lL].*'; + } + description + "A YANG identifier string as defined in RFC 6020, page 163. + An identifier must start with an alphabetic character or + an underscore followed by an arbitrary sequence of + alphabetic or numeric characters, underscores, hyphens + or dots. + + A YANG identifier MUST NOT start with any possible + combination of the lower-case or upper-case character + sequence 'xml'."; + reference + "RFC 6020: YANG - A Data Modeling Language for the Network + Configuration Protocol (NETCONF)"; + } + + /*** collection of date and time related types ***/ + + typedef date-and-time { + type string { + pattern '\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d+)?' + + '(Z|[\+\-]\d{2}:\d{2})'; + } + description + "The date-and-time type is a profile of the ISO 8601 + standard for representation of dates and times using the + Gregorian calendar. The profile is defined by the + date-time production in Section 5.6 of RFC 3339. + + The date-and-time type is compatible with the dateTime XML + schema type with the following notable exceptions: + + (a) The date-and-time type does not allow negative years. + + (b) The date-and-time time-offset -00:00 indicates an unknown + time zone (see RFC 3339) while -00:00 and +00:00 and Z all + represent the same time zone in dateTime. + + (c) The canonical format (see below) of data-and-time values + differs from the canonical format used by the dateTime XML + schema type, which requires all times to be in UTC using + the time-offset 'Z'. + + This type is not equivalent to the DateAndTime textual + convention of the SMIv2 since RFC 3339 uses a different + separator between full-date and full-time and provides + higher resolution of time-secfrac. + The canonical format for date-and-time values with a known time + zone uses a numeric time zone offset that is calculated using + the device's configured known offset to UTC time. A change of + the device's offset to UTC time will cause date-and-time values + to change accordingly. Such changes might happen periodically + in case a server follows automatically daylight saving time + (DST) time zone offset changes. The canonical format for + date-and-time values with an unknown time zone (usually + referring to the notion of local time) uses the time-offset + -00:00."; + reference + "RFC 3339: Date and Time on the Internet: Timestamps + RFC 2579: Textual Conventions for SMIv2 + XSD-TYPES: XML Schema Part 2: Datatypes Second Edition"; + } + + typedef timeticks { + type uint32; + description + "The timeticks type represents a non-negative integer that + represents the time, modulo 2^32 (4294967296 decimal), in + hundredths of a second between two epochs. When a schema + node is defined that uses this type, the description of + the schema node identifies both of the reference epochs. + + In the value set and its semantics, this type is equivalent + to the TimeTicks type of the SMIv2."; + reference + "RFC 2578: Structure of Management Information Version 2 + (SMIv2)"; + } + + typedef timestamp { + type yang:timeticks; + description + "The timestamp type represents the value of an associated + timeticks schema node at which a specific occurrence + happened. The specific occurrence must be defined in the + description of any schema node defined using this type. When + the specific occurrence occurred prior to the last time the + associated timeticks attribute was zero, then the timestamp + value is zero. Note that this requires all timestamp values + to be reset to zero when the value of the associated timeticks + attribute reaches 497+ days and wraps around to zero. + + The associated timeticks schema node must be specified + in the description of any schema node using this type. + In the value set and its semantics, this type is equivalent + to the TimeStamp textual convention of the SMIv2."; + reference + "RFC 2579: Textual Conventions for SMIv2"; + } + + /*** collection of generic address types ***/ + + typedef phys-address { + type string { + pattern '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'; + } + description + "Represents media- or physical-level addresses represented + as a sequence octets, each octet represented by two hexadecimal + numbers. Octets are separated by colons. The canonical + representation uses lowercase characters. + + In the value set and its semantics, this type is equivalent + to the PhysAddress textual convention of the SMIv2."; + reference + "RFC 2579: Textual Conventions for SMIv2"; + } + + typedef mac-address { + type string { + pattern '[0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){5}'; + } + description + "The mac-address type represents an IEEE 802 MAC address. + The canonical representation uses lowercase characters. + + In the value set and its semantics, this type is equivalent + to the MacAddress textual convention of the SMIv2."; + reference + "IEEE 802: IEEE Standard for Local and Metropolitan Area + Networks: Overview and Architecture + RFC 2579: Textual Conventions for SMIv2"; + } + + /*** collection of XML specific types ***/ + + typedef xpath1.0 { + type string; + description + "This type represents an XPATH 1.0 expression. + + When a schema node is defined that uses this type, the + description of the schema node MUST specify the XPath + context in which the XPath expression is evaluated."; + reference + "XPATH: XML Path Language (XPath) Version 1.0"; + } + + /*** collection of string types ***/ + + typedef hex-string { + type string { + pattern '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'; + } + description + "A hexadecimal string with octets represented as hex digits + separated by colons. The canonical representation uses + lowercase characters."; + } + + typedef uuid { + type string { + pattern '[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-' + + '[0-9a-fA-F]{4}-[0-9a-fA-F]{12}'; + } + description + "A Universally Unique IDentifier in the string representation + defined in RFC 4122. The canonical representation uses + lowercase characters. + + The following is an example of a UUID in string representation: + f81d4fae-7dec-11d0-a765-00a0c91e6bf6 + "; + reference + "RFC 4122: A Universally Unique IDentifier (UUID) URN + Namespace"; + } + + typedef dotted-quad { + type string { + 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])'; + } + description + "An unsigned 32-bit number expressed in the dotted-quad + notation, i.e., four octets written as decimal numbers + and separated with the '.' (full stop) character."; + } +}
\ No newline at end of file diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/full-versions/yangs/sal-remote@2014-01-14.yang b/netconf/restconf/restconf-nb-bierman02/src/test/resources/full-versions/yangs/sal-remote@2014-01-14.yang new file mode 100644 index 0000000..d12e252 --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/full-versions/yangs/sal-remote@2014-01-14.yang @@ -0,0 +1,98 @@ +module sal-remote { + + yang-version 1; + namespace "urn:opendaylight:params:xml:ns:yang:controller:md:sal:remote"; + prefix "sal-remote"; + + + organization "Cisco Systems, Inc."; + contact "Martin Bobak <mbobak@cisco.com>"; + + description + "This module contains the definition of methods related to + sal remote model. + + Copyright (c)2013 Cisco Systems, Inc. All rights reserved. + + This program and the accompanying materials are made available + under the terms of the Eclipse Public License v1.0 which + accompanies this distribution, and is available at + http://www.eclipse.org/legal/epl-v10.html"; + + revision "2014-01-14" { + description + "Initial revision"; + } + + + typedef q-name { + type string; + reference + "http://www.w3.org/TR/2004/REC-xmlschema-2-20041028/#QName"; + } + + rpc create-data-change-event-subscription { + input { + leaf path { + type instance-identifier; + description "Subtree path. "; + } + } + output { + leaf stream-name { + type string; + description "Notification stream name."; + } + } + } + + notification data-changed-notification { + description "Data change notification."; + list data-change-event { + key path; + leaf path { + type instance-identifier; + } + leaf store { + type enumeration { + enum config; + enum operation; + } + } + leaf operation { + type enumeration { + enum created; + enum updated; + enum deleted; + } + } + anyxml data{ + description "DataObject "; + } + } + } + + rpc create-notification-stream { + input { + leaf-list notifications { + type q-name; + description "Notification QNames"; + } + } + output { + leaf notification-stream-identifier { + type string; + description "Unique notification stream identifier, in which notifications will be propagated"; + } + } + } + + rpc begin-transaction{ + output{ + anyxml data-modification-transaction{ + description "DataModificationTransaction xml"; + } + } + } + +}
\ No newline at end of file diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/full-versions/yangs/simple-nodes.yang b/netconf/restconf/restconf-nb-bierman02/src/test/resources/full-versions/yangs/simple-nodes.yang new file mode 100644 index 0000000..6c16254 --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/full-versions/yangs/simple-nodes.yang @@ -0,0 +1,80 @@ +module simple-nodes { + yang-version 1; + namespace "urn:opendaylight:simple-nodes"; + prefix "sn"; + + description + "test file containing yang data nodes"; + + revision "2013-07-30" { + description + "Initial revision."; + reference "will be defined"; + } + + container users { + leaf user { + type string; + } + + leaf group { + type string; + } + } + + list user { + key "name class"; + leaf name { + type string; + } + leaf full-name { + type string; + } + leaf class { + type string; + } + } + + list userWithoutClass { + key "name"; + leaf name { + type string; + } + leaf full-name { + type string; + } + container inner-container { + leaf inner-list { + type uint16; + } + } + } + + container food { + choice snack { + case sports-arena { + leaf pretzel { + type string; + } + leaf beer { + type string; + } + container nonalcoholic { + leaf beer { + type string; + } + } + } + case late-night { + leaf chocolate { + type enumeration { + enum dark; + enum milk; + enum first-available; + } + } + } + } + } + +} diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/full-versions/yangs/subscribe-to-notification.yang b/netconf/restconf/restconf-nb-bierman02/src/test/resources/full-versions/yangs/subscribe-to-notification.yang new file mode 100644 index 0000000..5fe7df7 --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/full-versions/yangs/subscribe-to-notification.yang @@ -0,0 +1,18 @@ +module subscribe-to-notification { + + yang-version 1; + namespace "subscribe:to:notification"; + prefix "subs-to-notifi"; + + description + "Added input parameters to rpc create-data-change-event-subscription and to create-notification-stream"; + + revision "2016-10-28" { + } + + container "notifi"{ + leaf "location"{ + type string; + } + } +} diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/full-versions/yangs/toaster.yang b/netconf/restconf/restconf-nb-bierman02/src/test/resources/full-versions/yangs/toaster.yang new file mode 100644 index 0000000..571ed0c --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/full-versions/yangs/toaster.yang @@ -0,0 +1,197 @@ + module toaster { + + yang-version 1; + + namespace + "http://netconfcentral.org/ns/toaster"; + + prefix toast; + + organization "Netconf Central"; + + contact + "Andy Bierman <andy@netconfcentral.org>"; + + description + "YANG version of the TOASTER-MIB."; + + revision "2009-11-20" { + description + "Toaster module in progress."; + } + + + identity toast-type { + description + "Base for all bread types supported by the toaster. + New bread types not listed here nay be added in the + future."; + } + + identity white-bread { + base toast:toast-type; + description "White bread."; + } + + identity wheat-bread { + base toast-type; + description "Wheat bread."; + } + + identity wonder-bread { + base toast-type; + description "Wonder bread."; + } + + identity frozen-waffle { + base toast-type; + description "Frozen waffle."; + } + + identity frozen-bagel { + base toast-type; + description "Frozen bagel."; + } + + identity hash-brown { + base toast-type; + description "Hash browned potatos."; + } + + typedef DisplayString { + type string { + length "0 .. 255"; + } + description + "YANG version of the SMIv2 DisplayString TEXTUAL-CONVENTION."; + reference + "RFC 2579, section 2."; + + } + + container toaster { + presence + "Indicates the toaster service is available"; + description + "Top-level container for all toaster database objects."; + leaf toasterManufacturer { + type DisplayString; + config false; + mandatory true; + description + "The name of the toaster's manufacturer. For instance, + Microsoft Toaster."; + } + + leaf toasterModelNumber { + type DisplayString; + config false; + mandatory true; + description + "The name of the toaster's model. For instance, + Radiant Automatic."; + } + + leaf toasterStatus { + type enumeration { + enum "up" { + value 1; + description + "The toaster knob position is up. + No toast is being made now."; + } + enum "down" { + value 2; + description + "The toaster knob position is down. + Toast is being made now."; + } + } + config false; + mandatory true; + description + "This variable indicates the current state of + the toaster."; + } + } // container toaster + + rpc make-toast { + description + "Make some toast. + The toastDone notification will be sent when + the toast is finished. + An 'in-use' error will be returned if toast + is already being made. + A 'resource-denied' error will be returned + if the toaster service is disabled."; + input { + leaf toasterDoneness { + type uint32 { + range "1 .. 10"; + } + default '5'; + description + "This variable controls how well-done is the + ensuing toast. It should be on a scale of 1 to 10. + Toast made at 10 generally is considered unfit + for human consumption; toast made at 1 is warmed + lightly."; + } + + leaf toasterToastType { + type identityref { + base toast:toast-type; + } + default 'wheat-bread'; + description + "This variable informs the toaster of the type of + material that is being toasted. The toaster + uses this information, combined with + toasterDoneness, to compute for how + long the material must be toasted to achieve + the required doneness."; + } + } + } // rpc make-toast + + rpc testOutput { + output { + leaf textOut { + type string; + } + } + } + + rpc cancel-toast { + description + "Stop making toast, if any is being made. + A 'resource-denied' error will be returned + if the toaster service is disabled."; + } // rpc cancel-toast + + notification toastDone { + description + "Indicates that the toast in progress has completed."; + leaf toastStatus { + type enumeration { + enum "done" { + value 0; + description "The toast is done."; + } + enum "cancelled" { + value 1; + description + "The toast was cancelled."; + } + enum "error" { + value 2; + description + "The toaster service was disabled or + the toaster is broken."; + } + } + description + "Indicates the final toast status"; + } + } // notification toastDone + } // module toaster diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/instanceidentifier/iid-value.yang b/netconf/restconf/restconf-nb-bierman02/src/test/resources/instanceidentifier/iid-value.yang new file mode 100644 index 0000000..4e536df --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/instanceidentifier/iid-value.yang @@ -0,0 +1,23 @@ +module iid-value-module { + namespace "iid:value:module"; + + prefix "iidvm"; + revision 2016-09-12 { + } + + container cont-iid { + list iid-list{ + key "iid-leaf"; + leaf iid-leaf{ + type instance-identifier; + } + } + + list values-iid{ + key "value-iid"; + leaf value-iid{ + type string; + } + } + } +}
\ No newline at end of file diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/instanceidentifier/json/jsonPATCHMergeOperationOnContainer.json b/netconf/restconf/restconf-nb-bierman02/src/test/resources/instanceidentifier/json/jsonPATCHMergeOperationOnContainer.json new file mode 100644 index 0000000..1483920 --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/instanceidentifier/json/jsonPATCHMergeOperationOnContainer.json @@ -0,0 +1,43 @@ +{ + "ietf-yang-patch:yang-patch" : { + "patch-id" : "Test merge operation", + "comment" : "This is test patch for merge operation on container", + "edit" : [ + { + "edit-id": "edit1", + "operation": "create", + "target": "/", + "value": { + "patch-cont": { + "my-list1": [ + { + "name": "my-list1 - A", + "my-leaf11": "I am leaf11-0", + "my-leaf12": "I am leaf12-1" + }, + { + "name": "my-list1 - B", + "my-leaf11": "I am leaf11-0", + "my-leaf12": "I am leaf12-1" + } + ] + } + } + }, + { + "edit-id": "edit2", + "operation": "merge", + "target": "/", + "value": { + "patch-cont": { + "my-list1": { + "name": "my-list1 - Merged", + "my-leaf11": "I am leaf11-0", + "my-leaf12": "I am leaf12-1" + } + } + } + } + ] + } +}
\ No newline at end of file diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/instanceidentifier/json/jsonPATCHMergeOperationOnList.json b/netconf/restconf/restconf-nb-bierman02/src/test/resources/instanceidentifier/json/jsonPATCHMergeOperationOnList.json new file mode 100644 index 0000000..3b809e0 --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/instanceidentifier/json/jsonPATCHMergeOperationOnList.json @@ -0,0 +1,32 @@ +{ + "ietf-yang-patch:yang-patch" : { + "patch-id" : "Test merge operation", + "comment" : "This is test patch for merge operation on list", + "edit" : [ + { + "edit-id": "edit1", + "operation": "replace", + "target": "/instance-identifier-patch-module:my-list2[instance-identifier-patch-module:name='my-leaf20']", + "value": { + "my-list2": { + "name": "my-leaf20", + "my-leaf21": "I am leaf21-0", + "my-leaf22": "I am leaf22-0" + } + } + }, + { + "edit-id": "edit2", + "operation": "merge", + "target": "/instance-identifier-patch-module:my-list2[instance-identifier-patch-module:name='my-leaf21']", + "value": { + "my-list2": { + "name": "my-leaf21", + "my-leaf21": "I am leaf21-1", + "my-leaf22": "I am leaf22-1" + } + } + } + ] + } +}
\ No newline at end of file diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/instanceidentifier/json/jsonPATCHSimpleLeafValue.json b/netconf/restconf/restconf-nb-bierman02/src/test/resources/instanceidentifier/json/jsonPATCHSimpleLeafValue.json new file mode 100644 index 0000000..4a109ef --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/instanceidentifier/json/jsonPATCHSimpleLeafValue.json @@ -0,0 +1,17 @@ +{ + "ietf-yang-patch:yang-patch" : { + + "patch-id" : "test-patch", + "comment" : "this is test patch for simple leaf value", + "edit" : [ + { + "edit-id": "edit1", + "operation": "replace", + "target": "/instance-identifier-patch-module:my-list2[instance-identifier-patch-module:name='my-leaf20']/instance-identifier-patch-module:name", + "value": { + "name": "my-leaf20" + } + } + ] + } +}
\ No newline at end of file diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/instanceidentifier/json/jsonPATCHdata.json b/netconf/restconf/restconf-nb-bierman02/src/test/resources/instanceidentifier/json/jsonPATCHdata.json new file mode 100644 index 0000000..e027a76 --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/instanceidentifier/json/jsonPATCHdata.json @@ -0,0 +1,35 @@ +{ + "ietf-yang-patch:yang-patch" : { + + "patch-id" : "test-patch", + "comment" : "this is test patch", + "edit" : [ + { + "edit-id": "edit1", + "operation": "replace", + "target": "/instance-identifier-patch-module:my-list2[instance-identifier-patch-module:name='my-leaf20']", + "value": { + "my-list2": { + "name": "my-leaf20", + "my-leaf21": "I am leaf21-0", + "my-leaf22": "I am leaf22-0" + } + } + }, + + { + "edit-id": "edit2", + "operation": "replace", + "target": "/instance-identifier-patch-module:my-list2[instance-identifier-patch-module:name='my-leaf20']", + "value": { + "my-list2": { + "name": "my-leaf20", + "my-leaf21": "I am leaf21-1", + "my-leaf22": "I am leaf22-1", + "my-leaf-list": ["listelement"] + } + } + } + ] + } +} diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/instanceidentifier/json/jsonPATCHdataCompleteTargetInURI.json b/netconf/restconf/restconf-nb-bierman02/src/test/resources/instanceidentifier/json/jsonPATCHdataCompleteTargetInURI.json new file mode 100644 index 0000000..1b170c7 --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/instanceidentifier/json/jsonPATCHdataCompleteTargetInURI.json @@ -0,0 +1,44 @@ +{ + "ietf-yang-patch:yang-patch" : { + + "patch-id" : "test-patch", + "comment" : "Test to create and replace data in container directly using / sign as a target", + "edit" : [ + { + "edit-id": "edit1", + "operation": "create", + "target": "/", + "value": { + "patch-cont": { + "my-list1": [ + { + "name": "my-list1 - A", + "my-leaf11": "I am leaf11-0", + "my-leaf12": "I am leaf12-1" + }, + { + "name": "my-list1 - B", + "my-leaf11": "I am leaf11-0", + "my-leaf12": "I am leaf12-1" + } + ] + } + } + }, + { + "edit-id": "edit2", + "operation": "replace", + "target": "/", + "value": { + "patch-cont": { + "my-list1": { + "name": "my-list1 - Replacing", + "my-leaf11": "I am leaf11-0", + "my-leaf12": "I am leaf12-1" + } + } + } + } + ] + } +}
\ No newline at end of file diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/instanceidentifier/json/jsonPATCHdataCreateAndDelete.json b/netconf/restconf/restconf-nb-bierman02/src/test/resources/instanceidentifier/json/jsonPATCHdataCreateAndDelete.json new file mode 100644 index 0000000..4455038 --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/instanceidentifier/json/jsonPATCHdataCreateAndDelete.json @@ -0,0 +1,31 @@ +{ + "ietf-yang-patch:yang-patch" : { + "patch-id" : "test-patch", + "comment" : "this is test patch", + "edit" : [ + { + "edit-id": "edit1", + "value": { + "my-list2": [ + { + "name": "my-leaf20", + "my-leaf21": "I am leaf20" + }, + { + "name": "my-leaf21", + "my-leaf21": "I am leaf21-1", + "my-leaf22": "I am leaf21-2" + } + ] + }, + "target": "/instance-identifier-patch-module:my-list2[instance-identifier-patch-module:name='my-leaf20']", + "operation": "create" + }, + { + "edit-id": "edit2", + "operation": "delete", + "target": "/instance-identifier-patch-module:my-list2[instance-identifier-patch-module:name='my-leaf20']" + } + ] + } +}
\ No newline at end of file diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/instanceidentifier/json/jsonPATCHdataValueMissing.json b/netconf/restconf/restconf-nb-bierman02/src/test/resources/instanceidentifier/json/jsonPATCHdataValueMissing.json new file mode 100644 index 0000000..eaf1b37 --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/instanceidentifier/json/jsonPATCHdataValueMissing.json @@ -0,0 +1,13 @@ +{ + "ietf-yang-patch:yang-patch" : { + "patch-id" : "test-patch", + "comment" : "this is test patch", + "edit" : [ + { + "edit-id": "edit1", + "target": "/instance-identifier-patch-module:my-list2[instance-identifier-patch-module:name='my-leaf20']", + "operation": "create" + } + ] + } +}
\ No newline at end of file diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/instanceidentifier/json/jsonPATCHdataValueNotSupported.json b/netconf/restconf/restconf-nb-bierman02/src/test/resources/instanceidentifier/json/jsonPATCHdataValueNotSupported.json new file mode 100644 index 0000000..1ad52fb --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/instanceidentifier/json/jsonPATCHdataValueNotSupported.json @@ -0,0 +1,20 @@ +{ + "ietf-yang-patch:yang-patch" : { + "patch-id" : "test-patch", + "comment" : "this is test patch", + "edit" : [ + { + "edit-id": "edit2", + "operation": "delete", + "target": "/instance-identifier-patch-module:my-list2[instance-identifier-patch-module:name='my-leaf20']", + "value": { + "my-list2": [ + { + "name": "my-leaf20" + } + ] + } + } + ] + } +}
\ No newline at end of file diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/instanceidentifier/json/json_augment_choice_container.json b/netconf/restconf/restconf-nb-bierman02/src/test/resources/instanceidentifier/json/json_augment_choice_container.json new file mode 100644 index 0000000..e64e00e --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/instanceidentifier/json/json_augment_choice_container.json @@ -0,0 +1,5 @@ +{ + "augment-module:case-choice-case-container1": { + "augment-module:case-choice-case-leaf1": "stryng" + } +}
\ No newline at end of file diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/instanceidentifier/json/json_augment_container.json b/netconf/restconf/restconf-nb-bierman02/src/test/resources/instanceidentifier/json/json_augment_container.json new file mode 100644 index 0000000..e2532f2 --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/instanceidentifier/json/json_augment_container.json @@ -0,0 +1,5 @@ +{ + "augment-module:cont-augment": { + "augment-module:leaf1": "stryng" + } +}
\ No newline at end of file diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/instanceidentifier/json/json_sub_container.json b/netconf/restconf/restconf-nb-bierman02/src/test/resources/instanceidentifier/json/json_sub_container.json new file mode 100644 index 0000000..22a1d15 --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/instanceidentifier/json/json_sub_container.json @@ -0,0 +1,5 @@ +{ + "instance-identifier-module:cont1": { + "augment-module-leaf-list:lf11" : "/instance-identifier-module:cont/instance-identifier-module:cont1/augment-module-leaf-list:lflst11[.=\"lflst11_1\"]" + } +}
\ No newline at end of file diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/instanceidentifier/json/jsondata.json b/netconf/restconf/restconf-nb-bierman02/src/test/resources/instanceidentifier/json/jsondata.json new file mode 100644 index 0000000..f616a8a --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/instanceidentifier/json/jsondata.json @@ -0,0 +1,14 @@ +{ + "instance-identifier-module:cont": { + "cont1": { + "augment-module:lst11": [ + { + "keyvalue111":"value1", + "keyvalue112":"value2", + "augment-augment-module:lf111":"/instance-identifier-module:cont/instance-identifier-module:cont1/augment-module:lst11[augment-module:keyvalue111=\"value1\"][augment-module:keyvalue112=\"value2\"]/augment-augment-module:lf112", + "augment-augment-module:lf112":"lf112 value" + } + ] + } + } +}
\ No newline at end of file diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/instanceidentifier/json/jsondata_leaf_list.json b/netconf/restconf/restconf-nb-bierman02/src/test/resources/instanceidentifier/json/jsondata_leaf_list.json new file mode 100644 index 0000000..63be4b9 --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/instanceidentifier/json/jsondata_leaf_list.json @@ -0,0 +1,7 @@ +{ + "instance-identifier-module:cont": { + "cont1": { + "augment-module-leaf-list:lf11" : "/instance-identifier-module:cont/instance-identifier-module:cont1/augment-module-leaf-list:lflst11[.=\"lflst11_1\"]" + } + } +}
\ No newline at end of file diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/instanceidentifier/xml/bug7933.xml b/netconf/restconf/restconf-nb-bierman02/src/test/resources/instanceidentifier/xml/bug7933.xml new file mode 100644 index 0000000..aa0d79e --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/instanceidentifier/xml/bug7933.xml @@ -0,0 +1,9 @@ +<!-- + ~ Copyright (c) 2017 Pantheon Technologies s.r.o. and others. All rights reserved. + ~ + ~ This program and the accompanying materials are made available under the + ~ terms of the Eclipse Public License v1.0 which accompanies this distribution, + ~ and is available at http://www.eclipse.org/legal/epl-v10.html + --> + +<cont1 xmlns="instance:identifier:module"/> diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/instanceidentifier/xml/xmlDataFindBarContainer.xml b/netconf/restconf/restconf-nb-bierman02/src/test/resources/instanceidentifier/xml/xmlDataFindBarContainer.xml new file mode 100644 index 0000000..6523345 --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/instanceidentifier/xml/xmlDataFindBarContainer.xml @@ -0,0 +1,10 @@ +<!-- + ~ Copyright (c) 2016 Cisco Systems, Inc. and others. All rights reserved. + ~ + ~ This program and the accompanying materials are made available under the + ~ terms of the Eclipse Public License v1.0 which accompanies this distribution, + ~ and is available at http://www.eclipse.org/legal/epl-v10.html + --> + +<foo-bar-container xmlns="bar:module"> +</foo-bar-container>
\ No newline at end of file diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/instanceidentifier/xml/xmlDataFindFooContainer.xml b/netconf/restconf/restconf-nb-bierman02/src/test/resources/instanceidentifier/xml/xmlDataFindFooContainer.xml new file mode 100644 index 0000000..93aeff8 --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/instanceidentifier/xml/xmlDataFindFooContainer.xml @@ -0,0 +1,10 @@ +<!-- + ~ Copyright (c) 2016 Cisco Systems, Inc. and others. All rights reserved. + ~ + ~ This program and the accompanying materials are made available under the + ~ terms of the Eclipse Public License v1.0 which accompanies this distribution, + ~ and is available at http://www.eclipse.org/legal/epl-v10.html + --> + +<foo-bar-container xmlns="foo:module"> +</foo-bar-container>
\ No newline at end of file diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/instanceidentifier/xml/xmlPATCHdata.xml b/netconf/restconf/restconf-nb-bierman02/src/test/resources/instanceidentifier/xml/xmlPATCHdata.xml new file mode 100644 index 0000000..d7d3a6b --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/instanceidentifier/xml/xmlPATCHdata.xml @@ -0,0 +1,28 @@ +<yang-patch xmlns="urn:ietf:params:xml:ns:yang:ietf-yang-patch"> + <patch-id>test-patch</patch-id> + <comment>this is test patch</comment> + <edit> + <edit-id>edit1</edit-id> + <operation>create</operation> + <target>/my-list2</target> + <value> + <my-list2 xmlns="instance:identifier:patch:module"> + <name>my-leaf20</name> + <my-leaf21>I am leaf21-0</my-leaf21> + <my-leaf22>I am leaf22-0</my-leaf22> + </my-list2> + </value> + </edit> + <edit> + <edit-id>edit2</edit-id> + <operation>create</operation> + <target>/my-list2</target> + <value> + <my-list2 xmlns="instance:identifier:patch:module"> + <name>my-leaf21</name> + <my-leaf21>I am leaf21-1</my-leaf21> + <my-leaf22>I am leaf22-1</my-leaf22> + </my-list2> + </value> + </edit> +</yang-patch>
\ No newline at end of file diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/instanceidentifier/xml/xmlPATCHdataAbsoluteTargetPath.xml b/netconf/restconf/restconf-nb-bierman02/src/test/resources/instanceidentifier/xml/xmlPATCHdataAbsoluteTargetPath.xml new file mode 100644 index 0000000..6e84c47 --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/instanceidentifier/xml/xmlPATCHdataAbsoluteTargetPath.xml @@ -0,0 +1,35 @@ +<!-- + ~ Copyright (c) 2016 Cisco Systems, Inc. and others. All rights reserved. + ~ + ~ This program and the accompanying materials are made available under the + ~ terms of the Eclipse Public License v1.0 which accompanies this distribution, + ~ and is available at http://www.eclipse.org/legal/epl-v10.html + --> +<yang-patch xmlns="urn:ietf:params:xml:ns:yang:ietf-yang-patch"> + <patch-id>test-patch</patch-id> + <comment>Test patch with absolute target path</comment> + <edit> + <edit-id>edit1</edit-id> + <operation>create</operation> + <target>/instance-identifier-patch-module:patch-cont/my-list1/leaf1/my-list2</target> + <value> + <my-list2 xmlns="instance:identifier:patch:module"> + <name>my-leaf20</name> + <my-leaf21>I am leaf21-0</my-leaf21> + <my-leaf22>I am leaf22-0</my-leaf22> + </my-list2> + </value> + </edit> + <edit> + <edit-id>edit2</edit-id> + <operation>create</operation> + <target>/instance-identifier-patch-module:patch-cont/my-list1/leaf1/my-list2</target> + <value> + <my-list2 xmlns="instance:identifier:patch:module"> + <name>my-leaf21</name> + <my-leaf21>I am leaf21-1</my-leaf21> + <my-leaf22>I am leaf22-1</my-leaf22> + </my-list2> + </value> + </edit> +</yang-patch>
\ No newline at end of file diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/instanceidentifier/xml/xmlPATCHdataCompleteTargetInURI.xml b/netconf/restconf/restconf-nb-bierman02/src/test/resources/instanceidentifier/xml/xmlPATCHdataCompleteTargetInURI.xml new file mode 100644 index 0000000..23d2ce0 --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/instanceidentifier/xml/xmlPATCHdataCompleteTargetInURI.xml @@ -0,0 +1,44 @@ +<!-- + ~ Copyright (c) 2016 Cisco Systems, Inc. and others. All rights reserved. + ~ + ~ This program and the accompanying materials are made available under the + ~ terms of the Eclipse Public License v1.0 which accompanies this distribution, + ~ and is available at http://www.eclipse.org/legal/epl-v10.html + --> +<yang-patch xmlns="urn:ietf:params:xml:ns:yang:ietf-yang-patch"> + <patch-id>test-patch</patch-id> + <comment>Test to create and replace data in container directly using / sign as a target</comment> + <edit> + <edit-id>edit1</edit-id> + <operation>create</operation> + <target>/</target> + <value> + <patch-cont xmlns="instance:identifier:patch:module"> + <my-list1> + <name>my-list1 - A</name> + <my-leaf11>I am leaf11-0</my-leaf11> + <my-leaf12>I am leaf12-1</my-leaf12> + </my-list1> + <my-list1> + <name>my-list1 - B</name> + <my-leaf11>I am leaf11-0</my-leaf11> + <my-leaf12>I am leaf12-1</my-leaf12> + </my-list1> + </patch-cont> + </value> + </edit> + <edit> + <edit-id>edit2</edit-id> + <operation>replace</operation> + <target>/</target> + <value> + <patch-cont xmlns="instance:identifier:patch:module"> + <my-list1> + <name>my-list1 - Replacing</name> + <my-leaf11>I am leaf11-0</my-leaf11> + <my-leaf12>I am leaf12-1</my-leaf12> + </my-list1> + </patch-cont> + </value> + </edit> +</yang-patch>
\ No newline at end of file diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/instanceidentifier/xml/xmlPATCHdataMergeOperationOnContainer.xml b/netconf/restconf/restconf-nb-bierman02/src/test/resources/instanceidentifier/xml/xmlPATCHdataMergeOperationOnContainer.xml new file mode 100644 index 0000000..afa35bd --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/instanceidentifier/xml/xmlPATCHdataMergeOperationOnContainer.xml @@ -0,0 +1,44 @@ +<!-- + ~ Copyright (c) 2016 Cisco Systems, Inc. and others. All rights reserved. + ~ + ~ This program and the accompanying materials are made available under the + ~ terms of the Eclipse Public License v1.0 which accompanies this distribution, + ~ and is available at http://www.eclipse.org/legal/epl-v10.html + --> +<yang-patch xmlns="urn:ietf:params:xml:ns:yang:ietf-yang-patch"> + <patch-id>Test merge operation</patch-id> + <comment>This is test patch for merge operation on container</comment> + <edit> + <edit-id>edit1</edit-id> + <operation>create</operation> + <target>/</target> + <value> + <patch-cont xmlns="instance:identifier:patch:module"> + <my-list1> + <name>my-list1 - A</name> + <my-leaf11>I am leaf11-0</my-leaf11> + <my-leaf12>I am leaf12-1</my-leaf12> + </my-list1> + <my-list1> + <name>my-list1 - B</name> + <my-leaf11>I am leaf11-0</my-leaf11> + <my-leaf12>I am leaf12-1</my-leaf12> + </my-list1> + </patch-cont> + </value> + </edit> + <edit> + <edit-id>edit2</edit-id> + <operation>merge</operation> + <target>/</target> + <value> + <patch-cont xmlns="instance:identifier:patch:module"> + <my-list1> + <name>my-list1 - Merged</name> + <my-leaf11>I am leaf11-0</my-leaf11> + <my-leaf12>I am leaf12-1</my-leaf12> + </my-list1> + </patch-cont> + </value> + </edit> +</yang-patch>
\ No newline at end of file diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/instanceidentifier/xml/xmlPATCHdataMergeOperationOnList.xml b/netconf/restconf/restconf-nb-bierman02/src/test/resources/instanceidentifier/xml/xmlPATCHdataMergeOperationOnList.xml new file mode 100644 index 0000000..ad13041 --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/instanceidentifier/xml/xmlPATCHdataMergeOperationOnList.xml @@ -0,0 +1,35 @@ +<!-- + ~ Copyright (c) 2016 Cisco Systems, Inc. and others. All rights reserved. + ~ + ~ This program and the accompanying materials are made available under the + ~ terms of the Eclipse Public License v1.0 which accompanies this distribution, + ~ and is available at http://www.eclipse.org/legal/epl-v10.html + --> +<yang-patch xmlns="urn:ietf:params:xml:ns:yang:ietf-yang-patch"> + <patch-id>Test merge operation</patch-id> + <comment>This is test patch for merge operation on list</comment> + <edit> + <edit-id>edit1</edit-id> + <operation>replace</operation> + <target>/my-list2</target> + <value> + <my-list2 xmlns="instance:identifier:patch:module"> + <name>my-leaf20</name> + <my-leaf21>I am leaf21-0</my-leaf21> + <my-leaf22>I am leaf22-0</my-leaf22> + </my-list2> + </value> + </edit> + <edit> + <edit-id>edit2</edit-id> + <operation>merge</operation> + <target>/my-list2</target> + <value> + <my-list2 xmlns="instance:identifier:patch:module"> + <name>my-leaf21</name> + <my-leaf21>I am leaf21-1</my-leaf21> + <my-leaf22>I am leaf22-1</my-leaf22> + </my-list2> + </value> + </edit> +</yang-patch>
\ No newline at end of file diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/instanceidentifier/xml/xmlPATCHdataValueMissing.xml b/netconf/restconf/restconf-nb-bierman02/src/test/resources/instanceidentifier/xml/xmlPATCHdataValueMissing.xml new file mode 100644 index 0000000..eeec5ad --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/instanceidentifier/xml/xmlPATCHdataValueMissing.xml @@ -0,0 +1,16 @@ +<!-- + ~ Copyright (c) 2016 Cisco Systems, Inc. and others. All rights reserved. + ~ + ~ This program and the accompanying materials are made available under the + ~ terms of the Eclipse Public License v1.0 which accompanies this distribution, + ~ and is available at http://www.eclipse.org/legal/epl-v10.html + --> +<yang-patch xmlns="urn:ietf:params:xml:ns:yang:ietf-yang-patch"> + <patch-id>test-patch</patch-id> + <comment>Test patch with missing value node for create operation</comment> + <edit> + <edit-id>edit1</edit-id> + <operation>create</operation> + <target>/my-list2</target> + </edit> +</yang-patch>
\ No newline at end of file diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/instanceidentifier/xml/xmlPATCHdataValueNotSupported.xml b/netconf/restconf/restconf-nb-bierman02/src/test/resources/instanceidentifier/xml/xmlPATCHdataValueNotSupported.xml new file mode 100644 index 0000000..8817094 --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/instanceidentifier/xml/xmlPATCHdataValueNotSupported.xml @@ -0,0 +1,23 @@ +<!-- + ~ Copyright (c) 2016 Cisco Systems, Inc. and others. All rights reserved. + ~ + ~ This program and the accompanying materials are made available under the + ~ terms of the Eclipse Public License v1.0 which accompanies this distribution, + ~ and is available at http://www.eclipse.org/legal/epl-v10.html + --> +<yang-patch xmlns="urn:ietf:params:xml:ns:yang:ietf-yang-patch"> + <patch-id>test-patch</patch-id> + <comment>Test patch with not allowed value node for delete operation</comment> + <edit> + <edit-id>edit1</edit-id> + <operation>delete</operation> + <target>/my-list2/my-leaf21</target> + <value> + <my-list2 xmlns="instance:identifier:patch:module"> + <name>my-leaf20</name> + <my-leaf21>I am leaf21-0</my-leaf21> + <my-leaf22>I am leaf22-0</my-leaf22> + </my-list2> + </value> + </edit> +</yang-patch>
\ No newline at end of file diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/instanceidentifier/xml/xml_augment_choice_container.xml b/netconf/restconf/restconf-nb-bierman02/src/test/resources/instanceidentifier/xml/xml_augment_choice_container.xml new file mode 100644 index 0000000..d73b300 --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/instanceidentifier/xml/xml_augment_choice_container.xml @@ -0,0 +1,3 @@ +<case-choice-case-container1 xmlns="augment:module"> + <case-choice-case-leaf1>stryng</case-choice-case-leaf1> +</case-choice-case-container1>
\ No newline at end of file diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/instanceidentifier/xml/xml_augment_container.xml b/netconf/restconf/restconf-nb-bierman02/src/test/resources/instanceidentifier/xml/xml_augment_container.xml new file mode 100644 index 0000000..6b35e9e --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/instanceidentifier/xml/xml_augment_container.xml @@ -0,0 +1,3 @@ +<cont-augment xmlns="augment:module"> + <leaf1>stryng</leaf1> +</cont-augment>
\ No newline at end of file diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/instanceidentifier/xml/xml_sub_container.xml b/netconf/restconf/restconf-nb-bierman02/src/test/resources/instanceidentifier/xml/xml_sub_container.xml new file mode 100644 index 0000000..f76e08d --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/instanceidentifier/xml/xml_sub_container.xml @@ -0,0 +1,6 @@ +<cont1 xmlns="instance:identifier:module"> + <lflst11 xmlns="augment:module:leaf:list">lflst11_1</lflst11> + <lflst11 xmlns="augment:module:leaf:list">lflst11_2</lflst11> + <lflst11 xmlns="augment:module:leaf:list">lflst11_3</lflst11> + <lf11 xmlns:a="instance:identifier:module" xmlns:b="augment:module:leaf:list" xmlns="augment:module:leaf:list">/a:cont/a:cont1/b:lflst11[.="lflst11_1"]</lf11> +</cont1>
\ No newline at end of file diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/instanceidentifier/xml/xmldata.xml b/netconf/restconf/restconf-nb-bierman02/src/test/resources/instanceidentifier/xml/xmldata.xml new file mode 100644 index 0000000..bd558fb --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/instanceidentifier/xml/xmldata.xml @@ -0,0 +1,10 @@ +<cont xmlns="instance:identifier:module"> + <cont1> + <lst11 xmlns="augment:module" xmlns:c="augment:augment:module"> + <keyvalue111>value1</keyvalue111> + <keyvalue112>value2</keyvalue112> + <lf111 xmlns="augment:augment:module" xmlns:a="instance:identifier:module" xmlns:b="augment:module" >/a:cont/a:cont1/b:lst11[b:keyvalue111="value1"][b:keyvalue112="value2"]/c:lf112</lf111> + <lf112 xmlns="augment:augment:module">lf112 value</lf112> + </lst11> + </cont1> +</cont> diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/instanceidentifier/xml/xmldata_leaf_list.xml b/netconf/restconf/restconf-nb-bierman02/src/test/resources/instanceidentifier/xml/xmldata_leaf_list.xml new file mode 100644 index 0000000..00d58c2 --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/instanceidentifier/xml/xmldata_leaf_list.xml @@ -0,0 +1,8 @@ +<cont xmlns="instance:identifier:module"> + <cont1> + <lflst11 xmlns="augment:module:leaf:list">lflst11_1</lflst11> + <lflst11 xmlns="augment:module:leaf:list">lflst11_2</lflst11> + <lflst11 xmlns="augment:module:leaf:list">lflst11_3</lflst11> + <lf11 xmlns:a="instance:identifier:module" xmlns:b="augment:module:leaf:list" xmlns="augment:module:leaf:list">/a:cont/a:cont1/b:lflst11[.="lflst11_1"]</lf11> + </cont1> +</cont> diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/instanceidentifier/yang/augment-augment-module.yang b/netconf/restconf/restconf-nb-bierman02/src/test/resources/instanceidentifier/yang/augment-augment-module.yang new file mode 100644 index 0000000..546111c --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/instanceidentifier/yang/augment-augment-module.yang @@ -0,0 +1,21 @@ +module augment-augment-module { + namespace "augment:augment:module"; + + prefix "aamodule"; + + import augment-module {prefix amodule; revision-date 2014-01-17;} + import instance-identifier-module {prefix imodule; revision-date 2014-01-17;} + + revision 2014-01-17 { + } + + augment "/imodule:cont/imodule:cont1/amodule:lst11" { + leaf lf111 { + type instance-identifier; + } + leaf lf112 { + type string; + } + } + +}
\ No newline at end of file diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/instanceidentifier/yang/augment-module-leaf-list.yang b/netconf/restconf/restconf-nb-bierman02/src/test/resources/instanceidentifier/yang/augment-module-leaf-list.yang new file mode 100644 index 0000000..54c305b --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/instanceidentifier/yang/augment-module-leaf-list.yang @@ -0,0 +1,20 @@ +module augment-module-leaf-list { + namespace "augment:module:leaf:list"; + + prefix "amodulelflst"; + + import instance-identifier-module {prefix imodule; revision-date 2014-01-17;} + + revision 2014-01-27 { + } + + augment "/imodule:cont/imodule:cont1" { + leaf-list lflst11 { + type string; + } + leaf lf11 { + type instance-identifier; + } + } + +}
\ No newline at end of file diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/instanceidentifier/yang/augment-module.yang b/netconf/restconf/restconf-nb-bierman02/src/test/resources/instanceidentifier/yang/augment-module.yang new file mode 100644 index 0000000..c918ef9 --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/instanceidentifier/yang/augment-module.yang @@ -0,0 +1,63 @@ +module augment-module { + namespace "augment:module"; + + prefix "amodule"; + + import instance-identifier-module {prefix imodule; revision-date 2014-01-17;} + + revision 2014-01-17 { + } + + augment "/imodule:cont/imodule:cont1" { + list lst11 { + key "keyvalue111 keyvalue112"; + leaf keyvalue111 { + type string; + } + leaf keyvalue112 { + type string; + } + } + } + + augment "/imodule:cont" { + container cont-augment { + leaf leaf1 { + type string; + } + } + } + + augment "/imodule:cont" { + choice augment-choice1 { + case case1 { + container case-container1 { + leaf case-leaf1 { + type string; + } + } + } + + case case2 { + container case-container2 { + leaf case-leaf2 { + type string; + } + } + } + } + } + + augment "/imodule:cont/augment-choice1/case1" { + choice augment-choice2 { + case case11 { + container case-choice-case-container1 { + leaf case-choice-case-leaf1 { + type string; + } + } + } + } + } + +} diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/instanceidentifier/yang/bar-module.yang b/netconf/restconf/restconf-nb-bierman02/src/test/resources/instanceidentifier/yang/bar-module.yang new file mode 100644 index 0000000..90de085 --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/instanceidentifier/yang/bar-module.yang @@ -0,0 +1,11 @@ +module bar-module { + namespace "bar:module"; + + prefix "bar-module"; + revision 2016-09-29 { + } + + /* This container has the same name as container in foo-module */ + container foo-bar-container { + } +}
\ No newline at end of file diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/instanceidentifier/yang/foo-module.yang b/netconf/restconf/restconf-nb-bierman02/src/test/resources/instanceidentifier/yang/foo-module.yang new file mode 100644 index 0000000..16b8e7f --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/instanceidentifier/yang/foo-module.yang @@ -0,0 +1,11 @@ +module foo-module { + namespace "foo:module"; + + prefix "foo-module"; + revision 2016-09-29 { + } + + /* This container has the same name as container in bar-module */ + container foo-bar-container { + } +}
\ No newline at end of file diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/instanceidentifier/yang/instance-identifier-module.yang b/netconf/restconf/restconf-nb-bierman02/src/test/resources/instanceidentifier/yang/instance-identifier-module.yang new file mode 100644 index 0000000..7a95a5f --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/instanceidentifier/yang/instance-identifier-module.yang @@ -0,0 +1,13 @@ +module instance-identifier-module { + namespace "instance:identifier:module"; + + prefix "iimodule"; + revision 2014-01-17 { + } + + container cont { + container cont1 { + } + } + +}
\ No newline at end of file diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/instanceidentifier/yang/instance-identifier-patch-module.yang b/netconf/restconf/restconf-nb-bierman02/src/test/resources/instanceidentifier/yang/instance-identifier-patch-module.yang new file mode 100644 index 0000000..02c1c2e --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/instanceidentifier/yang/instance-identifier-patch-module.yang @@ -0,0 +1,47 @@ +module instance-identifier-patch-module { + namespace "instance:identifier:patch:module"; + + prefix "iipmodule"; + revision 2015-11-21 { + } + + container patch-cont { + list my-list1 { + + description "PATCH /restconf/config/instance-identifier-patch-module:patch-cont/my-list1/leaf1"; + + key name; + + leaf name { + type string; + } + + leaf my-leaf11 { + type string; + } + + leaf my-leaf12 { + type string; + } + + list my-list2 { + key name; + + leaf name { + type string; + } + + leaf my-leaf21 { + type string; + } + + leaf my-leaf22 { + type string; + } + leaf-list my-leaf-list { + type string; + } + } + } + } +} diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/invoke-rpc/ietf-inet-types.yang b/netconf/restconf/restconf-nb-bierman02/src/test/resources/invoke-rpc/ietf-inet-types.yang new file mode 100644 index 0000000..de20feb --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/invoke-rpc/ietf-inet-types.yang @@ -0,0 +1,418 @@ + module ietf-inet-types { + + namespace "urn:ietf:params:xml:ns:yang:ietf-inet-types"; + prefix "inet"; + + organization + "IETF NETMOD (NETCONF Data Modeling Language) Working Group"; + + contact + "WG Web: <http://tools.ietf.org/wg/netmod/> + WG List: <mailto:netmod@ietf.org> + + WG Chair: David Partain + <mailto:david.partain@ericsson.com> + + WG Chair: David Kessens + <mailto:david.kessens@nsn.com> + + Editor: Juergen Schoenwaelder + <mailto:j.schoenwaelder@jacobs-university.de>"; + + description + "This module contains a collection of generally useful derived + YANG data types for Internet addresses and related things. + + Copyright (c) 2010 IETF Trust and the persons identified as + authors of the code. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, is permitted pursuant to, and subject to the license + terms contained in, the Simplified BSD License set forth in Section + 4.c of the IETF Trust's Legal Provisions Relating to IETF Documents + (http://trustee.ietf.org/license-info). + + This version of this YANG module is part of RFC 6021; see + the RFC itself for full legal notices."; + + revision 2010-09-24 { + description + "Initial revision."; + reference + "RFC 6021: Common YANG Data Types"; + } + + /*** collection of protocol field related types ***/ + + typedef ip-version { + type enumeration { + enum unknown { + value "0"; + description + "An unknown or unspecified version of the Internet protocol."; + } + enum ipv4 { + value "1"; + description + "The IPv4 protocol as defined in RFC 791."; + } + enum ipv6 { + value "2"; + description + "The IPv6 protocol as defined in RFC 2460."; + } + } + description + "This value represents the version of the IP protocol. + + In the value set and its semantics, this type is equivalent + to the InetVersion textual convention of the SMIv2."; + reference + "RFC 791: Internet Protocol + RFC 2460: Internet Protocol, Version 6 (IPv6) Specification + RFC 4001: Textual Conventions for Internet Network Addresses"; + } + + typedef dscp { + type uint8 { + range "0..63"; + } + description + "The dscp type represents a Differentiated Services Code-Point + that may be used for marking packets in a traffic stream. + + In the value set and its semantics, this type is equivalent + to the Dscp textual convention of the SMIv2."; + reference + "RFC 3289: Management Information Base for the Differentiated + Services Architecture + RFC 2474: Definition of the Differentiated Services Field + (DS Field) in the IPv4 and IPv6 Headers + RFC 2780: IANA Allocation Guidelines For Values In + the Internet Protocol and Related Headers"; + } + + typedef ipv6-flow-label { + type uint32 { + range "0..1048575"; + } + description + "The flow-label type represents flow identifier or Flow Label + in an IPv6 packet header that may be used to discriminate + traffic flows. + + In the value set and its semantics, this type is equivalent + to the IPv6FlowLabel textual convention of the SMIv2."; + reference + "RFC 3595: Textual Conventions for IPv6 Flow Label + RFC 2460: Internet Protocol, Version 6 (IPv6) Specification"; + } + + typedef port-number { + type uint16 { + range "0..65535"; + } + description + "The port-number type represents a 16-bit port number of an + Internet transport layer protocol such as UDP, TCP, DCCP, or + SCTP. Port numbers are assigned by IANA. A current list of + all assignments is available from <http://www.iana.org/>. + + Note that the port number value zero is reserved by IANA. In + situations where the value zero does not make sense, it can + be excluded by subtyping the port-number type. + + In the value set and its semantics, this type is equivalent + to the InetPortNumber textual convention of the SMIv2."; + reference + "RFC 768: User Datagram Protocol + RFC 793: Transmission Control Protocol + RFC 4960: Stream Control Transmission Protocol + RFC 4340: Datagram Congestion Control Protocol (DCCP) + RFC 4001: Textual Conventions for Internet Network Addresses"; + } + + /*** collection of autonomous system related types ***/ + + typedef as-number { + type uint32; + description + "The as-number type represents autonomous system numbers + which identify an Autonomous System (AS). An AS is a set + of routers under a single technical administration, using + an interior gateway protocol and common metrics to route + packets within the AS, and using an exterior gateway + protocol to route packets to other ASs'. IANA maintains + the AS number space and has delegated large parts to the + regional registries. + + Autonomous system numbers were originally limited to 16 + bits. BGP extensions have enlarged the autonomous system + number space to 32 bits. This type therefore uses an uint32 + base type without a range restriction in order to support + a larger autonomous system number space. + + In the value set and its semantics, this type is equivalent + to the InetAutonomousSystemNumber textual convention of + the SMIv2."; + reference + "RFC 1930: Guidelines for creation, selection, and registration + of an Autonomous System (AS) + RFC 4271: A Border Gateway Protocol 4 (BGP-4) + RFC 4893: BGP Support for Four-octet AS Number Space + RFC 4001: Textual Conventions for Internet Network Addresses"; + } + + /*** collection of IP address and hostname related types ***/ + + typedef ip-address { + type union { + type inet:ipv4-address; + type inet:ipv6-address; + } + description + "The ip-address type represents an IP address and is IP + version neutral. The format of the textual representations + implies the IP version."; + } + + typedef ipv4-address { + type string { + 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])' + + '(%[\p{N}\p{L}]+)?'; + } + description + "The ipv4-address type represents an IPv4 address in + dotted-quad notation. The IPv4 address may include a zone + index, separated by a % sign. + + The zone index is used to disambiguate identical address + values. For link-local addresses, the zone index will + typically be the interface index number or the name of an + interface. If the zone index is not present, the default + zone of the device will be used. + + The canonical format for the zone index is the numerical + format"; + } + + typedef ipv6-address { + type string { + pattern '((:|[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}]+)?'; + pattern '(([^:]+:){6}(([^:]+:[^:]+)|(.*\..*)))|' + + '((([^:]+:)*[^:]+)?::(([^:]+:)*[^:]+)?)' + + '(%.+)?'; + } + description + "The ipv6-address type represents an IPv6 address in full, + mixed, shortened, and shortened-mixed notation. The IPv6 + address may include a zone index, separated by a % sign. + + The zone index is used to disambiguate identical address + values. For link-local addresses, the zone index will + typically be the interface index number or the name of an + interface. If the zone index is not present, the default + zone of the device will be used. + + The canonical format of IPv6 addresses uses the compressed + format described in RFC 4291, Section 2.2, item 2 with the + following additional rules: the :: substitution must be + applied to the longest sequence of all-zero 16-bit chunks + in an IPv6 address. If there is a tie, the first sequence + of all-zero 16-bit chunks is replaced by ::. Single + all-zero 16-bit chunks are not compressed. The canonical + format uses lowercase characters and leading zeros are + not allowed. The canonical format for the zone index is + the numerical format as described in RFC 4007, Section + 11.2."; + reference + "RFC 4291: IP Version 6 Addressing Architecture + RFC 4007: IPv6 Scoped Address Architecture + RFC 5952: A Recommendation for IPv6 Address Text Representation"; + } + + typedef ip-prefix { + type union { + type inet:ipv4-prefix; + type inet:ipv6-prefix; + } + description + "The ip-prefix type represents an IP prefix and is IP + version neutral. The format of the textual representations + implies the IP version."; + } + + typedef ipv4-prefix { + type string { + 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])' + + '/(([0-9])|([1-2][0-9])|(3[0-2]))'; + } + description + "The ipv4-prefix type represents an IPv4 address prefix. + The prefix length is given by the number following the + slash character and must be less than or equal to 32. + + A prefix length value of n corresponds to an IP address + mask that has n contiguous 1-bits from the most + significant bit (MSB) and all other bits set to 0. + + The canonical format of an IPv4 prefix has all bits of + the IPv4 address set to zero that are not part of the + IPv4 prefix."; + } + + typedef ipv6-prefix { + type string { + pattern '((:|[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])))'; + pattern '(([^:]+:){6}(([^:]+:[^:]+)|(.*\..*)))|' + + '((([^:]+:)*[^:]+)?::(([^:]+:)*[^:]+)?)' + + '(/.+)'; + } + description + "The ipv6-prefix type represents an IPv6 address prefix. + The prefix length is given by the number following the + slash character and must be less than or equal 128. + + A prefix length value of n corresponds to an IP address + mask that has n contiguous 1-bits from the most + significant bit (MSB) and all other bits set to 0. + + The IPv6 address should have all bits that do not belong + to the prefix set to zero. + + The canonical format of an IPv6 prefix has all bits of + the IPv6 address set to zero that are not part of the + IPv6 prefix. Furthermore, IPv6 address is represented + in the compressed format described in RFC 4291, Section + 2.2, item 2 with the following additional rules: the :: + substitution must be applied to the longest sequence of + all-zero 16-bit chunks in an IPv6 address. If there is + a tie, the first sequence of all-zero 16-bit chunks is + replaced by ::. Single all-zero 16-bit chunks are not + compressed. The canonical format uses lowercase + characters and leading zeros are not allowed."; + reference + "RFC 4291: IP Version 6 Addressing Architecture"; + } + + /*** collection of domain name and URI types ***/ + + typedef domain-name { + type string { + pattern '((([a-zA-Z0-9_]([a-zA-Z0-9\-_]){0,61})?[a-zA-Z0-9]\.)*' + + '([a-zA-Z0-9_]([a-zA-Z0-9\-_]){0,61})?[a-zA-Z0-9]\.?)' + + '|\.'; + length "1..253"; + } + description + "The domain-name type represents a DNS domain name. The + name SHOULD be fully qualified whenever possible. + + Internet domain names are only loosely specified. Section + 3.5 of RFC 1034 recommends a syntax (modified in Section + 2.1 of RFC 1123). The pattern above is intended to allow + for current practice in domain name use, and some possible + future expansion. It is designed to hold various types of + domain names, including names used for A or AAAA records + (host names) and other records, such as SRV records. Note + that Internet host names have a stricter syntax (described + in RFC 952) than the DNS recommendations in RFCs 1034 and + 1123, and that systems that want to store host names in + schema nodes using the domain-name type are recommended to + adhere to this stricter standard to ensure interoperability. + + The encoding of DNS names in the DNS protocol is limited + to 255 characters. Since the encoding consists of labels + prefixed by a length bytes and there is a trailing NULL + byte, only 253 characters can appear in the textual dotted + notation. + + The description clause of schema nodes using the domain-name + type MUST describe when and how these names are resolved to + IP addresses. Note that the resolution of a domain-name value + may require to query multiple DNS records (e.g., A for IPv4 + and AAAA for IPv6). The order of the resolution process and + which DNS record takes precedence can either be defined + explicitely or it may depend on the configuration of the + resolver. + + Domain-name values use the US-ASCII encoding. Their canonical + format uses lowercase US-ASCII characters. Internationalized + domain names MUST be encoded in punycode as described in RFC + 3492"; + reference + "RFC 952: DoD Internet Host Table Specification + RFC 1034: Domain Names - Concepts and Facilities + RFC 1123: Requirements for Internet Hosts -- Application + and Support + RFC 2782: A DNS RR for specifying the location of services + (DNS SRV) + RFC 3492: Punycode: A Bootstring encoding of Unicode for + Internationalized Domain Names in Applications + (IDNA) + RFC 5891: Internationalizing Domain Names in Applications + (IDNA): Protocol"; + } + + typedef host { + type union { + type inet:ip-address; + type inet:domain-name; + } + description + "The host type represents either an IP address or a DNS + domain name."; + } + + typedef uri { + type string; + description + "The uri type represents a Uniform Resource Identifier + (URI) as defined by STD 66. + + Objects using the uri type MUST be in US-ASCII encoding, + and MUST be normalized as described by RFC 3986 Sections + 6.2.1, 6.2.2.1, and 6.2.2.2. All unnecessary + percent-encoding is removed, and all case-insensitive + characters are set to lowercase except for hexadecimal + digits, which are normalized to uppercase as described in + Section 6.2.2.1. + + The purpose of this normalization is to help provide + unique URIs. Note that this normalization is not + sufficient to provide uniqueness. Two URIs that are + textually distinct after this normalization may still be + equivalent. + + Objects using the uri type may restrict the schemes that + they permit. For example, 'data:' and 'urn:' schemes + might not be appropriate. + + A zero-length URI is not a valid URI. This can be used to + express 'URI absent' where required. + + In the value set and its semantics, this type is equivalent + to the Uri SMIv2 textual convention defined in RFC 5017."; + reference + "RFC 3986: Uniform Resource Identifier (URI): Generic Syntax + RFC 3305: Report from the Joint W3C/IETF URI Planning Interest + Group: Uniform Resource Identifiers (URIs), URLs, + and Uniform Resource Names (URNs): Clarifications + and Recommendations + RFC 5017: MIB Textual Conventions for Uniform Resource + Identifiers (URIs)"; + } + + } diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/invoke-rpc/ietf-restconf-monitoring@2017-01-26.yang b/netconf/restconf/restconf-nb-bierman02/src/test/resources/invoke-rpc/ietf-restconf-monitoring@2017-01-26.yang new file mode 100644 index 0000000..55c3cb1 --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/invoke-rpc/ietf-restconf-monitoring@2017-01-26.yang @@ -0,0 +1,149 @@ +module ietf-restconf-monitoring { + namespace "urn:ietf:params:xml:ns:yang:ietf-restconf-monitoring"; + prefix "rcmon"; + + import ietf-yang-types { prefix yang; } + import ietf-inet-types { prefix inet; } + + organization + "IETF NETCONF (Network Configuration) Working Group"; + + contact + "WG Web: <https://datatracker.ietf.org/wg/netconf/> + WG List: <mailto:netconf@ietf.org> + + Author: Andy Bierman + <mailto:andy@yumaworks.com> + + Author: Martin Bjorklund + <mailto:mbj@tail-f.com> + + Author: Kent Watsen + <mailto:kwatsen@juniper.net>"; + + description + "This module contains monitoring information for the + RESTCONF protocol. + + Copyright (c) 2017 IETF Trust and the persons identified as + authors of the code. All rights reserved. + + Redistribution and use in source and binary forms, with or + without modification, is permitted pursuant to, and subject + to the license terms contained in, the Simplified BSD License + set forth in Section 4.c of the IETF Trust's Legal Provisions + Relating to IETF Documents + (http://trustee.ietf.org/license-info). + + This version of this YANG module is part of RFC 8040; see + the RFC itself for full legal notices."; + + revision 2017-01-26 { + description + "Initial revision."; + reference + "RFC 8040: RESTCONF Protocol."; + } + + container restconf-state { + config false; + description + "Contains RESTCONF protocol monitoring information."; + + container capabilities { + description + "Contains a list of protocol capability URIs."; + + leaf-list capability { + type inet:uri; + description + "A RESTCONF protocol capability URI."; + } + } + + container streams { + description + "Container representing the notification event streams + supported by the server."; + reference + "RFC 5277, Section 3.4, <streams> element."; + + list stream { + key name; + description + "Each entry describes an event stream supported by + the server."; + + leaf name { + type string; + description + "The stream name."; + reference + "RFC 5277, Section 3.4, <name> element."; + } + + leaf description { + type string; + description + "Description of stream content."; + reference + "RFC 5277, Section 3.4, <description> element."; + } + + leaf replay-support { + type boolean; + default false; + description + "Indicates if replay buffer is supported for this stream. + If 'true', then the server MUST support the 'start-time' + and 'stop-time' query parameters for this stream."; + reference + "RFC 5277, Section 3.4, <replaySupport> element."; + } + + leaf replay-log-creation-time { + when "../replay-support" { + description + "Only present if notification replay is supported."; + } + type yang:date-and-time; + description + "Indicates the time the replay log for this stream + was created."; + reference + "RFC 5277, Section 3.4, <replayLogCreationTime> + element."; + } + + list access { + key encoding; + min-elements 1; + description + "The server will create an entry in this list for each + encoding format that is supported for this stream. + The media type 'text/event-stream' is expected + for all event streams. This list identifies the + subtypes supported for this stream."; + + leaf encoding { + type string; + description + "This is the secondary encoding format within the + 'text/event-stream' encoding used by all streams. + The type 'xml' is supported for XML encoding. + The type 'json' is supported for JSON encoding."; + } + + leaf location { + type inet:uri; + mandatory true; + description + "Contains a URL that represents the entry point + for establishing notification delivery via + server-sent events."; + } + } + } + } + } +} diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/invoke-rpc/ietf-yang-library@2016-06-21.yang b/netconf/restconf/restconf-nb-bierman02/src/test/resources/invoke-rpc/ietf-yang-library@2016-06-21.yang new file mode 100644 index 0000000..bc466ee --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/invoke-rpc/ietf-yang-library@2016-06-21.yang @@ -0,0 +1,208 @@ +module ietf-yang-library { + namespace "urn:ietf:params:xml:ns:yang:ietf-yang-library"; + prefix "yanglib"; + import ietf-yang-types { + prefix yang; + } + import ietf-inet-types { + prefix inet; + } + organization + "IETF NETCONF (Network Configuration) Working Group"; + contact + "WG Web: <https://datatracker.ietf.org/wg/netconf/> + WG List: <mailto:netconf@ietf.org> + WG Chair: Mehmet Ersue + <mailto:mehmet.ersue@nsn.com> + WG Chair: Mahesh Jethanandani + <mailto:mjethanandani@gmail.com> + Editor: Andy Bierman + <mailto:andy@yumaworks.com> + Editor: Martin Bjorklund + <mailto:mbj@tail-f.com> + Editor: Kent Watsen + <mailto:kwatsen@juniper.net>"; + description + "This module contains monitoring information about the YANG + modules and submodules that are used within a YANG-based + server. + Copyright (c) 2016 IETF Trust and the persons identified as + authors of the code. All rights reserved. + Redistribution and use in source and binary forms, with or + without modification, is permitted pursuant to, and subject + to the license terms contained in, the Simplified BSD License + set forth in Section 4.c of the IETF Trust's Legal Provisions + Relating to IETF Documents + (http://trustee.ietf.org/license-info). + This version of this YANG module is part of RFC 7895; see + the RFC itself for full legal notices."; + revision 2016-06-21 { + description + "Initial revision."; + reference + "RFC 7895: YANG Module Library."; + } + /* + * Typedefs + */ + typedef revision-identifier { + type string { + pattern '\d{4}-\d{2}-\d{2}'; + } + description + "Represents a specific date in YYYY-MM-DD format."; + } + /* + * Groupings + */ + grouping module-list { + description + "The module data structure is represented as a grouping + so it can be reused in configuration or another monitoring + data structure."; + grouping common-leafs { + description + "Common parameters for YANG modules and submodules."; + leaf name { + type yang:yang-identifier; + description + "The YANG module or submodule name."; + } + leaf revision { + type union { + type revision-identifier; + type string { length 0; } + } + description + "The YANG module or submodule revision date. + A zero-length string is used if no revision statement + is present in the YANG module or submodule."; + } + } + grouping schema-leaf { + description + "Common schema leaf parameter for modules and submodules."; + leaf schema { + type inet:uri; + description + "Contains a URL that represents the YANG schema + resource for this module or submodule. + This leaf will only be present if there is a URL + available for retrieval of the schema for this entry."; + } + } + list module { + key "name revision"; + description + "Each entry represents one revision of one module + currently supported by the server."; + uses common-leafs; + uses schema-leaf; + leaf namespace { + type inet:uri; + mandatory true; + description + "The XML namespace identifier for this module."; + } + leaf-list feature { + type yang:yang-identifier; + description + "List of YANG feature names from this module that are + supported by the server, regardless of whether they are + defined in the module or any included submodule."; + } + list deviation { + key "name revision"; + description + "List of YANG deviation module names and revisions + used by this server to modify the conformance of + the module associated with this entry. Note that + the same module can be used for deviations for + multiple modules, so the same entry MAY appear + within multiple 'module' entries. + The deviation module MUST be present in the 'module' + list, with the same name and revision values. + The 'conformance-type' value will be 'implement' for + the deviation module."; + uses common-leafs; + } + leaf conformance-type { + type enumeration { + enum implement { + description + "Indicates that the server implements one or more + protocol-accessible objects defined in the YANG module + identified in this entry. This includes deviation + statements defined in the module. + For YANG version 1.1 modules, there is at most one + module entry with conformance type 'implement' for a + particular module name, since YANG 1.1 requires that, + at most, one revision of a module is implemented. + For YANG version 1 modules, there SHOULD NOT be more + than one module entry for a particular module name."; + } + enum import { + description + "Indicates that the server imports reusable definitions + from the specified revision of the module but does + not implement any protocol-accessible objects from + this revision. + Multiple module entries for the same module name MAY + exist. This can occur if multiple modules import the + same module but specify different revision dates in + the import statements."; + } + } + mandatory true; + description + "Indicates the type of conformance the server is claiming + for the YANG module identified by this entry."; + } + list submodule { + key "name revision"; + description + "Each entry represents one submodule within the + parent module."; + uses common-leafs; + uses schema-leaf; + } + } + } + /* + * Operational state data nodes + */ + container modules-state { + config false; + description + "Contains YANG module monitoring information."; + leaf module-set-id { + type string; + mandatory true; + description + "Contains a server-specific identifier representing + the current set of modules and submodules. The + server MUST change the value of this leaf if the + information represented by the 'module' list instances + has changed."; + } + uses module-list; + } + /* + * Notifications + */ + notification yang-library-change { + description + "Generated when the set of modules and submodules supported + by the server has changed."; + leaf module-set-id { + type leafref { + path "/yanglib:modules-state/yanglib:module-set-id"; + } + mandatory true; + description + "Contains the module-set-id value representing the + set of modules and submodules supported at the server at + the time the notification is generated."; + } + } +} diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/invoke-rpc/ietf-yang-types.yang b/netconf/restconf/restconf-nb-bierman02/src/test/resources/invoke-rpc/ietf-yang-types.yang new file mode 100644 index 0000000..c3f952c --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/invoke-rpc/ietf-yang-types.yang @@ -0,0 +1,417 @@ + module ietf-yang-types { + + namespace "urn:ietf:params:xml:ns:yang:ietf-yang-types"; + prefix "yang"; + + organization + "IETF NETMOD (NETCONF Data Modeling Language) Working Group"; + + contact + "WG Web: <http://tools.ietf.org/wg/netmod/> + WG List: <mailto:netmod@ietf.org> + + WG Chair: David Partain + <mailto:david.partain@ericsson.com> + + WG Chair: David Kessens + <mailto:david.kessens@nsn.com> + + Editor: Juergen Schoenwaelder + <mailto:j.schoenwaelder@jacobs-university.de>"; + + description + "This module contains a collection of generally useful derived + YANG data types. + + Copyright (c) 2010 IETF Trust and the persons identified as + authors of the code. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, is permitted pursuant to, and subject to the license + terms contained in, the Simplified BSD License set forth in Section + 4.c of the IETF Trust's Legal Provisions Relating to IETF Documents + (http://trustee.ietf.org/license-info). + + This version of this YANG module is part of RFC 6021; see + the RFC itself for full legal notices."; + + revision 2010-09-24 { + description + "Initial revision."; + reference + "RFC 6021: Common YANG Data Types"; + } + + /*** collection of counter and gauge types ***/ + + typedef counter32 { + type uint32; + description + "The counter32 type represents a non-negative integer + that monotonically increases until it reaches a + maximum value of 2^32-1 (4294967295 decimal), when it + wraps around and starts increasing again from zero. + + Counters have no defined 'initial' value, and thus, a + single value of a counter has (in general) no information + content. Discontinuities in the monotonically increasing + value normally occur at re-initialization of the + management system, and at other times as specified in the + description of a schema node using this type. If such + other times can occur, for example, the creation of + a schema node of type counter32 at times other than + re-initialization, then a corresponding schema node + should be defined, with an appropriate type, to indicate + the last discontinuity. + + The counter32 type should not be used for configuration + schema nodes. A default statement SHOULD NOT be used in + combination with the type counter32. + + In the value set and its semantics, this type is equivalent + to the Counter32 type of the SMIv2."; + reference + "RFC 2578: Structure of Management Information Version 2 (SMIv2)"; + } + + typedef zero-based-counter32 { + type yang:counter32; + default "0"; + description + "The zero-based-counter32 type represents a counter32 + that has the defined 'initial' value zero. + + A schema node of this type will be set to zero (0) on creation + and will thereafter increase monotonically until it reaches + a maximum value of 2^32-1 (4294967295 decimal), when it + wraps around and starts increasing again from zero. + + Provided that an application discovers a new schema node + of this type within the minimum time to wrap, it can use the + 'initial' value as a delta. It is important for a management + station to be aware of this minimum time and the actual time + between polls, and to discard data if the actual time is too + long or there is no defined minimum time. + + In the value set and its semantics, this type is equivalent + to the ZeroBasedCounter32 textual convention of the SMIv2."; + reference + "RFC 4502: Remote Network Monitoring Management Information + Base Version 2"; + } + + typedef counter64 { + type uint64; + description + "The counter64 type represents a non-negative integer + that monotonically increases until it reaches a + maximum value of 2^64-1 (18446744073709551615 decimal), + when it wraps around and starts increasing again from zero. + + Counters have no defined 'initial' value, and thus, a + single value of a counter has (in general) no information + content. Discontinuities in the monotonically increasing + value normally occur at re-initialization of the + management system, and at other times as specified in the + description of a schema node using this type. If such + other times can occur, for example, the creation of + a schema node of type counter64 at times other than + re-initialization, then a corresponding schema node + should be defined, with an appropriate type, to indicate + the last discontinuity. + + The counter64 type should not be used for configuration + schema nodes. A default statement SHOULD NOT be used in + combination with the type counter64. + + In the value set and its semantics, this type is equivalent + to the Counter64 type of the SMIv2."; + reference + "RFC 2578: Structure of Management Information Version 2 (SMIv2)"; + } + + typedef zero-based-counter64 { + type yang:counter64; + default "0"; + description + "The zero-based-counter64 type represents a counter64 that + has the defined 'initial' value zero. + + A schema node of this type will be set to zero (0) on creation + and will thereafter increase monotonically until it reaches + a maximum value of 2^64-1 (18446744073709551615 decimal), + when it wraps around and starts increasing again from zero. + + Provided that an application discovers a new schema node + of this type within the minimum time to wrap, it can use the + 'initial' value as a delta. It is important for a management + station to be aware of this minimum time and the actual time + between polls, and to discard data if the actual time is too + long or there is no defined minimum time. + + In the value set and its semantics, this type is equivalent + to the ZeroBasedCounter64 textual convention of the SMIv2."; + reference + "RFC 2856: Textual Conventions for Additional High Capacity + Data Types"; + } + + typedef gauge32 { + type uint32; + description + "The gauge32 type represents a non-negative integer, which + may increase or decrease, but shall never exceed a maximum + value, nor fall below a minimum value. The maximum value + cannot be greater than 2^32-1 (4294967295 decimal), and + the minimum value cannot be smaller than 0. The value of + a gauge32 has its maximum value whenever the information + being modeled is greater than or equal to its maximum + value, and has its minimum value whenever the information + being modeled is smaller than or equal to its minimum value. + If the information being modeled subsequently decreases + below (increases above) the maximum (minimum) value, the + gauge32 also decreases (increases). + + In the value set and its semantics, this type is equivalent + to the Gauge32 type of the SMIv2."; + reference + "RFC 2578: Structure of Management Information Version 2 (SMIv2)"; + } + + typedef gauge64 { + type uint64; + description + "The gauge64 type represents a non-negative integer, which + may increase or decrease, but shall never exceed a maximum + value, nor fall below a minimum value. The maximum value + cannot be greater than 2^64-1 (18446744073709551615), and + the minimum value cannot be smaller than 0. The value of + a gauge64 has its maximum value whenever the information + being modeled is greater than or equal to its maximum + value, and has its minimum value whenever the information + being modeled is smaller than or equal to its minimum value. + If the information being modeled subsequently decreases + below (increases above) the maximum (minimum) value, the + gauge64 also decreases (increases). + + In the value set and its semantics, this type is equivalent + to the CounterBasedGauge64 SMIv2 textual convention defined + in RFC 2856"; + reference + "RFC 2856: Textual Conventions for Additional High Capacity + Data Types"; + } + + /*** collection of identifier related types ***/ + + typedef object-identifier { + type string { + pattern '(([0-1](\.[1-3]?[0-9]))|(2\.(0|([1-9]\d*))))' + + '(\.(0|([1-9]\d*)))*'; + } + description + "The object-identifier type represents administratively + assigned names in a registration-hierarchical-name tree. + + Values of this type are denoted as a sequence of numerical + non-negative sub-identifier values. Each sub-identifier + value MUST NOT exceed 2^32-1 (4294967295). Sub-identifiers + are separated by single dots and without any intermediate + whitespace. + + The ASN.1 standard restricts the value space of the first + sub-identifier to 0, 1, or 2. Furthermore, the value space + of the second sub-identifier is restricted to the range + 0 to 39 if the first sub-identifier is 0 or 1. Finally, + the ASN.1 standard requires that an object identifier + has always at least two sub-identifier. The pattern + captures these restrictions. + + Although the number of sub-identifiers is not limited, + module designers should realize that there may be + implementations that stick with the SMIv2 limit of 128 + sub-identifiers. + + This type is a superset of the SMIv2 OBJECT IDENTIFIER type + since it is not restricted to 128 sub-identifiers. Hence, + this type SHOULD NOT be used to represent the SMIv2 OBJECT + IDENTIFIER type, the object-identifier-128 type SHOULD be + used instead."; + reference + "ISO9834-1: Information technology -- Open Systems + Interconnection -- Procedures for the operation of OSI + Registration Authorities: General procedures and top + arcs of the ASN.1 Object Identifier tree"; + } + + + + + typedef object-identifier-128 { + type object-identifier { + pattern '\d*(\.\d*){1,127}'; + } + description + "This type represents object-identifiers restricted to 128 + sub-identifiers. + + In the value set and its semantics, this type is equivalent + to the OBJECT IDENTIFIER type of the SMIv2."; + reference + "RFC 2578: Structure of Management Information Version 2 (SMIv2)"; + } + + typedef yang-identifier { + type string { + length "1..max"; + pattern '[a-zA-Z_][a-zA-Z0-9\-_.]*'; + pattern '.|..|[^xX].*|.[^mM].*|..[^lL].*'; + } + description + "A YANG identifier string as defined by the 'identifier' + rule in Section 12 of RFC 6020. An identifier must + start with an alphabetic character or an underscore + followed by an arbitrary sequence of alphabetic or + numeric characters, underscores, hyphens, or dots. + + A YANG identifier MUST NOT start with any possible + combination of the lowercase or uppercase character + sequence 'xml'."; + reference + "RFC 6020: YANG - A Data Modeling Language for the Network + Configuration Protocol (NETCONF)"; + } + + /*** collection of date and time related types ***/ + + typedef date-and-time { + type string { + pattern '\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d+)?' + + '(Z|[\+\-]\d{2}:\d{2})'; + } + description + "The date-and-time type is a profile of the ISO 8601 + standard for representation of dates and times using the + Gregorian calendar. The profile is defined by the + date-time production in Section 5.6 of RFC 3339. + + The date-and-time type is compatible with the dateTime XML + schema type with the following notable exceptions: + + (a) The date-and-time type does not allow negative years. + + (b) The date-and-time time-offset -00:00 indicates an unknown + time zone (see RFC 3339) while -00:00 and +00:00 and Z all + represent the same time zone in dateTime. + + (c) The canonical format (see below) of data-and-time values + differs from the canonical format used by the dateTime XML + schema type, which requires all times to be in UTC using the + time-offset 'Z'. + + This type is not equivalent to the DateAndTime textual + convention of the SMIv2 since RFC 3339 uses a different + separator between full-date and full-time and provides + higher resolution of time-secfrac. + + The canonical format for date-and-time values with a known time + zone uses a numeric time zone offset that is calculated using + the device's configured known offset to UTC time. A change of + the device's offset to UTC time will cause date-and-time values + to change accordingly. Such changes might happen periodically + in case a server follows automatically daylight saving time + (DST) time zone offset changes. The canonical format for + date-and-time values with an unknown time zone (usually referring + to the notion of local time) uses the time-offset -00:00."; + reference + "RFC 3339: Date and Time on the Internet: Timestamps + RFC 2579: Textual Conventions for SMIv2 + XSD-TYPES: XML Schema Part 2: Datatypes Second Edition"; + } + + typedef timeticks { + type uint32; + description + "The timeticks type represents a non-negative integer that + represents the time, modulo 2^32 (4294967296 decimal), in + hundredths of a second between two epochs. When a schema + node is defined that uses this type, the description of + the schema node identifies both of the reference epochs. + + In the value set and its semantics, this type is equivalent + to the TimeTicks type of the SMIv2."; + reference + "RFC 2578: Structure of Management Information Version 2 (SMIv2)"; + } + + typedef timestamp { + type yang:timeticks; + description + "The timestamp type represents the value of an associated + timeticks schema node at which a specific occurrence happened. + The specific occurrence must be defined in the description + of any schema node defined using this type. When the specific + occurrence occurred prior to the last time the associated + timeticks attribute was zero, then the timestamp value is + zero. Note that this requires all timestamp values to be + reset to zero when the value of the associated timeticks + attribute reaches 497+ days and wraps around to zero. + + The associated timeticks schema node must be specified + in the description of any schema node using this type. + + In the value set and its semantics, this type is equivalent + to the TimeStamp textual convention of the SMIv2."; + reference + "RFC 2579: Textual Conventions for SMIv2"; + } + + /*** collection of generic address types ***/ + + typedef phys-address { + type string { + pattern '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'; + } + description + "Represents media- or physical-level addresses represented + as a sequence octets, each octet represented by two hexadecimal + numbers. Octets are separated by colons. The canonical + representation uses lowercase characters. + + In the value set and its semantics, this type is equivalent + to the PhysAddress textual convention of the SMIv2."; + reference + "RFC 2579: Textual Conventions for SMIv2"; + } + + typedef mac-address { + type string { + pattern '[0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){5}'; + } + description + "The mac-address type represents an IEEE 802 MAC address. + The canonical representation uses lowercase characters. + + In the value set and its semantics, this type is equivalent + to the MacAddress textual convention of the SMIv2."; + reference + "IEEE 802: IEEE Standard for Local and Metropolitan Area + Networks: Overview and Architecture + RFC 2579: Textual Conventions for SMIv2"; + } + + /*** collection of XML specific types ***/ + + typedef xpath1.0 { + type string; + description + "This type represents an XPATH 1.0 expression. + + When a schema node is defined that uses this type, the + description of the schema node MUST specify the XPath + context in which the XPath expression is evaluated."; + reference + "XPATH: XML Path Language (XPath) Version 1.0"; + } + + } diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/invoke-rpc/invoke-rpc-module.yang b/netconf/restconf/restconf-nb-bierman02/src/test/resources/invoke-rpc/invoke-rpc-module.yang new file mode 100644 index 0000000..e744818 --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/invoke-rpc/invoke-rpc-module.yang @@ -0,0 +1,30 @@ +module invoke-rpc-module { + namespace "invoke:rpc:module"; + + prefix "inrpcmod"; + + revision 2013-12-03 { + + } + + rpc rpc-test { + input { + container cont { + leaf lf { + type string; + } + } + } + output { + container cont-out { + leaf lf-out { + type string; + } + } + } + } + + rpc rpc-noop { + } + +} diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/invoke-rpc/json/rpc-input.json b/netconf/restconf/restconf-nb-bierman02/src/test/resources/invoke-rpc/json/rpc-input.json new file mode 100644 index 0000000..2ba5f27 --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/invoke-rpc/json/rpc-input.json @@ -0,0 +1,7 @@ +{ + "invoke-rpc-module:input" : { + "cont" : { + "lf" : "lf-test" + } + } +}
\ No newline at end of file diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/invoke-rpc/json/rpc-output.json b/netconf/restconf/restconf-nb-bierman02/src/test/resources/invoke-rpc/json/rpc-output.json new file mode 100644 index 0000000..107f4c7 --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/invoke-rpc/json/rpc-output.json @@ -0,0 +1,7 @@ +{ + "invoke-rpc-module:output" : { + "cont-out" : { + "lf-out" : "lf-test" + } + } +}
\ No newline at end of file diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/invoke-rpc/xml/rpc-input.xml b/netconf/restconf/restconf-nb-bierman02/src/test/resources/invoke-rpc/xml/rpc-input.xml new file mode 100644 index 0000000..48fb557 --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/invoke-rpc/xml/rpc-input.xml @@ -0,0 +1,5 @@ +<input xmlns="invoke:rpc:module"> + <cont> + <lf>lf-test</lf> + </cont> +</input>
\ No newline at end of file diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/invoke-rpc/xml/rpc-output.xml b/netconf/restconf/restconf-nb-bierman02/src/test/resources/invoke-rpc/xml/rpc-output.xml new file mode 100644 index 0000000..3b11eb8 --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/invoke-rpc/xml/rpc-output.xml @@ -0,0 +1,5 @@ +<output xmlns="invoke:rpc:module"> + <cont-out> + <lf-out>lf-test</lf-out> + </cont-out> +</output>
\ No newline at end of file diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/json-to-nn/array-with-null.json b/netconf/restconf/restconf-nb-bierman02/src/test/resources/json-to-nn/array-with-null.json new file mode 100644 index 0000000..995b3c6 --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/json-to-nn/array-with-null.json @@ -0,0 +1,5 @@ +{ + "array-with-null-yang:cont": { + "lf":null + } +}
\ No newline at end of file diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/json-to-nn/empty-data.json b/netconf/restconf/restconf-nb-bierman02/src/test/resources/json-to-nn/empty-data.json new file mode 100644 index 0000000..aa7142d --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/json-to-nn/empty-data.json @@ -0,0 +1,6 @@ +{ + "array-with-null-yang:cont": { + "lflst1":[], + "lflst2":[45] + } +} diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/json-to-nn/empty-data1.json b/netconf/restconf/restconf-nb-bierman02/src/test/resources/json-to-nn/empty-data1.json new file mode 100644 index 0000000..b886fc9 --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/json-to-nn/empty-data1.json @@ -0,0 +1,5 @@ +{ + "cont": { + "lf": + } +}
\ No newline at end of file diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/json-to-nn/identityref/identity-module.yang b/netconf/restconf/restconf-nb-bierman02/src/test/resources/json-to-nn/identityref/identity-module.yang new file mode 100644 index 0000000..09a34c5 --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/json-to-nn/identityref/identity-module.yang @@ -0,0 +1,10 @@ +module identity-module { + namespace "identity:module"; + + prefix "idemod"; + revision 2013-12-02 { + } + + identity iden { + } +} diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/json-to-nn/identityref/identityref-module.yang b/netconf/restconf/restconf-nb-bierman02/src/test/resources/json-to-nn/identityref/identityref-module.yang new file mode 100644 index 0000000..80ec396 --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/json-to-nn/identityref/identityref-module.yang @@ -0,0 +1,39 @@ +module identityref-module { + namespace "identityref:module"; + + prefix "iderefmod"; + + import identity-module {prefix idemo; revision-date 2013-12-02; } + + revision 2013-12-02 { + } + + identity iden_local { + } + + container cont { + container cont1 { + leaf lf11 { + type identityref { + base "idemo:iden"; + } + } + leaf lf12 { + type identityref { + base "iden_local"; + } + } + leaf lf13 { + type identityref { + base "iden_local"; + } + } + leaf lf14 { + type identityref { + base "iden_local"; + } + } + } + } + +} diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/json-to-nn/identityref/json/data.json b/netconf/restconf/restconf-nb-bierman02/src/test/resources/json-to-nn/identityref/json/data.json new file mode 100644 index 0000000..88cd6b4 --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/json-to-nn/identityref/json/data.json @@ -0,0 +1,10 @@ +{ + "identityref:cont":{ + "cont1":{ + "lf11":"identity-module:iden", + "lf12":"identityref-module:iden_local", + "identityref-module:lf13":"identityref-module:iden_local", + "identityref-module:lf14":"identity-module:iden" + } + } +}
\ No newline at end of file diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/json-to-nn/invalid-uri-character-in-value.json b/netconf/restconf/restconf-nb-bierman02/src/test/resources/json-to-nn/invalid-uri-character-in-value.json new file mode 100644 index 0000000..545f99b --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/json-to-nn/invalid-uri-character-in-value.json @@ -0,0 +1,6 @@ +{ + "array-with-null-yang:cont":{ + "lf1":"module<Name:value lf1", + "lf2":"module>Name:value lf2" + } +} diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/json-to-nn/leafref/augment-leafref-module.yang b/netconf/restconf/restconf-nb-bierman02/src/test/resources/json-to-nn/leafref/augment-leafref-module.yang new file mode 100644 index 0000000..8a55e43 --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/json-to-nn/leafref/augment-leafref-module.yang @@ -0,0 +1,18 @@ +module augment-leafref-module { + namespace "augment:leafref:module"; + + prefix "auglfrfmo"; + revision 2014-12-16; + + typedef leafreftype { + type leafref { + path "/auglfrfmo:cont/auglfrfmo:lf3"; + } + } + + container cont { + leaf lf3 { + type string; + } + } +} diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/json-to-nn/leafref/json/data.json b/netconf/restconf/restconf-nb-bierman02/src/test/resources/json-to-nn/leafref/json/data.json new file mode 100644 index 0000000..df5bcef --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/json-to-nn/leafref/json/data.json @@ -0,0 +1,7 @@ +{ + "leafref-module:cont":{ + "lf1":121, + "lf2":121, + "lf4":"pcc://39.39.39.39" + } +}
\ No newline at end of file diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/json-to-nn/leafref/leafref-module.yang b/netconf/restconf/restconf-nb-bierman02/src/test/resources/json-to-nn/leafref/leafref-module.yang new file mode 100644 index 0000000..9b124a0 --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/json-to-nn/leafref/leafref-module.yang @@ -0,0 +1,24 @@ +module leafref-module { + namespace "leafref:module"; + + prefix "lfrfmo"; + + import augment-leafref-module {prefix augleafref; revision-date 2014-12-16;} + revision 2013-11-18 { + } + + container cont { + leaf lf1 { + type int32; + } + leaf lf2 { + type leafref { + path "/cont/lf1"; + } + } + leaf lf4 { + type augleafref:leafreftype; + } + } + +}
\ No newline at end of file diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/json-to-nn/multiple-items-in-list.json b/netconf/restconf/restconf-nb-bierman02/src/test/resources/json-to-nn/multiple-items-in-list.json new file mode 100644 index 0000000..2131744 --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/json-to-nn/multiple-items-in-list.json @@ -0,0 +1,26 @@ +{ + "multiple-items-yang:lst":[ + { + "lst1": [ + { + "lf11":"lf11_1" + }, + { + "lflst11":[ + 45 + ] + }, + { + "cont11":{ + } + }, + { + "lst11":[ + { + } + ] + } + ] + } + ] +} diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/json-to-nn/multiple-leaflist-items.json b/netconf/restconf/restconf-nb-bierman02/src/test/resources/json-to-nn/multiple-leaflist-items.json new file mode 100644 index 0000000..c1f5d1e --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/json-to-nn/multiple-leaflist-items.json @@ -0,0 +1,5 @@ +{ + "simple-list-yang1:lst": { + "lflst1":[45,55,66] + } +} diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/json-to-nn/simple-container-yang/simple-container.yang b/netconf/restconf/restconf-nb-bierman02/src/test/resources/json-to-nn/simple-container-yang/simple-container.yang new file mode 100644 index 0000000..493101c --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/json-to-nn/simple-container-yang/simple-container.yang @@ -0,0 +1,20 @@ +module simple-container-yang { + namespace "simple:container:yang"; + + prefix "smpdtp"; + revision 2013-11-12 { + } + + container cont { + container cont1 { + } + list lst1 { + } + leaf-list lflst1 { + type string; + } + leaf lf1 { + type string; + } + } +}
\ No newline at end of file diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/json-to-nn/simple-container.json b/netconf/restconf/restconf-nb-bierman02/src/test/resources/json-to-nn/simple-container.json new file mode 100644 index 0000000..28d244d --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/json-to-nn/simple-container.json @@ -0,0 +1,15 @@ +{ + "simple-container-yang:cont":{ + "cont1":{ + }, + "lst1": [ + { + } + ], + "lflst1":[ + "lflst1_1", + "lflst1_2" + ], + "lf1":"lf1" + } +} diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/json-to-nn/simple-list-yang/1/simple-list1.yang b/netconf/restconf/restconf-nb-bierman02/src/test/resources/json-to-nn/simple-list-yang/1/simple-list1.yang new file mode 100644 index 0000000..0ce8ea4 --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/json-to-nn/simple-list-yang/1/simple-list1.yang @@ -0,0 +1,20 @@ +module simple-list-yang1 { + namespace "simple:list:yang1"; + + prefix "smplstyg"; + revision 2013-11-12 { + } + + list lst { + container cont1 { + } + list lst1 { + } + leaf-list lflst1 { + type string; + } + leaf lf1 { + type string; + } + } +}
\ No newline at end of file diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/json-to-nn/simple-list-yang/2/simple-list2.yang b/netconf/restconf/restconf-nb-bierman02/src/test/resources/json-to-nn/simple-list-yang/2/simple-list2.yang new file mode 100644 index 0000000..0872a47 --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/json-to-nn/simple-list-yang/2/simple-list2.yang @@ -0,0 +1,20 @@ +module simple-list-yang2 { + namespace "simple:list:yang2"; + + prefix "smplstyg"; + revision 2013-11-12 { + } + + list lst { + container cont1 { + } + list lst1 { + } + leaf-list lflst1 { + type string; + } + leaf lf1 { + type string; + } + } +}
\ No newline at end of file diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/json-to-nn/simple-list-yang/3/multiple-items.yang b/netconf/restconf/restconf-nb-bierman02/src/test/resources/json-to-nn/simple-list-yang/3/multiple-items.yang new file mode 100644 index 0000000..dcc17d5 --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/json-to-nn/simple-list-yang/3/multiple-items.yang @@ -0,0 +1,24 @@ +module multiple-items-yang { + namespace "multiple:items:yang"; + + prefix "mltitmsyg"; + revision 2013-11-12 { + } + + list lst { + list lst1 { + leaf lf11{ + type string; + } + leaf-list lflst11{ + type string; + } + container cont11{ + + } + list lst11{ + + } + } + } +}
\ No newline at end of file diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/json-to-nn/simple-list-yang/4/array-with-null.yang b/netconf/restconf/restconf-nb-bierman02/src/test/resources/json-to-nn/simple-list-yang/4/array-with-null.yang new file mode 100644 index 0000000..869e406 --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/json-to-nn/simple-list-yang/4/array-with-null.yang @@ -0,0 +1,26 @@ +module array-with-null-yang { + namespace "array:with:null:yang"; + + prefix "arwnlyn"; + revision 2013-11-12 { + } + + container cont{ + leaf lf{ + type empty; + } + leaf lf1{ + type string; + } + leaf lf2{ + type string; + } + leaf-list lflst1{ + type empty; + } + + leaf-list lflst2{ + type string; + } + } +}
\ No newline at end of file diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/json-to-nn/simple-list.json b/netconf/restconf/restconf-nb-bierman02/src/test/resources/json-to-nn/simple-list.json new file mode 100644 index 0000000..76a0190 --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/json-to-nn/simple-list.json @@ -0,0 +1,17 @@ +{ + "simple-list-yang1:lst":[ + { + "cont1":{ + }, + "lst1": [ + { + } + ], + "lflst1":[ + "lflst1_1", + "lflst1_2" + ], + "lf1":"lf1" + } + ] +} diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/json-to-nn/unsupported-json-format.json b/netconf/restconf/restconf-nb-bierman02/src/test/resources/json-to-nn/unsupported-json-format.json new file mode 100644 index 0000000..abc6267 --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/json-to-nn/unsupported-json-format.json @@ -0,0 +1 @@ +fffff
\ No newline at end of file diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/json-to-nn/wrong-top-level1.json b/netconf/restconf/restconf-nb-bierman02/src/test/resources/json-to-nn/wrong-top-level1.json new file mode 100644 index 0000000..88baef3 --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/json-to-nn/wrong-top-level1.json @@ -0,0 +1,8 @@ +{ + "wrong":[ + { + }, + { + } + ] +} diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/json-to-nn/wrong-top-level2.json b/netconf/restconf/restconf-nb-bierman02/src/test/resources/json-to-nn/wrong-top-level2.json new file mode 100644 index 0000000..c567273 --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/json-to-nn/wrong-top-level2.json @@ -0,0 +1,9 @@ +{ + + "simple-list-yang1:lst": { + }, + "lst1":[ + { + } + ] +} diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/json-to-nn/wrong-top-level3.json b/netconf/restconf/restconf-nb-bierman02/src/test/resources/json-to-nn/wrong-top-level3.json new file mode 100644 index 0000000..7288969 --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/json-to-nn/wrong-top-level3.json @@ -0,0 +1,3 @@ +{ + "lf":"hello" +}
\ No newline at end of file diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/jukebox/augmented-jukebox@2016-05-05.yang b/netconf/restconf/restconf-nb-bierman02/src/test/resources/jukebox/augmented-jukebox@2016-05-05.yang new file mode 100644 index 0000000..abbd5d0 --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/jukebox/augmented-jukebox@2016-05-05.yang @@ -0,0 +1,16 @@ +module augmented-jukebox { + + namespace "http://example.com/ns/augmented-jukebox"; + prefix "augmented-jbox"; + + revision "2016-05-05" { + description "Initial version."; + } + + import example-jukebox {prefix jbox; revision-date "2015-04-04";} + + augment "/jbox:jukebox" { + container augmented-library { + } + } + }
\ No newline at end of file diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/jukebox/example-jukebox@2015-04-04.yang b/netconf/restconf/restconf-nb-bierman02/src/test/resources/jukebox/example-jukebox@2015-04-04.yang new file mode 100644 index 0000000..ddaa602 --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/jukebox/example-jukebox@2015-04-04.yang @@ -0,0 +1,243 @@ +module example-jukebox { + + namespace "http://example.com/ns/example-jukebox"; + prefix "jbox"; + + organization "Example, Inc."; + contact "support at example.com"; + description "Example Jukebox Data Model Module"; + revision "2015-04-04" { + description "Initial version."; + reference "example.com document 1-4673"; + } + + identity genre { + description "Base for all genre types"; + } + + // abbreviated list of genre classifications + identity alternative { + base genre; + description "Alternative music"; + } + identity blues { + base genre; + description "Blues music"; + } + identity country { + base genre; + description "Country music"; + } + identity jazz { + base genre; + description "Jazz music"; + } + identity pop { + base genre; + description "Pop music"; + } + identity rock { + base genre; + description "Rock music"; + } + + container jukebox { + presence + "An empty container indicates that the jukebox + service is available"; + + description + "Represents a jukebox resource, with a library, playlists, + and a play operation."; + + container library { + + description "Represents the jukebox library resource."; + + list artist { + key name; + + description + "Represents one artist resource within the + jukebox library resource."; + + leaf name { + type string { + length "1 .. max"; + } + description "The name of the artist."; + } + + list album { + key name; + + description + "Represents one album resource within one + artist resource, within the jukebox library."; + + leaf name { + type string { + length "1 .. max"; + } + description "The name of the album."; + } + + leaf genre { + type identityref { base genre; } + description + "The genre identifying the type of music on + the album."; + } + + leaf year { + type uint16 { + range "1900 .. max"; + } + description "The year the album was released"; + } + + container admin { + description + "Administrative information for the album."; + + leaf label { + type string; + description "The label that released the album."; + } + leaf catalogue-number { + type string; + description "The album's catalogue number."; + } + } + + list song { + key name; + + description + "Represents one song resource within one + album resource, within the jukebox library."; + + leaf name { + type string { + length "1 .. max"; + } + description "The name of the song"; + } + leaf location { + type string; + mandatory true; + description + "The file location string of the + media file for the song"; + } + leaf format { + type string; + description + "An identifier string for the media type + for the file associated with the + 'location' leaf for this entry."; + } + leaf length { + type uint32; + units "seconds"; + description + "The duration of this song in seconds."; + } + } // end list 'song' + } // end list 'album' + } // end list 'artist' + + leaf artist-count { + type uint32; + units "songs"; + config false; + description "Number of artists in the library"; + } + leaf album-count { + type uint32; + units "albums"; + config false; + description "Number of albums in the library"; + } + leaf song-count { + type uint32; + units "songs"; + config false; + description "Number of songs in the library"; + } + } // end library + + list playlist { + key name; + + description + "Example configuration data resource"; + + leaf name { + type string; + description + "The name of the playlist."; + } + leaf description { + type string; + description + "A comment describing the playlist."; + } + + list song { + key index; + ordered-by user; + + description + "Example nested configuration data resource"; + + leaf index { // not really needed + type uint32; + description + "An arbitrary integer index for this playlist song."; + } + leaf id { + type leafref { + path "/jbox:jukebox/jbox:library/jbox:artist/" + + "jbox:album/jbox:song/jbox:name"; + } + mandatory true; + description + "Song identifier. Must identify an instance of + /jukebox/library/artist/album/song/name."; + } + } + } + + container player { + description + "Represents the jukebox player resource."; + + leaf gap { + type decimal64 { + fraction-digits 1; + range "0.0 .. 2.0"; + } + units "tenths of seconds"; + description "Time gap between each song"; + } + } + } + + rpc play { + description "Control function for the jukebox player"; + input { + leaf playlist { + type string; + mandatory true; + description "playlist name"; + } + + leaf song-number { + type uint32; + mandatory true; + description "Song number in playlist to play"; + } + } + } + }
\ No newline at end of file diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/jukebox/ietf-inet-types.yang b/netconf/restconf/restconf-nb-bierman02/src/test/resources/jukebox/ietf-inet-types.yang new file mode 100644 index 0000000..de20feb --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/jukebox/ietf-inet-types.yang @@ -0,0 +1,418 @@ + module ietf-inet-types { + + namespace "urn:ietf:params:xml:ns:yang:ietf-inet-types"; + prefix "inet"; + + organization + "IETF NETMOD (NETCONF Data Modeling Language) Working Group"; + + contact + "WG Web: <http://tools.ietf.org/wg/netmod/> + WG List: <mailto:netmod@ietf.org> + + WG Chair: David Partain + <mailto:david.partain@ericsson.com> + + WG Chair: David Kessens + <mailto:david.kessens@nsn.com> + + Editor: Juergen Schoenwaelder + <mailto:j.schoenwaelder@jacobs-university.de>"; + + description + "This module contains a collection of generally useful derived + YANG data types for Internet addresses and related things. + + Copyright (c) 2010 IETF Trust and the persons identified as + authors of the code. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, is permitted pursuant to, and subject to the license + terms contained in, the Simplified BSD License set forth in Section + 4.c of the IETF Trust's Legal Provisions Relating to IETF Documents + (http://trustee.ietf.org/license-info). + + This version of this YANG module is part of RFC 6021; see + the RFC itself for full legal notices."; + + revision 2010-09-24 { + description + "Initial revision."; + reference + "RFC 6021: Common YANG Data Types"; + } + + /*** collection of protocol field related types ***/ + + typedef ip-version { + type enumeration { + enum unknown { + value "0"; + description + "An unknown or unspecified version of the Internet protocol."; + } + enum ipv4 { + value "1"; + description + "The IPv4 protocol as defined in RFC 791."; + } + enum ipv6 { + value "2"; + description + "The IPv6 protocol as defined in RFC 2460."; + } + } + description + "This value represents the version of the IP protocol. + + In the value set and its semantics, this type is equivalent + to the InetVersion textual convention of the SMIv2."; + reference + "RFC 791: Internet Protocol + RFC 2460: Internet Protocol, Version 6 (IPv6) Specification + RFC 4001: Textual Conventions for Internet Network Addresses"; + } + + typedef dscp { + type uint8 { + range "0..63"; + } + description + "The dscp type represents a Differentiated Services Code-Point + that may be used for marking packets in a traffic stream. + + In the value set and its semantics, this type is equivalent + to the Dscp textual convention of the SMIv2."; + reference + "RFC 3289: Management Information Base for the Differentiated + Services Architecture + RFC 2474: Definition of the Differentiated Services Field + (DS Field) in the IPv4 and IPv6 Headers + RFC 2780: IANA Allocation Guidelines For Values In + the Internet Protocol and Related Headers"; + } + + typedef ipv6-flow-label { + type uint32 { + range "0..1048575"; + } + description + "The flow-label type represents flow identifier or Flow Label + in an IPv6 packet header that may be used to discriminate + traffic flows. + + In the value set and its semantics, this type is equivalent + to the IPv6FlowLabel textual convention of the SMIv2."; + reference + "RFC 3595: Textual Conventions for IPv6 Flow Label + RFC 2460: Internet Protocol, Version 6 (IPv6) Specification"; + } + + typedef port-number { + type uint16 { + range "0..65535"; + } + description + "The port-number type represents a 16-bit port number of an + Internet transport layer protocol such as UDP, TCP, DCCP, or + SCTP. Port numbers are assigned by IANA. A current list of + all assignments is available from <http://www.iana.org/>. + + Note that the port number value zero is reserved by IANA. In + situations where the value zero does not make sense, it can + be excluded by subtyping the port-number type. + + In the value set and its semantics, this type is equivalent + to the InetPortNumber textual convention of the SMIv2."; + reference + "RFC 768: User Datagram Protocol + RFC 793: Transmission Control Protocol + RFC 4960: Stream Control Transmission Protocol + RFC 4340: Datagram Congestion Control Protocol (DCCP) + RFC 4001: Textual Conventions for Internet Network Addresses"; + } + + /*** collection of autonomous system related types ***/ + + typedef as-number { + type uint32; + description + "The as-number type represents autonomous system numbers + which identify an Autonomous System (AS). An AS is a set + of routers under a single technical administration, using + an interior gateway protocol and common metrics to route + packets within the AS, and using an exterior gateway + protocol to route packets to other ASs'. IANA maintains + the AS number space and has delegated large parts to the + regional registries. + + Autonomous system numbers were originally limited to 16 + bits. BGP extensions have enlarged the autonomous system + number space to 32 bits. This type therefore uses an uint32 + base type without a range restriction in order to support + a larger autonomous system number space. + + In the value set and its semantics, this type is equivalent + to the InetAutonomousSystemNumber textual convention of + the SMIv2."; + reference + "RFC 1930: Guidelines for creation, selection, and registration + of an Autonomous System (AS) + RFC 4271: A Border Gateway Protocol 4 (BGP-4) + RFC 4893: BGP Support for Four-octet AS Number Space + RFC 4001: Textual Conventions for Internet Network Addresses"; + } + + /*** collection of IP address and hostname related types ***/ + + typedef ip-address { + type union { + type inet:ipv4-address; + type inet:ipv6-address; + } + description + "The ip-address type represents an IP address and is IP + version neutral. The format of the textual representations + implies the IP version."; + } + + typedef ipv4-address { + type string { + 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])' + + '(%[\p{N}\p{L}]+)?'; + } + description + "The ipv4-address type represents an IPv4 address in + dotted-quad notation. The IPv4 address may include a zone + index, separated by a % sign. + + The zone index is used to disambiguate identical address + values. For link-local addresses, the zone index will + typically be the interface index number or the name of an + interface. If the zone index is not present, the default + zone of the device will be used. + + The canonical format for the zone index is the numerical + format"; + } + + typedef ipv6-address { + type string { + pattern '((:|[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}]+)?'; + pattern '(([^:]+:){6}(([^:]+:[^:]+)|(.*\..*)))|' + + '((([^:]+:)*[^:]+)?::(([^:]+:)*[^:]+)?)' + + '(%.+)?'; + } + description + "The ipv6-address type represents an IPv6 address in full, + mixed, shortened, and shortened-mixed notation. The IPv6 + address may include a zone index, separated by a % sign. + + The zone index is used to disambiguate identical address + values. For link-local addresses, the zone index will + typically be the interface index number or the name of an + interface. If the zone index is not present, the default + zone of the device will be used. + + The canonical format of IPv6 addresses uses the compressed + format described in RFC 4291, Section 2.2, item 2 with the + following additional rules: the :: substitution must be + applied to the longest sequence of all-zero 16-bit chunks + in an IPv6 address. If there is a tie, the first sequence + of all-zero 16-bit chunks is replaced by ::. Single + all-zero 16-bit chunks are not compressed. The canonical + format uses lowercase characters and leading zeros are + not allowed. The canonical format for the zone index is + the numerical format as described in RFC 4007, Section + 11.2."; + reference + "RFC 4291: IP Version 6 Addressing Architecture + RFC 4007: IPv6 Scoped Address Architecture + RFC 5952: A Recommendation for IPv6 Address Text Representation"; + } + + typedef ip-prefix { + type union { + type inet:ipv4-prefix; + type inet:ipv6-prefix; + } + description + "The ip-prefix type represents an IP prefix and is IP + version neutral. The format of the textual representations + implies the IP version."; + } + + typedef ipv4-prefix { + type string { + 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])' + + '/(([0-9])|([1-2][0-9])|(3[0-2]))'; + } + description + "The ipv4-prefix type represents an IPv4 address prefix. + The prefix length is given by the number following the + slash character and must be less than or equal to 32. + + A prefix length value of n corresponds to an IP address + mask that has n contiguous 1-bits from the most + significant bit (MSB) and all other bits set to 0. + + The canonical format of an IPv4 prefix has all bits of + the IPv4 address set to zero that are not part of the + IPv4 prefix."; + } + + typedef ipv6-prefix { + type string { + pattern '((:|[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])))'; + pattern '(([^:]+:){6}(([^:]+:[^:]+)|(.*\..*)))|' + + '((([^:]+:)*[^:]+)?::(([^:]+:)*[^:]+)?)' + + '(/.+)'; + } + description + "The ipv6-prefix type represents an IPv6 address prefix. + The prefix length is given by the number following the + slash character and must be less than or equal 128. + + A prefix length value of n corresponds to an IP address + mask that has n contiguous 1-bits from the most + significant bit (MSB) and all other bits set to 0. + + The IPv6 address should have all bits that do not belong + to the prefix set to zero. + + The canonical format of an IPv6 prefix has all bits of + the IPv6 address set to zero that are not part of the + IPv6 prefix. Furthermore, IPv6 address is represented + in the compressed format described in RFC 4291, Section + 2.2, item 2 with the following additional rules: the :: + substitution must be applied to the longest sequence of + all-zero 16-bit chunks in an IPv6 address. If there is + a tie, the first sequence of all-zero 16-bit chunks is + replaced by ::. Single all-zero 16-bit chunks are not + compressed. The canonical format uses lowercase + characters and leading zeros are not allowed."; + reference + "RFC 4291: IP Version 6 Addressing Architecture"; + } + + /*** collection of domain name and URI types ***/ + + typedef domain-name { + type string { + pattern '((([a-zA-Z0-9_]([a-zA-Z0-9\-_]){0,61})?[a-zA-Z0-9]\.)*' + + '([a-zA-Z0-9_]([a-zA-Z0-9\-_]){0,61})?[a-zA-Z0-9]\.?)' + + '|\.'; + length "1..253"; + } + description + "The domain-name type represents a DNS domain name. The + name SHOULD be fully qualified whenever possible. + + Internet domain names are only loosely specified. Section + 3.5 of RFC 1034 recommends a syntax (modified in Section + 2.1 of RFC 1123). The pattern above is intended to allow + for current practice in domain name use, and some possible + future expansion. It is designed to hold various types of + domain names, including names used for A or AAAA records + (host names) and other records, such as SRV records. Note + that Internet host names have a stricter syntax (described + in RFC 952) than the DNS recommendations in RFCs 1034 and + 1123, and that systems that want to store host names in + schema nodes using the domain-name type are recommended to + adhere to this stricter standard to ensure interoperability. + + The encoding of DNS names in the DNS protocol is limited + to 255 characters. Since the encoding consists of labels + prefixed by a length bytes and there is a trailing NULL + byte, only 253 characters can appear in the textual dotted + notation. + + The description clause of schema nodes using the domain-name + type MUST describe when and how these names are resolved to + IP addresses. Note that the resolution of a domain-name value + may require to query multiple DNS records (e.g., A for IPv4 + and AAAA for IPv6). The order of the resolution process and + which DNS record takes precedence can either be defined + explicitely or it may depend on the configuration of the + resolver. + + Domain-name values use the US-ASCII encoding. Their canonical + format uses lowercase US-ASCII characters. Internationalized + domain names MUST be encoded in punycode as described in RFC + 3492"; + reference + "RFC 952: DoD Internet Host Table Specification + RFC 1034: Domain Names - Concepts and Facilities + RFC 1123: Requirements for Internet Hosts -- Application + and Support + RFC 2782: A DNS RR for specifying the location of services + (DNS SRV) + RFC 3492: Punycode: A Bootstring encoding of Unicode for + Internationalized Domain Names in Applications + (IDNA) + RFC 5891: Internationalizing Domain Names in Applications + (IDNA): Protocol"; + } + + typedef host { + type union { + type inet:ip-address; + type inet:domain-name; + } + description + "The host type represents either an IP address or a DNS + domain name."; + } + + typedef uri { + type string; + description + "The uri type represents a Uniform Resource Identifier + (URI) as defined by STD 66. + + Objects using the uri type MUST be in US-ASCII encoding, + and MUST be normalized as described by RFC 3986 Sections + 6.2.1, 6.2.2.1, and 6.2.2.2. All unnecessary + percent-encoding is removed, and all case-insensitive + characters are set to lowercase except for hexadecimal + digits, which are normalized to uppercase as described in + Section 6.2.2.1. + + The purpose of this normalization is to help provide + unique URIs. Note that this normalization is not + sufficient to provide uniqueness. Two URIs that are + textually distinct after this normalization may still be + equivalent. + + Objects using the uri type may restrict the schemes that + they permit. For example, 'data:' and 'urn:' schemes + might not be appropriate. + + A zero-length URI is not a valid URI. This can be used to + express 'URI absent' where required. + + In the value set and its semantics, this type is equivalent + to the Uri SMIv2 textual convention defined in RFC 5017."; + reference + "RFC 3986: Uniform Resource Identifier (URI): Generic Syntax + RFC 3305: Report from the Joint W3C/IETF URI Planning Interest + Group: Uniform Resource Identifiers (URIs), URLs, + and Uniform Resource Names (URNs): Clarifications + and Recommendations + RFC 5017: MIB Textual Conventions for Uniform Resource + Identifiers (URIs)"; + } + + } diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/jukebox/ietf-restconf-monitoring@2017-01-26.yang b/netconf/restconf/restconf-nb-bierman02/src/test/resources/jukebox/ietf-restconf-monitoring@2017-01-26.yang new file mode 100644 index 0000000..55c3cb1 --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/jukebox/ietf-restconf-monitoring@2017-01-26.yang @@ -0,0 +1,149 @@ +module ietf-restconf-monitoring { + namespace "urn:ietf:params:xml:ns:yang:ietf-restconf-monitoring"; + prefix "rcmon"; + + import ietf-yang-types { prefix yang; } + import ietf-inet-types { prefix inet; } + + organization + "IETF NETCONF (Network Configuration) Working Group"; + + contact + "WG Web: <https://datatracker.ietf.org/wg/netconf/> + WG List: <mailto:netconf@ietf.org> + + Author: Andy Bierman + <mailto:andy@yumaworks.com> + + Author: Martin Bjorklund + <mailto:mbj@tail-f.com> + + Author: Kent Watsen + <mailto:kwatsen@juniper.net>"; + + description + "This module contains monitoring information for the + RESTCONF protocol. + + Copyright (c) 2017 IETF Trust and the persons identified as + authors of the code. All rights reserved. + + Redistribution and use in source and binary forms, with or + without modification, is permitted pursuant to, and subject + to the license terms contained in, the Simplified BSD License + set forth in Section 4.c of the IETF Trust's Legal Provisions + Relating to IETF Documents + (http://trustee.ietf.org/license-info). + + This version of this YANG module is part of RFC 8040; see + the RFC itself for full legal notices."; + + revision 2017-01-26 { + description + "Initial revision."; + reference + "RFC 8040: RESTCONF Protocol."; + } + + container restconf-state { + config false; + description + "Contains RESTCONF protocol monitoring information."; + + container capabilities { + description + "Contains a list of protocol capability URIs."; + + leaf-list capability { + type inet:uri; + description + "A RESTCONF protocol capability URI."; + } + } + + container streams { + description + "Container representing the notification event streams + supported by the server."; + reference + "RFC 5277, Section 3.4, <streams> element."; + + list stream { + key name; + description + "Each entry describes an event stream supported by + the server."; + + leaf name { + type string; + description + "The stream name."; + reference + "RFC 5277, Section 3.4, <name> element."; + } + + leaf description { + type string; + description + "Description of stream content."; + reference + "RFC 5277, Section 3.4, <description> element."; + } + + leaf replay-support { + type boolean; + default false; + description + "Indicates if replay buffer is supported for this stream. + If 'true', then the server MUST support the 'start-time' + and 'stop-time' query parameters for this stream."; + reference + "RFC 5277, Section 3.4, <replaySupport> element."; + } + + leaf replay-log-creation-time { + when "../replay-support" { + description + "Only present if notification replay is supported."; + } + type yang:date-and-time; + description + "Indicates the time the replay log for this stream + was created."; + reference + "RFC 5277, Section 3.4, <replayLogCreationTime> + element."; + } + + list access { + key encoding; + min-elements 1; + description + "The server will create an entry in this list for each + encoding format that is supported for this stream. + The media type 'text/event-stream' is expected + for all event streams. This list identifies the + subtypes supported for this stream."; + + leaf encoding { + type string; + description + "This is the secondary encoding format within the + 'text/event-stream' encoding used by all streams. + The type 'xml' is supported for XML encoding. + The type 'json' is supported for JSON encoding."; + } + + leaf location { + type inet:uri; + mandatory true; + description + "Contains a URL that represents the entry point + for establishing notification delivery via + server-sent events."; + } + } + } + } + } +} diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/jukebox/ietf-yang-library@2016-06-21.yang b/netconf/restconf/restconf-nb-bierman02/src/test/resources/jukebox/ietf-yang-library@2016-06-21.yang new file mode 100644 index 0000000..bc466ee --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/jukebox/ietf-yang-library@2016-06-21.yang @@ -0,0 +1,208 @@ +module ietf-yang-library { + namespace "urn:ietf:params:xml:ns:yang:ietf-yang-library"; + prefix "yanglib"; + import ietf-yang-types { + prefix yang; + } + import ietf-inet-types { + prefix inet; + } + organization + "IETF NETCONF (Network Configuration) Working Group"; + contact + "WG Web: <https://datatracker.ietf.org/wg/netconf/> + WG List: <mailto:netconf@ietf.org> + WG Chair: Mehmet Ersue + <mailto:mehmet.ersue@nsn.com> + WG Chair: Mahesh Jethanandani + <mailto:mjethanandani@gmail.com> + Editor: Andy Bierman + <mailto:andy@yumaworks.com> + Editor: Martin Bjorklund + <mailto:mbj@tail-f.com> + Editor: Kent Watsen + <mailto:kwatsen@juniper.net>"; + description + "This module contains monitoring information about the YANG + modules and submodules that are used within a YANG-based + server. + Copyright (c) 2016 IETF Trust and the persons identified as + authors of the code. All rights reserved. + Redistribution and use in source and binary forms, with or + without modification, is permitted pursuant to, and subject + to the license terms contained in, the Simplified BSD License + set forth in Section 4.c of the IETF Trust's Legal Provisions + Relating to IETF Documents + (http://trustee.ietf.org/license-info). + This version of this YANG module is part of RFC 7895; see + the RFC itself for full legal notices."; + revision 2016-06-21 { + description + "Initial revision."; + reference + "RFC 7895: YANG Module Library."; + } + /* + * Typedefs + */ + typedef revision-identifier { + type string { + pattern '\d{4}-\d{2}-\d{2}'; + } + description + "Represents a specific date in YYYY-MM-DD format."; + } + /* + * Groupings + */ + grouping module-list { + description + "The module data structure is represented as a grouping + so it can be reused in configuration or another monitoring + data structure."; + grouping common-leafs { + description + "Common parameters for YANG modules and submodules."; + leaf name { + type yang:yang-identifier; + description + "The YANG module or submodule name."; + } + leaf revision { + type union { + type revision-identifier; + type string { length 0; } + } + description + "The YANG module or submodule revision date. + A zero-length string is used if no revision statement + is present in the YANG module or submodule."; + } + } + grouping schema-leaf { + description + "Common schema leaf parameter for modules and submodules."; + leaf schema { + type inet:uri; + description + "Contains a URL that represents the YANG schema + resource for this module or submodule. + This leaf will only be present if there is a URL + available for retrieval of the schema for this entry."; + } + } + list module { + key "name revision"; + description + "Each entry represents one revision of one module + currently supported by the server."; + uses common-leafs; + uses schema-leaf; + leaf namespace { + type inet:uri; + mandatory true; + description + "The XML namespace identifier for this module."; + } + leaf-list feature { + type yang:yang-identifier; + description + "List of YANG feature names from this module that are + supported by the server, regardless of whether they are + defined in the module or any included submodule."; + } + list deviation { + key "name revision"; + description + "List of YANG deviation module names and revisions + used by this server to modify the conformance of + the module associated with this entry. Note that + the same module can be used for deviations for + multiple modules, so the same entry MAY appear + within multiple 'module' entries. + The deviation module MUST be present in the 'module' + list, with the same name and revision values. + The 'conformance-type' value will be 'implement' for + the deviation module."; + uses common-leafs; + } + leaf conformance-type { + type enumeration { + enum implement { + description + "Indicates that the server implements one or more + protocol-accessible objects defined in the YANG module + identified in this entry. This includes deviation + statements defined in the module. + For YANG version 1.1 modules, there is at most one + module entry with conformance type 'implement' for a + particular module name, since YANG 1.1 requires that, + at most, one revision of a module is implemented. + For YANG version 1 modules, there SHOULD NOT be more + than one module entry for a particular module name."; + } + enum import { + description + "Indicates that the server imports reusable definitions + from the specified revision of the module but does + not implement any protocol-accessible objects from + this revision. + Multiple module entries for the same module name MAY + exist. This can occur if multiple modules import the + same module but specify different revision dates in + the import statements."; + } + } + mandatory true; + description + "Indicates the type of conformance the server is claiming + for the YANG module identified by this entry."; + } + list submodule { + key "name revision"; + description + "Each entry represents one submodule within the + parent module."; + uses common-leafs; + uses schema-leaf; + } + } + } + /* + * Operational state data nodes + */ + container modules-state { + config false; + description + "Contains YANG module monitoring information."; + leaf module-set-id { + type string; + mandatory true; + description + "Contains a server-specific identifier representing + the current set of modules and submodules. The + server MUST change the value of this leaf if the + information represented by the 'module' list instances + has changed."; + } + uses module-list; + } + /* + * Notifications + */ + notification yang-library-change { + description + "Generated when the set of modules and submodules supported + by the server has changed."; + leaf module-set-id { + type leafref { + path "/yanglib:modules-state/yanglib:module-set-id"; + } + mandatory true; + description + "Contains the module-set-id value representing the + set of modules and submodules supported at the server at + the time the notification is generated."; + } + } +} diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/jukebox/ietf-yang-types.yang b/netconf/restconf/restconf-nb-bierman02/src/test/resources/jukebox/ietf-yang-types.yang new file mode 100644 index 0000000..c3f952c --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/jukebox/ietf-yang-types.yang @@ -0,0 +1,417 @@ + module ietf-yang-types { + + namespace "urn:ietf:params:xml:ns:yang:ietf-yang-types"; + prefix "yang"; + + organization + "IETF NETMOD (NETCONF Data Modeling Language) Working Group"; + + contact + "WG Web: <http://tools.ietf.org/wg/netmod/> + WG List: <mailto:netmod@ietf.org> + + WG Chair: David Partain + <mailto:david.partain@ericsson.com> + + WG Chair: David Kessens + <mailto:david.kessens@nsn.com> + + Editor: Juergen Schoenwaelder + <mailto:j.schoenwaelder@jacobs-university.de>"; + + description + "This module contains a collection of generally useful derived + YANG data types. + + Copyright (c) 2010 IETF Trust and the persons identified as + authors of the code. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, is permitted pursuant to, and subject to the license + terms contained in, the Simplified BSD License set forth in Section + 4.c of the IETF Trust's Legal Provisions Relating to IETF Documents + (http://trustee.ietf.org/license-info). + + This version of this YANG module is part of RFC 6021; see + the RFC itself for full legal notices."; + + revision 2010-09-24 { + description + "Initial revision."; + reference + "RFC 6021: Common YANG Data Types"; + } + + /*** collection of counter and gauge types ***/ + + typedef counter32 { + type uint32; + description + "The counter32 type represents a non-negative integer + that monotonically increases until it reaches a + maximum value of 2^32-1 (4294967295 decimal), when it + wraps around and starts increasing again from zero. + + Counters have no defined 'initial' value, and thus, a + single value of a counter has (in general) no information + content. Discontinuities in the monotonically increasing + value normally occur at re-initialization of the + management system, and at other times as specified in the + description of a schema node using this type. If such + other times can occur, for example, the creation of + a schema node of type counter32 at times other than + re-initialization, then a corresponding schema node + should be defined, with an appropriate type, to indicate + the last discontinuity. + + The counter32 type should not be used for configuration + schema nodes. A default statement SHOULD NOT be used in + combination with the type counter32. + + In the value set and its semantics, this type is equivalent + to the Counter32 type of the SMIv2."; + reference + "RFC 2578: Structure of Management Information Version 2 (SMIv2)"; + } + + typedef zero-based-counter32 { + type yang:counter32; + default "0"; + description + "The zero-based-counter32 type represents a counter32 + that has the defined 'initial' value zero. + + A schema node of this type will be set to zero (0) on creation + and will thereafter increase monotonically until it reaches + a maximum value of 2^32-1 (4294967295 decimal), when it + wraps around and starts increasing again from zero. + + Provided that an application discovers a new schema node + of this type within the minimum time to wrap, it can use the + 'initial' value as a delta. It is important for a management + station to be aware of this minimum time and the actual time + between polls, and to discard data if the actual time is too + long or there is no defined minimum time. + + In the value set and its semantics, this type is equivalent + to the ZeroBasedCounter32 textual convention of the SMIv2."; + reference + "RFC 4502: Remote Network Monitoring Management Information + Base Version 2"; + } + + typedef counter64 { + type uint64; + description + "The counter64 type represents a non-negative integer + that monotonically increases until it reaches a + maximum value of 2^64-1 (18446744073709551615 decimal), + when it wraps around and starts increasing again from zero. + + Counters have no defined 'initial' value, and thus, a + single value of a counter has (in general) no information + content. Discontinuities in the monotonically increasing + value normally occur at re-initialization of the + management system, and at other times as specified in the + description of a schema node using this type. If such + other times can occur, for example, the creation of + a schema node of type counter64 at times other than + re-initialization, then a corresponding schema node + should be defined, with an appropriate type, to indicate + the last discontinuity. + + The counter64 type should not be used for configuration + schema nodes. A default statement SHOULD NOT be used in + combination with the type counter64. + + In the value set and its semantics, this type is equivalent + to the Counter64 type of the SMIv2."; + reference + "RFC 2578: Structure of Management Information Version 2 (SMIv2)"; + } + + typedef zero-based-counter64 { + type yang:counter64; + default "0"; + description + "The zero-based-counter64 type represents a counter64 that + has the defined 'initial' value zero. + + A schema node of this type will be set to zero (0) on creation + and will thereafter increase monotonically until it reaches + a maximum value of 2^64-1 (18446744073709551615 decimal), + when it wraps around and starts increasing again from zero. + + Provided that an application discovers a new schema node + of this type within the minimum time to wrap, it can use the + 'initial' value as a delta. It is important for a management + station to be aware of this minimum time and the actual time + between polls, and to discard data if the actual time is too + long or there is no defined minimum time. + + In the value set and its semantics, this type is equivalent + to the ZeroBasedCounter64 textual convention of the SMIv2."; + reference + "RFC 2856: Textual Conventions for Additional High Capacity + Data Types"; + } + + typedef gauge32 { + type uint32; + description + "The gauge32 type represents a non-negative integer, which + may increase or decrease, but shall never exceed a maximum + value, nor fall below a minimum value. The maximum value + cannot be greater than 2^32-1 (4294967295 decimal), and + the minimum value cannot be smaller than 0. The value of + a gauge32 has its maximum value whenever the information + being modeled is greater than or equal to its maximum + value, and has its minimum value whenever the information + being modeled is smaller than or equal to its minimum value. + If the information being modeled subsequently decreases + below (increases above) the maximum (minimum) value, the + gauge32 also decreases (increases). + + In the value set and its semantics, this type is equivalent + to the Gauge32 type of the SMIv2."; + reference + "RFC 2578: Structure of Management Information Version 2 (SMIv2)"; + } + + typedef gauge64 { + type uint64; + description + "The gauge64 type represents a non-negative integer, which + may increase or decrease, but shall never exceed a maximum + value, nor fall below a minimum value. The maximum value + cannot be greater than 2^64-1 (18446744073709551615), and + the minimum value cannot be smaller than 0. The value of + a gauge64 has its maximum value whenever the information + being modeled is greater than or equal to its maximum + value, and has its minimum value whenever the information + being modeled is smaller than or equal to its minimum value. + If the information being modeled subsequently decreases + below (increases above) the maximum (minimum) value, the + gauge64 also decreases (increases). + + In the value set and its semantics, this type is equivalent + to the CounterBasedGauge64 SMIv2 textual convention defined + in RFC 2856"; + reference + "RFC 2856: Textual Conventions for Additional High Capacity + Data Types"; + } + + /*** collection of identifier related types ***/ + + typedef object-identifier { + type string { + pattern '(([0-1](\.[1-3]?[0-9]))|(2\.(0|([1-9]\d*))))' + + '(\.(0|([1-9]\d*)))*'; + } + description + "The object-identifier type represents administratively + assigned names in a registration-hierarchical-name tree. + + Values of this type are denoted as a sequence of numerical + non-negative sub-identifier values. Each sub-identifier + value MUST NOT exceed 2^32-1 (4294967295). Sub-identifiers + are separated by single dots and without any intermediate + whitespace. + + The ASN.1 standard restricts the value space of the first + sub-identifier to 0, 1, or 2. Furthermore, the value space + of the second sub-identifier is restricted to the range + 0 to 39 if the first sub-identifier is 0 or 1. Finally, + the ASN.1 standard requires that an object identifier + has always at least two sub-identifier. The pattern + captures these restrictions. + + Although the number of sub-identifiers is not limited, + module designers should realize that there may be + implementations that stick with the SMIv2 limit of 128 + sub-identifiers. + + This type is a superset of the SMIv2 OBJECT IDENTIFIER type + since it is not restricted to 128 sub-identifiers. Hence, + this type SHOULD NOT be used to represent the SMIv2 OBJECT + IDENTIFIER type, the object-identifier-128 type SHOULD be + used instead."; + reference + "ISO9834-1: Information technology -- Open Systems + Interconnection -- Procedures for the operation of OSI + Registration Authorities: General procedures and top + arcs of the ASN.1 Object Identifier tree"; + } + + + + + typedef object-identifier-128 { + type object-identifier { + pattern '\d*(\.\d*){1,127}'; + } + description + "This type represents object-identifiers restricted to 128 + sub-identifiers. + + In the value set and its semantics, this type is equivalent + to the OBJECT IDENTIFIER type of the SMIv2."; + reference + "RFC 2578: Structure of Management Information Version 2 (SMIv2)"; + } + + typedef yang-identifier { + type string { + length "1..max"; + pattern '[a-zA-Z_][a-zA-Z0-9\-_.]*'; + pattern '.|..|[^xX].*|.[^mM].*|..[^lL].*'; + } + description + "A YANG identifier string as defined by the 'identifier' + rule in Section 12 of RFC 6020. An identifier must + start with an alphabetic character or an underscore + followed by an arbitrary sequence of alphabetic or + numeric characters, underscores, hyphens, or dots. + + A YANG identifier MUST NOT start with any possible + combination of the lowercase or uppercase character + sequence 'xml'."; + reference + "RFC 6020: YANG - A Data Modeling Language for the Network + Configuration Protocol (NETCONF)"; + } + + /*** collection of date and time related types ***/ + + typedef date-and-time { + type string { + pattern '\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d+)?' + + '(Z|[\+\-]\d{2}:\d{2})'; + } + description + "The date-and-time type is a profile of the ISO 8601 + standard for representation of dates and times using the + Gregorian calendar. The profile is defined by the + date-time production in Section 5.6 of RFC 3339. + + The date-and-time type is compatible with the dateTime XML + schema type with the following notable exceptions: + + (a) The date-and-time type does not allow negative years. + + (b) The date-and-time time-offset -00:00 indicates an unknown + time zone (see RFC 3339) while -00:00 and +00:00 and Z all + represent the same time zone in dateTime. + + (c) The canonical format (see below) of data-and-time values + differs from the canonical format used by the dateTime XML + schema type, which requires all times to be in UTC using the + time-offset 'Z'. + + This type is not equivalent to the DateAndTime textual + convention of the SMIv2 since RFC 3339 uses a different + separator between full-date and full-time and provides + higher resolution of time-secfrac. + + The canonical format for date-and-time values with a known time + zone uses a numeric time zone offset that is calculated using + the device's configured known offset to UTC time. A change of + the device's offset to UTC time will cause date-and-time values + to change accordingly. Such changes might happen periodically + in case a server follows automatically daylight saving time + (DST) time zone offset changes. The canonical format for + date-and-time values with an unknown time zone (usually referring + to the notion of local time) uses the time-offset -00:00."; + reference + "RFC 3339: Date and Time on the Internet: Timestamps + RFC 2579: Textual Conventions for SMIv2 + XSD-TYPES: XML Schema Part 2: Datatypes Second Edition"; + } + + typedef timeticks { + type uint32; + description + "The timeticks type represents a non-negative integer that + represents the time, modulo 2^32 (4294967296 decimal), in + hundredths of a second between two epochs. When a schema + node is defined that uses this type, the description of + the schema node identifies both of the reference epochs. + + In the value set and its semantics, this type is equivalent + to the TimeTicks type of the SMIv2."; + reference + "RFC 2578: Structure of Management Information Version 2 (SMIv2)"; + } + + typedef timestamp { + type yang:timeticks; + description + "The timestamp type represents the value of an associated + timeticks schema node at which a specific occurrence happened. + The specific occurrence must be defined in the description + of any schema node defined using this type. When the specific + occurrence occurred prior to the last time the associated + timeticks attribute was zero, then the timestamp value is + zero. Note that this requires all timestamp values to be + reset to zero when the value of the associated timeticks + attribute reaches 497+ days and wraps around to zero. + + The associated timeticks schema node must be specified + in the description of any schema node using this type. + + In the value set and its semantics, this type is equivalent + to the TimeStamp textual convention of the SMIv2."; + reference + "RFC 2579: Textual Conventions for SMIv2"; + } + + /*** collection of generic address types ***/ + + typedef phys-address { + type string { + pattern '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'; + } + description + "Represents media- or physical-level addresses represented + as a sequence octets, each octet represented by two hexadecimal + numbers. Octets are separated by colons. The canonical + representation uses lowercase characters. + + In the value set and its semantics, this type is equivalent + to the PhysAddress textual convention of the SMIv2."; + reference + "RFC 2579: Textual Conventions for SMIv2"; + } + + typedef mac-address { + type string { + pattern '[0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){5}'; + } + description + "The mac-address type represents an IEEE 802 MAC address. + The canonical representation uses lowercase characters. + + In the value set and its semantics, this type is equivalent + to the MacAddress textual convention of the SMIv2."; + reference + "IEEE 802: IEEE Standard for Local and Metropolitan Area + Networks: Overview and Architecture + RFC 2579: Textual Conventions for SMIv2"; + } + + /*** collection of XML specific types ***/ + + typedef xpath1.0 { + type string; + description + "This type represents an XPATH 1.0 expression. + + When a schema node is defined that uses this type, the + description of the schema node MUST specify the XPath + context in which the XPath expression is evaluated."; + reference + "XPATH: XML Path Language (XPath) Version 1.0"; + } + + } diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/leafref/json/jsondata.json b/netconf/restconf/restconf-nb-bierman02/src/test/resources/leafref/json/jsondata.json new file mode 100644 index 0000000..f4a435e --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/leafref/json/jsondata.json @@ -0,0 +1,8 @@ +{ + "leafref-module:cont" : { + "lf4" : "/referenced-module:cont/referenced-module:lf1", + "lf2" : "/leafref-module:cont/leafref-module:lf1", + "lf3" : "/leafref-module:cont/leafref-module:lf2", + "lf5" : "/leafref-module:cont/leafref-module:lf3" + } +}
\ No newline at end of file diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/leafref/xml/xmldata.xml b/netconf/restconf/restconf-nb-bierman02/src/test/resources/leafref/xml/xmldata.xml new file mode 100644 index 0000000..1b5ce83 --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/leafref/xml/xmldata.xml @@ -0,0 +1,6 @@ +<cont xmlnsa="leafref:module"> + <lf4 xmlns:nsa="referenced:module">/nsa:cont/nsa:lf1</lf4> + <lf2 xmlns:nsa="leafref:module">/nsa:cont/nsa:lf1</lf2> + <lf3 xmlns:ns="leafref:module">/ns:cont/ns:lf2</lf3> + <lf5 xmlns:nsa="leafref:module">/nsa:cont/nsa:lf3</lf5> +</cont> diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/leafref/yang/leafref-module.yang b/netconf/restconf/restconf-nb-bierman02/src/test/resources/leafref/yang/leafref-module.yang new file mode 100644 index 0000000..9675b79 --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/leafref/yang/leafref-module.yang @@ -0,0 +1,54 @@ +module leafref-module { + namespace "leafref:module"; + + + prefix "lfrfmodule"; + + import referenced-module { prefix refmod; revision-date 2014-04-17;} + + + revision 2014-04-17 { + } + + + container cont { + leaf lf1 { + type instance-identifier; + } + + leaf lf2 { + type leafref { + path "../lf1"; + } + } + + leaf lf3 { + type leafref { + path "/refmod:cont/refmod:lf1"; + } + } + + leaf lf4 { + type leafref { + path "/cont/lf1"; + } + } + + leaf lf5 { + type leafref { + path "../lf1"; + } + } + + list lst-with-lfref-key { + key "lfref-key"; + + leaf lfref-key { + type leafref { + path "/refmod:cont/refmod:id-ref"; + } + } + } + + } +} diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/leafref/yang/referenced-module.yang b/netconf/restconf/restconf-nb-bierman02/src/test/resources/leafref/yang/referenced-module.yang new file mode 100644 index 0000000..05dd123 --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/leafref/yang/referenced-module.yang @@ -0,0 +1,23 @@ +module referenced-module { + namespace "referenced:module"; + + prefix "refmodule"; + revision 2014-04-17 { + } + + container cont { + leaf lf1 { + type instance-identifier; + } + + leaf id-ref { + type leafref { + path "../../id"; + } + } + } + + leaf id { + type string; + } +} diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/listener-adapter-test/notif-create.json b/netconf/restconf/restconf-nb-bierman02/src/test/resources/listener-adapter-test/notif-create.json new file mode 100644 index 0000000..bc1cf52 --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/listener-adapter-test/notif-create.json @@ -0,0 +1,55 @@ +{ + "notification": { + "data-changed-notification": { + "data-change-event": [ + { + "data": { + "my-leaf11": { + "content": "Jed", + "xmlns": "instance:identifier:patch:module" + } + }, + "operation": "created", + "path": "/instance-identifier-patch-module:patch-cont/instance-identifier-patch-module:my-list1[instance-identifier-patch-module:name='Althea']/instance-identifier-patch-module:my-leaf11" + }, + { + "data": { + "name": { + "content": "Althea", + "xmlns": "instance:identifier:patch:module" + } + }, + "operation": "created", + "path": "/instance-identifier-patch-module:patch-cont/instance-identifier-patch-module:my-list1[instance-identifier-patch-module:name='Althea']/instance-identifier-patch-module:name" + }, + { + "data": { + "patch-cont": { + "my-list1": { + "my-leaf11": "Jed", + "name": "Althea" + }, + "xmlns": "instance:identifier:patch:module" + } + }, + "operation": "created", + "path": "/instance-identifier-patch-module:patch-cont" + }, + { + "data": { + "my-list1": { + "my-leaf11": "Jed", + "name": "Althea", + "xmlns": "instance:identifier:patch:module" + } + }, + "operation": "created", + "path": "/instance-identifier-patch-module:patch-cont/instance-identifier-patch-module:my-list1[instance-identifier-patch-module:name='Althea']" + } + ], + "xmlns": "urn:opendaylight:params:xml:ns:yang:controller:md:sal:remote" + }, + "eventTime": "2017-09-17T13:32:03.586+03:00", + "xmlns": "urn:ietf:params:xml:ns:netconf:notification:1.0" + } +} diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/listener-adapter-test/notif-del.json b/netconf/restconf/restconf-nb-bierman02/src/test/resources/listener-adapter-test/notif-del.json new file mode 100644 index 0000000..dbadab2 --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/listener-adapter-test/notif-del.json @@ -0,0 +1,31 @@ +{ + "notification": { + "data-changed-notification": { + "data-change-event": [ + { + "operation": "deleted", + "path": "/instance-identifier-patch-module:patch-cont" + }, + { + "operation": "deleted", + "path": "/instance-identifier-patch-module:patch-cont/instance-identifier-patch-module:my-list1[instance-identifier-patch-module:name='Althea']" + }, + { + "operation": "deleted", + "path": "/instance-identifier-patch-module:patch-cont/instance-identifier-patch-module:my-list1[instance-identifier-patch-module:name='Althea']/instance-identifier-patch-module:name" + }, + { + "operation": "deleted", + "path": "/instance-identifier-patch-module:patch-cont/instance-identifier-patch-module:my-list1[instance-identifier-patch-module:name='Althea']/instance-identifier-patch-module:my-leaf12" + }, + { + "operation": "deleted", + "path": "/instance-identifier-patch-module:patch-cont/instance-identifier-patch-module:my-list1[instance-identifier-patch-module:name='Althea']/instance-identifier-patch-module:my-leaf11" + } + ], + "xmlns": "urn:opendaylight:params:xml:ns:yang:controller:md:sal:remote" + }, + "eventTime": "2017-09-17T14:18:53.404+03:00", + "xmlns": "urn:ietf:params:xml:ns:netconf:notification:1.0" + } +} diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/listener-adapter-test/notif-leaves-create.json b/netconf/restconf/restconf-nb-bierman02/src/test/resources/listener-adapter-test/notif-leaves-create.json new file mode 100644 index 0000000..52be56a --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/listener-adapter-test/notif-leaves-create.json @@ -0,0 +1,31 @@ +{ + "notification": { + "data-changed-notification": { + "data-change-event": [ + { + "data": { + "my-leaf11": { + "content": "Jed", + "xmlns": "instance:identifier:patch:module" + } + }, + "operation": "created", + "path": "/instance-identifier-patch-module:patch-cont/instance-identifier-patch-module:my-list1[instance-identifier-patch-module:name='Althea']/instance-identifier-patch-module:my-leaf11" + }, + { + "data": { + "name": { + "content": "Althea", + "xmlns": "instance:identifier:patch:module" + } + }, + "operation": "created", + "path": "/instance-identifier-patch-module:patch-cont/instance-identifier-patch-module:my-list1[instance-identifier-patch-module:name='Althea']/instance-identifier-patch-module:name" + } + ], + "xmlns": "urn:opendaylight:params:xml:ns:yang:controller:md:sal:remote" + }, + "eventTime": "2017-09-17T11:23:10.323+03:00", + "xmlns": "urn:ietf:params:xml:ns:netconf:notification:1.0" + } +} diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/listener-adapter-test/notif-leaves-del.json b/netconf/restconf/restconf-nb-bierman02/src/test/resources/listener-adapter-test/notif-leaves-del.json new file mode 100644 index 0000000..5d9e9f1 --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/listener-adapter-test/notif-leaves-del.json @@ -0,0 +1,23 @@ +{ + "notification": { + "data-changed-notification": { + "data-change-event": [ + { + "operation": "deleted", + "path": "/instance-identifier-patch-module:patch-cont/instance-identifier-patch-module:my-list1[instance-identifier-patch-module:name='Althea']/instance-identifier-patch-module:my-leaf11" + }, + { + "operation": "deleted", + "path": "/instance-identifier-patch-module:patch-cont/instance-identifier-patch-module:my-list1[instance-identifier-patch-module:name='Althea']/instance-identifier-patch-module:name" + }, + { + "operation": "deleted", + "path": "/instance-identifier-patch-module:patch-cont/instance-identifier-patch-module:my-list1[instance-identifier-patch-module:name='Althea']/instance-identifier-patch-module:my-leaf12" + } + ], + "xmlns": "urn:opendaylight:params:xml:ns:yang:controller:md:sal:remote" + }, + "eventTime": "2017-09-18T15:30:16.099+03:00", + "xmlns": "urn:ietf:params:xml:ns:netconf:notification:1.0" + } +} diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/listener-adapter-test/notif-leaves-update.json b/netconf/restconf/restconf-nb-bierman02/src/test/resources/listener-adapter-test/notif-leaves-update.json new file mode 100644 index 0000000..ffef660 --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/listener-adapter-test/notif-leaves-update.json @@ -0,0 +1,31 @@ +{ + "notification": { + "data-changed-notification": { + "data-change-event": [ + { + "data": { + "my-leaf12": { + "content": "Bertha", + "xmlns": "instance:identifier:patch:module" + } + }, + "operation": "created", + "path": "/instance-identifier-patch-module:patch-cont/instance-identifier-patch-module:my-list1[instance-identifier-patch-module:name='Althea']/instance-identifier-patch-module:my-leaf12" + }, + { + "data": { + "name": { + "content": "Althea", + "xmlns": "instance:identifier:patch:module" + } + }, + "operation": "updated", + "path": "/instance-identifier-patch-module:patch-cont/instance-identifier-patch-module:my-list1[instance-identifier-patch-module:name='Althea']/instance-identifier-patch-module:name" + } + ], + "xmlns": "urn:opendaylight:params:xml:ns:yang:controller:md:sal:remote" + }, + "eventTime": "2017-09-18T14:20:54.82+03:00", + "xmlns": "urn:ietf:params:xml:ns:netconf:notification:1.0" + } +} diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/listener-adapter-test/notif-update.json b/netconf/restconf/restconf-nb-bierman02/src/test/resources/listener-adapter-test/notif-update.json new file mode 100644 index 0000000..b2957ea --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/listener-adapter-test/notif-update.json @@ -0,0 +1,57 @@ +{ + "notification": { + "data-changed-notification": { + "data-change-event": [ + { + "data": { + "patch-cont": { + "my-list1": { + "my-leaf11": "Jed", + "my-leaf12": "Bertha", + "name": "Althea" + }, + "xmlns": "instance:identifier:patch:module" + } + }, + "operation": "updated", + "path": "/instance-identifier-patch-module:patch-cont" + }, + { + "data": { + "my-list1": { + "my-leaf11": "Jed", + "my-leaf12": "Bertha", + "name": "Althea", + "xmlns": "instance:identifier:patch:module" + } + }, + "operation": "updated", + "path": "/instance-identifier-patch-module:patch-cont/instance-identifier-patch-module:my-list1[instance-identifier-patch-module:name='Althea']" + }, + { + "data": { + "my-leaf12": { + "content": "Bertha", + "xmlns": "instance:identifier:patch:module" + } + }, + "operation": "created", + "path": "/instance-identifier-patch-module:patch-cont/instance-identifier-patch-module:my-list1[instance-identifier-patch-module:name='Althea']/instance-identifier-patch-module:my-leaf12" + }, + { + "data": { + "name": { + "content": "Althea", + "xmlns": "instance:identifier:patch:module" + } + }, + "operation": "updated", + "path": "/instance-identifier-patch-module:patch-cont/instance-identifier-patch-module:my-list1[instance-identifier-patch-module:name='Althea']/instance-identifier-patch-module:name" + } + ], + "xmlns": "urn:opendaylight:params:xml:ns:yang:controller:md:sal:remote" + }, + "eventTime": "2017-09-18T15:52:25.213+03:00", + "xmlns": "urn:ietf:params:xml:ns:netconf:notification:1.0" + } +} diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/listener-adapter-test/notif-without-data-create.json b/netconf/restconf/restconf-nb-bierman02/src/test/resources/listener-adapter-test/notif-without-data-create.json new file mode 100644 index 0000000..6e4dadc --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/listener-adapter-test/notif-without-data-create.json @@ -0,0 +1,13 @@ +{ + "notification":{ + "xmlns":"urn:ietf:params:xml:ns:netconf:notification:1.0", + "data-changed-notification":{ + "xmlns":"urn:opendaylight:params:xml:ns:yang:controller:md:sal:remote", + "data-change-event":{ + "path":"/instance-identifier-patch-module:patch-cont", + "operation":"created" + } + }, + "eventTime":"2020-05-31T18:45:05.132101+05:30" + } +} diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/listener-adapter-test/notif-without-data-del.json b/netconf/restconf/restconf-nb-bierman02/src/test/resources/listener-adapter-test/notif-without-data-del.json new file mode 100644 index 0000000..dc3f739 --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/listener-adapter-test/notif-without-data-del.json @@ -0,0 +1,13 @@ +{ + "notification":{ + "xmlns":"urn:ietf:params:xml:ns:netconf:notification:1.0", + "data-changed-notification":{ + "xmlns":"urn:opendaylight:params:xml:ns:yang:controller:md:sal:remote", + "data-change-event":{ + "path":"/instance-identifier-patch-module:patch-cont", + "operation":"deleted" + } + }, + "eventTime":"2020-05-31T18:45:05.132101+05:30" + } +} diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/listener-adapter-test/notif-without-data-update.json b/netconf/restconf/restconf-nb-bierman02/src/test/resources/listener-adapter-test/notif-without-data-update.json new file mode 100644 index 0000000..c22c956 --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/listener-adapter-test/notif-without-data-update.json @@ -0,0 +1,13 @@ +{ + "notification":{ + "xmlns":"urn:ietf:params:xml:ns:netconf:notification:1.0", + "data-changed-notification":{ + "xmlns":"urn:opendaylight:params:xml:ns:yang:controller:md:sal:remote", + "data-change-event":{ + "path":"/instance-identifier-patch-module:patch-cont", + "operation":"updated" + } + }, + "eventTime":"2020-05-31T18:45:05.132101+05:30" + } +} diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/modules/iana-if-type.yang b/netconf/restconf/restconf-nb-bierman02/src/test/resources/modules/iana-if-type.yang new file mode 100644 index 0000000..7bd0003 --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/modules/iana-if-type.yang @@ -0,0 +1,1517 @@ +module iana-if-type { + namespace "urn:ietf:params:xml:ns:yang:iana-if-type"; + prefix ianaift; + + organization "IANA"; + contact + " Internet Assigned Numbers Authority + + Postal: ICANN + 4676 Admiralty Way, Suite 330 + Marina del Rey, CA 90292 + + Tel: +1 310 823 9358 + E-Mail: iana&iana.org"; + description + "This YANG module defines the iana-if-type typedef, which + contains YANG definitions for IANA-registered interface types. + + This YANG module is maintained by IANA, and reflects the + 'ifType definitions' registry. + + The latest revision of this YANG module can be obtained from + the IANA web site. + + Copyright (c) 2011 IETF Trust and the persons identified as + authors of the code. All rights reserved. + + Redistribution and use in source and binary forms, with or + without modification, is permitted pursuant to, and subject + to the license terms contained in, the Simplified BSD License + set forth in Section 4.c of the IETF Trust's Legal Provisions + Relating to IETF Documents + (http://trustee.ietf.org/license-info). + + This version of this YANG module is part of RFC XXXX; see + the RFC itself for full legal notices."; + // RFC Ed.: replace XXXX with actual RFC number and remove this + // note. + + // RFC Ed.: update the date below with the date of RFC publication + // and remove this note. + revision 2013-07-04 { + description + "Initial revision."; + reference + "RFC XXXX: IANA Interface Type YANG Module"; + } + + typedef iana-if-type { + type enumeration { + enum "other" { + value 1; + description + "None of the following"; + } + enum "regular1822" { + value 2; + } + enum "hdh1822" { + value 3; + } + enum "ddnX25" { + value 4; + } + enum "rfc877x25" { + value 5; + reference + "RFC 1382 - SNMP MIB Extension for the X.25 Packet Layer"; + } + enum "ethernetCsmacd" { + value 6; + description + "For all ethernet-like interfaces, regardless of speed, + as per RFC3635."; + reference + "RFC 3635 - Definitions of Managed Objects for the + Ethernet-like Interface Types."; + } + enum "iso88023Csmacd" { + value 7; + status deprecated; + description + "Deprecated via RFC3635. + Use ethernetCsmacd(6) instead."; + reference + "RFC 3635 - Definitions of Managed Objects for the + Ethernet-like Interface Types."; + } + enum "iso88024TokenBus" { + value 8; + } + enum "iso88025TokenRing" { + value 9; + } + enum "iso88026Man" { + value 10; + } + enum "starLan" { + value 11; + status deprecated; + description + "Deprecated via RFC3635. + Use ethernetCsmacd(6) instead."; + reference + "RFC 3635 - Definitions of Managed Objects for the + Ethernet-like Interface Types."; + } + enum "proteon10Mbit" { + value 12; + } + enum "proteon80Mbit" { + value 13; + } + enum "hyperchannel" { + value 14; + } + enum "fddi" { + value 15; + reference + "RFC 1512 - FDDI Management Information Base"; + } + enum "lapb" { + value 16; + reference + "RFC 1381 - SNMP MIB Extension for X.25 LAPB"; + } + enum "sdlc" { + value 17; + } + enum "ds1" { + value 18; + description + "DS1-MIB"; + reference + "RFC 4805 - Definitions of Managed Objects for the + DS1, J1, E1, DS2, and E2 Interface Types"; + } + enum "e1" { + value 19; + status obsolete; + description + "Obsolete see DS1-MIB"; + reference + "RFC 4805 - Definitions of Managed Objects for the + DS1, J1, E1, DS2, and E2 Interface Types"; + } + enum "basicISDN" { + value 20; + description + "see also RFC2127"; + } + enum "primaryISDN" { + value 21; + } + enum "propPointToPointSerial" { + value 22; + description + "proprietary serial"; + } + enum "ppp" { + value 23; + } + enum "softwareLoopback" { + value 24; + } + enum "eon" { + value 25; + description + "CLNP over IP"; + } + enum "ethernet3Mbit" { + value 26; + } + enum "nsip" { + value 27; + description + "XNS over IP"; + } + enum "slip" { + value 28; + description + "generic SLIP"; + } + enum "ultra" { + value 29; + description + "ULTRA technologies"; + } + enum "ds3" { + value 30; + description + "DS3-MIB"; + reference + "RFC 3896 - Definitions of Managed Objects for the + DS3/E3 Interface Type"; + } + enum "sip" { + value 31; + description + "SMDS, coffee"; + reference + "RFC 1694 - Definitions of Managed Objects for SMDS + Interfaces using SMIv2"; + } + enum "frameRelay" { + value 32; + description + "DTE only."; + reference + "RFC 2115 - Management Information Base for Frame Relay + DTEs Using SMIv2"; + } + enum "rs232" { + value 33; + reference + "RFC 1659 - Definitions of Managed Objects for RS-232-like + Hardware Devices using SMIv2"; + } + enum "para" { + value 34; + description + "parallel-port"; + reference + "RFC 1660 - Definitions of Managed Objects for + Parallel-printer-like Hardware Devices using + SMIv2"; + } + enum "arcnet" { + value 35; + description + "arcnet"; + } + enum "arcnetPlus" { + value 36; + description + "arcnet plus"; + } + enum "atm" { + value 37; + description + "ATM cells"; + } + enum "miox25" { + value 38; + reference + "RFC 1461 - SNMP MIB extension for Multiprotocol + Interconnect over X.25"; + } + enum "sonet" { + value 39; + description + "SONET or SDH"; + } + enum "x25ple" { + value 40; + reference + "RFC 2127 - ISDN Management Information Base using SMIv2"; + } + enum "iso88022llc" { + value 41; + } + enum "localTalk" { + value 42; + } + enum "smdsDxi" { + value 43; + } + enum "frameRelayService" { + value 44; + description + "FRNETSERV-MIB"; + reference + "RFC 2954 - Definitions of Managed Objects for Frame + Relay Service"; + } + enum "v35" { + value 45; + } + enum "hssi" { + value 46; + } + enum "hippi" { + value 47; + } + enum "modem" { + value 48; + description + "Generic modem"; + } + enum "aal5" { + value 49; + description + "AAL5 over ATM"; + } + enum "sonetPath" { + value 50; + } + enum "sonetVT" { + value 51; + } + enum "smdsIcip" { + value 52; + description + "SMDS InterCarrier Interface"; + } + enum "propVirtual" { + value 53; + description + "proprietary virtual/internal"; + reference + "RFC 2863 - The Interfaces Group MIB"; + } + enum "propMultiplexor" { + value 54; + description + "proprietary multiplexing"; + reference + "RFC 2863 - The Interfaces Group MIB"; + } + enum "ieee80212" { + value 55; + description + "100BaseVG"; + } + enum "fibreChannel" { + value 56; + description + "Fibre Channel"; + } + enum "hippiInterface" { + value 57; + description + "HIPPI interfaces"; + } + enum "frameRelayInterconnect" { + value 58; + status obsolete; + description + "Obsolete use either + frameRelay(32) or frameRelayService(44)."; + } + enum "aflane8023" { + value 59; + description + "ATM Emulated LAN for 802.3"; + } + enum "aflane8025" { + value 60; + description + "ATM Emulated LAN for 802.5"; + } + enum "cctEmul" { + value 61; + description + "ATM Emulated circuit"; + } + enum "fastEther" { + value 62; + status deprecated; + description + "Obsoleted via RFC3635. + ethernetCsmacd(6) should be used instead"; + reference + "RFC 3635 - Definitions of Managed Objects for the + Ethernet-like Interface Types."; + } + enum "isdn" { + value 63; + description + "ISDN and X.25"; + reference + "RFC 1356 - Multiprotocol Interconnect on X.25 and ISDN + in the Packet Mode"; + } + enum "v11" { + value 64; + description + "CCITT V.11/X.21"; + } + enum "v36" { + value 65; + description + "CCITT V.36"; + } + enum "g703at64k" { + value 66; + description + "CCITT G703 at 64Kbps"; + } + enum "g703at2mb" { + value 67; + status obsolete; + description + "Obsolete see DS1-MIB"; + } + enum "qllc" { + value 68; + description + "SNA QLLC"; + } + enum "fastEtherFX" { + value 69; + status deprecated; + description + "Obsoleted via RFC3635 + ethernetCsmacd(6) should be used instead"; + reference + "RFC 3635 - Definitions of Managed Objects for the + Ethernet-like Interface Types."; + } + enum "channel" { + value 70; + description + "channel"; + } + enum "ieee80211" { + value 71; + description + "radio spread spectrum"; + } + enum "ibm370parChan" { + value 72; + description + "IBM System 360/370 OEMI Channel"; + } + enum "escon" { + value 73; + description + "IBM Enterprise Systems Connection"; + } + enum "dlsw" { + value 74; + description + "Data Link Switching"; + } + enum "isdns" { + value 75; + description + "ISDN S/T interface"; + } + enum "isdnu" { + value 76; + description + "ISDN U interface"; + } + enum "lapd" { + value 77; + description + "Link Access Protocol D"; + } + enum "ipSwitch" { + value 78; + description + "IP Switching Objects"; + } + enum "rsrb" { + value 79; + description + "Remote Source Route Bridging"; + } + enum "atmLogical" { + value 80; + description + "ATM Logical Port"; + reference + "RFC 3606 - Definitions of Supplemental Managed Objects + for ATM Interface"; + } + enum "ds0" { + value 81; + description + "Digital Signal Level 0"; + reference + "RFC 2494 - Definitions of Managed Objects for the DS0 + and DS0 Bundle Interface Type"; + } + enum "ds0Bundle" { + value 82; + description + "group of ds0s on the same ds1"; + reference + "RFC 2494 - Definitions of Managed Objects for the DS0 + and DS0 Bundle Interface Type"; + } + enum "bsc" { + value 83; + description + "Bisynchronous Protocol"; + } + enum "async" { + value 84; + description + "Asynchronous Protocol"; + } + enum "cnr" { + value 85; + description + "Combat Net Radio"; + } + enum "iso88025Dtr" { + value 86; + description + "ISO 802.5r DTR"; + } + enum "eplrs" { + value 87; + description + "Ext Pos Loc Report Sys"; + } + enum "arap" { + value 88; + description + "Appletalk Remote Access Protocol"; + } + enum "propCnls" { + value 89; + description + "Proprietary Connectionless Protocol"; + } + enum "hostPad" { + value 90; + description + "CCITT-ITU X.29 PAD Protocol"; + } + enum "termPad" { + value 91; + description + "CCITT-ITU X.3 PAD Facility"; + } + enum "frameRelayMPI" { + value 92; + description + "Multiproto Interconnect over FR"; + } + enum "x213" { + value 93; + description + "CCITT-ITU X213"; + } + enum "adsl" { + value 94; + description + "Asymmetric Digital Subscriber Loop"; + } + enum "radsl" { + value 95; + description + "Rate-Adapt. Digital Subscriber Loop"; + } + enum "sdsl" { + value 96; + description + "Symmetric Digital Subscriber Loop"; + } + enum "vdsl" { + value 97; + description + "Very H-Speed Digital Subscrib. Loop"; + } + enum "iso88025CRFPInt" { + value 98; + description + "ISO 802.5 CRFP"; + } + enum "myrinet" { + value 99; + description + "Myricom Myrinet"; + } + enum "voiceEM" { + value 100; + description + "voice recEive and transMit"; + } + enum "voiceFXO" { + value 101; + description + "voice Foreign Exchange Office"; + } + enum "voiceFXS" { + value 102; + description + "voice Foreign Exchange Station"; + } + enum "voiceEncap" { + value 103; + description + "voice encapsulation"; + } + enum "voiceOverIp" { + value 104; + description + "voice over IP encapsulation"; + } + enum "atmDxi" { + value 105; + description + "ATM DXI"; + } + enum "atmFuni" { + value 106; + description + "ATM FUNI"; + } + enum "atmIma" { + value 107; + description + "ATM IMA"; + } + enum "pppMultilinkBundle" { + value 108; + description + "PPP Multilink Bundle"; + } + enum "ipOverCdlc" { + value 109; + description + "IBM ipOverCdlc"; + } + enum "ipOverClaw" { + value 110; + description + "IBM Common Link Access to Workstn"; + } + enum "stackToStack" { + value 111; + description + "IBM stackToStack"; + } + enum "virtualIpAddress" { + value 112; + description + "IBM VIPA"; + } + enum "mpc" { + value 113; + description + "IBM multi-protocol channel support"; + } + enum "ipOverAtm" { + value 114; + description + "IBM ipOverAtm"; + reference + "RFC 2320 - Definitions of Managed Objects for Classical IP + and ARP Over ATM Using SMIv2 (IPOA-MIB)"; + } + enum "iso88025Fiber" { + value 115; + description + "ISO 802.5j Fiber Token Ring"; + } + enum "tdlc" { + value 116; + description + "IBM twinaxial data link control"; + } + enum "gigabitEthernet" { + value 117; + status deprecated; + description + "Obsoleted via RFC3635 + ethernetCsmacd(6) should be used instead"; + reference + "RFC 3635 - Definitions of Managed Objects for the + Ethernet-like Interface Types."; + } + enum "hdlc" { + value 118; + description + "HDLC"; + } + enum "lapf" { + value 119; + description + "LAP F"; + } + enum "v37" { + value 120; + description + "V.37"; + } + enum "x25mlp" { + value 121; + description + "Multi-Link Protocol"; + } + enum "x25huntGroup" { + value 122; + description + "X25 Hunt Group"; + } + enum "transpHdlc" { + value 123; + description + "Transp HDLC"; + } + enum "interleave" { + value 124; + description + "Interleave channel"; + } + enum "fast" { + value 125; + description + "Fast channel"; + } + enum "ip" { + value 126; + description + "IP (for APPN HPR in IP networks)"; + } + enum "docsCableMaclayer" { + value 127; + description + "CATV Mac Layer"; + } + enum "docsCableDownstream" { + value 128; + description + "CATV Downstream interface"; + } + enum "docsCableUpstream" { + value 129; + description + "CATV Upstream interface"; + } + enum "a12MppSwitch" { + value 130; + description + "Avalon Parallel Processor"; + } + enum "tunnel" { + value 131; + description + "Encapsulation interface"; + } + enum "coffee" { + value 132; + description + "coffee pot"; + reference + "RFC 2325 - Coffee MIB"; + } + enum "ces" { + value 133; + description + "Circuit Emulation Service"; + } + enum "atmSubInterface" { + value 134; + description + "ATM Sub Interface"; + } + enum "l2vlan" { + value 135; + description + "Layer 2 Virtual LAN using 802.1Q"; + } + enum "l3ipvlan" { + value 136; + description + "Layer 3 Virtual LAN using IP"; + } + enum "l3ipxvlan" { + value 137; + description + "Layer 3 Virtual LAN using IPX"; + } + enum "digitalPowerline" { + value 138; + description + "IP over Power Lines"; + } + enum "mediaMailOverIp" { + value 139; + description + "Multimedia Mail over IP"; + } + enum "dtm" { + value 140; + description + "Dynamic syncronous Transfer Mode"; + } + enum "dcn" { + value 141; + description + "Data Communications Network"; + } + enum "ipForward" { + value 142; + description + "IP Forwarding Interface"; + } + enum "msdsl" { + value 143; + description + "Multi-rate Symmetric DSL"; + } + enum "ieee1394" { + value 144; + description + "IEEE1394 High Performance Serial Bus"; + } + enum "if-gsn" { + value 145; + description + "HIPPI-6400"; + } + enum "dvbRccMacLayer" { + value 146; + description + "DVB-RCC MAC Layer"; + } + enum "dvbRccDownstream" { + value 147; + description + "DVB-RCC Downstream Channel"; + } + enum "dvbRccUpstream" { + value 148; + description + "DVB-RCC Upstream Channel"; + } + enum "atmVirtual" { + value 149; + description + "ATM Virtual Interface"; + } + enum "mplsTunnel" { + value 150; + description + "MPLS Tunnel Virtual Interface"; + } + enum "srp" { + value 151; + description + "Spatial Reuse Protocol"; + } + enum "voiceOverAtm" { + value 152; + description + "Voice Over ATM"; + } + enum "voiceOverFrameRelay" { + value 153; + description + "Voice Over Frame Relay"; + } + enum "idsl" { + value 154; + description + "Digital Subscriber Loop over ISDN"; + } + enum "compositeLink" { + value 155; + description + "Avici Composite Link Interface"; + } + enum "ss7SigLink" { + value 156; + description + "SS7 Signaling Link"; + } + enum "propWirelessP2P" { + value 157; + description + "Prop. P2P wireless interface"; + } + enum "frForward" { + value 158; + description + "Frame Forward Interface"; + } + enum "rfc1483" { + value 159; + description + "Multiprotocol over ATM AAL5"; + reference + "RFC 1483 - Multiprotocol Encapsulation over ATM + Adaptation Layer 5"; + } + enum "usb" { + value 160; + description + "USB Interface"; + } + enum "ieee8023adLag" { + value 161; + description + "IEEE 802.3ad Link Aggregate"; + } + enum "bgppolicyaccounting" { + value 162; + description + "BGP Policy Accounting"; + } + enum "frf16MfrBundle" { + value 163; + description + "FRF .16 Multilink Frame Relay"; + } + enum "h323Gatekeeper" { + value 164; + description + "H323 Gatekeeper"; + } + enum "h323Proxy" { + value 165; + description + "H323 Voice and Video Proxy"; + } + enum "mpls" { + value 166; + description + "MPLS"; + } + enum "mfSigLink" { + value 167; + description + "Multi-frequency signaling link"; + } + enum "hdsl2" { + value 168; + description + "High Bit-Rate DSL - 2nd generation"; + } + enum "shdsl" { + value 169; + description + "Multirate HDSL2"; + } + enum "ds1FDL" { + value 170; + description + "Facility Data Link 4Kbps on a DS1"; + } + enum "pos" { + value 171; + description + "Packet over SONET/SDH Interface"; + } + enum "dvbAsiIn" { + value 172; + description + "DVB-ASI Input"; + } + enum "dvbAsiOut" { + value 173; + description + "DVB-ASI Output"; + } + enum "plc" { + value 174; + description + "Power Line Communtications"; + } + enum "nfas" { + value 175; + description + "Non Facility Associated Signaling"; + } + enum "tr008" { + value 176; + description + "TR008"; + } + enum "gr303RDT" { + value 177; + description + "Remote Digital Terminal"; + } + enum "gr303IDT" { + value 178; + description + "Integrated Digital Terminal"; + } + enum "isup" { + value 179; + description + "ISUP"; + } + enum "propDocsWirelessMaclayer" { + value 180; + description + "Cisco proprietary Maclayer"; + } + enum "propDocsWirelessDownstream" { + value 181; + description + "Cisco proprietary Downstream"; + } + enum "propDocsWirelessUpstream" { + value 182; + description + "Cisco proprietary Upstream"; + } + enum "hiperlan2" { + value 183; + description + "HIPERLAN Type 2 Radio Interface"; + } + enum "propBWAp2Mp" { + value 184; + description + "PropBroadbandWirelessAccesspt2multipt use of this value + for IEEE 802.16 WMAN interfaces as per IEEE Std 802.16f + is deprecated and ieee80216WMAN(237) should be used + instead."; + } + enum "sonetOverheadChannel" { + value 185; + description + "SONET Overhead Channel"; + } + enum "digitalWrapperOverheadChannel" { + value 186; + description + "Digital Wrapper"; + } + enum "aal2" { + value 187; + description + "ATM adaptation layer 2"; + } + enum "radioMAC" { + value 188; + description + "MAC layer over radio links"; + } + enum "atmRadio" { + value 189; + description + "ATM over radio links"; + } + enum "imt" { + value 190; + description + "Inter Machine Trunks"; + } + enum "mvl" { + value 191; + description + "Multiple Virtual Lines DSL"; + } + enum "reachDSL" { + value 192; + description + "Long Reach DSL"; + } + enum "frDlciEndPt" { + value 193; + description + "Frame Relay DLCI End Point"; + } + enum "atmVciEndPt" { + value 194; + description + "ATM VCI End Point"; + } + enum "opticalChannel" { + value 195; + description + "Optical Channel"; + } + enum "opticalTransport" { + value 196; + description + "Optical Transport"; + } + enum "propAtm" { + value 197; + description + "Proprietary ATM"; + } + enum "voiceOverCable" { + value 198; + description + "Voice Over Cable Interface"; + } + enum "infiniband" { + value 199; + description + "Infiniband"; + } + enum "teLink" { + value 200; + description + "TE Link"; + } + enum "q2931" { + value 201; + description + "Q.2931"; + } + enum "virtualTg" { + value 202; + description + "Virtual Trunk Group"; + } + enum "sipTg" { + value 203; + description + "SIP Trunk Group"; + } + enum "sipSig" { + value 204; + description + "SIP Signaling"; + } + enum "docsCableUpstreamChannel" { + value 205; + description + "CATV Upstream Channel"; + } + enum "econet" { + value 206; + description + "Acorn Econet"; + } + enum "pon155" { + value 207; + description + "FSAN 155Mb Symetrical PON interface"; + } + enum "pon622" { + value 208; + description + "FSAN622Mb Symetrical PON interface"; + } + enum "bridge" { + value 209; + description + "Transparent bridge interface"; + } + enum "linegroup" { + value 210; + description + "Interface common to multiple lines"; + } + enum "voiceEMFGD" { + value 211; + description + "voice E&M Feature Group D"; + } + enum "voiceFGDEANA" { + value 212; + description + "voice FGD Exchange Access North American"; + } + enum "voiceDID" { + value 213; + description + "voice Direct Inward Dialing"; + } + enum "mpegTransport" { + value 214; + description + "MPEG transport interface"; + } + enum "sixToFour" { + value 215; + status deprecated; + description + "6to4 interface (DEPRECATED)"; + reference + "RFC 4087 - IP Tunnel MIB"; + } + enum "gtp" { + value 216; + description + "GTP (GPRS Tunneling Protocol)"; + } + enum "pdnEtherLoop1" { + value 217; + description + "Paradyne EtherLoop 1"; + } + enum "pdnEtherLoop2" { + value 218; + description + "Paradyne EtherLoop 2"; + } + enum "opticalChannelGroup" { + value 219; + description + "Optical Channel Group"; + } + enum "homepna" { + value 220; + description + "HomePNA ITU-T G.989"; + } + enum "gfp" { + value 221; + description + "Generic Framing Procedure (GFP)"; + } + enum "ciscoISLvlan" { + value 222; + description + "Layer 2 Virtual LAN using Cisco ISL"; + } + enum "actelisMetaLOOP" { + value 223; + description + "Acteleis proprietary MetaLOOP High Speed Link"; + } + enum "fcipLink" { + value 224; + description + "FCIP Link"; + } + enum "rpr" { + value 225; + description + "Resilient Packet Ring Interface Type"; + } + enum "qam" { + value 226; + description + "RF Qam Interface"; + } + enum "lmp" { + value 227; + description + "Link Management Protocol"; + reference + "RFC 4327 - Link Management Protocol (LMP) Management + Information Base (MIB)"; + } + enum "cblVectaStar" { + value 228; + description + "Cambridge Broadband Networks Limited VectaStar"; + } + enum "docsCableMCmtsDownstream" { + value 229; + description + "CATV Modular CMTS Downstream Interface"; + } + enum "adsl2" { + value 230; + status deprecated; + description + "Asymmetric Digital Subscriber Loop Version 2 + (DEPRECATED/OBSOLETED - please use adsl2plus(238) + instead)"; + reference + "RFC 4706 - Definitions of Managed Objects for Asymmetric + Digital Subscriber Line 2 (ADSL2)"; + } + enum "macSecControlledIF" { + value 231; + description + "MACSecControlled"; + } + enum "macSecUncontrolledIF" { + value 232; + description + "MACSecUncontrolled"; + } + enum "aviciOpticalEther" { + value 233; + description + "Avici Optical Ethernet Aggregate"; + } + enum "atmbond" { + value 234; + description + "atmbond"; + } + enum "voiceFGDOS" { + value 235; + description + "voice FGD Operator Services"; + } + enum "mocaVersion1" { + value 236; + description + "MultiMedia over Coax Alliance (MoCA) Interface + as documented in information provided privately to IANA"; + } + enum "ieee80216WMAN" { + value 237; + description + "IEEE 802.16 WMAN interface"; + } + enum "adsl2plus" { + value 238; + description + "Asymmetric Digital Subscriber Loop Version 2, + Version 2 Plus and all variants"; + } + enum "dvbRcsMacLayer" { + value 239; + description + "DVB-RCS MAC Layer"; + reference + "RFC 5728 - The SatLabs Group DVB-RCS MIB"; + } + enum "dvbTdm" { + value 240; + description + "DVB Satellite TDM"; + reference + "RFC 5728 - The SatLabs Group DVB-RCS MIB"; + } + enum "dvbRcsTdma" { + value 241; + description + "DVB-RCS TDMA"; + reference + "RFC 5728 - The SatLabs Group DVB-RCS MIB"; + } + enum "x86Laps" { + value 242; + description + "LAPS based on ITU-T X.86/Y.1323"; + } + enum "wwanPP" { + value 243; + description + "3GPP WWAN"; + } + enum "wwanPP2" { + value 244; + description + "3GPP2 WWAN"; + } + enum "voiceEBS" { + value 245; + description + "voice P-phone EBS physical interface"; + } + enum "ifPwType" { + value 246; + description + "Pseudowire interface type"; + reference + "RFC 5601 - Pseudowire (PW) Management Information Base"; + } + enum "ilan" { + value 247; + description + "Internal LAN on a bridge per IEEE 802.1ap"; + } + enum "pip" { + value 248; + description + "Provider Instance Port on a bridge per IEEE 802.1ah PBB"; + } + enum "aluELP" { + value 249; + description + "Alcatel-Lucent Ethernet Link Protection"; + } + enum "gpon" { + value 250; + description + "Gigabit-capable passive optical networks (G-PON) as per + ITU-T G.948"; + } + enum "vdsl2" { + value 251; + description + "Very high speed digital subscriber line Version 2 + (as per ITU-T Recommendation G.993.2)"; + reference + "RFC 5650 - Definitions of Managed Objects for Very High + Speed Digital Subscriber Line 2 (VDSL2)"; + } + enum "capwapDot11Profile" { + value 252; + description + "WLAN Profile Interface"; + reference + "RFC 5834 - Control and Provisioning of Wireless Access + Points (CAPWAP) Protocol Binding MIB for + IEEE 802.11"; + } + enum "capwapDot11Bss" { + value 253; + description + "WLAN BSS Interface"; + reference + "RFC 5834 - Control and Provisioning of Wireless Access + Points (CAPWAP) Protocol Binding MIB for + IEEE 802.11"; + } + enum "capwapWtpVirtualRadio" { + value 254; + description + "WTP Virtual Radio Interface"; + reference + "RFC 5833 - Control and Provisioning of Wireless Access + Points (CAPWAP) Protocol Base MIB"; + } + enum "bits" { + value 255; + description + "bitsport"; + } + enum "docsCableUpstreamRfPort" { + value 256; + description + "DOCSIS CATV Upstream RF Port"; + } + enum "cableDownstreamRfPort" { + value 257; + description + "CATV downstream RF port"; + } + enum "vmwareVirtualNic" { + value 258; + description + "VMware Virtual Network Interface"; + } + enum "ieee802154" { + value 259; + description + "IEEE 802.15.4 WPAN interface"; + reference + "IEEE 802.15.4-2006"; + } + enum "otnOdu" { + value 260; + description + "OTN Optical Data Unit"; + } + enum "otnOtu" { + value 261; + description + "OTN Optical channel Transport Unit"; + } + enum "ifVfiType" { + value 262; + description + "VPLS Forwarding Instance Interface Type"; + } + enum "g9981" { + value 263; + description + "G.998.1 bonded interface"; + } + enum "g9982" { + value 264; + description + "G.998.2 bonded interface"; + } + enum "g9983" { + value 265; + description + "G.998.3 bonded interface"; + } + enum "aluEpon" { + value 266; + description + "Ethernet Passive Optical Networks (E-PON)"; + } + enum "aluEponOnu" { + value 267; + description + "EPON Optical Network Unit"; + } + enum "aluEponPhysicalUni" { + value 268; + description + "EPON physical User to Network interface"; + } + enum "aluEponLogicalLink" { + value 269; + description + "The emulation of a point-to-point link over the EPON + layer"; + } + enum "aluGponOnu" { + value 270; + description + "GPON Optical Network Unit"; + reference + "ITU-T G.984.2"; + } + enum "aluGponPhysicalUni" { + value 271; + description + "GPON physical User to Network interface"; + reference + "ITU-T G.984.2"; + } + enum "vmwareNicTeam" { + value 272; + description + "VMware NIC Team"; + } + // value 273 reserved by IANA + } + description + "This data type is used as the syntax of the 'type' + leaf in the 'interface' list in the YANG module + ietf-interface. + + The definition of this typedef with the + addition of newly assigned values is published + periodically by the IANA, in either the Assigned + Numbers RFC, or some derivative of it specific to + Internet Network Management number assignments. (The + latest arrangements can be obtained by contacting the + IANA.) + + Requests for new values should be made to IANA via + email (iana&iana.org)."; + reference + "IANA ifType definitions registry. + <http://www.iana.org/assignments/smi-numbers>"; + } +}
\ No newline at end of file diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/modules/ietf-inet-types.yang b/netconf/restconf/restconf-nb-bierman02/src/test/resources/modules/ietf-inet-types.yang new file mode 100644 index 0000000..de20feb --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/modules/ietf-inet-types.yang @@ -0,0 +1,418 @@ + module ietf-inet-types { + + namespace "urn:ietf:params:xml:ns:yang:ietf-inet-types"; + prefix "inet"; + + organization + "IETF NETMOD (NETCONF Data Modeling Language) Working Group"; + + contact + "WG Web: <http://tools.ietf.org/wg/netmod/> + WG List: <mailto:netmod@ietf.org> + + WG Chair: David Partain + <mailto:david.partain@ericsson.com> + + WG Chair: David Kessens + <mailto:david.kessens@nsn.com> + + Editor: Juergen Schoenwaelder + <mailto:j.schoenwaelder@jacobs-university.de>"; + + description + "This module contains a collection of generally useful derived + YANG data types for Internet addresses and related things. + + Copyright (c) 2010 IETF Trust and the persons identified as + authors of the code. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, is permitted pursuant to, and subject to the license + terms contained in, the Simplified BSD License set forth in Section + 4.c of the IETF Trust's Legal Provisions Relating to IETF Documents + (http://trustee.ietf.org/license-info). + + This version of this YANG module is part of RFC 6021; see + the RFC itself for full legal notices."; + + revision 2010-09-24 { + description + "Initial revision."; + reference + "RFC 6021: Common YANG Data Types"; + } + + /*** collection of protocol field related types ***/ + + typedef ip-version { + type enumeration { + enum unknown { + value "0"; + description + "An unknown or unspecified version of the Internet protocol."; + } + enum ipv4 { + value "1"; + description + "The IPv4 protocol as defined in RFC 791."; + } + enum ipv6 { + value "2"; + description + "The IPv6 protocol as defined in RFC 2460."; + } + } + description + "This value represents the version of the IP protocol. + + In the value set and its semantics, this type is equivalent + to the InetVersion textual convention of the SMIv2."; + reference + "RFC 791: Internet Protocol + RFC 2460: Internet Protocol, Version 6 (IPv6) Specification + RFC 4001: Textual Conventions for Internet Network Addresses"; + } + + typedef dscp { + type uint8 { + range "0..63"; + } + description + "The dscp type represents a Differentiated Services Code-Point + that may be used for marking packets in a traffic stream. + + In the value set and its semantics, this type is equivalent + to the Dscp textual convention of the SMIv2."; + reference + "RFC 3289: Management Information Base for the Differentiated + Services Architecture + RFC 2474: Definition of the Differentiated Services Field + (DS Field) in the IPv4 and IPv6 Headers + RFC 2780: IANA Allocation Guidelines For Values In + the Internet Protocol and Related Headers"; + } + + typedef ipv6-flow-label { + type uint32 { + range "0..1048575"; + } + description + "The flow-label type represents flow identifier or Flow Label + in an IPv6 packet header that may be used to discriminate + traffic flows. + + In the value set and its semantics, this type is equivalent + to the IPv6FlowLabel textual convention of the SMIv2."; + reference + "RFC 3595: Textual Conventions for IPv6 Flow Label + RFC 2460: Internet Protocol, Version 6 (IPv6) Specification"; + } + + typedef port-number { + type uint16 { + range "0..65535"; + } + description + "The port-number type represents a 16-bit port number of an + Internet transport layer protocol such as UDP, TCP, DCCP, or + SCTP. Port numbers are assigned by IANA. A current list of + all assignments is available from <http://www.iana.org/>. + + Note that the port number value zero is reserved by IANA. In + situations where the value zero does not make sense, it can + be excluded by subtyping the port-number type. + + In the value set and its semantics, this type is equivalent + to the InetPortNumber textual convention of the SMIv2."; + reference + "RFC 768: User Datagram Protocol + RFC 793: Transmission Control Protocol + RFC 4960: Stream Control Transmission Protocol + RFC 4340: Datagram Congestion Control Protocol (DCCP) + RFC 4001: Textual Conventions for Internet Network Addresses"; + } + + /*** collection of autonomous system related types ***/ + + typedef as-number { + type uint32; + description + "The as-number type represents autonomous system numbers + which identify an Autonomous System (AS). An AS is a set + of routers under a single technical administration, using + an interior gateway protocol and common metrics to route + packets within the AS, and using an exterior gateway + protocol to route packets to other ASs'. IANA maintains + the AS number space and has delegated large parts to the + regional registries. + + Autonomous system numbers were originally limited to 16 + bits. BGP extensions have enlarged the autonomous system + number space to 32 bits. This type therefore uses an uint32 + base type without a range restriction in order to support + a larger autonomous system number space. + + In the value set and its semantics, this type is equivalent + to the InetAutonomousSystemNumber textual convention of + the SMIv2."; + reference + "RFC 1930: Guidelines for creation, selection, and registration + of an Autonomous System (AS) + RFC 4271: A Border Gateway Protocol 4 (BGP-4) + RFC 4893: BGP Support for Four-octet AS Number Space + RFC 4001: Textual Conventions for Internet Network Addresses"; + } + + /*** collection of IP address and hostname related types ***/ + + typedef ip-address { + type union { + type inet:ipv4-address; + type inet:ipv6-address; + } + description + "The ip-address type represents an IP address and is IP + version neutral. The format of the textual representations + implies the IP version."; + } + + typedef ipv4-address { + type string { + 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])' + + '(%[\p{N}\p{L}]+)?'; + } + description + "The ipv4-address type represents an IPv4 address in + dotted-quad notation. The IPv4 address may include a zone + index, separated by a % sign. + + The zone index is used to disambiguate identical address + values. For link-local addresses, the zone index will + typically be the interface index number or the name of an + interface. If the zone index is not present, the default + zone of the device will be used. + + The canonical format for the zone index is the numerical + format"; + } + + typedef ipv6-address { + type string { + pattern '((:|[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}]+)?'; + pattern '(([^:]+:){6}(([^:]+:[^:]+)|(.*\..*)))|' + + '((([^:]+:)*[^:]+)?::(([^:]+:)*[^:]+)?)' + + '(%.+)?'; + } + description + "The ipv6-address type represents an IPv6 address in full, + mixed, shortened, and shortened-mixed notation. The IPv6 + address may include a zone index, separated by a % sign. + + The zone index is used to disambiguate identical address + values. For link-local addresses, the zone index will + typically be the interface index number or the name of an + interface. If the zone index is not present, the default + zone of the device will be used. + + The canonical format of IPv6 addresses uses the compressed + format described in RFC 4291, Section 2.2, item 2 with the + following additional rules: the :: substitution must be + applied to the longest sequence of all-zero 16-bit chunks + in an IPv6 address. If there is a tie, the first sequence + of all-zero 16-bit chunks is replaced by ::. Single + all-zero 16-bit chunks are not compressed. The canonical + format uses lowercase characters and leading zeros are + not allowed. The canonical format for the zone index is + the numerical format as described in RFC 4007, Section + 11.2."; + reference + "RFC 4291: IP Version 6 Addressing Architecture + RFC 4007: IPv6 Scoped Address Architecture + RFC 5952: A Recommendation for IPv6 Address Text Representation"; + } + + typedef ip-prefix { + type union { + type inet:ipv4-prefix; + type inet:ipv6-prefix; + } + description + "The ip-prefix type represents an IP prefix and is IP + version neutral. The format of the textual representations + implies the IP version."; + } + + typedef ipv4-prefix { + type string { + 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])' + + '/(([0-9])|([1-2][0-9])|(3[0-2]))'; + } + description + "The ipv4-prefix type represents an IPv4 address prefix. + The prefix length is given by the number following the + slash character and must be less than or equal to 32. + + A prefix length value of n corresponds to an IP address + mask that has n contiguous 1-bits from the most + significant bit (MSB) and all other bits set to 0. + + The canonical format of an IPv4 prefix has all bits of + the IPv4 address set to zero that are not part of the + IPv4 prefix."; + } + + typedef ipv6-prefix { + type string { + pattern '((:|[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])))'; + pattern '(([^:]+:){6}(([^:]+:[^:]+)|(.*\..*)))|' + + '((([^:]+:)*[^:]+)?::(([^:]+:)*[^:]+)?)' + + '(/.+)'; + } + description + "The ipv6-prefix type represents an IPv6 address prefix. + The prefix length is given by the number following the + slash character and must be less than or equal 128. + + A prefix length value of n corresponds to an IP address + mask that has n contiguous 1-bits from the most + significant bit (MSB) and all other bits set to 0. + + The IPv6 address should have all bits that do not belong + to the prefix set to zero. + + The canonical format of an IPv6 prefix has all bits of + the IPv6 address set to zero that are not part of the + IPv6 prefix. Furthermore, IPv6 address is represented + in the compressed format described in RFC 4291, Section + 2.2, item 2 with the following additional rules: the :: + substitution must be applied to the longest sequence of + all-zero 16-bit chunks in an IPv6 address. If there is + a tie, the first sequence of all-zero 16-bit chunks is + replaced by ::. Single all-zero 16-bit chunks are not + compressed. The canonical format uses lowercase + characters and leading zeros are not allowed."; + reference + "RFC 4291: IP Version 6 Addressing Architecture"; + } + + /*** collection of domain name and URI types ***/ + + typedef domain-name { + type string { + pattern '((([a-zA-Z0-9_]([a-zA-Z0-9\-_]){0,61})?[a-zA-Z0-9]\.)*' + + '([a-zA-Z0-9_]([a-zA-Z0-9\-_]){0,61})?[a-zA-Z0-9]\.?)' + + '|\.'; + length "1..253"; + } + description + "The domain-name type represents a DNS domain name. The + name SHOULD be fully qualified whenever possible. + + Internet domain names are only loosely specified. Section + 3.5 of RFC 1034 recommends a syntax (modified in Section + 2.1 of RFC 1123). The pattern above is intended to allow + for current practice in domain name use, and some possible + future expansion. It is designed to hold various types of + domain names, including names used for A or AAAA records + (host names) and other records, such as SRV records. Note + that Internet host names have a stricter syntax (described + in RFC 952) than the DNS recommendations in RFCs 1034 and + 1123, and that systems that want to store host names in + schema nodes using the domain-name type are recommended to + adhere to this stricter standard to ensure interoperability. + + The encoding of DNS names in the DNS protocol is limited + to 255 characters. Since the encoding consists of labels + prefixed by a length bytes and there is a trailing NULL + byte, only 253 characters can appear in the textual dotted + notation. + + The description clause of schema nodes using the domain-name + type MUST describe when and how these names are resolved to + IP addresses. Note that the resolution of a domain-name value + may require to query multiple DNS records (e.g., A for IPv4 + and AAAA for IPv6). The order of the resolution process and + which DNS record takes precedence can either be defined + explicitely or it may depend on the configuration of the + resolver. + + Domain-name values use the US-ASCII encoding. Their canonical + format uses lowercase US-ASCII characters. Internationalized + domain names MUST be encoded in punycode as described in RFC + 3492"; + reference + "RFC 952: DoD Internet Host Table Specification + RFC 1034: Domain Names - Concepts and Facilities + RFC 1123: Requirements for Internet Hosts -- Application + and Support + RFC 2782: A DNS RR for specifying the location of services + (DNS SRV) + RFC 3492: Punycode: A Bootstring encoding of Unicode for + Internationalized Domain Names in Applications + (IDNA) + RFC 5891: Internationalizing Domain Names in Applications + (IDNA): Protocol"; + } + + typedef host { + type union { + type inet:ip-address; + type inet:domain-name; + } + description + "The host type represents either an IP address or a DNS + domain name."; + } + + typedef uri { + type string; + description + "The uri type represents a Uniform Resource Identifier + (URI) as defined by STD 66. + + Objects using the uri type MUST be in US-ASCII encoding, + and MUST be normalized as described by RFC 3986 Sections + 6.2.1, 6.2.2.1, and 6.2.2.2. All unnecessary + percent-encoding is removed, and all case-insensitive + characters are set to lowercase except for hexadecimal + digits, which are normalized to uppercase as described in + Section 6.2.2.1. + + The purpose of this normalization is to help provide + unique URIs. Note that this normalization is not + sufficient to provide uniqueness. Two URIs that are + textually distinct after this normalization may still be + equivalent. + + Objects using the uri type may restrict the schemes that + they permit. For example, 'data:' and 'urn:' schemes + might not be appropriate. + + A zero-length URI is not a valid URI. This can be used to + express 'URI absent' where required. + + In the value set and its semantics, this type is equivalent + to the Uri SMIv2 textual convention defined in RFC 5017."; + reference + "RFC 3986: Uniform Resource Identifier (URI): Generic Syntax + RFC 3305: Report from the Joint W3C/IETF URI Planning Interest + Group: Uniform Resource Identifiers (URIs), URLs, + and Uniform Resource Names (URNs): Clarifications + and Recommendations + RFC 5017: MIB Textual Conventions for Uniform Resource + Identifiers (URIs)"; + } + + } diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/modules/ietf-interfaces@2013-07-04.yang b/netconf/restconf/restconf-nb-bierman02/src/test/resources/modules/ietf-interfaces@2013-07-04.yang new file mode 100644 index 0000000..9db753c --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/modules/ietf-interfaces@2013-07-04.yang @@ -0,0 +1,673 @@ +module ietf-interfaces { + + namespace "urn:ietf:params:xml:ns:yang:ietf-interfaces"; + prefix if; + + import ietf-yang-types { + prefix yang; + } + import iana-if-type { + prefix ianaift; + } + + organization + "IETF NETMOD (NETCONF Data Modeling Language) Working Group"; + + contact + "WG Web: <http://tools.ietf.org/wg/netmod/> + WG List: <mailto:netmod@ietf.org> + + WG Chair: David Kessens + <mailto:david.kessens@nsn.com> + + WG Chair: Juergen Schoenwaelder + <mailto:j.schoenwaelder@jacobs-university.de> + + Editor: Martin Bjorklund + <mailto:mbj@tail-f.com>"; + + description + "This module contains a collection of YANG definitions for + managing network interfaces. + + Copyright (c) 2013 IETF Trust and the persons identified as + authors of the code. All rights reserved. + + Redistribution and use in source and binary forms, with or + without modification, is permitted pursuant to, and subject + to the license terms contained in, the Simplified BSD License + set forth in Section 4.c of the IETF Trust's Legal Provisions + Relating to IETF Documents + (http://trustee.ietf.org/license-info). + + This version of this YANG module is part of RFC XXXX; see + the RFC itself for full legal notices."; + + // RFC Ed.: replace XXXX with actual RFC number and remove this + // note. + + // RFC Ed.: update the date below with the date of RFC publication + // and remove this note. + revision 2013-07-04 { + description + "Initial revision."; + reference + "RFC XXXX: A YANG Data Model for Interface Management"; + } + + /* Typedefs */ + + typedef interface-ref { + type leafref { + path "/if:interfaces/if:interface/if:name"; + } + description + "This type is used by data models that need to reference + configured interfaces."; + } + + typedef interface-state-ref { + type leafref { + path "/if:interfaces-state/if:interface/if:name"; + } + description + "This type is used by data models that need to reference + the operationally present interfaces."; + } + + /* Features */ + + feature arbitrary-names { + description + "This feature indicates that the device allows user-controlled + interfaces to be named arbitrarily."; + } + + feature pre-provisioning { + description + "This feature indicates that the device supports + pre-provisioning of interface configuration, i.e., it is + possible to configure an interface whose physical interface + hardware is not present on the device."; + } + + feature if-mib { + description + "This feature indicates that the device implements IF-MIB."; + reference + "RFC 2863: The Interfaces Group MIB"; + } + + /* Data nodes */ + + container interfaces { + description + "Interface configuration parameters."; + + list interface { + key "name"; + + description + "The list of configured interfaces on the device. + + The operational state of an interface is available in the + /interfaces-state/interface list. If the configuration of a + system-controlled interface cannot be used by the system + (e.g., the interface hardware present does not match the + interface type), then the configuration is not applied to + the system-controlled interface shown in the + /interfaces-state/interface list. If the the configuration + of a user-controlled interface cannot be used by the system, + the configured interface is not instantiated in the + /interfaces-state/interface list."; + + leaf name { + type string; + description + "The name of the interface. + + A device MAY restrict the allowed values for this leaf, + possibly depending on the type of the interface. + + For system-controlled interfaces, this leaf is the + device-specific name of the interface. The 'config false' + list /interfaces-state/interface contains the currently + existing interfaces on the device. + + If a client tries to create configuration for a + system-controlled interface that is not present in the + /interfaces-state/interface list, the server MAY reject + the request, if the implementation does not support + pre-provisioning of interfaces, or if the name refers to + an interface that can never exist in the system. A + NETCONF server MUST reply with an rpc-error with the + error-tag 'invalid-value' in this case. + + If the device supports pre-provisioning of interface + configuration, the feature 'pre-provisioning' is + advertised. + + If the device allows arbitrarily named user-controlled + interfaces, the feature 'arbitrary-names' is advertised. + + When a configured user-controlled interface is created by + the system, it is instantiated with the same name in the + /interface-state/interface list. Since the name in that + list MAY be mapped to ifName by an implementation, such an + implementation MUST restrict the allowed values for this + leaf so that it matches the restrictions of ifName. + + If a NETCONF server that implements this restriction is + sent a value that doesn't match the restriction, it MUST + reply with an rpc-error with the error-tag + 'invalid-value'."; + } + + leaf description { + type string; + description + "A textual description of the interface. + + This leaf MAY be mapped to ifAlias by an implementation. + Such an implementation MUST restrict the allowed values + for this leaf so that it matches the restrictions of + ifAlias. + + If a NETCONF server that implements this restriction is + sent a value that doesn't match the restriction, it MUST + reply with an rpc-error with the error-tag + 'invalid-value'. + + Since ifAlias is defined to be stored in non-volatile + storage, the MIB implementation MUST map ifAlias to the + value of 'description' in the persistently stored + datastore. + + Specifically, if the device supports ':startup', when + ifAlias is read the device MUST return the value of + 'description' in the 'startup' datastore, and when it is + written, it MUST be written to the 'running' and 'startup' + datastores. Note that it is up to the implementation if + it modifies this single leaf in 'startup', or if it + performs an implicit copy-config from 'running' to + 'startup'. + + If the device does not support ':startup', ifAlias MUST + be mapped to the 'description' leaf in the 'running' + datastore."; + reference + "RFC 2863: The Interfaces Group MIB - ifAlias"; + } + + leaf type { + type ianaift:iana-if-type; + mandatory true; + description + "The type of the interface. + + When an interface entry is created, a server MAY + initialize the type leaf with a valid value, e.g., if it + is possible to derive the type from the name of the + interface. + + If a client tries to set the type of an interface to a + value that can never be used by the system, e.g., if the + type is not supported or if the type does not match the + name of the interface, the server MUST reject the request. + A NETCONF server MUST reply with an rpc-error with the + error-tag 'invalid-value' in this case."; + reference + "RFC 2863: The Interfaces Group MIB - ifType"; + } + + leaf enabled { + type boolean; + default "true"; + description + "This leaf contains the configured, desired state of the + interface. + + Systems that implement the IF-MIB use the value of this + leaf in the 'running' datastore to set + IF-MIB.ifAdminStatus to 'up' or 'down' after an ifEntry + has been initialized, as described in RFC 2863. + + Changes in this leaf in the 'running' datastore are + reflected in ifAdminStatus, but if ifAdminStatus is + changed over SNMP, this leaf is not affected."; + reference + "RFC 2863: The Interfaces Group MIB - ifAdminStatus"; + } + + leaf link-up-down-trap-enable { + if-feature if-mib; + type enumeration { + enum enabled { + value 1; + } + enum disabled { + value 2; + } + } + description + "Controls whether linkUp/linkDown SNMP notifications + should be generated for this interface. + + If this node is not configured, the value 'enabled' is + operationally used by the server for interfaces which do + not operate on top of any other interface (i.e., there are + no 'lower-layer-if' entries), and 'disabled' otherwise."; + reference + "RFC 2863: The Interfaces Group MIB - + ifLinkUpDownTrapEnable"; + } + } + } + + container interfaces-state { + config false; + description + "Data nodes for the operational state of interfaces."; + + list interface { + key "name"; + + description + "The list of interfaces on the device. + + System-controlled interfaces created by the system are + always present in this list, whether they are configured or + not."; + + leaf name { + type string; + description + "The name of the interface. + + This leaf MAY be mapped to ifName by an implementation."; + reference + "RFC 2863: The Interfaces Group MIB - ifName"; + } + + leaf type { + type ianaift:iana-if-type; + mandatory true; + description + "The type of the interface."; + reference + "RFC 2863: The Interfaces Group MIB - ifType"; + } + + leaf admin-status { + if-feature if-mib; + type enumeration { + enum up { + value 1; + description + "Ready to pass packets."; + } + enum down { + value 2; + description + "Not ready to pass packets and not in some test mode."; + } + enum testing { + value 3; + description + "In some test mode."; + } + } + mandatory true; + description + "The desired state of the interface. + + This leaf has the same read semantics as ifAdminStatus."; + reference + "RFC 2863: The Interfaces Group MIB - ifAdminStatus"; + } + + leaf oper-status { + type enumeration { + enum up { + value 1; + description + "Ready to pass packets."; + } + enum down { + value 2; + description + "The interface does not pass any packets."; + } + enum testing { + value 3; + description + "In some test mode. No operational packets can + be passed."; + } + enum unknown { + value 4; + description + "Status cannot be determined for some reason."; + } + enum dormant { + value 5; + description + "Waiting for some external event."; + } + enum not-present { + value 6; + description + "Some component (typically hardware) is missing."; + } + enum lower-layer-down { + value 7; + description + "Down due to state of lower-layer interface(s)."; + } + } + mandatory true; + description + "The current operational state of the interface. + + This leaf has the same semantics as ifOperStatus."; + reference + "RFC 2863: The Interfaces Group MIB - ifOperStatus"; + } + + leaf last-change { + type yang:date-and-time; + description + "The time the interface entered its current operational + state. If the current state was entered prior to the + last re-initialization of the local network management + subsystem, then this node is not present."; + reference + "RFC 2863: The Interfaces Group MIB - ifLastChange"; + } + + leaf if-index { + if-feature if-mib; + type int32 { + range "1..2147483647"; + } + mandatory true; + description + "The ifIndex value for the ifEntry represented by this + interface."; + reference + "RFC 2863: The Interfaces Group MIB - ifIndex"; + } + + leaf phys-address { + type yang:phys-address; + description + "The interface's address at its protocol sub-layer. For + example, for an 802.x interface, this object normally + contains a MAC address. The interface's media-specific + modules must define the bit and byte ordering and the + format of the value of this object. For interfaces that do + not have such an address (e.g., a serial line), this node + is not present."; + reference + "RFC 2863: The Interfaces Group MIB - ifPhysAddress"; + } + + leaf-list higher-layer-if { + type interface-state-ref; + description + "A list of references to interfaces layered on top of this + interface."; + reference + "RFC 2863: The Interfaces Group MIB - ifStackTable"; + } + + leaf-list lower-layer-if { + type interface-state-ref; + description + "A list of references to interfaces layered underneath this + interface."; + reference + "RFC 2863: The Interfaces Group MIB - ifStackTable"; + } + + leaf speed { + type yang:gauge64; + units "bits / second"; + description + "An estimate of the interface's current bandwidth in bits + per second. For interfaces that do not vary in + bandwidth or for those where no accurate estimation can + be made, this node should contain the nominal bandwidth. + For interfaces that have no concept of bandwidth, this + node is not present."; + reference + "RFC 2863: The Interfaces Group MIB - + ifSpeed, ifHighSpeed"; + } + + container statistics { + description + "A collection of interface-related statistics objects."; + + leaf discontinuity-time { + type yang:date-and-time; + mandatory true; + description + "The time on the most recent occasion at which any one or + more of this interface's counters suffered a + discontinuity. If no such discontinuities have occurred + since the last re-initialization of the local management + subsystem, then this node contains the time the local + management subsystem re-initialized itself."; + } + + leaf in-octets { + type yang:counter64; + description + "The total number of octets received on the interface, + including framing characters. + + Discontinuities in the value of this counter can occur + at re-initialization of the management system, and at + other times as indicated by the value of + 'discontinuity-time'."; + reference + "RFC 2863: The Interfaces Group MIB - ifHCInOctets"; + } + leaf in-unicast-pkts { + type yang:counter64; + description + "The number of packets, delivered by this sub-layer to a + higher (sub-)layer, which were not addressed to a + multicast or broadcast address at this sub-layer. + + Discontinuities in the value of this counter can occur + at re-initialization of the management system, and at + other times as indicated by the value of + 'discontinuity-time'."; + reference + "RFC 2863: The Interfaces Group MIB - ifHCInUcastPkts"; + } + leaf in-broadcast-pkts { + type yang:counter64; + description + "The number of packets, delivered by this sub-layer to a + higher (sub-)layer, which were addressed to a broadcast + address at this sub-layer. + + Discontinuities in the value of this counter can occur + at re-initialization of the management system, and at + other times as indicated by the value of + 'discontinuity-time'."; + reference + "RFC 2863: The Interfaces Group MIB - + ifHCInBroadcastPkts"; + } + leaf in-multicast-pkts { + type yang:counter64; + description + "The number of packets, delivered by this sub-layer to a + higher (sub-)layer, which were addressed to a multicast + address at this sub-layer. For a MAC layer protocol, + this includes both Group and Functional addresses. + + Discontinuities in the value of this counter can occur + at re-initialization of the management system, and at + other times as indicated by the value of + 'discontinuity-time'."; + reference + "RFC 2863: The Interfaces Group MIB - + ifHCInMulticastPkts"; + } + leaf in-discards { + type yang:counter32; + description + "The number of inbound packets which were chosen to be + discarded even though no errors had been detected to + prevent their being deliverable to a higher-layer + protocol. One possible reason for discarding such a + packet could be to free up buffer space. + + Discontinuities in the value of this counter can occur + at re-initialization of the management system, and at + other times as indicated by the value of + 'discontinuity-time'."; + reference + "RFC 2863: The Interfaces Group MIB - ifInDiscards"; + } + leaf in-errors { + type yang:counter32; + description + "For packet-oriented interfaces, the number of inbound + packets that contained errors preventing them from being + deliverable to a higher-layer protocol. For character- + oriented or fixed-length interfaces, the number of + inbound transmission units that contained errors + preventing them from being deliverable to a higher-layer + protocol. + + Discontinuities in the value of this counter can occur + at re-initialization of the management system, and at + other times as indicated by the value of + 'discontinuity-time'."; + reference + "RFC 2863: The Interfaces Group MIB - ifInErrors"; + } + leaf in-unknown-protos { + type yang:counter32; + description + "For packet-oriented interfaces, the number of packets + received via the interface which were discarded because + of an unknown or unsupported protocol. For + character-oriented or fixed-length interfaces that + support protocol multiplexing the number of transmission + units received via the interface which were discarded + because of an unknown or unsupported protocol. For any + interface that does not support protocol multiplexing, + this counter is not present. + Discontinuities in the value of this counter can occur + at re-initialization of the management system, and at + other times as indicated by the value of + 'discontinuity-time'."; + reference + "RFC 2863: The Interfaces Group MIB - ifInUnknownProtos"; + } + + leaf out-octets { + type yang:counter64; + description + "The total number of octets transmitted out of the + interface, including framing characters. + + Discontinuities in the value of this counter can occur + at re-initialization of the management system, and at + other times as indicated by the value of + 'discontinuity-time'."; + reference + "RFC 2863: The Interfaces Group MIB - ifHCOutOctets"; + } + leaf out-unicast-pkts { + type yang:counter64; + description + "The total number of packets that higher-level protocols + requested be transmitted, and which were not addressed + to a multicast or broadcast address at this sub-layer, + including those that were discarded or not sent. + + Discontinuities in the value of this counter can occur + at re-initialization of the management system, and at + other times as indicated by the value of + 'discontinuity-time'."; + reference + "RFC 2863: The Interfaces Group MIB - ifHCOutUcastPkts"; + } + leaf out-broadcast-pkts { + type yang:counter64; + description + "The total number of packets that higher-level protocols + requested be transmitted, and which were addressed to a + broadcast address at this sub-layer, including those + that were discarded or not sent. + + Discontinuities in the value of this counter can occur + at re-initialization of the management system, and at + other times as indicated by the value of + 'discontinuity-time'."; + reference + "RFC 2863: The Interfaces Group MIB - + ifHCOutBroadcastPkts"; + } + leaf out-multicast-pkts { + type yang:counter64; + description + "The total number of packets that higher-level protocols + requested be transmitted, and which were addressed to a + multicast address at this sub-layer, including those + that were discarded or not sent. For a MAC layer + protocol, this includes both Group and Functional + addresses. + + Discontinuities in the value of this counter can occur + at re-initialization of the management system, and at + other times as indicated by the value of + 'discontinuity-time'."; + reference + "RFC 2863: The Interfaces Group MIB - + ifHCOutMulticastPkts"; + } + leaf out-discards { + type yang:counter32; + description + "The number of outbound packets which were chosen to be + discarded even though no errors had been detected to + prevent their being transmitted. One possible reason + for discarding such a packet could be to free up buffer + space. + + Discontinuities in the value of this counter can occur + at re-initialization of the management system, and at + other times as indicated by the value of + 'discontinuity-time'."; + reference + "RFC 2863: The Interfaces Group MIB - ifOutDiscards"; + } + leaf out-errors { + type yang:counter32; + description + "For packet-oriented interfaces, the number of outbound + packets that could not be transmitted because of errors. + For character-oriented or fixed-length interfaces, the + number of outbound transmission units that could not be + transmitted because of errors. + + Discontinuities in the value of this counter can occur + at re-initialization of the management system, and at + other times as indicated by the value of + 'discontinuity-time'."; + reference + "RFC 2863: The Interfaces Group MIB - ifOutErrors"; + } + } + } + } +}
\ No newline at end of file diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/modules/ietf-restconf-monitoring@2017-01-26.yang b/netconf/restconf/restconf-nb-bierman02/src/test/resources/modules/ietf-restconf-monitoring@2017-01-26.yang new file mode 100644 index 0000000..55c3cb1 --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/modules/ietf-restconf-monitoring@2017-01-26.yang @@ -0,0 +1,149 @@ +module ietf-restconf-monitoring { + namespace "urn:ietf:params:xml:ns:yang:ietf-restconf-monitoring"; + prefix "rcmon"; + + import ietf-yang-types { prefix yang; } + import ietf-inet-types { prefix inet; } + + organization + "IETF NETCONF (Network Configuration) Working Group"; + + contact + "WG Web: <https://datatracker.ietf.org/wg/netconf/> + WG List: <mailto:netconf@ietf.org> + + Author: Andy Bierman + <mailto:andy@yumaworks.com> + + Author: Martin Bjorklund + <mailto:mbj@tail-f.com> + + Author: Kent Watsen + <mailto:kwatsen@juniper.net>"; + + description + "This module contains monitoring information for the + RESTCONF protocol. + + Copyright (c) 2017 IETF Trust and the persons identified as + authors of the code. All rights reserved. + + Redistribution and use in source and binary forms, with or + without modification, is permitted pursuant to, and subject + to the license terms contained in, the Simplified BSD License + set forth in Section 4.c of the IETF Trust's Legal Provisions + Relating to IETF Documents + (http://trustee.ietf.org/license-info). + + This version of this YANG module is part of RFC 8040; see + the RFC itself for full legal notices."; + + revision 2017-01-26 { + description + "Initial revision."; + reference + "RFC 8040: RESTCONF Protocol."; + } + + container restconf-state { + config false; + description + "Contains RESTCONF protocol monitoring information."; + + container capabilities { + description + "Contains a list of protocol capability URIs."; + + leaf-list capability { + type inet:uri; + description + "A RESTCONF protocol capability URI."; + } + } + + container streams { + description + "Container representing the notification event streams + supported by the server."; + reference + "RFC 5277, Section 3.4, <streams> element."; + + list stream { + key name; + description + "Each entry describes an event stream supported by + the server."; + + leaf name { + type string; + description + "The stream name."; + reference + "RFC 5277, Section 3.4, <name> element."; + } + + leaf description { + type string; + description + "Description of stream content."; + reference + "RFC 5277, Section 3.4, <description> element."; + } + + leaf replay-support { + type boolean; + default false; + description + "Indicates if replay buffer is supported for this stream. + If 'true', then the server MUST support the 'start-time' + and 'stop-time' query parameters for this stream."; + reference + "RFC 5277, Section 3.4, <replaySupport> element."; + } + + leaf replay-log-creation-time { + when "../replay-support" { + description + "Only present if notification replay is supported."; + } + type yang:date-and-time; + description + "Indicates the time the replay log for this stream + was created."; + reference + "RFC 5277, Section 3.4, <replayLogCreationTime> + element."; + } + + list access { + key encoding; + min-elements 1; + description + "The server will create an entry in this list for each + encoding format that is supported for this stream. + The media type 'text/event-stream' is expected + for all event streams. This list identifies the + subtypes supported for this stream."; + + leaf encoding { + type string; + description + "This is the secondary encoding format within the + 'text/event-stream' encoding used by all streams. + The type 'xml' is supported for XML encoding. + The type 'json' is supported for JSON encoding."; + } + + leaf location { + type inet:uri; + mandatory true; + description + "Contains a URL that represents the entry point + for establishing notification delivery via + server-sent events."; + } + } + } + } + } +} diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/modules/ietf-restconf@2013-10-19.yang b/netconf/restconf/restconf-nb-bierman02/src/test/resources/modules/ietf-restconf@2013-10-19.yang new file mode 100644 index 0000000..16766b0 --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/modules/ietf-restconf@2013-10-19.yang @@ -0,0 +1,684 @@ +module ietf-restconf { + namespace "urn:ietf:params:xml:ns:yang:ietf-restconf"; + prefix "restconf"; + + import ietf-yang-types { prefix yang; } + import ietf-inet-types { prefix inet; } + + organization + "IETF NETCONF (Network Configuration) Working Group"; + + contact + "Editor: Andy Bierman + <mailto:andy@yumaworks.com> + + Editor: Martin Bjorklund + <mailto:mbj@tail-f.com> + + Editor: Kent Watsen + <mailto:kwatsen@juniper.net> + + Editor: Rex Fernando + <mailto:rex@cisco.com>"; + + description + "This module contains conceptual YANG specifications + for the YANG Patch and error content that is used in + RESTCONF protocol messages. A conceptual container + representing the RESTCONF API nodes (media type + application/yang.api). + + Note that the YANG definitions within this module do not + represent configuration data of any kind. + The YANG grouping statements provide a normative syntax + for XML and JSON message encoding purposes. + Copyright (c) 2013 IETF Trust and the persons identified as + authors of the code. All rights reserved. + + Redistribution and use in source and binary forms, with or + without modification, is permitted pursuant to, and subject + to the license terms contained in, the Simplified BSD License + set forth in Section 4.c of the IETF Trust's Legal Provisions + Relating to IETF Documents + (http://trustee.ietf.org/license-info). + + This version of this YANG module is part of RFC XXXX; see + the RFC itself for full legal notices."; + + // RFC Ed.: replace XXXX with actual RFC number and remove this + // note. + + // RFC Ed.: remove this note + // Note: extracted from draft-bierman-netconf-restconf-02.txt + + // RFC Ed.: update the date below with the date of RFC publication + // and remove this note. + revision 2013-10-19 { + description + "Initial revision."; + reference + "RFC XXXX: RESTCONF Protocol."; + } + + typedef data-resource-identifier { + type string { + length "1 .. max"; + } + description + "Contains a Data Resource Identifier formatted string + to identify a specific data node. The data node that + uses this data type SHOULD define the document root + for data resource identifiers. The default document + root is the target datastore conceptual root node. + Data resource identifiers are defined relative to + this document root."; + reference + "RFC XXXX: [sec. 5.3.1.1 ABNF For Data Resource Identifiers]"; + } + + // this typedef is TBD; not currently used + typedef datastore-identifier { + type union { + type enumeration { + enum candidate { + description + "Identifies the NETCONF shared candidate datastore."; + reference + "RFC 6241, section 8.3"; + } + enum running { + description + "Identifies the NETCONF running datastore."; + reference + "RFC 6241, section 5.1"; + } + enum startup { + description + "Identifies the NETCONF startup datastore."; + reference + "RFC 6241, section 8.7"; + } + } + type string; + } + description + "Contains a string to identify a specific datastore. + The enumerated datastore identifier values are + reserved for standard datastore names."; + } + + typedef revision-identifier { + type string { + pattern '\d{4}-\d{2}-\d{2}'; + } + description + "Represents a specific date in YYYY-MM-DD format. + TBD: make pattern more precise to exclude leading zeros."; + } + + grouping yang-patch { + description + "A grouping that contains a YANG container + representing the syntax and semantics of a + YANG Patch edit request message."; + + container yang-patch { + description + "Represents a conceptual sequence of datastore edits, + called a patch. Each patch is given a client-assigned + patch identifier. Each edit MUST be applied + in ascending order, and all edits MUST be applied. + If any errors occur, then the target datastore MUST NOT + be changed by the patch operation. + + A patch MUST be validated by the server to be a + well-formed message before any of the patch edits + are validated or attempted. + + YANG datastore validation (defined in RFC 6020, section + 8.3.3) is performed after all edits have been + individually validated. + + It is possible for a datastore constraint violation to occur + due to any node in the datastore, including nodes not + included in the edit list. Any validation errors MUST + be reported in the reply message."; + + reference + "RFC 6020, section 8.3."; + + leaf patch-id { + type string; + description + "An arbitrary string provided by the client to identify + the entire patch. This value SHOULD be present in any + audit logging records generated by the server for the + patch. Error messages returned by the server pertaining + to this patch will be identified by this patch-id value."; + } + + leaf comment { + type string { + length "0 .. 1024"; + } + description + "An arbitrary string provided by the client to describe + the entire patch. This value SHOULD be present in any + audit logging records generated by the server for the + patch."; + } + + list edit { + key edit-id; + ordered-by user; + + description + "Represents one edit within the YANG Patch + request message."; + leaf edit-id { + type string; + description + "Arbitrary string index for the edit. + Error messages returned by the server pertaining + to a specific edit will be identified by this + value."; + } + + leaf operation { + type enumeration { + enum create { + description + "The target data node is created using the + supplied value, only if it does not already + exist."; + } + enum delete { + description + "Delete the target node, only if the data resource + currently exists, otherwise return an error."; + } + enum insert { + description + "Insert the supplied value into a user-ordered + list or leaf-list entry. The target node must + represent a new data resource."; + } + enum merge { + description + "The supplied value is merged with the target data + node."; + } + enum move { + description + "Move the target node. Reorder a user-ordered + list or leaf-list. The target node must represent + an existing data resource."; + } + enum replace { + description + "The supplied value is used to replace the target + data node."; + } + enum remove { + description + "Delete the target node if it currently exists."; + } + } + mandatory true; + description + "The datastore operation requested for the associated + edit entry"; + } + + leaf target { + type data-resource-identifier; + mandatory true; + description + "Identifies the target data resource for the edit + operation."; + } + + leaf point { + when "(../operation = 'insert' or " + + "../operation = 'move') and " + + "(../where = 'before' or ../where = 'after')" { + description + "Point leaf only applies for insert or move + operations, before or after an existing entry."; + } + type data-resource-identifier; + description + "The absolute URL path for the data node that is being + used as the insertion point or move point for the + target of this edit entry."; + } + + leaf where { + when "../operation = 'insert' or ../operation = 'move'" { + description + "Where leaf only applies for insert or move + operations."; + } + type enumeration { + enum before { + description + "Insert or move a data node before the data resource + identified by the 'point' parameter."; + } + enum after { + description + "Insert or move a data node after the data resource + identified by the 'point' parameter."; + } + enum first { + description + "Insert or move a data node so it becomes ordered + as the first entry."; + } + enum last { + description + "Insert or move a data node so it becomes ordered + as the last entry."; + } + + } + default last; + description + "Identifies where a data resource will be inserted or + moved. YANG only allows these operations for + list and leaf-list data nodes that are ordered-by + user."; + } + + anyxml value { + when "(../operation = 'create' or " + + "../operation = 'merge' " + + "or ../operation = 'replace' or " + + "../operation = 'insert')" { + description + "Value node only used for create, merge, + replace, and insert operations"; + } + description + "Value used for this edit operation."; + } + } + } + + } // grouping yang-patch + + + grouping yang-patch-status { + + description + "A grouping that contains a YANG container + representing the syntax and semantics of + YANG Patch status response message."; + + container yang-patch-status { + description + "A container representing the response message + sent by the server after a YANG Patch edit + request message has been processed."; + + leaf patch-id { + type string; + description + "The patch-id value used in the request"; + } + + choice global-status { + description + "Report global errors or complete success. + If there is no case selected then errors + are reported in the edit-status container."; + + case global-errors { + uses errors; + description + "This container will be present if global + errors unrelated to a specific edit occurred."; + } + leaf ok { + type empty; + description + "This leaf will be present if the request succeeded + and there are no errors reported in the edit-status + container."; + } + } + + container edit-status { + description + "This container will be present if there are + edit-specific status responses to report."; + + list edit { + key edit-id; + + description + "Represents a list of status responses, + corresponding to edits in the YANG Patch + request message. If an edit entry was + skipped or not reached by the server, + then this list will not contain a corresponding + entry for that edit."; + + leaf edit-id { + type string; + description + "Response status is for the edit list entry + with this edit-id value."; + } + choice edit-status-choice { + description + "A choice between different types of status + responses for each edit entry."; + leaf ok { + type empty; + description + "This edit entry was invoked without any + errors detected by the server associated + with this edit."; + } + leaf location { + type inet:uri; + description + "Contains the Location header value that would be + returned if this edit causes a new resource to be + created. If the edit identified by the same edit-id + value was successfully invoked and a new resource + was created, then this field will be returned + instead of 'ok'."; + } + case errors { + uses errors; + description + "The server detected errors associated with the + edit identified by the same edit-id value."; + } + } + } + } + } + } // grouping yang-patch-status + + + grouping errors { + + description + "A grouping that contains a YANG container + representing the syntax and semantics of a + YANG Patch errors report within a response message."; + + container errors { + config false; // needed so list error does not need a key + description + "Represents an error report returned by the server if + a request results in an error."; + + list error { + description + "An entry containing information about one + specific error that occurred while processing + a RESTCONF request."; + reference "RFC 6241, Section 4.3"; + + leaf error-type { + type enumeration { + enum transport { + description "The transport layer"; + } + enum rpc { + description "The rpc or notification layer"; + } + enum protocol { + description "The protocol operation layer"; + } + enum application { + description "The server application layer"; + } + } + mandatory true; + description + "The protocol layer where the error occurred."; + } + + leaf error-tag { + type string; + mandatory true; + description + "The enumerated error tag."; + } + + leaf error-app-tag { + type string; + description + "The application-specific error tag."; + } + + leaf error-path { + type data-resource-identifier; + description + "The target data resource identifier associated + with the error, if any."; + } + leaf error-message { + type string; + description + "A message describing the error."; + } + + container error-info { + description + "A container allowing additional information + to be included in the error report."; + // arbitrary anyxml content here + } + } + } + } // grouping errors + + + grouping restconf { + + description + "A grouping that contains a YANG container + representing the syntax and semantics of + the RESTCONF API resource."; + + container restconf { + description + "Conceptual container representing the + application/yang.api resource type."; + + container config { + description + "Container representing the application/yang.datastore + resource type. Represents the conceptual root of the + unified configuration datastore containing YANG data + nodes. The child nodes of this container are + configuration data resources (application/yang.data) + defined as top-level YANG data nodes from the modules + advertised by the server in /restconf/modules."; + } + + container operational { + description + "Container representing the application/yang.datastore + resource type. Represents the conceptual root of the + operational data supported by the server. The child + nodes of this container are operational data resources + (application/yang.data) defined as top-level + YANG data nodes from the modules advertised by + the server in /restconf/modules."; + } + + container modules { + description + "Contains a list of module description entries. + These modules are currently loaded into the server."; + + list module { + key "name revision"; + description + "Each entry represents one module currently + supported by the server."; + + leaf name { + type yang:yang-identifier; + description "The YANG module name."; + } + leaf revision { + type union { + type revision-identifier; + type string { length 0; } + } + description + "The YANG module revision date. An empty string is + used if no revision statement is present in the + YANG module."; + } + leaf namespace { + type inet:uri; + mandatory true; + description + "The XML namespace identifier for this module."; + } + leaf-list feature { + type yang:yang-identifier; + description + "List of YANG feature names from this module that are + supported by the server."; + } + leaf-list deviation { + type yang:yang-identifier; + description + "List of YANG deviation module names used by this + server to modify the conformance of the module + associated with this entry."; + } + } + } + + container operations { + description + "Container for all operation resources + (application/yang.operation), + + Each resource is represented as an empty leaf with the + name of the RPC operation from the YANG rpc statement. + + E.g.; + + POST /restconf/operations/show-log-errors + + leaf show-log-errors { + type empty; + } + "; + } + + container streams { + description + "Container representing the notification event streams + supported by the server."; + reference + "RFC 5277, Section 3.4, <streams> element."; + + list stream { + key name; + description + "Each entry describes an event stream supported by + the server."; + + leaf name { + type string; + description "The stream name"; + reference "RFC 5277, Section 3.4, <name> element."; + } + + leaf description { + type string; + description "Description of stream content"; + reference + "RFC 5277, Section 3.4, <description> element."; + } + + leaf replay-support { + type boolean; + description + "Indicates if replay buffer supported for this stream"; + reference + "RFC 5277, Section 3.4, <replaySupport> element."; + } + + leaf replay-log-creation-time { + type yang:date-and-time; + description + "Indicates the time the replay log for this stream + was created."; + reference + "RFC 5277, Section 3.4, <replayLogCreationTime> + element."; + } + + leaf events { + type empty; + description + "Represents the entry point for establishing + notification delivery via server sent events."; + } + } + } + + leaf version { + type enumeration { + enum "1.0" { + description + "Version 1.0 of the RESTCONF protocol."; + } + } + config false; + description + "Contains the RESTCONF protocol version."; + } + } + } // grouping restconf + + + grouping notification { + description + "Contains the notification message wrapper definition."; + + container notification { + description + "RESTCONF notification message wrapper."; + leaf event-time { + type yang:date-and-time; + mandatory true; + description + "The time the event was generated by the + event source."; + reference + "RFC 5277, section 4, <eventTime> element."; + } + + /* The YANG-specific notification container is encoded + * after the 'event-time' element. The format + * corresponds to the notificationContent element + * in RFC 5277, section 4. For example: + * + * module example-one { + * ... + * notification event1 { ... } + * + * } + * + * Encoded as element 'event1' in the namespace + * for module 'example-one'. + */ + } + } // grouping notification + + }
\ No newline at end of file diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/modules/ietf-yang-library@2016-06-21.yang b/netconf/restconf/restconf-nb-bierman02/src/test/resources/modules/ietf-yang-library@2016-06-21.yang new file mode 100644 index 0000000..bc466ee --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/modules/ietf-yang-library@2016-06-21.yang @@ -0,0 +1,208 @@ +module ietf-yang-library { + namespace "urn:ietf:params:xml:ns:yang:ietf-yang-library"; + prefix "yanglib"; + import ietf-yang-types { + prefix yang; + } + import ietf-inet-types { + prefix inet; + } + organization + "IETF NETCONF (Network Configuration) Working Group"; + contact + "WG Web: <https://datatracker.ietf.org/wg/netconf/> + WG List: <mailto:netconf@ietf.org> + WG Chair: Mehmet Ersue + <mailto:mehmet.ersue@nsn.com> + WG Chair: Mahesh Jethanandani + <mailto:mjethanandani@gmail.com> + Editor: Andy Bierman + <mailto:andy@yumaworks.com> + Editor: Martin Bjorklund + <mailto:mbj@tail-f.com> + Editor: Kent Watsen + <mailto:kwatsen@juniper.net>"; + description + "This module contains monitoring information about the YANG + modules and submodules that are used within a YANG-based + server. + Copyright (c) 2016 IETF Trust and the persons identified as + authors of the code. All rights reserved. + Redistribution and use in source and binary forms, with or + without modification, is permitted pursuant to, and subject + to the license terms contained in, the Simplified BSD License + set forth in Section 4.c of the IETF Trust's Legal Provisions + Relating to IETF Documents + (http://trustee.ietf.org/license-info). + This version of this YANG module is part of RFC 7895; see + the RFC itself for full legal notices."; + revision 2016-06-21 { + description + "Initial revision."; + reference + "RFC 7895: YANG Module Library."; + } + /* + * Typedefs + */ + typedef revision-identifier { + type string { + pattern '\d{4}-\d{2}-\d{2}'; + } + description + "Represents a specific date in YYYY-MM-DD format."; + } + /* + * Groupings + */ + grouping module-list { + description + "The module data structure is represented as a grouping + so it can be reused in configuration or another monitoring + data structure."; + grouping common-leafs { + description + "Common parameters for YANG modules and submodules."; + leaf name { + type yang:yang-identifier; + description + "The YANG module or submodule name."; + } + leaf revision { + type union { + type revision-identifier; + type string { length 0; } + } + description + "The YANG module or submodule revision date. + A zero-length string is used if no revision statement + is present in the YANG module or submodule."; + } + } + grouping schema-leaf { + description + "Common schema leaf parameter for modules and submodules."; + leaf schema { + type inet:uri; + description + "Contains a URL that represents the YANG schema + resource for this module or submodule. + This leaf will only be present if there is a URL + available for retrieval of the schema for this entry."; + } + } + list module { + key "name revision"; + description + "Each entry represents one revision of one module + currently supported by the server."; + uses common-leafs; + uses schema-leaf; + leaf namespace { + type inet:uri; + mandatory true; + description + "The XML namespace identifier for this module."; + } + leaf-list feature { + type yang:yang-identifier; + description + "List of YANG feature names from this module that are + supported by the server, regardless of whether they are + defined in the module or any included submodule."; + } + list deviation { + key "name revision"; + description + "List of YANG deviation module names and revisions + used by this server to modify the conformance of + the module associated with this entry. Note that + the same module can be used for deviations for + multiple modules, so the same entry MAY appear + within multiple 'module' entries. + The deviation module MUST be present in the 'module' + list, with the same name and revision values. + The 'conformance-type' value will be 'implement' for + the deviation module."; + uses common-leafs; + } + leaf conformance-type { + type enumeration { + enum implement { + description + "Indicates that the server implements one or more + protocol-accessible objects defined in the YANG module + identified in this entry. This includes deviation + statements defined in the module. + For YANG version 1.1 modules, there is at most one + module entry with conformance type 'implement' for a + particular module name, since YANG 1.1 requires that, + at most, one revision of a module is implemented. + For YANG version 1 modules, there SHOULD NOT be more + than one module entry for a particular module name."; + } + enum import { + description + "Indicates that the server imports reusable definitions + from the specified revision of the module but does + not implement any protocol-accessible objects from + this revision. + Multiple module entries for the same module name MAY + exist. This can occur if multiple modules import the + same module but specify different revision dates in + the import statements."; + } + } + mandatory true; + description + "Indicates the type of conformance the server is claiming + for the YANG module identified by this entry."; + } + list submodule { + key "name revision"; + description + "Each entry represents one submodule within the + parent module."; + uses common-leafs; + uses schema-leaf; + } + } + } + /* + * Operational state data nodes + */ + container modules-state { + config false; + description + "Contains YANG module monitoring information."; + leaf module-set-id { + type string; + mandatory true; + description + "Contains a server-specific identifier representing + the current set of modules and submodules. The + server MUST change the value of this leaf if the + information represented by the 'module' list instances + has changed."; + } + uses module-list; + } + /* + * Notifications + */ + notification yang-library-change { + description + "Generated when the set of modules and submodules supported + by the server has changed."; + leaf module-set-id { + type leafref { + path "/yanglib:modules-state/yanglib:module-set-id"; + } + mandatory true; + description + "Contains the module-set-id value representing the + set of modules and submodules supported at the server at + the time the notification is generated."; + } + } +} diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/modules/ietf-yang-types.yang b/netconf/restconf/restconf-nb-bierman02/src/test/resources/modules/ietf-yang-types.yang new file mode 100644 index 0000000..c3f952c --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/modules/ietf-yang-types.yang @@ -0,0 +1,417 @@ + module ietf-yang-types { + + namespace "urn:ietf:params:xml:ns:yang:ietf-yang-types"; + prefix "yang"; + + organization + "IETF NETMOD (NETCONF Data Modeling Language) Working Group"; + + contact + "WG Web: <http://tools.ietf.org/wg/netmod/> + WG List: <mailto:netmod@ietf.org> + + WG Chair: David Partain + <mailto:david.partain@ericsson.com> + + WG Chair: David Kessens + <mailto:david.kessens@nsn.com> + + Editor: Juergen Schoenwaelder + <mailto:j.schoenwaelder@jacobs-university.de>"; + + description + "This module contains a collection of generally useful derived + YANG data types. + + Copyright (c) 2010 IETF Trust and the persons identified as + authors of the code. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, is permitted pursuant to, and subject to the license + terms contained in, the Simplified BSD License set forth in Section + 4.c of the IETF Trust's Legal Provisions Relating to IETF Documents + (http://trustee.ietf.org/license-info). + + This version of this YANG module is part of RFC 6021; see + the RFC itself for full legal notices."; + + revision 2010-09-24 { + description + "Initial revision."; + reference + "RFC 6021: Common YANG Data Types"; + } + + /*** collection of counter and gauge types ***/ + + typedef counter32 { + type uint32; + description + "The counter32 type represents a non-negative integer + that monotonically increases until it reaches a + maximum value of 2^32-1 (4294967295 decimal), when it + wraps around and starts increasing again from zero. + + Counters have no defined 'initial' value, and thus, a + single value of a counter has (in general) no information + content. Discontinuities in the monotonically increasing + value normally occur at re-initialization of the + management system, and at other times as specified in the + description of a schema node using this type. If such + other times can occur, for example, the creation of + a schema node of type counter32 at times other than + re-initialization, then a corresponding schema node + should be defined, with an appropriate type, to indicate + the last discontinuity. + + The counter32 type should not be used for configuration + schema nodes. A default statement SHOULD NOT be used in + combination with the type counter32. + + In the value set and its semantics, this type is equivalent + to the Counter32 type of the SMIv2."; + reference + "RFC 2578: Structure of Management Information Version 2 (SMIv2)"; + } + + typedef zero-based-counter32 { + type yang:counter32; + default "0"; + description + "The zero-based-counter32 type represents a counter32 + that has the defined 'initial' value zero. + + A schema node of this type will be set to zero (0) on creation + and will thereafter increase monotonically until it reaches + a maximum value of 2^32-1 (4294967295 decimal), when it + wraps around and starts increasing again from zero. + + Provided that an application discovers a new schema node + of this type within the minimum time to wrap, it can use the + 'initial' value as a delta. It is important for a management + station to be aware of this minimum time and the actual time + between polls, and to discard data if the actual time is too + long or there is no defined minimum time. + + In the value set and its semantics, this type is equivalent + to the ZeroBasedCounter32 textual convention of the SMIv2."; + reference + "RFC 4502: Remote Network Monitoring Management Information + Base Version 2"; + } + + typedef counter64 { + type uint64; + description + "The counter64 type represents a non-negative integer + that monotonically increases until it reaches a + maximum value of 2^64-1 (18446744073709551615 decimal), + when it wraps around and starts increasing again from zero. + + Counters have no defined 'initial' value, and thus, a + single value of a counter has (in general) no information + content. Discontinuities in the monotonically increasing + value normally occur at re-initialization of the + management system, and at other times as specified in the + description of a schema node using this type. If such + other times can occur, for example, the creation of + a schema node of type counter64 at times other than + re-initialization, then a corresponding schema node + should be defined, with an appropriate type, to indicate + the last discontinuity. + + The counter64 type should not be used for configuration + schema nodes. A default statement SHOULD NOT be used in + combination with the type counter64. + + In the value set and its semantics, this type is equivalent + to the Counter64 type of the SMIv2."; + reference + "RFC 2578: Structure of Management Information Version 2 (SMIv2)"; + } + + typedef zero-based-counter64 { + type yang:counter64; + default "0"; + description + "The zero-based-counter64 type represents a counter64 that + has the defined 'initial' value zero. + + A schema node of this type will be set to zero (0) on creation + and will thereafter increase monotonically until it reaches + a maximum value of 2^64-1 (18446744073709551615 decimal), + when it wraps around and starts increasing again from zero. + + Provided that an application discovers a new schema node + of this type within the minimum time to wrap, it can use the + 'initial' value as a delta. It is important for a management + station to be aware of this minimum time and the actual time + between polls, and to discard data if the actual time is too + long or there is no defined minimum time. + + In the value set and its semantics, this type is equivalent + to the ZeroBasedCounter64 textual convention of the SMIv2."; + reference + "RFC 2856: Textual Conventions for Additional High Capacity + Data Types"; + } + + typedef gauge32 { + type uint32; + description + "The gauge32 type represents a non-negative integer, which + may increase or decrease, but shall never exceed a maximum + value, nor fall below a minimum value. The maximum value + cannot be greater than 2^32-1 (4294967295 decimal), and + the minimum value cannot be smaller than 0. The value of + a gauge32 has its maximum value whenever the information + being modeled is greater than or equal to its maximum + value, and has its minimum value whenever the information + being modeled is smaller than or equal to its minimum value. + If the information being modeled subsequently decreases + below (increases above) the maximum (minimum) value, the + gauge32 also decreases (increases). + + In the value set and its semantics, this type is equivalent + to the Gauge32 type of the SMIv2."; + reference + "RFC 2578: Structure of Management Information Version 2 (SMIv2)"; + } + + typedef gauge64 { + type uint64; + description + "The gauge64 type represents a non-negative integer, which + may increase or decrease, but shall never exceed a maximum + value, nor fall below a minimum value. The maximum value + cannot be greater than 2^64-1 (18446744073709551615), and + the minimum value cannot be smaller than 0. The value of + a gauge64 has its maximum value whenever the information + being modeled is greater than or equal to its maximum + value, and has its minimum value whenever the information + being modeled is smaller than or equal to its minimum value. + If the information being modeled subsequently decreases + below (increases above) the maximum (minimum) value, the + gauge64 also decreases (increases). + + In the value set and its semantics, this type is equivalent + to the CounterBasedGauge64 SMIv2 textual convention defined + in RFC 2856"; + reference + "RFC 2856: Textual Conventions for Additional High Capacity + Data Types"; + } + + /*** collection of identifier related types ***/ + + typedef object-identifier { + type string { + pattern '(([0-1](\.[1-3]?[0-9]))|(2\.(0|([1-9]\d*))))' + + '(\.(0|([1-9]\d*)))*'; + } + description + "The object-identifier type represents administratively + assigned names in a registration-hierarchical-name tree. + + Values of this type are denoted as a sequence of numerical + non-negative sub-identifier values. Each sub-identifier + value MUST NOT exceed 2^32-1 (4294967295). Sub-identifiers + are separated by single dots and without any intermediate + whitespace. + + The ASN.1 standard restricts the value space of the first + sub-identifier to 0, 1, or 2. Furthermore, the value space + of the second sub-identifier is restricted to the range + 0 to 39 if the first sub-identifier is 0 or 1. Finally, + the ASN.1 standard requires that an object identifier + has always at least two sub-identifier. The pattern + captures these restrictions. + + Although the number of sub-identifiers is not limited, + module designers should realize that there may be + implementations that stick with the SMIv2 limit of 128 + sub-identifiers. + + This type is a superset of the SMIv2 OBJECT IDENTIFIER type + since it is not restricted to 128 sub-identifiers. Hence, + this type SHOULD NOT be used to represent the SMIv2 OBJECT + IDENTIFIER type, the object-identifier-128 type SHOULD be + used instead."; + reference + "ISO9834-1: Information technology -- Open Systems + Interconnection -- Procedures for the operation of OSI + Registration Authorities: General procedures and top + arcs of the ASN.1 Object Identifier tree"; + } + + + + + typedef object-identifier-128 { + type object-identifier { + pattern '\d*(\.\d*){1,127}'; + } + description + "This type represents object-identifiers restricted to 128 + sub-identifiers. + + In the value set and its semantics, this type is equivalent + to the OBJECT IDENTIFIER type of the SMIv2."; + reference + "RFC 2578: Structure of Management Information Version 2 (SMIv2)"; + } + + typedef yang-identifier { + type string { + length "1..max"; + pattern '[a-zA-Z_][a-zA-Z0-9\-_.]*'; + pattern '.|..|[^xX].*|.[^mM].*|..[^lL].*'; + } + description + "A YANG identifier string as defined by the 'identifier' + rule in Section 12 of RFC 6020. An identifier must + start with an alphabetic character or an underscore + followed by an arbitrary sequence of alphabetic or + numeric characters, underscores, hyphens, or dots. + + A YANG identifier MUST NOT start with any possible + combination of the lowercase or uppercase character + sequence 'xml'."; + reference + "RFC 6020: YANG - A Data Modeling Language for the Network + Configuration Protocol (NETCONF)"; + } + + /*** collection of date and time related types ***/ + + typedef date-and-time { + type string { + pattern '\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d+)?' + + '(Z|[\+\-]\d{2}:\d{2})'; + } + description + "The date-and-time type is a profile of the ISO 8601 + standard for representation of dates and times using the + Gregorian calendar. The profile is defined by the + date-time production in Section 5.6 of RFC 3339. + + The date-and-time type is compatible with the dateTime XML + schema type with the following notable exceptions: + + (a) The date-and-time type does not allow negative years. + + (b) The date-and-time time-offset -00:00 indicates an unknown + time zone (see RFC 3339) while -00:00 and +00:00 and Z all + represent the same time zone in dateTime. + + (c) The canonical format (see below) of data-and-time values + differs from the canonical format used by the dateTime XML + schema type, which requires all times to be in UTC using the + time-offset 'Z'. + + This type is not equivalent to the DateAndTime textual + convention of the SMIv2 since RFC 3339 uses a different + separator between full-date and full-time and provides + higher resolution of time-secfrac. + + The canonical format for date-and-time values with a known time + zone uses a numeric time zone offset that is calculated using + the device's configured known offset to UTC time. A change of + the device's offset to UTC time will cause date-and-time values + to change accordingly. Such changes might happen periodically + in case a server follows automatically daylight saving time + (DST) time zone offset changes. The canonical format for + date-and-time values with an unknown time zone (usually referring + to the notion of local time) uses the time-offset -00:00."; + reference + "RFC 3339: Date and Time on the Internet: Timestamps + RFC 2579: Textual Conventions for SMIv2 + XSD-TYPES: XML Schema Part 2: Datatypes Second Edition"; + } + + typedef timeticks { + type uint32; + description + "The timeticks type represents a non-negative integer that + represents the time, modulo 2^32 (4294967296 decimal), in + hundredths of a second between two epochs. When a schema + node is defined that uses this type, the description of + the schema node identifies both of the reference epochs. + + In the value set and its semantics, this type is equivalent + to the TimeTicks type of the SMIv2."; + reference + "RFC 2578: Structure of Management Information Version 2 (SMIv2)"; + } + + typedef timestamp { + type yang:timeticks; + description + "The timestamp type represents the value of an associated + timeticks schema node at which a specific occurrence happened. + The specific occurrence must be defined in the description + of any schema node defined using this type. When the specific + occurrence occurred prior to the last time the associated + timeticks attribute was zero, then the timestamp value is + zero. Note that this requires all timestamp values to be + reset to zero when the value of the associated timeticks + attribute reaches 497+ days and wraps around to zero. + + The associated timeticks schema node must be specified + in the description of any schema node using this type. + + In the value set and its semantics, this type is equivalent + to the TimeStamp textual convention of the SMIv2."; + reference + "RFC 2579: Textual Conventions for SMIv2"; + } + + /*** collection of generic address types ***/ + + typedef phys-address { + type string { + pattern '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'; + } + description + "Represents media- or physical-level addresses represented + as a sequence octets, each octet represented by two hexadecimal + numbers. Octets are separated by colons. The canonical + representation uses lowercase characters. + + In the value set and its semantics, this type is equivalent + to the PhysAddress textual convention of the SMIv2."; + reference + "RFC 2579: Textual Conventions for SMIv2"; + } + + typedef mac-address { + type string { + pattern '[0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){5}'; + } + description + "The mac-address type represents an IEEE 802 MAC address. + The canonical representation uses lowercase characters. + + In the value set and its semantics, this type is equivalent + to the MacAddress textual convention of the SMIv2."; + reference + "IEEE 802: IEEE Standard for Local and Metropolitan Area + Networks: Overview and Architecture + RFC 2579: Textual Conventions for SMIv2"; + } + + /*** collection of XML specific types ***/ + + typedef xpath1.0 { + type string; + description + "This type represents an XPATH 1.0 expression. + + When a schema node is defined that uses this type, the + description of the schema node MUST specify the XPath + context in which the XPath expression is evaluated."; + reference + "XPATH: XML Path Language (XPath) Version 1.0"; + } + + } diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/modules/module1.yang b/netconf/restconf/restconf-nb-bierman02/src/test/resources/modules/module1.yang new file mode 100644 index 0000000..604fe94 --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/modules/module1.yang @@ -0,0 +1,12 @@ +module module1 { + namespace "module:1"; + prefix "mod1"; + revision "2014-01-01"; + + rpc dummy-rpc1-module1 { + } + + rpc dummy-rpc2-module1 { + } + +}
\ No newline at end of file diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/modules/module2.yang b/netconf/restconf/restconf-nb-bierman02/src/test/resources/modules/module2.yang new file mode 100644 index 0000000..7b359f3 --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/modules/module2.yang @@ -0,0 +1,11 @@ +module module2 { + namespace "module:2"; + prefix "mod2"; + revision "2014-01-02"; + + rpc dummy-rpc1-module2 { + } + + rpc dummy-rpc2-module2 { + } +}
\ No newline at end of file diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/modules/module3.yang b/netconf/restconf/restconf-nb-bierman02/src/test/resources/modules/module3.yang new file mode 100644 index 0000000..39bb690 --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/modules/module3.yang @@ -0,0 +1,5 @@ +module module3 { + namespace "module:3"; + prefix "mod3"; + revision "2014-01-03"; +}
\ No newline at end of file diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/modules/modules-behind-mount-point/iana-if-type.yang b/netconf/restconf/restconf-nb-bierman02/src/test/resources/modules/modules-behind-mount-point/iana-if-type.yang new file mode 100644 index 0000000..7bd0003 --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/modules/modules-behind-mount-point/iana-if-type.yang @@ -0,0 +1,1517 @@ +module iana-if-type { + namespace "urn:ietf:params:xml:ns:yang:iana-if-type"; + prefix ianaift; + + organization "IANA"; + contact + " Internet Assigned Numbers Authority + + Postal: ICANN + 4676 Admiralty Way, Suite 330 + Marina del Rey, CA 90292 + + Tel: +1 310 823 9358 + E-Mail: iana&iana.org"; + description + "This YANG module defines the iana-if-type typedef, which + contains YANG definitions for IANA-registered interface types. + + This YANG module is maintained by IANA, and reflects the + 'ifType definitions' registry. + + The latest revision of this YANG module can be obtained from + the IANA web site. + + Copyright (c) 2011 IETF Trust and the persons identified as + authors of the code. All rights reserved. + + Redistribution and use in source and binary forms, with or + without modification, is permitted pursuant to, and subject + to the license terms contained in, the Simplified BSD License + set forth in Section 4.c of the IETF Trust's Legal Provisions + Relating to IETF Documents + (http://trustee.ietf.org/license-info). + + This version of this YANG module is part of RFC XXXX; see + the RFC itself for full legal notices."; + // RFC Ed.: replace XXXX with actual RFC number and remove this + // note. + + // RFC Ed.: update the date below with the date of RFC publication + // and remove this note. + revision 2013-07-04 { + description + "Initial revision."; + reference + "RFC XXXX: IANA Interface Type YANG Module"; + } + + typedef iana-if-type { + type enumeration { + enum "other" { + value 1; + description + "None of the following"; + } + enum "regular1822" { + value 2; + } + enum "hdh1822" { + value 3; + } + enum "ddnX25" { + value 4; + } + enum "rfc877x25" { + value 5; + reference + "RFC 1382 - SNMP MIB Extension for the X.25 Packet Layer"; + } + enum "ethernetCsmacd" { + value 6; + description + "For all ethernet-like interfaces, regardless of speed, + as per RFC3635."; + reference + "RFC 3635 - Definitions of Managed Objects for the + Ethernet-like Interface Types."; + } + enum "iso88023Csmacd" { + value 7; + status deprecated; + description + "Deprecated via RFC3635. + Use ethernetCsmacd(6) instead."; + reference + "RFC 3635 - Definitions of Managed Objects for the + Ethernet-like Interface Types."; + } + enum "iso88024TokenBus" { + value 8; + } + enum "iso88025TokenRing" { + value 9; + } + enum "iso88026Man" { + value 10; + } + enum "starLan" { + value 11; + status deprecated; + description + "Deprecated via RFC3635. + Use ethernetCsmacd(6) instead."; + reference + "RFC 3635 - Definitions of Managed Objects for the + Ethernet-like Interface Types."; + } + enum "proteon10Mbit" { + value 12; + } + enum "proteon80Mbit" { + value 13; + } + enum "hyperchannel" { + value 14; + } + enum "fddi" { + value 15; + reference + "RFC 1512 - FDDI Management Information Base"; + } + enum "lapb" { + value 16; + reference + "RFC 1381 - SNMP MIB Extension for X.25 LAPB"; + } + enum "sdlc" { + value 17; + } + enum "ds1" { + value 18; + description + "DS1-MIB"; + reference + "RFC 4805 - Definitions of Managed Objects for the + DS1, J1, E1, DS2, and E2 Interface Types"; + } + enum "e1" { + value 19; + status obsolete; + description + "Obsolete see DS1-MIB"; + reference + "RFC 4805 - Definitions of Managed Objects for the + DS1, J1, E1, DS2, and E2 Interface Types"; + } + enum "basicISDN" { + value 20; + description + "see also RFC2127"; + } + enum "primaryISDN" { + value 21; + } + enum "propPointToPointSerial" { + value 22; + description + "proprietary serial"; + } + enum "ppp" { + value 23; + } + enum "softwareLoopback" { + value 24; + } + enum "eon" { + value 25; + description + "CLNP over IP"; + } + enum "ethernet3Mbit" { + value 26; + } + enum "nsip" { + value 27; + description + "XNS over IP"; + } + enum "slip" { + value 28; + description + "generic SLIP"; + } + enum "ultra" { + value 29; + description + "ULTRA technologies"; + } + enum "ds3" { + value 30; + description + "DS3-MIB"; + reference + "RFC 3896 - Definitions of Managed Objects for the + DS3/E3 Interface Type"; + } + enum "sip" { + value 31; + description + "SMDS, coffee"; + reference + "RFC 1694 - Definitions of Managed Objects for SMDS + Interfaces using SMIv2"; + } + enum "frameRelay" { + value 32; + description + "DTE only."; + reference + "RFC 2115 - Management Information Base for Frame Relay + DTEs Using SMIv2"; + } + enum "rs232" { + value 33; + reference + "RFC 1659 - Definitions of Managed Objects for RS-232-like + Hardware Devices using SMIv2"; + } + enum "para" { + value 34; + description + "parallel-port"; + reference + "RFC 1660 - Definitions of Managed Objects for + Parallel-printer-like Hardware Devices using + SMIv2"; + } + enum "arcnet" { + value 35; + description + "arcnet"; + } + enum "arcnetPlus" { + value 36; + description + "arcnet plus"; + } + enum "atm" { + value 37; + description + "ATM cells"; + } + enum "miox25" { + value 38; + reference + "RFC 1461 - SNMP MIB extension for Multiprotocol + Interconnect over X.25"; + } + enum "sonet" { + value 39; + description + "SONET or SDH"; + } + enum "x25ple" { + value 40; + reference + "RFC 2127 - ISDN Management Information Base using SMIv2"; + } + enum "iso88022llc" { + value 41; + } + enum "localTalk" { + value 42; + } + enum "smdsDxi" { + value 43; + } + enum "frameRelayService" { + value 44; + description + "FRNETSERV-MIB"; + reference + "RFC 2954 - Definitions of Managed Objects for Frame + Relay Service"; + } + enum "v35" { + value 45; + } + enum "hssi" { + value 46; + } + enum "hippi" { + value 47; + } + enum "modem" { + value 48; + description + "Generic modem"; + } + enum "aal5" { + value 49; + description + "AAL5 over ATM"; + } + enum "sonetPath" { + value 50; + } + enum "sonetVT" { + value 51; + } + enum "smdsIcip" { + value 52; + description + "SMDS InterCarrier Interface"; + } + enum "propVirtual" { + value 53; + description + "proprietary virtual/internal"; + reference + "RFC 2863 - The Interfaces Group MIB"; + } + enum "propMultiplexor" { + value 54; + description + "proprietary multiplexing"; + reference + "RFC 2863 - The Interfaces Group MIB"; + } + enum "ieee80212" { + value 55; + description + "100BaseVG"; + } + enum "fibreChannel" { + value 56; + description + "Fibre Channel"; + } + enum "hippiInterface" { + value 57; + description + "HIPPI interfaces"; + } + enum "frameRelayInterconnect" { + value 58; + status obsolete; + description + "Obsolete use either + frameRelay(32) or frameRelayService(44)."; + } + enum "aflane8023" { + value 59; + description + "ATM Emulated LAN for 802.3"; + } + enum "aflane8025" { + value 60; + description + "ATM Emulated LAN for 802.5"; + } + enum "cctEmul" { + value 61; + description + "ATM Emulated circuit"; + } + enum "fastEther" { + value 62; + status deprecated; + description + "Obsoleted via RFC3635. + ethernetCsmacd(6) should be used instead"; + reference + "RFC 3635 - Definitions of Managed Objects for the + Ethernet-like Interface Types."; + } + enum "isdn" { + value 63; + description + "ISDN and X.25"; + reference + "RFC 1356 - Multiprotocol Interconnect on X.25 and ISDN + in the Packet Mode"; + } + enum "v11" { + value 64; + description + "CCITT V.11/X.21"; + } + enum "v36" { + value 65; + description + "CCITT V.36"; + } + enum "g703at64k" { + value 66; + description + "CCITT G703 at 64Kbps"; + } + enum "g703at2mb" { + value 67; + status obsolete; + description + "Obsolete see DS1-MIB"; + } + enum "qllc" { + value 68; + description + "SNA QLLC"; + } + enum "fastEtherFX" { + value 69; + status deprecated; + description + "Obsoleted via RFC3635 + ethernetCsmacd(6) should be used instead"; + reference + "RFC 3635 - Definitions of Managed Objects for the + Ethernet-like Interface Types."; + } + enum "channel" { + value 70; + description + "channel"; + } + enum "ieee80211" { + value 71; + description + "radio spread spectrum"; + } + enum "ibm370parChan" { + value 72; + description + "IBM System 360/370 OEMI Channel"; + } + enum "escon" { + value 73; + description + "IBM Enterprise Systems Connection"; + } + enum "dlsw" { + value 74; + description + "Data Link Switching"; + } + enum "isdns" { + value 75; + description + "ISDN S/T interface"; + } + enum "isdnu" { + value 76; + description + "ISDN U interface"; + } + enum "lapd" { + value 77; + description + "Link Access Protocol D"; + } + enum "ipSwitch" { + value 78; + description + "IP Switching Objects"; + } + enum "rsrb" { + value 79; + description + "Remote Source Route Bridging"; + } + enum "atmLogical" { + value 80; + description + "ATM Logical Port"; + reference + "RFC 3606 - Definitions of Supplemental Managed Objects + for ATM Interface"; + } + enum "ds0" { + value 81; + description + "Digital Signal Level 0"; + reference + "RFC 2494 - Definitions of Managed Objects for the DS0 + and DS0 Bundle Interface Type"; + } + enum "ds0Bundle" { + value 82; + description + "group of ds0s on the same ds1"; + reference + "RFC 2494 - Definitions of Managed Objects for the DS0 + and DS0 Bundle Interface Type"; + } + enum "bsc" { + value 83; + description + "Bisynchronous Protocol"; + } + enum "async" { + value 84; + description + "Asynchronous Protocol"; + } + enum "cnr" { + value 85; + description + "Combat Net Radio"; + } + enum "iso88025Dtr" { + value 86; + description + "ISO 802.5r DTR"; + } + enum "eplrs" { + value 87; + description + "Ext Pos Loc Report Sys"; + } + enum "arap" { + value 88; + description + "Appletalk Remote Access Protocol"; + } + enum "propCnls" { + value 89; + description + "Proprietary Connectionless Protocol"; + } + enum "hostPad" { + value 90; + description + "CCITT-ITU X.29 PAD Protocol"; + } + enum "termPad" { + value 91; + description + "CCITT-ITU X.3 PAD Facility"; + } + enum "frameRelayMPI" { + value 92; + description + "Multiproto Interconnect over FR"; + } + enum "x213" { + value 93; + description + "CCITT-ITU X213"; + } + enum "adsl" { + value 94; + description + "Asymmetric Digital Subscriber Loop"; + } + enum "radsl" { + value 95; + description + "Rate-Adapt. Digital Subscriber Loop"; + } + enum "sdsl" { + value 96; + description + "Symmetric Digital Subscriber Loop"; + } + enum "vdsl" { + value 97; + description + "Very H-Speed Digital Subscrib. Loop"; + } + enum "iso88025CRFPInt" { + value 98; + description + "ISO 802.5 CRFP"; + } + enum "myrinet" { + value 99; + description + "Myricom Myrinet"; + } + enum "voiceEM" { + value 100; + description + "voice recEive and transMit"; + } + enum "voiceFXO" { + value 101; + description + "voice Foreign Exchange Office"; + } + enum "voiceFXS" { + value 102; + description + "voice Foreign Exchange Station"; + } + enum "voiceEncap" { + value 103; + description + "voice encapsulation"; + } + enum "voiceOverIp" { + value 104; + description + "voice over IP encapsulation"; + } + enum "atmDxi" { + value 105; + description + "ATM DXI"; + } + enum "atmFuni" { + value 106; + description + "ATM FUNI"; + } + enum "atmIma" { + value 107; + description + "ATM IMA"; + } + enum "pppMultilinkBundle" { + value 108; + description + "PPP Multilink Bundle"; + } + enum "ipOverCdlc" { + value 109; + description + "IBM ipOverCdlc"; + } + enum "ipOverClaw" { + value 110; + description + "IBM Common Link Access to Workstn"; + } + enum "stackToStack" { + value 111; + description + "IBM stackToStack"; + } + enum "virtualIpAddress" { + value 112; + description + "IBM VIPA"; + } + enum "mpc" { + value 113; + description + "IBM multi-protocol channel support"; + } + enum "ipOverAtm" { + value 114; + description + "IBM ipOverAtm"; + reference + "RFC 2320 - Definitions of Managed Objects for Classical IP + and ARP Over ATM Using SMIv2 (IPOA-MIB)"; + } + enum "iso88025Fiber" { + value 115; + description + "ISO 802.5j Fiber Token Ring"; + } + enum "tdlc" { + value 116; + description + "IBM twinaxial data link control"; + } + enum "gigabitEthernet" { + value 117; + status deprecated; + description + "Obsoleted via RFC3635 + ethernetCsmacd(6) should be used instead"; + reference + "RFC 3635 - Definitions of Managed Objects for the + Ethernet-like Interface Types."; + } + enum "hdlc" { + value 118; + description + "HDLC"; + } + enum "lapf" { + value 119; + description + "LAP F"; + } + enum "v37" { + value 120; + description + "V.37"; + } + enum "x25mlp" { + value 121; + description + "Multi-Link Protocol"; + } + enum "x25huntGroup" { + value 122; + description + "X25 Hunt Group"; + } + enum "transpHdlc" { + value 123; + description + "Transp HDLC"; + } + enum "interleave" { + value 124; + description + "Interleave channel"; + } + enum "fast" { + value 125; + description + "Fast channel"; + } + enum "ip" { + value 126; + description + "IP (for APPN HPR in IP networks)"; + } + enum "docsCableMaclayer" { + value 127; + description + "CATV Mac Layer"; + } + enum "docsCableDownstream" { + value 128; + description + "CATV Downstream interface"; + } + enum "docsCableUpstream" { + value 129; + description + "CATV Upstream interface"; + } + enum "a12MppSwitch" { + value 130; + description + "Avalon Parallel Processor"; + } + enum "tunnel" { + value 131; + description + "Encapsulation interface"; + } + enum "coffee" { + value 132; + description + "coffee pot"; + reference + "RFC 2325 - Coffee MIB"; + } + enum "ces" { + value 133; + description + "Circuit Emulation Service"; + } + enum "atmSubInterface" { + value 134; + description + "ATM Sub Interface"; + } + enum "l2vlan" { + value 135; + description + "Layer 2 Virtual LAN using 802.1Q"; + } + enum "l3ipvlan" { + value 136; + description + "Layer 3 Virtual LAN using IP"; + } + enum "l3ipxvlan" { + value 137; + description + "Layer 3 Virtual LAN using IPX"; + } + enum "digitalPowerline" { + value 138; + description + "IP over Power Lines"; + } + enum "mediaMailOverIp" { + value 139; + description + "Multimedia Mail over IP"; + } + enum "dtm" { + value 140; + description + "Dynamic syncronous Transfer Mode"; + } + enum "dcn" { + value 141; + description + "Data Communications Network"; + } + enum "ipForward" { + value 142; + description + "IP Forwarding Interface"; + } + enum "msdsl" { + value 143; + description + "Multi-rate Symmetric DSL"; + } + enum "ieee1394" { + value 144; + description + "IEEE1394 High Performance Serial Bus"; + } + enum "if-gsn" { + value 145; + description + "HIPPI-6400"; + } + enum "dvbRccMacLayer" { + value 146; + description + "DVB-RCC MAC Layer"; + } + enum "dvbRccDownstream" { + value 147; + description + "DVB-RCC Downstream Channel"; + } + enum "dvbRccUpstream" { + value 148; + description + "DVB-RCC Upstream Channel"; + } + enum "atmVirtual" { + value 149; + description + "ATM Virtual Interface"; + } + enum "mplsTunnel" { + value 150; + description + "MPLS Tunnel Virtual Interface"; + } + enum "srp" { + value 151; + description + "Spatial Reuse Protocol"; + } + enum "voiceOverAtm" { + value 152; + description + "Voice Over ATM"; + } + enum "voiceOverFrameRelay" { + value 153; + description + "Voice Over Frame Relay"; + } + enum "idsl" { + value 154; + description + "Digital Subscriber Loop over ISDN"; + } + enum "compositeLink" { + value 155; + description + "Avici Composite Link Interface"; + } + enum "ss7SigLink" { + value 156; + description + "SS7 Signaling Link"; + } + enum "propWirelessP2P" { + value 157; + description + "Prop. P2P wireless interface"; + } + enum "frForward" { + value 158; + description + "Frame Forward Interface"; + } + enum "rfc1483" { + value 159; + description + "Multiprotocol over ATM AAL5"; + reference + "RFC 1483 - Multiprotocol Encapsulation over ATM + Adaptation Layer 5"; + } + enum "usb" { + value 160; + description + "USB Interface"; + } + enum "ieee8023adLag" { + value 161; + description + "IEEE 802.3ad Link Aggregate"; + } + enum "bgppolicyaccounting" { + value 162; + description + "BGP Policy Accounting"; + } + enum "frf16MfrBundle" { + value 163; + description + "FRF .16 Multilink Frame Relay"; + } + enum "h323Gatekeeper" { + value 164; + description + "H323 Gatekeeper"; + } + enum "h323Proxy" { + value 165; + description + "H323 Voice and Video Proxy"; + } + enum "mpls" { + value 166; + description + "MPLS"; + } + enum "mfSigLink" { + value 167; + description + "Multi-frequency signaling link"; + } + enum "hdsl2" { + value 168; + description + "High Bit-Rate DSL - 2nd generation"; + } + enum "shdsl" { + value 169; + description + "Multirate HDSL2"; + } + enum "ds1FDL" { + value 170; + description + "Facility Data Link 4Kbps on a DS1"; + } + enum "pos" { + value 171; + description + "Packet over SONET/SDH Interface"; + } + enum "dvbAsiIn" { + value 172; + description + "DVB-ASI Input"; + } + enum "dvbAsiOut" { + value 173; + description + "DVB-ASI Output"; + } + enum "plc" { + value 174; + description + "Power Line Communtications"; + } + enum "nfas" { + value 175; + description + "Non Facility Associated Signaling"; + } + enum "tr008" { + value 176; + description + "TR008"; + } + enum "gr303RDT" { + value 177; + description + "Remote Digital Terminal"; + } + enum "gr303IDT" { + value 178; + description + "Integrated Digital Terminal"; + } + enum "isup" { + value 179; + description + "ISUP"; + } + enum "propDocsWirelessMaclayer" { + value 180; + description + "Cisco proprietary Maclayer"; + } + enum "propDocsWirelessDownstream" { + value 181; + description + "Cisco proprietary Downstream"; + } + enum "propDocsWirelessUpstream" { + value 182; + description + "Cisco proprietary Upstream"; + } + enum "hiperlan2" { + value 183; + description + "HIPERLAN Type 2 Radio Interface"; + } + enum "propBWAp2Mp" { + value 184; + description + "PropBroadbandWirelessAccesspt2multipt use of this value + for IEEE 802.16 WMAN interfaces as per IEEE Std 802.16f + is deprecated and ieee80216WMAN(237) should be used + instead."; + } + enum "sonetOverheadChannel" { + value 185; + description + "SONET Overhead Channel"; + } + enum "digitalWrapperOverheadChannel" { + value 186; + description + "Digital Wrapper"; + } + enum "aal2" { + value 187; + description + "ATM adaptation layer 2"; + } + enum "radioMAC" { + value 188; + description + "MAC layer over radio links"; + } + enum "atmRadio" { + value 189; + description + "ATM over radio links"; + } + enum "imt" { + value 190; + description + "Inter Machine Trunks"; + } + enum "mvl" { + value 191; + description + "Multiple Virtual Lines DSL"; + } + enum "reachDSL" { + value 192; + description + "Long Reach DSL"; + } + enum "frDlciEndPt" { + value 193; + description + "Frame Relay DLCI End Point"; + } + enum "atmVciEndPt" { + value 194; + description + "ATM VCI End Point"; + } + enum "opticalChannel" { + value 195; + description + "Optical Channel"; + } + enum "opticalTransport" { + value 196; + description + "Optical Transport"; + } + enum "propAtm" { + value 197; + description + "Proprietary ATM"; + } + enum "voiceOverCable" { + value 198; + description + "Voice Over Cable Interface"; + } + enum "infiniband" { + value 199; + description + "Infiniband"; + } + enum "teLink" { + value 200; + description + "TE Link"; + } + enum "q2931" { + value 201; + description + "Q.2931"; + } + enum "virtualTg" { + value 202; + description + "Virtual Trunk Group"; + } + enum "sipTg" { + value 203; + description + "SIP Trunk Group"; + } + enum "sipSig" { + value 204; + description + "SIP Signaling"; + } + enum "docsCableUpstreamChannel" { + value 205; + description + "CATV Upstream Channel"; + } + enum "econet" { + value 206; + description + "Acorn Econet"; + } + enum "pon155" { + value 207; + description + "FSAN 155Mb Symetrical PON interface"; + } + enum "pon622" { + value 208; + description + "FSAN622Mb Symetrical PON interface"; + } + enum "bridge" { + value 209; + description + "Transparent bridge interface"; + } + enum "linegroup" { + value 210; + description + "Interface common to multiple lines"; + } + enum "voiceEMFGD" { + value 211; + description + "voice E&M Feature Group D"; + } + enum "voiceFGDEANA" { + value 212; + description + "voice FGD Exchange Access North American"; + } + enum "voiceDID" { + value 213; + description + "voice Direct Inward Dialing"; + } + enum "mpegTransport" { + value 214; + description + "MPEG transport interface"; + } + enum "sixToFour" { + value 215; + status deprecated; + description + "6to4 interface (DEPRECATED)"; + reference + "RFC 4087 - IP Tunnel MIB"; + } + enum "gtp" { + value 216; + description + "GTP (GPRS Tunneling Protocol)"; + } + enum "pdnEtherLoop1" { + value 217; + description + "Paradyne EtherLoop 1"; + } + enum "pdnEtherLoop2" { + value 218; + description + "Paradyne EtherLoop 2"; + } + enum "opticalChannelGroup" { + value 219; + description + "Optical Channel Group"; + } + enum "homepna" { + value 220; + description + "HomePNA ITU-T G.989"; + } + enum "gfp" { + value 221; + description + "Generic Framing Procedure (GFP)"; + } + enum "ciscoISLvlan" { + value 222; + description + "Layer 2 Virtual LAN using Cisco ISL"; + } + enum "actelisMetaLOOP" { + value 223; + description + "Acteleis proprietary MetaLOOP High Speed Link"; + } + enum "fcipLink" { + value 224; + description + "FCIP Link"; + } + enum "rpr" { + value 225; + description + "Resilient Packet Ring Interface Type"; + } + enum "qam" { + value 226; + description + "RF Qam Interface"; + } + enum "lmp" { + value 227; + description + "Link Management Protocol"; + reference + "RFC 4327 - Link Management Protocol (LMP) Management + Information Base (MIB)"; + } + enum "cblVectaStar" { + value 228; + description + "Cambridge Broadband Networks Limited VectaStar"; + } + enum "docsCableMCmtsDownstream" { + value 229; + description + "CATV Modular CMTS Downstream Interface"; + } + enum "adsl2" { + value 230; + status deprecated; + description + "Asymmetric Digital Subscriber Loop Version 2 + (DEPRECATED/OBSOLETED - please use adsl2plus(238) + instead)"; + reference + "RFC 4706 - Definitions of Managed Objects for Asymmetric + Digital Subscriber Line 2 (ADSL2)"; + } + enum "macSecControlledIF" { + value 231; + description + "MACSecControlled"; + } + enum "macSecUncontrolledIF" { + value 232; + description + "MACSecUncontrolled"; + } + enum "aviciOpticalEther" { + value 233; + description + "Avici Optical Ethernet Aggregate"; + } + enum "atmbond" { + value 234; + description + "atmbond"; + } + enum "voiceFGDOS" { + value 235; + description + "voice FGD Operator Services"; + } + enum "mocaVersion1" { + value 236; + description + "MultiMedia over Coax Alliance (MoCA) Interface + as documented in information provided privately to IANA"; + } + enum "ieee80216WMAN" { + value 237; + description + "IEEE 802.16 WMAN interface"; + } + enum "adsl2plus" { + value 238; + description + "Asymmetric Digital Subscriber Loop Version 2, + Version 2 Plus and all variants"; + } + enum "dvbRcsMacLayer" { + value 239; + description + "DVB-RCS MAC Layer"; + reference + "RFC 5728 - The SatLabs Group DVB-RCS MIB"; + } + enum "dvbTdm" { + value 240; + description + "DVB Satellite TDM"; + reference + "RFC 5728 - The SatLabs Group DVB-RCS MIB"; + } + enum "dvbRcsTdma" { + value 241; + description + "DVB-RCS TDMA"; + reference + "RFC 5728 - The SatLabs Group DVB-RCS MIB"; + } + enum "x86Laps" { + value 242; + description + "LAPS based on ITU-T X.86/Y.1323"; + } + enum "wwanPP" { + value 243; + description + "3GPP WWAN"; + } + enum "wwanPP2" { + value 244; + description + "3GPP2 WWAN"; + } + enum "voiceEBS" { + value 245; + description + "voice P-phone EBS physical interface"; + } + enum "ifPwType" { + value 246; + description + "Pseudowire interface type"; + reference + "RFC 5601 - Pseudowire (PW) Management Information Base"; + } + enum "ilan" { + value 247; + description + "Internal LAN on a bridge per IEEE 802.1ap"; + } + enum "pip" { + value 248; + description + "Provider Instance Port on a bridge per IEEE 802.1ah PBB"; + } + enum "aluELP" { + value 249; + description + "Alcatel-Lucent Ethernet Link Protection"; + } + enum "gpon" { + value 250; + description + "Gigabit-capable passive optical networks (G-PON) as per + ITU-T G.948"; + } + enum "vdsl2" { + value 251; + description + "Very high speed digital subscriber line Version 2 + (as per ITU-T Recommendation G.993.2)"; + reference + "RFC 5650 - Definitions of Managed Objects for Very High + Speed Digital Subscriber Line 2 (VDSL2)"; + } + enum "capwapDot11Profile" { + value 252; + description + "WLAN Profile Interface"; + reference + "RFC 5834 - Control and Provisioning of Wireless Access + Points (CAPWAP) Protocol Binding MIB for + IEEE 802.11"; + } + enum "capwapDot11Bss" { + value 253; + description + "WLAN BSS Interface"; + reference + "RFC 5834 - Control and Provisioning of Wireless Access + Points (CAPWAP) Protocol Binding MIB for + IEEE 802.11"; + } + enum "capwapWtpVirtualRadio" { + value 254; + description + "WTP Virtual Radio Interface"; + reference + "RFC 5833 - Control and Provisioning of Wireless Access + Points (CAPWAP) Protocol Base MIB"; + } + enum "bits" { + value 255; + description + "bitsport"; + } + enum "docsCableUpstreamRfPort" { + value 256; + description + "DOCSIS CATV Upstream RF Port"; + } + enum "cableDownstreamRfPort" { + value 257; + description + "CATV downstream RF port"; + } + enum "vmwareVirtualNic" { + value 258; + description + "VMware Virtual Network Interface"; + } + enum "ieee802154" { + value 259; + description + "IEEE 802.15.4 WPAN interface"; + reference + "IEEE 802.15.4-2006"; + } + enum "otnOdu" { + value 260; + description + "OTN Optical Data Unit"; + } + enum "otnOtu" { + value 261; + description + "OTN Optical channel Transport Unit"; + } + enum "ifVfiType" { + value 262; + description + "VPLS Forwarding Instance Interface Type"; + } + enum "g9981" { + value 263; + description + "G.998.1 bonded interface"; + } + enum "g9982" { + value 264; + description + "G.998.2 bonded interface"; + } + enum "g9983" { + value 265; + description + "G.998.3 bonded interface"; + } + enum "aluEpon" { + value 266; + description + "Ethernet Passive Optical Networks (E-PON)"; + } + enum "aluEponOnu" { + value 267; + description + "EPON Optical Network Unit"; + } + enum "aluEponPhysicalUni" { + value 268; + description + "EPON physical User to Network interface"; + } + enum "aluEponLogicalLink" { + value 269; + description + "The emulation of a point-to-point link over the EPON + layer"; + } + enum "aluGponOnu" { + value 270; + description + "GPON Optical Network Unit"; + reference + "ITU-T G.984.2"; + } + enum "aluGponPhysicalUni" { + value 271; + description + "GPON physical User to Network interface"; + reference + "ITU-T G.984.2"; + } + enum "vmwareNicTeam" { + value 272; + description + "VMware NIC Team"; + } + // value 273 reserved by IANA + } + description + "This data type is used as the syntax of the 'type' + leaf in the 'interface' list in the YANG module + ietf-interface. + + The definition of this typedef with the + addition of newly assigned values is published + periodically by the IANA, in either the Assigned + Numbers RFC, or some derivative of it specific to + Internet Network Management number assignments. (The + latest arrangements can be obtained by contacting the + IANA.) + + Requests for new values should be made to IANA via + email (iana&iana.org)."; + reference + "IANA ifType definitions registry. + <http://www.iana.org/assignments/smi-numbers>"; + } +}
\ No newline at end of file diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/modules/modules-behind-mount-point/ietf-inet-types.yang b/netconf/restconf/restconf-nb-bierman02/src/test/resources/modules/modules-behind-mount-point/ietf-inet-types.yang new file mode 100644 index 0000000..de20feb --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/modules/modules-behind-mount-point/ietf-inet-types.yang @@ -0,0 +1,418 @@ + module ietf-inet-types { + + namespace "urn:ietf:params:xml:ns:yang:ietf-inet-types"; + prefix "inet"; + + organization + "IETF NETMOD (NETCONF Data Modeling Language) Working Group"; + + contact + "WG Web: <http://tools.ietf.org/wg/netmod/> + WG List: <mailto:netmod@ietf.org> + + WG Chair: David Partain + <mailto:david.partain@ericsson.com> + + WG Chair: David Kessens + <mailto:david.kessens@nsn.com> + + Editor: Juergen Schoenwaelder + <mailto:j.schoenwaelder@jacobs-university.de>"; + + description + "This module contains a collection of generally useful derived + YANG data types for Internet addresses and related things. + + Copyright (c) 2010 IETF Trust and the persons identified as + authors of the code. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, is permitted pursuant to, and subject to the license + terms contained in, the Simplified BSD License set forth in Section + 4.c of the IETF Trust's Legal Provisions Relating to IETF Documents + (http://trustee.ietf.org/license-info). + + This version of this YANG module is part of RFC 6021; see + the RFC itself for full legal notices."; + + revision 2010-09-24 { + description + "Initial revision."; + reference + "RFC 6021: Common YANG Data Types"; + } + + /*** collection of protocol field related types ***/ + + typedef ip-version { + type enumeration { + enum unknown { + value "0"; + description + "An unknown or unspecified version of the Internet protocol."; + } + enum ipv4 { + value "1"; + description + "The IPv4 protocol as defined in RFC 791."; + } + enum ipv6 { + value "2"; + description + "The IPv6 protocol as defined in RFC 2460."; + } + } + description + "This value represents the version of the IP protocol. + + In the value set and its semantics, this type is equivalent + to the InetVersion textual convention of the SMIv2."; + reference + "RFC 791: Internet Protocol + RFC 2460: Internet Protocol, Version 6 (IPv6) Specification + RFC 4001: Textual Conventions for Internet Network Addresses"; + } + + typedef dscp { + type uint8 { + range "0..63"; + } + description + "The dscp type represents a Differentiated Services Code-Point + that may be used for marking packets in a traffic stream. + + In the value set and its semantics, this type is equivalent + to the Dscp textual convention of the SMIv2."; + reference + "RFC 3289: Management Information Base for the Differentiated + Services Architecture + RFC 2474: Definition of the Differentiated Services Field + (DS Field) in the IPv4 and IPv6 Headers + RFC 2780: IANA Allocation Guidelines For Values In + the Internet Protocol and Related Headers"; + } + + typedef ipv6-flow-label { + type uint32 { + range "0..1048575"; + } + description + "The flow-label type represents flow identifier or Flow Label + in an IPv6 packet header that may be used to discriminate + traffic flows. + + In the value set and its semantics, this type is equivalent + to the IPv6FlowLabel textual convention of the SMIv2."; + reference + "RFC 3595: Textual Conventions for IPv6 Flow Label + RFC 2460: Internet Protocol, Version 6 (IPv6) Specification"; + } + + typedef port-number { + type uint16 { + range "0..65535"; + } + description + "The port-number type represents a 16-bit port number of an + Internet transport layer protocol such as UDP, TCP, DCCP, or + SCTP. Port numbers are assigned by IANA. A current list of + all assignments is available from <http://www.iana.org/>. + + Note that the port number value zero is reserved by IANA. In + situations where the value zero does not make sense, it can + be excluded by subtyping the port-number type. + + In the value set and its semantics, this type is equivalent + to the InetPortNumber textual convention of the SMIv2."; + reference + "RFC 768: User Datagram Protocol + RFC 793: Transmission Control Protocol + RFC 4960: Stream Control Transmission Protocol + RFC 4340: Datagram Congestion Control Protocol (DCCP) + RFC 4001: Textual Conventions for Internet Network Addresses"; + } + + /*** collection of autonomous system related types ***/ + + typedef as-number { + type uint32; + description + "The as-number type represents autonomous system numbers + which identify an Autonomous System (AS). An AS is a set + of routers under a single technical administration, using + an interior gateway protocol and common metrics to route + packets within the AS, and using an exterior gateway + protocol to route packets to other ASs'. IANA maintains + the AS number space and has delegated large parts to the + regional registries. + + Autonomous system numbers were originally limited to 16 + bits. BGP extensions have enlarged the autonomous system + number space to 32 bits. This type therefore uses an uint32 + base type without a range restriction in order to support + a larger autonomous system number space. + + In the value set and its semantics, this type is equivalent + to the InetAutonomousSystemNumber textual convention of + the SMIv2."; + reference + "RFC 1930: Guidelines for creation, selection, and registration + of an Autonomous System (AS) + RFC 4271: A Border Gateway Protocol 4 (BGP-4) + RFC 4893: BGP Support for Four-octet AS Number Space + RFC 4001: Textual Conventions for Internet Network Addresses"; + } + + /*** collection of IP address and hostname related types ***/ + + typedef ip-address { + type union { + type inet:ipv4-address; + type inet:ipv6-address; + } + description + "The ip-address type represents an IP address and is IP + version neutral. The format of the textual representations + implies the IP version."; + } + + typedef ipv4-address { + type string { + 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])' + + '(%[\p{N}\p{L}]+)?'; + } + description + "The ipv4-address type represents an IPv4 address in + dotted-quad notation. The IPv4 address may include a zone + index, separated by a % sign. + + The zone index is used to disambiguate identical address + values. For link-local addresses, the zone index will + typically be the interface index number or the name of an + interface. If the zone index is not present, the default + zone of the device will be used. + + The canonical format for the zone index is the numerical + format"; + } + + typedef ipv6-address { + type string { + pattern '((:|[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}]+)?'; + pattern '(([^:]+:){6}(([^:]+:[^:]+)|(.*\..*)))|' + + '((([^:]+:)*[^:]+)?::(([^:]+:)*[^:]+)?)' + + '(%.+)?'; + } + description + "The ipv6-address type represents an IPv6 address in full, + mixed, shortened, and shortened-mixed notation. The IPv6 + address may include a zone index, separated by a % sign. + + The zone index is used to disambiguate identical address + values. For link-local addresses, the zone index will + typically be the interface index number or the name of an + interface. If the zone index is not present, the default + zone of the device will be used. + + The canonical format of IPv6 addresses uses the compressed + format described in RFC 4291, Section 2.2, item 2 with the + following additional rules: the :: substitution must be + applied to the longest sequence of all-zero 16-bit chunks + in an IPv6 address. If there is a tie, the first sequence + of all-zero 16-bit chunks is replaced by ::. Single + all-zero 16-bit chunks are not compressed. The canonical + format uses lowercase characters and leading zeros are + not allowed. The canonical format for the zone index is + the numerical format as described in RFC 4007, Section + 11.2."; + reference + "RFC 4291: IP Version 6 Addressing Architecture + RFC 4007: IPv6 Scoped Address Architecture + RFC 5952: A Recommendation for IPv6 Address Text Representation"; + } + + typedef ip-prefix { + type union { + type inet:ipv4-prefix; + type inet:ipv6-prefix; + } + description + "The ip-prefix type represents an IP prefix and is IP + version neutral. The format of the textual representations + implies the IP version."; + } + + typedef ipv4-prefix { + type string { + 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])' + + '/(([0-9])|([1-2][0-9])|(3[0-2]))'; + } + description + "The ipv4-prefix type represents an IPv4 address prefix. + The prefix length is given by the number following the + slash character and must be less than or equal to 32. + + A prefix length value of n corresponds to an IP address + mask that has n contiguous 1-bits from the most + significant bit (MSB) and all other bits set to 0. + + The canonical format of an IPv4 prefix has all bits of + the IPv4 address set to zero that are not part of the + IPv4 prefix."; + } + + typedef ipv6-prefix { + type string { + pattern '((:|[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])))'; + pattern '(([^:]+:){6}(([^:]+:[^:]+)|(.*\..*)))|' + + '((([^:]+:)*[^:]+)?::(([^:]+:)*[^:]+)?)' + + '(/.+)'; + } + description + "The ipv6-prefix type represents an IPv6 address prefix. + The prefix length is given by the number following the + slash character and must be less than or equal 128. + + A prefix length value of n corresponds to an IP address + mask that has n contiguous 1-bits from the most + significant bit (MSB) and all other bits set to 0. + + The IPv6 address should have all bits that do not belong + to the prefix set to zero. + + The canonical format of an IPv6 prefix has all bits of + the IPv6 address set to zero that are not part of the + IPv6 prefix. Furthermore, IPv6 address is represented + in the compressed format described in RFC 4291, Section + 2.2, item 2 with the following additional rules: the :: + substitution must be applied to the longest sequence of + all-zero 16-bit chunks in an IPv6 address. If there is + a tie, the first sequence of all-zero 16-bit chunks is + replaced by ::. Single all-zero 16-bit chunks are not + compressed. The canonical format uses lowercase + characters and leading zeros are not allowed."; + reference + "RFC 4291: IP Version 6 Addressing Architecture"; + } + + /*** collection of domain name and URI types ***/ + + typedef domain-name { + type string { + pattern '((([a-zA-Z0-9_]([a-zA-Z0-9\-_]){0,61})?[a-zA-Z0-9]\.)*' + + '([a-zA-Z0-9_]([a-zA-Z0-9\-_]){0,61})?[a-zA-Z0-9]\.?)' + + '|\.'; + length "1..253"; + } + description + "The domain-name type represents a DNS domain name. The + name SHOULD be fully qualified whenever possible. + + Internet domain names are only loosely specified. Section + 3.5 of RFC 1034 recommends a syntax (modified in Section + 2.1 of RFC 1123). The pattern above is intended to allow + for current practice in domain name use, and some possible + future expansion. It is designed to hold various types of + domain names, including names used for A or AAAA records + (host names) and other records, such as SRV records. Note + that Internet host names have a stricter syntax (described + in RFC 952) than the DNS recommendations in RFCs 1034 and + 1123, and that systems that want to store host names in + schema nodes using the domain-name type are recommended to + adhere to this stricter standard to ensure interoperability. + + The encoding of DNS names in the DNS protocol is limited + to 255 characters. Since the encoding consists of labels + prefixed by a length bytes and there is a trailing NULL + byte, only 253 characters can appear in the textual dotted + notation. + + The description clause of schema nodes using the domain-name + type MUST describe when and how these names are resolved to + IP addresses. Note that the resolution of a domain-name value + may require to query multiple DNS records (e.g., A for IPv4 + and AAAA for IPv6). The order of the resolution process and + which DNS record takes precedence can either be defined + explicitely or it may depend on the configuration of the + resolver. + + Domain-name values use the US-ASCII encoding. Their canonical + format uses lowercase US-ASCII characters. Internationalized + domain names MUST be encoded in punycode as described in RFC + 3492"; + reference + "RFC 952: DoD Internet Host Table Specification + RFC 1034: Domain Names - Concepts and Facilities + RFC 1123: Requirements for Internet Hosts -- Application + and Support + RFC 2782: A DNS RR for specifying the location of services + (DNS SRV) + RFC 3492: Punycode: A Bootstring encoding of Unicode for + Internationalized Domain Names in Applications + (IDNA) + RFC 5891: Internationalizing Domain Names in Applications + (IDNA): Protocol"; + } + + typedef host { + type union { + type inet:ip-address; + type inet:domain-name; + } + description + "The host type represents either an IP address or a DNS + domain name."; + } + + typedef uri { + type string; + description + "The uri type represents a Uniform Resource Identifier + (URI) as defined by STD 66. + + Objects using the uri type MUST be in US-ASCII encoding, + and MUST be normalized as described by RFC 3986 Sections + 6.2.1, 6.2.2.1, and 6.2.2.2. All unnecessary + percent-encoding is removed, and all case-insensitive + characters are set to lowercase except for hexadecimal + digits, which are normalized to uppercase as described in + Section 6.2.2.1. + + The purpose of this normalization is to help provide + unique URIs. Note that this normalization is not + sufficient to provide uniqueness. Two URIs that are + textually distinct after this normalization may still be + equivalent. + + Objects using the uri type may restrict the schemes that + they permit. For example, 'data:' and 'urn:' schemes + might not be appropriate. + + A zero-length URI is not a valid URI. This can be used to + express 'URI absent' where required. + + In the value set and its semantics, this type is equivalent + to the Uri SMIv2 textual convention defined in RFC 5017."; + reference + "RFC 3986: Uniform Resource Identifier (URI): Generic Syntax + RFC 3305: Report from the Joint W3C/IETF URI Planning Interest + Group: Uniform Resource Identifiers (URIs), URLs, + and Uniform Resource Names (URNs): Clarifications + and Recommendations + RFC 5017: MIB Textual Conventions for Uniform Resource + Identifiers (URIs)"; + } + + } diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/modules/modules-behind-mount-point/ietf-interfaces@2013-07-04.yang b/netconf/restconf/restconf-nb-bierman02/src/test/resources/modules/modules-behind-mount-point/ietf-interfaces@2013-07-04.yang new file mode 100644 index 0000000..9db753c --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/modules/modules-behind-mount-point/ietf-interfaces@2013-07-04.yang @@ -0,0 +1,673 @@ +module ietf-interfaces { + + namespace "urn:ietf:params:xml:ns:yang:ietf-interfaces"; + prefix if; + + import ietf-yang-types { + prefix yang; + } + import iana-if-type { + prefix ianaift; + } + + organization + "IETF NETMOD (NETCONF Data Modeling Language) Working Group"; + + contact + "WG Web: <http://tools.ietf.org/wg/netmod/> + WG List: <mailto:netmod@ietf.org> + + WG Chair: David Kessens + <mailto:david.kessens@nsn.com> + + WG Chair: Juergen Schoenwaelder + <mailto:j.schoenwaelder@jacobs-university.de> + + Editor: Martin Bjorklund + <mailto:mbj@tail-f.com>"; + + description + "This module contains a collection of YANG definitions for + managing network interfaces. + + Copyright (c) 2013 IETF Trust and the persons identified as + authors of the code. All rights reserved. + + Redistribution and use in source and binary forms, with or + without modification, is permitted pursuant to, and subject + to the license terms contained in, the Simplified BSD License + set forth in Section 4.c of the IETF Trust's Legal Provisions + Relating to IETF Documents + (http://trustee.ietf.org/license-info). + + This version of this YANG module is part of RFC XXXX; see + the RFC itself for full legal notices."; + + // RFC Ed.: replace XXXX with actual RFC number and remove this + // note. + + // RFC Ed.: update the date below with the date of RFC publication + // and remove this note. + revision 2013-07-04 { + description + "Initial revision."; + reference + "RFC XXXX: A YANG Data Model for Interface Management"; + } + + /* Typedefs */ + + typedef interface-ref { + type leafref { + path "/if:interfaces/if:interface/if:name"; + } + description + "This type is used by data models that need to reference + configured interfaces."; + } + + typedef interface-state-ref { + type leafref { + path "/if:interfaces-state/if:interface/if:name"; + } + description + "This type is used by data models that need to reference + the operationally present interfaces."; + } + + /* Features */ + + feature arbitrary-names { + description + "This feature indicates that the device allows user-controlled + interfaces to be named arbitrarily."; + } + + feature pre-provisioning { + description + "This feature indicates that the device supports + pre-provisioning of interface configuration, i.e., it is + possible to configure an interface whose physical interface + hardware is not present on the device."; + } + + feature if-mib { + description + "This feature indicates that the device implements IF-MIB."; + reference + "RFC 2863: The Interfaces Group MIB"; + } + + /* Data nodes */ + + container interfaces { + description + "Interface configuration parameters."; + + list interface { + key "name"; + + description + "The list of configured interfaces on the device. + + The operational state of an interface is available in the + /interfaces-state/interface list. If the configuration of a + system-controlled interface cannot be used by the system + (e.g., the interface hardware present does not match the + interface type), then the configuration is not applied to + the system-controlled interface shown in the + /interfaces-state/interface list. If the the configuration + of a user-controlled interface cannot be used by the system, + the configured interface is not instantiated in the + /interfaces-state/interface list."; + + leaf name { + type string; + description + "The name of the interface. + + A device MAY restrict the allowed values for this leaf, + possibly depending on the type of the interface. + + For system-controlled interfaces, this leaf is the + device-specific name of the interface. The 'config false' + list /interfaces-state/interface contains the currently + existing interfaces on the device. + + If a client tries to create configuration for a + system-controlled interface that is not present in the + /interfaces-state/interface list, the server MAY reject + the request, if the implementation does not support + pre-provisioning of interfaces, or if the name refers to + an interface that can never exist in the system. A + NETCONF server MUST reply with an rpc-error with the + error-tag 'invalid-value' in this case. + + If the device supports pre-provisioning of interface + configuration, the feature 'pre-provisioning' is + advertised. + + If the device allows arbitrarily named user-controlled + interfaces, the feature 'arbitrary-names' is advertised. + + When a configured user-controlled interface is created by + the system, it is instantiated with the same name in the + /interface-state/interface list. Since the name in that + list MAY be mapped to ifName by an implementation, such an + implementation MUST restrict the allowed values for this + leaf so that it matches the restrictions of ifName. + + If a NETCONF server that implements this restriction is + sent a value that doesn't match the restriction, it MUST + reply with an rpc-error with the error-tag + 'invalid-value'."; + } + + leaf description { + type string; + description + "A textual description of the interface. + + This leaf MAY be mapped to ifAlias by an implementation. + Such an implementation MUST restrict the allowed values + for this leaf so that it matches the restrictions of + ifAlias. + + If a NETCONF server that implements this restriction is + sent a value that doesn't match the restriction, it MUST + reply with an rpc-error with the error-tag + 'invalid-value'. + + Since ifAlias is defined to be stored in non-volatile + storage, the MIB implementation MUST map ifAlias to the + value of 'description' in the persistently stored + datastore. + + Specifically, if the device supports ':startup', when + ifAlias is read the device MUST return the value of + 'description' in the 'startup' datastore, and when it is + written, it MUST be written to the 'running' and 'startup' + datastores. Note that it is up to the implementation if + it modifies this single leaf in 'startup', or if it + performs an implicit copy-config from 'running' to + 'startup'. + + If the device does not support ':startup', ifAlias MUST + be mapped to the 'description' leaf in the 'running' + datastore."; + reference + "RFC 2863: The Interfaces Group MIB - ifAlias"; + } + + leaf type { + type ianaift:iana-if-type; + mandatory true; + description + "The type of the interface. + + When an interface entry is created, a server MAY + initialize the type leaf with a valid value, e.g., if it + is possible to derive the type from the name of the + interface. + + If a client tries to set the type of an interface to a + value that can never be used by the system, e.g., if the + type is not supported or if the type does not match the + name of the interface, the server MUST reject the request. + A NETCONF server MUST reply with an rpc-error with the + error-tag 'invalid-value' in this case."; + reference + "RFC 2863: The Interfaces Group MIB - ifType"; + } + + leaf enabled { + type boolean; + default "true"; + description + "This leaf contains the configured, desired state of the + interface. + + Systems that implement the IF-MIB use the value of this + leaf in the 'running' datastore to set + IF-MIB.ifAdminStatus to 'up' or 'down' after an ifEntry + has been initialized, as described in RFC 2863. + + Changes in this leaf in the 'running' datastore are + reflected in ifAdminStatus, but if ifAdminStatus is + changed over SNMP, this leaf is not affected."; + reference + "RFC 2863: The Interfaces Group MIB - ifAdminStatus"; + } + + leaf link-up-down-trap-enable { + if-feature if-mib; + type enumeration { + enum enabled { + value 1; + } + enum disabled { + value 2; + } + } + description + "Controls whether linkUp/linkDown SNMP notifications + should be generated for this interface. + + If this node is not configured, the value 'enabled' is + operationally used by the server for interfaces which do + not operate on top of any other interface (i.e., there are + no 'lower-layer-if' entries), and 'disabled' otherwise."; + reference + "RFC 2863: The Interfaces Group MIB - + ifLinkUpDownTrapEnable"; + } + } + } + + container interfaces-state { + config false; + description + "Data nodes for the operational state of interfaces."; + + list interface { + key "name"; + + description + "The list of interfaces on the device. + + System-controlled interfaces created by the system are + always present in this list, whether they are configured or + not."; + + leaf name { + type string; + description + "The name of the interface. + + This leaf MAY be mapped to ifName by an implementation."; + reference + "RFC 2863: The Interfaces Group MIB - ifName"; + } + + leaf type { + type ianaift:iana-if-type; + mandatory true; + description + "The type of the interface."; + reference + "RFC 2863: The Interfaces Group MIB - ifType"; + } + + leaf admin-status { + if-feature if-mib; + type enumeration { + enum up { + value 1; + description + "Ready to pass packets."; + } + enum down { + value 2; + description + "Not ready to pass packets and not in some test mode."; + } + enum testing { + value 3; + description + "In some test mode."; + } + } + mandatory true; + description + "The desired state of the interface. + + This leaf has the same read semantics as ifAdminStatus."; + reference + "RFC 2863: The Interfaces Group MIB - ifAdminStatus"; + } + + leaf oper-status { + type enumeration { + enum up { + value 1; + description + "Ready to pass packets."; + } + enum down { + value 2; + description + "The interface does not pass any packets."; + } + enum testing { + value 3; + description + "In some test mode. No operational packets can + be passed."; + } + enum unknown { + value 4; + description + "Status cannot be determined for some reason."; + } + enum dormant { + value 5; + description + "Waiting for some external event."; + } + enum not-present { + value 6; + description + "Some component (typically hardware) is missing."; + } + enum lower-layer-down { + value 7; + description + "Down due to state of lower-layer interface(s)."; + } + } + mandatory true; + description + "The current operational state of the interface. + + This leaf has the same semantics as ifOperStatus."; + reference + "RFC 2863: The Interfaces Group MIB - ifOperStatus"; + } + + leaf last-change { + type yang:date-and-time; + description + "The time the interface entered its current operational + state. If the current state was entered prior to the + last re-initialization of the local network management + subsystem, then this node is not present."; + reference + "RFC 2863: The Interfaces Group MIB - ifLastChange"; + } + + leaf if-index { + if-feature if-mib; + type int32 { + range "1..2147483647"; + } + mandatory true; + description + "The ifIndex value for the ifEntry represented by this + interface."; + reference + "RFC 2863: The Interfaces Group MIB - ifIndex"; + } + + leaf phys-address { + type yang:phys-address; + description + "The interface's address at its protocol sub-layer. For + example, for an 802.x interface, this object normally + contains a MAC address. The interface's media-specific + modules must define the bit and byte ordering and the + format of the value of this object. For interfaces that do + not have such an address (e.g., a serial line), this node + is not present."; + reference + "RFC 2863: The Interfaces Group MIB - ifPhysAddress"; + } + + leaf-list higher-layer-if { + type interface-state-ref; + description + "A list of references to interfaces layered on top of this + interface."; + reference + "RFC 2863: The Interfaces Group MIB - ifStackTable"; + } + + leaf-list lower-layer-if { + type interface-state-ref; + description + "A list of references to interfaces layered underneath this + interface."; + reference + "RFC 2863: The Interfaces Group MIB - ifStackTable"; + } + + leaf speed { + type yang:gauge64; + units "bits / second"; + description + "An estimate of the interface's current bandwidth in bits + per second. For interfaces that do not vary in + bandwidth or for those where no accurate estimation can + be made, this node should contain the nominal bandwidth. + For interfaces that have no concept of bandwidth, this + node is not present."; + reference + "RFC 2863: The Interfaces Group MIB - + ifSpeed, ifHighSpeed"; + } + + container statistics { + description + "A collection of interface-related statistics objects."; + + leaf discontinuity-time { + type yang:date-and-time; + mandatory true; + description + "The time on the most recent occasion at which any one or + more of this interface's counters suffered a + discontinuity. If no such discontinuities have occurred + since the last re-initialization of the local management + subsystem, then this node contains the time the local + management subsystem re-initialized itself."; + } + + leaf in-octets { + type yang:counter64; + description + "The total number of octets received on the interface, + including framing characters. + + Discontinuities in the value of this counter can occur + at re-initialization of the management system, and at + other times as indicated by the value of + 'discontinuity-time'."; + reference + "RFC 2863: The Interfaces Group MIB - ifHCInOctets"; + } + leaf in-unicast-pkts { + type yang:counter64; + description + "The number of packets, delivered by this sub-layer to a + higher (sub-)layer, which were not addressed to a + multicast or broadcast address at this sub-layer. + + Discontinuities in the value of this counter can occur + at re-initialization of the management system, and at + other times as indicated by the value of + 'discontinuity-time'."; + reference + "RFC 2863: The Interfaces Group MIB - ifHCInUcastPkts"; + } + leaf in-broadcast-pkts { + type yang:counter64; + description + "The number of packets, delivered by this sub-layer to a + higher (sub-)layer, which were addressed to a broadcast + address at this sub-layer. + + Discontinuities in the value of this counter can occur + at re-initialization of the management system, and at + other times as indicated by the value of + 'discontinuity-time'."; + reference + "RFC 2863: The Interfaces Group MIB - + ifHCInBroadcastPkts"; + } + leaf in-multicast-pkts { + type yang:counter64; + description + "The number of packets, delivered by this sub-layer to a + higher (sub-)layer, which were addressed to a multicast + address at this sub-layer. For a MAC layer protocol, + this includes both Group and Functional addresses. + + Discontinuities in the value of this counter can occur + at re-initialization of the management system, and at + other times as indicated by the value of + 'discontinuity-time'."; + reference + "RFC 2863: The Interfaces Group MIB - + ifHCInMulticastPkts"; + } + leaf in-discards { + type yang:counter32; + description + "The number of inbound packets which were chosen to be + discarded even though no errors had been detected to + prevent their being deliverable to a higher-layer + protocol. One possible reason for discarding such a + packet could be to free up buffer space. + + Discontinuities in the value of this counter can occur + at re-initialization of the management system, and at + other times as indicated by the value of + 'discontinuity-time'."; + reference + "RFC 2863: The Interfaces Group MIB - ifInDiscards"; + } + leaf in-errors { + type yang:counter32; + description + "For packet-oriented interfaces, the number of inbound + packets that contained errors preventing them from being + deliverable to a higher-layer protocol. For character- + oriented or fixed-length interfaces, the number of + inbound transmission units that contained errors + preventing them from being deliverable to a higher-layer + protocol. + + Discontinuities in the value of this counter can occur + at re-initialization of the management system, and at + other times as indicated by the value of + 'discontinuity-time'."; + reference + "RFC 2863: The Interfaces Group MIB - ifInErrors"; + } + leaf in-unknown-protos { + type yang:counter32; + description + "For packet-oriented interfaces, the number of packets + received via the interface which were discarded because + of an unknown or unsupported protocol. For + character-oriented or fixed-length interfaces that + support protocol multiplexing the number of transmission + units received via the interface which were discarded + because of an unknown or unsupported protocol. For any + interface that does not support protocol multiplexing, + this counter is not present. + Discontinuities in the value of this counter can occur + at re-initialization of the management system, and at + other times as indicated by the value of + 'discontinuity-time'."; + reference + "RFC 2863: The Interfaces Group MIB - ifInUnknownProtos"; + } + + leaf out-octets { + type yang:counter64; + description + "The total number of octets transmitted out of the + interface, including framing characters. + + Discontinuities in the value of this counter can occur + at re-initialization of the management system, and at + other times as indicated by the value of + 'discontinuity-time'."; + reference + "RFC 2863: The Interfaces Group MIB - ifHCOutOctets"; + } + leaf out-unicast-pkts { + type yang:counter64; + description + "The total number of packets that higher-level protocols + requested be transmitted, and which were not addressed + to a multicast or broadcast address at this sub-layer, + including those that were discarded or not sent. + + Discontinuities in the value of this counter can occur + at re-initialization of the management system, and at + other times as indicated by the value of + 'discontinuity-time'."; + reference + "RFC 2863: The Interfaces Group MIB - ifHCOutUcastPkts"; + } + leaf out-broadcast-pkts { + type yang:counter64; + description + "The total number of packets that higher-level protocols + requested be transmitted, and which were addressed to a + broadcast address at this sub-layer, including those + that were discarded or not sent. + + Discontinuities in the value of this counter can occur + at re-initialization of the management system, and at + other times as indicated by the value of + 'discontinuity-time'."; + reference + "RFC 2863: The Interfaces Group MIB - + ifHCOutBroadcastPkts"; + } + leaf out-multicast-pkts { + type yang:counter64; + description + "The total number of packets that higher-level protocols + requested be transmitted, and which were addressed to a + multicast address at this sub-layer, including those + that were discarded or not sent. For a MAC layer + protocol, this includes both Group and Functional + addresses. + + Discontinuities in the value of this counter can occur + at re-initialization of the management system, and at + other times as indicated by the value of + 'discontinuity-time'."; + reference + "RFC 2863: The Interfaces Group MIB - + ifHCOutMulticastPkts"; + } + leaf out-discards { + type yang:counter32; + description + "The number of outbound packets which were chosen to be + discarded even though no errors had been detected to + prevent their being transmitted. One possible reason + for discarding such a packet could be to free up buffer + space. + + Discontinuities in the value of this counter can occur + at re-initialization of the management system, and at + other times as indicated by the value of + 'discontinuity-time'."; + reference + "RFC 2863: The Interfaces Group MIB - ifOutDiscards"; + } + leaf out-errors { + type yang:counter32; + description + "For packet-oriented interfaces, the number of outbound + packets that could not be transmitted because of errors. + For character-oriented or fixed-length interfaces, the + number of outbound transmission units that could not be + transmitted because of errors. + + Discontinuities in the value of this counter can occur + at re-initialization of the management system, and at + other times as indicated by the value of + 'discontinuity-time'."; + reference + "RFC 2863: The Interfaces Group MIB - ifOutErrors"; + } + } + } + } +}
\ No newline at end of file diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/modules/modules-behind-mount-point/ietf-restconf-monitoring@2017-01-26.yang b/netconf/restconf/restconf-nb-bierman02/src/test/resources/modules/modules-behind-mount-point/ietf-restconf-monitoring@2017-01-26.yang new file mode 100644 index 0000000..55c3cb1 --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/modules/modules-behind-mount-point/ietf-restconf-monitoring@2017-01-26.yang @@ -0,0 +1,149 @@ +module ietf-restconf-monitoring { + namespace "urn:ietf:params:xml:ns:yang:ietf-restconf-monitoring"; + prefix "rcmon"; + + import ietf-yang-types { prefix yang; } + import ietf-inet-types { prefix inet; } + + organization + "IETF NETCONF (Network Configuration) Working Group"; + + contact + "WG Web: <https://datatracker.ietf.org/wg/netconf/> + WG List: <mailto:netconf@ietf.org> + + Author: Andy Bierman + <mailto:andy@yumaworks.com> + + Author: Martin Bjorklund + <mailto:mbj@tail-f.com> + + Author: Kent Watsen + <mailto:kwatsen@juniper.net>"; + + description + "This module contains monitoring information for the + RESTCONF protocol. + + Copyright (c) 2017 IETF Trust and the persons identified as + authors of the code. All rights reserved. + + Redistribution and use in source and binary forms, with or + without modification, is permitted pursuant to, and subject + to the license terms contained in, the Simplified BSD License + set forth in Section 4.c of the IETF Trust's Legal Provisions + Relating to IETF Documents + (http://trustee.ietf.org/license-info). + + This version of this YANG module is part of RFC 8040; see + the RFC itself for full legal notices."; + + revision 2017-01-26 { + description + "Initial revision."; + reference + "RFC 8040: RESTCONF Protocol."; + } + + container restconf-state { + config false; + description + "Contains RESTCONF protocol monitoring information."; + + container capabilities { + description + "Contains a list of protocol capability URIs."; + + leaf-list capability { + type inet:uri; + description + "A RESTCONF protocol capability URI."; + } + } + + container streams { + description + "Container representing the notification event streams + supported by the server."; + reference + "RFC 5277, Section 3.4, <streams> element."; + + list stream { + key name; + description + "Each entry describes an event stream supported by + the server."; + + leaf name { + type string; + description + "The stream name."; + reference + "RFC 5277, Section 3.4, <name> element."; + } + + leaf description { + type string; + description + "Description of stream content."; + reference + "RFC 5277, Section 3.4, <description> element."; + } + + leaf replay-support { + type boolean; + default false; + description + "Indicates if replay buffer is supported for this stream. + If 'true', then the server MUST support the 'start-time' + and 'stop-time' query parameters for this stream."; + reference + "RFC 5277, Section 3.4, <replaySupport> element."; + } + + leaf replay-log-creation-time { + when "../replay-support" { + description + "Only present if notification replay is supported."; + } + type yang:date-and-time; + description + "Indicates the time the replay log for this stream + was created."; + reference + "RFC 5277, Section 3.4, <replayLogCreationTime> + element."; + } + + list access { + key encoding; + min-elements 1; + description + "The server will create an entry in this list for each + encoding format that is supported for this stream. + The media type 'text/event-stream' is expected + for all event streams. This list identifies the + subtypes supported for this stream."; + + leaf encoding { + type string; + description + "This is the secondary encoding format within the + 'text/event-stream' encoding used by all streams. + The type 'xml' is supported for XML encoding. + The type 'json' is supported for JSON encoding."; + } + + leaf location { + type inet:uri; + mandatory true; + description + "Contains a URL that represents the entry point + for establishing notification delivery via + server-sent events."; + } + } + } + } + } +} diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/modules/modules-behind-mount-point/ietf-restconf@2013-10-19.yang b/netconf/restconf/restconf-nb-bierman02/src/test/resources/modules/modules-behind-mount-point/ietf-restconf@2013-10-19.yang new file mode 100644 index 0000000..16766b0 --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/modules/modules-behind-mount-point/ietf-restconf@2013-10-19.yang @@ -0,0 +1,684 @@ +module ietf-restconf { + namespace "urn:ietf:params:xml:ns:yang:ietf-restconf"; + prefix "restconf"; + + import ietf-yang-types { prefix yang; } + import ietf-inet-types { prefix inet; } + + organization + "IETF NETCONF (Network Configuration) Working Group"; + + contact + "Editor: Andy Bierman + <mailto:andy@yumaworks.com> + + Editor: Martin Bjorklund + <mailto:mbj@tail-f.com> + + Editor: Kent Watsen + <mailto:kwatsen@juniper.net> + + Editor: Rex Fernando + <mailto:rex@cisco.com>"; + + description + "This module contains conceptual YANG specifications + for the YANG Patch and error content that is used in + RESTCONF protocol messages. A conceptual container + representing the RESTCONF API nodes (media type + application/yang.api). + + Note that the YANG definitions within this module do not + represent configuration data of any kind. + The YANG grouping statements provide a normative syntax + for XML and JSON message encoding purposes. + Copyright (c) 2013 IETF Trust and the persons identified as + authors of the code. All rights reserved. + + Redistribution and use in source and binary forms, with or + without modification, is permitted pursuant to, and subject + to the license terms contained in, the Simplified BSD License + set forth in Section 4.c of the IETF Trust's Legal Provisions + Relating to IETF Documents + (http://trustee.ietf.org/license-info). + + This version of this YANG module is part of RFC XXXX; see + the RFC itself for full legal notices."; + + // RFC Ed.: replace XXXX with actual RFC number and remove this + // note. + + // RFC Ed.: remove this note + // Note: extracted from draft-bierman-netconf-restconf-02.txt + + // RFC Ed.: update the date below with the date of RFC publication + // and remove this note. + revision 2013-10-19 { + description + "Initial revision."; + reference + "RFC XXXX: RESTCONF Protocol."; + } + + typedef data-resource-identifier { + type string { + length "1 .. max"; + } + description + "Contains a Data Resource Identifier formatted string + to identify a specific data node. The data node that + uses this data type SHOULD define the document root + for data resource identifiers. The default document + root is the target datastore conceptual root node. + Data resource identifiers are defined relative to + this document root."; + reference + "RFC XXXX: [sec. 5.3.1.1 ABNF For Data Resource Identifiers]"; + } + + // this typedef is TBD; not currently used + typedef datastore-identifier { + type union { + type enumeration { + enum candidate { + description + "Identifies the NETCONF shared candidate datastore."; + reference + "RFC 6241, section 8.3"; + } + enum running { + description + "Identifies the NETCONF running datastore."; + reference + "RFC 6241, section 5.1"; + } + enum startup { + description + "Identifies the NETCONF startup datastore."; + reference + "RFC 6241, section 8.7"; + } + } + type string; + } + description + "Contains a string to identify a specific datastore. + The enumerated datastore identifier values are + reserved for standard datastore names."; + } + + typedef revision-identifier { + type string { + pattern '\d{4}-\d{2}-\d{2}'; + } + description + "Represents a specific date in YYYY-MM-DD format. + TBD: make pattern more precise to exclude leading zeros."; + } + + grouping yang-patch { + description + "A grouping that contains a YANG container + representing the syntax and semantics of a + YANG Patch edit request message."; + + container yang-patch { + description + "Represents a conceptual sequence of datastore edits, + called a patch. Each patch is given a client-assigned + patch identifier. Each edit MUST be applied + in ascending order, and all edits MUST be applied. + If any errors occur, then the target datastore MUST NOT + be changed by the patch operation. + + A patch MUST be validated by the server to be a + well-formed message before any of the patch edits + are validated or attempted. + + YANG datastore validation (defined in RFC 6020, section + 8.3.3) is performed after all edits have been + individually validated. + + It is possible for a datastore constraint violation to occur + due to any node in the datastore, including nodes not + included in the edit list. Any validation errors MUST + be reported in the reply message."; + + reference + "RFC 6020, section 8.3."; + + leaf patch-id { + type string; + description + "An arbitrary string provided by the client to identify + the entire patch. This value SHOULD be present in any + audit logging records generated by the server for the + patch. Error messages returned by the server pertaining + to this patch will be identified by this patch-id value."; + } + + leaf comment { + type string { + length "0 .. 1024"; + } + description + "An arbitrary string provided by the client to describe + the entire patch. This value SHOULD be present in any + audit logging records generated by the server for the + patch."; + } + + list edit { + key edit-id; + ordered-by user; + + description + "Represents one edit within the YANG Patch + request message."; + leaf edit-id { + type string; + description + "Arbitrary string index for the edit. + Error messages returned by the server pertaining + to a specific edit will be identified by this + value."; + } + + leaf operation { + type enumeration { + enum create { + description + "The target data node is created using the + supplied value, only if it does not already + exist."; + } + enum delete { + description + "Delete the target node, only if the data resource + currently exists, otherwise return an error."; + } + enum insert { + description + "Insert the supplied value into a user-ordered + list or leaf-list entry. The target node must + represent a new data resource."; + } + enum merge { + description + "The supplied value is merged with the target data + node."; + } + enum move { + description + "Move the target node. Reorder a user-ordered + list or leaf-list. The target node must represent + an existing data resource."; + } + enum replace { + description + "The supplied value is used to replace the target + data node."; + } + enum remove { + description + "Delete the target node if it currently exists."; + } + } + mandatory true; + description + "The datastore operation requested for the associated + edit entry"; + } + + leaf target { + type data-resource-identifier; + mandatory true; + description + "Identifies the target data resource for the edit + operation."; + } + + leaf point { + when "(../operation = 'insert' or " + + "../operation = 'move') and " + + "(../where = 'before' or ../where = 'after')" { + description + "Point leaf only applies for insert or move + operations, before or after an existing entry."; + } + type data-resource-identifier; + description + "The absolute URL path for the data node that is being + used as the insertion point or move point for the + target of this edit entry."; + } + + leaf where { + when "../operation = 'insert' or ../operation = 'move'" { + description + "Where leaf only applies for insert or move + operations."; + } + type enumeration { + enum before { + description + "Insert or move a data node before the data resource + identified by the 'point' parameter."; + } + enum after { + description + "Insert or move a data node after the data resource + identified by the 'point' parameter."; + } + enum first { + description + "Insert or move a data node so it becomes ordered + as the first entry."; + } + enum last { + description + "Insert or move a data node so it becomes ordered + as the last entry."; + } + + } + default last; + description + "Identifies where a data resource will be inserted or + moved. YANG only allows these operations for + list and leaf-list data nodes that are ordered-by + user."; + } + + anyxml value { + when "(../operation = 'create' or " + + "../operation = 'merge' " + + "or ../operation = 'replace' or " + + "../operation = 'insert')" { + description + "Value node only used for create, merge, + replace, and insert operations"; + } + description + "Value used for this edit operation."; + } + } + } + + } // grouping yang-patch + + + grouping yang-patch-status { + + description + "A grouping that contains a YANG container + representing the syntax and semantics of + YANG Patch status response message."; + + container yang-patch-status { + description + "A container representing the response message + sent by the server after a YANG Patch edit + request message has been processed."; + + leaf patch-id { + type string; + description + "The patch-id value used in the request"; + } + + choice global-status { + description + "Report global errors or complete success. + If there is no case selected then errors + are reported in the edit-status container."; + + case global-errors { + uses errors; + description + "This container will be present if global + errors unrelated to a specific edit occurred."; + } + leaf ok { + type empty; + description + "This leaf will be present if the request succeeded + and there are no errors reported in the edit-status + container."; + } + } + + container edit-status { + description + "This container will be present if there are + edit-specific status responses to report."; + + list edit { + key edit-id; + + description + "Represents a list of status responses, + corresponding to edits in the YANG Patch + request message. If an edit entry was + skipped or not reached by the server, + then this list will not contain a corresponding + entry for that edit."; + + leaf edit-id { + type string; + description + "Response status is for the edit list entry + with this edit-id value."; + } + choice edit-status-choice { + description + "A choice between different types of status + responses for each edit entry."; + leaf ok { + type empty; + description + "This edit entry was invoked without any + errors detected by the server associated + with this edit."; + } + leaf location { + type inet:uri; + description + "Contains the Location header value that would be + returned if this edit causes a new resource to be + created. If the edit identified by the same edit-id + value was successfully invoked and a new resource + was created, then this field will be returned + instead of 'ok'."; + } + case errors { + uses errors; + description + "The server detected errors associated with the + edit identified by the same edit-id value."; + } + } + } + } + } + } // grouping yang-patch-status + + + grouping errors { + + description + "A grouping that contains a YANG container + representing the syntax and semantics of a + YANG Patch errors report within a response message."; + + container errors { + config false; // needed so list error does not need a key + description + "Represents an error report returned by the server if + a request results in an error."; + + list error { + description + "An entry containing information about one + specific error that occurred while processing + a RESTCONF request."; + reference "RFC 6241, Section 4.3"; + + leaf error-type { + type enumeration { + enum transport { + description "The transport layer"; + } + enum rpc { + description "The rpc or notification layer"; + } + enum protocol { + description "The protocol operation layer"; + } + enum application { + description "The server application layer"; + } + } + mandatory true; + description + "The protocol layer where the error occurred."; + } + + leaf error-tag { + type string; + mandatory true; + description + "The enumerated error tag."; + } + + leaf error-app-tag { + type string; + description + "The application-specific error tag."; + } + + leaf error-path { + type data-resource-identifier; + description + "The target data resource identifier associated + with the error, if any."; + } + leaf error-message { + type string; + description + "A message describing the error."; + } + + container error-info { + description + "A container allowing additional information + to be included in the error report."; + // arbitrary anyxml content here + } + } + } + } // grouping errors + + + grouping restconf { + + description + "A grouping that contains a YANG container + representing the syntax and semantics of + the RESTCONF API resource."; + + container restconf { + description + "Conceptual container representing the + application/yang.api resource type."; + + container config { + description + "Container representing the application/yang.datastore + resource type. Represents the conceptual root of the + unified configuration datastore containing YANG data + nodes. The child nodes of this container are + configuration data resources (application/yang.data) + defined as top-level YANG data nodes from the modules + advertised by the server in /restconf/modules."; + } + + container operational { + description + "Container representing the application/yang.datastore + resource type. Represents the conceptual root of the + operational data supported by the server. The child + nodes of this container are operational data resources + (application/yang.data) defined as top-level + YANG data nodes from the modules advertised by + the server in /restconf/modules."; + } + + container modules { + description + "Contains a list of module description entries. + These modules are currently loaded into the server."; + + list module { + key "name revision"; + description + "Each entry represents one module currently + supported by the server."; + + leaf name { + type yang:yang-identifier; + description "The YANG module name."; + } + leaf revision { + type union { + type revision-identifier; + type string { length 0; } + } + description + "The YANG module revision date. An empty string is + used if no revision statement is present in the + YANG module."; + } + leaf namespace { + type inet:uri; + mandatory true; + description + "The XML namespace identifier for this module."; + } + leaf-list feature { + type yang:yang-identifier; + description + "List of YANG feature names from this module that are + supported by the server."; + } + leaf-list deviation { + type yang:yang-identifier; + description + "List of YANG deviation module names used by this + server to modify the conformance of the module + associated with this entry."; + } + } + } + + container operations { + description + "Container for all operation resources + (application/yang.operation), + + Each resource is represented as an empty leaf with the + name of the RPC operation from the YANG rpc statement. + + E.g.; + + POST /restconf/operations/show-log-errors + + leaf show-log-errors { + type empty; + } + "; + } + + container streams { + description + "Container representing the notification event streams + supported by the server."; + reference + "RFC 5277, Section 3.4, <streams> element."; + + list stream { + key name; + description + "Each entry describes an event stream supported by + the server."; + + leaf name { + type string; + description "The stream name"; + reference "RFC 5277, Section 3.4, <name> element."; + } + + leaf description { + type string; + description "Description of stream content"; + reference + "RFC 5277, Section 3.4, <description> element."; + } + + leaf replay-support { + type boolean; + description + "Indicates if replay buffer supported for this stream"; + reference + "RFC 5277, Section 3.4, <replaySupport> element."; + } + + leaf replay-log-creation-time { + type yang:date-and-time; + description + "Indicates the time the replay log for this stream + was created."; + reference + "RFC 5277, Section 3.4, <replayLogCreationTime> + element."; + } + + leaf events { + type empty; + description + "Represents the entry point for establishing + notification delivery via server sent events."; + } + } + } + + leaf version { + type enumeration { + enum "1.0" { + description + "Version 1.0 of the RESTCONF protocol."; + } + } + config false; + description + "Contains the RESTCONF protocol version."; + } + } + } // grouping restconf + + + grouping notification { + description + "Contains the notification message wrapper definition."; + + container notification { + description + "RESTCONF notification message wrapper."; + leaf event-time { + type yang:date-and-time; + mandatory true; + description + "The time the event was generated by the + event source."; + reference + "RFC 5277, section 4, <eventTime> element."; + } + + /* The YANG-specific notification container is encoded + * after the 'event-time' element. The format + * corresponds to the notificationContent element + * in RFC 5277, section 4. For example: + * + * module example-one { + * ... + * notification event1 { ... } + * + * } + * + * Encoded as element 'event1' in the namespace + * for module 'example-one'. + */ + } + } // grouping notification + + }
\ No newline at end of file diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/modules/modules-behind-mount-point/ietf-yang-library@2016-06-21.yang b/netconf/restconf/restconf-nb-bierman02/src/test/resources/modules/modules-behind-mount-point/ietf-yang-library@2016-06-21.yang new file mode 100644 index 0000000..bc466ee --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/modules/modules-behind-mount-point/ietf-yang-library@2016-06-21.yang @@ -0,0 +1,208 @@ +module ietf-yang-library { + namespace "urn:ietf:params:xml:ns:yang:ietf-yang-library"; + prefix "yanglib"; + import ietf-yang-types { + prefix yang; + } + import ietf-inet-types { + prefix inet; + } + organization + "IETF NETCONF (Network Configuration) Working Group"; + contact + "WG Web: <https://datatracker.ietf.org/wg/netconf/> + WG List: <mailto:netconf@ietf.org> + WG Chair: Mehmet Ersue + <mailto:mehmet.ersue@nsn.com> + WG Chair: Mahesh Jethanandani + <mailto:mjethanandani@gmail.com> + Editor: Andy Bierman + <mailto:andy@yumaworks.com> + Editor: Martin Bjorklund + <mailto:mbj@tail-f.com> + Editor: Kent Watsen + <mailto:kwatsen@juniper.net>"; + description + "This module contains monitoring information about the YANG + modules and submodules that are used within a YANG-based + server. + Copyright (c) 2016 IETF Trust and the persons identified as + authors of the code. All rights reserved. + Redistribution and use in source and binary forms, with or + without modification, is permitted pursuant to, and subject + to the license terms contained in, the Simplified BSD License + set forth in Section 4.c of the IETF Trust's Legal Provisions + Relating to IETF Documents + (http://trustee.ietf.org/license-info). + This version of this YANG module is part of RFC 7895; see + the RFC itself for full legal notices."; + revision 2016-06-21 { + description + "Initial revision."; + reference + "RFC 7895: YANG Module Library."; + } + /* + * Typedefs + */ + typedef revision-identifier { + type string { + pattern '\d{4}-\d{2}-\d{2}'; + } + description + "Represents a specific date in YYYY-MM-DD format."; + } + /* + * Groupings + */ + grouping module-list { + description + "The module data structure is represented as a grouping + so it can be reused in configuration or another monitoring + data structure."; + grouping common-leafs { + description + "Common parameters for YANG modules and submodules."; + leaf name { + type yang:yang-identifier; + description + "The YANG module or submodule name."; + } + leaf revision { + type union { + type revision-identifier; + type string { length 0; } + } + description + "The YANG module or submodule revision date. + A zero-length string is used if no revision statement + is present in the YANG module or submodule."; + } + } + grouping schema-leaf { + description + "Common schema leaf parameter for modules and submodules."; + leaf schema { + type inet:uri; + description + "Contains a URL that represents the YANG schema + resource for this module or submodule. + This leaf will only be present if there is a URL + available for retrieval of the schema for this entry."; + } + } + list module { + key "name revision"; + description + "Each entry represents one revision of one module + currently supported by the server."; + uses common-leafs; + uses schema-leaf; + leaf namespace { + type inet:uri; + mandatory true; + description + "The XML namespace identifier for this module."; + } + leaf-list feature { + type yang:yang-identifier; + description + "List of YANG feature names from this module that are + supported by the server, regardless of whether they are + defined in the module or any included submodule."; + } + list deviation { + key "name revision"; + description + "List of YANG deviation module names and revisions + used by this server to modify the conformance of + the module associated with this entry. Note that + the same module can be used for deviations for + multiple modules, so the same entry MAY appear + within multiple 'module' entries. + The deviation module MUST be present in the 'module' + list, with the same name and revision values. + The 'conformance-type' value will be 'implement' for + the deviation module."; + uses common-leafs; + } + leaf conformance-type { + type enumeration { + enum implement { + description + "Indicates that the server implements one or more + protocol-accessible objects defined in the YANG module + identified in this entry. This includes deviation + statements defined in the module. + For YANG version 1.1 modules, there is at most one + module entry with conformance type 'implement' for a + particular module name, since YANG 1.1 requires that, + at most, one revision of a module is implemented. + For YANG version 1 modules, there SHOULD NOT be more + than one module entry for a particular module name."; + } + enum import { + description + "Indicates that the server imports reusable definitions + from the specified revision of the module but does + not implement any protocol-accessible objects from + this revision. + Multiple module entries for the same module name MAY + exist. This can occur if multiple modules import the + same module but specify different revision dates in + the import statements."; + } + } + mandatory true; + description + "Indicates the type of conformance the server is claiming + for the YANG module identified by this entry."; + } + list submodule { + key "name revision"; + description + "Each entry represents one submodule within the + parent module."; + uses common-leafs; + uses schema-leaf; + } + } + } + /* + * Operational state data nodes + */ + container modules-state { + config false; + description + "Contains YANG module monitoring information."; + leaf module-set-id { + type string; + mandatory true; + description + "Contains a server-specific identifier representing + the current set of modules and submodules. The + server MUST change the value of this leaf if the + information represented by the 'module' list instances + has changed."; + } + uses module-list; + } + /* + * Notifications + */ + notification yang-library-change { + description + "Generated when the set of modules and submodules supported + by the server has changed."; + leaf module-set-id { + type leafref { + path "/yanglib:modules-state/yanglib:module-set-id"; + } + mandatory true; + description + "Contains the module-set-id value representing the + set of modules and submodules supported at the server at + the time the notification is generated."; + } + } +} diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/modules/modules-behind-mount-point/ietf-yang-types.yang b/netconf/restconf/restconf-nb-bierman02/src/test/resources/modules/modules-behind-mount-point/ietf-yang-types.yang new file mode 100644 index 0000000..07e50b3 --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/modules/modules-behind-mount-point/ietf-yang-types.yang @@ -0,0 +1,417 @@ + module ietf-yang-types { + + namespace "urn:ietf:params:xml:ns:yang:ietf-yang-types"; + prefix "yang"; + + organization + "IETF NETMOD (NETCONF Data Modeling Language) Working Group"; + + contact + "WG Web: <http://tools.ietf.org/wg/netmod/> + WG List: <mailto:netmod@ietf.org> + + WG Chair: David Partain + <mailto:david.partain@ericsson.com> + + WG Chair: David Kessens + <mailto:david.kessens@nsn.com> + + Editor: Juergen Schoenwaelder + <mailto:j.schoenwaelder@jacobs-university.de>"; + + description + "This module contains a collection of generally useful derived + YANG data types. + + Copyright (c) 2010 IETF Trust and the persons identified as + authors of the code. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, is permitted pursuant to, and subject to the license + terms contained in, the Simplified BSD License set forth in Section + 4.c of the IETF Trust's Legal Provisions Relating to IETF Documents + (http://trustee.ietf.org/license-info). + + This version of this YANG module is part of RFC 6021; see + the RFC itself for full legal notices."; + + revision 2010-09-24 { + description + "Initial revision."; + reference + "RFC 6021: Common YANG Data Types"; + } + + /*** collection of counter and gauge types ***/ + + typedef counter32 { + type uint32; + description + "The counter32 type represents a non-negative integer + that monotonically increases until it reaches a + maximum value of 2^32-1 (4294967295 decimal), when it + wraps around and starts increasing again from zero. + + Counters have no defined 'initial' value, and thus, a + single value of a counter has (in general) no information + content. Discontinuities in the monotonically increasing + value normally occur at re-initialization of the + management system, and at other times as specified in the + description of a schema node using this type. If such + other times can occur, for example, the creation of + a schema node of type counter32 at times other than + re-initialization, then a corresponding schema node + should be defined, with an appropriate type, to indicate + the last discontinuity. + + The counter32 type should not be used for configuration + schema nodes. A default statement SHOULD NOT be used in + combination with the type counter32. + + In the value set and its semantics, this type is equivalent + to the Counter32 type of the SMIv2."; + reference + "RFC 2578: Structure of Management Information Version 2 (SMIv2)"; + } + + typedef zero-based-counter32 { + type yang:counter32; + default "0"; + description + "The zero-based-counter32 type represents a counter32 + that has the defined 'initial' value zero. + + A schema node of this type will be set to zero (0) on creation + and will thereafter increase monotonically until it reaches + a maximum value of 2^32-1 (4294967295 decimal), when it + wraps around and starts increasing again from zero. + + Provided that an application discovers a new schema node + of this type within the minimum time to wrap, it can use the + 'initial' value as a delta. It is important for a management + station to be aware of this minimum time and the actual time + between polls, and to discard data if the actual time is too + long or there is no defined minimum time. + + In the value set and its semantics, this type is equivalent + to the ZeroBasedCounter32 textual convention of the SMIv2."; + reference + "RFC 4502: Remote Network Monitoring Management Information + Base Version 2"; + } + + typedef counter64 { + type uint64; + description + "The counter64 type represents a non-negative integer + that monotonically increases until it reaches a + maximum value of 2^64-1 (18446744073709551615 decimal), + when it wraps around and starts increasing again from zero. + + Counters have no defined 'initial' value, and thus, a + single value of a counter has (in general) no information + content. Discontinuities in the monotonically increasing + value normally occur at re-initialization of the + management system, and at other times as specified in the + description of a schema node using this type. If such + other times can occur, for example, the creation of + a schema node of type counter64 at times other than + re-initialization, then a corresponding schema node + should be defined, with an appropriate type, to indicate + the last discontinuity. + + The counter64 type should not be used for configuration + schema nodes. A default statement SHOULD NOT be used in + combination with the type counter64. + + In the value set and its semantics, this type is equivalent + to the Counter64 type of the SMIv2."; + reference + "RFC 2578: Structure of Management Information Version 2 (SMIv2)"; + } + + typedef zero-based-counter64 { + type yang:counter64; + default "0"; + description + "The zero-based-counter64 type represents a counter64 that + has the defined 'initial' value zero. + + A schema node of this type will be set to zero (0) on creation + and will thereafter increase monotonically until it reaches + a maximum value of 2^64-1 (18446744073709551615 decimal), + when it wraps around and starts increasing again from zero. + + Provided that an application discovers a new schema node + of this type within the minimum time to wrap, it can use the + 'initial' value as a delta. It is important for a management + station to be aware of this minimum time and the actual time + between polls, and to discard data if the actual time is too + long or there is no defined minimum time. + + In the value set and its semantics, this type is equivalent + to the ZeroBasedCounter64 textual convention of the SMIv2."; + reference + "RFC 2856: Textual Conventions for Additional High Capacity + Data Types"; + } + + typedef gauge32 { + type uint32; + description + "The gauge32 type represents a non-negative integer, which + may increase or decrease, but shall never exceed a maximum + value, nor fall below a minimum value. The maximum value + cannot be greater than 2^32-1 (4294967295 decimal), and + the minimum value cannot be smaller than 0. The value of + a gauge32 has its maximum value whenever the information + being modeled is greater than or equal to its maximum + value, and has its minimum value whenever the information + being modeled is smaller than or equal to its minimum value. + If the information being modeled subsequently decreases + below (increases above) the maximum (minimum) value, the + gauge32 also decreases (increases). + + In the value set and its semantics, this type is equivalent + to the Gauge32 type of the SMIv2."; + reference + "RFC 2578: Structure of Management Information Version 2 (SMIv2)"; + } + + typedef gauge64 { + type uint64; + description + "The gauge64 type represents a non-negative integer, which + may increase or decrease, but shall never exceed a maximum + value, nor fall below a minimum value. The maximum value + cannot be greater than 2^64-1 (18446744073709551615), and + the minimum value cannot be smaller than 0. The value of + a gauge64 has its maximum value whenever the information + being modeled is greater than or equal to its maximum + value, and has its minimum value whenever the information + being modeled is smaller than or equal to its minimum value. + If the information being modeled subsequently decreases + below (increases above) the maximum (minimum) value, the + gauge64 also decreases (increases). + + In the value set and its semantics, this type is equivalent + to the CounterBasedGauge64 SMIv2 textual convention defined + in RFC 2856"; + reference + "RFC 2856: Textual Conventions for Additional High Capacity + Data Types"; + } + + /*** collection of identifier related types ***/ + + typedef object-identifier { + type string { + pattern '(([0-1](\.[1-3]?[0-9]))|(2\.(0|([1-9]\d*))))' + + '(\.(0|([1-9]\d*)))*'; + } + description + "The object-identifier type represents administratively + assigned names in a registration-hierarchical-name tree. + + Values of this type are denoted as a sequence of numerical + non-negative sub-identifier values. Each sub-identifier + value MUST NOT exceed 2^32-1 (4294967295). Sub-identifiers + are separated by single dots and without any intermediate + whitespace. + + The ASN.1 standard restricts the value space of the first + sub-identifier to 0, 1, or 2. Furthermore, the value space + of the second sub-identifier is restricted to the range + 0 to 39 if the first sub-identifier is 0 or 1. Finally, + the ASN.1 standard requires that an object identifier + has always at least two sub-identifier. The pattern + captures these restrictions. + + Although the number of sub-identifiers is not limited, + module designers should realize that there may be + implementations that stick with the SMIv2 limit of 128 + sub-identifiers. + + This type is a superset of the SMIv2 OBJECT IDENTIFIER type + since it is not restricted to 128 sub-identifiers. Hence, + this type SHOULD NOT be used to represent the SMIv2 OBJECT + IDENTIFIER type, the object-identifier-128 type SHOULD be + used instead."; + reference + "ISO9834-1: Information technology -- Open Systems + Interconnection -- Procedures for the operation of OSI + Registration Authorities: General procedures and top + arcs of the ASN.1 Object Identifier tree"; + } + + + + + typedef object-identifier-128 { + type object-identifier { + pattern '\d*(\.\d*){1,127}'; + } + description + "This type represents object-identifiers restricted to 128 + sub-identifiers. + + In the value set and its semantics, this type is equivalent + to the OBJECT IDENTIFIER type of the SMIv2."; + reference + "RFC 2578: Structure of Management Information Version 2 (SMIv2)"; + } + + typedef yang-identifier { + type string { + length "1..max"; + pattern '[a-zA-Z_][a-zA-Z0-9\-_.]*'; + pattern '.|..|[^xX].*|.[^mM].*|..[^lL].*'; + } + description + "A YANG identifier string as defined by the 'identifier' + rule in Section 12 of RFC 6020. An identifier must + start with an alphabetic character or an underscore + followed by an arbitrary sequence of alphabetic or + numeric characters, underscores, hyphens, or dots. + + A YANG identifier MUST NOT start with any possible + combination of the lowercase or uppercase character + sequence 'xml'."; + reference + "RFC 6020: YANG - A Data Modeling Language for the Network + Configuration Protocol (NETCONF)"; + } + + /*** collection of date and time related types ***/ + + typedef date-and-time { + type string { + pattern '\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d+)?' + + '(Z|[\+\-]\d{2}:\d{2})'; + } + description + "The date-and-time type is a profile of the ISO 8601 + standard for representation of dates and times using the + Gregorian calendar. The profile is defined by the + date-time production in Section 5.6 of RFC 3339. + + The date-and-time type is compatible with the dateTime XML + schema type with the following notable exceptions: + + (a) The date-and-time type does not allow negative years. + + (b) The date-and-time time-offset -00:00 indicates an unknown + time zone (see RFC 3339) while -00:00 and +00:00 and Z all + represent the same time zone in dateTime. + + (c) The canonical format (see below) of data-and-time values + differs from the canonical format used by the dateTime XML + schema type, which requires all times to be in UTC using the + time-offset 'Z'. + + This type is not equivalent to the DateAndTime textual + convention of the SMIv2 since RFC 3339 uses a different + separator between full-date and full-time and provides + higher resolution of time-secfrac. + + The canonical format for date-and-time values with a known time + zone uses a numeric time zone offset that is calculated using + the device's configured known offset to UTC time. A change of + the device's offset to UTC time will cause date-and-time values + to change accordingly. Such changes might happen periodically + in case a server follows automatically daylight saving time + (DST) time zone offset changes. The canonical format for + date-and-time values with an unknown time zone (usually referring + to the notion of local time) uses the time-offset -00:00."; + reference + "RFC 3339: Date and Time on the Internet: Timestamps + RFC 2579: Textual Conventions for SMIv2 + XSD-TYPES: XML Schema Part 2: Datatypes Second Edition"; + } + + typedef timeticks { + type uint32; + description + "The timeticks type represents a non-negative integer that + represents the time, modulo 2^32 (4294967296 decimal), in + hundredths of a second between two epochs. When a schema + node is defined that uses this type, the description of + the schema node identifies both of the reference epochs. + + In the value set and its semantics, this type is equivalent + to the TimeTicks type of the SMIv2."; + reference + "RFC 2578: Structure of Management Information Version 2 (SMIv2)"; + } + + typedef timestamp { + type yang:timeticks; + description + "The timestamp type represents the value of an associated + timeticks schema node at which a specific occurrence happened. + The specific occurrence must be defined in the description + of any schema node defined using this type. When the specific + occurrence occurred prior to the last time the associated + timeticks attribute was zero, then the timestamp value is + zero. Note that this requires all timestamp values to be + reset to zero when the value of the associated timeticks + attribute reaches 497+ days and wraps around to zero. + + The associated timeticks schema node must be specified + in the description of any schema node using this type. + + In the value set and its semantics, this type is equivalent + to the TimeStamp textual convention of the SMIv2."; + reference + "RFC 2579: Textual Conventions for SMIv2"; + } + + /*** collection of generic address types ***/ + + typedef phys-address { + type string { + pattern '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'; + } + description + "Represents media- or physical-level addresses represented + as a sequence octets, each octet represented by two hexadecimal + numbers. Octets are separated by colons. The canonical + representation uses lowercase characters. + + In the value set and its semantics, this type is equivalent + to the PhysAddress textual convention of the SMIv2."; + reference + "RFC 2579: Textual Conventions for SMIv2"; + } + + typedef mac-address { + type string { + pattern '[0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){5}'; + } + description + "The mac-address type represents an IEEE 802 MAC address. + The canonical representation uses lowercase characters. + + In the value set and its semantics, this type is equivalent + to the MacAddress textual convention of the SMIv2."; + reference + "IEEE 802: IEEE Standard for Local and Metropolitan Area + Networks: Overview and Architecture + RFC 2579: Textual Conventions for SMIv2"; + } + + /*** collection of XML specific types ***/ + + typedef xpath1.0 { + type string; + description + "This type represents an XPATH 1.0 expression. + + When a schema node is defined that uses this type, the + description of the schema node MUST specify the XPath + context in which the XPath expression is evaluated."; + reference + "XPATH: XML Path Language (XPath) Version 1.0"; + } + + } diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/modules/modules-behind-mount-point/module1-behind-mount-point.yang b/netconf/restconf/restconf-nb-bierman02/src/test/resources/modules/modules-behind-mount-point/module1-behind-mount-point.yang new file mode 100644 index 0000000..e48184b --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/modules/modules-behind-mount-point/module1-behind-mount-point.yang @@ -0,0 +1,10 @@ +module module1-behind-mount-point { + namespace "module:1:behind:mount:point"; + prefix "mod1bemopo"; + revision "2014-02-03"; + + rpc rpc-behind-module1 { + } + + +}
\ No newline at end of file diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/modules/modules-behind-mount-point/module2-behind-mount-point.yang b/netconf/restconf/restconf-nb-bierman02/src/test/resources/modules/modules-behind-mount-point/module2-behind-mount-point.yang new file mode 100644 index 0000000..89b8c02 --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/modules/modules-behind-mount-point/module2-behind-mount-point.yang @@ -0,0 +1,9 @@ +module module2-behind-mount-point { + namespace "module:2:behind:mount:point"; + prefix "mod2bemopo"; + revision "2014-02-04"; + + rpc rpc-behind-module2 { + } + +}
\ No newline at end of file diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/modules/modules-without-restconf-module/module1.yang b/netconf/restconf/restconf-nb-bierman02/src/test/resources/modules/modules-without-restconf-module/module1.yang new file mode 100644 index 0000000..ab9d967 --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/modules/modules-without-restconf-module/module1.yang @@ -0,0 +1,12 @@ +module module1 { + namespace "module:1"; + prefix "mod1"; + revision "2014-01-01"; + + rpc dummy-rpc1-module1 { + } + + rpc dummy-rpc2-module1 { + } + +}
\ No newline at end of file diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/modules/modules-without-restconf-module/module2.yang b/netconf/restconf/restconf-nb-bierman02/src/test/resources/modules/modules-without-restconf-module/module2.yang new file mode 100644 index 0000000..fa792d7 --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/modules/modules-without-restconf-module/module2.yang @@ -0,0 +1,11 @@ +module module2 { + namespace "module:2"; + prefix "mod2"; + revision "2014-01-02"; + + rpc dummy-rpc1-module2 { + } + + rpc dummy-rpc2-module2 { + } +}
\ No newline at end of file diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/modules/modules-without-restconf-module/module3.yang b/netconf/restconf/restconf-nb-bierman02/src/test/resources/modules/modules-without-restconf-module/module3.yang new file mode 100644 index 0000000..39bb690 --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/modules/modules-without-restconf-module/module3.yang @@ -0,0 +1,5 @@ +module module3 { + namespace "module:3"; + prefix "mod3"; + revision "2014-01-03"; +}
\ No newline at end of file diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/modules/modules-without-restconf-module/mount-point-1.yang b/netconf/restconf/restconf-nb-bierman02/src/test/resources/modules/modules-without-restconf-module/mount-point-1.yang new file mode 100644 index 0000000..4963c89 --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/modules/modules-without-restconf-module/mount-point-1.yang @@ -0,0 +1,11 @@ +module mount-point-1 { + namespace "mount:point:1"; + prefix "point1"; + revision "2016-01-01"; + + container cont { + } + + list listA { + } +}
\ No newline at end of file diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/modules/mount-points/mount-point-1.yang b/netconf/restconf/restconf-nb-bierman02/src/test/resources/modules/mount-points/mount-point-1.yang new file mode 100644 index 0000000..4963c89 --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/modules/mount-points/mount-point-1.yang @@ -0,0 +1,11 @@ +module mount-point-1 { + namespace "mount:point:1"; + prefix "point1"; + revision "2016-01-01"; + + container cont { + } + + list listA { + } +}
\ No newline at end of file diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/modules/mount-points/mount-point-2.yang b/netconf/restconf/restconf-nb-bierman02/src/test/resources/modules/mount-points/mount-point-2.yang new file mode 100644 index 0000000..c748cb7 --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/modules/mount-points/mount-point-2.yang @@ -0,0 +1,8 @@ +module mount-point-2 { + namespace "mount:point:2"; + prefix "point2"; + revision "2016-01-01"; + + container cont { + } +}
\ No newline at end of file diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/modules/nested-module.yang b/netconf/restconf/restconf-nb-bierman02/src/test/resources/modules/nested-module.yang new file mode 100644 index 0000000..794859b --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/modules/nested-module.yang @@ -0,0 +1,69 @@ +module nested-module { + namespace "urn:nested:module"; + prefix "nested"; + revision "2014-06-03"; + + container depth1-cont { + list depth2-cont1 { + container depth3-cont1 { + container depth4-cont1 { + leaf depth5-leaf1 { + type string; + } + } + + leaf depth4-leaf1 { + type string; + } + } + + leaf depth3-leaf1 { + type string; + } + } + + /* list depth2-list2 was added to test keyed list */ + list depth2-list2 { + key "depth3-lf1-key depth3-lf2-key"; + leaf depth3-lf1-key { + type string; + } + leaf depth3-lf2-key { + type string; + } + leaf depth3-lf3 { + type string; + } + } + + leaf-list depth2-lfLst1 { + type string; + } + + container depth2-cont2 { + container depth3-cont2 { + container depth4-cont2 { + leaf depth5-leaf2 { + type string; + } + } + + leaf depth4-leaf2 { + type string; + } + } + + leaf depth3-leaf2 { + type string; + } + } + + leaf depth2-leaf1 { + type string; + } + } + + notification notifi{ + description "Notifi"; + } +} diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/modules/restconf-module-testing-mount-point/ietf-inet-types.yang b/netconf/restconf/restconf-nb-bierman02/src/test/resources/modules/restconf-module-testing-mount-point/ietf-inet-types.yang new file mode 100644 index 0000000..de20feb --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/modules/restconf-module-testing-mount-point/ietf-inet-types.yang @@ -0,0 +1,418 @@ + module ietf-inet-types { + + namespace "urn:ietf:params:xml:ns:yang:ietf-inet-types"; + prefix "inet"; + + organization + "IETF NETMOD (NETCONF Data Modeling Language) Working Group"; + + contact + "WG Web: <http://tools.ietf.org/wg/netmod/> + WG List: <mailto:netmod@ietf.org> + + WG Chair: David Partain + <mailto:david.partain@ericsson.com> + + WG Chair: David Kessens + <mailto:david.kessens@nsn.com> + + Editor: Juergen Schoenwaelder + <mailto:j.schoenwaelder@jacobs-university.de>"; + + description + "This module contains a collection of generally useful derived + YANG data types for Internet addresses and related things. + + Copyright (c) 2010 IETF Trust and the persons identified as + authors of the code. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, is permitted pursuant to, and subject to the license + terms contained in, the Simplified BSD License set forth in Section + 4.c of the IETF Trust's Legal Provisions Relating to IETF Documents + (http://trustee.ietf.org/license-info). + + This version of this YANG module is part of RFC 6021; see + the RFC itself for full legal notices."; + + revision 2010-09-24 { + description + "Initial revision."; + reference + "RFC 6021: Common YANG Data Types"; + } + + /*** collection of protocol field related types ***/ + + typedef ip-version { + type enumeration { + enum unknown { + value "0"; + description + "An unknown or unspecified version of the Internet protocol."; + } + enum ipv4 { + value "1"; + description + "The IPv4 protocol as defined in RFC 791."; + } + enum ipv6 { + value "2"; + description + "The IPv6 protocol as defined in RFC 2460."; + } + } + description + "This value represents the version of the IP protocol. + + In the value set and its semantics, this type is equivalent + to the InetVersion textual convention of the SMIv2."; + reference + "RFC 791: Internet Protocol + RFC 2460: Internet Protocol, Version 6 (IPv6) Specification + RFC 4001: Textual Conventions for Internet Network Addresses"; + } + + typedef dscp { + type uint8 { + range "0..63"; + } + description + "The dscp type represents a Differentiated Services Code-Point + that may be used for marking packets in a traffic stream. + + In the value set and its semantics, this type is equivalent + to the Dscp textual convention of the SMIv2."; + reference + "RFC 3289: Management Information Base for the Differentiated + Services Architecture + RFC 2474: Definition of the Differentiated Services Field + (DS Field) in the IPv4 and IPv6 Headers + RFC 2780: IANA Allocation Guidelines For Values In + the Internet Protocol and Related Headers"; + } + + typedef ipv6-flow-label { + type uint32 { + range "0..1048575"; + } + description + "The flow-label type represents flow identifier or Flow Label + in an IPv6 packet header that may be used to discriminate + traffic flows. + + In the value set and its semantics, this type is equivalent + to the IPv6FlowLabel textual convention of the SMIv2."; + reference + "RFC 3595: Textual Conventions for IPv6 Flow Label + RFC 2460: Internet Protocol, Version 6 (IPv6) Specification"; + } + + typedef port-number { + type uint16 { + range "0..65535"; + } + description + "The port-number type represents a 16-bit port number of an + Internet transport layer protocol such as UDP, TCP, DCCP, or + SCTP. Port numbers are assigned by IANA. A current list of + all assignments is available from <http://www.iana.org/>. + + Note that the port number value zero is reserved by IANA. In + situations where the value zero does not make sense, it can + be excluded by subtyping the port-number type. + + In the value set and its semantics, this type is equivalent + to the InetPortNumber textual convention of the SMIv2."; + reference + "RFC 768: User Datagram Protocol + RFC 793: Transmission Control Protocol + RFC 4960: Stream Control Transmission Protocol + RFC 4340: Datagram Congestion Control Protocol (DCCP) + RFC 4001: Textual Conventions for Internet Network Addresses"; + } + + /*** collection of autonomous system related types ***/ + + typedef as-number { + type uint32; + description + "The as-number type represents autonomous system numbers + which identify an Autonomous System (AS). An AS is a set + of routers under a single technical administration, using + an interior gateway protocol and common metrics to route + packets within the AS, and using an exterior gateway + protocol to route packets to other ASs'. IANA maintains + the AS number space and has delegated large parts to the + regional registries. + + Autonomous system numbers were originally limited to 16 + bits. BGP extensions have enlarged the autonomous system + number space to 32 bits. This type therefore uses an uint32 + base type without a range restriction in order to support + a larger autonomous system number space. + + In the value set and its semantics, this type is equivalent + to the InetAutonomousSystemNumber textual convention of + the SMIv2."; + reference + "RFC 1930: Guidelines for creation, selection, and registration + of an Autonomous System (AS) + RFC 4271: A Border Gateway Protocol 4 (BGP-4) + RFC 4893: BGP Support for Four-octet AS Number Space + RFC 4001: Textual Conventions for Internet Network Addresses"; + } + + /*** collection of IP address and hostname related types ***/ + + typedef ip-address { + type union { + type inet:ipv4-address; + type inet:ipv6-address; + } + description + "The ip-address type represents an IP address and is IP + version neutral. The format of the textual representations + implies the IP version."; + } + + typedef ipv4-address { + type string { + 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])' + + '(%[\p{N}\p{L}]+)?'; + } + description + "The ipv4-address type represents an IPv4 address in + dotted-quad notation. The IPv4 address may include a zone + index, separated by a % sign. + + The zone index is used to disambiguate identical address + values. For link-local addresses, the zone index will + typically be the interface index number or the name of an + interface. If the zone index is not present, the default + zone of the device will be used. + + The canonical format for the zone index is the numerical + format"; + } + + typedef ipv6-address { + type string { + pattern '((:|[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}]+)?'; + pattern '(([^:]+:){6}(([^:]+:[^:]+)|(.*\..*)))|' + + '((([^:]+:)*[^:]+)?::(([^:]+:)*[^:]+)?)' + + '(%.+)?'; + } + description + "The ipv6-address type represents an IPv6 address in full, + mixed, shortened, and shortened-mixed notation. The IPv6 + address may include a zone index, separated by a % sign. + + The zone index is used to disambiguate identical address + values. For link-local addresses, the zone index will + typically be the interface index number or the name of an + interface. If the zone index is not present, the default + zone of the device will be used. + + The canonical format of IPv6 addresses uses the compressed + format described in RFC 4291, Section 2.2, item 2 with the + following additional rules: the :: substitution must be + applied to the longest sequence of all-zero 16-bit chunks + in an IPv6 address. If there is a tie, the first sequence + of all-zero 16-bit chunks is replaced by ::. Single + all-zero 16-bit chunks are not compressed. The canonical + format uses lowercase characters and leading zeros are + not allowed. The canonical format for the zone index is + the numerical format as described in RFC 4007, Section + 11.2."; + reference + "RFC 4291: IP Version 6 Addressing Architecture + RFC 4007: IPv6 Scoped Address Architecture + RFC 5952: A Recommendation for IPv6 Address Text Representation"; + } + + typedef ip-prefix { + type union { + type inet:ipv4-prefix; + type inet:ipv6-prefix; + } + description + "The ip-prefix type represents an IP prefix and is IP + version neutral. The format of the textual representations + implies the IP version."; + } + + typedef ipv4-prefix { + type string { + 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])' + + '/(([0-9])|([1-2][0-9])|(3[0-2]))'; + } + description + "The ipv4-prefix type represents an IPv4 address prefix. + The prefix length is given by the number following the + slash character and must be less than or equal to 32. + + A prefix length value of n corresponds to an IP address + mask that has n contiguous 1-bits from the most + significant bit (MSB) and all other bits set to 0. + + The canonical format of an IPv4 prefix has all bits of + the IPv4 address set to zero that are not part of the + IPv4 prefix."; + } + + typedef ipv6-prefix { + type string { + pattern '((:|[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])))'; + pattern '(([^:]+:){6}(([^:]+:[^:]+)|(.*\..*)))|' + + '((([^:]+:)*[^:]+)?::(([^:]+:)*[^:]+)?)' + + '(/.+)'; + } + description + "The ipv6-prefix type represents an IPv6 address prefix. + The prefix length is given by the number following the + slash character and must be less than or equal 128. + + A prefix length value of n corresponds to an IP address + mask that has n contiguous 1-bits from the most + significant bit (MSB) and all other bits set to 0. + + The IPv6 address should have all bits that do not belong + to the prefix set to zero. + + The canonical format of an IPv6 prefix has all bits of + the IPv6 address set to zero that are not part of the + IPv6 prefix. Furthermore, IPv6 address is represented + in the compressed format described in RFC 4291, Section + 2.2, item 2 with the following additional rules: the :: + substitution must be applied to the longest sequence of + all-zero 16-bit chunks in an IPv6 address. If there is + a tie, the first sequence of all-zero 16-bit chunks is + replaced by ::. Single all-zero 16-bit chunks are not + compressed. The canonical format uses lowercase + characters and leading zeros are not allowed."; + reference + "RFC 4291: IP Version 6 Addressing Architecture"; + } + + /*** collection of domain name and URI types ***/ + + typedef domain-name { + type string { + pattern '((([a-zA-Z0-9_]([a-zA-Z0-9\-_]){0,61})?[a-zA-Z0-9]\.)*' + + '([a-zA-Z0-9_]([a-zA-Z0-9\-_]){0,61})?[a-zA-Z0-9]\.?)' + + '|\.'; + length "1..253"; + } + description + "The domain-name type represents a DNS domain name. The + name SHOULD be fully qualified whenever possible. + + Internet domain names are only loosely specified. Section + 3.5 of RFC 1034 recommends a syntax (modified in Section + 2.1 of RFC 1123). The pattern above is intended to allow + for current practice in domain name use, and some possible + future expansion. It is designed to hold various types of + domain names, including names used for A or AAAA records + (host names) and other records, such as SRV records. Note + that Internet host names have a stricter syntax (described + in RFC 952) than the DNS recommendations in RFCs 1034 and + 1123, and that systems that want to store host names in + schema nodes using the domain-name type are recommended to + adhere to this stricter standard to ensure interoperability. + + The encoding of DNS names in the DNS protocol is limited + to 255 characters. Since the encoding consists of labels + prefixed by a length bytes and there is a trailing NULL + byte, only 253 characters can appear in the textual dotted + notation. + + The description clause of schema nodes using the domain-name + type MUST describe when and how these names are resolved to + IP addresses. Note that the resolution of a domain-name value + may require to query multiple DNS records (e.g., A for IPv4 + and AAAA for IPv6). The order of the resolution process and + which DNS record takes precedence can either be defined + explicitely or it may depend on the configuration of the + resolver. + + Domain-name values use the US-ASCII encoding. Their canonical + format uses lowercase US-ASCII characters. Internationalized + domain names MUST be encoded in punycode as described in RFC + 3492"; + reference + "RFC 952: DoD Internet Host Table Specification + RFC 1034: Domain Names - Concepts and Facilities + RFC 1123: Requirements for Internet Hosts -- Application + and Support + RFC 2782: A DNS RR for specifying the location of services + (DNS SRV) + RFC 3492: Punycode: A Bootstring encoding of Unicode for + Internationalized Domain Names in Applications + (IDNA) + RFC 5891: Internationalizing Domain Names in Applications + (IDNA): Protocol"; + } + + typedef host { + type union { + type inet:ip-address; + type inet:domain-name; + } + description + "The host type represents either an IP address or a DNS + domain name."; + } + + typedef uri { + type string; + description + "The uri type represents a Uniform Resource Identifier + (URI) as defined by STD 66. + + Objects using the uri type MUST be in US-ASCII encoding, + and MUST be normalized as described by RFC 3986 Sections + 6.2.1, 6.2.2.1, and 6.2.2.2. All unnecessary + percent-encoding is removed, and all case-insensitive + characters are set to lowercase except for hexadecimal + digits, which are normalized to uppercase as described in + Section 6.2.2.1. + + The purpose of this normalization is to help provide + unique URIs. Note that this normalization is not + sufficient to provide uniqueness. Two URIs that are + textually distinct after this normalization may still be + equivalent. + + Objects using the uri type may restrict the schemes that + they permit. For example, 'data:' and 'urn:' schemes + might not be appropriate. + + A zero-length URI is not a valid URI. This can be used to + express 'URI absent' where required. + + In the value set and its semantics, this type is equivalent + to the Uri SMIv2 textual convention defined in RFC 5017."; + reference + "RFC 3986: Uniform Resource Identifier (URI): Generic Syntax + RFC 3305: Report from the Joint W3C/IETF URI Planning Interest + Group: Uniform Resource Identifiers (URIs), URLs, + and Uniform Resource Names (URNs): Clarifications + and Recommendations + RFC 5017: MIB Textual Conventions for Uniform Resource + Identifiers (URIs)"; + } + + } diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/modules/restconf-module-testing-mount-point/ietf-yang-types.yang b/netconf/restconf/restconf-nb-bierman02/src/test/resources/modules/restconf-module-testing-mount-point/ietf-yang-types.yang new file mode 100644 index 0000000..c3f952c --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/modules/restconf-module-testing-mount-point/ietf-yang-types.yang @@ -0,0 +1,417 @@ + module ietf-yang-types { + + namespace "urn:ietf:params:xml:ns:yang:ietf-yang-types"; + prefix "yang"; + + organization + "IETF NETMOD (NETCONF Data Modeling Language) Working Group"; + + contact + "WG Web: <http://tools.ietf.org/wg/netmod/> + WG List: <mailto:netmod@ietf.org> + + WG Chair: David Partain + <mailto:david.partain@ericsson.com> + + WG Chair: David Kessens + <mailto:david.kessens@nsn.com> + + Editor: Juergen Schoenwaelder + <mailto:j.schoenwaelder@jacobs-university.de>"; + + description + "This module contains a collection of generally useful derived + YANG data types. + + Copyright (c) 2010 IETF Trust and the persons identified as + authors of the code. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, is permitted pursuant to, and subject to the license + terms contained in, the Simplified BSD License set forth in Section + 4.c of the IETF Trust's Legal Provisions Relating to IETF Documents + (http://trustee.ietf.org/license-info). + + This version of this YANG module is part of RFC 6021; see + the RFC itself for full legal notices."; + + revision 2010-09-24 { + description + "Initial revision."; + reference + "RFC 6021: Common YANG Data Types"; + } + + /*** collection of counter and gauge types ***/ + + typedef counter32 { + type uint32; + description + "The counter32 type represents a non-negative integer + that monotonically increases until it reaches a + maximum value of 2^32-1 (4294967295 decimal), when it + wraps around and starts increasing again from zero. + + Counters have no defined 'initial' value, and thus, a + single value of a counter has (in general) no information + content. Discontinuities in the monotonically increasing + value normally occur at re-initialization of the + management system, and at other times as specified in the + description of a schema node using this type. If such + other times can occur, for example, the creation of + a schema node of type counter32 at times other than + re-initialization, then a corresponding schema node + should be defined, with an appropriate type, to indicate + the last discontinuity. + + The counter32 type should not be used for configuration + schema nodes. A default statement SHOULD NOT be used in + combination with the type counter32. + + In the value set and its semantics, this type is equivalent + to the Counter32 type of the SMIv2."; + reference + "RFC 2578: Structure of Management Information Version 2 (SMIv2)"; + } + + typedef zero-based-counter32 { + type yang:counter32; + default "0"; + description + "The zero-based-counter32 type represents a counter32 + that has the defined 'initial' value zero. + + A schema node of this type will be set to zero (0) on creation + and will thereafter increase monotonically until it reaches + a maximum value of 2^32-1 (4294967295 decimal), when it + wraps around and starts increasing again from zero. + + Provided that an application discovers a new schema node + of this type within the minimum time to wrap, it can use the + 'initial' value as a delta. It is important for a management + station to be aware of this minimum time and the actual time + between polls, and to discard data if the actual time is too + long or there is no defined minimum time. + + In the value set and its semantics, this type is equivalent + to the ZeroBasedCounter32 textual convention of the SMIv2."; + reference + "RFC 4502: Remote Network Monitoring Management Information + Base Version 2"; + } + + typedef counter64 { + type uint64; + description + "The counter64 type represents a non-negative integer + that monotonically increases until it reaches a + maximum value of 2^64-1 (18446744073709551615 decimal), + when it wraps around and starts increasing again from zero. + + Counters have no defined 'initial' value, and thus, a + single value of a counter has (in general) no information + content. Discontinuities in the monotonically increasing + value normally occur at re-initialization of the + management system, and at other times as specified in the + description of a schema node using this type. If such + other times can occur, for example, the creation of + a schema node of type counter64 at times other than + re-initialization, then a corresponding schema node + should be defined, with an appropriate type, to indicate + the last discontinuity. + + The counter64 type should not be used for configuration + schema nodes. A default statement SHOULD NOT be used in + combination with the type counter64. + + In the value set and its semantics, this type is equivalent + to the Counter64 type of the SMIv2."; + reference + "RFC 2578: Structure of Management Information Version 2 (SMIv2)"; + } + + typedef zero-based-counter64 { + type yang:counter64; + default "0"; + description + "The zero-based-counter64 type represents a counter64 that + has the defined 'initial' value zero. + + A schema node of this type will be set to zero (0) on creation + and will thereafter increase monotonically until it reaches + a maximum value of 2^64-1 (18446744073709551615 decimal), + when it wraps around and starts increasing again from zero. + + Provided that an application discovers a new schema node + of this type within the minimum time to wrap, it can use the + 'initial' value as a delta. It is important for a management + station to be aware of this minimum time and the actual time + between polls, and to discard data if the actual time is too + long or there is no defined minimum time. + + In the value set and its semantics, this type is equivalent + to the ZeroBasedCounter64 textual convention of the SMIv2."; + reference + "RFC 2856: Textual Conventions for Additional High Capacity + Data Types"; + } + + typedef gauge32 { + type uint32; + description + "The gauge32 type represents a non-negative integer, which + may increase or decrease, but shall never exceed a maximum + value, nor fall below a minimum value. The maximum value + cannot be greater than 2^32-1 (4294967295 decimal), and + the minimum value cannot be smaller than 0. The value of + a gauge32 has its maximum value whenever the information + being modeled is greater than or equal to its maximum + value, and has its minimum value whenever the information + being modeled is smaller than or equal to its minimum value. + If the information being modeled subsequently decreases + below (increases above) the maximum (minimum) value, the + gauge32 also decreases (increases). + + In the value set and its semantics, this type is equivalent + to the Gauge32 type of the SMIv2."; + reference + "RFC 2578: Structure of Management Information Version 2 (SMIv2)"; + } + + typedef gauge64 { + type uint64; + description + "The gauge64 type represents a non-negative integer, which + may increase or decrease, but shall never exceed a maximum + value, nor fall below a minimum value. The maximum value + cannot be greater than 2^64-1 (18446744073709551615), and + the minimum value cannot be smaller than 0. The value of + a gauge64 has its maximum value whenever the information + being modeled is greater than or equal to its maximum + value, and has its minimum value whenever the information + being modeled is smaller than or equal to its minimum value. + If the information being modeled subsequently decreases + below (increases above) the maximum (minimum) value, the + gauge64 also decreases (increases). + + In the value set and its semantics, this type is equivalent + to the CounterBasedGauge64 SMIv2 textual convention defined + in RFC 2856"; + reference + "RFC 2856: Textual Conventions for Additional High Capacity + Data Types"; + } + + /*** collection of identifier related types ***/ + + typedef object-identifier { + type string { + pattern '(([0-1](\.[1-3]?[0-9]))|(2\.(0|([1-9]\d*))))' + + '(\.(0|([1-9]\d*)))*'; + } + description + "The object-identifier type represents administratively + assigned names in a registration-hierarchical-name tree. + + Values of this type are denoted as a sequence of numerical + non-negative sub-identifier values. Each sub-identifier + value MUST NOT exceed 2^32-1 (4294967295). Sub-identifiers + are separated by single dots and without any intermediate + whitespace. + + The ASN.1 standard restricts the value space of the first + sub-identifier to 0, 1, or 2. Furthermore, the value space + of the second sub-identifier is restricted to the range + 0 to 39 if the first sub-identifier is 0 or 1. Finally, + the ASN.1 standard requires that an object identifier + has always at least two sub-identifier. The pattern + captures these restrictions. + + Although the number of sub-identifiers is not limited, + module designers should realize that there may be + implementations that stick with the SMIv2 limit of 128 + sub-identifiers. + + This type is a superset of the SMIv2 OBJECT IDENTIFIER type + since it is not restricted to 128 sub-identifiers. Hence, + this type SHOULD NOT be used to represent the SMIv2 OBJECT + IDENTIFIER type, the object-identifier-128 type SHOULD be + used instead."; + reference + "ISO9834-1: Information technology -- Open Systems + Interconnection -- Procedures for the operation of OSI + Registration Authorities: General procedures and top + arcs of the ASN.1 Object Identifier tree"; + } + + + + + typedef object-identifier-128 { + type object-identifier { + pattern '\d*(\.\d*){1,127}'; + } + description + "This type represents object-identifiers restricted to 128 + sub-identifiers. + + In the value set and its semantics, this type is equivalent + to the OBJECT IDENTIFIER type of the SMIv2."; + reference + "RFC 2578: Structure of Management Information Version 2 (SMIv2)"; + } + + typedef yang-identifier { + type string { + length "1..max"; + pattern '[a-zA-Z_][a-zA-Z0-9\-_.]*'; + pattern '.|..|[^xX].*|.[^mM].*|..[^lL].*'; + } + description + "A YANG identifier string as defined by the 'identifier' + rule in Section 12 of RFC 6020. An identifier must + start with an alphabetic character or an underscore + followed by an arbitrary sequence of alphabetic or + numeric characters, underscores, hyphens, or dots. + + A YANG identifier MUST NOT start with any possible + combination of the lowercase or uppercase character + sequence 'xml'."; + reference + "RFC 6020: YANG - A Data Modeling Language for the Network + Configuration Protocol (NETCONF)"; + } + + /*** collection of date and time related types ***/ + + typedef date-and-time { + type string { + pattern '\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d+)?' + + '(Z|[\+\-]\d{2}:\d{2})'; + } + description + "The date-and-time type is a profile of the ISO 8601 + standard for representation of dates and times using the + Gregorian calendar. The profile is defined by the + date-time production in Section 5.6 of RFC 3339. + + The date-and-time type is compatible with the dateTime XML + schema type with the following notable exceptions: + + (a) The date-and-time type does not allow negative years. + + (b) The date-and-time time-offset -00:00 indicates an unknown + time zone (see RFC 3339) while -00:00 and +00:00 and Z all + represent the same time zone in dateTime. + + (c) The canonical format (see below) of data-and-time values + differs from the canonical format used by the dateTime XML + schema type, which requires all times to be in UTC using the + time-offset 'Z'. + + This type is not equivalent to the DateAndTime textual + convention of the SMIv2 since RFC 3339 uses a different + separator between full-date and full-time and provides + higher resolution of time-secfrac. + + The canonical format for date-and-time values with a known time + zone uses a numeric time zone offset that is calculated using + the device's configured known offset to UTC time. A change of + the device's offset to UTC time will cause date-and-time values + to change accordingly. Such changes might happen periodically + in case a server follows automatically daylight saving time + (DST) time zone offset changes. The canonical format for + date-and-time values with an unknown time zone (usually referring + to the notion of local time) uses the time-offset -00:00."; + reference + "RFC 3339: Date and Time on the Internet: Timestamps + RFC 2579: Textual Conventions for SMIv2 + XSD-TYPES: XML Schema Part 2: Datatypes Second Edition"; + } + + typedef timeticks { + type uint32; + description + "The timeticks type represents a non-negative integer that + represents the time, modulo 2^32 (4294967296 decimal), in + hundredths of a second between two epochs. When a schema + node is defined that uses this type, the description of + the schema node identifies both of the reference epochs. + + In the value set and its semantics, this type is equivalent + to the TimeTicks type of the SMIv2."; + reference + "RFC 2578: Structure of Management Information Version 2 (SMIv2)"; + } + + typedef timestamp { + type yang:timeticks; + description + "The timestamp type represents the value of an associated + timeticks schema node at which a specific occurrence happened. + The specific occurrence must be defined in the description + of any schema node defined using this type. When the specific + occurrence occurred prior to the last time the associated + timeticks attribute was zero, then the timestamp value is + zero. Note that this requires all timestamp values to be + reset to zero when the value of the associated timeticks + attribute reaches 497+ days and wraps around to zero. + + The associated timeticks schema node must be specified + in the description of any schema node using this type. + + In the value set and its semantics, this type is equivalent + to the TimeStamp textual convention of the SMIv2."; + reference + "RFC 2579: Textual Conventions for SMIv2"; + } + + /*** collection of generic address types ***/ + + typedef phys-address { + type string { + pattern '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'; + } + description + "Represents media- or physical-level addresses represented + as a sequence octets, each octet represented by two hexadecimal + numbers. Octets are separated by colons. The canonical + representation uses lowercase characters. + + In the value set and its semantics, this type is equivalent + to the PhysAddress textual convention of the SMIv2."; + reference + "RFC 2579: Textual Conventions for SMIv2"; + } + + typedef mac-address { + type string { + pattern '[0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){5}'; + } + description + "The mac-address type represents an IEEE 802 MAC address. + The canonical representation uses lowercase characters. + + In the value set and its semantics, this type is equivalent + to the MacAddress textual convention of the SMIv2."; + reference + "IEEE 802: IEEE Standard for Local and Metropolitan Area + Networks: Overview and Architecture + RFC 2579: Textual Conventions for SMIv2"; + } + + /*** collection of XML specific types ***/ + + typedef xpath1.0 { + type string; + description + "This type represents an XPATH 1.0 expression. + + When a schema node is defined that uses this type, the + description of the schema node MUST specify the XPath + context in which the XPath expression is evaluated."; + reference + "XPATH: XML Path Language (XPath) Version 1.0"; + } + + } diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/modules/restconf-module-testing-mount-point/mount-point-1.yang b/netconf/restconf/restconf-nb-bierman02/src/test/resources/modules/restconf-module-testing-mount-point/mount-point-1.yang new file mode 100644 index 0000000..4963c89 --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/modules/restconf-module-testing-mount-point/mount-point-1.yang @@ -0,0 +1,11 @@ +module mount-point-1 { + namespace "mount:point:1"; + prefix "point1"; + revision "2016-01-01"; + + container cont { + } + + list listA { + } +}
\ No newline at end of file diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/modules/restconf-module-testing-mount-point/restconf-module-with-illegal-container-modules/restconf-module-with-illegal-container-modules.yang b/netconf/restconf/restconf-nb-bierman02/src/test/resources/modules/restconf-module-testing-mount-point/restconf-module-with-illegal-container-modules/restconf-module-with-illegal-container-modules.yang new file mode 100644 index 0000000..116cdc1 --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/modules/restconf-module-testing-mount-point/restconf-module-with-illegal-container-modules/restconf-module-with-illegal-container-modules.yang @@ -0,0 +1,685 @@ +module restconf-module-with-illegal-container-modules { + namespace "urn:ietf:params:xml:ns:yang:ietf-restconf"; + prefix "restconf"; + + import ietf-yang-types { prefix yang; } + import ietf-inet-types { prefix inet; } + + organization + "IETF NETCONF (Network Configuration) Working Group"; + + contact + "Editor: Andy Bierman + <mailto:andy@yumaworks.com> + + Editor: Martin Bjorklund + <mailto:mbj@tail-f.com> + + Editor: Kent Watsen + <mailto:kwatsen@juniper.net> + + Editor: Rex Fernando + <mailto:rex@cisco.com>"; + + description + "This module contains conceptual YANG specifications + for the YANG Patch and error content that is used in + RESTCONF protocol messages. A conceptual container + representing the RESTCONF API nodes (media type + application/yang.api). + + Note that the YANG definitions within this module do not + represent configuration data of any kind. + The YANG grouping statements provide a normative syntax + for XML and JSON message encoding purposes. + Copyright (c) 2013 IETF Trust and the persons identified as + authors of the code. All rights reserved. + + Redistribution and use in source and binary forms, with or + without modification, is permitted pursuant to, and subject + to the license terms contained in, the Simplified BSD License + set forth in Section 4.c of the IETF Trust's Legal Provisions + Relating to IETF Documents + (http://trustee.ietf.org/license-info). + + This version of this YANG module is part of RFC XXXX; see + the RFC itself for full legal notices."; + + // RFC Ed.: replace XXXX with actual RFC number and remove this + // note. + + // RFC Ed.: remove this note + // Note: extracted from draft-bierman-netconf-restconf-02.txt + + // RFC Ed.: update the date below with the date of RFC publication + // and remove this note. + revision 2013-10-19 { + description + "Initial revision."; + reference + "RFC XXXX: RESTCONF Protocol."; + } + + typedef data-resource-identifier { + type string { + length "1 .. max"; + } + description + "Contains a Data Resource Identifier formatted string + to identify a specific data node. The data node that + uses this data type SHOULD define the document root + for data resource identifiers. The default document + root is the target datastore conceptual root node. + Data resource identifiers are defined relative to + this document root."; + reference + "RFC XXXX: [sec. 5.3.1.1 ABNF For Data Resource Identifiers]"; + } + + // this typedef is TBD; not currently used + typedef datastore-identifier { + type union { + type enumeration { + enum candidate { + description + "Identifies the NETCONF shared candidate datastore."; + reference + "RFC 6241, section 8.3"; + } + enum running { + description + "Identifies the NETCONF running datastore."; + reference + "RFC 6241, section 5.1"; + } + enum startup { + description + "Identifies the NETCONF startup datastore."; + reference + "RFC 6241, section 8.7"; + } + } + type string; + } + description + "Contains a string to identify a specific datastore. + The enumerated datastore identifier values are + reserved for standard datastore names."; + } + + typedef revision-identifier { + type string { + pattern '\d{4}-\d{2}-\d{2}'; + } + description + "Represents a specific date in YYYY-MM-DD format. + TBD: make pattern more precise to exclude leading zeros."; + } + + grouping yang-patch { + description + "A grouping that contains a YANG container + representing the syntax and semantics of a + YANG Patch edit request message."; + + container yang-patch { + description + "Represents a conceptual sequence of datastore edits, + called a patch. Each patch is given a client-assigned + patch identifier. Each edit MUST be applied + in ascending order, and all edits MUST be applied. + If any errors occur, then the target datastore MUST NOT + be changed by the patch operation. + + A patch MUST be validated by the server to be a + well-formed message before any of the patch edits + are validated or attempted. + + YANG datastore validation (defined in RFC 6020, section + 8.3.3) is performed after all edits have been + individually validated. + + It is possible for a datastore constraint violation to occur + due to any node in the datastore, including nodes not + included in the edit list. Any validation errors MUST + be reported in the reply message."; + + reference + "RFC 6020, section 8.3."; + + leaf patch-id { + type string; + description + "An arbitrary string provided by the client to identify + the entire patch. This value SHOULD be present in any + audit logging records generated by the server for the + patch. Error messages returned by the server pertaining + to this patch will be identified by this patch-id value."; + } + + leaf comment { + type string { + length "0 .. 1024"; + } + description + "An arbitrary string provided by the client to describe + the entire patch. This value SHOULD be present in any + audit logging records generated by the server for the + patch."; + } + + list edit { + key edit-id; + ordered-by user; + + description + "Represents one edit within the YANG Patch + request message."; + leaf edit-id { + type string; + description + "Arbitrary string index for the edit. + Error messages returned by the server pertaining + to a specific edit will be identified by this + value."; + } + + leaf operation { + type enumeration { + enum create { + description + "The target data node is created using the + supplied value, only if it does not already + exist."; + } + enum delete { + description + "Delete the target node, only if the data resource + currently exists, otherwise return an error."; + } + enum insert { + description + "Insert the supplied value into a user-ordered + list or leaf-list entry. The target node must + represent a new data resource."; + } + enum merge { + description + "The supplied value is merged with the target data + node."; + } + enum move { + description + "Move the target node. Reorder a user-ordered + list or leaf-list. The target node must represent + an existing data resource."; + } + enum replace { + description + "The supplied value is used to replace the target + data node."; + } + enum remove { + description + "Delete the target node if it currently exists."; + } + } + mandatory true; + description + "The datastore operation requested for the associated + edit entry"; + } + + leaf target { + type data-resource-identifier; + mandatory true; + description + "Identifies the target data resource for the edit + operation."; + } + + leaf point { + when "(../operation = 'insert' or " + + "../operation = 'move') and " + + "(../where = 'before' or ../where = 'after')" { + description + "Point leaf only applies for insert or move + operations, before or after an existing entry."; + } + type data-resource-identifier; + description + "The absolute URL path for the data node that is being + used as the insertion point or move point for the + target of this edit entry."; + } + + leaf where { + when "../operation = 'insert' or ../operation = 'move'" { + description + "Where leaf only applies for insert or move + operations."; + } + type enumeration { + enum before { + description + "Insert or move a data node before the data resource + identified by the 'point' parameter."; + } + enum after { + description + "Insert or move a data node after the data resource + identified by the 'point' parameter."; + } + enum first { + description + "Insert or move a data node so it becomes ordered + as the first entry."; + } + enum last { + description + "Insert or move a data node so it becomes ordered + as the last entry."; + } + + } + default last; + description + "Identifies where a data resource will be inserted or + moved. YANG only allows these operations for + list and leaf-list data nodes that are ordered-by + user."; + } + + anyxml value { + when "(../operation = 'create' or " + + "../operation = 'merge' " + + "or ../operation = 'replace' or " + + "../operation = 'insert')" { + description + "Value node only used for create, merge, + replace, and insert operations"; + } + description + "Value used for this edit operation."; + } + } + } + + } // grouping yang-patch + + + grouping yang-patch-status { + + description + "A grouping that contains a YANG container + representing the syntax and semantics of + YANG Patch status response message."; + + container yang-patch-status { + description + "A container representing the response message + sent by the server after a YANG Patch edit + request message has been processed."; + + leaf patch-id { + type string; + description + "The patch-id value used in the request"; + } + + choice global-status { + description + "Report global errors or complete success. + If there is no case selected then errors + are reported in the edit-status container."; + + case global-errors { + uses errors; + description + "This container will be present if global + errors unrelated to a specific edit occurred."; + } + leaf ok { + type empty; + description + "This leaf will be present if the request succeeded + and there are no errors reported in the edit-status + container."; + } + } + + container edit-status { + description + "This container will be present if there are + edit-specific status responses to report."; + + list edit { + key edit-id; + + description + "Represents a list of status responses, + corresponding to edits in the YANG Patch + request message. If an edit entry was + skipped or not reached by the server, + then this list will not contain a corresponding + entry for that edit."; + + leaf edit-id { + type string; + description + "Response status is for the edit list entry + with this edit-id value."; + } + choice edit-status-choice { + description + "A choice between different types of status + responses for each edit entry."; + leaf ok { + type empty; + description + "This edit entry was invoked without any + errors detected by the server associated + with this edit."; + } + leaf location { + type inet:uri; + description + "Contains the Location header value that would be + returned if this edit causes a new resource to be + created. If the edit identified by the same edit-id + value was successfully invoked and a new resource + was created, then this field will be returned + instead of 'ok'."; + } + case errors { + uses errors; + description + "The server detected errors associated with the + edit identified by the same edit-id value."; + } + } + } + } + } + } // grouping yang-patch-status + + + grouping errors { + + description + "A grouping that contains a YANG container + representing the syntax and semantics of a + YANG Patch errors report within a response message."; + + container errors { + config false; // needed so list error does not need a key + description + "Represents an error report returned by the server if + a request results in an error."; + + list error { + description + "An entry containing information about one + specific error that occurred while processing + a RESTCONF request."; + reference "RFC 6241, Section 4.3"; + + leaf error-type { + type enumeration { + enum transport { + description "The transport layer"; + } + enum rpc { + description "The rpc or notification layer"; + } + enum protocol { + description "The protocol operation layer"; + } + enum application { + description "The server application layer"; + } + } + mandatory true; + description + "The protocol layer where the error occurred."; + } + + leaf error-tag { + type string; + mandatory true; + description + "The enumerated error tag."; + } + + leaf error-app-tag { + type string; + description + "The application-specific error tag."; + } + + leaf error-path { + type data-resource-identifier; + description + "The target data resource identifier associated + with the error, if any."; + } + leaf error-message { + type string; + description + "A message describing the error."; + } + + container error-info { + description + "A container allowing additional information + to be included in the error report."; + // arbitrary anyxml content here + } + } + } + } // grouping errors + + + grouping restconf { + + description + "A grouping that contains a YANG container + representing the syntax and semantics of + the RESTCONF API resource."; + + container restconf { + description + "Conceptual container representing the + application/yang.api resource type."; + + container config { + description + "Container representing the application/yang.datastore + resource type. Represents the conceptual root of the + unified configuration datastore containing YANG data + nodes. The child nodes of this container are + configuration data resources (application/yang.data) + defined as top-level YANG data nodes from the modules + advertised by the server in /restconf/modules."; + } + + container operational { + description + "Container representing the application/yang.datastore + resource type. Represents the conceptual root of the + operational data supported by the server. The child + nodes of this container are operational data resources + (application/yang.data) defined as top-level + YANG data nodes from the modules advertised by + the server in /restconf/modules."; + } + + /** changed from container modules to list modules for testing purposes **/ + list modules { + description + "Contains a list of module description entries. + These modules are currently loaded into the server."; + + list module { + key "name revision"; + description + "Each entry represents one module currently + supported by the server."; + + leaf name { + type yang:yang-identifier; + description "The YANG module name."; + } + leaf revision { + type union { + type revision-identifier; + type string { length 0; } + } + description + "The YANG module revision date. An empty string is + used if no revision statement is present in the + YANG module."; + } + leaf namespace { + type inet:uri; + mandatory true; + description + "The XML namespace identifier for this module."; + } + leaf-list feature { + type yang:yang-identifier; + description + "List of YANG feature names from this module that are + supported by the server."; + } + leaf-list deviation { + type yang:yang-identifier; + description + "List of YANG deviation module names used by this + server to modify the conformance of the module + associated with this entry."; + } + } + } + + container operations { + description + "Container for all operation resources + (application/yang.operation), + + Each resource is represented as an empty leaf with the + name of the RPC operation from the YANG rpc statement. + + E.g.; + + POST /restconf/operations/show-log-errors + + leaf show-log-errors { + type empty; + } + "; + } + + container streams { + description + "Container representing the notification event streams + supported by the server."; + reference + "RFC 5277, Section 3.4, <streams> element."; + + list stream { + key name; + description + "Each entry describes an event stream supported by + the server."; + + leaf name { + type string; + description "The stream name"; + reference "RFC 5277, Section 3.4, <name> element."; + } + + leaf description { + type string; + description "Description of stream content"; + reference + "RFC 5277, Section 3.4, <description> element."; + } + + leaf replay-support { + type boolean; + description + "Indicates if replay buffer supported for this stream"; + reference + "RFC 5277, Section 3.4, <replaySupport> element."; + } + + leaf replay-log-creation-time { + type yang:date-and-time; + description + "Indicates the time the replay log for this stream + was created."; + reference + "RFC 5277, Section 3.4, <replayLogCreationTime> + element."; + } + + leaf events { + type empty; + description + "Represents the entry point for establishing + notification delivery via server sent events."; + } + } + } + + leaf version { + type enumeration { + enum "1.0" { + description + "Version 1.0 of the RESTCONF protocol."; + } + } + config false; + description + "Contains the RESTCONF protocol version."; + } + } + } // grouping restconf + + + grouping notification { + description + "Contains the notification message wrapper definition."; + + container notification { + description + "RESTCONF notification message wrapper."; + leaf event-time { + type yang:date-and-time; + mandatory true; + description + "The time the event was generated by the + event source."; + reference + "RFC 5277, section 4, <eventTime> element."; + } + + /* The YANG-specific notification container is encoded + * after the 'event-time' element. The format + * corresponds to the notificationContent element + * in RFC 5277, section 4. For example: + * + * module example-one { + * ... + * notification event1 { ... } + * + * } + * + * Encoded as element 'event1' in the namespace + * for module 'example-one'. + */ + } + } // grouping notification + + }
\ No newline at end of file diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/modules/restconf-module-testing-mount-point/restconf-module-with-illegal-list-module/restconf-module-with-illegal-list-module.yang b/netconf/restconf/restconf-nb-bierman02/src/test/resources/modules/restconf-module-testing-mount-point/restconf-module-with-illegal-list-module/restconf-module-with-illegal-list-module.yang new file mode 100644 index 0000000..2d8fbb1 --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/modules/restconf-module-testing-mount-point/restconf-module-with-illegal-list-module/restconf-module-with-illegal-list-module.yang @@ -0,0 +1,684 @@ +module restconf-module-with-illegal-list-module { + namespace "urn:ietf:params:xml:ns:yang:ietf-restconf"; + prefix "restconf"; + + import ietf-yang-types { prefix yang; } + import ietf-inet-types { prefix inet; } + + organization + "IETF NETCONF (Network Configuration) Working Group"; + + contact + "Editor: Andy Bierman + <mailto:andy@yumaworks.com> + + Editor: Martin Bjorklund + <mailto:mbj@tail-f.com> + + Editor: Kent Watsen + <mailto:kwatsen@juniper.net> + + Editor: Rex Fernando + <mailto:rex@cisco.com>"; + + description + "This module contains conceptual YANG specifications + for the YANG Patch and error content that is used in + RESTCONF protocol messages. A conceptual container + representing the RESTCONF API nodes (media type + application/yang.api). + + Note that the YANG definitions within this module do not + represent configuration data of any kind. + The YANG grouping statements provide a normative syntax + for XML and JSON message encoding purposes. + Copyright (c) 2013 IETF Trust and the persons identified as + authors of the code. All rights reserved. + + Redistribution and use in source and binary forms, with or + without modification, is permitted pursuant to, and subject + to the license terms contained in, the Simplified BSD License + set forth in Section 4.c of the IETF Trust's Legal Provisions + Relating to IETF Documents + (http://trustee.ietf.org/license-info). + + This version of this YANG module is part of RFC XXXX; see + the RFC itself for full legal notices."; + + // RFC Ed.: replace XXXX with actual RFC number and remove this + // note. + + // RFC Ed.: remove this note + // Note: extracted from draft-bierman-netconf-restconf-02.txt + + // RFC Ed.: update the date below with the date of RFC publication + // and remove this note. + revision 2013-10-19 { + description + "Initial revision."; + reference + "RFC XXXX: RESTCONF Protocol."; + } + + typedef data-resource-identifier { + type string { + length "1 .. max"; + } + description + "Contains a Data Resource Identifier formatted string + to identify a specific data node. The data node that + uses this data type SHOULD define the document root + for data resource identifiers. The default document + root is the target datastore conceptual root node. + Data resource identifiers are defined relative to + this document root."; + reference + "RFC XXXX: [sec. 5.3.1.1 ABNF For Data Resource Identifiers]"; + } + + // this typedef is TBD; not currently used + typedef datastore-identifier { + type union { + type enumeration { + enum candidate { + description + "Identifies the NETCONF shared candidate datastore."; + reference + "RFC 6241, section 8.3"; + } + enum running { + description + "Identifies the NETCONF running datastore."; + reference + "RFC 6241, section 5.1"; + } + enum startup { + description + "Identifies the NETCONF startup datastore."; + reference + "RFC 6241, section 8.7"; + } + } + type string; + } + description + "Contains a string to identify a specific datastore. + The enumerated datastore identifier values are + reserved for standard datastore names."; + } + + typedef revision-identifier { + type string { + pattern '\d{4}-\d{2}-\d{2}'; + } + description + "Represents a specific date in YYYY-MM-DD format. + TBD: make pattern more precise to exclude leading zeros."; + } + + grouping yang-patch { + description + "A grouping that contains a YANG container + representing the syntax and semantics of a + YANG Patch edit request message."; + + container yang-patch { + description + "Represents a conceptual sequence of datastore edits, + called a patch. Each patch is given a client-assigned + patch identifier. Each edit MUST be applied + in ascending order, and all edits MUST be applied. + If any errors occur, then the target datastore MUST NOT + be changed by the patch operation. + + A patch MUST be validated by the server to be a + well-formed message before any of the patch edits + are validated or attempted. + + YANG datastore validation (defined in RFC 6020, section + 8.3.3) is performed after all edits have been + individually validated. + + It is possible for a datastore constraint violation to occur + due to any node in the datastore, including nodes not + included in the edit list. Any validation errors MUST + be reported in the reply message."; + + reference + "RFC 6020, section 8.3."; + + leaf patch-id { + type string; + description + "An arbitrary string provided by the client to identify + the entire patch. This value SHOULD be present in any + audit logging records generated by the server for the + patch. Error messages returned by the server pertaining + to this patch will be identified by this patch-id value."; + } + + leaf comment { + type string { + length "0 .. 1024"; + } + description + "An arbitrary string provided by the client to describe + the entire patch. This value SHOULD be present in any + audit logging records generated by the server for the + patch."; + } + + list edit { + key edit-id; + ordered-by user; + + description + "Represents one edit within the YANG Patch + request message."; + leaf edit-id { + type string; + description + "Arbitrary string index for the edit. + Error messages returned by the server pertaining + to a specific edit will be identified by this + value."; + } + + leaf operation { + type enumeration { + enum create { + description + "The target data node is created using the + supplied value, only if it does not already + exist."; + } + enum delete { + description + "Delete the target node, only if the data resource + currently exists, otherwise return an error."; + } + enum insert { + description + "Insert the supplied value into a user-ordered + list or leaf-list entry. The target node must + represent a new data resource."; + } + enum merge { + description + "The supplied value is merged with the target data + node."; + } + enum move { + description + "Move the target node. Reorder a user-ordered + list or leaf-list. The target node must represent + an existing data resource."; + } + enum replace { + description + "The supplied value is used to replace the target + data node."; + } + enum remove { + description + "Delete the target node if it currently exists."; + } + } + mandatory true; + description + "The datastore operation requested for the associated + edit entry"; + } + + leaf target { + type data-resource-identifier; + mandatory true; + description + "Identifies the target data resource for the edit + operation."; + } + + leaf point { + when "(../operation = 'insert' or " + + "../operation = 'move') and " + + "(../where = 'before' or ../where = 'after')" { + description + "Point leaf only applies for insert or move + operations, before or after an existing entry."; + } + type data-resource-identifier; + description + "The absolute URL path for the data node that is being + used as the insertion point or move point for the + target of this edit entry."; + } + + leaf where { + when "../operation = 'insert' or ../operation = 'move'" { + description + "Where leaf only applies for insert or move + operations."; + } + type enumeration { + enum before { + description + "Insert or move a data node before the data resource + identified by the 'point' parameter."; + } + enum after { + description + "Insert or move a data node after the data resource + identified by the 'point' parameter."; + } + enum first { + description + "Insert or move a data node so it becomes ordered + as the first entry."; + } + enum last { + description + "Insert or move a data node so it becomes ordered + as the last entry."; + } + + } + default last; + description + "Identifies where a data resource will be inserted or + moved. YANG only allows these operations for + list and leaf-list data nodes that are ordered-by + user."; + } + + anyxml value { + when "(../operation = 'create' or " + + "../operation = 'merge' " + + "or ../operation = 'replace' or " + + "../operation = 'insert')" { + description + "Value node only used for create, merge, + replace, and insert operations"; + } + description + "Value used for this edit operation."; + } + } + } + + } // grouping yang-patch + + + grouping yang-patch-status { + + description + "A grouping that contains a YANG container + representing the syntax and semantics of + YANG Patch status response message."; + + container yang-patch-status { + description + "A container representing the response message + sent by the server after a YANG Patch edit + request message has been processed."; + + leaf patch-id { + type string; + description + "The patch-id value used in the request"; + } + + choice global-status { + description + "Report global errors or complete success. + If there is no case selected then errors + are reported in the edit-status container."; + + case global-errors { + uses errors; + description + "This container will be present if global + errors unrelated to a specific edit occurred."; + } + leaf ok { + type empty; + description + "This leaf will be present if the request succeeded + and there are no errors reported in the edit-status + container."; + } + } + + container edit-status { + description + "This container will be present if there are + edit-specific status responses to report."; + + list edit { + key edit-id; + + description + "Represents a list of status responses, + corresponding to edits in the YANG Patch + request message. If an edit entry was + skipped or not reached by the server, + then this list will not contain a corresponding + entry for that edit."; + + leaf edit-id { + type string; + description + "Response status is for the edit list entry + with this edit-id value."; + } + choice edit-status-choice { + description + "A choice between different types of status + responses for each edit entry."; + leaf ok { + type empty; + description + "This edit entry was invoked without any + errors detected by the server associated + with this edit."; + } + leaf location { + type inet:uri; + description + "Contains the Location header value that would be + returned if this edit causes a new resource to be + created. If the edit identified by the same edit-id + value was successfully invoked and a new resource + was created, then this field will be returned + instead of 'ok'."; + } + case errors { + uses errors; + description + "The server detected errors associated with the + edit identified by the same edit-id value."; + } + } + } + } + } + } // grouping yang-patch-status + + + grouping errors { + + description + "A grouping that contains a YANG container + representing the syntax and semantics of a + YANG Patch errors report within a response message."; + + container errors { + config false; // needed so list error does not need a key + description + "Represents an error report returned by the server if + a request results in an error."; + + list error { + description + "An entry containing information about one + specific error that occurred while processing + a RESTCONF request."; + reference "RFC 6241, Section 4.3"; + + leaf error-type { + type enumeration { + enum transport { + description "The transport layer"; + } + enum rpc { + description "The rpc or notification layer"; + } + enum protocol { + description "The protocol operation layer"; + } + enum application { + description "The server application layer"; + } + } + mandatory true; + description + "The protocol layer where the error occurred."; + } + + leaf error-tag { + type string; + mandatory true; + description + "The enumerated error tag."; + } + + leaf error-app-tag { + type string; + description + "The application-specific error tag."; + } + + leaf error-path { + type data-resource-identifier; + description + "The target data resource identifier associated + with the error, if any."; + } + leaf error-message { + type string; + description + "A message describing the error."; + } + + container error-info { + description + "A container allowing additional information + to be included in the error report."; + // arbitrary anyxml content here + } + } + } + } // grouping errors + + + grouping restconf { + + description + "A grouping that contains a YANG container + representing the syntax and semantics of + the RESTCONF API resource."; + + container restconf { + description + "Conceptual container representing the + application/yang.api resource type."; + + container config { + description + "Container representing the application/yang.datastore + resource type. Represents the conceptual root of the + unified configuration datastore containing YANG data + nodes. The child nodes of this container are + configuration data resources (application/yang.data) + defined as top-level YANG data nodes from the modules + advertised by the server in /restconf/modules."; + } + + container operational { + description + "Container representing the application/yang.datastore + resource type. Represents the conceptual root of the + operational data supported by the server. The child + nodes of this container are operational data resources + (application/yang.data) defined as top-level + YANG data nodes from the modules advertised by + the server in /restconf/modules."; + } + + container modules { + description + "Contains a list of module description entries. + These modules are currently loaded into the server."; + + /** changed from list module to container module for testing purposes **/ + container module { + description + "Each entry represents one module currently + supported by the server."; + + leaf name { + type yang:yang-identifier; + description "The YANG module name."; + } + leaf revision { + type union { + type revision-identifier; + type string { length 0; } + } + description + "The YANG module revision date. An empty string is + used if no revision statement is present in the + YANG module."; + } + leaf namespace { + type inet:uri; + mandatory true; + description + "The XML namespace identifier for this module."; + } + leaf-list feature { + type yang:yang-identifier; + description + "List of YANG feature names from this module that are + supported by the server."; + } + leaf-list deviation { + type yang:yang-identifier; + description + "List of YANG deviation module names used by this + server to modify the conformance of the module + associated with this entry."; + } + } + } + + container operations { + description + "Container for all operation resources + (application/yang.operation), + + Each resource is represented as an empty leaf with the + name of the RPC operation from the YANG rpc statement. + + E.g.; + + POST /restconf/operations/show-log-errors + + leaf show-log-errors { + type empty; + } + "; + } + + container streams { + description + "Container representing the notification event streams + supported by the server."; + reference + "RFC 5277, Section 3.4, <streams> element."; + + list stream { + key name; + description + "Each entry describes an event stream supported by + the server."; + + leaf name { + type string; + description "The stream name"; + reference "RFC 5277, Section 3.4, <name> element."; + } + + leaf description { + type string; + description "Description of stream content"; + reference + "RFC 5277, Section 3.4, <description> element."; + } + + leaf replay-support { + type boolean; + description + "Indicates if replay buffer supported for this stream"; + reference + "RFC 5277, Section 3.4, <replaySupport> element."; + } + + leaf replay-log-creation-time { + type yang:date-and-time; + description + "Indicates the time the replay log for this stream + was created."; + reference + "RFC 5277, Section 3.4, <replayLogCreationTime> + element."; + } + + leaf events { + type empty; + description + "Represents the entry point for establishing + notification delivery via server sent events."; + } + } + } + + leaf version { + type enumeration { + enum "1.0" { + description + "Version 1.0 of the RESTCONF protocol."; + } + } + config false; + description + "Contains the RESTCONF protocol version."; + } + } + } // grouping restconf + + + grouping notification { + description + "Contains the notification message wrapper definition."; + + container notification { + description + "RESTCONF notification message wrapper."; + leaf event-time { + type yang:date-and-time; + mandatory true; + description + "The time the event was generated by the + event source."; + reference + "RFC 5277, section 4, <eventTime> element."; + } + + /* The YANG-specific notification container is encoded + * after the 'event-time' element. The format + * corresponds to the notificationContent element + * in RFC 5277, section 4. For example: + * + * module example-one { + * ... + * notification event1 { ... } + * + * } + * + * Encoded as element 'event1' in the namespace + * for module 'example-one'. + */ + } + } // grouping notification + + }
\ No newline at end of file diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/modules/restconf-module-testing-mount-point/restconf-module-with-missing-container-modules/restconf-module-with-missing-container-modules.yang b/netconf/restconf/restconf-nb-bierman02/src/test/resources/modules/restconf-module-testing-mount-point/restconf-module-with-missing-container-modules/restconf-module-with-missing-container-modules.yang new file mode 100644 index 0000000..907533d --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/modules/restconf-module-testing-mount-point/restconf-module-with-missing-container-modules/restconf-module-with-missing-container-modules.yang @@ -0,0 +1,639 @@ +module restconf-module-with-missing-container-modules { + namespace "urn:ietf:params:xml:ns:yang:ietf-restconf"; + prefix "restconf"; + + import ietf-yang-types { prefix yang; } + import ietf-inet-types { prefix inet; } + + organization + "IETF NETCONF (Network Configuration) Working Group"; + + contact + "Editor: Andy Bierman + <mailto:andy@yumaworks.com> + + Editor: Martin Bjorklund + <mailto:mbj@tail-f.com> + + Editor: Kent Watsen + <mailto:kwatsen@juniper.net> + + Editor: Rex Fernando + <mailto:rex@cisco.com>"; + + description + "This module contains conceptual YANG specifications + for the YANG Patch and error content that is used in + RESTCONF protocol messages. A conceptual container + representing the RESTCONF API nodes (media type + application/yang.api). + + Note that the YANG definitions within this module do not + represent configuration data of any kind. + The YANG grouping statements provide a normative syntax + for XML and JSON message encoding purposes. + Copyright (c) 2013 IETF Trust and the persons identified as + authors of the code. All rights reserved. + + Redistribution and use in source and binary forms, with or + without modification, is permitted pursuant to, and subject + to the license terms contained in, the Simplified BSD License + set forth in Section 4.c of the IETF Trust's Legal Provisions + Relating to IETF Documents + (http://trustee.ietf.org/license-info). + + This version of this YANG module is part of RFC XXXX; see + the RFC itself for full legal notices."; + + // RFC Ed.: replace XXXX with actual RFC number and remove this + // note. + + // RFC Ed.: remove this note + // Note: extracted from draft-bierman-netconf-restconf-02.txt + + // RFC Ed.: update the date below with the date of RFC publication + // and remove this note. + revision 2013-10-19 { + description + "Initial revision."; + reference + "RFC XXXX: RESTCONF Protocol."; + } + + typedef data-resource-identifier { + type string { + length "1 .. max"; + } + description + "Contains a Data Resource Identifier formatted string + to identify a specific data node. The data node that + uses this data type SHOULD define the document root + for data resource identifiers. The default document + root is the target datastore conceptual root node. + Data resource identifiers are defined relative to + this document root."; + reference + "RFC XXXX: [sec. 5.3.1.1 ABNF For Data Resource Identifiers]"; + } + + // this typedef is TBD; not currently used + typedef datastore-identifier { + type union { + type enumeration { + enum candidate { + description + "Identifies the NETCONF shared candidate datastore."; + reference + "RFC 6241, section 8.3"; + } + enum running { + description + "Identifies the NETCONF running datastore."; + reference + "RFC 6241, section 5.1"; + } + enum startup { + description + "Identifies the NETCONF startup datastore."; + reference + "RFC 6241, section 8.7"; + } + } + type string; + } + description + "Contains a string to identify a specific datastore. + The enumerated datastore identifier values are + reserved for standard datastore names."; + } + + typedef revision-identifier { + type string { + pattern '\d{4}-\d{2}-\d{2}'; + } + description + "Represents a specific date in YYYY-MM-DD format. + TBD: make pattern more precise to exclude leading zeros."; + } + + grouping yang-patch { + description + "A grouping that contains a YANG container + representing the syntax and semantics of a + YANG Patch edit request message."; + + container yang-patch { + description + "Represents a conceptual sequence of datastore edits, + called a patch. Each patch is given a client-assigned + patch identifier. Each edit MUST be applied + in ascending order, and all edits MUST be applied. + If any errors occur, then the target datastore MUST NOT + be changed by the patch operation. + + A patch MUST be validated by the server to be a + well-formed message before any of the patch edits + are validated or attempted. + + YANG datastore validation (defined in RFC 6020, section + 8.3.3) is performed after all edits have been + individually validated. + + It is possible for a datastore constraint violation to occur + due to any node in the datastore, including nodes not + included in the edit list. Any validation errors MUST + be reported in the reply message."; + + reference + "RFC 6020, section 8.3."; + + leaf patch-id { + type string; + description + "An arbitrary string provided by the client to identify + the entire patch. This value SHOULD be present in any + audit logging records generated by the server for the + patch. Error messages returned by the server pertaining + to this patch will be identified by this patch-id value."; + } + + leaf comment { + type string { + length "0 .. 1024"; + } + description + "An arbitrary string provided by the client to describe + the entire patch. This value SHOULD be present in any + audit logging records generated by the server for the + patch."; + } + + list edit { + key edit-id; + ordered-by user; + + description + "Represents one edit within the YANG Patch + request message."; + leaf edit-id { + type string; + description + "Arbitrary string index for the edit. + Error messages returned by the server pertaining + to a specific edit will be identified by this + value."; + } + + leaf operation { + type enumeration { + enum create { + description + "The target data node is created using the + supplied value, only if it does not already + exist."; + } + enum delete { + description + "Delete the target node, only if the data resource + currently exists, otherwise return an error."; + } + enum insert { + description + "Insert the supplied value into a user-ordered + list or leaf-list entry. The target node must + represent a new data resource."; + } + enum merge { + description + "The supplied value is merged with the target data + node."; + } + enum move { + description + "Move the target node. Reorder a user-ordered + list or leaf-list. The target node must represent + an existing data resource."; + } + enum replace { + description + "The supplied value is used to replace the target + data node."; + } + enum remove { + description + "Delete the target node if it currently exists."; + } + } + mandatory true; + description + "The datastore operation requested for the associated + edit entry"; + } + + leaf target { + type data-resource-identifier; + mandatory true; + description + "Identifies the target data resource for the edit + operation."; + } + + leaf point { + when "(../operation = 'insert' or " + + "../operation = 'move') and " + + "(../where = 'before' or ../where = 'after')" { + description + "Point leaf only applies for insert or move + operations, before or after an existing entry."; + } + type data-resource-identifier; + description + "The absolute URL path for the data node that is being + used as the insertion point or move point for the + target of this edit entry."; + } + + leaf where { + when "../operation = 'insert' or ../operation = 'move'" { + description + "Where leaf only applies for insert or move + operations."; + } + type enumeration { + enum before { + description + "Insert or move a data node before the data resource + identified by the 'point' parameter."; + } + enum after { + description + "Insert or move a data node after the data resource + identified by the 'point' parameter."; + } + enum first { + description + "Insert or move a data node so it becomes ordered + as the first entry."; + } + enum last { + description + "Insert or move a data node so it becomes ordered + as the last entry."; + } + + } + default last; + description + "Identifies where a data resource will be inserted or + moved. YANG only allows these operations for + list and leaf-list data nodes that are ordered-by + user."; + } + + anyxml value { + when "(../operation = 'create' or " + + "../operation = 'merge' " + + "or ../operation = 'replace' or " + + "../operation = 'insert')" { + description + "Value node only used for create, merge, + replace, and insert operations"; + } + description + "Value used for this edit operation."; + } + } + } + + } // grouping yang-patch + + + grouping yang-patch-status { + + description + "A grouping that contains a YANG container + representing the syntax and semantics of + YANG Patch status response message."; + + container yang-patch-status { + description + "A container representing the response message + sent by the server after a YANG Patch edit + request message has been processed."; + + leaf patch-id { + type string; + description + "The patch-id value used in the request"; + } + + choice global-status { + description + "Report global errors or complete success. + If there is no case selected then errors + are reported in the edit-status container."; + + case global-errors { + uses errors; + description + "This container will be present if global + errors unrelated to a specific edit occurred."; + } + leaf ok { + type empty; + description + "This leaf will be present if the request succeeded + and there are no errors reported in the edit-status + container."; + } + } + + container edit-status { + description + "This container will be present if there are + edit-specific status responses to report."; + + list edit { + key edit-id; + + description + "Represents a list of status responses, + corresponding to edits in the YANG Patch + request message. If an edit entry was + skipped or not reached by the server, + then this list will not contain a corresponding + entry for that edit."; + + leaf edit-id { + type string; + description + "Response status is for the edit list entry + with this edit-id value."; + } + choice edit-status-choice { + description + "A choice between different types of status + responses for each edit entry."; + leaf ok { + type empty; + description + "This edit entry was invoked without any + errors detected by the server associated + with this edit."; + } + leaf location { + type inet:uri; + description + "Contains the Location header value that would be + returned if this edit causes a new resource to be + created. If the edit identified by the same edit-id + value was successfully invoked and a new resource + was created, then this field will be returned + instead of 'ok'."; + } + case errors { + uses errors; + description + "The server detected errors associated with the + edit identified by the same edit-id value."; + } + } + } + } + } + } // grouping yang-patch-status + + + grouping errors { + + description + "A grouping that contains a YANG container + representing the syntax and semantics of a + YANG Patch errors report within a response message."; + + container errors { + config false; // needed so list error does not need a key + description + "Represents an error report returned by the server if + a request results in an error."; + + list error { + description + "An entry containing information about one + specific error that occurred while processing + a RESTCONF request."; + reference "RFC 6241, Section 4.3"; + + leaf error-type { + type enumeration { + enum transport { + description "The transport layer"; + } + enum rpc { + description "The rpc or notification layer"; + } + enum protocol { + description "The protocol operation layer"; + } + enum application { + description "The server application layer"; + } + } + mandatory true; + description + "The protocol layer where the error occurred."; + } + + leaf error-tag { + type string; + mandatory true; + description + "The enumerated error tag."; + } + + leaf error-app-tag { + type string; + description + "The application-specific error tag."; + } + + leaf error-path { + type data-resource-identifier; + description + "The target data resource identifier associated + with the error, if any."; + } + leaf error-message { + type string; + description + "A message describing the error."; + } + + container error-info { + description + "A container allowing additional information + to be included in the error report."; + // arbitrary anyxml content here + } + } + } + } // grouping errors + + + grouping restconf { + + description + "A grouping that contains a YANG container + representing the syntax and semantics of + the RESTCONF API resource."; + + container restconf { + description + "Conceptual container representing the + application/yang.api resource type."; + + container config { + description + "Container representing the application/yang.datastore + resource type. Represents the conceptual root of the + unified configuration datastore containing YANG data + nodes. The child nodes of this container are + configuration data resources (application/yang.data) + defined as top-level YANG data nodes from the modules + advertised by the server in /restconf/modules."; + } + + container operational { + description + "Container representing the application/yang.datastore + resource type. Represents the conceptual root of the + operational data supported by the server. The child + nodes of this container are operational data resources + (application/yang.data) defined as top-level + YANG data nodes from the modules advertised by + the server in /restconf/modules."; + } + + // removed container modules for testing purposes + + container operations { + description + "Container for all operation resources + (application/yang.operation), + + Each resource is represented as an empty leaf with the + name of the RPC operation from the YANG rpc statement. + + E.g.; + + POST /restconf/operations/show-log-errors + + leaf show-log-errors { + type empty; + } + "; + } + + container streams { + description + "Container representing the notification event streams + supported by the server."; + reference + "RFC 5277, Section 3.4, <streams> element."; + + list stream { + key name; + description + "Each entry describes an event stream supported by + the server."; + + leaf name { + type string; + description "The stream name"; + reference "RFC 5277, Section 3.4, <name> element."; + } + + leaf description { + type string; + description "Description of stream content"; + reference + "RFC 5277, Section 3.4, <description> element."; + } + + leaf replay-support { + type boolean; + description + "Indicates if replay buffer supported for this stream"; + reference + "RFC 5277, Section 3.4, <replaySupport> element."; + } + + leaf replay-log-creation-time { + type yang:date-and-time; + description + "Indicates the time the replay log for this stream + was created."; + reference + "RFC 5277, Section 3.4, <replayLogCreationTime> + element."; + } + + leaf events { + type empty; + description + "Represents the entry point for establishing + notification delivery via server sent events."; + } + } + } + + leaf version { + type enumeration { + enum "1.0" { + description + "Version 1.0 of the RESTCONF protocol."; + } + } + config false; + description + "Contains the RESTCONF protocol version."; + } + } + } // grouping restconf + + + grouping notification { + description + "Contains the notification message wrapper definition."; + + container notification { + description + "RESTCONF notification message wrapper."; + leaf event-time { + type yang:date-and-time; + mandatory true; + description + "The time the event was generated by the + event source."; + reference + "RFC 5277, section 4, <eventTime> element."; + } + + /* The YANG-specific notification container is encoded + * after the 'event-time' element. The format + * corresponds to the notificationContent element + * in RFC 5277, section 4. For example: + * + * module example-one { + * ... + * notification event1 { ... } + * + * } + * + * Encoded as element 'event1' in the namespace + * for module 'example-one'. + */ + } + } // grouping notification + + }
\ No newline at end of file diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/modules/restconf-module-testing-mount-point/restconf-module-with-missing-list-module/restconf-module-with-missing-list-module.yang b/netconf/restconf/restconf-nb-bierman02/src/test/resources/modules/restconf-module-testing-mount-point/restconf-module-with-missing-list-module/restconf-module-with-missing-list-module.yang new file mode 100644 index 0000000..6d2b4da --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/modules/restconf-module-testing-mount-point/restconf-module-with-missing-list-module/restconf-module-with-missing-list-module.yang @@ -0,0 +1,650 @@ +module restconf-module-with-missing-list-module { + namespace "urn:ietf:params:xml:ns:yang:ietf-restconf"; + prefix "restconf"; + + import ietf-yang-types { prefix yang; } + import ietf-inet-types { prefix inet; } + + organization + "IETF NETCONF (Network Configuration) Working Group"; + + contact + "Editor: Andy Bierman + <mailto:andy@yumaworks.com> + + Editor: Martin Bjorklund + <mailto:mbj@tail-f.com> + + Editor: Kent Watsen + <mailto:kwatsen@juniper.net> + + Editor: Rex Fernando + <mailto:rex@cisco.com>"; + + description + "This module contains conceptual YANG specifications + for the YANG Patch and error content that is used in + RESTCONF protocol messages. A conceptual container + representing the RESTCONF API nodes (media type + application/yang.api). + + Note that the YANG definitions within this module do not + represent configuration data of any kind. + The YANG grouping statements provide a normative syntax + for XML and JSON message encoding purposes. + Copyright (c) 2013 IETF Trust and the persons identified as + authors of the code. All rights reserved. + + Redistribution and use in source and binary forms, with or + without modification, is permitted pursuant to, and subject + to the license terms contained in, the Simplified BSD License + set forth in Section 4.c of the IETF Trust's Legal Provisions + Relating to IETF Documents + (http://trustee.ietf.org/license-info). + + This version of this YANG module is part of RFC XXXX; see + the RFC itself for full legal notices."; + + // RFC Ed.: replace XXXX with actual RFC number and remove this + // note. + + // RFC Ed.: remove this note + // Note: extracted from draft-bierman-netconf-restconf-02.txt + + // RFC Ed.: update the date below with the date of RFC publication + // and remove this note. + revision 2013-10-19 { + description + "Initial revision."; + reference + "RFC XXXX: RESTCONF Protocol."; + } + + typedef data-resource-identifier { + type string { + length "1 .. max"; + } + description + "Contains a Data Resource Identifier formatted string + to identify a specific data node. The data node that + uses this data type SHOULD define the document root + for data resource identifiers. The default document + root is the target datastore conceptual root node. + Data resource identifiers are defined relative to + this document root."; + reference + "RFC XXXX: [sec. 5.3.1.1 ABNF For Data Resource Identifiers]"; + } + + // this typedef is TBD; not currently used + typedef datastore-identifier { + type union { + type enumeration { + enum candidate { + description + "Identifies the NETCONF shared candidate datastore."; + reference + "RFC 6241, section 8.3"; + } + enum running { + description + "Identifies the NETCONF running datastore."; + reference + "RFC 6241, section 5.1"; + } + enum startup { + description + "Identifies the NETCONF startup datastore."; + reference + "RFC 6241, section 8.7"; + } + } + type string; + } + description + "Contains a string to identify a specific datastore. + The enumerated datastore identifier values are + reserved for standard datastore names."; + } + + typedef revision-identifier { + type string { + pattern '\d{4}-\d{2}-\d{2}'; + } + description + "Represents a specific date in YYYY-MM-DD format. + TBD: make pattern more precise to exclude leading zeros."; + } + + grouping yang-patch { + description + "A grouping that contains a YANG container + representing the syntax and semantics of a + YANG Patch edit request message."; + + container yang-patch { + description + "Represents a conceptual sequence of datastore edits, + called a patch. Each patch is given a client-assigned + patch identifier. Each edit MUST be applied + in ascending order, and all edits MUST be applied. + If any errors occur, then the target datastore MUST NOT + be changed by the patch operation. + + A patch MUST be validated by the server to be a + well-formed message before any of the patch edits + are validated or attempted. + + YANG datastore validation (defined in RFC 6020, section + 8.3.3) is performed after all edits have been + individually validated. + + It is possible for a datastore constraint violation to occur + due to any node in the datastore, including nodes not + included in the edit list. Any validation errors MUST + be reported in the reply message."; + + reference + "RFC 6020, section 8.3."; + + leaf patch-id { + type string; + description + "An arbitrary string provided by the client to identify + the entire patch. This value SHOULD be present in any + audit logging records generated by the server for the + patch. Error messages returned by the server pertaining + to this patch will be identified by this patch-id value."; + } + + leaf comment { + type string { + length "0 .. 1024"; + } + description + "An arbitrary string provided by the client to describe + the entire patch. This value SHOULD be present in any + audit logging records generated by the server for the + patch."; + } + + list edit { + key edit-id; + ordered-by user; + + description + "Represents one edit within the YANG Patch + request message."; + leaf edit-id { + type string; + description + "Arbitrary string index for the edit. + Error messages returned by the server pertaining + to a specific edit will be identified by this + value."; + } + + leaf operation { + type enumeration { + enum create { + description + "The target data node is created using the + supplied value, only if it does not already + exist."; + } + enum delete { + description + "Delete the target node, only if the data resource + currently exists, otherwise return an error."; + } + enum insert { + description + "Insert the supplied value into a user-ordered + list or leaf-list entry. The target node must + represent a new data resource."; + } + enum merge { + description + "The supplied value is merged with the target data + node."; + } + enum move { + description + "Move the target node. Reorder a user-ordered + list or leaf-list. The target node must represent + an existing data resource."; + } + enum replace { + description + "The supplied value is used to replace the target + data node."; + } + enum remove { + description + "Delete the target node if it currently exists."; + } + } + mandatory true; + description + "The datastore operation requested for the associated + edit entry"; + } + + leaf target { + type data-resource-identifier; + mandatory true; + description + "Identifies the target data resource for the edit + operation."; + } + + leaf point { + when "(../operation = 'insert' or " + + "../operation = 'move') and " + + "(../where = 'before' or ../where = 'after')" { + description + "Point leaf only applies for insert or move + operations, before or after an existing entry."; + } + type data-resource-identifier; + description + "The absolute URL path for the data node that is being + used as the insertion point or move point for the + target of this edit entry."; + } + + leaf where { + when "../operation = 'insert' or ../operation = 'move'" { + description + "Where leaf only applies for insert or move + operations."; + } + type enumeration { + enum before { + description + "Insert or move a data node before the data resource + identified by the 'point' parameter."; + } + enum after { + description + "Insert or move a data node after the data resource + identified by the 'point' parameter."; + } + enum first { + description + "Insert or move a data node so it becomes ordered + as the first entry."; + } + enum last { + description + "Insert or move a data node so it becomes ordered + as the last entry."; + } + + } + default last; + description + "Identifies where a data resource will be inserted or + moved. YANG only allows these operations for + list and leaf-list data nodes that are ordered-by + user."; + } + + anyxml value { + when "(../operation = 'create' or " + + "../operation = 'merge' " + + "or ../operation = 'replace' or " + + "../operation = 'insert')" { + description + "Value node only used for create, merge, + replace, and insert operations"; + } + description + "Value used for this edit operation."; + } + } + } + + } // grouping yang-patch + + + grouping yang-patch-status { + + description + "A grouping that contains a YANG container + representing the syntax and semantics of + YANG Patch status response message."; + + container yang-patch-status { + description + "A container representing the response message + sent by the server after a YANG Patch edit + request message has been processed."; + + leaf patch-id { + type string; + description + "The patch-id value used in the request"; + } + + choice global-status { + description + "Report global errors or complete success. + If there is no case selected then errors + are reported in the edit-status container."; + + case global-errors { + uses errors; + description + "This container will be present if global + errors unrelated to a specific edit occurred."; + } + leaf ok { + type empty; + description + "This leaf will be present if the request succeeded + and there are no errors reported in the edit-status + container."; + } + } + + container edit-status { + description + "This container will be present if there are + edit-specific status responses to report."; + + list edit { + key edit-id; + + description + "Represents a list of status responses, + corresponding to edits in the YANG Patch + request message. If an edit entry was + skipped or not reached by the server, + then this list will not contain a corresponding + entry for that edit."; + + leaf edit-id { + type string; + description + "Response status is for the edit list entry + with this edit-id value."; + } + choice edit-status-choice { + description + "A choice between different types of status + responses for each edit entry."; + leaf ok { + type empty; + description + "This edit entry was invoked without any + errors detected by the server associated + with this edit."; + } + leaf location { + type inet:uri; + description + "Contains the Location header value that would be + returned if this edit causes a new resource to be + created. If the edit identified by the same edit-id + value was successfully invoked and a new resource + was created, then this field will be returned + instead of 'ok'."; + } + case errors { + uses errors; + description + "The server detected errors associated with the + edit identified by the same edit-id value."; + } + } + } + } + } + } // grouping yang-patch-status + + + grouping errors { + + description + "A grouping that contains a YANG container + representing the syntax and semantics of a + YANG Patch errors report within a response message."; + + container errors { + config false; // needed so list error does not need a key + description + "Represents an error report returned by the server if + a request results in an error."; + + list error { + description + "An entry containing information about one + specific error that occurred while processing + a RESTCONF request."; + reference "RFC 6241, Section 4.3"; + + leaf error-type { + type enumeration { + enum transport { + description "The transport layer"; + } + enum rpc { + description "The rpc or notification layer"; + } + enum protocol { + description "The protocol operation layer"; + } + enum application { + description "The server application layer"; + } + } + mandatory true; + description + "The protocol layer where the error occurred."; + } + + leaf error-tag { + type string; + mandatory true; + description + "The enumerated error tag."; + } + + leaf error-app-tag { + type string; + description + "The application-specific error tag."; + } + + leaf error-path { + type data-resource-identifier; + description + "The target data resource identifier associated + with the error, if any."; + } + leaf error-message { + type string; + description + "A message describing the error."; + } + + container error-info { + description + "A container allowing additional information + to be included in the error report."; + // arbitrary anyxml content here + } + } + } + } // grouping errors + + + grouping restconf { + + description + "A grouping that contains a YANG container + representing the syntax and semantics of + the RESTCONF API resource."; + + container restconf { + description + "Conceptual container representing the + application/yang.api resource type."; + + container config { + description + "Container representing the application/yang.datastore + resource type. Represents the conceptual root of the + unified configuration datastore containing YANG data + nodes. The child nodes of this container are + configuration data resources (application/yang.data) + defined as top-level YANG data nodes from the modules + advertised by the server in /restconf/modules."; + } + + container operational { + description + "Container representing the application/yang.datastore + resource type. Represents the conceptual root of the + operational data supported by the server. The child + nodes of this container are operational data resources + (application/yang.data) defined as top-level + YANG data nodes from the modules advertised by + the server in /restconf/modules."; + } + + container modules { + description + "Contains a list of module description entries. + These modules are currently loaded into the server."; + + // removed list module for testing purposes + added list test-list + list test-list { + leaf test-leaf { + type string; + } + } + } + + container operations { + description + "Container for all operation resources + (application/yang.operation), + + Each resource is represented as an empty leaf with the + name of the RPC operation from the YANG rpc statement. + + E.g.; + + POST /restconf/operations/show-log-errors + + leaf show-log-errors { + type empty; + } + "; + } + + container streams { + description + "Container representing the notification event streams + supported by the server."; + reference + "RFC 5277, Section 3.4, <streams> element."; + + list stream { + key name; + description + "Each entry describes an event stream supported by + the server."; + + leaf name { + type string; + description "The stream name"; + reference "RFC 5277, Section 3.4, <name> element."; + } + + leaf description { + type string; + description "Description of stream content"; + reference + "RFC 5277, Section 3.4, <description> element."; + } + + leaf replay-support { + type boolean; + description + "Indicates if replay buffer supported for this stream"; + reference + "RFC 5277, Section 3.4, <replaySupport> element."; + } + + leaf replay-log-creation-time { + type yang:date-and-time; + description + "Indicates the time the replay log for this stream + was created."; + reference + "RFC 5277, Section 3.4, <replayLogCreationTime> + element."; + } + + leaf events { + type empty; + description + "Represents the entry point for establishing + notification delivery via server sent events."; + } + } + } + + leaf version { + type enumeration { + enum "1.0" { + description + "Version 1.0 of the RESTCONF protocol."; + } + } + config false; + description + "Contains the RESTCONF protocol version."; + } + } + } // grouping restconf + + + grouping notification { + description + "Contains the notification message wrapper definition."; + + container notification { + description + "RESTCONF notification message wrapper."; + leaf event-time { + type yang:date-and-time; + mandatory true; + description + "The time the event was generated by the + event source."; + reference + "RFC 5277, section 4, <eventTime> element."; + } + + /* The YANG-specific notification container is encoded + * after the 'event-time' element. The format + * corresponds to the notificationContent element + * in RFC 5277, section 4. For example: + * + * module example-one { + * ... + * notification event1 { ... } + * + * } + * + * Encoded as element 'event1' in the namespace + * for module 'example-one'. + */ + } + } // grouping notification + + }
\ No newline at end of file diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/modules/restconf-module-testing/ietf-inet-types.yang b/netconf/restconf/restconf-nb-bierman02/src/test/resources/modules/restconf-module-testing/ietf-inet-types.yang new file mode 100644 index 0000000..de20feb --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/modules/restconf-module-testing/ietf-inet-types.yang @@ -0,0 +1,418 @@ + module ietf-inet-types { + + namespace "urn:ietf:params:xml:ns:yang:ietf-inet-types"; + prefix "inet"; + + organization + "IETF NETMOD (NETCONF Data Modeling Language) Working Group"; + + contact + "WG Web: <http://tools.ietf.org/wg/netmod/> + WG List: <mailto:netmod@ietf.org> + + WG Chair: David Partain + <mailto:david.partain@ericsson.com> + + WG Chair: David Kessens + <mailto:david.kessens@nsn.com> + + Editor: Juergen Schoenwaelder + <mailto:j.schoenwaelder@jacobs-university.de>"; + + description + "This module contains a collection of generally useful derived + YANG data types for Internet addresses and related things. + + Copyright (c) 2010 IETF Trust and the persons identified as + authors of the code. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, is permitted pursuant to, and subject to the license + terms contained in, the Simplified BSD License set forth in Section + 4.c of the IETF Trust's Legal Provisions Relating to IETF Documents + (http://trustee.ietf.org/license-info). + + This version of this YANG module is part of RFC 6021; see + the RFC itself for full legal notices."; + + revision 2010-09-24 { + description + "Initial revision."; + reference + "RFC 6021: Common YANG Data Types"; + } + + /*** collection of protocol field related types ***/ + + typedef ip-version { + type enumeration { + enum unknown { + value "0"; + description + "An unknown or unspecified version of the Internet protocol."; + } + enum ipv4 { + value "1"; + description + "The IPv4 protocol as defined in RFC 791."; + } + enum ipv6 { + value "2"; + description + "The IPv6 protocol as defined in RFC 2460."; + } + } + description + "This value represents the version of the IP protocol. + + In the value set and its semantics, this type is equivalent + to the InetVersion textual convention of the SMIv2."; + reference + "RFC 791: Internet Protocol + RFC 2460: Internet Protocol, Version 6 (IPv6) Specification + RFC 4001: Textual Conventions for Internet Network Addresses"; + } + + typedef dscp { + type uint8 { + range "0..63"; + } + description + "The dscp type represents a Differentiated Services Code-Point + that may be used for marking packets in a traffic stream. + + In the value set and its semantics, this type is equivalent + to the Dscp textual convention of the SMIv2."; + reference + "RFC 3289: Management Information Base for the Differentiated + Services Architecture + RFC 2474: Definition of the Differentiated Services Field + (DS Field) in the IPv4 and IPv6 Headers + RFC 2780: IANA Allocation Guidelines For Values In + the Internet Protocol and Related Headers"; + } + + typedef ipv6-flow-label { + type uint32 { + range "0..1048575"; + } + description + "The flow-label type represents flow identifier or Flow Label + in an IPv6 packet header that may be used to discriminate + traffic flows. + + In the value set and its semantics, this type is equivalent + to the IPv6FlowLabel textual convention of the SMIv2."; + reference + "RFC 3595: Textual Conventions for IPv6 Flow Label + RFC 2460: Internet Protocol, Version 6 (IPv6) Specification"; + } + + typedef port-number { + type uint16 { + range "0..65535"; + } + description + "The port-number type represents a 16-bit port number of an + Internet transport layer protocol such as UDP, TCP, DCCP, or + SCTP. Port numbers are assigned by IANA. A current list of + all assignments is available from <http://www.iana.org/>. + + Note that the port number value zero is reserved by IANA. In + situations where the value zero does not make sense, it can + be excluded by subtyping the port-number type. + + In the value set and its semantics, this type is equivalent + to the InetPortNumber textual convention of the SMIv2."; + reference + "RFC 768: User Datagram Protocol + RFC 793: Transmission Control Protocol + RFC 4960: Stream Control Transmission Protocol + RFC 4340: Datagram Congestion Control Protocol (DCCP) + RFC 4001: Textual Conventions for Internet Network Addresses"; + } + + /*** collection of autonomous system related types ***/ + + typedef as-number { + type uint32; + description + "The as-number type represents autonomous system numbers + which identify an Autonomous System (AS). An AS is a set + of routers under a single technical administration, using + an interior gateway protocol and common metrics to route + packets within the AS, and using an exterior gateway + protocol to route packets to other ASs'. IANA maintains + the AS number space and has delegated large parts to the + regional registries. + + Autonomous system numbers were originally limited to 16 + bits. BGP extensions have enlarged the autonomous system + number space to 32 bits. This type therefore uses an uint32 + base type without a range restriction in order to support + a larger autonomous system number space. + + In the value set and its semantics, this type is equivalent + to the InetAutonomousSystemNumber textual convention of + the SMIv2."; + reference + "RFC 1930: Guidelines for creation, selection, and registration + of an Autonomous System (AS) + RFC 4271: A Border Gateway Protocol 4 (BGP-4) + RFC 4893: BGP Support for Four-octet AS Number Space + RFC 4001: Textual Conventions for Internet Network Addresses"; + } + + /*** collection of IP address and hostname related types ***/ + + typedef ip-address { + type union { + type inet:ipv4-address; + type inet:ipv6-address; + } + description + "The ip-address type represents an IP address and is IP + version neutral. The format of the textual representations + implies the IP version."; + } + + typedef ipv4-address { + type string { + 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])' + + '(%[\p{N}\p{L}]+)?'; + } + description + "The ipv4-address type represents an IPv4 address in + dotted-quad notation. The IPv4 address may include a zone + index, separated by a % sign. + + The zone index is used to disambiguate identical address + values. For link-local addresses, the zone index will + typically be the interface index number or the name of an + interface. If the zone index is not present, the default + zone of the device will be used. + + The canonical format for the zone index is the numerical + format"; + } + + typedef ipv6-address { + type string { + pattern '((:|[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}]+)?'; + pattern '(([^:]+:){6}(([^:]+:[^:]+)|(.*\..*)))|' + + '((([^:]+:)*[^:]+)?::(([^:]+:)*[^:]+)?)' + + '(%.+)?'; + } + description + "The ipv6-address type represents an IPv6 address in full, + mixed, shortened, and shortened-mixed notation. The IPv6 + address may include a zone index, separated by a % sign. + + The zone index is used to disambiguate identical address + values. For link-local addresses, the zone index will + typically be the interface index number or the name of an + interface. If the zone index is not present, the default + zone of the device will be used. + + The canonical format of IPv6 addresses uses the compressed + format described in RFC 4291, Section 2.2, item 2 with the + following additional rules: the :: substitution must be + applied to the longest sequence of all-zero 16-bit chunks + in an IPv6 address. If there is a tie, the first sequence + of all-zero 16-bit chunks is replaced by ::. Single + all-zero 16-bit chunks are not compressed. The canonical + format uses lowercase characters and leading zeros are + not allowed. The canonical format for the zone index is + the numerical format as described in RFC 4007, Section + 11.2."; + reference + "RFC 4291: IP Version 6 Addressing Architecture + RFC 4007: IPv6 Scoped Address Architecture + RFC 5952: A Recommendation for IPv6 Address Text Representation"; + } + + typedef ip-prefix { + type union { + type inet:ipv4-prefix; + type inet:ipv6-prefix; + } + description + "The ip-prefix type represents an IP prefix and is IP + version neutral. The format of the textual representations + implies the IP version."; + } + + typedef ipv4-prefix { + type string { + 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])' + + '/(([0-9])|([1-2][0-9])|(3[0-2]))'; + } + description + "The ipv4-prefix type represents an IPv4 address prefix. + The prefix length is given by the number following the + slash character and must be less than or equal to 32. + + A prefix length value of n corresponds to an IP address + mask that has n contiguous 1-bits from the most + significant bit (MSB) and all other bits set to 0. + + The canonical format of an IPv4 prefix has all bits of + the IPv4 address set to zero that are not part of the + IPv4 prefix."; + } + + typedef ipv6-prefix { + type string { + pattern '((:|[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])))'; + pattern '(([^:]+:){6}(([^:]+:[^:]+)|(.*\..*)))|' + + '((([^:]+:)*[^:]+)?::(([^:]+:)*[^:]+)?)' + + '(/.+)'; + } + description + "The ipv6-prefix type represents an IPv6 address prefix. + The prefix length is given by the number following the + slash character and must be less than or equal 128. + + A prefix length value of n corresponds to an IP address + mask that has n contiguous 1-bits from the most + significant bit (MSB) and all other bits set to 0. + + The IPv6 address should have all bits that do not belong + to the prefix set to zero. + + The canonical format of an IPv6 prefix has all bits of + the IPv6 address set to zero that are not part of the + IPv6 prefix. Furthermore, IPv6 address is represented + in the compressed format described in RFC 4291, Section + 2.2, item 2 with the following additional rules: the :: + substitution must be applied to the longest sequence of + all-zero 16-bit chunks in an IPv6 address. If there is + a tie, the first sequence of all-zero 16-bit chunks is + replaced by ::. Single all-zero 16-bit chunks are not + compressed. The canonical format uses lowercase + characters and leading zeros are not allowed."; + reference + "RFC 4291: IP Version 6 Addressing Architecture"; + } + + /*** collection of domain name and URI types ***/ + + typedef domain-name { + type string { + pattern '((([a-zA-Z0-9_]([a-zA-Z0-9\-_]){0,61})?[a-zA-Z0-9]\.)*' + + '([a-zA-Z0-9_]([a-zA-Z0-9\-_]){0,61})?[a-zA-Z0-9]\.?)' + + '|\.'; + length "1..253"; + } + description + "The domain-name type represents a DNS domain name. The + name SHOULD be fully qualified whenever possible. + + Internet domain names are only loosely specified. Section + 3.5 of RFC 1034 recommends a syntax (modified in Section + 2.1 of RFC 1123). The pattern above is intended to allow + for current practice in domain name use, and some possible + future expansion. It is designed to hold various types of + domain names, including names used for A or AAAA records + (host names) and other records, such as SRV records. Note + that Internet host names have a stricter syntax (described + in RFC 952) than the DNS recommendations in RFCs 1034 and + 1123, and that systems that want to store host names in + schema nodes using the domain-name type are recommended to + adhere to this stricter standard to ensure interoperability. + + The encoding of DNS names in the DNS protocol is limited + to 255 characters. Since the encoding consists of labels + prefixed by a length bytes and there is a trailing NULL + byte, only 253 characters can appear in the textual dotted + notation. + + The description clause of schema nodes using the domain-name + type MUST describe when and how these names are resolved to + IP addresses. Note that the resolution of a domain-name value + may require to query multiple DNS records (e.g., A for IPv4 + and AAAA for IPv6). The order of the resolution process and + which DNS record takes precedence can either be defined + explicitely or it may depend on the configuration of the + resolver. + + Domain-name values use the US-ASCII encoding. Their canonical + format uses lowercase US-ASCII characters. Internationalized + domain names MUST be encoded in punycode as described in RFC + 3492"; + reference + "RFC 952: DoD Internet Host Table Specification + RFC 1034: Domain Names - Concepts and Facilities + RFC 1123: Requirements for Internet Hosts -- Application + and Support + RFC 2782: A DNS RR for specifying the location of services + (DNS SRV) + RFC 3492: Punycode: A Bootstring encoding of Unicode for + Internationalized Domain Names in Applications + (IDNA) + RFC 5891: Internationalizing Domain Names in Applications + (IDNA): Protocol"; + } + + typedef host { + type union { + type inet:ip-address; + type inet:domain-name; + } + description + "The host type represents either an IP address or a DNS + domain name."; + } + + typedef uri { + type string; + description + "The uri type represents a Uniform Resource Identifier + (URI) as defined by STD 66. + + Objects using the uri type MUST be in US-ASCII encoding, + and MUST be normalized as described by RFC 3986 Sections + 6.2.1, 6.2.2.1, and 6.2.2.2. All unnecessary + percent-encoding is removed, and all case-insensitive + characters are set to lowercase except for hexadecimal + digits, which are normalized to uppercase as described in + Section 6.2.2.1. + + The purpose of this normalization is to help provide + unique URIs. Note that this normalization is not + sufficient to provide uniqueness. Two URIs that are + textually distinct after this normalization may still be + equivalent. + + Objects using the uri type may restrict the schemes that + they permit. For example, 'data:' and 'urn:' schemes + might not be appropriate. + + A zero-length URI is not a valid URI. This can be used to + express 'URI absent' where required. + + In the value set and its semantics, this type is equivalent + to the Uri SMIv2 textual convention defined in RFC 5017."; + reference + "RFC 3986: Uniform Resource Identifier (URI): Generic Syntax + RFC 3305: Report from the Joint W3C/IETF URI Planning Interest + Group: Uniform Resource Identifiers (URIs), URLs, + and Uniform Resource Names (URNs): Clarifications + and Recommendations + RFC 5017: MIB Textual Conventions for Uniform Resource + Identifiers (URIs)"; + } + + } diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/modules/restconf-module-testing/ietf-restconf@2013-10-19.yang b/netconf/restconf/restconf-nb-bierman02/src/test/resources/modules/restconf-module-testing/ietf-restconf@2013-10-19.yang new file mode 100644 index 0000000..bd8273a --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/modules/restconf-module-testing/ietf-restconf@2013-10-19.yang @@ -0,0 +1,684 @@ +module ietf-restconf { + namespace "urn:ietf:params:xml:ns:yang:ietf-restconf"; + prefix "restconf"; + + import ietf-yang-types { prefix yang; } + import ietf-inet-types { prefix inet; } + + organization + "IETF NETCONF (Network Configuration) Working Group"; + + contact + "Editor: Andy Bierman + <mailto:andy@yumaworks.com> + + Editor: Martin Bjorklund + <mailto:mbj@tail-f.com> + + Editor: Kent Watsen + <mailto:kwatsen@juniper.net> + + Editor: Rex Fernando + <mailto:rex@cisco.com>"; + + description + "This module contains conceptual YANG specifications + for the YANG Patch and error content that is used in + RESTCONF protocol messages. A conceptual container + representing the RESTCONF API nodes (media type + application/yang.api). + + Note that the YANG definitions within this module do not + represent configuration data of any kind. + The YANG grouping statements provide a normative syntax + for XML and JSON message encoding purposes. + Copyright (c) 2013 IETF Trust and the persons identified as + authors of the code. All rights reserved. + + Redistribution and use in source and binary forms, with or + without modification, is permitted pursuant to, and subject + to the license terms contained in, the Simplified BSD License + set forth in Section 4.c of the IETF Trust's Legal Provisions + Relating to IETF Documents + (http://trustee.ietf.org/license-info). + + This version of this YANG module is part of RFC XXXX; see + the RFC itself for full legal notices."; + + // RFC Ed.: replace XXXX with actual RFC number and remove this + // note. + + // RFC Ed.: remove this note + // Note: extracted from draft-bierman-netconf-restconf-02.txt + + // RFC Ed.: update the date below with the date of RFC publication + // and remove this note. + revision 2013-10-19 { + description + "Initial revision."; + reference + "RFC XXXX: RESTCONF Protocol."; + } + + typedef data-resource-identifier { + type string { + length "1 .. max"; + } + description + "Contains a Data Resource Identifier formatted string + to identify a specific data node. The data node that + uses this data type SHOULD define the document root + for data resource identifiers. The default document + root is the target datastore conceptual root node. + Data resource identifiers are defined relative to + this document root."; + reference + "RFC XXXX: [sec. 5.3.1.1 ABNF For Data Resource Identifiers]"; + } + + // this typedef is TBD; not currently used + typedef datastore-identifier { + type union { + type enumeration { + enum candidate { + description + "Identifies the NETCONF shared candidate datastore."; + reference + "RFC 6241, section 8.3"; + } + enum running { + description + "Identifies the NETCONF running datastore."; + reference + "RFC 6241, section 5.1"; + } + enum startup { + description + "Identifies the NETCONF startup datastore."; + reference + "RFC 6241, section 8.7"; + } + } + type string; + } + description + "Contains a string to identify a specific datastore. + The enumerated datastore identifier values are + reserved for standard datastore names."; + } + + typedef revision-identifier { + type string { + pattern '\d{4}-\d{2}-\d{2}'; + } + description + "Represents a specific date in YYYY-MM-DD format. + TBD: make pattern more precise to exclude leading zeros."; + } + + grouping yang-patch { + description + "A grouping that contains a YANG container + representing the syntax and semantics of a + YANG Patch edit request message."; + + container yang-patch { + description + "Represents a conceptual sequence of datastore edits, + called a patch. Each patch is given a client-assigned + patch identifier. Each edit MUST be applied + in ascending order, and all edits MUST be applied. + If any errors occur, then the target datastore MUST NOT + be changed by the patch operation. + + A patch MUST be validated by the server to be a + well-formed message before any of the patch edits + are validated or attempted. + + YANG datastore validation (defined in RFC 6020, section + 8.3.3) is performed after all edits have been + individually validated. + + It is possible for a datastore constraint violation to occur + due to any node in the datastore, including nodes not + included in the edit list. Any validation errors MUST + be reported in the reply message."; + + reference + "RFC 6020, section 8.3."; + + leaf patch-id { + type string; + description + "An arbitrary string provided by the client to identify + the entire patch. This value SHOULD be present in any + audit logging records generated by the server for the + patch. Error messages returned by the server pertaining + to this patch will be identified by this patch-id value."; + } + + leaf comment { + type string { + length "0 .. 1024"; + } + description + "An arbitrary string provided by the client to describe + the entire patch. This value SHOULD be present in any + audit logging records generated by the server for the + patch."; + } + + list edit { + key edit-id; + ordered-by user; + + description + "Represents one edit within the YANG Patch + request message."; + leaf edit-id { + type string; + description + "Arbitrary string index for the edit. + Error messages returned by the server pertaining + to a specific edit will be identified by this + value."; + } + + leaf operation { + type enumeration { + enum create { + description + "The target data node is created using the + supplied value, only if it does not already + exist."; + } + enum delete { + description + "Delete the target node, only if the data resource + currently exists, otherwise return an error."; + } + enum insert { + description + "Insert the supplied value into a user-ordered + list or leaf-list entry. The target node must + represent a new data resource."; + } + enum merge { + description + "The supplied value is merged with the target data + node."; + } + enum move { + description + "Move the target node. Reorder a user-ordered + list or leaf-list. The target node must represent + an existing data resource."; + } + enum replace { + description + "The supplied value is used to replace the target + data node."; + } + enum remove { + description + "Delete the target node if it currently exists."; + } + } + mandatory true; + description + "The datastore operation requested for the associated + edit entry"; + } + + leaf target { + type data-resource-identifier; + mandatory true; + description + "Identifies the target data resource for the edit + operation."; + } + + leaf point { + when "(../operation = 'insert' or " + + "../operation = 'move') and " + + "(../where = 'before' or ../where = 'after')" { + description + "Point leaf only applies for insert or move + operations, before or after an existing entry."; + } + type data-resource-identifier; + description + "The absolute URL path for the data node that is being + used as the insertion point or move point for the + target of this edit entry."; + } + + leaf where { + when "../operation = 'insert' or ../operation = 'move'" { + description + "Where leaf only applies for insert or move + operations."; + } + type enumeration { + enum before { + description + "Insert or move a data node before the data resource + identified by the 'point' parameter."; + } + enum after { + description + "Insert or move a data node after the data resource + identified by the 'point' parameter."; + } + enum first { + description + "Insert or move a data node so it becomes ordered + as the first entry."; + } + enum last { + description + "Insert or move a data node so it becomes ordered + as the last entry."; + } + + } + default last; + description + "Identifies where a data resource will be inserted or + moved. YANG only allows these operations for + list and leaf-list data nodes that are ordered-by + user."; + } + + anyxml value { + when "(../operation = 'create' or " + + "../operation = 'merge' " + + "or ../operation = 'replace' or " + + "../operation = 'insert')" { + description + "Value node only used for create, merge, + replace, and insert operations"; + } + description + "Value used for this edit operation."; + } + } + } + + } // grouping yang-patch + + + grouping yang-patch-status { + + description + "A grouping that contains a YANG container + representing the syntax and semantics of + YANG Patch status response message."; + + container yang-patch-status { + description + "A container representing the response message + sent by the server after a YANG Patch edit + request message has been processed."; + + leaf patch-id { + type string; + description + "The patch-id value used in the request"; + } + + choice global-status { + description + "Report global errors or complete success. + If there is no case selected then errors + are reported in the edit-status container."; + + case global-errors { + uses errors; + description + "This container will be present if global + errors unrelated to a specific edit occurred."; + } + leaf ok { + type empty; + description + "This leaf will be present if the request succeeded + and there are no errors reported in the edit-status + container."; + } + } + + container edit-status { + description + "This container will be present if there are + edit-specific status responses to report."; + + list edit { + key edit-id; + + description + "Represents a list of status responses, + corresponding to edits in the YANG Patch + request message. If an edit entry was + skipped or not reached by the server, + then this list will not contain a corresponding + entry for that edit."; + + leaf edit-id { + type string; + description + "Response status is for the edit list entry + with this edit-id value."; + } + choice edit-status-choice { + description + "A choice between different types of status + responses for each edit entry."; + leaf ok { + type empty; + description + "This edit entry was invoked without any + errors detected by the server associated + with this edit."; + } + leaf location { + type inet:uri; + description + "Contains the Location header value that would be + returned if this edit causes a new resource to be + created. If the edit identified by the same edit-id + value was successfully invoked and a new resource + was created, then this field will be returned + instead of 'ok'."; + } + case errors { + uses errors; + description + "The server detected errors associated with the + edit identified by the same edit-id value."; + } + } + } + } + } + } // grouping yang-patch-status + + + grouping errors { + + description + "A grouping that contains a YANG container + representing the syntax and semantics of a + YANG Patch errors report within a response message."; + + container errors { + config false; // needed so list error does not need a key + description + "Represents an error report returned by the server if + a request results in an error."; + + list error { + description + "An entry containing information about one + specific error that occurred while processing + a RESTCONF request."; + reference "RFC 6241, Section 4.3"; + + leaf error-type { + type enumeration { + enum transport { + description "The transport layer"; + } + enum rpc { + description "The rpc or notification layer"; + } + enum protocol { + description "The protocol operation layer"; + } + enum application { + description "The server application layer"; + } + } + mandatory true; + description + "The protocol layer where the error occurred."; + } + + leaf error-tag { + type string; + mandatory true; + description + "The enumerated error tag."; + } + + leaf error-app-tag { + type string; + description + "The application-specific error tag."; + } + + leaf error-path { + type data-resource-identifier; + description + "The target data resource identifier associated + with the error, if any."; + } + leaf error-message { + type string; + description + "A message describing the error."; + } + + container error-info { + description + "A container allowing additional information + to be included in the error report."; + // arbitrary anyxml content here + } + } + } + } // grouping errors + + + grouping restconf { + + description + "A grouping that contains a YANG container + representing the syntax and semantics of + the RESTCONF API resource."; + + container restconf { + description + "Conceptual container representing the + application/yang.api resource type."; + + container config { + description + "Container representing the application/yang.datastore + resource type. Represents the conceptual root of the + unified configuration datastore containing YANG data + nodes. The child nodes of this container are + configuration data resources (application/yang.data) + defined as top-level YANG data nodes from the modules + advertised by the server in /restconf/modules."; + } + + container operational { + description + "Container representing the application/yang.datastore + resource type. Represents the conceptual root of the + operational data supported by the server. The child + nodes of this container are operational data resources + (application/yang.data) defined as top-level + YANG data nodes from the modules advertised by + the server in /restconf/modules."; + } + + container modules { + description + "Contains a list of module description entries. + These modules are currently loaded into the server."; + + list module { + key "name revision"; + description + "Each entry represents one module currently + supported by the server."; + + leaf name { + type yang:yang-identifier; + description "The YANG module name."; + } + leaf revision { + type union { + type revision-identifier; + type string { length 0; } + } + description + "The YANG module revision date. An empty string is + used if no revision statement is present in the + YANG module."; + } + leaf namespace { + type inet:uri; + mandatory true; + description + "The XML namespace identifier for this module."; + } + leaf-list feature { + type yang:yang-identifier; + description + "List of YANG feature names from this module that are + supported by the server."; + } + leaf-list deviation { + type yang:yang-identifier; + description + "List of YANG deviation module names used by this + server to modify the conformance of the module + associated with this entry."; + } + } + } + + container operations { + description + "Container for all operation resources + (application/yang.operation), + + Each resource is represented as an empty leaf with the + name of the RPC operation from the YANG rpc statement. + + E.g.; + + POST /restconf/operations/show-log-errors + + leaf show-log-errors { + type empty; + } + "; + } + + container streams { + description + "Container representing the notification event streams + supported by the server."; + reference + "RFC 5277, Section 3.4, <streams> element."; + + list stream { + key name; + description + "Each entry describes an event stream supported by + the server."; + + leaf name { + type string; + description "The stream name"; + reference "RFC 5277, Section 3.4, <name> element."; + } + + leaf description { + type string; + description "Description of stream content"; + reference + "RFC 5277, Section 3.4, <description> element."; + } + + leaf replay-support { + type boolean; + description + "Indicates if replay buffer supported for this stream"; + reference + "RFC 5277, Section 3.4, <replaySupport> element."; + } + + leaf replay-log-creation-time { + type yang:date-and-time; + description + "Indicates the time the replay log for this stream + was created."; + reference + "RFC 5277, Section 3.4, <replayLogCreationTime> + element."; + } + + leaf events { + type empty; + description + "Represents the entry point for establishing + notification delivery via server sent events."; + } + } + } + + leaf version { + type enumeration { + enum "1.0" { + description + "Version 1.0 of the RESTCONF protocol."; + } + } + config false; + description + "Contains the RESTCONF protocol version."; + } + } + } // grouping restconf + + + grouping notification { + description + "Contains the notification message wrapper definition."; + + container notification { + description + "RESTCONF notification message wrapper."; + leaf event-time { + type yang:date-and-time; + mandatory true; + description + "The time the event was generated by the + event source."; + reference + "RFC 5277, section 4, <eventTime> element."; + } + + /* The YANG-specific notification container is encoded + * after the 'event-time' element. The format + * corresponds to the notificationContent element + * in RFC 5277, section 4. For example: + * + * module example-one { + * ... + * notification event1 { ... } + * + * } + * + * Encoded as element 'event1' in the namespace + * for module 'example-one'. + */ + } + } // grouping notification + + }
\ No newline at end of file diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/modules/restconf-module-testing/ietf-yang-library@2016-06-21.yang b/netconf/restconf/restconf-nb-bierman02/src/test/resources/modules/restconf-module-testing/ietf-yang-library@2016-06-21.yang new file mode 100644 index 0000000..bc466ee --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/modules/restconf-module-testing/ietf-yang-library@2016-06-21.yang @@ -0,0 +1,208 @@ +module ietf-yang-library { + namespace "urn:ietf:params:xml:ns:yang:ietf-yang-library"; + prefix "yanglib"; + import ietf-yang-types { + prefix yang; + } + import ietf-inet-types { + prefix inet; + } + organization + "IETF NETCONF (Network Configuration) Working Group"; + contact + "WG Web: <https://datatracker.ietf.org/wg/netconf/> + WG List: <mailto:netconf@ietf.org> + WG Chair: Mehmet Ersue + <mailto:mehmet.ersue@nsn.com> + WG Chair: Mahesh Jethanandani + <mailto:mjethanandani@gmail.com> + Editor: Andy Bierman + <mailto:andy@yumaworks.com> + Editor: Martin Bjorklund + <mailto:mbj@tail-f.com> + Editor: Kent Watsen + <mailto:kwatsen@juniper.net>"; + description + "This module contains monitoring information about the YANG + modules and submodules that are used within a YANG-based + server. + Copyright (c) 2016 IETF Trust and the persons identified as + authors of the code. All rights reserved. + Redistribution and use in source and binary forms, with or + without modification, is permitted pursuant to, and subject + to the license terms contained in, the Simplified BSD License + set forth in Section 4.c of the IETF Trust's Legal Provisions + Relating to IETF Documents + (http://trustee.ietf.org/license-info). + This version of this YANG module is part of RFC 7895; see + the RFC itself for full legal notices."; + revision 2016-06-21 { + description + "Initial revision."; + reference + "RFC 7895: YANG Module Library."; + } + /* + * Typedefs + */ + typedef revision-identifier { + type string { + pattern '\d{4}-\d{2}-\d{2}'; + } + description + "Represents a specific date in YYYY-MM-DD format."; + } + /* + * Groupings + */ + grouping module-list { + description + "The module data structure is represented as a grouping + so it can be reused in configuration or another monitoring + data structure."; + grouping common-leafs { + description + "Common parameters for YANG modules and submodules."; + leaf name { + type yang:yang-identifier; + description + "The YANG module or submodule name."; + } + leaf revision { + type union { + type revision-identifier; + type string { length 0; } + } + description + "The YANG module or submodule revision date. + A zero-length string is used if no revision statement + is present in the YANG module or submodule."; + } + } + grouping schema-leaf { + description + "Common schema leaf parameter for modules and submodules."; + leaf schema { + type inet:uri; + description + "Contains a URL that represents the YANG schema + resource for this module or submodule. + This leaf will only be present if there is a URL + available for retrieval of the schema for this entry."; + } + } + list module { + key "name revision"; + description + "Each entry represents one revision of one module + currently supported by the server."; + uses common-leafs; + uses schema-leaf; + leaf namespace { + type inet:uri; + mandatory true; + description + "The XML namespace identifier for this module."; + } + leaf-list feature { + type yang:yang-identifier; + description + "List of YANG feature names from this module that are + supported by the server, regardless of whether they are + defined in the module or any included submodule."; + } + list deviation { + key "name revision"; + description + "List of YANG deviation module names and revisions + used by this server to modify the conformance of + the module associated with this entry. Note that + the same module can be used for deviations for + multiple modules, so the same entry MAY appear + within multiple 'module' entries. + The deviation module MUST be present in the 'module' + list, with the same name and revision values. + The 'conformance-type' value will be 'implement' for + the deviation module."; + uses common-leafs; + } + leaf conformance-type { + type enumeration { + enum implement { + description + "Indicates that the server implements one or more + protocol-accessible objects defined in the YANG module + identified in this entry. This includes deviation + statements defined in the module. + For YANG version 1.1 modules, there is at most one + module entry with conformance type 'implement' for a + particular module name, since YANG 1.1 requires that, + at most, one revision of a module is implemented. + For YANG version 1 modules, there SHOULD NOT be more + than one module entry for a particular module name."; + } + enum import { + description + "Indicates that the server imports reusable definitions + from the specified revision of the module but does + not implement any protocol-accessible objects from + this revision. + Multiple module entries for the same module name MAY + exist. This can occur if multiple modules import the + same module but specify different revision dates in + the import statements."; + } + } + mandatory true; + description + "Indicates the type of conformance the server is claiming + for the YANG module identified by this entry."; + } + list submodule { + key "name revision"; + description + "Each entry represents one submodule within the + parent module."; + uses common-leafs; + uses schema-leaf; + } + } + } + /* + * Operational state data nodes + */ + container modules-state { + config false; + description + "Contains YANG module monitoring information."; + leaf module-set-id { + type string; + mandatory true; + description + "Contains a server-specific identifier representing + the current set of modules and submodules. The + server MUST change the value of this leaf if the + information represented by the 'module' list instances + has changed."; + } + uses module-list; + } + /* + * Notifications + */ + notification yang-library-change { + description + "Generated when the set of modules and submodules supported + by the server has changed."; + leaf module-set-id { + type leafref { + path "/yanglib:modules-state/yanglib:module-set-id"; + } + mandatory true; + description + "Contains the module-set-id value representing the + set of modules and submodules supported at the server at + the time the notification is generated."; + } + } +} diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/modules/restconf-module-testing/ietf-yang-types.yang b/netconf/restconf/restconf-nb-bierman02/src/test/resources/modules/restconf-module-testing/ietf-yang-types.yang new file mode 100644 index 0000000..c3f952c --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/modules/restconf-module-testing/ietf-yang-types.yang @@ -0,0 +1,417 @@ + module ietf-yang-types { + + namespace "urn:ietf:params:xml:ns:yang:ietf-yang-types"; + prefix "yang"; + + organization + "IETF NETMOD (NETCONF Data Modeling Language) Working Group"; + + contact + "WG Web: <http://tools.ietf.org/wg/netmod/> + WG List: <mailto:netmod@ietf.org> + + WG Chair: David Partain + <mailto:david.partain@ericsson.com> + + WG Chair: David Kessens + <mailto:david.kessens@nsn.com> + + Editor: Juergen Schoenwaelder + <mailto:j.schoenwaelder@jacobs-university.de>"; + + description + "This module contains a collection of generally useful derived + YANG data types. + + Copyright (c) 2010 IETF Trust and the persons identified as + authors of the code. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, is permitted pursuant to, and subject to the license + terms contained in, the Simplified BSD License set forth in Section + 4.c of the IETF Trust's Legal Provisions Relating to IETF Documents + (http://trustee.ietf.org/license-info). + + This version of this YANG module is part of RFC 6021; see + the RFC itself for full legal notices."; + + revision 2010-09-24 { + description + "Initial revision."; + reference + "RFC 6021: Common YANG Data Types"; + } + + /*** collection of counter and gauge types ***/ + + typedef counter32 { + type uint32; + description + "The counter32 type represents a non-negative integer + that monotonically increases until it reaches a + maximum value of 2^32-1 (4294967295 decimal), when it + wraps around and starts increasing again from zero. + + Counters have no defined 'initial' value, and thus, a + single value of a counter has (in general) no information + content. Discontinuities in the monotonically increasing + value normally occur at re-initialization of the + management system, and at other times as specified in the + description of a schema node using this type. If such + other times can occur, for example, the creation of + a schema node of type counter32 at times other than + re-initialization, then a corresponding schema node + should be defined, with an appropriate type, to indicate + the last discontinuity. + + The counter32 type should not be used for configuration + schema nodes. A default statement SHOULD NOT be used in + combination with the type counter32. + + In the value set and its semantics, this type is equivalent + to the Counter32 type of the SMIv2."; + reference + "RFC 2578: Structure of Management Information Version 2 (SMIv2)"; + } + + typedef zero-based-counter32 { + type yang:counter32; + default "0"; + description + "The zero-based-counter32 type represents a counter32 + that has the defined 'initial' value zero. + + A schema node of this type will be set to zero (0) on creation + and will thereafter increase monotonically until it reaches + a maximum value of 2^32-1 (4294967295 decimal), when it + wraps around and starts increasing again from zero. + + Provided that an application discovers a new schema node + of this type within the minimum time to wrap, it can use the + 'initial' value as a delta. It is important for a management + station to be aware of this minimum time and the actual time + between polls, and to discard data if the actual time is too + long or there is no defined minimum time. + + In the value set and its semantics, this type is equivalent + to the ZeroBasedCounter32 textual convention of the SMIv2."; + reference + "RFC 4502: Remote Network Monitoring Management Information + Base Version 2"; + } + + typedef counter64 { + type uint64; + description + "The counter64 type represents a non-negative integer + that monotonically increases until it reaches a + maximum value of 2^64-1 (18446744073709551615 decimal), + when it wraps around and starts increasing again from zero. + + Counters have no defined 'initial' value, and thus, a + single value of a counter has (in general) no information + content. Discontinuities in the monotonically increasing + value normally occur at re-initialization of the + management system, and at other times as specified in the + description of a schema node using this type. If such + other times can occur, for example, the creation of + a schema node of type counter64 at times other than + re-initialization, then a corresponding schema node + should be defined, with an appropriate type, to indicate + the last discontinuity. + + The counter64 type should not be used for configuration + schema nodes. A default statement SHOULD NOT be used in + combination with the type counter64. + + In the value set and its semantics, this type is equivalent + to the Counter64 type of the SMIv2."; + reference + "RFC 2578: Structure of Management Information Version 2 (SMIv2)"; + } + + typedef zero-based-counter64 { + type yang:counter64; + default "0"; + description + "The zero-based-counter64 type represents a counter64 that + has the defined 'initial' value zero. + + A schema node of this type will be set to zero (0) on creation + and will thereafter increase monotonically until it reaches + a maximum value of 2^64-1 (18446744073709551615 decimal), + when it wraps around and starts increasing again from zero. + + Provided that an application discovers a new schema node + of this type within the minimum time to wrap, it can use the + 'initial' value as a delta. It is important for a management + station to be aware of this minimum time and the actual time + between polls, and to discard data if the actual time is too + long or there is no defined minimum time. + + In the value set and its semantics, this type is equivalent + to the ZeroBasedCounter64 textual convention of the SMIv2."; + reference + "RFC 2856: Textual Conventions for Additional High Capacity + Data Types"; + } + + typedef gauge32 { + type uint32; + description + "The gauge32 type represents a non-negative integer, which + may increase or decrease, but shall never exceed a maximum + value, nor fall below a minimum value. The maximum value + cannot be greater than 2^32-1 (4294967295 decimal), and + the minimum value cannot be smaller than 0. The value of + a gauge32 has its maximum value whenever the information + being modeled is greater than or equal to its maximum + value, and has its minimum value whenever the information + being modeled is smaller than or equal to its minimum value. + If the information being modeled subsequently decreases + below (increases above) the maximum (minimum) value, the + gauge32 also decreases (increases). + + In the value set and its semantics, this type is equivalent + to the Gauge32 type of the SMIv2."; + reference + "RFC 2578: Structure of Management Information Version 2 (SMIv2)"; + } + + typedef gauge64 { + type uint64; + description + "The gauge64 type represents a non-negative integer, which + may increase or decrease, but shall never exceed a maximum + value, nor fall below a minimum value. The maximum value + cannot be greater than 2^64-1 (18446744073709551615), and + the minimum value cannot be smaller than 0. The value of + a gauge64 has its maximum value whenever the information + being modeled is greater than or equal to its maximum + value, and has its minimum value whenever the information + being modeled is smaller than or equal to its minimum value. + If the information being modeled subsequently decreases + below (increases above) the maximum (minimum) value, the + gauge64 also decreases (increases). + + In the value set and its semantics, this type is equivalent + to the CounterBasedGauge64 SMIv2 textual convention defined + in RFC 2856"; + reference + "RFC 2856: Textual Conventions for Additional High Capacity + Data Types"; + } + + /*** collection of identifier related types ***/ + + typedef object-identifier { + type string { + pattern '(([0-1](\.[1-3]?[0-9]))|(2\.(0|([1-9]\d*))))' + + '(\.(0|([1-9]\d*)))*'; + } + description + "The object-identifier type represents administratively + assigned names in a registration-hierarchical-name tree. + + Values of this type are denoted as a sequence of numerical + non-negative sub-identifier values. Each sub-identifier + value MUST NOT exceed 2^32-1 (4294967295). Sub-identifiers + are separated by single dots and without any intermediate + whitespace. + + The ASN.1 standard restricts the value space of the first + sub-identifier to 0, 1, or 2. Furthermore, the value space + of the second sub-identifier is restricted to the range + 0 to 39 if the first sub-identifier is 0 or 1. Finally, + the ASN.1 standard requires that an object identifier + has always at least two sub-identifier. The pattern + captures these restrictions. + + Although the number of sub-identifiers is not limited, + module designers should realize that there may be + implementations that stick with the SMIv2 limit of 128 + sub-identifiers. + + This type is a superset of the SMIv2 OBJECT IDENTIFIER type + since it is not restricted to 128 sub-identifiers. Hence, + this type SHOULD NOT be used to represent the SMIv2 OBJECT + IDENTIFIER type, the object-identifier-128 type SHOULD be + used instead."; + reference + "ISO9834-1: Information technology -- Open Systems + Interconnection -- Procedures for the operation of OSI + Registration Authorities: General procedures and top + arcs of the ASN.1 Object Identifier tree"; + } + + + + + typedef object-identifier-128 { + type object-identifier { + pattern '\d*(\.\d*){1,127}'; + } + description + "This type represents object-identifiers restricted to 128 + sub-identifiers. + + In the value set and its semantics, this type is equivalent + to the OBJECT IDENTIFIER type of the SMIv2."; + reference + "RFC 2578: Structure of Management Information Version 2 (SMIv2)"; + } + + typedef yang-identifier { + type string { + length "1..max"; + pattern '[a-zA-Z_][a-zA-Z0-9\-_.]*'; + pattern '.|..|[^xX].*|.[^mM].*|..[^lL].*'; + } + description + "A YANG identifier string as defined by the 'identifier' + rule in Section 12 of RFC 6020. An identifier must + start with an alphabetic character or an underscore + followed by an arbitrary sequence of alphabetic or + numeric characters, underscores, hyphens, or dots. + + A YANG identifier MUST NOT start with any possible + combination of the lowercase or uppercase character + sequence 'xml'."; + reference + "RFC 6020: YANG - A Data Modeling Language for the Network + Configuration Protocol (NETCONF)"; + } + + /*** collection of date and time related types ***/ + + typedef date-and-time { + type string { + pattern '\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d+)?' + + '(Z|[\+\-]\d{2}:\d{2})'; + } + description + "The date-and-time type is a profile of the ISO 8601 + standard for representation of dates and times using the + Gregorian calendar. The profile is defined by the + date-time production in Section 5.6 of RFC 3339. + + The date-and-time type is compatible with the dateTime XML + schema type with the following notable exceptions: + + (a) The date-and-time type does not allow negative years. + + (b) The date-and-time time-offset -00:00 indicates an unknown + time zone (see RFC 3339) while -00:00 and +00:00 and Z all + represent the same time zone in dateTime. + + (c) The canonical format (see below) of data-and-time values + differs from the canonical format used by the dateTime XML + schema type, which requires all times to be in UTC using the + time-offset 'Z'. + + This type is not equivalent to the DateAndTime textual + convention of the SMIv2 since RFC 3339 uses a different + separator between full-date and full-time and provides + higher resolution of time-secfrac. + + The canonical format for date-and-time values with a known time + zone uses a numeric time zone offset that is calculated using + the device's configured known offset to UTC time. A change of + the device's offset to UTC time will cause date-and-time values + to change accordingly. Such changes might happen periodically + in case a server follows automatically daylight saving time + (DST) time zone offset changes. The canonical format for + date-and-time values with an unknown time zone (usually referring + to the notion of local time) uses the time-offset -00:00."; + reference + "RFC 3339: Date and Time on the Internet: Timestamps + RFC 2579: Textual Conventions for SMIv2 + XSD-TYPES: XML Schema Part 2: Datatypes Second Edition"; + } + + typedef timeticks { + type uint32; + description + "The timeticks type represents a non-negative integer that + represents the time, modulo 2^32 (4294967296 decimal), in + hundredths of a second between two epochs. When a schema + node is defined that uses this type, the description of + the schema node identifies both of the reference epochs. + + In the value set and its semantics, this type is equivalent + to the TimeTicks type of the SMIv2."; + reference + "RFC 2578: Structure of Management Information Version 2 (SMIv2)"; + } + + typedef timestamp { + type yang:timeticks; + description + "The timestamp type represents the value of an associated + timeticks schema node at which a specific occurrence happened. + The specific occurrence must be defined in the description + of any schema node defined using this type. When the specific + occurrence occurred prior to the last time the associated + timeticks attribute was zero, then the timestamp value is + zero. Note that this requires all timestamp values to be + reset to zero when the value of the associated timeticks + attribute reaches 497+ days and wraps around to zero. + + The associated timeticks schema node must be specified + in the description of any schema node using this type. + + In the value set and its semantics, this type is equivalent + to the TimeStamp textual convention of the SMIv2."; + reference + "RFC 2579: Textual Conventions for SMIv2"; + } + + /*** collection of generic address types ***/ + + typedef phys-address { + type string { + pattern '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'; + } + description + "Represents media- or physical-level addresses represented + as a sequence octets, each octet represented by two hexadecimal + numbers. Octets are separated by colons. The canonical + representation uses lowercase characters. + + In the value set and its semantics, this type is equivalent + to the PhysAddress textual convention of the SMIv2."; + reference + "RFC 2579: Textual Conventions for SMIv2"; + } + + typedef mac-address { + type string { + pattern '[0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){5}'; + } + description + "The mac-address type represents an IEEE 802 MAC address. + The canonical representation uses lowercase characters. + + In the value set and its semantics, this type is equivalent + to the MacAddress textual convention of the SMIv2."; + reference + "IEEE 802: IEEE Standard for Local and Metropolitan Area + Networks: Overview and Architecture + RFC 2579: Textual Conventions for SMIv2"; + } + + /*** collection of XML specific types ***/ + + typedef xpath1.0 { + type string; + description + "This type represents an XPATH 1.0 expression. + + When a schema node is defined that uses this type, the + description of the schema node MUST specify the XPath + context in which the XPath expression is evaluated."; + reference + "XPATH: XML Path Language (XPath) Version 1.0"; + } + + } diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/multiple-nodes/multiple-nodes.yang b/netconf/restconf/restconf-nb-bierman02/src/test/resources/multiple-nodes/multiple-nodes.yang new file mode 100644 index 0000000..22a1dae --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/multiple-nodes/multiple-nodes.yang @@ -0,0 +1,17 @@ +module multiple-nodes { + namespace "multiple:nodes"; + prefix "mod1"; + revision "2014-06-23"; + + container cont { + container cont1 { + leaf lf11 { + type string; + } + } + + leaf lf1 { + type string; + } + } +}
\ No newline at end of file diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/nn-to-json/augmentation/augment-container.yang b/netconf/restconf/restconf-nb-bierman02/src/test/resources/nn-to-json/augmentation/augment-container.yang new file mode 100644 index 0000000..7efe4f7 --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/nn-to-json/augmentation/augment-container.yang @@ -0,0 +1,22 @@ +module augment-container { + namespace "ns:augment:container"; + prefix "augcont"; + + + import yang {prefix yng; revision-date 2013-11-26;} + + + revision "2013-11-26" { + } + + augment "/yng:cont" { + container cont1 { + leaf lf11 { + type string; + } + } + } + + + +}
\ No newline at end of file diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/nn-to-json/augmentation/augment-leaf.yang b/netconf/restconf/restconf-nb-bierman02/src/test/resources/nn-to-json/augmentation/augment-leaf.yang new file mode 100644 index 0000000..248d3bb --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/nn-to-json/augmentation/augment-leaf.yang @@ -0,0 +1,18 @@ +module augment-leaf { + namespace "ns:augment:leaf"; + prefix "auglf"; + + + import yang {prefix yng; revision-date 2013-11-26;} + + + revision "2013-11-26" { + } + + augment "/yng:cont" { + leaf lf2 { + type string; + } + } + +}
\ No newline at end of file diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/nn-to-json/augmentation/augment-leaflist.yang b/netconf/restconf/restconf-nb-bierman02/src/test/resources/nn-to-json/augmentation/augment-leaflist.yang new file mode 100644 index 0000000..1f4b937 --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/nn-to-json/augmentation/augment-leaflist.yang @@ -0,0 +1,20 @@ +module augment-leaflist { + namespace "ns:augment:leaflist"; + prefix "auglflst"; + + + import yang {prefix yng; revision-date 2013-11-26;} + + + revision "2013-11-26" { + } + + augment "/yng:cont" { + leaf-list lflst1 { + type string; + } + } + + + +}
\ No newline at end of file diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/nn-to-json/augmentation/augment-list.yang b/netconf/restconf/restconf-nb-bierman02/src/test/resources/nn-to-json/augmentation/augment-list.yang new file mode 100644 index 0000000..a35a87e --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/nn-to-json/augmentation/augment-list.yang @@ -0,0 +1,22 @@ +module augment-list { + namespace "ns:augment:list"; + prefix "auglst"; + + + import yang {prefix yng; revision-date 2013-11-26;} + + + revision "2013-11-26" { + } + + augment "/yng:cont" { + list lst1 { + leaf lf11 { + type string; + } + } + } + + + +}
\ No newline at end of file diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/nn-to-json/augmentation/xml/data.xml b/netconf/restconf/restconf-nb-bierman02/src/test/resources/nn-to-json/augmentation/xml/data.xml new file mode 100644 index 0000000..fec6209 --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/nn-to-json/augmentation/xml/data.xml @@ -0,0 +1,16 @@ +<cont xmlns="ns:yang"> + <lf1>lf1</lf1> + <lf2>lf2</lf2> + <cont1> + <lf11>lf11</lf11> + </cont1> + <lst1> + <lf11>lf1_1</lf11> + </lst1> + <lst1> + <lf11>lf1_2</lf11> + </lst1> + <lflst1>lflst1_1</lflst1> + <lflst1>lflst1_2</lflst1> + <lflst1>lflst1_3</lflst1> +</cont>
\ No newline at end of file diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/nn-to-json/augmentation/yang.yang b/netconf/restconf/restconf-nb-bierman02/src/test/resources/nn-to-json/augmentation/yang.yang new file mode 100644 index 0000000..327280f --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/nn-to-json/augmentation/yang.yang @@ -0,0 +1,30 @@ +module yang { + namespace "ns:yang"; + + prefix "yng"; + revision 2013-11-26 { + } + + container cont { + leaf lf1 { + type string; + } + leaf lf2 { + type string; + } + container cont1{ + leaf lf11 { + type string; + } + } + + list lst1{ + leaf lf11 { + type string; + } + } + leaf-list lflst1{ + type string; + } + } +}
\ No newline at end of file diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/nn-to-json/choice/choice.yang b/netconf/restconf/restconf-nb-bierman02/src/test/resources/nn-to-json/choice/choice.yang new file mode 100644 index 0000000..22430b9 --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/nn-to-json/choice/choice.yang @@ -0,0 +1,125 @@ +module choice-case-test { + namespace "choice:case:test"; + + prefix "chcatst"; + revision 2013-11-27 { + } + + container cont { + leaf lf1 { + type string; + } + + choice choi1 { + case a1 { + leaf lf1a { + type uint16; + } + choice choi1a { + case aa1 { + leaf lf1aa { + type string; + } + choice choi1aa { + case aaa1 { + leaf lf1aaa { + type string; + } + } + case aab1 { + leaf lf1aab { + type string; + } + } + } + } + case ab1 { + leaf lf1ab { + type string; + } + } + } + } + case b1 { + list lst1b { + leaf lf11b { + type string; + } + } + } + case c1 { + container cont1c { + leaf lf11c { + type string; + } + } + } + case d1 { + leaf-list lflst1d { + type string; + } + } + leaf e1 { + type uint32; + } + } + + choice choi2 { + case a2 { + leaf lf2a { + type string; + } + } + case b2 { + leaf lf2b { + type string; + } + } + } + + choice choi4 { + case a4 { + list lst4a { + choice choi4aa { + case aa1 { + leaf lf4aa { + type string; + } + } + case ab2 { + leaf lf4ab { + type int16; + } + } + } + } + } + case b4 { + leaf-list lflst4b { + type uint32; + } + } + + } + +/* equal identifiers in various cases are illegal 7.9.2 rfc6020 */ +/* + choice choi3 { + case 3a { + leaf lf3a { + type string; + } + } + case 3b { + leaf lf3b { + type string; + } + } + } +*/ + + } + + + +}
\ No newline at end of file diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/nn-to-json/choice/xml/data_case_defined_without_case.xml b/netconf/restconf/restconf-nb-bierman02/src/test/resources/nn-to-json/choice/xml/data_case_defined_without_case.xml new file mode 100644 index 0000000..1d3f99f --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/nn-to-json/choice/xml/data_case_defined_without_case.xml @@ -0,0 +1,4 @@ +<cont xmlns="choice:case:test"> + <e1>45</e1> + <lf2b>lf2b val</lf2b> +</cont>
\ No newline at end of file diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/nn-to-json/choice/xml/data_container.xml b/netconf/restconf/restconf-nb-bierman02/src/test/resources/nn-to-json/choice/xml/data_container.xml new file mode 100644 index 0000000..146e256 --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/nn-to-json/choice/xml/data_container.xml @@ -0,0 +1,5 @@ +<cont xmlns="choice:case:test"> + <cont1c> + <lf11c>lf11c val</lf11c> + </cont1c> +</cont>
\ No newline at end of file diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/nn-to-json/choice/xml/data_leaflist.xml b/netconf/restconf/restconf-nb-bierman02/src/test/resources/nn-to-json/choice/xml/data_leaflist.xml new file mode 100644 index 0000000..f501e04 --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/nn-to-json/choice/xml/data_leaflist.xml @@ -0,0 +1,4 @@ +<cont xmlns="choice:case:test"> + <lflst1d>lflst1d_1 val</lflst1d> + <lflst1d>lflst1d_2 val</lflst1d> +</cont>
\ No newline at end of file diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/nn-to-json/choice/xml/data_list.xml b/netconf/restconf/restconf-nb-bierman02/src/test/resources/nn-to-json/choice/xml/data_list.xml new file mode 100644 index 0000000..6694b48 --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/nn-to-json/choice/xml/data_list.xml @@ -0,0 +1,8 @@ +<cont xmlns="choice:case:test"> + <lst1b> + <lf11b>lf11b_1 val</lf11b> + </lst1b> + <lst1b> + <lf11b>lf11b_2 val</lf11b> + </lst1b> +</cont>
\ No newline at end of file diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/nn-to-json/choice/xml/data_more_choices_same_level.xml b/netconf/restconf/restconf-nb-bierman02/src/test/resources/nn-to-json/choice/xml/data_more_choices_same_level.xml new file mode 100644 index 0000000..3d2742a --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/nn-to-json/choice/xml/data_more_choices_same_level.xml @@ -0,0 +1,6 @@ +<cont xmlns="choice:case:test"> + <cont1c> + <lf11c>lf11c val</lf11c> + </cont1c> + <lf2b>lf2b value</lf2b> +</cont>
\ No newline at end of file diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/nn-to-json/choice/xml/data_more_choices_same_level_various_paths_err.xml b/netconf/restconf/restconf-nb-bierman02/src/test/resources/nn-to-json/choice/xml/data_more_choices_same_level_various_paths_err.xml new file mode 100644 index 0000000..aa9e24c --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/nn-to-json/choice/xml/data_more_choices_same_level_various_paths_err.xml @@ -0,0 +1,7 @@ +<cont xmlns="choice:case:test"> + <cont1c> + <lf11c>lf11c val</lf11c> + </cont1c> + <lf2b>lf2b value</lf2b> + <lf2a>lf2b value</lf2a> +</cont>
\ No newline at end of file diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/nn-to-json/choice/xml/data_no_first_case.xml b/netconf/restconf/restconf-nb-bierman02/src/test/resources/nn-to-json/choice/xml/data_no_first_case.xml new file mode 100644 index 0000000..cc6f019 --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/nn-to-json/choice/xml/data_no_first_case.xml @@ -0,0 +1,5 @@ +<cont xmlns="choice:case:test"> + <lf1>lf1 val</lf1> + <lf1a>121</lf1a> + <lf1ab>lf1ab val</lf1ab> +</cont>
\ No newline at end of file diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/nn-to-json/choice/xml/data_random_level.xml b/netconf/restconf/restconf-nb-bierman02/src/test/resources/nn-to-json/choice/xml/data_random_level.xml new file mode 100644 index 0000000..05ca42f --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/nn-to-json/choice/xml/data_random_level.xml @@ -0,0 +1,6 @@ +<cont xmlns="choice:case:test"> + <lf1aa>lf1aa val</lf1aa> + <lf1>lf1 val</lf1> + <lf1a>121</lf1a> + <lf1aaa>lf1aaa val</lf1aaa> +</cont>
\ No newline at end of file diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/nn-to-json/choice/xml/data_three_choices_same_level.xml b/netconf/restconf/restconf-nb-bierman02/src/test/resources/nn-to-json/choice/xml/data_three_choices_same_level.xml new file mode 100644 index 0000000..7e54301 --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/nn-to-json/choice/xml/data_three_choices_same_level.xml @@ -0,0 +1,13 @@ +<cont xmlns="choice:case:test"> + <lf1aaa>lf1aaa value</lf1aaa> + <lf2b>lf2b value</lf2b> + <lst4a> + <lf4ab>33</lf4ab> + </lst4a> + <lst4a> + <lf4ab>33</lf4ab> + </lst4a> + <lst4a> + <lf4ab>37</lf4ab> + </lst4a> +</cont>
\ No newline at end of file diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/nn-to-json/choice/xml/data_various_path_err.xml b/netconf/restconf/restconf-nb-bierman02/src/test/resources/nn-to-json/choice/xml/data_various_path_err.xml new file mode 100644 index 0000000..5274679 --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/nn-to-json/choice/xml/data_various_path_err.xml @@ -0,0 +1,6 @@ +<cont xmlns="choice:case:test"> + <lf1aa>lf1aa val</lf1aa> + <lf1>lf1 val</lf1> + <lf1a>121</lf1a> + <lf1ab>lf1ab value</lf1ab> +</cont>
\ No newline at end of file diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/nn-to-json/data-of-several-modules/yang/module1.yang b/netconf/restconf/restconf-nb-bierman02/src/test/resources/nn-to-json/data-of-several-modules/yang/module1.yang new file mode 100644 index 0000000..72a82ca --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/nn-to-json/data-of-several-modules/yang/module1.yang @@ -0,0 +1,20 @@ +module module1 { + namespace "module:one"; + + prefix "m1"; + revision 2014-01-17 { + } + + container cont_m1 { + leaf lf1_m1 { + type string; + } + uses confB_gr; + } + + grouping confB_gr { + container contB_m1 { + } + } + +}
\ No newline at end of file diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/nn-to-json/data-of-several-modules/yang/module2.yang b/netconf/restconf/restconf-nb-bierman02/src/test/resources/nn-to-json/data-of-several-modules/yang/module2.yang new file mode 100644 index 0000000..521d9c0 --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/nn-to-json/data-of-several-modules/yang/module2.yang @@ -0,0 +1,20 @@ +module module2 { + namespace "module:two"; + + prefix "m2"; + revision 2014-01-17 { + } + + container cont_m2 { + leaf lf1_m2 { + type string; + } + uses confB_gr; + } + + grouping confB_gr { + container contB_m2 { + } + } + +}
\ No newline at end of file diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/nn-to-json/identityref/identity-module.yang b/netconf/restconf/restconf-nb-bierman02/src/test/resources/nn-to-json/identityref/identity-module.yang new file mode 100644 index 0000000..09a34c5 --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/nn-to-json/identityref/identity-module.yang @@ -0,0 +1,10 @@ +module identity-module { + namespace "identity:module"; + + prefix "idemod"; + revision 2013-12-02 { + } + + identity iden { + } +} diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/nn-to-json/identityref/identityref-module.yang b/netconf/restconf/restconf-nb-bierman02/src/test/resources/nn-to-json/identityref/identityref-module.yang new file mode 100644 index 0000000..c5c8f62 --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/nn-to-json/identityref/identityref-module.yang @@ -0,0 +1,21 @@ +module identityref-module { + namespace "identityref:module"; + + prefix "iderefmod"; + + import identity-module {prefix idemo; revision-date 2013-12-02; } + + revision 2013-12-02 { + } + + container cont { + container cont1 { + leaf lf1 { + type identityref { + base "idemo:iden"; + } + } + } + } + +} diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/nn-to-json/invalid-top-level-element/invalid-top-level-element.yang b/netconf/restconf/restconf-nb-bierman02/src/test/resources/nn-to-json/invalid-top-level-element/invalid-top-level-element.yang new file mode 100644 index 0000000..a9df486 --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/nn-to-json/invalid-top-level-element/invalid-top-level-element.yang @@ -0,0 +1,13 @@ +module invalid-top-level-element { + namespace "invalid:top:level:element"; + + prefix "intoleel"; + revision 2013-12-17 { + } + + + leaf lf { + type string; + } + +}
\ No newline at end of file diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/nn-to-json/leafref/cont-augment-module.yang b/netconf/restconf/restconf-nb-bierman02/src/test/resources/nn-to-json/leafref/cont-augment-module.yang new file mode 100644 index 0000000..b54027e --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/nn-to-json/leafref/cont-augment-module.yang @@ -0,0 +1,39 @@ +module cont-augment-module { + namespace "cont:augment:module"; + + prefix "cntaugmod"; + + import main-module {prefix mamo; revision-date 2013-12-02;} + + revision 2013-12-02 { + + } + + augment "/mamo:cont" { + leaf-list lflst1 { + type leafref { + path "../mamo:lf1"; + } + } + + leaf lf4 { + type leafref { + path "../mamo:lf1"; + } + } + + /* reference to not leaf element */ + leaf lf6 { + type leafref { + path "../lflst1"; + } + } + + leaf lf7 { + type leafref { + path "../lf4"; + } + } + } + +} diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/nn-to-json/leafref/main-module.yang b/netconf/restconf/restconf-nb-bierman02/src/test/resources/nn-to-json/leafref/main-module.yang new file mode 100644 index 0000000..0d90d2b --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/nn-to-json/leafref/main-module.yang @@ -0,0 +1,50 @@ +module main-module { + namespace "main:module"; + + prefix "mainmod"; + revision 2013-12-02 { + } + + container cont { + leaf lf1 { + /* + *FIX ME + * If is this leaf lf1 called from cont-augment-module.yang + * from lf4, type that will be returned to the lf1 is string. + * Than there are failing tests because of we have string, + * do not number(uint32) + */ +// type uint32; + type string; + } + + container cont1 { + leaf lf11 { + /* + * FIX ME TOO WITH BAD PARSING + */ +// type boolean; + type string; + } + } + + leaf lf2 { + type leafref { + path "../lf1"; + } + } + + leaf lf3 { + type leafref { + path "/cont/cont1/lf11"; + } + } + + /* reference to nonexisting leaf */ + leaf lf5 { + type leafref { + path "/cont/lf"; + } + } + } +} diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/nn-to-json/leafref/xml/data_absolut_ref_to_existing_leaf.xml b/netconf/restconf/restconf-nb-bierman02/src/test/resources/nn-to-json/leafref/xml/data_absolut_ref_to_existing_leaf.xml new file mode 100644 index 0000000..bd5b6a2 --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/nn-to-json/leafref/xml/data_absolut_ref_to_existing_leaf.xml @@ -0,0 +1,7 @@ +<cont xmlns="main:module" + xmlns:cont-augment-module="cont:augment:module"> + <cont1> + <lf11>true</lf11> + </cont1> + <lf3>true</lf3> +</cont>
\ No newline at end of file diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/nn-to-json/leafref/xml/data_from_leafref_to_leafref.xml b/netconf/restconf/restconf-nb-bierman02/src/test/resources/nn-to-json/leafref/xml/data_from_leafref_to_leafref.xml new file mode 100644 index 0000000..7b1c277 --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/nn-to-json/leafref/xml/data_from_leafref_to_leafref.xml @@ -0,0 +1,4 @@ +<cont xmlns="main:module" + xmlns:cont-augment-module="cont:augment:module"> + <cont-augment-module:lf7>200</cont-augment-module:lf7> +</cont>
\ No newline at end of file diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/nn-to-json/leafref/xml/data_ref_to_non_existing_leaf.xml b/netconf/restconf/restconf-nb-bierman02/src/test/resources/nn-to-json/leafref/xml/data_ref_to_non_existing_leaf.xml new file mode 100644 index 0000000..cdbd56b --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/nn-to-json/leafref/xml/data_ref_to_non_existing_leaf.xml @@ -0,0 +1,4 @@ +<cont xmlns="main:module" + xmlns:cont-augment-module="cont:augment:module"> + <lf5>137</lf5> +</cont>
\ No newline at end of file diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/nn-to-json/leafref/xml/data_ref_to_not_leaf.xml b/netconf/restconf/restconf-nb-bierman02/src/test/resources/nn-to-json/leafref/xml/data_ref_to_not_leaf.xml new file mode 100644 index 0000000..953280b --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/nn-to-json/leafref/xml/data_ref_to_not_leaf.xml @@ -0,0 +1,4 @@ +<cont xmlns="main:module" + xmlns:cont-augment-module="cont:augment:module"> + <cont-augment-module:lf6>44</cont-augment-module:lf6> +</cont>
\ No newline at end of file diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/nn-to-json/leafref/xml/data_relativ_ref_from_leaflist_to_existing_leaf.xml b/netconf/restconf/restconf-nb-bierman02/src/test/resources/nn-to-json/leafref/xml/data_relativ_ref_from_leaflist_to_existing_leaf.xml new file mode 100644 index 0000000..8fe0ac4 --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/nn-to-json/leafref/xml/data_relativ_ref_from_leaflist_to_existing_leaf.xml @@ -0,0 +1,6 @@ +<cont xmlns="main:module" + xmlns:cont-augment-module="cont:augment:module"> + <cont-augment-module:lflst1>345</cont-augment-module:lflst1> + <cont-augment-module:lflst1>346</cont-augment-module:lflst1> + <cont-augment-module:lflst1>347</cont-augment-module:lflst1> +</cont>
\ No newline at end of file diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/nn-to-json/leafref/xml/data_relativ_ref_to_existing_leaf.xml b/netconf/restconf/restconf-nb-bierman02/src/test/resources/nn-to-json/leafref/xml/data_relativ_ref_to_existing_leaf.xml new file mode 100644 index 0000000..14a2544 --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/nn-to-json/leafref/xml/data_relativ_ref_to_existing_leaf.xml @@ -0,0 +1,5 @@ +<cont xmlns="main:module" + xmlns:cont-augment-module="cont:augment:module"> + <lf1>121</lf1> + <lf2>121</lf2> +</cont>
\ No newline at end of file diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/nn-to-json/list/list-types-module b/netconf/restconf/restconf-nb-bierman02/src/test/resources/nn-to-json/list/list-types-module new file mode 100644 index 0000000..9bdea81 --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/nn-to-json/list/list-types-module @@ -0,0 +1,274 @@ +module simple-data-types { + namespace "simple:data:types"; + + prefix "smpdtp"; + revision 2013-11-12 { + } + + identity iden { + } + + typedef tpdfempty { + type empty; + } + + typedef tpdfbit { + type bits { + bit b1; + bit b2; + bit b3; + } + } + + typedef tpdfun4 { + type boolean; + } + + typedef tpdfun3 { + type union { + type tpdfbit; + type tpdfempty; + } + } + + typedef tpdfun2 { + type union { + type tpdfun3; + type tpdfun4; + } + } + + typedef tpdfun1 { + type union { + type uint8; + type decimal64 { + fraction-digits 2; + } + } + } + + container cont { + leaf lfnint8Min { + type int8; + } + leaf lfnint8Max { + type int8; + } + leaf lfnint16Min { + type int16; + } + leaf lfnint16Max { + type int16; + } + leaf lfnint32Min { + type int32; + } + leaf lfnint32Max { + type int32; + } + leaf lfnint64Min { + type int64; + } + leaf lfnint64Max { + type int64; + } + + leaf lfnuint8Max { + type uint8; + } + leaf lfnuint16Max { + type uint16; + } + leaf lfnuint32Max { + type uint32; + } + leaf lfuint64Max { + type uint64; + } + leaf lfstr { + type string; + } + leaf lfstr1 { + type string; + } + leaf lfbool1 { + type boolean; + } + leaf lfbool2 { + type boolean; + } + leaf lfbool3 { + type boolean; + } + leaf lfdecimal1 { + type decimal64 { + fraction-digits 2; + } + } + leaf lfdecimal2 { + type decimal64 { + fraction-digits 2; + } + } + leaf lfdecimal3 { + type decimal64 { + fraction-digits 2; + } + } + + leaf lfdecimal4 { + type decimal64 { + fraction-digits 2; + } + } + + + leaf lfdecimal6 { + type decimal64 { + fraction-digits 2; + } + } + + leaf lfenum { + type enumeration { + enum enum1; + enum enum2; + enum enum3; + enum enum4; + } + } + + leaf lfbits { + type bits { + bit bit1; + bit bit2; + bit bit3; + bit bit4; + } + } + + leaf lfbinary { + type binary; + } + + leaf lfref1 { //reference to string type + type leafref { + path "../lfstr"; + } + } + + leaf lfref2 { //reference to number type + type leafref { + path "../lfnint8Max"; + } + } + + leaf lfempty { + type empty; + } + + leaf lfunion1 { + type union { + type uint16; + type string; + } + } + leaf lfunion2 { + type union { + type decimal64 { + fraction-digits 2; + } + type string; + } + } + + leaf lfunion3 { + type union { + type empty; + type string; + } + } + + leaf lfunion4 { + type union { + type boolean; + type string; + } + } + + leaf lfunion5 { + type union { + type uint16; + type string; + } + } + + leaf lfunion6 { + type union { + type uint16; + type empty; + } + } + + leaf lfunion7 { + type tpdfun3; + } + + leaf lfunion8 { + type union { + type uint16; + type string; + } + } + + leaf lfunion9 { + type union { + type uint16; + type boolean; + } + } + + leaf lfunion10 { + type union { + type bits { + bit bt1; + bit bt2; + } + type boolean; + } + } + + leaf lfunion11 { + type union { + type tpdfun1; + type tpdfun2; + } + } + + leaf lfunion12 { + type tpdfun2; + } + + leaf lfunion13 { + type tpdfbit; + } + + leaf lfunion14 { + type union { + type enumeration { + enum zero; + enum one; + } + type uint16; + } + } + + leaf identityref1 { + type identityref { + base iden; + } + } + + + } +}
\ No newline at end of file diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/nn-to-json/simple-data-types/simple-data-types.yang b/netconf/restconf/restconf-nb-bierman02/src/test/resources/nn-to-json/simple-data-types/simple-data-types.yang new file mode 100644 index 0000000..cf6e513 --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/nn-to-json/simple-data-types/simple-data-types.yang @@ -0,0 +1,278 @@ +module simple-data-types { + namespace "simple:data:types"; + + prefix "smpdtp"; + revision 2013-11-12 { + } + + identity iden { + } + + typedef tpdfempty { + type empty; + } + + typedef tpdfbit { + type bits { + bit b1; + bit b2; + bit b3; + } + } + + typedef tpdfun4 { + type boolean; + } + + typedef tpdfun3 { + type union { + type tpdfbit; + type tpdfempty; + } + } + + typedef tpdfun2 { + type union { + type tpdfun3; + type tpdfun4; + } + } + + typedef tpdfun1 { + type union { + type uint8; + type decimal64 { + fraction-digits 2; + } + } + } + + container cont { + leaf lfnint8Min { + type int8; + } + leaf lfnint8Max { + type int8; + } + leaf lfnint16Min { + type int16; + } + leaf lfnint16Max { + type int16; + } + leaf lfnint32Min { + type int32; + } + leaf lfnint32Max { + type int32; + } + leaf lfnint64Min { + type int64; + } + leaf lfnint64Max { + type int64; + } + + leaf lfnuint8Max { + type uint8; + } + leaf lfnuint16Max { + type uint16; + } + leaf lfnuint32Max { + type uint32; + } + leaf lfuint64Max { + type uint64; + } + leaf lfstr { + type string; + } + leaf lfstr1 { + type string; + } + leaf lfbool1 { + type boolean; + } + leaf lfbool2 { + type boolean; + } + leaf lfbool3 { + type boolean; + } + leaf lfdecimal1 { + type decimal64 { + fraction-digits 2; + } + } + leaf lfdecimal2 { + type decimal64 { + fraction-digits 2; + } + } + leaf lfdecimal3 { + type decimal64 { + fraction-digits 2; + } + } + + leaf lfdecimal4 { + type decimal64 { + fraction-digits 2; + } + } + + + leaf lfdecimal6 { + type decimal64 { + fraction-digits 2; + } + } + + leaf lfenum { + type enumeration { + enum enum1; + enum enum2; + enum enum3; + enum enum4; + } + } + + leaf lfbits { + type bits { + bit bit1; + bit bit2; + bit bit3; + bit bit4; + } + } + + leaf lfbinary { + type binary; + } + + leaf lfref1 { //reference to string type + type leafref { + path "../lfstr"; + } + } + + leaf lfref2 { //reference to number type + type leafref { + path "../lfnint8Max"; + } + } + + leaf lfempty { + type empty; + } + + leaf lfunion1 { + type union { + type uint16; + type string; + } + } + leaf lfunion2 { + type union { + type decimal64 { + fraction-digits 2; + } + type string; + } + } + + leaf lfunion3 { + type union { + type empty; + type string; + } + } + + leaf lfunion4 { + type union { + type boolean; + type string; + } + } + + leaf lfunion5 { + type union { + type uint16; + type string; + } + } + + leaf lfunion6 { + type union { + type uint16; + type empty; + } + } + + leaf lfunion7 { + type tpdfun3; + } + + leaf lfunion8 { + type union { + type uint16; + type string; + } + } + + leaf lfunion9 { + type union { + type uint16; + type boolean; + } + } + + leaf lfunion10 { + type union { + type bits { + bit bt1; + bit bt2; + } + type boolean; + } + } + + leaf lfunion11 { + type union { + type tpdfun1; + type tpdfun2; + } + } + + leaf lfunion12 { + type tpdfun2; + } + + leaf lfunion13 { + type tpdfbit; + } + + leaf lfunion14 { + type union { + type enumeration { + enum zero; + enum one; + } + type uint16; + } + } + + leaf identityref1 { + type identityref { + base iden; + } + } + + anyxml complex-any; + + anyxml simple-any; + + anyxml empty-any; + } +}
\ No newline at end of file diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/nn-to-json/simple-data-types/xml/bad-data.xml b/netconf/restconf/restconf-nb-bierman02/src/test/resources/nn-to-json/simple-data-types/xml/bad-data.xml new file mode 100644 index 0000000..31dfad1 --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/nn-to-json/simple-data-types/xml/bad-data.xml @@ -0,0 +1,3 @@ +<cont xmlns= "simple:data:types"> + <lfnint8Min>invalid</lfnint8Min> +</cont>
\ No newline at end of file diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/nn-to-json/simple-data-types/xml/data.xml b/netconf/restconf/restconf-nb-bierman02/src/test/resources/nn-to-json/simple-data-types/xml/data.xml new file mode 100644 index 0000000..86043d7 --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/nn-to-json/simple-data-types/xml/data.xml @@ -0,0 +1,71 @@ +<cont xmlns="simple:data:types"> + <lfnint8Min>-128</lfnint8Min> + <lfnint8Max>127</lfnint8Max> + <lfnint16Min>-32768</lfnint16Min> + <lfnint16Max>32767</lfnint16Max> + <lfnint32Min>-2147483648</lfnint32Min> + <lfnint32Max>2147483647</lfnint32Max> + <lfnint64Min>-9223372036854775808</lfnint64Min> + <lfnint64Max>9223372036854775807</lfnint64Max> + <lfnuint8Max>255</lfnuint8Max> + <lfnuint16Max>65535</lfnuint16Max> + <lfnuint32Max>4294967295</lfnuint32Max> + <lfstr>lfstr</lfstr> + <lfstr1></lfstr1> + <lfbool1>true</lfbool1> + <lfbool2>false</lfbool2> + <lfbool3>bla</lfbool3> + <lfdecimal1>43.32</lfdecimal1> + <lfdecimal2>-0.43</lfdecimal2> + <lfdecimal3>43</lfdecimal3> + <lfdecimal4>43E3</lfdecimal4> + <lfdecimal6>33.12345</lfdecimal6> + <lfenum>enum3</lfenum> + <lfbits>bit3 bit2</lfbits> + <lfbinary>ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz</lfbinary> + <lfunion1>324</lfunion1> + <lfunion2>33.3</lfunion2> + <lfunion3>55</lfunion3> + <lfunion4>true</lfunion4> + <lfunion5>true</lfunion5> + <lfunion6>10</lfunion6> + <lfunion7></lfunion7> + <lfunion8></lfunion8> + <lfunion9></lfunion9> + <lfunion10>bt1</lfunion10> + <lfunion11>33</lfunion11> + <lfunion12>false</lfunion12> + <lfunion13>b1</lfunion13> + <lfunion14>zero</lfunion14> + <lfempty></lfempty> + <identityref1 xmlns:x="simple:data:types">x:iden</identityref1> + <complex-any> + <data> + <leaf1>leaf1-value</leaf1> + <leaf2>leaf2-value</leaf2> + + <leaf-list>leaf-list-value1</leaf-list> + <leaf-list>leaf-list-value2</leaf-list> + + <list> + <nested-list> + <nested-leaf>nested-value1</nested-leaf> + </nested-list> + <nested-list> + <nested-leaf>nested-value2</nested-leaf> + </nested-list> + </list> + + <list> + <nested-list> + <nested-leaf>nested-value3</nested-leaf> + </nested-list> + <nested-list> + <nested-leaf>nested-value4</nested-leaf> + </nested-list> + </list> + </data> + </complex-any> + <simple-any>simple</simple-any> + <empty-any></empty-any> +</cont> diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/nn-to-json/simple-yang-types/simple-yang-types.yang b/netconf/restconf/restconf-nb-bierman02/src/test/resources/nn-to-json/simple-yang-types/simple-yang-types.yang new file mode 100644 index 0000000..fdb3bfb --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/nn-to-json/simple-yang-types/simple-yang-types.yang @@ -0,0 +1,57 @@ +module simple-yang-types { + namespace "simple:yang:types"; + + prefix "smptp"; + revision 2013-11-5 { + description "Initial revision."; + } + + container cont1 { + leaf lf11 { + type string; + } + leaf-list lflst11 { + type int32; + } + leaf-list lflst12 { + type string; + } + list lst11 { + key "lf111"; + leaf lf111 { + type uint8; + } + leaf lf112 { + type string; + } + container cont111 { + leaf lf1111 { + type string; + } + leaf-list lflst1111 { + type int32; + } + list lst1111 { + leaf lf1111A { + type string; + } + leaf lf1111B { + type uint8; + } + } + } + list lst111 { + leaf lf1111 { + type int32; + } + } + list lst112 { + leaf lf1121 { + type string; + } + } + } + + } + +}
\ No newline at end of file diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/nn-to-json/simple-yang-types/xml/awaited_output_data.json b/netconf/restconf/restconf-nb-bierman02/src/test/resources/nn-to-json/simple-yang-types/xml/awaited_output_data.json new file mode 100644 index 0000000..8888e7f --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/nn-to-json/simple-yang-types/xml/awaited_output_data.json @@ -0,0 +1,72 @@ +{ + "cont1": { + "lf11":"lf", + "lflst11": [55,56,57], + "lflst12": ["lflst12 str1", "lflst12 str2", "lflst12 str3"], + "lst11": [ + { + "lf111":140, + "lf112":"lf112 str", + "cont111": { + "lf1111":"lf1111 str", + "lflst1111": [2048, 1024, 4096], + "lst1111": [ + { + "lf1111A": "lf1111A str11", + "lf1111B": 4 + }, + { + "lf1111A": "lf1111A str12", + "lf1111B": 7 + } + ] + }, + "lst111" : [ + { + "lf1111" : 65 + } + ], + "lst112" : [ + { + "lf1121" : "lf1121 str11" + } + ] + + }, + { + "lf111":141, + "lf112":"lf112 str2", + "cont111": { + "lf1111":"lf1111 str2", + "lflst1111": [2049, 1025, 4097], + "lst1111": [ + { + "lf1111A": "lf1111A str21", + "lf1111B": 5 + }, + { + "lf1111A": "lf1111A str22", + "lf1111B": 8 + } + ] + }, + "lst111" : [ + { + "lf1111" : 55 + }, + { + "lf1111" : 56 + } + ], + "lst112" : [ + { + "lf1121" : "lf1121 str21" + }, + { + "lf1121" : "lf1121 str22" + } + ] + } + ] + } +}
\ No newline at end of file diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/nn-to-json/simple-yang-types/xml/awaited_output_empty_data.json b/netconf/restconf/restconf-nb-bierman02/src/test/resources/nn-to-json/simple-yang-types/xml/awaited_output_empty_data.json new file mode 100644 index 0000000..4b19988 --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/nn-to-json/simple-yang-types/xml/awaited_output_empty_data.json @@ -0,0 +1,49 @@ +{ + "cont1": { + "lst11": [ + { + "lf111": 1, + "lst111": [ + { + "lf1111": 34 + }, + { + "lf1111": 35 + }, + {}, + {} + ], + "cont111": {} + }, + { + "lf111": 2, + "cont111": { + "lflst1111": [ + 1024, + 4096 + ], + "lst1111": [ + { + "lf1111B": 4 + }, + { + "lf1111A": "lf1111A str12" + } + ] + }, + "lst112": [ + {} + ] + }, + { + "lf111": 3, + "cont111": { + "lst1111": [ + {}, + {} + ] + } + } + ] + } +}
\ No newline at end of file diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/nn-to-json/simple-yang-types/xml/data.xml b/netconf/restconf/restconf-nb-bierman02/src/test/resources/nn-to-json/simple-yang-types/xml/data.xml new file mode 100644 index 0000000..1df9ca5 --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/nn-to-json/simple-yang-types/xml/data.xml @@ -0,0 +1,63 @@ +<cont1 xmlns="simple:yang:types"> + <lf11>lf</lf11> + <lflst11>56</lflst11> + <lflst11>55</lflst11> + <lflst11>57</lflst11> + <lflst12>lflst12 str3</lflst12> + <lst11> + <lst112> + <lf1121>lf1121 str22</lf1121> + </lst112> + <lf111>141</lf111> + <lf112>lf112 str2</lf112> + <lst111> + <lf1111>55</lf1111> + </lst111> + <cont111> + <lflst1111>4097</lflst1111> + <lflst1111>2049</lflst1111> + <lflst1111>1025</lflst1111> + <lst1111> + <lf1111A>lf1111A str22</lf1111A> + <lf1111B>8</lf1111B> + </lst1111> + <lf1111>lf1111 str2</lf1111> + <lst1111> + <lf1111B>5</lf1111B> + <lf1111A>lf1111A str21</lf1111A> + </lst1111> + </cont111> + <lst111> + <lf1111>56</lf1111> + </lst111> + <lst112> + <lf1121>lf1121 str21</lf1121> + </lst112> + </lst11> + <lflst12>lflst12 str1</lflst12> + <lst11> + <lf111>140</lf111> + <lf112>lf112 str</lf112> + <cont111> + <lf1111>lf1111 str</lf1111> + <lflst1111>2048</lflst1111> + <lflst1111>1024</lflst1111> + <lflst1111>4096</lflst1111> + <lst1111> + <lf1111A>lf1111A str11</lf1111A> + <lf1111B>4</lf1111B> + </lst1111> + <lst1111> + <lf1111A>lf1111A str12</lf1111A> + <lf1111B>7</lf1111B> + </lst1111> + </cont111> + <lst111> + <lf1111>65</lf1111> + </lst111> + <lst112> + <lf1121>lf1121 str11</lf1121> + </lst112> + </lst11> + <lflst12>lflst12 str2</lflst12> +</cont1> diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/nn-to-json/simple-yang-types/xml/empty_data.xml b/netconf/restconf/restconf-nb-bierman02/src/test/resources/nn-to-json/simple-yang-types/xml/empty_data.xml new file mode 100644 index 0000000..9cd503e --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/nn-to-json/simple-yang-types/xml/empty_data.xml @@ -0,0 +1,40 @@ +<cont1> + <lst11> + <lf111>1</lf111> + <lst111></lst111> + <lst111></lst111> + <lst111> + <lf1111></lf1111> + </lst111> + <lst111> + <lf1111>35</lf1111> + </lst111> + <cont111></cont111> + </lst11> + <lst11> + <lf111>2</lf111> + <cont111> + <lf1111></lf1111> + <lflst1111></lflst1111> + <lflst1111>1024</lflst1111> + <lflst1111>4096</lflst1111> + <lst1111> + <lf1111B>4</lf1111B> + </lst1111> + <lst1111> + <lf1111A>lf1111A str12</lf1111A> + </lst1111> + </cont111> + <lst112></lst112> + </lst11> + <lst11> + <lf111>3</lf111> + <cont111> + <lf1111></lf1111> + <lflst1111></lflst1111> + <lflst1111></lflst1111> + <lst1111></lst1111> + <lst1111></lst1111> + </cont111> + </lst11> +</cont1> diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/nn-to-xml/choice/module-with-choice.yang b/netconf/restconf/restconf-nb-bierman02/src/test/resources/nn-to-xml/choice/module-with-choice.yang new file mode 100644 index 0000000..8454784 --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/nn-to-xml/choice/module-with-choice.yang @@ -0,0 +1,25 @@ +module module-with-choice { + namespace "module:with:choice"; + + prefix "mowicho"; + + revision 2013-12-18 { + } + + + container cont { + choice choA { + case caA1 { + leaf lf1 { + type string; + } + } + case caA2 { + leaf lf2 { + type string; + } + } + } + } + +}
\ No newline at end of file diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/nn-to-xml/data-of-several-modules/yang/module1.yang b/netconf/restconf/restconf-nb-bierman02/src/test/resources/nn-to-xml/data-of-several-modules/yang/module1.yang new file mode 100644 index 0000000..72a82ca --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/nn-to-xml/data-of-several-modules/yang/module1.yang @@ -0,0 +1,20 @@ +module module1 { + namespace "module:one"; + + prefix "m1"; + revision 2014-01-17 { + } + + container cont_m1 { + leaf lf1_m1 { + type string; + } + uses confB_gr; + } + + grouping confB_gr { + container contB_m1 { + } + } + +}
\ No newline at end of file diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/nn-to-xml/data-of-several-modules/yang/module2.yang b/netconf/restconf/restconf-nb-bierman02/src/test/resources/nn-to-xml/data-of-several-modules/yang/module2.yang new file mode 100644 index 0000000..521d9c0 --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/nn-to-xml/data-of-several-modules/yang/module2.yang @@ -0,0 +1,20 @@ +module module2 { + namespace "module:two"; + + prefix "m2"; + revision 2014-01-17 { + } + + container cont_m2 { + leaf lf1_m2 { + type string; + } + uses confB_gr; + } + + grouping confB_gr { + container contB_m2 { + } + } + +}
\ No newline at end of file diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/nn-to-xml/instance_identifier/aug-referenced-elements-module.yang b/netconf/restconf/restconf-nb-bierman02/src/test/resources/nn-to-xml/instance_identifier/aug-referenced-elements-module.yang new file mode 100644 index 0000000..5829e04 --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/nn-to-xml/instance_identifier/aug-referenced-elements-module.yang @@ -0,0 +1,18 @@ +module aug-referenced-elements-module { + namespace "aug:referenced:elements:module"; + + prefix "augrefelmo"; + + import referenced-elements-module {prefix refelmo; revision-date 2013-12-03;} + + revision 2013-12-03 { + } + + augment "/refelmo:cont" { + leaf lf2 { + type boolean; + } + } + + +} diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/nn-to-xml/instance_identifier/eferenced-elements-module.yang b/netconf/restconf/restconf-nb-bierman02/src/test/resources/nn-to-xml/instance_identifier/eferenced-elements-module.yang new file mode 100644 index 0000000..a844ac6 --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/nn-to-xml/instance_identifier/eferenced-elements-module.yang @@ -0,0 +1,20 @@ +module referenced-elements-module { + namespace "referenced:elements:module"; + + prefix "refelmo"; + + revision 2013-12-03 { + } + + container cont { + leaf lf1 { + type string; + } + } + leaf-list lflst1 { + type uint32; + } + + } + +} diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/nn-to-xml/instance_identifier/rinstance-identifier-module.yang b/netconf/restconf/restconf-nb-bierman02/src/test/resources/nn-to-xml/instance_identifier/rinstance-identifier-module.yang new file mode 100644 index 0000000..41a9001 --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/nn-to-xml/instance_identifier/rinstance-identifier-module.yang @@ -0,0 +1,16 @@ +module instance-identifier-module { + namespace "instance:identifier:module"; + + prefix "inidmod"; + + revision 2013-12-03 { + } + + container cont { + leaf lf1 { + type instance-identifier { + } + } + } + +} diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/nn-to-xml/yang/basic-module.yang b/netconf/restconf/restconf-nb-bierman02/src/test/resources/nn-to-xml/yang/basic-module.yang new file mode 100644 index 0000000..efbac4d --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/nn-to-xml/yang/basic-module.yang @@ -0,0 +1,111 @@ +module basic-module { + namespace "basic:module"; + + prefix "basmod"; + + import referenced-module {prefix refmo; revision-date 2013-12-02;} + + revision 2013-12-02 { + } + + container cont { + container cont1 { + leaf lf11 { + type identityref { + base "refmo:iden"; + } + } + } + leaf lfStr { + type string; + } + leaf lfInt8 { + type int8; + } + + leaf lfInt16 { + type int16; + } + + leaf lfInt32 { + type int32; + } + + leaf lfInt64 { + type int64; + } + + leaf lfUint8 { + type uint8; + } + + leaf lfUint16 { + type uint16; + } + + leaf lfUint32 { + type uint32; + } + + leaf lfUint64 { + type uint64; + } + + leaf lfBinary { + type binary; + } + + leaf lfBits { + type bits { + bit one; + bit two; + bit three; + } + } + + leaf lfEnumeration { + type enumeration { + enum enum1; + enum enum2; + enum enum3; + } + } + + leaf lfEmpty { + type empty; + } + + leaf lfBoolean { + type boolean; + } + + leaf lfUnion { + type union { + type int8; + type string; + type bits { + bit first; + bit second; + } + type boolean; + } + } + + leaf lfLfref { + type leafref { + path "/cont/lfBoolean"; + } + } + + leaf lfLfrefNegative { + type leafref { + path "/cont/not-existing"; + } + } + + leaf lfInIdentifier { + type instance-identifier; + } + + } +} diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/nn-to-xml/yang/referenced-module.yang b/netconf/restconf/restconf-nb-bierman02/src/test/resources/nn-to-xml/yang/referenced-module.yang new file mode 100644 index 0000000..e78266f --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/nn-to-xml/yang/referenced-module.yang @@ -0,0 +1,10 @@ +module referenced-module { + namespace "referenced:module"; + + prefix "refmod"; + revision 2013-12-02 { + } + + identity iden { + } +} diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/normalize-node/yang/normalize-node-module b/netconf/restconf/restconf-nb-bierman02/src/test/resources/normalize-node/yang/normalize-node-module new file mode 100644 index 0000000..15e68ef --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/normalize-node/yang/normalize-node-module @@ -0,0 +1,14 @@ +module normalize-node-module { + namespace "normalize:node:module"; + + prefix "nonomo"; + revision 2014-01-09 { + } + + container cont { + leaf lf1 { + type int32; + } + } + +}
\ No newline at end of file diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/notifications/ietf-inet-types.yang b/netconf/restconf/restconf-nb-bierman02/src/test/resources/notifications/ietf-inet-types.yang new file mode 100644 index 0000000..de20feb --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/notifications/ietf-inet-types.yang @@ -0,0 +1,418 @@ + module ietf-inet-types { + + namespace "urn:ietf:params:xml:ns:yang:ietf-inet-types"; + prefix "inet"; + + organization + "IETF NETMOD (NETCONF Data Modeling Language) Working Group"; + + contact + "WG Web: <http://tools.ietf.org/wg/netmod/> + WG List: <mailto:netmod@ietf.org> + + WG Chair: David Partain + <mailto:david.partain@ericsson.com> + + WG Chair: David Kessens + <mailto:david.kessens@nsn.com> + + Editor: Juergen Schoenwaelder + <mailto:j.schoenwaelder@jacobs-university.de>"; + + description + "This module contains a collection of generally useful derived + YANG data types for Internet addresses and related things. + + Copyright (c) 2010 IETF Trust and the persons identified as + authors of the code. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, is permitted pursuant to, and subject to the license + terms contained in, the Simplified BSD License set forth in Section + 4.c of the IETF Trust's Legal Provisions Relating to IETF Documents + (http://trustee.ietf.org/license-info). + + This version of this YANG module is part of RFC 6021; see + the RFC itself for full legal notices."; + + revision 2010-09-24 { + description + "Initial revision."; + reference + "RFC 6021: Common YANG Data Types"; + } + + /*** collection of protocol field related types ***/ + + typedef ip-version { + type enumeration { + enum unknown { + value "0"; + description + "An unknown or unspecified version of the Internet protocol."; + } + enum ipv4 { + value "1"; + description + "The IPv4 protocol as defined in RFC 791."; + } + enum ipv6 { + value "2"; + description + "The IPv6 protocol as defined in RFC 2460."; + } + } + description + "This value represents the version of the IP protocol. + + In the value set and its semantics, this type is equivalent + to the InetVersion textual convention of the SMIv2."; + reference + "RFC 791: Internet Protocol + RFC 2460: Internet Protocol, Version 6 (IPv6) Specification + RFC 4001: Textual Conventions for Internet Network Addresses"; + } + + typedef dscp { + type uint8 { + range "0..63"; + } + description + "The dscp type represents a Differentiated Services Code-Point + that may be used for marking packets in a traffic stream. + + In the value set and its semantics, this type is equivalent + to the Dscp textual convention of the SMIv2."; + reference + "RFC 3289: Management Information Base for the Differentiated + Services Architecture + RFC 2474: Definition of the Differentiated Services Field + (DS Field) in the IPv4 and IPv6 Headers + RFC 2780: IANA Allocation Guidelines For Values In + the Internet Protocol and Related Headers"; + } + + typedef ipv6-flow-label { + type uint32 { + range "0..1048575"; + } + description + "The flow-label type represents flow identifier or Flow Label + in an IPv6 packet header that may be used to discriminate + traffic flows. + + In the value set and its semantics, this type is equivalent + to the IPv6FlowLabel textual convention of the SMIv2."; + reference + "RFC 3595: Textual Conventions for IPv6 Flow Label + RFC 2460: Internet Protocol, Version 6 (IPv6) Specification"; + } + + typedef port-number { + type uint16 { + range "0..65535"; + } + description + "The port-number type represents a 16-bit port number of an + Internet transport layer protocol such as UDP, TCP, DCCP, or + SCTP. Port numbers are assigned by IANA. A current list of + all assignments is available from <http://www.iana.org/>. + + Note that the port number value zero is reserved by IANA. In + situations where the value zero does not make sense, it can + be excluded by subtyping the port-number type. + + In the value set and its semantics, this type is equivalent + to the InetPortNumber textual convention of the SMIv2."; + reference + "RFC 768: User Datagram Protocol + RFC 793: Transmission Control Protocol + RFC 4960: Stream Control Transmission Protocol + RFC 4340: Datagram Congestion Control Protocol (DCCP) + RFC 4001: Textual Conventions for Internet Network Addresses"; + } + + /*** collection of autonomous system related types ***/ + + typedef as-number { + type uint32; + description + "The as-number type represents autonomous system numbers + which identify an Autonomous System (AS). An AS is a set + of routers under a single technical administration, using + an interior gateway protocol and common metrics to route + packets within the AS, and using an exterior gateway + protocol to route packets to other ASs'. IANA maintains + the AS number space and has delegated large parts to the + regional registries. + + Autonomous system numbers were originally limited to 16 + bits. BGP extensions have enlarged the autonomous system + number space to 32 bits. This type therefore uses an uint32 + base type without a range restriction in order to support + a larger autonomous system number space. + + In the value set and its semantics, this type is equivalent + to the InetAutonomousSystemNumber textual convention of + the SMIv2."; + reference + "RFC 1930: Guidelines for creation, selection, and registration + of an Autonomous System (AS) + RFC 4271: A Border Gateway Protocol 4 (BGP-4) + RFC 4893: BGP Support for Four-octet AS Number Space + RFC 4001: Textual Conventions for Internet Network Addresses"; + } + + /*** collection of IP address and hostname related types ***/ + + typedef ip-address { + type union { + type inet:ipv4-address; + type inet:ipv6-address; + } + description + "The ip-address type represents an IP address and is IP + version neutral. The format of the textual representations + implies the IP version."; + } + + typedef ipv4-address { + type string { + 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])' + + '(%[\p{N}\p{L}]+)?'; + } + description + "The ipv4-address type represents an IPv4 address in + dotted-quad notation. The IPv4 address may include a zone + index, separated by a % sign. + + The zone index is used to disambiguate identical address + values. For link-local addresses, the zone index will + typically be the interface index number or the name of an + interface. If the zone index is not present, the default + zone of the device will be used. + + The canonical format for the zone index is the numerical + format"; + } + + typedef ipv6-address { + type string { + pattern '((:|[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}]+)?'; + pattern '(([^:]+:){6}(([^:]+:[^:]+)|(.*\..*)))|' + + '((([^:]+:)*[^:]+)?::(([^:]+:)*[^:]+)?)' + + '(%.+)?'; + } + description + "The ipv6-address type represents an IPv6 address in full, + mixed, shortened, and shortened-mixed notation. The IPv6 + address may include a zone index, separated by a % sign. + + The zone index is used to disambiguate identical address + values. For link-local addresses, the zone index will + typically be the interface index number or the name of an + interface. If the zone index is not present, the default + zone of the device will be used. + + The canonical format of IPv6 addresses uses the compressed + format described in RFC 4291, Section 2.2, item 2 with the + following additional rules: the :: substitution must be + applied to the longest sequence of all-zero 16-bit chunks + in an IPv6 address. If there is a tie, the first sequence + of all-zero 16-bit chunks is replaced by ::. Single + all-zero 16-bit chunks are not compressed. The canonical + format uses lowercase characters and leading zeros are + not allowed. The canonical format for the zone index is + the numerical format as described in RFC 4007, Section + 11.2."; + reference + "RFC 4291: IP Version 6 Addressing Architecture + RFC 4007: IPv6 Scoped Address Architecture + RFC 5952: A Recommendation for IPv6 Address Text Representation"; + } + + typedef ip-prefix { + type union { + type inet:ipv4-prefix; + type inet:ipv6-prefix; + } + description + "The ip-prefix type represents an IP prefix and is IP + version neutral. The format of the textual representations + implies the IP version."; + } + + typedef ipv4-prefix { + type string { + 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])' + + '/(([0-9])|([1-2][0-9])|(3[0-2]))'; + } + description + "The ipv4-prefix type represents an IPv4 address prefix. + The prefix length is given by the number following the + slash character and must be less than or equal to 32. + + A prefix length value of n corresponds to an IP address + mask that has n contiguous 1-bits from the most + significant bit (MSB) and all other bits set to 0. + + The canonical format of an IPv4 prefix has all bits of + the IPv4 address set to zero that are not part of the + IPv4 prefix."; + } + + typedef ipv6-prefix { + type string { + pattern '((:|[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])))'; + pattern '(([^:]+:){6}(([^:]+:[^:]+)|(.*\..*)))|' + + '((([^:]+:)*[^:]+)?::(([^:]+:)*[^:]+)?)' + + '(/.+)'; + } + description + "The ipv6-prefix type represents an IPv6 address prefix. + The prefix length is given by the number following the + slash character and must be less than or equal 128. + + A prefix length value of n corresponds to an IP address + mask that has n contiguous 1-bits from the most + significant bit (MSB) and all other bits set to 0. + + The IPv6 address should have all bits that do not belong + to the prefix set to zero. + + The canonical format of an IPv6 prefix has all bits of + the IPv6 address set to zero that are not part of the + IPv6 prefix. Furthermore, IPv6 address is represented + in the compressed format described in RFC 4291, Section + 2.2, item 2 with the following additional rules: the :: + substitution must be applied to the longest sequence of + all-zero 16-bit chunks in an IPv6 address. If there is + a tie, the first sequence of all-zero 16-bit chunks is + replaced by ::. Single all-zero 16-bit chunks are not + compressed. The canonical format uses lowercase + characters and leading zeros are not allowed."; + reference + "RFC 4291: IP Version 6 Addressing Architecture"; + } + + /*** collection of domain name and URI types ***/ + + typedef domain-name { + type string { + pattern '((([a-zA-Z0-9_]([a-zA-Z0-9\-_]){0,61})?[a-zA-Z0-9]\.)*' + + '([a-zA-Z0-9_]([a-zA-Z0-9\-_]){0,61})?[a-zA-Z0-9]\.?)' + + '|\.'; + length "1..253"; + } + description + "The domain-name type represents a DNS domain name. The + name SHOULD be fully qualified whenever possible. + + Internet domain names are only loosely specified. Section + 3.5 of RFC 1034 recommends a syntax (modified in Section + 2.1 of RFC 1123). The pattern above is intended to allow + for current practice in domain name use, and some possible + future expansion. It is designed to hold various types of + domain names, including names used for A or AAAA records + (host names) and other records, such as SRV records. Note + that Internet host names have a stricter syntax (described + in RFC 952) than the DNS recommendations in RFCs 1034 and + 1123, and that systems that want to store host names in + schema nodes using the domain-name type are recommended to + adhere to this stricter standard to ensure interoperability. + + The encoding of DNS names in the DNS protocol is limited + to 255 characters. Since the encoding consists of labels + prefixed by a length bytes and there is a trailing NULL + byte, only 253 characters can appear in the textual dotted + notation. + + The description clause of schema nodes using the domain-name + type MUST describe when and how these names are resolved to + IP addresses. Note that the resolution of a domain-name value + may require to query multiple DNS records (e.g., A for IPv4 + and AAAA for IPv6). The order of the resolution process and + which DNS record takes precedence can either be defined + explicitely or it may depend on the configuration of the + resolver. + + Domain-name values use the US-ASCII encoding. Their canonical + format uses lowercase US-ASCII characters. Internationalized + domain names MUST be encoded in punycode as described in RFC + 3492"; + reference + "RFC 952: DoD Internet Host Table Specification + RFC 1034: Domain Names - Concepts and Facilities + RFC 1123: Requirements for Internet Hosts -- Application + and Support + RFC 2782: A DNS RR for specifying the location of services + (DNS SRV) + RFC 3492: Punycode: A Bootstring encoding of Unicode for + Internationalized Domain Names in Applications + (IDNA) + RFC 5891: Internationalizing Domain Names in Applications + (IDNA): Protocol"; + } + + typedef host { + type union { + type inet:ip-address; + type inet:domain-name; + } + description + "The host type represents either an IP address or a DNS + domain name."; + } + + typedef uri { + type string; + description + "The uri type represents a Uniform Resource Identifier + (URI) as defined by STD 66. + + Objects using the uri type MUST be in US-ASCII encoding, + and MUST be normalized as described by RFC 3986 Sections + 6.2.1, 6.2.2.1, and 6.2.2.2. All unnecessary + percent-encoding is removed, and all case-insensitive + characters are set to lowercase except for hexadecimal + digits, which are normalized to uppercase as described in + Section 6.2.2.1. + + The purpose of this normalization is to help provide + unique URIs. Note that this normalization is not + sufficient to provide uniqueness. Two URIs that are + textually distinct after this normalization may still be + equivalent. + + Objects using the uri type may restrict the schemes that + they permit. For example, 'data:' and 'urn:' schemes + might not be appropriate. + + A zero-length URI is not a valid URI. This can be used to + express 'URI absent' where required. + + In the value set and its semantics, this type is equivalent + to the Uri SMIv2 textual convention defined in RFC 5017."; + reference + "RFC 3986: Uniform Resource Identifier (URI): Generic Syntax + RFC 3305: Report from the Joint W3C/IETF URI Planning Interest + Group: Uniform Resource Identifiers (URIs), URLs, + and Uniform Resource Names (URNs): Clarifications + and Recommendations + RFC 5017: MIB Textual Conventions for Uniform Resource + Identifiers (URIs)"; + } + + } diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/notifications/ietf-restconf-monitoring@2017-01-26.yang b/netconf/restconf/restconf-nb-bierman02/src/test/resources/notifications/ietf-restconf-monitoring@2017-01-26.yang new file mode 100644 index 0000000..55c3cb1 --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/notifications/ietf-restconf-monitoring@2017-01-26.yang @@ -0,0 +1,149 @@ +module ietf-restconf-monitoring { + namespace "urn:ietf:params:xml:ns:yang:ietf-restconf-monitoring"; + prefix "rcmon"; + + import ietf-yang-types { prefix yang; } + import ietf-inet-types { prefix inet; } + + organization + "IETF NETCONF (Network Configuration) Working Group"; + + contact + "WG Web: <https://datatracker.ietf.org/wg/netconf/> + WG List: <mailto:netconf@ietf.org> + + Author: Andy Bierman + <mailto:andy@yumaworks.com> + + Author: Martin Bjorklund + <mailto:mbj@tail-f.com> + + Author: Kent Watsen + <mailto:kwatsen@juniper.net>"; + + description + "This module contains monitoring information for the + RESTCONF protocol. + + Copyright (c) 2017 IETF Trust and the persons identified as + authors of the code. All rights reserved. + + Redistribution and use in source and binary forms, with or + without modification, is permitted pursuant to, and subject + to the license terms contained in, the Simplified BSD License + set forth in Section 4.c of the IETF Trust's Legal Provisions + Relating to IETF Documents + (http://trustee.ietf.org/license-info). + + This version of this YANG module is part of RFC 8040; see + the RFC itself for full legal notices."; + + revision 2017-01-26 { + description + "Initial revision."; + reference + "RFC 8040: RESTCONF Protocol."; + } + + container restconf-state { + config false; + description + "Contains RESTCONF protocol monitoring information."; + + container capabilities { + description + "Contains a list of protocol capability URIs."; + + leaf-list capability { + type inet:uri; + description + "A RESTCONF protocol capability URI."; + } + } + + container streams { + description + "Container representing the notification event streams + supported by the server."; + reference + "RFC 5277, Section 3.4, <streams> element."; + + list stream { + key name; + description + "Each entry describes an event stream supported by + the server."; + + leaf name { + type string; + description + "The stream name."; + reference + "RFC 5277, Section 3.4, <name> element."; + } + + leaf description { + type string; + description + "Description of stream content."; + reference + "RFC 5277, Section 3.4, <description> element."; + } + + leaf replay-support { + type boolean; + default false; + description + "Indicates if replay buffer is supported for this stream. + If 'true', then the server MUST support the 'start-time' + and 'stop-time' query parameters for this stream."; + reference + "RFC 5277, Section 3.4, <replaySupport> element."; + } + + leaf replay-log-creation-time { + when "../replay-support" { + description + "Only present if notification replay is supported."; + } + type yang:date-and-time; + description + "Indicates the time the replay log for this stream + was created."; + reference + "RFC 5277, Section 3.4, <replayLogCreationTime> + element."; + } + + list access { + key encoding; + min-elements 1; + description + "The server will create an entry in this list for each + encoding format that is supported for this stream. + The media type 'text/event-stream' is expected + for all event streams. This list identifies the + subtypes supported for this stream."; + + leaf encoding { + type string; + description + "This is the secondary encoding format within the + 'text/event-stream' encoding used by all streams. + The type 'xml' is supported for XML encoding. + The type 'json' is supported for JSON encoding."; + } + + leaf location { + type inet:uri; + mandatory true; + description + "Contains a URL that represents the entry point + for establishing notification delivery via + server-sent events."; + } + } + } + } + } +} diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/notifications/ietf-yang-library@2016-06-21.yang b/netconf/restconf/restconf-nb-bierman02/src/test/resources/notifications/ietf-yang-library@2016-06-21.yang new file mode 100644 index 0000000..bc466ee --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/notifications/ietf-yang-library@2016-06-21.yang @@ -0,0 +1,208 @@ +module ietf-yang-library { + namespace "urn:ietf:params:xml:ns:yang:ietf-yang-library"; + prefix "yanglib"; + import ietf-yang-types { + prefix yang; + } + import ietf-inet-types { + prefix inet; + } + organization + "IETF NETCONF (Network Configuration) Working Group"; + contact + "WG Web: <https://datatracker.ietf.org/wg/netconf/> + WG List: <mailto:netconf@ietf.org> + WG Chair: Mehmet Ersue + <mailto:mehmet.ersue@nsn.com> + WG Chair: Mahesh Jethanandani + <mailto:mjethanandani@gmail.com> + Editor: Andy Bierman + <mailto:andy@yumaworks.com> + Editor: Martin Bjorklund + <mailto:mbj@tail-f.com> + Editor: Kent Watsen + <mailto:kwatsen@juniper.net>"; + description + "This module contains monitoring information about the YANG + modules and submodules that are used within a YANG-based + server. + Copyright (c) 2016 IETF Trust and the persons identified as + authors of the code. All rights reserved. + Redistribution and use in source and binary forms, with or + without modification, is permitted pursuant to, and subject + to the license terms contained in, the Simplified BSD License + set forth in Section 4.c of the IETF Trust's Legal Provisions + Relating to IETF Documents + (http://trustee.ietf.org/license-info). + This version of this YANG module is part of RFC 7895; see + the RFC itself for full legal notices."; + revision 2016-06-21 { + description + "Initial revision."; + reference + "RFC 7895: YANG Module Library."; + } + /* + * Typedefs + */ + typedef revision-identifier { + type string { + pattern '\d{4}-\d{2}-\d{2}'; + } + description + "Represents a specific date in YYYY-MM-DD format."; + } + /* + * Groupings + */ + grouping module-list { + description + "The module data structure is represented as a grouping + so it can be reused in configuration or another monitoring + data structure."; + grouping common-leafs { + description + "Common parameters for YANG modules and submodules."; + leaf name { + type yang:yang-identifier; + description + "The YANG module or submodule name."; + } + leaf revision { + type union { + type revision-identifier; + type string { length 0; } + } + description + "The YANG module or submodule revision date. + A zero-length string is used if no revision statement + is present in the YANG module or submodule."; + } + } + grouping schema-leaf { + description + "Common schema leaf parameter for modules and submodules."; + leaf schema { + type inet:uri; + description + "Contains a URL that represents the YANG schema + resource for this module or submodule. + This leaf will only be present if there is a URL + available for retrieval of the schema for this entry."; + } + } + list module { + key "name revision"; + description + "Each entry represents one revision of one module + currently supported by the server."; + uses common-leafs; + uses schema-leaf; + leaf namespace { + type inet:uri; + mandatory true; + description + "The XML namespace identifier for this module."; + } + leaf-list feature { + type yang:yang-identifier; + description + "List of YANG feature names from this module that are + supported by the server, regardless of whether they are + defined in the module or any included submodule."; + } + list deviation { + key "name revision"; + description + "List of YANG deviation module names and revisions + used by this server to modify the conformance of + the module associated with this entry. Note that + the same module can be used for deviations for + multiple modules, so the same entry MAY appear + within multiple 'module' entries. + The deviation module MUST be present in the 'module' + list, with the same name and revision values. + The 'conformance-type' value will be 'implement' for + the deviation module."; + uses common-leafs; + } + leaf conformance-type { + type enumeration { + enum implement { + description + "Indicates that the server implements one or more + protocol-accessible objects defined in the YANG module + identified in this entry. This includes deviation + statements defined in the module. + For YANG version 1.1 modules, there is at most one + module entry with conformance type 'implement' for a + particular module name, since YANG 1.1 requires that, + at most, one revision of a module is implemented. + For YANG version 1 modules, there SHOULD NOT be more + than one module entry for a particular module name."; + } + enum import { + description + "Indicates that the server imports reusable definitions + from the specified revision of the module but does + not implement any protocol-accessible objects from + this revision. + Multiple module entries for the same module name MAY + exist. This can occur if multiple modules import the + same module but specify different revision dates in + the import statements."; + } + } + mandatory true; + description + "Indicates the type of conformance the server is claiming + for the YANG module identified by this entry."; + } + list submodule { + key "name revision"; + description + "Each entry represents one submodule within the + parent module."; + uses common-leafs; + uses schema-leaf; + } + } + } + /* + * Operational state data nodes + */ + container modules-state { + config false; + description + "Contains YANG module monitoring information."; + leaf module-set-id { + type string; + mandatory true; + description + "Contains a server-specific identifier representing + the current set of modules and submodules. The + server MUST change the value of this leaf if the + information represented by the 'module' list instances + has changed."; + } + uses module-list; + } + /* + * Notifications + */ + notification yang-library-change { + description + "Generated when the set of modules and submodules supported + by the server has changed."; + leaf module-set-id { + type leafref { + path "/yanglib:modules-state/yanglib:module-set-id"; + } + mandatory true; + description + "Contains the module-set-id value representing the + set of modules and submodules supported at the server at + the time the notification is generated."; + } + } +} diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/notifications/ietf-yang-types.yang b/netconf/restconf/restconf-nb-bierman02/src/test/resources/notifications/ietf-yang-types.yang new file mode 100644 index 0000000..c3f952c --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/notifications/ietf-yang-types.yang @@ -0,0 +1,417 @@ + module ietf-yang-types { + + namespace "urn:ietf:params:xml:ns:yang:ietf-yang-types"; + prefix "yang"; + + organization + "IETF NETMOD (NETCONF Data Modeling Language) Working Group"; + + contact + "WG Web: <http://tools.ietf.org/wg/netmod/> + WG List: <mailto:netmod@ietf.org> + + WG Chair: David Partain + <mailto:david.partain@ericsson.com> + + WG Chair: David Kessens + <mailto:david.kessens@nsn.com> + + Editor: Juergen Schoenwaelder + <mailto:j.schoenwaelder@jacobs-university.de>"; + + description + "This module contains a collection of generally useful derived + YANG data types. + + Copyright (c) 2010 IETF Trust and the persons identified as + authors of the code. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, is permitted pursuant to, and subject to the license + terms contained in, the Simplified BSD License set forth in Section + 4.c of the IETF Trust's Legal Provisions Relating to IETF Documents + (http://trustee.ietf.org/license-info). + + This version of this YANG module is part of RFC 6021; see + the RFC itself for full legal notices."; + + revision 2010-09-24 { + description + "Initial revision."; + reference + "RFC 6021: Common YANG Data Types"; + } + + /*** collection of counter and gauge types ***/ + + typedef counter32 { + type uint32; + description + "The counter32 type represents a non-negative integer + that monotonically increases until it reaches a + maximum value of 2^32-1 (4294967295 decimal), when it + wraps around and starts increasing again from zero. + + Counters have no defined 'initial' value, and thus, a + single value of a counter has (in general) no information + content. Discontinuities in the monotonically increasing + value normally occur at re-initialization of the + management system, and at other times as specified in the + description of a schema node using this type. If such + other times can occur, for example, the creation of + a schema node of type counter32 at times other than + re-initialization, then a corresponding schema node + should be defined, with an appropriate type, to indicate + the last discontinuity. + + The counter32 type should not be used for configuration + schema nodes. A default statement SHOULD NOT be used in + combination with the type counter32. + + In the value set and its semantics, this type is equivalent + to the Counter32 type of the SMIv2."; + reference + "RFC 2578: Structure of Management Information Version 2 (SMIv2)"; + } + + typedef zero-based-counter32 { + type yang:counter32; + default "0"; + description + "The zero-based-counter32 type represents a counter32 + that has the defined 'initial' value zero. + + A schema node of this type will be set to zero (0) on creation + and will thereafter increase monotonically until it reaches + a maximum value of 2^32-1 (4294967295 decimal), when it + wraps around and starts increasing again from zero. + + Provided that an application discovers a new schema node + of this type within the minimum time to wrap, it can use the + 'initial' value as a delta. It is important for a management + station to be aware of this minimum time and the actual time + between polls, and to discard data if the actual time is too + long or there is no defined minimum time. + + In the value set and its semantics, this type is equivalent + to the ZeroBasedCounter32 textual convention of the SMIv2."; + reference + "RFC 4502: Remote Network Monitoring Management Information + Base Version 2"; + } + + typedef counter64 { + type uint64; + description + "The counter64 type represents a non-negative integer + that monotonically increases until it reaches a + maximum value of 2^64-1 (18446744073709551615 decimal), + when it wraps around and starts increasing again from zero. + + Counters have no defined 'initial' value, and thus, a + single value of a counter has (in general) no information + content. Discontinuities in the monotonically increasing + value normally occur at re-initialization of the + management system, and at other times as specified in the + description of a schema node using this type. If such + other times can occur, for example, the creation of + a schema node of type counter64 at times other than + re-initialization, then a corresponding schema node + should be defined, with an appropriate type, to indicate + the last discontinuity. + + The counter64 type should not be used for configuration + schema nodes. A default statement SHOULD NOT be used in + combination with the type counter64. + + In the value set and its semantics, this type is equivalent + to the Counter64 type of the SMIv2."; + reference + "RFC 2578: Structure of Management Information Version 2 (SMIv2)"; + } + + typedef zero-based-counter64 { + type yang:counter64; + default "0"; + description + "The zero-based-counter64 type represents a counter64 that + has the defined 'initial' value zero. + + A schema node of this type will be set to zero (0) on creation + and will thereafter increase monotonically until it reaches + a maximum value of 2^64-1 (18446744073709551615 decimal), + when it wraps around and starts increasing again from zero. + + Provided that an application discovers a new schema node + of this type within the minimum time to wrap, it can use the + 'initial' value as a delta. It is important for a management + station to be aware of this minimum time and the actual time + between polls, and to discard data if the actual time is too + long or there is no defined minimum time. + + In the value set and its semantics, this type is equivalent + to the ZeroBasedCounter64 textual convention of the SMIv2."; + reference + "RFC 2856: Textual Conventions for Additional High Capacity + Data Types"; + } + + typedef gauge32 { + type uint32; + description + "The gauge32 type represents a non-negative integer, which + may increase or decrease, but shall never exceed a maximum + value, nor fall below a minimum value. The maximum value + cannot be greater than 2^32-1 (4294967295 decimal), and + the minimum value cannot be smaller than 0. The value of + a gauge32 has its maximum value whenever the information + being modeled is greater than or equal to its maximum + value, and has its minimum value whenever the information + being modeled is smaller than or equal to its minimum value. + If the information being modeled subsequently decreases + below (increases above) the maximum (minimum) value, the + gauge32 also decreases (increases). + + In the value set and its semantics, this type is equivalent + to the Gauge32 type of the SMIv2."; + reference + "RFC 2578: Structure of Management Information Version 2 (SMIv2)"; + } + + typedef gauge64 { + type uint64; + description + "The gauge64 type represents a non-negative integer, which + may increase or decrease, but shall never exceed a maximum + value, nor fall below a minimum value. The maximum value + cannot be greater than 2^64-1 (18446744073709551615), and + the minimum value cannot be smaller than 0. The value of + a gauge64 has its maximum value whenever the information + being modeled is greater than or equal to its maximum + value, and has its minimum value whenever the information + being modeled is smaller than or equal to its minimum value. + If the information being modeled subsequently decreases + below (increases above) the maximum (minimum) value, the + gauge64 also decreases (increases). + + In the value set and its semantics, this type is equivalent + to the CounterBasedGauge64 SMIv2 textual convention defined + in RFC 2856"; + reference + "RFC 2856: Textual Conventions for Additional High Capacity + Data Types"; + } + + /*** collection of identifier related types ***/ + + typedef object-identifier { + type string { + pattern '(([0-1](\.[1-3]?[0-9]))|(2\.(0|([1-9]\d*))))' + + '(\.(0|([1-9]\d*)))*'; + } + description + "The object-identifier type represents administratively + assigned names in a registration-hierarchical-name tree. + + Values of this type are denoted as a sequence of numerical + non-negative sub-identifier values. Each sub-identifier + value MUST NOT exceed 2^32-1 (4294967295). Sub-identifiers + are separated by single dots and without any intermediate + whitespace. + + The ASN.1 standard restricts the value space of the first + sub-identifier to 0, 1, or 2. Furthermore, the value space + of the second sub-identifier is restricted to the range + 0 to 39 if the first sub-identifier is 0 or 1. Finally, + the ASN.1 standard requires that an object identifier + has always at least two sub-identifier. The pattern + captures these restrictions. + + Although the number of sub-identifiers is not limited, + module designers should realize that there may be + implementations that stick with the SMIv2 limit of 128 + sub-identifiers. + + This type is a superset of the SMIv2 OBJECT IDENTIFIER type + since it is not restricted to 128 sub-identifiers. Hence, + this type SHOULD NOT be used to represent the SMIv2 OBJECT + IDENTIFIER type, the object-identifier-128 type SHOULD be + used instead."; + reference + "ISO9834-1: Information technology -- Open Systems + Interconnection -- Procedures for the operation of OSI + Registration Authorities: General procedures and top + arcs of the ASN.1 Object Identifier tree"; + } + + + + + typedef object-identifier-128 { + type object-identifier { + pattern '\d*(\.\d*){1,127}'; + } + description + "This type represents object-identifiers restricted to 128 + sub-identifiers. + + In the value set and its semantics, this type is equivalent + to the OBJECT IDENTIFIER type of the SMIv2."; + reference + "RFC 2578: Structure of Management Information Version 2 (SMIv2)"; + } + + typedef yang-identifier { + type string { + length "1..max"; + pattern '[a-zA-Z_][a-zA-Z0-9\-_.]*'; + pattern '.|..|[^xX].*|.[^mM].*|..[^lL].*'; + } + description + "A YANG identifier string as defined by the 'identifier' + rule in Section 12 of RFC 6020. An identifier must + start with an alphabetic character or an underscore + followed by an arbitrary sequence of alphabetic or + numeric characters, underscores, hyphens, or dots. + + A YANG identifier MUST NOT start with any possible + combination of the lowercase or uppercase character + sequence 'xml'."; + reference + "RFC 6020: YANG - A Data Modeling Language for the Network + Configuration Protocol (NETCONF)"; + } + + /*** collection of date and time related types ***/ + + typedef date-and-time { + type string { + pattern '\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d+)?' + + '(Z|[\+\-]\d{2}:\d{2})'; + } + description + "The date-and-time type is a profile of the ISO 8601 + standard for representation of dates and times using the + Gregorian calendar. The profile is defined by the + date-time production in Section 5.6 of RFC 3339. + + The date-and-time type is compatible with the dateTime XML + schema type with the following notable exceptions: + + (a) The date-and-time type does not allow negative years. + + (b) The date-and-time time-offset -00:00 indicates an unknown + time zone (see RFC 3339) while -00:00 and +00:00 and Z all + represent the same time zone in dateTime. + + (c) The canonical format (see below) of data-and-time values + differs from the canonical format used by the dateTime XML + schema type, which requires all times to be in UTC using the + time-offset 'Z'. + + This type is not equivalent to the DateAndTime textual + convention of the SMIv2 since RFC 3339 uses a different + separator between full-date and full-time and provides + higher resolution of time-secfrac. + + The canonical format for date-and-time values with a known time + zone uses a numeric time zone offset that is calculated using + the device's configured known offset to UTC time. A change of + the device's offset to UTC time will cause date-and-time values + to change accordingly. Such changes might happen periodically + in case a server follows automatically daylight saving time + (DST) time zone offset changes. The canonical format for + date-and-time values with an unknown time zone (usually referring + to the notion of local time) uses the time-offset -00:00."; + reference + "RFC 3339: Date and Time on the Internet: Timestamps + RFC 2579: Textual Conventions for SMIv2 + XSD-TYPES: XML Schema Part 2: Datatypes Second Edition"; + } + + typedef timeticks { + type uint32; + description + "The timeticks type represents a non-negative integer that + represents the time, modulo 2^32 (4294967296 decimal), in + hundredths of a second between two epochs. When a schema + node is defined that uses this type, the description of + the schema node identifies both of the reference epochs. + + In the value set and its semantics, this type is equivalent + to the TimeTicks type of the SMIv2."; + reference + "RFC 2578: Structure of Management Information Version 2 (SMIv2)"; + } + + typedef timestamp { + type yang:timeticks; + description + "The timestamp type represents the value of an associated + timeticks schema node at which a specific occurrence happened. + The specific occurrence must be defined in the description + of any schema node defined using this type. When the specific + occurrence occurred prior to the last time the associated + timeticks attribute was zero, then the timestamp value is + zero. Note that this requires all timestamp values to be + reset to zero when the value of the associated timeticks + attribute reaches 497+ days and wraps around to zero. + + The associated timeticks schema node must be specified + in the description of any schema node using this type. + + In the value set and its semantics, this type is equivalent + to the TimeStamp textual convention of the SMIv2."; + reference + "RFC 2579: Textual Conventions for SMIv2"; + } + + /*** collection of generic address types ***/ + + typedef phys-address { + type string { + pattern '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'; + } + description + "Represents media- or physical-level addresses represented + as a sequence octets, each octet represented by two hexadecimal + numbers. Octets are separated by colons. The canonical + representation uses lowercase characters. + + In the value set and its semantics, this type is equivalent + to the PhysAddress textual convention of the SMIv2."; + reference + "RFC 2579: Textual Conventions for SMIv2"; + } + + typedef mac-address { + type string { + pattern '[0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){5}'; + } + description + "The mac-address type represents an IEEE 802 MAC address. + The canonical representation uses lowercase characters. + + In the value set and its semantics, this type is equivalent + to the MacAddress textual convention of the SMIv2."; + reference + "IEEE 802: IEEE Standard for Local and Metropolitan Area + Networks: Overview and Architecture + RFC 2579: Textual Conventions for SMIv2"; + } + + /*** collection of XML specific types ***/ + + typedef xpath1.0 { + type string; + description + "This type represents an XPATH 1.0 expression. + + When a schema node is defined that uses this type, the + description of the schema node MUST specify the XPath + context in which the XPath expression is evaluated."; + reference + "XPATH: XML Path Language (XPath) Version 1.0"; + } + + } diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/notifications/notifi-module.yang b/netconf/restconf/restconf-nb-bierman02/src/test/resources/notifications/notifi-module.yang new file mode 100644 index 0000000..e9c0e4b --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/notifications/notifi-module.yang @@ -0,0 +1,49 @@ +module notifi-module { + namespace "notifi:mod"; + prefix notm; + + revision "2016-11-23" { + } + + notification notifi-leaf { + leaf lf { + type string; + } + } + + notification notifi-cont { + container cont { + leaf lf { + type string; + } + } + } + + notification notifi-list { + list lst { + key lf; + leaf lf { + type string; + } + } + } + + notification notifi-grp { + uses grp; + } + + grouping grp { + leaf lf { + type string; + } + } + + notification notifi-augm { + } + + augment /notifi-augm { + leaf lf-augm { + type string; + } + } +} diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/notifications/subscribe-to-notification.yang b/netconf/restconf/restconf-nb-bierman02/src/test/resources/notifications/subscribe-to-notification.yang new file mode 100644 index 0000000..5fe7df7 --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/notifications/subscribe-to-notification.yang @@ -0,0 +1,18 @@ +module subscribe-to-notification { + + yang-version 1; + namespace "subscribe:to:notification"; + prefix "subs-to-notifi"; + + description + "Added input parameters to rpc create-data-change-event-subscription and to create-notification-stream"; + + revision "2016-10-28" { + } + + container "notifi"{ + leaf "location"{ + type string; + } + } +} diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/notifications/toaster.yang b/netconf/restconf/restconf-nb-bierman02/src/test/resources/notifications/toaster.yang new file mode 100644 index 0000000..da68016 --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/notifications/toaster.yang @@ -0,0 +1,200 @@ +module toaster { + + yang-version 1; + + namespace + "http://netconfcentral.org/ns/toaster"; + + prefix toast; + + organization "Netconf Central"; + + contact + "Andy Bierman <andy@netconfcentral.org>"; + + description + "YANG version of the TOASTER-MIB."; + + revision "2009-11-20" { + description + "Toaster module in progress."; + } + + + identity toast-type { + description + "Base for all bread types supported by the toaster. + New bread types not listed here nay be added in the + future."; + } + + identity white-bread { + base toast:toast-type; + description "White bread."; + } + + identity wheat-bread { + base toast-type; + description "Wheat bread."; + } + + identity wonder-bread { + base toast-type; + description "Wonder bread."; + } + + identity frozen-waffle { + base toast-type; + description "Frozen waffle."; + } + + identity frozen-bagel { + base toast-type; + description "Frozen bagel."; + } + + identity hash-brown { + base toast-type; + description "Hash browned potatos."; + } + + typedef DisplayString { + type string { + length "0 .. 255"; + } + description + "YANG version of the SMIv2 DisplayString TEXTUAL-CONVENTION."; + reference + "RFC 2579, section 2."; + + } + + container toaster { + presence + "Indicates the toaster service is available"; + description + "Top-level container for all toaster database objects."; + leaf toasterManufacturer { + type DisplayString; + config false; + mandatory true; + description + "The name of the toaster's manufacturer. For instance, + Microsoft Toaster."; + } + + leaf toasterModelNumber { + type DisplayString; + config false; + mandatory true; + description + "The name of the toaster's model. For instance, + Radiant Automatic."; + } + + leaf toasterStatus { + type enumeration { + enum "up" { + value 1; + description + "The toaster knob position is up. + No toast is being made now."; + } + enum "down" { + value 2; + description + "The toaster knob position is down. + Toast is being made now."; + } + } + config false; + mandatory true; + description + "This variable indicates the current state of + the toaster."; + } + + leaf darknessFactor { + type uint32; + config true; + default 1000; + description + "The darkness factor. Basically, the number of ms to multiple the doneness value by."; + } + } // container toaster + + rpc make-toast { + description + "Make some toast. + The toastDone notification will be sent when + the toast is finished. + An 'in-use' error will be returned if toast + is already being made. + A 'resource-denied' error will be returned + if the toaster service is disabled."; + input { + leaf toasterDoneness { + type uint32 { + range "1 .. 10"; + } + default '5'; + description + "This variable controls how well-done is the + ensuing toast. It should be on a scale of 1 to 10. + Toast made at 10 generally is considered unfit + for human consumption; toast made at 1 is warmed + lightly."; + } + + leaf toasterToastType { + type identityref { + base toast:toast-type; + } + default 'wheat-bread'; + description + "This variable informs the toaster of the type of + material that is being toasted. The toaster + uses this information, combined with + toasterDoneness, to compute for how + long the material must be toasted to achieve + the required doneness."; + } + } + } // rpc make-toast + + rpc cancel-toast { + description + "Stop making toast, if any is being made. + A 'resource-denied' error will be returned + if the toaster service is disabled."; + } // rpc cancel-toast + + rpc restock-toaster { + description + "Restocks the toaster with the amount of bread specified."; + + input { + leaf amountOfBreadToStock { + type uint32; + description + "Indicates the amount of bread to re-stock"; + } + } + } + + notification toasterOutOfBread { + description + "Indicates that the toaster has run of out bread."; + } // notification toasterOutOfStock + + notification toasterRestocked { + description + "Indicates that the toaster has run of out bread."; + leaf amountOfBread { + type uint32; + description + "Indicates the amount of bread that was re-stocked"; + } + } // notification toasterOutOfStock + + } // module toaster
\ No newline at end of file diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/notifications/xml/output/data_change_notification_toaster_status_DOWN.xml b/netconf/restconf/restconf-nb-bierman02/src/test/resources/notifications/xml/output/data_change_notification_toaster_status_DOWN.xml new file mode 100644 index 0000000..43babd2 --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/notifications/xml/output/data_change_notification_toaster_status_DOWN.xml @@ -0,0 +1,13 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<notification xmlns="urn:ietf:params:xml:ns:netconf:notification:1.0"> + <eventTime>2016-11-10T04:45:31+01:00</eventTime> + <data-changed-notification xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:remote"> + <data-change-event> + <path>/toaster:toaster/toaster:toasterStatus</path> + <operation>updated</operation> + <data> + <toasterStatus xmlns="http://netconfcentral.org/ns/toaster">down</toasterStatus> + </data> + </data-change-event> + </data-changed-notification> +</notification>
\ No newline at end of file diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/notifications/xml/output/data_change_notification_toaster_status_NUMBER.xml b/netconf/restconf/restconf-nb-bierman02/src/test/resources/notifications/xml/output/data_change_notification_toaster_status_NUMBER.xml new file mode 100644 index 0000000..8a4a866 --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/notifications/xml/output/data_change_notification_toaster_status_NUMBER.xml @@ -0,0 +1,13 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<notification xmlns="urn:ietf:params:xml:ns:netconf:notification:1.0"> + <eventTime>2016-11-10T04:45:31+01:00</eventTime> + <data-changed-notification xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:remote"> + <data-change-event> + <path>/toaster:toaster/toaster:toasterStatus</path> + <operation>updated</operation> + <data> + <toasterStatus xmlns="http://netconfcentral.org/ns/toaster">1</toasterStatus> + </data> + </data-change-event> + </data-changed-notification> +</notification>
\ No newline at end of file diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/ordered/by/user/ordered-by-user-example.yang b/netconf/restconf/restconf-nb-bierman02/src/test/resources/ordered/by/user/ordered-by-user-example.yang new file mode 100644 index 0000000..2684336 --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/ordered/by/user/ordered-by-user-example.yang @@ -0,0 +1,44 @@ +module ordered-example { + namespace "ordered:example"; + prefix "oex"; + + revision 2016-11-13 { + description + "Initial revision."; + } + + container cont { + list playlist { + key name; + + leaf name { + type string; + } + list song { + key index; + ordered-by user; + + leaf index { + type uint32; + } + leaf id { + type instance-identifier; + mandatory true; + description + "Song identifier. Must identify an instance of + /songs-cont/songs/song-name."; + } + } + } + } + + container songs-cont{ + list songs{ + key song-name; + + leaf song-name{ + type string; + } + } + } +}
\ No newline at end of file diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/parser-identifier/invoke-rpc-module.yang b/netconf/restconf/restconf-nb-bierman02/src/test/resources/parser-identifier/invoke-rpc-module.yang new file mode 100644 index 0000000..7a8bcff --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/parser-identifier/invoke-rpc-module.yang @@ -0,0 +1,26 @@ +module invoke-rpc-module { + namespace "invoke:rpc:module"; + prefix "inrpcmod"; + yang-version 1; + + revision 2017-05-23 { + description "Initial revision."; + } + + rpc rpc-test { + input { + container cont { + leaf lf { + type string; + } + } + } + output { + container cont-out { + leaf lf-out { + type string; + } + } + } + } +}
\ No newline at end of file diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/parser-identifier/mount-point.yang b/netconf/restconf/restconf-nb-bierman02/src/test/resources/parser-identifier/mount-point.yang new file mode 100644 index 0000000..02a468f --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/parser-identifier/mount-point.yang @@ -0,0 +1,17 @@ +module mount-point { + namespace "mount:point"; + prefix "mountp"; + yang-version 1; + + import parser-identifier-included { prefix pii; revision-date 2016-06-02; } + + revision 2016-06-02 { + description "Initial revision."; + } + + container mount-container { + leaf point-number { + type uint8; + } + } +}
\ No newline at end of file diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/parser-identifier/parser-identifier-test-included.yang b/netconf/restconf/restconf-nb-bierman02/src/test/resources/parser-identifier/parser-identifier-test-included.yang new file mode 100644 index 0000000..d5200a9 --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/parser-identifier/parser-identifier-test-included.yang @@ -0,0 +1,23 @@ +module parser-identifier-included { + namespace "parser:identifier:included"; + prefix "parseridinc"; + yang-version 1; + + revision 2016-06-02 { + description + "Initial revision."; + } + + list list-1 { + key "name revision"; + description "List in grouping"; + + leaf name { + type string; + } + + leaf revision { + type string; + } + } +}
\ No newline at end of file diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/parser-identifier/parser-identifier-test.yang b/netconf/restconf/restconf-nb-bierman02/src/test/resources/parser-identifier/parser-identifier-test.yang new file mode 100644 index 0000000..ac91dc1 --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/parser-identifier/parser-identifier-test.yang @@ -0,0 +1,40 @@ +module parser-identifier { + namespace "parser:identifier"; + prefix "parserid"; + yang-version 1; + + import parser-identifier-included { prefix pii; revision-date 2016-06-02; } + + revision 2016-06-02 { + description + "Initial revision."; + } + + container cont1 { + container cont2 { + list listTest { + uses group; + } + } + } + + grouping group { + list list-in-grouping { + key name; + + leaf name { + type string; + } + + leaf leaf-A.B { + type uint8; + } + } + } + + augment "/pii:list-1" { + leaf augment-leaf { + type string; + } + } +}
\ No newline at end of file diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/parser-identifier/test-module.yang b/netconf/restconf/restconf-nb-bierman02/src/test/resources/parser-identifier/test-module.yang new file mode 100644 index 0000000..a9a6756 --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/parser-identifier/test-module.yang @@ -0,0 +1,9 @@ +module test-module { + namespace "test:module"; + prefix "testm"; + yang-version 1; + + revision 2016-06-02 { + description "Initial revision."; + } +}
\ No newline at end of file diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/parts/ietf-interfaces_interfaces.json b/netconf/restconf/restconf-nb-bierman02/src/test/resources/parts/ietf-interfaces_interfaces.json new file mode 100644 index 0000000..0b39dc7 --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/parts/ietf-interfaces_interfaces.json @@ -0,0 +1,10 @@ +{ + "interface":[ + { + "name":"eth0", + "type":"ethernetCsmacd", + "enabled":false, + "description": "some interface" + } + ] +}
\ No newline at end of file diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/parts/ietf-interfaces_interfaces.xml b/netconf/restconf/restconf-nb-bierman02/src/test/resources/parts/ietf-interfaces_interfaces.xml new file mode 100644 index 0000000..19569b5 --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/parts/ietf-interfaces_interfaces.xml @@ -0,0 +1,6 @@ +<interface xmlns="urn:ietf:params:xml:ns:yang:ietf-interfaces"> + <name>eth0</name> + <type>ethernetCsmacd</type> + <enabled>false</enabled> + <description>some interface</description> +</interface> diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/parts/ietf-interfaces_interfaces2.xml b/netconf/restconf/restconf-nb-bierman02/src/test/resources/parts/ietf-interfaces_interfaces2.xml new file mode 100644 index 0000000..b4bdec8 --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/parts/ietf-interfaces_interfaces2.xml @@ -0,0 +1,5 @@ +<class xmlns="test:module"> + <name>xxx</name> + <address>bbb</address> + <email>ccc</email> +</class>
\ No newline at end of file diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/parts/ietf-interfaces_interfaces_absolute_path.json b/netconf/restconf/restconf-nb-bierman02/src/test/resources/parts/ietf-interfaces_interfaces_absolute_path.json new file mode 100644 index 0000000..7de7fac --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/parts/ietf-interfaces_interfaces_absolute_path.json @@ -0,0 +1,12 @@ +{ + "ietf-interfaces:interfaces":{ + "interface":[ + { + "name":"eth0", + "type":"ethernetCsmacd", + "enabled":false, + "description": "some interface" + } + ] + } +}
\ No newline at end of file diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/parts/ietf-interfaces_interfaces_absolute_path.xml b/netconf/restconf/restconf-nb-bierman02/src/test/resources/parts/ietf-interfaces_interfaces_absolute_path.xml new file mode 100644 index 0000000..313f32d --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/parts/ietf-interfaces_interfaces_absolute_path.xml @@ -0,0 +1,8 @@ +<interfaces xmlns="urn:ietf:params:xml:ns:yang:ietf-interfaces" > + <interface> + <name>eth0</name> + <type>ethernetCsmacd</type> + <enabled>false</enabled> + <description>some interface</description> + </interface> +</interfaces>
\ No newline at end of file diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/parts/ietf-interfaces_interfaces_absolute_path2.xml b/netconf/restconf/restconf-nb-bierman02/src/test/resources/parts/ietf-interfaces_interfaces_absolute_path2.xml new file mode 100644 index 0000000..77cb026 --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/parts/ietf-interfaces_interfaces_absolute_path2.xml @@ -0,0 +1,7 @@ + +<interface xmlns="urn:ietf:params:xml:ns:yang:ietf-interfaces"> + <name>eth0</name> + <type>ethernetCsmacd</type> + <enabled>false</enabled> + <description>some interface</description> +</interface> diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/parts/ietf-interfaces_interfaces_interface_absolute_path.xml b/netconf/restconf/restconf-nb-bierman02/src/test/resources/parts/ietf-interfaces_interfaces_interface_absolute_path.xml new file mode 100644 index 0000000..19569b5 --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/parts/ietf-interfaces_interfaces_interface_absolute_path.xml @@ -0,0 +1,6 @@ +<interface xmlns="urn:ietf:params:xml:ns:yang:ietf-interfaces"> + <name>eth0</name> + <type>ethernetCsmacd</type> + <enabled>false</enabled> + <description>some interface</description> +</interface> diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/parts/ietf-interfaces_interfaces_patch.json b/netconf/restconf/restconf-nb-bierman02/src/test/resources/parts/ietf-interfaces_interfaces_patch.json new file mode 100644 index 0000000..26b8f8d --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/parts/ietf-interfaces_interfaces_patch.json @@ -0,0 +1,22 @@ +{ + "ietf-restconf:yang-patch" : { + "patch-id" : "0", + "edit" : [ + { + "edit-id" : "edit1", + "operation" : "create", + "target" : "", + "value" : { + "interface":[ + { + "name":"eth0", + "type":"ethernetCsmacd", + "enabled":"false", + "description": "some interface" + } + ] + } + } + ] + } +}
\ No newline at end of file diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/restconf/impl/ietf-inet-types.yang b/netconf/restconf/restconf-nb-bierman02/src/test/resources/restconf/impl/ietf-inet-types.yang new file mode 100644 index 0000000..de20feb --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/restconf/impl/ietf-inet-types.yang @@ -0,0 +1,418 @@ + module ietf-inet-types { + + namespace "urn:ietf:params:xml:ns:yang:ietf-inet-types"; + prefix "inet"; + + organization + "IETF NETMOD (NETCONF Data Modeling Language) Working Group"; + + contact + "WG Web: <http://tools.ietf.org/wg/netmod/> + WG List: <mailto:netmod@ietf.org> + + WG Chair: David Partain + <mailto:david.partain@ericsson.com> + + WG Chair: David Kessens + <mailto:david.kessens@nsn.com> + + Editor: Juergen Schoenwaelder + <mailto:j.schoenwaelder@jacobs-university.de>"; + + description + "This module contains a collection of generally useful derived + YANG data types for Internet addresses and related things. + + Copyright (c) 2010 IETF Trust and the persons identified as + authors of the code. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, is permitted pursuant to, and subject to the license + terms contained in, the Simplified BSD License set forth in Section + 4.c of the IETF Trust's Legal Provisions Relating to IETF Documents + (http://trustee.ietf.org/license-info). + + This version of this YANG module is part of RFC 6021; see + the RFC itself for full legal notices."; + + revision 2010-09-24 { + description + "Initial revision."; + reference + "RFC 6021: Common YANG Data Types"; + } + + /*** collection of protocol field related types ***/ + + typedef ip-version { + type enumeration { + enum unknown { + value "0"; + description + "An unknown or unspecified version of the Internet protocol."; + } + enum ipv4 { + value "1"; + description + "The IPv4 protocol as defined in RFC 791."; + } + enum ipv6 { + value "2"; + description + "The IPv6 protocol as defined in RFC 2460."; + } + } + description + "This value represents the version of the IP protocol. + + In the value set and its semantics, this type is equivalent + to the InetVersion textual convention of the SMIv2."; + reference + "RFC 791: Internet Protocol + RFC 2460: Internet Protocol, Version 6 (IPv6) Specification + RFC 4001: Textual Conventions for Internet Network Addresses"; + } + + typedef dscp { + type uint8 { + range "0..63"; + } + description + "The dscp type represents a Differentiated Services Code-Point + that may be used for marking packets in a traffic stream. + + In the value set and its semantics, this type is equivalent + to the Dscp textual convention of the SMIv2."; + reference + "RFC 3289: Management Information Base for the Differentiated + Services Architecture + RFC 2474: Definition of the Differentiated Services Field + (DS Field) in the IPv4 and IPv6 Headers + RFC 2780: IANA Allocation Guidelines For Values In + the Internet Protocol and Related Headers"; + } + + typedef ipv6-flow-label { + type uint32 { + range "0..1048575"; + } + description + "The flow-label type represents flow identifier or Flow Label + in an IPv6 packet header that may be used to discriminate + traffic flows. + + In the value set and its semantics, this type is equivalent + to the IPv6FlowLabel textual convention of the SMIv2."; + reference + "RFC 3595: Textual Conventions for IPv6 Flow Label + RFC 2460: Internet Protocol, Version 6 (IPv6) Specification"; + } + + typedef port-number { + type uint16 { + range "0..65535"; + } + description + "The port-number type represents a 16-bit port number of an + Internet transport layer protocol such as UDP, TCP, DCCP, or + SCTP. Port numbers are assigned by IANA. A current list of + all assignments is available from <http://www.iana.org/>. + + Note that the port number value zero is reserved by IANA. In + situations where the value zero does not make sense, it can + be excluded by subtyping the port-number type. + + In the value set and its semantics, this type is equivalent + to the InetPortNumber textual convention of the SMIv2."; + reference + "RFC 768: User Datagram Protocol + RFC 793: Transmission Control Protocol + RFC 4960: Stream Control Transmission Protocol + RFC 4340: Datagram Congestion Control Protocol (DCCP) + RFC 4001: Textual Conventions for Internet Network Addresses"; + } + + /*** collection of autonomous system related types ***/ + + typedef as-number { + type uint32; + description + "The as-number type represents autonomous system numbers + which identify an Autonomous System (AS). An AS is a set + of routers under a single technical administration, using + an interior gateway protocol and common metrics to route + packets within the AS, and using an exterior gateway + protocol to route packets to other ASs'. IANA maintains + the AS number space and has delegated large parts to the + regional registries. + + Autonomous system numbers were originally limited to 16 + bits. BGP extensions have enlarged the autonomous system + number space to 32 bits. This type therefore uses an uint32 + base type without a range restriction in order to support + a larger autonomous system number space. + + In the value set and its semantics, this type is equivalent + to the InetAutonomousSystemNumber textual convention of + the SMIv2."; + reference + "RFC 1930: Guidelines for creation, selection, and registration + of an Autonomous System (AS) + RFC 4271: A Border Gateway Protocol 4 (BGP-4) + RFC 4893: BGP Support for Four-octet AS Number Space + RFC 4001: Textual Conventions for Internet Network Addresses"; + } + + /*** collection of IP address and hostname related types ***/ + + typedef ip-address { + type union { + type inet:ipv4-address; + type inet:ipv6-address; + } + description + "The ip-address type represents an IP address and is IP + version neutral. The format of the textual representations + implies the IP version."; + } + + typedef ipv4-address { + type string { + 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])' + + '(%[\p{N}\p{L}]+)?'; + } + description + "The ipv4-address type represents an IPv4 address in + dotted-quad notation. The IPv4 address may include a zone + index, separated by a % sign. + + The zone index is used to disambiguate identical address + values. For link-local addresses, the zone index will + typically be the interface index number or the name of an + interface. If the zone index is not present, the default + zone of the device will be used. + + The canonical format for the zone index is the numerical + format"; + } + + typedef ipv6-address { + type string { + pattern '((:|[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}]+)?'; + pattern '(([^:]+:){6}(([^:]+:[^:]+)|(.*\..*)))|' + + '((([^:]+:)*[^:]+)?::(([^:]+:)*[^:]+)?)' + + '(%.+)?'; + } + description + "The ipv6-address type represents an IPv6 address in full, + mixed, shortened, and shortened-mixed notation. The IPv6 + address may include a zone index, separated by a % sign. + + The zone index is used to disambiguate identical address + values. For link-local addresses, the zone index will + typically be the interface index number or the name of an + interface. If the zone index is not present, the default + zone of the device will be used. + + The canonical format of IPv6 addresses uses the compressed + format described in RFC 4291, Section 2.2, item 2 with the + following additional rules: the :: substitution must be + applied to the longest sequence of all-zero 16-bit chunks + in an IPv6 address. If there is a tie, the first sequence + of all-zero 16-bit chunks is replaced by ::. Single + all-zero 16-bit chunks are not compressed. The canonical + format uses lowercase characters and leading zeros are + not allowed. The canonical format for the zone index is + the numerical format as described in RFC 4007, Section + 11.2."; + reference + "RFC 4291: IP Version 6 Addressing Architecture + RFC 4007: IPv6 Scoped Address Architecture + RFC 5952: A Recommendation for IPv6 Address Text Representation"; + } + + typedef ip-prefix { + type union { + type inet:ipv4-prefix; + type inet:ipv6-prefix; + } + description + "The ip-prefix type represents an IP prefix and is IP + version neutral. The format of the textual representations + implies the IP version."; + } + + typedef ipv4-prefix { + type string { + 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])' + + '/(([0-9])|([1-2][0-9])|(3[0-2]))'; + } + description + "The ipv4-prefix type represents an IPv4 address prefix. + The prefix length is given by the number following the + slash character and must be less than or equal to 32. + + A prefix length value of n corresponds to an IP address + mask that has n contiguous 1-bits from the most + significant bit (MSB) and all other bits set to 0. + + The canonical format of an IPv4 prefix has all bits of + the IPv4 address set to zero that are not part of the + IPv4 prefix."; + } + + typedef ipv6-prefix { + type string { + pattern '((:|[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])))'; + pattern '(([^:]+:){6}(([^:]+:[^:]+)|(.*\..*)))|' + + '((([^:]+:)*[^:]+)?::(([^:]+:)*[^:]+)?)' + + '(/.+)'; + } + description + "The ipv6-prefix type represents an IPv6 address prefix. + The prefix length is given by the number following the + slash character and must be less than or equal 128. + + A prefix length value of n corresponds to an IP address + mask that has n contiguous 1-bits from the most + significant bit (MSB) and all other bits set to 0. + + The IPv6 address should have all bits that do not belong + to the prefix set to zero. + + The canonical format of an IPv6 prefix has all bits of + the IPv6 address set to zero that are not part of the + IPv6 prefix. Furthermore, IPv6 address is represented + in the compressed format described in RFC 4291, Section + 2.2, item 2 with the following additional rules: the :: + substitution must be applied to the longest sequence of + all-zero 16-bit chunks in an IPv6 address. If there is + a tie, the first sequence of all-zero 16-bit chunks is + replaced by ::. Single all-zero 16-bit chunks are not + compressed. The canonical format uses lowercase + characters and leading zeros are not allowed."; + reference + "RFC 4291: IP Version 6 Addressing Architecture"; + } + + /*** collection of domain name and URI types ***/ + + typedef domain-name { + type string { + pattern '((([a-zA-Z0-9_]([a-zA-Z0-9\-_]){0,61})?[a-zA-Z0-9]\.)*' + + '([a-zA-Z0-9_]([a-zA-Z0-9\-_]){0,61})?[a-zA-Z0-9]\.?)' + + '|\.'; + length "1..253"; + } + description + "The domain-name type represents a DNS domain name. The + name SHOULD be fully qualified whenever possible. + + Internet domain names are only loosely specified. Section + 3.5 of RFC 1034 recommends a syntax (modified in Section + 2.1 of RFC 1123). The pattern above is intended to allow + for current practice in domain name use, and some possible + future expansion. It is designed to hold various types of + domain names, including names used for A or AAAA records + (host names) and other records, such as SRV records. Note + that Internet host names have a stricter syntax (described + in RFC 952) than the DNS recommendations in RFCs 1034 and + 1123, and that systems that want to store host names in + schema nodes using the domain-name type are recommended to + adhere to this stricter standard to ensure interoperability. + + The encoding of DNS names in the DNS protocol is limited + to 255 characters. Since the encoding consists of labels + prefixed by a length bytes and there is a trailing NULL + byte, only 253 characters can appear in the textual dotted + notation. + + The description clause of schema nodes using the domain-name + type MUST describe when and how these names are resolved to + IP addresses. Note that the resolution of a domain-name value + may require to query multiple DNS records (e.g., A for IPv4 + and AAAA for IPv6). The order of the resolution process and + which DNS record takes precedence can either be defined + explicitely or it may depend on the configuration of the + resolver. + + Domain-name values use the US-ASCII encoding. Their canonical + format uses lowercase US-ASCII characters. Internationalized + domain names MUST be encoded in punycode as described in RFC + 3492"; + reference + "RFC 952: DoD Internet Host Table Specification + RFC 1034: Domain Names - Concepts and Facilities + RFC 1123: Requirements for Internet Hosts -- Application + and Support + RFC 2782: A DNS RR for specifying the location of services + (DNS SRV) + RFC 3492: Punycode: A Bootstring encoding of Unicode for + Internationalized Domain Names in Applications + (IDNA) + RFC 5891: Internationalizing Domain Names in Applications + (IDNA): Protocol"; + } + + typedef host { + type union { + type inet:ip-address; + type inet:domain-name; + } + description + "The host type represents either an IP address or a DNS + domain name."; + } + + typedef uri { + type string; + description + "The uri type represents a Uniform Resource Identifier + (URI) as defined by STD 66. + + Objects using the uri type MUST be in US-ASCII encoding, + and MUST be normalized as described by RFC 3986 Sections + 6.2.1, 6.2.2.1, and 6.2.2.2. All unnecessary + percent-encoding is removed, and all case-insensitive + characters are set to lowercase except for hexadecimal + digits, which are normalized to uppercase as described in + Section 6.2.2.1. + + The purpose of this normalization is to help provide + unique URIs. Note that this normalization is not + sufficient to provide uniqueness. Two URIs that are + textually distinct after this normalization may still be + equivalent. + + Objects using the uri type may restrict the schemes that + they permit. For example, 'data:' and 'urn:' schemes + might not be appropriate. + + A zero-length URI is not a valid URI. This can be used to + express 'URI absent' where required. + + In the value set and its semantics, this type is equivalent + to the Uri SMIv2 textual convention defined in RFC 5017."; + reference + "RFC 3986: Uniform Resource Identifier (URI): Generic Syntax + RFC 3305: Report from the Joint W3C/IETF URI Planning Interest + Group: Uniform Resource Identifiers (URIs), URLs, + and Uniform Resource Names (URNs): Clarifications + and Recommendations + RFC 5017: MIB Textual Conventions for Uniform Resource + Identifiers (URIs)"; + } + + } diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/restconf/impl/ietf-restconf-monitoring@2017-01-26.yang b/netconf/restconf/restconf-nb-bierman02/src/test/resources/restconf/impl/ietf-restconf-monitoring@2017-01-26.yang new file mode 100644 index 0000000..55c3cb1 --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/restconf/impl/ietf-restconf-monitoring@2017-01-26.yang @@ -0,0 +1,149 @@ +module ietf-restconf-monitoring { + namespace "urn:ietf:params:xml:ns:yang:ietf-restconf-monitoring"; + prefix "rcmon"; + + import ietf-yang-types { prefix yang; } + import ietf-inet-types { prefix inet; } + + organization + "IETF NETCONF (Network Configuration) Working Group"; + + contact + "WG Web: <https://datatracker.ietf.org/wg/netconf/> + WG List: <mailto:netconf@ietf.org> + + Author: Andy Bierman + <mailto:andy@yumaworks.com> + + Author: Martin Bjorklund + <mailto:mbj@tail-f.com> + + Author: Kent Watsen + <mailto:kwatsen@juniper.net>"; + + description + "This module contains monitoring information for the + RESTCONF protocol. + + Copyright (c) 2017 IETF Trust and the persons identified as + authors of the code. All rights reserved. + + Redistribution and use in source and binary forms, with or + without modification, is permitted pursuant to, and subject + to the license terms contained in, the Simplified BSD License + set forth in Section 4.c of the IETF Trust's Legal Provisions + Relating to IETF Documents + (http://trustee.ietf.org/license-info). + + This version of this YANG module is part of RFC 8040; see + the RFC itself for full legal notices."; + + revision 2017-01-26 { + description + "Initial revision."; + reference + "RFC 8040: RESTCONF Protocol."; + } + + container restconf-state { + config false; + description + "Contains RESTCONF protocol monitoring information."; + + container capabilities { + description + "Contains a list of protocol capability URIs."; + + leaf-list capability { + type inet:uri; + description + "A RESTCONF protocol capability URI."; + } + } + + container streams { + description + "Container representing the notification event streams + supported by the server."; + reference + "RFC 5277, Section 3.4, <streams> element."; + + list stream { + key name; + description + "Each entry describes an event stream supported by + the server."; + + leaf name { + type string; + description + "The stream name."; + reference + "RFC 5277, Section 3.4, <name> element."; + } + + leaf description { + type string; + description + "Description of stream content."; + reference + "RFC 5277, Section 3.4, <description> element."; + } + + leaf replay-support { + type boolean; + default false; + description + "Indicates if replay buffer is supported for this stream. + If 'true', then the server MUST support the 'start-time' + and 'stop-time' query parameters for this stream."; + reference + "RFC 5277, Section 3.4, <replaySupport> element."; + } + + leaf replay-log-creation-time { + when "../replay-support" { + description + "Only present if notification replay is supported."; + } + type yang:date-and-time; + description + "Indicates the time the replay log for this stream + was created."; + reference + "RFC 5277, Section 3.4, <replayLogCreationTime> + element."; + } + + list access { + key encoding; + min-elements 1; + description + "The server will create an entry in this list for each + encoding format that is supported for this stream. + The media type 'text/event-stream' is expected + for all event streams. This list identifies the + subtypes supported for this stream."; + + leaf encoding { + type string; + description + "This is the secondary encoding format within the + 'text/event-stream' encoding used by all streams. + The type 'xml' is supported for XML encoding. + The type 'json' is supported for JSON encoding."; + } + + leaf location { + type inet:uri; + mandatory true; + description + "Contains a URL that represents the entry point + for establishing notification delivery via + server-sent events."; + } + } + } + } + } +} diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/restconf/impl/ietf-restconf@2017-01-26.yang b/netconf/restconf/restconf-nb-bierman02/src/test/resources/restconf/impl/ietf-restconf@2017-01-26.yang new file mode 100644 index 0000000..dc54388 --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/restconf/impl/ietf-restconf@2017-01-26.yang @@ -0,0 +1,279 @@ +module ietf-restconf { + yang-version 1.1; + namespace "urn:ietf:params:xml:ns:yang:ietf-restconf"; + prefix "rc"; + + organization + "IETF NETCONF (Network Configuration) Working Group"; + + contact + "WG Web: <https://datatracker.ietf.org/wg/netconf/> + WG List: <mailto:netconf@ietf.org> + + Author: Andy Bierman + <mailto:andy@yumaworks.com> + + Author: Martin Bjorklund + <mailto:mbj@tail-f.com> + + Author: Kent Watsen + <mailto:kwatsen@juniper.net>"; + + description + "This module contains conceptual YANG specifications + for basic RESTCONF media type definitions used in + RESTCONF protocol messages. + + Note that the YANG definitions within this module do not + represent configuration data of any kind. + The 'restconf-media-type' YANG extension statement + provides a normative syntax for XML and JSON + message-encoding purposes. + + Copyright (c) 2017 IETF Trust and the persons identified as + authors of the code. All rights reserved. + + Redistribution and use in source and binary forms, with or + without modification, is permitted pursuant to, and subject + to the license terms contained in, the Simplified BSD License + set forth in Section 4.c of the IETF Trust's Legal Provisions + Relating to IETF Documents + (http://trustee.ietf.org/license-info). + + This version of this YANG module is part of RFC 8040; see + the RFC itself for full legal notices."; + + revision 2017-01-26 { + description + "Initial revision."; + reference + "RFC 8040: RESTCONF Protocol."; + } + + extension yang-data { + argument name { + yin-element true; + } + description + "This extension is used to specify a YANG data template that + represents conceptual data defined in YANG. It is + intended to describe hierarchical data independent of + protocol context or specific message-encoding format. + Data definition statements within a yang-data extension + specify the generic syntax for the specific YANG data + template, whose name is the argument of the 'yang-data' + extension statement. + + Note that this extension does not define a media type. + A specification using this extension MUST specify the + message-encoding rules, including the content media type. + + The mandatory 'name' parameter value identifies the YANG + data template that is being defined. It contains the + template name. + + This extension is ignored unless it appears as a top-level + statement. It MUST contain data definition statements + that result in exactly one container data node definition. + An instance of a YANG data template can thus be translated + into an XML instance document, whose top-level element + corresponds to the top-level container. + + The module name and namespace values for the YANG module using + the extension statement are assigned to instance document data + conforming to the data definition statements within + this extension. + + The substatements of this extension MUST follow the + 'data-def-stmt' rule in the YANG ABNF. + + The XPath document root is the extension statement itself, + such that the child nodes of the document root are + represented by the data-def-stmt substatements within + this extension. This conceptual document is the context + for the following YANG statements: + + - must-stmt + - when-stmt + - path-stmt + - min-elements-stmt + - max-elements-stmt + - mandatory-stmt + - unique-stmt + - ordered-by + - instance-identifier data type + + The following data-def-stmt substatements are constrained + when used within a 'yang-data' extension statement. + + - The list-stmt is not required to have a key-stmt defined. + - The if-feature-stmt is ignored if present. + - The config-stmt is ignored if present. + - The available identity values for any 'identityref' + leaf or leaf-list nodes are limited to the module + containing this extension statement and the modules + imported into that module. + "; + } + + rc:yang-data yang-errors { + uses errors; + } + + rc:yang-data yang-api { + uses restconf; + } + + grouping errors { + description + "A grouping that contains a YANG container + representing the syntax and semantics of a + YANG Patch error report within a response message."; + + container errors { + description + "Represents an error report returned by the server if + a request results in an error."; + + list error { + description + "An entry containing information about one + specific error that occurred while processing + a RESTCONF request."; + reference + "RFC 6241, Section 4.3."; + + leaf error-type { + type enumeration { + enum transport { + description + "The transport layer."; + } + enum rpc { + description + "The rpc or notification layer."; + } + enum protocol { + description + "The protocol operation layer."; + } + enum application { + description + "The server application layer."; + } + } + mandatory true; + description + "The protocol layer where the error occurred."; + } + + leaf error-tag { + type string; + mandatory true; + description + "The enumerated error-tag."; + } + + leaf error-app-tag { + type string; + description + "The application-specific error-tag."; + } + + leaf error-path { + type instance-identifier; + description + "The YANG instance identifier associated + with the error node."; + } + + leaf error-message { + type string; + description + "A message describing the error."; + } + + anydata error-info { + description + "This anydata value MUST represent a container with + zero or more data nodes representing additional + error information."; + } + } + } + } + + grouping restconf { + description + "Conceptual grouping representing the RESTCONF + root resource."; + + container restconf { + description + "Conceptual container representing the RESTCONF + root resource."; + + container data { + description + "Container representing the datastore resource. + Represents the conceptual root of all state data + and configuration data supported by the server. + The child nodes of this container can be any data + resources that are defined as top-level data nodes + from the YANG modules advertised by the server in + the 'ietf-yang-library' module."; + } + + container operations { + description + "Container for all operation resources. + + Each resource is represented as an empty leaf with the + name of the RPC operation from the YANG 'rpc' statement. + + For example, the 'system-restart' RPC operation defined + in the 'ietf-system' module would be represented as + an empty leaf in the 'ietf-system' namespace. This is + a conceptual leaf and will not actually be found in + the module: + + module ietf-system { + leaf system-reset { + type empty; + } + } + + To invoke the 'system-restart' RPC operation: + + POST /restconf/operations/ietf-system:system-restart + + To discover the RPC operations supported by the server: + + GET /restconf/operations + + In XML, the YANG module namespace identifies the module: + + <system-restart + xmlns='urn:ietf:params:xml:ns:yang:ietf-system'/> + + In JSON, the YANG module name identifies the module: + + { 'ietf-system:system-restart' : [null] } + "; + } + + leaf yang-library-version { + type string { + pattern '\d{4}-\d{2}-\d{2}'; + } + config false; + mandatory true; + description + "Identifies the revision date of the 'ietf-yang-library' + module that is implemented by this RESTCONF server. + Indicates the year, month, and day in YYYY-MM-DD + numeric format."; + } + } + } +} diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/restconf/impl/ietf-yang-library@2016-06-21.yang b/netconf/restconf/restconf-nb-bierman02/src/test/resources/restconf/impl/ietf-yang-library@2016-06-21.yang new file mode 100644 index 0000000..bc466ee --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/restconf/impl/ietf-yang-library@2016-06-21.yang @@ -0,0 +1,208 @@ +module ietf-yang-library { + namespace "urn:ietf:params:xml:ns:yang:ietf-yang-library"; + prefix "yanglib"; + import ietf-yang-types { + prefix yang; + } + import ietf-inet-types { + prefix inet; + } + organization + "IETF NETCONF (Network Configuration) Working Group"; + contact + "WG Web: <https://datatracker.ietf.org/wg/netconf/> + WG List: <mailto:netconf@ietf.org> + WG Chair: Mehmet Ersue + <mailto:mehmet.ersue@nsn.com> + WG Chair: Mahesh Jethanandani + <mailto:mjethanandani@gmail.com> + Editor: Andy Bierman + <mailto:andy@yumaworks.com> + Editor: Martin Bjorklund + <mailto:mbj@tail-f.com> + Editor: Kent Watsen + <mailto:kwatsen@juniper.net>"; + description + "This module contains monitoring information about the YANG + modules and submodules that are used within a YANG-based + server. + Copyright (c) 2016 IETF Trust and the persons identified as + authors of the code. All rights reserved. + Redistribution and use in source and binary forms, with or + without modification, is permitted pursuant to, and subject + to the license terms contained in, the Simplified BSD License + set forth in Section 4.c of the IETF Trust's Legal Provisions + Relating to IETF Documents + (http://trustee.ietf.org/license-info). + This version of this YANG module is part of RFC 7895; see + the RFC itself for full legal notices."; + revision 2016-06-21 { + description + "Initial revision."; + reference + "RFC 7895: YANG Module Library."; + } + /* + * Typedefs + */ + typedef revision-identifier { + type string { + pattern '\d{4}-\d{2}-\d{2}'; + } + description + "Represents a specific date in YYYY-MM-DD format."; + } + /* + * Groupings + */ + grouping module-list { + description + "The module data structure is represented as a grouping + so it can be reused in configuration or another monitoring + data structure."; + grouping common-leafs { + description + "Common parameters for YANG modules and submodules."; + leaf name { + type yang:yang-identifier; + description + "The YANG module or submodule name."; + } + leaf revision { + type union { + type revision-identifier; + type string { length 0; } + } + description + "The YANG module or submodule revision date. + A zero-length string is used if no revision statement + is present in the YANG module or submodule."; + } + } + grouping schema-leaf { + description + "Common schema leaf parameter for modules and submodules."; + leaf schema { + type inet:uri; + description + "Contains a URL that represents the YANG schema + resource for this module or submodule. + This leaf will only be present if there is a URL + available for retrieval of the schema for this entry."; + } + } + list module { + key "name revision"; + description + "Each entry represents one revision of one module + currently supported by the server."; + uses common-leafs; + uses schema-leaf; + leaf namespace { + type inet:uri; + mandatory true; + description + "The XML namespace identifier for this module."; + } + leaf-list feature { + type yang:yang-identifier; + description + "List of YANG feature names from this module that are + supported by the server, regardless of whether they are + defined in the module or any included submodule."; + } + list deviation { + key "name revision"; + description + "List of YANG deviation module names and revisions + used by this server to modify the conformance of + the module associated with this entry. Note that + the same module can be used for deviations for + multiple modules, so the same entry MAY appear + within multiple 'module' entries. + The deviation module MUST be present in the 'module' + list, with the same name and revision values. + The 'conformance-type' value will be 'implement' for + the deviation module."; + uses common-leafs; + } + leaf conformance-type { + type enumeration { + enum implement { + description + "Indicates that the server implements one or more + protocol-accessible objects defined in the YANG module + identified in this entry. This includes deviation + statements defined in the module. + For YANG version 1.1 modules, there is at most one + module entry with conformance type 'implement' for a + particular module name, since YANG 1.1 requires that, + at most, one revision of a module is implemented. + For YANG version 1 modules, there SHOULD NOT be more + than one module entry for a particular module name."; + } + enum import { + description + "Indicates that the server imports reusable definitions + from the specified revision of the module but does + not implement any protocol-accessible objects from + this revision. + Multiple module entries for the same module name MAY + exist. This can occur if multiple modules import the + same module but specify different revision dates in + the import statements."; + } + } + mandatory true; + description + "Indicates the type of conformance the server is claiming + for the YANG module identified by this entry."; + } + list submodule { + key "name revision"; + description + "Each entry represents one submodule within the + parent module."; + uses common-leafs; + uses schema-leaf; + } + } + } + /* + * Operational state data nodes + */ + container modules-state { + config false; + description + "Contains YANG module monitoring information."; + leaf module-set-id { + type string; + mandatory true; + description + "Contains a server-specific identifier representing + the current set of modules and submodules. The + server MUST change the value of this leaf if the + information represented by the 'module' list instances + has changed."; + } + uses module-list; + } + /* + * Notifications + */ + notification yang-library-change { + description + "Generated when the set of modules and submodules supported + by the server has changed."; + leaf module-set-id { + type leafref { + path "/yanglib:modules-state/yanglib:module-set-id"; + } + mandatory true; + description + "Contains the module-set-id value representing the + set of modules and submodules supported at the server at + the time the notification is generated."; + } + } +} diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/restconf/impl/ietf-yang-types.yang b/netconf/restconf/restconf-nb-bierman02/src/test/resources/restconf/impl/ietf-yang-types.yang new file mode 100644 index 0000000..c3f952c --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/restconf/impl/ietf-yang-types.yang @@ -0,0 +1,417 @@ + module ietf-yang-types { + + namespace "urn:ietf:params:xml:ns:yang:ietf-yang-types"; + prefix "yang"; + + organization + "IETF NETMOD (NETCONF Data Modeling Language) Working Group"; + + contact + "WG Web: <http://tools.ietf.org/wg/netmod/> + WG List: <mailto:netmod@ietf.org> + + WG Chair: David Partain + <mailto:david.partain@ericsson.com> + + WG Chair: David Kessens + <mailto:david.kessens@nsn.com> + + Editor: Juergen Schoenwaelder + <mailto:j.schoenwaelder@jacobs-university.de>"; + + description + "This module contains a collection of generally useful derived + YANG data types. + + Copyright (c) 2010 IETF Trust and the persons identified as + authors of the code. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, is permitted pursuant to, and subject to the license + terms contained in, the Simplified BSD License set forth in Section + 4.c of the IETF Trust's Legal Provisions Relating to IETF Documents + (http://trustee.ietf.org/license-info). + + This version of this YANG module is part of RFC 6021; see + the RFC itself for full legal notices."; + + revision 2010-09-24 { + description + "Initial revision."; + reference + "RFC 6021: Common YANG Data Types"; + } + + /*** collection of counter and gauge types ***/ + + typedef counter32 { + type uint32; + description + "The counter32 type represents a non-negative integer + that monotonically increases until it reaches a + maximum value of 2^32-1 (4294967295 decimal), when it + wraps around and starts increasing again from zero. + + Counters have no defined 'initial' value, and thus, a + single value of a counter has (in general) no information + content. Discontinuities in the monotonically increasing + value normally occur at re-initialization of the + management system, and at other times as specified in the + description of a schema node using this type. If such + other times can occur, for example, the creation of + a schema node of type counter32 at times other than + re-initialization, then a corresponding schema node + should be defined, with an appropriate type, to indicate + the last discontinuity. + + The counter32 type should not be used for configuration + schema nodes. A default statement SHOULD NOT be used in + combination with the type counter32. + + In the value set and its semantics, this type is equivalent + to the Counter32 type of the SMIv2."; + reference + "RFC 2578: Structure of Management Information Version 2 (SMIv2)"; + } + + typedef zero-based-counter32 { + type yang:counter32; + default "0"; + description + "The zero-based-counter32 type represents a counter32 + that has the defined 'initial' value zero. + + A schema node of this type will be set to zero (0) on creation + and will thereafter increase monotonically until it reaches + a maximum value of 2^32-1 (4294967295 decimal), when it + wraps around and starts increasing again from zero. + + Provided that an application discovers a new schema node + of this type within the minimum time to wrap, it can use the + 'initial' value as a delta. It is important for a management + station to be aware of this minimum time and the actual time + between polls, and to discard data if the actual time is too + long or there is no defined minimum time. + + In the value set and its semantics, this type is equivalent + to the ZeroBasedCounter32 textual convention of the SMIv2."; + reference + "RFC 4502: Remote Network Monitoring Management Information + Base Version 2"; + } + + typedef counter64 { + type uint64; + description + "The counter64 type represents a non-negative integer + that monotonically increases until it reaches a + maximum value of 2^64-1 (18446744073709551615 decimal), + when it wraps around and starts increasing again from zero. + + Counters have no defined 'initial' value, and thus, a + single value of a counter has (in general) no information + content. Discontinuities in the monotonically increasing + value normally occur at re-initialization of the + management system, and at other times as specified in the + description of a schema node using this type. If such + other times can occur, for example, the creation of + a schema node of type counter64 at times other than + re-initialization, then a corresponding schema node + should be defined, with an appropriate type, to indicate + the last discontinuity. + + The counter64 type should not be used for configuration + schema nodes. A default statement SHOULD NOT be used in + combination with the type counter64. + + In the value set and its semantics, this type is equivalent + to the Counter64 type of the SMIv2."; + reference + "RFC 2578: Structure of Management Information Version 2 (SMIv2)"; + } + + typedef zero-based-counter64 { + type yang:counter64; + default "0"; + description + "The zero-based-counter64 type represents a counter64 that + has the defined 'initial' value zero. + + A schema node of this type will be set to zero (0) on creation + and will thereafter increase monotonically until it reaches + a maximum value of 2^64-1 (18446744073709551615 decimal), + when it wraps around and starts increasing again from zero. + + Provided that an application discovers a new schema node + of this type within the minimum time to wrap, it can use the + 'initial' value as a delta. It is important for a management + station to be aware of this minimum time and the actual time + between polls, and to discard data if the actual time is too + long or there is no defined minimum time. + + In the value set and its semantics, this type is equivalent + to the ZeroBasedCounter64 textual convention of the SMIv2."; + reference + "RFC 2856: Textual Conventions for Additional High Capacity + Data Types"; + } + + typedef gauge32 { + type uint32; + description + "The gauge32 type represents a non-negative integer, which + may increase or decrease, but shall never exceed a maximum + value, nor fall below a minimum value. The maximum value + cannot be greater than 2^32-1 (4294967295 decimal), and + the minimum value cannot be smaller than 0. The value of + a gauge32 has its maximum value whenever the information + being modeled is greater than or equal to its maximum + value, and has its minimum value whenever the information + being modeled is smaller than or equal to its minimum value. + If the information being modeled subsequently decreases + below (increases above) the maximum (minimum) value, the + gauge32 also decreases (increases). + + In the value set and its semantics, this type is equivalent + to the Gauge32 type of the SMIv2."; + reference + "RFC 2578: Structure of Management Information Version 2 (SMIv2)"; + } + + typedef gauge64 { + type uint64; + description + "The gauge64 type represents a non-negative integer, which + may increase or decrease, but shall never exceed a maximum + value, nor fall below a minimum value. The maximum value + cannot be greater than 2^64-1 (18446744073709551615), and + the minimum value cannot be smaller than 0. The value of + a gauge64 has its maximum value whenever the information + being modeled is greater than or equal to its maximum + value, and has its minimum value whenever the information + being modeled is smaller than or equal to its minimum value. + If the information being modeled subsequently decreases + below (increases above) the maximum (minimum) value, the + gauge64 also decreases (increases). + + In the value set and its semantics, this type is equivalent + to the CounterBasedGauge64 SMIv2 textual convention defined + in RFC 2856"; + reference + "RFC 2856: Textual Conventions for Additional High Capacity + Data Types"; + } + + /*** collection of identifier related types ***/ + + typedef object-identifier { + type string { + pattern '(([0-1](\.[1-3]?[0-9]))|(2\.(0|([1-9]\d*))))' + + '(\.(0|([1-9]\d*)))*'; + } + description + "The object-identifier type represents administratively + assigned names in a registration-hierarchical-name tree. + + Values of this type are denoted as a sequence of numerical + non-negative sub-identifier values. Each sub-identifier + value MUST NOT exceed 2^32-1 (4294967295). Sub-identifiers + are separated by single dots and without any intermediate + whitespace. + + The ASN.1 standard restricts the value space of the first + sub-identifier to 0, 1, or 2. Furthermore, the value space + of the second sub-identifier is restricted to the range + 0 to 39 if the first sub-identifier is 0 or 1. Finally, + the ASN.1 standard requires that an object identifier + has always at least two sub-identifier. The pattern + captures these restrictions. + + Although the number of sub-identifiers is not limited, + module designers should realize that there may be + implementations that stick with the SMIv2 limit of 128 + sub-identifiers. + + This type is a superset of the SMIv2 OBJECT IDENTIFIER type + since it is not restricted to 128 sub-identifiers. Hence, + this type SHOULD NOT be used to represent the SMIv2 OBJECT + IDENTIFIER type, the object-identifier-128 type SHOULD be + used instead."; + reference + "ISO9834-1: Information technology -- Open Systems + Interconnection -- Procedures for the operation of OSI + Registration Authorities: General procedures and top + arcs of the ASN.1 Object Identifier tree"; + } + + + + + typedef object-identifier-128 { + type object-identifier { + pattern '\d*(\.\d*){1,127}'; + } + description + "This type represents object-identifiers restricted to 128 + sub-identifiers. + + In the value set and its semantics, this type is equivalent + to the OBJECT IDENTIFIER type of the SMIv2."; + reference + "RFC 2578: Structure of Management Information Version 2 (SMIv2)"; + } + + typedef yang-identifier { + type string { + length "1..max"; + pattern '[a-zA-Z_][a-zA-Z0-9\-_.]*'; + pattern '.|..|[^xX].*|.[^mM].*|..[^lL].*'; + } + description + "A YANG identifier string as defined by the 'identifier' + rule in Section 12 of RFC 6020. An identifier must + start with an alphabetic character or an underscore + followed by an arbitrary sequence of alphabetic or + numeric characters, underscores, hyphens, or dots. + + A YANG identifier MUST NOT start with any possible + combination of the lowercase or uppercase character + sequence 'xml'."; + reference + "RFC 6020: YANG - A Data Modeling Language for the Network + Configuration Protocol (NETCONF)"; + } + + /*** collection of date and time related types ***/ + + typedef date-and-time { + type string { + pattern '\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d+)?' + + '(Z|[\+\-]\d{2}:\d{2})'; + } + description + "The date-and-time type is a profile of the ISO 8601 + standard for representation of dates and times using the + Gregorian calendar. The profile is defined by the + date-time production in Section 5.6 of RFC 3339. + + The date-and-time type is compatible with the dateTime XML + schema type with the following notable exceptions: + + (a) The date-and-time type does not allow negative years. + + (b) The date-and-time time-offset -00:00 indicates an unknown + time zone (see RFC 3339) while -00:00 and +00:00 and Z all + represent the same time zone in dateTime. + + (c) The canonical format (see below) of data-and-time values + differs from the canonical format used by the dateTime XML + schema type, which requires all times to be in UTC using the + time-offset 'Z'. + + This type is not equivalent to the DateAndTime textual + convention of the SMIv2 since RFC 3339 uses a different + separator between full-date and full-time and provides + higher resolution of time-secfrac. + + The canonical format for date-and-time values with a known time + zone uses a numeric time zone offset that is calculated using + the device's configured known offset to UTC time. A change of + the device's offset to UTC time will cause date-and-time values + to change accordingly. Such changes might happen periodically + in case a server follows automatically daylight saving time + (DST) time zone offset changes. The canonical format for + date-and-time values with an unknown time zone (usually referring + to the notion of local time) uses the time-offset -00:00."; + reference + "RFC 3339: Date and Time on the Internet: Timestamps + RFC 2579: Textual Conventions for SMIv2 + XSD-TYPES: XML Schema Part 2: Datatypes Second Edition"; + } + + typedef timeticks { + type uint32; + description + "The timeticks type represents a non-negative integer that + represents the time, modulo 2^32 (4294967296 decimal), in + hundredths of a second between two epochs. When a schema + node is defined that uses this type, the description of + the schema node identifies both of the reference epochs. + + In the value set and its semantics, this type is equivalent + to the TimeTicks type of the SMIv2."; + reference + "RFC 2578: Structure of Management Information Version 2 (SMIv2)"; + } + + typedef timestamp { + type yang:timeticks; + description + "The timestamp type represents the value of an associated + timeticks schema node at which a specific occurrence happened. + The specific occurrence must be defined in the description + of any schema node defined using this type. When the specific + occurrence occurred prior to the last time the associated + timeticks attribute was zero, then the timestamp value is + zero. Note that this requires all timestamp values to be + reset to zero when the value of the associated timeticks + attribute reaches 497+ days and wraps around to zero. + + The associated timeticks schema node must be specified + in the description of any schema node using this type. + + In the value set and its semantics, this type is equivalent + to the TimeStamp textual convention of the SMIv2."; + reference + "RFC 2579: Textual Conventions for SMIv2"; + } + + /*** collection of generic address types ***/ + + typedef phys-address { + type string { + pattern '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'; + } + description + "Represents media- or physical-level addresses represented + as a sequence octets, each octet represented by two hexadecimal + numbers. Octets are separated by colons. The canonical + representation uses lowercase characters. + + In the value set and its semantics, this type is equivalent + to the PhysAddress textual convention of the SMIv2."; + reference + "RFC 2579: Textual Conventions for SMIv2"; + } + + typedef mac-address { + type string { + pattern '[0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){5}'; + } + description + "The mac-address type represents an IEEE 802 MAC address. + The canonical representation uses lowercase characters. + + In the value set and its semantics, this type is equivalent + to the MacAddress textual convention of the SMIv2."; + reference + "IEEE 802: IEEE Standard for Local and Metropolitan Area + Networks: Overview and Architecture + RFC 2579: Textual Conventions for SMIv2"; + } + + /*** collection of XML specific types ***/ + + typedef xpath1.0 { + type string; + description + "This type represents an XPATH 1.0 expression. + + When a schema node is defined that uses this type, the + description of the schema node MUST specify the XPath + context in which the XPath expression is evaluated."; + reference + "XPATH: XML Path Language (XPath) Version 1.0"; + } + + } diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/restconf/parser/deserializer/deserializer-test-included.yang b/netconf/restconf/restconf-nb-bierman02/src/test/resources/restconf/parser/deserializer/deserializer-test-included.yang new file mode 100644 index 0000000..b46898c --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/restconf/parser/deserializer/deserializer-test-included.yang @@ -0,0 +1,22 @@ +module deserializer-test-included { + namespace "deserializer:test:included"; + prefix "dti"; + yang-version 1; + + revision 2016-06-06 { + description + "Initial revision."; + } + + list augmented-list { + key list-key; + + leaf list-key { + type uint16; + } + + leaf list-value { + type string; + } + } +} diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/restconf/parser/deserializer/deserializer-test.yang b/netconf/restconf/restconf-nb-bierman02/src/test/resources/restconf/parser/deserializer/deserializer-test.yang new file mode 100644 index 0000000..38f989e --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/restconf/parser/deserializer/deserializer-test.yang @@ -0,0 +1,90 @@ +module deserializer-test { + namespace "deserializer:test"; + prefix "dt"; + yang-version 1; + + import deserializer-test-included { prefix dti; revision-date 2016-06-06; } + + revision 2016-06-06 { + description + "Initial revision."; + } + + container contA { + leaf-list leaf-list-A { + type string; + } + + leaf leaf-A { + type string; + } + + list list-A { + key list-key; + + leaf list-key { + type uint8; + } + + leaf-list leaf-list-AA { + type string; + } + } + } + + leaf-list leaf-list-0 { + type boolean; + } + + leaf leaf-0 { + type string; + } + + list list-no-key { + leaf name { + type string; + } + + leaf number { + type uint8; + } + } + + list list-one-key { + key name; + + leaf name { + type string; + } + + leaf number { + type uint8; + } + } + + list list-multiple-keys { + key "name number enabled"; + + leaf name { + type string; + } + + leaf number { + type uint8; + } + + leaf enabled { + type boolean; + } + + leaf string-value { + type string; + } + } + + augment "/dti:augmented-list" { + leaf augmented-leaf { + type string; + } + } +} diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/restconf/parser/list-test.yang b/netconf/restconf/restconf-nb-bierman02/src/test/resources/restconf/parser/list-test.yang new file mode 100644 index 0000000..981e6fe --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/restconf/parser/list-test.yang @@ -0,0 +1,39 @@ +module list-test { + namespace "list:test"; + prefix "listt"; + + revision 2016-04-29 { + description + "Initial revision."; + } + + container top { + list list1 { + key "key1 key2 key3"; + leaf key1 { + type string; + } + leaf key2 { + type string; + } + leaf key3 { + type string; + } + list list2 { + key "key4 key5"; + leaf key4 { + type string; + } + leaf key5 { + type string; + } + leaf result { + type string; + } + } + } + leaf-list Y { + type uint32; + } + } +}
\ No newline at end of file diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/restconf/parser/serializer/serializer-test-included.yang b/netconf/restconf/restconf-nb-bierman02/src/test/resources/restconf/parser/serializer/serializer-test-included.yang new file mode 100644 index 0000000..c404aeb --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/restconf/parser/serializer/serializer-test-included.yang @@ -0,0 +1,22 @@ +module serializer-test-included { + namespace "serializer:test:included"; + prefix "sti"; + yang-version 1; + + revision 2016-06-06 { + description + "Initial revision."; + } + + list augmented-list { + key list-key; + + leaf list-key { + type uint16; + } + + leaf list-value { + type string; + } + } +}
\ No newline at end of file diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/restconf/parser/serializer/serializer-test.yang b/netconf/restconf/restconf-nb-bierman02/src/test/resources/restconf/parser/serializer/serializer-test.yang new file mode 100644 index 0000000..691e4dc --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/restconf/parser/serializer/serializer-test.yang @@ -0,0 +1,86 @@ +module serializer-test { + namespace "serializer:test"; + prefix "st"; + yang-version 1; + + import serializer-test-included { prefix sti; revision-date 2016-06-06; } + + revision 2016-06-06 { + description + "Initial revision."; + } + + container contA { + leaf-list leaf-list-A { + type string; + } + + leaf leaf-A { + type string; + } + + list list-A { + key list-key; + + leaf list-key { + type uint8; + } + + leaf-list leaf-list-AA { + type string; + } + } + } + + leaf-list leaf-list-0 { + type boolean; + } + + leaf leaf-0 { + type string; + } + + list list-no-key { + leaf name { + type string; + } + + leaf number { + type uint8; + } + } + + list list-one-key { + key name; + + leaf name { + type string; + } + + leaf number { + type uint8; + } + } + + list list-multiple-keys { + key "name number enabled"; + + leaf name { + type string; + } + + leaf number { + type uint8; + } + + leaf enabled { + type boolean; + } + } + + augment "/sti:augmented-list" { + leaf augmented-leaf { + type string; + } + } +}
\ No newline at end of file diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/streams/sal-remote@2014-01-14.yang b/netconf/restconf/restconf-nb-bierman02/src/test/resources/streams/sal-remote@2014-01-14.yang new file mode 100644 index 0000000..0f6aebf --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/streams/sal-remote@2014-01-14.yang @@ -0,0 +1,112 @@ +module sal-remote { + + yang-version 1; + namespace "urn:opendaylight:params:xml:ns:yang:controller:md:sal:remote"; + prefix "sal-remote"; + + organization "Cisco Systems, Inc."; + contact "Martin Bobak <mbobak@cisco.com>"; + + description + "This module contains the definition of methods related to + sal remote model. + + Copyright (c)2013 Cisco Systems, Inc. All rights reserved. + + This program and the accompanying materials are made available + under the terms of the Eclipse Public License v1.0 which + accompanies this distribution, and is available at + http://www.eclipse.org/legal/epl-v10.html"; + + revision "2014-01-14" { + description + "Initial revision"; + } + + + typedef q-name { + type string; + reference + "http://www.w3.org/TR/2004/REC-xmlschema-2-20041028/#QName"; + } + + rpc create-data-change-event-subscription { + input { + leaf path { + type instance-identifier; + description "Subtree path. "; + } + } + output { + leaf stream-name { + type string; + description "Notification stream name."; + } + } + } + + rpc create-data-change-event-subscription2 { + input { + leaf path2 { + type instance-identifier; + description "Subtree path. "; + } + } + output { + leaf stream-name2 { + type string; + description "Notification stream name."; + } + } + } + + notification data-changed-notification { + description "Data change notification."; + list data-change-event { + key path; + leaf path { + type instance-identifier; + } + leaf store { + type enumeration { + enum config; + enum operation; + } + } + leaf operation { + type enumeration { + enum created; + enum updated; + enum deleted; + } + } + anyxml data{ + description "DataObject "; + } + } + } + + rpc create-notification-stream { + input { + leaf-list notifications { + type q-name; + description "Notification QNames"; + } + } + output { + leaf notification-stream-identifier { + type string; + description "Unique notification stream identifier, in which notifications will be propagated"; + } + } + } + + rpc begin-transaction{ + output{ + anyxml data-modification-transaction{ + description "DataModificationTransaction xml"; + } + } + } + +}
\ No newline at end of file diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/streams/toaster.yang b/netconf/restconf/restconf-nb-bierman02/src/test/resources/streams/toaster.yang new file mode 100644 index 0000000..ad6b9b0 --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/streams/toaster.yang @@ -0,0 +1,197 @@ + module toaster { + + yang-version 1; + + namespace + "http://netconfcentral.org/ns/toaster"; + + prefix toast; + + organization "Netconf Central"; + + contact + "Andy Bierman <andy@netconfcentral.org>"; + + description + "YANG version of the TOASTER-MIB."; + + revision "2009-11-20" { + description + "Toaster module in progress."; + } + + + identity toast-type { + description + "Base for all bread types supported by the toaster. + New bread types not listed here nay be added in the + future."; + } + + identity white-bread { + base toast:toast-type; + description "White bread."; + } + + identity wheat-bread { + base toast-type; + description "Wheat bread."; + } + + identity wonder-bread { + base toast-type; + description "Wonder bread."; + } + + identity frozen-waffle { + base toast-type; + description "Frozen waffle."; + } + + identity frozen-bagel { + base toast-type; + description "Frozen bagel."; + } + + identity hash-brown { + base toast-type; + description "Hash browned potatos."; + } + + typedef DisplayString { + type string { + length "0 .. 255"; + } + description + "YANG version of the SMIv2 DisplayString TEXTUAL-CONVENTION."; + reference + "RFC 2579, section 2."; + + } + + container toaster { + presence + "Indicates the toaster service is available"; + description + "Top-level container for all toaster database objects."; + leaf toasterManufacturer { + type DisplayString; + config false; + mandatory true; + description + "The name of the toaster's manufacturer. For instance, + Microsoft Toaster."; + } + + leaf toasterModelNumber { + type DisplayString; + config false; + mandatory true; + description + "The name of the toaster's model. For instance, + Radiant Automatic."; + } + + leaf toasterStatus { + type enumeration { + enum "up" { + value 1; + description + "The toaster knob position is up. + No toast is being made now."; + } + enum "down" { + value 2; + description + "The toaster knob position is down. + Toast is being made now."; + } + } + config false; + mandatory true; + description + "This variable indicates the current state of + the toaster."; + } + } // container toaster + + rpc make-toast { + description + "Make some toast. + The toastDone notification will be sent when + the toast is finished. + An 'in-use' error will be returned if toast + is already being made. + A 'resource-denied' error will be returned + if the toaster service is disabled."; + input { + leaf toasterDoneness { + type uint32 { + range "1 .. 10"; + } + default '5'; + description + "This variable controls how well-done is the + ensuing toast. It should be on a scale of 1 to 10. + Toast made at 10 generally is considered unfit + for human consumption; toast made at 1 is warmed + lightly."; + } + + leaf toasterToastType { + type identityref { + base toast:toast-type; + } + default 'wheat-bread'; + description + "This variable informs the toaster of the type of + material that is being toasted. The toaster + uses this information, combined with + toasterDoneness, to compute for how + long the material must be toasted to achieve + the required doneness."; + } + } + } // rpc make-toast + + rpc testOutput { + output { + leaf textOut { + type string; + } + } + } + + rpc cancel-toast { + description + "Stop making toast, if any is being made. + A 'resource-denied' error will be returned + if the toaster service is disabled."; + } // rpc cancel-toast + + notification toastDone { + description + "Indicates that the toast in progress has completed."; + leaf toastStatus { + type enumeration { + enum "done" { + value 0; + description "The toast is done."; + } + enum "cancelled" { + value 1; + description + "The toast was cancelled."; + } + enum "error" { + value 2; + description + "The toaster service was disabled or + the toaster is broken."; + } + } + description + "Indicates the final toast status"; + } + } // notification toastDone + } // module toaster diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/test-config-data/test-mount-point/yang/test-interface.yang b/netconf/restconf/restconf-nb-bierman02/src/test/resources/test-config-data/test-mount-point/yang/test-interface.yang new file mode 100644 index 0000000..7502f85 --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/test-config-data/test-mount-point/yang/test-interface.yang @@ -0,0 +1,30 @@ +module mount-interface { + yang-version 1; + namespace "urn:ietf:params:xml:ns:yang:mount-interface"; + prefix "sn"; + + description + "test file"; + + revision "2014-07-01" { + description + "Initial revision"; + reference "will be defined"; + } + + container interfaces { + list interface { + key "name"; + + leaf name { + type string; + } + leaf type { + type string; + } + leaf enabled { + type string; + } + } + } +} diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/test-config-data/test-mount-point/yang/test-interface2.yang b/netconf/restconf/restconf-nb-bierman02/src/test/resources/test-config-data/test-mount-point/yang/test-interface2.yang new file mode 100644 index 0000000..086d682 --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/test-config-data/test-mount-point/yang/test-interface2.yang @@ -0,0 +1,27 @@ +module mount-interface2 { + yang-version 1; + namespace "urn:ietf:params:xml:ns:yang:mount-interface2"; + prefix "snn"; + + description + "test file"; + + revision "2014-08-01" { + description + "Initial revision"; + reference "will be defined"; + } + + container class { + list student { + key "name"; + + leaf name { + type string; + } + leaf age { + type string; + } + } + } +} diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/test-config-data/xml/block-data.xml b/netconf/restconf/restconf-nb-bierman02/src/test/resources/test-config-data/xml/block-data.xml new file mode 100644 index 0000000..625b04d --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/test-config-data/xml/block-data.xml @@ -0,0 +1,4 @@ +<block xmlns="urn:ietf:params:xml:ns:yang:test-interface"> + <address>456</address> + <location>First</location> +</block>
\ No newline at end of file diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/test-config-data/xml/data2.xml b/netconf/restconf/restconf-nb-bierman02/src/test/resources/test-config-data/xml/data2.xml new file mode 100644 index 0000000..21712cb --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/test-config-data/xml/data2.xml @@ -0,0 +1,4 @@ +<student xmlns="urn:ietf:params:xml:ns:yang:test-interface2"> + <name>Vojtech</name> + <age>17</age> +</student>
\ No newline at end of file diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/test-config-data/xml/test-interface.xml b/netconf/restconf/restconf-nb-bierman02/src/test/resources/test-config-data/xml/test-interface.xml new file mode 100644 index 0000000..755c8a9 --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/test-config-data/xml/test-interface.xml @@ -0,0 +1,8 @@ +<interfaces xmlns="urn:ietf:params:xml:ns:yang:test-interface"> + <interface> + <name>eth0</name> + <type>ethernetCsmacd</type> + <enabled>false</enabled> + </interface> +</interfaces> + diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/test-config-data/xml/test-interface2.xml b/netconf/restconf/restconf-nb-bierman02/src/test/resources/test-config-data/xml/test-interface2.xml new file mode 100644 index 0000000..05db4a5 --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/test-config-data/xml/test-interface2.xml @@ -0,0 +1,5 @@ +<interface> + <name>eth0</name> + <type>ethernetCsmacd</type> + <enabled>false</enabled> +</interface> diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/test-config-data/xml/test-interface3.xml b/netconf/restconf/restconf-nb-bierman02/src/test/resources/test-config-data/xml/test-interface3.xml new file mode 100644 index 0000000..e59ba17 --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/test-config-data/xml/test-interface3.xml @@ -0,0 +1,6 @@ +<class xmlns="urn:ietf:params:xml:ns:yang:test-interface2"> + <student> + <name>Thomas</name> + <age>23</age> + </student> +</class> diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/test-config-data/yang1/test-interface.yang b/netconf/restconf/restconf-nb-bierman02/src/test/resources/test-config-data/yang1/test-interface.yang new file mode 100644 index 0000000..d0699e2 --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/test-config-data/yang1/test-interface.yang @@ -0,0 +1,49 @@ +module test-interface { + yang-version 1; + namespace "urn:ietf:params:xml:ns:yang:test-interface"; + prefix "sn"; + + description + "test file"; + + revision "2014-07-01" { + description + "Initial revision"; + reference "will be defined"; + } + + container interfaces { + + container block { + + leaf address { + type string; + } + leaf location { + type string; + } + } + + list interface { + key "name"; + + list sub-interface { + key "sub-name"; + + leaf sub-name { + type string; + } + } + + leaf name { + type string; + } + leaf type { + type string; + } + leaf enabled { + type string; + } + } + } +} diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/test-config-data/yang2/test-interface2.yang b/netconf/restconf/restconf-nb-bierman02/src/test/resources/test-config-data/yang2/test-interface2.yang new file mode 100644 index 0000000..13bc0eb --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/test-config-data/yang2/test-interface2.yang @@ -0,0 +1,27 @@ +module test-interface2 { + yang-version 1; + namespace "urn:ietf:params:xml:ns:yang:test-interface2"; + prefix "snn"; + + description + "test file"; + + revision "2014-08-01" { + description + "Initial revision"; + reference "will be defined"; + } + + container class { + list student { + key "name"; + + leaf name { + type string; + } + leaf age { + type string; + } + } + } +} diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/varioustest/xmldata.xml b/netconf/restconf/restconf-nb-bierman02/src/test/resources/varioustest/xmldata.xml new file mode 100644 index 0000000..5d45980 --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/varioustest/xmldata.xml @@ -0,0 +1,5 @@ +<cont xmlns="generalnamespace"> + <cont1> + <lf1 xmlns:prefix="prefix:name" xmlns:prefix2="prefix2:name">/prefix:somepath1/prefix2:somepath2</lf1> + </cont1> +</cont>
\ No newline at end of file diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/xml-to-cnsn/data-container-yang/data-container.yang b/netconf/restconf/restconf-nb-bierman02/src/test/resources/xml-to-cnsn/data-container-yang/data-container.yang new file mode 100644 index 0000000..b038eb1 --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/xml-to-cnsn/data-container-yang/data-container.yang @@ -0,0 +1,35 @@ +module data-container-yang { + namespace "data:container:yang"; + + prefix "dtconyg"; + revision 2013-11-19 { + } + + container cont { + leaf lf1 { + type string; + } + + leaf lf2 { + type string; + } + + leaf lf3 { + type empty; + } + + leaf-list lflst1 { + type string; + } + list lst1 { + leaf lf11 { + type string; + } + } + container cont1 { + leaf lf11 { + type uint8; + } + } + } +}
\ No newline at end of file diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/xml-to-cnsn/data-container.xml b/netconf/restconf/restconf-nb-bierman02/src/test/resources/xml-to-cnsn/data-container.xml new file mode 100644 index 0000000..841d351 --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/xml-to-cnsn/data-container.xml @@ -0,0 +1,14 @@ +<cont> + <lf1>str0</lf1> + <lf2></lf2> + <lf3/> + <lflst1>121</lflst1> + <lflst1>131</lflst1> + <lflst1>str1</lflst1> + <lst1> + <lf11>str2</lf11> + </lst1> + <cont1> + <lf11>100</lf11> + </cont1> +</cont> diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/xml-to-cnsn/data-list-yang/data-container.yang b/netconf/restconf/restconf-nb-bierman02/src/test/resources/xml-to-cnsn/data-list-yang/data-container.yang new file mode 100644 index 0000000..3df3413 --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/xml-to-cnsn/data-list-yang/data-container.yang @@ -0,0 +1,28 @@ +module data-container-yang { + namespace "data:container:yang"; + + prefix "dtconyg"; + revision 2013-11-19 { + } + + container cont { + list lst1 { + leaf lf11 { + type string; + } + leaf-list lflst11 { + type string; + } + list lst11 { + leaf lf111 { + type string; + } + } + container cont11 { + leaf lf111 { + type uint8; + } + } + } + } +}
\ No newline at end of file diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/xml-to-cnsn/data-list-yang/data-list.yang b/netconf/restconf/restconf-nb-bierman02/src/test/resources/xml-to-cnsn/data-list-yang/data-list.yang new file mode 100644 index 0000000..47e2a45 --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/xml-to-cnsn/data-list-yang/data-list.yang @@ -0,0 +1,22 @@ +module data-list-yang { + namespace "data:list:yang"; + + prefix "dtlstyg"; + + import data-container-yang { + prefix "dtconyg"; + revision-date 2013-11-19; + } + + + revision 2013-11-19 { + } + + + + augment "/dtconyg:cont" { + leaf lf1 { + type string; + } + } +} diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/xml-to-cnsn/data-list.xml b/netconf/restconf/restconf-nb-bierman02/src/test/resources/xml-to-cnsn/data-list.xml new file mode 100644 index 0000000..9c4256a --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/xml-to-cnsn/data-list.xml @@ -0,0 +1,21 @@ +<cont> + <lst1> + <lf11>str0</lf11> + <lflst11>121</lflst11> + <lflst11>131</lflst11> + <lflst11>str1</lflst11> + <lst11> + <lf111>str2</lf111> + </lst11> + <cont11> + <lf111>100</lf111> + </cont11> + </lst1> + <lst1> + <lflst11>221</lflst11> + <cont11> + <lf111>100</lf111> + </cont11> + </lst1> + <lf1>lf1</lf1> +</cont> diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/xml-to-cnsn/data-nmspc-in-attributes.xml b/netconf/restconf/restconf-nb-bierman02/src/test/resources/xml-to-cnsn/data-nmspc-in-attributes.xml new file mode 100644 index 0000000..848c020 --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/xml-to-cnsn/data-nmspc-in-attributes.xml @@ -0,0 +1,5 @@ +<cont xmlns:x="x:namespace" xmlns:y="y:namespace"> + <cont1 xmlns:z="z:namespace" xmlns:a="a:namespace" xmlns:b="b:namespace"> + <lf11 xmlns:c="identity:module">c:iden</lf11> + </cont1> +</cont>
\ No newline at end of file diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/xml-to-cnsn/data-of-several-modules/yang/module1.yang b/netconf/restconf/restconf-nb-bierman02/src/test/resources/xml-to-cnsn/data-of-several-modules/yang/module1.yang new file mode 100644 index 0000000..f6a81ae --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/xml-to-cnsn/data-of-several-modules/yang/module1.yang @@ -0,0 +1,16 @@ +module module1 { + namespace "module:one"; + + prefix "m1"; + revision 2014-01-17 { + } + + container cont_m1 { + leaf lf1_m1 { + type string; + } + } + container contB_m1 { + } + +}
\ No newline at end of file diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/xml-to-cnsn/data-of-several-modules/yang/module2.yang b/netconf/restconf/restconf-nb-bierman02/src/test/resources/xml-to-cnsn/data-of-several-modules/yang/module2.yang new file mode 100644 index 0000000..bdd8ece --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/xml-to-cnsn/data-of-several-modules/yang/module2.yang @@ -0,0 +1,17 @@ +module module2 { + namespace "module:two"; + + prefix "m2"; + revision 2014-01-17 { + } + + container cont_m2 { + leaf lf1_m2 { + type string; + } + } + container contB_m2 { + } + + +}
\ No newline at end of file diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/xml-to-cnsn/empty-data.xml b/netconf/restconf/restconf-nb-bierman02/src/test/resources/xml-to-cnsn/empty-data.xml new file mode 100644 index 0000000..7d62b9e --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/xml-to-cnsn/empty-data.xml @@ -0,0 +1,8 @@ +<cont> + <lf1></lf1> + <lflst1></lflst1> + <lflst1></lflst1> + <lst1> + <lf11></lf11> + </lst1> +</cont> diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/xml-to-cnsn/identityref/identity-module.yang b/netconf/restconf/restconf-nb-bierman02/src/test/resources/xml-to-cnsn/identityref/identity-module.yang new file mode 100644 index 0000000..09a34c5 --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/xml-to-cnsn/identityref/identity-module.yang @@ -0,0 +1,10 @@ +module identity-module { + namespace "identity:module"; + + prefix "idemod"; + revision 2013-12-02 { + } + + identity iden { + } +} diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/xml-to-cnsn/identityref/identityref-module.yang b/netconf/restconf/restconf-nb-bierman02/src/test/resources/xml-to-cnsn/identityref/identityref-module.yang new file mode 100644 index 0000000..e0ef1bb --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/xml-to-cnsn/identityref/identityref-module.yang @@ -0,0 +1,21 @@ +module identityref-module { + namespace "identityref:module"; + + prefix "iderefmod"; + + import identity-module {prefix idemo; revision-date 2013-12-02;} + + revision 2013-12-02 { + } + + container cont { + container cont1 { + leaf lf11 { + type identityref { + base "idemo:iden"; + } + } + } + } + +} diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/xml-to-cnsn/identityref/xml/data-default-nmspc-in-element.xml b/netconf/restconf/restconf-nb-bierman02/src/test/resources/xml-to-cnsn/identityref/xml/data-default-nmspc-in-element.xml new file mode 100644 index 0000000..ebf7ac6 --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/xml-to-cnsn/identityref/xml/data-default-nmspc-in-element.xml @@ -0,0 +1,5 @@ +<cont xmlns="general:module" xmlns:x="x:namespace" xmlns:y="y:namespace"> + <cont1 xmlns:z="z:namespace" xmlns:a="a:namespace" xmlns:b="b:namespace"> + <lf11 xmlns="identityref:module" xmlns:c="c:namespace">iden</lf11> + </cont1> +</cont>
\ No newline at end of file diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/xml-to-cnsn/identityref/xml/data-default-nmspc-in-parrent-element.xml b/netconf/restconf/restconf-nb-bierman02/src/test/resources/xml-to-cnsn/identityref/xml/data-default-nmspc-in-parrent-element.xml new file mode 100644 index 0000000..3fe1e4b --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/xml-to-cnsn/identityref/xml/data-default-nmspc-in-parrent-element.xml @@ -0,0 +1,5 @@ +<cont xmlns:x="x:namespace" xmlns:y="y:namespace"> + <cont1 xmlns="identityref:module" xmlns:z="z:namespace" xmlns:a="a:namespace" xmlns:b="b:namespace"> + <lf11 xmlns:c="c:namespace">iden</lf11> + </cont1> +</cont>
\ No newline at end of file diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/xml-to-cnsn/identityref/xml/data-nmspc-in-element.xml b/netconf/restconf/restconf-nb-bierman02/src/test/resources/xml-to-cnsn/identityref/xml/data-nmspc-in-element.xml new file mode 100644 index 0000000..76de72d --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/xml-to-cnsn/identityref/xml/data-nmspc-in-element.xml @@ -0,0 +1,5 @@ +<cont xmlns="identityref:module" xmlns:x="x:namespace" xmlns:y="y:namespace"> + <cont1 xmlns:z="z:namespace" xmlns:a="a:namespace" xmlns:b="b:namespace"> + <lf11 xmlns:c="identity:module">c:iden</lf11> + </cont1> +</cont>
\ No newline at end of file diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/xml-to-cnsn/identityref/xml/data-nmspc-in-parrent-element.xml b/netconf/restconf/restconf-nb-bierman02/src/test/resources/xml-to-cnsn/identityref/xml/data-nmspc-in-parrent-element.xml new file mode 100644 index 0000000..30a5418 --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/xml-to-cnsn/identityref/xml/data-nmspc-in-parrent-element.xml @@ -0,0 +1,5 @@ +<cont xmlns="identityref:module" xmlns:x="x:namespace" xmlns:y="y:namespace"> + <cont1 xmlns:c="identity:module" xmlns:z="z:namespace" xmlns:a="a:namespace" xmlns:b="b:namespace"> + <lf11>z:iden</lf11> + </cont1> +</cont>
\ No newline at end of file diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/xml-to-cnsn/identityref/xml/data-no-nmspc-value-with-prefix.xml b/netconf/restconf/restconf-nb-bierman02/src/test/resources/xml-to-cnsn/identityref/xml/data-no-nmspc-value-with-prefix.xml new file mode 100644 index 0000000..7d31fa7 --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/xml-to-cnsn/identityref/xml/data-no-nmspc-value-with-prefix.xml @@ -0,0 +1,5 @@ +<cont> + <cont1> + <lf11>x:iden</lf11> + </cont1> +</cont>
\ No newline at end of file diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/xml-to-cnsn/identityref/xml/data-no-nmspc-value-without-prefix.xml b/netconf/restconf/restconf-nb-bierman02/src/test/resources/xml-to-cnsn/identityref/xml/data-no-nmspc-value-without-prefix.xml new file mode 100644 index 0000000..c65df1a --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/xml-to-cnsn/identityref/xml/data-no-nmspc-value-without-prefix.xml @@ -0,0 +1,5 @@ +<cont> + <cont1> + <lf11>iden</lf11> + </cont1> +</cont>
\ No newline at end of file diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/xml-to-cnsn/identityref/yang-augments/general-module.yang b/netconf/restconf/restconf-nb-bierman02/src/test/resources/xml-to-cnsn/identityref/yang-augments/general-module.yang new file mode 100644 index 0000000..f1a1ea6 --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/xml-to-cnsn/identityref/yang-augments/general-module.yang @@ -0,0 +1,14 @@ +module general-module { + namespace "general:module"; + + prefix "genmod"; + revision 2013-12-12 { + } + + container cont { + container cont1 { + } + } + + +}
\ No newline at end of file diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/xml-to-cnsn/identityref/yang-augments/identity-module.yang b/netconf/restconf/restconf-nb-bierman02/src/test/resources/xml-to-cnsn/identityref/yang-augments/identity-module.yang new file mode 100644 index 0000000..09a34c5 --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/xml-to-cnsn/identityref/yang-augments/identity-module.yang @@ -0,0 +1,10 @@ +module identity-module { + namespace "identity:module"; + + prefix "idemod"; + revision 2013-12-02 { + } + + identity iden { + } +} diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/xml-to-cnsn/identityref/yang-augments/identityref-module.yang b/netconf/restconf/restconf-nb-bierman02/src/test/resources/xml-to-cnsn/identityref/yang-augments/identityref-module.yang new file mode 100644 index 0000000..8fd9002 --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/xml-to-cnsn/identityref/yang-augments/identityref-module.yang @@ -0,0 +1,20 @@ +module identityref-module { + namespace "identityref:module"; + + prefix "iderefmod"; + + import identity-module {prefix idemo; revision-date 2013-12-02;} + import general-module {prefix gmo; revision-date 2013-12-12;} + + revision 2013-12-02 { + } + + augment "/gmo:cont/gmo:cont1" { + leaf lf11 { + type identityref { + base "idemo:iden"; + } + } + } + +} diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/xml-to-cnsn/leafref/leafref-module b/netconf/restconf/restconf-nb-bierman02/src/test/resources/xml-to-cnsn/leafref/leafref-module new file mode 100644 index 0000000..6fe770b --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/xml-to-cnsn/leafref/leafref-module @@ -0,0 +1,61 @@ +module leafref-module { + namespace "leafref:module"; + + prefix "lfrfmo"; + revision 2013-11-18 { + } + + identity base {} + + container cont { + leaf lf1 { + type int32; + } + leaf lf2 { + type leafref { + path "/cont/lf1"; + } + } + + leaf lf-ident { + type identityref { + base "lfrfmo:base"; + } + } + + leaf lf-ident-ref { + type leafref { + path "/cont/lf-ident"; + } + } + + leaf lf-ident-ref-relative { + type leafref { + path "../lf-ident"; + } + } + + leaf lf-ident-ref-relative-cnd { + type leafref { + path "/lfrfmo:cont/lfrfmo:lis[lfrfmo:id='abc']/lf-ident-ref"; + } + } + + + list lis { + key "id"; + + leaf id { + type string; + } + + leaf lf-ident-ref { + type leafref { + path "/cont/lf-ident"; + } + } + } + + } + +}
\ No newline at end of file diff --git a/netconf/restconf/restconf-nb-bierman02/src/test/resources/xml-to-cnsn/leafref/xml/data.xml b/netconf/restconf/restconf-nb-bierman02/src/test/resources/xml-to-cnsn/leafref/xml/data.xml new file mode 100644 index 0000000..c3071e5 --- /dev/null +++ b/netconf/restconf/restconf-nb-bierman02/src/test/resources/xml-to-cnsn/leafref/xml/data.xml @@ -0,0 +1,8 @@ +<cont> + <lf1>121</lf1> + <lf2>121</lf2> + <lf-ident xmlns:a="leafref:module">a:base</lf-ident> + <lf-ident-ref xmlns:a="leafref:module">a:base</lf-ident-ref> + <lf-ident-ref-relative xmlns:a="leafref:module">a:base</lf-ident-ref-relative> + <lf-ident-ref-relative-cnd xmlns:a="leafref:module">a:base</lf-ident-ref-relative-cnd> +</cont>
\ No newline at end of file |