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