|
|
@@ -74,31 +74,31 @@ Suppose there is such a piece of YANG circuitry:
|
|
|
|
|
|
```
|
|
|
module ttt {
|
|
|
-namespace "urn:ttt";
|
|
|
-prefix ttt;
|
|
|
-
|
|
|
-container test {
|
|
|
-list iface {
|
|
|
-key "name";
|
|
|
-
|
|
|
-leaf name {
|
|
|
-type string;
|
|
|
-}
|
|
|
-
|
|
|
-leaf comment {
|
|
|
-type string;
|
|
|
-}
|
|
|
-
|
|
|
-leaf type {
|
|
|
-type enumeration {
|
|
|
-enum ethernet;
|
|
|
-enum ppp;
|
|
|
-enum dummy;
|
|
|
-}
|
|
|
-}
|
|
|
-
|
|
|
-}
|
|
|
-}
|
|
|
+ namespace "urn:ttt";
|
|
|
+ prefix ttt;
|
|
|
+
|
|
|
+ container test {
|
|
|
+ list iface {
|
|
|
+ key "name";
|
|
|
+
|
|
|
+ leaf name {
|
|
|
+ type string;
|
|
|
+ }
|
|
|
+
|
|
|
+ leaf comment {
|
|
|
+ type string;
|
|
|
+ }
|
|
|
+
|
|
|
+ leaf type {
|
|
|
+ type enumeration {
|
|
|
+ enum ethernet;
|
|
|
+ enum ppp;
|
|
|
+ enum dummy;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
```
|
|
|
@@ -371,17 +371,17 @@ only the contents of the specified section will be displayed. By default, the co
|
|
|
[edit]
|
|
|
# show
|
|
|
test
|
|
|
-iface eth0
|
|
|
-comment "Test desc"
|
|
|
-type ethernet
|
|
|
+ iface eth0
|
|
|
+ comment "Test desc"
|
|
|
+ type ethernet
|
|
|
acl acl2
|
|
|
acl acl3
|
|
|
acl acl1
|
|
|
[edit]
|
|
|
# show test
|
|
|
iface eth0
|
|
|
-comment "Test desc"
|
|
|
-type ethernet
|
|
|
+ comment "Test desc"
|
|
|
+ type ethernet
|
|
|
```
|
|
|
|
|
|
|
|
|
@@ -394,9 +394,9 @@ configurations.
|
|
|
[edit]
|
|
|
# show
|
|
|
test
|
|
|
-iface eth0
|
|
|
-comment "Test desc"
|
|
|
-type ethernet
|
|
|
+ iface eth0
|
|
|
+ comment "Test desc"
|
|
|
+ type ethernet
|
|
|
acl acl2
|
|
|
acl acl3
|
|
|
acl acl1
|
|
|
@@ -406,16 +406,16 @@ acl acl1
|
|
|
[edit]
|
|
|
# show
|
|
|
test
|
|
|
-iface eth0
|
|
|
-comment "New comment"
|
|
|
-type ethernet
|
|
|
+ iface eth0
|
|
|
+ comment "New comment"
|
|
|
+ type ethernet
|
|
|
acl acl2
|
|
|
acl acl1
|
|
|
acl acl4
|
|
|
## diff
|
|
|
test
|
|
|
-iface eth0
|
|
|
-= comment "New comment"
|
|
|
+ iface eth0
|
|
|
+= comment "New comment"
|
|
|
-acl acl3
|
|
|
+acl acl4
|
|
|
```
|
|
|
@@ -454,10 +454,10 @@ nesting levels.
|
|
|
|
|
|
```
|
|
|
test {
|
|
|
-iface eth0 {
|
|
|
-comment "Test desc"
|
|
|
-type ethernet
|
|
|
-}
|
|
|
+ iface eth0 {
|
|
|
+ comment "Test desc"
|
|
|
+ type ethernet
|
|
|
+ }
|
|
|
}
|
|
|
```
|
|
|
|
|
|
@@ -471,11 +471,11 @@ showing the configuration, display the `;` character at the end of lines with "l
|
|
|
(`leaf' nodes).
|
|
|
|
|
|
```
|
|
|
-test
|
|
|
-iface eth0 {
|
|
|
-comment "Test desc";
|
|
|
-type ethernet;
|
|
|
-}
|
|
|
+test {
|
|
|
+ iface eth0 {
|
|
|
+ comment "Test desc";
|
|
|
+ type ethernet;
|
|
|
+ }
|
|
|
}
|
|
|
```
|
|
|
|
|
|
@@ -564,30 +564,30 @@ Example of a YANG file using default keys:
|
|
|
import klish { prefix "klish"; }
|
|
|
...
|
|
|
list list {
|
|
|
-key "key1 key2 key3";
|
|
|
-leaf key1 {
|
|
|
-description "First key";
|
|
|
-type string;
|
|
|
-klish:default "def1";
|
|
|
-}
|
|
|
-leaf key2 {
|
|
|
-description "Second key";
|
|
|
-type string;
|
|
|
-klish:default "def2";
|
|
|
-}
|
|
|
-leaf key3 {
|
|
|
-description "Third key";
|
|
|
-type string;
|
|
|
-}
|
|
|
-leaf el1 {
|
|
|
-description "First el";
|
|
|
-type string;
|
|
|
-default "el1-def";
|
|
|
-}
|
|
|
-leaf el2 {
|
|
|
-description "Second el";
|
|
|
-type string;
|
|
|
-}
|
|
|
+ key "key1 key2 key3";
|
|
|
+ leaf key1 {
|
|
|
+ description "First key";
|
|
|
+ type string;
|
|
|
+ klish:default "def1";
|
|
|
+ }
|
|
|
+ leaf key2 {
|
|
|
+ description "Second key";
|
|
|
+ type string;
|
|
|
+ klish:default "def2";
|
|
|
+ }
|
|
|
+ leaf key3 {
|
|
|
+ description "Third key";
|
|
|
+ type string;
|
|
|
+ }
|
|
|
+ leaf el1 {
|
|
|
+ description "First el";
|
|
|
+ type string;
|
|
|
+ default "el1-def";
|
|
|
+ }
|
|
|
+ leaf el2 {
|
|
|
+ description "Second el";
|
|
|
+ type string;
|
|
|
+ }
|
|
|
}
|
|
|
```
|
|
|
|
|
|
@@ -599,7 +599,7 @@ since they have default values:
|
|
|
# show
|
|
|
...
|
|
|
list key1 def1 key2 def2 key3 nnn {
|
|
|
-el1 mmm
|
|
|
+ el1 mmm
|
|
|
}
|
|
|
...
|
|
|
```
|
|
|
@@ -627,8 +627,8 @@ YANG module, wherein one of the fields is labeled "password".
|
|
|
import klish { prefix "klish"; }
|
|
|
...
|
|
|
leaf pass {
|
|
|
-type string;
|
|
|
-klish:password;
|
|
|
+ type string;
|
|
|
+ klish:password;
|
|
|
}
|
|
|
...
|
|
|
```
|
|
|
@@ -687,14 +687,14 @@ with no descendants will also be shown without opening and closing brackets.
|
|
|
|
|
|
```
|
|
|
<PLUGIN name="sysrepo">
|
|
|
-ShowBrackets = y
|
|
|
-ShowSemicolons = y
|
|
|
-KeysWithStatement = y
|
|
|
-FirstKeyWithStatement = n
|
|
|
-Colorize = y
|
|
|
-Indent = 2
|
|
|
-HidePasswords = y
|
|
|
-DefaultKeys = y
|
|
|
-EnableNACM = n
|
|
|
+ ShowBrackets = y
|
|
|
+ ShowSemicolons = y
|
|
|
+ KeysWithStatement = y
|
|
|
+ FirstKeyWithStatement = n
|
|
|
+ Colorize = y
|
|
|
+ Indent = 2
|
|
|
+ HidePasswords = y
|
|
|
+ DefaultKeys = y
|
|
|
+ EnableNACM = n
|
|
|
</PLUGIN>.
|
|
|
```
|