Update docs conf.yaml version to Sulfur
[transportpce.git] / ordmodels / device / src / main / yang / org-openroadm-key-chain@2019-11-29.yang
1 module org-openroadm-key-chain {
2   namespace "http://org/openroadm/key-chain";
3   prefix org-openroadm-key-chain;
4
5   import ietf-yang-types {
6     prefix yang;
7     revision-date 2013-07-15;
8   }
9
10   organization
11     "Open ROADM MSA";
12   contact
13     "OpenROADM.org";
14   description
15     "This model defines the Yang model for key chain.
16
17      This model reuses data items defined in the IETF YANG model for
18      key-chain as described by RFC 8177.
19
20      Some attributes which are not required in Open ROADM MSA are removed.
21      Yang file included are changed to fit into Open ROADM MSA yang structure.
22
23      IETF code is subject to the following copyright and license:
24      Copyright (c) IETF Trust and the persons identified as authors of
25      the code.
26      All rights reserved.
27
28      Redistribution and use in source and binary forms, with or without
29      modification, is permitted pursuant to, and subject to the license
30      terms contained in, the Simplified BSD License set forth in
31      Section 4.c of the IETF Trust's Legal Provisions Relating
32      to IETF Documents (http://trustee.ietf.org/license-info).";
33
34   revision 2019-11-29 {
35     description
36       "Version 6.1.0";
37   }
38   revision 2019-03-29 {
39     description
40       "Version 5.0.0";
41   }
42   revision 2018-03-30 {
43     description
44       "Initial revision.";
45   }
46
47   feature hex-key-string {
48     description
49       "Support hexadecimal key string.";
50   }
51
52   feature independent-send-accept-lifetime {
53     description
54       "Support for independent send and accept key lifetimes.";
55   }
56
57   feature crypto-hmac-sha-1-12 {
58     description
59       "Support for TCP HMAC-SHA-1 12 byte digest hack.";
60   }
61
62   typedef key-chain-ref {
63     type leafref {
64       path "/org-openroadm-key-chain:key-chains/key-chain-list/org-openroadm-key-chain:name";
65     }
66     description
67       "This type is used by data models that need to reference
68        configured key-chains.";
69   }
70
71   grouping lifetime {
72     description
73       "Key lifetime specification.";
74     choice lifetime {
75       default "always";
76       description
77         "Options for specifying key accept or send lifetimes";
78       case always {
79         leaf always {
80           type empty;
81           description
82             "Indicates key lifetime is always valid.";
83         }
84       }
85       case start-end-time {
86         leaf start-date-time {
87           type yang:date-and-time;
88           description
89             "Start time.";
90         }
91         choice end-time {
92           default "infinite";
93           description
94             "End-time setting.";
95           case infinite {
96             leaf no-end-time {
97               type empty;
98               description
99                 "Indicates key lifetime end-time in infinite.";
100             }
101           }
102           case duration {
103             leaf duration {
104               type uint32 {
105                 range "1..2147483646";
106               }
107               units "seconds";
108               description
109                 "Key lifetime duration, in seconds";
110             }
111           }
112           case end-date-time {
113             leaf end-date-time {
114               type yang:date-and-time;
115               description
116                 "End time.";
117             }
118           }
119         }
120       }
121     }
122   }
123
124   grouping crypto-algorithm-types {
125     description
126       "Cryptographic algorithm types.";
127     choice algorithm {
128       description
129         "Options for crytographic algorithm specification.";
130       case md5 {
131         leaf md5 {
132           type empty;
133           description
134             "The MD5 algorithm.";
135         }
136       }
137     }
138   }
139
140   grouping key-chain {
141     description
142       "key-chain specification grouping.";
143     leaf name {
144       type string;
145       description
146         "Name of the key-chain.";
147     }
148     list key-chain-entry {
149       key "key-id";
150       description
151         "One key.";
152       leaf key-id {
153         type uint64 {
154           range "1..255" {
155             error-message "Configured value is out of range";
156           }
157         }
158         description
159           "Key id.";
160       }
161       container key-string {
162         description
163           "The key string.";
164         choice key-string-style {
165           description
166             "Key string styles";
167           case keystring {
168             leaf keystring {
169               type string {
170                 length "1..16" {
171                   error-message "Configured string exceeds the maximum length";
172                 }
173               }
174               description
175                 "Key string in ASCII format.";
176             }
177           }
178           case hexadecimal {
179             if-feature "hex-key-string";
180           }
181         }
182       }
183       container crypto-algorithm {
184         description
185           "Cryptographic algorithm associated with key.";
186         uses crypto-algorithm-types;
187       }
188     }
189   }
190
191   container key-chains {
192     description
193       "All configured key-chains for the device.";
194     list key-chain-list {
195       key "name";
196       description
197         "List of key-chains.";
198       uses key-chain;
199     }
200   }
201   container key-chains-state {
202     config false;
203     description
204       "All configured key-chains state.";
205     list key-chain-list-state {
206       description
207         "One key-chain state.";
208       leaf name-state {
209         type string;
210         description
211           "Configured name of the key-chain.";
212       }
213       list key-chain-entry {
214         key "key-id";
215         description
216           "One key.";
217         leaf key-id {
218           type uint64;
219           description
220             "Configurd key id.";
221         }
222         container crypto-algorithm-state {
223           description
224             "Configured cryptographic algorithm.";
225           uses crypto-algorithm-types;
226         }
227       }
228     }
229   }
230 }