Skip to content

Changes v0.0.12 to 1.0.0

Lukas Kämmerling edited this page Aug 8, 2018 · 1 revision

Breaking Changes

  • Servers Class The create method was split into two different methods createInLocation for creating a server in a location and createInDatacenterfor creating a server in a datacenter

  • All "action" like Server::powerOn() methods now return an instance of LKDev\HetznerCloud\ApiResponse instead an instance of LKDev\HetznerCloud\Models\Actions\Action. If you want to the the underlying action object just use the value action as parameter of the getResponsePart on the LKDev\HetznerCloud\ApiResponseobject. Of course you could use server or wss_url as parameter like in the official Hetzner Cloud documentation

  • All resource object constructors now require an instance of the internal GuzzleHttpClient LKDev\HetznerCloud\Clients\GuzzleClient if you use the shortcut methods this is done for you.

Non Breaking Changes

Shortcut methods

The HetznerApiClient- object has now a method for every resource, for easily accessing the underlying object. Instead of

// < v1.0.0
$apiKey = '{InsertApiTokenHere}';

$hetznerClient = new \LKDev\HetznerCloud\HetznerAPIClient($apiKey);
$serverEndpoint = new  \LKDev\HetznerCloud\Models\Servers\Servers();
$serverEndpoint->all();

you could now do simply

// >= v1.0.0
$apiKey = '{InsertApiTokenHere}';

$hetznerClient = new \LKDev\HetznerCloud\HetznerAPIClient($apiKey);
$hetznerClient->servers()->all();
Clone this wiki locally