Add new revision for pcep types model
[bgpcep.git] / pcep / ietf-stateful07 / src / main / yang / odl-pcep-ietf-stateful07.yang
1 module odl-pcep-ietf-stateful07 {
2     yang-version 1;
3     namespace "urn:opendaylight:params:xml:ns:yang:pcep:ietf:stateful";
4     prefix "stateful";
5
6     import ietf-inet-types { prefix inet; revision-date 2013-07-15; }
7     import network-topology { prefix nt; revision-date 2013-10-21; }
8     import network-topology-pcep { prefix topo; revision-date 2018-11-09; }
9     import pcep-types { prefix pcep; revision-date 2018-11-09; }
10     import pcep-message { prefix msg; revision-date 2018-11-09; }
11     import rsvp { prefix rsvp; revision-date 2015-08-20; }
12     import topology-tunnel { prefix tt; revision-date 2013-08-19; }
13     import topology-tunnel-pcep { prefix tun; revision-date 2018-11-09; }
14     import topology-tunnel-pcep-programming { prefix ttpp; revision-date 2018-11-09; }
15     import yang-ext { prefix ext; revision-date 2013-07-09; }
16     import network-concepts { prefix netc; revision-date 2013-11-25; }
17
18     organization "Cisco Systems, Inc.";
19     contact "Robert Varga <rovarga@cisco.com>";
20
21     description
22         "This module contains the data model of PCEP extensions defined
23         in draft-ietf-pce-stateful-pce.
24
25         Copyright (c)2013 Cisco Systems, Inc. All rights reserved.
26
27         This program and the accompanying materials are made available
28         under the terms of the Eclipse Public License v1.0 which
29         accompanies this distribution, and is available at
30         http://www.eclipse.org/legal/epl-v10.html";
31
32     revision "2018-11-09" {
33         description
34             "P2MP extension.";
35         reference "RFC8306";
36     }
37
38     revision 2017-10-25 {
39         description "Update network-topology-pcep revision";
40     }
41
42     revision "2013-12-22" {
43         description
44             "Initial revision.";
45         reference "https://tools.ietf.org/html/draft-ietf-pce-stateful-pce-07";
46     }
47
48     typedef operational-status {
49         type enumeration {
50             enum down {
51                 value 0;
52             }
53             enum up {
54                 value 1;
55             }
56             enum active {
57                 value 2;
58             }
59             enum going-down {
60                 value 3;
61             }
62             enum going-up {
63                 value 4;
64             }
65         }
66     }
67
68     typedef plsp-id {
69         type uint32 {
70             range 0..1048576;
71         }
72     }
73
74     typedef srp-id-number {
75         type uint32 {
76             range 0..4294967294;
77         }
78     }
79
80     typedef symbolic-path-name {
81         type binary {
82             length 1..65535;
83         }
84     }
85
86     grouping path-binding-tlv {
87         reference "https://tools.ietf.org/html/draft-sivabalan-pce-binding-label-sid-01#section-3";
88         container path-binding {
89             uses pcep:tlv;
90             choice binding-type-value {
91                 case mpls-label {
92                     leaf mpls-label {
93                         type netc:mpls-label;
94                     }
95                 }
96                 case mpls-label-entry {
97                     leaf label {
98                         type netc:mpls-label;
99                     }
100                     leaf traffic-class {
101                         type uint8 {
102                             range 0..7;
103                         }
104                     }
105                     leaf bottom-of-stack {
106                         type boolean;
107                     }
108                     leaf time-to-live {
109                         type uint8;
110                     }
111                 }
112             }
113         }
114     }
115
116     grouping lsp-identifiers-tlv {
117         description "LSP Identifiers TLV";
118         reference "https://tools.ietf.org/html/draft-ietf-pce-stateful-pce-07#section-7.3.1";
119         container lsp-identifiers {
120             uses pcep:tlv;
121             leaf lsp-id {
122                 type rsvp:lsp-id;
123             }
124
125             leaf tunnel-id {
126                 type rsvp:tunnel-id;
127             }
128
129             choice address-family {
130                 case ipv4-case {
131                     container ipv4 {
132                         leaf ipv4-tunnel-sender-address {
133                             type inet:ipv4-address-no-zone;
134                             mandatory true;
135                         }
136                         leaf ipv4-extended-tunnel-id {
137                             type rsvp:ipv4-extended-tunnel-id;
138                             mandatory true;
139                         }
140                         leaf ipv4-tunnel-endpoint-address {
141                             type inet:ipv4-address-no-zone;
142                             mandatory true;
143                         }
144                     }
145                 }
146                 case ipv6-case {
147                     container ipv6 {
148                         leaf ipv6-tunnel-sender-address {
149                             type inet:ipv6-address-no-zone;
150                             mandatory true;
151                         }
152                         leaf ipv6-extended-tunnel-id {
153                             type rsvp:ipv6-extended-tunnel-id;
154                             mandatory true;
155                         }
156                         leaf ipv6-tunnel-endpoint-address {
157                             type inet:ipv6-address-no-zone;
158                             mandatory true;
159                         }
160                     }
161                 }
162             }
163         }
164     }
165
166     grouping lsp-error-code-tlv {
167         description "LSP Error Code TLV";
168         reference "https://tools.ietf.org/html/draft-ietf-pce-stateful-pce-07#section-7.3.3";
169         container lsp-error-code {
170             uses pcep:tlv;
171             leaf error-code {
172                 type uint32;
173             }
174         }
175     }
176
177     grouping rsvp-error-spec-tlv {
178         description "RSVP Error Spec TLV";
179         reference "https://tools.ietf.org/html/draft-ietf-pce-stateful-pce-07#section-7.3.4";
180         container rsvp-error-spec {
181             uses pcep:tlv;
182             choice error-type {
183                 case rsvp-case {
184                     container rsvp-error {
185                         uses rsvp:error-spec;
186                     }
187                 }
188                 case user-case {
189                     container user-error {
190                         uses rsvp:user-error-spec;
191                     }
192                 }
193             }
194         }
195     }
196
197     grouping stateful-capability-tlv {
198         description "Stateful PCE Capability TLV";
199         reference "https://tools.ietf.org/html/draft-ietf-pce-stateful-pce-07#section-7.1.1";
200
201         container stateful {
202             uses pcep:tlv;
203
204             leaf lsp-update-capability {
205                 type boolean;
206                 default false;
207             }
208         }
209     }
210
211     grouping symbolic-path-name-tlv {
212         description "Symbolic Path Name TLV";
213         reference "https://tools.ietf.org/html/draft-ietf-pce-stateful-pce-07#section-7.3.2";
214         container symbolic-path-name {
215             uses pcep:tlv;
216             leaf path-name {
217                 type symbolic-path-name;
218             }
219         }
220     }
221
222     grouping lsp-object {
223         description "LSP Object";
224         reference "https://tools.ietf.org/html/draft-ietf-pce-stateful-pce-07#section-7.3";
225
226         container lsp {
227             uses pcep:object;
228             container "tlvs" {
229                 uses lsp-error-code-tlv;
230
231                 uses lsp-identifiers-tlv;
232
233                 uses rsvp-error-spec-tlv;
234
235                 uses symbolic-path-name-tlv;
236
237                 uses pcep:vs-tlv;
238
239                 uses pcep:vendor-information-tlvs;
240
241                 uses path-binding-tlv;
242             }
243
244             leaf plsp-id {
245                 type plsp-id;
246             }
247
248             leaf delegate {
249                 type boolean;
250                 default false;
251             }
252
253             leaf sync {
254                 type boolean;
255                 default false;
256             }
257
258             leaf remove {
259                 type boolean;
260                 default false;
261             }
262
263             leaf administrative {
264                 type boolean;
265                 default false;
266             }
267
268             leaf operational {
269                 type operational-status;
270             }
271         }
272     }
273
274     grouping srp-object {
275         description "SRP Object";
276         reference "https://tools.ietf.org/html/draft-ietf-pce-stateful-pce-07#section-7.2";
277
278         container srp {
279             uses pcep:object;
280
281             container "tlvs" {
282                 uses symbolic-path-name-tlv;
283
284                 uses pcep:vendor-information-tlvs;
285
286                 uses pcep:path-setup-type-tlv;
287             }
288
289             leaf operation-id {
290                 type srp-id-number;
291                 mandatory true;
292             }
293         }
294     }
295
296     grouping pcupd-message {
297         uses pcep:message;
298
299         container pcupd-message {
300             description "State Update Request Message";
301             reference "https://tools.ietf.org/html/draft-ietf-pce-stateful-pce-07#section-6.2";
302
303             uses pcep:message-header;
304
305             list updates {
306                 uses srp-object;
307
308                 uses lsp-object;
309
310                 container path {
311                     uses pcep:path-definition;
312                 }
313             }
314         }
315     }
316
317     grouping pcrpt-message {
318         uses pcep:message;
319
320         container pcrpt-message {
321             description "State Report Message";
322             reference "https://tools.ietf.org/html/draft-ietf-pce-stateful-pce-07#section-6.1";
323
324             uses pcep:message-header;
325
326             list reports {
327                 uses srp-object;
328
329                 uses lsp-object;
330
331                 container path {
332                     uses pcep:path-definition;
333                 }
334             }
335         }
336     }
337
338     notification pcupd {
339         uses pcupd-message;
340     }
341
342     notification pcrpt {
343         uses pcrpt-message;
344     }
345
346     augment "/msg:open/msg:open-message/msg:open/msg:tlvs" {
347         uses stateful-capability-tlv;
348         ext:augment-identifier tlvs-1;
349     }
350
351     augment "/msg:pcrep/msg:pcrep-message/msg:replies/msg:result/msg:failure-case/msg:lspa/msg:tlvs" {
352         uses symbolic-path-name-tlv;
353         ext:augment-identifier tlvs-4;
354     }
355
356     augment "/msg:pcerr/msg:pcerr-message/msg:error-type" {
357         reference "https://tools.ietf.org/html/draft-ietf-pce-stateful-pce-07#section-6.3";
358         case stateful-case {
359             container stateful {
360                 list srps {
361                     uses srp-object;
362                 }
363             }
364         }
365     }
366
367     augment "/msg:pcreq/msg:pcreq-message/msg:requests/msg:segment-computation/msg:p2p/msg:lspa/msg:tlvs" {
368         uses symbolic-path-name-tlv;
369         ext:augment-identifier tlvs-2;
370     }
371
372     augment "/msg:pcerr/msg:pcerr-message/msg:error-type/msg:session-case/msg:session/msg:open/msg:tlvs" {
373         uses stateful-capability-tlv;
374         ext:augment-identifier tlvs-3;
375     }
376
377     augment "/nt:network-topology/nt:topology/nt:node/topo:path-computation-client/topo:reported-lsp/topo:path" {
378         uses lsp-object;
379         uses pcep:path-setup-type-tlv;
380     }
381
382     augment "/nt:network-topology/nt:topology/nt:node/topo:path-computation-client/topo:stateful-tlv" {
383         uses stateful-capability-tlv;
384     }
385
386     augment "/topo:ensure-lsp-operational/topo:input/topo:arguments" {
387         ext:augment-identifier arguments-1;
388         leaf operational {
389             type operational-status;
390         }
391     }
392
393     augment "/topo:add-lsp/topo:input/topo:arguments" {
394         ext:augment-identifier arguments-2;
395         uses lsp-object;
396         uses pcep:path-setup-type-tlv;
397     }
398
399     augment "/topo:update-lsp/topo:input/topo:arguments" {
400         ext:augment-identifier arguments-3;
401         uses lsp-object;
402         uses pcep:path-setup-type-tlv;
403     }
404
405     typedef administrative-status {
406         type enumeration {
407             enum active;
408             enum inactive;
409         }
410         reference "https://tools.ietf.org/html/draft-ietf-pce-stateful-pce-07#section-7.3";
411     }
412
413     grouping cfg-attributes {
414         leaf administrative-status {
415             type administrative-status;
416         }
417     }
418
419     grouping oper-attributes {
420         leaf operational-status {
421             type operational-status;
422             config false;
423         }
424     }
425
426     augment "/nt:network-topology/nt:topology/nt:link" {
427         when "../../tunnel-types/pcep-tunnel";
428
429         uses cfg-attributes;
430         uses oper-attributes;
431     }
432
433     augment "/nt:network-topology/nt:topology/tt:paths" {
434         when "../../tunnel-types/pcep-tunnel";
435
436         uses cfg-attributes;
437         uses oper-attributes;
438     }
439
440     augment "/ttpp:pcep-create-p2p-tunnel/ttpp:input" {
441         uses cfg-attributes;
442     }
443
444     augment "/ttpp:pcep-update-tunnel/ttpp:input" {
445         uses cfg-attributes;
446     }
447 }
448