Add interface SslHandlerFactory
[netconf.git] / netconf / sal-netconf-connector / src / test / resources / schemas / netconf-node-topology.yang
1 module netconf-node-topology {
2     namespace "urn:opendaylight:netconf-node-topology";
3     prefix "nettop";
4
5     import network-topology { prefix nt; revision-date 2013-10-21; }
6     import yang-ext { prefix ext; revision-date "2013-07-09";}
7     import ietf-inet-types { prefix inet; revision-date "2013-07-15"; }
8
9     revision "2015-01-14" {
10         description "Initial revision of Topology model";
11     }
12
13     augment "/nt:network-topology/nt:topology/nt:topology-types" {
14         container topology-netconf {
15         }
16     }
17
18     grouping netconf-node-credentials {
19
20         choice credentials {
21             config true;
22             case login-password {
23                 leaf username {
24                     type string;
25                 }
26
27                 leaf password {
28                     type string;
29                 }
30             }
31         }
32     }
33
34     grouping netconf-node-connection-parameters {
35
36         leaf host {
37             type inet:host;
38         }
39
40         leaf port {
41             type inet:port-number;
42         }
43
44         leaf tcp-only {
45             config true;
46             type boolean;
47         }
48
49         container protocol {
50             config true;
51             leaf name {
52                 type enumeration {
53                     enum SSH;
54                     enum TLS;
55                 }
56                 default SSH;
57             }
58
59             choice specification {
60                 case tls-case {
61                    container tls {
62                        leaf-list excluded-versions {
63                            type string;
64                            description "A list of TLS version names provided in JDK that are not supported by the
65                                         target netconf device, eg, the netopeer2 simulator does not support the
66                                         SSLv2Hello. Most of the time, this list need not be set";
67                        }
68                    }
69                 }
70             }
71         }
72
73         leaf schemaless {
74             type boolean;
75             default false;
76         }
77
78         container yang-module-capabilities {
79             config true;
80             leaf override {
81                 type boolean;
82                 default false;
83                 description "Whether to override or merge this list of capabilities with capabilities from device";
84             }
85
86             leaf-list capability {
87                 type string;
88                 description "Set a list of capabilities to override capabilities provided in device's hello message.
89                              Can be used for devices that do not report any yang modules in their hello message";
90             }
91         }
92
93         container non-module-capabilities {
94             config true;
95             leaf override {
96                 type boolean;
97                 default false;
98                 description "Whether to override or merge this list of non-module based capabilities with non-module
99                              based capabilities from device";
100             }
101
102             leaf-list capability {
103                 type string;
104                 description "Set a list of non-module based capabilities to override or merge non-module capabilities
105                              provided in device's hello message. Can be used for devices that do not report or
106                              incorrectly report non-module based capabilities in their hello message";
107             }
108         }
109
110         leaf reconnect-on-changed-schema {
111             config true;
112             type boolean;
113             default false;
114             description "If true, the connector would auto disconnect/reconnect when schemas are changed in the remote device.
115                          The connector subscribes (right after connect) to base netconf notifications and listens for netconf-capability-change notification";
116         }
117
118         leaf connection-timeout-millis {
119             description "Specifies timeout in milliseconds after which connection must be established.";
120             config true;
121             type uint32;
122             default 20000;
123         }
124
125         leaf default-request-timeout-millis {
126             description "Timeout for blocking operations within transactions.";
127             config true;
128             type uint32;
129             default 60000;
130         }
131
132         leaf max-connection-attempts {
133             description "Maximum number of connection retries. Non positive value or null is interpreted as infinity.";
134             config true;
135             type uint32;
136             default 0; // retry forever
137         }
138
139         leaf between-attempts-timeout-millis {
140             description "Initial timeout in milliseconds to wait between connection attempts. Will be multiplied by sleep-factor with every additional attempt";
141             config true;
142             type uint16;
143             default 2000;
144         }
145
146         leaf sleep-factor {
147             config true;
148             type decimal64 {
149                 fraction-digits 1;
150             }
151             default 1.5;
152         }
153
154         // Keepalive configuration
155         leaf keepalive-delay {
156             config true;
157             type uint32;
158             default 120;
159             description "Netconf connector sends keepalive RPCs while the session is idle, this delay specifies the delay between keepalive RPC in seconds
160                          If a value <1 is provided, no keepalives will be sent";
161         }
162
163         leaf concurrent-rpc-limit {
164             config true;
165             type uint16;
166             default 0;
167             description "Limit of concurrent messages that can be send before reply messages are received.
168                          If value <1 is provided, no limit will be enforced";
169         }
170     }
171
172     grouping netconf-node-connection-status {
173
174         leaf connection-status {
175             config false;
176             type enumeration {
177                 enum connecting;
178                 enum connected;
179                 enum unable-to-connect;
180             }
181         }
182
183         container clustered-connection-status {
184             config false;
185             list node-status {
186                 leaf node {
187                     type string;
188                 }
189                 leaf status {
190                     type enumeration {
191                         enum connected;
192                         enum unavailable;
193                         enum failed;
194                     }
195                 }
196             }
197         }
198
199         leaf connected-message {
200             config false;
201             type string;
202         }
203
204         container available-capabilities {
205             config false;
206             list available-capability {
207                 leaf capability {
208                     type string;
209                 }
210                 leaf capability-origin {
211                     type enumeration {
212                         enum user-defined;
213                         enum device-advertised;
214                     }
215                 }
216             }
217         }
218
219         container unavailable-capabilities {
220             config false;
221             list unavailable-capability {
222                 leaf capability {
223                     type string;
224                 }
225
226                 leaf failure-reason {
227                     type enumeration {
228                         enum missing-source;
229                         enum unable-to-resolve;
230                     }
231                 }
232             }
233         }
234
235         container pass-through {
236             when "../connection-status = connected";
237             description
238                 "When the underlying node is connected, its NETCONF context
239                 is available verbatim under this container through the
240                 mount extension.";
241         }
242
243     }
244
245     grouping netconf-schema-storage {
246         leaf schema-cache-directory {
247             config true;
248             type string;
249             default "schema";
250             description "The destination schema repository for yang files relative to the cache directory.  This may be specified per netconf mount
251                          so that the loaded yang files are stored to a distinct directory to avoid potential conflict.";
252         }
253
254         container yang-library {
255             leaf yang-library-url {
256                 config true;
257                 type inet:uri;
258                 description "Yang library to be plugged as additional source provider into the shared schema repository";
259             }
260
261             // credentials for basic http authentication
262             leaf username {
263                 config true;
264                 type string;
265             }
266
267             leaf password {
268                 config true;
269                 type string;
270             }
271         }
272     }
273
274     grouping netconf-node-fields {
275
276         uses netconf-node-credentials;
277
278         uses netconf-node-connection-parameters;
279
280         uses netconf-node-connection-status;
281
282         uses netconf-schema-storage;
283
284     }
285
286     augment "/nt:network-topology/nt:topology/nt:node" {
287         when "../../nt:topology-types/topology-netconf";
288         ext:augment-identifier "netconf-node";
289
290         uses netconf-node-fields;
291     }
292 }