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