Bug-2081: PCEP statistics
[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-stateful02 {
47         base config:module-type;
48         config:provided-service pcep-topology-stateful;
49         config:java-name-prefix Stateful02TopologySessionListener;
50     }
51
52     augment "/config:modules/config:module/config:configuration" {
53         case pcep-topology-stateful02 {
54             when "/config:modules/config:module/config:type = 'pcep-topology-stateful02'";
55         }
56     }
57
58     identity pcep-topology-stateful07 {
59         base config:module-type;
60         config:provided-service pcep-topology-stateful;
61         config:java-name-prefix Stateful07TopologySessionListener;
62     }
63
64     augment "/config:modules/config:module/config:configuration" {
65         case pcep-topology-stateful07 {
66             when "/config:modules/config:module/config:type = 'pcep-topology-stateful07'";
67         }
68     }
69
70     identity pcep-topology-reference {
71         description
72             "Service representing a PCEP-enabled topology.";
73
74         // FIXME: should be a topology-reference, really
75         //base "topo:topology-reference";
76         base "config:service-type";
77         config:java-class "org.opendaylight.bgpcep.topology.TopologyReference";
78     }
79
80     identity pcep-topology-provider {
81         base config:module-type;
82         config:provided-service pcep-topology-reference;
83         config:java-name-prefix PCEPTopologyProvider;
84     }
85
86     augment "/config:modules/config:module/config:configuration" {
87         case pcep-topology-provider {
88             when "/config:modules/config:module/config:type = 'pcep-topology-provider'";
89
90             container data-provider {
91                 uses config:service-ref {
92                     refine type {
93                         mandatory true;
94                         config:required-identity mdsal:binding-async-data-broker;
95                     }
96                 }
97             }
98
99             container rpc-registry {
100                 uses config:service-ref {
101                     refine type {
102                         mandatory true;
103                         config:required-identity mdsal:binding-rpc-registry;
104                     }
105                 }
106             }
107
108             container dispatcher {
109                 uses config:service-ref {
110                     refine type {
111                         mandatory true;
112                         config:required-identity pcep:pcep-dispatcher;
113                     }
114                 }
115             }
116
117             container scheduler {
118                 uses config:service-ref {
119                     refine type {
120                         mandatory true;
121                         config:required-identity pgmspi:instruction-scheduler;
122                     }
123                 }
124             }
125
126             container stateful-plugin {
127                 uses config:service-ref {
128                     refine type {
129                         mandatory true;
130                         config:required-identity pcep-topology-stateful;
131                     }
132                 }
133             }
134
135             leaf topology-id {
136                 type nt:topology-id;
137                 mandatory true;
138             }
139
140             leaf listen-address {
141                 type inet:ip-address;
142                 default "0.0.0.0";
143             }
144
145             leaf listen-port {
146                 type inet:port-number;
147                 default 4189;
148             }
149
150             list client {
151                 leaf address {
152                     type inet:ip-address;
153                 }
154                 key "address";
155
156                 leaf password {
157                     type tcpmd5:rfc2385-key;
158                     description "RFC2385 shared secret";
159                 }
160             }
161         }
162     }
163
164     identity session-rpc;
165
166     grouping stateful-preferences {
167         leaf instantiation {
168             description "Represents peer's instantiation capability.";
169             type boolean;
170             default "false";
171         }
172
173         leaf stateful {
174             description "Represents peer's stateful/stateless capability.";
175             type boolean;
176             default "false";
177         }
178
179         leaf active {
180             description "Represents peer's LSP update capability.";
181             type boolean;
182             default "false";
183         }
184     }
185
186     augment "/config:modules/config:module/config:state" {
187         case pcep-topology-provider {
188             when "/config:modules/config:module/config:type = 'pcep-topology-provider'";
189             list listener-state {
190                 description "Statistics gained from session listener.";
191                 config:inner-state-bean;
192                 rpcx:rpc-context-instance "session-rpc";
193
194                 key "peer-id";
195
196                 leaf peer-id {
197                     type string;
198                 }
199
200                 container session-state {
201                     leaf session-duration {
202                         description "Elapsed time (in d:H:m:s) from session-up until now.";
203                         type string;
204                     }
205                     uses pcep-stats:pcep-session-state;
206                 }
207
208                 container peer-capabilities {
209                     description "Remote peer's (PCC) advertised stateful capabilities.";
210                     uses stateful-preferences;
211                 }
212
213                 leaf delegated-lsps-count {
214                     description "The number of delegated LSPs (tunnels) from PCC.";
215                     type uint16;
216                 }
217
218                 leaf synchronized {
219                     description "Represents synchronization status.";
220                     type boolean;
221                 }
222
223                 container stateful-messages {
224                     description "The statistics of sent/received PCEP stateful messages.";
225                     leaf last-received-rpt-msg-timestamp {
226                         description "The timestamp of last received PCRpt message.";
227                         type uint32;
228                     }
229
230                     leaf received-rpt-msg-count {
231                         description "The number of received PcRpt messages.";
232                         type uint32;
233                     }
234
235                     leaf sent-upd-msg-count {
236                         description "The number of sent PCUpd messages.";
237                         type uint32;
238                     }
239
240                     leaf sent-init-msg-count {
241                         description "The number of sent PCInitiate messages.";
242                         type uint32;
243                     }
244                 }
245
246                 container reply-time {
247                     description "Measures time elapsed from request's send to reply's received.";
248
249                     leaf average-time {
250                         description "Average time (in milliseconds) of gauged values.";
251                         type uint32;
252                     }
253
254                     leaf min-time {
255                         description "Minimal measured time value (in milliseconds).";
256                         type uint32;
257                     }
258
259                     leaf max-time {
260                         description "Maximal measured time value (in milliseconds).";
261                         type uint32;
262                     }
263                 }
264               }
265           }
266     }
267
268     rpc tear-down-session {
269         description "Closes the session between PCE and PCC.";
270         input {
271             uses rpcx:rpc-context-ref {
272                 refine context-instance {
273                     rpcx:rpc-context-instance session-rpc;
274                 }
275             }
276         }
277     }
278
279     rpc reset-stats {
280         description "Resets statistics like message counters and timestamps. (set to 0)";
281         input {
282             uses rpcx:rpc-context-ref {
283                 refine context-instance {
284                     rpcx:rpc-context-instance session-rpc;
285                 }
286             }
287         }
288     }
289 }
290