Add new revision for pcep types model
[bgpcep.git] / pcep / topology / topology-api / src / main / yang / network-topology-pcep.yang
1 module network-topology-pcep {
2     // vi: set et smarttab sw=4 tabstop=4:
3     yang-version 1;
4     namespace "urn:opendaylight:params:xml:ns:yang:topology:pcep";
5     prefix "pn";
6
7     import ietf-inet-types { prefix inet; revision-date 2013-07-15; }
8     import network-topology { prefix nt; revision-date 2013-10-21; }
9     import odl-network-topology { prefix ont; revision-date 2014-01-13; }
10     import pcep-types { prefix pcep; revision-date 2018-11-09; }
11     import rsvp { prefix rsvp; revision-date 2015-08-20; }
12
13     organization "Cisco Systems, Inc.";
14     contact "Robert Varga <rovarga@cisco.com>";
15
16     description
17         "This module contains the PCEP extensions to base topology model. It
18         exposes the LSPs for which a particular node is the head end.
19
20         This module exposes three programming instructions,add-lsp,
21         remove-lsp and update-lsp, which map to actively-stateful PCEP
22         operations using PCInitiate and PCUpd messages to initiate,
23         destroy and udpate LSP configuration. The lifecycle of these
24         instructions follows draft-crabbe-pce-pce-initiated-lsp and
25         draft-ietf-pce-stateful-pce, completing execution once the head-end
26         router has acknowledged operation success. Should the router become
27         disconnected, the instruction resolve to Cancelled if the message
28         has not been sent into the TCP socket, or Failed it they have.
29
30         Copyright (c)2013 Cisco Systems, Inc. All rights reserved.
31
32         This program and the accompanying materials are made available
33         under the terms of the Eclipse Public License v1.0 which
34         accompanies this distribution, and is available at
35         http://www.eclipse.org/legal/epl-v10.html";
36
37     revision "2018-11-09" {
38         description
39             "P2MP extension.";
40         reference "RFC8306";
41     }
42
43     revision 2017-10-25 {
44         description "Add release-connection rpc";
45     }
46
47     revision "2013-10-24" {
48         description
49             "Initial revision.";
50         reference "";
51     }
52
53     typedef pcc-sync-state {
54         type enumeration {
55             enum initial-resync {
56                 description
57                     "Initial state resynchronization is being performed.";
58             }
59             enum incremental-sync {
60                 description
61                     "Incremental state resynchronization is being performed.";
62             }
63             enum triggered-initial-sync {
64                 description
65                      "Triggered initial state resynchronization is being performed.";
66             }
67             enum pcep-triggered-resync {
68                 description
69                     "Pcep triggered state resynchronization is being performed.";
70             }
71             enum synchronized {
72                 description
73                     "State synchronization has been achieved.";
74             }
75         }
76     }
77
78     grouping topology-pcep-type {
79         container topology-pcep {
80             presence "indicates a PCEP-aware topology";
81         }
82     }
83
84     augment "/nt:network-topology/nt:topology/nt:topology-types" {
85         uses topology-pcep-type;
86     }
87
88     grouping pcep-client-attributes {
89         description "Data present in a node which is a PCEP client (PCC).";
90
91         container path-computation-client {
92             description
93                 "PCC-related run-time information. This container is only
94                 present when the node is connected through PCEP in a PCC
95                 role.";
96             config false;
97
98             leaf ip-address {
99                 description
100                     "IP address which the node used to connected to the PCE.
101                     There are no guarantees as to reachability of the address,
102                     nor its relationship to other control, management, or
103                     data plane addresses.";
104
105                 type inet:ip-address;
106             }
107
108             container stateful-tlv {
109
110             }
111
112             leaf state-sync {
113                 type pcc-sync-state;
114                 when "../stateful-tlv";
115             }
116
117             list reported-lsp {
118                 leaf name {
119                     type string;
120                 }
121                 key name;
122
123                 list path {
124                     leaf lsp-id {
125                         type rsvp:lsp-id;
126                         mandatory true;
127                     }
128                     key lsp-id;
129
130                     uses pcep:path-definition;
131                 }
132                 uses lsp-metadata;
133             }
134         }
135     }
136
137     augment "/nt:network-topology/nt:topology/nt:node" {
138         when "../../nt:topology-types/topology-pcep";
139
140         uses pcep-client-attributes;
141     }
142
143     typedef failure-type {
144         description
145             "Enumeration of all the distinct failure modes that can
146             happen while servicing a request towards the PCC.";
147
148         type enumeration {
149             enum unsent {
150                 description
151                     "The request failed before it was sent to the PCC.
152                     PCC's state is guaranteed not to reflect state
153                     transition implied by the request. This typically
154                     happens if the request is syntactically invalid,
155                     the target PCC is not connected or disconnects
156                     while the request is enqueued.";
157             }
158             enum no-ack {
159                 description
160                     "The request has been sent to the PCC, but either the
161                     session went down before we have received confirmation
162                     of the request being received by the PCC, or the request
163                     timed-out waiting for response from PCC. PCC's state is
164                     unknown -- the request may or may not be reflected
165                     in its internal state. The caller should not make
166                     any hard assumptions about PCC state until it reconnects
167                     and state synchronization completes.";
168             }
169             enum failed {
170                 description
171                     "The request has been seen by the PCC, where it failed
172                     for some external reason. The caller can assume the
173                     state transition has not taken place, but is advised
174                     to examine the attached error list to gain a deeper
175                     understanding of the failure cause.";
176             }
177         }
178     }
179
180     grouping node-id {
181         leaf node {
182             type nt:node-ref;
183             mandatory true;
184         }
185     }
186
187     grouping lsp-id {
188         uses node-id;
189
190         leaf name {
191             type string;
192             mandatory true;
193         }
194     }
195
196     grouping operation-result {
197         leaf failure {
198             type failure-type;
199         }
200
201         list error {
202             when "../failure = failed";
203             uses pcep:pcep-error-object;
204         }
205     }
206
207     grouping lsp-metadata {
208
209         container metadata {
210             description
211                 "Container for external metadata attached to the LSP. Contents of this container
212                 are not propagated onto the router itself, so it is persisted only while the LSP
213                 is present.";
214         }
215     }
216
217     grouping add-lsp-args {
218         uses lsp-id;
219
220         container arguments {
221
222             uses pcep:endpoints-object;
223
224             uses pcep:path-definition;
225
226             uses lsp-metadata;
227         }
228     }
229
230     rpc add-lsp {
231         input {
232             uses ont:network-topology-reference;
233             uses add-lsp-args;
234         }
235         output {
236             uses operation-result;
237         }
238     }
239
240     grouping remove-lsp-args {
241         uses lsp-id;
242     }
243
244     rpc remove-lsp {
245         input {
246             uses ont:network-topology-reference;
247             uses remove-lsp-args;
248         }
249         output {
250             uses operation-result;
251         }
252     }
253
254     grouping update-lsp-args {
255         uses lsp-id;
256
257         container arguments {
258
259             uses pcep:path-definition;
260
261             uses lsp-metadata;
262         }
263     }
264
265     rpc update-lsp {
266         input {
267             uses ont:network-topology-reference;
268             uses update-lsp-args;
269         }
270         output {
271             uses operation-result;
272         }
273     }
274
275     grouping ensure-lsp-operational-args {
276         uses lsp-id;
277
278         container arguments {
279
280         }
281     }
282
283     rpc ensure-lsp-operational {
284         description
285             "Ensure that the target LSP is provisioned and has specified
286             operational status.";
287
288         input {
289             uses ont:network-topology-reference;
290             uses ensure-lsp-operational-args;
291         }
292         output {
293             uses operation-result;
294         }
295     }
296
297     grouping trigger-sync-args {
298         uses lsp-id {
299           refine name {
300             mandatory false;
301           }
302         }
303     }
304
305     rpc trigger-sync {
306         input {
307             uses ont:network-topology-reference;
308             uses trigger-sync-args;
309         }
310         output {
311             uses operation-result;
312         }
313     }
314
315     rpc tear-down-session {
316         description "Closes the session between PCE and PCC.";
317         input {
318             uses ont:network-topology-reference;
319             uses node-id;
320         }
321     }
322 }
323