+ httpStatusCodeException.getStatusCode().value());
+ }
+ }
+
+ /**
+ * Get DMI plugin health status.
+ *
+ * @param dmiPluginBaseUrl the base URL of the dmi-plugin
+ * @return plugin health status ("UP" is all OK, "" (not-specified) in case of any exception)
+ */
+ public String getDmiHealthStatus(final String dmiPluginBaseUrl) {
+ final HttpEntity<Object> httpHeaders = new HttpEntity<>(configureHttpHeaders(new HttpHeaders()));
+ try {
+ final JsonNode responseHealthStatus =
+ restTemplate.getForObject(dmiPluginBaseUrl + HEALTH_CHECK_URL_EXTENSION,
+ JsonNode.class, httpHeaders);
+ return responseHealthStatus == null ? NOT_SPECIFIED :
+ responseHealthStatus.get("status").asText();
+ } catch (final Exception e) {
+ log.warn("Failed to retrieve health status from {}. Error Message: {}", dmiPluginBaseUrl, e.getMessage());
+ return NOT_SPECIFIED;