Scalr\Api\Service\Account\V1beta0\Controller\Environments::fetchCloudCredentialsAction PHP Method

fetchCloudCredentialsAction() public method

Fetch detailed info about specified cloud configuration
public fetchCloudCredentialsAction ( integer $envId, string $cloud ) : Scalr\Api\DataType\ResultEnvelope
$envId integer Environment ID
$cloud string Cloud platform name
return Scalr\Api\DataType\ResultEnvelope
    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));
    }