Welcome Guest. Please Login or Register  


You are here: Index > Virtualizor - Virtual Server Control Panel > General Support > Topic : Virtualizor API Issue



Threaded Mode | Print  

 Virtualizor API Issue (4 Replies, Read 3086 times)
ajmeireles
Group: Member
Post Group: Newbie
Posts: 7
Status:
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.
IP: --   

Virtualizor API Issue
wolke
Group: NOC
Post Group: Elite Member
Posts: 273
Status:
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.
IP: --   

Virtualizor API Issue
ajmeireles
Group: Member
Post Group: Newbie
Posts: 7
Status:
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.
IP: --   

Virtualizor API Issue
wolke
Group: NOC
Post Group: Elite Member
Posts: 273
Status:
seems that there were made some significant changes. I got it working too with connecting only to master.sounds like fun :-)
IP: --   

Virtualizor API Issue
chirag
Group: Virtualizor Team
Post Group: Elite Member
Posts: 351
Status:
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
IP: --   

« Previous    Next »

Threaded Mode | Print  



Jump To :


Users viewing this topic
1 guests, 0 users.


All times are GMT. The time now is December 11, 2019, 8:42 pm.

  Powered By AEF 1.0.8 © 2007-2008 Electron Inc.Queries: 11  |  Page Created In:1.873