Legrand / Raritan / Server Technology Xerus™ JSON-RPC API: UserManager.idl Source File

Legrand / Raritan / Server Technology Xerus™ JSON-RPC API

Loading...
Searching...
No Matches
UserManager.idl
1/* SPDX-License-Identifier: BSD-3-Clause */
2/*
3 * Copyright 2009 Raritan Inc. All rights reserved.
4 */
5
6#include <User.idl>
7#include <UserEvent.idl>
8
9/**
10 * %User Management
11 */
12module usermgmt {
13
14 /** %Account information */
15 structure Account {
16 string name; ///< %Account name
17 UserInfo info; ///< %User information
18 };
19
20 /* event definitions */
21 /**
22 * Base type of all account event
23 */
24 valueobject AccountEvent extends event.UserEvent {
25 string username; ///< name of user which was affected
26 };
27
28 /**
29 * This event is emitted after a new account with the
30 * provided username was added
31 */
32 valueobject AccountAdded extends AccountEvent {};
33
34 /**
35 * This event is emitted after an account has been renamed
36 */
37 valueobject AccountRenamed extends AccountEvent {
38 string newUsername; ///< new user name
39 };
40
41 /**
42 * This event is emitted after the account with
43 * the provided username has been removed
44 */
45 valueobject AccountRemoved extends AccountEvent {};
46
47 /**
48 * This event is emitted after the password for
49 * an account was changed
50 */
51 valueobject PasswordChanged extends AccountEvent {};
52
53 /**
54 * This event is emitted if the settings of an account
55 * as defined in usermgmt.UserInfo have changed
56 */
57 valueobject AccountChanged extends AccountEvent {};
58
59
60 /** %User manager interface */
61 interface UserManager {
62
63 constant int ERR_USER_DOESNT_EXIST = 1; ///< A user with the given name does not exist
64 constant int ERR_USER_NOT_DELETABLE = 2; ///< The user is not deletable
65
66 constant int ERR_USER_ALREADY_EXISTS = 1; ///< A user with the given name already exists
67 constant int ERR_MAX_USERS_REACHED = 2; ///< Maximum number of users reached
68 constant int ERR_PASSWORD_TOO_SHORT_FOR_SNMP = 3; ///< The password is too short to be used as SNMPv3 passphrase
69 constant int ERR_INVALID_VALUE = 4; ///< Invalid arguments
70 constant int ERR_PASSWORD_EMPTY = 5; ///< The password must not be empty
71 constant int ERR_PASSWORD_TOO_SHORT = 6; ///< The password is too short
72 constant int ERR_PASSWORD_TOO_LONG = 7; ///< The password is too long
73 constant int ERR_PASSWORD_CTRL_CHARS = 8; ///< The password must not contain control characters
74 constant int ERR_PASSWORD_NEED_LOWER = 9; ///< The password must contain at least one lower-case character
75 constant int ERR_PASSWORD_NEED_UPPER = 10; ///< The password must contain at least one upper-case character
76 constant int ERR_PASSWORD_NEED_NUMERIC = 11; ///< The password must contain at least one numeric character
77 constant int ERR_PASSWORD_NEED_SPECIAL = 12; ///< The password must contain at least one special character
78 constant int ERR_SSH_PUBKEY_DATA_TOO_LARGE = 14; ///< The ssh public key data is too large.
79 constant int ERR_SSH_PUBKEY_INVALID = 15; ///< The ssh public key is invalid.
80 constant int ERR_SSH_PUBKEY_NOT_SUPPORTED = 16; ///< The ssh public key is not supported.
81 constant int ERR_SSH_RSA_PUBKEY_TOO_SHORT = 17; ///< The ssh RSA public key is too short.
82 constant int ERR_USERNAME_INVALID = 18; ///< The user name contains one or more invalid character(s).
83 constant int ERR_NEW_USER_ALREADY_EXISTS = 19; ///< A user with the new (renamed) user name already exists
84
85 /**
86 * Get a list of account names available on the system.
87 *
88 * @return List of account names
89 */
90 vector<string> getAccountNames();
91
92 /**
93 * Create a new account.
94 *
95 * @param username New user name
96 * @param password New password
97 *
98 * @return 0 if OK
99 * @return 1 if a user with the given name already exists
100 * @return 2 if the maximum number of users is reached
101 * @return 3 SNMPv3 USM is activated for the user and the
102 * password shall be used as auth passphrase. For this
103 * case, the password is too short (must be at least 8
104 * characters).
105 * @return 5 The password must not be empty.
106 * @return 6 The password is too short.
107 * @return 7 The password is too long.
108 * @return 8 The password must not contain control characters.
109 * @return 9 The password has to contain at least one lower case
110 * character.
111 * @return 10 The password has to contain at least one upper case
112 * character.
113 * @return 11 The password has to contain at least one numeric
114 * character.
115 * @return 12 The password has to contain at least one printable
116 * special character.
117 * @return 18 if the user name is invalid.
118 */
119 int createAccount(in string username, in string password);
120
121 /**
122 * Rename an account.
123 *
124 * @param username Current name of user
125 * @param newUsername New name of the user
126 *
127 * @return 0 if OK
128 * @return 1 if a user with the given name does not exist
129 * @return 19 if a user with the new name already exists
130 */
131 int renameAccount(in string username, in string newUsername);
132
133 /**
134 * Deletes an account.
135 *
136 * @param username Name of user to delete
137 *
138 * @return 0 if OK
139 * @return 1 if a user with the given name does not exist
140 * @return 2 if the user cannot be deleted
141 */
142 int deleteAccount(in string username);
143
144 /**
145 * Get information about all available user accounts.
146 *
147 * @return List of accounts
148 */
149 vector<Account> getAllAccounts();
150
151 /**
152 * Create a new account with defined settings.
153 *
154 * @param username New user name
155 * @param password New password
156 * @param info New user information
157 *
158 * @return 0 if OK
159 * @return 1 if a user with the given name already exists
160 * @return 2 if the maximum number of users is reached
161 * @return 3 SNMPv3 USM is activated for the user and the
162 * password shall be used as auth passphrase. For this
163 * case, the password is too short (must be at least 8
164 * characters).
165 * @return 4 if any value in the user info is invalid.
166 * @return 5 The password must not be empty.
167 * @return 6 The password is too short.
168 * @return 7 The password is too long.
169 * @return 8 The password must not contain control characters.
170 * @return 9 The password has to contain at least one lower case
171 * character.
172 * @return 10 The password has to contain at least one upper case
173 * character.
174 * @return 11 The password has to contain at least one numeric
175 * character.
176 * @return 12 The password has to contain at least one printable
177 * special character.
178 * @return 14 The ssh public key data is too large.
179 * @return 15 The ssh public key is invalid.
180 * @return 16 The ssh public key is not supported.
181 * @return 17 The ssh RSA public key is too short.
182 * @return 18 if the user name is invalid.
183 */
184 int createAccountFull(in string username, in string password, in UserInfo info);
185
186 /**
187 * Get a list of accounts that have a given role.
188 *
189 * @param roleName Role name
190 *
191 * @return List of accounts
192 */
193 vector<Account> getAccountsByRole(in string roleName);
194
195 /**
196 * Get default user preferences.
197 *
198 * @return Default user preferences.
199 */
200 Preferences getDefaultPreferences();
201
202 /**
203 * Set default user preferences.
204 *
205 * @param prefs Default user preferences.
206 *
207 * @return 0 if OK
208 */
209 int setDefaultPreferences(in Preferences prefs);
210 };
211
212}
usermgmt::UserManager
User manager interface
Definition UserManager.idl:61
usermgmt::UserManager::createAccount
int createAccount(in string username, in string password)
Create a new account.
usermgmt::UserManager::getAccountsByRole
vector< Account > getAccountsByRole(in string roleName)
Get a list of accounts that have a given role.
usermgmt::UserManager::getAllAccounts
vector< Account > getAllAccounts()
Get information about all available user accounts.
usermgmt::UserManager::setDefaultPreferences
int setDefaultPreferences(in Preferences prefs)
Set default user preferences.
usermgmt::UserManager::renameAccount
int renameAccount(in string username, in string newUsername)
Rename an account.
usermgmt::UserManager::createAccountFull
int createAccountFull(in string username, in string password, in UserInfo info)
Create a new account with defined settings.
usermgmt::UserManager::getAccountNames
vector< string > getAccountNames()
Get a list of account names available on the system.
usermgmt::UserManager::getDefaultPreferences
Preferences getDefaultPreferences()
Get default user preferences.
usermgmt::UserManager::deleteAccount
int deleteAccount(in string username)
Deletes an account.
usermgmt
User Management
Definition Role.idl:12
usermgmt::AccountAdded
This event is emitted after a new account with the provided username was added.
Definition UserManager.idl:32
usermgmt::AccountChanged
This event is emitted if the settings of an account as defined in usermgmt::UserInfo have changed.
Definition UserManager.idl:57
usermgmt::AccountEvent
Base type of all account event.
Definition UserManager.idl:24
usermgmt::AccountEvent::username
string username
name of user which was affected
Definition UserManager.idl:25
usermgmt::AccountRemoved
This event is emitted after the account with the provided username has been removed.
Definition UserManager.idl:45
usermgmt::AccountRenamed
This event is emitted after an account has been renamed.
Definition UserManager.idl:37
usermgmt::AccountRenamed::newUsername
string newUsername
new user name
Definition UserManager.idl:38
usermgmt::Account
Account information
Definition UserManager.idl:15
usermgmt::Account::name
string name
Account name
Definition UserManager.idl:16
usermgmt::Account::info
UserInfo info
User information
Definition UserManager.idl:17
usermgmt::PasswordChanged
This event is emitted after the password for an account was changed.
Definition UserManager.idl:51
usermgmt::Preferences
User preferences
Definition User.idl:80
usermgmt::UserInfo
User information
Definition User.idl:87