lib/Elastica/Cluster/Settings.php
public function setReadOnly(bool $readOnly = true, bool $persistent = false): Response
    {
        $key = 'cluster.blocks.read_only';

        if ($persistent) {
            return $this->setPersistent($key, $readOnly);
        }

        return $this->setTransient($key, $readOnly);
    }
public function setReadOnly(bool $readOnly = true, bool $persistent = false): Response
    {
        $key = 'cluster.blocks.read_only';

        if ($persistent) {
            return $this->setPersistent($key, $readOnly);
        }

        return $this->setTransient($key, $readOnly);
    }
public function setReadOnly ( bool $ readOnly = true , bool $ persistent = false ) : Response { $ key = 'cluster.blocks.read_only' ; if ( $ persistent ) { return $ this -> setPersistent ( $ key , $ readOnly ) ; } return $ this -> setTransient ( $ key , $ readOnly ) ; }
Sets the cluster to read only.

Second param can be used to set it persistent

@param bool $readOnly
@param bool $persistent

@return Response $response
Sets the cluster to read only .