fdisotto/cac-api

cloudatcost API 的 PHP 封装

1.0.4 2015-04-21 21:04 UTC

This package is not auto-updated.

Last update: 2024-09-14 17:04:53 UTC


README

cloudatcost API 的 PHP 封装

参考

https://github.com/cloudatcost/api

安装

通过 Composer

$ composer require fdisotto/cac-api

需要 PHP 5.3.0 或更高版本和安装 cURL 库。

使用方法

$cac = new \fdisotto\CACApi(array(
    'key' => 'YourApiKey',
    'login' => 'YourLoginEmail'
));

动作

列出服务器

print_r($cac->getServers());

列出模板

print_r($cac->getTemplates());

列出任务

print_r($cac->getTasks());

开启服务器

$cac->powerOnServer($serverID);

关闭服务器

$cac->powerOffServer($serverID);

重置服务器

$cac->resetServer($serverID);

控制台 URL

$cac->getConsoleUrl($serverID);

重命名服务器

$cac->renameServer($serverID, $newName);

修改反向 DNS

$cac->reverseDNS($serverID, $hostname);

运行模式

$cac->runMode($serverID, $runmode);

更新

v1.0.4

  • 添加了 运行模式 功能

v1.0.3

  • 添加了 重命名服务器 功能
  • 添加了 修改反向 DNS 功能
  • 更新了测试

v1.0.1

  • 添加了测试
  • 添加了示例
  • 扩展 curl 类,现在你可以使用此库的所有公共方法和属性(例如:http_status_code 等。)
  • 一些修复

致谢

许可协议

MIT 许可协议(MIT)。请参阅许可文件以获取更多信息。