bennetgallein / virtualizor-php
A Wrapper for the Virtualizor API
Installs: 1 071
Dependents: 0
Suggesters: 0
Security: 0
Stars: 4
Watchers: 2
Forks: 3
Open Issues: 3
Requires (Dev)
- phpunit/phpunit: ^6.5
This package is auto-updated.
Last update: 2024-10-29 00:01:37 UTC
README
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.
Installation
Install this library via composer is pretty easy.
composer require bennetgallein/virtualizor-php
And then you can get started with your project.
Object Description:
Every call starts by Initializing the Virtualizor
Object. Once initialized you can use it over and over again.
$virt = new \Virtualizor\Virtualizor("ip", "key", "pass", "port");
ServerInfo
Get some information about the master
$info = json_decode($virt->serverInfo());
VirtualServer:
Create a new VirtualServer Object by using the following:
$virtualobject = $virt->vps();
Add Attributes and set the Act Method, then execute the query.
$vps = $virtualobject->setAct(\Virtualizor\Objects\VirtualServer::REBUILD)->setHostname("hostname_1")->exec();
IPPool
Create a new IPPool Object by using the following:
$virtualobject = $virt->ippool();
List all pools:
$pools = $virtualobject->setAct(\Virtualizor\Objects\IPPool::LISTPOOLS)->exec();
OSTemplates
Create a new OSTemplates Object by using the following:
$virtualobject = $virt->ostemplates();
List all templates:
$ostemplates = $virtualobject->setAct(\Virtualizor\Objects\OSTemplates::LISTOS)->exec();