SelfResolutionWithLeafrefInGrouping.yang 852 Bytes
module ietf-network {
     yang-version 1;
     namespace "urn:ietf:params:xml:ns:yang:ietf-network";
     prefix nd;

     import ietf-inet-types {
       prefix inet;
     }
     typedef node-id {
       type inet:uri;
       description
         "Identifier for a node.";
     }

     leaf xyz {
         type string;
     }
     typedef network-id {
       type inet:uri;
       description
         "Identifier for a network.";
     }
     grouping network-ref {
       description
         "Contains the information necessary to reference a network,
          for example an underlay network.";
       leaf network-ref {
         type leafref {
           path "/nd:xyz";
         require-instance false;
         }
         description
           "Used to reference a network, for example an underlay
            network.";
       }
     }
   }