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