b41904ae61b41335034a47ae434a855b3d938651
[bgpcep.git] / pcep / 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 2013-10-05; }
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 "2013-10-24" {
38         description
39             "Initial revision.";
40         reference "";
41     }
42
43     typedef pcc-sync-state {
44         type enumeration {
45             enum initial-resync {
46                 description
47                     "Initial state resynchronization is being performed.";
48             }
49             enum incremental-sync {
50                 description
51                     "Incremental state resynchronization is being performed.";
52             }
53             enum triggered-initial-sync {
54                 description
55                      "Triggered initial state resynchronization is being performed.";
56             }
57             enum pcep-triggered-resync {
58                 description
59                     "Pcep triggered state resynchronization is being performed.";
60             }
61             enum synchronized {
62                 description
63                     "State synchronization has been achieved.";
64             }
65         }
66     }
67
68     grouping topology-pcep-type {
69         container topology-pcep {
70             presence "indicates a PCEP-aware topology";
71         }
72     }
73
74     augment "/nt:network-topology/nt:topology/nt:topology-types" {
75         uses topology-pcep-type;
76     }
77
78     grouping pcep-client-attributes {
79         description "Data present in a node which is a PCEP client (PCC).";
80
81         container path-computation-client {
82             description
83                 "PCC-related run-time information. This container is only
84                 present when the node is connected through PCEP in a PCC
85                 role.";
86             config false;
87
88             leaf ip-address {
89                 description
90                     "IP address which the node used to connected to the PCE.
91                     There are no guarantees as to reachability of the address,
92                     nor its relationship to other control, management, or
93                     data plane addresses.";
94
95                 type inet:ip-address;
96             }
97
98             container stateful-tlv {
99
100             }
101
102             leaf state-sync {
103                 type pcc-sync-state;
104                 when "../stateful-tlv";
105             }
106
107             list reported-lsp {
108                 leaf name {
109                     type string;
110                 }
111                 key name;
112
113                 list path {
114                     leaf lsp-id {
115                         type rsvp:lsp-id;
116                         mandatory true;
117                     }
118                     key lsp-id;
119
120                     uses pcep:path-definition;
121                 }
122                 uses lsp-metadata;
123             }
124         }
125     }
126
127     augment "/nt:network-topology/nt:topology/nt:node" {
128         when "../../nt:topology-types/topology-pcep";
129
130         uses pcep-client-attributes;
131     }
132
133     typedef failure-type {
134         description
135             "Enumeration of all the distinct failure modes that can
136             happen while servicing a request towards the PCC.";
137
138         type enumeration {
139             enum unsent {
140                 description
141                     "The request failed before it was sent to the PCC.
142                     PCC's state is guaranteed not to reflect state
143                     transition implied by the request. This typically
144                     happens if the request is syntactically invalid,
145                     the target PCC is not connected or disconnects
146                     while the request is enqueued.";
147             }
148             enum no-ack {
149                 description
150                     "The request has been sent to the PCC, but either the
151                     session went down before we have received confirmation
152                     of the request being received by the PCC, or the request
153                     timed-out waiting for response from PCC. PCC's state is
154                     unknown -- the request may or may not be reflected
155                     in its internal state. The caller should not make
156                     any hard assumptions about PCC state until it reconnects
157                     and state synchronization completes.";
158             }
159             enum failed {
160                 description
161                     "The request has been seen by the PCC, where it failed
162                     for some external reason. The caller can assume the
163                     state transition has not taken place, but is advised
164                     to examine the attached error list to gain a deeper
165                     understanding of the failure cause.";
166             }
167         }
168     }
169
170     grouping lsp-id {
171         leaf node {
172             type nt:node-ref;
173             mandatory true;
174         }
175
176         leaf name {
177             type string;
178             mandatory true;
179         }
180     }
181
182     grouping operation-result {
183         leaf failure {
184             type failure-type;
185         }
186
187         list error {
188             when "../failure = failed";
189             uses pcep:pcep-error-object;
190         }
191     }
192
193     grouping lsp-metadata {
194
195         container metadata {
196             description
197                 "Container for external metadata attached to the LSP. Contents of this container
198                 are not propagated onto the router itself, so it is persisted only while the LSP
199                 is present.";
200         }
201     }
202
203     grouping add-lsp-args {
204         uses lsp-id;
205
206         container arguments {
207
208             uses pcep:endpoints-object;
209
210             uses pcep:path-definition;
211
212             uses lsp-metadata;
213         }
214     }
215
216     rpc add-lsp {
217         input {
218             uses ont:network-topology-reference;
219             uses add-lsp-args;
220         }
221         output {
222             uses operation-result;
223         }
224     }
225
226     grouping remove-lsp-args {
227         uses lsp-id;
228     }
229
230     rpc remove-lsp {
231         input {
232             uses ont:network-topology-reference;
233             uses remove-lsp-args;
234         }
235         output {
236             uses operation-result;
237         }
238     }
239
240     grouping update-lsp-args {
241         uses lsp-id;
242
243         container arguments {
244
245             uses pcep:path-definition;
246
247             uses lsp-metadata;
248         }
249     }
250
251     rpc update-lsp {
252         input {
253             uses ont:network-topology-reference;
254             uses update-lsp-args;
255         }
256         output {
257             uses operation-result;
258         }
259     }
260
261     grouping ensure-lsp-operational-args {
262         uses lsp-id;
263
264         container arguments {
265
266         }
267     }
268
269     rpc ensure-lsp-operational {
270         description
271             "Ensure that the target LSP is provisioned and has specified
272             operational status.";
273
274         input {
275             uses ont:network-topology-reference;
276             uses ensure-lsp-operational-args;
277         }
278         output {
279             uses operation-result;
280         }
281     }
282
283     grouping trigger-sync-args {
284         uses lsp-id {
285           refine name {
286             mandatory false;
287           }
288         }
289     }
290
291     rpc trigger-sync {
292         input {
293             uses ont:network-topology-reference;
294             uses trigger-sync-args;
295         }
296         output {
297             uses operation-result;
298         }
299     }
300 }
301