reformat API YANG models
[transportpce.git] / api / src / main / yang / service_path / transportpce-pce@2020-01-28.yang
1 module transportpce-pce {
2   namespace "http://org/opendaylight/transportpce/pce";
3   prefix org-opendaylight-transportpce-pce;
4
5   import ietf-yang-types {
6     prefix yang;
7   }
8   import transportpce-routing-constraints {
9     prefix transportpce-routing-constraints;
10   }
11   import org-openroadm-common-service-types {
12     prefix org-openroadm-common-service-types;
13   }
14   import transportpce-common-service-path-types {
15     prefix transportpce-common-service-path-types;
16   }
17   import transportpce-pathDescription {
18     prefix transportpce-pathDescription;
19   }
20   import gnpy-path-computation-simplified {
21     prefix gnpypc;
22   }
23
24   organization
25     "transportPCE";
26   contact
27     "transportPCE committers - ODL";
28   description
29     "YANG definitions of B interface (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 2020-01-28 {
60     description
61       "Version 1.7";
62   }
63   revision 2019-06-24 {
64     description
65       "Version 1.6.1";
66   }
67   revision 2017-10-17 {
68     description
69       "Version 1.6";
70   }
71   revision 2017-04-26 {
72     description
73       "Version 1.5";
74   }
75
76   grouping stubpce-path-description {
77     leaf path-name {
78       type string;
79       mandatory true;
80       description
81         "Identifier for the pathDescription to be created in the ROADM
82          network, e.g., CLFI, CLCI, etc.";
83     }
84     uses transportpce-pathDescription:path-description;
85   }
86
87   grouping gnpy {
88     list gnpy-response {
89       key "path-dir";
90       config false;
91       description
92         "GNPy response";
93       leaf path-dir {
94         type string;
95         description
96           "A-to-Z or Z-to-A";
97       }
98       leaf feasibility {
99         type boolean;
100         description
101           "true : feasible path / False : non-feasible.";
102       }
103       choice response-type {
104         config false;
105         description
106           "response-type";
107         case no-path-case {
108           uses gnpypc:no-path-info;
109         }
110         case path-case {
111           description
112             "Path computation service.";
113           uses path-performance;
114         }
115       }
116     }
117   }
118
119   grouping path-performance {
120     description
121       "TE generic path properties grouping";
122     container path-properties {
123       config false;
124       description
125         "The TE path properties";
126       list path-metric {
127         key "metric-type";
128         description
129           "TE path metric type";
130         leaf metric-type {
131           type identityref {
132             base gnpypc:path-metric-type;
133           }
134         }
135         leaf accumulative-value {
136           type decimal64 {
137             fraction-digits 2;
138           }
139         }
140       }
141     }
142   }
143
144   rpc path-computation-request {
145     input {
146       leaf service-name {
147         type string;
148         mandatory true;
149         description
150           "Identifier for the service to be created in the ROADM network,
151            e.g., CLFI, CLCI, etc. This is reported against the service, but
152            may not get reflected in the service in the network.";
153       }
154       leaf resource-reserve {
155         type boolean;
156         mandatory true;
157         description
158           "indicates if resources (from local PCE topology) must be reserved
159            until further notice (cancel-resource-reserve or topology update)";
160       }
161       uses transportpce-common-service-path-types:service-handler-header;
162       container service-a-end {
163         uses transportpce-common-service-path-types:service-endpoint-sp;
164       }
165       container service-z-end {
166         uses transportpce-common-service-path-types:service-endpoint-sp;
167       }
168       uses transportpce-routing-constraints:routing-constraints-sp;
169       uses org-openroadm-common-service-types:routing-metric;
170     }
171     output {
172       uses org-openroadm-common-service-types:configuration-response-common;
173       uses transportpce-common-service-path-types:response-parameters-sp;
174       uses gnpy;
175     }
176   }
177
178   rpc cancel-resource-reserve {
179     input {
180       leaf service-name {
181         type string;
182         mandatory true;
183       }
184       uses transportpce-common-service-path-types:service-handler-header;
185     }
186     output {
187       uses org-openroadm-common-service-types:configuration-response-common;
188     }
189   }
190
191   notification service-path-rpc-result {
192     description
193       "This Notification indicates result of  service RPC";
194     leaf notification-type {
195       type transportpce-common-service-path-types:service-path-notification-types;
196     }
197     container path-description {
198       uses transportpce-pathDescription:path-description;
199     }
200     uses transportpce-common-service-path-types:rpc-response-status-ex;
201     uses org-openroadm-common-service-types:service-notification-result;
202     uses org-openroadm-common-service-types:routing-metric;
203   }
204
205   container path-description-list {
206     description
207       "List of pathDescription. Can only be created, deleted, modified,
208        etc. using special RPCs.";
209     list pathDescriptions {
210       key "path-name";
211       uses stubpce-path-description;
212     }
213   }
214 }