class HeatStackAudit {

    public Optional<AAIObjectAuditList> auditHeatStack(String cloudRegion, String cloudOwner, String tenantId,
            String heatStackName) {
        try {
            logger.debug("Fetching Top Level Stack Information");
            Resources resources = heat.queryStackResources(cloudRegion, tenantId, heatStackName, 3);
            List<Resource> novaResources = resources.getList().stream()
                    .filter(p -> "OS::Nova::Server".equals(p.getType())).collect(Collectors.toList());
            List<Resource> resourceGroups = resources.getList().stream()
                    .filter(p -> "OS::Heat::ResourceGroup".equals(p.getType()) && p.getName().contains("subinterfaces"))
                    .collect(Collectors.toList());
            List<Optional<Port>> neutronPortDetails = retrieveNeutronPortDetails(resources, cloudRegion, tenantId);
            if (novaResources.isEmpty())
                return Optional.of(new AAIObjectAuditList());
            else {
                Set<Vserver> vserversToAudit = createVserverSet(resources, novaResources, neutronPortDetails);
                Set<Vserver> vserversWithSubInterfaces =
                        processSubInterfaces(cloudRegion, tenantId, resourceGroups, vserversToAudit);
                return auditVservers.auditVservers(vserversWithSubInterfaces, tenantId, cloudOwner, cloudRegion);
            }
        } catch (Exception e) {
            logger.error("Error during auditing stack resources", e);
            return Optional.empty();
        }
    }

}