class
ScriptLiveDeviceUserManagement.
ScriptLiveDeviceUserManagement
Bases: object
This object represents the live user management on a given device.
3.5.16.0
online_device
Gets the online device this user management is using.
ScriptOnlineDevice
users
Gets the users on the device.
groups
Gets the groups on the device.
upload
Uploads the user and group information from the device.
backup
directory
password
Backups the user management from the device.
Don't change the name of the backup file because the device uses a fixed file name. Use different directories to store different backups.
directory (str) -- Directory where the backup file shall be stored.
password (str) -- Password which should be used to protected the backup file.
str
Full path of the backup file.
restore
path
password
Restores the user management to the device.
After the restore of the user management it is possible to get an authentication exception during the next operation on the online device because the current login session is no longer valid. In this case you catch the exception, reconnect the online device and repeat the operation.
For example:
online_device = online.create_online_device(device_obj)
user_mgmt = online_device.create_live_user_management()
user_mgmt.restore(file, password)
try:
user_mgmt.upload()
except:
online_device.disconnect()
online_device.connect()
user_mgmt.upload()
path (str) -- Path of the backup file.
password (str) -- Password which was used to protect the backup file.
add_user
name
password
can_change_password=True
must_change_password=False
Adds a new user with the specified name.
name (str) -- The name of the new user.
password (str) -- Password for the new user.
can_change_password (bool) -- User can change their password.
must_change_password (bool) -- User must change their password with next login.
remove_user
name
Removes the user with the specified name.
name (str) -- The name of the existing user.
set_user_password
name
password
Sets the password for this user.
name (str) -- The name of the user.
password (str) -- The password to set.
set_user_flags
name
flags
Sets flags for the user.
name (str) -- The name of the user.
flags (DeviceUserManagementFlags) -- The flags to set.
add_group
name
group_members
user_members
Adds a new group with the specified name.
name (str) -- The name of the new group.
group_members ([]) -- The group members of the new group.
user_members ([]) -- The user members of the new group.
remove_group
name
Removes the group with the specified name.
name (str) -- The name of the existing group.
set_members_of_group
name
group_members
user_members
Sets the members of groups and users which shall be in the group.
name (str) -- The name of the group.
group_members ([]) -- Group names which should be member for the group.
user_members ([]) -- User names which should be member for the group.
class
ScriptLiveDeviceUserManagement.
ScriptLiveDeviceGroupList
class
ScriptLiveDeviceUserManagement.
ScriptLiveDeviceUserList
class
ScriptLiveDeviceUserManagement.
ScriptLiveDeviceGroup
Bases: object
A group of users, which have common rights on the device.
3.5.16.0
flags
Gets flags concerning this particular group.
DeviceUserManagementFlags
name
Gets the name of the group.
str
user_members
Gets the user names which are member of this group.
[]
group_members
Gets the group names which are member of this group.
[]
check_cyclic_membership
new_group_member
Checks whether adding the specified group member would cause a cyclic membership dependency.
new_group_member (str) -- The name of the new group membership to check.
bool
True if adding the specified group member would cause a cycle, False otherwise.