Ovh\Dedicated\Server\ServerClient::setBootDevice PHP Метод

setBootDevice() публичный Метод

Set boot device
public setBootDevice ( $domain, $currentState, $bootDevice ) : Guzzle\Http\EntityBodyInterface | string
$domain
$bootDevice
Результат Guzzle\Http\EntityBodyInterface | string
    public function setBootDevice($domain, $currentState, $bootDevice)
    {
        //var_dump($currentState);
        if (!$domain) {
            throw new BadMethodCallException('Parameter $domain is missing.');
        }
        $domain = (string) $domain;
        if (!$bootDevice) {
            throw new BadMethodCallException('Parameter $bootDevice is missing.');
        }
        $bootDevice = (string) $bootDevice;
        $payload = array('bootId' => $bootDevice, 'monitoring' => $currentState->monitoring, 'rootDevice' => $currentState->rootDevice);
        //			'state' =>$currentState->state
        // dont try and set 'state' unless the machine is in 'hacked' state.... ugh
        try {
            $r = $this->put('dedicated/server/' . $domain, array('Content-Type' => 'application/json;charset=UTF-8'), json_encode($payload))->send();
        } catch (\Exception $e) {
            throw new ServerException($e->getMessage(), $e->getCode(), $e);
        }
        return $r->getBody(true);
    }