Softaculous


Topic : Virtualizor API Issue


Posted By: ajmeireles on May 16, 2019, 4:15 pm
Hello,
 
 I'm trying to create a custom button on WHMCS Admin Panel called as "Rebuild", only to the Admin user be able to rebuild a VPS with easy mode, because I do not use "User Rebuilt" on VPS panel to prevent any errors that the customer can do.

I'm trying to use ADMIN API, but when I call the function, the system return this error: https://puu.sh/Dt6fR/84a806575a.png, say me this reason: "The VPS ID doesn't exists"

 
 My questions is:


1. The Virtualizor admin API only work if the VPS is in Master server?

2. Can you check if have some error in this simple code? https://puu.sh/Dt6N7/eb597c694a.png

On error log,  it returns all data from the VPS as correct informations, but it simply doesn't process.

Posted By: wolke on May 21, 2019, 9:50 am | Post: 1
You need to set the server IP. You can´t use master for all API access. It is server based. So if you direct the API request to the master, but the vps is on a slave you will get the vps id not found error.
I mentioned that many months ago, because this make tha Admin API unusable in my opinion., At least if used with automation software like WHMCS (there you only have the vps ID and WHMCS has no clue on which server the vps is installed.).
That´s one of the reason I never use this.

Posted By: ajmeireles on May 22, 2019, 7:01 am | Post: 2
Quote From : wolke May 21, 2019, 9:50 am
You need to set the server IP. You can´t use master for all API access. It is server based. So if you direct the API request to the master, but the vps is on a slave you will get the vps id not found error.
I mentioned that many months ago, because this make tha Admin API unusable in my opinion., At least if used with automation software like WHMCS (there you only have the vps ID and WHMCS has no clue on which server the vps is installed.).
That´s one of the reason I never use this.


They send me the new SDK admin. Check it out with they. With it, we can connect to any VPS from any server, master or slave.

So I finished my custom module from WHMCS: "Rebuild VPS", now we can rebuild a VPS without need access Virtualizor, why we do not allow the rebuild feature to the enduser.

Posted By: wolke on May 22, 2019, 8:30 am | Post: 3
seems that there were made some significant changes. I got it working too with connecting only to master.sounds like fun :-)

Posted By: chirag on November 18, 2019, 6:31 am | Post: 4
Hi,
Sir whenever you make any call using SDK you will need to make a call to Master server only.If you make call to Slave server it will work but Master will not be aware of that changes. So in next sync the DB changes will be overwirtten as per the master server entry.
It should work from Master server.https://www.virtualizor.com/docs/admin-api/rebuild-vps/
Let us know if you are facing any issues.


-----------------------
Virtualizor - VPS Control Panel
Follow us on Facebook

Powered By AEF 1.0.8 © 2007-2008 Electron Inc.