Bug-5612: ODL(PCEP) infinitely waits for the response from peer for addlsp
[bgpcep.git] / pcep / topology-provider / src / main / yang / odl-pcep-topology-provider-cfg.yang
1 // vi: set smarttab et sw=4 tabstop=4:
2 module odl-pcep-topology-provider-cfg {
3     yang-version 1;
4     namespace "urn:opendaylight:params:xml:ns:yang:controller:pcep:topology:provider";
5     prefix "p2p";
6
7     import config { prefix config; revision-date 2013-04-05; }
8     import odl-programming-spi-cfg { prefix pgmspi; revision-date 2013-11-15; }
9     import odl-topology-api-cfg { prefix topo; revision-date 2013-11-15; }
10     import ietf-inet-types { prefix inet; revision-date 2010-09-24; }
11     import network-topology { prefix nt; revision-date 2013-10-21; }
12     import odl-pcep-api-cfg { prefix pcep; revision-date 2013-04-09; }
13     import opendaylight-md-sal-binding { prefix mdsal; revision-date 2013-10-28; }
14     import odl-tcpmd5-cfg { prefix tcpmd5; revision-date 2014-04-27; }
15     import rpc-context { prefix rpcx; revision-date 2013-06-17; }
16     import pcep-session-stats { prefix pcep-stats; revision-date 2014-10-06; }
17
18     organization "Cisco Systems, Inc.";
19
20     contact "Robert Varga <rovarga@cisco.com>";
21
22     description
23         "This module contains the base YANG definitions for
24         PCEP topology provider service.
25
26         Copyright (c)2013 Cisco Systems, Inc. All rights reserved.;
27
28         This program and the accompanying materials are made available
29         under the terms of the Eclipse Public License v1.0 which
30         accompanies this distribution, and is available at
31         http://www.eclipse.org/legal/epl-v10.html";
32
33     revision "2013-11-15" {
34         description
35             "Initial revision";
36     }
37
38     identity pcep-topology-stateful {
39         description
40             "Service representing a stateful draft support module";
41
42         base "config:service-type";
43         config:java-class "org.opendaylight.bgpcep.pcep.topology.provider.TopologySessionListenerFactory";
44     }
45
46     identity pcep-topology-stateful07 {
47         base config:module-type;
48         config:provided-service pcep-topology-stateful;
49         config:java-name-prefix Stateful07TopologySessionListener;
50     }
51
52     augment "/config:modules/config:module/config:configuration" {
53         case pcep-topology-stateful07 {
54             when "/config:modules/config:module/config:type = 'pcep-topology-stateful07'";
55         }
56     }
57
58     identity pcep-topology-reference {
59         description
60             "Service representing a PCEP-enabled topology.";
61
62         // FIXME: should be a topology-reference, really
63         //base "topo:topology-reference";
64         base "config:service-type";
65         config:java-class "org.opendaylight.bgpcep.topology.TopologyReference";
66     }
67
68     identity pcep-topology-provider {
69         base config:module-type;
70         config:provided-service pcep-topology-reference;
71         config:java-name-prefix PCEPTopologyProvider;
72     }
73
74     augment "/config:modules/config:module/config:configuration" {
75         case pcep-topology-provider {
76             when "/config:modules/config:module/config:type = 'pcep-topology-provider'";
77
78             container data-provider {
79                 uses config:service-ref {
80                     refine type {
81                         mandatory true;
82                         config:required-identity mdsal:binding-async-data-broker;
83                     }
84                 }
85             }
86
87             container rpc-registry {
88                 uses config:service-ref {
89                     refine type {
90                         mandatory true;
91                         config:required-identity mdsal:binding-rpc-registry;
92                     }
93                 }
94             }
95
96             container dispatcher {
97                 uses config:service-ref {
98                     refine type {
99                         mandatory true;
100                         config:required-identity pcep:pcep-dispatcher;
101                     }
102                 }
103             }
104
105             container scheduler {
106                 uses config:service-ref {
107                     refine type {
108                         mandatory true;
109                         config:required-identity pgmspi:instruction-scheduler;
110                     }
111                 }
112             }
113
114             container stateful-plugin {
115                 uses config:service-ref {
116                     refine type {
117                         mandatory true;
118                         config:required-identity pcep-topology-stateful;
119                     }
120                 }
121             }
122
123             leaf topology-id {
124                 type nt:topology-id;
125                 mandatory true;
126             }
127
128             leaf listen-address {
129                 type inet:ip-address;
130                 default "0.0.0.0";
131             }
132
133             leaf listen-port {
134                 type inet:port-number;
135                 default 4189;
136             }
137
138             list client {
139                 leaf address {
140                     type inet:ip-address;
141                 }
142                 key "address";
143
144                 leaf password {
145                     type tcpmd5:rfc2385-key;
146                     description "RFC2385 shared secret";
147                 }
148             }
149
150             leaf rpc-timeout {
151                 type int16;
152                 default 30;
153             }
154         }
155     }
156
157     identity session-rpc;
158
159     grouping stateful-preferences {
160         leaf instantiation {
161             description "Represents peer's instantiation capability.";
162             type boolean;
163             default "false";
164         }
165
166         leaf stateful {
167             description "Represents peer's stateful/stateless capability.";
168             type boolean;
169             default "false";
170         }
171
172         leaf active {
173             description "Represents peer's LSP update capability.";
174             type boolean;
175             default "false";
176         }
177     }
178
179     augment "/config:modules/config:module/config:state" {
180         case pcep-topology-provider {
181             when "/config:modules/config:module/config:type = 'pcep-topology-provider'";
182             list listener-state {
183                 description "Statistics gained from session listener.";
184                 config:inner-state-bean;
185                 rpcx:rpc-context-instance "session-rpc";
186
187                 key "peer-id";
188
189                 leaf peer-id {
190                     type string;
191                 }
192
193                 container session-state {
194                     leaf session-duration {
195                         description "Elapsed time (in d:H:m:s) from session-up until now.";
196                         type string;
197                     }
198                     uses pcep-stats:pcep-session-state;
199                 }
200
201                 container peer-capabilities {
202                     description "Remote peer's (PCC) advertised stateful capabilities.";
203                     uses stateful-preferences;
204                 }
205
206                 leaf delegated-lsps-count {
207                     description "The number of delegated LSPs (tunnels) from PCC.";
208                     type uint16;
209                 }
210
211                 leaf synchronized {
212                     description "Represents synchronization status.";
213                     type boolean;
214                 }
215
216                 container stateful-messages {
217                     description "The statistics of sent/received PCEP stateful messages.";
218                     leaf last-received-rpt-msg-timestamp {
219                         description "The timestamp of last received PCRpt message.";
220                         type uint32;
221                     }
222
223                     leaf received-rpt-msg-count {
224                         description "The number of received PcRpt messages.";
225                         type uint32;
226                     }
227
228                     leaf sent-upd-msg-count {
229                         description "The number of sent PCUpd messages.";
230                         type uint32;
231                     }
232
233                     leaf sent-init-msg-count {
234                         description "The number of sent PCInitiate messages.";
235                         type uint32;
236                     }
237                 }
238
239                 container reply-time {
240                     description "Measures time elapsed from request's send to reply's received.";
241
242                     leaf average-time {
243                         description "Average time (in milliseconds) of gauged values.";
244                         type uint32;
245                     }
246
247                     leaf min-time {
248                         description "Minimal measured time value (in milliseconds).";
249                         type uint32;
250                     }
251
252                     leaf max-time {
253                         description "Maximal measured time value (in milliseconds).";
254                         type uint32;
255                     }
256                 }
257               }
258           }
259     }
260
261     rpc tear-down-session {
262         description "Closes the session between PCE and PCC.";
263         input {
264             uses rpcx:rpc-context-ref {
265                 refine context-instance {
266                     rpcx:rpc-context-instance session-rpc;
267                 }
268             }
269         }
270     }
271
272     rpc reset-stats {
273         description "Resets statistics like message counters and timestamps. (set to 0)";
274         input {
275             uses rpcx:rpc-context-ref {
276                 refine context-instance {
277                     rpcx:rpc-context-instance session-rpc;
278                 }
279             }
280         }
281     }
282 }
283