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