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

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

Get Set backupFTP ACL
public setBackupFTPaccessBlock ( $domain, $ipBlock, $ftp, $nfs, $cifs ) : object
$domain -> Server that this applies to
Результат object result set throws BadMethodCallException if any param is not defined usual handling for 400/404 errors
    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);
    }