--- /dev/null
+module ietf-network {\r
+ yang-version 1;\r
+ namespace "urn:ietf:params:xml:ns:yang:ietf-network";\r
+ prefix nd;\r
+\r
+ import ietf-inet-types {\r
+ prefix inet;\r
+ }\r
+\r
+ organization "TBD";\r
+ contact\r
+ "WILL-BE-DEFINED-LATER";\r
+ description\r
+ "This module defines a common base model for a collection \r
+ of nodes in a network. Node definitions s are further used\r
+ in network topologies and inventories.";\r
+\r
+ revision 2015-06-08 {\r
+ description\r
+ "Initial revision.";\r
+ reference "draft-ietf-i2rs-yang-network-topo-01";\r
+ }\r
+\r
+ typedef node-id {\r
+ type inet:uri;\r
+ description\r
+ "Identifier for a node.";\r
+ }\r
+\r
+ typedef network-id {\r
+ type inet:uri;\r
+ description\r
+ "Identifier for a network.";\r
+ }\r
+\r
+ grouping network-ref {\r
+ description\r
+ "Contains the information necessary to reference a network,\r
+ for example an underlay network.";\r
+ leaf network-ref {\r
+ type leafref {\r
+ path "/network/network-id";\r
+ }\r
+ description\r
+ "Used to reference a network, for example an underlay\r
+ network.";\r
+ }\r
+ }\r
+\r
+ grouping node-ref {\r
+ description \r
+ "Contains the information necessary to reference a node.";\r
+ leaf node-ref {\r
+ type leafref {\r
+ path "/network[network-id=current()/../network-ref]"+\r
+ "/node/node-id";\r
+ }\r
+ description\r
+ "Used to reference a node. \r
+ Nodes are identified relative to the network they are\r
+ contained in.";\r
+ }\r
+ uses network-ref;\r
+ }\r
+\r
+ list network {\r
+ key "network-id";\r
+ description\r
+ "Describes a network.\r
+ A network typically contains an inventory of nodes,\r
+ topological information (augmented through \r
+ network-topology model), as well as layering \r
+ information.";\r
+ container network-types {\r
+ description\r
+ "Serves as an augmentation target. \r
+ The network type is indicated through corresponding\r
+ presence containers augmented into this container.";\r
+ }\r
+ leaf network-id {\r
+ type network-id;\r
+ description\r
+ "Identifies a network.";\r
+ }\r
+ leaf server-provided {\r
+ type boolean;\r
+ config false;\r
+ description\r
+ "Indicates whether the information concerning this\r
+ particular network is populated by the server \r
+ (server-provided true, the general case for network \r
+ information discovered from the server), \r
+ or whether it is configured by a client \r
+ (server-provided true, possible e.g. for \r
+ service overlays managed through a controller).";\r
+ }\r
+ list supporting-network {\r
+ key "network-ref";\r
+ description\r
+ "An underlay network, used to represent layered network\r
+ topologies.";\r
+ leaf network-ref {\r
+ type leafref {\r
+ path "/network/network-id";\r
+ }\r
+ description\r
+ "References the underlay network.";\r
+ }\r
+ }\r
+ list node {\r
+ key "node-id";\r
+ description\r
+ "The inventory of nodes of this network.";\r
+ leaf node-id {\r
+ type node-id;\r
+ description\r
+ "Identifies a node uniquely within the containing \r
+ network.";\r
+ }\r
+ list supporting-node {\r
+ key "network-ref node-ref";\r
+ description\r
+ "Represents another node, in an underlay network, that \r
+ this node is supported by. Used to represent layering \r
+ structure.";\r
+ leaf network-ref {\r
+ type leafref {\r
+ path "../../../supporting-network/network-ref";\r
+ }\r
+ description\r
+ "References the underlay network that the \r
+ underlay node is part of.";\r
+ }\r
+ leaf node-ref {\r
+ type leafref {\r
+ path "/network/node/node-id";\r
+ }\r
+ description\r
+ "References the underlay node itself.";\r
+ }\r
+ }\r
+ }\r
+ }\r
+}\r