Add OpenROADM 7.1.0 device and common models
[transportpce.git] / ordmodels / device / src / main / yang / org-openroadm-security@2020-05-29.yang
1 module org-openroadm-security {
2   yang-version 1.1;
3   namespace "http://org/openroadm/security";
4   prefix org-openroadm-security;
5
6   import org-openroadm-device {
7     prefix org-openroadm-device;
8     revision-date 2020-05-29;
9   }
10   import org-openroadm-common-types {
11     prefix org-openroadm-common-types;
12     revision-date 2020-05-29;
13   }
14
15   organization
16     "Open ROADM MSA";
17   contact
18     "OpenROADM.org";
19   description
20     "This model defines the Yang model for openroadm security.
21
22      Copyright of the Members of the Open ROADM MSA Agreement dated (c) 2016,
23      All other rights reserved.
24
25      Redistribution and use in source and binary forms, with or without modification,
26      are permitted provided that the following conditions are met:
27
28      * Redistributions of source code must retain the above copyright notice, this
29        list of conditions and the following disclaimer.
30      * Redistributions in binary form must reproduce the above copyright notice,
31        this list of conditions and the following disclaimer in the documentation and/or
32        other materials provided with the distribution.
33      * Neither the Members of the Open ROADM MSA Agreement nor the names of its
34        contributors may be used to endorse or promote products derived from this software
35        without specific prior written permission.
36
37      THIS SOFTWARE IS PROVIDED BY THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT ''AS IS''
38      AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
39      WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
40      IN NO EVENT THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT BE LIABLE FOR ANY DIRECT,
41      INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
42      NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;  LOSS OF USE, DATA,
43      OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
44      WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
45      ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
46      POSSIBILITY OF SUCH DAMAGE.";
47
48   revision 2020-05-29 {
49     description
50       "Version 7.1.0";
51   }
52   revision 2020-03-27 {
53     description
54       "Version 7.0.0";
55   }
56   revision 2019-11-29 {
57     description
58       "Version 6.1.0";
59   }
60   revision 2019-09-27 {
61     description
62       "Version 6.0.0";
63   }
64   revision 2019-05-31 {
65     description
66       "Version 5.1.0";
67   }
68   revision 2019-03-29 {
69     description
70       "Initial revision.";
71   }
72
73   typedef certificate-id-type {
74     type string {
75       length "3..250";
76       pattern '(([a-zA-Z]([a-zA-Z0-9_.-]*)([a-zA-Z0-9])))' {
77         error-message
78           "The certificate id must start with a letter and
79            end with a letter or digit. Interior characters are only
80            alphabets, digits, minus, underscore and dot.";
81       }
82     }
83     description
84       "The certificate id must starts with a letter and
85        end with a letter or digit. Interior characters are only
86        alphabets, digits, minus, underscore and dot.";
87   }
88
89   grouping security-container {
90     description
91       "Grouping for standalone security certificates";
92     container security {
93       description
94         "Security related Configurations";
95       list certificate {
96         key "certificate-id";
97         max-elements 10;
98         description
99           "A list of certificates for this system";
100         action install {
101           description
102             "Install certificate.";
103           input {
104             leaf filename {
105               type string;
106               description
107                 "Name of the certificate file to be installed.";
108             }
109           }
110           output {
111             uses org-openroadm-common-types:rpc-response-status;
112           }
113         }
114         leaf certificate-id {
115           type certificate-id-type;
116           description
117             "Certificate identifier";
118         }
119         leaf information {
120           type string;
121           config false;
122           description
123             "Information about the certificate
124              (subject line in the certificate).";
125         }
126       }
127       list ca-certificate {
128         key "ca-certificate-id";
129         max-elements 10;
130         description
131           "A list of CA certificates for this system";
132         action install {
133           description
134             "Install certificate.";
135           input {
136             leaf filename {
137               type string;
138               description
139                 "Name of the CA certificate file to be installed.";
140             }
141           }
142           output {
143             uses org-openroadm-common-types:rpc-response-status;
144           }
145         }
146         leaf ca-certificate-id {
147           type certificate-id-type;
148           description
149             "CA certificate identifier";
150         }
151         leaf information {
152           type string;
153           config false;
154           description
155             "Information about the CA certificate
156              (subject line in the certificate).";
157         }
158       }
159     }
160   }
161
162   augment "/org-openroadm-device:org-openroadm-device" {
163     description
164       "Augment for security container under device";
165     uses security-container;
166   }
167 }