hsrtech / catc
Cloudatcost和vps-hosting.ca的PHP包装器。
0.9.1-alpha
2016-04-24 12:56 UTC
Requires
- php: >=5.6
- curl/curl: ^1.3
This package is not auto-updated.
Last update: 2024-09-14 18:58:28 UTC
README
Name: CatC Wrapper
Author: Rishabh Jain
Website: https://www.hsrtech.net
Stable Version: 1.0
Minimum Requirement: PHP 5.6 with cURL extenssion
简短描述
HSR TECH的PHP包装器,用于cloudatcost的API。
参考
安装
通过Composer
$ composer require hsrtech/catc
用法
基本用法
以下示例将展示基本用法
$api = new \hsrtech\catc\Wrapper( [ 'email' => 'Registered Email', 'api_key' => 'YourLoginEmail' ] );
高级用法
可以在其他具有相同类型面板的网站上使用此功能,只需添加一些其他参数。
$api = new \hsrtech\catc\Wrapper( [ 'email' => 'Registered Email', 'api_key' => 'YourLoginEmail' ], [ 'link' => 'The Base link for the api', // Default: https://panel.cloudatcost.com/api 'api_version' => 'the version of API to use', // Default = 'v1' ] );
操作
列出服务器
$api->getServers();
列出模板
$api->getTemplates();
列出任务
$api->getTasks();
开机服务器
$api->powerOnServer($Server_ID);
关机服务器
$api->powerOffServer($Server_ID);
重启服务器
$api->rebootServer($Server_ID);
获取控制台URL
$api->getConsole($Server_ID);
重命名服务器
$api->renameServer($Server_ID, $Name);
修改反向DNS
$api->setRDNS($Server_ID, $rdns);
运行模式
$api->runMode($Server_ID, $runmode);
Cloud Pro功能
构建服务器
$api->buildServer( [ 'cpu' => 'Amount of CPU cores for server', 'ram' => 'Amount of Ram for the server', 'storage' => 'Storage space alloted to the server', 'os' => 'Valid Operating System ID', ] );
删除服务器
$api->deleteServer($Server_ID);
资源
$api->getResources();
##其他功能您还可以使用以下函数返回上次调用的结果。
$api->results();
致谢
许可证
版权所有 2016 HSR-TECH
遵循Apache许可证第2版(“许可证”);除非遵守许可证规定,否则不得使用此文件。您可以在https://apache.ac.cn/licenses/LICENSE-2.0获取许可证副本。
除非适用法律要求或书面同意,否则在许可证下分发的软件按“现状”分发,不提供任何明示或暗示的保证。有关许可证的具体语言、权限和限制,请参阅许可证。