dev-master
9999999-devA Wrapper for the Virtualizor API
MIT
The Development Requires
A Wrapper for the Virtualizor API
This is a wrapper for the API for Virtualizor. Documentation for this Version of the API can be found here: http://virtualizor.com/admin-api/#virtual-servers . Own Documentation will follow., (*1)
Install this library via composer is pretty easy., (*2)
composer require bennetgallein/virtualizor-php
And then you can get started with your project., (*3)
Every call starts by Initializing the Virtualizor
Object. Once initialized you can use it over and over again., (*4)
$virt = new \Virtualizor\Virtualizor("ip", "key", "pass", "port");
Get some information about the master, (*5)
$info = json_decode($virt->serverInfo());
Create a new VirtualServer Object by using the following:, (*6)
$virtualobject = $virt->vps();
Add Attributes and set the Act Method, then execute the query., (*7)
$vps = $virtualobject->setAct(\Virtualizor\Objects\VirtualServer::REBUILD)->setHostname("hostname_1")->exec();
Create a new IPPool Object by using the following:, (*8)
$virtualobject = $virt->ippool();
List all pools:, (*9)
$pools = $virtualobject->setAct(\Virtualizor\Objects\IPPool::LISTPOOLS)->exec();
Create a new OSTemplates Object by using the following:, (*10)
$virtualobject = $virt->ostemplates();
List all templates:, (*11)
$ostemplates = $virtualobject->setAct(\Virtualizor\Objects\OSTemplates::LISTOS)->exec();
A Wrapper for the Virtualizor API
MIT