morningtrain / hcloud-php
Hetzner Cloud API 的 PHP 库
v1.2.0
2021-11-29 09:32 UTC
Requires
- php: >=5.6.4
- ext-json: *
- ext-mbstring: *
- guzzlehttp/guzzle: ^6.3|^7.0
- tightenco/collect: >=v5.4.33
Requires (Dev)
- phpunit/phpunit: ^6.5
- victorjonsson/markdowndocs: ^1.3
README
安装:Composer
您可以通过 Composer 安装此库。运行以下命令
composer require exploriment/hcloud-php
文档和示例
完整技术文档可在 DOCUMENTATION.md
文件中找到。更易于使用的文档可以在 wiki 中找到。
HetznerCloud
<?php use Exploriment\HetznerCloud; /** * set your API token like this and you are ready to * make API calls using this library! */ HetznerCloud\HetznerCloud::setToken('my_token_here'); // retrieve the pricing object $pricing = HetznerCloud\HetznerCloud::getPricing(); /** * retrieve the rate limit status, returns the following: * * object(stdClass)#1 (3) { * ["limit"]=> * int(0) * ["remaining"]=> * int(0) * ["reset"]=> * int(1517655111) * } * * values of these will be `null` if no requests to the API were made */ $rateLimit = HetznerCloud\HetznerCloud::getRateLimit();
先决条件和依赖项
- PHP 5.6.4 或更高版本
- ext-mbstring
- ext-json
- ext-curl (推荐)
- Laravel Collections
- GuzzlePHP
许可证
MIT