Merge "Fix bug when creating SRG termination points"
[transportpce.git] / ordmodels / common / src / main / yang / org-openroadm-user-mgmt@2019-11-29.yang
1 module org-openroadm-user-mgmt {
2   namespace "http://org/openroadm/user-mgmt";
3   prefix org-openroadm-user-mgmt;
4
5   organization
6     "Open ROADM MSA";
7   contact
8     "OpenROADM.org";
9   description
10     "YANG definitions of user managements.
11
12       Copyright of the Members of the Open ROADM MSA Agreement dated (c) 2016,
13       All other rights reserved.
14
15       Redistribution and use in source and binary forms, with or without modification,
16       are permitted provided that the following conditions are met:
17
18       * Redistributions of source code must retain the above copyright notice, this
19         list of conditions and the following disclaimer.
20       * Redistributions in binary form must reproduce the above copyright notice,
21         this list of conditions and the following disclaimer in the documentation and/or
22         other materials provided with the distribution.
23       * Neither the Members of the Open ROADM MSA Agreement nor the names of its
24         contributors may be used to endorse or promote products derived from this software
25         without specific prior written permission.
26
27       THIS SOFTWARE IS PROVIDED BY THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT ''AS IS''
28       AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
29       WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
30       IN NO EVENT THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT BE LIABLE FOR ANY DIRECT,
31       INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
32       NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;  LOSS OF USE, DATA,
33       OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
34       WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
35       ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
36       POSSIBILITY OF SUCH DAMAGE";
37
38   revision 2019-11-29 {
39     description
40       "Version 6.1.0";
41   }
42   revision 2018-11-30 {
43     description
44       "Version 4.1.0";
45   }
46   revision 2017-12-15 {
47     description
48       "Version 2.2";
49   }
50   revision 2017-09-29 {
51     description
52       "Version 2.1";
53   }
54   revision 2017-06-26 {
55     description
56       "Version 2.0";
57   }
58   revision 2016-10-14 {
59     description
60       "Version 1.2";
61   }
62
63   typedef username-type {
64     type string {
65       length "3..32";
66       pattern '[a-z][a-z0-9]{2,31}' {
67         error-message
68           "A username must begin with a lowercase letter, The remainder
69            of the string may contain lowercase letters, or numbers 0 through 9.";
70       }
71     }
72     description
73       "The user name string identifying this entry.";
74   }
75
76   typedef password-type {
77     type string {
78       length "8..128";
79       pattern '[a-zA-Z0-9!$%\^()\[\]_\-~{}.+]*' {
80         error-message "Password content does not meet the requirements";
81       }
82     }
83     description
84       "The password for this entry. This shouldn't be in clear text
85        The Password must contain at least 2 characters from
86        each of the following groups:
87        a) Lower case alphabetic (a-z)
88        b) Upper case alphabetic (A-Z)
89        c) Numeric 0-9
90        d) Special characters Allowed !$%^()[]_-~{}.+
91        Password must not contain Username.";
92   }
93
94   grouping user-profile {
95     list user {
96       key "name";
97       description
98         "The list of local users configured on this device.";
99       leaf name {
100         type username-type;
101         description
102           "The user name string identifying this entry.";
103       }
104       leaf password {
105         type password-type;
106         description
107           "The password for this entry.";
108       }
109       leaf group {
110         type enumeration {
111           enum sudo;
112         }
113         description
114           "The group to which the user is associated to.";
115       }
116     }
117   }
118
119   rpc chg-password {
120     input {
121       leaf currentPassword {
122         type password-type;
123         mandatory true;
124         description
125           "provide the current password";
126       }
127       leaf newPassword {
128         type password-type;
129         mandatory true;
130         description
131           "provide a new password";
132       }
133       leaf newPasswordConfirm {
134         type password-type;
135         mandatory true;
136         description
137           "re-enter the new password ";
138       }
139     }
140     output {
141       leaf status {
142         type enumeration {
143           enum Successful {
144             value 1;
145           }
146           enum Failed {
147             value 2;
148           }
149         }
150         mandatory true;
151         description
152           "Successful or Failed";
153       }
154       leaf status-message {
155         type string;
156         description
157           "Gives a more detailed reason for success / failure";
158       }
159     }
160   }
161 }