Added routed rpcs to pcep-topology|tunnel-provider
[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 pcep-ietf-stateful { prefix stateful; revision-date 2013-12-22; }
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     revision "2013-10-24" {
33         description
34             "Initial revision.";
35         reference "";
36     }
37
38     typedef pcc-sync-state {
39         type enumeration {
40             enum initial-resync {
41                 description
42                     "Initial state resynchronization is being performed.";
43             }
44             enum synchronized {
45                 description
46                     "State synchronization has been achieved.";
47             }
48         }
49     }
50
51     grouping topology-pcep-type {
52         container topology-pcep {
53             presence "indicates a PCEP-aware topology";
54         }
55     }
56
57     augment "/nt:network-topology/nt:topology/nt:topology-types" {
58         uses topology-pcep-type;
59     }
60
61     grouping pcep-client-attributes {
62         description "Data present in a node which is a PCEP client (PCC).";
63
64         container path-computation-client {
65             description
66                 "PCC-related run-time information. This container is only
67                 present when the node is connected through PCEP in a PCC
68                 role.";
69             config false;
70
71             leaf ip-address {
72                 description
73                     "IP address which the node used to connected to the PCE.
74                     There are no guarantees as to reachability of the address,
75                     nor its relationship to other control, management, or
76                     data plane addresses.";
77
78                 type inet:ip-address;
79                 mandatory true;
80             }
81
82             container stateful-tlv {
83                 uses stateful:stateful-capability-tlv;
84             }
85
86             leaf state-sync {
87                 when "../stateful-tlv";
88                 type pcc-sync-state;
89             }
90
91             list reported-lsp {
92                 leaf name {
93                     type stateful:symbolic-path-name;
94                 }
95                 key name;
96
97                 uses stateful:lsp-object;
98
99                 container path {
100                     uses pcep:path-definition;
101                 }
102
103                 uses lsp-metadata;
104             }
105         }
106     }
107
108     augment "/nt:network-topology/nt:topology/nt:node" {
109         when "../../nt:topology-types/topology-pcep";
110
111         uses pcep-client-attributes;
112     }
113
114     typedef failure-type {
115         type enumeration {
116             enum unsent;
117             enum no-ack;
118             enum failed;
119         }
120     }
121
122     grouping lsp-id {
123         leaf node {
124             type nt:node-ref;
125             mandatory true;
126         }
127
128         leaf name {
129             type stateful:symbolic-path-name;
130             mandatory true;
131         }
132     }
133
134     grouping operation-result {
135         leaf failure {
136             type failure-type;
137         }
138     }
139
140     grouping lsp-metadata {
141
142         container metadata {
143             description
144                 "Container for external metadata attached to the LSP. Contents of this container
145                 are not propagated onto the router itself, so it is persisted only while the LSP
146                 is present.";
147         }
148     }
149
150     grouping add-lsp-args {
151         uses lsp-id;
152
153         container arguments {
154             leaf administrative {
155                 type boolean;
156                 default true;
157             }
158
159             uses pcep:endpoints-object;
160
161             uses pcep:path-definition;
162
163             uses lsp-metadata;
164         }
165     }
166
167     rpc add-lsp {
168         input {
169             uses ont:network-topology-reference;
170             uses add-lsp-args;
171         }
172         output {
173             uses operation-result;
174         }
175     }
176
177     grouping remove-lsp-args {
178         uses lsp-id;
179     }
180
181     rpc remove-lsp {
182         input {
183             uses ont:network-topology-reference;
184             uses remove-lsp-args;
185         }
186         output {
187             uses operation-result;
188         }
189     }
190
191     grouping update-lsp-args {
192         uses lsp-id;
193
194         container arguments {
195             leaf administrative {
196                 type boolean;
197                 default true;
198             }
199
200             uses pcep:path-definition;
201
202             uses lsp-metadata;
203         }
204     }
205
206     rpc update-lsp {
207         input {
208             uses ont:network-topology-reference;
209             uses update-lsp-args;
210         }
211         output {
212             uses operation-result;
213         }
214     }
215
216     grouping ensure-lsp-operational-args {
217         uses lsp-id;
218
219         container arguments {
220             leaf operational {
221                 type stateful:operational-status;
222                 mandatory true;
223             }
224         }
225     }
226
227     rpc ensure-lsp-operational {
228         description
229             "Ensure that the target LSP is provisioned and has specified
230             operational status.";
231
232         input {
233             uses ont:network-topology-reference;
234             uses ensure-lsp-operational-args;
235         }
236         output {
237             uses operation-result;
238         }
239     }
240 }
241