morningtrain / hcloud-php
PHP library for the Hetzner Cloud API
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
Installation: Composer
You can install this library via Composer. Run the following command:
composer require exploriment/hcloud-php
Documentation and examples
Full technical documentation can be found in DOCUMENTATION.md
. The more user-friendly documentation can be found in the 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();
Prerequisites and dependencies
- PHP 5.6.4 or higher
- ext-mbstring
- ext-json
- ext-curl (recommended)
- Laravel Collections
- GuzzlePHP
License
MIT