s4wny/cloud-royale-api
最新稳定版本:0.2.0
Composer 安装命令:
composer require s4wny/cloud-royale-api
包简介
Unoffical API for Cloud Royale
README 文档
README
Unoffical API for Cloud Royale. (They don't have any offical API at the moment.)
Installation
composer require s4wny/cloud-royale-api
Documentation
Example usage:
<?php require_once __DIR__ . '/vendor/autoload.php'; // Autoload files using Composer autoload use CloudRoyaleAPI\CloudRoyaleAPI; $api = new CloudRoyaleAPI("name@domain.com", "123456"); // Login var_dump($api->login()); // Get all your servers ( [ID => server name] ) $servers = $api->getServers(); print_r($servers); // Get status about a specific server $firstServer = key($servers); print_r(json_decode($api->getStatus($firstServer))); /* Output: bool(true) Array ( [0] => Array ( [ip] => 1.2.3.4 [id] => sadffsd34rfxd3 [name] => http server [online] => false ) [1] => Array ( [ip] => 4.4.4.4 [id] => asfdsadf [name] => vpn [online] => true ) ) stdClass Object ( [sadffsd34rfxd3] => stdClass Object ( [status] => On [memory] => 8 [cpus] => 3 [disk_size] => 30 [disks] => stdClass Object ( [1337] => stdClass Object ( [size] => 30 [storage] => 13 ) ) ) ) */ ?>
Methods
- __construct($username, $password)
- login()
- getStatus($serverID)
- getServers()
- startServer($serverID)
- stopServer($serverID)
- addSSHKeys($serverID)
- createServer($config)
License
This library is open-sourced software licensed under the MIT license
统计信息
- 总下载量: 101
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2015-09-12