Merge "Refactor ConvertORTopoToTapiTopoTest"
[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 org-openroadm-routing-constraints {
6     prefix org-openroadm-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   }
17   import org-openroadm-common-service-types {
18     prefix org-openroadm-common-service-types;
19   }
20   import org-openroadm-service-format {
21     prefix org-openroadm-service-format;
22   }
23
24   organization
25     "transportPCE";
26   contact
27     "transportPCE committers - ODL";
28   description
29     "YANG definitions of B & C interfaces (transportPCE). Adapted from service definition (openroadm)
30      Copyright ©  2017 Orange, Inc. and others.  All rights reserved.
31
32      openroadm copyright:
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 2022-01-18 {
60     description
61       "Add typedef pce-metric.
62        Replace transportpce-routing-constraints by org-openroadm-routing-constraints.";
63   }
64
65   revision 2020-01-28 {
66     description
67       "Version 1.7";
68     // General consolidation to handle OTN and ONAP MDONS use case
69   }
70   revision 2019-10-09 {
71     description
72       "Version 1.6.1";
73   }
74   revision 2017-10-16 {
75     description
76       "Version 1.6";
77   }
78   revision 2017-04-26 {
79     description
80       "Version 1.5";
81   }
82
83   typedef pce-metric {
84     type enumeration {
85       enum hop-count {
86         value 1;
87       }
88       enum propagation-delay {
89         value 2;
90       }
91       enum TE-metric {
92         value 3;
93       }
94       enum IGP-metric {
95         value 4;
96       }
97     }
98   }
99
100   typedef service-path-notification-types {
101     type enumeration {
102       enum path-computation-request {
103         value 1;
104       }
105       enum cancel-resource-reserve {
106         value 2;
107       }
108       enum service-implementation-request {
109         value 3;
110       }
111       enum service-delete {
112         value 4;
113       }
114     }
115   }
116
117   typedef rpc-status-ex {
118     type enumeration {
119       enum Successful {
120         value 1;
121       }
122       enum Failed {
123         value 2;
124       }
125       enum Pending {
126         value 3;
127       }
128     }
129     description
130       "extended status of RPC ";
131   }
132
133   grouping rpc-response-status-ex {
134     leaf status {
135       type rpc-status-ex;
136       mandatory true;
137       description
138         "Successful, Failed or Pending";
139     }
140     leaf status-message {
141       type string;
142       description
143         "Gives a more detailed reason for failure";
144     }
145   }
146
147   grouping response-parameters-sp {
148     container response-parameters {
149       uses org-openroadm-routing-constraints:routing-constraints;
150       container path-description {
151         uses transportpce-pathDescription:path-description;
152       }
153     }
154   }
155
156   grouping service-endpoint-sp {
157     leaf service-format {
158       type org-openroadm-service-format:service-format;
159       mandatory true;
160       description
161         "Format of the requested service: Ethernet, OTU, etc.";
162     }
163     leaf service-rate {
164       when "../service-format!='OMS'" {
165         description
166           "service rate not applicable when service format is roadmline";
167       }
168       type uint32;
169       mandatory true;
170       description
171         "Rate of the requested service in GBps";
172     }
173     leaf otu-service-rate {
174       when "../service-format='OTU'" {
175         description
176           "service rate not applicable when service format is OTU";
177       }
178       type identityref {
179         base org-openroadm-otn-common-types:otu-rate-identity;
180       }
181       mandatory false;
182       description
183         "OTU Rate of the requested service";
184     }
185     leaf odu-service-rate {
186       when "../service-format='ODU'" {
187         description
188           "service rate not applicable when service format is ODU";
189       }
190       type identityref {
191         base org-openroadm-otn-common-types:odu-rate-identity;
192       }
193       mandatory false;
194       description
195         "OTU Rate of the requested service";
196     }
197     leaf other-service-format-and-rate {
198       type string;
199       description
200         "This value encodes both the service format and the rate supported.
201          This field should not be specified when service format != other.";
202     }
203     leaf clli {
204       type string;
205       mandatory true;
206       description
207         "CLLI";
208     }
209     leaf node-id {
210       type string;
211     }
212     container tx-direction {
213       leaf logical-connection-point {
214         type string;
215         description
216           "PCE works on topology --> change from port (device) to node-id+logical-connection-point
217            (topology) assuming Portmapping will be used by both the Renderer
218            and the SH to make the conversion from device to topology";
219       }
220       uses org-openroadm-common-service-types:service-port;
221       //     uses service-lgx;
222       //     uses service-tail;
223     }
224     container rx-direction {
225       leaf logical-connection-point {
226         type string;
227         description
228           "PCE works on topology --> change from port (device) to node-id+logical-connection-point
229            (topology) assuming Portmapping will be used by both the Renderer
230            and the SH to make the conversion from device to topology";
231       }
232       uses org-openroadm-common-service-types:service-port;
233       //     uses service-lgx;
234       //     uses service-tail;
235     }
236   }
237
238   grouping service-handler-header {
239     container service-handler-header {
240       leaf request-id {
241         type string;
242         mandatory true;
243       }
244     }
245   }
246
247   grouping service-path {
248     leaf service-path-name {
249       type string;
250       mandatory true;
251       description
252         "Identifier for the service-path to be calculated by the PCE";
253     }
254     uses service-handler-header;
255     container service-a-end {
256       uses service-endpoint-sp;
257     }
258     container service-z-end {
259       uses service-endpoint-sp;
260     }
261     leaf pce-routing-metric {
262       type pce-metric;
263     }
264     uses org-openroadm-routing-constraints:routing-constraints;
265     leaf latency {
266       type uint32;
267       description
268         "Latency on service";
269     }
270     leaf-list fiber-span-srlgs {
271       type string;
272       description
273         "Shared risk link group identifiers";
274     }
275     list equipment-srgs {
276       key "srg-number";
277       uses org-openroadm-resource-types:srg-number;
278     }
279     leaf-list supporting-service-name {
280       type string;
281       description
282         "The service name that this runs over top. If connection-type is service, then this is the related
283          connection-type = infrastructure service, for example.";
284     }
285     container path-description {
286       uses transportpce-pathDescription:path-description;
287     }
288   }
289 }