Ovh\Dedicated\Server\ServerClient::setNetboot PHP Method

setNetboot() public method

Set netboot
public setNetboot ( string $domain, integer $bootId ) : Guzzle\Http\EntityBodyInterface | string
$domain string
$bootId integer
return Guzzle\Http\EntityBodyInterface | string
    public function setNetboot($domain, $bootId)
    {
        if (!$domain) {
            throw new BadMethodCallException('Parameter $domain is missing.');
        }
        $domain = (string) $domain;
        if (!$bootId) {
            throw new BadMethodCallException('Parameter $bootId is missing.');
        }
        $bootId = intval($bootId);
        $payload = array('bootId' => $bootId);
        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);
    }