// a {"$DOMAIN": $VALUE} dict before json serializing and returning it.
// Execute the control command over each target cluster
Iterator<Target> targetIterator = targets.iterator();
while (targetIterator.hasNext()) {
Target target = targetIterator.next();
if (targets.size() > 1) {
if (!json) {
final List<URI> endpoints = target.getEndpointSupplier().get();
final String header = format("%s (%s)", target.getName(), endpoints);
out.println(header);
out.println(repeat("-", header.length()));
out.flush();
} else {
if (isFirst) {
out.println("{");
isFirst = false;
}
out.println("\"" + target.getName() + "\": ");
}
}
successful &= run(options, target, out, err, username, json, stdin);