API Set Server Config

From Virtualizor Wiki
Jump to: navigation, search

Set Server Configuration

Parameters Description
sn Site Name. The name of the server or company using Virtualizor.
logo_url Logo URL. If empty the Virtualizor logo will be shown
support Support URL. Specify the support URL which will be displayed in the Enduser Panel.
copyright Copyright. The Copyright that appears in the footer
cookie_name Cookie Name. The name of the cookie that will be stored on browsers.
soft_email Email Address. The email address for the FROM headers.
gzip Compress Output. This will compress output and it saves a lot of bandwidth. Accepted value are 1 or 0
sess_len Session Timeout. Seconds before an unused session timesout
language Enter your preferred language
theme_folder The selected theme will be the default theme throughout Virtualizor
timezone Timezone
interface Network Interface.The public network interface of the server.
cpu_nm The IP Pool id
overcommit Enable Overcommit
node_bandwidth Node Bandwidth.The total bandwidth of the Node in GB. If set to Zero, the bandwidth calculation will assume unlimited bandwidth
vnc_ip Set VNC IP. Use this option only when Virtualizor is installed on an Internal Network
ping_ip Set Ping IP. When the Virtualizor Bridge Network is started it will try to ping to this IP to check if the server has connectivity. If empty, then Virtualizor will ping 4.2.2.1
disable_icons_monitor Disable Monitoring. Disable the Monitor icon for the endusers
login_attempts Max Login Attempts. The number of attempts allowed before banning the IP for a period of time specified in the Failed Login Ban Time
login_ban_time Failed Login Ban Time. The time in minutes to ban the IP of the user who has crossed the Max Login Attempts
change_ssh_port Change SSH port. Set the SSH port for your Server. Its recommeded to change this for better security.
max_ssh_login Maximum SSH Login. Set the maximum SSH login attempts
vpslimit VPS Creation Limit. This config is to restrict the number of VPS that will be created on this server. Set 0 for no restriction.
addvs_cpu_prio CPU priorities. Enter values between -20 to 19
addvs_io_prio I/O priorities. Enter values between 0 to 7
addvs_io_class I/O class
update Auto Update Virtualizor. If enabled Virtualizor will automatically update itself to the latest version.
email_update Notify Updates. Will send emails when Virtualizor upgrades are available or Auto Upgrade is performed
cron_time Cron Job Frequency. The cron job that will collect all information of VPS(s) and also check for updates.
admin_logs Admin Logs Duration. Admin logs older than the specified days will be deleted. (Enter 0 for no limit)
vps_logs VPS Logs Duration. VPS logs older than the specified days will be deleted. (Enter 0 for no limit)
login_logs Login Logs Duration. Login logs older than the specified days will be deleted. (Enter 0 for no limit)
system_logs VPS System Logs Duration. Logs older than the specified days will be deleted. (Enter 0 for no limit)
status_logs VPS Status Logs Duration. Logs older than the specified days will be deleted. (Enter 0 for no limit)
bandwidth_logs Bandwidth Logs Duration. Logs older than the specified days will be deleted. (Enter 0 for no limit)
alert_load_limit Alert on High Load. If the 15 minute load of the hardware node exceeds the limit set here, an email will be sent to the Administrator.
alert_disk_limit Disk Alert Limit. If the Disk Usage of the Node exceeds the set limit (in %), an email will be sent to the Administrator.
dbbackup_email Send backup to Email. A backup of the Database SQL file will be sent to the Admin via email

Example Code

<?php

    require_once('admin.php');

    $key =  'uketenhrhpunty5lhgwkcuxxxxxxxxxx';

    $pass = 'yrsofc3tg3tre7bjpfppspxxxxxxxxxx';

    $ip = 'xxx.xxx.xxx.xxx';

    $admin = new Virtualizor_Admin_API($ip, $key, $pass);

    $post = array();
    $post['sn']='Virtualizor';
    $post['logo_url']='';
    $post['support']='rahul@softaulocus.com';
    $post['copyright']='';
    $post['cookie_name']='SIMCookies1493';
    $post['soft_email']='rahul@softaulocus.com';
    $post['gzip']='1';
    $post['sess_len']='3600';
    $post['language']='english';
    $post['theme_folder']='default';
    $post['timezone']='0';
    $post['interface']='';
    $post['cpu_nm']='1';
    $post['overcommit']='0';
    $post['node_bandwidth']='0';
    $post['vnc_ip']='';
    $post['ping_ip']='4.2.2.2';
    $post['disable_icons_monitor']='1';
    $post['login_attempts']='5';
    $post['login_ban_time']='15';
    $post['change_ssh_port']='399';
    $post['max_ssh_login']='10';
    $post['vpslimit']='';
    $post['addvs_cpu_prio']='';
    $post['addvs_io_prio']='';
    $post['addvs_io_class']='';
    $post['update']='1';
    $post['email_update']='1';
    $post['cron_time']='51 8 * * *';
    $post['admin_logs']='2';
    $post['vps_logs']='2';
    $post['login_logs']='2';
    $post['system_logs']='7';
    $post['status_logs']='7';
    $post['bandwidth_logs']='0';
    $post['alert_load_limit']='0';
    $post['alert_disk_limit']='10';
    $post['dbbackup_email']='1';
    $ret = $admin->config($post);
    $admin->r($ret);

    $output = $admin->config($post);
    print_r($output);
?>

Returns:

1