[2024-12-30 17:49:54] Core(433): E_WARNING: Undefined array key "billic_lock_session_ip", File: /var/www/6ab474d6-cdc0-4240-941a-f8f83d769a20/public_html/Modules/Core.php
VirtPanel has the ability to be managed easily by using an integrated API.
This can be done by going to "Tools" -> "API Access". Then, enter the main IP address of the server your script is located and click on Add.
On the API Access page, get the randomly generated API Key. The IP Address is now ready to access the API.
!!! When using the apikey for API Access, POST fields are also accepted as GET !!!
List Virtual Machineshttp://you.virtpanel.com/?vm&apikey=XXXXXX Returns: The HTML of the page as accessed normally though the GUI. Add Rule to Firewall (POST EXAMPLE) http://you.virtpanel.com/?security&apikey=XXXXXX&action=firewall&subaction=add&id=1&type=tcp&port=80&add=1
Returns: The HTML of the page as accessed normally though the GUI.
/api/list_accounts.php?apikey=XXXXXX
Returns: A JSON encoded array of all your accounts.
/api/list_servers.php?apikey=XXXXXX
Returns: A comma separated list of server hostnames.
List Servers
/api/list_servers.php?apikey=XXXXXX
Optional Arguments: type (currently only qemu)
Returns: A comma separated list of servers.
/api/list_servers_full.php?apikey=XXXXXX
Optional Arguments: type (currently only qemu)
Returns: A JSON encoded array of all your servers with their settings.
/api/list_pools.php?apikey=XXXXXX
Returns: A comma separated list of server pool names.
List Plans
/api/list_plans.php?apikey=XXXXXX
Returns: A comma separated list of plans.
/api/list_templates.php?apikey=XXXXXX&type=qemu
Required Arguments: type (currently only qemu)
Returns: A comma separated list of templates. The format is: filename.lzo [128 XX] where XX is either B, KB, MB or GB.
/api/login_auth.php?apikey=XXXXXX&username=XXXXXXX
Required Arguments: username (the account username)
Returns: The plain key.
Explanation: The end user should be logged into the panel by accessing http://you.virtpanel.com/?login&auth=XXXXXXXXX where XXXXXXX is the key returned from the API. The key can only be used once and lasts for 60 seconds after generation.
/api/get_vm.php?username=XXXXXX
Required Arguments: username (the account username)
Returns: A JSON encoded array of the single account.
Get Account Logs
/api/get_vm_logs.php?username=XXXXXX
Required Arguments: username (the account username)
Returns: A JSON encoded array of the action logs.
Get Task History
/api/get_vm_tasks.php?username=XXXXXX
Required Arguments: username (the account username)
Returns: A JSON encoded array of the task history.
/api/get_ip.php?username=XXXXXXX
Required Arguments: username (the account username)
Returns: A comma separated list of IP addresses that the account has been assigned.