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