Merge "Bug 6023 - Adress for config subsystem netconf endpoint is not configurable"
[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         leaf schemaless {
50             type boolean;
51             default false;
52         }
53
54         container yang-module-capabilities {
55             config true;
56             leaf override {
57                 type boolean;
58                 default false;
59                 description "Whether to override or merge this list of capabilities with capabilities from device";
60             }
61
62             leaf-list capability {
63                 type string;
64                 description "Set a list of capabilities to override capabilities provided in device's hello message.
65                              Can be used for devices that do not report any yang modules in their hello message";
66             }
67         }
68
69         leaf reconnect-on-changed-schema {
70             config true;
71             type boolean;
72             default false;
73             description "If true, the connector would auto disconnect/reconnect when schemas are changed in the remote device.
74                          The connector subscribes (right after connect) to base netconf notifications and listens for netconf-capability-change notification";
75         }
76
77         leaf connection-timeout-millis {
78             description "Specifies timeout in milliseconds after which connection must be established.";
79             config true;
80             type uint32;
81             default 20000;
82         }
83
84         leaf default-request-timeout-millis {
85             description "Timeout for blocking operations within transactions.";
86             config true;
87             type uint32;
88             default 60000;
89         }
90
91         leaf max-connection-attempts {
92             description "Maximum number of connection retries. Non positive value or null is interpreted as infinity.";
93             config true;
94             type uint32;
95             default 0; // retry forever
96         }
97
98         leaf between-attempts-timeout-millis {
99             description "Initial timeout in milliseconds to wait between connection attempts. Will be multiplied by sleep-factor with every additional attempt";
100             config true;
101             type uint16;
102             default 2000;
103         }
104
105         leaf sleep-factor {
106             config true;
107             type decimal64 {
108                 fraction-digits 1;
109             }
110             default 1.5;
111         }
112
113         // Keepalive configuration
114         leaf keepalive-delay {
115             config true;
116             type uint32;
117             default 120;
118             description "Netconf connector sends keepalive RPCs while the session is idle, this delay specifies the delay between keepalive RPC in seconds
119                          If a value <1 is provided, no keepalives will be sent";
120         }
121
122         leaf concurrent-rpc-limit {
123             config true;
124             type uint16;
125             default 0;
126             description "Limit of concurrent messages that can be send before reply messages are received.
127                          If value <1 is provided, no limit will be enforced";
128         }
129     }
130
131     grouping netconf-node-connection-status {
132
133         leaf connection-status {
134             config false;
135             type enumeration {
136                 enum connecting;
137                 enum connected;
138                 enum unable-to-connect;
139             }
140         }
141
142         container clustered-connection-status {
143             config false;
144             list node-status {
145                 leaf node {
146                     type string;
147                 }
148                 leaf status {
149                     type enumeration {
150                         enum connected;
151                         enum unavailable;
152                         enum failed;
153                     }
154                 }
155             }
156         }
157
158         leaf connected-message {
159             config false;
160             type string;
161         }
162
163         container available-capabilities {
164             config false;
165             list available-capability {
166                 leaf capability {
167                     type string;
168                 }
169                 leaf capability-origin {
170                     type enumeration {
171                         enum user-defined;
172                         enum device-advertised;
173                     }
174                 }
175             }
176         }
177
178         container unavailable-capabilities {
179             config false;
180             list unavailable-capability {
181                 leaf capability {
182                     type string;
183                 }
184
185                 leaf failure-reason {
186                     type enumeration {
187                         enum missing-source;
188                         enum unable-to-resolve;
189                     }
190                 }
191             }
192         }
193
194         container pass-through {
195             when "../connection-status = connected";
196             description
197                 "When the underlying node is connected, its NETCONF context
198                 is available verbatim under this container through the
199                 mount extension.";
200         }
201
202     }
203
204     grouping netconf-schema-storage {
205         leaf schema-cache-directory {
206             config true;
207             type string;
208             default "schema";
209             description "The destination schema repository for yang files relative to the cache directory.  This may be specified per netconf mount
210                          so that the loaded yang files are stored to a distinct directory to avoid potential conflict.";
211         }
212
213         container yang-library {
214             leaf yang-library-url {
215                 config true;
216                 type inet:uri;
217                 description "Yang library to be plugged as additional source provider into the shared schema repository";
218             }
219
220             // credentials for basic http authentication
221             leaf username {
222                 config true;
223                 type string;
224             }
225
226             leaf password {
227                 config true;
228                 type string;
229             }
230         }
231     }
232
233     grouping netconf-node-fields {
234
235         uses netconf-node-credentials;
236
237         uses netconf-node-connection-parameters;
238
239         uses netconf-node-connection-status;
240
241         uses netconf-schema-storage;
242
243     }
244
245     augment "/nt:network-topology/nt:topology/nt:node" {
246         when "../../nt:topology-types/topology-netconf";
247         ext:augment-identifier "netconf-node";
248
249         uses netconf-node-fields;
250     }
251 }