bennetgallein/virtualizor-php

A Wrapper for the Virtualizor API

dev-master 2018-05-29 22:03 UTC

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();