Exploriment / hcloud-php

PHP library for the Hetzner Cloud API by Exploriment
MIT License
28 stars 8 forks source link

Request Console not implemented #4

Closed Vladdy88 closed 6 years ago

Vladdy88 commented 6 years ago

I saw another useful server action available on Hetzner API name Request Console (https://docs.hetzner.cloud/#resources-server-actions-post-17), that I didn't find implemented in your code.

I added it on the Servers class like this :

/**
     * Request console
     *
     * @param $id
     * @return \Exploriment\HetznerCloud\ApiResponse
     * @throws \Exploriment\HetznerCloud\Exceptions\MalformedResponse
     * @throws \ReflectionException
     */
    public static function requestConsole($id)
    {
        $response = self::request('POST', $id.'/actions/request_console');

        return $response->getBody();
    }

Maybe you can implement it or something like this. Thank you!

dyhli commented 6 years ago

Added in v1.1.0

778fee9928e0f7e296e07f148b7b1029c1135aad