github.com/openconfig/goyang@v1.4.5/pkg/yang/testdata/deviate-replace.yang (about)

     1  module deviate {
     2      prefix "d";
     3      namespace "urn:d";
     4  
     5      grouping substmts {
     6          leaf config {
     7              type string;
     8              config true;
     9          }
    10          leaf default {
    11              type string;
    12              default "fish";
    13          }
    14          leaf-list default-list {
    15              type string;
    16              default "fish";
    17              default "sticks";
    18          }
    19          leaf mandatory {
    20              type string;
    21              mandatory false;
    22          }
    23          leaf-list max-elements {
    24              type string;
    25              max-elements 1000;
    26          }
    27          leaf-list min-elements {
    28              type string;
    29              min-elements 1000;
    30          }
    31          leaf-list max-and-min-elements {
    32              type string;
    33              max-elements 1024;
    34              min-elements 1;
    35          }
    36          leaf type {
    37              type string;
    38          }
    39          // TODO(robjs): unique for deviation
    40          leaf units {
    41              type uint16;
    42              units "nanofish per millenium";
    43          }
    44      }
    45  
    46      container target {
    47          container replace {
    48              uses substmts;
    49          }
    50      }
    51  
    52      deviation /target/replace/config {
    53          deviate replace {
    54              config false;
    55          }
    56      }
    57  
    58      deviation /target/replace/default {
    59          deviate replace {
    60              default "a default value";
    61          }
    62      }
    63  
    64      deviation /target/replace/default-list {
    65          deviate replace {
    66              default "nematodes";
    67          }
    68      }
    69  
    70      deviation /target/replace/mandatory {
    71          deviate replace {
    72              mandatory true;
    73          }
    74      }
    75  
    76      deviation /target/replace/min-elements {
    77          deviate replace {
    78              min-elements 42;
    79          }
    80      }
    81  
    82      deviation /target/replace/max-elements {
    83          deviate replace {
    84              max-elements 42;
    85          }
    86      }
    87  
    88      deviation /target/replace/max-and-min-elements {
    89          deviate replace {
    90              max-elements 42;
    91              min-elements 42;
    92          }
    93      }
    94  
    95      deviation /target/replace/type {
    96          deviate replace {
    97              type uint16;
    98          }
    99      }
   100  
   101      deviation /target/replace/units {
   102          deviate replace {
   103              units "fish per second";
   104          }
   105      }
   106  }