public function fetchCloudCredentialsAction($envId, $cloud)
{
if (!$this->getUser()->canManageAcl()) {
$this->checkPermissions(Acl::RESOURCE_ENV_CLOUDS_ENVIRONMENT);
}
$env = $this->getEnv($envId);
$cloudCredentials = $env->keychain($cloud);
if (empty($cloudCredentials->id)) {
throw new ApiErrorException(404, ErrorMessage::ERR_OBJECT_NOT_FOUND, "Cloud '{$cloud}' not configured for this environment");
}
return $this->result($this->getCloudCredsController()->adapter($cloudCredentials)->toData($cloudCredentials));
}