Virtualizor provides the Access Control List feature using which root user of the virtualizor can control the actions of other virtualizor admins. Using this API you can create a role which consists list of rules/actions relating to the features of Virtualizor like creation of vps, deletion of vps, creation of plans etc. This role can be assigned to any admin user of the Virtualizor except root. The API response will contain "done" as "true" on successful creation of ACL.
For more information, you can refer this Administrator ACL guide.
HTTP Request
https://hostname:4085/index.php?act=add_admin_acl
Parameters
Name | Method | Value | Description | Required |
---|---|---|---|---|
act | GET | add_admin_acl | The action specified to perform specific operation and will return "done" as "true" on successful creation of the ACL | Yes |
add_admin_acl | POST | 1 | Flag to Add ACL | Yes |
name | POST | text | Name of the Plan | Yes |
act_add_admin_acl | POST | 1/0 | Add Admin ACL | No |
act_addbackupserver | POST | 1/0 | Add Backup Server | No |
act_addbackup_plan | POST | 1/0 | Add Backup Plan | No |
act_adddnsplan | POST | 1/0 | Add DNS Plan | No |
act_addippool | POST | 1/0 | Add Ip Pool | No |
act_addips | POST | 1/0 | Add IPs | No |
act_addiso | POST | 1/0 | Add ISOs | No |
act_addmg | POST | 1/0 | Add Media Groups | No |
act_addpdns | POST | 1/0 | Add PDNS | No |
act_addplan | POST | 1/0 | Add Plans | No |
act_addrecipe | POST | 1/0 | Add Recipe | No |
act_addserver | POST | 1/0 | Add Slave Server | No |
act_addsg | POST | 1/0 | Add Server Groups | No |
act_addtemplate | POST | 1/0 | Add Templates | No |
act_adduser | POST | 1/0 | Add Users | No |
act_adminacl | POST | 1/0 | View Admin ACLs | No |
act_addvs | POST | 1/0 | Add VPS | No |
act_add_distro | POST | 1/0 | Add Distro | No |
act_backupservers | POST | 1/0 | View Backup Servers | No |
act_backup_plans | POST | 1/0 | View Backup Plans | No |
act_changehostname | POST | 1/0 | Edit Hostname | No |
act_cluster_resources | POST | 1/0 | View Cluster Resources | No |
act_cluster_statistics | POST | 1/0 | View Cluster Statistics | No |
act_config | POST | 1/0 | Edit General Settings | No |
act_createssl | POST | 1/0 | Create SSL | No |
act_createtemplate | POST | 1/0 | Create Template | No |
act_databackup | POST | 1/0 | View DB Backups | No |
act_defaultvsconf | POST | 1/0 | Default VPS Config | No |
act_delete_admin_acl | POST | 1/0 | Delete Admin ACL | No |
act_deletebackupserver | POST | 1/0 | Delete Backup Server | No |
act_deletebackup_plan | POST | 1/0 | Delete Backup Plan | No |
act_deletedatabackup | POST | 1/0 | Delete Data Backup | No |
act_deletednsplan | POST | 1/0 | Delete DNS Plan | No |
act_deleteippool | POST | 1/0 | Delete IP Pool | No |
act_deleteips | POST | 1/0 | Delete IPs | No |
act_deleteiso | POST | 1/0 | Delete ISO | No |
act_deleteloginlogs | POST | 1/0 | Delete Login Logs | No |
act_deletelogs | POST | 1/0 | No | |
act_deletemg | POST | 1/0 | Delete Media Group | No |
act_deleteorphaneddisk | POST | 1/0 | Delete Orphan Disk | No |
act_deletepdns | POST | 1/0 | Delete PDNS | No |
act_deleteplan | POST | 1/0 | Delete Plans | No |
act_deleteserver | POST | 1/0 | Delete Server | No |
act_deletesg | POST | 1/0 | Delete Server Group | No |
act_deletetemplate | POST | 1/0 | Delete Template | No |
act_deleteuser | POST | 1/0 | Delete User | No |
act_deleteuserlogs | POST | 1/0 | Delete User Log | No |
act_deletevpsbackup | POST | 1/0 | Delete VPS Backup | No |
act_deletevs | POST | 1/0 | Delete VPS | No |
act_deliplogs | POST | 1/0 | Delete IP logs | No |
act_dldatabackup | POST | 1/0 | Download DB Backups | No |
act_dnsplans | POST | 1/0 | View DNS Plans | No |
act_edit_admin_acl | POST | 1/0 | Edit Admin ACL | No |
act_editbackupservsers | POST | 1/0 | Edit Backup Server | No |
act_editbackup_plan | POST | 1/0 | Edit Backup Plan | No |
act_editdnsplan | POST | 1/0 | Edit DNS Plan | No |
act_editemailtemps | POST | 1/0 | Edit Email Templates | No |
act_editippool | POST | 1/0 | Edit IP Pool | No |
act_editips | POST | 1/0 | Edit IPs | No |
act_editiso | POST | 1/0 | Edit ISO | No |
act_editmg | POST | 1/0 | Edit Media Group | No |
act_editpdns | POST | 1/0 | Edit PDNS | No |
act_editplan | POST | 1/0 | Edit Plan | No |
act_editrecipe | POST | 1/0 | No | |
act_editserver | POST | 1/0 | Edit Server | No |
act_editsg | POST | 1/0 | Edit Server Group | No |
act_editssl | POST | 1/0 | Edit SSL | No |
act_edittemplate | POST | 1/0 | Edit Template | No |
act_edituser | POST | 1/0 | Edit User | No |
act_editvs | POST | 1/0 | Edit VPS | No |
act_emailsettings | POST | 1/0 | Edit Email Settings | No |
act_emailtemps | POST | 1/0 | View email templates | No |
act_euiso | POST | 1/0 | Enduser ISO | No |
act_filemanager | POST | 1/0 | Access File Manager | No |
act_firewall | POST | 1/0 | Manage Firewall | No |
act_haproxy | POST | 1/0 | View Domain Forwarding | No |
act_hostname | POST | 1/0 | View Hostname | No |
act_importvs | POST | 1/0 | Import VS | No |
act_iplogs | POST | 1/0 | View IP logs | No |
act_ippool | POST | 1/0 | View IP Pools | No |
act_ips | POST | 1/0 | View IPs | No |
act_iptables | POST | 1/0 | Restart IP Tables | No |
act_iso | POST | 1/0 | View ISO List | No |
act_kernconfig | POST | 1/0 | Edit Kernel Config | No |
act_licenseinfo | POST | 1/0 | View License Info | No |
act_list_distros | POST | 1/0 | View Distro List | No |
act_loginlogs | POST | 1/0 | View Login Logs | No |
act_logs | POST | 1/0 | View Logs | No |
act_maintenance | POST | 1/0 | Maintenance Mode | No |
act_managepdns | POST | 1/0 | Manage DNS Servers | No |
act_mg | POST | 1/0 | View Media Groups | No |
act_migrate | POST | 1/0 | Migrate Virtual Server | No |
act_mysqld | POST | 1/0 | Restart MySQL | No |
act_network | POST | 1/0 | Restart network service | No |
act_orphaneddisk | POST | 1/0 | List Orphaned Disks | No |
act_os | POST | 1/0 | View Template Browser | No |
act_ostemplates | POST | 1/0 | View Templates | No |
act_pdns | POST | 1/0 | View DNS Servers | No |
act_performdatabackup | POST | 1/0 | Perform DB Backups | No |
act_phpmyadmin | POST | 1/0 | Access PhpMyAdmin | No |
act_plans | POST | 1/0 | View Plans | No |
act_poweroffvs | POST | 1/0 | Poweroff VPS | No |
act_procs | POST | 1/0 | Manage processes | No |
act_rdns | POST | 1/0 | Add Reverse DNS Zones | No |
act_rebootserver | POST | 1/0 | Reboot Server | No |
act_rebuildvs | POST | 1/0 | Rebuild Virtual Server | No |
act_recipes | POST | 1/0 | View Recipes | No |
act_restartvs | POST | 1/0 | Restart VPS | No |
act_restorevpsbackup | POST | 1/0 | Restore VPS Backups | No |
act_sendmail | POST | 1/0 | Restart mail server | No |
act_server_statistics | POST | 1/0 | View Server Statistics | No |
act_serverinfo | POST | 1/0 | View Server Info | No |
act_servers | POST | 1/0 | View Servers | No |
act_services | POST | 1/0 | Manage services | No |
act_sg | POST | 1/0 | View Server Groups | No |
act_ssh | POST | 1/0 | Access SSH | No |
act_ssl | POST | 1/0 | Access SSL | No |
act_startvs | POST | 1/0 | Start VPS | No |
act_statistics | POST | 1/0 | View Statistics | No |
act_stopvs | POST | 1/0 | Stop VPS | No |
act_suspendvs | POST | 1/0 | Suspend Virtual Server | No |
act_suspend_user | POST | 1/0 | Suspend User | No |
act_twofactauth | POST | 1/0 | Two Factor Authentication | No |
act_unsuspendvs | POST | 1/0 | Unsuspend Virtual Server | No |
act_unsuspend_user | POST | 1/0 | Unsuspend User | No |
act_updates | POST | 1/0 | Perform Updates | No |
act_userlogs | POST | 1/0 | View User logs | No |
act_users | POST | 1/0 | View Users | No |
act_vnc | POST | 1/0 | Virtual Server VNC | No |
act_vpsbackups | POST | 1/0 | View VPS Backups | No |
act_vpsbackupsettings | POST | 1/0 | Edit VPS Backup Settings | No |
act_vs | POST | 1/0 | List Virtual Servers | No |
act_vsresources | POST | 1/0 | View VPS Resources | No |
act_webserver | POST | 1/0 | Restart webserver | No |
Sample Code
<?php
require_once('/usr/local/virtualizor/sdk/admin.php');
$key = 'your_api_key';
$pass = 'your_api_pass';
$ip = 'your_server_ip';
$admin = new Virtualizor_Admin_API($ip, $key, $pass);
$post = array();
$post['add_admin_acl'] = 1;
$post['name'] = 'test_api';
$post['act_add_admin_acl'] = 0;
$post['act_addbackupserver'] = 0;
$post['act_adddnsplan'] = 0;
$output = $admin->add_admin_acl($post);
print_r(json_encode($output));
?>
Output
{
"title": "Add Administrator ACL",
"done": true,
"timenow": 1535997030,
"time_taken": "0.132"
}