Get Virtualizor

Add Administrator ACL

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

NameMethodValueDescriptionRequired
actGETadd_admin_aclThe action specified to perform specific operation and will return "done" as "true" on successful creation of the ACLYes
add_admin_aclPOST1Flag to Add ACLYes
namePOSTtextName of the PlanYes
act_add_admin_aclPOST1/0Add Admin ACLNo
act_addbackupserverPOST1/0Add Backup ServerNo
act_addbackup_planPOST1/0Add Backup PlanNo
act_adddnsplanPOST1/0Add DNS PlanNo
act_addippoolPOST1/0Add Ip PoolNo
act_addipsPOST1/0Add IPsNo
act_addisoPOST1/0Add ISOsNo
act_addmgPOST1/0Add Media GroupsNo
act_addpdnsPOST1/0Add PDNSNo
act_addplanPOST1/0Add PlansNo
act_addrecipePOST1/0Add RecipeNo
act_addserverPOST1/0Add Slave ServerNo
act_addsgPOST1/0Add Server GroupsNo
act_addtemplatePOST1/0Add TemplatesNo
act_adduserPOST1/0Add UsersNo
act_adminaclPOST1/0View Admin ACLsNo
act_addvsPOST1/0Add VPSNo
act_add_distroPOST1/0Add DistroNo
act_backupserversPOST1/0View Backup ServersNo
act_backup_plansPOST1/0View Backup PlansNo
act_changehostnamePOST1/0Edit HostnameNo
act_cluster_resourcesPOST1/0View Cluster ResourcesNo
act_cluster_statisticsPOST1/0View Cluster StatisticsNo
act_configPOST1/0Edit General SettingsNo
act_createsslPOST1/0Create SSLNo
act_createtemplatePOST1/0Create TemplateNo
act_databackupPOST1/0View DB BackupsNo
act_defaultvsconfPOST1/0Default VPS ConfigNo
act_delete_admin_aclPOST1/0Delete Admin ACLNo
act_deletebackupserverPOST1/0Delete Backup ServerNo
act_deletebackup_planPOST1/0Delete Backup PlanNo
act_deletedatabackupPOST1/0Delete Data BackupNo
act_deletednsplanPOST1/0Delete DNS PlanNo
act_deleteippoolPOST1/0Delete IP PoolNo
act_deleteipsPOST1/0Delete IPsNo
act_deleteisoPOST1/0Delete ISONo
act_deleteloginlogsPOST1/0Delete Login LogsNo
act_deletelogsPOST1/0No
act_deletemgPOST1/0Delete Media GroupNo
act_deleteorphaneddiskPOST1/0Delete Orphan DiskNo
act_deletepdnsPOST1/0Delete PDNSNo
act_deleteplanPOST1/0Delete PlansNo
act_deleteserverPOST1/0Delete ServerNo
act_deletesgPOST1/0Delete Server GroupNo
act_deletetemplatePOST1/0Delete TemplateNo
act_deleteuserPOST1/0Delete UserNo
act_deleteuserlogsPOST1/0Delete User LogNo
act_deletevpsbackupPOST1/0Delete VPS BackupNo
act_deletevsPOST1/0Delete VPSNo
act_deliplogsPOST1/0Delete IP logsNo
act_dldatabackupPOST1/0Download DB BackupsNo
act_dnsplansPOST1/0View DNS PlansNo
act_edit_admin_aclPOST1/0Edit Admin ACLNo
act_editbackupservsersPOST1/0Edit Backup ServerNo
act_editbackup_planPOST1/0Edit Backup PlanNo
act_editdnsplanPOST1/0Edit DNS PlanNo
act_editemailtempsPOST1/0Edit Email TemplatesNo
act_editippoolPOST1/0Edit IP PoolNo
act_editipsPOST1/0Edit IPsNo
act_editisoPOST1/0Edit ISONo
act_editmgPOST1/0Edit Media GroupNo
act_editpdnsPOST1/0Edit PDNSNo
act_editplanPOST1/0Edit PlanNo
act_editrecipePOST1/0No
act_editserverPOST1/0Edit ServerNo
act_editsgPOST1/0Edit Server GroupNo
act_editsslPOST1/0Edit SSLNo
act_edittemplatePOST1/0Edit TemplateNo
act_edituserPOST1/0Edit UserNo
act_editvsPOST1/0Edit VPSNo
act_emailsettingsPOST1/0Edit Email SettingsNo
act_emailtempsPOST1/0View email templatesNo
act_euisoPOST1/0Enduser ISONo
act_filemanagerPOST1/0Access File ManagerNo
act_firewallPOST1/0Manage FirewallNo
act_haproxyPOST1/0View Domain ForwardingNo
act_hostnamePOST1/0View HostnameNo
act_importvsPOST1/0Import VSNo
act_iplogsPOST1/0View IP logsNo
act_ippoolPOST1/0View IP PoolsNo
act_ipsPOST1/0View IPsNo
act_iptablesPOST1/0Restart IP TablesNo
act_isoPOST1/0View ISO ListNo
act_kernconfigPOST1/0Edit Kernel ConfigNo
act_licenseinfoPOST1/0View License InfoNo
act_list_distrosPOST1/0View Distro ListNo
act_loginlogsPOST1/0View Login LogsNo
act_logsPOST1/0View LogsNo
act_maintenancePOST1/0Maintenance ModeNo
act_managepdnsPOST1/0Manage DNS ServersNo
act_mgPOST1/0View Media GroupsNo
act_migratePOST1/0Migrate Virtual ServerNo
act_mysqldPOST1/0Restart MySQLNo
act_networkPOST1/0Restart network serviceNo
act_orphaneddiskPOST1/0List Orphaned DisksNo
act_osPOST1/0View Template BrowserNo
act_ostemplatesPOST1/0View TemplatesNo
act_pdnsPOST1/0View DNS ServersNo
act_performdatabackupPOST1/0Perform DB BackupsNo
act_phpmyadminPOST1/0Access PhpMyAdminNo
act_plansPOST1/0View PlansNo
act_poweroffvsPOST1/0Poweroff VPSNo
act_procsPOST1/0Manage processesNo
act_rdnsPOST1/0Add Reverse DNS ZonesNo
act_rebootserverPOST1/0Reboot ServerNo
act_rebuildvsPOST1/0Rebuild Virtual ServerNo
act_recipesPOST1/0View RecipesNo
act_restartvsPOST1/0Restart VPSNo
act_restorevpsbackupPOST1/0Restore VPS BackupsNo
act_sendmailPOST1/0Restart mail serverNo
act_server_statisticsPOST1/0View Server StatisticsNo
act_serverinfoPOST1/0View Server InfoNo
act_serversPOST1/0View ServersNo
act_servicesPOST1/0Manage servicesNo
act_sgPOST1/0View Server GroupsNo
act_sshPOST1/0Access SSHNo
act_sslPOST1/0Access SSLNo
act_startvsPOST1/0Start VPSNo
act_statisticsPOST1/0View StatisticsNo
act_stopvsPOST1/0Stop VPSNo
act_suspendvsPOST1/0Suspend Virtual ServerNo
act_suspend_userPOST1/0Suspend UserNo
act_twofactauthPOST1/0Two Factor AuthenticationNo
act_unsuspendvsPOST1/0Unsuspend Virtual ServerNo
act_unsuspend_userPOST1/0Unsuspend UserNo
act_updatesPOST1/0Perform UpdatesNo
act_userlogsPOST1/0View User logsNo
act_usersPOST1/0View UsersNo
act_vncPOST1/0Virtual Server VNCNo
act_vpsbackupsPOST1/0View VPS BackupsNo
act_vpsbackupsettingsPOST1/0Edit VPS Backup SettingsNo
act_vsPOST1/0List Virtual ServersNo
act_vsresourcesPOST1/0View VPS ResourcesNo
act_webserverPOST1/0Restart webserverNo

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"
}
    Was this page helpful?
    Newsletter Subscription
    Subscribing you to the mailing list