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