public function setBackupFTPaccessBlock($domain, $ipBlock, $ftp, $nfs, $cifs)
{
$domain = (string) $domain;
if (!$domain) {
throw new BadMethodCallException('Parameter $domain is missing.');
}
if (!$ipBlock) {
throw new BadMethodCallException('Parameter $ipBlock is missing.');
}
if (!$ftp) {
throw new BadMethodCallException('Parameter $ftp is missing.');
}
if (!$nfs) {
throw new BadMethodCallException('Parameter $nfs is missing.');
}
if (!$cifs) {
throw new BadMethodCallException('Parameter $cifs is missing.');
}
$payload = array('ftp' => $ftp == 'on', 'nfs' => $nfs == 'on', 'cifs' => $cifs == 'on');
try {
$r = $this->put('dedicated/server/' . $domain . '/features/backupFTP/access/' . urlencode($ipBlock), 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);
}