getVariants().add(new Variant(MediaType.APPLICATION_JSON));
setNegotiated(false);
}
public Representation get() {
StringRepresentation presentation = null;
try {
String clusterName = (String) getRequest().getAttributes().get("clusterName");
String instanceName = (String) getRequest().getAttributes().get("instanceName");
presentation = getInstanceErrorsRepresentation(clusterName, instanceName);
} catch (Exception e) {
String error = ClusterRepresentationUtil.getErrorAsJsonStringFromException(e);
presentation = new StringRepresentation(error, MediaType.APPLICATION_JSON);
LOG.error("", e);
}
return presentation;