PDA

View Full Version : HyperVM 2.1.0 dev(beta) php variables defining VPS parameters



Fli
04-17-2017, 09:36 AM
In the file /usr/local/lxlabs/hypervm/httpdocs/lib/vps/vpslib.php is:


class Vps extends vpsBase {// Core


static $__desc = array("", "", "virtual_machine");
static $__table = "vps";
// Mysql
static $__desc_nname = array("n", "", "VM_name", URL_SHOW);
static $__desc_contactemail = array("", "", "contact_email");
static $__desc_coma_vmipaddress_a = array("", "", "ipaddress");
static $__desc_parent_name_f = array("", "", "owner");
static $__desc_one_ipaddress_f = array("", "", "Ip_Address_(optional)");
static $__desc_num_ipaddress_f = array("", "", "number_of_ips(from_pool)");
static $__desc_num_ipv6address_f = array("", "", "number_of_ipv6s(from_v6pool)");
static $__desc_syncserver = array("", "", "Server");


/// Fake Variables
static $__desc_send_welcome_f = array("f","", "send_welcome_message");
static $__desc_use_resourceplan_f = array("f", "", "use_template");
static $__desc_resourceplan_f = array("s", "", "plan_name");
static $__desc_resourceplan_used_f = array("n","", "Plan");
static $__desc_information_f = array("b", "", "", 'a=updateform&sa=information');
static $__desc_ipaddress_f = array("b", "", "", 'a=list&c=vmipaddress_a');
static $__desc_portmon_f = array("b", "", "", 'a=list&c=monitorserver');
static $__desc_limit_f = array("b", "", "", 'a=updateform&sa=limit');
static $__desc_openvzostemplate_list = array("", "", "openvz_template_list");
static $__desc_xenostemplate_list = array("", "", "xen_template_list");


//static $__desc_kernelmem_usage = array("qh", "", "Kernel_Memory_(KB)");
static $__desc_hostname = array("", "", "hostname");
static $__desc_parent_clname = array("", "", "owner");
static $__desc_lmemoryusage_f = array("S", "", "mem");
static $__desc_ldiskusage_f = array("S", "", "disk");
static $__desc___v_priv_used_traffic_usage = array("S","", "traffic");
static $__desc_traffic_usage_per_f = array("pS", "", "traffic");
static $__desc_dipaddress_f = array("S", "", "ipaddress");
static $__desc_rebuild_backup_f = array("f", "", "take_a_backup_of_current_vps._will_be_available_in _the_filemanager_under_backup");
static $__desc_macaddress = array("", "", "mac_address_base");


static $__desc_ttype = array("e", "", "type");
static $__desc_ttype_v_xen = array("", "", "xen");
static $__desc_ttype_v_openvz = array("", "", "openvz");


static $__desc_nosaveconfig_flag = array("f", "", "dont_save_config");
static $__desc_disk_usage = array("qh", "", "disk:disk_quota_(MB)");
static $__desc_backup_num = array("q", "", "backup:number_of_backups");
static $__desc_memory_usage = array("qh", "", "burst_mem:burstable_memory_(MB)(openvz_only)");
static $__desc_cpu_usage = array("qh", "", "cpu:cpu_usage_(%) 100/CPU");
static $__desc_managedns_flag = array("q", "", "can_manage_dns");
static $__desc_managereversedns_flag = array("q", "", "can_manage_reverse_dns");
static $__desc_rebuildvps_flag = array("q", "", "can_rebuild_vps");
static $__desc_centralbackup_flag = array("q", "", "enable_central_backup");


static $__desc_cpuunit_usage = array("qh", "", "cpuUNIT:CPU_UNITS_(default_1000)");
static $__desc_ncpu_usage = array("qh", "", "cpuNum:number_of_CPUS");
static $__desc_ioprio_usage = array("qh", "", "ioprio:IO_priority_(0-7)");


//static $__desc_monitorserver_num = array("q","", "number_of_monitored_servers");
//static $__desc_monitorport_num = array("q","", "number_of_monitored_ports");
static $__desc_uplink_usage = array("qh", "", "uplink_traffic(KB/s)");
//static $__desc_kernelmem_usage = array("q", "", "Kernel_Memory_(KB)");


static $__desc_process_usage = array("qh", "", "process:number_of_processes(openvz_only)");
static $__desc_guarmem_usage = array("qh", "", "guaranteed:guaranteed_memory_(MB)(openvz_only)");
static $__desc_realmem_usage = array("qh", "", "realmem:real_memory_usage_(MB)(xen_only)");
static $__desc_swap_usage = array("qh", "", "swap:swap_(MB)");
static $__desc_traffic_usage_q = array("", "", "Traffic");
static $__desc_timezone = array("", "", "timezone");
static $__desc_confirm_f = array("", "", "confirm");
static $__desc_reversedns_l = array("d", "", "", "");
static $__desc_ndskshortcut_l = array("d", "", "", "");


static $__acdesc_update_ostemplatelist = array("","", "ostemplate_list");
static $__acdesc_update_timezone = array("", "", "set_timezone");
static $__acdesc_update_boot = array("", "", "boot");
static $__acdesc_graph_base = array("", "", "graphs");
static $__acdesc_graph_traffic = array("", "", "traffic");
static $__acdesc_graph_v6traffic = array("", "", "v6traffic");
static $__acdesc_graph_cpuusage = array("", "", "Cpuusage");
static $__acdesc_graph_memoryusage = array("", "", "Memory");
static $__acdesc_update_livemigrate = array("", "", "live_migrate");
static $__acdesc_update_macaddress = array("", "", "mac_address");
static $__acdesc_update_clonevps = array("", "", "clone_vps");






static $__desc_traffic_usage_per = array("pS", "", "Traffic");
static $__desc_disk_usage_per = array("pS", "", "Disk");
static $__desc_mainipaddress = array("", "", "main_ipaddress");
static $__acdesc_update_mainipaddress = array("", "", "main_ipaddress");


// Objects
//static $__desc_vpsipaddress_l = array('qd', '', '', '');
static $__desc_vpstraffic_l = array('d', '', '', '');
static $__desc_vpstraffichistory_l = array('d', '', '', '');
static $__desc_vmipaddress_a = array('', '', '', '');
static $__desc_openvzqos_l = array('', '', '', '');
static $__desc_dns_l = array('d', '', '', '');
static $__desc_traceroute_l = array('', '', '', '');
static $__desc_diskusage_l = array('', '', '', '');
static $__acdesc_update_changelocation = array('n', "", "change_location", "");
static $__acdesc_update_changeosomagename = array('n', "", "set_distro_name", "");
static $__acdesc_update_hardpoweroff = array('n', "", "hard_poweroff", "");
static $__acdesc_show = array('', "", "VM_home", "");


static $__desc_monitorserver_l = array("qdtLbB", "", "");
static $__desc_emailalert_l = array("d", "", "", "");
static $__desc_kloxo_o = array("", "", "", "");


// Lists
//static $__desc_domain_l = array("qvd", "", "virtual_object");

maybe these data can be used to learn which variables one need to use when editting other php files of the HyperVM 2.1.0 dev(beta).

Here is a file responsible for sending vzctl commands to the server: /usr/local/lxlabs/hypervm/httpdocs/lib/vps/driver/vps__openvzlib.phps

This file (vps__openvzlib.phps) contains for example this:


$diskusage = $this->main->priv->disk_usage * 1024;
lxshell_return("/usr/sbin/vzctl", "set", $this->main->vpsid, "--save", "--diskspace", $diskusage, "--diskinodes", round($diskusage/2));


And when i qoute corresponding part of the above mentioned file "/usr/local/lxlabs/hypervm/httpdocs/lib/vps/vpslib.php":

static $__desc_disk_usage = array("qh", "", "disk:disk_quota_(MB)");

i see that the phrasse after "$__desc_" is the variable that i should be using in other files. The "disk_quota_(MB)" maybe somehow translates into the text that is actualy shown on the HyperVM webpage -> "Disk Quota (MB)"

So i think based on above mentioned list of variables of the file vpslib.php, i can know which variables i need to use in other HyperVM files.

If i need to discover variable for the hyperVM parameter "Swap (MB)" (this parameter is in HyperVM/Resource/Resource Plans/plan name), then i lookup "Swap" in above mentioned file vpslib.php and find the line:

static $__desc_swap_usage = array("qh", "", "swap:swap_(MB)");
telling me that i need to use variable swap_usage in other php files. The example usage is visible above in case of "disk_usage" variable.