Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bennetgallein/virtualizorphp
OOP Wrapper for the Virtualizor API
https://github.com/bennetgallein/virtualizorphp
Last synced: 3 months ago
JSON representation
OOP Wrapper for the Virtualizor API
- Host: GitHub
- URL: https://github.com/bennetgallein/virtualizorphp
- Owner: bennetgallein
- License: mit
- Created: 2018-02-15T22:26:06.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2018-05-29T22:03:46.000Z (over 6 years ago)
- Last Synced: 2024-09-27T23:16:29.799Z (5 months ago)
- Language: PHP
- Homepage:
- Size: 21.5 KB
- Stars: 4
- Watchers: 2
- Forks: 3
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Virtualizor API Wrapper [![Build Status](https://travis-ci.org/bennetgallein/VirtualizorPHP.svg?branch=master)](https://travis-ci.org/bennetgallein/VirtualizorPHP)
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.
```php
$virt = new \Virtualizor\Virtualizor("ip", "key", "pass", "port");
```### ServerInfo
Get some information about the master
```php
$info = json_decode($virt->serverInfo());
```### VirtualServer:
Create a new VirtualServer Object by using the following:
```php
$virtualobject = $virt->vps();
```
Add Attributes and set the Act Method, then execute the query.
```php
$vps = $virtualobject->setAct(\Virtualizor\Objects\VirtualServer::REBUILD)->setHostname("hostname_1")->exec();
```### IPPool
Create a new IPPool Object by using the following:
```php
$virtualobject = $virt->ippool();
```
List all pools:
```php
$pools = $virtualobject->setAct(\Virtualizor\Objects\IPPool::LISTPOOLS)->exec();
```### OSTemplates
Create a new OSTemplates Object by using the following:
```php
$virtualobject = $virt->ostemplates();
```
List all templates:
```php
$ostemplates = $virtualobject->setAct(\Virtualizor\Objects\OSTemplates::LISTOS)->exec();
```