Scalr\Api\Service\Account\V1beta0\Controller\Environments::deleteAction PHP Метод

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

Delete an Environment from this Account
public deleteAction ( string $envId ) : Scalr\Api\DataType\ResultEnvelope
$envId string Unique identifier of the Environment
Результат Scalr\Api\DataType\ResultEnvelope
    public function deleteAction($envId)
    {
        if (!$this->getUser()->isAccountSuperAdmin() && !$this->getUser()->isAccountOwner()) {
            throw new ApiErrorException(403, ErrorMessage::ERR_PERMISSION_VIOLATION, "Insufficient Permissions");
        }
        $env = $this->getEnv($envId);
        try {
            $env->delete();
        } catch (ObjectInUseException $e) {
            throw new ApiErrorException(409, ErrorMessage::ERR_OBJECT_IN_USE, $e->getMessage(), $e->getCode(), $e);
        }
        return $this->result(null);
    }