add pceOtnNodeTest class
[transportpce.git] / api / src / main / yang / gnpy-network-topology@2018-12-14.yang
1 module gnpy-network-topology {
2   yang-version 1;
3   namespace "gnpy:gnpy-network-topology";
4   prefix gnpynt;
5
6   import gnpy-eqpt-config {
7     prefix geqpt;
8   }
9   import ietf-inet-types {
10     prefix inet;
11   }
12
13   organization
14     "Telecom Infra Project OOPT PSE Working Group";
15   contact
16     "WG Web:   <https://github.com/Telecominfraproject/oopt-gnpy>
17      contact:  <mailto:ahmed.triki@orange.com>
18      contact:  <mailto:esther.lerouzic@orange.com>
19     ";
20   description
21     "YANG model for gnpy network input for path computation - transportPCE preversion";
22
23   revision 2018-12-14 {
24     description
25       "first draft";
26     reference
27       "YANG model for network input for path computation with gnpy";
28   }
29
30   identity type-element {
31     description
32       "Base identity for element type";
33   }
34
35   identity Transceiver {
36     base type-element;
37     description
38       " Transceiver element";
39   }
40
41   identity Fiber {
42     base type-element;
43     description
44       "Fiber element";
45   }
46
47   identity Roadm {
48     base type-element;
49     description
50       "Roadm element";
51   }
52
53   identity Edfa {
54     base type-element;
55     description
56       "Edfa element";
57   }
58
59   identity Fused {
60     base type-element;
61     description
62       "Fused element";
63   }
64
65   identity length-unit {
66     description
67       "length unit";
68   }
69
70   identity km {
71     base length-unit;
72     description
73       "kilometers";
74   }
75
76   identity m {
77     base length-unit;
78     description
79       "meter";
80   }
81
82   typedef Coordinate {
83     type decimal64 {
84       fraction-digits 6;
85     }
86   }
87
88   typedef te-node-id {
89     type inet:ip-address;
90     description
91       "An identifier for a node in a topology.
92        The identifier is represented as 32-bit unsigned integer in
93        the dotted-quad notation.
94        This attribute is mapped to Router ID in
95        RFC3630, RFC5329, RFC5305, and RFC6119.";
96   }
97
98   typedef Coef {
99     type decimal64 {
100       fraction-digits 2;
101     }
102   }
103
104   grouping location-attributes {
105     container location {
106       leaf city {
107         type string;
108         mandatory true;
109       }
110       leaf region {
111         type string;
112         mandatory true;
113       }
114       leaf latitude {
115         type Coordinate;
116         mandatory true;
117       }
118       leaf longitude {
119         type Coordinate;
120         mandatory true;
121       }
122     }
123   }
124
125   grouping fiber-params {
126     description
127       ".....";
128     leaf length {
129       type decimal64 {
130         fraction-digits 2;
131       }
132       mandatory true;
133     }
134     leaf loss_coef {
135       type decimal64 {
136         fraction-digits 2;
137       }
138       mandatory true;
139     }
140     leaf length_units {
141       type identityref {
142         base length-unit;
143       }
144       mandatory true;
145     }
146     leaf att_in {
147       type decimal64 {
148         fraction-digits 2;
149       }
150       mandatory true;
151     }
152     leaf con_in {
153       type decimal64 {
154         fraction-digits 2;
155       }
156       mandatory true;
157     }
158     leaf con_out {
159       type decimal64 {
160         fraction-digits 2;
161       }
162       mandatory true;
163     }
164   }
165
166   grouping edfa-params {
167     container operational {
168       description
169         "Operational values for the Edfa ";
170       leaf gain-target {
171         type decimal64 {
172           fraction-digits 2;
173         }
174         units "dB";
175         mandatory true;
176         description
177           "..";
178       }
179       leaf tilt-target {
180         type decimal64 {
181           fraction-digits 2;
182         }
183         mandatory true;
184         description
185           "..";
186       }
187       leaf out-voa {
188         type decimal64 {
189           fraction-digits 2;
190         }
191         units "dB";
192         mandatory true;
193         description
194           "..";
195       }
196     }
197   }
198
199   grouping roadm-params {
200     leaf target_pch_out_db {
201       type decimal64 {
202         fraction-digits 2;
203       }
204       units "dB";
205       description
206         "..";
207     }
208   }
209
210   grouping transceiver-params;
211
212   grouping fused-params;
213
214   grouping element-type-choice {
215     choice element-type {
216       case Edfa {
217         when "type = 'Edfa'";
218         uses edfa-params;
219       }
220       case FiberRoadm {
221         container params {
222           choice fiberroadm {
223             case Fiber {
224               when "type = 'Fiber'";
225               uses fiber-params;
226             }
227             case Roadm {
228               when "type = 'Roadm'";
229               uses roadm-params;
230             }
231           }
232         }
233       }
234       case Transceiver {
235         when "type = 'Transceiver'";
236       }
237       case Fused {
238         when "type = 'Fused'";
239       }
240     }
241   }
242
243   grouping topo {
244     list elements {
245       key "uid";
246       leaf uid {
247         type string;
248       }
249       leaf type {
250         type identityref {
251           base type-element;
252         }
253         mandatory true;
254       }
255       leaf type_variety {
256         type string;
257         mandatory false;
258       }
259       container metadata {
260         uses location-attributes;
261       }
262       uses element-type-choice;
263     }
264     list connections {
265       config false;
266       leaf from_node {
267         type leafref {
268           path "/topo/elements/uid";
269         }
270       }
271       leaf to_node {
272         type leafref {
273           path "/topo/elements/uid";
274         }
275       }
276     }
277   }
278 }