PHP code example of exploriment / hcloud-php
1. Go to this page and download the library: Download exploriment/hcloud-php library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
exploriment / hcloud-php example snippets
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();
bash
composer