Clean up API YANG models with the help of pyang
[transportpce.git] / api / src / main / yang / service_path / transportpce-common-service-path-types@2020-01-28.yang
1 module transportpce-common-service-path-types {
2   namespace "http://org/transportpce/B-C-interface/service/types";
3   prefix transportpce-common-service-path-types;
4
5   import transportpce-routing-constraints {
6     prefix transportpce-routing-constraints;
7   }
8   import transportpce-pathDescription {
9     prefix transportpce-pathDescription;
10   }
11   import org-openroadm-otn-common-types {
12     prefix org-openroadm-otn-common-types;
13     revision-date 2018-11-30;
14   }
15   import org-openroadm-resource-types {
16     prefix org-openroadm-resource-types;
17     revision-date 2018-11-30;
18   }
19   import org-openroadm-common-service-types {
20     prefix org-openroadm-common-service-types;
21     revision-date 2019-05-31;
22   }
23   import org-openroadm-service-format {
24     prefix org-openroadm-service-format;
25     revision-date 2019-05-31;
26   }
27
28   organization
29     "transportPCE";
30   contact
31     "transportPCE committers - ODL";
32   description
33     "YANG definitions of B & C interfaces (transportPCE). Adapted from service definition (openroadm)
34      Copyright ©  2017 Orange, Inc. and others.  All rights reserved.
35
36      openroadm copyright:
37       Copyright of the Members of the Open ROADM MSA Agreement dated (c) 2016,
38       AT&T Intellectual Property.  All other rights reserved.
39
40       Redistribution and use in source and binary forms, with or without modification,
41       are permitted provided that the following conditions are met:
42
43       * Redistributions of source code must retain the above copyright notice, this
44         list of conditions and the following disclaimer.
45       * Redistributions in binary form must reproduce the above copyright notice,
46         this list of conditions and the following disclaimer in the documentation and/or
47         other materials provided with the distribution.
48       * Neither the Members of the Open ROADM MSA Agreement nor the names of its
49         contributors may be used to endorse or promote products derived from this software
50         without specific prior written permission.
51
52       THIS SOFTWARE IS PROVIDED BY THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT ''AS IS''
53       AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
54       WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
55       IN NO EVENT THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT BE LIABLE FOR ANY DIRECT,
56       INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
57       NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;  LOSS OF USE, DATA,
58       OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
59       WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
60       ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
61       POSSIBILITY OF SUCH DAMAGE";
62
63   revision 2020-01-28 {
64     description
65       "Version 1.7";
66     // General consolidation to handle OTN and ONAP MDONS use case
67   }
68   revision 2019-10-09 {
69     description
70       "Version 1.6.1";
71   }
72   revision 2017-10-16 {
73     description
74       "Version 1.6";
75   }
76   revision 2017-04-26 {
77     description
78       "Version 1.5";
79   }
80
81   typedef service-path-notification-types {
82     type enumeration {
83       enum path-computation-request {
84         value 1;
85       }
86       enum cancel-resource-reserve {
87         value 2;
88       }
89       enum service-implementation-request {
90         value 3;
91       }
92       enum service-delete {
93         value 4;
94       }
95     }
96   }
97
98   typedef rpc-status-ex {
99     type enumeration {
100       enum Successful {
101         value 1;
102       }
103       enum Failed {
104         value 2;
105       }
106       enum Pending {
107         value 3;
108       }
109     }
110     description
111       "extended status of RPC ";
112   }
113
114   grouping rpc-response-status-ex {
115     leaf status {
116       type rpc-status-ex;
117       mandatory true;
118       description
119         "Successful, Failed or Pending";
120     }
121     leaf status-message {
122       type string;
123       description
124         "Gives a more detailed reason for failure";
125     }
126   }
127
128   grouping response-parameters-sp {
129     container response-parameters {
130       uses transportpce-routing-constraints:routing-constraints-sp;
131       container path-description {
132         uses transportpce-pathDescription:path-description;
133       }
134     }
135   }
136
137   grouping service-endpoint-sp {
138     leaf service-format {
139       type org-openroadm-service-format:service-format;
140       mandatory true;
141       description
142         "Format of the requested service: Ethernet, OTU, etc.";
143     }
144     leaf service-rate {
145       when "../service-format!='OMS'" {
146         description
147           "service rate not applicable when service format is roadmline";
148       }
149       type uint32;
150       mandatory true;
151       description
152         "Rate of the requested service in GBps";
153     }
154     leaf otu-service-rate {
155       when "../service-format='OTU'" {
156         description
157           "service rate not applicable when service format is OTU";
158       }
159       type identityref {
160         base org-openroadm-otn-common-types:otu-rate-identity;
161       }
162       mandatory false;
163       description
164         "OTU Rate of the requested service";
165     }
166     leaf odu-service-rate {
167       when "../service-format='ODU'" {
168         description
169           "service rate not applicable when service format is ODU";
170       }
171       type identityref {
172         base org-openroadm-otn-common-types:odu-rate-identity;
173       }
174       mandatory false;
175       description
176         "OTU Rate of the requested service";
177     }
178     leaf other-service-format-and-rate {
179       type string;
180       description
181         "This value encodes both the service format and the rate supported.
182          This field should not be specified when service format != other.";
183     }
184     leaf clli {
185       type string;
186       mandatory true;
187       description
188         "CLLI";
189     }
190     leaf node-id {
191       type string;
192     }
193     container tx-direction {
194       leaf logical-connection-point {
195         type string;
196         description
197           "PCE works on topology --> change from port (device) to node-id+logical-connection-point
198            (topology) assuming Portmapping will be used by both the Renderer
199            and the SH to make the conversion from device to topology";
200       }
201       uses org-openroadm-common-service-types:service-port;
202       //     uses service-lgx;
203       //     uses service-tail;
204     }
205     container rx-direction {
206       leaf logical-connection-point {
207         type string;
208         description
209           "PCE works on topology --> change from port (device) to node-id+logical-connection-point
210            (topology) assuming Portmapping will be used by both the Renderer
211            and the SH to make the conversion from device to topology";
212       }
213       uses org-openroadm-common-service-types:service-port;
214       //     uses service-lgx;
215       //     uses service-tail;
216     }
217   }
218
219   grouping service-handler-header {
220     container service-handler-header {
221       leaf request-id {
222         type string;
223         mandatory true;
224       }
225     }
226   }
227
228   grouping service-path {
229     leaf service-path-name {
230       type string;
231       mandatory true;
232       description
233         "Identifier for the service-path to be calculated by the PCE";
234     }
235     uses service-handler-header;
236     container service-a-end {
237       uses service-endpoint-sp;
238     }
239     container service-z-end {
240       uses service-endpoint-sp;
241     }
242     uses transportpce-routing-constraints:routing-constraints-sp;
243     leaf latency {
244       type uint32;
245       description
246         "Latency on service";
247     }
248     leaf-list fiber-span-srlgs {
249       type string;
250       description
251         "Shared risk link group identifiers";
252     }
253     list equipment-srgs {
254       key "srg-number";
255       uses org-openroadm-resource-types:srg-number;
256     }
257     leaf-list supporting-service-name {
258       type string;
259       description
260         "The service name that this runs over top. If connection-type is service, then this is the related
261          connection-type = infrastructure service, for example.";
262     }
263     container path-description {
264       uses transportpce-pathDescription:path-description;
265     }
266   }
267 }