downgrade dependencies to stable/fluorine SR1
[transportpce.git] / tests / ordmodels_2_1 / ietf-network-topology@2015-06-08.yang
1 module ietf-network-topology {
2   yang-version 1;
3   namespace "urn:ietf:params:xml:ns:yang:ietf-network-topology";
4   prefix lnk;
5
6   import ietf-inet-types {
7     prefix inet;
8   }
9   import ietf-network {
10     prefix nd;
11   }
12
13   organization "TBD";
14   contact
15     "WILL-BE-DEFINED-LATER";
16   description
17     "This module defines a common base model for network topology,
18      augmenting the base network model with links to connect nodes,
19      as well as termination points to terminate links on nodes.";
20
21   revision 2015-06-08 {
22     description
23       "Initial revision.";
24     reference "draft-ietf-i2rs-yang-network-topo-01";
25   }
26
27   typedef link-id {
28     type inet:uri;
29     description
30       "An identifier for a link in a topology.
31        The identifier may be opaque.
32        The identifier SHOULD be chosen such that the same link in a
33        real network topology will always be identified through the
34        same identifier, even if the model is instantiated in
35        separate datastores. An implementation MAY choose to capture
36        semantics in the identifier, for example to indicate the type
37        of link and/or the type of topology that the link is a part
38        of.";
39   }
40
41   typedef tp-id {
42     type inet:uri;
43     description
44       "An identifier for termination points on a node.
45        The identifier may be opaque.
46        The identifier SHOULD be chosen such that the same TP in a
47        real network topology will always be identified through the
48        same identifier, even if the model is instantiated in
49        separate datastores. An implementation MAY choose to capture
50        semantics in the identifier, for example to indicate the type
51        of TP and/or the type of node and topology that the TP is a
52        part of.";
53   }
54
55   grouping link-ref {
56     description
57       "References a link in a specific network.";
58     leaf link-ref {
59       type leafref {
60         path "/nd:network[nd:network-id=current()/../"+
61           "nd:network-ref]/link/link-id";
62       }
63       description
64         "A type for an absolute reference a link instance.
65          (This type should not be used for relative references.
66          In such a case, a relative path should be used instead.)";
67     }
68     uses nd:network-ref;
69   }
70
71   grouping tp-ref {
72     description
73       "References a termination point in a specific node.";
74     leaf tp-ref {
75       type leafref {
76         path "/nd:network[nd:network-id=current()/../"+
77           "nd:network-ref]/nd:node[nd:node-id=current()/../"+
78           "nd:node-ref]/termination-point/tp-id";
79       }
80       description
81         "A type for an absolute reference to a termination point.
82          (This type should not be used for relative references.
83          In such a case, a relative path should be used instead.)";
84     }
85     uses nd:node-ref;
86   }
87
88   augment "/nd:network" {
89     description
90       "Add links to the network model.";
91     list link {
92       key "link-id";
93       description
94         "A Network Link connects a by Local (Source) node and
95          a Remote (Destination) Network Nodes via a set of the
96          nodes' termination points.
97          As it is possible to have several links between the same
98          source and destination nodes, and as a link could
99          potentially be re-homed between termination points, to
100          ensure that we would always know to distinguish between
101          links, every link is identified by a dedicated link
102          identifier.
103          Note that a link models a point-to-point link, not a
104          multipoint link.
105          Layering dependencies on links in underlay topologies are
106          not represented as the layering information of nodes and of
107          termination points is sufficient.";
108       container source {
109         description
110           "This container holds the logical source of a particular
111            link.";
112         leaf source-node {
113           type leafref {
114             path "../../../nd:node/nd:node-id";
115           }
116           mandatory true;
117           description
118             "Source node identifier, must be in same topology.";
119         }
120         leaf source-tp {
121           type leafref {
122             path "../../../nd:node[nd:node-id=current()/../"+
123               "source-node]/termination-point/tp-id";
124           }
125           description
126             "Termination point within source node that terminates
127              the link.";
128         }
129       }
130       container destination {
131         description
132           "This container holds the logical destination of a
133            particular link.";
134         leaf dest-node {
135           type leafref {
136             path "../../../nd:node/nd:node-id";
137           }
138           mandatory true;
139           description
140             "Destination node identifier, must be in the same
141              network.";
142         }
143         leaf dest-tp {
144           type leafref {
145             path "../../../nd:node[nd:node-id=current()/../"+
146               "dest-node]/termination-point/tp-id";
147           }
148           description
149             "Termination point within destination node that
150              terminates the link.";
151         }
152       }
153       leaf link-id {
154         type link-id;
155         description
156           "The identifier of a link in the topology.
157            A link is specific to a topology to which it belongs.";
158       }
159       list supporting-link {
160         key "network-ref link-ref";
161         description
162           "Identifies the link, or links, that this link
163            is dependent on.";
164         leaf network-ref {
165           type leafref {
166             path "../../../nd:supporting-network/nd:network-ref";
167           }
168           description
169             "This leaf identifies in which underlay topology
170              supporting link is present.";
171         }
172         leaf link-ref {
173           type leafref {
174             path "/nd:network[nd:network-id=current()/.."+
175               "/network-ref]/link/link-id";
176           }
177           description
178             "This leaf identifies a link which is a part
179              of this link's underlay. Reference loops, in which
180              a link identifies itself as its underlay, either
181              directly or transitively, are not allowed.";
182         }
183       }
184     }
185   }
186   augment "/nd:network/nd:node" {
187     description
188       "Augment termination points which terminate links.
189        Termination points can ultimately be mapped to interfaces.";
190     list termination-point {
191       key "tp-id";
192       description
193         "A termination point can terminate a link.
194          Depending on the type of topology, a termination point
195          could, for example, refer to a port or an interface.";
196       leaf tp-id {
197         type tp-id;
198         description
199           "Termination point identifier.";
200       }
201       list supporting-termination-point {
202         key "network-ref node-ref tp-ref";
203         description
204           "The leaf list identifies any termination points that
205            the termination point is dependent on, or maps onto.
206            Those termination points will themselves be contained
207            in a supporting node.
208            This dependency information can be inferred from
209            the dependencies between links.  For this reason,
210            this item is not separately configurable.  Hence no
211            corresponding constraint needs to be articulated.
212            The corresponding information is simply provided by the
213            implementing system.";
214         leaf network-ref {
215           type leafref {
216             path "../../../nd:supporting-node/nd:network-ref";
217           }
218           description
219             "This leaf identifies in which topology the
220              supporting termination point is present.";
221         }
222         leaf node-ref {
223           type leafref {
224             path "../../../nd:supporting-node/nd:node-ref";
225           }
226           description
227             "This leaf identifies in which node the supporting
228              termination point is present.";
229         }
230         leaf tp-ref {
231           type leafref {
232             path "/nd:network[nd:network-id=current()/../"+
233               "network-ref]/nd:node[nd:node-id=current()/../"+
234               "node-ref]/termination-point/tp-id";
235           }
236           description
237             "Reference to the underlay node, must be in a
238              different topology";
239         }
240       }
241     }
242   }
243 }