695fb1dd38a55d0ed73e342e500f7428c55dd24d
[controller.git] / opendaylight / sal / yang-prototype / code-generator / binding-generator-impl / src / test / resources / choice-case-type-test-models / ietf-netconf-monitoring@2010-10-04.yang
1 module ietf-netconf-monitoring {
2
3   namespace "urn:ietf:params:xml:ns:yang:ietf-netconf-monitoring";
4   prefix "ncm";
5
6   import ietf-yang-types { prefix yang; }
7   import ietf-inet-types { prefix inet; }
8
9   organization
10     "IETF NETCONF (Network Configuration) Working Group";
11
12   contact
13     "WG Web:   <http://tools.ietf.org/wg/netconf/>
14      WG List:  <mailto:netconf@ietf.org>
15
16      WG Chair: Mehmet Ersue
17                <mailto:mehmet.ersue@nsn.com>
18
19      WG Chair: Bert Wijnen
20                <mailto:bertietf@bwijnen.net>
21
22      Editor:   Mark Scott
23                <mailto:mark.scott@ericsson.com>
24
25      Editor:   Martin Bjorklund
26                <mailto:mbj@tail-f.com>";
27
28   description
29     "NETCONF Monitoring Module.
30      All elements in this module are read-only.
31
32      Copyright (c) 2010 IETF Trust and the persons identified as
33      authors of the code. All rights reserved.
34
35      Redistribution and use in source and binary forms, with or
36      without modification, is permitted pursuant to, and subject
37      to the license terms contained in, the Simplified BSD
38      License set forth in Section 4.c of the IETF Trust's
39      Legal Provisions Relating to IETF Documents
40      (http://trustee.ietf.org/license-info).
41
42      This version of this YANG module is part of RFC 6022; see
43      the RFC itself for full legal notices.";
44
45   revision 2010-10-04 {
46     description
47       "Initial revision.";
48     reference
49       "RFC 6022: YANG Module for NETCONF Monitoring";
50   }
51
52   typedef tls-fingerprint-type {
53     type string {
54       pattern '([0-9a-fA-F]){2}(:([0-9a-fA-F]){2})*';
55     }
56     description
57       "A cryptographic signature (fingerprint) value that can be used to
58        uniquely reference other data of potentially arbitrary length.";
59   }
60
61   typedef netconf-datastore-type {
62     type enumeration {
63       enum running;
64       enum candidate;
65       enum startup;
66     }
67     description
68       "Enumeration of possible NETCONF datastore types.";
69     reference
70       "RFC 4741: NETCONF Configuration Protocol";
71   }
72
73   container netconf-state {
74     config false;
75     description
76       "The netconf-state container is the root of the monitoring
77        data model.";
78
79     container datastores {
80       description
81         "Contains the list of NETCONF configuration datastores.";
82
83       list datastore {
84         key name;
85         description
86           "List of NETCONF configuration datastores supported by
87            the NETCONF server and related information.";
88
89         leaf name {
90           type netconf-datastore-type;
91           description
92             "Name of the datastore associated with this list entry.";
93         }
94         container locks {
95           presence
96             "This container is present only if the datastore
97              is locked.";
98           description
99             "The NETCONF <lock> and <partial-lock> operations allow
100              a client to lock specific resources in a datastore.  The
101              NETCONF server will prevent changes to the locked
102              resources by all sessions except the one that acquired
103              the lock(s).
104
105              Monitoring information is provided for each datastore
106              entry including details such as the session that acquired
107              the lock, the type of lock (global or partial) and the
108              list of locked resources.  Multiple locks per datastore
109              are supported.";
110
111           choice lock-type {
112             description
113               "Indicates if a global lock or a set of partial locks
114                are set.";
115
116             case global-lock {
117                 container global-lock {
118                 description
119                   "Present if the global lock is set.";
120
121                 leaf locked-by-session {
122                   type uint32;
123                   mandatory true;
124                   description
125                     "The session ID of the session that has locked
126                      this resource.  Both a global lock and a partial
127                      lock MUST contain the NETCONF session-id.
128
129                      If the lock is held by a session that is not managed
130                       by the NETCONF server (e.g., a CLI session), a session
131                      id of 0 (zero) is reported.";
132                   reference
133                     "RFC 4741: NETCONF Configuration Protocol";
134                 }
135                 leaf locked-time {
136                   type yang:date-and-time;
137                   mandatory true;
138                   description
139                     "The date and time of when the resource was
140                       locked.";
141                 }
142
143                 container capabilities {
144                   description
145                   "Contains the list of NETCONF capabilities supported by the
146                       server.";
147
148                   leaf-list capability {
149                       type inet:uri;
150                         description
151                           "List of NETCONF capabilities supported by the server.";
152                   }
153                 }
154               }
155             }
156
157             case partial-lock {
158               list partial-lock {
159                   key lock-id;
160                   description
161                     "List of partial locks.";
162                   reference
163                     "RFC 5717: Partial Lock Remote Procedure Call (RPC) for
164                      NETCONF";
165
166                   leaf lock-id {
167                     type uint32;
168                     description
169                       "This is the lock id returned in the <partial-lock>
170                        response.";
171                   }
172                   leaf-list select {
173                     type yang:xpath1.0;
174                     min-elements 1;
175                     description
176                       "The xpath expression that was used to request
177                        the lock.  The select expression indicates the
178                        original intended scope of the lock.";
179                   }
180                   leaf-list locked-node {
181                     type string;
182                     description
183                       "The list of instance-identifiers (i.e., the
184                        locked nodes). The scope of the partial lock is defined by the list
185                        of locked nodes.";
186                   }
187               }
188             }
189
190             case fingerprint {
191               choice algorithm-and-hash {
192                   mandatory true;
193                   case md5 {
194                     leaf md5 {
195                       type tls-fingerprint-type;
196                     }
197                   }
198                   
199                   case sha1 {
200                     leaf sha1 {
201                       type tls-fingerprint-type;
202                     }
203                   }
204                   
205                   case sha224 {
206                     leaf sha224 {
207                       type tls-fingerprint-type;
208                     }
209                   }
210                   
211                   case sha256 {
212                     leaf sha256 {
213                       type tls-fingerprint-type;
214                     }
215                   }
216                   
217                   case sha384 {
218                     leaf sha384 {
219                       type tls-fingerprint-type;
220                     }
221                   }                
222                   
223                   case sha512 {
224                     leaf sha512 {
225                       type tls-fingerprint-type;
226                     }
227                   }
228                   
229                   description
230                     "Specifies the signature algorithm and cryptographic
231                       signature (fingerprint) used to identify an X.509
232                       certificate.
233
234                       Implementations of this YANG module MAY, but are not
235                       required to, implement all of these cryptographic signature
236                       algorithms.  Implementations of this YANG module MUST
237                       implement at least one of these cryptographic signature
238                       algorithms.
239
240                       The available choices may be extended in the future as
241                       stronger cryptographic signature algorithms become
242                       available and are deemed necessary.";
243
244                   reference
245                     "RFC 5246: The Transport Layer Security (TLS) Protocol
246                       Version 1.2; Section 7.4.1.4.1,  Signature Algorithms";
247               }  // choice algorithm-and-hash
248             }
249           }
250         }
251       }
252     }
253   }
254 }