f70b7d601c5bfab21ed61d008513f99d37a2ad4c
[transportpce.git] / ordmodels / service / src / main / yang / org-openroadm-common-service-types@2016-10-14.yang
1 module org-openroadm-common-service-types {
2   namespace "http://org/openroadm/common/service/types";
3   prefix org-openroadm-common-service-types;
4
5   import ietf-yang-types {
6     prefix yang;
7   }
8   import ietf-inet-types {
9     prefix inet;
10   }
11   import org-openroadm-routing-constraints {
12      prefix org-openroadm-routing-constraints;
13      revision-date 2016-10-14;
14   }
15   import org-openroadm-topology {
16     prefix org-openroadm-topology;
17   }
18   import org-openroadm-common-types {
19      prefix org-openroadm-common-types;
20      revision-date 2016-10-14;
21   }
22   import org-openroadm-resource-types {
23     prefix org-openroadm-resource-types;
24   }
25
26   organization
27     "Open ROADM MSA";
28   contact
29     "OpenROADM.org";
30   description
31     "YANG definitions of common service types.
32
33       Copyright of the Members of the Open ROADM MSA Agreement dated (c) 2016,
34       AT&T Intellectual Property.  All other rights reserved.
35
36       Redistribution and use in source and binary forms, with or without modification,
37       are permitted provided that the following conditions are met:
38
39       * Redistributions of source code must retain the above copyright notice, this
40         list of conditions and the following disclaimer.
41       * Redistributions in binary form must reproduce the above copyright notice,
42         this list of conditions and the following disclaimer in the documentation and/or
43         other materials provided with the distribution.
44       * Neither the Members of the Open ROADM MSA Agreement nor the names of its
45         contributors may be used to endorse or promote products derived from this software
46         without specific prior written permission.
47
48       THIS SOFTWARE IS PROVIDED BY THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT ''AS IS''
49       AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
50       WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
51       IN NO EVENT THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT BE LIABLE FOR ANY DIRECT,
52       INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
53       NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;  LOSS OF USE, DATA,
54       OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
55       WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
56       ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
57       POSSIBILITY OF SUCH DAMAGE";
58
59   revision 2016-10-14 {
60     description
61       "Version 1.2";
62   }
63
64   grouping configuration-response-common {
65     container configuration-response-common {
66       leaf request-id {
67         type string;
68         mandatory true;
69       }
70       leaf response-code {
71         type string;
72         mandatory true;
73       }
74       leaf response-message {
75         type string;
76       }
77       leaf ack-final-indicator {
78         type string;
79         mandatory true;
80       }
81     }
82   }
83
84   grouping response-parameters {
85     container response-parameters {
86       uses org-openroadm-routing-constraints:routing-constraints;
87     }
88   }
89
90   grouping service-endpoint {
91     leaf service-format {
92       type service-format;
93       mandatory true;
94       description
95         "Format of the requested service: Ethernet, OTU, etc.";
96     }
97     leaf service-rate {
98       when "../service-format!='OMS'"{
99         description "service rate not applicable when service
100         format is roadmline";
101       }
102       type uint32;
103       mandatory true;
104       description
105         "Rate of the requested service in GBps";
106     }
107     leaf clli {
108       type string;
109       mandatory true;
110       description
111         "CLLI";
112     }
113     uses org-openroadm-resource-types:device-id;
114     container site;
115     container tx-direction {
116       uses service-port;
117       uses service-lgx;
118       uses service-tail;
119     }
120     container rx-direction {
121       uses service-port;
122       uses service-lgx;
123       uses service-tail;
124     }
125     leaf optic-type {
126       type org-openroadm-common-types:optic-types;
127     }
128     container router {
129       description
130         "Needed for communication with DWDM pluggable";
131       leaf node-id {
132         type string;
133         description
134           "Node id. This is reported against the service, but may not get reflected in the service in the network.";
135       }
136       leaf ip-address {
137         type inet:ip-address;
138         description
139           "Router IP Address. This is reported against the service, but may not get reflected in the service in the network.";
140       }
141       leaf url {
142         type string;
143         description
144           "URL needed for communication with DWDM pluggable. This is reported against the service, but may not get reflected in the service in the network.";
145       }
146     }
147     leaf user-label {
148       type string;
149       mandatory false;
150       description
151         "Label for service endpoint, defined by the user";
152     }
153   }
154
155   typedef rpc-actions {
156     description "rpc-actions include all the rpc methods";
157     type enumeration {
158       enum service-create {
159         value "1";
160       }
161       enum service-feasibility-check {
162         value "2";
163       }
164       enum service-delete {
165         value "3";
166       }
167       enum equipment-notification {
168         value "4";
169       }
170       enum temp-service-create {
171         value "5";
172       }
173       enum temp-service-delete {
174         value "6";
175       }
176       enum service-roll {
177         value "7";
178       }
179       enum service-reconfigure {
180         value "8";
181       }
182       enum service-restoration {
183         value "9";
184       }
185       enum service-reversion {
186         value "10";
187       }
188       enum service-reroute {
189         value "11";
190       }
191       enum service-reroute-confirm {
192         value "12";
193       }
194       enum network-re-optimization {
195         value "13";
196       }
197     }
198   }
199
200   grouping sdnc-request-header {
201     container sdnc-request-header {
202       leaf request-id {
203         type string;
204       }
205       leaf rpc-action {
206         type rpc-actions;
207       }
208       leaf notification-url {
209         type string;
210       }
211       leaf request-system-id{
212         type string;
213       }
214     }
215   }
216
217   grouping service-port {
218     container port {
219       leaf port-device-name {
220         type string;
221       }
222       leaf port-type {
223         type string;
224       }
225       leaf port-name {
226         type string;
227       }
228       leaf port-rack {
229         type string;
230       }
231       leaf port-shelf {
232         type string;
233       }
234       leaf port-slot {
235         type string;
236       }
237       leaf port-sub-slot {
238         type string;
239       }
240     }
241   }
242
243   grouping service-lgx {
244     container lgx {
245       leaf lgx-device-name {
246         type string;
247       }
248       leaf lgx-port-name {
249         type string;
250       }
251       leaf lgx-port-rack {
252         type string;
253       }
254       leaf lgx-port-shelf {
255         type string;
256       }
257     }
258   }
259
260   grouping service-tail {
261     container tail {
262       container tail-roadm {
263         description
264           "ROADM on which the transponder is connected to (TID, IP Address,
265            or FQDN)";
266         uses org-openroadm-resource-types:device-id;
267       }
268       container xponder-port {
269         description
270           "Muxponder port used in tail, that will get used as a service endpoint.";
271         leaf circuit-pack-name {
272           type string;
273         }
274         leaf port-name {
275           type string;
276         }
277       }
278       leaf tail-roadm-port-aid {
279         type string;
280         description
281           "This will provide the transponder port needed to inter-city ROADM
282            connection";
283       }
284       leaf tail-roadm-port-rack-location {
285         type string;
286         description
287           "Transponder's location";
288       }
289     }
290   }
291
292   grouping service-information {
293     leaf due-date {
294       type yang:date-and-time;
295       description
296         "Date and time service to be turn up. If time is not specified for a given date, default to  midnight. Service turned up immediately if no due date is specified";
297     }
298     leaf end-date {
299       type yang:date-and-time;
300       description
301         "Date and time service to be removed";
302       mandatory false;
303     }
304     leaf nc-code {
305       type string;
306       description
307         "NC code applied to wavelength service only.This is reported against the service, but may not get reflected in the service in the network.";
308     }
309     leaf nci-code {
310       type string;
311       description
312         "NCI code applied to wavelength service only.This is reported against the service, but may not get reflected in the service in the network.";
313     }
314     leaf secondary-nci-code {
315       type string;
316       description
317         "NC code applied to wavelength service only.This is reported against the service, but may not get reflected in the service in the network.";
318     }
319     leaf customer {
320       type string;
321       description
322         "To be included in ticket information.This is reported against the service, but may not get reflected in the service in the network.";
323     }
324     leaf customer-contact {
325       type string;
326       description
327         "Customer contact information To be included in ticket information. This is reported against the service, but may not get reflected in the service in the network.";
328     }
329     leaf operator-contact {
330       type string;
331       description
332         "Operator contact information to be included in ticket information. This is reported against the service, but may not get reflected in the service in the network.";
333     }
334   }
335
336   grouping service {
337     leaf service-name {
338       type string;
339       description
340         "Identifier for the service to be created in
341          the ROADM network, e.g., CLFI, CLCI, etc.";
342       mandatory true;
343     }
344     leaf common-id {
345       type string;
346       description
347         "To be used by the ROADM controller to identify the routing
348          constraints received from planning application (PED).";
349     }
350     uses sdnc-request-header;
351     leaf connection-type {
352       type connection-type;
353       mandatory true;
354       description
355         "Connection type";
356     }
357     leaf lifecycle-state {
358       type org-openroadm-common-types:lifecycle-state;
359       description
360         "Lifecycle State of service. Whether it is planned, deployed, in maintenance, etc.";
361     }
362     leaf administrative-state {
363       type org-openroadm-common-types:state;
364       description
365         "Administrative State: Intended state of service";
366     }
367     leaf operational-state {
368       type org-openroadm-common-types:state;
369       config false;
370       description
371         "Operational State: Actual state of service";
372     }
373     leaf condition {
374       type service-condition;
375       description
376         "Service Condition: Additional information about the state of the service. Only sent when applicable.";
377     }
378     container service-a-end {
379       uses service-endpoint;
380     }
381     container service-z-end {
382       uses service-endpoint;
383     }
384     uses org-openroadm-routing-constraints:routing-constraints;
385     uses service-information;
386     leaf latency {
387       type uint32;
388       description
389         "Latency on service";
390     }
391     leaf-list fiber-span-srlgs {
392       type string;
393       description
394         "Shared risk link group identifiers";
395     }
396     list equipment-srgs {
397       key "srg-number";
398       uses org-openroadm-resource-types:srg-number;
399     }
400     leaf-list supporting-service-name {
401       description
402         "The service name that this runs over top. If connection-type is service, then this is the related
403          connection-type = infrastructure service, for example.";
404       type string;
405     }
406     container topology {
407       uses org-openroadm-topology:topology;
408     }
409   }
410
411   grouping service-notification-result {
412     leaf service-name {
413       type string;
414       description
415         "Identifier for the service e.g., CLFI, CLCI, etc.";
416       mandatory true;
417     }
418     leaf actual-date {
419       type yang:date-and-time;
420       description
421         "Actual date and time (if successful)";
422     }
423   }
424
425   typedef service-format {
426     type enumeration {
427       enum "Ethernet" {
428         value 1;
429       }
430       enum "OTU" {
431         value 2;
432       }
433       enum "OC" {
434         value 3;
435       }
436       enum "STM" {
437         value 4;
438       }
439       enum "OMS" {
440         value 5;
441       }
442       enum "ODU" {
443         value 6;
444       }
445       enum "OTM" {
446         value 7;
447       }
448     }
449   }
450
451   typedef service-notification-types {
452     type enumeration {
453       enum "service-create-result" {
454         value 1;
455       }
456       enum "service-reconfigure-result" {
457         value 2;
458       }
459       enum "service-delete-result" {
460         value 3;
461       }
462       enum "service-roll-result" {
463         value 4;
464       }
465       enum "service-revert-result" {
466         value 5;
467       }
468       enum "service-reroute-result" {
469         value 6;
470       }
471       enum "service-restoration-result" {
472         value 7;
473       }
474       //Add Martial
475       enum "service-feasibility-check-result" {
476         value 8;
477       }
478     }
479   }
480
481   typedef connection-type {
482     type enumeration {
483       enum "service" {
484         value 1;
485       }
486       enum "infrastructure" {
487         value 2;
488       }
489       enum "roadm-line" {
490         value 3;
491       }
492     }
493   }
494
495   typedef service-condition {
496     type enumeration {
497       enum "restored-temporarily" {
498         value 1;
499       }
500       enum "re-routed-temporarily" {
501         value 2;
502       }
503       enum "activated-for-service" {
504         value 3;
505       }
506       enum "activated-for-further-check" {
507         value 4;
508       }
509       enum "activated-for-troubleshooting-failure" {
510         value 5;
511       }
512     }
513   }
514 }