private static String createId(String dnsName, TenantName tenant, ApplicationName application,
                                      Optional<InstanceName> instance, ClusterSpec.Id cluster, ZoneId zone) {
            if (instance.isEmpty()) { // Application-scoped endpoint
                if (dnsName.isEmpty()) throw new IllegalArgumentException("dnsName must given for application-scoped endpoint");
                @SuppressWarnings("deprecation")
                String endpointHash = Hashing.sha1().hashString(dnsName, StandardCharsets.UTF_8).toString();
                return "application-" + endpointHash + "." +application.value() + "." + tenant.value();
            } else {
                if (!dnsName.isEmpty()) throw new IllegalArgumentException("dnsName must not be given for instance-level endpoint");
            }
            return Stream.of(nullIfDefault(cluster.value()),
                             nullIfDefault(instance.get().value()),
                             application.value(),
                             tenant.value(),
                             zone.region().value(),
                             zone.environment().value())
                         .filter(Objects::nonNull)
                         .map(Target::sanitize)
                         .collect(Collectors.joining("."));
        }
Create an unique identifier for given dnsName and target
routing-generator/src/main/java/com/yahoo/vespa/hosted/routing/RoutingTable.java