2017 © Pedro Peláez
 

library solusvm-client

SolusVM PHP Api,PHP control vps reboot, shutdown, boot, status.

image

jaeger/solusvm-client

SolusVM PHP Api,PHP control vps reboot, shutdown, boot, status.

  • Wednesday, December 7, 2016
  • by jae
  • Repository
  • 1 Watchers
  • 2 Stars
  • 13 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

solusvm-client

SolusVM PHP Api,PHP control vps reboot, shutdown, boot, status。-通过PHP来管理和控制VPS, (*1)

可用于检测服务器状态,检测拓机并重启服务器。, (*2)

Install 安装

composer require jaeger/solusvm-client

Code Example 例子

1.基本用法

$vm = new \Jaeger\SolusVm([
    //SolusVM server api url - 服务器SolusVM控制面板的API地址 
    'server_api_url' => 'https://xxxx.com/api/client/command.php',
    //API Key
    'key' => '*****',
    //API Hash
    'hash' => '*****'
]);

//reboot server - 重启服务器
$rt = $vm->reboot();
//$rt = $vm->action('reboot');

//shutdown server - 服务器关机
$rt = $vm->shutdown();

//boot server - 服务器开机
$rt = $vm->boot();

//get server status - 获取服务器状态(是否在线)
$rt = $vm->status();

$rt = $vm->shutdownAndBoot();

//Check if the server is ofline, and reboot the server if the ofline
//检测服务器是否拓机,如果拓机则重启服务器
$rt = $vm->checkAndReboot();

2.Log 记录日志

本项目使用的日志系统为Monolog., (*3)

see Monolog documents ., (*4)


$vm = new \Jaeger\SolusVm([ 'server_api_url' => 'https://xxxx.com/api/client/command.php', 'key' => '*****', 'hash' => '*****', //log path - 日志文件路径 'log' => './log/vm.log' ]); //or $logHandler = new \Monolog\Handler\StreamHandler('./log/vm.log',\Monolog\Logger::INFO); $vm = new \Jaeger\SolusVm([ 'server_api_url' => 'https://xxxx.com/api/client/command.php', 'key' => '*****', 'hash' => '*****', //log handler 'log' => $logHandler ]);

Just do it,不需要其它额外操作,这样配置后,项目就可以自动记录日志了。, (*5)

Author

Jaeger JaegerCode@gmail.com, (*6)

The Versions

07/12 2016

dev-master

9999999-dev

SolusVM PHP Api,PHP control vps reboot, shutdown, boot, status.

  Sources   Download

MIT

The Requires

 

by Jaeger

solusvm

07/12 2016

1.0

1.0.0.0

SolusVM PHP Api,PHP control vps reboot, shutdown, boot, status.

  Sources   Download

MIT

The Requires

 

by Jaeger

solusvm