diff --git a/sdnr/wt/common/pom.xml b/sdnr/wt/common/pom.xml
index 5719be1..7a414e5 100644
--- a/sdnr/wt/common/pom.xml
+++ b/sdnr/wt/common/pom.xml
@@ -109,28 +109,6 @@
                 </configuration>
             </plugin>
             <plugin>
-                <groupId>org.codehaus.mojo</groupId>
-                <artifactId>exec-maven-plugin</artifactId>
-                <executions>
-                    <execution>
-                        <id>generateDTOs</id>
-                        <phase>generate-sources</phase>
-                        <goals>
-                            <goal>exec</goal>
-                        </goals>
-                        <configuration>
-                            <executable>bash</executable>
-                            <arguments>
-                                <argument>${basedir}/../data-provider/provider/src/main/resources/es-init.sh</argument>
-                                <argument>initfile</argument>
-                                <argument>-f</argument>
-                                <argument>${project.build.directory}/EsInit.script</argument>
-                            </arguments>
-                        </configuration>
-                    </execution>
-                </executions>
-            </plugin>
-            <plugin>
                 <groupId>com.github.alexcojocaru</groupId>
                 <artifactId>elasticsearch-maven-plugin</artifactId>
                 <version>6.16</version>
@@ -141,7 +119,6 @@
                     <httpPort>${databaseport}</httpPort>
                     <version>6.5.0</version>
                     <timeout>120</timeout>
-                    <pathInitScript>${project.build.directory}/EsInit.script</pathInitScript>
                 </configuration>
                 <executions>
                     <execution>
diff --git a/sdnr/wt/common/src/main/java/org/onap/ccsdk/features/sdnr/wt/common/configuration/subtypes/Section.java b/sdnr/wt/common/src/main/java/org/onap/ccsdk/features/sdnr/wt/common/configuration/subtypes/Section.java
index 094da63..1160c28 100644
--- a/sdnr/wt/common/src/main/java/org/onap/ccsdk/features/sdnr/wt/common/configuration/subtypes/Section.java
+++ b/sdnr/wt/common/src/main/java/org/onap/ccsdk/features/sdnr/wt/common/configuration/subtypes/Section.java
@@ -22,6 +22,8 @@
 import java.util.List;
 import java.util.Map.Entry;
 import java.util.Optional;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
 
 import org.onap.ccsdk.features.sdnr.wt.common.configuration.exception.ConversionException;
 import org.slf4j.Logger;
@@ -53,12 +55,36 @@
         return this.getProperty(key, "");
     }
 
-    public String getProperty(String key, String defValue) {
-        if (values.containsKey(key)) {
-            return values.get(key).getValue();
-        }
-        return defValue;
-    }
+	public String getProperty(final String key, final String defValue) {
+		String value=defValue;
+		LOG.debug("try to get property for {} with def {}",key,defValue);
+		if (values.containsKey(key)) {
+			value = values.get(key).getValue();
+		}
+		//try to read env var
+		if (value != null && value.contains("${")) {
+			
+			LOG.debug("try to find env var(s) for {}",value);
+			final String regex = "(\\$\\{[A-Z]+\\})";
+			final Pattern pattern = Pattern.compile(regex);
+			final Matcher matcher = pattern.matcher(value);
+			String tmp=new String(value);
+			while(matcher.find() && matcher.groupCount()>0) {
+				final String mkey = matcher.group(1);
+				if(mkey!=null) {
+					try {
+						LOG.debug("match found for v={} and env key={}",tmp,mkey);
+						String env=System.getenv(mkey.substring(2,mkey.length()-1));
+						tmp = tmp.replace(mkey, env==null?"":env );	
+					} catch (SecurityException e) {
+						LOG.warn("unable to read env {}: {}", value, e);
+					}
+				}
+			}
+			value=tmp;
+		}
+		return value;
+	}
 
     public String getName() {
         return name;
diff --git a/sdnr/wt/common/src/main/java/org/onap/ccsdk/features/sdnr/wt/common/database/ExtRestClient.java b/sdnr/wt/common/src/main/java/org/onap/ccsdk/features/sdnr/wt/common/database/ExtRestClient.java
index 6fb26f5..5ef326f 100644
--- a/sdnr/wt/common/src/main/java/org/onap/ccsdk/features/sdnr/wt/common/database/ExtRestClient.java
+++ b/sdnr/wt/common/src/main/java/org/onap/ccsdk/features/sdnr/wt/common/database/ExtRestClient.java
@@ -18,6 +18,8 @@
 package org.onap.ccsdk.features.sdnr.wt.common.database;
 
 import java.io.IOException;
+import java.text.ParseException;
+
 import org.apache.http.HttpHost;
 import org.apache.http.auth.AuthScope;
 import org.apache.http.auth.UsernamePasswordCredentials;
@@ -32,14 +34,19 @@
 import org.onap.ccsdk.features.sdnr.wt.common.database.config.HostInfo;
 import org.onap.ccsdk.features.sdnr.wt.common.database.config.HostInfo.Protocol;
 import org.onap.ccsdk.features.sdnr.wt.common.database.requests.ClusterHealthRequest;
+import org.onap.ccsdk.features.sdnr.wt.common.database.requests.CreateAliasRequest;
 import org.onap.ccsdk.features.sdnr.wt.common.database.requests.CreateIndexRequest;
+import org.onap.ccsdk.features.sdnr.wt.common.database.requests.DeleteAliasRequest;
 import org.onap.ccsdk.features.sdnr.wt.common.database.requests.DeleteByQueryRequest;
 import org.onap.ccsdk.features.sdnr.wt.common.database.requests.DeleteIndexRequest;
 import org.onap.ccsdk.features.sdnr.wt.common.database.requests.DeleteRequest;
 import org.onap.ccsdk.features.sdnr.wt.common.database.requests.GetIndexRequest;
+import org.onap.ccsdk.features.sdnr.wt.common.database.requests.GetInfoRequest;
 import org.onap.ccsdk.features.sdnr.wt.common.database.requests.GetRequest;
 import org.onap.ccsdk.features.sdnr.wt.common.database.requests.IndexRequest;
 import org.onap.ccsdk.features.sdnr.wt.common.database.requests.IndicesAliasesRequest;
+import org.onap.ccsdk.features.sdnr.wt.common.database.requests.ListAliasesRequest;
+import org.onap.ccsdk.features.sdnr.wt.common.database.requests.ListIndicesRequest;
 import org.onap.ccsdk.features.sdnr.wt.common.database.requests.NodeStatsRequest;
 import org.onap.ccsdk.features.sdnr.wt.common.database.requests.RefreshIndexRequest;
 import org.onap.ccsdk.features.sdnr.wt.common.database.requests.SearchRequest;
@@ -47,12 +54,17 @@
 import org.onap.ccsdk.features.sdnr.wt.common.database.requests.UpdateRequest;
 import org.onap.ccsdk.features.sdnr.wt.common.database.responses.AcknowledgedResponse;
 import org.onap.ccsdk.features.sdnr.wt.common.database.responses.ClusterHealthResponse;
+import org.onap.ccsdk.features.sdnr.wt.common.database.responses.CreateAliasResponse;
 import org.onap.ccsdk.features.sdnr.wt.common.database.responses.CreateIndexResponse;
+import org.onap.ccsdk.features.sdnr.wt.common.database.responses.DeleteAliasResponse;
 import org.onap.ccsdk.features.sdnr.wt.common.database.responses.DeleteByQueryResponse;
 import org.onap.ccsdk.features.sdnr.wt.common.database.responses.DeleteIndexResponse;
 import org.onap.ccsdk.features.sdnr.wt.common.database.responses.DeleteResponse;
+import org.onap.ccsdk.features.sdnr.wt.common.database.responses.GetInfoResponse;
 import org.onap.ccsdk.features.sdnr.wt.common.database.responses.GetResponse;
 import org.onap.ccsdk.features.sdnr.wt.common.database.responses.IndexResponse;
+import org.onap.ccsdk.features.sdnr.wt.common.database.responses.ListAliasesResponse;
+import org.onap.ccsdk.features.sdnr.wt.common.database.responses.ListIndicesResponse;
 import org.onap.ccsdk.features.sdnr.wt.common.database.responses.NodeStatsResponse;
 import org.onap.ccsdk.features.sdnr.wt.common.database.responses.RefreshIndexResponse;
 import org.onap.ccsdk.features.sdnr.wt.common.database.responses.SearchResponse;
@@ -63,234 +75,247 @@
 
 public class ExtRestClient {
 
-	private static final Logger LOG = LoggerFactory.getLogger(ExtRestClient.class);
+    private static final Logger LOG = LoggerFactory.getLogger(ExtRestClient.class);
 
-	private class BasicAuthHttpClientConfigCallback implements HttpClientConfigCallback {
+    private class BasicAuthHttpClientConfigCallback implements HttpClientConfigCallback {
 
-		private final String basicAuthUsername;
-		private final String basicAuthPassword;
+        private final String basicAuthUsername;
+        private final String basicAuthPassword;
 
-		BasicAuthHttpClientConfigCallback(String username, String password) {
-			this.basicAuthUsername = username;
-			this.basicAuthPassword = password;
-		}
+        BasicAuthHttpClientConfigCallback(String username, String password) {
+            this.basicAuthUsername = username;
+            this.basicAuthPassword = password;
+        }
 
-		@Override
-		public HttpAsyncClientBuilder customizeHttpClient(HttpAsyncClientBuilder httpClientBuilder) {
-			if (basicAuthPassword == null || basicAuthUsername == null) {
-				return httpClientBuilder;
-			}
-			final CredentialsProvider credentialsProvider = new BasicCredentialsProvider();
-			credentialsProvider.setCredentials(AuthScope.ANY,
-					new UsernamePasswordCredentials(basicAuthUsername, basicAuthPassword));
+        @Override
+        public HttpAsyncClientBuilder customizeHttpClient(HttpAsyncClientBuilder httpClientBuilder) {
+            if (basicAuthPassword == null || basicAuthUsername == null) {
+                return httpClientBuilder;
+            }
+            final CredentialsProvider credentialsProvider = new BasicCredentialsProvider();
+            credentialsProvider.setCredentials(AuthScope.ANY,
+                    new UsernamePasswordCredentials(basicAuthUsername, basicAuthPassword));
 
-			return httpClientBuilder.setDefaultCredentialsProvider(credentialsProvider);
-		}
+            return httpClientBuilder.setDefaultCredentialsProvider(credentialsProvider);
+        }
 
-	}
-//	private class SSLCercAuthHttpClientConfigCallback implements HttpClientConfigCallback {
+    }
+//    private class SSLCercAuthHttpClientConfigCallback implements HttpClientConfigCallback {
 //
-//		private final String certFilename;
+//        private final String certFilename;
 //
-//		SSLCercAuthHttpClientConfigCallback(String certfile) {
-//			this.certFilename = certfile;
-//		}
+//        SSLCercAuthHttpClientConfigCallback(String certfile) {
+//            this.certFilename = certfile;
+//        }
 //
-//		@Override
-//		public HttpAsyncClientBuilder customizeHttpClient(HttpAsyncClientBuilder httpClientBuilder) {
-//			if (this.certFilename == null) {
-//				return httpClientBuilder;
-//			}
+//        @Override
+//        public HttpAsyncClientBuilder customizeHttpClient(HttpAsyncClientBuilder httpClientBuilder) {
+//            if (this.certFilename == null) {
+//                return httpClientBuilder;
+//            }
 //
-//			char[] keystorePass = "MY PASSWORD".toCharArray();
+//            char[] keystorePass = "MY PASSWORD".toCharArray();
 //
-//			FileInputStream fis = null;
+//            FileInputStream fis = null;
 //
-//			// Loading KEYSTORE in JKS format
-//			KeyStore keyStorePci = null;
-//			try {
-//				keyStorePci = KeyStore.getInstance(KeyStore.getDefaultType());
-//			} catch (KeyStoreException e1) {
-//				LOG.warn("unable to load keystore: {}",e1);
-//			}
-//			if (keyStorePci != null) {
-//				try {
-//					fis = new FileInputStream(this.certFilename);
-//					keyStorePci.load(fis, keystorePass);
-//				} catch (Exception e) {
-//					LOG.error("Error loading keystore: " + this.certFilename);
-//				} finally {
-//					if (fis != null) {
-//						try {
-//							fis.close();
-//						} catch (IOException e) {
+//            // Loading KEYSTORE in JKS format
+//            KeyStore keyStorePci = null;
+//            try {
+//                keyStorePci = KeyStore.getInstance(KeyStore.getDefaultType());
+//            } catch (KeyStoreException e1) {
+//                LOG.warn("unable to load keystore: {}",e1);
+//            }
+//            if (keyStorePci != null) {
+//                try {
+//                    fis = new FileInputStream(this.certFilename);
+//                    keyStorePci.load(fis, keystorePass);
+//                } catch (Exception e) {
+//                    LOG.error("Error loading keystore: " + this.certFilename);
+//                } finally {
+//                    if (fis != null) {
+//                        try {
+//                            fis.close();
+//                        } catch (IOException e) {
 //
-//						}
-//					}
-//				}
-//			}
-//			SSLContext sslcontext=null;
-//			try {
-//				sslcontext = SSLContexts.custom().loadKeyMaterial(keyStorePci, keystorePass).build();
-//			} catch (KeyManagementException | UnrecoverableKeyException | NoSuchAlgorithmException
-//					| KeyStoreException e) {
-//				LOG.warn("unable to load sslcontext: {}",e);
-//			}
-//			return httpClientBuilder.setSSLContext(sslcontext);
-//		}
-//	}
+//                        }
+//                    }
+//                }
+//            }
+//            SSLContext sslcontext=null;
+//            try {
+//                sslcontext = SSLContexts.custom().loadKeyMaterial(keyStorePci, keystorePass).build();
+//            } catch (KeyManagementException | UnrecoverableKeyException | NoSuchAlgorithmException
+//                    | KeyStoreException e) {
+//                LOG.warn("unable to load sslcontext: {}",e);
+//            }
+//            return httpClientBuilder.setSSLContext(sslcontext);
+//        }
+//    }
 
-	private RestClient client;
+    private final RestClient client;
 
-	protected ExtRestClient(HostInfo[] hosts) {
-		this(hosts, null, null);
-	}
-	protected ExtRestClient(HostInfo[] hosts,String username,String password) {
-		this.client = RestClient.builder(get(hosts)).setHttpClientConfigCallback(new BasicAuthHttpClientConfigCallback(username, password) ).build();
-	}
+    protected ExtRestClient(HostInfo[] hosts) {
+        this(hosts, null, null);
+    }
+    protected ExtRestClient(HostInfo[] hosts,String username,String password) {
+        this.client = RestClient.builder(get(hosts)).setHttpClientConfigCallback(new BasicAuthHttpClientConfigCallback(username, password) ).build();
+    }
 
-	public ClusterHealthResponse health(ClusterHealthRequest request)
-			throws UnsupportedOperationException, IOException, JSONException {
-		return new ClusterHealthResponse(this.client.performRequest(request.getInner()));
-	}
+    public ClusterHealthResponse health(ClusterHealthRequest request)
+            throws UnsupportedOperationException, IOException, JSONException {
+        return new ClusterHealthResponse(this.client.performRequest(request.getInner()));
+    }
 
-	public void close() throws IOException {
-		this.client.close();
-		
-	}
-	//
-	public boolean indicesExists(GetIndexRequest request) throws IOException {
-		Response response = this.client.performRequest(request.getInner());
-		return response.getStatusLine().getStatusCode()==200;
-	}
+    public void close() throws IOException {
+        this.client.close();
 
-	public AcknowledgedResponse updateAliases(IndicesAliasesRequest request) throws IOException{
-		return new AcknowledgedResponse(this.client.performRequest(request.getInner()));
-	}
+    }
+    //
+    public boolean indicesExists(GetIndexRequest request) throws IOException {
+        Response response = this.client.performRequest(request.getInner());
+        return response.getStatusLine().getStatusCode()==200;
+    }
 
-	public CreateIndexResponse createIndex(CreateIndexRequest request) throws IOException {
-		CreateIndexResponse response = new CreateIndexResponse(this.client.performRequest(request.getInner()));
-		return response;
-	}
-	public DeleteIndexResponse deleteIndex(DeleteIndexRequest request) throws IOException {
-		return new DeleteIndexResponse(this.client.performRequest(request.getInner()));
-	}
-	public IndexResponse index(IndexRequest request) throws IOException{
-		return new IndexResponse(this.client.performRequest(request.getInner()));
-	}
+    public AcknowledgedResponse updateAliases(IndicesAliasesRequest request) throws IOException{
+        return new AcknowledgedResponse(this.client.performRequest(request.getInner()));
+    }
 
-	public DeleteResponse delete(DeleteRequest request) throws IOException{
-		Response response=null;
-		try {
-			 response = this.client.performRequest(request.getInner());
-		}
-		catch(ResponseException e) {
-			new DeleteResponse(e.getResponse());
-		}
-		return new DeleteResponse(response);
+    public CreateIndexResponse createIndex(CreateIndexRequest request) throws IOException {
+        return new CreateIndexResponse(this.client.performRequest(request.getInner()));
+    }
+    public CreateAliasResponse createAlias(CreateAliasRequest request) throws IOException {
+		return new CreateAliasResponse(this.client.performRequest(request.getInner()));
 	}
-	public DeleteByQueryResponse deleteByQuery(DeleteByQueryRequest request) throws IOException {
-		Response response=null;
-		try {
-			 response = this.client.performRequest(request.getInner());
-		}
-		catch(ResponseException e) {
-			new DeleteResponse(e.getResponse());
-		}
-		return new DeleteByQueryResponse(response);
+    public DeleteAliasResponse deleteAlias(DeleteAliasRequest request) throws IOException {
+		return new DeleteAliasResponse(this.client.performRequest(request.getInner()));
 	}
-	public SearchResponse search(SearchRequest request) throws IOException{
-		return this.search(request,false);
-	}
+    public DeleteIndexResponse deleteIndex(DeleteIndexRequest request) throws IOException {
+        return new DeleteIndexResponse(this.client.performRequest(request.getInner()));
+    }
+    public IndexResponse index(IndexRequest request) throws IOException{
+        return new IndexResponse(this.client.performRequest(request.getInner()));
+    }
 
-	/**
-	 * 
-	 * @param request
-	 * @param ignoreParseException especially for usercreated filters which may cause ES server response exceptions
-	 * @return
-	 * @throws IOException
-	 */
-	public SearchResponse search(SearchRequest request, boolean ignoreParseException) throws IOException {
-		if (ignoreParseException) {
-			try {
-				return new SearchResponse(this.client.performRequest(request.getInner()));
-			} catch (ResponseException e) {
-				LOG.debug("ignoring Exception for request {}: {}",request,e.getMessage());
-				return new SearchResponse(e.getResponse());
-			}
-		} else {
-			return new SearchResponse(this.client.performRequest(request.getInner()));
-		}
-	}
+    public DeleteResponse delete(DeleteRequest request) throws IOException{
+        Response response=null;
+        try {
+             response = this.client.performRequest(request.getInner());
+        }
+        catch(ResponseException e) {
+            new DeleteResponse(e.getResponse());
+        }
+        return new DeleteResponse(response);
+    }
+    public DeleteByQueryResponse deleteByQuery(DeleteByQueryRequest request) throws IOException {
+        Response response=null;
+        try {
+             response = this.client.performRequest(request.getInner());
+        }
+        catch(ResponseException e) {
+            new DeleteResponse(e.getResponse());
+        }
+        return new DeleteByQueryResponse(response);
+    }
+    public SearchResponse search(SearchRequest request) throws IOException{
+        return this.search(request,false);
+    }
 
-	public GetResponse get(GetRequest request) throws IOException{
-		try {
-			return new GetResponse(this.client.performRequest(request.getInner()));
-		}
-		catch (ResponseException e) {
-			return new GetResponse(e.getResponse());
-		}
-	}
-	
+    /**
+     * Search for database entries
+     * @param request inputRequest
+     * @param ignoreParseException especially for usercreated filters which may cause ES server response exceptions
+     * @return Response with related entries
+     * @throws IOException of client
+     */
+    public SearchResponse search(SearchRequest request, boolean ignoreParseException) throws IOException {
+        if (ignoreParseException) {
+            try {
+                return new SearchResponse(this.client.performRequest(request.getInner()));
+            } catch (ResponseException e) {
+                LOG.debug("ignoring Exception for request {}: {}",request,e.getMessage());
+                return new SearchResponse(e.getResponse());
+            }
+        } else {
+            return new SearchResponse(this.client.performRequest(request.getInner()));
+        }
+    }
 
-	public UpdateByQueryResponse update(UpdateByQueryRequest request) throws IOException {
-		return new UpdateByQueryResponse(this.client.performRequest(request.getInner()));
-		
-	}
-	public UpdateResponse update(UpdateRequest request) throws IOException {
-		return new UpdateResponse(this.client.performRequest(request.getInner()));
-		
-	}
-	public RefreshIndexResponse refreshIndex(RefreshIndexRequest request) throws IOException{
-		return new RefreshIndexResponse(this.client.performRequest(request.getInner()));
-	}
-	
-	public NodeStatsResponse stats(NodeStatsRequest request) throws IOException{
-		return new NodeStatsResponse(this.client.performRequest(request.getInner()));
-	}
-	
-	public boolean waitForYellowStatus(long timeoutms) {
-	
-		ClusterHealthRequest request = new ClusterHealthRequest();
-		request.timeout(timeoutms/1000);
-		ClusterHealthResponse response = null;
-		String status="";
-		try {
-			response = this.health(request);
+    public GetResponse get(GetRequest request) throws IOException{
+        try {
+            return new GetResponse(this.client.performRequest(request.getInner()));
+        }
+        catch (ResponseException e) {
+            return new GetResponse(e.getResponse());
+        }
+    }
 
-		} catch (UnsupportedOperationException | IOException | JSONException e) {
-			LOG.error(e.getMessage());
-		}
-		if(response!=null) {
-			status=response.getStatus();
-			LOG.debug("Elasticsearch service started with status {}", response.getStatus());
 
-		}
-		else {
-			LOG.warn("Elasticsearch service not started yet with status {}. current status is {}",status,"none");
-			return false;
-		}
-		return response.isStatusMinimal(ClusterHealthResponse.HEALTHSTATUS_YELLOW);
+    public UpdateByQueryResponse update(UpdateByQueryRequest request) throws IOException {
+        return new UpdateByQueryResponse(this.client.performRequest(request.getInner()));
 
-	}
-	
-	private static HttpHost[] get(HostInfo[] hosts) {
-		HttpHost[] httphosts = new HttpHost[hosts.length];
-		for(int i=0;i<hosts.length;i++) {
-			httphosts[i]=new HttpHost(hosts[i].hostname, hosts[i].port, hosts[i].protocol.toString());
-		}
-		return httphosts;
-	}
-	public static ExtRestClient createInstance(HostInfo[] hosts) {
-		return new ExtRestClient(hosts);
-	}
-	public static ExtRestClient createInstance(HostInfo[] hosts,String username,String password) {
-		return new ExtRestClient(hosts,username,password);
-	}
-	public static ExtRestClient createInstance(String hostname, int port, Protocol protocol){
-		return createInstance(new HostInfo[] {new HostInfo(hostname,port,protocol)});
+    }
+    public UpdateResponse update(UpdateRequest request) throws IOException {
+        return new UpdateResponse(this.client.performRequest(request.getInner()));
 
-	}
-	
+    }
+    public RefreshIndexResponse refreshIndex(RefreshIndexRequest request) throws IOException{
+        return new RefreshIndexResponse(this.client.performRequest(request.getInner()));
+    }
+
+    public NodeStatsResponse stats(NodeStatsRequest request) throws IOException{
+        return new NodeStatsResponse(this.client.performRequest(request.getInner()));
+    }
+    public ListIndicesResponse getIndices() throws ParseException, IOException {
+    	return new ListIndicesResponse(this.client.performRequest(new ListIndicesRequest().getInner()));
+    }
+    public ListAliasesResponse getAliases() throws ParseException, IOException {
+    	return new ListAliasesResponse(this.client.performRequest(new ListAliasesRequest().getInner()));
+    }
+    public GetInfoResponse getInfo() throws IOException, Exception {
+    	return new GetInfoResponse(this.client.performRequest(new GetInfoRequest().getInner()));
+    }
+    public boolean waitForYellowStatus(long timeoutms) {
+
+        ClusterHealthRequest request = new ClusterHealthRequest();
+        request.timeout(timeoutms/1000);
+        ClusterHealthResponse response = null;
+        String status="";
+        try {
+            response = this.health(request);
+
+        } catch (UnsupportedOperationException | IOException | JSONException e) {
+            LOG.error(e.getMessage());
+        }
+        if(response!=null) {
+            status=response.getStatus();
+            LOG.debug("Elasticsearch service started with status {}", response.getStatus());
+
+        }
+        else {
+            LOG.warn("Elasticsearch service not started yet with status {}. current status is {}",status,"none");
+            return false;
+        }
+        return response.isStatusMinimal(ClusterHealthResponse.HEALTHSTATUS_YELLOW);
+
+    }
+
+    private static HttpHost[] get(HostInfo[] hosts) {
+        HttpHost[] httphosts = new HttpHost[hosts.length];
+        for(int i=0;i<hosts.length;i++) {
+            httphosts[i]=new HttpHost(hosts[i].hostname, hosts[i].port, hosts[i].protocol.toString());
+        }
+        return httphosts;
+    }
+    public static ExtRestClient createInstance(HostInfo[] hosts) {
+        return new ExtRestClient(hosts);
+    }
+    public static ExtRestClient createInstance(HostInfo[] hosts,String username,String password) {
+        return new ExtRestClient(hosts,username,password);
+    }
+    public static ExtRestClient createInstance(String hostname, int port, Protocol protocol){
+        return createInstance(new HostInfo[] {new HostInfo(hostname,port,protocol)});
+
+    }
+
 
 }
diff --git a/sdnr/wt/common/src/main/java/org/onap/ccsdk/features/sdnr/wt/common/database/HtDatabaseClient.java b/sdnr/wt/common/src/main/java/org/onap/ccsdk/features/sdnr/wt/common/database/HtDatabaseClient.java
index 9a04f0d..d64f7cc 100644
--- a/sdnr/wt/common/src/main/java/org/onap/ccsdk/features/sdnr/wt/common/database/HtDatabaseClient.java
+++ b/sdnr/wt/common/src/main/java/org/onap/ccsdk/features/sdnr/wt/common/database/HtDatabaseClient.java
@@ -26,6 +26,7 @@
 import org.onap.ccsdk.features.sdnr.wt.common.database.config.HostInfo;
 import org.onap.ccsdk.features.sdnr.wt.common.database.queries.QueryBuilder;
 import org.onap.ccsdk.features.sdnr.wt.common.database.queries.QueryBuilders;
+import org.onap.ccsdk.features.sdnr.wt.common.database.requests.CreateAliasRequest;
 import org.onap.ccsdk.features.sdnr.wt.common.database.requests.DeleteByQueryRequest;
 import org.onap.ccsdk.features.sdnr.wt.common.database.requests.DeleteRequest;
 import org.onap.ccsdk.features.sdnr.wt.common.database.requests.GetIndexRequest;
@@ -35,6 +36,7 @@
 import org.onap.ccsdk.features.sdnr.wt.common.database.requests.SearchRequest;
 import org.onap.ccsdk.features.sdnr.wt.common.database.requests.UpdateByQueryRequest;
 import org.onap.ccsdk.features.sdnr.wt.common.database.requests.UpdateRequest;
+import org.onap.ccsdk.features.sdnr.wt.common.database.responses.CreateIndexResponse;
 import org.onap.ccsdk.features.sdnr.wt.common.database.responses.DeleteByQueryResponse;
 import org.onap.ccsdk.features.sdnr.wt.common.database.responses.DeleteResponse;
 import org.onap.ccsdk.features.sdnr.wt.common.database.responses.GetResponse;
@@ -293,5 +295,5 @@
 		}
 		return del;
 	}
-
+	
 }
diff --git a/sdnr/wt/common/src/main/java/org/onap/ccsdk/features/sdnr/wt/common/database/SearchHit.java b/sdnr/wt/common/src/main/java/org/onap/ccsdk/features/sdnr/wt/common/database/SearchHit.java
index b6df262..020dd2b 100644
--- a/sdnr/wt/common/src/main/java/org/onap/ccsdk/features/sdnr/wt/common/database/SearchHit.java
+++ b/sdnr/wt/common/src/main/java/org/onap/ccsdk/features/sdnr/wt/common/database/SearchHit.java
@@ -21,42 +21,38 @@
 
 public class SearchHit {
 
-	private final String index;
-	private final String type;
-	private final String id;
-	private final JSONObject source;
-	private final JSONObject raw;
+    private final String index;
+    private final String type;
+    private final String id;
+    private final JSONObject source;
+    private final JSONObject raw;
 
-	public SearchHit(JSONObject o) {
-		this.raw = o;
-		this.index=o.getString("_index");
-		this.type = o.getString("_type");
-		this.id = o.getString("_id");
-		this.source = o.getJSONObject("_source");
-	}
-	
-	public String getIndex() {
-		return this.index;
-	}
-	public String getType() {
-		return this.type;
-	}
-	public String getId() {
-		return this.id;
-	}
+    public SearchHit(JSONObject o) {
+        this.raw = o;
+        this.index=o.getString("_index");
+        this.type = o.getString("_type");
+        this.id = o.getString("_id");
+        this.source = o.getJSONObject("_source");
+    }
 
-	public JSONObject getSource() {
-		return this.source;
-	}
-	public String getSourceAsString() {
-		return this.source.toString();
-	}
+    public String getIndex() {
+        return this.index;
+    }
+    public String getType() {
+        return this.type;
+    }
+    public String getId() {
+        return this.id;
+    }
 
-	/**
-	 * @return
-	 */
-	public JSONObject getRaw() {
-		return this.raw;
-	}
+    public JSONObject getSource() {
+        return this.source;
+    }
+    public String getSourceAsString() {
+        return this.source.toString();
+    }
+    public JSONObject getRaw() {
+        return this.raw;
+    }
 
 }
diff --git a/sdnr/wt/common/src/main/java/org/onap/ccsdk/features/sdnr/wt/common/database/config/HostInfo.java b/sdnr/wt/common/src/main/java/org/onap/ccsdk/features/sdnr/wt/common/database/config/HostInfo.java
index 11554b5..2b4172d 100644
--- a/sdnr/wt/common/src/main/java/org/onap/ccsdk/features/sdnr/wt/common/database/config/HostInfo.java
+++ b/sdnr/wt/common/src/main/java/org/onap/ccsdk/features/sdnr/wt/common/database/config/HostInfo.java
@@ -17,6 +17,10 @@
  ******************************************************************************/
 package org.onap.ccsdk.features.sdnr.wt.common.database.config;
 
+import java.text.ParseException;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
 public class HostInfo {
 
 	public enum Protocol{
@@ -75,4 +79,24 @@
 	public static HostInfo getDefault() {
 		return new HostInfo("localhost",9200,Protocol.HTTP);
 	}
+
+	/**
+	 * @param dbUrl
+	 * @return
+	 */
+	public static HostInfo parse(String dbUrl) throws ParseException{
+		final String regex = "^(https?):\\/\\/([^:]*):?([0-9]{0,5})$";
+		final Pattern pattern = Pattern.compile(regex);
+		final Matcher matcher = pattern.matcher(dbUrl);
+		if(!matcher.find() || matcher.groupCount()<2) {
+			throw new ParseException("url "+dbUrl+" not parseable", 0);
+		}
+		Protocol p = Protocol.getValueOf(matcher.group(1));
+		String host = matcher.group(2);
+		int port = p==Protocol.HTTP?80:443;
+		if(matcher.groupCount()>2) {
+			port=Integer.parseInt(matcher.group(3));
+		}
+		return new HostInfo(host,port,p);
+	}
 }
diff --git a/sdnr/wt/common/src/main/java/org/onap/ccsdk/features/sdnr/wt/common/database/data/AliasesEntry.java b/sdnr/wt/common/src/main/java/org/onap/ccsdk/features/sdnr/wt/common/database/data/AliasesEntry.java
new file mode 100644
index 0000000..73d50db
--- /dev/null
+++ b/sdnr/wt/common/src/main/java/org/onap/ccsdk/features/sdnr/wt/common/database/data/AliasesEntry.java
@@ -0,0 +1,49 @@
+/*******************************************************************************
+ * ============LICENSE_START========================================================================
+ * ONAP : ccsdk feature sdnr wt
+ * =================================================================================================
+ * Copyright (C) 2020 highstreet technologies GmbH Intellectual Property. All rights reserved.
+ * =================================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
+ * in compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
+ * or implied. See the License for the specific language governing permissions and limitations under
+ * the License.
+ * ============LICENSE_END==========================================================================
+ ******************************************************************************/
+package org.onap.ccsdk.features.sdnr.wt.common.database.data;
+
+import java.text.ParseException;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+/**
+ * @author Michael Dürre
+ *
+ */
+public class AliasesEntry {
+	private static final String regex = "^([^\\ ]+)[\\ ]+([^\\ ]+)[\\ ]+.*$";
+	private static final Pattern pattern = Pattern.compile(regex, Pattern.MULTILINE);
+
+	
+	public String getAlias() {
+		return alias;
+	}
+	public String getIndex() {
+		return index;
+	}
+	private final String alias;
+	private final String index;
+	public AliasesEntry(String line) throws ParseException {
+		final Matcher matcher = pattern.matcher(line);
+		if (!matcher.find() || matcher.groupCount() < 2) {
+			throw new ParseException("unable to parse string:" + line, 0);
+		}
+		this.alias = matcher.group(1);
+		this.index = matcher.group(2);
+	}
+}
diff --git a/sdnr/wt/common/src/main/java/org/onap/ccsdk/features/sdnr/wt/common/database/responses/CountResponse.java b/sdnr/wt/common/src/main/java/org/onap/ccsdk/features/sdnr/wt/common/database/data/AliasesEntryList.java
similarity index 69%
copy from sdnr/wt/common/src/main/java/org/onap/ccsdk/features/sdnr/wt/common/database/responses/CountResponse.java
copy to sdnr/wt/common/src/main/java/org/onap/ccsdk/features/sdnr/wt/common/database/data/AliasesEntryList.java
index 429c339..a3a8e72 100644
--- a/sdnr/wt/common/src/main/java/org/onap/ccsdk/features/sdnr/wt/common/database/responses/CountResponse.java
+++ b/sdnr/wt/common/src/main/java/org/onap/ccsdk/features/sdnr/wt/common/database/data/AliasesEntryList.java
@@ -2,7 +2,7 @@
  * ============LICENSE_START========================================================================
  * ONAP : ccsdk feature sdnr wt
  * =================================================================================================
- * Copyright (C) 2019 highstreet technologies GmbH Intellectual Property. All rights reserved.
+ * Copyright (C) 2020 highstreet technologies GmbH Intellectual Property. All rights reserved.
  * =================================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
  * in compliance with the License. You may obtain a copy of the License at
@@ -15,16 +15,32 @@
  * the License.
  * ============LICENSE_END==========================================================================
  ******************************************************************************/
-package org.onap.ccsdk.features.sdnr.wt.common.database.responses;
+package org.onap.ccsdk.features.sdnr.wt.common.database.data;
 
-import org.elasticsearch.client.Response;
+import java.util.ArrayList;
 
-public class CountResponse extends BaseResponse {
+/**
+ * @author Michael Dürre
+ *
+ */
+public class AliasesEntryList extends ArrayList<AliasesEntry>{
 
-	private long count;
-	
-	public CountResponse(Response response) {
-		super(response);
-		
+	/**
+	 * 
+	 */
+	private static final long serialVersionUID = 1L;
+
+	/**
+	 * @param alias
+	 * @return
+	 */
+	public AliasesEntry findByAlias(String alias) {
+		for(AliasesEntry e:this) {
+			if(e.getAlias().equals(alias)) {
+				return e;
+			}
+		}
+		return null;
 	}
+
 }
diff --git a/sdnr/wt/common/src/main/java/org/onap/ccsdk/features/sdnr/wt/common/database/data/EsVersion.java b/sdnr/wt/common/src/main/java/org/onap/ccsdk/features/sdnr/wt/common/database/data/EsVersion.java
new file mode 100644
index 0000000..8d52691
--- /dev/null
+++ b/sdnr/wt/common/src/main/java/org/onap/ccsdk/features/sdnr/wt/common/database/data/EsVersion.java
@@ -0,0 +1,135 @@
+/*******************************************************************************
+ * ============LICENSE_START========================================================================
+ * ONAP : ccsdk feature sdnr wt
+ * =================================================================================================
+ * Copyright (C) 2020 highstreet technologies GmbH Intellectual Property. All rights reserved.
+ * =================================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
+ * in compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
+ * or implied. See the License for the specific language governing permissions and limitations under
+ * the License.
+ * ============LICENSE_END==========================================================================
+ ******************************************************************************/
+package org.onap.ccsdk.features.sdnr.wt.common.database.data;
+
+import java.text.ParseException;
+
+import org.eclipse.jdt.annotation.NonNull;
+
+
+/**
+ * @author Michael Dürre
+ *
+ */
+public class EsVersion {
+	
+	private final String raw;
+	private final int major;
+	private final int minor;
+	private final int revision;
+	
+	public EsVersion(@NonNull String version) throws ParseException {
+		String[] hlp=version.split("\\.");
+		if(hlp.length<3) {
+			throw new ParseException("unable to parse version string: "+version, 0);
+		}
+		this.raw = version;
+		this.major = Integer.parseInt(hlp[0]);
+		this.minor = Integer.parseInt(hlp[1]);
+		this.revision = Integer.parseInt(hlp[2]);
+	}
+
+	/**
+	 * @param major
+	 * @param minor
+	 * @param revision
+	 */
+	public EsVersion(int major, int minor, int revision) {
+		this.raw = String.format("%d.%d.%d", major,minor,revision);
+		this.major = major;
+		this.minor = minor;
+		this.revision = revision;
+	}
+
+	/**
+	 * @return the revision
+	 */
+	public int getRevision() {
+		return revision;
+	}
+
+	/**
+	 * @return the minor
+	 */
+	public int getMinor() {
+		return minor;
+	}
+
+	/**
+	 * @return the major
+	 */
+	public int getMajor() {
+		return major;
+	}
+
+	@Override
+	public boolean equals(Object obj) {
+		if(!(obj instanceof EsVersion)) {
+			return false;
+		}
+		EsVersion esobj = (EsVersion)obj;
+		return this.major==esobj.major && this.minor==esobj.minor && this.revision==esobj.revision;
+	}
+	@Override
+	public int hashCode() {
+		return this.raw.hashCode();
+	}
+	public boolean isNewerOrEqualThan(EsVersion v) {
+		if(this.equals(v)) {
+			return true;
+		}
+		if(this.major>v.major) {
+			return true;
+		}
+		else if(this.major<v.major) {
+			return false;
+		}
+		if(this.minor>v.minor) {
+			return true;
+		}
+		else if(this.minor<v.minor) {
+			return false;
+		}
+		if(this.revision>v.revision) {
+			return true;
+		}
+		return false;
+	}
+	public boolean isOlderOrEqualThan(EsVersion v) {
+		if(this.equals(v)) {
+			return true;
+		}
+		if(this.major<v.major) {
+			return true;
+		}
+		else if(this.major>v.major) {
+			return false;
+		}
+		if(this.minor<v.minor) {
+			return true;
+		}
+		else if(this.minor>v.minor) {
+			return false;
+		}
+		if(this.revision<v.revision) {
+			return true;
+		}
+		return false;
+	}
+	
+}
diff --git a/sdnr/wt/common/src/main/java/org/onap/ccsdk/features/sdnr/wt/common/database/data/IndicesEntry.java b/sdnr/wt/common/src/main/java/org/onap/ccsdk/features/sdnr/wt/common/database/data/IndicesEntry.java
new file mode 100644
index 0000000..760f9ff
--- /dev/null
+++ b/sdnr/wt/common/src/main/java/org/onap/ccsdk/features/sdnr/wt/common/database/data/IndicesEntry.java
@@ -0,0 +1,104 @@
+/*******************************************************************************
+ * ============LICENSE_START========================================================================
+ * ONAP : ccsdk feature sdnr wt
+ * =================================================================================================
+ * Copyright (C) 2020 highstreet technologies GmbH Intellectual Property. All rights reserved.
+ * =================================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
+ * in compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
+ * or implied. See the License for the specific language governing permissions and limitations under
+ * the License.
+ * ============LICENSE_END==========================================================================
+ ******************************************************************************/
+package org.onap.ccsdk.features.sdnr.wt.common.database.data;
+
+import java.text.ParseException;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+/**
+ * @author Michael Dürre
+ *
+ *  Entry of list indices http request (/_cat/indices)
+ *   
+ *  yellow open inventoryequipment-v1         5nNPRbJ3T9arMxqxBbJKyQ 5 1 0 0 1.2kb 1.2kb
+ */
+public class IndicesEntry {
+
+	private static final String regex = "^(yellow|red|green)[\\ ]+([^\\ ]*)[\\ ]+([^\\ ]*)[\\ ]+([^\\ ]*)[\\ ]+([0-9]+)[\\ ]+([0-9]+)[\\ ]+([0-9]+)[\\ ]+([0-9]+)[\\ ]+([^\\ ]+)[\\ ]+([^\\ ]+)$";
+	private static final Pattern pattern = Pattern.compile(regex, Pattern.MULTILINE);
+	
+	private final String status;
+	private final String status2;
+	private final String name;
+	private final String hash;
+	private final int shards;
+	private final int replicas;
+	private final int c1;
+	private final int c2;
+	private final String size1;
+	private final String size2;
+
+	public String getStatus() {
+		return status;
+	}
+
+	public String getStatus2() {
+		return status2;
+	}
+
+	public String getName() {
+		return name;
+	}
+
+	public String getHash() {
+		return hash;
+	}
+
+	public int getShards() {
+		return shards;
+	}
+
+	public int getReplicas() {
+		return replicas;
+	}
+
+	public int getC1() {
+		return c1;
+	}
+
+	public int getC2() {
+		return c2;
+	}
+
+	public String getSize1() {
+		return size1;
+	}
+
+	public String getSize2() {
+		return size2;
+	}
+
+	public IndicesEntry(String line) throws ParseException {
+		final Matcher matcher = pattern.matcher(line);
+		if(!matcher.find() || matcher.groupCount()<10) {
+			throw new ParseException("unable to parse string:" +line,0);
+		}
+		this.status = matcher.group(1);
+		this.status2 = matcher.group(2);
+		this.name = matcher.group(3);
+		this.hash = matcher.group(4);
+		this.shards = Integer.parseInt(matcher.group(5));
+		this.replicas = Integer.parseInt(matcher.group(6));
+		this.c1 = Integer.parseInt(matcher.group(7));
+		this.c2 = Integer.parseInt(matcher.group(8));
+		this.size1 = matcher.group(9);
+		this.size2 = matcher.group(10);
+		
+	}
+}
diff --git a/sdnr/wt/common/src/main/java/org/onap/ccsdk/features/sdnr/wt/common/database/responses/CountResponse.java b/sdnr/wt/common/src/main/java/org/onap/ccsdk/features/sdnr/wt/common/database/data/IndicesEntryList.java
similarity index 69%
copy from sdnr/wt/common/src/main/java/org/onap/ccsdk/features/sdnr/wt/common/database/responses/CountResponse.java
copy to sdnr/wt/common/src/main/java/org/onap/ccsdk/features/sdnr/wt/common/database/data/IndicesEntryList.java
index 429c339..0931b44 100644
--- a/sdnr/wt/common/src/main/java/org/onap/ccsdk/features/sdnr/wt/common/database/responses/CountResponse.java
+++ b/sdnr/wt/common/src/main/java/org/onap/ccsdk/features/sdnr/wt/common/database/data/IndicesEntryList.java
@@ -2,7 +2,7 @@
  * ============LICENSE_START========================================================================
  * ONAP : ccsdk feature sdnr wt
  * =================================================================================================
- * Copyright (C) 2019 highstreet technologies GmbH Intellectual Property. All rights reserved.
+ * Copyright (C) 2020 highstreet technologies GmbH Intellectual Property. All rights reserved.
  * =================================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
  * in compliance with the License. You may obtain a copy of the License at
@@ -15,16 +15,32 @@
  * the License.
  * ============LICENSE_END==========================================================================
  ******************************************************************************/
-package org.onap.ccsdk.features.sdnr.wt.common.database.responses;
+package org.onap.ccsdk.features.sdnr.wt.common.database.data;
 
-import org.elasticsearch.client.Response;
+import java.util.ArrayList;
 
-public class CountResponse extends BaseResponse {
+/**
+ * @author Michael Dürre
+ *
+ */
+public class IndicesEntryList extends ArrayList<IndicesEntry>{
 
-	private long count;
-	
-	public CountResponse(Response response) {
-		super(response);
-		
+	/**
+	 * 
+	 */
+	private static final long serialVersionUID = 1L;
+
+	/**
+	 * @param index
+	 * @return
+	 */
+	public IndicesEntry findByIndex(String index) {
+		for(IndicesEntry e:this) {
+			if(e.getName().equals(index)) {
+				return e;
+			}
+		}
+		return null;
 	}
+
 }
diff --git a/sdnr/wt/common/src/main/java/org/onap/ccsdk/features/sdnr/wt/common/database/responses/CountResponse.java b/sdnr/wt/common/src/main/java/org/onap/ccsdk/features/sdnr/wt/common/database/requests/CreateAliasRequest.java
similarity index 77%
copy from sdnr/wt/common/src/main/java/org/onap/ccsdk/features/sdnr/wt/common/database/responses/CountResponse.java
copy to sdnr/wt/common/src/main/java/org/onap/ccsdk/features/sdnr/wt/common/database/requests/CreateAliasRequest.java
index 429c339..15132fd 100644
--- a/sdnr/wt/common/src/main/java/org/onap/ccsdk/features/sdnr/wt/common/database/responses/CountResponse.java
+++ b/sdnr/wt/common/src/main/java/org/onap/ccsdk/features/sdnr/wt/common/database/requests/CreateAliasRequest.java
@@ -15,16 +15,15 @@
  * the License.
  * ============LICENSE_END==========================================================================
  ******************************************************************************/
-package org.onap.ccsdk.features.sdnr.wt.common.database.responses;
+package org.onap.ccsdk.features.sdnr.wt.common.database.requests;
 
-import org.elasticsearch.client.Response;
+//https://github.com/elastic/elasticsearch/blob/6.4/rest-api-spec/src/main/resources/rest-api-spec/api/indices.put_alias.json
+public class CreateAliasRequest extends BaseRequest{
 
-public class CountResponse extends BaseResponse {
 
-	private long count;
-	
-	public CountResponse(Response response) {
-		super(response);
-		
-	}
+    public CreateAliasRequest(String index,String alias) {
+        super("PUT","/"+index+"/_alias/"+alias);
+    }
+
+
 }
diff --git a/sdnr/wt/common/src/main/java/org/onap/ccsdk/features/sdnr/wt/common/database/requests/CreateIndexRequest.java b/sdnr/wt/common/src/main/java/org/onap/ccsdk/features/sdnr/wt/common/database/requests/CreateIndexRequest.java
index c7e27ee..c08ee88 100644
--- a/sdnr/wt/common/src/main/java/org/onap/ccsdk/features/sdnr/wt/common/database/requests/CreateIndexRequest.java
+++ b/sdnr/wt/common/src/main/java/org/onap/ccsdk/features/sdnr/wt/common/database/requests/CreateIndexRequest.java
@@ -23,41 +23,42 @@
 //https://github.com/elastic/elasticsearch/blob/6.4/rest-api-spec/src/main/resources/rest-api-spec/api/indices.put_mapping.json
 public class CreateIndexRequest extends BaseRequest{
 
-	private JSONObject settings;
-	private JSONObject mappings;
+    private JSONObject settings;
+    private JSONObject mappings;
 
-	public CreateIndexRequest(String index) {
-		super("PUT","/"+index);
-		this.mappings=new JSONObject();
-	}
+    public CreateIndexRequest(String index) {
+        super("PUT","/"+index);
+        this.mappings=new JSONObject();
+    }
 
-	private void setRequest() {
-	
-		JSONObject o=new JSONObject();
-		if(this.mappings!=null) {
-			o.put("mappings", this.mappings);
-		}
-		if(this.settings!=null) {
-			o.put("settings", this.settings);
-		}
-		super.setQuery(o);
-	}
-	public void mappings(JSONObject mappings) {
-		this.mappings=mappings;
-		this.setRequest();
-	}
+    private void setRequest() {
 
-	public void settings(JSONObject settings) {
-		this.settings = settings;
-		this.setRequest();
-	}
+        JSONObject o=new JSONObject();
+        if(this.mappings!=null) {
+            o.put("mappings", this.mappings);
+        }
+        if(this.settings!=null) {
+            o.put("settings", this.settings);
+        }
+        super.setQuery(o);
+    }
+    @SuppressWarnings("hiding")
+    public void mappings(JSONObject mappings) {
+        this.mappings=mappings;
+        this.setRequest();
+    }
 
-	public boolean hasMappings() {
-		return this.mappings!=null;
-	}
+    public void settings(JSONObject settings) {
+        this.settings = settings;
+        this.setRequest();
+    }
 
-	public boolean hasSettings() {
-		return this.settings!=null;
-	}
+    public boolean hasMappings() {
+        return this.mappings!=null;
+    }
+
+    public boolean hasSettings() {
+        return this.settings!=null;
+    }
 
 }
diff --git a/sdnr/wt/common/src/main/java/org/onap/ccsdk/features/sdnr/wt/common/database/responses/CountResponse.java b/sdnr/wt/common/src/main/java/org/onap/ccsdk/features/sdnr/wt/common/database/requests/DeleteAliasRequest.java
similarity index 77%
copy from sdnr/wt/common/src/main/java/org/onap/ccsdk/features/sdnr/wt/common/database/responses/CountResponse.java
copy to sdnr/wt/common/src/main/java/org/onap/ccsdk/features/sdnr/wt/common/database/requests/DeleteAliasRequest.java
index 429c339..b3d8877 100644
--- a/sdnr/wt/common/src/main/java/org/onap/ccsdk/features/sdnr/wt/common/database/responses/CountResponse.java
+++ b/sdnr/wt/common/src/main/java/org/onap/ccsdk/features/sdnr/wt/common/database/requests/DeleteAliasRequest.java
@@ -15,16 +15,13 @@
  * the License.
  * ============LICENSE_END==========================================================================
  ******************************************************************************/
-package org.onap.ccsdk.features.sdnr.wt.common.database.responses;
+package org.onap.ccsdk.features.sdnr.wt.common.database.requests;
 
-import org.elasticsearch.client.Response;
+//https://github.com/elastic/elasticsearch/blob/6.4/rest-api-spec/src/main/resources/rest-api-spec/api/indices.delete_alias.json
+public class DeleteAliasRequest extends BaseRequest{
 
-public class CountResponse extends BaseResponse {
-
-	private long count;
-	
-	public CountResponse(Response response) {
-		super(response);
-		
+	public DeleteAliasRequest(String index,String alias) {
+		super("DELETE","/"+index+"/_alias/"+alias);
 	}
+
 }
diff --git a/sdnr/wt/common/src/main/java/org/onap/ccsdk/features/sdnr/wt/common/database/responses/CountResponse.java b/sdnr/wt/common/src/main/java/org/onap/ccsdk/features/sdnr/wt/common/database/requests/GetInfoRequest.java
similarity index 80%
copy from sdnr/wt/common/src/main/java/org/onap/ccsdk/features/sdnr/wt/common/database/responses/CountResponse.java
copy to sdnr/wt/common/src/main/java/org/onap/ccsdk/features/sdnr/wt/common/database/requests/GetInfoRequest.java
index 429c339..949444b 100644
--- a/sdnr/wt/common/src/main/java/org/onap/ccsdk/features/sdnr/wt/common/database/responses/CountResponse.java
+++ b/sdnr/wt/common/src/main/java/org/onap/ccsdk/features/sdnr/wt/common/database/requests/GetInfoRequest.java
@@ -15,16 +15,15 @@
  * the License.
  * ============LICENSE_END==========================================================================
  ******************************************************************************/
-package org.onap.ccsdk.features.sdnr.wt.common.database.responses;
+package org.onap.ccsdk.features.sdnr.wt.common.database.requests;
 
-import org.elasticsearch.client.Response;
+//https://github.com/elastic/elasticsearch/blob/6.4/rest-api-spec/src/main/resources/rest-api-spec/api/indices.exists.json
+public class GetInfoRequest extends BaseRequest {
 
-public class CountResponse extends BaseResponse {
-
-	private long count;
-	
-	public CountResponse(Response response) {
-		super(response);
-		
+	public GetInfoRequest() {
+		super("GET","/");
 	}
+
+	
+
 }
diff --git a/sdnr/wt/common/src/main/java/org/onap/ccsdk/features/sdnr/wt/common/database/responses/CountResponse.java b/sdnr/wt/common/src/main/java/org/onap/ccsdk/features/sdnr/wt/common/database/requests/ListAliasesRequest.java
similarity index 83%
copy from sdnr/wt/common/src/main/java/org/onap/ccsdk/features/sdnr/wt/common/database/responses/CountResponse.java
copy to sdnr/wt/common/src/main/java/org/onap/ccsdk/features/sdnr/wt/common/database/requests/ListAliasesRequest.java
index 429c339..b538291 100644
--- a/sdnr/wt/common/src/main/java/org/onap/ccsdk/features/sdnr/wt/common/database/responses/CountResponse.java
+++ b/sdnr/wt/common/src/main/java/org/onap/ccsdk/features/sdnr/wt/common/database/requests/ListAliasesRequest.java
@@ -15,16 +15,13 @@
  * the License.
  * ============LICENSE_END==========================================================================
  ******************************************************************************/
-package org.onap.ccsdk.features.sdnr.wt.common.database.responses;
+package org.onap.ccsdk.features.sdnr.wt.common.database.requests;
 
-import org.elasticsearch.client.Response;
+public class ListAliasesRequest extends BaseRequest{
 
-public class CountResponse extends BaseResponse {
-
-	private long count;
 	
-	public CountResponse(Response response) {
-		super(response);
-		
+	public ListAliasesRequest() {
+		super("GET","/_cat/aliases");
 	}
+
 }
diff --git a/sdnr/wt/common/src/main/java/org/onap/ccsdk/features/sdnr/wt/common/database/responses/CountResponse.java b/sdnr/wt/common/src/main/java/org/onap/ccsdk/features/sdnr/wt/common/database/requests/ListIndicesRequest.java
similarity index 83%
copy from sdnr/wt/common/src/main/java/org/onap/ccsdk/features/sdnr/wt/common/database/responses/CountResponse.java
copy to sdnr/wt/common/src/main/java/org/onap/ccsdk/features/sdnr/wt/common/database/requests/ListIndicesRequest.java
index 429c339..d8b7d5f 100644
--- a/sdnr/wt/common/src/main/java/org/onap/ccsdk/features/sdnr/wt/common/database/responses/CountResponse.java
+++ b/sdnr/wt/common/src/main/java/org/onap/ccsdk/features/sdnr/wt/common/database/requests/ListIndicesRequest.java
@@ -15,16 +15,13 @@
  * the License.
  * ============LICENSE_END==========================================================================
  ******************************************************************************/
-package org.onap.ccsdk.features.sdnr.wt.common.database.responses;
+package org.onap.ccsdk.features.sdnr.wt.common.database.requests;
 
-import org.elasticsearch.client.Response;
+public class ListIndicesRequest extends BaseRequest{
 
-public class CountResponse extends BaseResponse {
-
-	private long count;
 	
-	public CountResponse(Response response) {
-		super(response);
-		
+	public ListIndicesRequest() {
+		super("GET","/_cat/indices");
 	}
+
 }
diff --git a/sdnr/wt/common/src/main/java/org/onap/ccsdk/features/sdnr/wt/common/database/responses/BaseResponse.java b/sdnr/wt/common/src/main/java/org/onap/ccsdk/features/sdnr/wt/common/database/responses/BaseResponse.java
index 49447f6..01219f0 100644
--- a/sdnr/wt/common/src/main/java/org/onap/ccsdk/features/sdnr/wt/common/database/responses/BaseResponse.java
+++ b/sdnr/wt/common/src/main/java/org/onap/ccsdk/features/sdnr/wt/common/database/responses/BaseResponse.java
@@ -18,9 +18,11 @@
 package org.onap.ccsdk.features.sdnr.wt.common.database.responses;
 
 import java.io.IOException;
-import java.io.InputStream;
-import java.util.Scanner;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
 
+import org.apache.http.util.EntityUtils;
 import org.elasticsearch.client.Response;
 import org.json.JSONObject;
 import org.slf4j.Logger;
@@ -28,48 +30,61 @@
 
 public class BaseResponse {
 	private static final Logger LOG = LoggerFactory.getLogger(BaseResponse.class);
-	private int responseCode;
 
-	public int getResponseCode() {
+	private final int responseCode;
+
+	BaseResponse(Response response) {
+		this.responseCode = response != null ? response.getStatusLine().getStatusCode() : 0;
+	}
+
+	int getResponseCode() {
 		return this.responseCode;
 	}
+
 	public boolean isResponseSucceeded() {
-		return this.responseCode<300;
+		return this.responseCode < 300;
 	}
-	public BaseResponse() {
-	}
-	public BaseResponse(Response response) {
-		this.responseCode = response!=null?response.getStatusLine().getStatusCode():0;
-	}
-	protected JSONObject getJson(Response response) {
-		Scanner s;
-		JSONObject o=null;
+
+	JSONObject getJson(Response response) {
 		try {
-			//input stream used because Scanner ignored whitespaces
-			InputStream is = response.getEntity().getContent();
-			long len;
-			int BUFSIZE=1024;
-			byte[] buffer = new byte[BUFSIZE];
-			StringBuffer sresponse = new StringBuffer();
-			 while (true) {
-                 len = is.read(buffer, 0, BUFSIZE);
-                 if (len <= 0) {
-                     break;
-                 }
-
-                 sresponse.append(new String(buffer));
-             }
-
-			LOG.debug("parsing response={}",sresponse);
-			o = new JSONObject(sresponse.toString());
+			String sresponse = EntityUtils.toString(response.getEntity());
+			LOG.debug("parsing response={}", sresponse);
+			return new JSONObject(sresponse);
 		} catch (UnsupportedOperationException | IOException e) {
-			LOG.warn("error parsing es response: {}",e.getMessage());
+			LOG.warn("error parsing es response: {}", e.getMessage());
+			return null;
 		}
 
-		return o;
 	}
-	protected JSONObject getJson(String json) {
+
+	JSONObject getJson(String json) {
 		return new JSONObject(json);
 	}
 
+	/**
+	 * @param response
+	 * @return
+	 */
+	List<String> getLines(Response response){
+		return this.getLines(response,true);
+	}
+	List<String> getLines(Response response,boolean ignoreEmpty) {
+		try {
+			String sresponse = EntityUtils.toString(response.getEntity());
+			LOG.debug("parsing response={}", sresponse);
+			String[] hlp = sresponse.split("\n");
+			List<String> lines=new ArrayList<String>();
+			for(String h:hlp) {
+				if(ignoreEmpty && h.trim().length()==0) {
+					continue;
+				}
+				lines.add(h);
+			}
+			return lines;
+		} catch (UnsupportedOperationException | IOException e) {
+			LOG.warn("error parsing es response: {}", e.getMessage());
+			return null;
+		}
+
+	}
 }
diff --git a/sdnr/wt/common/src/main/java/org/onap/ccsdk/features/sdnr/wt/common/database/responses/ClusterHealthResponse.java b/sdnr/wt/common/src/main/java/org/onap/ccsdk/features/sdnr/wt/common/database/responses/ClusterHealthResponse.java
index 3f47ac2..b90bbbc 100644
--- a/sdnr/wt/common/src/main/java/org/onap/ccsdk/features/sdnr/wt/common/database/responses/ClusterHealthResponse.java
+++ b/sdnr/wt/common/src/main/java/org/onap/ccsdk/features/sdnr/wt/common/database/responses/ClusterHealthResponse.java
@@ -24,53 +24,54 @@
 
 public class ClusterHealthResponse extends BaseResponse {
 
-	public static final String HEALTHSTATUS_GREEN = "green";
-	public static final String HEALTHSTATUS_YELLOW = "yellow";
-	public static final String HEALTSTATUS_RED = "red";
+    public static final String HEALTHSTATUS_GREEN = "green";
+    public static final String HEALTHSTATUS_YELLOW = "yellow";
+    public static final String HEALTSTATUS_RED = "red";
 
-	private String status;
-	private boolean timedOut;
+    private String status;
+    private boolean timedOut;
 
-	/*
-	 * "cluster_name": "docker-cluster", "status": "yellow", "timed_out": false,
-	 * "number_of_nodes": 1, "number_of_data_nodes": 1, "active_primary_shards": 5,
-	 * "active_shards": 5, "relocating_shards": 0, "initializing_shards": 0,
-	 * "unassigned_shards": 5, "delayed_unassigned_shards": 0,
-	 * "number_of_pending_tasks": 0, "number_of_in_flight_fetch": 0,
-	 * "task_max_waiting_in_queue_millis": 0, "active_shards_percent_as_number": 50
-	 */
-	public ClusterHealthResponse(Response response) throws UnsupportedOperationException, IOException, JSONException {
-		super(response);
-		
-		JSONObject o = this.getJson(response);
-		if (o != null) {
-			this.status = o.getString("status");
-			this.timedOut = o.getBoolean("timed_out");
-		}
-	}
+    /*
+     * "cluster_name": "docker-cluster", "status": "yellow", "timed_out": false,
+     * "number_of_nodes": 1, "number_of_data_nodes": 1, "active_primary_shards": 5,
+     * "active_shards": 5, "relocating_shards": 0, "initializing_shards": 0,
+     * "unassigned_shards": 5, "delayed_unassigned_shards": 0,
+     * "number_of_pending_tasks": 0, "number_of_in_flight_fetch": 0,
+     * "task_max_waiting_in_queue_millis": 0, "active_shards_percent_as_number": 50
+     */
+    public ClusterHealthResponse(Response response) throws UnsupportedOperationException, IOException, JSONException {
+        super(response);
 
-	public boolean isTimedOut() {
-		return this.timedOut;
-	}
-	public boolean isStatusMinimal(String status) {
-		if (status == null) {
-			return true;
-		}
-		if (this.status.equals(HEALTHSTATUS_GREEN)) {
-			return true;
-		}
-		if (this.status.equals(HEALTHSTATUS_YELLOW) && !status.equals(HEALTHSTATUS_GREEN)) {
-			return true;
-		}
-		if (this.status.equals(status)) {
-			return true;
-		}
-		return false;
+        JSONObject o = this.getJson(response);
+        if (o != null) {
+            this.status = o.getString("status");
+            this.timedOut = o.getBoolean("timed_out");
+        }
+    }
 
-	}
+    public boolean isTimedOut() {
+        return this.timedOut;
+    }
+    @SuppressWarnings("hiding")
+    public boolean isStatusMinimal(String status) {
+        if (status == null) {
+            return true;
+        }
+        if (this.status.equals(HEALTHSTATUS_GREEN)) {
+            return true;
+        }
+        if (this.status.equals(HEALTHSTATUS_YELLOW) && !status.equals(HEALTHSTATUS_GREEN)) {
+            return true;
+        }
+        if (this.status.equals(status)) {
+            return true;
+        }
+        return false;
 
-	public String getStatus() {
-		return this.status;
-	}
+    }
+
+    public String getStatus() {
+        return this.status;
+    }
 
 }
diff --git a/sdnr/wt/common/src/main/java/org/onap/ccsdk/features/sdnr/wt/common/database/responses/CountResponse.java b/sdnr/wt/common/src/main/java/org/onap/ccsdk/features/sdnr/wt/common/database/responses/CreateAliasResponse.java
similarity index 91%
rename from sdnr/wt/common/src/main/java/org/onap/ccsdk/features/sdnr/wt/common/database/responses/CountResponse.java
rename to sdnr/wt/common/src/main/java/org/onap/ccsdk/features/sdnr/wt/common/database/responses/CreateAliasResponse.java
index 429c339..280ce39 100644
--- a/sdnr/wt/common/src/main/java/org/onap/ccsdk/features/sdnr/wt/common/database/responses/CountResponse.java
+++ b/sdnr/wt/common/src/main/java/org/onap/ccsdk/features/sdnr/wt/common/database/responses/CreateAliasResponse.java
@@ -19,12 +19,10 @@
 
 import org.elasticsearch.client.Response;
 
-public class CountResponse extends BaseResponse {
+public class CreateAliasResponse extends AcknowledgedResponse {
 
-	private long count;
-	
-	public CountResponse(Response response) {
+	public CreateAliasResponse(Response response) {
 		super(response);
-		
 	}
+
 }
diff --git a/sdnr/wt/common/src/main/java/org/onap/ccsdk/features/sdnr/wt/common/database/responses/CountResponse.java b/sdnr/wt/common/src/main/java/org/onap/ccsdk/features/sdnr/wt/common/database/responses/DeleteAliasResponse.java
similarity index 91%
copy from sdnr/wt/common/src/main/java/org/onap/ccsdk/features/sdnr/wt/common/database/responses/CountResponse.java
copy to sdnr/wt/common/src/main/java/org/onap/ccsdk/features/sdnr/wt/common/database/responses/DeleteAliasResponse.java
index 429c339..291aff0 100644
--- a/sdnr/wt/common/src/main/java/org/onap/ccsdk/features/sdnr/wt/common/database/responses/CountResponse.java
+++ b/sdnr/wt/common/src/main/java/org/onap/ccsdk/features/sdnr/wt/common/database/responses/DeleteAliasResponse.java
@@ -19,12 +19,10 @@
 
 import org.elasticsearch.client.Response;
 
-public class CountResponse extends BaseResponse {
+public class DeleteAliasResponse extends AcknowledgedResponse {
 
-	private long count;
-	
-	public CountResponse(Response response) {
+	public DeleteAliasResponse(Response response) {
 		super(response);
-		
 	}
-}
+
+}
\ No newline at end of file
diff --git a/sdnr/wt/common/src/main/java/org/onap/ccsdk/features/sdnr/wt/common/database/responses/GetInfoResponse.java b/sdnr/wt/common/src/main/java/org/onap/ccsdk/features/sdnr/wt/common/database/responses/GetInfoResponse.java
new file mode 100644
index 0000000..9b579f5
--- /dev/null
+++ b/sdnr/wt/common/src/main/java/org/onap/ccsdk/features/sdnr/wt/common/database/responses/GetInfoResponse.java
@@ -0,0 +1,72 @@
+/*******************************************************************************
+ * ============LICENSE_START========================================================================
+ * ONAP : ccsdk feature sdnr wt
+ * =================================================================================================
+ * Copyright (C) 2019 highstreet technologies GmbH Intellectual Property. All rights reserved.
+ * =================================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
+ * in compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
+ * or implied. See the License for the specific language governing permissions and limitations under
+ * the License.
+ * ============LICENSE_END==========================================================================
+ ******************************************************************************/
+package org.onap.ccsdk.features.sdnr.wt.common.database.responses;
+
+import org.elasticsearch.client.Response;
+import org.json.JSONObject;
+import org.onap.ccsdk.features.sdnr.wt.common.database.data.EsVersion;
+
+public class GetInfoResponse extends BaseResponse {
+
+    /**
+     * {
+     *  "name" : "kpOdXt-",
+     *  "cluster_name" : "docker-cluster",
+     *  "cluster_uuid" : "qags6CGGTrS75iBhrAdsgg",
+     *  "version" : {
+     *    "number" : "6.4.3",
+     *    "build_flavor" : "default",
+     *    "build_type" : "tar",
+     *    "build_hash" : "fe40335",
+     *    "build_date" : "2018-10-30T23:17:19.084789Z",
+     *    "build_snapshot" : false,
+     *    "lucene_version" : "7.4.0",
+     *    "minimum_wire_compatibility_version" : "5.6.0",
+     *    "minimum_index_compatibility_version" : "5.0.0"
+     *  },
+     *  "tagline" : "You Know, for Search"
+     *}
+     */
+	private final String clusterName;
+	private final String name;
+	
+	private final EsVersion version;
+    public GetInfoResponse(Response response) throws Exception  {
+        super(response);
+        JSONObject o = this.getJson(response);
+        if(o==null) {
+        	throw new Exception("unable to read response");
+        }
+        this.name = o.getString("name");
+        this.clusterName = o.getString("cluster_name");
+        this.version = new EsVersion(o.getJSONObject("version").getString("number"));
+    }
+	public String getClusterName() {
+		return clusterName;
+	}
+	public String getName() {
+		return name;
+	}
+	public EsVersion getVersion() {
+		return version;
+	}
+  
+
+   
+   
+}
diff --git a/sdnr/wt/common/src/main/java/org/onap/ccsdk/features/sdnr/wt/common/database/responses/ListAliasesResponse.java b/sdnr/wt/common/src/main/java/org/onap/ccsdk/features/sdnr/wt/common/database/responses/ListAliasesResponse.java
new file mode 100644
index 0000000..29e51fe
--- /dev/null
+++ b/sdnr/wt/common/src/main/java/org/onap/ccsdk/features/sdnr/wt/common/database/responses/ListAliasesResponse.java
@@ -0,0 +1,63 @@
+/*******************************************************************************
+ * ============LICENSE_START========================================================================
+ * ONAP : ccsdk feature sdnr wt
+ * =================================================================================================
+ * Copyright (C) 2019 highstreet technologies GmbH Intellectual Property. All rights reserved.
+ * =================================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
+ * in compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
+ * or implied. See the License for the specific language governing permissions and limitations under
+ * the License.
+ * ============LICENSE_END==========================================================================
+ ******************************************************************************/
+package org.onap.ccsdk.features.sdnr.wt.common.database.responses;
+
+import java.text.ParseException;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.elasticsearch.client.Response;
+import org.onap.ccsdk.features.sdnr.wt.common.database.data.AliasesEntry;
+import org.onap.ccsdk.features.sdnr.wt.common.database.data.AliasesEntryList;
+
+public class ListAliasesResponse extends BaseResponse {
+
+    /*
+     * eventlog                   eventlog-v1                   - - -
+     * faultlog                   faultlog-v1                   - - -
+     * inventoryequipment         inventoryequipment-v1         - - -
+     * historicalperformance24h   historicalperformance24h-v1   - - -
+     * mediator-server            mediator-server-v1            - - -
+     * networkelement-connection  networkelement-connection-v1  - - -
+     * maintenancemode            maintenancemode-v1            - - -
+     * historicalperformance15min historicalperformance15min-v1 - - -
+     * faultcurrent               faultcurrent-v1               - - -
+     * connectionlog              connectionlog-v1              - - -
+     */
+	private final AliasesEntryList entries;
+    public ListAliasesResponse(Response response) throws ParseException {
+        super(response);
+        List<String> lines=this.getLines(response);
+        this.entries = new AliasesEntryList();
+        if(lines!=null) {
+        	for(String line:lines) {
+        		this.entries.add(new AliasesEntry(line));
+        	}
+        }
+    }
+    /**
+     * 
+     * @return null if parsing failed otherwise valid (=>no entries may also be valid)
+     */
+    public AliasesEntryList getEntries(){
+    	return this.entries;
+    }
+
+   
+   
+}
diff --git a/sdnr/wt/common/src/main/java/org/onap/ccsdk/features/sdnr/wt/common/database/responses/ListIndicesResponse.java b/sdnr/wt/common/src/main/java/org/onap/ccsdk/features/sdnr/wt/common/database/responses/ListIndicesResponse.java
new file mode 100644
index 0000000..cfbe159
--- /dev/null
+++ b/sdnr/wt/common/src/main/java/org/onap/ccsdk/features/sdnr/wt/common/database/responses/ListIndicesResponse.java
@@ -0,0 +1,63 @@
+/*******************************************************************************
+ * ============LICENSE_START========================================================================
+ * ONAP : ccsdk feature sdnr wt
+ * =================================================================================================
+ * Copyright (C) 2019 highstreet technologies GmbH Intellectual Property. All rights reserved.
+ * =================================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
+ * in compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
+ * or implied. See the License for the specific language governing permissions and limitations under
+ * the License.
+ * ============LICENSE_END==========================================================================
+ ******************************************************************************/
+package org.onap.ccsdk.features.sdnr.wt.common.database.responses;
+
+import java.text.ParseException;
+import java.util.List;
+
+import org.elasticsearch.client.Response;
+import org.onap.ccsdk.features.sdnr.wt.common.database.data.IndicesEntry;
+import org.onap.ccsdk.features.sdnr.wt.common.database.data.IndicesEntryList;
+
+public class ListIndicesResponse extends BaseResponse {
+
+    /*
+     * yellow open inventoryequipment-v1         5nNPRbJ3T9arMxqxBbJKyQ 5 1 0 0 1.2kb 1.2kb
+     * yellow open eventlog-v1                   8lkfX97iT86dZdUlgVAktg 5 1 0 0 1.2kb 1.2kb
+     * yellow open mediator-server-v1            8T4hNo61SgulupKntivY4Q 5 1 0 0 1.2kb 1.2kb
+     * yellow open historicalperformance24h-v1   fRCGb7JYRdiry23HKWg0Hw 5 1 0 0 1.2kb 1.2kb
+     * yellow open faultlog-v1                   kjsb50boTPOAzXMYdnfv4A 5 1 0 0 1.2kb 1.2kb
+     * yellow open maintenancemode-v1            Q9ZsCgW0Q9m6nk49iOFNhA 5 1 0 0 1.2kb 1.2kb
+     * yellow open historicalperformance15min-v1 BdEOe7X2RK2o5yTwNH5QQg 5 1 0 0 1.2kb 1.2kb
+     * yellow open faultcurrent-v1               BdikWk9HQtS5aFpYEAac2g 5 1 0 0 1.2kb 1.2kb
+     * yellow open networkelement-connection-v1  YT3lj0AKRoOmtN30Zbdfqw 5 1 0 0 1.2kb 1.2kb
+     * yellow open connectionlog-v1              7yrVaaM1QjyO5eMsCUHNHQ 5 1 0 0 1.2kb 1.2kb
+     */
+	private final IndicesEntryList entries;
+    public ListIndicesResponse(Response response) throws ParseException  {
+        super(response);
+        List<String> lines=this.getLines(response);
+        this.entries = new IndicesEntryList();
+        if(lines!=null) {
+        	for(String line:lines) {
+        		this.entries.add(new IndicesEntry(line));
+        	}
+        }
+        
+    }
+	/**
+	 * @return
+	 */
+	public IndicesEntryList getEntries() {
+		return this.entries;
+	}
+	
+
+   
+   
+}
diff --git a/sdnr/wt/common/src/main/java/org/onap/ccsdk/features/sdnr/wt/common/file/FileWatchdog.java b/sdnr/wt/common/src/main/java/org/onap/ccsdk/features/sdnr/wt/common/file/FileWatchdog.java
index 63c1f15..11e6cb8 100644
--- a/sdnr/wt/common/src/main/java/org/onap/ccsdk/features/sdnr/wt/common/file/FileWatchdog.java
+++ b/sdnr/wt/common/src/main/java/org/onap/ccsdk/features/sdnr/wt/common/file/FileWatchdog.java
@@ -1,26 +1,21 @@
-/*
- * ============LICENSE_START=======================================================
- * ONAP : ccsdk features
- * ================================================================================
- * Copyright (C) 2019 highstreet technologies GmbH Intellectual Property.
- * All rights reserved.
- * ================================================================================
- * Update Copyright (C) 2020 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+/*******************************************************************************
+ * ============LICENSE_START========================================================================
+ * ONAP : ccsdk feature sdnr wt
+ * =================================================================================================
+ * Copyright (C) 2019 highstreet technologies GmbH Intellectual Property. All rights reserved.
+ * =================================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
+ * in compliance with the License. You may obtain a copy of the License at
  *
- *     http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=======================================================
- *
- */
+ * Unless required by applicable law or agreed to in writing, software distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
+ * or implied. See the License for the specific language governing permissions and limitations under
+ * the License.
+ * ============LICENSE_END==========================================================================
+ *****************************************************************************/
+
 package org.onap.ccsdk.features.sdnr.wt.common.file;
 
 import java.io.File;
diff --git a/sdnr/wt/common/src/test/java/org/onap/ccsdk/features/sdnr/wt/common/test/TestConfig.java b/sdnr/wt/common/src/test/java/org/onap/ccsdk/features/sdnr/wt/common/test/TestConfig.java
index 591ea49..fd0c255 100644
--- a/sdnr/wt/common/src/test/java/org/onap/ccsdk/features/sdnr/wt/common/test/TestConfig.java
+++ b/sdnr/wt/common/src/test/java/org/onap/ccsdk/features/sdnr/wt/common/test/TestConfig.java
@@ -21,9 +21,13 @@
 
 import java.io.File;
 import java.io.IOException;
+import java.lang.reflect.Field;
 import java.net.MalformedURLException;
 import java.net.URL;
 import java.nio.file.Files;
+import java.util.Collections;
+import java.util.Map;
+
 import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
@@ -230,4 +234,24 @@
 		}
 		
 	}
+	@Test
+	public void testEnvPropert() {
+		final String KEY = "basada";
+		Section section = new Section("test");
+		section.addLine(KEY+"=${USER} in ${HOME}");
+		section.parseLines();
+		assertTrue(section.getProperty(KEY).length()>" in ".length());
+	}
+	public static void setEnv(String key, String value) {
+	    try {
+	        Map<String, String> env = System.getenv();
+	        Class<?> cl = env.getClass();
+	        Field field = cl.getDeclaredField("m");
+	        field.setAccessible(true);
+	        Map<String, String> writableEnv = (Map<String, String>) field.get(env);
+	        writableEnv.put(key, value);
+	    } catch (Exception e) {
+	        throw new IllegalStateException("Failed to set environment variable", e);
+	    }
+	}
 }
diff --git a/sdnr/wt/common/src/test/java/org/onap/ccsdk/features/sdnr/wt/common/test/TestDbRequests.java b/sdnr/wt/common/src/test/java/org/onap/ccsdk/features/sdnr/wt/common/test/TestDbRequests.java
index 36bbebe..9fdfeb2 100644
--- a/sdnr/wt/common/src/test/java/org/onap/ccsdk/features/sdnr/wt/common/test/TestDbRequests.java
+++ b/sdnr/wt/common/src/test/java/org/onap/ccsdk/features/sdnr/wt/common/test/TestDbRequests.java
@@ -24,7 +24,9 @@
 import org.onap.ccsdk.features.sdnr.wt.common.database.config.HostInfo;
 import org.onap.ccsdk.features.sdnr.wt.common.database.queries.QueryBuilders;
 import org.onap.ccsdk.features.sdnr.wt.common.database.requests.ClusterHealthRequest;
+import org.onap.ccsdk.features.sdnr.wt.common.database.requests.CreateAliasRequest;
 import org.onap.ccsdk.features.sdnr.wt.common.database.requests.CreateIndexRequest;
+import org.onap.ccsdk.features.sdnr.wt.common.database.requests.DeleteAliasRequest;
 import org.onap.ccsdk.features.sdnr.wt.common.database.requests.DeleteByQueryRequest;
 import org.onap.ccsdk.features.sdnr.wt.common.database.requests.DeleteIndexRequest;
 import org.onap.ccsdk.features.sdnr.wt.common.database.requests.DeleteRequest;
@@ -36,12 +38,14 @@
 import org.onap.ccsdk.features.sdnr.wt.common.database.requests.UpdateByQueryRequest;
 import org.onap.ccsdk.features.sdnr.wt.common.database.requests.UpdateRequest;
 import org.onap.ccsdk.features.sdnr.wt.common.database.responses.ClusterHealthResponse;
+import org.onap.ccsdk.features.sdnr.wt.common.database.responses.CreateAliasResponse;
 import org.onap.ccsdk.features.sdnr.wt.common.database.responses.CreateIndexResponse;
 import org.onap.ccsdk.features.sdnr.wt.common.database.responses.DeleteByQueryResponse;
 import org.onap.ccsdk.features.sdnr.wt.common.database.responses.DeleteIndexResponse;
 import org.onap.ccsdk.features.sdnr.wt.common.database.responses.DeleteResponse;
 import org.onap.ccsdk.features.sdnr.wt.common.database.responses.GetResponse;
 import org.onap.ccsdk.features.sdnr.wt.common.database.responses.IndexResponse;
+import org.onap.ccsdk.features.sdnr.wt.common.database.responses.ListIndicesResponse;
 import org.onap.ccsdk.features.sdnr.wt.common.database.responses.NodeStatsResponse;
 import org.onap.ccsdk.features.sdnr.wt.common.database.responses.SearchResponse;
 import org.onap.ccsdk.features.sdnr.wt.common.database.responses.UpdateByQueryResponse;
@@ -53,6 +57,7 @@
 import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.fail;
 import java.io.IOException;
+import java.text.ParseException;
 import java.util.Arrays;
 import java.util.List;
 
@@ -96,6 +101,53 @@
 	public void testCount() {
 
 	}
+	@Test
+	public void testIndexAndAliasList() {
+		final String ALIAS="asdoi32kmasd";
+		final String IDX=ALIAS+"-v1";
+		CreateIndexRequest request = new CreateIndexRequest(IDX);
+		CreateIndexResponse response = null;
+		try {
+			response = dbClient.createIndex(request);
+		} catch (IOException e) {
+			fail(e.getMessage());
+		}
+		assertNotNull(response);
+
+		CreateAliasRequest request3 = new CreateAliasRequest(IDX,ALIAS);
+		CreateAliasResponse response3 = null;
+		try {
+			response3 = dbClient.createAlias(request3);
+		} catch (IOException e) {
+			fail(e.getMessage());
+		}
+		assertNotNull(response3);
+		assertTrue(response3.isResponseSucceeded());
+		
+		assertTrue("index not existing", dbClient.isExistsIndex(IDX));
+		ListIndicesResponse response2=null;
+		try {
+			 response2 = dbClient.getIndices();
+		} catch (ParseException | IOException e) {
+			fail(e.getMessage());
+		}
+		assertNotNull(response2);
+		assertNotNull(response2.getEntries());
+		assertTrue(response2.getEntries().size()>0);
+		
+		DeleteIndexRequest request11 = new DeleteIndexRequest(IDX);
+
+		DeleteIndexResponse response11 = null;
+		try {
+			response11 = dbClient.deleteIndex(request11);
+		} catch (IOException e) {
+			fail(e.getMessage());
+		}
+		assertNotNull(response11);
+		assertFalse("index still existing", dbClient.isExistsIndex(IDX));
+		this.deleteAlias(IDX, ALIAS);
+		this.deleteIndex(IDX);
+	}
 
 	@Test
 	public void testCreateAndDeleteIndex() {
@@ -401,6 +453,13 @@
 		System.out.println(stats.getNodesInfo());
 		System.out.println(stats.getNodeStatistics());
 	}
+	private void deleteAlias(String idx,String alias) {
+		try {
+			dbClient.deleteAlias( new DeleteAliasRequest(idx,alias));
+		} catch (IOException e) {
+
+		}
+	}
 	private void deleteIndex(String idx) {
 		try {
 			dbClient.deleteIndex( new DeleteIndexRequest(idx));
diff --git a/sdnr/wt/common/src/test/java/org/onap/ccsdk/features/sdnr/wt/common/test/TestEsData.java b/sdnr/wt/common/src/test/java/org/onap/ccsdk/features/sdnr/wt/common/test/TestEsData.java
new file mode 100644
index 0000000..d88df96
--- /dev/null
+++ b/sdnr/wt/common/src/test/java/org/onap/ccsdk/features/sdnr/wt/common/test/TestEsData.java
@@ -0,0 +1,111 @@
+/*******************************************************************************
+ * ============LICENSE_START========================================================================
+ * ONAP : ccsdk feature sdnr wt
+ * =================================================================================================
+ * Copyright (C) 2020 highstreet technologies GmbH Intellectual Property. All rights reserved.
+ * =================================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
+ * in compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
+ * or implied. See the License for the specific language governing permissions and limitations under
+ * the License.
+ * ============LICENSE_END==========================================================================
+ ******************************************************************************/
+package org.onap.ccsdk.features.sdnr.wt.common.test;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
+import java.text.ParseException;
+
+import org.junit.Test;
+import org.onap.ccsdk.features.sdnr.wt.common.database.data.AliasesEntry;
+import org.onap.ccsdk.features.sdnr.wt.common.database.data.AliasesEntryList;
+import org.onap.ccsdk.features.sdnr.wt.common.database.data.EsVersion;
+import org.onap.ccsdk.features.sdnr.wt.common.database.data.IndicesEntry;
+import org.onap.ccsdk.features.sdnr.wt.common.database.data.IndicesEntryList;
+
+/**
+ * @author Michael Dürre
+ *
+ */
+public class TestEsData {
+
+	
+	@Test
+	public void testVersion() {
+		EsVersion version=null;
+		try {
+			version = new EsVersion("2.3.4");
+		} catch (ParseException e) {
+			fail(e.getMessage());
+		}
+		assertNotNull(version);
+		assertEquals(2, version.getMajor());
+		assertEquals(3, version.getMinor());
+		assertEquals(4, version.getRevision());
+		
+		EsVersion versionNewer = new EsVersion(5,0,0);
+		EsVersion versionOlder = new EsVersion(2,2,0);
+		
+		assertTrue(version.isOlderOrEqualThan(versionNewer));
+		assertTrue(version.isNewerOrEqualThan(versionOlder));
+		
+	}
+	@Test
+	public void testIndices() {
+		IndicesEntryList list = new IndicesEntryList();
+		IndicesEntry entry=null;
+		try {
+			entry=new IndicesEntry("yellow open inventoryequipment-v1         5nNPRbJ3T9arMxqxBbJKyQ 5 1 2 3 1.2kb 2.4kb");
+			list.add(entry);
+			list.add(new IndicesEntry("yellow open networkelement-connection-v1         5nNPRbJ3T9arMxqxBbJKyQ 5 1 0 0 1.2kb 1.2kb"));
+			list.add(new IndicesEntry("yellow open faultlog-v1         5nNPRbJ3T9arMxqxBbJKyQ 5 1 0 0 1.2kb 1.2kb"));
+			list.add(new IndicesEntry("yellow open eventlog-v1         5nNPRbJ3T9arMxqxBbJKyQ 5 1 0 0 1.2kb 1.2kb"));
+			} catch (ParseException e) {
+			fail(e.getMessage());
+		}
+		assertEquals(4, list.size());
+		assertNotNull(list.findByIndex("eventlog-v1"));
+		assertNull(list.findByIndex("faultcurrent"));
+		assertNotNull(entry);
+		assertEquals("yellow",entry.getStatus());
+		assertEquals("open", entry.getStatus2());
+		assertEquals("inventoryequipment-v1", entry.getName());
+		assertEquals("5nNPRbJ3T9arMxqxBbJKyQ", entry.getHash());
+		assertEquals(5, entry.getShards());
+		assertEquals(1, entry.getReplicas());
+		assertEquals(2, entry.getC1());
+		assertEquals(3, entry.getC2());
+		assertEquals("1.2kb", entry.getSize1());
+		assertEquals("2.4kb", entry.getSize2());
+		
+	}
+	@Test
+	public void testAliases() {
+		AliasesEntryList list = new AliasesEntryList();
+		AliasesEntry entry=null;
+		try {
+			entry=new AliasesEntry("networkelement-connection  networkelement-connection-v1  - - -");
+			list.add(entry);
+			list.add(new AliasesEntry("faultcurrent               faultcurrent-v1               - - -"));
+			list.add(new AliasesEntry("faultlog                   faultlog-v1                   - - -"));
+			list.add(new AliasesEntry("maintenancemode            maintenancemode-v1            - - -"));
+			} catch (ParseException e) {
+			fail(e.getMessage());
+		}
+		assertEquals(4, list.size());
+		assertNotNull(list.findByAlias("faultcurrent"));
+		assertNull(list.findByAlias("eventlog"));
+		assertNotNull(entry);
+		assertEquals("networkelement-connection",entry.getAlias());
+		assertEquals("networkelement-connection-v1", entry.getIndex());
+	}
+}
