public function setMonitoring($domain, $_enable)
{
if (!$domain) {
throw new BadMethodCallException('Parameter $domain is missing.');
}
$domain = (string) $domain;
if ($_enable == "on") {
$enable = true;
} else {
$enable = false;
}
// if (!$enable)
// throw new BadMethodCallException('Parameter enable is missing.');
if (!is_bool($enable)) {
throw new BadMethodCallException('Parameter $enable must be a boolean');
}
$payload = array('monitoring' => $enable);
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);
}