Remove useless global calls and add docblocks

This commit is contained in:
Mark Schouten
2015-09-01 10:14:15 +02:00
parent bcca44b08e
commit e5281fa49d
4 changed files with 27 additions and 5 deletions

View File

@ -16,14 +16,30 @@
* See http://www.gnu.org/licenses/gpl.txt for the full license
*/
/**
* Fetch all VM's in a Proxmox Cluster
* @param string $c Clustername
* @return array An array with all the VM's on this cluster
*/
function proxmox_cluster_vms($c) {
return dbFetchRows("SELECT * FROM proxmox WHERE cluster = ? ORDER BY vmid", array($c));
}
/**
* Fetch all VM's on a Proxmox node
* @param integer $n device_id
* @return array An array with all the VM's on this node
*/
function proxmox_node_vms($n) {
return dbFetchRows("SELECT * FROM proxmox WHERE device_id = ? ORDER BY vmid", array($n));
}
/**
* Fetch all info about a Proxmox VM
* @param integer $vmid Proxmox VM ID
* @param string $c Clustername
* @return array An array with all info of this VM on this cluster, including ports
*/
function proxmox_vm_info($vmid, $c) {
$vm = dbFetchRow("SELECT pm.*, d.hostname AS host, d.device_id FROM proxmox pm, devices d WHERE pm.device_id = d.device_id AND pm.vmid = ? AND pm.cluster = ?", array($vmid, $c));
$appid = dbFetchRow("SELECT app_id FROM applications WHERE device_id = ? AND app_type = ?", array($vm['device_id'], 'proxmox'));