
This external documentation for pyVmomi was generated using Googly Docs (aka Google Standard Documentation) which renders very cleanly in GitHub. Internal documentation for a class should be done in Sphinx format because tools like pyCharm and Eclipse can use that documentation as a hint for code completion. Note: External docs as Googly Docs, internal docs as Sphinx. Closes bug#15
5.9 KiB
vim.host.LocalAccountManager
This managed object type provides an interface through which local accounts on a host are managed. Note that this managed object applies only to applications that use a local account database on the host to provide authentication (ESX Server, for example). POSIX and win32 hosts may impose different restrictions on the password, ID, and description formats. POSIX host implementation may restrict the user or group name to be lower case letters and less than 16 characters in total. It may also disallow characters such as ";", "n", and so on. In short, all the platform dependent rules and restrictions regarding naming of users/groups and password apply here. An InvalidArgument fault is thrown if any of these rules are not obeyed.
Attributes
Methods
- CreateUser(user):
-
Creates a local user account using the parameters defined in the HostLocalAccountManagerAccountSpecification data object type. For POSIX hosts, passing HostLocalAccountManagerPosixAccountSpecification data object type allows you to control the format of the user ID of the user account being created.
- Privilege:
-
Host.Local.ManageUserGroups
- Args:
-
- user (vim.host.LocalAccountManager.AccountSpecification):
-
Specification of user being created.
- Returns:
-
None
Raises:
- vim.fault.AlreadyExists:
-
if the specified local user account already exists.
- vmodl.fault.InvalidArgument:
-
if the user name or password has an invalid format.
- UpdateUser(user):
-
Updates a local user account using the parameters defined in the HostLocalAccountManagerAccountSpecification data object type.
- Privilege:
-
Host.Local.ManageUserGroups
- Args:
-
- user (vim.host.LocalAccountManager.AccountSpecification):
-
Specification of user being updated.
- Returns:
-
None
Raises:
- vim.fault.UserNotFound:
-
if user is not found.
- vim.fault.AlreadyExists:
-
if new account specification specifies an existing user's ID.
- vmodl.fault.InvalidArgument:
-
if new password or description has an invalid format.
- CreateGroup(group):
-
Creates a local group account using the parameters defined in the HostLocalAccountManagerAccountSpecification data object type. For POSIX hosts, passing the HostLocalAccountManagerPosixAccountSpecification data object type allows you to control the group ID format of the group account being created.
- Privilege:
-
Host.Local.ManageUserGroups
- Args:
-
- group (vim.host.LocalAccountManager.AccountSpecification):
-
Specification of group being created.
- Returns:
-
None
Raises:
- vim.fault.AlreadyExists:
-
if specified local group already exists.
- vmodl.fault.InvalidArgument:
-
if group name is in invalid format.
- RemoveUser(userName):
-
Removes a local user account.As of vSphere API 5.1, this operation will first try to remove all permissions associated with the specifed account. The permissions of the user are removed one by one, not atomically, and the operation is not rolled back, if the removal of some permission fails.
- Privilege:
-
Host.Local.ManageUserGroups
- Args:
-
- userName (str):
-
User ID of the user account being removed.
- Returns:
-
None
Raises:
- vim.fault.UserNotFound:
-
if the specified userName does not exist.
- vmodl.fault.SecurityError:
-
if trying to remove the last local user with DCUI access, or if trying to remove the last local user with full administrative privileges, or if the system has encountered an error while trying to remove user's permissions. or if the account cannot be removed due to permission issues.
- RemoveGroup(groupName):
-
Removes a local group account.
- Privilege:
-
Host.Local.ManageUserGroups
- Args:
-
- groupName (str):
-
Group ID of the group account being removed.
- Returns:
-
None
Raises:
- vim.fault.UserNotFound:
-
if the specified groupName does not exist.
- AssignUserToGroup(user, group):
-
Assigns a user to a group.
- Privilege:
-
Host.Local.ManageUserGroups
- Args:
- Returns:
-
None
Raises:
- vim.fault.UserNotFound:
-
if the specified user or group does not exist.
- vim.fault.AlreadyExists:
-
if the user is already a member of the target group.
- UnassignUserFromGroup(user, group):
-
Unassigns a user from a group.
- Privilege:
-
Host.Local.ManageUserGroups
- Args:
- Returns:
-
None
Raises:
- vim.fault.UserNotFound:
-
if the specified user or group does not exist.
- vim.fault.NoPermission:
-
if the group is the only group to which the user belongs.