m1guelpf / hyperhost-api
Hyper.Host API 的 PHP 客户端
dev-master
2018-12-28 14:58 UTC
Requires
- php: ^5.5|^7.0
- guzzlehttp/guzzle: ^6.1
Requires (Dev)
- phpunit/phpunit: 6.*
This package is auto-updated.
Last update: 2024-09-17 04:33:47 UTC
README
此包简化了与 Hyper.host API 的交互。
需求
此包需要 PHP >= 5.5。
安装
您可以通过 composer 安装此包
composer require m1guelpf/hyperhost-api
使用方法
您必须将 Guzzle 客户端和 API 令牌传递给 M1guelpf\HyperHostAPI\HyperHost
构造函数。
$hyperhost = new \M1guelpf\HyperHostAPI\HyperHost('YOUR_API_TOKEN');
或者您可以跳过令牌,稍后使用 connect()
方法
$hyperhost = new \M1guelpf\HyperHostAPI\HyperHost(); $hyperhost->connect('YOUR_FLY_API_TOKEN');
获取所有团队
$hyperhost->getTeams();
获取特定团队
$hyperhost->getTeam($teamId);
创建团队
$hyperhost->createTeam($name, $slug);
邀请某人加入团队
$hyperhost->inviteTeamMember($teamId, $email);
获取所有包
$hyperhost->getPackages();
获取 SSO 链接
$hyperhost->getSSOLink($packageId);
创建包
$hyperhost->createPackage($domain, $platform, $teamId);
开始迁移
$hyperhost->startMigration($host, $user, $password, $domain);
获取 Guzzle 客户端
$hyperhost->getClient();
设置 Guzzle 客户端
$client = new \GuzzleHttp\Client(); // Example Guzzle client $hyperhost->setClient($client);
其中 $client 是 \GuzzleHttp\Client
实例。
变更日志
请参阅 CHANGELOG 了解最近更改的详细信息。
测试
$ composer test
贡献
请参阅 CONTRIBUTING 了解详细信息。
安全
如果您发现任何安全相关的问题,请通过电子邮件 soy@miguelpiedrafita.com 而不是使用问题跟踪器。
鸣谢
许可证
MIT 许可证。请参阅 许可证文件 了解更多信息。