</build>
 
        <dependencies>
+               <dependency>
+                       <groupId>org.glassfish.jersey.core</groupId>
+                       <artifactId>jersey-client</artifactId>
+               </dependency>
+               <dependency>
+                       <groupId>ch.vorburger.mariaDB4j</groupId>
+                       <artifactId>mariaDB4j</artifactId>
+                       <version>2.2.3</version>
+                       <scope>test</scope>
+               </dependency>
                <dependency>
                        <groupId>org.onap.so.adapters</groupId>
                        <artifactId>mso-adapters-rest-interface</artifactId>
 
 
 package org.onap.so.cloud;
 
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Map.Entry;
 import java.util.Optional;
 
-import javax.annotation.PostConstruct;
-
-import com.fasterxml.jackson.annotation.JsonProperty;
 import com.fasterxml.jackson.annotation.JsonRootName;
 
-import org.apache.commons.lang3.builder.ToStringBuilder;
-import org.apache.commons.lang3.builder.ToStringStyle;
-import org.springframework.boot.context.properties.ConfigurationProperties;
-import org.springframework.context.annotation.Configuration;
-import org.apache.commons.lang3.builder.HashCodeBuilder;
-import org.apache.commons.lang3.builder.EqualsBuilder;
+import org.onap.so.db.catalog.beans.CloudIdentity;
+import org.onap.so.db.catalog.beans.CloudSite;
+import org.onap.so.db.catalog.beans.CloudifyManager;
+import org.onap.so.db.catalog.client.CatalogDbClient;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
 
 /**
  * JavaBean JSON class for a CloudConfig. This bean maps a JSON-format cloud
  *
  */
 
-@Configuration
 @JsonRootName("cloud_config")
-@ConfigurationProperties(prefix="cloud_config")
+@Component
 public class CloudConfig {
        
     private static final String CLOUD_SITE_VERSION = "2.5";
     private static final String DEFAULT_CLOUD_SITE_ID = "default";
-    
-    @JsonProperty("identity_services")
-    private Map<String, CloudIdentity> identityServices = new HashMap<>();
-    
-    @JsonProperty("cloud_sites")
-    private Map <String, CloudSite> cloudSites = new HashMap<>();
-    
-    @JsonProperty("cloudify_managers")
-    private Map <String, CloudifyManager> cloudifyManagers = new HashMap<>();
 
-    @PostConstruct
-    private void init() {
-       for (Entry<String, CloudIdentity> entry : identityServices.entrySet()) {
-               entry.getValue().setId(entry.getKey());
-       }
-       
-       for (Entry<String, CloudSite> entry : cloudSites.entrySet()) {
-               entry.getValue().setId(entry.getKey());
-       }
-       
-       for (Entry<String, CloudifyManager> entry : cloudifyManagers.entrySet()) {
-               entry.getValue().setId(entry.getKey());
-       }
-    }
-    
-    /**
-     * Get a map of all identity services that have been loaded.
-     */
-    public Map<String, CloudIdentity> getIdentityServices() {
-        return identityServices;
-    }
+    @Autowired
+    private CatalogDbClient catalogDbClient;
 
-    /**
-     * Get a map of all cloud sites that have been loaded.
-     */
-    public Map<String, CloudSite> getCloudSites() {
-        return cloudSites;
-    }
-
-       /**
-        * Get a Map of all CloudifyManagers that have been loaded.
-        * @return the Map
-        */
-    public Map<String,CloudifyManager> getCloudifyManagers() {
-         return cloudifyManagers;
-    }
-    
     /**
      * Get a specific CloudSites, based on an ID. The ID is first checked
      * against the regions, and if no match is found there, then against
      * @return an Optional of CloudSite object.
      */
      public synchronized Optional<CloudSite> getCloudSite(String id) {
-        if (id == null) {
-            return Optional.empty();
-        }
-        if (cloudSites.containsKey(id)) {
-            return Optional.ofNullable(cloudSites.get(id));
-        } else {
-               return getCloudSiteWithClli(id);
-        }
-    }
-    
-    public String getCloudSiteId(CloudSite cloudSite) {
-       for(Entry<String, CloudSite> entry : this.getCloudSites().entrySet()){
-          if(entry.getValue().equals(cloudSite))
-                  return entry.getKey();
-       }
-       return null;
-    }
+         if (id == null) {
+             return Optional.empty();
+         }
+         CloudSite cloudSite = catalogDbClient.getCloudSite(id);
 
+         if (cloudSite != null) {
+             return Optional.of(cloudSite);
+         } else {
+             return getCloudSiteWithClli(id);
+         }
+     }
+    
     /**
      * Get a specific CloudSites, based on a CLLI and (optional) version, which
      * will be matched against the aic_version field of the CloudSite.
      * 
      * @param clli
      *            the CLLI to match
-     * @param version
-     *            the version to match; may be null in which case any version
-     *            matches
      * @return a CloudSite, or null of no match found
      */
     private Optional<CloudSite> getCloudSiteWithClli(String clli) {
-        Optional <CloudSite> cloudSiteOptional = cloudSites.values().stream().filter(cs ->
-                cs.getClli() != null && clli.equals(cs.getClli()) && (CLOUD_SITE_VERSION.equals(cs.getAicVersion())))
-                .findAny();
+        Optional <CloudSite> cloudSiteOptional = Optional.ofNullable(catalogDbClient.getCloudSiteByClliAndAicVersion(clli,CLOUD_SITE_VERSION));
         if (cloudSiteOptional.isPresent()) {
                return cloudSiteOptional;
         } else {
     }
 
     private Optional<CloudSite> getDefaultCloudSite(String clli) {
-        Optional<CloudSite> cloudSiteOpt = cloudSites.values().stream()
-                .filter(cs -> cs.getId().equalsIgnoreCase(DEFAULT_CLOUD_SITE_ID)).findAny();
+        Optional<CloudSite> cloudSiteOpt = Optional.ofNullable(catalogDbClient.getCloudSite(DEFAULT_CLOUD_SITE_ID));
         if (cloudSiteOpt.isPresent()) {
             CloudSite defaultCloudSite = cloudSiteOpt.get();
             CloudSite clone = new CloudSite(defaultCloudSite);
      * @return a CloudIdentity, or null of no match found
      */
     public CloudIdentity getIdentityService(String id) {
-               return identityServices.get(id);
+        return catalogDbClient.getCloudIdentity(id);
     }
 
        /**
         * @return a CloudifyManager, or null of no match found
         */
        public CloudifyManager getCloudifyManager (String id) {
-                       return cloudifyManagers.get(id);
-       }
-       
-       @Override
-       public String toString() {
-               return new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE)
-                               .append("identityServices", getIdentityServices()).append("cloudSites", getCloudSites()).toString();
-       }
-       
-       @Override
-       public boolean equals(final Object other) {
-               if (other == null) {
-                       return false;
-               }
-               if (!getClass().equals(other.getClass())) {
-                       return false;
-               }
-               CloudConfig castOther = (CloudConfig) other;
-               return new EqualsBuilder().append(getIdentityServices(), castOther.getIdentityServices())
-                               .append(getCloudSites(), castOther.getCloudSites()).isEquals();
-       }
-       
-       @Override
-       public int hashCode() {
-               return new HashCodeBuilder(1, 31).append(getIdentityServices()).append(getCloudSites()).toHashCode();
+        return catalogDbClient.getCloudifyManager(id);
        }
 }
 
 
 package org.onap.so.cloud.authentication;
 
-import org.onap.so.cloud.AuthenticationType;
-import org.onap.so.cloud.CloudIdentity;
+import org.onap.so.db.catalog.beans.AuthenticationType;
+import org.onap.so.db.catalog.beans.CloudIdentity;
 import org.onap.so.cloud.authentication.models.RackspaceAuthentication;
 import org.onap.so.utils.CryptoUtils;
 import org.springframework.stereotype.Component;
 
 import org.onap.so.adapters.vdu.VduStateType;
 import org.onap.so.adapters.vdu.VduStatus;
 import org.onap.so.cloud.CloudConfig;
-import org.onap.so.cloud.CloudSite;
-import org.onap.so.cloud.CloudifyManager;
+import org.onap.so.db.catalog.beans.CloudSite;
+import org.onap.so.db.catalog.beans.CloudifyManager;
 import org.onap.so.cloudify.base.client.CloudifyBaseException;
 import org.onap.so.cloudify.base.client.CloudifyClientTokenProvider;
 import org.onap.so.cloudify.base.client.CloudifyConnectException;
     {
         CloudifyManager cloudifyConfig = cloudConfig.getCloudifyManager(cloudSite.getCloudifyId());
         if (cloudifyConfig == null) {
-               throw new MsoCloudifyManagerNotFound (cloudConfig.getCloudSiteId(cloudSite));
+               throw new MsoCloudifyManagerNotFound (cloudSite.getId());
         }
 
         // Get a Cloudify client
 
 import org.onap.so.adapters.vdu.VduStateType;
 import org.onap.so.adapters.vdu.VduStatus;
 import org.onap.so.cloud.CloudConfig;
-import org.onap.so.cloud.CloudIdentity;
-import org.onap.so.cloud.CloudSite;
+import org.onap.so.db.catalog.beans.CloudIdentity;
+import org.onap.so.db.catalog.beans.CloudSite;
 import org.onap.so.cloud.authentication.AuthenticationMethodFactory;
 import org.onap.so.db.catalog.beans.HeatTemplate;
 import org.onap.so.db.catalog.beans.HeatTemplateParam;
      * @return an authenticated Heat object
      */
     public Heat getHeatClient (CloudSite cloudSite, String tenantId) throws MsoException {
-        String cloudId = cloudConfig.getCloudSiteId(cloudSite);
+        String cloudId = cloudSite.getId();
 
         // Check first in the cache of previously authorized clients
         String cacheKey = cloudId + ":" + tenantId;
 
 import java.util.List;
 import java.util.Map;
 
-import org.onap.so.cloud.CloudConfig;
-import org.onap.so.cloud.CloudSite;
+import org.onap.so.db.catalog.beans.CloudSite;
 import org.onap.so.logger.MessageEnum;
 import org.onap.so.logger.MsoLogger;
 import org.onap.so.openstack.beans.StackInfo;
 
 import java.util.Map;
 import java.util.Optional;
 
-import org.onap.so.cloud.CloudIdentity;
-import org.onap.so.cloud.CloudSite;
+import org.onap.so.db.catalog.beans.CloudIdentity;
+import org.onap.so.db.catalog.beans.CloudSite;
 import org.onap.so.cloud.authentication.AuthenticationMethodFactory;
 import org.onap.so.logger.MessageEnum;
 import org.onap.so.logger.MsoAlarmLogger;
      * <p>
      *
      * @param tenantName The tenant name to create
-     * @param cloudId The cloud identifier (may be a region) in which to create the tenant.
+     * @param cloudSiteId The cloud identifier (may be a region) in which to create the tenant.
      * @return the tenant ID of the newly created tenant
      * @throws MsoTenantAlreadyExists Thrown if the requested tenant already exists
      * @throws MsoOpenstackException Thrown if the Openstack API call returns an exception
                    executeAndRecordOpenstackRequest (request);
             }
 
-            if (cloudIdentity.hasTenantMetadata () && metadata != null && !metadata.isEmpty ()) {
+            if (cloudIdentity.getTenantMetadata () && metadata != null && !metadata.isEmpty ()) {
                 Metadata tenantMetadata = new Metadata ();
                 tenantMetadata.setMetadata (metadata);
 
             }
 
             Map <String, String> metadata = new HashMap <String, String> ();
-            if (cloudConfig.getIdentityService(cloudSite.getIdentityServiceId()).hasTenantMetadata ()) {
+            if (cloudConfig.getIdentityService(cloudSite.getIdentityServiceId()).getTenantMetadata ()) {
                 OpenStackRequest <Metadata> request = keystoneAdminClient.tenants ().showMetadata (tenant.getId ());
                 Metadata tenantMetadata = executeAndRecordOpenstackRequest (request);
                 if (tenantMetadata != null) {
             }
 
             Map <String, String> metadata = new HashMap <String, String> ();
-            if (cloudConfig.getIdentityService(cloudSite.getIdentityServiceId()).hasTenantMetadata ()) {
+            if (cloudConfig.getIdentityService(cloudSite.getIdentityServiceId()).getTenantMetadata ()) {
                 OpenStackRequest <Metadata> request = keystoneAdminClient.tenants ().showMetadata (tenant.getId ());
                 Metadata tenantMetadata = executeAndRecordOpenstackRequest (request);
                 if (tenantMetadata != null) {
 
 import java.util.Map;
 
 import org.onap.so.cloud.CloudConfig;
-import org.onap.so.cloud.CloudIdentity;
-import org.onap.so.cloud.CloudSite;
+import org.onap.so.db.catalog.beans.CloudIdentity;
+import org.onap.so.db.catalog.beans.CloudSite;
 import org.onap.so.cloud.authentication.AuthenticationMethodFactory;
 import org.onap.so.logger.MessageEnum;
 import org.onap.so.logger.MsoAlarmLogger;
 import org.onap.so.openstack.exceptions.MsoNetworkAlreadyExists;
 import org.onap.so.openstack.exceptions.MsoNetworkNotFound;
 import org.onap.so.openstack.exceptions.MsoOpenstackException;
-import org.onap.so.openstack.exceptions.MsoTenantNotFound;
 import org.onap.so.openstack.mappers.NetworkInfoMapper;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 
 import java.util.Map;
 
 import org.onap.so.cloud.CloudConfig;
-import org.onap.so.cloud.CloudIdentity;
+import org.onap.so.db.catalog.beans.CloudIdentity;
 import org.onap.so.logger.MsoLogger;
 import org.onap.so.openstack.beans.MsoTenant;
 import org.onap.so.openstack.exceptions.MsoCloudSiteNotFound;
 
 package org.onap.so.openstack.utils;
 
 import org.onap.so.cloud.CloudConfig;
-import org.onap.so.cloud.CloudSite;
-import org.onap.so.cloud.ServerType;
+import org.onap.so.db.catalog.beans.CloudSite;
+import org.onap.so.db.catalog.beans.ServerType;
 import org.onap.so.logger.MsoLogger;
 import org.onap.so.openstack.exceptions.MsoCloudSiteNotFound;
 import org.springframework.beans.factory.annotation.Autowired;
 
 
 
 import com.github.tomakehurst.wiremock.client.WireMock;
+import org.apache.http.HttpHeaders;
+import org.apache.http.HttpStatus;
 import org.junit.After;
+import org.junit.Before;
 import org.junit.runner.RunWith;
+import org.onap.so.db.catalog.beans.AuthenticationType;
+import org.onap.so.db.catalog.beans.CloudIdentity;
+import org.onap.so.db.catalog.beans.CloudSite;
+import org.onap.so.db.catalog.beans.ServerType;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.boot.test.context.SpringBootTest;
 import org.springframework.cloud.contract.wiremock.AutoConfigureWireMock;
 import org.springframework.test.context.ActiveProfiles;
 import org.springframework.test.context.junit4.SpringRunner;
 
+import javax.ws.rs.core.MediaType;
+import java.io.BufferedReader;
+import java.io.FileReader;
+import java.io.IOException;
+
+import static com.github.tomakehurst.wiremock.client.WireMock.*;
+import static com.github.tomakehurst.wiremock.client.WireMock.aResponse;
+import static com.github.tomakehurst.wiremock.client.WireMock.urlPathEqualTo;
+
 @RunWith(SpringRunner.class)
 @SpringBootTest(classes = TestApplication.class, webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
 @ActiveProfiles("test")
        public void after() {
                WireMock.reset();
        }
-}
+
+       protected static String getBody(String body, int port, String urlPath) throws IOException {
+               return body.replaceAll("port", "http://localhost:" + port + urlPath);
+       }
+
+       @Before
+       public void init() throws IOException {
+               CloudIdentity identity = getCloudIdentity();
+               CloudSite cloudSite = getCloudSite(identity);
+               mockCloud(identity, cloudSite);
+       }
+
+       private void mockCloud(CloudIdentity identity, CloudSite cloudSite) throws IOException {
+               stubFor(get(urlPathEqualTo("/cloudSite/MTN13")).willReturn(aResponse()
+                               .withBody(getBody(mapper.writeValueAsString(cloudSite),wireMockPort, ""))
+                               .withHeader(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON)
+                               .withStatus(HttpStatus.SC_OK)));
+               stubFor(get(urlPathEqualTo("/cloudSite/default")).willReturn(aResponse()
+                               .withBody(getBody(mapper.writeValueAsString(cloudSite),wireMockPort, ""))
+                               .withHeader(HttpHeaders.CONTENT_TYPE,MediaType.APPLICATION_JSON)
+                               .withStatus(HttpStatus.SC_OK)));
+               stubFor(get(urlPathEqualTo("/cloudIdentity/mtn13")).willReturn(aResponse()
+                               .withBody(getBody(mapper.writeValueAsString(identity),wireMockPort, ""))
+                               .withHeader(HttpHeaders.CONTENT_TYPE,MediaType.APPLICATION_JSON)
+                               .withStatus(HttpStatus.SC_OK)));
+       }
+
+       private CloudIdentity getCloudIdentity() {
+               CloudIdentity identity = new CloudIdentity();
+               identity.setId("mtn13");
+               identity.setMsoId("m93945");
+               identity.setMsoPass("93937EA01B94A10A49279D4572B48369");
+               identity.setAdminTenant("admin");
+               identity.setMemberRole("admin");
+               identity.setTenantMetadata(false);
+               identity.setIdentityUrl("http://localhost:"+wireMockPort+"/v2.0");
+               identity.setIdentityAuthenticationType(AuthenticationType.USERNAME_PASSWORD);
+               identity.setIdentityServerType(ServerType.KEYSTONE);
+               return identity;
+       }
+
+       private CloudSite getCloudSite(CloudIdentity identity) {
+               CloudSite cloudSite = new CloudSite();
+               cloudSite.setId("MTN13");
+               cloudSite.setCloudVersion("3.0");
+               cloudSite.setClli("MDT13");
+               cloudSite.setRegionId("mtn13");
+               cloudSite.setIdentityService(identity);
+               return cloudSite;
+       }
+
+       private static String readFile(String fileName) throws IOException {
+               try (BufferedReader br = new BufferedReader(new FileReader(fileName))) {
+                       StringBuilder sb = new StringBuilder();
+                       String line = br.readLine();
+
+                       while (line != null) {
+                               sb.append(line);
+                               sb.append("\n");
+                               line = br.readLine();
+                       }
+                       return sb.toString();
+               }
+       }
+}
\ No newline at end of file
 
--- /dev/null
+package org.onap.so;
+
+import ch.vorburger.exec.ManagedProcessException;
+import ch.vorburger.mariadb4j.DBConfigurationBuilder;
+import ch.vorburger.mariadb4j.springframework.MariaDB4jSpringService;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.boot.autoconfigure.jdbc.DataSourceBuilder;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.context.annotation.Profile;
+
+import javax.sql.DataSource;
+
+@Configuration
+@Profile({"test","local"})
+public class EmbeddedMariaDbConfig {
+
+    @Bean
+    MariaDB4jSpringService mariaDB4jSpringService() {
+        return new MariaDB4jSpringService();
+    }
+
+    @Bean
+    DataSource dataSource(MariaDB4jSpringService mariaDB4jSpringService,
+                          @Value("${mariaDB4j.databaseName}") String databaseName,
+                          @Value("${spring.datasource.username}") String datasourceUsername,
+                          @Value("${spring.datasource.password}") String datasourcePassword,
+                          @Value("${spring.datasource.driver-class-name}") String datasourceDriver) throws ManagedProcessException {
+        //Create our database with default root user and no password
+        mariaDB4jSpringService.getDB().createDB(databaseName);
+
+        DBConfigurationBuilder config = mariaDB4jSpringService.getConfiguration();
+
+        return DataSourceBuilder
+                .create()
+                .username(datasourceUsername)
+                .password(datasourcePassword)
+                .url(config.getURL(databaseName))
+                .driverClassName(datasourceDriver)
+                .build();
+    }
+}
\ No newline at end of file
 
 package org.onap.so.adapter_utils.tests;
 
 
+import org.apache.http.HttpHeaders;
+import org.apache.http.HttpStatus;
+import org.junit.Before;
 import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.onap.so.cloud.Application;
-import org.onap.so.openstack.utils.MsoCommonUtils;
+import org.onap.so.BaseTest;
+import org.onap.so.db.catalog.beans.AuthenticationType;
+import org.onap.so.db.catalog.beans.CloudIdentity;
+import org.onap.so.db.catalog.beans.CloudSite;
+import org.onap.so.db.catalog.beans.ServerType;
+import org.onap.so.openstack.exceptions.MsoCloudSiteNotFound;
 import org.onap.so.openstack.utils.MsoHeatUtils;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.boot.test.context.SpringBootTest;
-import org.springframework.test.context.ActiveProfiles;
-import org.springframework.test.context.junit4.SpringRunner;
+
+import javax.ws.rs.core.MediaType;
+import java.io.IOException;
+
+import static com.github.tomakehurst.wiremock.client.WireMock.*;
+import static com.github.tomakehurst.wiremock.client.WireMock.aResponse;
+import static com.github.tomakehurst.wiremock.client.WireMock.urlPathEqualTo;
 import static org.junit.Assert.assertEquals;
 
-/**
+/**PoConfigTest
  * This class implements test methods of the MsoHeatUtils
  *
  *
  */
-@RunWith(SpringRunner.class)
-@SpringBootTest(classes = Application.class)
-@ActiveProfiles("test")
-public class MsoHeatUtilsRefactorTest extends MsoCommonUtils {
+public class MsoHeatUtilsRefactorTest extends BaseTest {
 
        @Autowired
        private  MsoHeatUtils msoHeatUtils;
+
+       @Before
+       public void init() throws IOException {
+               CloudIdentity identity = new CloudIdentity();
+
+               identity.setId("MTN13");
+               identity.setMsoId("m93945");
+               identity.setMsoPass("93937EA01B94A10A49279D4572B48369");
+               identity.setAdminTenant("admin");
+               identity.setMemberRole("admin");
+               identity.setTenantMetadata(true);
+               identity.setIdentityUrl("http://localhost:28090/v2.0");
+               identity.setIdentityAuthenticationType(AuthenticationType.USERNAME_PASSWORD);
+
+               CloudSite cloudSite = new CloudSite();
+               cloudSite.setId("MTN13");
+               cloudSite.setCloudVersion("3.0");
+               cloudSite.setClli("MDT13");
+               cloudSite.setRegionId("MTN13");
+               identity.setIdentityServerType(ServerType.KEYSTONE);
+               cloudSite.setIdentityService(identity);
+
+
+               stubFor(get(urlPathEqualTo("/cloudSite/default")).willReturn(aResponse()
+                               .withBody(getBody(mapper.writeValueAsString(cloudSite),wireMockPort, ""))
+                               .withHeader(HttpHeaders.CONTENT_TYPE,MediaType.APPLICATION_JSON)
+                               .withStatus(HttpStatus.SC_OK)));
+               stubFor(get(urlPathEqualTo("/cloudIdentity/MTN13")).willReturn(aResponse()
+                               .withBody(getBody(mapper.writeValueAsString(identity),wireMockPort, ""))
+                               .withHeader(HttpHeaders.CONTENT_TYPE,MediaType.APPLICATION_JSON)
+                               .withStatus(HttpStatus.SC_OK)));
+       }
        
        @Test
-       public final void testGetKeystoneUrl() {
-               try {
-                       String keyUrl = msoHeatUtils.getCloudSiteKeystoneUrl("DAN");
-                       assertEquals("http://192.168.170.21:5000/v2.0",keyUrl);
-               } catch (Exception e) {
-                       
-               }
+       public final void testGetKeystoneUrl() throws MsoCloudSiteNotFound {
+               String keyUrl = msoHeatUtils.getCloudSiteKeystoneUrl("DAN");
+               assertEquals("http://localhost:28090/v2.0", keyUrl);
        }
-
-
 }
 
 import static org.junit.Assert.fail;
 import static org.mockito.Mockito.when;
 
-import java.security.GeneralSecurityException;
 import java.util.HashMap;
 import java.util.Map;
 
 import org.mockito.Mock;
 import org.mockito.runners.MockitoJUnitRunner;
 import org.onap.so.cloud.CloudConfig;
-import org.onap.so.cloud.CloudIdentity;
-import org.onap.so.cloud.CloudSite;
-import org.onap.so.cloud.ServerType;
+import org.onap.so.db.catalog.beans.CloudIdentity;
+import org.onap.so.db.catalog.beans.CloudSite;
+import org.onap.so.db.catalog.beans.ServerType;
 import org.onap.so.openstack.exceptions.MsoCloudSiteNotFound;
 import org.onap.so.openstack.exceptions.MsoException;
 import org.onap.so.openstack.exceptions.MsoIOException;
 
 
 import static org.junit.Assert.*;
 
-import java.util.Map;
 import java.util.Optional;
 
 import org.junit.Test;
-import org.junit.runner.RunWith;
 import org.onap.so.BaseTest;
+import org.onap.so.db.catalog.beans.AuthenticationType;
+import org.onap.so.db.catalog.beans.CloudIdentity;
+import org.onap.so.db.catalog.beans.CloudSite;
+import org.onap.so.db.catalog.beans.ServerType;
 import org.onap.so.openstack.exceptions.MsoException;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.boot.test.context.SpringBootTest;
-import org.springframework.test.context.ActiveProfiles;
-import org.springframework.test.context.junit4.SpringRunner;
 
 /**
  * This class implements test methods of the CloudConfig features.
  *
  *
  */
-public class CloudConfigTest extends BaseTest {
+public class CloudConfigTest extends BaseTest{
 
        @Autowired
        private CloudConfig con;
 
-   /**
-    * This method implements a test for the getCloudSites method.
-    */
-   @Test
-   public final void testGetCloudSites () {
-          Map<String,CloudSite> siteMap = con.getCloudSites();
-          assertNotNull(siteMap);
-
-          CloudSite site1 = siteMap.get("regionOne");
-
-          assertEquals ("regionOne", site1.getRegionId());
-          assertEquals ("MT_KEYSTONE", site1.getIdentityServiceId());
-          assertEquals ("MT2", site1.getClli());
-          assertEquals ("2.5", site1.getAicVersion());
-   }
-
-
-   /**
-    * This method implements a test for the getIdentityServices method.
- * @throws MsoException 
-    */
-   @Test
-   public final void testGetIdentityServices () throws MsoException {
-          Map<String,CloudIdentity> identityMap = con.getIdentityServices ();
-          assertNotNull(identityMap);
-
-          CloudIdentity identity1 = identityMap.get("MT_KEYSTONE");
-
-          assertEquals("john", identity1.getMsoId());
-          assertEquals("313DECE408AF7759D442D7B06DD9A6AA", identity1.getMsoPass());
-          assertEquals("admin", identity1.getAdminTenant());
-          assertEquals("_member_", identity1.getMemberRole());
-          assertEquals(false, identity1.hasTenantMetadata());
-          assertEquals("http://localhost:"+wireMockPort+"/v2.0", identity1.getIdentityUrl());
-          assertEquals(ServerType.KEYSTONE, identity1.getIdentityServerType());
-          assertEquals(AuthenticationType.USERNAME_PASSWORD, identity1.getIdentityAuthenticationType());
-
-   }
-
-   /**
-    * This method implements a test for the getCloudSite method.
-    */
-   @Test
-   public final void testGetDefaultCloudSite () {
-          Optional<CloudSite> site  = con.getCloudSite("NotThere");
-          assertTrue(site.isPresent());
-          CloudSite site1 = site.get();
-          assertEquals ("NotThere", site1.getRegionId());
-          assertEquals("MTN6", site1.getClli());
-          assertEquals("NotThere", site1.getId());
-          assertEquals ("ORDM3", site1.getIdentityServiceId());
-   }
-   
-   @Test
-   public void testGetIdentityService() {
-          CloudIdentity identity = con.getIdentityService("MT_KEYSTONE");
-          assertEquals("john", identity.getMsoId());
-          assertEquals("MT_KEYSTONE", identity.getId());
-   }
-
+       /**
+        * This method implements a test for the getCloudSite method.
+        */
+       @Test
+       public final void testGetCloudSite () {
+               CloudSite site1 = con.getCloudSite("MTN13").get();
+
+               assertEquals ("mtn13", site1.getRegionId());
+               assertEquals ("mtn13", site1.getIdentityServiceId());
+               assertEquals ("MDT13", site1.getClli());
+               assertEquals ("3.0", site1.getCloudVersion());
+       }
+
+
+       /**
+        * This method implements a test for the getIdentityServices method.
+        * @throws MsoException
+        */
+       @Test
+       public final void testGetIdentityServices () throws MsoException {
+
+               CloudIdentity identity1 = con.getIdentityService("mtn13");
+
+               assertEquals("m93945", identity1.getMsoId());
+               assertEquals("93937EA01B94A10A49279D4572B48369", identity1.getMsoPass());
+               assertEquals("admin", identity1.getAdminTenant());
+               assertEquals("admin", identity1.getMemberRole());
+               assertTrue(identity1.getIdentityUrl().contains("http://localhost:"));
+               assertEquals(ServerType.KEYSTONE, identity1.getIdentityServerType());
+               assertEquals(AuthenticationType.USERNAME_PASSWORD, identity1.getIdentityAuthenticationType());
+
+       }
+
+       /**
+        * This method implements a test for the getCloudSite method.
+        */
+       @Test
+       public final void testGetDefaultCloudSite () {
+               Optional<CloudSite> site  = con.getCloudSite("NotThere");
+               assertTrue(site.isPresent());
+               CloudSite site1 = site.get();
+               assertEquals ("NotThere", site1.getRegionId());
+               assertEquals("MDT13", site1.getClli());
+               assertEquals("NotThere", site1.getId());
+       }
+       
 }
 
 package org.onap.so.cloud;
 
 import org.junit.Test;
-import org.onap.so.openpojo.rules.EqualsAndHashCodeTester;
+import org.onap.so.db.catalog.beans.CloudIdentity;
+import org.onap.so.db.catalog.beans.CloudSite;
+import org.onap.so.db.catalog.beans.CloudifyManager;
 import org.onap.so.openpojo.rules.ToStringTester;
 
 import com.openpojo.reflection.PojoClass;
                                .with(new SetterTester())
                                .with(new GetterTester())
                                .with(new ToStringTester())
-                               .with(new EqualsAndHashCodeTester())
                                .build();
                validator.validate(pojoClass);
        }
 
 
 import org.junit.Test;
 import org.junit.runner.RunWith;
+import org.onap.so.BaseTest;
 import org.onap.so.cloud.Application;
-import org.onap.so.cloud.AuthenticationType;
-import org.onap.so.cloud.CloudIdentity;
+import org.onap.so.db.catalog.beans.AuthenticationType;
+import org.onap.so.db.catalog.beans.CloudIdentity;
 import org.onap.so.cloud.authentication.models.RackspaceAuthentication;
-import org.onap.so.openstack.exceptions.MsoException;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.boot.test.context.SpringBootTest;
 import org.springframework.test.context.ActiveProfiles;
  * only are tested.
  *
  */
-@RunWith(SpringRunner.class)
-@SpringBootTest(classes = Application.class)
-@ActiveProfiles("test")
-public class AuthenticationMethodTest {
+public class AuthenticationMethodTest extends BaseTest {
 
        @Autowired
        private AuthenticationMethodFactory authenticationMethodFactory;
 
 import org.onap.so.adapters.vdu.VduStateType;
 import org.onap.so.adapters.vdu.VduStatus;
 import org.onap.so.cloud.CloudConfig;
-import org.onap.so.cloud.CloudIdentity;
-import org.onap.so.cloud.CloudSite;
+import org.onap.so.db.catalog.beans.CloudIdentity;
+import org.onap.so.db.catalog.beans.CloudSite;
 import org.onap.so.cloudify.beans.DeploymentInfo;
 import org.onap.so.cloudify.beans.DeploymentStatus;
 import org.onap.so.cloudify.v3.client.Cloudify;
 import org.onap.so.cloudify.v3.model.AzureConfig;
-import org.onap.so.cloudify.v3.model.OpenstackConfig;
 import org.onap.so.openstack.exceptions.MsoException;
 
 public class MsoCloudifyUtilsTest2 {
 
 
 import org.junit.Test;
 import org.junit.runner.RunWith;
+import org.onap.so.BaseTest;
 import org.onap.so.cloud.Application;
 import org.onap.so.config.beans.PoConfig;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.test.context.ActiveProfiles;
 import org.springframework.test.context.junit4.SpringRunner;
 
-@RunWith(SpringRunner.class)
-@SpringBootTest(classes = Application.class)
-@ActiveProfiles("test")
-public class PoConfigTest {
+public class PoConfigTest extends BaseTest {
 
        
        @Autowired
 
 import org.junit.Test;
 import org.onap.so.BaseTest;
 
-public class HeatCacheEntryTest extends BaseTest {
+public class HeatCacheEntryTest {
        
        private static final String HEAT_URL = "testHeatUrl";
        private static final String TOKEN = "testToken";
 
 import org.junit.Test;
 import org.onap.so.BaseTest;
 
-public class NeutronCacheEntryTest extends BaseTest {
+public class NeutronCacheEntryTest {
        
        private static final String NEUTRON_URL = "testNeutronUrl";
        private static final String TOKEN = "testToken";
 
 import com.openpojo.validation.test.impl.GetterTester;
 import com.openpojo.validation.test.impl.SetterTester;
 
-public class OpenstackBeansPojoTest extends BaseTest {
+public class OpenstackBeansPojoTest {
        @Test
        public void pojoStructure() {
                test(PojoClassFactory.getPojoClass(VnfRollback.class));
 
 import org.onap.so.adapters.vdu.VduModelInfo;
 import org.onap.so.adapters.vdu.VduStateType;
 import org.onap.so.adapters.vdu.VduStatus;
+import org.onap.so.cloud.CloudConfig;
+import org.onap.so.db.catalog.beans.CloudSite;
+import org.onap.so.openstack.beans.HeatStatus;
+import org.onap.so.openstack.beans.StackInfo;
 import org.onap.so.openstack.exceptions.MsoException;
 
 import org.springframework.beans.factory.annotation.Autowired;
                expected.setStatus(status);
 
                CloudInfo cloudInfo = new CloudInfo();
-               cloudInfo.setCloudSiteId("regionOne");
+               cloudInfo.setCloudSiteId("MTN13");
                cloudInfo.setTenantId("tenantId");
                VduModelInfo vduModel = new VduModelInfo();
                vduModel.setModelCustomizationUUID("blueprintId");
                expected.setStatus(status);
 
                CloudInfo cloudInfo = new CloudInfo();
-               cloudInfo.setCloudSiteId("regionOne");
+               cloudInfo.setCloudSiteId("mtn13");
                cloudInfo.setTenantId("tenantId");
                String instanceId = "instanceId";
 
                expected.setStatus(status);
 
                CloudInfo cloudInfo = new CloudInfo();
-               cloudInfo.setCloudSiteId("regionOne");
+               cloudInfo.setCloudSiteId("mtn13");
                cloudInfo.setTenantId("tenantId");
                String instanceId = "instanceId";
 
 
 import static org.mockito.Matchers.any;
 import static org.mockito.Matchers.isA;
 import static org.mockito.Mockito.doReturn;
-import static org.mockito.Mockito.times;
 import static org.mockito.Mockito.verify;
 
 import java.io.File;
 import org.junit.runner.RunWith;
 import org.mockito.InjectMocks;
 import org.mockito.Mock;
-import org.mockito.Mockito;
 import org.mockito.MockitoAnnotations;
 import org.mockito.Spy;
 import org.mockito.runners.MockitoJUnitRunner;
 import org.onap.so.TestDataSetup;
 import org.onap.so.cloud.CloudConfig;
-import org.onap.so.cloud.CloudSite;
+import org.onap.so.db.catalog.beans.CloudSite;
 import org.onap.so.openstack.beans.HeatStatus;
 import org.onap.so.openstack.beans.StackInfo;
 import org.onap.so.openstack.exceptions.MsoException;
 import com.fasterxml.jackson.databind.JsonMappingException;
 import com.woorea.openstack.base.client.OpenStackRequest;
 import com.woorea.openstack.heat.Heat;
-import com.woorea.openstack.heat.StackResource;
-import com.woorea.openstack.heat.StackResource.UpdateStack;
 import com.woorea.openstack.heat.model.Stack;
-import com.woorea.openstack.heat.model.UpdateStackParam;
 
 @RunWith(MockitoJUnitRunner.class)
 public class MsoHeatUtilsWithUpdateTest extends TestDataSetup {
        
        @Test
        public void updateStackTest() throws MsoException, JsonParseException, JsonMappingException, IOException {
-               CloudSite cloudSite = mapper.readValue(new File(RESOURCE_PATH + "CloudSite.json"), CloudSite.class);
+               CloudSite cloudSite = new CloudSite();
                Heat heatClient = new Heat("endpoint");
                Stack heatStack = mapper.readValue(new File(RESOURCE_PATH + "HeatStack.json"), Stack.class);
                Stack updateStack = mapper.readValue(new File(RESOURCE_PATH + "UpdateStack.json"), Stack.class);
        public void updateStackWithEnvironmentTest() throws JsonParseException, JsonMappingException, IOException, MsoException {
                String environmentString = "environmentString";
                
-               CloudSite cloudSite = mapper.readValue(new File(RESOURCE_PATH + "CloudSite.json"), CloudSite.class);
+               CloudSite cloudSite = new CloudSite();
                Heat heatClient = new Heat("endpoint");
                Stack heatStack = mapper.readValue(new File(RESOURCE_PATH + "HeatStack.json"), Stack.class);
                Stack updateStack = mapper.readValue(new File(RESOURCE_PATH + "UpdateStack.json"), Stack.class);
                Map<String, Object> files = new HashMap<>();
                files.put("file1", new Object());
                
-               CloudSite cloudSite = mapper.readValue(new File(RESOURCE_PATH + "CloudSite.json"), CloudSite.class);
+               CloudSite cloudSite = new CloudSite();
                Heat heatClient = new Heat("endpoint");
                Stack heatStack = mapper.readValue(new File(RESOURCE_PATH + "HeatStack.json"), Stack.class);
                Stack updateStack = mapper.readValue(new File(RESOURCE_PATH + "UpdateStack.json"), Stack.class);
 
 
         StubOpenStack.mockOpenStackGetUserById("john");
         StubOpenStack.mockOpenStackGetRoles_200("OS-KSADM");
-        String response = msoKeystoneUtils.createTenant("tenant", "regionOne", new HashMap<>(), true);
+        String response = msoKeystoneUtils.createTenant("tenant", "MTN13", new HashMap<>(), true);
 
         Assert.assertEquals("tenantId", response);
     }
 
         StubOpenStack.mockOpenStackGetUserByName("john");
         StubOpenStack.mockOpenStackGetRoles_200("OS-KSADM");
-        String response = msoKeystoneUtils.createTenant("tenant", "regionOne", new HashMap<>(), true);
+        String response = msoKeystoneUtils.createTenant("tenant", "MTN13", new HashMap<>(), true);
         Assert.assertEquals("tenantId", response);
 
     }
         StubOpenStack.mockOpenStackPostTenantWithBodyFile_200();
         StubOpenStack.mockOpenStackGetUserByName_500("john");
         StubOpenStack.mockOpenStackGetRoles_200("OS-KSADM");
-        msoKeystoneUtils.createTenant("tenant", "regionOne", new HashMap<>(), true);
+        msoKeystoneUtils.createTenant("tenant", "Test", new HashMap<>(), true);
     }
 
     @Test
     public void queryTenantTest() throws Exception {
         StubOpenStack.mockOpenStackGetTenantById("tenantId");
 
-        MsoTenant msoTenant = msoKeystoneUtils.queryTenant("tenantId", "regionOne");
+        MsoTenant msoTenant = msoKeystoneUtils.queryTenant("tenantId", "MTN13");
 
         Assert.assertEquals("testingTenantName", msoTenant.getTenantName());
     }
     public void queryTenantByNameTest() throws Exception {
         StubOpenStack.mockOpenStackGetTenantByName("tenant");
 
-        MsoTenant msoTenant = msoKeystoneUtils.queryTenantByName("tenant", "regionOne");
+        MsoTenant msoTenant = msoKeystoneUtils.queryTenantByName("tenant", "MTN13");
 
         Assert.assertEquals("testingTenantName", msoTenant.getTenantName());
     }
     public void deleteTenantTest() throws Exception {
         StubOpenStack.mockOpenStackGetTenantById("tenantId");
         StubOpenStack.mockOpenStackDeleteTenantById_200("tenantId");
-        boolean result = msoKeystoneUtils.deleteTenant("tenantId", "regionOne");
+        boolean result = msoKeystoneUtils.deleteTenant("tenantId", "MTN13");
 
         Assert.assertTrue(result);
     }
     public void deleteTenantByNameTest() throws Exception {
         StubOpenStack.mockOpenStackGetTenantByName("tenant");
         StubOpenStack.mockOpenStackDeleteTenantById_200("tenantId");
-        boolean result = msoKeystoneUtils.deleteTenantByName("tenant", "regionOne");
+        boolean result = msoKeystoneUtils.deleteTenantByName("tenant", "MTN13");
 
         Assert.assertTrue(result);
     }
 
     @Test
     public void createNetworkTest_OpenStackBaseException() throws Exception {
         expectedException.expect(MsoException.class);
-        msoNeutronUtils.createNetwork("regionOne", "tenantId", 
+        msoNeutronUtils.createNetwork("MTN13", "tenantId", 
                 MsoNeutronUtils.NetworkType.PROVIDER,"networkName", "PROVIDER", vlans);
     }
 
     @Test
     public void createNetworkTest_NetworkTypeAsMultiProvider() throws Exception {
         StubOpenStack.mockOpenstackPostNetwork("OpenstackCreateNeutronNetworkResponse.json");
-        NetworkInfo networkInfo = msoNeutronUtils.createNetwork("regionOne", "tenantId",
+        NetworkInfo networkInfo = msoNeutronUtils.createNetwork("MTN13", "tenantId",
                 MsoNeutronUtils.NetworkType.MULTI_PROVIDER,"networkName","PROVIDER", vlans);
 
         Assert.assertEquals("2a4017ef-31ff-496a-9294-e96ecc3bc9c9",networkInfo.getId());
     @Test
     public void createNetworkTest() throws Exception {
         StubOpenStack.mockOpenstackPostNetwork("OpenstackCreateNeutronNetworkResponse.json");
-        NetworkInfo networkInfo = msoNeutronUtils.createNetwork("regionOne", "tenantId",
+        NetworkInfo networkInfo = msoNeutronUtils.createNetwork("MTN13", "tenantId",
                 MsoNeutronUtils.NetworkType.PROVIDER,"networkName","PROVIDER", vlans);
 
         Assert.assertEquals("2a4017ef-31ff-496a-9294-e96ecc3bc9c9",networkInfo.getId());
     @Test
     public void queryNetworkTest() throws Exception {
         StubOpenStack.mockOpenStackGetNeutronNetwork("GetNeutronNetwork.json", "43173f6a-d699-414b-888f-ab243dda6dfe");
-        NetworkInfo networkInfo = msoNeutronUtils.queryNetwork("43173f6a-d699-414b-888f-ab243dda6dfe", "tenantId","regionOne");
+        NetworkInfo networkInfo = msoNeutronUtils.queryNetwork("43173f6a-d699-414b-888f-ab243dda6dfe", "tenantId","MTN13");
 
         Assert.assertEquals("net1",networkInfo.getName());
     }
 
     @Test
     public void queryNetworkTest_404() throws Exception {
-        NetworkInfo networkInfo = msoNeutronUtils.queryNetwork("43173f6a-d699-414b-888f-ab243dda6dfe", "tenantId","regionOne");
+        NetworkInfo networkInfo = msoNeutronUtils.queryNetwork("43173f6a-d699-414b-888f-ab243dda6dfe", "tenantId","MTN13");
         Assert.assertNull(networkInfo);
     }
 
     public void queryNetworkTest_500() throws Exception {
         expectedException.expect(MsoException.class);
         StubOpenStack.mockOpenStackGetNeutronNetwork_500("43173f6a-d699-414b-888f-ab243dda6dfe");
-        msoNeutronUtils.queryNetwork("43173f6a-d699-414b-888f-ab243dda6dfe", "tenantId","regionOne");
+        msoNeutronUtils.queryNetwork("43173f6a-d699-414b-888f-ab243dda6dfe", "tenantId","MTN13");
 
     }
 
     public void deleteNetworkkTest() throws Exception {
         StubOpenStack.mockOpenStackGetNeutronNetwork("GetNeutronNetwork.json", "43173f6a-d699-414b-888f-ab243dda6dfe");
         StubOpenStack.mockOpenStackDeleteNeutronNetwork("43173f6a-d699-414b-888f-ab243dda6dfe");
-        Boolean result = msoNeutronUtils.deleteNetwork("43173f6a-d699-414b-888f-ab243dda6dfe", "tenantId","regionOne");
+        Boolean result = msoNeutronUtils.deleteNetwork("43173f6a-d699-414b-888f-ab243dda6dfe", "tenantId","MTN13");
 
         Assert.assertTrue(result);
     }
     public void updateNetworkTest() throws Exception {
         StubOpenStack.mockOpenStackGetNeutronNetwork("GetNeutronNetwork.json", "43173f6a-d699-414b-888f-ab243dda6dfe");
         StubOpenStack.mockOpenstackPutNetwork("OpenstackCreateNeutronNetworkResponse.json", "43173f6a-d699-414b-888f-ab243dda6dfe");
-        NetworkInfo networkInfo = msoNeutronUtils.updateNetwork("regionOne", "tenantId",
+        NetworkInfo networkInfo = msoNeutronUtils.updateNetwork("MTN13", "tenantId",
                 "43173f6a-d699-414b-888f-ab243dda6dfe",MsoNeutronUtils.NetworkType.PROVIDER,"PROVIDER", vlans);
 
         Assert.assertEquals("2a4017ef-31ff-496a-9294-e96ecc3bc9c9",networkInfo.getId());
     public void updateNetworkTest_NetworkTypeAsMultiProvider() throws Exception {
         StubOpenStack.mockOpenStackGetNeutronNetwork("GetNeutronNetwork.json", "43173f6a-d699-414b-888f-ab243dda6dfe");
         StubOpenStack.mockOpenstackPutNetwork("OpenstackCreateNeutronNetworkResponse.json", "43173f6a-d699-414b-888f-ab243dda6dfe");
-        NetworkInfo networkInfo = msoNeutronUtils.updateNetwork("regionOne", "tenantId",
+        NetworkInfo networkInfo = msoNeutronUtils.updateNetwork("MTN13", "tenantId",
                 "43173f6a-d699-414b-888f-ab243dda6dfe",MsoNeutronUtils.NetworkType.MULTI_PROVIDER,"PROVIDER", vlans);
 
         Assert.assertEquals("2a4017ef-31ff-496a-9294-e96ecc3bc9c9",networkInfo.getId());
 
                                "name": null,
                                "endpoints": [
                                        {
-                                               "region": "regionOne",
+                                               "region": "mtn13",
                                                "publicURL": "port",
                                                "internalURL": null,
                                                "adminURL": null
                                "name": null,
                                "endpoints": [
                                        {
-                                               "region": "regionOne",
+                                               "region": "mtn13",
                                                "publicURL": "port",
                                                "internalURL": null,
                                                "adminURL": null
                                "name": null,
                                "endpoints": [
                                        {
-                                               "region": "regionOne",
+                                               "region": "mtn13",
                                                "publicURL": "port",
                                                "internalURL": null,
                                                "adminURL": null
 
 # will be used as entry in DB to say SITE OFF/ON for healthcheck
 # MSO Properties go here
-mso:
-  catalog:
-    db:
-      spring:
-        endpoint: "http://localhost:"
-  db:
-    auth: Basic YnBlbDptc28tZGItMTUwNyE=
 cloud_config:
   identity_services:
     MT_KEYSTONE:
     orm_url_replace_with_this: "7080"
     quota_value: "10"
     set_default_quota: "false"
+      
+server-port: 8080
+ssl-enable: false
+tomcat:
+  max-threads: 50
+mso:
+  logPath: logs
+  catalog:
+    db:
+      spring:
+        endpoint: http://localhost:${wiremock.server.port}
+  db:
+    auth: Basic YnBlbDptc28tZGItMTUwNyE=
+  site-name: localDevEnv
+  async:
+    core-pool-size: 50
+    max-pool-size: 50
+    queue-capacity: 500
+spring:
+  datasource:
+    url: jdbc:mariadb://localhost:3307/catalogdb
+    username: root
+    password: password
+    driver-class-name: org.mariadb.jdbc.Driver    
+    initialize: true
+    initialization-mode: never
+  jpa:   
+    generate-ddl: false
+    show-sql: false
+    hibernate:      
+      ddl-auto: none
+      naming-strategy: org.hibernate.cfg.ImprovedNamingStrategy
+      enable-lazy-load-no-trans: true
+    database-platform: org.hibernate.dialect.MySQL5InnoDBDialect
+
+mariaDB4j:
+  dataDir: 
+  port: 3307
+  databaseName: catalogdb
+
+
+#Actuator
+management: 
+  endpoints:
+    enabled-by-default: false
+  endpoint:
+    info:
+      enabled: true
\ No newline at end of file
 
--- /dev/null
+INSERT INTO `cloudify_managers` (`ID`, `CLOUDIFY_URL`, `USERNAME`, `PASSWORD`, `VERSION`, `CREATION_TIMESTAMP`, `UPDATE_TIMESTAMP`) VALUES ('mtn13', 'http://localhost:28090/v2.0', 'm93945', '93937EA01B94A10A49279D4572B48369', NULL, '2018-07-17 14:05:08', '2018-07-17 14:05:08');
+
+INSERT INTO `cloud_sites` (`ID`, `region_id`, `identity_service_id`, `cloud_version`, `clli`, `cloudify_id`, `platform`, `orchestrator`, `CREATION_TIMESTAMP`, `UPDATE_TIMESTAMP`) VALUES ('MTN13', 'mtn13', 'MTN13', '3.0', 'MDT13', 'mtn13', null, 'orchestrator', '2018-07-17 14:06:28', '2018-07-17 14:06:28');
\ No newline at end of file
 
--- /dev/null
+
+CREATE TABLE IF NOT EXISTS `identity_services` (
+  `ID` varchar(50) NOT NULL,
+  `IDENTITY_URL` varchar(200) DEFAULT NULL,
+  `MSO_ID` varchar(255) DEFAULT NULL,
+  `MSO_PASS` varchar(255) DEFAULT NULL,
+  `ADMIN_TENANT` varchar(50) DEFAULT NULL,
+  `MEMBER_ROLE` varchar(50) DEFAULT NULL,
+  `TENANT_METADATA` tinyint(1) DEFAULT 0,
+  `IDENTITY_SERVER_TYPE` varchar(50) DEFAULT NULL,
+  `IDENTITY_AUTHENTICATION_TYPE` varchar(50) DEFAULT NULL,
+  `LAST_UPDATED_BY` varchar(120) DEFAULT NULL,
+  `CREATION_TIMESTAMP` timestamp NULL DEFAULT current_timestamp(),
+  `UPDATE_TIMESTAMP` timestamp NULL DEFAULT current_timestamp(),
+  PRIMARY KEY (`ID`)
+) ;
+
+
+CREATE TABLE IF NOT EXISTS `cloudify_managers` (
+  `ID` varchar(50) NOT NULL,
+  `CLOUDIFY_URL` varchar(200) DEFAULT NULL,
+  `USERNAME` varchar(255) DEFAULT NULL,
+  `PASSWORD` varchar(255) DEFAULT NULL,
+  `VERSION` varchar(20) DEFAULT NULL,
+  `LAST_UPDATED_BY` varchar(120) DEFAULT NULL,
+  `CREATION_TIMESTAMP` timestamp NULL DEFAULT current_timestamp(),
+  `UPDATE_TIMESTAMP` timestamp NULL DEFAULT current_timestamp(),
+  PRIMARY KEY (`ID`)
+) ;
+
+
+CREATE TABLE IF NOT EXISTS `cloud_sites` (
+  `ID` varchar(50) NOT NULL,
+  `REGION_ID` varchar(11)  DEFAULT NULL,
+  `IDENTITY_SERVICE_ID` varchar(50)  DEFAULT NULL,
+  `CLOUD_VERSION` varchar(20)  DEFAULT NULL,
+  `CLLI` varchar(11)  DEFAULT NULL,
+  `CLOUDIFY_ID` varchar(50)  DEFAULT NULL,
+  `PLATFORM` varchar(50)  DEFAULT NULL,
+  `ORCHESTRATOR` varchar(50)  DEFAULT NULL,
+  `LAST_UPDATED_BY` varchar(120) DEFAULT NULL,
+  `CREATION_TIMESTAMP` timestamp NULL DEFAULT current_timestamp(),
+  `UPDATE_TIMESTAMP` timestamp NULL DEFAULT current_timestamp(),
+  PRIMARY KEY (`ID`),
+  KEY `FK_cloud_sites_identity_services` (`IDENTITY_SERVICE_ID`),
+  CONSTRAINT `FK_cloud_sites_identity_services` FOREIGN KEY (`IDENTITY_SERVICE_ID`) REFERENCES `identity_services` (`ID`)
+) ;
\ No newline at end of file
 
 
+CREATE TABLE IF NOT EXISTS `identity_services` (
+  `ID` varchar(50) NOT NULL,
+  `IDENTITY_URL` varchar(200) DEFAULT NULL,
+  `MSO_ID` varchar(255) DEFAULT NULL,
+  `MSO_PASS` varchar(255) DEFAULT NULL,
+  `ADMIN_TENANT` varchar(50) DEFAULT NULL,
+  `MEMBER_ROLE` varchar(50) DEFAULT NULL,
+  `TENANT_METADATA` tinyint(1) DEFAULT 0,
+  `IDENTITY_SERVER_TYPE` varchar(50) DEFAULT NULL,
+  `IDENTITY_AUTHENTICATION_TYPE` varchar(50) DEFAULT NULL,
+  `LAST_UPDATED_BY` varchar(120) DEFAULT NULL,
+  `CREATION_TIMESTAMP` timestamp NULL DEFAULT current_timestamp(),
+  `UPDATE_TIMESTAMP` timestamp NULL DEFAULT current_timestamp(),
+  PRIMARY KEY (`ID`)
+) ;
+
+
+
+CREATE TABLE IF NOT EXISTS `cloudify_managers` (
+  `ID` varchar(50) NOT NULL,
+  `CLOUDIFY_URL` varchar(200) DEFAULT NULL,
+  `USERNAME` varchar(255) DEFAULT NULL,
+  `PASSWORD` varchar(255) DEFAULT NULL,
+  `VERSION` varchar(20) DEFAULT NULL,
+  `LAST_UPDATED_BY` varchar(120) DEFAULT NULL,
+  `CREATION_TIMESTAMP` timestamp NULL DEFAULT current_timestamp(),
+  `UPDATE_TIMESTAMP` timestamp NULL DEFAULT current_timestamp(),
+  PRIMARY KEY (`ID`)
+) ;
+
+
+
+
+CREATE TABLE IF NOT EXISTS `cloud_sites` (
+  `ID` varchar(50) NOT NULL,
+  `REGION_ID` varchar(11)  DEFAULT NULL,
+  `IDENTITY_SERVICE_ID` varchar(50)  DEFAULT NULL,
+  `CLOUD_VERSION` varchar(20)  DEFAULT NULL,
+  `CLLI` varchar(11)  DEFAULT NULL,
+  `CLOUDIFY_ID` varchar(50)  DEFAULT NULL,
+  `PLATFORM` varchar(50)  DEFAULT NULL,
+  `ORCHESTRATOR` varchar(50)  DEFAULT NULL,
+  `LAST_UPDATED_BY` varchar(120) DEFAULT NULL,
+  `CREATION_TIMESTAMP` timestamp NULL DEFAULT current_timestamp(),
+  `UPDATE_TIMESTAMP` timestamp NULL DEFAULT current_timestamp(),
+  PRIMARY KEY (`ID`),
+  KEY `FK_cloud_sites_identity_services` (`IDENTITY_SERVICE_ID`),
+  CONSTRAINT `FK_cloud_sites_identity_services` FOREIGN KEY (`IDENTITY_SERVICE_ID`) REFERENCES `identity_services` (`ID`)
+) ;
+
 insert into heat_files(artifact_uuid, name, version, description, body, artifact_checksum, creation_timestamp) values
 ('00535bdd-0878-4478-b95a-c575c742bfb0', 'nimbus-ethernet-gw', '1', 'created from csar', 'DEVICE=$dev\nBOOTPROTO=none\nNM_CONTROLLED=no\nIPADDR=$ip\nNETMASK=$netmask\nGATEWAY=$gateway\n', 'MANUAL RECORD', '2017-01-21 23:56:43');
 
 
                        <artifactId>spring-boot-starter-test</artifactId>
                        <scope>test</scope>
                </dependency>
+               <dependency>
+                       <groupId>com.fasterxml.jackson.core</groupId>
+                       <artifactId>jackson-databind</artifactId>
+               </dependency>
                <dependency>
                <groupId>janino</groupId>
                <artifactId>janino</artifactId>
                        <version>1.2.4.RELEASE</version>
                        <scope>test</scope>
                </dependency>
+               <dependency>
+                       <groupId>org.flywaydb</groupId>
+                       <artifactId>flyway-core</artifactId>
+               </dependency>
        </dependencies>
 </project>
 
--- /dev/null
+package db.migration;
+
+import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import org.onap.so.db.catalog.beans.CloudIdentity;
+import org.onap.so.db.catalog.beans.CloudSite;
+import org.onap.so.db.catalog.beans.CloudifyManager;
+
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * @deprecated
+ * This class is introduced as deprecated as its only purpose is for migration of cloud config data. It shouldnt be used elsewhere.
+ */
+
+@Deprecated
+@JsonIgnoreProperties(ignoreUnknown = true)
+public class CloudConfig {
+    @JsonProperty("identity_services")
+    private Map<String, CloudIdentity> identityServices = new HashMap<>();
+
+    @JsonProperty("cloud_sites")
+    private Map<String, CloudSite> cloudSites = new HashMap<>();
+
+    @JsonProperty("cloudify_managers")
+    private Map<String, CloudifyManager> cloudifyManagers = new HashMap<>();
+
+
+    public Map<String, CloudIdentity> getIdentityServices() {
+        return identityServices;
+    }
+
+    public void setIdentityServices(Map<String, CloudIdentity> identityServices) {
+        this.identityServices = identityServices;
+    }
+
+    public Map<String, CloudSite> getCloudSites() {
+        return cloudSites;
+    }
+
+    public void setCloudSites(Map<String, CloudSite> cloudSites) {
+        this.cloudSites = cloudSites;
+    }
+
+    public Map<String, CloudifyManager> getCloudifyManagers() {
+        return cloudifyManagers;
+    }
+
+    public void setCloudifyManagers(Map<String, CloudifyManager> cloudifyManagers) {
+        this.cloudifyManagers = cloudifyManagers;
+    }
+
+    public void populateId(){
+        for (Map.Entry<String, CloudIdentity> entry : identityServices.entrySet()) {
+            entry.getValue().setId(entry.getKey());
+        }
+
+        for (Map.Entry <String, CloudSite> entry : cloudSites.entrySet()) {
+            entry.getValue().setId(entry.getKey());
+        }
+
+        for (Map.Entry<String, CloudifyManager> entry : cloudifyManagers.entrySet()) {
+            entry.getValue().setId(entry.getKey());
+        }
+    }
+}
 
--- /dev/null
+package db.migration;
+
+import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.dataformat.yaml.YAMLFactory;
+import org.flywaydb.core.api.MigrationVersion;
+import org.flywaydb.core.api.migration.MigrationChecksumProvider;
+import org.flywaydb.core.api.migration.MigrationInfoProvider;
+import org.flywaydb.core.api.migration.jdbc.JdbcMigration;
+import org.onap.so.db.catalog.beans.CloudIdentity;
+import org.onap.so.db.catalog.beans.CloudSite;
+import org.onap.so.db.catalog.beans.CloudifyManager;
+import org.onap.so.logger.MsoLogger;
+
+import java.sql.Connection;
+import java.sql.PreparedStatement;
+import java.sql.ResultSet;
+import java.sql.Statement;
+import java.util.Collection;
+
+/**
+ * Performs migration using JDBC Connection from the cloud config provided in the environment (application-{profile}.yaml) and persist data (when not already present) to the catalod database.
+ */
+@JsonIgnoreProperties(ignoreUnknown = true)
+public class R__CloudConfigMigration implements JdbcMigration , MigrationInfoProvider, MigrationChecksumProvider {
+    public static final String FLYWAY = "FLYWAY";
+
+    private static final MsoLogger LOGGER = MsoLogger.getMsoLogger(MsoLogger.Catalog.RA, R__CloudConfigMigration.class);
+    @JsonProperty("cloud_config")
+    private CloudConfig cloudConfig;
+
+    @Override
+    public void migrate(Connection connection) throws Exception {
+        LOGGER.debug("Starting migration for CloudConfig");
+        CloudConfig cloudConfig = loadCloudConfig();
+        if(cloudConfig == null){
+            LOGGER.debug("No CloudConfig defined in :"+getApplicationYamlName()+" exiting.");
+        }else{
+            migrateCloudIdentity(cloudConfig.getIdentityServices().values(), connection);
+            migrateCloudSite(cloudConfig.getCloudSites().values(), connection);
+            migrateCloudifyManagers(cloudConfig.getCloudifyManagers().values(), connection);
+        }
+    }
+
+    public CloudConfig getCloudConfig() {
+        return cloudConfig;
+    }
+
+    public void setCloudConfig(CloudConfig cloudConfig) {
+        this.cloudConfig = cloudConfig;
+    }
+
+    private CloudConfig loadCloudConfig() throws Exception {
+        ObjectMapper mapper = new ObjectMapper(new YAMLFactory());
+        R__CloudConfigMigration cloudConfigMigration = mapper.readValue(R__CloudConfigMigration.class
+                .getResourceAsStream(getApplicationYamlName()), R__CloudConfigMigration.class);
+        CloudConfig cloudConfig = cloudConfigMigration.getCloudConfig();
+        if(cloudConfig != null){
+            cloudConfig.populateId();
+        }
+
+        return cloudConfig;
+    }
+
+    private String getApplicationYamlName() {
+        String profile = System.getProperty("spring.profiles.active") == null ? "" : "-" + System.getProperty("spring.profiles.active");
+        return "/application" + profile + ".yaml";
+    }
+
+    private void migrateCloudIdentity(Collection<CloudIdentity> entities, Connection connection) throws Exception {
+        LOGGER.debug("Starting migration for CloudConfig-->IdentityService");
+        String insert = "INSERT INTO `identity_services` (`ID`, `IDENTITY_URL`, `MSO_ID`, `MSO_PASS`, `ADMIN_TENANT`, `MEMBER_ROLE`, `TENANT_METADATA`, `IDENTITY_SERVER_TYPE`, `IDENTITY_AUTHENTICATION_TYPE`, `LAST_UPDATED_BY`) " +
+                "VALUES (?,?,?,?,?,?,?,?,?,?);";
+        PreparedStatement ps = connection.prepareStatement(insert);
+        try (Statement stmt = connection.createStatement()) {
+            for (CloudIdentity cloudIdentity : entities) {
+                try (ResultSet rows = stmt.executeQuery("Select count(1) from identity_services where id='" + cloudIdentity.getId() + "'")) {
+                    int count = 0;
+                    while (rows.next()) {
+                        count = rows.getInt(1);
+                    }
+                    if (count == 0) {
+                        ps.setString(1, cloudIdentity.getId());
+                        ps.setString(2, cloudIdentity.getIdentityUrl());
+                        ps.setString(3, cloudIdentity.getMsoId());
+                        ps.setString(4, cloudIdentity.getMsoPass());
+                        ps.setString(5, cloudIdentity.getAdminTenant());
+                        ps.setString(6, cloudIdentity.getMemberRole());
+                        ps.setBoolean(7, cloudIdentity.getTenantMetadata());
+                        ps.setString(8, cloudIdentity.getIdentityServerType() != null ? cloudIdentity.getIdentityServerType().name() : null);
+                        ps.setString(9, cloudIdentity.getIdentityAuthenticationType() != null ? cloudIdentity.getIdentityAuthenticationType().name() : null);
+                        ps.setString(10, FLYWAY);
+                        ps.executeUpdate();
+                    }
+                }
+            }
+        }
+    }
+
+    private void migrateCloudSite(Collection<CloudSite> entities, Connection connection) throws Exception {
+        LOGGER.debug("Starting migration for CloudConfig-->CloudSite");
+        String insert = "INSERT INTO `cloud_sites` (`ID`, `REGION_ID`, `IDENTITY_SERVICE_ID`, `CLOUD_VERSION`, `CLLI`, `CLOUDIFY_ID`, `PLATFORM`, `ORCHESTRATOR`, `LAST_UPDATED_BY`) " +
+                "VALUES (?,?,?,?,?,?,?,?,?);";
+        PreparedStatement ps = connection.prepareStatement(insert);
+        try (Statement stmt = connection.createStatement()) {
+            for (CloudSite cloudSite : entities) {
+                try (ResultSet rows = stmt.executeQuery("Select count(1) from cloud_sites where id='" + cloudSite.getId() + "'")) {
+                    int count = 0;
+                    while (rows.next()) {
+                        count = rows.getInt(1);
+                    }
+                    if (count == 0) {
+                        ps.setString(1, cloudSite.getId());
+                        ps.setString(2, cloudSite.getRegionId());
+                        ps.setString(3, cloudSite.getIdentityServiceId());
+                        ps.setString(4, cloudSite.getCloudVersion());
+                        ps.setString(5, cloudSite.getClli());
+                        ps.setString(6, cloudSite.getCloudifyId());
+                        ps.setString(7, cloudSite.getPlatform());
+                        ps.setString(8, cloudSite.getOrchestrator());
+                        ps.setString(9, FLYWAY);
+                        ps.executeUpdate();
+                    }
+                }
+            }
+        }
+    }
+
+    private void migrateCloudifyManagers(Collection<CloudifyManager> entities, Connection connection) throws Exception {
+        String insert = "INSERT INTO `cloudify_managers` (`ID`, `CLOUDIFY_URL`, `USERNAME`, `PASSWORD`, `VERSION`, `LAST_UPDATED_BY`)" +
+                " VALUES (?,?,?,?,?,?);";
+        PreparedStatement ps = connection.prepareStatement(insert);
+        try (Statement stmt = connection.createStatement()) {
+            for (CloudifyManager cloudifyManager : entities) {
+                try (ResultSet rows = stmt.executeQuery("Select count(1) from cloudify_managers where id='" + cloudifyManager.getId() + "'")) {
+                    int count = 0;
+                    while (rows.next()) {
+                        count = rows.getInt(1);
+                    }
+                    if (count == 0) {
+                        ps.setString(1, cloudifyManager.getId());
+                        ps.setString(2, cloudifyManager.getCloudifyUrl());
+                        ps.setString(3, cloudifyManager.getUsername());
+                        ps.setString(4, cloudifyManager.getPassword());
+                        ps.setString(5, cloudifyManager.getVersion());
+                        ps.setString(6, FLYWAY);
+                        ps.executeUpdate();
+                    }
+                }
+            }
+        }
+    }
+
+    public MigrationVersion getVersion() {
+        return null;
+    }
+
+    public String getDescription() {
+        return "R_CloudConfigMigration";
+    }
+
+    public Integer getChecksum() {
+        return Math.toIntExact(System.currentTimeMillis() / 1000);
+    }
+}
+
 
--- /dev/null
+package db.migration;
+
+import org.flywaydb.core.api.migration.jdbc.JdbcMigration;
+
+import java.sql.Connection;
+
+public class V4_2__DummyMigration implements JdbcMigration {
+    @Override
+    public void migrate(Connection connection) throws Exception {
+        
+    }
+}
 
 import org.onap.so.adapters.network.exceptions.NetworkException;
 import org.onap.so.adapters.network.mappers.ContrailSubnetMapper;
 import org.onap.so.cloud.CloudConfig;
-import org.onap.so.cloud.CloudSite;
+import org.onap.so.db.catalog.beans.CloudSite;
 import org.onap.so.db.catalog.beans.HeatTemplate;
 import org.onap.so.db.catalog.beans.NetworkResource;
 import org.onap.so.db.catalog.beans.NetworkResourceCustomization;
                        }
 
                        MavenLikeVersioning aicV = new MavenLikeVersioning();
-                       aicV.setVersion(cloudSite.getAicVersion());
+                       aicV.setVersion(cloudSite.getCloudVersion());
                        if ((aicV.isMoreRecentThan(networkResource.getAicVersionMin()) || aicV
                                        .isTheSameVersion(networkResource.getAicVersionMin())) // aic
                                                                                                                                                        // >=
                                                + networkResource.getAicVersionMin() + " VersionMax:"
                                                + networkResource.getAicVersionMax()
                                                + " supported on Cloud:" + cloudSiteId
-                                               + " with AIC_Version:" + cloudSite.getAicVersion());
+                                               + " with AIC_Version:" + cloudSite.getCloudVersion());
                        } else {
                                String error = "Network Type:" + networkType + " Version_Min:"
                                                + networkResource.getAicVersionMin() + " Version_Max:"
                                                + networkResource.getAicVersionMax()
                                                + " not supported on Cloud:" + cloudSiteId
-                                               + " with AIC_Version:" + cloudSite.getAicVersion();
+                                               + " with AIC_Version:" + cloudSite.getCloudVersion();
                                LOGGER.error(MessageEnum.RA_CONFIG_EXC, error, "OpenStack", "",
                                                MsoLogger.ErrorCode.DataError,
                                                "Network Type not supported on Cloud");
 
 @SpringBootApplication(scanBasePackages = { "org.onap.so" })
 @EnableAsync
 @EnableJpaRepositories({ "org.onap.so.db.catalog.data.repository",
-               "org.onap.so.db.request.data.repository" })
-@EntityScan({ "org.onap.so.db.catalog.beans", "org.onap.so.db.request.beans" })
+               "org.onap.so.db.request.data.repository"})
+@EntityScan({ "org.onap.so.db.catalog.beans", "org.onap.so.db.request.beans"})
 public class MsoOpenstackAdaptersApplication {
 
        @Value("${mso.async.core-pool-size}")
 
 import org.onap.so.adapters.vnf.exceptions.VnfException;
 import org.onap.so.adapters.vnf.exceptions.VnfNotFound;
 import org.onap.so.cloud.CloudConfig;
-import org.onap.so.cloud.CloudSite;
+import org.onap.so.db.catalog.beans.CloudSite;
 import org.onap.so.db.catalog.beans.HeatEnvironment;
 import org.onap.so.db.catalog.beans.HeatFiles;
 import org.onap.so.db.catalog.beans.HeatTemplate;
                                if (this.cloudConfig != null) {
                     Optional<CloudSite> cloudSiteOpt = this.cloudConfig.getCloudSite(cloudSiteId);
                     if (cloudSiteOpt.isPresent()) {
-                        aicV.setVersion(cloudSiteOpt.get().getAicVersion());
+                        aicV.setVersion(cloudSiteOpt.get().getCloudVersion());
                                                // Add code to handle unexpected values in here
                                                boolean moreThanMin = true;
                                                boolean equalToMin = true;
                                                if (!doNotTest) {
                                                        if ((moreThanMin || equalToMin) // aic >= min
                                                                        && (equalToMax || !(moreThanMax))) { //aic <= max
-                                                               LOGGER.debug("VNF Resource " + vnfResource.getModelName() + ", ModelUuid=" + vnfResource.getModelUUID() + " VersionMin=" + minVersionVnf + " VersionMax:" + maxVersionVnf + " supported on Cloud: " + cloudSiteId + " with AIC_Version:" + cloudSiteOpt.get().getAicVersion());
+                                                               LOGGER.debug("VNF Resource " + vnfResource.getModelName() + ", ModelUuid=" + vnfResource.getModelUUID() + " VersionMin=" + minVersionVnf + " VersionMax:" + maxVersionVnf + " supported on Cloud: " + cloudSiteId + " with AIC_Version:" + cloudSiteOpt.get().getCloudVersion());
                                                        } else {
                                                                // ERROR
-                                                               String error = "VNF Resource type: " + vnfResource.getModelName() + ", ModelUuid=" + vnfResource.getModelUUID() + " VersionMin=" + minVersionVnf + " VersionMax:" + maxVersionVnf + " NOT supported on Cloud: " + cloudSiteId + " with AIC_Version:" + cloudSiteOpt.get().getAicVersion();
+                                                               String error = "VNF Resource type: " + vnfResource.getModelName() + ", ModelUuid=" + vnfResource.getModelUUID() + " VersionMin=" + minVersionVnf + " VersionMax:" + maxVersionVnf + " NOT supported on Cloud: " + cloudSiteId + " with AIC_Version:" + cloudSiteOpt.get().getCloudVersion();
                                                                LOGGER.error(MessageEnum.RA_CONFIG_EXC, error, "OpenStack", "", MsoLogger.ErrorCode.BusinessProcesssError, "Exception - setVersion");
                                                                LOGGER.debug(error);
                                                                throw new VnfException(error, MsoExceptionCategory.USERDATA);
                        if (this.cloudConfig != null) {
                                Optional<CloudSite> cloudSiteOpt = this.cloudConfig.getCloudSite(cloudSiteId);
                                if (cloudSiteOpt.isPresent()) {
-                                       aicV.setVersion(cloudSiteOpt.get().getAicVersion());
+                                       aicV.setVersion(cloudSiteOpt.get().getCloudVersion());
                                        boolean moreThanMin = true;
                                        boolean equalToMin = true;
                                        boolean moreThanMax = true;
 
 import org.onap.so.adapters.vnf.exceptions.VnfAlreadyExists;
 import org.onap.so.adapters.vnf.exceptions.VnfException;
 import org.onap.so.cloud.CloudConfig;
-import org.onap.so.cloud.CloudSite;
+import org.onap.so.db.catalog.beans.CloudSite;
 import org.onap.so.cloudify.beans.DeploymentInfo;
 import org.onap.so.cloudify.beans.DeploymentStatus;
 import org.onap.so.cloudify.exceptions.MsoCloudifyManagerNotFound;
         }
         CloudSite cloudSite = cloudSiteOp.get();
                MavenLikeVersioning aicV = new MavenLikeVersioning();
-               aicV.setVersion(cloudSite.getAicVersion());
+               aicV.setVersion(cloudSite.getCloudVersion());
     
                String vnfMin = vnfResource.getAicVersionMin();
                String vnfMax = vnfResource.getAicVersionMax();
                     (vnfMax != null && aicV.isMoreRecentThan(vnfMax)))
                {
                        // ERROR
-                       String error = "VNF Resource type: " + vnfResource.getModelName() + ", ModelUuid=" + vnfResource.getModelUUID() + " VersionMin=" + vnfMin + " VersionMax:" + vnfMax + " NOT supported on Cloud: " + cloudSiteId + " with AIC_Version:" + cloudSite.getAicVersion();
+                       String error = "VNF Resource type: " + vnfResource.getModelName() + ", ModelUuid=" + vnfResource.getModelUUID() + " VersionMin=" + vnfMin + " VersionMax:" + vnfMax + " NOT supported on Cloud: " + cloudSiteId + " with AIC_Version:" + cloudSite.getCloudVersion();
                        LOGGER.error(MessageEnum.RA_CONFIG_EXC, error, "OpenStack", "", MsoLogger.ErrorCode.BusinessProcesssError, "Exception - setVersion");
                        LOGGER.debug(error);
                        throw new VnfException(error, MsoExceptionCategory.USERDATA);
 
 import org.onap.so.adapters.vnf.exceptions.VnfAlreadyExists;
 import org.onap.so.adapters.vnf.exceptions.VnfException;
 import org.onap.so.cloud.CloudConfig;
-import org.onap.so.cloud.CloudSite;
+import org.onap.so.db.catalog.beans.CloudSite;
 import org.onap.so.cloudify.utils.MsoCloudifyUtils;
 import org.onap.so.db.catalog.beans.HeatEnvironment;
 import org.onap.so.db.catalog.beans.HeatTemplate;
         }
         CloudSite cloudSite = cloudSiteOp.get();
                MavenLikeVersioning aicV = new MavenLikeVersioning();
-               aicV.setVersion(cloudSite.getAicVersion());
+               aicV.setVersion(cloudSite.getCloudVersion());
     
                String vnfMin = vnfResource.getAicVersionMin();
                String vnfMax = vnfResource.getAicVersionMax();
                     (vnfMax != null && aicV.isMoreRecentThan(vnfMax)))
                {
                        // ERROR
-                       String error = "VNF Resource type: " + vnfResource.getModelName() + ", ModelUuid=" + vnfResource.getModelUUID() + " VersionMin=" + vnfMin + " VersionMax:" + vnfMax + " NOT supported on Cloud: " + cloudSiteId + " with AIC_Version:" + cloudSite.getAicVersion();
+                       String error = "VNF Resource type: " + vnfResource.getModelName() + ", ModelUuid=" + vnfResource.getModelUUID() + " VersionMin=" + vnfMin + " VersionMax:" + vnfMax + " NOT supported on Cloud: " + cloudSiteId + " with AIC_Version:" + cloudSite.getCloudVersion();
                        LOGGER.error(MessageEnum.RA_CONFIG_EXC, error, "OpenStack", "", MsoLogger.ErrorCode.BusinessProcesssError, "Exception - setVersion");
                        LOGGER.debug(error);
                        throw new VnfException(error, MsoExceptionCategory.USERDATA);
 
 import java.util.Optional;
 
 import org.onap.so.cloud.CloudConfig;
-import org.onap.so.cloud.CloudSite;
+import org.onap.so.db.catalog.beans.CloudSite;
 import org.onap.so.logger.MsoLogger;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 
 management: 
   context-path: /manage
 
-cloud_config:
-  identity_services:
-    MTN13:
-      identity_url: "http://localhost:5000/v2.0"
-      mso_id: "m93945"
-      mso_pass: "93937EA01B94A10A49279D4572B48369"
-      admin_tenant: "admin"
-      member_role: "admin"
-      tenant_metadata: true
-      identity_server_type: "KEYSTONE"
-      identity_authentication_type: "USERNAME_PASSWORD"
-  cloud_sites:
-    mtn13:
-      region_id: "mtn13"
-      clli: "MDT13"
-      aic_version: "3.0"
-      identity_service_id: "MTN13"
+flyway:
+  outOfOrder: true
+  ignoreMissingMigrations: true
 
 
 #Actuator
 management: 
   context-path: /manage
+
+flyway:
+  outOfOrder: true
+  ignoreMissingMigrations: true
\ No newline at end of file
 
--- /dev/null
+package db.migration;
+
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
+import org.onap.so.adapters.vnf.BaseRestTestUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Qualifier;
+
+import javax.sql.DataSource;
+import java.sql.Connection;
+import java.sql.ResultSet;
+import java.sql.Statement;
+
+public class CloudConfigMigrationTest extends BaseRestTestUtils {
+
+    @Qualifier("dataSource")
+    @Autowired
+    DataSource dataSource;
+
+    R__CloudConfigMigration cloudConfigMigration;
+
+    @Before
+    public void setup() {
+        cloudConfigMigration = new R__CloudConfigMigration();
+    }
+
+    @Test
+    public void testMigrate() throws Exception {
+        System.setProperty("spring.profiles.active", "test");
+        cloudConfigMigration.migrate(dataSource.getConnection());
+        assertMigratedIdentityServiceData();
+        assertMigratedCloudSiteData();
+        assertMigratedCloudManagerData();
+    }
+
+    @Test
+    public void testMigrateNoData() throws Exception {
+        System.setProperty("spring.profiles.active", "nomigrate");
+        int identityCount = getDataCount("identity_services");
+        int cloudSiteCount = getDataCount("cloud_sites");
+        int cloudManagerCount = getDataCount("cloudify_managers");
+
+        cloudConfigMigration.migrate(dataSource.getConnection());
+
+        Assert.assertEquals(identityCount, getDataCount("identity_services"));
+        Assert.assertEquals(cloudSiteCount, getDataCount("cloud_sites"));
+        Assert.assertEquals(cloudManagerCount, getDataCount("cloudify_managers"));
+    }
+
+
+    private int getDataCount(String tableName) throws Exception {
+        try (Connection con = dataSource.getConnection(); Statement stmt = con.createStatement(); ResultSet rs = stmt.executeQuery("select count(1) from " + tableName)) {
+            while (rs.next()) {
+                return rs.getInt(1);
+            }
+        }
+        return 0;
+    }
+
+    private void assertMigratedIdentityServiceData() throws Exception {
+        try (Connection con = dataSource.getConnection(); Statement stmt = con.createStatement(); ResultSet rs = stmt.executeQuery("select * from identity_services where id='MTKEYSTONE'")) {
+            boolean dataAvailable = false;
+            while (rs.next()) {
+                dataAvailable = true;
+                Assert.assertEquals("MTKEYSTONE", rs.getString("id"));
+                Assert.assertEquals("http://localhost:5000/v2.0", rs.getString("identity_url"));
+                Assert.assertEquals("john", rs.getString("mso_id"));
+                Assert.assertEquals("313DECE408AF7759D442D7B06DD9A6AA", rs.getString("mso_pass"));
+                Assert.assertEquals("admin", rs.getString("admin_tenant"));
+                Assert.assertEquals("_member_", rs.getString("member_role"));
+                Assert.assertEquals("KEYSTONE", rs.getString("identity_server_type"));
+                Assert.assertEquals("USERNAME_PASSWORD", rs.getString("identity_authentication_type"));
+            }
+            Assert.assertTrue("Expected data in identity_services table post migration but didnt find any!!!", dataAvailable);
+        }
+    }
+
+    private void assertMigratedCloudSiteData() throws Exception {
+        try (Connection con = dataSource.getConnection(); Statement stmt = con.createStatement(); ResultSet rs = stmt.executeQuery("select * from cloud_sites where id='regionOne'")) {
+            boolean dataAvailable = false;
+            while (rs.next()) {
+                dataAvailable = true;
+                Assert.assertEquals("regionOne", rs.getString("id"));
+                Assert.assertEquals("regionOne", rs.getString("region_id"));
+                Assert.assertEquals("MT2", rs.getString("clli"));
+                Assert.assertEquals("2.5", rs.getString("cloud_version"));
+                Assert.assertEquals("MTKEYSTONE", rs.getString("identity_service_id"));
+            }
+            Assert.assertTrue("Expected data in identity_services table post migration but didnt find any!!!", dataAvailable);
+        }
+    }
+
+    private void assertMigratedCloudManagerData() throws Exception {
+        try (Connection con = dataSource.getConnection(); Statement stmt = con.createStatement(); ResultSet rs = stmt.executeQuery("select * from cloudify_managers where id='manager'")) {
+            boolean dataAvailable = false;
+            while (rs.next()) {
+                dataAvailable = true;
+                Assert.assertEquals("http://localhost:8080", rs.getString("cloudify_url"));
+                Assert.assertEquals("user", rs.getString("username"));
+                Assert.assertEquals("password", rs.getString("password"));
+                Assert.assertEquals("2.0", rs.getString("version"));
+            }
+            Assert.assertTrue("Expected data in identity_services table post migration but didnt find any!!!", dataAvailable);
+        }
+    }
+}
 
                
                cloudConfig.getIdentityService("MTN13").setIdentityUrl("http://localhost:" + wireMockPort + "/v2.0");
                CreateTenantRequest request = new CreateTenantRequest();
-               String cloudSiteId = "mtn13";
+               String cloudSiteId = "MTN13";
                String requestId = "62265093-277d-4388-9ba6-449838ade586";
                String serviceInstanceId = "4147e06f-1b89-49c5-b21f-4faf8dc9805a";
                String tenantName = "testingTenantName";
                
                cloudConfig.getIdentityService("MTN13").setIdentityUrl("http://localhost:" + wireMockPort + "/v2.0");
                CreateTenantRequest request = new CreateTenantRequest();
-               String cloudSiteId = "mtn13";
+               String cloudSiteId = "MTN13";
                String requestId = "62265093-277d-4388-9ba6-449838ade586";
                String serviceInstanceId = "4147e06f-1b89-49c5-b21f-4faf8dc9805a";
                String tenantName = "testingTenantName";
 
 import com.fasterxml.jackson.databind.JsonMappingException;
 import com.fasterxml.jackson.databind.JsonNode;
 import com.fasterxml.jackson.databind.ObjectMapper;
+import org.apache.http.HttpStatus;
 import org.junit.Before;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.onap.so.adapters.openstack.MsoOpenstackAdaptersApplication;
+import org.onap.so.db.catalog.beans.AuthenticationType;
+import org.onap.so.db.catalog.beans.CloudIdentity;
+import org.onap.so.db.catalog.beans.CloudSite;
+import org.onap.so.db.catalog.beans.ServerType;
+import org.onap.so.db.catalog.data.repository.CloudIdentityRepository;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Qualifier;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.boot.test.web.client.TestRestTemplate;
 import org.springframework.cloud.contract.wiremock.AutoConfigureWireMock;
 import org.springframework.http.HttpHeaders;
-import org.springframework.test.annotation.DirtiesContext;
 import org.springframework.test.context.ActiveProfiles;
 import org.springframework.test.context.junit4.SpringRunner;
 
+import javax.ws.rs.core.MediaType;
 import java.io.BufferedReader;
 import java.io.File;
 import java.io.FileReader;
 import java.io.IOException;
 
+import static com.github.tomakehurst.wiremock.client.WireMock.aResponse;
+import static com.github.tomakehurst.wiremock.client.WireMock.get;
 import static com.github.tomakehurst.wiremock.client.WireMock.reset;
+import static com.github.tomakehurst.wiremock.client.WireMock.stubFor;
+import static com.github.tomakehurst.wiremock.client.WireMock.urlPathEqualTo;
 
 @RunWith(SpringRunner.class)
 @SpringBootTest(classes = MsoOpenstackAdaptersApplication.class, webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
        
        @LocalServerPort
        private int port;
+
+       public ObjectMapper mapper;
+       
+       @Autowired
+       private CloudIdentityRepository cloudIdentityRepository;
        
        protected String readJsonFileAsString(String fileLocation) throws JsonParseException, JsonMappingException, IOException{
                ObjectMapper mapper = new ObjectMapper();
                        return sb.toString();
                }
        }
-       
+
+       /***
+        * Before each test execution, updating IdentityUrl port value to the ramdom wireMockPort
+        * Since URL will be used as a rest call and required to be mocked in unit tests
+        */
        @Before
-       public void setUp(){
+       public void setUp() throws Exception {
                reset();
+               mapper = new ObjectMapper();
+
+               CloudIdentity identity = new CloudIdentity();
+               identity.setId("MTN13");
+               identity.setMsoId("m93945");
+               identity.setMsoPass("93937EA01B94A10A49279D4572B48369");
+               identity.setAdminTenant("admin");
+               identity.setMemberRole("admin");
+               identity.setTenantMetadata(new Boolean(true));
+               identity.setIdentityUrl("http://localhost:"+wireMockPort+"/v2.0");
+               identity.setIdentityAuthenticationType(AuthenticationType.USERNAME_PASSWORD);
+
+               CloudSite cloudSite = new CloudSite();
+               cloudSite.setId("MTN13");
+               cloudSite.setCloudVersion("3.0");
+               cloudSite.setClli("MDT13");
+               cloudSite.setRegionId("mtn13");
+               cloudSite.setOrchestrator("orchestrator" +
+                               "");
+               identity.setIdentityServerType(ServerType.KEYSTONE);
+               cloudSite.setIdentityService(identity);
+
+
+               stubFor(get(urlPathEqualTo("/cloudSite/MTN13")).willReturn(aResponse()
+                               .withBody(getBody(mapper.writeValueAsString(cloudSite),wireMockPort, ""))
+                               .withHeader(org.apache.http.HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON)
+                               .withStatus(HttpStatus.SC_OK)));
+               stubFor(get(urlPathEqualTo("/cloudSite/default")).willReturn(aResponse()
+                               .withBody(getBody(mapper.writeValueAsString(cloudSite),wireMockPort, ""))
+                               .withHeader(org.apache.http.HttpHeaders.CONTENT_TYPE,MediaType.APPLICATION_JSON)
+                               .withStatus(HttpStatus.SC_OK)));
+               stubFor(get(urlPathEqualTo("/cloudIdentity/MTN13")).willReturn(aResponse()
+                               .withBody(getBody(mapper.writeValueAsString(identity),wireMockPort, ""))
+                               .withHeader(org.apache.http.HttpHeaders.CONTENT_TYPE,MediaType.APPLICATION_JSON)
+                               .withStatus(HttpStatus.SC_OK)));
+       }
+
+       protected static String getBody(String body, int port, String urlPath) throws IOException {
+               return body.replaceAll("port", "http://localhost:" + port + urlPath);
        }
        
        @Test
 
        String vnfName = "DEV-VF-1802-it3-pwt3-v6-vSAMP10a-addon2-Replace-1001/stackId";
 
        @Before
-       public void before() {
+       public void before() throws Exception {
                MockitoAnnotations.initMocks(this);
                WireMock.reset();
+               setUp();
        }
 
        @Test
 
                Map<String, String> map = new HashMap<>();
                map.put("key1", "value1");
-               instance.createVfModule("mtn13", "88a6ca3ee0394ade9403f075db23167e", "vnf", "1", vnfName, "VFMOD",
+               instance.createVfModule("MTN13", "88a6ca3ee0394ade9403f075db23167e", "vnf", "1", vnfName, "VFMOD",
                                "volumeGroupHeatStackId|1", "baseVfHeatStackId", "88a6ca3ee0394ade9403f075db23167e", map,
                                Boolean.FALSE, Boolean.TRUE, Boolean.FALSE, msoRequest, new Holder<>(), new Holder<Map<String, String>>(),
                                new Holder<VnfRollback>());
                vfModuleCustomization.getVfModule().getModuleHeatTemplate().setParameters(new HashSet<>());
                Map<String, String> map = new HashMap<>();
                map.put("key1", "value1");
-               instance.updateVfModule("mtn13", "88a6ca3ee0394ade9403f075db23167e", "vnf", "1", vnfName, "VFMOD",
+               instance.updateVfModule("MTN13", "88a6ca3ee0394ade9403f075db23167e", "vnf", "1", vnfName, "VFMOD",
                                "volumeGroupHeatStackId", "baseVfHeatStackId", "vfModuleStackId",
                                "b4ea86b4-253f-11e7-93ae-92361f002671", map, msoRequest, new Holder<Map<String, String>>(),
                                new Holder<VnfRollback>());
 
 package org.onap.so.adapters.vnf;
 
 import org.apache.http.HttpStatus;
-import org.junit.After;
 import org.junit.Before;
 import org.junit.Rule;
 import org.junit.Test;
 import org.junit.rules.ExpectedException;
 import org.onap.so.adapters.vnf.exceptions.VnfException;
 import org.onap.so.cloud.CloudConfig;
-import org.onap.so.cloud.CloudifyManager;
+import org.onap.so.db.catalog.beans.CloudifyManager;
 import org.onap.so.entity.MsoRequest;
 import org.onap.so.openstack.beans.VnfRollback;
 import org.springframework.beans.factory.annotation.Autowired;
 import java.util.HashMap;
 import java.util.Map;
 
-import static com.github.tomakehurst.wiremock.client.WireMock.aResponse;
-import static com.github.tomakehurst.wiremock.client.WireMock.get;
-import static com.github.tomakehurst.wiremock.client.WireMock.stubFor;
-import static com.github.tomakehurst.wiremock.client.WireMock.urlMatching;
-import static com.github.tomakehurst.wiremock.client.WireMock.urlPathEqualTo;
+import static com.github.tomakehurst.wiremock.client.WireMock.*;
 
 public class MsoVnfCloudifyAdapterImplTest extends BaseRestTestUtils {
 
        private CloudConfig cloudConfig;
 
        @Before
-       public void before(){
+       public void before() throws Exception {
                super.setUp();
                CloudifyManager cloudifyManager = new CloudifyManager();
                cloudifyManager.setId("mtn13");
                cloudifyManager.setCloudifyUrl("http://localhost:"+wireMockPort+"/v2.0");
                cloudifyManager.setUsername("m93945");
                cloudifyManager.setPassword("93937EA01B94A10A49279D4572B48369");
-               cloudConfig.getCloudifyManagers().put("mtn13",cloudifyManager);
        }
        
-       @After
-       public void after(){
-               cloudConfig.getCloudifyManagers().clear();
-       }
-       
-       @Test
-    public void queryVnfNullPointerExceptionTest() throws Exception {
+       @Test 
+    public void queryVnfExceptionTest() throws Exception {
+               reset();
                expectedException.expect(VnfException.class);
         MsoRequest msoRequest = new MsoRequest();
         msoRequest.setRequestId("12345");
 
 {
        "createTenantResponse": {
-               "cloudSiteId": "mtn13",
+               "cloudSiteId": "MTN13",
                "tenantId": "tenantId",
                "tenantCreated": true,
                "tenantRollback": {
                        "tenantId": "tenantId",
-                       "cloudId": "mtn13",
+                       "cloudId": "MTN13",
                        "tenantCreated": true,
                        "msoRequest": {
                                "requestId": "62265093-277d-4388-9ba6-449838ade586",
 
 {
        "createTenantResponse": {
-               "cloudSiteId": "mtn13",
+               "cloudSiteId": "MTN13",
                "tenantId": "tenantId",
                "tenantCreated": false,
                "tenantRollback": {
-                       "cloudId": "mtn13",
+                       "cloudId": "MTN13",
                        "tenantCreated": false,
                        "msoRequest": {
                                "requestId": "62265093-277d-4388-9ba6-449838ade586",
 
--- /dev/null
+# will be used as entry in DB to say SITE OFF/ON for healthcheck
+# MSO Properties go here
+org:
+  onap:
+    so:
+      adapters:
+        default_keystone_url_version: /v2.0
+        default_keystone_reg_ex: "/[vV][0-9]"
+        vnf:
+          bpelauth: 481E6A95CE97E393A53363750D5E1E75
+          checkRequiredParameters: true
+          addGetFilesOnVolumeReq: false
+          sockettimeout: 30
+          connecttimeout: 30
+          retrycount: 5
+          retryinterval: -15
+          retrylist: 408,429,500,502,503,504,900
+        network:
+          bpelauth: 481E6A95CE97E393A53363750D5E1E75
+          sockettimeout: 5
+          connecttimeout: 5
+          retrycount: 5
+          retryinterval: -15
+          retrylist: 408,429,500,502,503,504,900
+        tenant: 
+          default_x_aic_orm_client_string: ONAP-SO
+          default_keystone_url_version: /v2.0
+          default_keystone_reg_ex: "/[vV][0-9]"
+          default_tenant_description: ECOMP Tenant
+          default_region_type: single
+          default_user_role: admin
+          default_success_status_string: Success
+          default_no_regions_status_string: no regions
+          default_orm_request_path: /v1/orm/customers/
+          default_orm_url_replace_this: 8080
+          default_orm_url_replace_with_this: 7080
+          default_quota_value: 10
+          set_default_quota: false
+        valet:
+          base_url: http://localhost:${wiremock.server.port}
+          base_path: /api/valet/placement/v1/
+          valet_auth: 
+ecomp:
+  mso:
+    adapters:
+      po:
+        retryCodes: 504
+        retryDelay: 5
+        retryCount: 3
+      vnf:
+        heat:
+          create:
+            pollInterval: 15
+          delete:
+            pollTimeout: 7500
+            pollInterval: 15
+      network:
+        heat:
+          create:
+            pollInterval: 15
+          delete:
+            pollTimeout: 300
+            pollInterval: 15
+      
+server-port: 8080
+ssl-enable: false
+tomcat:
+  max-threads: 50
+mso:
+  logPath: logs
+  catalog:
+    db:
+      spring:
+        endpoint: http://localhost:${wiremock.server.port}
+  db:
+    auth: Basic YnBlbDptc28tZGItMTUwNyE=
+  site-name: localDevEnv
+  async:
+    core-pool-size: 50
+    max-pool-size: 50
+    queue-capacity: 500
+spring:
+  datasource:
+    url: jdbc:mariadb://localhost:3307/catalogdb
+    username: root
+    password: password
+    driver-class-name: org.mariadb.jdbc.Driver    
+    initialize: true
+    initialization-mode: never
+  jpa:   
+    generate-ddl: false
+    show-sql: false
+    hibernate:      
+      ddl-auto: none
+      naming-strategy: org.hibernate.cfg.ImprovedNamingStrategy
+      enable-lazy-load-no-trans: true
+    database-platform: org.hibernate.dialect.MySQL5InnoDBDialect
+  security:
+    usercredentials:
+    -  
+      username: test
+      password: '$2a$12$Zi3AuYcZoZO/gBQyUtST2.F5N6HqcTtaNci2Et.ufsQhski56srIu'
+      role: MSO-Client        
+
+mariaDB4j:
+  dataDir: 
+  port: 3307
+  databaseName: catalogdb
+
+
+#Actuator
+management: 
+  endpoints:
+    enabled-by-default: false
+  endpoint:
+    info:
+      enabled: true
+
+flyway:
+  baseline-on-migrate: true
+  outOfOrder: true
+  ignoreMissingMigrations: true
\ No newline at end of file
 
   catalog:
     db:
       spring:
-        endpoint: "http://localhost:"
+        endpoint: http://localhost:${wiremock.server.port}
   db:
     auth: Basic YnBlbDptc28tZGItMTUwNyE=
   site-name: localDevEnv
 
 cloud_config:
   identity_services:
-    MTN13:
-      identity_url: "http://localhost:${wiremock.server.port}/v2.0"
-      mso_id: "m93945"
-      mso_pass: "93937EA01B94A10A49279D4572B48369"
+    MTKEYSTONE:
+      identity_url: "http://localhost:5000/v2.0"
+      mso_id: "john"
+      mso_pass: "313DECE408AF7759D442D7B06DD9A6AA"
       admin_tenant: "admin"
-      member_role: "admin"
-      tenant_metadata: true
+      member_role: "_member_"
+      tenant_metadata: false
       identity_server_type: "KEYSTONE"
       identity_authentication_type: "USERNAME_PASSWORD"
   cloud_sites:
       identity_service_id: "MTN13"
       orchestrator: "orchestrator"
       cloudify_id: "mtn13"
+    regionOne:
+      region_id: "regionOne"
+      clli: "MT2"
+      aic_version: "2.5"
+      identity_service_id: "MTKEYSTONE"
+  cloudify_managers:
+    manager:
+      cloudify_url: "http://localhost:8080"
+      username: "user"
+      password: "password"
+      version: "2.0"
+
+
+flyway:
+  baseline-on-migrate: true
+  outOfOrder: true
+  ignoreMissingMigrations: true
\ No newline at end of file
 
 
  INSERT INTO `vf_module_customization` (`MODEL_CUSTOMIZATION_UUID`, `LABEL`, `INITIAL_COUNT`, `MIN_INSTANCES`, `MAX_INSTANCES`, `AVAILABILITY_ZONE_COUNT`, `HEAT_ENVIRONMENT_ARTIFACT_UUID`, `VOL_ENVIRONMENT_ARTIFACT_UUID`, `CREATION_TIMESTAMP`, `VF_MODULE_MODEL_UUID`) VALUES ('9b339a61-69ca-465f-86b8-1c72c582b8e8', 'base_vmme', 1, 1, 1, NULL, 'f4a21b58-5654-4cf6-9c50-de42004fe2b4', '3375f64b-4709-4802-8713-7a164763f9cd', '2018-05-13 12:12:09', '207fe0dc-4c89-4e5d-9a78-345e99ef7fbe');
 
+INSERT INTO `cloudify_managers` (`ID`, `CLOUDIFY_URL`, `USERNAME`, `PASSWORD`, `VERSION`, `LAST_UPDATED_BY`, `CREATION_TIMESTAMP`, `UPDATE_TIMESTAMP`) VALUES ('mtn13', 'http://localhost:28090/v2.0', 'm93945', '93937EA01B94A10A49279D4572B48369', NULL, 'MSO_USER', '2018-07-17 14:05:08', '2018-07-17 14:05:08');
 
+INSERT INTO `identity_services` (`ID`, `IDENTITY_URL`, `MSO_ID`, `MSO_PASS`, `ADMIN_TENANT`, `MEMBER_ROLE`, `TENANT_METADATA`, `IDENTITY_SERVER_TYPE`, `IDENTITY_AUTHENTICATION_TYPE`, `LAST_UPDATED_BY`, `CREATION_TIMESTAMP`, `UPDATE_TIMESTAMP`) VALUES ('MTN13', 'http://localhost:28090/v2.0', 'm939454', '93937EA01B94A10A49279D4572B48369', 'admin', 'admin', 1, 'KEYSTONE', 'USERNAME_PASSWORD', 'MSO_USER', '2018-07-17 14:02:33', '2018-07-17 14:02:33');
+
+INSERT INTO `cloud_sites` (`ID`, `region_id`, `identity_service_id`, `cloud_version`, `clli`, `cloudify_id`, `platform`, `orchestrator`, `CREATION_TIMESTAMP`, `UPDATE_TIMESTAMP`) VALUES ('MTN13', 'mtn13', 'MTN13', '3.0', 'MDT13', 'mtn13', null, 'orchestrator', '2018-07-17 14:06:28', '2018-07-17 14:06:28');
 
 
 
 
        PRIMARY KEY (`ID`),
        CONSTRAINT uk1_model UNIQUE (`MODEL_TYPE`, `MODEL_VERSION_ID`),
        FOREIGN KEY (`RECIPE`) REFERENCES `model_recipe` (`MODEL_ID`) ON DELETE CASCADE ON UPDATE CASCADE
-) ENGINE=InnoDB DEFAULT CHARSET=latin1;
\ No newline at end of file
+) ENGINE=InnoDB DEFAULT CHARSET=latin1;
+
+CREATE TABLE IF NOT EXISTS `identity_services` (
+  `ID` varchar(50) NOT NULL,
+  `IDENTITY_URL` varchar(200) DEFAULT NULL,
+  `MSO_ID` varchar(255) DEFAULT NULL,
+  `MSO_PASS` varchar(255) DEFAULT NULL,
+  `ADMIN_TENANT` varchar(50) DEFAULT NULL,
+  `MEMBER_ROLE` varchar(50) DEFAULT NULL,
+  `TENANT_METADATA` tinyint(1) DEFAULT 0,
+  `IDENTITY_SERVER_TYPE` varchar(50) DEFAULT NULL,
+  `IDENTITY_AUTHENTICATION_TYPE` varchar(50) DEFAULT NULL,
+  `LAST_UPDATED_BY` varchar(120) DEFAULT NULL,
+  `CREATION_TIMESTAMP` timestamp NULL DEFAULT current_timestamp(),
+  `UPDATE_TIMESTAMP` timestamp NULL DEFAULT current_timestamp(),
+  PRIMARY KEY (`ID`)
+) ;
+
+
+
+CREATE TABLE IF NOT EXISTS `cloudify_managers` (
+  `ID` varchar(50) NOT NULL,
+  `CLOUDIFY_URL` varchar(200) DEFAULT NULL,
+  `USERNAME` varchar(255) DEFAULT NULL,
+  `PASSWORD` varchar(255) DEFAULT NULL,
+  `VERSION` varchar(20) DEFAULT NULL,
+  `LAST_UPDATED_BY` varchar(120) DEFAULT NULL,
+  `CREATION_TIMESTAMP` timestamp NULL DEFAULT current_timestamp(),
+  `UPDATE_TIMESTAMP` timestamp NULL DEFAULT current_timestamp(),
+  PRIMARY KEY (`ID`)
+) ;
+
+
+
+CREATE TABLE IF NOT EXISTS `cloud_sites` (
+  `ID` varchar(50) NOT NULL,
+  `REGION_ID` varchar(11)  DEFAULT NULL,
+  `IDENTITY_SERVICE_ID` varchar(50)  DEFAULT NULL,
+  `CLOUD_VERSION` varchar(20)  DEFAULT NULL,
+  `CLLI` varchar(11)  DEFAULT NULL,
+  `CLOUDIFY_ID` varchar(50)  DEFAULT NULL,
+  `PLATFORM` varchar(50)  DEFAULT NULL,
+  `ORCHESTRATOR` varchar(50)  DEFAULT NULL,
+  `LAST_UPDATED_BY` varchar(120) DEFAULT NULL,
+  `CREATION_TIMESTAMP` timestamp NULL DEFAULT current_timestamp(),
+  `UPDATE_TIMESTAMP` timestamp NULL DEFAULT current_timestamp(),
+  PRIMARY KEY (`ID`),
+  KEY `FK_cloud_sites_identity_services` (`IDENTITY_SERVICE_ID`),
+  CONSTRAINT `FK_cloud_sites_identity_services` FOREIGN KEY (`IDENTITY_SERVICE_ID`) REFERENCES `identity_services` (`ID`)
+) ;
\ No newline at end of file
 
  * ============LICENSE_END=========================================================
  */
 
-package org.onap.so.cloud;
+package org.onap.so.db.catalog.beans;
 
 public enum AuthenticationType {
        USERNAME_PASSWORD, RACKSPACE_APIKEY; 
 
  * ============LICENSE_END=========================================================
  */
 
-package org.onap.so.cloud;
+package org.onap.so.db.catalog.beans;
 
 import com.fasterxml.jackson.annotation.JsonProperty;
 import com.openpojo.business.annotation.BusinessKey;
 import org.apache.commons.lang3.builder.HashCodeBuilder;
 
-import java.util.Comparator;
+import java.util.Date;
 
 import org.apache.commons.lang3.builder.EqualsBuilder;
 import org.apache.commons.lang3.builder.ToStringBuilder;
 import org.apache.commons.lang3.builder.ToStringStyle;
 
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.EnumType;
+import javax.persistence.Enumerated;
+import javax.persistence.Id;
+import javax.persistence.PrePersist;
+import javax.persistence.Table;
+import javax.persistence.Temporal;
+import javax.persistence.TemporalType;
+
 /**
- * JavaBean JSON class for a CloudIdentity. This bean represents a cloud identity
+ * EntityBean class for a CloudIdentity. This bean represents a cloud identity
  * service instance (i.e. a DCP node) in the NVP/AIC cloud. It will be loaded via
- * CloudConfig object, of which it is a component (a CloudConfig JSON configuration
- * file may contain multiple CloudIdentity definitions).
- *
- * Note that this is only used to access Cloud Configurations loaded from a
- * JSON config file, so there are no explicit setters.
+ * CloudConfig object, of which it is a component.
  *
  */
+@Entity
+@Table(name = "identity_services")
 public class CloudIdentity {
-       
+
     @JsonProperty
     @BusinessKey
+    @Id
+    @Column(name = "ID")
     private String id;
+    
     @JsonProperty("identity_url")
     @BusinessKey
+    @Column(name = "IDENTITY_URL")
     private String identityUrl;
+    
     @JsonProperty("mso_id")
     @BusinessKey
+    @Column(name = "MSO_ID")
     private String msoId;
+    
     @JsonProperty("mso_pass")
     @BusinessKey
+    @Column(name = "MSO_PASS")
     private String msoPass;
+    
     @JsonProperty("admin_tenant")
     @BusinessKey
+    @Column(name = "ADMIN_TENANT")
     private String adminTenant;
+    
     @JsonProperty("member_role")
     @BusinessKey
+    @Column(name = "MEMBER_ROLE")
     private String memberRole;
+    
     @JsonProperty("tenant_metadata")
     @BusinessKey
+    @Column(name = "TENANT_METADATA")
     private Boolean tenantMetadata;
+    
     @JsonProperty("identity_server_type")
     @BusinessKey
+    @Enumerated(EnumType.STRING)
+    @Column(name = "IDENTITY_SERVER_TYPE")
     private ServerType identityServerType;
+    
     @JsonProperty("identity_authentication_type")
     @BusinessKey
+    @Enumerated(EnumType.STRING)
+    @Column(name = "IDENTITY_AUTHENTICATION_TYPE")
     private AuthenticationType identityAuthenticationType;
+
+    @JsonProperty("last_updated_by")
+    @BusinessKey
+    @Column(name = "LAST_UPDATED_BY")
+    private String lastUpdatedBy ;
+
+    @JsonProperty("creation_timestamp")
+    @BusinessKey
+    @Column(name = "CREATION_TIMESTAMP", updatable = false)
+    @Temporal(TemporalType.TIMESTAMP)
+    private Date created;
+
+    @JsonProperty("update_timestamp")
+    @BusinessKey
+    @Column(name = "UPDATE_TIMESTAMP")
+    @Temporal(TemporalType.TIMESTAMP)
+    private Date updated;
     
     public CloudIdentity() {}
 
+    @PrePersist
+    protected void onCreate() {
+        this.created = new Date();
+        this.updated = new Date();
+    }
+
     public String getId () {
         return id;
     }
         return adminTenant;
     }
 
+    public String getLastUpdatedBy() {
+        return lastUpdatedBy;
+    }
+
+    public Date getCreated() {
+        return created;
+    }
+
+    public Date getUpdated() {
+        return updated;
+    }
+
+    public void setLastUpdatedBy(String lastUpdatedBy) {
+        this.lastUpdatedBy = lastUpdatedBy;
+    }
+
+    public void setCreated(Date created) {
+        this.created = created;
+    }
+
+    public void setUpdated(Date updated) {
+        this.updated = updated;
+    }
+
     public void setAdminTenant (String tenant) {
         this.adminTenant = tenant;
     }
         this.memberRole = role;
     }
 
-    public Boolean hasTenantMetadata () {
+    public Boolean getTenantMetadata() {
         return tenantMetadata;
     }
 
                return new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE).append("id", getId())
                                .append("identityUrl", getIdentityUrl()).append("msoId", getMsoId())
                                .append("adminTenant", getAdminTenant()).append("memberRole", getMemberRole())
-                               .append("tenantMetadata", hasTenantMetadata()).append("identityServerType", getIdentityServerType())
+                               .append("tenantMetadata", getTenantMetadata()).append("identityServerType", getIdentityServerType())
                                .append("identityAuthenticationType", getIdentityAuthenticationType()).toString();
        }
 
                                .append(getIdentityUrl(), castOther.getIdentityUrl()).append(getMsoId(), castOther.getMsoId())
                                .append(getMsoPass(), castOther.getMsoPass()).append(getAdminTenant(), castOther.getAdminTenant())
                                .append(getMemberRole(), castOther.getMemberRole())
-                               .append(hasTenantMetadata(), castOther.hasTenantMetadata())
+                               .append(getTenantMetadata(), castOther.getTenantMetadata())
                                .append(getIdentityServerType(), castOther.getIdentityServerType())
                                .append(getIdentityAuthenticationType(), castOther.getIdentityAuthenticationType()).isEquals();
        }
        @Override
        public int hashCode() {
                return new HashCodeBuilder(1, 31).append(getId()).append(getIdentityUrl()).append(getMsoId())
-                               .append(getMsoPass()).append(getAdminTenant()).append(getMemberRole()).append(hasTenantMetadata())
+                               .append(getMsoPass()).append(getAdminTenant()).append(getMemberRole()).append(getTenantMetadata())
                                .append(getIdentityServerType()).append(getIdentityAuthenticationType()).toHashCode();
        }
 }
\ No newline at end of file
 
  * ============LICENSE_END=========================================================
  */
 
-package org.onap.so.cloud;
+package org.onap.so.db.catalog.beans;
 
 
-import java.util.Comparator;
+import java.util.Date;
 
 import com.fasterxml.jackson.annotation.JsonProperty;
 import com.openpojo.business.annotation.BusinessKey;
 import org.apache.commons.lang3.builder.ToStringBuilder;
 import org.apache.commons.lang3.builder.ToStringStyle;
 
+import javax.persistence.CascadeType;
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.FetchType;
+import javax.persistence.Id;
+import javax.persistence.JoinColumn;
+import javax.persistence.OneToOne;
+import javax.persistence.PrePersist;
+import javax.persistence.Table;
+import javax.persistence.Temporal;
+import javax.persistence.TemporalType;
+
 /**
- * JavaBean JSON class for a CloudSite.  This bean represents a cloud location
+ * EntityBean class for a CloudSite.  This bean represents a cloud location
  * (i.e. and LCP node) in the NVP/AIC cloud.  It will be loaded via CloudConfig
- * object, of which it is a component (a CloudConfig JSON configuration file
- * will contain multiple CloudSite definitions).
- *
- * Note that this is only used to access Cloud Configurations loaded from a
- * JSON config file, so there are no explicit setters.
+ * object, of which it is a component
  *
  */
+@Entity
+@Table(name = "cloud_sites")
 public class CloudSite {
+       
        @JsonProperty
        @BusinessKey
+       @Id
+       @Column(name = "ID")
        private String id;
+       
        @JsonProperty("region_id")
        @BusinessKey
+       @Column(name = "REGION_ID")
        private String regionId;
-       @JsonProperty("identity_service_id")
-       @BusinessKey
-       private String identityServiceId;
+
        @JsonProperty("aic_version")
        @BusinessKey
-       private String aicVersion;
+       @Column(name = "CLOUD_VERSION")
+       private String cloudVersion;
+       
        @JsonProperty("clli")
        @BusinessKey
+       @Column(name = "CLLI")
        private String clli;
-       @JsonProperty("cloudify_id")
-       @BusinessKey
-       private String cloudifyId;
+       
        @JsonProperty("platform")
        @BusinessKey
+       @Column(name = "PLATFORM")
        private String platform;
+       
        @JsonProperty("orchestrator")
        @BusinessKey
+       @Column(name = "ORCHESTRATOR")
        private String orchestrator;
+
+       @JsonProperty("cloudify_id")
+       @BusinessKey
+       @Column(name = "CLOUDIFY_ID")
+       private String cloudifyId;
        
        // Derived property (set by CloudConfig loader based on identityServiceId)
+       @BusinessKey
+       @OneToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
+       @JoinColumn(name = "IDENTITY_SERVICE_ID")
        private CloudIdentity identityService;
-       // Derived property (set by CloudConfig loader based on cloudifyId)
-       private CloudifyManager cloudifyManager;
+
+       @BusinessKey
+       @JsonProperty("identity_service_id")
+       transient private String identityServiceId;
+
+       @JsonProperty("last_updated_by")
+       @BusinessKey
+       @Column(name = "LAST_UPDATED_BY")
+       private String lastUpdatedBy ;
+
+       @JsonProperty("creation_timestamp")
+       @BusinessKey
+       @Column(name = "CREATION_TIMESTAMP", updatable = false)
+       @Temporal(TemporalType.TIMESTAMP)
+       private Date created;
+
+       @JsonProperty("update_timestamp")
+       @BusinessKey
+       @Column(name = "UPDATE_TIMESTAMP")
+       @Temporal(TemporalType.TIMESTAMP)
+       private Date updated;
        
        public CloudSite() {
                
        }
+
+       @PrePersist
+       protected void onCreate() {
+               this.created = new Date();
+               this.updated = new Date();
+       }
        
        public CloudSite(CloudSite site) {
-               this.aicVersion = site.getAicVersion();
+               this.cloudVersion = site.getCloudVersion();
                this.clli = site.getClli();
-               this.cloudifyId = this.getCloudifyId();
-               this.cloudifyManager = this.getCloudifyManager();
                this.id = site.getId();
                this.identityService = site.getIdentityService();
-               this.identityServiceId = site.getIdentityServiceId();
                this.orchestrator = site.getOrchestrator();
                this.platform = site.getPlatform();
-               this.regionId = this.getRegionId();
+               this.regionId = site.getRegionId();
+               this.identityServiceId = site.getIdentityServiceId();
        }
        public String getId() {
                return this.id;
        }
 
        public String getIdentityServiceId() {
-               return identityServiceId;
+               return identityServiceId == null ? (identityService== null? null:identityService.getId()):identityServiceId;
        }
        
-       public void setIdentityServiceId(String identityServiceId) {
-               this.identityServiceId = identityServiceId;
-       }
-       public String getAicVersion() {
-               return aicVersion;
+       public String getCloudVersion() {
+               return cloudVersion;
        }
 
-       public void setAicVersion(String aicVersion) {
-               this.aicVersion = aicVersion;
+       public void setCloudVersion(String cloudVersion) {
+               this.cloudVersion = cloudVersion;
        }
 
        public String getClli() {
                return cloudifyId;
        }
 
-       public void setCloudifyId (String id) {
-               this.cloudifyId = id;
+       public void setCloudifyId(String cloudifyId) {
+               this.cloudifyId = cloudifyId;
        }
-       
+
+       public String getLastUpdatedBy() {
+               return lastUpdatedBy;
+       }
+
+       public Date getCreated() {
+               return created;
+       }
+
+       public Date getUpdated() {
+               return updated;
+       }
+
+       public void setLastUpdatedBy(String lastUpdatedBy) {
+               this.lastUpdatedBy = lastUpdatedBy;
+       }
+
+       public void setCreated(Date created) {
+               this.created = created;
+       }
+
+       public void setUpdated(Date updated) {
+               this.updated = updated;
+       }
+
        public String getPlatform() {
                return platform;
        }
        public void setIdentityService (CloudIdentity identity) {
                this.identityService = identity;
        }
-       
-       public CloudifyManager getCloudifyManager () {
-               return cloudifyManager;
-       }
-
-       public void setCloudifyManager (CloudifyManager cloudify) {
-               this.cloudifyManager = cloudify;
+       @Deprecated
+       public void setIdentityServiceId(String identityServiceId) {
+               this.identityServiceId = identityServiceId;
        }
 
        @Override
        public String toString() {
                return new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE).append("regionId", getRegionId())
-                               .append("identityServiceId", getIdentityServiceId()).append("aicVersion", getAicVersion())
+                               .append("identityServiceId", getIdentityServiceId()).append("cloudVersion", getCloudVersion())
                                .append("clli", getClli()).append("cloudifyId", getCloudifyId()).append("platform", getPlatform())
                                .append("orchestrator", getOrchestrator()).toString();
        }
                CloudSite castOther = (CloudSite) other;
                return new EqualsBuilder().append(getRegionId(), castOther.getRegionId())
                                .append(getIdentityServiceId(), castOther.getIdentityServiceId())
-                               .append(getAicVersion(), castOther.getAicVersion()).append(getClli(), castOther.getClli()).isEquals();
+                               .append(getCloudVersion(), castOther.getCloudVersion()).append(getClli(), castOther.getClli()).isEquals();
        }
 
        @Override
        public int hashCode() {
-               return new HashCodeBuilder(1, 31).append(getRegionId()).append(getIdentityServiceId()).append(getAicVersion())
+               return new HashCodeBuilder(1, 31).append(getRegionId()).append(getIdentityServiceId()).append(getCloudVersion())
                                .append(getClli()).toHashCode();
        }
 }
\ No newline at end of file
 
  * ============LICENSE_END=========================================================
  */
 
-package org.onap.so.cloud;
+package org.onap.so.db.catalog.beans;
 
-import java.security.GeneralSecurityException;
-import java.util.Comparator;
-
-import org.onap.so.logger.MessageEnum;
-import org.onap.so.logger.MsoLogger;
-import org.onap.so.utils.CryptoUtils;
+import java.util.Date;
 
 import com.fasterxml.jackson.annotation.JsonProperty;
 import com.openpojo.business.annotation.BusinessKey;
+import org.onap.so.logger.MsoLogger;
+
 import org.apache.commons.lang3.builder.ToStringBuilder;
 import org.apache.commons.lang3.builder.ToStringStyle;
 import org.apache.commons.lang3.builder.HashCodeBuilder;
 import org.apache.commons.lang3.builder.EqualsBuilder;
 
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.Id;
+import javax.persistence.PrePersist;
+import javax.persistence.Table;
+import javax.persistence.Temporal;
+import javax.persistence.TemporalType;
+
 /**
- * JavaBean JSON class for a Cloudify Manager.  This bean represents a Cloudify
+ * EntityBean class for a Cloudify Manager.  This bean represents a Cloudify
  * node through which TOSCA-based VNFs may be deployed.  Each CloudSite in the
  * CloudConfig may have a Cloudify Manager for deployments using TOSCA blueprints.
  * Cloudify Managers may support multiple Cloud Sites, but each site will have
  * 
  * This does not replace the ability to use the CloudSite directly via Openstack.
  *
- * Note that this is only used to access Cloud Configurations loaded from a
- * JSON config file, so there are no explicit setters.
- *
  * @author JC1348
  */
+@Entity
+@Table(name = "cloudify_managers")
 public class CloudifyManager {
        
-    private static MsoLogger LOGGER = MsoLogger.getMsoLogger (MsoLogger.Catalog.RA, CloudifyManager.class);
-
-       @BusinessKey
        @JsonProperty
+       @BusinessKey
+       @Id
+       @Column(name = "ID")
        private String id;
        
        @BusinessKey
        @JsonProperty ("cloudify_url")
+       @Column(name = "CLOUDIFY_URL")
        private String cloudifyUrl;
        
        @BusinessKey
        @JsonProperty("username")
+       @Column(name = "USERNAME")
        private String username;
        
        @BusinessKey
        @JsonProperty("password")
+       @Column(name = "PASSWORD")
        private String password;
        
        @BusinessKey
        @JsonProperty("version")
+       @Column(name = "VERSION")
        private String version;
 
+       @JsonProperty("last_updated_by")
+       @BusinessKey
+       @Column(name = "LAST_UPDATED_BY")
+       private String lastUpdatedBy ;
+
+       @JsonProperty("creation_timestamp")
+       @BusinessKey
+       @Column(name = "CREATION_TIMESTAMP", updatable = false)
+       @Temporal(TemporalType.TIMESTAMP)
+       private Date created;
+
+       @JsonProperty("update_timestamp")
+       @BusinessKey
+       @Column(name = "UPDATE_TIMESTAMP")
+       @Temporal(TemporalType.TIMESTAMP)
+       private Date updated;
+
        public CloudifyManager() {}
+
+       @PrePersist
+       protected void onCreate() {
+               this.created = new Date();
+               this.updated = new Date();
+       }
        
        public String getId() {
                return id;
                this.version = version;
        }
 
+       public String getLastUpdatedBy() {
+               return lastUpdatedBy;
+       }
+
+       public Date getCreated() {
+               return created;
+       }
+
+       public Date getUpdated() {
+               return updated;
+       }
+
+       public void setLastUpdatedBy(String lastUpdatedBy) {
+               this.lastUpdatedBy = lastUpdatedBy;
+       }
+
+       public void setCreated(Date created) {
+               this.created = created;
+       }
+
+       public void setUpdated(Date updated) {
+               this.updated = updated;
+       }
+
        @Override
        public CloudifyManager clone() {
                CloudifyManager cloudifyManagerCopy = new CloudifyManager();
 
  * ============LICENSE_END=========================================================
  */
 
-package org.onap.so.cloud;
+package org.onap.so.db.catalog.beans;
 
 public enum ServerType {
        KEYSTONE, ORM;
 
 import org.onap.so.db.catalog.beans.Service;
 import org.onap.so.db.catalog.beans.VfModuleCustomization;
 import org.onap.so.db.catalog.beans.VnfcInstanceGroupCustomization;
+import org.onap.so.db.catalog.beans.CloudSite;
+import org.onap.so.db.catalog.beans.CloudIdentity;
+import org.onap.so.db.catalog.beans.CloudifyManager;
 import org.onap.so.db.catalog.beans.ServiceRecipe;
 import org.onap.so.db.catalog.beans.macro.NorthBoundRequest;
 import org.onap.so.db.catalog.beans.macro.OrchestrationFlow;
 import org.onap.so.db.catalog.beans.macro.RainyDayHandlerStatus;
 import org.onap.so.logging.jaxrs.filter.jersey.SpringClientFilter;
 import org.springframework.beans.factory.annotation.Value;
-import org.springframework.http.HttpRequest;
 import org.springframework.http.client.BufferingClientHttpRequestFactory;
-import org.springframework.http.client.ClientHttpRequestExecution;
 import org.springframework.http.client.ClientHttpRequestFactory;
-import org.springframework.http.client.ClientHttpRequestInterceptor;
-import org.springframework.http.client.ClientHttpResponse;
 import org.springframework.http.client.SimpleClientHttpRequestFactory;
 import org.springframework.stereotype.Component;
 import org.springframework.web.client.RestTemplate;
 
        private Client<ServiceRecipe> serviceRecipeClient;
 
+       private Client<CloudSite> cloudSiteClient;
+
+       private Client<CloudIdentity> cloudIdentityClient;
+
+       private Client<CloudifyManager> cloudifyManagerClient;
+
        @Value("${mso.catalog.db.spring.endpoint}")
-       protected String endpoint;
+       private String endpoint;
 
        @Value("${mso.db.auth}")
        private String msoAdaptersAuth;
        public CatalogDbClient() {
                ClientHttpRequestFactory factory = new BufferingClientHttpRequestFactory(new SimpleClientHttpRequestFactory());
                
-               ClientFactory clientFactory = Configuration.builder().setClientHttpRequestFactory(factory).setRestTemplateConfigurer(new RestTemplateConfigurer() {
-
-                       public void configure(RestTemplate restTemplate) {
-                               restTemplate.getInterceptors().add((new SpringClientFilter()));
-                               
-                               restTemplate.getInterceptors().add(new ClientHttpRequestInterceptor() {
-
-                                       public ClientHttpResponse intercept(HttpRequest request, byte[] body,
-                                                       ClientHttpRequestExecution execution) throws IOException {
-
-                                               request.getHeaders().add("Authorization", msoAdaptersAuth);
-                                               return execution.execute(request, body);
-                                       }
-                               });
-                       }
+               ClientFactory clientFactory = Configuration.builder().setClientHttpRequestFactory(factory).setRestTemplateConfigurer(restTemplate -> {
+                       restTemplate.getInterceptors().add((new SpringClientFilter()));
+                       
+                       restTemplate.getInterceptors().add((request, body, execution) -> {
+
+                               request.getHeaders().add("Authorization", msoAdaptersAuth);
+                               return execution.execute(request, body);
+                       });
                }).build().buildClientFactory();
                serviceClient = clientFactory.create(Service.class);
                orchestrationClient = clientFactory.create(OrchestrationFlow.class);
                instanceGroupClient = clientFactory.create(InstanceGroup.class);
                networkCollectionResourceCustomizationClient = clientFactory.create(NetworkCollectionResourceCustomization.class);
                collectionNetworkResourceCustomizationClient = clientFactory.create(CollectionNetworkResourceCustomization.class);
+               cloudSiteClient = clientFactory.create(CloudSite.class);
+               cloudIdentityClient = clientFactory.create(CloudIdentity.class);
+               cloudifyManagerClient = clientFactory.create(CloudifyManager.class);
                serviceRecipeClient = clientFactory.create(ServiceRecipe.class);
        }
        
                return collectionNetworkResourceCustomizationClient.get(uri);
        }
 
+       public CloudifyManager getCloudifyManager(String id) {
+               return this.getSingleCloudifyManager(UriBuilder.fromUri(endpoint+"/cloudifyManager/"+id).build());
+       }
+       
+       public CloudSite getCloudSite(String id){
+               return this.getSinglCloudSite(UriBuilder.fromUri(endpoint+"/cloudSite/"+id).build());
+       }
+       
+       public CloudIdentity getCloudIdentity(String id){
+               return this.getSingleCloudIdentity(UriBuilder.fromUri(endpoint+"/cloudIdentity/"+id).build());
+       }
+       
+       public CloudSite getCloudSiteByClliAndAicVersion (String clli, String aicVersion){
+               return this.getSinglCloudSite(UriBuilder.fromUri(endpoint+"/cloud_sites/search/findByClliAndCloudVersion")
+               .queryParam("CLLI",clli).queryParam("AIC_VERSION",aicVersion)
+               .build());
+       }
+
        private InstanceGroup getSingleInstanceGroup(URI uri) {
                return instanceGroupClient.get(uri);
        }
                return serviceRecipeClient.get(uri);
        }
 
+       protected CloudSite getSinglCloudSite(URI uri) {
+               return cloudSiteClient.get(uri);
+       }
+
+       protected CloudIdentity getSingleCloudIdentity(URI uri) {
+               return cloudIdentityClient.get(uri);
+       }
+
+       protected CloudifyManager getSingleCloudifyManager(URI uri) {
+               return cloudifyManagerClient.get(uri);
+       }
+
        public Service getServiceByModelVersionAndModelInvariantUUID(String modelVersion, String modelInvariantUUID) {
                return this.getSingleService(
                                UriBuilder.fromUri(findByModelVersionAndModelInvariantUUIDURI)
 
--- /dev/null
+package org.onap.so.db.catalog.data.repository;
+
+import org.onap.so.db.catalog.beans.CloudIdentity;
+import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.data.rest.core.annotation.RepositoryRestResource;
+
+@RepositoryRestResource(collectionResourceRel = "cloudIdentity", path = "cloudIdentity")
+public interface CloudIdentityRepository extends JpaRepository<CloudIdentity, String> {
+
+}
 
--- /dev/null
+package org.onap.so.db.catalog.data.repository;
+
+import org.onap.so.db.catalog.beans.CloudSite;
+import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.data.rest.core.annotation.RepositoryRestResource;
+
+import javax.transaction.Transactional;
+
+@RepositoryRestResource(collectionResourceRel = "cloudSite", path = "cloudSite")
+@Transactional
+public interface CloudSiteRepository extends JpaRepository<CloudSite, String> {
+
+    CloudSite findByClliAndCloudVersion(String clli, String aicVersion);
+}
 
--- /dev/null
+package org.onap.so.db.catalog.data.repository;
+
+import org.onap.so.db.catalog.beans.CloudifyManager;
+import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.data.rest.core.annotation.RepositoryRestResource;
+
+@RepositoryRestResource(collectionResourceRel = "cloudifyManager", path = "cloudifyManager")
+public interface CloudifyManagerRepository extends JpaRepository<CloudifyManager, String> {
+
+}
 
--- /dev/null
+package org.onap.so;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.springframework.boot.test.context.SpringBootTest;
+import org.springframework.test.context.ActiveProfiles;
+import org.springframework.test.context.junit4.SpringRunner;
+
+@RunWith(SpringRunner.class)
+@SpringBootTest(classes = TestApplication.class, webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
+@ActiveProfiles("test")
+public class BaseTest {
+    @Test
+    public void testNothing(){}
+}
 
  * ============LICENSE_END=========================================================
  */
 
-package org.onap.so.cloud;
+package org.onap.so.db.catalog.beans;
 
 
 import static org.junit.Assert.assertEquals;
 import java.security.GeneralSecurityException;
 
 import org.junit.Test;
+import org.onap.so.db.catalog.beans.AuthenticationType;
+import org.onap.so.db.catalog.beans.CloudIdentity;
+import org.onap.so.db.catalog.beans.ServerType;
 import org.onap.so.utils.CryptoUtils;
 
 public class CloudIdentityTest {
         assertTrue (id.getMemberRole ().equals ("member"));
         assertTrue (id.getMsoId ().equals ("msoId"));
         assertTrue (CryptoUtils.decryptCloudConfigPassword(id.getMsoPass()).equals ("password"));
-        assertTrue (id.hasTenantMetadata ());
+        assertTrue (id.getTenantMetadata ());
 //        assertTrue (id.toString ().contains ("keystone"));
         assertTrue(id.toString().contains("null"));
     }
 
  * ============LICENSE_END=========================================================
  */
 
-package org.onap.so.cloud;
+package org.onap.so.db.catalog.beans;
 
 import static org.junit.Assert.assertEquals;
 import org.junit.Test;
+import org.onap.so.db.catalog.beans.CloudifyManager;
 
 public class CloudifyManagerTest {
        
 
--- /dev/null
+package org.onap.so.db.catalog.data.repository;
+
+import org.junit.Assert;
+import org.junit.Test;
+import org.onap.so.BaseTest;
+import org.onap.so.db.catalog.beans.CloudIdentity;
+import org.springframework.beans.factory.annotation.Autowired;
+
+public class CloudIdentityRepositoryTest extends BaseTest {
+    
+    @Autowired
+    private CloudIdentityRepository cloudIdentityRepository;
+    
+    @Test
+    public void findOneTest() throws Exception {
+        CloudIdentity cloudIdentity = cloudIdentityRepository.findOne("mtn13");
+        Assert.assertNotNull(cloudIdentity);
+        Assert.assertEquals("mtn13",cloudIdentity.getId());
+    }
+
+}
\ No newline at end of file
 
--- /dev/null
+package org.onap.so.db.catalog.data.repository;
+
+import org.junit.Assert;
+import org.junit.Test;
+import org.onap.so.BaseTest;
+import org.onap.so.db.catalog.beans.CloudSite;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.util.CollectionUtils;
+
+import java.util.List;
+
+public class CloudSiteRepositoryTest extends BaseTest {
+    
+    @Autowired
+    private CloudSiteRepository cloudSiteRepository;
+    
+    @Test
+    public void findByClliAndAicVersionTest() throws Exception {
+        CloudSite cloudSite = cloudSiteRepository.findByClliAndCloudVersion("MDT13","2.5");
+        Assert.assertNotNull(cloudSite);
+        Assert.assertEquals("mtn13",cloudSite.getId());
+    }
+
+    @Test
+    public void findOneTest() throws Exception {
+        CloudSite cloudSite = cloudSiteRepository.findOne("mtn13");
+        Assert.assertNotNull(cloudSite);
+        Assert.assertEquals("mtn13",cloudSite.getId());
+    }
+
+    @Test
+    public void findAllTest() throws Exception {
+        List<CloudSite> cloudSiteList = cloudSiteRepository.findAll();
+        Assert.assertFalse(CollectionUtils.isEmpty(cloudSiteList));
+    }
+
+}
\ No newline at end of file
 
--- /dev/null
+package org.onap.so.db.catalog.data.repository;
+
+import org.junit.Assert;
+import org.junit.Test;
+import org.onap.so.BaseTest;
+import org.onap.so.db.catalog.beans.CloudifyManager;
+import org.springframework.beans.factory.annotation.Autowired;
+
+public class CloudifyManagerRepositoryTest extends BaseTest {
+
+    @Autowired
+    private CloudifyManagerRepository cloudifyManagerRepository;
+
+    @Test
+    public void findOneTest() throws Exception {
+        CloudifyManager cloudifyManager = cloudifyManagerRepository.findOne("mtn13");
+        Assert.assertNotNull(cloudifyManager);
+        Assert.assertEquals("mtn13", cloudifyManager.getId());
+    }
+
+}
\ No newline at end of file
 
 ('CUSTOM', 'PENDING_CREATE', 'CUSTOM', 'CONTINUE'),
 ('CUSTOM', 'PENDING_DELETE', 'CUSTOM', 'CONTINUE'),
 ('CUSTOM', 'PRECREATED', 'CUSTOM', 'CONTINUE');
+
+
+INSERT INTO `cloudify_managers` (`ID`, `CLOUDIFY_URL`, `USERNAME`, `PASSWORD`, `VERSION`, `LAST_UPDATED_BY`, `CREATION_TIMESTAMP`, `UPDATE_TIMESTAMP`) VALUES ('mtn13', 'http://localhost:28090/v2.0', 'm93945', '93937EA01B94A10A49279D4572B48369', NULL, 'MSO_USER', '2018-07-17 14:05:08', '2018-07-17 14:05:08');
+
+INSERT INTO `identity_services` (`ID`, `IDENTITY_URL`, `MSO_ID`, `MSO_PASS`, `ADMIN_TENANT`, `MEMBER_ROLE`, `TENANT_METADATA`, `IDENTITY_SERVER_TYPE`, `IDENTITY_AUTHENTICATION_TYPE`, `LAST_UPDATED_BY`, `CREATION_TIMESTAMP`, `UPDATE_TIMESTAMP`) VALUES ('MTN13', 'http://localhost:28090/v2.0', 'm93945', '93937EA01B94A10A49279D4572B48369', 'admin', 'admin', 1, 'KEYSTONE', 'USERNAME_PASSWORD', 'MSO_USER', '2018-07-17 14:02:33', '2018-07-17 14:02:33');
+
+INSERT INTO `cloud_sites` (`ID`, `REGION_ID`, `IDENTITY_SERVICE_ID`, `CLOUD_VERSION`, `CLLI`, `CLOUDIFY_ID`, `PLATFORM`, `ORCHESTRATOR`, `LAST_UPDATED_BY`, `CREATION_TIMESTAMP`, `UPDATE_TIMESTAMP`) VALUES ('mtn13', 'mtn13', 'MTN13', '2.5', 'MDT13', 'mtn13', NULL, 'orchestrator', 'MSO_USER', '2018-07-17 14:06:28', '2018-07-17 14:06:28');
\ No newline at end of file
 
 ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
 
 ALTER TABLE `vnf_recipe` 
-CHANGE COLUMN `VNF_TYPE` `NF_ROLE` VARCHAR(200) NULL DEFAULT NULL ;
\ No newline at end of file
+CHANGE COLUMN `VNF_TYPE` `NF_ROLE` VARCHAR(200) NULL DEFAULT NULL ;
+
+CREATE TABLE IF NOT EXISTS `identity_services` (
+  `ID` varchar(50) NOT NULL,
+  `IDENTITY_URL` varchar(200) DEFAULT NULL,
+  `MSO_ID` varchar(255) DEFAULT NULL,
+  `MSO_PASS` varchar(255) DEFAULT NULL,
+  `ADMIN_TENANT` varchar(50) DEFAULT NULL,
+  `MEMBER_ROLE` varchar(50) DEFAULT NULL,
+  `TENANT_METADATA` tinyint(1) DEFAULT 0,
+  `IDENTITY_SERVER_TYPE` varchar(50) DEFAULT NULL,
+  `IDENTITY_AUTHENTICATION_TYPE` varchar(50) DEFAULT NULL,
+  `LAST_UPDATED_BY` varchar(120) DEFAULT NULL,
+  `CREATION_TIMESTAMP` timestamp NULL DEFAULT current_timestamp(),
+  `UPDATE_TIMESTAMP` timestamp NULL DEFAULT current_timestamp(),
+  PRIMARY KEY (`ID`)
+) ;
+
+
+CREATE TABLE IF NOT EXISTS `cloudify_managers` (
+  `ID` varchar(50) NOT NULL,
+  `CLOUDIFY_URL` varchar(200) DEFAULT NULL,
+  `USERNAME` varchar(255) DEFAULT NULL,
+  `PASSWORD` varchar(255) DEFAULT NULL,
+  `VERSION` varchar(20) DEFAULT NULL,
+  `LAST_UPDATED_BY` varchar(120) DEFAULT NULL,
+  `CREATION_TIMESTAMP` timestamp NULL DEFAULT current_timestamp(),
+  `UPDATE_TIMESTAMP` timestamp NULL DEFAULT current_timestamp(),
+  PRIMARY KEY (`ID`)
+) ;
+
+
+
+
+CREATE TABLE IF NOT EXISTS `cloud_sites` (
+  `ID` varchar(50) NOT NULL,
+  `REGION_ID` varchar(11)  DEFAULT NULL,
+  `IDENTITY_SERVICE_ID` varchar(50)  DEFAULT NULL,
+  `CLOUD_VERSION` varchar(20)  DEFAULT NULL,
+  `CLLI` varchar(11)  DEFAULT NULL,
+  `CLOUDIFY_ID` varchar(50)  DEFAULT NULL,
+  `PLATFORM` varchar(50)  DEFAULT NULL,
+  `ORCHESTRATOR` varchar(50)  DEFAULT NULL,
+  `LAST_UPDATED_BY` varchar(120) DEFAULT NULL,
+  `CREATION_TIMESTAMP` timestamp NULL DEFAULT current_timestamp(),
+  `UPDATE_TIMESTAMP` timestamp NULL DEFAULT current_timestamp(),
+  PRIMARY KEY (`ID`),
+  KEY `FK_cloud_sites_identity_services` (`IDENTITY_SERVICE_ID`),
+  CONSTRAINT `FK_cloud_sites_identity_services` FOREIGN KEY (`IDENTITY_SERVICE_ID`) REFERENCES `identity_services` (`ID`)
+) ;
\ No newline at end of file