Net::Proxmox::VE::Access - Functions for the 'access' portion of the API
# assuming $obj is a Net::Proxmox::VE object my @dir_index = $obj->access(); my @domain_index = $obj->access_domains(); my $domain = $obj->access_domains($realm);
Without arguments, returns the 'Directory index':
Note: Accessible by all authententicated users.
Gets a list of access domains (aka the Authentication domain index)
@pools = $obj->access_domains();
Note: Anyone can access that, because we need that list for the login box (before the user is authenticated).
FIXME: currently this isn't implemented in this library.
Creates a new access domain
$ok = $obj->create_access_domains( %args ); $ok = $obj->create_access_domains( \%args );
%args may items contain from the following list
String. The id of the authentication domain you wish to add, in pve-realm format. This is required.
Enum. This is the server type and is either 'ad' or 'ldap'. This is required.
String. LDAP base domain name. Optional.
String. This is a comment associated with the new domain, this is optional.
Boolean. Use this domain as the default. Optional.
String. AD domain name. Optional.
Integer. Server port, user '0' if you want to use the default setting. Optional.
Boolean. Use secure LDAPS protocol. Optional.
String. LDAP user attribute name. Optional.
Gets a single access domain
$ok = $obj->get_access_domains('realm')
realm is a string in pve-realm format
Updates (sets) a access domain's data
$ok = $obj->update_access_domains( 'realm', %args ); $ok = $obj->update_access_domains( 'realm', \%args );
String. This is a comment associated with the domain, this is optional.
Deletes a single access domain
$ok = $obj->delete_access_domains('realm')
Gets a list of access groups (aka the Group index)
@pools = $obj->access_groups();
Note: The returned list is restricted to groups where you have 'User.Modify', 'Sys.Audit' or 'Group.Allocate' permissions on /access/groups/<<group>>.
Creates a new access group
$ok = $obj->create_access_groups( %args ); $ok = $obj->create_access_groups( \%args );
String. The id of the access group you wish to add, in pve-groupid format. This is required.
String. This is a comment associated with the new group, this is optional.
Gets a single access group
$ok = $obj->get_access_groups('groupid')
groupid is a string in pve-groupid format
Updates (sets) a access group's data
$ok = $obj->update_access_groups( 'groupid', %args ); $ok = $obj->update_access_groups( 'groupid', \%args );
String. This is a comment associated with the group, this is optional.
Deletes a single access group
$ok = $obj->delete_access_groups('groupid')
Gets a list of access roles (aka the Role index)
@pools = $obj->access_roles();
Creates a new access role
$ok = $obj->create_access_roles( %args ); $ok = $obj->create_access_roles( \%args );
String. The id of the access role you wish to add, in pve-roleid format. This is required.
String. A string in pve-string-list format. Optional.
Gets a single access role
$ok = $obj->get_access_roles('roleid')
roleid is a string in pve-roleid format
Updates (sets) a access role's data
$ok = $obj->update_access_roles( 'roleid', %args ); $ok = $obj->update_access_roles( 'roleid', \%args );
String. A string in pve-priv-list format, this is required.
Booelean. Append privileges to existing. Optional.
Deletes a single access role
$ok = $obj->delete_access_roles('roleid')
Gets a list of users (aka the User index)
@pools = $obj->access_users();
Note: You need 'Realm.AllocateUser' on '/access/realm/<<realm>>' on the realm of user <<userid>>, and 'User.Modify' permissions to '/access/groups/<<group>>' for any group specified (or 'User.Modify' on '/access/groups' if you pass no groups.
Creates a new user
$ok = $obj->create_access_users( %args ); $ok = $obj->create_access_users( \%args );
String. The id of the user you wish to add, in pve-userid format. This is required.
String. This is a comment associated with the new user, this is optional.
String. The users email address in email-opt format. Optional.
Boolean. If the user is enabled where the default is to be enabled. Disable with a 0 value. Optional.
Integer. Account expiration date in seconds since epoch. 0 means never expire. Optional.
String. Optional.
String. A string in pve-groupid-list format. Optional.
String. The users initial passowrd. Optional.
Gets a single user
$ok = $obj->get_access_users('userid')
userid is a string in pve-userid format
Updates (sets) a user's configuration
$ok = $obj->update_access_users( 'userid', %args ); $ok = $obj->update_access_users( 'userid', \%args );
Boolean. Optional.
String. This is a comment associated with the user, this is optional.
Deletes a single user
$ok = $obj->delete_access_users('userid')
Verifies if the objects login ticket is valid and not expired
Returns true if valid Returns false and clears the the login ticket details inside the object if invalid
Clears the login ticket inside the object
The returned list is restricted to objects where you have rights to modify permissions
$pool = $obj->get_access_acl();
Note: The returned list is restricted to objects where you have rights to modify permissions.
Initiates the log in to the PVE Server using JSON API, and potentially obtains an Access Ticket.
Returns true if success
Updates (sets) an acl's data
$ok = $obj->update_access_acl( %args ); $ok = $obj->update_access_acl( \%args );
String. Access control path. Required.
String. List of roles. Required.
Boolean. Removes the access rather than adding it. Optional.
String. List of groups. Optional.
Boolean. Allow to propagate (inherit) permissions. Optional.
String. List of users. Optional.
Updates a users password
$ok = $obj->update_password( %args ); $ok = $obj->update_password( \%args );
Each user is allowed to change his own password. See proxmox api document for which permissions are needed to change the passwords of other people.
String. The new password. Required.
String. User ID. Required.
Note: Each user is allowed to change his own password. A user can change the password of another user if he has 'Realm.AllocateUser' (on the realm of user <<userid>>) and 'User.Modify' permission on /access/groups/<<group>> on a group where user <<userid>> is member of.
L<Net::Proxmox::VE>
VERSION 0.3
Brendan Beveridge L<<brendan@nodeintegration.com.au>> Dean Hamstead L<<dean@bytefoundry.com.au>>
To install Net::Proxmox::VE, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Net::Proxmox::VE
CPAN shell
perl -MCPAN -e shell install Net::Proxmox::VE
For more information on module installation, please visit the detailed CPAN module installation guide.