Proxmox API

  • Thread starter Thread starter Chris Rivera
  • Start date Start date
C

Chris Rivera

Guest
Before i ask how to get what i need done just wanted to thank you guys for the API. this helps out alot and allows me to do what i do best and develop code.

I am working on a cluster management system that works with WHMCS.


I am running into an issue where i cannot run actions using the PHP API provided by link from you guys.



I created my own class / function to wrap your API... dont know if thats normal... but thats how i develop my stuff.


function vz_shutdown($nodeId,$vmID){
$postValues['node'] = $nodeId;
$postValues['vmid'] = $vmID;
var_dump($this->pve2->post("/nodes/".$nodeId."/openvz/".$vmID."/status/stop",$postValues));
}

this seems to be what you guys want .... but when ran does not shutdown the vm...


could you please shed come light as to why this is not working. thanks!
 
No there was no error message or response when i ran the command.

using print_r() and var_dump()

returns blank value..



Meanwhile... if i do a get to query information it works no problem. Anything i can provide to help track down whats wrong?
 
code:



$pve = new PVEAPI();
$result = $pve->vz_shutdown("poxmox5","128");


print_r($result);
var_dump($result);





response:

bool(false) NULL




**poxmox5 is indeed the hostname of the node(typo on configuration).....openvz ct 128 is on this node