Removed pcep-stateful02 implementation
[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     }
151
152     identity session-rpc;
153
154     grouping stateful-preferences {
155         leaf instantiation {
156             description "Represents peer's instantiation capability.";
157             type boolean;
158             default "false";
159         }
160
161         leaf stateful {
162             description "Represents peer's stateful/stateless capability.";
163             type boolean;
164             default "false";
165         }
166
167         leaf active {
168             description "Represents peer's LSP update capability.";
169             type boolean;
170             default "false";
171         }
172     }
173
174     augment "/config:modules/config:module/config:state" {
175         case pcep-topology-provider {
176             when "/config:modules/config:module/config:type = 'pcep-topology-provider'";
177             list listener-state {
178                 description "Statistics gained from session listener.";
179                 config:inner-state-bean;
180                 rpcx:rpc-context-instance "session-rpc";
181
182                 key "peer-id";
183
184                 leaf peer-id {
185                     type string;
186                 }
187
188                 container session-state {
189                     leaf session-duration {
190                         description "Elapsed time (in d:H:m:s) from session-up until now.";
191                         type string;
192                     }
193                     uses pcep-stats:pcep-session-state;
194                 }
195
196                 container peer-capabilities {
197                     description "Remote peer's (PCC) advertised stateful capabilities.";
198                     uses stateful-preferences;
199                 }
200
201                 leaf delegated-lsps-count {
202                     description "The number of delegated LSPs (tunnels) from PCC.";
203                     type uint16;
204                 }
205
206                 leaf synchronized {
207                     description "Represents synchronization status.";
208                     type boolean;
209                 }
210
211                 container stateful-messages {
212                     description "The statistics of sent/received PCEP stateful messages.";
213                     leaf last-received-rpt-msg-timestamp {
214                         description "The timestamp of last received PCRpt message.";
215                         type uint32;
216                     }
217
218                     leaf received-rpt-msg-count {
219                         description "The number of received PcRpt messages.";
220                         type uint32;
221                     }
222
223                     leaf sent-upd-msg-count {
224                         description "The number of sent PCUpd messages.";
225                         type uint32;
226                     }
227
228                     leaf sent-init-msg-count {
229                         description "The number of sent PCInitiate messages.";
230                         type uint32;
231                     }
232                 }
233
234                 container reply-time {
235                     description "Measures time elapsed from request's send to reply's received.";
236
237                     leaf average-time {
238                         description "Average time (in milliseconds) of gauged values.";
239                         type uint32;
240                     }
241
242                     leaf min-time {
243                         description "Minimal measured time value (in milliseconds).";
244                         type uint32;
245                     }
246
247                     leaf max-time {
248                         description "Maximal measured time value (in milliseconds).";
249                         type uint32;
250                     }
251                 }
252               }
253           }
254     }
255
256     rpc tear-down-session {
257         description "Closes the session between PCE and PCC.";
258         input {
259             uses rpcx:rpc-context-ref {
260                 refine context-instance {
261                     rpcx:rpc-context-instance session-rpc;
262                 }
263             }
264         }
265     }
266
267     rpc reset-stats {
268         description "Resets statistics like message counters and timestamps. (set to 0)";
269         input {
270             uses rpcx:rpc-context-ref {
271                 refine context-instance {
272                     rpcx:rpc-context-instance session-rpc;
273                 }
274             }
275         }
276     }
277 }
278