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