8829406ea4dd828e49102c1f80f2031ec7fb9d89
[transportpce.git] / api / src / main / yang / service_path / transportpce-pce@2022-01-18.yang
1 module transportpce-pce {
2   namespace "http://org/opendaylight/transportpce/pce";
3   prefix org-opendaylight-transportpce-pce;
4
5   import transportpce-routing-constraints {
6     prefix transportpce-routing-constraints;
7   }
8   import org-openroadm-common-service-types {
9     prefix org-openroadm-common-service-types;
10   }
11   import transportpce-common-service-path-types {
12     prefix transportpce-common-service-path-types;
13   }
14   import transportpce-pathDescription {
15     prefix transportpce-pathDescription;
16   }
17   import gnpy-path-computation-simplified {
18     prefix gnpypc;
19   }
20
21   organization
22     "transportPCE";
23   contact
24     "transportPCE committers - ODL";
25   description
26     "YANG definitions of B interface (transportPCE). Adapted from service definition (openroadm)
27      Copyright © 2017 Orange, Inc. and others.  All rights reserved.
28
29      openroadm copyright:
30       Copyright of the Members of the Open ROADM MSA Agreement dated (c) 2016,
31       AT&T Intellectual Property.  All other rights reserved.
32
33       Redistribution and use in source and binary forms, with or without modification,
34       are permitted provided that the following conditions are met:
35
36       * Redistributions of source code must retain the above copyright notice, this
37         list of conditions and the following disclaimer.
38       * Redistributions in binary form must reproduce the above copyright notice,
39         this list of conditions and the following disclaimer in the documentation and/or
40         other materials provided with the distribution.
41       * Neither the Members of the Open ROADM MSA Agreement nor the names of its
42         contributors may be used to endorse or promote products derived from this software
43         without specific prior written permission.
44
45       THIS SOFTWARE IS PROVIDED BY THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT ''AS IS''
46       AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
47       WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
48       IN NO EVENT THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT BE LIABLE FOR ANY DIRECT,
49       INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
50       NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;  LOSS OF USE, DATA,
51       OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
52       WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
53       ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
54       POSSIBILITY OF SUCH DAMAGE";
55
56   revision 2022-01-18 {
57     description
58       "Add in path-computation-request input the pce-routing-metric";
59   }
60   revision 2021-07-01 {
61     description
62       "Version 1.8";
63   }
64   revision 2020-01-28 {
65     description
66       "Version 1.7";
67   }
68   revision 2019-06-24 {
69     description
70       "Version 1.6.1";
71   }
72   revision 2017-10-17 {
73     description
74       "Version 1.6";
75   }
76   revision 2017-04-26 {
77     description
78       "Version 1.5";
79   }
80
81   grouping stubpce-path-description {
82     leaf path-name {
83       type string;
84       mandatory true;
85       description
86         "Identifier for the pathDescription to be created in the ROADM
87          network, e.g., CLFI, CLCI, etc.";
88     }
89     uses transportpce-pathDescription:path-description;
90   }
91
92   grouping gnpy {
93     list gnpy-response {
94       key "path-dir";
95       config false;
96       description
97         "GNPy response";
98       leaf path-dir {
99         type string;
100         description
101           "A-to-Z or Z-to-A";
102       }
103       leaf feasibility {
104         type boolean;
105         description
106           "true : feasible path / False : non-feasible.";
107       }
108       choice response-type {
109         config false;
110         description
111           "response-type";
112         case no-path-case {
113           uses gnpypc:no-path-info;
114         }
115         case path-case {
116           description
117             "Path computation service.";
118           uses path-performance;
119         }
120       }
121     }
122   }
123
124   grouping path-performance {
125     description
126       "TE generic path properties grouping";
127     container path-properties {
128       config false;
129       description
130         "The TE path properties";
131       list path-metric {
132         key "metric-type";
133         description
134           "TE path metric type";
135         leaf metric-type {
136           type identityref {
137             base gnpypc:path-metric-type;
138           }
139         }
140         leaf accumulative-value {
141           type decimal64 {
142             fraction-digits 2;
143           }
144         }
145       }
146     }
147   }
148
149   rpc path-computation-request {
150     input {
151       leaf service-name {
152         type string;
153         mandatory true;
154         description
155           "Identifier for the service to be created in the ROADM network,
156            e.g., CLFI, CLCI, etc. This is reported against the service, but
157            may not get reflected in the service in the network.";
158       }
159       leaf resource-reserve {
160         type boolean;
161         mandatory true;
162         description
163           "indicates if resources (from local PCE topology) must be reserved
164            until further notice (cancel-resource-reserve or topology update)";
165       }
166       leaf pce-routing-metric {
167         type transportpce-common-service-path-types:pce-metric;
168       }
169       uses transportpce-common-service-path-types:service-handler-header;
170       container service-a-end {
171         uses transportpce-common-service-path-types:service-endpoint-sp;
172       }
173       container service-z-end {
174         uses transportpce-common-service-path-types:service-endpoint-sp;
175       }
176       uses transportpce-routing-constraints:routing-constraints-sp;
177       uses org-openroadm-common-service-types:routing-metric;
178     }
179     output {
180       uses org-openroadm-common-service-types:configuration-response-common;
181       uses transportpce-common-service-path-types:response-parameters-sp;
182       uses gnpy;
183     }
184   }
185
186   rpc cancel-resource-reserve {
187     input {
188       leaf service-name {
189         type string;
190         mandatory true;
191       }
192       uses transportpce-common-service-path-types:service-handler-header;
193     }
194     output {
195       uses org-openroadm-common-service-types:configuration-response-common;
196     }
197   }
198
199   notification service-path-rpc-result {
200     description
201       "This Notification indicates result of  service RPC";
202     leaf notification-type {
203       type transportpce-common-service-path-types:service-path-notification-types;
204     }
205     container path-description {
206       uses transportpce-pathDescription:path-description;
207     }
208     uses transportpce-common-service-path-types:rpc-response-status-ex;
209     uses org-openroadm-common-service-types:service-notification-result;
210     uses org-openroadm-common-service-types:routing-metric;
211   }
212
213   container path-description-list {
214     description
215       "List of pathDescription. Can only be created, deleted, modified,
216        etc. using special RPCs.";
217     list pathDescriptions {
218       key "path-name";
219       uses stubpce-path-description;
220     }
221   }
222
223   container spectrum-assignment {
224     description
225       "Spectrum assignment management using index steps and flexgrid property";
226     leaf begin-index {
227       type uint16;
228       mandatory true;
229       description
230         "Begin index of spectrum assignment";
231     }
232     leaf stop-index {
233       type uint16;
234       mandatory true;
235       description
236         "End index of spectrum assignment";
237     }
238     leaf flex-grid {
239       type boolean;
240       mandatory true;
241       description
242         "Set it to true for flexgrid, false otherwise";
243     }
244   }
245 }