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