Proxmox API

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

 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!