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