Extend probe mechanism
[vid.git] / vid-app-common / src / main / java / org / onap / vid / asdc / rest / SdcRestClient.java
index ab07aae..428083e 100644 (file)
@@ -22,6 +22,7 @@ package org.onap.vid.asdc.rest;
 
 import com.att.eelf.configuration.EELFLogger;
 import com.google.common.collect.ImmutableMap;
+import io.joshworks.restclient.http.HttpResponse;
 import io.vavr.control.Try;
 import org.onap.portalsdk.core.util.SystemProperties;
 import org.onap.vid.asdc.AsdcCatalogException;
@@ -97,6 +98,13 @@ public class SdcRestClient implements AsdcClient {
     }
 
 
+    public HttpResponse<String> checkSDCConnectivity() {
+        String finalUrl = baseUrl + URIS.HEALTH_CHECK_ENDPOINT;
+
+        return syncRestClient
+                .get(finalUrl, prepareHeaders(auth, APPLICATION_JSON), Collections.emptyMap(), String.class);
+    }
+
     private Map<String, String> prepareHeaders(String auth, String contentType) {
         return ImmutableMap.of(
                 X_ECOMP_INSTANCE_ID, SystemProperties.getProperty(APP_DISPLAY_NAME),