c7463432527dc71883f2722f1f2d9d4963646ac7
[transportpce.git] / ordmodels / network / src / main / yang / ietf-network@2015-06-08.yang
1 module ietf-network {\r
2   yang-version 1;\r
3   namespace "urn:ietf:params:xml:ns:yang:ietf-network";\r
4   prefix nd;\r
5 \r
6   import ietf-inet-types {\r
7     prefix inet;\r
8   }\r
9 \r
10   organization "TBD";\r
11   contact\r
12     "WILL-BE-DEFINED-LATER";\r
13   description\r
14     "This module defines a common base model for a collection \r
15      of nodes in a network. Node definitions s are further used\r
16      in network topologies and inventories.";\r
17 \r
18   revision 2015-06-08 {\r
19     description\r
20       "Initial revision.";\r
21     reference "draft-ietf-i2rs-yang-network-topo-01";\r
22   }\r
23 \r
24   typedef node-id {\r
25     type inet:uri;\r
26     description\r
27       "Identifier for a node.";\r
28   }\r
29 \r
30   typedef network-id {\r
31     type inet:uri;\r
32     description\r
33       "Identifier for a network.";\r
34   }\r
35 \r
36   grouping network-ref {\r
37     description\r
38       "Contains the information necessary to reference a network,\r
39        for example an underlay network.";\r
40     leaf network-ref {\r
41       type leafref {\r
42         path "/network/network-id";\r
43       }\r
44       description\r
45         "Used to reference a network, for example an underlay\r
46          network.";\r
47     }\r
48   }\r
49 \r
50   grouping node-ref {\r
51     description \r
52       "Contains the information necessary to reference a node.";\r
53     leaf node-ref {\r
54       type leafref {\r
55         path "/network[network-id=current()/../network-ref]"+\r
56           "/node/node-id";\r
57       }\r
58       description\r
59         "Used to reference a node.  \r
60          Nodes are identified relative to the network they are\r
61          contained in.";\r
62     }\r
63     uses network-ref;\r
64   }\r
65 \r
66   list network {\r
67     key "network-id";\r
68     description\r
69       "Describes a network.\r
70        A network typically contains an inventory of nodes,\r
71        topological information (augmented through \r
72        network-topology model), as well as layering \r
73        information.";\r
74     container network-types {\r
75       description\r
76         "Serves as an augmentation target.  \r
77          The network type is indicated through corresponding\r
78          presence containers augmented into this container.";\r
79     }\r
80     leaf network-id {\r
81       type network-id;\r
82       description\r
83         "Identifies a network.";\r
84     }\r
85     leaf server-provided {\r
86       type boolean;\r
87       config false;\r
88       description\r
89         "Indicates whether the information concerning this\r
90          particular network is populated by the server \r
91          (server-provided true, the general case for network \r
92          information discovered from the server), \r
93          or whether it is configured by a client \r
94          (server-provided true, possible e.g. for \r
95          service overlays managed through a controller).";\r
96     }\r
97     list supporting-network {\r
98       key "network-ref";\r
99       description\r
100         "An underlay network, used to represent layered network\r
101          topologies.";\r
102       leaf network-ref {\r
103         type leafref {\r
104           path "/network/network-id";\r
105         }\r
106         description\r
107           "References the underlay network.";\r
108       }\r
109     }\r
110     list node {\r
111       key "node-id";\r
112       description\r
113         "The inventory of nodes of this network.";\r
114       leaf node-id {\r
115         type node-id;\r
116         description\r
117           "Identifies a node uniquely within the containing \r
118            network.";\r
119       }\r
120       list supporting-node {\r
121         key "network-ref node-ref";\r
122         description\r
123           "Represents another node, in an underlay network, that \r
124            this node is supported by.  Used to represent layering \r
125            structure.";\r
126         leaf network-ref {\r
127           type leafref {\r
128             path "../../../supporting-network/network-ref";\r
129           }\r
130           description\r
131             "References the underlay network that the \r
132              underlay node is part of.";\r
133         }\r
134         leaf node-ref {\r
135           type leafref {\r
136             path "/network/node/node-id";\r
137           }\r
138           description\r
139             "References the underlay node itself.";\r
140         }\r
141       }\r
142     }\r
143   }\r
144 }\r