public function getDatabaseBackupLocation($site, $env, $db, $backup)
{
$method = 'GET';
$resource = sprintf('/sites/%s/envs/%s/dbs/%s/backups/%s/download', $this->getSiteName($site), $env, $db, $backup);
$options = array('include_header' => TRUE);
$result = $this->callAcapi($site, $method, $resource, array(), array(), $options);
// Now parse the HTTP header, find the location.
$matches = array();
if (1 == preg_match('/^Location: (.*)$/m', $result['content'], $matches)) {
$result['result'] = $matches[1];
} else {
throw new CloudApiException(sprintf('BACKUP_NOT_FOUND: Could not find backup %s', $backup));
}
return $result['result'];
}