diff --git a/vid-app-common/src/main/java/org/ecomp/aai/model/AaiAICZones/AicZones.java b/vid-app-common/src/main/java/org/ecomp/aai/model/AaiAICZones/AicZones.java
deleted file mode 100644
index ee8bcf0..0000000
--- a/vid-app-common/src/main/java/org/ecomp/aai/model/AaiAICZones/AicZones.java
+++ /dev/null
@@ -1,10 +0,0 @@
-package org.ecomp.aai.model.AaiAICZones;
-
-import java.util.List;
-
-import org.codehaus.jackson.annotate.JsonProperty;
-
-public class AicZones {
-	@JsonProperty("zone")
-	public List<Zone> zones;
-}
diff --git a/vid-app-common/src/main/java/org/ecomp/aai/model/AaiAICZones/Zone.java b/vid-app-common/src/main/java/org/ecomp/aai/model/AaiAICZones/Zone.java
deleted file mode 100644
index 00d387c..0000000
--- a/vid-app-common/src/main/java/org/ecomp/aai/model/AaiAICZones/Zone.java
+++ /dev/null
@@ -1,13 +0,0 @@
-package org.ecomp.aai.model.AaiAICZones;
-
-import org.codehaus.jackson.annotate.JsonIgnoreProperties;
-import org.codehaus.jackson.annotate.JsonProperty;
-
-@JsonIgnoreProperties(ignoreUnknown = true)
-public class Zone {
-    @JsonProperty("zone-id")
-    public String zoneId;
-    
-    @JsonProperty("zone-name")
-    public String zoneName;
-}
diff --git a/vid-app-common/src/main/java/org/onap/vid/RelatedTo.java b/vid-app-common/src/main/java/org/onap/vid/RelatedTo.java
new file mode 100644
index 0000000..738f620
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/RelatedTo.java
@@ -0,0 +1,39 @@
+package org.onap.vid;
+
+import com.fasterxml.jackson.annotation.*;
+import org.codehaus.jackson.annotate.JsonProperty;
+
+import java.util.HashMap;
+import java.util.Map;
+
+@JsonInclude(JsonInclude.Include.NON_NULL)
+@JsonPropertyOrder({
+        "id",
+        "node-type",
+        "relationship-label",
+        "url"
+})
+public class RelatedTo {
+
+    @JsonProperty("id")
+    public String id;
+    @JsonProperty("node-type")
+    public String nodeType;
+    @JsonProperty("relationship-label")
+    public String relationshipLabel;
+    @JsonProperty("url")
+    public String url;
+    @JsonIgnore
+    private Map<String, Object> additionalProperties = new HashMap<String, Object>();
+
+    @JsonAnyGetter
+    public Map<String, Object> getAdditionalProperties() {
+        return this.additionalProperties;
+    }
+
+    @JsonAnySetter
+    public void setAdditionalProperty(String name, Object value) {
+        this.additionalProperties.put(name, value);
+    }
+
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/aai/AaiClient.java b/vid-app-common/src/main/java/org/onap/vid/aai/AaiClient.java
new file mode 100644
index 0000000..2b8cf3a
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/aai/AaiClient.java
@@ -0,0 +1,489 @@
+package org.onap.vid.aai;
+
+import org.apache.http.HttpStatus;
+import org.apache.http.client.utils.URIBuilder;
+import org.codehaus.jackson.map.ObjectMapper;
+import org.json.simple.JSONArray;
+import org.json.simple.JSONObject;
+import org.json.simple.parser.JSONParser;
+import org.onap.vid.aai.util.AAIRestInterface;
+import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
+import org.onap.vid.aai.model.AaiGetAicZone.AicZones;
+import org.onap.vid.aai.model.AaiGetOperationalEnvironments.OperationalEnvironmentList;
+import org.onap.vid.aai.model.*;
+import org.onap.vid.aai.model.AaiGetPnfs.Pnf;
+import org.onap.vid.aai.model.AaiGetServicesRequestModel.GetServicesAAIRespone;
+import org.onap.vid.aai.model.AaiGetTenatns.GetTenantsResponse;
+import org.onap.vid.model.SubscriberList;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.util.UriUtils;
+
+import javax.servlet.ServletContext;
+import javax.ws.rs.BadRequestException;
+import javax.ws.rs.WebApplicationException;
+import javax.ws.rs.core.Response;
+import java.io.File;
+import java.io.IOException;
+import java.io.UnsupportedEncodingException;
+import java.net.URLEncoder;
+import java.text.DateFormat;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+import java.util.Iterator;
+import java.util.List;
+import java.util.UUID;
+
+/**
+
+ * Created by Oren on 7/4/17.
+ */
+public class AaiClient implements AaiClientInterface {
+
+    /**
+     * The Constant dateFormat.
+     */
+    final static DateFormat dateFormat = new SimpleDateFormat("HH:mm:ss:SSSS");
+    protected String fromAppId = "VidAaiController";
+    @Autowired
+    ServletContext servletContext;
+    /**
+     * The logger
+     */
+
+    EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(AaiClient.class);
+    private final String getServiceModelsResponseBody = "{\"start\" : \"service-design-and-creation/models/\", \"query\" : \"query/serviceModels-byDistributionStatus?distributionStatus=DISTRIBUTION_COMPLETE_OK\"}";
+
+    public AaiClient() {
+        //        certiPath = getCertificatesFile().getAbsolutePath();
+        //        depth = "0";
+    }
+
+    public AaiClient(ServletContext context) {
+        servletContext = context;
+    }
+
+
+    private static String checkForNull(String local) {
+        if (local != null)
+            return local;
+        else
+            return "";
+
+    }
+
+    @Override
+    public AaiResponse getServicesByOwningEntityId(List<String> owningEntityIds){
+        File certiPath = getCertificatesFile();
+        Response resp = doAaiGet(certiPath.getAbsolutePath(), getUrlFromLIst("business/owning-entities?", "owning-entity-id=", owningEntityIds), false);
+        AaiResponse aaiResponse = proccessAaiResponse(resp, OwningEntityResponse.class, null);
+
+        return aaiResponse;
+    }
+
+    @Override
+    public AaiResponse getServicesByProjectNames(List<String> projectNames){
+        File certiPath = getCertificatesFile();
+        Response resp = doAaiGet(certiPath.getAbsolutePath(), getUrlFromLIst("business/projects?", "project-name=",  projectNames), false);
+        AaiResponse aaiResponse = proccessAaiResponse(resp, ProjectResponse.class, null);
+
+        return aaiResponse;
+    }
+
+    @Override
+    public AaiResponse getServiceModelsByDistributionStatus() {
+        File certiPath = getCertificatesFile();
+        Response resp = doAaiPut(certiPath.getAbsolutePath(), "query?format=resource", getServiceModelsResponseBody, false);
+        AaiResponse aaiResponse = proccessAaiResponse(resp, GetServiceModelsByDistributionStatusResponse.class, null);
+
+        return aaiResponse;
+    }
+
+    @Override
+    public AaiResponse getPNFData(String globalCustomerId, String serviceType, String modelVersionId, String modelInvariantId, String cloudRegion, String equipVendor, String equipModel) {
+        String certiPath = getCertificatesFile().getAbsolutePath();
+        String siQuery = "/business/customers/customer/" + globalCustomerId + "/service-subscriptions/service-subscription/" + encodePathSegment(serviceType) + "/service-instances?model-version-id=" + modelVersionId + "&model-invariant-id=" + modelInvariantId;
+        String pnfQuery = "query/pnf-fromModel-byRegion?cloudRegionId=" + encodePathSegment(cloudRegion) + "&equipVendor=" + encodePathSegment(equipVendor) + "&equipModel=" + encodePathSegment(equipModel);
+        String payload = "{\"start\":\"" + siQuery + "\",\"query\":\"" + pnfQuery + "\"}";
+        Response resp = doAaiPut(certiPath, "query?format=simple", payload, false);
+        return proccessAaiResponse(resp, AaiGetPnfResponse.class, null);
+    }
+
+
+    @Override
+    public AaiResponse<Pnf> getSpecificPnf(String pnfId) {
+        File certiPath = getCertificatesFile();
+        Response resp = doAaiGet(certiPath.getAbsolutePath(), "network/pnfs/pnf/"+pnfId, false);
+        AaiResponse aaiResponse = proccessAaiResponse(resp, Pnf.class, null);
+
+        return aaiResponse;
+    }
+
+    public AaiResponse getServiceInstance(String globalCustomerId, String serviceType, String serviceInstanceId) {
+        String certiPath = getCertificatesFile().getAbsolutePath();
+        String getServiceInstancePath = "business/customers/customer/"+globalCustomerId+"/service-subscriptions/service-subscription/"+serviceType+"/service-instances/service-instance/"+serviceInstanceId;
+        Response resp = doAaiGet(certiPath , getServiceInstancePath , false);
+        return proccessAaiResponse(resp, ServiceRelationships.class, null);
+    }
+
+    @Override
+    public AaiResponse getLogicalLink(String link) {
+        String certiPath = getCertificatesFile().getAbsolutePath();
+        Response resp = doAaiGet(certiPath , "network/logical-links/logical-link/" + link , false);
+        return proccessAaiResponse(resp, LogicalLinkResponse.class, null);
+    }
+
+    private String getUrlFromLIst(String url, String paramKey, List<String> params){
+        url.concat(paramKey);
+        int i = 0;
+        for(String param: params){
+            i ++;
+            url = url.concat(paramKey);
+            String encodedParam= param;
+            try {
+                encodedParam= URLEncoder.encode(param, "UTF-8");
+            } catch (UnsupportedEncodingException e) {
+                String methodName = "getUrlFromList";
+                logger.error(EELFLoggerDelegate.errorLogger, dateFormat.format(new Date()) + "<== " + "." + methodName + e.toString());
+                logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + "." + methodName + e.toString());
+            }
+            url = url.concat(encodedParam);
+            if(i != params.size()){
+                url = url.concat("&");
+            }
+        }
+        return url;
+    }
+
+
+    @Override
+    public AaiResponse<SubscriberList> getAllSubscribers() {
+        String certiPath = getCertificatesFile().getAbsolutePath();
+        String depth = "0";
+        Response resp = doAaiGet(certiPath, "business/customers?subscriber-type=INFRA&depth=" + depth, false);
+        return proccessAaiResponse(resp, SubscriberList.class, null);
+    }
+
+
+    @Override
+    public AaiResponse getAllAicZones() {
+        String certiPath = getCertificatesFile().getAbsolutePath();
+        Response resp = doAaiGet(certiPath, "network/zones", false);
+        AaiResponse aaiAicZones = proccessAaiResponse(resp, AicZones.class, null);
+        return aaiAicZones;
+    }
+
+
+    @Override
+    public AaiResponse<String> getAicZoneForPnf(String globalCustomerId , String serviceType , String serviceId) {
+        String certiPath = getCertificatesFile().getAbsolutePath();
+        String aicZonePath = "business/customers/customer/" + globalCustomerId + "/service-subscriptions/service-subscription/" + serviceType + "/service-instances/service-instance/" + serviceId;
+        Response resp = doAaiGet(certiPath , aicZonePath , false);
+        AaiResponse<ServiceRelationships> aaiResponse = proccessAaiResponse(resp , ServiceRelationships.class , null);
+        ServiceRelationships serviceRelationships = (ServiceRelationships)aaiResponse.getT();
+        RelationshipList relationshipList = serviceRelationships.getRelationshipList();
+        Relationship relationship = relationshipList.getRelationship().get(0);
+        RelationshipData relationshipData=  relationship.getRelationDataList().get(0);
+        String aicZone = relationshipData.getRelationshipValue();
+        AaiResponse<String> aaiAicZonaForPnfResponse = new AaiResponse(aicZone , null ,HttpStatus.SC_OK);
+        return  aaiAicZonaForPnfResponse;
+    }
+
+
+    @Override
+    public AaiResponse getVNFData() {
+        String certiPath = getCertificatesFile().getAbsolutePath();
+        String payload = "{\"start\": [\"/business/customers/customer/e433710f-9217-458d-a79d-1c7aff376d89/service-subscriptions/service-subscription/VIRTUAL%20USP/service-instances/service-instance/3f93c7cb-2fd0-4557-9514-e189b7b04f9d\"],	\"query\": \"query/vnf-topology-fromServiceInstance\"}";
+        Response resp = doAaiPut(certiPath, "query?format=simple", payload, false);
+        return proccessAaiResponse(resp, AaiGetVnfResponse.class, null);
+
+    }
+
+    @Override
+    public Response getVNFData(String globalSubscriberId, String serviceType) {
+        String certiPath = getCertificatesFile().getAbsolutePath();
+        String payload = "{\"start\": [\"business/customers/customer/" + globalSubscriberId + "/service-subscriptions/service-subscription/"+ encodePathSegment(serviceType) +"/service-instances\"]," +
+                "\"query\": \"query/vnf-topology-fromServiceInstance\"}";
+        return doAaiPut(certiPath, "query?format=simple", payload, false);
+
+    }
+
+    @Override
+    public AaiResponse getVNFData(String globalSubscriberId, String serviceType, String serviceInstanceId) {
+        String certiPath = getCertificatesFile().getAbsolutePath();
+        String payload = "{\"start\": [\"/business/customers/customer/" + globalSubscriberId + "/service-subscriptions/service-subscription/" + encodePathSegment(serviceType) + "/service-instances/service-instance/" + serviceInstanceId + "\"],	\"query\": \"query/vnf-topology-fromServiceInstance\"}";
+        Response resp = doAaiPut(certiPath, "query?format=simple", payload, false);
+        return proccessAaiResponse(resp, AaiGetVnfResponse.class, null);
+    }
+
+    @Override
+    public Response getVersionByInvariantId(List<String> modelInvariantId) {
+        File certiPath = getCertificatesFile();
+        StringBuilder sb = new StringBuilder();
+        for (String id : modelInvariantId){
+            sb.append("&model-invariant-id=");
+            sb.append(id);
+
+        }
+        Response resp = doAaiGet(certiPath.getAbsolutePath(), "service-design-and-creation/models?depth=2"+ sb.toString(), false);
+        return resp;
+    }
+
+    @Override
+    public AaiResponse getSubscriberData(String subscriberId) {
+        File certiPath = getCertificatesFile();
+        String depth = "2";
+        AaiResponse subscriberDataResponse;
+        Response resp = doAaiGet(certiPath.getAbsolutePath(), "business/customers/customer/" + subscriberId + "?depth=" + depth, false);
+        subscriberDataResponse = proccessAaiResponse(resp, Services.class, null);
+        return subscriberDataResponse;
+    }
+
+    @Override
+    public AaiResponse getServices() {
+        File certiPath = getCertificatesFile();
+        Response resp = doAaiGet(certiPath.getAbsolutePath(), "service-design-and-creation/services", false);
+        AaiResponse<GetServicesAAIRespone> getServicesResponse = proccessAaiResponse(resp, GetServicesAAIRespone.class, null);
+
+        return getServicesResponse;
+    }
+
+    @Override
+    public AaiResponse getOperationalEnvironments(String operationalEnvironmentType, String operationalEnvironmentStatus) {
+        File certiPath = getCertificatesFile();
+        String url = "cloud-infrastructure/operational-environments";
+        URIBuilder urlBuilder  = new URIBuilder();
+        if (operationalEnvironmentType != null)
+            urlBuilder.addParameter("operational-environment-type", operationalEnvironmentType);
+        if (operationalEnvironmentStatus != null)
+            urlBuilder.addParameter("operational-environment-status", operationalEnvironmentStatus);
+        url += urlBuilder.toString();
+        Response resp = doAaiGet(certiPath.getAbsolutePath(), url, false);
+        AaiResponse<OperationalEnvironmentList> getOperationalEnvironmentsResponse = proccessAaiResponse(resp, OperationalEnvironmentList.class, null);
+        return getOperationalEnvironmentsResponse;
+
+    }
+
+    @Override
+    public AaiResponse getTenants(String globalCustomerId, String serviceType) {
+        File certiPath = getCertificatesFile();
+        String url = "business/customers/customer/" + globalCustomerId + "/service-subscriptions/service-subscription/" + serviceType;
+
+        Response resp = doAaiGet(certiPath.getAbsolutePath(), url, false);
+        String responseAsString = parseForTenantsByServiceSubscription(resp.readEntity(String.class));
+        if (responseAsString.equals("")){
+            AaiResponse aaiResponse = new AaiResponse<>(null, String.format("{\"statusText\":\" A&AI has no LCP Region & Tenants associated to subscriber '%s' and service type '%s'\"}", globalCustomerId, serviceType), HttpStatus.SC_INTERNAL_SERVER_ERROR);
+            return  aaiResponse;
+        }
+        else {
+            AaiResponse<GetTenantsResponse[]> getTenantsResponse = proccessAaiResponse(resp, GetTenantsResponse[].class, responseAsString);
+            return getTenantsResponse;
+        }
+
+    }
+
+    @Override
+    public AaiResponse getNodeTemplateInstances(String globalCustomerId, String serviceType, String modelVersionId, String modelInvariantId, String cloudRegion) {
+
+        String certiPath = getCertificatesFile().getAbsolutePath();
+
+        String siQuery = "/business/customers/customer/" + globalCustomerId + "/service-subscriptions/service-subscription/" + encodePathSegment(serviceType) + "/service-instances?model-version-id=" + modelVersionId + "&model-invariant-id=" + modelInvariantId;
+        String vnfQuery = "query/queryvnfFromModelbyRegion?cloudRegionId=" + encodePathSegment(cloudRegion);
+        String payload1 = "{\"start\":\"" + siQuery + "\",\"query\":\"" + vnfQuery + "\"}";
+
+        Response resp1 = doAaiPut(certiPath, "query?format=simple", payload1, false);
+        AaiResponse aaiResponse1 = proccessAaiResponse(resp1, AaiGetVnfResponse.class, null);
+        logger.debug(EELFLoggerDelegate.debugLogger, "getNodeTemplateInstances AAI's response: {}", aaiResponse1);
+        return aaiResponse1;
+    }
+
+    private AaiResponse proccessAaiResponse(Response resp, Class classType, String responseBody) {
+        AaiResponse subscriberDataResponse = null;
+        if (resp == null) {
+            subscriberDataResponse = new AaiResponse<>(null, null, HttpStatus.SC_INTERNAL_SERVER_ERROR);
+            logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + "Invalid response from AAI");
+        } else {
+            logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + "getSubscribers() resp=" + resp.getStatusInfo().toString());
+            if (resp.getStatus() != HttpStatus.SC_OK) {
+                logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + "Invalid response from AAI");
+                subscriberDataResponse = new AaiResponse<>(null, resp.readEntity(String.class), resp.getStatus());
+            } else {
+                String finalResponse = null;
+                try {
+                    if (responseBody != null) {
+                        finalResponse = responseBody;
+                    } else {
+                        finalResponse = resp.readEntity(String.class);
+                    }
+
+                    subscriberDataResponse = new AaiResponse<>((new ObjectMapper().readValue(finalResponse, classType)), null, HttpStatus.SC_OK);
+
+                } catch(Exception e){
+                    subscriberDataResponse = new AaiResponse<>(null, null, HttpStatus.SC_INTERNAL_SERVER_ERROR);
+                    logger.error("Failed to parse aai response: \"{}\" to class {}", finalResponse, classType, e);
+                }
+            }
+        }
+        return subscriberDataResponse;
+    }
+
+    private File getCertificatesFile() {
+        if (servletContext != null)
+            return new File(servletContext.getRealPath("/WEB-INF/cert/"));
+        return null;
+    }
+
+    @SuppressWarnings("all")
+    public Response doAaiGet(String certiPath, String uri, boolean xml) {
+        String methodName = "doAaiGet";
+        String transId = UUID.randomUUID().toString();
+        logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
+
+        Response resp = null;
+        try {
+
+            AAIRestInterface restContrller = new AAIRestInterface(certiPath);
+            resp = restContrller.RestGet(fromAppId, transId, uri, xml);
+
+        } catch (WebApplicationException e) {
+            final String message = ((BadRequestException) e).getResponse().readEntity(String.class);
+            logger.info(EELFLoggerDelegate.errorLogger, dateFormat.format(new Date()) + "<== " + "." + methodName + message);
+            logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + "." + methodName + message);
+        } catch (Exception e) {
+            logger.info(EELFLoggerDelegate.errorLogger, dateFormat.format(new Date()) + "<== " + "." + methodName + e.toString());
+            logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + "." + methodName + e.toString());
+        }
+
+        return resp;
+    }
+
+    private String parseForTenantsByServiceSubscription(String resp) {
+        String tenantList = "";
+
+        try {
+            JSONParser jsonParser = new JSONParser();
+
+            JSONObject jsonObject = (JSONObject) jsonParser.parse(resp);
+
+            return parseServiceSubscriptionObjectForTenants(jsonObject);
+        } catch (Exception ex) {
+
+        }
+
+        return tenantList;
+    }
+
+    protected Response doAaiPut(String certiPath, String uri, String payload, boolean xml) {
+        String methodName = "doAaiPut";
+        String transId = UUID.randomUUID().toString();
+        logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
+
+        Response resp = null;
+        try {
+
+            AAIRestInterface restContrller = new AAIRestInterface(certiPath);
+            resp = restContrller.RestPut(fromAppId, transId, uri, payload, xml);
+
+        } catch (Exception e) {
+            logger.info(EELFLoggerDelegate.errorLogger, dateFormat.format(new Date()) + "<== " + "." + methodName + e.toString());
+            logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + "." + methodName + e.toString());
+        }
+
+        return resp;
+    }
+
+
+    public static String parseServiceSubscriptionObjectForTenants(JSONObject jsonObject) {
+
+        JSONArray tenantArray = new JSONArray();
+        boolean bconvert = false;
+
+        try {
+            JSONObject relationShipListsObj = (JSONObject) jsonObject.get("relationship-list");
+            if (relationShipListsObj != null) {
+                JSONArray rShipArray = (JSONArray) relationShipListsObj.get("relationship");
+                if (rShipArray != null) {
+                    Iterator i1 = rShipArray.iterator();
+
+                    while (i1.hasNext()) {
+
+                        JSONObject inner1Obj = (JSONObject) i1.next();
+
+                        if (inner1Obj == null)
+                            continue;
+
+                        String relatedTo = checkForNull((String) inner1Obj.get("related-to"));
+                        if (relatedTo.equalsIgnoreCase("tenant")) {
+                            JSONObject tenantNewObj = new JSONObject();
+
+                            String relatedLink = checkForNull((String) inner1Obj.get("related-link"));
+                            tenantNewObj.put("link", relatedLink);
+
+                            JSONArray rDataArray = (JSONArray) inner1Obj.get("relationship-data");
+                            if (rDataArray != null) {
+                                Iterator i2 = rDataArray.iterator();
+
+                                while (i2.hasNext()) {
+                                    JSONObject inner2Obj = (JSONObject) i2.next();
+
+                                    if (inner2Obj == null)
+                                        continue;
+
+                                    String rShipKey = checkForNull((String) inner2Obj.get("relationship-key"));
+                                    String rShipVal = checkForNull((String) inner2Obj.get("relationship-value"));
+                                    if (rShipKey.equalsIgnoreCase("cloud-region.cloud-owner")) {
+                                        tenantNewObj.put("cloudOwner", rShipVal);
+                                    } else if (rShipKey.equalsIgnoreCase("cloud-region.cloud-region-id")) {
+                                        tenantNewObj.put("cloudRegionID", rShipVal);
+                                    }
+
+                                    if (rShipKey.equalsIgnoreCase("tenant.tenant-id")) {
+                                        tenantNewObj.put("tenantID", rShipVal);
+                                    }
+                                }
+                            }
+
+                            JSONArray relatedTPropArray = (JSONArray) inner1Obj.get("related-to-property");
+                            if (relatedTPropArray != null) {
+                                Iterator i3 = relatedTPropArray.iterator();
+
+                                while (i3.hasNext()) {
+                                    JSONObject inner3Obj = (JSONObject) i3.next();
+
+                                    if (inner3Obj == null)
+                                        continue;
+
+                                    String propKey = checkForNull((String) inner3Obj.get("property-key"));
+                                    String propVal = checkForNull((String) inner3Obj.get("property-value"));
+                                    if (propKey.equalsIgnoreCase("tenant.tenant-name")) {
+                                        tenantNewObj.put("tenantName", propVal);
+                                    }
+                                }
+                            }
+                            bconvert = true;
+                            tenantArray.add(tenantNewObj);
+                        }
+                    }
+
+                }
+            }
+        } catch (NullPointerException ex) {
+
+
+        }
+
+        if (bconvert)
+            return tenantArray.toJSONString();
+        else
+            return "";
+
+    }
+
+    private static String encodePathSegment(String segmentToEncode) {
+        try {
+            return UriUtils.encodePathSegment(segmentToEncode, "UTF-8");
+        } catch (UnsupportedEncodingException e) {
+            throw new RuntimeException("URI encoding failed unexpectedly", e);
+        }
+    }
+
+}
\ No newline at end of file
diff --git a/vid-app-common/src/main/java/org/onap/vid/aai/AaiClientInterface.java b/vid-app-common/src/main/java/org/onap/vid/aai/AaiClientInterface.java
new file mode 100644
index 0000000..5095f48
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/aai/AaiClientInterface.java
@@ -0,0 +1,58 @@
+package org.onap.vid.aai;
+
+import org.codehaus.jackson.JsonParseException;
+import org.codehaus.jackson.map.JsonMappingException;
+import org.onap.vid.aai.model.AaiGetPnfs.Pnf;
+import org.onap.vid.aai.model.AaiGetOperationalEnvironments.OperationalEnvironmentList;
+import org.onap.vid.aai.model.AaiGetServicesRequestModel.GetServicesAAIRespone;
+import org.onap.vid.aai.model.AaiGetTenatns.GetTenantsResponse;
+import org.onap.vid.model.SubscriberList;
+
+import javax.ws.rs.core.Response;
+
+import java.io.IOException;
+import java.util.List;
+
+/**
+ * Created by Oren on 7/4/17.
+ */
+public interface AaiClientInterface {
+
+    AaiResponse<SubscriberList> getAllSubscribers();
+
+    AaiResponse getSubscriberData(String subscriberId);
+
+    AaiResponse getServices();
+
+    AaiResponse getServicesByOwningEntityId(List<String> owningEntityIds);
+
+    AaiResponse<GetTenantsResponse[]> getTenants(String globalCustomerId, String serviceType);
+
+    AaiResponse<OperationalEnvironmentList> getOperationalEnvironments(String operationalEnvironmentType, String operationalEnvironmentStatus);
+
+    AaiResponse getAllAicZones();
+
+    AaiResponse getAicZoneForPnf(String globalCustomerId , String serviceType , String serviceId);
+
+	AaiResponse getVNFData();
+
+    Response getVNFData(String globalSubscriberId, String serviceType);
+
+    AaiResponse getVNFData(String globalSubscriberId, String serviceType, String serviceInstanceId);
+
+    AaiResponse getNodeTemplateInstances(String globalCustomerId, String serviceType, String modelVersionId, String modelInvariantId, String cloudRegion);
+
+    Response getVersionByInvariantId(List<String> modelInvariantId);
+
+    AaiResponse getServicesByProjectNames(List<String> projectNames);
+
+    AaiResponse getServiceModelsByDistributionStatus();
+	
+    AaiResponse getPNFData(String globalCustomerId, String serviceType, String modelVersionId, String modelInvariantId, String cloudRegion, String equipVendor, String equipModel);
+
+    AaiResponse<Pnf> getSpecificPnf(String pnfId);
+
+    AaiResponse getServiceInstance(String globalCustomerId, String serviceType, String serviceInstanceId);
+
+    AaiResponse getLogicalLink(String link);
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/aai/AaiGetVnfResponse.java b/vid-app-common/src/main/java/org/onap/vid/aai/AaiGetVnfResponse.java
new file mode 100644
index 0000000..14e8e5d
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/aai/AaiGetVnfResponse.java
@@ -0,0 +1,39 @@
+package org.onap.vid.aai;
+
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.google.common.base.MoreObjects;
+import org.codehaus.jackson.annotate.*;
+import org.onap.vid.aai.model.VnfResult;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+@JsonInclude(JsonInclude.Include.NON_NULL)
+@JsonPropertyOrder({
+        "results"
+})
+public class AaiGetVnfResponse {
+    @JsonProperty("results")
+    public List<VnfResult> results = null;
+    @JsonIgnore
+    private Map<String, Object> additionalProperties = new HashMap<String, Object>();
+
+    @JsonAnyGetter
+    public Map<String, Object> getAdditionalProperties() {
+        return this.additionalProperties;
+    }
+
+    @JsonAnySetter
+    public void setAdditionalProperty(String name, Object value) {
+        this.additionalProperties.put(name, value);
+    }
+
+    @Override
+    public String toString() {
+        return MoreObjects.toStringHelper(this)
+                .add("results", results)
+                .add("additionalProperties", additionalProperties)
+                .toString();
+    }
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/aai/AaiResponse.java b/vid-app-common/src/main/java/org/onap/vid/aai/AaiResponse.java
new file mode 100644
index 0000000..c4b19b1
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/aai/AaiResponse.java
@@ -0,0 +1,34 @@
+package org.onap.vid.aai;
+
+import com.google.common.base.MoreObjects;
+import org.onap.vid.model.ProxyResponse;
+
+/**
+ * Created by Oren on 7/10/17.
+ */
+public class AaiResponse<T> extends ProxyResponse{
+
+    T t;
+
+    public AaiResponse() {
+    }
+
+    public AaiResponse(T t, String errorMessage, int aaiHttpCode) {
+        this.t = t;
+        this.errorMessage = errorMessage;
+        this.httpCode = aaiHttpCode;
+    }
+
+    public T getT() {
+        return t;
+    }
+
+    @Override
+    public String toString() {
+        return MoreObjects.toStringHelper(this)
+                .add("httpCode", httpCode)
+                .add("errorMessage", errorMessage)
+                .add("t", t)
+                .toString();
+    }
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/aai/OperationalEnvironment.java b/vid-app-common/src/main/java/org/onap/vid/aai/OperationalEnvironment.java
new file mode 100644
index 0000000..10ad4e9
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/aai/OperationalEnvironment.java
@@ -0,0 +1,107 @@
+package org.onap.vid.aai;
+
+import org.codehaus.jackson.annotate.JsonIgnoreProperties;
+import org.codehaus.jackson.annotate.JsonProperty;
+import org.onap.vid.aai.model.Relationship;
+import org.onap.vid.aai.model.RelationshipList;
+
+import java.util.List;
+
+@JsonIgnoreProperties(ignoreUnknown = true)
+public class OperationalEnvironment {
+
+    private String operationalEnvironmentId;
+    private String operationalEnvironmentName;
+    private String operationalEnvironmentType;
+    private String operationalEnvironmentStatus;
+    private String tenantContext;
+    private String workloadContext;
+    private String resourceVersion;
+    private RelationshipList relationshipList;
+
+    public OperationalEnvironment() {
+    }
+
+    public OperationalEnvironment(String operationalEnvironmentId, String operationalEnvironmentName, String operationalEnvironmentType, String operationalEnvironmentStatus, String tenantContext, String workloadContext, String resourceVersion, RelationshipList relationshipList) {
+        this.operationalEnvironmentId = operationalEnvironmentId;
+        this.operationalEnvironmentName = operationalEnvironmentName;
+        this.operationalEnvironmentType = operationalEnvironmentType;
+        this.operationalEnvironmentStatus = operationalEnvironmentStatus;
+        this.tenantContext = tenantContext;
+        this.workloadContext = workloadContext;
+        this.resourceVersion = resourceVersion;
+        this.relationshipList = relationshipList;
+    }
+
+    @JsonProperty("operational-environment-id")
+    public String getOperationalEnvironmentId() {
+        return operationalEnvironmentId;
+    }
+
+    public void setOperationalEnvironmentId(String operationalEnvironmentId) {
+        this.operationalEnvironmentId = operationalEnvironmentId;
+    }
+
+    @JsonProperty("operational-environment-name")
+    public String getOperationalEnvironmentName() {
+        return operationalEnvironmentName;
+    }
+
+    public void setOperationalEnvironmentName(String operationalEnvironmentName) {
+        this.operationalEnvironmentName = operationalEnvironmentName;
+    }
+
+    @JsonProperty("operational-environment-type")
+    public String getOperationalEnvironmentType() {
+        return operationalEnvironmentType;
+    }
+
+    public void setOperationalEnvironmentType(String operationalEnvironmentType) {
+        this.operationalEnvironmentType = operationalEnvironmentType;
+    }
+
+    @JsonProperty("operational-environment-status")
+    public String getOperationalEnvironmentStatus() {
+        return operationalEnvironmentStatus;
+    }
+
+    public void setOperationalEnvironmentStatus(String operationalEnvironmentStatus) {
+        this.operationalEnvironmentStatus = operationalEnvironmentStatus;
+    }
+
+    @JsonProperty("tenant-context")
+    public String getTenantContext() {
+        return tenantContext;
+    }
+
+    public void setTenantContext(String tenantContext) {
+        this.tenantContext = tenantContext;
+    }
+
+    @JsonProperty("workload-context")
+    public String getWorkloadContext() {
+        return workloadContext;
+    }
+
+    public void setWorkloadContext(String workloadContext) {
+        this.workloadContext = workloadContext;
+    }
+
+    @JsonProperty("resource-version")
+    public String getResourceVersion() {
+        return resourceVersion;
+    }
+
+    public void setResourceVersion(String resourceVersion) {
+        this.resourceVersion = resourceVersion;
+    }
+
+    @JsonProperty("relationship-list")
+    public RelationshipList getRelationshipList() {
+        return relationshipList;
+    }
+
+    public void setRelationshipList(RelationshipList relationshipList) {
+        this.relationshipList = relationshipList;
+    }
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/aai/ServiceInstance.java b/vid-app-common/src/main/java/org/onap/vid/aai/ServiceInstance.java
new file mode 100644
index 0000000..26f4a21
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/aai/ServiceInstance.java
@@ -0,0 +1,33 @@
+package org.onap.vid.aai;
+
+import org.codehaus.jackson.annotate.JsonIgnoreProperties;
+import org.codehaus.jackson.annotate.JsonProperty;
+
+@JsonIgnoreProperties(ignoreUnknown = true)
+public class ServiceInstance {
+	
+	@JsonProperty("service-instance-id")
+	public String serviceInstanceId;
+
+	@JsonProperty("service-instance-name")
+	public String serviceInstanceName;
+	
+	@JsonProperty("persona-model-id")
+	public String personaModelId;
+	
+	@JsonProperty("persona-model-version")
+	public String personaModelVersion;
+	
+	@JsonProperty("resource-version")
+	public String resourceVersion;
+	
+	@JsonProperty("orchestration-status")
+	public String orchestrationStatus;
+
+	@JsonProperty("model-invariant-id")
+	public String modelInvariantId;
+
+	@JsonProperty("model-version-id")
+	public String modelVersionId;
+
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/aai/ServiceInstances.java b/vid-app-common/src/main/java/org/onap/vid/aai/ServiceInstances.java
new file mode 100644
index 0000000..c92a47a
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/aai/ServiceInstances.java
@@ -0,0 +1,14 @@
+package org.onap.vid.aai;
+
+import org.codehaus.jackson.annotate.JsonIgnoreProperties;
+import org.codehaus.jackson.annotate.JsonProperty;
+
+import java.util.List;
+
+@JsonIgnoreProperties(ignoreUnknown = true)
+public class ServiceInstances {
+	
+	@JsonProperty("service-instance")
+	public List<ServiceInstance> serviceInstance;
+
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/aai/ServiceInstancesSearchResults.java b/vid-app-common/src/main/java/org/onap/vid/aai/ServiceInstancesSearchResults.java
new file mode 100644
index 0000000..b32a83a
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/aai/ServiceInstancesSearchResults.java
@@ -0,0 +1,14 @@
+package org.onap.vid.aai;
+
+import org.codehaus.jackson.annotate.JsonIgnoreProperties;
+import org.codehaus.jackson.annotate.JsonProperty;
+import org.onap.vid.model.ServiceInstanceSearchResult;
+
+import java.util.ArrayList;
+import java.util.List;
+
+@JsonIgnoreProperties(ignoreUnknown = true)
+public class ServiceInstancesSearchResults {
+    @JsonProperty("service-instances")
+    public List<ServiceInstanceSearchResult> serviceInstances;
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/aai/ServiceSubscription.java b/vid-app-common/src/main/java/org/onap/vid/aai/ServiceSubscription.java
new file mode 100644
index 0000000..5dc9d52
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/aai/ServiceSubscription.java
@@ -0,0 +1,20 @@
+package org.onap.vid.aai;
+
+import org.codehaus.jackson.annotate.JsonIgnoreProperties;
+import org.codehaus.jackson.annotate.JsonProperty;
+
+@JsonIgnoreProperties(ignoreUnknown = true)
+public class ServiceSubscription {
+	
+    @JsonProperty("service-type")
+    public String serviceType;
+
+    @JsonProperty("resource-version")
+    public String resourceVersion;
+
+    @JsonProperty("service-instances")
+    public ServiceInstances serviceInstances;
+
+    @JsonProperty("is-permitted")
+    public boolean isPermitted =false;
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/aai/ServiceSubscriptions.java b/vid-app-common/src/main/java/org/onap/vid/aai/ServiceSubscriptions.java
new file mode 100644
index 0000000..686dc7d
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/aai/ServiceSubscriptions.java
@@ -0,0 +1,17 @@
+package org.onap.vid.aai;
+
+import org.codehaus.jackson.annotate.JsonIgnoreProperties;
+import org.codehaus.jackson.annotate.JsonProperty;
+
+import java.util.List;
+
+/**
+ * Created by Oren on 7/9/17.
+ */
+@JsonIgnoreProperties(ignoreUnknown = true)
+
+public class ServiceSubscriptions {
+
+    @JsonProperty("service-subscription")
+    public List<ServiceSubscription> serviceSubscription;
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/aai/Services.java b/vid-app-common/src/main/java/org/onap/vid/aai/Services.java
new file mode 100644
index 0000000..fe70de5
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/aai/Services.java
@@ -0,0 +1,24 @@
+package org.onap.vid.aai;
+
+import org.codehaus.jackson.annotate.JsonIgnoreProperties;
+import org.codehaus.jackson.annotate.JsonProperty;
+
+@JsonIgnoreProperties(ignoreUnknown = true)
+public class Services {
+    @JsonProperty("global-customer-id")
+    public String globalCustomerId;
+
+    @JsonProperty("subscriber-name")
+    public String subscriberName;
+
+    @JsonProperty("subscriber-type")
+    public String subscriberType;
+
+    @JsonProperty("resource-version")
+    public String resourceVersion;
+    
+    @JsonProperty("service-subscriptions")
+    public ServiceSubscriptions serviceSubscriptions;
+
+
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/aai/SubscriberAaiResponse.java b/vid-app-common/src/main/java/org/onap/vid/aai/SubscriberAaiResponse.java
new file mode 100644
index 0000000..2dad75f
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/aai/SubscriberAaiResponse.java
@@ -0,0 +1,24 @@
+package org.onap.vid.aai;
+
+import org.onap.vid.model.ProxyResponse;
+import org.onap.vid.model.SubscriberList;
+
+/**
+ * Created by Oren on 7/5/17.
+ */
+public class SubscriberAaiResponse extends ProxyResponse {
+
+
+    private SubscriberList subscriberList;
+
+    public SubscriberAaiResponse(SubscriberList subscriberList, String errorMessage, int aaiHttpCode) {
+        this.subscriberList = subscriberList;
+        this.errorMessage = errorMessage;
+        this.httpCode = aaiHttpCode;
+    }
+
+
+    public SubscriberList getSubscriberList() {
+        return subscriberList;
+    }
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/aai/SubscriberData.java b/vid-app-common/src/main/java/org/onap/vid/aai/SubscriberData.java
new file mode 100644
index 0000000..1c93d97
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/aai/SubscriberData.java
@@ -0,0 +1,7 @@
+package org.onap.vid.aai;
+
+/**
+ * Created by Oren on 7/10/17.
+ */
+public class SubscriberData {
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/aai/SubscriberFilteredResults.java b/vid-app-common/src/main/java/org/onap/vid/aai/SubscriberFilteredResults.java
new file mode 100644
index 0000000..2db9819
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/aai/SubscriberFilteredResults.java
@@ -0,0 +1,29 @@
+package org.onap.vid.aai;
+
+import org.onap.vid.model.ProxyResponse;
+import org.onap.vid.model.SubscriberList;
+import org.onap.vid.roles.RoleValidator;
+
+/**
+ * Created by Oren on 7/5/17.
+ */
+
+public class SubscriberFilteredResults extends ProxyResponse {
+
+    private SubscriberListWithFilterData subscriberList;
+
+    public SubscriberFilteredResults(RoleValidator roleValidator,SubscriberList subscribers, String errorMessage, int aaiHttpCode) {
+        this.subscriberList = new SubscriberListWithFilterData(subscribers,roleValidator);
+        this.errorMessage = errorMessage;
+        this.httpCode = aaiHttpCode;
+    }
+
+
+    public SubscriberListWithFilterData getSubscriberList() {
+        return subscriberList;
+    }
+
+    public void setSubscriberList(SubscriberListWithFilterData subscriberList) {
+        this.subscriberList = subscriberList;
+    }
+}
\ No newline at end of file
diff --git a/vid-app-common/src/main/java/org/onap/vid/aai/SubscriberListWithFilterData.java b/vid-app-common/src/main/java/org/onap/vid/aai/SubscriberListWithFilterData.java
new file mode 100644
index 0000000..0d4b4b7
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/aai/SubscriberListWithFilterData.java
@@ -0,0 +1,31 @@
+package org.onap.vid.aai;
+
+import org.onap.vid.model.Subscriber;
+import org.onap.vid.model.SubscriberList;
+import org.onap.vid.roles.RoleValidator;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * Created by Oren on 7/5/17.
+ */
+public class SubscriberListWithFilterData {
+
+    public SubscriberListWithFilterData(SubscriberList subscriberList, RoleValidator roleValidator){
+        List<Subscriber> subscribers = subscriberList.customer;
+        List<SubscriberWithFilter> subscribersWithFilter = new ArrayList<>();
+        for (Subscriber subscriber :subscribers){
+            SubscriberWithFilter subscriberWithFilter = new SubscriberWithFilter();
+            subscriberWithFilter.setIsPermitted(roleValidator.isSubscriberPermitted(subscriber.globalCustomerId));
+            subscriberWithFilter.subscriberType = subscriber.subscriberType;
+            subscriberWithFilter.resourceVersion = subscriber.resourceVersion;
+            subscriberWithFilter.subscriberName = subscriber.subscriberName;
+            subscriberWithFilter.globalCustomerId = subscriber.globalCustomerId;
+            subscribersWithFilter.add(subscriberWithFilter);
+        }
+        this.customer = subscribersWithFilter;
+     }
+
+    public List<SubscriberWithFilter> customer;
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/aai/SubscriberWithFilter.java b/vid-app-common/src/main/java/org/onap/vid/aai/SubscriberWithFilter.java
new file mode 100644
index 0000000..aaaa144
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/aai/SubscriberWithFilter.java
@@ -0,0 +1,21 @@
+package org.onap.vid.aai;
+
+import org.codehaus.jackson.annotate.JsonProperty;
+import org.onap.vid.model.Subscriber;
+
+/**
+ * Created by Oren on 7/5/17.
+ */
+public class SubscriberWithFilter extends Subscriber{
+
+    @JsonProperty("is-permitted")
+    private boolean isPermitted;
+
+    public boolean getIsPermitted() {
+        return isPermitted;
+    }
+
+    public void setIsPermitted(boolean isPermitted) {
+        this.isPermitted = isPermitted;
+    }
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/aai/exceptions/InvalidAAIResponseException.java b/vid-app-common/src/main/java/org/onap/vid/aai/exceptions/InvalidAAIResponseException.java
new file mode 100644
index 0000000..e629648
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/aai/exceptions/InvalidAAIResponseException.java
@@ -0,0 +1,7 @@
+package org.onap.vid.aai.exceptions;
+
+/**
+ * Created by Oren on 7/4/17.
+ */
+public class InvalidAAIResponseException extends Exception {
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/aai/exceptions/RoleParsingException.java b/vid-app-common/src/main/java/org/onap/vid/aai/exceptions/RoleParsingException.java
new file mode 100644
index 0000000..1d838a1
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/aai/exceptions/RoleParsingException.java
@@ -0,0 +1,7 @@
+package org.onap.vid.aai.exceptions;
+
+/**
+ * Created by Oren on 12/16/17.
+ */
+public class RoleParsingException extends Exception {
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/aai/model/AaiGetAicZone/AicZones.java b/vid-app-common/src/main/java/org/onap/vid/aai/model/AaiGetAicZone/AicZones.java
new file mode 100644
index 0000000..c30aaeb
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/aai/model/AaiGetAicZone/AicZones.java
@@ -0,0 +1,10 @@
+package org.onap.vid.aai.model.AaiGetAicZone;
+
+import java.util.List;
+
+import org.codehaus.jackson.annotate.JsonProperty;
+
+public class AicZones {
+	@JsonProperty("zone")
+	public List<Zone> zones;
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/aai/model/AaiGetAicZone/Zone.java b/vid-app-common/src/main/java/org/onap/vid/aai/model/AaiGetAicZone/Zone.java
new file mode 100644
index 0000000..89400f2
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/aai/model/AaiGetAicZone/Zone.java
@@ -0,0 +1,13 @@
+package org.onap.vid.aai.model.AaiGetAicZone;
+
+import org.codehaus.jackson.annotate.JsonIgnoreProperties;
+import org.codehaus.jackson.annotate.JsonProperty;
+
+@JsonIgnoreProperties(ignoreUnknown = true)
+public class Zone {
+    @JsonProperty("zone-id")
+    public String zoneId;
+    
+    @JsonProperty("zone-name")
+    public String zoneName;
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/aai/model/AaiGetOperationalEnvironments/OperationalEnvironmentList.java b/vid-app-common/src/main/java/org/onap/vid/aai/model/AaiGetOperationalEnvironments/OperationalEnvironmentList.java
new file mode 100644
index 0000000..1f31cfa
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/aai/model/AaiGetOperationalEnvironments/OperationalEnvironmentList.java
@@ -0,0 +1,30 @@
+package org.onap.vid.aai.model.AaiGetOperationalEnvironments;
+
+import org.codehaus.jackson.annotate.JsonIgnoreProperties;
+import org.codehaus.jackson.annotate.JsonProperty;
+import org.onap.vid.aai.OperationalEnvironment;
+
+import java.util.List;
+
+@JsonIgnoreProperties(ignoreUnknown = true)
+public class OperationalEnvironmentList {
+
+    @JsonProperty("operational-environment")
+    public List<OperationalEnvironment> getOperationalEnvironment() {
+        return operationalEnvironment;
+    }
+
+    @JsonProperty("operational-environment")
+    public void setOperationalEnvironment(List<OperationalEnvironment> operationalEnvironment) {
+        this.operationalEnvironment = operationalEnvironment;
+    }
+
+    public OperationalEnvironmentList() {
+    }
+
+    public OperationalEnvironmentList(List<OperationalEnvironment> operationalEnvironment) {
+        this.operationalEnvironment = operationalEnvironment;
+    }
+
+    private List<OperationalEnvironment> operationalEnvironment;
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/aai/model/AaiGetPnfResponse.java b/vid-app-common/src/main/java/org/onap/vid/aai/model/AaiGetPnfResponse.java
new file mode 100644
index 0000000..cd8cca8
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/aai/model/AaiGetPnfResponse.java
@@ -0,0 +1,42 @@
+package org.onap.vid.aai.model;
+
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.google.common.base.MoreObjects;
+import org.codehaus.jackson.annotate.JsonAnyGetter;
+import org.codehaus.jackson.annotate.JsonAnySetter;
+import org.codehaus.jackson.annotate.JsonIgnore;
+import org.codehaus.jackson.annotate.JsonProperty;
+import org.codehaus.jackson.annotate.JsonPropertyOrder;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+@JsonInclude(JsonInclude.Include.NON_NULL)
+@JsonPropertyOrder({
+        "results"
+})
+public class AaiGetPnfResponse {
+    @JsonProperty("results")
+    public List<PnfResult> results = null;
+    @JsonIgnore
+    private Map<String, Object> additionalProperties = new HashMap<String, Object>();
+
+    @JsonAnyGetter
+    public Map<String, Object> getAdditionalProperties() {
+        return this.additionalProperties;
+    }
+
+    @JsonAnySetter
+    public void setAdditionalProperty(String name, Object value) {
+        this.additionalProperties.put(name, value);
+    }
+
+    @Override
+    public String toString() {
+        return MoreObjects.toStringHelper(this)
+                .add("results", results)
+                .add("additionalProperties", additionalProperties)
+                .toString();
+    }
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/aai/model/AaiGetPnfs/Pnf.java b/vid-app-common/src/main/java/org/onap/vid/aai/model/AaiGetPnfs/Pnf.java
new file mode 100644
index 0000000..00a731a
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/aai/model/AaiGetPnfs/Pnf.java
@@ -0,0 +1,77 @@
+package org.onap.vid.aai.model.AaiGetPnfs;
+
+import org.codehaus.jackson.annotate.JsonIgnoreProperties;
+import org.codehaus.jackson.annotate.JsonProperty;
+import org.onap.vid.aai.model.AaiRelationResponse;
+
+@JsonIgnoreProperties(ignoreUnknown = true)
+public class Pnf extends AaiRelationResponse {
+
+    @JsonProperty("pnf-name")
+    public String pnfName;
+    @JsonProperty("pnf-name2")
+    public String pnfName2;
+    @JsonProperty("pnf-name2-source")
+    public String pnfName2Source;
+    @JsonProperty("pnf-id")
+    public String pnfId;
+    @JsonProperty("equip-type")
+    public String equipType;
+    @JsonProperty("equip-vendor")
+    public String equipVendor;
+    @JsonProperty("equip-model")
+    public String equipModel;
+
+    public String getPnfName() {
+        return pnfName;
+    }
+
+    public void setPnfName(String pnfName) {
+        this.pnfName = pnfName;
+    }
+
+    public String getEquipType() {
+        return equipType;
+    }
+
+    public void setEquipType(String equipType) {
+        this.equipType = equipType;
+    }
+
+    public String getEquipVendor() {
+        return equipVendor;
+    }
+
+    public void setEquipVendor(String equipVendor) {
+        this.equipVendor = equipVendor;
+    }
+
+    public String getPnfName2() {
+        return pnfName2;
+    }
+
+    public void setPnfName2(String pnfName2) {
+        this.pnfName2 = pnfName2;
+    }
+
+    public String getPnfId() {
+        return pnfId;
+    }
+
+    public void setPnfId(String pnfId) {
+        this.pnfId = pnfId;
+    }
+
+    public String getEquipModel() {
+        return equipModel;
+    }
+
+    public void setEquipModel(String equipModel) {
+        this.equipModel = equipModel;
+    }
+
+    public String getPnfName2Source() { return pnfName2Source; }
+
+    public void setPnfName2Source(String pnfName2Source) { this.pnfName2Source = pnfName2Source; }
+}
+
diff --git a/vid-app-common/src/main/java/org/onap/vid/aai/model/AaiGetServicesRequestModel/GetServicesAAIRespone.java b/vid-app-common/src/main/java/org/onap/vid/aai/model/AaiGetServicesRequestModel/GetServicesAAIRespone.java
new file mode 100644
index 0000000..d3dd7d2
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/aai/model/AaiGetServicesRequestModel/GetServicesAAIRespone.java
@@ -0,0 +1,11 @@
+package org.onap.vid.aai.model.AaiGetServicesRequestModel;
+
+import org.codehaus.jackson.annotate.JsonIgnoreProperties;
+import org.codehaus.jackson.annotate.JsonProperty;
+
+import java.util.List;
+@JsonIgnoreProperties(ignoreUnknown = true)
+public class GetServicesAAIRespone {
+
+    public List<Service> service;
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/aai/model/AaiGetServicesRequestModel/Service.java b/vid-app-common/src/main/java/org/onap/vid/aai/model/AaiGetServicesRequestModel/Service.java
new file mode 100644
index 0000000..367287e
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/aai/model/AaiGetServicesRequestModel/Service.java
@@ -0,0 +1,21 @@
+package org.onap.vid.aai.model.AaiGetServicesRequestModel;
+
+import org.codehaus.jackson.annotate.JsonIgnoreProperties;
+import org.codehaus.jackson.annotate.JsonProperty;
+
+/**
+ * Created by Oren on 7/17/17.
+ */
+
+@JsonIgnoreProperties(ignoreUnknown = true)
+public class Service {
+    @JsonProperty("service-id")
+    public String serviceId;
+    @JsonProperty("service-description")
+    public String serviceDescription;
+    @JsonProperty("resource-version")
+    public String resourceVersion;
+    @JsonProperty("is-permitted")
+    public boolean isPermitted;
+
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/aai/model/AaiGetTenatns/GetTenantsResponse.java b/vid-app-common/src/main/java/org/onap/vid/aai/model/AaiGetTenatns/GetTenantsResponse.java
new file mode 100644
index 0000000..bee9244
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/aai/model/AaiGetTenatns/GetTenantsResponse.java
@@ -0,0 +1,33 @@
+package org.onap.vid.aai.model.AaiGetTenatns;
+
+import org.codehaus.jackson.annotate.JsonIgnoreProperties;
+import org.codehaus.jackson.annotate.JsonProperty;
+
+/**
+ * Created by Oren on 7/18/17.
+ */
+@JsonIgnoreProperties(ignoreUnknown = true)
+public class GetTenantsResponse {
+
+    @JsonProperty("cloudRegionID")
+    public String cloudRegionId;
+
+    @JsonProperty("tenantName")
+    public String tenantName;
+
+    @JsonProperty("tenantID")
+    public String tenantID;
+
+    @JsonProperty("is-permitted")
+    public boolean isPermitted;
+
+    public GetTenantsResponse() {
+    }
+
+    public GetTenantsResponse(String cloudRegionId, String tenantName, String tenantID, boolean isPermitted) {
+        this.cloudRegionId = cloudRegionId;
+        this.tenantName = tenantName;
+        this.tenantID = tenantID;
+        this.isPermitted = isPermitted;
+    }
+}
\ No newline at end of file
diff --git a/vid-app-common/src/main/java/org/onap/vid/aai/model/AaiRelationResponse.java b/vid-app-common/src/main/java/org/onap/vid/aai/model/AaiRelationResponse.java
new file mode 100644
index 0000000..7bc2e7a
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/aai/model/AaiRelationResponse.java
@@ -0,0 +1,45 @@
+package org.onap.vid.aai.model;
+
+
+
+import org.codehaus.jackson.annotate.JsonIgnore;
+import org.codehaus.jackson.annotate.JsonProperty;
+
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * Created by moriya1 on 08/10/2017.
+ */
+public class AaiRelationResponse {
+
+    @JsonProperty("resource-version")
+    private String resourceVersion;
+    @JsonProperty("relationship-list")
+    private RelationshipList relationshipList;
+    @JsonIgnore
+    private Map<String, Object> additionalProperties = new HashMap<String, Object>();
+
+
+    @JsonProperty("resource-version")
+    public String getResourceVersion() {
+        return resourceVersion;
+    }
+
+    @JsonProperty("resource-version")
+    public void setResourceVersion(String resourceVersion) {
+        this.resourceVersion = resourceVersion;
+    }
+
+    @JsonProperty("relationship-list")
+    public RelationshipList getRelationshipList() {
+        return relationshipList;
+    }
+
+    @JsonProperty("relationship-list")
+    public void setRelationshipList(RelationshipList relationshipList) {
+        this.relationshipList = relationshipList;
+    }
+
+
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/aai/model/GetServiceModelsByDistributionStatusResponse.java b/vid-app-common/src/main/java/org/onap/vid/aai/model/GetServiceModelsByDistributionStatusResponse.java
new file mode 100644
index 0000000..5a6924d
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/aai/model/GetServiceModelsByDistributionStatusResponse.java
@@ -0,0 +1,29 @@
+package org.onap.vid.aai.model;
+
+
+import org.codehaus.jackson.annotate.JsonIgnoreProperties;
+import org.codehaus.jackson.annotate.JsonProperty;
+
+import java.util.List;
+
+/**
+ * Created by moriya1 on 15/10/2017.
+ */
+@JsonIgnoreProperties(ignoreUnknown = true)
+public class GetServiceModelsByDistributionStatusResponse {
+    @JsonProperty("results")
+    private List<Result> results;
+
+
+    @JsonProperty("results")
+    public List<Result> getResults() {
+        return results;
+    }
+
+    @JsonProperty("results")
+    public void setResults(List<Result> results) {
+        this.results = results;
+    }
+
+
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/aai/model/LogicalLinkResponse.java b/vid-app-common/src/main/java/org/onap/vid/aai/model/LogicalLinkResponse.java
new file mode 100644
index 0000000..6625957
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/aai/model/LogicalLinkResponse.java
@@ -0,0 +1,72 @@
+package org.onap.vid.aai.model;
+
+import org.codehaus.jackson.annotate.JsonProperty;
+
+public class LogicalLinkResponse {
+
+    @JsonProperty("link-name")
+    public String linkName;
+
+    @JsonProperty("in-maint")
+    public Boolean inMaint;
+
+    @JsonProperty("link-type")
+    public String linkType;
+
+    @JsonProperty("resource-version")
+    public String resourceVersion;
+
+    @JsonProperty("purpose")
+    public String purpose;
+
+    @JsonProperty("relationship-list")
+    public RelationshipList relationshipList;
+
+    public String getLinkName() {
+        return linkName;
+    }
+
+    public void setLinkName(String linkName) {
+        this.linkName = linkName;
+    }
+
+    public Boolean getInMaint() {
+        return inMaint;
+    }
+
+    public void setInMaint(Boolean inMaint) {
+        this.inMaint = inMaint;
+    }
+
+    public String getLinkType() {
+        return linkType;
+    }
+
+    public void setLinkType(String linkType) {
+        this.linkType = linkType;
+    }
+
+    public String getResourceVersion() {
+        return resourceVersion;
+    }
+
+    public void setResourceVersion(String resourceVersion) {
+        this.resourceVersion = resourceVersion;
+    }
+
+    public String getPurpose() {
+        return purpose;
+    }
+
+    public void setPurpose(String purpose) {
+        this.purpose = purpose;
+    }
+
+    public RelationshipList getRelationshipList() {
+        return relationshipList;
+    }
+
+    public void setRelationshipList(RelationshipList relationshipList) {
+        this.relationshipList = relationshipList;
+    }
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/aai/model/Model.java b/vid-app-common/src/main/java/org/onap/vid/aai/model/Model.java
new file mode 100644
index 0000000..5f422f6
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/aai/model/Model.java
@@ -0,0 +1,61 @@
+package org.onap.vid.aai.model;
+
+import org.codehaus.jackson.annotate.JsonIgnoreProperties;
+import org.codehaus.jackson.annotate.JsonProperty;
+
+/**
+ * Created by moriya1 on 15/10/2017.
+ */
+@JsonIgnoreProperties(ignoreUnknown = true)
+public class Model {
+
+        @JsonProperty("model-invariant-id")
+        private String modelInvariantId;
+        @JsonProperty("model-type")
+        private String modelType;
+        @JsonProperty("resource-version")
+        private String resourceVersion;
+        @JsonProperty("model-vers")
+        private ModelVers modelVers;
+
+        @JsonProperty("model-invariant-id")
+        public String getModelInvariantId() {
+            return modelInvariantId;
+        }
+
+        @JsonProperty("model-invariant-id")
+        public void setModelInvariantId(String modelInvariantId) {
+            this.modelInvariantId = modelInvariantId;
+        }
+
+        @JsonProperty("model-type")
+        public String getModelType() {
+            return modelType;
+        }
+
+        @JsonProperty("model-type")
+        public void setModelType(String modelType) {
+            this.modelType = modelType;
+        }
+
+        @JsonProperty("resource-version")
+        public String getResourceVersion() {
+            return resourceVersion;
+        }
+
+        @JsonProperty("resource-version")
+        public void setResourceVersion(String resourceVersion) {
+            this.resourceVersion = resourceVersion;
+        }
+
+        @JsonProperty("model-vers")
+        public ModelVers getModelVers() {
+            return modelVers;
+        }
+
+        @JsonProperty("model-vers")
+        public void setModelVers(ModelVers modelVers) {
+            this.modelVers = modelVers;
+        }
+
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/aai/model/ModelVer.java b/vid-app-common/src/main/java/org/onap/vid/aai/model/ModelVer.java
new file mode 100644
index 0000000..f02bbac
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/aai/model/ModelVer.java
@@ -0,0 +1,84 @@
+package org.onap.vid.aai.model;
+
+import org.codehaus.jackson.annotate.JsonIgnoreProperties;
+import org.codehaus.jackson.annotate.JsonProperty;
+
+@JsonIgnoreProperties(ignoreUnknown = true)
+public class ModelVer {
+
+    @JsonProperty("model-version-id")
+    private String modelVersionId;
+    @JsonProperty("model-name")
+    private String modelName;
+    @JsonProperty("model-version")
+    private String modelVersion;
+    @JsonProperty("distribution-status")
+    private String distributionStatus;
+    @JsonProperty("resource-version")
+    private String resourceVersion;
+    @JsonProperty("model-description")
+    private String modelDescription;
+
+
+
+    @JsonProperty("model-version-id")
+    public String getModelVersionId() {
+        return modelVersionId;
+    }
+
+    @JsonProperty("model-version-id")
+    public void setModelVersionId(String modelVersionId) {
+        this.modelVersionId = modelVersionId;
+    }
+
+    @JsonProperty("model-name")
+    public String getModelName() {
+        return modelName;
+    }
+
+    @JsonProperty("model-name")
+    public void setModelName(String modelName) {
+        this.modelName = modelName;
+    }
+
+    @JsonProperty("model-version")
+    public String getModelVersion() {
+        return modelVersion;
+    }
+
+    @JsonProperty("model-version")
+    public void setModelVersion(String modelVersion) {
+        this.modelVersion = modelVersion;
+    }
+
+    @JsonProperty("distribution-status")
+    public String getDistributionStatus() {
+        return distributionStatus;
+    }
+
+    @JsonProperty("distribution-status")
+    public void setDistributionStatus(String distributionStatus) {
+        this.distributionStatus = distributionStatus;
+    }
+
+    @JsonProperty("resource-version")
+    public String getResourceVersion() {
+        return resourceVersion;
+    }
+
+    @JsonProperty("resource-version")
+    public void setResourceVersion(String resourceVersion) {
+        this.resourceVersion = resourceVersion;
+    }
+
+    @JsonProperty("model-description")
+    public String getModelDescription() {
+        return modelDescription;
+    }
+
+    @JsonProperty("model-description")
+    public void setModelDescription(String modelDescription) {
+        this.modelDescription = modelDescription;
+    }
+
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/aai/model/ModelVers.java b/vid-app-common/src/main/java/org/onap/vid/aai/model/ModelVers.java
new file mode 100644
index 0000000..f352158
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/aai/model/ModelVers.java
@@ -0,0 +1,28 @@
+package org.onap.vid.aai.model;
+
+import org.codehaus.jackson.annotate.JsonIgnoreProperties;
+import org.codehaus.jackson.annotate.JsonProperty;
+
+import java.util.List;
+
+/**
+ * Created by moriya1 on 15/10/2017.
+ */
+@JsonIgnoreProperties(ignoreUnknown = true)
+public class ModelVers {
+
+    @JsonProperty("model-ver")
+    private List<ModelVer> modelVer;
+
+    @JsonProperty("model-ver")
+    public List<ModelVer> getModelVer() {
+        return modelVer;
+    }
+
+    @JsonProperty("model-ver")
+    public void setModelVer(List<ModelVer> modelVer) {
+        this.modelVer = modelVer;
+    }
+
+
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/aai/model/OwningEntity.java b/vid-app-common/src/main/java/org/onap/vid/aai/model/OwningEntity.java
new file mode 100644
index 0000000..edf5242
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/aai/model/OwningEntity.java
@@ -0,0 +1,36 @@
+package org.onap.vid.aai.model;
+
+
+import org.codehaus.jackson.annotate.JsonProperty;
+
+/**
+ * Created by moriya1 on 08/10/2017.
+ */
+public class OwningEntity extends AaiRelationResponse {
+    @JsonProperty("owning-entity-id")
+    private String owningEntityId;
+    @JsonProperty("owning-entity-name")
+    private String owningEntityName;
+
+    @JsonProperty("owning-entity-id")
+    public String getOwningEntityId() {
+        return owningEntityId;
+    }
+
+    @JsonProperty("owning-entity-id")
+    public void setOwningEntityId(String owningEntityId) {
+        this.owningEntityId = owningEntityId;
+    }
+
+    @JsonProperty("owning-entity-name")
+    public String getOwningEntityName() {
+        return owningEntityName;
+    }
+
+    @JsonProperty("owning-entity-name")
+    public void setOwningEntityName(String owningEntityName) {
+        this.owningEntityName = owningEntityName;
+    }
+
+
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/aai/model/OwningEntityResponse.java b/vid-app-common/src/main/java/org/onap/vid/aai/model/OwningEntityResponse.java
new file mode 100644
index 0000000..3a571ea
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/aai/model/OwningEntityResponse.java
@@ -0,0 +1,28 @@
+package org.onap.vid.aai.model;
+
+
+import org.codehaus.jackson.annotate.JsonProperty;
+
+import java.util.List;
+
+/**
+ * Created by moriya1 on 08/10/2017.
+ */
+public class OwningEntityResponse {
+
+    @JsonProperty("owning-entity")
+    private List<OwningEntity> owningEntity;
+
+
+    @JsonProperty("owning-entity")
+    public List<OwningEntity> getOwningEntity() {
+        return owningEntity;
+    }
+
+    @JsonProperty("owning-entity")
+    public void setOwningEntity(List<OwningEntity> owningEntity) {
+        this.owningEntity = owningEntity;
+    }
+
+
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/aai/model/PnfProperties.java b/vid-app-common/src/main/java/org/onap/vid/aai/model/PnfProperties.java
new file mode 100644
index 0000000..3481d26
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/aai/model/PnfProperties.java
@@ -0,0 +1,51 @@
+package org.onap.vid.aai.model;
+
+import com.fasterxml.jackson.annotation.JsonAnyGetter;
+import com.fasterxml.jackson.annotation.JsonAnySetter;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonPropertyOrder;
+import org.codehaus.jackson.annotate.JsonIgnoreProperties;
+import org.codehaus.jackson.annotate.JsonProperty;
+
+import java.util.HashMap;
+import java.util.Map;
+
+@JsonInclude(JsonInclude.Include.NON_NULL)
+@JsonIgnoreProperties(ignoreUnknown = true)
+@JsonPropertyOrder({
+        "pnf-name",
+        "equip-type",
+        "equip-vendor",
+        "equip-model",
+        "in-maint",
+        "resource-version"
+})
+public class PnfProperties {
+
+    @JsonProperty("pnf-name")
+    public String pnfName;
+    @JsonProperty("equip-type")
+    public String equipType;
+    @JsonProperty("equip-vendor")
+    public String equipVendor;
+    @JsonProperty("equip-model")
+    public String equipModel;
+    @JsonProperty("in-maint")
+    public Boolean inMaint;
+    @JsonProperty("resource-version")
+    public String resourceVersion;
+    @JsonIgnore
+    private Map<String, Object> additionalProperties = new HashMap<String, Object>();
+
+    @JsonAnyGetter
+    public Map<String, Object> getAdditionalProperties() {
+        return this.additionalProperties;
+    }
+
+    @JsonAnySetter
+    public void setAdditionalProperty(String name, Object value) {
+        this.additionalProperties.put(name, value);
+    }
+
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/aai/model/PnfResult.java b/vid-app-common/src/main/java/org/onap/vid/aai/model/PnfResult.java
new file mode 100644
index 0000000..a727d8f
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/aai/model/PnfResult.java
@@ -0,0 +1,49 @@
+package org.onap.vid.aai.model;
+
+import com.fasterxml.jackson.annotation.JsonAnyGetter;
+import com.fasterxml.jackson.annotation.JsonAnySetter;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonPropertyOrder;
+import org.codehaus.jackson.annotate.JsonProperty;
+import org.onap.vid.RelatedTo;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+
+@JsonInclude(JsonInclude.Include.NON_NULL)
+@JsonPropertyOrder({
+        "id",
+        "node-type",
+        "url",
+        "properties",
+        "related-to"
+})
+public class PnfResult {
+
+    @JsonProperty("id")
+    public String id;
+    @JsonProperty("node-type")
+    public String nodeType;
+    @JsonProperty("url")
+    public String url;
+    @JsonProperty("properties")
+    public PnfProperties properties;
+    @JsonProperty("related-to")
+    public List<RelatedTo> relatedTo;
+
+    @JsonIgnore
+    private Map<String, Object> additionalProperties = new HashMap<String, Object>();
+
+    @JsonAnyGetter
+    public Map<String, Object> getAdditionalProperties() {
+        return this.additionalProperties;
+    }
+
+    @JsonAnySetter
+    public void setAdditionalProperty(String name, Object value) {
+        this.additionalProperties.put(name, value);
+    }
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/aai/model/Project.java b/vid-app-common/src/main/java/org/onap/vid/aai/model/Project.java
new file mode 100644
index 0000000..5931bb9
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/aai/model/Project.java
@@ -0,0 +1,21 @@
+package org.onap.vid.aai.model;
+
+
+import org.codehaus.jackson.annotate.JsonProperty;
+
+/**
+ * Created by moriya1 on 08/10/2017.
+ */
+public class Project extends AaiRelationResponse {
+
+    @JsonProperty("project-name")
+    private String projectName;
+
+    @JsonProperty("project-name")
+    public String getProjectName() { return projectName; }
+
+    @JsonProperty("project-name")
+    public void setProjectName(String projectName) { this.projectName = projectName; }
+
+
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/aai/model/ProjectResponse.java b/vid-app-common/src/main/java/org/onap/vid/aai/model/ProjectResponse.java
new file mode 100644
index 0000000..0ca35b0
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/aai/model/ProjectResponse.java
@@ -0,0 +1,28 @@
+package org.onap.vid.aai.model;
+
+
+import org.codehaus.jackson.annotate.JsonProperty;
+
+import java.util.List;
+
+/**
+ * Created by moriya1 on 08/10/2017.
+ */
+public class ProjectResponse {
+
+    @JsonProperty("project")
+    private List<Project> project;
+
+
+    @JsonProperty("project")
+    public List<Project> getProject() {
+        return project;
+    }
+
+    @JsonProperty("project")
+    public void setProject(List<Project> project) {
+        this.project = project;
+    }
+
+
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/aai/model/RelatedToProperty.java b/vid-app-common/src/main/java/org/onap/vid/aai/model/RelatedToProperty.java
new file mode 100644
index 0000000..38003ae
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/aai/model/RelatedToProperty.java
@@ -0,0 +1,35 @@
+package org.onap.vid.aai.model;
+
+
+import org.codehaus.jackson.annotate.JsonProperty;
+
+public class RelatedToProperty {
+
+	public String getPropertyKey() {
+		return propertyKey;
+	}
+
+
+	public void setPropertyKey(String propertyKey) {
+		this.propertyKey = propertyKey;
+	}
+
+
+	public String getPropertyValue() {
+		return propertyValue;
+	}
+
+
+	public void setPropertyValue(String propertyValue) {
+		this.propertyValue = propertyValue;
+	}
+
+
+	@JsonProperty("property-key")
+	public String propertyKey;
+	
+	
+	@JsonProperty("property-value")
+	public String propertyValue;
+
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/aai/model/Relationship.java b/vid-app-common/src/main/java/org/onap/vid/aai/model/Relationship.java
new file mode 100644
index 0000000..c80d5b6
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/aai/model/Relationship.java
@@ -0,0 +1,67 @@
+package org.onap.vid.aai.model;
+
+import org.codehaus.jackson.annotate.JsonProperty;
+
+import java.util.List;
+
+
+
+
+public class Relationship {
+	
+	@JsonProperty("related-to")
+	public String relatedTo;
+	
+	@JsonProperty("related-link")
+	public String relatedLink;
+
+	@JsonProperty("relationship-label")
+	public String relationshipLabel;
+	
+	@JsonProperty("relationship-data")
+	public List<RelationshipData> relationshipData;
+	
+	@JsonProperty("related-to-property")
+	public List<RelatedToProperty> relatedToProperty;
+
+	
+	public String getRelatedTo() {
+		return relatedTo;
+	}
+
+	public void setRelatedTo(String relatedTo) {
+		this.relatedTo = relatedTo;
+	}
+
+	public String getRelatedLink() {
+		return relatedLink;
+	}
+
+	public void setRelatedLink(String relatedLink) {
+		this.relatedLink = relatedLink;
+	}
+
+	public List<RelationshipData> getRelationDataList() {
+		return relationshipData;
+	}
+
+	public void setRelationDataList(List<RelationshipData> relationDataList) {
+		this.relationshipData = relationDataList;
+	}
+
+	public List<RelatedToProperty> getRelatedToPropertyList() {
+		return relatedToProperty;
+	}
+
+	public void setRelatedToPropertyList(List<RelatedToProperty> relatedToPropertyList) {
+		this.relatedToProperty = relatedToPropertyList;
+	}
+
+	public String getRelationshipLabel() {
+		return relationshipLabel;
+	}
+
+	public void setRelationshipLabel(String relationshipLabel) {
+		this.relationshipLabel = relationshipLabel;
+	}
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/aai/model/RelationshipData.java b/vid-app-common/src/main/java/org/onap/vid/aai/model/RelationshipData.java
new file mode 100644
index 0000000..5d2d409
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/aai/model/RelationshipData.java
@@ -0,0 +1,30 @@
+package org.onap.vid.aai.model;
+
+
+import org.codehaus.jackson.annotate.JsonProperty;
+
+public class RelationshipData {
+	@JsonProperty("relationship-key")
+	public String getRelationshipKey() {
+		return relationshipKey;
+	}
+	@JsonProperty("relationship-key")
+	public void setRelationshipKey(String relationshipKey) {
+		this.relationshipKey = relationshipKey;
+	}
+	@JsonProperty("relationship-value")
+	public String getRelationshipValue() {
+		return relationshipValue;
+	}
+	@JsonProperty("relationship-value")
+	public void setRelationshipValue(String relationshipValue) {
+		this.relationshipValue = relationshipValue;
+	}
+
+	@JsonProperty("relationship-key")
+	public String relationshipKey;
+	
+	@JsonProperty("relationship-value")
+	public String relationshipValue;
+
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/aai/model/RelationshipList.java b/vid-app-common/src/main/java/org/onap/vid/aai/model/RelationshipList.java
new file mode 100644
index 0000000..43194fc
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/aai/model/RelationshipList.java
@@ -0,0 +1,26 @@
+package org.onap.vid.aai.model;
+
+import org.codehaus.jackson.annotate.JsonProperty;
+
+import java.util.List;
+
+
+public class RelationshipList {
+	
+	@JsonProperty("relationship")
+	public List<Relationship> getRelationship() {
+		return relationship;
+	}
+	
+	@JsonProperty("relationship")
+	public void setRelationship(List<Relationship> relationship) {
+		this.relationship = relationship;
+	}
+
+	@JsonProperty("relationship")
+	public List<Relationship> relationship;
+	
+	
+	
+
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/aai/model/Result.java b/vid-app-common/src/main/java/org/onap/vid/aai/model/Result.java
new file mode 100644
index 0000000..1eb46be
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/aai/model/Result.java
@@ -0,0 +1,26 @@
+package org.onap.vid.aai.model;
+
+import org.codehaus.jackson.annotate.JsonIgnoreProperties;
+import org.codehaus.jackson.annotate.JsonProperty;
+
+/**
+ * Created by moriya1 on 15/10/2017.
+ */
+@JsonIgnoreProperties(ignoreUnknown = true)
+public class Result {
+    @JsonProperty("model")
+    private Model model;
+
+    @JsonProperty("model")
+    public Model getModel() {
+        return model;
+    }
+
+    @JsonProperty("model")
+    public void setModel(Model model) {
+        this.model = model;
+    }
+
+
+
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/aai/model/ServiceInstance.java b/vid-app-common/src/main/java/org/onap/vid/aai/model/ServiceInstance.java
new file mode 100644
index 0000000..381f9bc
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/aai/model/ServiceInstance.java
@@ -0,0 +1,26 @@
+package org.onap.vid.aai.model;
+
+import org.codehaus.jackson.annotate.JsonProperty;
+
+public class ServiceInstance {
+	
+	@JsonProperty("service-instance-id")
+	public String serviceInstanceId;
+
+	@JsonProperty("service-instance-name")
+	public String serviceInstanceName;
+	
+	@JsonProperty("persona-model-id")
+	public String personaModelId;
+	
+	@JsonProperty("persona-model-version")
+	public String personaModelVersion;
+	
+	@JsonProperty("resource-version")
+	public String resourceVersion;
+	
+	@JsonProperty("orchestration-status")
+	public String orchestrationStatus;
+
+	
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/aai/model/ServiceInstances.java b/vid-app-common/src/main/java/org/onap/vid/aai/model/ServiceInstances.java
new file mode 100644
index 0000000..0fced4c
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/aai/model/ServiceInstances.java
@@ -0,0 +1,12 @@
+package org.onap.vid.aai.model;
+
+import java.util.List;
+
+import org.codehaus.jackson.annotate.JsonProperty;
+
+public class ServiceInstances {
+	
+	@JsonProperty("service-instance")
+	public List<ServiceInstance> serviceInstance;
+
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/aai/model/ServiceProperties.java b/vid-app-common/src/main/java/org/onap/vid/aai/model/ServiceProperties.java
new file mode 100644
index 0000000..a76bcf8
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/aai/model/ServiceProperties.java
@@ -0,0 +1,113 @@
+package org.onap.vid.aai.model;
+
+import com.fasterxml.jackson.annotation.*;
+import org.codehaus.jackson.annotate.JsonIgnoreProperties;
+import org.codehaus.jackson.annotate.JsonProperty;
+
+import java.util.HashMap;
+import java.util.Map;
+
+@JsonInclude(JsonInclude.Include.NON_NULL)
+@JsonIgnoreProperties(ignoreUnknown = true)
+@JsonPropertyOrder({
+        "service-instance-id",
+        "service-instance-name",
+        "model-invariant-id",
+        "model-version-id",
+        "resource-version",
+        "orchestration-status",
+        "global-customer-id",
+        "subscriber-name",
+        "subscriber-type",
+        "vnf-id",
+        "vnf-name",
+        "vnf-type",
+        "service-id",
+        "prov-status",
+        "in-maint",
+        "is-closed-loop-disabled",
+        "model-customization-id",
+        "nf-type",
+        "nf-function",
+        "nf-role",
+        "nf-naming-code"
+})
+public class ServiceProperties {
+
+    @JsonProperty("service-instance-id")
+    @com.fasterxml.jackson.annotation.JsonProperty("service-instance-id")
+    public String serviceInstanceId;
+    @JsonProperty("service-instance-name")
+    @com.fasterxml.jackson.annotation.JsonProperty("service-instance-name")
+    public String serviceInstanceName;
+    @JsonProperty("model-invariant-id")
+    @com.fasterxml.jackson.annotation.JsonProperty("model-invariant-id")
+    public String modelInvariantId;
+    @JsonProperty("model-version-id")
+    @com.fasterxml.jackson.annotation.JsonProperty("model-version-id")
+    public String modelVersionId;
+    @JsonProperty("resource-version")
+    @com.fasterxml.jackson.annotation.JsonProperty("resource-version")
+    public String resourceVersion;
+    @JsonProperty("orchestration-status")
+    @com.fasterxml.jackson.annotation.JsonProperty("orchestration-status")
+    public String orchestrationStatus;
+    @JsonProperty("global-customer-id")
+    @com.fasterxml.jackson.annotation.JsonProperty("global-customer-id")
+    public String globalCustomerId;
+    @JsonProperty("subscriber-name")
+    @com.fasterxml.jackson.annotation.JsonProperty("subscriber-name")
+    public String subscriberName;
+    @JsonProperty("subscriber-type")
+    @com.fasterxml.jackson.annotation.JsonProperty("subscriber-type")
+    public String subscriberType;
+    @JsonProperty("vnf-id")
+    @com.fasterxml.jackson.annotation.JsonProperty("vnf-id")
+    public String vnfId;
+    @JsonProperty("vnf-name")
+    @com.fasterxml.jackson.annotation.JsonProperty("vnf-name")
+    public String vnfName;
+    @JsonProperty("vnf-type")
+    @com.fasterxml.jackson.annotation.JsonProperty("vnf-type")
+    public String vnfType;
+    @JsonProperty("service-id")
+    @com.fasterxml.jackson.annotation.JsonProperty("service-id")
+    public String serviceId;
+    @JsonProperty("prov-status")
+    @com.fasterxml.jackson.annotation.JsonProperty("prov-status")
+    public String provStatus;
+    @JsonProperty("in-maint")
+    @com.fasterxml.jackson.annotation.JsonProperty("in-maint")
+    public Boolean inMaint;
+    @JsonProperty("is-closed-loop-disabled")
+    @com.fasterxml.jackson.annotation.JsonProperty("is-closed-loop-disabled")
+    public Boolean isClosedLoopDisabled;
+    @JsonProperty("model-customization-id")
+    @com.fasterxml.jackson.annotation.JsonProperty("model-customization-id")
+    public String modelCustomizationId;
+    @JsonProperty("nf-type")
+    @com.fasterxml.jackson.annotation.JsonProperty("nf-type")
+    public String nfType;
+    @JsonProperty("nf-function")
+    @com.fasterxml.jackson.annotation.JsonProperty("nf-function")
+    public String nfFunction;
+    @JsonProperty("nf-role")
+    @com.fasterxml.jackson.annotation.JsonProperty("nf-role")
+    public String nfRole;
+    @JsonProperty("nf-naming-code")
+    @com.fasterxml.jackson.annotation.JsonProperty("nf-naming-code")
+    public String nfNamingCode;
+    @JsonIgnore
+    private Map<String, Object> additionalProperties = new HashMap<String, Object>();
+
+    @JsonAnyGetter
+    public Map<String, Object> getAdditionalProperties() {
+        return this.additionalProperties;
+    }
+
+    @JsonAnySetter
+    public void setAdditionalProperty(String name, Object value) {
+        this.additionalProperties.put(name, value);
+    }
+
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/aai/model/ServiceRelationships.java b/vid-app-common/src/main/java/org/onap/vid/aai/model/ServiceRelationships.java
new file mode 100644
index 0000000..b8abc84
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/aai/model/ServiceRelationships.java
@@ -0,0 +1,102 @@
+package org.onap.vid.aai.model;
+
+import org.codehaus.jackson.annotate.JsonProperty;
+
+public class ServiceRelationships {
+	
+	@JsonProperty("service-instance-id")
+	public String serviceInstanceId;
+
+	@JsonProperty("service-instance-name")
+	public String serviceInstanceName;
+
+	@JsonProperty("service-type")
+	public String serviceType;
+
+	@JsonProperty("service-role")
+	public String serviceRole;
+
+	@JsonProperty("environment-context")
+	public String environmentContext;
+
+	@JsonProperty("workload-context")
+	public String workloadContext;
+
+	@JsonProperty("model-invariant-id")
+	public String modelInvariantId;
+	
+	@JsonProperty("model-version-id")
+	public String modelVersionId;
+
+	@JsonProperty("resource-version")
+	public String resourceVersion;
+	
+	@JsonProperty("orchestration-status")
+	public String orchestrationStatus;
+
+	@JsonProperty("relationship-list")
+	public RelationshipList relationshipList;
+
+
+	public String getServiceInstanceId() {
+		return serviceInstanceId;
+	}
+
+	public void setServiceInstanceId(String serviceInstanceId) {
+		this.serviceInstanceId = serviceInstanceId;
+	}
+
+	public String getServiceInstanceName() {
+		return serviceInstanceName;
+	}
+
+	public void setServiceInstanceName(String serviceInstanceName) {
+		this.serviceInstanceName = serviceInstanceName;
+	}
+
+	public String getModelInvariantId() {
+		return modelInvariantId;
+	}
+
+	public void setModelInvariantId(String modelInvariantId) {
+		this.modelInvariantId = modelInvariantId;
+	}
+
+	public String getModelVersionId() {
+		return modelVersionId;
+	}
+
+	public void setModelVersionId(String modelVersionId) {
+		this.modelVersionId = modelVersionId;
+	}
+
+	public String getResourceVersion() {
+		return resourceVersion;
+	}
+
+	public void setResourceVersion(String resourceVersion) {
+		this.resourceVersion = resourceVersion;
+	}
+
+	public String getOrchestrationStatus() {
+		return orchestrationStatus;
+	}
+
+	public void setOrchestrationStatus(String orchestrationStatus) {
+		this.orchestrationStatus = orchestrationStatus;
+	}
+
+	public RelationshipList getRelationshipList() {
+		return relationshipList;
+	}
+
+	public void setRelationshipList(RelationshipList relationshipList) {
+		this.relationshipList = relationshipList;
+	}
+
+
+
+	
+	
+
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/aai/model/ServiceSubscription.java b/vid-app-common/src/main/java/org/onap/vid/aai/model/ServiceSubscription.java
new file mode 100644
index 0000000..91582e8
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/aai/model/ServiceSubscription.java
@@ -0,0 +1,17 @@
+package org.onap.vid.aai.model;
+
+import org.codehaus.jackson.annotate.JsonProperty;
+
+public class ServiceSubscription {
+	
+    @JsonProperty("service-type")
+    public String serviceType;
+
+    @JsonProperty("resource-version")
+    public String resourceVersion;
+
+    @JsonProperty("service-instances")
+    public ServiceInstances serviceInstances;
+
+
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/aai/model/Services.java b/vid-app-common/src/main/java/org/onap/vid/aai/model/Services.java
new file mode 100644
index 0000000..3ba4b22
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/aai/model/Services.java
@@ -0,0 +1,24 @@
+package org.onap.vid.aai.model;
+
+import java.util.List;
+
+import org.codehaus.jackson.annotate.JsonProperty;
+
+public class Services {
+    @JsonProperty("global-customer-id")
+    public String globalCustomerId;
+
+    @JsonProperty("subscriber-name")
+    public String subscriberName;
+
+    @JsonProperty("subscriber-type")
+    public String subscriberType;
+
+    @JsonProperty("resource-version")
+    public String resourceVersion;
+    
+    @JsonProperty("service-subscriptions")
+    public List<ServiceSubscription> serviceSubscriptions;
+
+
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/aai/model/VnfResult.java b/vid-app-common/src/main/java/org/onap/vid/aai/model/VnfResult.java
new file mode 100644
index 0000000..e4f2284
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/aai/model/VnfResult.java
@@ -0,0 +1,46 @@
+package org.onap.vid.aai.model;
+
+import com.fasterxml.jackson.annotation.*;
+import org.codehaus.jackson.annotate.JsonProperty;
+import org.onap.vid.RelatedTo;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+
+@JsonInclude(JsonInclude.Include.NON_NULL)
+@JsonPropertyOrder({
+        "id",
+        "node-type",
+        "url",
+        "properties",
+        "related-to"
+})
+public class VnfResult {
+
+    @JsonProperty("id")
+    public String id;
+    @com.fasterxml.jackson.annotation.JsonProperty("node-type")
+    @JsonProperty("node-type")
+    public String nodeType;
+    @JsonProperty("url")
+    public String url;
+    @JsonProperty("properties")
+    public ServiceProperties properties;
+    @JsonProperty("related-to")
+    @com.fasterxml.jackson.annotation.JsonProperty("related-to")
+    public List<RelatedTo> relatedTo = null;
+    @JsonIgnore
+    private Map<String, Object> additionalProperties = new HashMap<String, Object>();
+
+    @JsonAnyGetter
+    public Map<String, Object> getAdditionalProperties() {
+        return this.additionalProperties;
+    }
+
+    @JsonAnySetter
+    public void setAdditionalProperty(String name, Object value) {
+        this.additionalProperties.put(name, value);
+    }
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/aai/util/AAIProperties.java b/vid-app-common/src/main/java/org/onap/vid/aai/util/AAIProperties.java
new file mode 100644
index 0000000..254584c
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/aai/util/AAIProperties.java
@@ -0,0 +1,68 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * VID
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.vid.aai.util;
+
+
+import org.openecomp.portalsdk.core.util.SystemProperties;
+
+/**
+ * The Class AAIProperties.
+ */
+public class AAIProperties extends SystemProperties {
+
+	/** The Constant AAI_SERVER_URL_BASE. */
+	//VID Specific
+	public static final String AAI_SERVER_URL_BASE = "aai.server.url.base";
+	
+	/** The Constant AAI_SERVER_URL. */
+	public static final String AAI_SERVER_URL = "aai.server.url";
+	
+	/** The Constant AAI_OLDSERVER_URL_BASE. */
+	public static final String AAI_OLDSERVER_URL_BASE = "aai.oldserver.url.base";
+	
+	/** The Constant AAI_OLDSERVER_URL. */
+	public static final String AAI_OLDSERVER_URL = "aai.oldserver.url";
+	
+	/** The Constant AAI_TRUSTSTORE_FILENAME. */
+	public static final String AAI_TRUSTSTORE_FILENAME = "aai.truststore.filename";
+	
+	/** The Constant AAI_TRUSTSTORE_PASSWD_X. */
+	public static final String AAI_TRUSTSTORE_PASSWD_X = "aai.truststore.passwd.x";
+	
+	/** The Constant AAI_KEYSTORE_FILENAME. */
+	public static final String AAI_KEYSTORE_FILENAME = "aai.keystore.filename";
+	
+	/** The Constant AAI_KEYSTORE_PASSWD_X. */
+	public static final String AAI_KEYSTORE_PASSWD_X = "aai.keystore.passwd.x";
+		
+	/** The Constant AAI_VID_USERNAME. */
+	public static final String AAI_VID_USERNAME = "aai.vid.username";
+
+	/** The Constant AAI_VID_PASSWD_X. */
+	public static final String AAI_VID_PASSWD_X = "aai.vid.passwd.x";
+	
+	/** The Constant FILESEPARTOR. */
+	public static final String FILESEPARTOR = (System.getProperty("file.separator") == null) ? "/" : System.getProperty("file.separator");
+
+	/** The Constant AAI_USE_CLIENT_CERT */
+	public static final String AAI_USE_CLIENT_CERT = "aai.use.client.cert";
+	
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/aai/util/AAIRestInterface.java b/vid-app-common/src/main/java/org/onap/vid/aai/util/AAIRestInterface.java
new file mode 100644
index 0000000..13b7d30
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/aai/util/AAIRestInterface.java
@@ -0,0 +1,373 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * VID
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+package org.onap.vid.aai.util;
+
+
+import java.io.UnsupportedEncodingException;
+import java.net.URLEncoder;
+import java.security.KeyManagementException;
+import java.text.DateFormat;
+import java.text.SimpleDateFormat;
+import java.util.Base64;
+import java.util.Date;
+import java.util.UUID;
+
+import javax.ws.rs.client.Client;
+import javax.ws.rs.client.Entity;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.Response;
+
+import com.att.eelf.configuration.EELFLogger;
+import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
+import org.openecomp.portalsdk.core.util.SystemProperties;
+import org.eclipse.jetty.util.security.Password;
+import org.onap.vid.utils.Logging;
+import org.springframework.http.HttpMethod;
+import static org.onap.vid.utils.Logging.getHttpServletRequest;
+import static org.onap.vid.utils.Logging.requestIdHeaderKey;
+
+
+/**
+ * The Class AAIRestInterface.
+ */
+public class AAIRestInterface {
+
+	/** The logger. */
+	EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(AAIRestInterface.class);
+
+	final private EELFLogger outgoingRequestsLogger = Logging.getRequestsLogger("aai");
+
+	/** The Constant dateFormat. */
+	final static DateFormat dateFormat = new SimpleDateFormat("HH:mm:ss:SSSS");
+
+	/** The client. */
+	private static Client client = null;
+
+	/** The rest srvr base URL. */
+	private String restSrvrBaseURL;
+
+	/** The certificate path. */
+	public String certificatePath = "";
+
+	private String START_STRING = " start";
+
+	private String TRANSACTION_ID_HEADER = "X-TransactionId";
+	private String FROM_APP_ID_HEADER = "X-FromAppId";
+	private String SUCCESSFUL_API_MESSAGE=" REST api POST was successful!";
+	private String URL_DECLERATION = ", url=";
+
+
+
+
+
+
+	/**
+	 * Instantiates a new AAI rest interface.
+	 *
+	 * @param certPath the cert path
+	 */
+	public AAIRestInterface(String certPath)
+	{
+		certificatePath = certPath;
+	}
+
+	/**
+	 * Encode URL.
+	 *
+	 * @param nodeKey the node key
+	 * @return the string
+	 * @throws UnsupportedEncodingException the unsupported encoding exception
+	 */
+	public String encodeURL (String nodeKey) throws UnsupportedEncodingException {
+		return URLEncoder.encode(nodeKey, "UTF-8").replaceAll("\\+", "%20");
+	}
+
+	/**
+	 * Inits the rest client.
+	 */
+	private void initRestClient()
+	{
+		String methodName = "initRestClient";
+
+		if (client == null) {
+			try {
+				client = HttpsAuthClient.getClient(certificatePath);
+			}
+			catch (KeyManagementException e){
+				logger.info(EELFLoggerDelegate.errorLogger, dateFormat.format(new Date()) +  "<== KeyManagementException in " + methodName + e.toString());
+				logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) +  "<== KeyManagementException in " + methodName + e.toString());
+			} catch (Exception e) {
+				logger.info(EELFLoggerDelegate.errorLogger, dateFormat.format(new Date()) +  "<== Exception in REST call to DB in initRestClient" + e.toString());
+				logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) +  "<== Exception in REST call to DB : " + e.toString());
+			}
+		}
+	}
+
+	/**
+	 * Sets the rest srvr base URL.
+	 *
+	 * @param baseURL the base URL
+	 */
+	public void SetRestSrvrBaseURL(String baseURL)
+	{
+		if (baseURL == null)
+		{
+			logger.info(EELFLoggerDelegate.errorLogger, dateFormat.format(new Date()) +  "<== REST Server base URL cannot be null.");
+			logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) +  "<== REST Server base URL cannot be null.");
+		}
+
+		restSrvrBaseURL = baseURL;
+	}
+
+	/**
+	 * Gets the rest srvr base URL.
+	 *
+	 * @return the rest srvr base URL
+	 */
+	public String getRestSrvrBaseURL()
+	{
+		return restSrvrBaseURL;
+	}
+
+
+	/**
+	 * Rest get.
+	 *
+	 * @param fromAppId the from app id
+	 * @param transId the trans id
+	 * @param requestUri the request uri
+	 * @param xml the xml
+	 * @return the string
+	 * @throws UnsupportedEncodingException
+	 */
+	public Response RestGet(String fromAppId, String transId, String requestUri, boolean xml) throws UnsupportedEncodingException  {
+		String methodName = "RestGet";
+
+		String responseType = MediaType.APPLICATION_JSON;
+		if (xml)
+			responseType = MediaType.APPLICATION_XML;
+
+		initRestClient();
+
+		String clientCert = SystemProperties.getProperty(AAIProperties.AAI_USE_CLIENT_CERT);
+
+		boolean useClientCert = false;
+		if (clientCert != null &&
+				SystemProperties.getProperty(AAIProperties.AAI_USE_CLIENT_CERT).equalsIgnoreCase("true")) {
+			useClientCert  = true;
+		}
+		String url = "";
+		logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + START_STRING);
+
+		url = SystemProperties.getProperty(AAIProperties.AAI_SERVER_URL) + requestUri;
+
+
+		logger.debug(dateFormat.format(new Date()) + "<== " + url + " for the get REST API");
+		Logging.logRequest(outgoingRequestsLogger, HttpMethod.GET, url);
+
+		final Response cres;
+		if (useClientCert == true) {
+			cres = client.target(url)
+					.request()
+					.accept(responseType)
+					.header(TRANSACTION_ID_HEADER, transId)
+					.header(FROM_APP_ID_HEADER,  fromAppId)
+					.header("Content-Type", MediaType.APPLICATION_JSON)
+					.header(requestIdHeaderKey, getHttpServletRequest().getHeader(requestIdHeaderKey))
+					.get();
+		} else {
+
+			String vidUsername = SystemProperties.getProperty(AAIProperties.AAI_VID_USERNAME);
+			String vidPassword = Password.deobfuscate(SystemProperties.getProperty(AAIProperties.AAI_VID_PASSWD_X));
+			String encodeThis = vidUsername + ":" + vidPassword;
+
+			cres = client.target(url)
+					.request()
+					.accept(responseType)
+					.header(TRANSACTION_ID_HEADER, transId)
+					.header(FROM_APP_ID_HEADER,  fromAppId)
+					.header("Content-Type", "application/json")
+					.header("Authorization", "Basic " + Base64.getEncoder().encodeToString(encodeThis.getBytes("utf-8")))
+					.header(requestIdHeaderKey, getHttpServletRequest().getHeader(requestIdHeaderKey))
+					.get();
+		}
+		Logging.logResponse(outgoingRequestsLogger, HttpMethod.GET, url, cres);
+//		String r = cres.readEntity(String.class);
+		if (cres.getStatus() == 200) {
+			logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + SUCCESSFUL_API_MESSAGE);
+			logger.info(EELFLoggerDelegate.errorLogger, dateFormat.format(new Date()) + "<== " + methodName + SUCCESSFUL_API_MESSAGE);
+		} else {
+			logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName +" with status="+cres.getStatus()+URL_DECLERATION+url);
+		}
+		return cres;
+//		 logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName +" resp=" + r );
+//		 return r;
+	}
+
+
+	/**
+	 * Delete.
+	 *
+	 * @param sourceID the source ID
+	 * @param transId the trans id
+	 * @param path the path
+	 * @return true, if successful
+	 */
+	public boolean Delete(String sourceID,  String transId,  String path) {
+		String methodName = "Delete";
+		String url="";
+		transId += ":" + UUID.randomUUID().toString();
+		logger.debug(dateFormat.format(new Date()) + "<== " +  methodName + START_STRING);
+
+		initRestClient();
+		String request = "{}";
+		url = SystemProperties.getProperty(AAIProperties.AAI_SERVER_URL) + path;
+		Logging.logRequest(outgoingRequestsLogger, HttpMethod.DELETE, url);
+		final Response cres = client.target(url)
+				.request()
+				.accept(MediaType.APPLICATION_JSON)
+				.header(TRANSACTION_ID_HEADER, transId)
+				.header(FROM_APP_ID_HEADER,  sourceID)
+				.header(requestIdHeaderKey, getHttpServletRequest().getHeader(requestIdHeaderKey))
+				//.entity(request)
+				.delete();
+		Logging.logResponse(outgoingRequestsLogger, HttpMethod.DELETE, url, cres);
+		if (cres.getStatus() == 404) { // resource not found
+			String msg = "Resource does not exist...: " + cres.getStatus()
+					+ ":" + cres.readEntity(String.class);
+			logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + msg);
+			return false;
+		} else if (cres.getStatus() == 200  || cres.getStatus() == 204){
+			logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + "Resource " + url + " deleted");
+			return true;
+		} else {
+			String msg = "Deleting Resource failed: " + cres.getStatus()
+					+ ":" + cres.readEntity(String.class);
+			logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + msg);
+		}
+
+		return false;
+	}
+
+
+	/**
+	 * Rest put.
+	 *
+	 * @param fromAppId the from app id
+	 * @param transId the trans id
+	 * @param path the path
+	 * @param payload the payload
+	 * @param xml the xml
+	 * @return the string
+	 */
+	public Response RestPut(String fromAppId,  String transId,  String path, String payload, boolean xml) {
+		String methodName = "RestPut";
+		String url="";
+		transId = UUID.randomUUID().toString();
+		logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " +  methodName + START_STRING);
+
+		try {
+
+			String responseType = MediaType.APPLICATION_JSON;
+			if (xml)
+				responseType = "application/xml";
+
+			initRestClient();
+
+			url = SystemProperties.getProperty(AAIProperties.AAI_SERVER_URL) + path;
+			Logging.logRequest(outgoingRequestsLogger, HttpMethod.PUT, url, payload);
+			final Response cres = client.target(url)
+					.request()
+					.accept(responseType)
+					.header(TRANSACTION_ID_HEADER, transId)
+					.header(FROM_APP_ID_HEADER,  fromAppId)
+					.header(requestIdHeaderKey, getHttpServletRequest().getHeader(requestIdHeaderKey))
+					.put(Entity.entity(payload, MediaType.APPLICATION_JSON));
+			Logging.logResponse(outgoingRequestsLogger, HttpMethod.PUT, url, cres);
+
+			if (cres.getStatus() == 200 && cres.getStatus() <= 299) {
+				logger.info(EELFLoggerDelegate.errorLogger, dateFormat.format(new Date()) + "<== " + methodName + URL_DECLERATION);
+				logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + URL_DECLERATION);
+			} else {
+				logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName +" with status="+cres.getStatus()+URL_DECLERATION+url);
+			}
+			return cres;
+		} catch (Exception e) {
+			logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + URL_DECLERATION+url+ ", Exception: " + e.toString());
+		}
+		return null;
+	}
+
+
+
+	/**
+	 * Rest post.
+	 *
+	 * @param fromAppId the from app id
+	 * @param transId the trans id
+	 * @param path the path
+	 * @param payload the payload
+	 * @param xml the xml
+	 * @return the string
+	 */
+	public Response RestPost(String fromAppId,  String transId,  String path, String payload, boolean xml) {
+		String methodName = "RestPost";
+		String url="";
+		transId = UUID.randomUUID().toString();
+		logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " +  methodName + START_STRING);
+
+		try {
+
+			String responseType = MediaType.APPLICATION_JSON;
+			if (xml)
+				responseType = "application/xml";
+
+			initRestClient();
+
+			url = SystemProperties.getProperty(AAIProperties.AAI_SERVER_URL_BASE) + path;
+			String vidUsername = SystemProperties.getProperty(AAIProperties.AAI_VID_USERNAME);
+			String vidPassword = Password.deobfuscate(SystemProperties.getProperty(AAIProperties.AAI_VID_PASSWD_X));
+			String encodeThis = vidUsername + ":" + vidPassword;
+			
+			Logging.logRequest(outgoingRequestsLogger, HttpMethod.POST, url, payload);
+			final Response cres = client.target(url)
+					.request()
+					.accept(responseType)
+					.header(TRANSACTION_ID_HEADER, transId)
+					.header(FROM_APP_ID_HEADER,  fromAppId)
+					.header("Authorization", "Basic " + Base64.getEncoder().encodeToString(encodeThis.getBytes("utf-8")))
+					.header(requestIdHeaderKey, getHttpServletRequest().getHeader(requestIdHeaderKey))
+					.post(Entity.entity(payload, MediaType.APPLICATION_JSON));
+			Logging.logResponse(outgoingRequestsLogger, HttpMethod.POST, url, cres);
+
+			if (cres.getStatus() == 200 && cres.getStatus() <= 299) {
+				logger.info(EELFLoggerDelegate.errorLogger, dateFormat.format(new Date()) + "<== " + methodName + URL_DECLERATION);
+				logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + URL_DECLERATION);
+			} else {
+				logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " with status="+cres.getStatus()+URL_DECLERATION+url);
+			}
+			return cres;
+		} catch (Exception e) {
+			logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + URL_DECLERATION+url+ ", Exception: " + e.toString());
+		}
+		return null;
+	}
+
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/aai/util/CustomJacksonJaxBJsonProvider.java b/vid-app-common/src/main/java/org/onap/vid/aai/util/CustomJacksonJaxBJsonProvider.java
new file mode 100644
index 0000000..996341a
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/aai/util/CustomJacksonJaxBJsonProvider.java
@@ -0,0 +1,73 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * VID
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.vid.aai.util;
+
+
+import javax.ws.rs.ext.Provider;
+
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.databind.DeserializationFeature;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.databind.SerializationFeature;
+import com.fasterxml.jackson.jaxrs.json.JacksonJaxbJsonProvider;
+import com.fasterxml.jackson.module.jaxb.JaxbAnnotationModule;
+
+/**
+ * The Class CustomJacksonJaxBJsonProvider.
+ */
+@Provider
+public class CustomJacksonJaxBJsonProvider extends JacksonJaxbJsonProvider {
+
+	    /** The common mapper. */
+    	private static ObjectMapper commonMapper = null;
+
+	    /**
+    	 * Instantiates a new custom jackson jax B json provider.
+    	 */
+    	public CustomJacksonJaxBJsonProvider() {
+	        if (commonMapper == null) {
+	            ObjectMapper mapper = new ObjectMapper();
+
+	            mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL);
+	            
+	            mapper.configure(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS, false);
+	            mapper.configure(SerializationFeature.INDENT_OUTPUT, false);
+	            mapper.configure(SerializationFeature.WRAP_ROOT_VALUE, false);
+
+	            mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
+	            mapper.configure(DeserializationFeature.UNWRAP_ROOT_VALUE, false);
+
+	            mapper.registerModule(new JaxbAnnotationModule());
+
+	            commonMapper = mapper;
+	        }
+	        super.setMapper(commonMapper);
+	    }
+	    
+	    /**
+    	 * Gets the mapper.
+    	 *
+    	 * @return the mapper
+    	 */
+    	public ObjectMapper getMapper() {
+	    	return commonMapper;
+	    }
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/aai/util/HttpsAuthClient.java b/vid-app-common/src/main/java/org/onap/vid/aai/util/HttpsAuthClient.java
new file mode 100644
index 0000000..0cf32cd
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/aai/util/HttpsAuthClient.java
@@ -0,0 +1,140 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * VID
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.vid.aai.util;
+
+
+import java.io.FileInputStream;
+import java.security.KeyManagementException;
+import java.security.KeyStore;
+
+import javax.net.ssl.HostnameVerifier;
+import javax.net.ssl.HttpsURLConnection;
+import javax.net.ssl.KeyManagerFactory;
+import javax.net.ssl.SSLContext;
+import javax.net.ssl.SSLSession;
+import javax.ws.rs.client.Client;
+import javax.ws.rs.client.ClientBuilder;
+
+import org.eclipse.jetty.util.security.Password;
+import org.glassfish.jersey.client.ClientConfig;
+import org.glassfish.jersey.client.HttpUrlConnectorProvider;
+import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
+import org.openecomp.portalsdk.core.util.SystemProperties;
+/**
+ * The Class HttpsAuthClient.
+ */
+public class HttpsAuthClient{
+	/** The logger. */
+	static EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(HttpsAuthClient.class);
+	
+	/**
+	 * Gets the client.
+	 *
+	 * @param certFilePath the cert file path
+	 * @return the client
+	 * @throws KeyManagementException the key management exception
+	 */
+	public static Client getClient(String certFilePath) throws KeyManagementException {
+
+		ClientConfig config = new ClientConfig();
+		//config.getFeatures().put(JSONConfiguration.FEATURE_POJO_MAPPING, Boolean.TRUE);
+		//config.getClasses().add(org.openecomp.aai.util.CustomJacksonJaxBJsonProvider.class);
+
+		try {
+			
+		    config.property(HttpUrlConnectorProvider.SET_METHOD_WORKAROUND, Boolean.TRUE );
+			
+			config.connectorProvider(new HttpUrlConnectorProvider().useSetMethodWorkaround());
+			String truststore_path = certFilePath + org.onap.vid.aai.util.AAIProperties.FILESEPARTOR + SystemProperties.getProperty(org.onap.vid.aai.util.AAIProperties.AAI_TRUSTSTORE_FILENAME);
+			String truststore_password = SystemProperties.getProperty(org.onap.vid.aai.util.AAIProperties.AAI_TRUSTSTORE_PASSWD_X);
+			String decrypted_truststore_password = Password.deobfuscate(truststore_password);
+			
+			boolean useClientCert = false;
+			
+			String keystore_path = certFilePath + org.onap.vid.aai.util.AAIProperties.FILESEPARTOR + SystemProperties.getProperty(org.onap.vid.aai.util.AAIProperties.AAI_KEYSTORE_FILENAME);
+			String keystore_password = SystemProperties.getProperty(org.onap.vid.aai.util.AAIProperties.AAI_KEYSTORE_PASSWD_X);
+			String decrypted_keystore_password = Password.deobfuscate(keystore_password);
+			
+			String clientCert = SystemProperties.getProperty(org.onap.vid.aai.util.AAIProperties.AAI_USE_CLIENT_CERT);
+			
+			if (clientCert != null && 
+					SystemProperties.getProperty(org.onap.vid.aai.util.AAIProperties.AAI_USE_CLIENT_CERT).equalsIgnoreCase("true")) {
+				useClientCert = true;
+			}
+			
+  		    System.setProperty("javax.net.ssl.trustStore", truststore_path);
+		    System.setProperty("javax.net.ssl.trustStorePassword", decrypted_truststore_password);
+			HttpsURLConnection.setDefaultHostnameVerifier( new HostnameVerifier(){
+			    public boolean verify(String string,SSLSession ssls) {
+			        return true;
+			    }
+			});
+	
+			final SSLContext ctx = SSLContext.getInstance("TLS");
+			
+			KeyManagerFactory kmf = null;
+			if (useClientCert) {
+			
+				try {
+					kmf = KeyManagerFactory.getInstance("SunX509");
+					FileInputStream fin = new FileInputStream(keystore_path);
+					KeyStore ks = KeyStore.getInstance("PKCS12");
+					char[] pwd = decrypted_keystore_password.toCharArray();
+					ks.load(fin, pwd);
+					kmf.init(ks, pwd);
+				} catch (Exception e) {
+					//System.out.println("Error setting up kmf: exiting");
+					logger.debug(EELFLoggerDelegate.debugLogger, "Error setting up kmf: exiting");
+					e.printStackTrace();
+					return null;
+				}
+				ctx.init(kmf.getKeyManagers(), null, null);
+			
+				return ClientBuilder.newBuilder()
+						.sslContext(ctx)
+						.hostnameVerifier(new HostnameVerifier() {
+							@Override
+							public boolean verify( String s, SSLSession sslSession ) {
+								return true;
+							}
+						}).withConfig(config)
+						.build()
+						.register(org.onap.vid.aai.util.CustomJacksonJaxBJsonProvider.class);
+			} else { 
+				return ClientBuilder.newBuilder()
+						.hostnameVerifier(new HostnameVerifier() {
+							@Override
+							public boolean verify( String s, SSLSession sslSession ) {
+								return true;
+							}
+						}).withConfig(config)
+						.build()
+						.register(org.onap.vid.aai.util.CustomJacksonJaxBJsonProvider.class);
+			}
+		} catch (Exception e) {
+			logger.debug(EELFLoggerDelegate.debugLogger, "Error setting up config: exiting");
+			//System.out.println("Error setting up config: exiting");
+			e.printStackTrace();
+			System.exit(1);
+			return null;
+		}
+	}
+}  
diff --git a/vid-app-common/src/main/java/org/onap/vid/aai/util/HttpsComponentsClient.java b/vid-app-common/src/main/java/org/onap/vid/aai/util/HttpsComponentsClient.java
new file mode 100644
index 0000000..54d7f46
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/aai/util/HttpsComponentsClient.java
@@ -0,0 +1,99 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * VID
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.vid.aai.util;
+
+import java.io.FileInputStream;
+import java.security.KeyManagementException;
+import java.security.KeyStore;
+
+import javax.net.ssl.SSLContext;
+
+import org.apache.http.conn.ssl.SSLContextBuilder;
+import org.apache.http.impl.client.CloseableHttpClient;
+import org.apache.http.conn.ssl.SSLConnectionSocketFactory;
+import org.apache.http.impl.client.HttpClients;
+import org.eclipse.jetty.util.security.Password;
+import org.openecomp.portalsdk.core.util.SystemProperties;
+
+
+/**
+ * The Class HttpsComponentsClient.
+ */
+public class HttpsComponentsClient{
+	
+	/**
+	 * Gets the client.
+	 *
+	 * @param certFilePath the cert file path
+	 * @return the client
+	 * @throws KeyManagementException the key management exception
+	 */
+	public static CloseableHttpClient getClient(String certFilePath) throws Exception {
+		CloseableHttpClient httpclient = null;
+		try {
+			
+			String truststore_path = certFilePath + AAIProperties.FILESEPARTOR + SystemProperties.getProperty(AAIProperties.AAI_TRUSTSTORE_FILENAME);
+			String truststore_password = SystemProperties.getProperty(AAIProperties.AAI_TRUSTSTORE_PASSWD_X);
+			String decrypted_truststore_password = Password.deobfuscate(truststore_password);
+			String keystore_path = certFilePath + AAIProperties.FILESEPARTOR + SystemProperties.getProperty(AAIProperties.AAI_KEYSTORE_FILENAME);
+			String keystore_password = SystemProperties.getProperty(AAIProperties.AAI_KEYSTORE_PASSWD_X);
+			String decrypted_keystore_password = Password.deobfuscate(keystore_password);
+			
+			SSLContextBuilder sslContextB = new SSLContextBuilder();
+			
+			KeyStore ks = KeyStore.getInstance("PKCS12");
+			FileInputStream fin = new FileInputStream(keystore_path);
+			char[] pwd = decrypted_keystore_password.toCharArray();
+			ks.load(fin, pwd);
+			
+			sslContextB.loadKeyMaterial(ks, pwd);
+			
+			KeyStore ts = KeyStore.getInstance("JKS");
+			FileInputStream fin1 = new FileInputStream(truststore_path);
+			char[] pwd1 = decrypted_truststore_password.toCharArray();
+			ts.load(fin1, pwd1);
+			
+			sslContextB.loadTrustMaterial(ts);
+			sslContextB.loadKeyMaterial(ks, pwd);
+			sslContextB.useTLS();
+			
+			SSLContext sslcontext = sslContextB.build();
+			
+			SSLConnectionSocketFactory sslFactory = new SSLConnectionSocketFactory(
+	                sslcontext,
+	                new String[] { "TLSv1.1", "TLSv1.2" },
+	                null,
+	            	SSLConnectionSocketFactory.ALLOW_ALL_HOSTNAME_VERIFIER );
+		
+			httpclient = HttpClients.custom()
+	                .setSSLSocketFactory(sslFactory)
+	                .build();
+
+
+		} catch (Exception e) {
+			throw e;
+		}
+		return httpclient;
+	}
+
+
+	
+}  
diff --git a/vid-app-common/src/main/java/org/onap/vid/aai/util/JettyObfuscationConversionCommandLineUtil.java b/vid-app-common/src/main/java/org/onap/vid/aai/util/JettyObfuscationConversionCommandLineUtil.java
new file mode 100644
index 0000000..8a3ba88
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/aai/util/JettyObfuscationConversionCommandLineUtil.java
@@ -0,0 +1,78 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * VID
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.vid.aai.util;
+
+
+import org.apache.commons.cli.BasicParser;
+import org.apache.commons.cli.CommandLine;
+import org.apache.commons.cli.CommandLineParser;
+import org.apache.commons.cli.Options;
+import org.apache.commons.cli.ParseException;
+import org.eclipse.jetty.util.security.Password;
+
+
+public class JettyObfuscationConversionCommandLineUtil {
+	/**
+	 * The main method.
+	 *
+	 * @param args the arguments
+	 */
+	public static void main(String[] args){
+		Options options = new Options();
+		options.addOption("e", true, "obfuscate the given string");
+		options.addOption("d", true, "deobfuscate the given string");
+		
+		CommandLineParser parser = new BasicParser();
+		
+		try {
+			CommandLine cmd = parser.parse(options, args);
+			String toProcess = null;
+			
+			if (cmd.hasOption("e")){
+				toProcess = cmd.getOptionValue("e");
+				String encoded = Password.obfuscate(toProcess);
+				System.out.println(encoded);
+			} else if (cmd.hasOption("d")) {
+				toProcess = cmd.getOptionValue("d");
+				String decoded_str = Password.deobfuscate(toProcess);
+				System.out.println(decoded_str);
+			} else {
+				usage();
+			}
+		} catch (ParseException e) {
+			System.out.println("failed to parse input");
+			System.out.println(e.toString());
+			usage();
+		} catch (Exception e) {
+			System.out.println("exception:" + e.toString());
+		}
+	}
+	
+	/**
+	 * Usage.
+	 */
+	private static void usage(){
+		System.out.println("usage:");;
+		System.out.println("-e [string] to obfuscate");
+		System.out.println("-d [string] to deobfuscate");
+		System.out.println("-h help");
+	}
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/asdc/AsdcCatalogException.java b/vid-app-common/src/main/java/org/onap/vid/asdc/AsdcCatalogException.java
new file mode 100644
index 0000000..01883d5
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/asdc/AsdcCatalogException.java
@@ -0,0 +1,58 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * VID
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.vid.asdc;
+
+/**
+ * The Class AsdcCatalogException.
+ */
+public class AsdcCatalogException extends Exception {
+	
+	/** The Constant serialVersionUID. */
+	private static final long serialVersionUID = 1L;
+
+	/**
+	 * Instantiates a new sdc catalog exception.
+	 *
+	 * @param msg the msg
+	 */
+	public AsdcCatalogException(String msg) {
+		super(msg);
+	}
+	
+	/**
+	 * Instantiates a new sdc catalog exception.
+	 *
+	 * @param cause the cause
+	 */
+	public AsdcCatalogException(Throwable cause) {
+		super(cause);
+	}
+	
+	/**
+	 * Instantiates a new sdc catalog exception.
+	 *
+	 * @param msg the msg
+	 * @param t the t
+	 */
+	public AsdcCatalogException(String msg, Throwable t) {
+		super(msg, t);
+	}
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/asdc/AsdcClient.java b/vid-app-common/src/main/java/org/onap/vid/asdc/AsdcClient.java
new file mode 100644
index 0000000..970ec95
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/asdc/AsdcClient.java
@@ -0,0 +1,129 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * VID
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.vid.asdc;
+
+import java.io.IOException;
+import java.nio.file.Path;
+import java.util.Collection;
+import java.util.Map;
+import java.util.UUID;
+
+import org.onap.vid.asdc.beans.Artifact;
+import org.onap.vid.asdc.beans.Resource;
+import org.onap.vid.asdc.beans.Service;
+
+/**
+ * The Interface AsdcClient.
+ */
+public interface AsdcClient {
+	
+	/**
+	 * Gets the resource.
+	 *
+	 * @param uuid the uuid
+	 * @return the resource
+	 * @throws AsdcCatalogException the sdc catalog exception
+	 */
+	public Resource getResource(UUID uuid) throws AsdcCatalogException;
+	
+	/**
+	 * Gets the resources.
+	 *
+	 * @return the resources
+	 * @throws AsdcCatalogException the sdc catalog exception
+	 */
+	public Collection<Resource> getResources() throws AsdcCatalogException;
+	
+	/**
+	 * Gets the resources.
+	 *
+	 * @param filter the filter
+	 * @return the resources
+	 * @throws AsdcCatalogException the sdc catalog exception
+	 */
+	public Collection<Resource> getResources(Map<String, String[]> filter) throws AsdcCatalogException;
+	
+	/**
+	 * Gets the resource artifact.
+	 *
+	 * @param resourceUuid the resource uuid
+	 * @param artifactUuid the artifact uuid
+	 * @return the resource artifact
+	 * @throws AsdcCatalogException the sdc catalog exception
+	 */
+	public Artifact getResourceArtifact(UUID resourceUuid, UUID artifactUuid) throws AsdcCatalogException;
+	
+	/**
+	 * Gets the resource tosca model.
+	 *
+	 * @param uuid the uuid
+	 * @return the resource tosca model
+	 * @throws AsdcCatalogException the sdc catalog exception
+	 */
+	public Path getResourceToscaModel(UUID uuid) throws AsdcCatalogException;
+	
+	/**
+	 * Gets the service.
+	 *
+	 * @param uuid the uuid
+	 * @return the service
+	 * @throws AsdcCatalogException the sdc catalog exception
+	 */
+	public Service getService(UUID uuid) throws AsdcCatalogException;
+	
+	/**
+	 * Gets the services.
+	 *
+	 * @return the services
+	 * @throws AsdcCatalogException the sdc catalog exception
+	 */
+	public Collection<Service> getServices() throws AsdcCatalogException;
+	
+	/**
+	 * Gets the services.
+	 *
+	 * @param filter the filter
+	 * @return the services
+	 * @throws AsdcCatalogException the asdc catalog exception
+	 */
+	public Collection<Service> getServices(Map<String, String[]> filter) throws AsdcCatalogException;
+	
+	/**
+	 * Gets the service artifact.
+	 *
+	 * @param serviceUuid the service uuid
+	 * @param artifactUuid the artifact uuid
+	 * @return the service artifact
+	 * @throws AsdcCatalogException the asdc catalog exception
+	 */
+	public Artifact getServiceArtifact(UUID serviceUuid, UUID artifactUuid) throws AsdcCatalogException;
+	
+	/**
+	 * Gets the service tosca model.
+	 *
+	 * @param uuid the uuid
+	 * @return the service tosca model
+	 * @throws AsdcCatalogException the asdc catalog exception
+	 */
+	public Path getServiceToscaModel(UUID uuid) throws AsdcCatalogException;
+	
+	//TODO: Collect TOSCA information from CSAR
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/asdc/beans/Artifact.java b/vid-app-common/src/main/java/org/onap/vid/asdc/beans/Artifact.java
new file mode 100644
index 0000000..c7e093f
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/asdc/beans/Artifact.java
@@ -0,0 +1,314 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * VID
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.vid.asdc.beans;
+
+import java.util.UUID;
+
+/**
+ * The Class Artifact.
+ */
+public class Artifact {
+
+/*
+ * SDC has widened this to a String type for 1610.
+	public enum Type {
+		HEAT,
+		HEAT_ENV,
+		HEAT_VOL,
+		HEAT_NET,
+		HEAT_NESTED,
+		HEAT_ARTIFACT,
+		YANG_XML,
+		VNF_CATALOG,
+		VF_LICENSE,
+		VENDOR_LICENSE,
+		ASSET_INVENTORY_PROFILE,
+		ASSET_QUERY_SPEC,
+		APPC_CONFIG,
+		VF_MODULES_METADATA,
+		DCAE_TOSCA,
+		DCAE_JSON,
+		DCAE_EMF,
+		DCAE_DOC,
+		DCAE_BLUEPRINT,
+		DCAE_EVENT,
+		DCAE_INVENTORY_TOSCA,
+		DCAE_INVENTORY_JSON,
+		DCAE_INVENTORY_EMF,
+		DCAE_INVENTORY_DOC,
+		DCAE_INVENTORY_BLUEPRINT,
+		DCAE_INVENTORY_EVENT,
+		OTHER,
+		AAI_SERVICE_MODEL //HEY! READ ME! YES, YOU!  I AM A TEMPORARY FIX, PLEASE REMOVE ME BECAUSE I AM A FRAUD.  I DON'T BELONG HERE.
+						  //Warm Regards,
+						  //	*The* Artifact.Type.AAI_SERVICE_MODEL Constant
+	}
+	*/
+	
+	/** The artifact name. */
+	private String artifactName;
+	
+	/** The artifact label. */
+	private String artifactLabel;
+	
+	/** The artifact group type. */
+	private String artifactGroupType;
+	
+	/** The artifact type. */
+	private String artifactType;
+	
+	/** The artifact URL. */
+	private String artifactURL;
+	
+	/** The artifact description. */
+	private String artifactDescription;
+	
+	/** The artifact timeout. */
+	private int artifactTimeout;
+	
+	/** The artifact checksum. */
+	private String artifactChecksum;
+	
+	/** The artifact UUID. */
+	private String artifactUUID;
+	
+	/** The artifact version. */
+	private String artifactVersion;
+	
+	/** The generated from UUID. */
+	private String generatedFromUUID;
+	
+	/**
+	 * Gets the artifact name.
+	 *
+	 * @return the artifact name
+	 */
+	public String getArtifactName() {
+		return artifactName;
+	}
+	
+	/**
+	 * Gets the artifact type.
+	 *
+	 * @return the artifact type
+	 */
+	public String getArtifactType() {
+		return artifactType;
+	}
+	/**
+	 * Gets the artifact group type.
+	 *
+	 * @return the artifact group type
+	 */
+	public String getArtifactGroupType() {
+		return artifactGroupType;
+	}
+	
+	/**
+	 * Gets the artifact label.
+	 *
+	 * @return the artifact label
+	 */
+	public String getArtifactLabel() {
+		return artifactLabel;
+	}
+	/**
+	 * Gets the artifact URL.
+	 *
+	 * @return the artifact URL
+	 */
+	public String getArtifactURL() {
+		return artifactURL;
+	}
+	
+	/**
+	 * Gets the artifact description.
+	 *
+	 * @return the artifact description
+	 */
+	public String getArtifactDescription() {
+		return artifactDescription;
+	}
+	
+	/**
+	 * Gets the artifact timeout.
+	 *
+	 * @return the artifact timeout
+	 */
+	public int getArtifactTimeout() {
+		return artifactTimeout;
+	}
+	
+	/**
+	 * Gets the artifact checksum.
+	 *
+	 * @return the artifact checksum
+	 */
+	public String getArtifactChecksum() {
+		return artifactChecksum;
+	}
+	
+	/**
+	 * Gets the artifact UUID.
+	 *
+	 * @return the artifact UUID
+	 */
+	public String getArtifactUUID() {
+		return artifactUUID;
+	}
+	
+	/**
+	 * Gets the artifact version.
+	 *
+	 * @return the artifact version
+	 */
+	public String getArtifactVersion() {
+		return artifactVersion;
+	}
+	
+	/**
+	 * Gets the generated from UUID.
+	 *
+	 * @return the generated from UUID
+	 */
+	public String getGeneratedFromUUID() {
+		return generatedFromUUID;
+	}
+	
+	/**
+	 * Sets the artifact name.
+	 *
+	 * @param artifactName the new artifact name
+	 */
+	public void setArtifactName(String artifactName) {
+		this.artifactName = artifactName;
+	}
+	
+	/**
+	 * Sets the artifact type.
+	 *
+	 * @param artifactType the new artifact type
+	 */
+	public void setArtifactType(String artifactType) {
+		this.artifactType = artifactType;
+	}
+	/**
+	 * Sets the artifact group type.
+	 *
+	 * @param artifactGroupType the new artifact group type
+	 */
+	public void setArtifactGroupType(String artifactGroupType) {
+		this.artifactGroupType = artifactGroupType;
+	}
+	/**
+	 * Sets the artifact label.
+	 *
+	 * @param artifactGroupType the new artifact label
+	 */
+	public void setArtifactLabel(String artifactLabel) {
+		this.artifactLabel = artifactLabel;
+	}
+	/**
+	 * Sets the artifact URL.
+	 *
+	 * @param artifactURL the new artifact URL
+	 */
+	public void setArtifactURL(String artifactURL) {
+		this.artifactURL = artifactURL;
+	}
+	
+	/**
+	 * Sets the artifact description.
+	 *
+	 * @param artifactDescription the new artifact description
+	 */
+	public void setArtifactDescription(String artifactDescription) {
+		this.artifactDescription = artifactDescription;
+	}
+	
+	/**
+	 * Sets the artifact timeout.
+	 *
+	 * @param artifactTimeout the new artifact timeout
+	 */
+	public void setArtifactTimeout(int artifactTimeout) {
+		this.artifactTimeout = artifactTimeout;
+	}
+	
+	/**
+	 * Sets the artifact checksum.
+	 *
+	 * @param artifactChecksum the new artifact checksum
+	 */
+	public void setArtifactChecksum(String artifactChecksum) {
+		this.artifactChecksum = artifactChecksum;
+	}
+	
+	/**
+	 * Sets the artifact UUID.
+	 *
+	 * @param artifactUUID the new artifact UUID
+	 */
+	public void setArtifactUUID(String artifactUUID) {
+		this.artifactUUID = artifactUUID;
+	}
+	
+	/**
+	 * Sets the artifact version.
+	 *
+	 * @param artifactVersion the new artifact version
+	 */
+	public void setArtifactVersion(String artifactVersion) {
+		this.artifactVersion = artifactVersion;
+	}
+	
+	/**
+	 * Sets the generated from UUID.
+	 *
+	 * @param generatedFromUUID the new generated from UUID
+	 */
+	public void setGeneratedFromUUID(String generatedFromUUID) {
+		this.generatedFromUUID = generatedFromUUID;
+	}
+	
+	/* (non-Javadoc)
+	 * @see java.lang.Object#hashCode()
+	 */
+	@Override
+	public int hashCode() {
+		final UUID uuid = UUID.fromString(getArtifactUUID());
+		
+		return uuid.hashCode();
+	}
+	
+	/* (non-Javadoc)
+	 * @see java.lang.Object#equals(java.lang.Object)
+	 */
+	@Override
+	public boolean equals(Object o) {
+		if (o == this) return true;
+		if (!(o instanceof Artifact)) return false;
+		
+		final Artifact artifact = (Artifact) o;
+		
+		return (artifact.getArtifactUUID().equals(getArtifactUUID()));
+	}
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/asdc/beans/Resource.java b/vid-app-common/src/main/java/org/onap/vid/asdc/beans/Resource.java
new file mode 100644
index 0000000..6b5aa53
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/asdc/beans/Resource.java
@@ -0,0 +1,429 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * VID
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.vid.asdc.beans;
+
+import java.util.Collection;
+import java.util.UUID;
+
+/**
+ * The Class Resource.
+ */
+public class Resource {
+
+	/**
+	 * The Enum Type.
+	 */
+	public enum Type { 
+		
+		/** The vf. */
+		VF, 
+		
+		/** The vfc. */
+		VFC, 
+		
+		/** The cp. */
+		CP, 
+		
+		/** The vl. */
+		VL,
+		
+		/** The vfcmt. */
+		VFCMT
+	}
+	
+	/**
+	 * The Enum LifecycleState.
+	 */
+	public enum LifecycleState {
+		
+		/** The not certified checkout. */
+		NOT_CERTIFIED_CHECKOUT,
+		
+		/** The not certified checkin. */
+		NOT_CERTIFIED_CHECKIN,
+		
+		/** The ready for certification. */
+		READY_FOR_CERTIFICATION,
+		
+		/** The certification in progress. */
+		CERTIFICATION_IN_PROGRESS,
+		
+		/** The certified. */
+		CERTIFIED
+	}
+	
+	/** The uuid. */
+	private String uuid;
+	
+	/** The invariant UUID. */
+	private String invariantUUID;
+	
+	/** The name. */
+	private String name;
+	
+	/** The description. */
+	private String description;
+	
+	/** The version. */
+	private String version;
+	
+	/** The tosca model URL. */
+	private String toscaModelURL;
+	
+	/** The category. */
+	private String category;
+	
+	/** The sub category. */
+	private String subCategory;
+	
+	/** The resource type. */
+	private Resource.Type resourceType;
+	
+	/** The lifecycle state. */
+	private Resource.LifecycleState lifecycleState;
+	
+	/** The last updater user ID. */
+	private String lastUpdaterUserId;
+	
+	/** The last updater full name. */
+	private String lastUpdaterFullName;
+	
+	/** The tosca model. */
+	private String toscaModel;
+	
+	/** The tosca resource name. */
+	private String toscaResourceName;
+	
+	/** The artifacts. */
+	private Collection<Artifact> artifacts;
+	
+	/** The resources. */
+	private Collection<SubResource> resources;
+	
+	/**
+	 * Gets the uuid.
+	 *
+	 * @return the uuid
+	 */
+	public String getUuid() {
+		return uuid;
+	}
+	
+	/**
+	 * Gets the invariant UUID.
+	 *
+	 * @return the invariant UUID
+	 */
+	public String getInvariantUUID() {
+		return invariantUUID;
+	}
+	
+	/**
+	 * Gets the name.
+	 *
+	 * @return the name
+	 */
+	public String getName() {
+		return name;
+	}
+	
+	/**
+	 * Gets the description.
+	 *
+	 * @return the description
+	 */
+	public String getDescription() {
+		return description;
+	}
+	
+	/**
+	 * Gets the version.
+	 *
+	 * @return the version
+	 */
+	public String getVersion() {
+		return version;
+	}
+	
+	/**
+	 * Gets the tosca model URL.
+	 *
+	 * @return the tosca model URL
+	 */
+	public String getToscaModelURL() {
+		return toscaModelURL;
+	}
+	
+	/**
+	 * Gets the category.
+	 *
+	 * @return the category
+	 */
+	public String getCategory() {
+		return category;
+	}
+	
+	/**
+	 * Gets the sub category.
+	 *
+	 * @return the sub category
+	 */
+	public String getSubCategory() {
+		return subCategory;
+	}
+	
+	/**
+	 * Gets the resource type.
+	 *
+	 * @return the resource type
+	 */
+	public Resource.Type getResourceType() {
+		return resourceType;
+	}
+	
+	/**
+	 * Gets the lifecycle state.
+	 *
+	 * @return the lifecycle state
+	 */
+	public Resource.LifecycleState getLifecycleState() {
+		return lifecycleState;
+	}
+	
+	/**
+	 * Gets the last updater user ID.
+	 *
+	 * @return the last updater user ID
+	 */
+	public String getLastUpdaterUserId() {
+		return lastUpdaterUserId;
+	}
+	
+	/**
+	 * Gets the last updater full name.
+	 *
+	 * @return the last updater full name
+	 */
+	public String getLastUpdaterFullName() {
+		return lastUpdaterFullName;
+	}
+	
+	/**
+	 * Gets the tosca model.
+	 *
+	 * @return the tosca model
+	 */
+	public String getToscaModel() {
+		return toscaModel;
+	}
+	
+	/**
+	 * Gets the tosca resource name.
+	 *
+	 * @return the tosca resource name
+	 */
+	public String getToscaResourceName() {
+		return toscaResourceName;
+	}
+	
+	/**
+	 * Gets the artifacts.
+	 *
+	 * @return the artifacts
+	 */
+	public Collection<Artifact> getArtifacts() {
+		return artifacts;
+	}
+	
+	/**
+	 * Gets the resources.
+	 *
+	 * @return the resources
+	 */
+	public Collection<SubResource> getResources() {
+		return resources;
+	}
+	
+	/**
+	 * Sets the uuid.
+	 *
+	 * @param uuid the new uuid
+	 */
+	public void setUuid(String uuid) {
+		this.uuid = uuid;
+	}
+	
+	/**
+	 * Sets the invariant UUID.
+	 *
+	 * @param invariantUUID the new invariant UUID
+	 */
+	public void setInvariantUUID(String invariantUUID) {
+		this.invariantUUID = invariantUUID;
+	}
+	
+	/**
+	 * Sets the name.
+	 *
+	 * @param name the new name
+	 */
+	public void setName(String name) {
+		this.name = name;
+	}
+	/**
+	 * Sets the description.
+	 *
+	 * @param name the new description
+	 */
+	public void setDescription(String description) {
+		this.description = description;
+	}
+	/**
+	 * Sets the version.
+	 *
+	 * @param version the new version
+	 */
+	public void setVersion(String version) {
+		this.version = version;
+	}
+	
+	/**
+	 * Sets the tosca model URL.
+	 *
+	 * @param toscaModelURL the new tosca model URL
+	 */
+	public void setToscaModelURL(String toscaModelURL) {
+		this.toscaModelURL = toscaModelURL;
+	}
+	
+	/**
+	 * Sets the category.
+	 *
+	 * @param category the new category
+	 */
+	public void setCategory(String category) {
+		this.category = category;
+	}
+	
+	/**
+	 * Sets the sub category.
+	 *
+	 * @param subCategory the new sub category
+	 */
+	public void setSubCategory(String subCategory) {
+		this.subCategory = subCategory;
+	}
+	
+	/**
+	 * Sets the resource type.
+	 *
+	 * @param resourceType the new resource type
+	 */
+	public void setResourceType(Resource.Type resourceType) {
+		this.resourceType = resourceType;
+	}
+	
+	/**
+	 * Sets the lifecycle state.
+	 *
+	 * @param lifecycleState the new lifecycle state
+	 */
+	public void setLifecycleState(Resource.LifecycleState lifecycleState) {
+		this.lifecycleState = lifecycleState;
+	}
+	
+	/**
+	 * Sets the last updater user ID.
+	 *
+	 * @param lastUpdaterUserId the new last updater user ID
+	 */
+	public void setLastUpdaterUserId(String lastUpdaterUserId) {
+		this.lastUpdaterUserId = lastUpdaterUserId;
+	}
+	
+	/**
+	 * Sets the last updater full name.
+	 *
+	 * @param lastUpdaterFullName the new last updater full name
+	 */
+	public void setLastUpdaterFullName(String lastUpdaterFullName) {
+		this.lastUpdaterFullName = lastUpdaterFullName;
+	}
+	
+	/**
+	 * Sets the tosca model.
+	 *
+	 * @param toscaModel the new tosca model
+	 */
+	public void setToscaModel(String toscaModel) {
+		this.toscaModel = toscaModel;
+	}
+	
+	/**
+	 * Sets the tosca resource name.
+	 *
+	 * @param toscaResourceName the new tosca resource name
+	 */
+	public void setToscaResourceName(String toscaResourceName) {
+		this.toscaResourceName = toscaResourceName;
+	}
+	
+	/**
+	 * Sets the artifacts.
+	 *
+	 * @param artifacts the new artifacts
+	 */
+	public void setArtifacts(Collection<Artifact> artifacts) {
+		this.artifacts = artifacts;
+	}
+	
+	/**
+	 * Sets the resources.
+	 *
+	 * @param resources the new resources
+	 */
+	public void setResources(Collection<SubResource> resources) {
+		this.resources = resources;
+	}
+
+	/* (non-Javadoc)
+	 * @see java.lang.Object#hashCode()
+	 */
+	@Override
+	public int hashCode() {
+		final UUID uuid = UUID.fromString(getUuid());
+		
+		return uuid.hashCode();
+	}
+	
+	/* (non-Javadoc)
+	 * @see java.lang.Object#equals(java.lang.Object)
+	 */
+	@Override
+	public boolean equals(Object o) {
+		if (o == this) return true;
+		if (!(o instanceof Resource)) return false;
+		
+		final Resource resource = (Resource) o;
+		
+		return (resource.getUuid().equals(getUuid()));
+	}
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/asdc/beans/SecureService.java b/vid-app-common/src/main/java/org/onap/vid/asdc/beans/SecureService.java
new file mode 100644
index 0000000..b81a438
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/asdc/beans/SecureService.java
@@ -0,0 +1,9 @@
+package org.onap.vid.asdc.beans;
+
+/**
+ * Created by Oren on 6/27/17.
+ */
+public class SecureService extends  Service{
+
+    public boolean isPermmited = true;
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/asdc/beans/SecureServices.java b/vid-app-common/src/main/java/org/onap/vid/asdc/beans/SecureServices.java
new file mode 100644
index 0000000..a6aa3de
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/asdc/beans/SecureServices.java
@@ -0,0 +1,30 @@
+package org.onap.vid.asdc.beans;
+
+import java.util.Collection;
+import java.util.List;
+
+/**
+ * Created by Oren on 6/27/17.
+ */
+public class SecureServices {
+
+    private Collection<Service> services;
+    private boolean isReadOnly = true;
+
+    public void setServices(Collection<Service> services) {
+        this.services = services;
+    }
+
+    public Collection<Service> getServices() {
+
+        return services;
+    }
+    public boolean isReadOnly() {
+        return isReadOnly;
+    }
+
+    public void setReadOnly(boolean readOnly) {
+        isReadOnly = readOnly;
+    }
+
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/asdc/beans/Service.java b/vid-app-common/src/main/java/org/onap/vid/asdc/beans/Service.java
new file mode 100644
index 0000000..5f59b89
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/asdc/beans/Service.java
@@ -0,0 +1,354 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * VID
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.vid.asdc.beans;
+
+import java.util.Collection;
+import java.util.UUID;
+/**
+ * The Class Service.
+ */
+public class Service {
+
+	/**
+	 * The Enum DistributionStatus.
+	 */
+	public enum DistributionStatus {
+
+		/** The distribution not approved. */
+		DISTRIBUTION_NOT_APPROVED,
+
+		/** The distribution approved. */
+		DISTRIBUTION_APPROVED,
+
+		/** The distributed. */
+		DISTRIBUTED,
+
+		/** The distribution rejected. */
+		DISTRIBUTION_REJECTED,
+
+		/** The destributed for tenant isolation. */
+		DISTRIBUTION_COMPLETE_OK
+	}
+
+	/**
+	 * The Enum LifecycleState.
+	 */
+	public enum LifecycleState {
+
+		/** The not certified checkout. */
+		NOT_CERTIFIED_CHECKOUT,
+
+		/** The not certified checkin. */
+		NOT_CERTIFIED_CHECKIN,
+
+		/** The ready for certification. */
+		READY_FOR_CERTIFICATION,
+
+		/** The certification in progress. */
+		CERTIFICATION_IN_PROGRESS,
+
+		/** The certified. */
+		CERTIFIED
+	}
+
+	/** The uuid. */
+	private String uuid;
+
+	/** The invariant UUID. */
+	private String invariantUUID;
+
+	/** The name. */
+	private String name;
+
+	/** The version. */
+	private String version;
+
+	/** The tosca model URL. */
+	private String toscaModelURL;
+
+	/** The category. */
+	private String category;
+
+	/** The lifecycle state. */
+	private Service.LifecycleState lifecycleState;
+
+	/** The last updater user uid. */
+	private String lastUpdaterUserId;
+
+	/** The last updater full name. */
+	private String lastUpdaterFullName;
+
+	/** The distribution status. */
+	private Service.DistributionStatus distributionStatus;
+
+	/** The artifacts. */
+	private Collection<Artifact> artifacts;
+
+	/** The resources. */
+	private Collection<SubResource> resources;
+
+	/**
+	 * Gets the uuid.
+	 *
+	 * @return the uuid
+	 */
+	public String getUuid() {
+		return uuid;
+	}
+
+	/**
+	 * Gets the invariant UUID.
+	 *
+	 * @return the invariant UUID
+	 */
+	public String getInvariantUUID() {
+		return invariantUUID;
+	}
+
+	/**
+	 * Gets the name.
+	 *
+	 * @return the name
+	 */
+	public String getName() {
+		return name;
+	}
+
+	/**
+	 * Gets the version.
+	 *
+	 * @return the version
+	 */
+	public String getVersion() {
+		return version;
+	}
+
+	/**
+	 * Gets the tosca model URL.
+	 *
+	 * @return the tosca model URL
+	 */
+	public String getToscaModelURL() {
+		return toscaModelURL;
+	}
+
+	/**
+	 * Gets the category.
+	 *
+	 * @return the category
+	 */
+	public String getCategory() {
+		return category;
+	}
+
+	/**
+	 * Gets the lifecycle state.
+	 *
+	 * @return the lifecycle state
+	 */
+	public Service.LifecycleState getLifecycleState() {
+		return lifecycleState;
+	}
+
+	/**
+	 * Gets the last updater user uid.
+	 *
+	 * @return the last updater user uid
+	 */
+	public String getLastUpdaterUserId() {
+		return lastUpdaterUserId;
+	}
+
+	/**
+	 * Gets the last updater full name.
+	 *
+	 * @return the last updater full name
+	 */
+	public String getLastUpdaterFullName() {
+		return lastUpdaterFullName;
+	}
+
+	/**
+	 * Gets the distribution status.
+	 *
+	 * @return the distribution status
+	 */
+	public Service.DistributionStatus getDistributionStatus() {
+		return distributionStatus;
+	}
+
+	/**
+	 * Gets the artifacts.
+	 *
+	 * @return the artifacts
+	 */
+	public Collection<Artifact> getArtifacts() {
+		return artifacts;
+	}
+
+	/**
+	 * Gets the resources.
+	 *
+	 * @return the resources
+	 */
+	public Collection<SubResource> getResources() {
+		return resources;
+	}
+
+	/**
+	 * Sets the uuid.
+	 *
+	 * @param uuid the new uuid
+	 */
+	public void setUuid(String uuid) {
+		this.uuid = uuid;
+	}
+
+	/**
+	 * Sets the invariant UUID.
+	 *
+	 * @param invariantUUID the new invariant UUID
+	 */
+	public void setInvariantUUID(String invariantUUID) {
+		this.invariantUUID = invariantUUID;
+	}
+
+	/**
+	 * Sets the name.
+	 *
+	 * @param name the new name
+	 */
+	public void setName(String name) {
+		this.name = name;
+	}
+
+	/**
+	 * Sets the version.
+	 *
+	 * @param version the new version
+	 */
+	public void setVersion(String version) {
+		this.version = version;
+	}
+
+	/**
+	 * Sets the tosca model URL.
+	 *
+	 * @param toscaModelURL the new tosca model URL
+	 */
+	public void setToscaModelURL(String toscaModelURL) {
+		this.toscaModelURL = toscaModelURL;
+	}
+
+	/**
+	 * Sets the category.
+	 *
+	 * @param category the new category
+	 */
+	public void setCategory(String category) {
+		this.category = category;
+	}
+
+	/**
+	 * Sets the lifecycle state.
+	 *
+	 * @param lifecycleState the new lifecycle state
+	 */
+	public void setLifecycleState(Service.LifecycleState lifecycleState) {
+		this.lifecycleState = lifecycleState;
+	}
+
+	/**
+	 * Sets the last updater user uid.
+	 *
+	 * @param lastUpdaterUserId the new last updater user uid
+	 */
+	public void set(String lastUpdaterUserId) {
+		this.lastUpdaterUserId = lastUpdaterUserId;
+	}
+
+	/**
+	 * Sets the last updater full name.
+	 *
+	 * @param lastUpdaterFullName the new last updater full name
+	 */
+	public void setLastUpdaterFullName(String lastUpdaterFullName) {
+		this.lastUpdaterFullName = lastUpdaterFullName;
+	}
+
+	/**
+	 * Sets the distribution status.
+	 *
+	 * @param distributionStatus the new distribution status
+	 */
+	public void setDistributionStatus(Service.DistributionStatus distributionStatus) {
+		this.distributionStatus = distributionStatus;
+	}
+
+	/**
+	 * Sets the artifacts.
+	 *
+	 * @param artifacts the new artifacts
+	 */
+	public void setArtifacts(Collection<Artifact> artifacts) {
+		this.artifacts = artifacts;
+	}
+
+	/**
+	 * Sets the resources.
+	 *
+	 * @param resources the new resources
+	 */
+	public void setResources(Collection<SubResource> resources) {
+		this.resources = resources;
+	}
+
+	/* (non-Javadoc)
+	 * @see java.lang.Object#toString()
+	 */
+	@Override
+	public String toString() {
+		return uuid;
+	}
+
+	/* (non-Javadoc)
+	 * @see java.lang.Object#hashCode()
+	 */
+	@Override
+	public int hashCode() {
+		final UUID uuid = UUID.fromString(getUuid());
+
+		return uuid.hashCode();
+	}
+
+	/* (non-Javadoc)
+	 * @see java.lang.Object#equals(java.lang.Object)
+	 */
+	@Override
+	public boolean equals(Object o) {
+		if (o == this) return true;
+		if (!(o instanceof Service)) return false;
+
+		final Service service = (Service) o;
+
+		return (service.getUuid().equals(getUuid()));
+	}
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/asdc/beans/SubResource.java b/vid-app-common/src/main/java/org/onap/vid/asdc/beans/SubResource.java
new file mode 100644
index 0000000..5f7811d
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/asdc/beans/SubResource.java
@@ -0,0 +1,175 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * VID
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.vid.asdc.beans;
+
+import java.util.Collection;
+/**
+ * The Class SubResource.
+ */
+public class SubResource {
+
+	/** The resource instance name. */
+	private String resourceInstanceName;
+	
+	/** The resource name. */
+	private String resourceName;
+	
+	/** The resource invariant UUID. */
+	private String resourceInvariantUUID;
+	
+	/** The resource version. */
+	private String resourceVersion;
+	
+	/** The resource type. */
+	private String resourceType;
+	
+	/** The resource UUID. */
+	private String resourceUUID;
+	
+	/** The artifacts. */
+	private Collection<Artifact> artifacts;
+	
+	/**
+	 * Gets the resource instance name.
+	 *
+	 * @return the resource instance name
+	 */
+	public String getResourceInstanceName() {
+		return resourceInstanceName;
+	}
+	
+	/**
+	 * Gets the resource name.
+	 *
+	 * @return the resource name
+	 */
+	public String getResourceName() {
+		return resourceName;
+	}
+	
+	/**
+	 * Gets the resource invariant UUID.
+	 *
+	 * @return the resource invariant UUID
+	 */
+	public String getResourceInvariantUUID() {
+		return resourceInvariantUUID;
+	}
+	
+	/**
+	 * Gets the resource version.
+	 *
+	 * @return the resource version
+	 */
+	public String getResourceVersion() {
+		return resourceVersion;
+	}
+	
+	/**
+	 * Gets the resoucre type.
+	 *
+	 * @return the resoucre type
+	 */
+	public String getResoucreType() {
+		return resourceType;
+	}
+	
+	/**
+	 * Gets the resource UUID.
+	 *
+	 * @return the resource UUID
+	 */
+	public String getResourceUUID() {
+		return resourceUUID;
+	}
+	
+	/**
+	 * Gets the artifacts.
+	 *
+	 * @return the artifacts
+	 */
+	public Collection<Artifact> getArtifacts() {
+		return artifacts;
+	}
+	
+	/**
+	 * Sets the resource instance name.
+	 *
+	 * @param resourceInstanceName the new resource instance name
+	 */
+	public void setResourceInstanceName(String resourceInstanceName) {
+		this.resourceInstanceName = resourceInstanceName;
+	}
+	
+	/**
+	 * Sets the resource name.
+	 *
+	 * @param resourceName the new resource name
+	 */
+	public void setResourceName(String resourceName) {
+		this.resourceName = resourceName;
+	}
+	
+	/**
+	 * Sets the resource invariant UUID.
+	 *
+	 * @param resourceInvariantUUID the new resource invariant UUID
+	 */
+	public void setResourceInvariantUUID(String resourceInvariantUUID) {
+		this.resourceInvariantUUID = resourceInvariantUUID;
+	}
+	
+	/**
+	 * Sets the resource version.
+	 *
+	 * @param resourceVersion the new resource version
+	 */
+	public void setResourceVersion(String resourceVersion) {
+		this.resourceVersion = resourceVersion;
+	}
+	
+	/**
+	 * Sets the resoucre type.
+	 *
+	 * @param resourceType the new resoucre type
+	 */
+	public void setResoucreType(String resourceType) {
+		this.resourceType = resourceType;
+	}
+	
+	/**
+	 * Sets the resource UUID.
+	 *
+	 * @param resourceUUID the new resource UUID
+	 */
+	public void setResourceUUID(String resourceUUID) {
+		this.resourceUUID = resourceUUID;
+	}
+	
+	/**
+	 * Sets the artifacts.
+	 *
+	 * @param artifacts the new artifacts
+	 */
+	public void setArtifacts(Collection<Artifact> artifacts) {
+		this.artifacts = artifacts;
+	}
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/asdc/beans/tosca/Capability.java b/vid-app-common/src/main/java/org/onap/vid/asdc/beans/tosca/Capability.java
new file mode 100644
index 0000000..7aa1343
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/asdc/beans/tosca/Capability.java
@@ -0,0 +1,140 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * VID
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.vid.asdc.beans.tosca;
+
+import java.util.Collection;
+import java.util.Map;
+
+/**
+ * The Class Capability.
+ */
+public class Capability {
+
+	/** The type. */
+	private String type; //FIXME: Make an enumeration?
+	
+	/** The description. */
+	private String description;
+	
+	/** The occurrences. */
+	private Collection<String> occurrences; //FIXME: Make an enumeration?
+	
+	/** The properties. */
+	private Map<String, Property> properties;
+	
+	/** The valid source types. */
+	private Collection<String> valid_source_types; //FIXME: Make an enumeration?
+	
+	/**
+	 * Instantiates a new capability.
+	 */
+	public Capability() {}
+	
+	/**
+	 * Gets the type.
+	 *
+	 * @return the type
+	 */
+	public String getType() {
+		return type;
+	}
+	
+	/**
+	 * Gets the description.
+	 *
+	 * @return the description
+	 */
+	public String getDescription() {
+		return description;
+	}
+	
+	/**
+	 * Gets the occurrences.
+	 *
+	 * @return the occurrences
+	 */
+	public Collection<String> getOccurrences() {
+		return occurrences;
+	}
+	
+	/**
+	 * Gets the properties.
+	 *
+	 * @return the properties
+	 */
+	public Map<String, Property> getProperties() {
+		return properties;
+	}
+	
+	/**
+	 * Gets the valid source types.
+	 *
+	 * @return the valid source types
+	 */
+	public Collection<String> getValid_source_types() {
+		return valid_source_types;
+	}
+	
+	/**
+	 * Sets the type.
+	 *
+	 * @param type the new type
+	 */
+	public void setType(String type) {
+		this.type = type;
+	}
+	
+	/**
+	 * Sets the description.
+	 *
+	 * @param description the new description
+	 */
+	public void setDescription(String description) {
+		this.description = description;
+	}
+	
+	/**
+	 * Sets the occurrences.
+	 *
+	 * @param occurrences the new occurrences
+	 */
+	public void setOccurrences(Collection<String> occurrences) {
+		this.occurrences = occurrences;
+	}
+	
+	/**
+	 * Sets the properties.
+	 *
+	 * @param properties the properties
+	 */
+	public void setProperties(Map<String, Property> properties) {
+		this.properties = properties;
+	}
+	
+	/**
+	 * Sets the valid source types.
+	 *
+	 * @param valid_source_types the new valid source types
+	 */
+	public void setValid_source_types(Collection<String> valid_source_types) {
+		this.valid_source_types = valid_source_types;
+	}
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/asdc/beans/tosca/Constraint.java b/vid-app-common/src/main/java/org/onap/vid/asdc/beans/tosca/Constraint.java
new file mode 100644
index 0000000..118776c
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/asdc/beans/tosca/Constraint.java
@@ -0,0 +1,199 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * VID
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+package org.onap.vid.asdc.beans.tosca;
+import java.util.List;
+import java.util.ArrayList;
+
+/**
+ * The Class Constraint.
+ */
+
+public class Constraint {
+	private  List<Object> valid_values;  
+	private Object equal;
+	private Object greater_than;
+	private Object greater_or_equal;
+	private Object less_than;
+	private Object less_or_equal;
+	private List<Object> in_range;
+	private Object length;
+	private Object min_length;
+	private Object max_length;
+	
+	/**
+	 * Instantiates a new Constraint.
+	 */
+	public Constraint() {
+		valid_values = new ArrayList<Object>();
+		in_range = new ArrayList<Object>();
+	}
+	
+	/**
+	 * Gets the valid_values.
+	 *
+	 * @return the valid_values
+	 */
+	public List<Object> getvalid_values() {
+		return valid_values;
+	}
+	/**
+	 * Gets equal.
+	 *
+	 * @return equal
+	 */
+	public Object getEqual() {
+		return equal;
+	}
+	/**
+	 * Gets greater_than.
+	 *
+	 * @return greater_than
+	 */
+	public Object getGreater_than() {
+		return greater_than;
+	}
+	/**
+	 * Gets greater_or_equal.
+	 *
+	 * @return greater_or_equal
+	 */
+	public Object getGreater_or_equal() {
+		return greater_or_equal;
+	}
+	/**
+	 * Gets less_than.
+	 *
+	 * @return less_than
+	 */
+	public Object getLess_than() {
+		return less_than;
+	}
+	/**
+	 * Gets less_or_equal.
+	 *
+	 * @return less_or_equal
+	 */
+	public Object getLess_or_equal() {
+		return less_or_equal;
+	}
+	/**
+	 * Gets in_range.
+	 *
+	 * @return in_range
+	 */
+	public List<Object> getIn_range() {
+		return in_range;
+	}
+	/**
+	 * Gets length.
+	 *
+	 * @return length
+	 */
+	public Object getLength() {
+		return length;
+	}
+	/**
+	 * Gets min_length.
+	 *
+	 * @return min_length
+	 */
+	public Object getMin_length() {
+		return min_length;
+	}
+	/**
+	 * Gets max_length.
+	 *
+	 * @return max_length
+	 */
+	public Object getMax_length() {
+		return max_length;
+	}
+	/**
+	 * Sets the valid_values.
+	 *
+	 * @param op the new valid_values
+	 */
+	public void setvalid_values(List<Object> vlist) {
+		this.valid_values = vlist;
+	}
+	/**
+	 * Sets equal.
+	 *
+	 * @param e the new equal
+	 */
+	public void setEqual(Object e) {
+		this.equal = e;
+	}
+	/**
+	 * Sets greater_than.
+	 *
+	 * @param e the new greater_than
+	 */
+	public void setGreater_than(Object e) {
+		this.greater_than = e;
+	}
+	/**
+	 * Sets less_than.
+	 *
+	 * @param e the new less_than
+	 */
+	public void setLess_than(Object e) {
+		this.less_than = e;
+	}
+	/**
+	 * Sets in_range.
+	 *
+	 * @param e the new in_range
+	 */
+	public void setIn_range(List<Object> e) {
+		this.in_range = e;
+	}
+	/**
+	 * Sets length.
+	 *
+	 * @param e the length
+	 */
+	public void setLength(Object e) {
+		this.length = e;
+	}
+	/**
+	 * Sets min_length.
+	 *
+	 * @param e the min_length
+	 */
+	public void setMin_length(Object e) {
+		this.min_length = e;
+	}
+	/**
+	 * Sets max_length.
+	 *
+	 * @param e the max_length
+	 */
+	public void setMax_length(Object e) {
+		this.max_length = e;
+	}
+	/* (non-Javadoc)
+	 * @see java.lang.Object#toString()
+	 */
+	@Override
+	public String toString() {
+		return "valid_values=" + valid_values;
+	}
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/asdc/beans/tosca/Group.java b/vid-app-common/src/main/java/org/onap/vid/asdc/beans/tosca/Group.java
new file mode 100644
index 0000000..2685b22
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/asdc/beans/tosca/Group.java
@@ -0,0 +1,135 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * VID
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.vid.asdc.beans.tosca;
+
+import java.util.Collection;
+import java.util.Map;
+
+/**
+ * The Class Group.
+ */
+public class Group {
+
+	/** The type. */
+	private String type;
+	
+	/** The members. */
+	private Collection<String> members;
+	
+	/** The metadata. */
+	private ToscaMetadata metadata;
+	
+	/** The vf module type. */
+	private String vf_module_type;
+	
+	/** The properties. */
+	private Map<String, Object> properties;
+	
+	/**
+	 * Gets the metadata.
+	 *
+	 * @return the metadata
+	 */
+	public ToscaMetadata getMetadata() {
+		return metadata;
+	}
+	
+	/**
+	 * Sets the metadata.
+	 *
+	 * @param metadata the new metadata
+	 */
+	public void setMetadata(ToscaMetadata metadata) {
+		this.metadata = metadata;
+	}
+	
+	/**
+	 * Gets the members.
+	 *
+	 * @return the members
+	 */
+	public Collection<String> getMembers() {
+		return members;
+	}
+	
+	/**
+	 * Sets the members.
+	 *
+	 * @param members the new members
+	 */
+	public void setMembers(Collection<String> members) {
+		this.members = members;
+	}
+	
+	/**
+	 * Gets the type.
+	 *
+	 * @return the type
+	 */
+	public String getType() {
+		return type;
+	}
+	
+	/**
+	 * Sets the type.
+	 *
+	 * @param type the new type
+	 */
+	public void setType(String type) {
+		this.type = type;
+	}
+	
+	/**
+	 * Gets the vf module type.
+	 *
+	 * @return the vf module type
+	 */
+	public String getvf_module_type() {
+		return vf_module_type;
+	}
+	
+	/**
+	 * Sets the vf module type.
+	 *
+	 * @param vf_module_type the new vf module type
+	 */
+	public void setvf_module_type(String vf_module_type) {
+		this.vf_module_type = vf_module_type;
+	}
+	
+	/**
+	 * Gets the properties.
+	 *
+	 * @return the properties
+	 */
+	public Map<String, Object> getProperties() {
+		return properties;
+	}
+	
+	/**
+	 * Sets the properties.
+	 *
+	 * @param properties the properties
+	 */
+	public void setProperties(Map<String, Object> properties) {
+		this.properties = properties;
+	}
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/asdc/beans/tosca/Import.java b/vid-app-common/src/main/java/org/onap/vid/asdc/beans/tosca/Import.java
new file mode 100644
index 0000000..dcd66e6
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/asdc/beans/tosca/Import.java
@@ -0,0 +1,48 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * VID
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.vid.asdc.beans.tosca;
+
+/**
+ * The Class Import.
+ */
+public class Import {
+
+	/** The file. */
+	private String file;
+
+	/**
+	 * Gets the file.
+	 *
+	 * @return the file
+	 */
+	public String getFile() {
+		return file;
+	}
+
+	/**
+	 * Sets the file.
+	 *
+	 * @param file the new file
+	 */
+	public void setFile(String file) {
+		this.file = file;
+	}
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/asdc/beans/tosca/Input.java b/vid-app-common/src/main/java/org/onap/vid/asdc/beans/tosca/Input.java
new file mode 100644
index 0000000..e485a65
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/asdc/beans/tosca/Input.java
@@ -0,0 +1,168 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * VID
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.vid.asdc.beans.tosca;
+
+import org.openecomp.sdc.toscaparser.api.elements.constraints.*;
+
+import java.util.List;
+import java.util.ArrayList;
+
+// TODO: Auto-generated Javadoc
+/**
+ * The Class Input.
+ */
+public class Input {
+
+	/** The type. */
+	private String type;
+	
+	/** The description. */
+	private String description;
+	
+	/** The default. */
+	private Object _default;
+	
+	/** The entry schema. */
+	private Input entry_schema;
+	
+	/** The constraints */
+	private List<org.openecomp.sdc.toscaparser.api.elements.constraints.Constraint> constraints;
+	
+	/** The required field. If not set, the default is true */
+	private boolean required = true;
+	
+	/**
+	 * Instantiates a new input.
+	 */
+	public Input() {
+		constraints = new ArrayList<org.openecomp.sdc.toscaparser.api.elements.constraints.Constraint>();
+	}
+	
+	/**
+	 * Gets the type.
+	 *
+	 * @return the type
+	 */
+	public String getType() {
+		return type;
+	}
+	
+	/**
+	 * Sets the type.
+	 *
+	 * @param type the new type
+	 */
+	public void setType(String type) {
+		this.type = type;
+	}
+	/**
+	 * Gets the required field.
+	 *
+	 * @return the required field
+	 */
+	public boolean getRequired() {
+		return required;
+	}
+	/**
+	 * Sets the required value.
+	 *
+	 * @param required the new required value
+	 */
+	public void setRequired(boolean required) {
+		this.required = required;
+	}
+	/**
+	 * Gets the description.
+	 *
+	 * @return the description
+	 */
+	public String getDescription() {
+		return description;
+	}
+	
+	/**
+	 * Sets the description.
+	 *
+	 * @param description the new description
+	 */
+	public void setDescription(String description) {
+		this.description = description;
+	}
+	
+	/**
+	 * Gets the default.
+	 *
+	 * @return the default
+	 */
+	public Object getDefault() {
+		return _default;
+	}
+	
+	/**
+	 * Sets the default.
+	 *
+	 * @param _default the new default
+	 */
+	public void setDefault(Object _default) {
+		this._default = _default;
+	}
+	
+	/**
+	 * Gets the entry schema.
+	 *
+	 * @return the entry schema
+	 */
+	public Input getentry_schema() {
+		return entry_schema;
+	}
+	/**
+	 * Sets the entry schema.
+	 *
+	 * @param the entry schema
+	 */
+	public void setentry_schema(Input s) {
+		this.entry_schema = s;
+	}
+	/**
+	 * Sets the constraints.
+	 *
+	 * @param c the new constraints
+	 */
+	public void setConstraints(List<org.openecomp.sdc.toscaparser.api.elements.constraints.Constraint> c) {
+		this.constraints = c;
+	}
+	/**
+	 * Gets the constraints
+	 *
+	 * @return the constraints
+	 */
+	public List<org.openecomp.sdc.toscaparser.api.elements.constraints.Constraint> getConstraints() {
+		return constraints;
+	}
+	
+	/* (non-Javadoc)
+	 * @see java.lang.Object#toString()
+	 */
+	@Override
+	public String toString() {
+		return "type=" + type + ",description=" + description + ",default=" + _default;
+	}
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/asdc/beans/tosca/NodeTemplate.java b/vid-app-common/src/main/java/org/onap/vid/asdc/beans/tosca/NodeTemplate.java
new file mode 100644
index 0000000..28210b2
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/asdc/beans/tosca/NodeTemplate.java
@@ -0,0 +1,117 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * VID
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.vid.asdc.beans.tosca;
+
+import java.util.Map;
+import java.util.HashMap;
+
+/**
+ * The Class NodeTemplate.
+ */
+public class NodeTemplate {
+
+	/** The type. */
+	private String type;
+	
+	/** The metadata. */
+	private ToscaMetadata metadata;
+	
+	/** The properties. */
+	private Map<String, Object> properties; //HEAT?
+	
+	/** The requirements. */
+	private Object requirements;
+	
+	public NodeTemplate () {
+		properties = new HashMap<String,Object>();
+	}
+	/**
+	 * Gets the type.
+	 *
+	 * @return the type
+	 */
+	public String getType() {
+		return type;
+	}
+	
+	/**
+	 * Sets the type.
+	 *
+	 * @param type the new type
+	 */
+	public void setType(String type) {
+		this.type = type;
+	}
+	
+	/**
+	 * Gets the metadata.
+	 *
+	 * @return the metadata
+	 */
+	public ToscaMetadata getMetadata() {
+		return metadata;
+	}
+	
+	/**
+	 * Sets the metadata.
+	 *
+	 * @param metadata the new metadata
+	 */
+	public void setMetadata(ToscaMetadata metadata) {
+		this.metadata = metadata;
+	}
+	
+	/**
+	 * Gets the properties.
+	 *
+	 * @return the properties
+	 */
+	public Map<String, Object> getProperties() {
+		return properties;
+	}
+	
+	/**
+	 * Sets the properties.
+	 *
+	 * @param properties the properties
+	 */
+	public void setProperties(Map<String, Object> properties) {
+		this.properties = properties;
+	}
+	
+	/**
+	 * Gets the requirements.
+	 *
+	 * @return the requirements
+	 */
+	public Object getRequirements() {
+		return requirements;
+	}
+	
+	/**
+	 * Sets the requirements.
+	 *
+	 * @param requirements the new requirements
+	 */
+	public void setRequirements(Object requirements) {
+		this.requirements = requirements;
+	}
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/asdc/beans/tosca/Property.java b/vid-app-common/src/main/java/org/onap/vid/asdc/beans/tosca/Property.java
new file mode 100644
index 0000000..107f5c8
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/asdc/beans/tosca/Property.java
@@ -0,0 +1,157 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * VID
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.vid.asdc.beans.tosca;
+
+/**
+ * The Class Property.
+ */
+public class Property {
+
+	/** The type. */
+	private String type;
+	
+	/** The description. */
+	private String description;
+	
+	/** The entry schema. */
+	private Schema entry_schema;
+	
+	/** The default. */
+	private String _default;
+	
+	/** The required. */
+	private boolean required;
+	
+	/**
+	 * Instantiates a new property.
+	 */
+	private Property() {}
+	
+	/**
+	 * Gets the type.
+	 *
+	 * @return the type
+	 */
+	public String getType() {
+		return type;
+	}
+
+	/**
+	 * Gets the description.
+	 *
+	 * @return the description
+	 */
+	public String getDescription() {
+		return description;
+	}
+
+	/**
+	 * Gets the entry schema.
+	 *
+	 * @return the entry schema
+	 */
+	public Schema getEntry_schema() {
+		return entry_schema;
+	}
+
+	/**
+	 * Gets the default.
+	 *
+	 * @return the default
+	 */
+	public String get_default() {
+		return _default;
+	}
+
+	/**
+	 * Sets the type.
+	 *
+	 * @param type the new type
+	 */
+	public void setType(String type) {
+		this.type = type;
+	}
+
+	/**
+	 * Sets the description.
+	 *
+	 * @param description the new description
+	 */
+	public void setDescription(String description) {
+		this.description = description;
+	}
+
+	/**
+	 * Sets the entry schema.
+	 *
+	 * @param entry_schema the new entry schema
+	 */
+	public void setEntry_schema(Schema entry_schema) {
+		this.entry_schema = entry_schema;
+	}
+
+	/**
+	 * Sets the default.
+	 *
+	 * @param _default the new default
+	 */
+	public void set_default(String _default) {
+		this._default = _default;
+	}
+
+	/**
+	 * Gets the default.
+	 *
+	 * @return the default
+	 */
+	public String getDefault() {
+		return _default;
+	}
+	
+	/**
+	 * Checks if is required.
+	 *
+	 * @return true, if is required
+	 */
+	public boolean isRequired() {
+		return required;
+	}
+	
+	/**
+	 * Sets the default.
+	 *
+	 * @param _default the new default
+	 */
+	public void setDefault(String _default) {
+		this._default = _default;
+	}
+	
+	/**
+	 * Sets the required.
+	 *
+	 * @param required the new required
+	 */
+	public void setRequired(boolean required) {
+		this.required = required;
+	}
+	
+	
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/asdc/beans/tosca/Requirement.java b/vid-app-common/src/main/java/org/onap/vid/asdc/beans/tosca/Requirement.java
new file mode 100644
index 0000000..0c2f884
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/asdc/beans/tosca/Requirement.java
@@ -0,0 +1,120 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * VID
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.vid.asdc.beans.tosca;
+
+import java.util.Collection;
+
+/**
+ * The Class Requirement.
+ */
+public class Requirement {
+
+	/** The occurrences. */
+	private Collection<String> occurrences;
+	
+	/** The capability. */
+	private String capability;
+	
+	/** The node. */
+	private String node;
+	
+	/** The relationship. */
+	private String relationship;
+	
+	/**
+	 * Instantiates a new requirement.
+	 */
+	private Requirement() {}
+	
+	/**
+	 * Gets the occurrences.
+	 *
+	 * @return the occurrences
+	 */
+	public Collection<String> getOccurrences() {
+		return occurrences;
+	}
+	
+	/**
+	 * Gets the capability.
+	 *
+	 * @return the capability
+	 */
+	public String getCapability() {
+		return capability;
+	}
+	
+	/**
+	 * Gets the node.
+	 *
+	 * @return the node
+	 */
+	public String getNode() {
+		return node;
+	}
+	
+	/**
+	 * Gets the relationship.
+	 *
+	 * @return the relationship
+	 */
+	public String getRelationship() {
+		return relationship;
+	}
+	
+	/**
+	 * Sets the occurrences.
+	 *
+	 * @param occurrences the new occurrences
+	 */
+	public void setOccurrences(Collection<String> occurrences) {
+		this.occurrences = occurrences;
+	}
+	
+	/**
+	 * Sets the capability.
+	 *
+	 * @param capability the new capability
+	 */
+	public void setCapability(String capability) {
+		this.capability = capability;
+	}
+	
+	/**
+	 * Sets the node.
+	 *
+	 * @param node the new node
+	 */
+	public void setNode(String node) {
+		this.node = node;
+	}
+	
+	/**
+	 * Sets the relationship.
+	 *
+	 * @param relationship the new relationship
+	 */
+	public void setRelationship(String relationship) {
+		this.relationship = relationship;
+	}
+	
+	
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/asdc/beans/tosca/Schema.java b/vid-app-common/src/main/java/org/onap/vid/asdc/beans/tosca/Schema.java
new file mode 100644
index 0000000..7bf3477
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/asdc/beans/tosca/Schema.java
@@ -0,0 +1,53 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * VID
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.vid.asdc.beans.tosca;
+
+/**
+ * The Class Schema.
+ */
+public class Schema {
+
+	/** The type. */
+	public String type;
+
+	/**
+	 * Instantiates a new schema.
+	 */
+	public Schema() {}
+	
+	/**
+	 * Gets the type.
+	 *
+	 * @return the type
+	 */
+	public String getType() {
+		return type;
+	}
+
+	/**
+	 * Sets the type.
+	 *
+	 * @param type the new type
+	 */
+	public void setType(String type) {
+		this.type = type;
+	}
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/asdc/beans/tosca/SubstitutionMappings.java b/vid-app-common/src/main/java/org/onap/vid/asdc/beans/tosca/SubstitutionMappings.java
new file mode 100644
index 0000000..70779c5
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/asdc/beans/tosca/SubstitutionMappings.java
@@ -0,0 +1,101 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * VID
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.vid.asdc.beans.tosca;
+
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * The Class SubstitutionMappings.
+ */
+public class SubstitutionMappings {
+
+	/** The node type. */
+	private String node_type;
+	
+	/** The capabilities. */
+	private Map<String, Object> capabilities;
+	
+	/** The requirements. */
+	private Map<String, Object> requirements;
+	
+	/**
+	 * Instantiates a new substitution mappings.
+	 */
+	public SubstitutionMappings() {
+		capabilities = new HashMap<String, Object> ();
+		requirements = new HashMap<String, Object> ();
+	}
+	
+	/**
+	 * Gets the node type.
+	 *
+	 * @return the node type
+	 */
+	public String getnode_type() {
+		return node_type;
+	}
+	
+	/**
+	 * Sets the node type.
+	 *
+	 * @param node_type the new node type
+	 */
+	public void setnode_type(String node_type) {
+		this.node_type = node_type;
+	}
+
+	/**
+	 * Gets the capabilities.
+	 *
+	 * @return the capabilities
+	 */
+	public Map<String, Object> getCapabilities() {
+		return capabilities;
+	}
+
+	/**
+	 * Sets the capabilities.
+	 *
+	 * @param capabilities the capabilities
+	 */
+	public void setCapabilities(Map<String, Object> capabilities) {
+		this.capabilities = capabilities;
+	}
+
+	/**
+	 * Gets the requirements.
+	 *
+	 * @return the requirements
+	 */
+	public Map<String, Object> getRequirements() {
+		return requirements;
+	}
+
+	/**
+	 * Sets the requirements.
+	 *
+	 * @param requirements the requirements
+	 */
+	public void setRequirements(Map<String, Object> requirements) {
+		this.requirements = requirements;
+	}
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/asdc/beans/tosca/TopologyTemplate.java b/vid-app-common/src/main/java/org/onap/vid/asdc/beans/tosca/TopologyTemplate.java
new file mode 100644
index 0000000..7083071
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/asdc/beans/tosca/TopologyTemplate.java
@@ -0,0 +1,124 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * VID
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.vid.asdc.beans.tosca;
+
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * The Class TopologyTemplate.
+ */
+public class TopologyTemplate {
+	
+	/** The substitution mappings. */
+	private SubstitutionMappings substitution_mappings;
+	
+	/** The inputs. */
+	private Map<String, Input> inputs;
+	
+	/** The node templates. */
+	private Map<String, NodeTemplate> node_templates;
+	
+	/** The groups. */
+	private Map<String, Group> groups;
+	
+	/**
+	 * Instantiates a new topology template.
+	 */
+	public TopologyTemplate() {
+		substitution_mappings = new SubstitutionMappings();
+		inputs = new HashMap<String, Input> ();
+		node_templates = new HashMap<String, NodeTemplate> ();
+		groups = new HashMap<String, Group> ();
+	}
+	
+	/**
+	 * Gets the substitution mappings.
+	 *
+	 * @return the substitution mappings
+	 */
+	public SubstitutionMappings getsubstitution_mappings() {
+		return this.substitution_mappings;
+	}
+	
+	/**
+	 * Sets the substitution mappings.
+	 *
+	 * @param substitution_mappings the new substitution mappings
+	 */
+	public void setsubstitution_mappings(SubstitutionMappings substitution_mappings) {
+		this.substitution_mappings = substitution_mappings;
+	}
+	
+	/**
+	 * Gets the inputs.
+	 *
+	 * @return the inputs
+	 */
+	public Map<String, Input> getInputs() {
+		return inputs;
+	}
+	
+	/**
+	 * Sets the inputs.
+	 *
+	 * @param inputs the inputs
+	 */
+	public void setInputs(Map<String, Input> inputs) {
+		this.inputs = inputs;
+	}
+	
+	/**
+	 * Gets the node templates.
+	 *
+	 * @return the node templates
+	 */
+	public Map<String, NodeTemplate> getnode_templates() {
+		return node_templates;
+	}
+	
+	/**
+	 * Setnode templates.
+	 *
+	 * @param node_templates the node templates
+	 */
+	public void setnode_templates(Map<String, NodeTemplate> node_templates) {
+		this.node_templates = node_templates;
+	}
+
+	/**
+	 * Gets the groups.
+	 *
+	 * @return the groups
+	 */
+	public Map<String, Group> getGroups() {
+		return groups;
+	}
+
+	/**
+	 * Sets the groups.
+	 *
+	 * @param groups the groups
+	 */
+	public void setGroups(Map<String, Group> groups) {
+		this.groups = groups;
+	}
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/asdc/beans/tosca/ToscaCsar.java b/vid-app-common/src/main/java/org/onap/vid/asdc/beans/tosca/ToscaCsar.java
new file mode 100644
index 0000000..6785835
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/asdc/beans/tosca/ToscaCsar.java
@@ -0,0 +1,101 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * VID
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.vid.asdc.beans.tosca;
+
+import java.util.Collection;
+import java.util.LinkedList;
+
+/**
+ * The Class ToscaCsar.
+ */
+public class ToscaCsar {
+
+	/** The parent. */
+	private final ToscaModel parent;
+	
+	/** The children. */
+	private final Collection<ToscaModel> children;
+	
+	/**
+	 * The Class Builder.
+	 */
+	public static class Builder {
+		
+		/** The parent. */
+		private final ToscaModel parent;
+		
+		/** The children. */
+		private Collection<ToscaModel> children = new LinkedList<ToscaModel> ();
+		
+		/**
+		 * Instantiates a new builder.
+		 *
+		 * @param parent the parent
+		 */
+		public Builder(ToscaModel parent) {
+			this.parent = parent;
+		}
+		
+		/**
+		 * Adds the vnf.
+		 *
+		 * @param child the child
+		 * @return the builder
+		 */
+		public Builder addVnf(ToscaModel child) {
+			children.add(child);
+			return this;
+		}
+		
+		/**
+		 * Builds the.
+		 *
+		 * @return the tosca csar
+		 */
+		public ToscaCsar build() {
+			return new ToscaCsar(this);
+		}
+	}
+	
+	/**
+	 * Instantiates a new tosca csar.
+	 *
+	 * @param builder the builder
+	 */
+	public ToscaCsar(Builder builder) {
+		this.parent = builder.parent;
+		this.children = builder.children;
+	}
+	
+	/**
+	 * Gets the parent.
+	 *
+	 * @return the parent
+	 */
+	public ToscaModel getParent() { return parent; }
+	
+	/**
+	 * Gets the children.
+	 *
+	 * @return the children
+	 */
+	public Collection<ToscaModel> getChildren() { return children; }
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/asdc/beans/tosca/ToscaMeta.java b/vid-app-common/src/main/java/org/onap/vid/asdc/beans/tosca/ToscaMeta.java
new file mode 100644
index 0000000..a7a6c62
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/asdc/beans/tosca/ToscaMeta.java
@@ -0,0 +1,124 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * VID
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.vid.asdc.beans.tosca;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.onap.vid.asdc.AsdcCatalogException;
+
+/**
+ * The Class ToscaMeta.
+ */
+public class ToscaMeta {
+
+	/** The metadata. */
+	private final Map<String, String> metadata;
+	
+	/**
+	 * Instantiates a new tosca meta.
+	 *
+	 * @param builder the builder
+	 * @throws IOException Signals that an I/O exception has occurred.
+	 * @throws AsdcCatalogException the asdc catalog exception
+	 */
+	private ToscaMeta(Builder builder) throws IOException, AsdcCatalogException {
+		metadata = new HashMap<String, String> ();
+		
+		read(builder.inputStream);
+	}
+	
+	/**
+	 * The Class Builder.
+	 */
+	public static class Builder {
+		
+		/** The input stream. */
+		private final InputStream inputStream;
+		
+		/**
+		 * Instantiates a new builder.
+		 *
+		 * @param inputStream the input stream
+		 */
+		public Builder(InputStream inputStream) {
+			this.inputStream = inputStream;
+		}
+		
+		/**
+		 * Builds the.
+		 *
+		 * @return the tosca meta
+		 * @throws IOException Signals that an I/O exception has occurred.
+		 * @throws AsdcCatalogException the asdc catalog exception
+		 */
+		public ToscaMeta build() throws IOException, AsdcCatalogException {
+			return new ToscaMeta(this);
+		}
+	}
+	
+	/**
+	 * Gets the.
+	 *
+	 * @param property the property
+	 * @return the string
+	 */
+	public String get(String property) {
+		return metadata.get(property);
+	}
+	
+	/**
+	 * Read.
+	 *
+	 * @param inputStream the input stream
+	 * @throws IOException Signals that an I/O exception has occurred.
+	 * @throws AsdcCatalogException the asdc catalog exception
+	 */
+	private void read(InputStream inputStream) throws IOException, AsdcCatalogException {
+		
+		final BufferedReader br = new BufferedReader(new InputStreamReader(inputStream));
+		
+		String line;
+		
+		try {
+			while ((line = br.readLine()) != null) {
+				if ( line.length() > 0 ) {
+					final String[] entry = line.split(":");
+					
+					if (entry.length != 2) throw new AsdcCatalogException("TOSCA.meta file cannot be parsed (more than 1 colon found on a single line");
+					if (!entry[1].startsWith(" ")) throw new AsdcCatalogException("TOSCA.meta file cannot be parsed (: not immediately followed by ' ')");
+					
+					metadata.put(entry[0], entry[1].substring(1));
+				}
+			}
+		} catch (IOException e) {
+			metadata.clear();
+			throw e;
+		} catch (AsdcCatalogException e) {
+			metadata.clear();
+			throw e;
+		}
+	}
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/asdc/beans/tosca/ToscaMetadata.java b/vid-app-common/src/main/java/org/onap/vid/asdc/beans/tosca/ToscaMetadata.java
new file mode 100644
index 0000000..32e9fba
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/asdc/beans/tosca/ToscaMetadata.java
@@ -0,0 +1,461 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * VID
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.vid.asdc.beans.tosca;
+
+/**
+ * The Class ToscaMetadata.
+ */
+public class ToscaMetadata {
+
+	/** The template name. */
+	private String template_name;
+	
+	/** The invariant UUID. */
+	private String invariantUUID;
+	
+	/** The customization UUID. */
+	private String customizationUUID;
+	
+	/** The uuid. */
+	private String uuid;
+	
+	/** The version. */
+	private String version;
+	
+	/** The name. */
+	private String name;
+	
+	/** The description. */
+	private String description;
+	
+	/** The category. */
+	private String category;
+	
+	/** The subcategory. */
+	private String subcategory;
+	
+	/** The type. */
+	private String type;
+	
+	/** The resource vendor. */
+	private String resourceVendor;
+	
+	/** The resource vendor release. */
+	private String resourceVendorRelease;
+	
+	/** The service ecomp naming. */
+	private String serviceEcompNaming;
+	
+	/** The ecomp generated naming - duplicate for serviceEcompNaming */
+	private boolean ecompGeneratedNaming;
+	
+	/** The naming policy */
+	private String namingPolicy;
+	
+	/** The service homing. */
+	private boolean serviceHoming;
+	
+	/** The vf module model name. */
+	//ToscaMetadata for VF Modules
+	private String vfModuleModelName;
+	
+	/** The vf module model invariant UUID. */
+	private String vfModuleModelInvariantUUID;
+	
+	/** The vf module model customization UUID. */
+	private String vfModuleModelCustomizationUUID;
+	
+	/** The vf module model UUID. */
+	private String vfModuleModelUUID;
+	
+	/** The vf module model version. */
+	private String vfModuleModelVersion;
+	
+	/**
+	 * Instantiates a new tosca metadata.
+	 */
+	public ToscaMetadata() {}
+	
+	/**
+	 * Gets the type.
+	 *
+	 * @return the type
+	 */
+	public String getType() {
+		return type;
+	}
+	
+	/**
+	 * Gets the invariant UUID.
+	 *
+	 * @return the invariant UUID
+	 */
+	public String getInvariantUUID() {
+		  return invariantUUID;
+	}
+	/**
+	 * Gets the customization UUID.
+	 *
+	 * @return the customization UUID
+	 */
+	public String getCustomizationUUID() {
+		  return customizationUUID;
+	}
+	/**
+	 * Gets the uuid.
+	 *
+	 * @return the uuid
+	 */
+	public String getUUID() {
+		return uuid;
+	}
+
+	/**
+	 * Gets the version.
+	 *
+	 * @return the version
+	 */
+	public String getVersion() {
+		return version;
+	}
+
+	/**
+	 * Gets the name.
+	 *
+	 * @return the name
+	 */
+	public String getName() {
+		return name;
+	}
+
+	/**
+	 * Gets the description.
+	 *
+	 * @return the description
+	 */
+	public String getDescription() {
+		return description;
+	}
+
+	/**
+	 * Gets the category.
+	 *
+	 * @return the category
+	 */
+	public String getCategory() {
+		return category;
+	}
+
+	/**
+	 * Gets the subcategory.
+	 *
+	 * @return the subcategory
+	 */
+	public String getSubcategory() {
+		return subcategory;
+	}
+
+	/**
+	 * Gets the resource vendor.
+	 *
+	 * @return the resource vendor
+	 */
+	public String getResourceVendor() {
+		return resourceVendor;
+	}
+
+	/**
+	 * Gets the resource vendor release.
+	 *
+	 * @return the resource vendor release
+	 */
+	public String getResourceVendorRelease() {
+		return resourceVendorRelease;
+	}
+
+	/**
+	 * Returns the value of service ecomp naming.
+	 *
+	 * @return serviceEcompNaming
+	 */
+	public String getServiceEcompNaming() {
+		return serviceEcompNaming;
+	}
+	/**
+	 * Returns the value of the naming policy.
+	 *
+	 * @return namingPolicy
+	 */
+	public String getNamingPolicy() {
+		return namingPolicy;
+	}
+	/**
+	 * Checks if is service homing.
+	 *
+	 * @return true, if is service homing
+	 */
+	public boolean isServiceHoming() {
+		return serviceHoming;
+	}
+	/**
+	 * Checks if is ecomp generated naming.
+	 *
+	 * @return true, if ecomp generated naming is true
+	 */
+	public boolean isEcompGeneratedNaming() {
+		return ecompGeneratedNaming;
+	}
+	/**
+	 * Sets the type.
+	 *
+	 * @param type the new type
+	 */
+	public void setType(String type) {
+		this.type = type;
+	}
+	
+	/**
+	 * Sets the invariant UUID.
+	 *
+	 * @param invariantUUID the new invariant UUID
+	 */
+	public void setInvariantUUID(String invariantUUID) {
+		this.invariantUUID = invariantUUID;
+	}
+	/**
+	 * Sets the naming policy.
+	 *
+	 * @param namingPolicy the new naming policy
+	 */
+	public void setNamingPolicy(String namingPolicy) {
+		this.namingPolicy = namingPolicy;
+	}
+	/**
+	 * Sets the uuid.
+	 *
+	 * @param uuid the new uuid
+	 */
+	public void setUUID(String uuid) {
+		this.uuid = uuid;
+	}
+	/**
+	 * Sets the customization uuid.
+	 *
+	 * @param u the new customization uuid
+	 */
+	public void setCustomizationUUID(String u) {
+		this.customizationUUID = u;
+	}
+	/**
+	 * Sets the version.
+	 *
+	 * @param version the new version
+	 */
+	public void setVersion(String version) {
+		this.version = version;
+	}
+
+	/**
+	 * Sets the name.
+	 *
+	 * @param name the new name
+	 */
+	public void setName(String name) {
+		this.name = name;
+	}
+
+	/**
+	 * Sets the description.
+	 *
+	 * @param description the new description
+	 */
+	public void setDescription(String description) {
+		this.description = description;
+	}
+
+	/**
+	 * Sets the category.
+	 *
+	 * @param category the new category
+	 */
+	public void setCategory(String category) {
+		this.category = category;
+	}
+
+	/**
+	 * Sets the service ecomp naming.
+	 *
+	 * @param serviceEcompNaming the new service ecomp naming
+	 */
+	public void setServiceEcompNaming(String serviceEcompNaming) {
+		this.serviceEcompNaming = serviceEcompNaming;
+	}
+
+	/**
+	 * Sets the service homing.
+	 *
+	 * @param serviceHoming the new service homing
+	 */
+	public void setServiceHoming(boolean serviceHoming) {
+		this.serviceHoming = serviceHoming;
+	}
+	/**
+	 * Sets the ecomp generated naming.
+	 *
+	 * @param ecompGeneratedNaming the new ecomp generated naming
+	 */
+	public void setEcompGeneratedNaming(boolean ecompGeneratedNaming) {
+		this.ecompGeneratedNaming = ecompGeneratedNaming;
+	}
+	/**
+	 * Gets the template name.
+	 *
+	 * @return the template name
+	 */
+	public String gettemplate_name() {
+		return template_name;
+	}
+	
+	/**
+	 * Sets the template name.
+	 *
+	 * @param template_name the new template name
+	 */
+	public void settemplate_name(String template_name) {
+		this.template_name = template_name;
+	}
+	
+	/**
+	 * Sets the subcategory.
+	 *
+	 * @param subcategory the new subcategory
+	 */
+	public void setSubcategory(String subcategory) {
+		this.subcategory = subcategory;
+	}
+	
+	/**
+	 * Sets the resource vendor.
+	 *
+	 * @param resourceVendor the new resource vendor
+	 */
+	public void setResourceVendor(String resourceVendor) {
+		this.resourceVendor = resourceVendor;
+	}
+
+	/**
+	 * Sets the resource vendor release.
+	 *
+	 * @param resourceVendorRelease the new resource vendor release
+	 */
+	public void setResourceVendorRelease(String resourceVendorRelease) {
+		this.resourceVendorRelease = resourceVendorRelease;
+	}
+
+	/**
+	 * Gets the vf module model name.
+	 *
+	 * @return the vf module model name
+	 */
+	public String getVfModuleModelName() {
+		return vfModuleModelName;
+	}
+
+	/**
+	 * Sets the vf module model name.
+	 *
+	 * @param vfModuleModelName the new vf module model name
+	 */
+	public void setVfModuleModelName(String vfModuleModelName) {
+		this.vfModuleModelName = vfModuleModelName;
+	}
+
+	/**
+	 * Gets the vf module model invariant UUID.
+	 *
+	 * @return the vf module model invariant UUID
+	 */
+	public String getVfModuleModelInvariantUUID() {
+		return vfModuleModelInvariantUUID;
+	}
+
+	/**
+	 * Sets the vf module model invariant UUID.
+	 *
+	 * @param vfModuleModelInvariantUUID the new vf module model invariant UUID
+	 */
+	public void setVfModuleModelInvariantUUID(String vfModuleModelInvariantUUID) {
+		this.vfModuleModelInvariantUUID = vfModuleModelInvariantUUID;
+	}
+
+	/**
+	 * Gets the vf module model UUID.
+	 *
+	 * @return the vf module model UUID
+	 */
+	public String getVfModuleModelUUID() {
+		return vfModuleModelUUID;
+	}
+
+	/**
+	 * Sets the vf module model UUID.
+	 *
+	 * @param vfModuleModelUUID the new vf module model UUID
+	 */
+	public void setVfModuleModelUUID(String vfModuleModelUUID) {
+		this.vfModuleModelUUID = vfModuleModelUUID;
+	}
+
+	/**
+	 * Gets the vf module model version.
+	 *
+	 * @return the vf module model version
+	 */
+	public String getVfModuleModelVersion() {
+		return vfModuleModelVersion;
+	}
+
+	/**
+	 * Sets the vf module model version.
+	 *
+	 * @param vfModuleModelVersion the new vf module model version
+	 */
+	public void setVfModuleModelVersion(String vfModuleModelVersion) {
+		this.vfModuleModelVersion = vfModuleModelVersion;
+	}
+	/**
+	 * Sets the vf module customization uuid.
+	 *
+	 * @param u the new vf module model customization uuid
+	 */
+	public void setVfModuleModelCustomizationUUID(String u) {
+		this.vfModuleModelCustomizationUUID = u;
+	}
+	/**
+	 * Gets the vf module model customization uuid.
+	 *
+	 * @return the vf module model customization uuid
+	 */
+	public String getVfModuleModelCustomizationUUID() {
+		
+		return vfModuleModelCustomizationUUID;
+	}
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/asdc/beans/tosca/ToscaModel.java b/vid-app-common/src/main/java/org/onap/vid/asdc/beans/tosca/ToscaModel.java
new file mode 100644
index 0000000..972d366
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/asdc/beans/tosca/ToscaModel.java
@@ -0,0 +1,166 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * VID
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.vid.asdc.beans.tosca;
+
+import java.util.Collection;
+import java.util.LinkedList;
+import java.util.Map;
+
+/**
+ * The Class ToscaModel.
+ */
+public class ToscaModel {
+
+	/** The tosca definitions version. */
+	private String tosca_definitions_version;
+	
+	/** The description. */
+	private String description;
+	
+	/** The metadata. */
+	private ToscaMetadata metadata;
+	
+	/** The topology template. */
+	private TopologyTemplate topology_template;
+	
+	/** The imports. */
+	private Collection<Map<String, Map<String, String>>> imports;
+	
+	/** The node types. */
+	private Map<String, Object> node_types;
+	
+	/**
+	 * Instantiates a new tosca model.
+	 */
+	public ToscaModel() {
+		metadata = new ToscaMetadata();
+		topology_template = new TopologyTemplate();
+		imports = new LinkedList<Map<String, Map<String, String>>> ();
+	}
+	
+	/**
+	 * Gets the metadata.
+	 *
+	 * @return the metadata
+	 */
+	public ToscaMetadata getMetadata() {
+		return metadata;
+	}
+	
+	/**
+	 * Sets the metadata.
+	 *
+	 * @param metadata the new metadata
+	 */
+	public void setMetadata(ToscaMetadata metadata) {
+		this.metadata = metadata;
+	}
+	
+	/**
+	 * Gets the tosca definitions version.
+	 *
+	 * @return the tosca definitions version
+	 */
+	public String gettosca_definitions_version() {
+		return tosca_definitions_version;
+	}
+	
+	/**
+	 * Sets the tosca definitions version.
+	 *
+	 * @param tosca_definitions_version the new tosca definitions version
+	 */
+	public void settosca_definitions_version(String tosca_definitions_version) {
+		this.tosca_definitions_version = tosca_definitions_version;
+	}
+	
+	/**
+	 * Gets the topology template.
+	 *
+	 * @return the topology template
+	 */
+	public TopologyTemplate gettopology_template() {
+		return topology_template;
+	}
+	
+	/**
+	 * Sets the topology template.
+	 *
+	 * @param topology_template the new topology template
+	 */
+	public void settopology_template(TopologyTemplate topology_template) {
+		this.topology_template = topology_template;
+	}
+
+	/**
+	 * Gets the description.
+	 *
+	 * @return the description
+	 */
+	public String getDescription() {
+		return description;
+	}
+
+	/**
+	 * Sets the description.
+	 *
+	 * @param description the new description
+	 */
+	public void setDescription(String description) {
+		this.description = description;
+	}
+
+	/**
+	 * Gets the imports.
+	 *
+	 * @return the imports
+	 */
+	public Collection<Map<String, Map<String, String>>> getImports() {
+		return imports;
+	}
+
+	/**
+	 * Sets the imports.
+	 *
+	 * @param imports the imports
+	 */
+	public void setImports(Collection<Map<String, Map<String, String>>> imports) {
+		this.imports = imports;
+	}
+	
+	/**
+	 * Gets the node types.
+	 *
+	 * @return the node types
+	 */
+	public Map<String, Object> getnode_types() {
+		return node_types;
+	}
+	
+	/**
+	 * Setnode types.
+	 *
+	 * @param node_types the node types
+	 */
+	public void setnode_types(Map<String, Object> node_types) { 
+		this.node_types = node_types;
+	}
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/asdc/local/LocalAsdcClient.java b/vid-app-common/src/main/java/org/onap/vid/asdc/local/LocalAsdcClient.java
new file mode 100644
index 0000000..3c04e5c
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/asdc/local/LocalAsdcClient.java
@@ -0,0 +1,394 @@
+package org.onap.vid.asdc.local;
+
+import org.codehaus.jackson.JsonParseException;
+import org.codehaus.jackson.map.JsonMappingException;
+import org.codehaus.jackson.map.ObjectMapper;
+import org.json.JSONArray;
+import org.json.JSONObject;
+import org.onap.vid.asdc.AsdcCatalogException;
+import org.onap.vid.asdc.AsdcClient;
+import org.onap.vid.asdc.beans.Artifact;
+import org.onap.vid.asdc.beans.Resource;
+import org.onap.vid.asdc.beans.Service;
+import org.onap.vid.asdc.beans.tosca.ToscaCsar;
+import org.onap.vid.asdc.beans.tosca.ToscaMeta;
+import org.onap.vid.asdc.beans.tosca.ToscaModel;
+import org.yaml.snakeyaml.Yaml;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.nio.file.StandardCopyOption;
+import java.util.Collection;
+import java.util.LinkedList;
+import java.util.Map;
+import java.util.UUID;
+import java.util.zip.ZipFile;
+
+/**
+ * The Class LocalAsdcClient.
+ */
+public class LocalAsdcClient implements AsdcClient {
+
+
+    /**
+     * The catalog.
+     */
+    private final JSONObject catalog;
+
+    /**
+     * The mapper.
+     */
+    private final ObjectMapper mapper;
+
+    /**
+     * Instantiates a new in local sdc client.
+     *
+     * @param builder the builder
+     */
+    public LocalAsdcClient(org.onap.vid.asdc.local.LocalAsdcClient.Builder builder) {
+        catalog = builder.catalog;
+        mapper = builder.mapper;
+    }
+
+    /**
+     * Gets the catalog.
+     *
+     * @return the catalog
+     */
+    private JSONObject getCatalog() {
+        return catalog;
+    }
+
+    /**
+     * Gets the mapper.
+     *
+     * @return the mapper
+     */
+    private ObjectMapper getMapper() {
+        return mapper;
+    }
+
+    /**
+     * Convert.
+     *
+     * @param <T>   the generic type
+     * @param json  the json
+     * @param clazz the clazz
+     * @return the t
+     * @throws AsdcCatalogException the sdc catalog exception
+     */
+    private <T> T convert(JSONObject json, Class<T> clazz) throws AsdcCatalogException {
+        try {
+            return getMapper().readValue(json.toString(), clazz);
+        } catch (JsonParseException e) {
+            throw new AsdcCatalogException("Failed to parse SDC response (bad data)", e);
+        } catch (JsonMappingException e) {
+            throw new AsdcCatalogException("Failed to map SDC response to internal VID data structure(s)", e);
+        } catch (IOException e) {
+            throw new AsdcCatalogException("Failed to get a response from SDC", e);
+        }
+    }
+
+    /* (non-Javadoc)
+     * @see org.openecomp.vid.asdc.AsdcClient#getResource(java.util.UUID)
+     */
+    public Resource getResource(UUID uuid) throws AsdcCatalogException {
+        final JSONObject resource = getCatalog().getJSONObject("resources")
+                .getJSONObject(uuid.toString());
+        return convert(resource, Resource.class);
+    }
+
+    /* (non-Javadoc)
+     * @see org.openecomp.vid.asdc.AsdcClient#getResources()
+     */
+    public Collection<Resource> getResources() throws AsdcCatalogException {
+        final Collection<Resource> resources = new LinkedList<Resource>();
+
+        for (String key : getCatalog().getJSONObject("resources").keySet()) {
+            final JSONObject json = getCatalog().getJSONObject("resources").getJSONObject(key);
+            final Resource resource = convert(json, Resource.class);
+            resources.add(resource);
+        }
+
+        return resources;
+    }
+
+    /* (non-Javadoc)
+     * @see org.openecomp.vid.asdc.AsdcClient#getResources(java.util.Map)
+     */
+    public Collection<Resource> getResources(Map<String, String[]> filter) throws AsdcCatalogException {
+        final Collection<Resource> resources = new LinkedList<Resource>();
+
+        for (String key : getCatalog().getJSONObject("resources").keySet()) {
+            final JSONObject json = getCatalog().getJSONObject("resources").getJSONObject(key);
+
+            boolean filterMatch = true;
+
+            for (Map.Entry<String, String[]> entry : filter.entrySet()) {
+                for (int i = 0; i < entry.getValue().length; i++) {
+                    if (!json.getString(entry.getKey()).equals(entry.getValue()[i])) {
+                        filterMatch = false;
+                        break;
+                    }
+                }
+            }
+
+            if (filterMatch) resources.add(convert(json, Resource.class));
+        }
+
+        return resources;
+    }
+
+    /* (non-Javadoc)
+     * @see org.openecomp.vid.asdc.AsdcClient#getService(java.util.UUID)
+     */
+    public Service getService(UUID uuid) throws AsdcCatalogException {
+
+        JSONObject serviceJsonObject = null;
+        final JSONArray categoryJsonArray = getCatalog().getJSONArray("services");
+
+        for (int i = 0; i < categoryJsonArray.length(); i++) {
+            JSONObject jsonServiceObject = categoryJsonArray.getJSONObject(i);
+            if (jsonServiceObject.get("uuid").equals(uuid.toString())) {
+                serviceJsonObject = jsonServiceObject;
+                break;
+            }
+        }
+
+        if (serviceJsonObject != null)
+            return convert(serviceJsonObject, Service.class);
+        else return null;
+    }
+
+    /* (non-Javadoc)
+     * @see org.openecomp.vid.asdc.AsdcClient#getServices()
+     */
+    public Collection<Service> getServices() throws AsdcCatalogException {
+        final Collection<Service> services = new LinkedList<Service>();
+
+        JSONArray servicesArr = getCatalog().getJSONArray("services");
+
+        for (Object objService : servicesArr) {
+            JSONObject jsonServiceItem = (JSONObject) objService;
+            final Service service = convert(jsonServiceItem, Service.class);
+            services.add(service);
+        }
+
+        return services;
+    }
+
+    /* (non-Javadoc)
+     * @see org.openecompt.vid.asdc.AsdcClient#getServices(java.util.Map)
+     */
+    public Collection<Service> getServices(Map<String, String[]> filter) throws AsdcCatalogException {
+        final Collection<Service> services = new LinkedList<Service>();
+
+        JSONArray catalogServices = catalog.getJSONArray("services");
+
+        for (int i = 0; i < catalogServices.length(); i++) {
+
+            JSONObject serviceJson = catalogServices.getJSONObject(i);
+
+            boolean filterMatch = true;
+
+            for (Map.Entry<String, String[]> entry : filter.entrySet()) {
+                for (int j = 0; j < entry.getValue().length; j++) {
+                    if (!serviceJson.getString(entry.getKey()).equals(entry.getValue()[j])) {
+                        filterMatch = false;
+                        break;
+                    }
+                }
+            }
+            if (filterMatch) services.add(convert(serviceJson, Service.class));
+        }
+        return services;
+    }
+
+    /* (non-Javadoc)
+     * @see org.openecomp.vid.asdc.AsdcClient#getResourceArtifact(java.util.UUID, java.util.UUID)
+     */
+    public Artifact getResourceArtifact(UUID resourceUuid, UUID artifactUuid) throws AsdcCatalogException {
+        final JSONArray artifacts = getCatalog().getJSONObject("resources")
+                .getJSONObject(resourceUuid.toString())
+                .getJSONArray("artifacts");
+
+        for (int i = 0; i < artifacts.length(); i++) {
+            final JSONObject artifact = artifacts.getJSONObject(i);
+
+            if (artifact.getString("artifactUUID").equals(artifactUuid.toString())) {
+                return convert(artifact, Artifact.class);
+            }
+        }
+
+        return null;
+    }
+
+    /* (non-Javadoc)
+     * @see org.openecomp.vid.asdc.AsdcClient#getServiceArtifact(java.util.UUID, java.util.UUID)
+     */
+    public Artifact getServiceArtifact(UUID serviceUuid, UUID artifactUuid) throws AsdcCatalogException {
+        final JSONArray artifacts = getCatalog().getJSONObject("services")
+                .getJSONObject(serviceUuid.toString())
+                .getJSONArray("artifacts");
+
+        for (int i = 0; i < artifacts.length(); i++) {
+            final JSONObject artifact = artifacts.getJSONObject(i);
+
+            if (artifact.getString("artifactUUID").equals(artifactUuid.toString())) {
+                return convert(artifact, Artifact.class);
+            }
+        }
+
+        return null;
+    }
+
+    /* (non-Javadoc)
+     * @see org.openecomp.vid.asdc.AsdcClient#getResourceToscaModel(java.util.UUID)
+     */
+    public Path getResourceToscaModel(UUID resourceUuid) throws AsdcCatalogException {
+        final String toscaModelURL = getCatalog().getJSONObject("resources")
+                .getJSONObject(resourceUuid.toString())
+                .getString("toscaModelURL");
+
+
+        final InputStream toscaModelStream = getClass().getClassLoader().getResourceAsStream(toscaModelURL);
+
+        if (toscaModelStream == null) return null;
+
+        return null;//getToscaModel(toscaModelStream);
+    }
+
+    /* (non-Javadoc)
+     * @see org.openecomp.vid.asdc.AsdcClient#getServiceToscaModel(java.util.UUID)
+     */
+    public Path getServiceToscaModel(UUID serviceUuid) throws AsdcCatalogException {
+
+        String toscaModelURL = null;
+
+        final JSONArray categoryJsonArray = getCatalog().getJSONArray("services");
+
+        for (int i = 0; i < categoryJsonArray.length(); i++) {
+
+            JSONObject jsonServiceObject = categoryJsonArray.getJSONObject(i);
+            if (jsonServiceObject.get("uuid").equals(serviceUuid.toString())) {
+                toscaModelURL = jsonServiceObject.getString("toscaModelURL");
+                break;
+            }
+        }
+        if (toscaModelURL == null) {
+            return null;
+        }
+        final InputStream toscaModelStream = getClass().getClassLoader().getResourceAsStream(toscaModelURL);
+
+        ClassLoader classLoader = getClass().getClassLoader();
+        File file = new File(classLoader.getResource(toscaModelURL).getFile());
+        Path path = Paths.get(file.getPath());
+
+        if (toscaModelStream == null) return null;
+
+        return path;
+    }
+
+    /**
+     * Gets the tosca model.
+     *
+     * @param csarInputStream the csar input stream
+     * @return the tosca model
+     * @throws AsdcCatalogException the asdc catalog exception
+     */
+    private ToscaCsar getToscaModel(InputStream csarInputStream) throws AsdcCatalogException {
+        final Path csarFile;
+
+        try {
+            csarFile = Files.createTempFile("csar", ".zip");
+            Files.copy(csarInputStream, csarFile, StandardCopyOption.REPLACE_EXISTING);
+        } catch (IOException e) {
+            throw new AsdcCatalogException("Caught IOException while creating CSAR", e);
+        }
+
+        try (final ZipFile csar = new ZipFile(csarFile.toFile())) {
+
+            final InputStream toscaMetaStream = csar.getInputStream(csar.getEntry("TOSCA-Metadata/TOSCA.meta"));
+            final ToscaMeta toscaMeta = new ToscaMeta.Builder(toscaMetaStream).build();
+            final String entryDefinitions = toscaMeta.get("Entry-Definitions");
+            final InputStream toscaParentEntryYamlStream = csar.getInputStream(csar.getEntry(entryDefinitions));
+
+            final Yaml yaml = new Yaml();
+            final ToscaModel parentModel = yaml.loadAs(toscaParentEntryYamlStream, ToscaModel.class);
+
+            final ToscaCsar.Builder csarBuilder = new ToscaCsar.Builder(parentModel);
+
+            for (Map<String, Map<String, String>> imports : parentModel.getImports()) {
+                for (Map.Entry<String, Map<String, String>> entry : imports.entrySet()) {
+                    final InputStream toscaChildEntryYamlStream = csar.getInputStream(csar.getEntry("Definitions/" + entry.getValue().get("file")));
+                    final ToscaModel childModel = yaml.loadAs(toscaChildEntryYamlStream, ToscaModel.class);
+                    csarBuilder.addVnf(childModel);
+                }
+            }
+
+            return csarBuilder.build();
+        } catch (IOException e) {
+            throw new AsdcCatalogException("Caught IOException while processing CSAR", e);
+        }
+    }
+
+    /**
+     * The Class Builder.
+     */
+    public static class Builder {
+
+        /**
+         * The catalog.
+         */
+        private JSONObject catalog = new JSONObject()
+                .put("resources", new JSONObject())
+                .put("services", new JSONObject());
+
+        /**
+         * The mapper.
+         */
+        private ObjectMapper mapper = new ObjectMapper();
+
+        /**
+         * Instantiates a new builder.
+         */
+        public Builder() {
+        }
+
+        /**
+         * Catalog.
+         *
+         * @param catalog the catalog
+         * @return the builder
+         */
+        public org.onap.vid.asdc.local.LocalAsdcClient.Builder catalog(JSONObject catalog) {
+            this.catalog = catalog;
+            return this;
+        }
+
+        /**
+         * Mapper.
+         *
+         * @param mapper the mapper
+         * @return the builder
+         */
+        public org.onap.vid.asdc.local.LocalAsdcClient.Builder mapper(ObjectMapper mapper) {
+            this.mapper = mapper;
+            return this;
+        }
+
+        /**
+         * Builds the.
+         *
+         * @return the in local sdc client
+         */
+        public org.onap.vid.asdc.local.LocalAsdcClient build() {
+            return new org.onap.vid.asdc.local.LocalAsdcClient(this);
+        }
+    }
+
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/asdc/memory/InMemoryAsdcClient.java b/vid-app-common/src/main/java/org/onap/vid/asdc/memory/InMemoryAsdcClient.java
new file mode 100644
index 0000000..a7b934e
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/asdc/memory/InMemoryAsdcClient.java
@@ -0,0 +1,372 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * VID
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 	
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.vid.asdc.memory;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.StandardCopyOption;
+import java.util.Collection;
+import java.util.LinkedList;
+import java.util.Map;
+import java.util.Map.Entry;
+import java.util.UUID;
+import java.util.zip.ZipFile;
+
+import org.codehaus.jackson.JsonParseException;
+import org.codehaus.jackson.map.JsonMappingException;
+import org.codehaus.jackson.map.ObjectMapper;
+import org.json.JSONArray;
+import org.json.JSONObject;
+import org.yaml.snakeyaml.Yaml;
+
+import org.onap.vid.asdc.AsdcCatalogException;
+import org.onap.vid.asdc.AsdcClient;
+import org.onap.vid.asdc.beans.Artifact;
+import org.onap.vid.asdc.beans.Resource;
+import org.onap.vid.asdc.beans.Service;
+import org.onap.vid.asdc.beans.tosca.ToscaCsar;
+import org.onap.vid.asdc.beans.tosca.ToscaMeta;
+import org.onap.vid.asdc.beans.tosca.ToscaModel;
+
+/**
+ * The Class InMemoryAsdcClient.
+ */
+public class InMemoryAsdcClient implements AsdcClient {
+
+	/** The catalog. */
+	private final JSONObject catalog;
+	
+	/** The mapper. */
+	private final ObjectMapper mapper;
+
+	/**
+	 * The Class Builder.
+	 */
+	public static class Builder {
+		
+		/** The catalog. */
+		private JSONObject catalog = new JSONObject()
+										.put("resources", new JSONObject())
+										.put("services", new JSONObject());
+		
+		/** The mapper. */
+		private ObjectMapper mapper = new ObjectMapper();
+
+		/**
+		 * Instantiates a new builder.
+		 */
+		public Builder() {}
+		
+		/**
+		 * Catalog.
+		 *
+		 * @param catalog the catalog
+		 * @return the builder
+		 */
+		public Builder catalog(JSONObject catalog) {
+			this.catalog = catalog;
+			return this;
+		}
+		
+		/**
+		 * Mapper.
+		 *
+		 * @param mapper the mapper
+		 * @return the builder
+		 */
+		public Builder mapper(ObjectMapper mapper) {
+			this.mapper = mapper;
+			return this;
+		}
+		
+		/**
+		 * Builds the.
+		 *
+		 * @return the in memory sdc client
+		 */
+		public InMemoryAsdcClient build() {
+			return new InMemoryAsdcClient(this);
+		}
+	}
+	
+	/**
+	 * Instantiates a new in memory sdc client.
+	 *
+	 * @param builder the builder
+	 */
+	private InMemoryAsdcClient(Builder builder) {
+		catalog = builder.catalog;
+		mapper = builder.mapper;
+	}
+	
+	/**
+	 * Gets the catalog.
+	 *
+	 * @return the catalog
+	 */
+	private JSONObject getCatalog() {
+		return catalog;
+	}
+	
+	/**
+	 * Gets the mapper.
+	 *
+	 * @return the mapper
+	 */
+	private ObjectMapper getMapper() {
+		return mapper;
+	}
+	
+	/**
+	 * Convert.
+	 *
+	 * @param <T> the generic type
+	 * @param json the json
+	 * @param clazz the clazz
+	 * @return the t
+	 * @throws AsdcCatalogException the sdc catalog exception
+	 */
+	private <T> T convert(JSONObject json, Class<T> clazz) throws AsdcCatalogException {
+		try {
+			return getMapper().readValue(json.toString(), clazz);
+		} catch (JsonParseException e) {
+			throw new AsdcCatalogException("Failed to parse SDC response (bad data)", e);
+		} catch (JsonMappingException e) {
+			throw new AsdcCatalogException("Failed to map SDC response to internal VID data structure(s)", e);
+		} catch (IOException e) {
+			throw new AsdcCatalogException("Failed to get a response from SDC", e);
+		}
+	}
+	
+	/* (non-Javadoc)
+	 * @see org.openecomp.vid.asdc.AsdcClient#getResource(java.util.UUID)
+	 */
+	public Resource getResource(UUID uuid) throws AsdcCatalogException {
+		final JSONObject resource = getCatalog().getJSONObject("resources")
+										.getJSONObject(uuid.toString());
+		return convert(resource, Resource.class);
+	}
+
+	/* (non-Javadoc)
+	 */
+	public Collection<Resource> getResources() throws AsdcCatalogException {
+		final Collection<Resource> resources = new LinkedList<Resource> ();
+		
+		for (String key : getCatalog().getJSONObject("resources").keySet()) {
+			final JSONObject json = getCatalog().getJSONObject("resources").getJSONObject(key);
+			final Resource resource = convert(json, Resource.class);
+			resources.add(resource);
+		}
+		
+		return resources;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.openecomp.vid.asdc.AsdcClient#getResources(java.util.Map)
+	 */
+	public Collection<Resource> getResources(Map<String, String[]> filter) throws AsdcCatalogException {
+		final Collection<Resource> resources = new LinkedList<Resource> ();
+		
+		for (String key : getCatalog().getJSONObject("resources").keySet()) {
+			final JSONObject json = getCatalog().getJSONObject("resources").getJSONObject(key);
+			
+			boolean filterMatch = true;
+			
+			for (Entry<String, String[]> entry : filter.entrySet()) {
+				for (int i = 0; i < entry.getValue().length; i++) {
+					if (!json.getString(entry.getKey()).equals(entry.getValue()[i])) {
+						filterMatch = false;
+						break;
+					}
+				}
+			}
+			
+			if (filterMatch) resources.add(convert(json, Resource.class));
+		}
+		
+		return resources;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.openecomp.vid.asdc.AsdcClient#getService(java.util.UUID)
+	 */
+	public Service getService(UUID uuid) throws AsdcCatalogException {
+		final JSONObject service = getCatalog().getJSONObject("services")
+				.getJSONObject(uuid.toString());
+		return convert(service, Service.class);
+	}
+
+	/* (non-Javadoc)
+	 * @see org.openecomp.vid.asdc.AsdcClient#getServices()
+	 */
+	public Collection<Service> getServices() throws AsdcCatalogException {
+		final Collection<Service> services = new LinkedList<Service> ();
+		
+		for (String key : getCatalog().getJSONObject("services").keySet()) {
+			final JSONObject json = getCatalog().getJSONObject("services").getJSONObject(key);
+			final Service service = convert(json, Service.class);
+			services.add(service);
+		}
+		
+		return services;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.openecompt.vid.asdc.AsdcClient#getServices(java.util.Map)
+	 */
+	public Collection<Service> getServices(Map<String, String[]> filter) throws AsdcCatalogException {
+		final Collection<Service> services = new LinkedList<Service> ();
+		
+		for (String key : getCatalog().getJSONObject("services").keySet()) {
+			final JSONObject json = getCatalog().getJSONObject("services").getJSONObject(key);
+			
+			boolean filterMatch = true;
+			
+			for (Entry<String, String[]> entry : filter.entrySet()) {
+				for (int i = 0; i < entry.getValue().length; i++) {
+					if (!json.getString(entry.getKey()).equals(entry.getValue()[i])) {
+						filterMatch = false;
+						break;
+					}
+				}
+			}
+			
+			if (filterMatch) services.add(convert(json, Service.class));
+		}
+		
+		return services;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.openecomp.vid.asdc.AsdcClient#getResourceArtifact(java.util.UUID, java.util.UUID)
+	 */
+	public Artifact getResourceArtifact(UUID resourceUuid, UUID artifactUuid) throws AsdcCatalogException {
+		final JSONArray artifacts = getCatalog().getJSONObject("resources")
+				.getJSONObject(resourceUuid.toString())
+				.getJSONArray("artifacts");
+		
+		for (int i = 0; i < artifacts.length(); i++) {
+			final JSONObject artifact = artifacts.getJSONObject(i);
+			
+			if (artifact.getString("artifactUUID").equals(artifactUuid.toString())) {
+				return convert(artifact, Artifact.class);
+			}
+		}
+		
+		return null;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.openecomp.vid.asdc.AsdcClient#getServiceArtifact(java.util.UUID, java.util.UUID)
+	 */
+	public Artifact getServiceArtifact(UUID serviceUuid, UUID artifactUuid) throws AsdcCatalogException {
+		final JSONArray artifacts = getCatalog().getJSONObject("services")
+				.getJSONObject(serviceUuid.toString())
+				.getJSONArray("artifacts");
+		
+		for (int i = 0; i < artifacts.length(); i++) {
+			final JSONObject artifact = artifacts.getJSONObject(i);
+			
+			if (artifact.getString("artifactUUID").equals(artifactUuid.toString())) {
+				return convert(artifact, Artifact.class);
+			}
+		}
+		
+		return null;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.openecomp.vid.asdc.AsdcClient#getResourceToscaModel(java.util.UUID)
+	 */
+	public Path getResourceToscaModel(UUID resourceUuid) throws AsdcCatalogException {
+		final String toscaModelURL = getCatalog().getJSONObject("resources")
+				.getJSONObject(resourceUuid.toString())
+				.getString("toscaModelURL");
+
+
+		final InputStream toscaModelStream = getClass().getClassLoader().getResourceAsStream(toscaModelURL);
+		
+		if (toscaModelStream == null) return null;
+		
+		return null;//getToscaModel(toscaModelStream);
+	}
+
+	/* (non-Javadoc)
+	 * @see org.openecomp.vid.asdc.AsdcClient#getServiceToscaModel(java.util.UUID)
+	 */
+	public Path getServiceToscaModel(UUID serviceUuid) throws AsdcCatalogException {
+		final String toscaModelURL = getCatalog().getJSONObject("services")
+						.getJSONObject(serviceUuid.toString())
+						.getString("toscaModelURL");
+		
+		final InputStream toscaModelStream = getClass().getClassLoader().getResourceAsStream(toscaModelURL);
+		
+		if (toscaModelStream == null) return null;
+		
+		return null;//getToscaModel(toscaModelStream);
+	}
+
+	/**
+	 * Gets the tosca model.
+	 *
+	 * @param csarInputStream the csar input stream
+	 * @return the tosca model
+	 * @throws AsdcCatalogException the asdc catalog exception
+	 */
+	private ToscaCsar getToscaModel(InputStream csarInputStream) throws AsdcCatalogException {
+		final Path csarFile;
+		
+		try {
+			csarFile = Files.createTempFile("csar", ".zip");
+			Files.copy(csarInputStream, csarFile, StandardCopyOption.REPLACE_EXISTING);
+		} catch (IOException e) {
+			throw new AsdcCatalogException("Caught IOException while creating CSAR", e);
+		}
+		
+		try (final ZipFile csar = new ZipFile(csarFile.toFile())) {
+			
+			final InputStream toscaMetaStream = csar.getInputStream(csar.getEntry("TOSCA-Metadata/TOSCA.meta"));
+			final ToscaMeta toscaMeta = new ToscaMeta.Builder(toscaMetaStream).build();
+			final String entryDefinitions = toscaMeta.get("Entry-Definitions");
+			final InputStream toscaParentEntryYamlStream = csar.getInputStream(csar.getEntry(entryDefinitions));
+			
+			final Yaml yaml = new Yaml();
+			final ToscaModel parentModel = yaml.loadAs(toscaParentEntryYamlStream, ToscaModel.class);
+
+			final ToscaCsar.Builder csarBuilder = new ToscaCsar.Builder(parentModel);
+			
+			for (Map<String, Map<String, String>> imports : parentModel.getImports()) {
+				for (Entry<String, Map<String, String>> entry : imports.entrySet()) {
+					final InputStream toscaChildEntryYamlStream = csar.getInputStream(csar.getEntry("Definitions/" + entry.getValue().get("file")));
+					final ToscaModel childModel = yaml.loadAs(toscaChildEntryYamlStream, ToscaModel.class);
+					csarBuilder.addVnf(childModel);
+				}
+			}
+			
+			return csarBuilder.build();
+		} catch (IOException e) {
+			throw new AsdcCatalogException("Caught IOException while processing CSAR", e);
+		}
+	}
+
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/asdc/parser/ToscaParser.java b/vid-app-common/src/main/java/org/onap/vid/asdc/parser/ToscaParser.java
new file mode 100644
index 0000000..890752a
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/asdc/parser/ToscaParser.java
@@ -0,0 +1,15 @@
+package org.onap.vid.asdc.parser;
+
+import java.nio.file.Path;
+
+import org.openecomp.sdc.tosca.parser.exceptions.SdcToscaParserException;
+import org.onap.vid.asdc.AsdcCatalogException;
+import org.onap.vid.asdc.beans.tosca.ToscaCsar;
+import org.onap.vid.asdc.beans.Service;
+import org.onap.vid.model.ServiceModel;
+
+public interface ToscaParser{
+	ToscaCsar parse(Path path) throws AsdcCatalogException;
+	
+	ServiceModel makeServiceModel(String uuid,Path path,Service asdcServiceMetadata) throws Exception;
+}
\ No newline at end of file
diff --git a/vid-app-common/src/main/java/org/onap/vid/asdc/parser/ToscaParserImpl.java b/vid-app-common/src/main/java/org/onap/vid/asdc/parser/ToscaParserImpl.java
new file mode 100644
index 0000000..12881b6
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/asdc/parser/ToscaParserImpl.java
@@ -0,0 +1,226 @@
+package org.onap.vid.asdc.parser;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.nio.file.Path;
+import java.text.DateFormat;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Set;
+import java.util.UUID;
+import java.util.Map.Entry;
+import java.util.zip.ZipFile;
+
+import org.apache.commons.lang3.mutable.MutableBoolean;
+import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
+import org.openecomp.sdc.tosca.parser.exceptions.SdcToscaParserException;
+import org.onap.vid.asdc.AsdcCatalogException;
+import org.onap.vid.asdc.beans.Service;
+import org.onap.vid.asdc.beans.tosca.NodeTemplate;
+import org.onap.vid.asdc.beans.tosca.ToscaCsar;
+import org.onap.vid.asdc.beans.tosca.ToscaMeta;
+import org.onap.vid.asdc.beans.tosca.ToscaModel;
+import org.onap.vid.model.ModelConstants;
+import org.onap.vid.model.Network;
+import org.onap.vid.model.Node;
+import org.onap.vid.model.ServiceModel;
+import org.onap.vid.model.VNF;
+import org.onap.vid.properties.VidProperties;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.yaml.snakeyaml.Yaml;
+import org.yaml.snakeyaml.error.YAMLException;
+
+public class ToscaParserImpl implements ToscaParser {
+	/** The Constant LOG. */
+	static final EELFLoggerDelegate LOG = EELFLoggerDelegate.getLogger(ToscaParserImpl.class);
+
+	@Autowired
+	private final static DateFormat dateFormat = new SimpleDateFormat("HH:mm:ss:SSSS");
+
+
+	private static final String asdcModelNamespace = VidProperties.getAsdcModelNamespace();
+	private static final String vnfTag = asdcModelNamespace + ModelConstants.VNF;
+	private static final String networkTag = asdcModelNamespace + ModelConstants.NETWORK;
+	private static final String vfModuleTag = asdcModelNamespace + ModelConstants.VF_MODULE;
+
+
+	@Override
+	public ToscaCsar parse(Path path) throws AsdcCatalogException {
+		return getToscaCsar(path);
+	}
+
+	private ToscaCsar getToscaCsar(final Path csarFile) throws AsdcCatalogException {
+		try (final ZipFile csar = new ZipFile(csarFile.toFile())) {
+
+			final InputStream toscaMetaStream = csar.getInputStream(csar.getEntry("TOSCA-Metadata/TOSCA.meta"));
+			final ToscaMeta toscaMeta = new ToscaMeta.Builder(toscaMetaStream).build();
+			final String entryDefinitions = toscaMeta.get("Entry-Definitions");
+			final InputStream toscaParentEntryYamlStream = csar.getInputStream(csar.getEntry(entryDefinitions));
+
+			try {
+				final Yaml yaml = new Yaml();
+				final ToscaModel parentModel = yaml.loadAs(toscaParentEntryYamlStream, ToscaModel.class);
+
+				final ToscaCsar.Builder csarBuilder = new ToscaCsar.Builder(parentModel);
+
+				for (Map<String, Map<String, String>> imports : parentModel.getImports()) {
+					LOG.debug("imports = " + imports.toString());
+					for (Entry<String, Map<String, String>> entry : imports.entrySet()) {
+						if (entry.getValue() != null) {
+							String fname = entry.getValue().get("file");
+							if ((fname != null) && (fname.startsWith("service") || fname.startsWith("resource"))) {
+								LOG.debug("fname = " + fname);
+								final InputStream toscaChildEntryYamlStream = csar
+										.getInputStream(csar.getEntry("Definitions/" + fname));
+
+								final ToscaModel childModel = yaml.loadAs(toscaChildEntryYamlStream, ToscaModel.class);
+								csarBuilder.addVnf(childModel);
+							}
+						}
+					}
+				}
+
+				return csarBuilder.build();
+			} catch (YAMLException e) {
+				throw new AsdcCatalogException("Caught exception while processing TOSCA YAML", e);
+			}
+		} catch (IOException e) {
+			throw new AsdcCatalogException("Caught IOException while processing CSAR", e);
+		}
+	}
+
+	public ServiceModel makeServiceModel(String uuid, final Path serviceCsar,Service service ) throws AsdcCatalogException, SdcToscaParserException {
+
+
+		final ServiceModel serviceModel = new ServiceModel();
+		ToscaCsar toscaCsar = getToscaCsar(serviceCsar);
+		String methodName = "getServices";
+		LOG.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + methodName + " start");
+		MutableBoolean isNewFlow = new MutableBoolean(false);
+		final Map<String, VNF> vnfs = new HashMap<String, VNF>();
+		final Map<String, Network> networks = new HashMap<String, Network>();
+		final ToscaModel asdcServiceToscaModel = toscaCsar.getParent();
+		serviceModel.setService(ServiceModel.extractService(asdcServiceToscaModel, service));
+
+
+		populateVnfsAndNetwork(methodName, isNewFlow, vnfs, networks, asdcServiceToscaModel, serviceModel);
+
+		// If we see customization uuid under vnf or network, follow 1702 flow
+		if (isNewFlow.getValue()) {
+			return (getCustomizedServices(asdcServiceToscaModel, serviceModel));
+		} else {
+			VNF vnf = null;
+			for (ToscaModel vnfModel : toscaCsar.getChildren()) {
+				// using uuid to match should only be valid for 1610 models
+				final String vnfUuid = (vnfModel.getMetadata().getUUID());
+				// find the VNF with that uuid, uuid is not the key anymore
+				vnf = findVNFAccordingToUUID(vnfs, vnfUuid);
+				if (vnf == null) {
+					LOG.warn("Couldn't find VNF object " + vnfUuid + ". Problem with Tosca model?");
+					continue;
+				}
+				extractAndUpdateInputs(vnf, vnfModel);
+				ServiceModel.extractGroups(vnfModel, serviceModel);
+			}
+
+			serviceModel.setVnfs(vnfs);
+			serviceModel.setNetworks(networks);
+			return serviceModel;
+		}
+	}
+
+	private VNF findVNFAccordingToUUID(final Map<String, VNF> vnfs,  final String vnfUuid) {
+		VNF vnf = null;
+		for (Entry<String, VNF> vnfComp : vnfs.entrySet()) {
+			if (((vnfComp.getValue().getUuid()).equalsIgnoreCase(vnfUuid))) {
+				// found the vnf
+				vnf = vnfComp.getValue();
+			}
+		}
+		return vnf;
+	}
+
+	private void extractAndUpdateInputs(VNF vnf, ToscaModel vnfModel) {
+		vnf.setInputs(vnfModel.gettopology_template().getInputs());
+	}
+
+	private static void populateVnfsAndNetwork(String methodName, MutableBoolean isNewFlow, final Map<String, VNF> vnfs,
+											   final Map<String, Network> networks, final ToscaModel asdcServiceToscaModel, ServiceModel serviceModel)
+			throws AsdcCatalogException, SdcToscaParserException {
+		for (Entry<String, NodeTemplate> component : extractNodeTemplates(asdcServiceToscaModel)) {
+			final String modelCustomizationName = component.getKey();
+			LOG.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + methodName
+					+ " model customization name: " + modelCustomizationName);
+			final NodeTemplate nodeTemplate = component.getValue();
+			final String type = nodeTemplate.getType();
+
+			if (type.startsWith(vnfTag)) {
+				LOG.debug(EELFLoggerDelegate.debugLogger,
+						dateFormat.format(new Date()) + methodName + " found node template type: " + type);
+				final VNF vnf = new VNF();
+				vnf.extractVnf(modelCustomizationName, nodeTemplate);
+//				populateNodeVersionIfMissing(nodeTemplate, vnf,service);
+				LOG.debug(EELFLoggerDelegate.debugLogger,
+						dateFormat.format(new Date()) + methodName + " VNF commands: " + vnf.getCommands());
+				vnfs.put(modelCustomizationName, vnf);
+				isNewFlow.setValue(isNewFlow(vnf));
+			}
+			// Networks
+			if (type.startsWith(networkTag)) {
+				LOG.debug(EELFLoggerDelegate.debugLogger,
+						dateFormat.format(new Date()) + methodName + " found node template type: " + type);
+				final Network network = new Network();
+				network.extractNetwork(modelCustomizationName, nodeTemplate);
+//				populateNodeVersionIfMissing(nodeTemplate, network, service);
+				isNewFlow.setValue(isNewFlow(network));
+				networks.put(modelCustomizationName, network);
+
+			}
+		}
+		serviceModel.setVnfs(vnfs);
+		serviceModel.setNetworks(networks);
+
+	}
+
+	private static Set<Entry<String, NodeTemplate>> extractNodeTemplates(final ToscaModel asdcServiceToscaModel) {
+		return asdcServiceToscaModel.gettopology_template().getnode_templates().entrySet();
+	}
+
+	private static boolean isNewFlow(Node node) {
+		return (node.getCustomizationUuid() != null) && (node.getCustomizationUuid().length() > 0);
+	}
+
+	private static boolean isNodeVersionMissing(Node Node) {
+		return Node.getVersion() == null;
+	}
+
+	private static void populateNodeVersionIfMissing(final NodeTemplate nodeTemplate, final Node node, Service service)
+			throws AsdcCatalogException {
+		if (isNodeVersionMissing(node)) {
+			node.setVersion(service.getVersion());
+		}
+	}
+
+	private ServiceModel getCustomizedServices(ToscaModel asdcServiceToscaModel, ServiceModel serviceModel) {
+		String methodName = "asdcServiceToscaModel";
+		LOG.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + methodName + " start");
+
+		// asdcServiceToscaModel should have vf modules and vol groups populated
+		// at this point but
+		// they are not associated with the VNFs
+		ServiceModel.extractGroups(asdcServiceToscaModel,serviceModel);
+		// Now put the vf modules and volume groups under the VNF they belong
+		// too
+		serviceModel.associateGroups();
+		return (serviceModel);
+	}
+
+
+	private UUID extractUUIDFromNodeTemplate(final NodeTemplate nodeTemplate) {
+		return UUID.fromString(nodeTemplate.getMetadata().getUUID());
+	}
+
+
+}
\ No newline at end of file
diff --git a/vid-app-common/src/main/java/org/onap/vid/asdc/parser/ToscaParserImpl2.java b/vid-app-common/src/main/java/org/onap/vid/asdc/parser/ToscaParserImpl2.java
new file mode 100644
index 0000000..4a5ab3a
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/asdc/parser/ToscaParserImpl2.java
@@ -0,0 +1,354 @@
+package org.onap.vid.asdc.parser;
+
+import org.onap.vid.asdc.beans.Service;
+import org.onap.vid.model.*;
+import org.openecomp.sdc.tosca.parser.api.ISdcCsarHelper;
+import org.openecomp.sdc.tosca.parser.exceptions.SdcToscaParserException;
+import org.openecomp.sdc.tosca.parser.impl.FilterType;
+import org.openecomp.sdc.tosca.parser.impl.SdcToscaParserFactory;
+import org.openecomp.sdc.tosca.parser.impl.SdcTypes;
+import org.openecomp.sdc.toscaparser.api.*;
+import org.openecomp.sdc.toscaparser.api.parameters.Input;
+
+import java.nio.file.Path;
+import java.util.*;
+import java.util.stream.Collectors;
+
+import static java.util.stream.Collectors.toMap;
+
+public class ToscaParserImpl2 {
+
+    
+	public class Constants {
+		public final static String uuid = "UUID";
+		public final static String description = "description";
+		public final static String serviceType = "serviceType";
+        public final static String serviceRole = "serviceRole";
+        public final static String ecompGeneratedNaming = "ecompGeneratedNaming";
+
+        public final static String customizationUUID = "customizationUUID";
+		public final static String vfModuleModelVersion = "vfModuleModelVersion";
+		public final static String vfModuleModelCustomizationUUID = "vfModuleModelCustomizationUUID";
+		public final static String volume_group = "volume_group";
+		public final static String vfModuleModelInvariantUUID = "vfModuleModelInvariantUUID";
+		public final static String vfModuleModelUUID = "vfModuleModelUUID";
+		public final static String invariantUUID = "invariantUUID";
+		public final static String version = "version";
+		public final static String name = "name";
+		public final static String category = "category";
+		public final static String vfModuleModelName = "vfModuleModelName";
+		public final static String getInput = "get_input";
+
+		public final static String instantiationType = "instantiationType";
+        //Instantiation Types
+        public final static String both = "Both";
+        public final static String macro = "Macro";
+        public final static String aLaCarte = "A-La-Carte";
+        public final static String clientConfig = "ClientConfig";
+
+
+	}
+	
+	public ToscaParserImpl2() {
+
+    }
+
+    public ServiceModel  makeServiceModel(Path path, Service asdcServiceMetadata) throws Exception {
+        ServiceModel serviceModel = new ServiceModel();
+        SdcToscaParserFactory factory = SdcToscaParserFactory.getInstance();
+        ISdcCsarHelper sdcCsarHelper = factory.getSdcCsarHelper(path.toFile().getAbsolutePath(),false);
+        serviceModel.setService(extractServiceFromCsar(asdcServiceMetadata, sdcCsarHelper));
+
+        serviceModel.setVolumeGroups(extractVolumeGroups(sdcCsarHelper));
+        serviceModel.setVfModules(extractVfModuleFromCsar(sdcCsarHelper));
+        serviceModel.setVnfs(extractVnfsFromCsar(serviceModel,sdcCsarHelper));
+        serviceModel.setConfigurations(extractPortMirroringConfigFromCsar(sdcCsarHelper));
+        serviceModel.setServiceProxies(extractServiceProxyFromCsar(sdcCsarHelper));
+        serviceModel.setNetworks(extractNetworksFromCsar(sdcCsarHelper));
+        serviceModel.setPnfs(extractPnfsFromCsar(sdcCsarHelper));
+        return serviceModel;
+    }
+
+    private  org.onap.vid.model.Service extractServiceFromCsar(Service asdcServiceMetadata, ISdcCsarHelper csarHelper) throws SdcToscaParserException {
+        org.onap.vid.model.Service service = new  org.onap.vid.model.Service();
+
+        service.setName(csarHelper.getServiceMetadata().getValue(Constants.name));
+        service.setCategory(csarHelper.getServiceMetadata().getValue(Constants.category));
+        service.setInvariantUuid(csarHelper.getServiceMetadata().getValue(Constants.invariantUUID));
+        service.setUuid(csarHelper.getServiceMetadata().getValue(Constants.uuid));
+        service.setVersion(asdcServiceMetadata.getVersion());
+        service.setDescription(csarHelper.getServiceMetadata().getValue(Constants.description));
+        service.setInputs(inputsListToInputsMap(csarHelper.getServiceInputs()));
+        service.setServiceEcompNaming(csarHelper.getServiceMetadata().getValue(Constants.ecompGeneratedNaming));
+        service.setServiceType(csarHelper.getServiceMetadata().getValue(Constants.serviceType));
+        service.setServiceRole(csarHelper.getServiceMetadata().getValue(Constants.serviceRole));
+        service.setInstantiationType(validateInstantiationType(csarHelper));
+        return service;
+    }
+
+    
+    private Map<String, VNF> extractVnfsFromCsar(ServiceModel serviceModel,ISdcCsarHelper csarHelper) {
+        List<NodeTemplate> nodeTemplates = csarHelper.getServiceVfList();
+        Map<String, VNF> vnfsMaps = new HashMap<String, VNF>();
+
+        for (NodeTemplate nodeTemplate : nodeTemplates) {
+            VNF vnf = new VNF();
+            populateNodeFromNodeTemplate(nodeTemplate, csarHelper, vnf);
+
+            vnf.setModelCustomizationName(nodeTemplate.getName());
+            Map<String, VfModule> vfModuleHashMap = getVfModulesFromVF(csarHelper, vnf.getCustomizationUuid());
+            vnf.setVfModules(vfModuleHashMap);
+
+            Map<String, VolumeGroup> volumeGroupMap = getVolumeGroupsFromVF(csarHelper, vnf.getCustomizationUuid());
+            vnf.setVolumeGroups(volumeGroupMap);
+
+            vnfsMaps.put(nodeTemplate.getName(), vnf);
+        }
+        return vnfsMaps;
+    }
+
+    private Map<String, PortMirroringConfig> extractPortMirroringConfigFromCsar(ISdcCsarHelper csarHelper) {
+        List<NodeTemplate> nodeTemplates = csarHelper.getServiceNodeTemplateBySdcType(SdcTypes.CONFIGURATION);
+        Map<String, PortMirroringConfig> configMaps = new HashMap<>();
+
+        for (NodeTemplate nodeTemplate : nodeTemplates) {
+            PortMirroringConfig pmConfig = new PortMirroringConfig();
+            populateNodeFromNodeTemplate(nodeTemplate, csarHelper, pmConfig);
+
+            pmConfig.setModelCustomizationName(nodeTemplate.getName());
+            pmConfig.setRequirementAssignments(nodeTemplate.getRequirements());
+            setSourceAndCollectorProxyNodes(csarHelper, pmConfig, nodeTemplate);
+
+            configMaps.put(nodeTemplate.getName(), pmConfig);
+        }
+
+        return configMaps;
+	}
+
+    private Map<String, ServiceProxy> extractServiceProxyFromCsar(ISdcCsarHelper csarHelper) {
+        List<NodeTemplate> nodeTemplates = csarHelper.getServiceNodeTemplateBySdcType(SdcTypes.SERVICE_PROXY);
+        Map<String, ServiceProxy> serviceProxies = new HashMap<>();
+        for (NodeTemplate nodeTemplate: nodeTemplates) {
+            ServiceProxy serviceProxy = new ServiceProxy();
+            populateNodeFromNodeTemplate(nodeTemplate, csarHelper, serviceProxy);
+
+            Map<String, String> metadata = nodeTemplate.getMetaData().getAllProperties();
+            serviceProxy.setSourceModelUuid(metadata.get("sourceModelUuid"));
+            serviceProxy.setSourceModelInvariant(metadata.get("sourceModelInvariant"));
+            serviceProxy.setSourceModelName(metadata.get("sourceModelName"));
+
+            serviceProxies.put(nodeTemplate.getName(), serviceProxy);
+        }
+
+        return serviceProxies;
+    }
+
+	private void setSourceAndCollectorProxyNodes(ISdcCsarHelper csarHelper, PortMirroringConfig portMirroringConfig, NodeTemplate nodeTemplate) {
+	    RequirementAssignments requirementAssignments = nodeTemplate.getRequirements();
+
+        List<String> sourceNodes = getRequirementsNodesNames(requirementAssignments.getRequirementsByName("source").getAll());
+        portMirroringConfig.setSourceNodes(sourceNodes);
+
+        List<String> collectorNodes = getRequirementsNodesNames(requirementAssignments.getRequirementsByName("collector").getAll());
+        if (!collectorNodes.isEmpty()) { // vprobe
+            portMirroringConfig.setCollectorNodes(collectorNodes);
+        } else { // pprobe - configuration by policy
+            String collectorNodeName = csarHelper.getNodeTemplatePropertyLeafValue(nodeTemplate, "collector_node");
+            if (collectorNodeName != null) {
+                portMirroringConfig.setCollectorNodes(Arrays.asList(collectorNodeName));
+                portMirroringConfig.setConfigurationByPolicy(true);
+            }
+        }
+    }
+
+    private List<String> getRequirementsNodesNames(List<RequirementAssignment> requirements) {
+
+        List<String> requirementsNodes = new ArrayList<>();
+        if (requirements != null && requirements.size() > 0) {
+            requirementsNodes =  requirements.stream().map(RequirementAssignment::getNodeTemplateName).collect(Collectors.toList());
+        }
+
+        return requirementsNodes;
+    }
+
+    Map<String, VfModule> getVfModulesFromVF(ISdcCsarHelper csarHelper, String vfUuid) {
+        List<Group> vfModulesByVf = csarHelper.getVfModulesByVf(vfUuid);
+        return vfModulesByVf.stream()
+                .collect(toMap(Group::getName, this::populateVfModuleFromGroup));
+    }
+
+    Map<String, VolumeGroup> getVolumeGroupsFromVF(ISdcCsarHelper csarHelper, String vfCustomizationUuid) {
+        List<Group> vfModulesByVf = csarHelper.getVfModulesByVf(vfCustomizationUuid);
+        return vfModulesByVf.stream()
+                .filter((group -> isVolumeGroup(group)))
+                .collect(toMap(Group::getName, this::populateVolumeGroupFromGroup));
+    }
+
+    private static Boolean isVolumeGroup(Group group) {
+        return Boolean.valueOf(group.getPropertyValue(Constants.volume_group).toString());
+    }
+
+    private Map<String, Network> extractNetworksFromCsar(ISdcCsarHelper csarHelper) {
+        List<NodeTemplate> nodeTemplates = csarHelper.getServiceVlList();
+        Map<String, Network> networksMap = new HashMap<String, Network>();
+
+        for (NodeTemplate nodeTemplate : nodeTemplates) {
+            Network newNetwork = new Network();
+            populateNodeFromNodeTemplate(nodeTemplate, csarHelper, newNetwork);
+            newNetwork.setModelCustomizationName(nodeTemplate.getName());
+            networksMap.put(nodeTemplate.getName(), newNetwork);
+        }
+        return networksMap;
+	}
+
+	private Map<String,Node> extractPnfsFromCsar(ISdcCsarHelper csarHelper) {
+        List<NodeTemplate> nodeTemplates = csarHelper.getServiceNodeTemplateBySdcType(SdcTypes.PNF);
+        HashMap<String, Node> pnfHashMap = new HashMap<>();
+
+        for (NodeTemplate nodeTemplate : nodeTemplates) {
+            Node pnf = new Node();
+            populateNodeFromNodeTemplate(nodeTemplate, csarHelper, pnf);
+            pnfHashMap.put(nodeTemplate.getName(), pnf);
+        }
+        return pnfHashMap;
+    }
+
+    private Map<String, VfModule> extractVfModuleFromCsar(ISdcCsarHelper csarHelper) {
+        List<NodeTemplate> serviceVfList = csarHelper.getServiceVfList();
+        HashMap<String, VfModule> vfModuleHashMap = new HashMap<>();
+
+        for (NodeTemplate nodeTemplate : serviceVfList) {
+            Map<String, VfModule> nodeTemplateVfModule =
+                    getVfModulesFromVF(csarHelper, nodeTemplate.getMetaData().getValue(Constants.customizationUUID));
+            vfModuleHashMap.putAll(nodeTemplateVfModule);
+        }
+        return vfModuleHashMap;
+    }
+
+    private Map<String, VolumeGroup> extractVolumeGroups(ISdcCsarHelper csarHelper) {
+        HashMap<String, VolumeGroup> volumeGroupHashMap = new HashMap<>();
+        for (NodeTemplate nodeTemplate : csarHelper.getServiceVfList()) {
+            Map<String, VolumeGroup> nodeTemplateVolumeGroups =
+                    getVolumeGroupsFromVF(csarHelper, csarHelper.getNodeTemplateCustomizationUuid(nodeTemplate));
+            volumeGroupHashMap.putAll(nodeTemplateVolumeGroups);
+        }
+        return volumeGroupHashMap;
+    }
+
+    private Map<String, org.onap.vid.asdc.beans.tosca.Input> inputsListToInputsMap(List<org.openecomp.sdc.toscaparser.api.parameters.Input> inputList) {
+        Map<String, org.onap.vid.asdc.beans.tosca.Input> inputs = new HashMap<>();
+        for (org.openecomp.sdc.toscaparser.api.parameters.Input input : inputList) {
+            inputs.put(input.getName(), convertInput(input, new org.onap.vid.asdc.beans.tosca.Input()));
+        }
+        return inputs;
+    }
+
+    private Node populateNodeFromNodeTemplate(NodeTemplate nodeTemplate, ISdcCsarHelper csarHelper, Node newNode) {
+        newNode.setCustomizationUuid(csarHelper.getNodeTemplateCustomizationUuid(nodeTemplate));
+        newNode.setDescription(nodeTemplate.getMetaData().getValue(Constants.description));
+        newNode.setInvariantUuid(nodeTemplate.getMetaData().getValue(Constants.invariantUUID));
+        newNode.setUuid(nodeTemplate.getMetaData().getValue(Constants.uuid));
+        newNode.setName(nodeTemplate.getMetaData().getValue(Constants.name));
+        newNode.setVersion(nodeTemplate.getMetaData().getValue(Constants.version));
+        newNode.setInputs(extractInputsAndCommandsForNodeTemplate(nodeTemplate, csarHelper, newNode));
+        newNode.setType(nodeTemplate.getMetaData().getValue("type"));
+        Map<String, String> propertiesMap = setPropertiesOfVnf(nodeTemplate.getPropertiesObjects());
+        newNode.setProperties(propertiesMap);
+        return newNode;
+    }
+
+    private VfModule populateVfModuleFromGroup(Group group){
+        VfModule vfModule = new VfModule();
+
+        vfModule.setVersion(group.getMetadata().getValue(Constants.vfModuleModelVersion));
+        vfModule.setCustomizationUuid(group.getMetadata().getValue(Constants.vfModuleModelCustomizationUUID));
+        vfModule.setModelCustomizationName(group.getMetadata().getValue(Constants.vfModuleModelName));
+        vfModule.setName(group.getMetadata().getValue(Constants.vfModuleModelName));
+        vfModule.setVolumeGroupAllowed(isVolumeGroup(group));
+        vfModule.setDescription(group.getDescription());
+        vfModule.setInvariantUuid(group.getMetadata().getValue(Constants.vfModuleModelInvariantUUID));
+        vfModule.setUuid(group.getMetadata().getValue(Constants.vfModuleModelUUID));
+        return vfModule;
+    }
+
+    private VolumeGroup populateVolumeGroupFromGroup(Group group){
+        VolumeGroup volumeGroup = new VolumeGroup();
+        volumeGroup.setDescription(group.getDescription());
+        volumeGroup.setInvariantUuid(group.getMetadata().getValue(Constants.vfModuleModelInvariantUUID));
+        volumeGroup.setName(group.getMetadata().getValue(Constants.vfModuleModelName));
+        volumeGroup.setModelCustomizationName(group.getMetadata().getValue(Constants.vfModuleModelName));
+        volumeGroup.setVersion(group.getMetadata().getValue(Constants.vfModuleModelVersion));
+        volumeGroup.setUuid(group.getMetadata().getValue(Constants.vfModuleModelUUID));
+        volumeGroup.setCustomizationUuid(group.getMetadata().getValue(Constants.vfModuleModelCustomizationUUID));
+
+        return volumeGroup;
+    }
+
+
+    private Map<String, org.onap.vid.asdc.beans.tosca.Input> extractInputsAndCommandsForNodeTemplate(NodeTemplate nodeTemplate, ISdcCsarHelper csarHelper, Node newNode){
+        Map<String, org.onap.vid.asdc.beans.tosca.Input> inputMap = new HashMap<>();
+        Map<String, CommandProperty> commandPropertyMap = new HashMap<>();
+
+        List<Input> inputs = csarHelper.getServiceInputs();
+        Map<String, String> properties  = csarHelper.filterNodeTemplatePropertiesByValue(nodeTemplate, FilterType.CONTAINS, Constants.getInput);
+        for (Map.Entry<String, String> property : properties.entrySet()) {
+            String inputKey = property.getValue();
+            String key = extractInputValue(inputKey);
+            for (Input input: inputs){
+                if(input.getName().equals(key)){
+                    org.onap.vid.asdc.beans.tosca.Input localInput = new org.onap.vid.asdc.beans.tosca.Input();
+                    localInput = convertInput(input, localInput);
+                    String name = property.getKey();
+                    commandPropertyMap.put(name, extractCommands(name, key));
+                    inputMap.put(name, localInput);
+                }
+            }
+        }
+        newNode.setCommands(commandPropertyMap);
+        return inputMap;
+    }
+
+    private String extractInputValue(String inputKey) {
+        return inputKey.substring(inputKey.indexOf(":") + 1);
+    }
+
+    private org.onap.vid.asdc.beans.tosca.Input convertInput(Input parserInput, org.onap.vid.asdc.beans.tosca.Input localInput){
+        localInput.setDefault(parserInput.getDefault());
+        localInput.setDescription(parserInput.getDescription());
+        localInput.setRequired(parserInput.isRequired());
+        localInput.setType(parserInput.getType());
+        localInput.setConstraints(parserInput.getConstraints());
+//        localInput.setentry_schema()
+        return localInput;
+    }
+
+    private CommandProperty extractCommands(String displayName, String inputName){
+        CommandProperty commandProperty = new CommandProperty();
+        commandProperty.setDisplayName(displayName);
+        commandProperty.setCommand(Constants.getInput);
+        commandProperty.setInputName(inputName);
+        return commandProperty;
+    }
+
+    private Map<String, String> setPropertiesOfVnf(List<Property> properties) {
+        Map<String, String> propertiesMap = new HashMap<String, String>();
+        for (Property property : properties) {
+            propertiesMap.put(property.getName(), property.getValue().toString());
+        }
+        return propertiesMap;
+    }
+
+    private String validateInstantiationType(ISdcCsarHelper csarHelper){
+        String instantiationType = csarHelper.getServiceMetadata().getValue(Constants.instantiationType);
+        String validatedInstantiationType = Constants.clientConfig;
+        if(instantiationType != null && !instantiationType.isEmpty()){
+            if(instantiationType.equalsIgnoreCase(Constants.macro) || instantiationType.equalsIgnoreCase(Constants.both))
+                validatedInstantiationType = Constants.macro;
+            else if(instantiationType.equalsIgnoreCase(Constants.aLaCarte))
+                validatedInstantiationType = Constants.aLaCarte;
+        }
+        return validatedInstantiationType;
+    }
+
+
+}
\ No newline at end of file
diff --git a/vid-app-common/src/main/java/org/onap/vid/asdc/rest/RestfulAsdcClient.java b/vid-app-common/src/main/java/org/onap/vid/asdc/rest/RestfulAsdcClient.java
new file mode 100644
index 0000000..a8dc287
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/asdc/rest/RestfulAsdcClient.java
@@ -0,0 +1,480 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * VID
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.vid.asdc.rest;
+
+import com.fasterxml.jackson.jaxrs.json.JacksonJsonProvider;
+import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
+import org.onap.vid.asdc.AsdcCatalogException;
+import org.onap.vid.asdc.AsdcClient;
+import org.onap.vid.asdc.beans.Artifact;
+import org.onap.vid.asdc.beans.Resource;
+import org.onap.vid.asdc.beans.Service;
+import org.onap.vid.asdc.parser.ToscaParserImpl;
+import org.onap.vid.model.ModelConstants;
+import org.onap.vid.properties.VidProperties;
+
+import javax.ws.rs.NotFoundException;
+import javax.ws.rs.ProcessingException;
+import javax.ws.rs.WebApplicationException;
+import javax.ws.rs.client.Client;
+import javax.ws.rs.client.ResponseProcessingException;
+import javax.ws.rs.client.WebTarget;
+import javax.ws.rs.core.GenericType;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.MultivaluedHashMap;
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.URI;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.StandardCopyOption;
+import java.text.DateFormat;
+import java.text.SimpleDateFormat;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Map;
+import java.util.Map.Entry;
+import java.util.UUID;
+
+import static org.onap.vid.utils.Logging.getHttpServletRequest;
+import static org.onap.vid.utils.Logging.requestIdHeaderKey;
+/**
+ * The Class RestfulAsdcClient.
+ */
+@SuppressWarnings("Duplicates")
+public class RestfulAsdcClient implements AsdcClient {
+
+
+    /**
+     * The Class Builder.
+     */
+    public static class Builder {
+
+        /**
+         * The client.
+         */
+        private final Client client;
+
+        /**
+         * The uri.
+         */
+        private final URI uri;
+
+        /**
+         * The auth.
+         */
+        private String auth = null;
+
+        /**
+         * Instantiates a new builder.
+         *
+         * @param client the client
+         * @param uri    the uri
+         */
+        public Builder(Client client, URI uri) {
+            this.client = client;
+            this.client.register(JacksonJsonProvider.class);
+            this.uri = uri;
+        }
+
+        /**
+         * Auth.
+         *
+         * @param auth the auth
+         * @return the builder
+         */
+        public Builder auth(String auth) {
+            this.auth = auth;
+            return this;
+        }
+
+        /**
+         * Builds the.
+         *
+         * @return the restful asdc client
+         */
+        public RestfulAsdcClient build() {
+            return new RestfulAsdcClient(this);
+        }
+    }
+
+    /**
+     * The Constant LOG.
+     */
+    static final EELFLoggerDelegate LOG = EELFLoggerDelegate.getLogger(RestfulAsdcClient.class);
+
+    /**
+     * The Constant dateFormat.
+     */
+    final static DateFormat dateFormat = new SimpleDateFormat("HH:mm:ss:SSSS");
+
+    /**
+     * The client.
+     */
+    private final Client client;
+
+    /**
+     * The uri.
+     */
+    private final URI uri;
+
+    /**
+     * The common headers.
+     */
+    private final MultivaluedHashMap<String, Object> commonHeaders;
+
+    /**
+     * The auth.
+     */
+    private final String auth;
+
+    ToscaParserImpl p = new ToscaParserImpl();
+
+    /**
+     * Instantiates a new restful asdc client.
+     *
+     * @param builder the builder
+     */
+    private RestfulAsdcClient(Builder builder) {
+        client = builder.client;
+        uri = builder.uri;
+        auth = builder.auth;
+
+        commonHeaders = new MultivaluedHashMap<String, Object>();
+        commonHeaders.put("Authorization", Collections.singletonList((Object) (auth)));
+    }
+
+    private Path createTmpFile(InputStream csarInputStream) throws AsdcCatalogException {
+        final Path csarFile;
+        try {
+            csarFile = Files.createTempFile("csar", ".zip");
+            Files.copy(csarInputStream, csarFile, StandardCopyOption.REPLACE_EXISTING);
+        } catch (IOException e) {
+            throw new AsdcCatalogException("Caught IOException while creating CSAR", e);
+        }
+        return csarFile;
+    }
+
+    /**
+     * Gets the client.
+     *
+     * @return the client
+     */
+    private Client getClient() {
+        return client;
+    }
+
+    /* (non-Javadoc)
+     * @see org.onap.vid.asdc.AsdcClient#getResource(java.util.UUID)
+     */
+    public Resource getResource(UUID uuid) throws AsdcCatalogException {
+
+        String path = VidProperties.getPropertyWithDefault(ModelConstants.ASDC_RESOURCE_API_PATH, ModelConstants.DEFAULT_ASDC_RESOURCE_API_PATH);
+        try {
+            return getClient()
+                    .target(uri)
+                    .path(path + "/" + uuid.toString() + "/metadata")
+                    .request(MediaType.APPLICATION_JSON_TYPE)
+                    .headers(commonHeaders)
+                    .header("Content-Type", MediaType.APPLICATION_JSON)
+                    .header(requestIdHeaderKey, getHttpServletRequest().getHeader(requestIdHeaderKey))
+                    .get(Resource.class);
+        } catch (ResponseProcessingException e) {
+            //Couldn't convert response to Java type
+            throw new AsdcCatalogException("ASDC response could not be processed", e);
+        } catch (ProcessingException e) {
+            //IO problems during request
+            throw new AsdcCatalogException("Failed to get a response from ASDC service", e);
+        } catch (WebApplicationException e) {
+            //Web service returned data, but the response status wasn't a good one (i.e. non 2xx)
+            throw new AsdcCatalogException(e);
+        }
+    }
+
+    /* (non-Javadoc)
+     * @see org.onap.vid.asdc.AsdcClient#getResourceArtifact(java.util.UUID, java.util.UUID)
+     */
+    public Artifact getResourceArtifact(UUID resourceUuid, UUID artifactUuid) throws AsdcCatalogException {
+        String path = VidProperties.getPropertyWithDefault(ModelConstants.ASDC_RESOURCE_API_PATH, ModelConstants.DEFAULT_ASDC_RESOURCE_API_PATH);
+        try {
+            return getClient()
+                    .target(uri)
+                    .path(path + "/" + resourceUuid + "/artifacts/" + artifactUuid)
+                    .request(MediaType.APPLICATION_JSON_TYPE)
+                    .headers(commonHeaders)
+                    .header("Content-Type", MediaType.APPLICATION_JSON)
+                    .header(requestIdHeaderKey, getHttpServletRequest().getHeader(requestIdHeaderKey))
+                    .get(Artifact.class);
+        } catch (ResponseProcessingException e) {
+            //Couldn't convert response to Java type
+            throw new AsdcCatalogException("ASDC response could not be processed", e);
+        } catch (ProcessingException e) {
+            //IO problems during request
+            throw new AsdcCatalogException("Failed to get a response from ASDC service", e);
+        } catch (WebApplicationException e) {
+            //Web service returned data, but the response status wasn't a good one (i.e. non 2xx)
+            throw new AsdcCatalogException(e);
+        }
+    }
+
+    /* (non-Javadoc)
+     * @see org.onap.vid.asdc.AsdcClient#getResources()
+     */
+    public Collection<Resource> getResources() throws AsdcCatalogException {
+        String path = VidProperties.getPropertyWithDefault(ModelConstants.ASDC_RESOURCE_API_PATH, ModelConstants.DEFAULT_ASDC_RESOURCE_API_PATH);
+        try {
+            return getClient()
+                    .target(uri)
+                    .path(path)
+                    .request(MediaType.APPLICATION_JSON_TYPE)
+                    .headers(commonHeaders)
+                    .header("Content-Type", MediaType.APPLICATION_JSON)
+                    .header(requestIdHeaderKey, getHttpServletRequest().getHeader(requestIdHeaderKey))
+                    .get(new GenericType<Collection<Resource>>() {
+                    });
+        } catch (ResponseProcessingException e) {
+            //Couldn't convert response to Java type
+            throw new AsdcCatalogException("ASDC response could not be processed", e);
+        } catch (ProcessingException e) {
+            //IO problems during request
+            throw new AsdcCatalogException("Failed to get a response from ASDC service", e);
+        } catch (WebApplicationException e) {
+            //Web service returned data, but the response status wasn't a good one (i.e. non 2xx)
+            throw new AsdcCatalogException(e);
+        }
+    }
+
+    /* (non-Javadoc)
+     * @see org.onap.vid.asdc.AsdcClient#getResources(java.util.Map)
+     */
+    public Collection<Resource> getResources(Map<String, String[]> filter) throws AsdcCatalogException {
+        String path = VidProperties.getPropertyWithDefault(ModelConstants.ASDC_RESOURCE_API_PATH, ModelConstants.DEFAULT_ASDC_RESOURCE_API_PATH);
+        WebTarget target = getClient()
+                .target(uri)
+                .path(path);
+
+        for (Entry<String, String[]> filterEntry : filter.entrySet()) {
+            target = target.queryParam(filterEntry.getKey(), (Object[]) filterEntry.getValue());
+        }
+
+        try {
+            return target.request()
+                    .accept(MediaType.APPLICATION_JSON_TYPE)
+                    .headers(commonHeaders)
+                    .header("Content-Type", MediaType.APPLICATION_JSON)
+                    .header(requestIdHeaderKey, getHttpServletRequest().getHeader(requestIdHeaderKey))
+                    .get(new GenericType<Collection<Resource>>() {
+                    });
+        } catch (ResponseProcessingException e) {
+            //Couldn't convert response to Java type
+            throw new AsdcCatalogException("ASDC response could not be processed", e);
+        } catch (ProcessingException e) {
+            //IO problems during request
+            throw new AsdcCatalogException("Failed to get a response from ASDC service", e);
+        } catch (NotFoundException e) {
+            throw e;
+        } catch (WebApplicationException e) {
+            //Web service returned data, but the response status wasn't a good one (i.e. non 2xx)
+            throw new AsdcCatalogException(e);
+        }
+    }
+
+    /* (non-Javadoc)
+     * @see org.onap.vid.asdc.AsdcClient#getResourceToscaModel(java.util.UUID)
+     */
+    public Path getResourceToscaModel(UUID resourceUuid) throws AsdcCatalogException {
+        String path = VidProperties.getPropertyWithDefault(ModelConstants.ASDC_RESOURCE_API_PATH, ModelConstants.DEFAULT_ASDC_RESOURCE_API_PATH);
+        try (final InputStream csarInputStream = (InputStream) getClient()
+                .target(uri)
+                .path(path + "/" + resourceUuid + "/toscaModel")
+                .request(MediaType.APPLICATION_OCTET_STREAM_TYPE)
+                .headers(commonHeaders)
+                .header("Content-Type", MediaType.APPLICATION_OCTET_STREAM)
+                .header(requestIdHeaderKey, getHttpServletRequest().getHeader(requestIdHeaderKey))
+                .get(InputStream.class)) {
+
+            return getToscaCsar(csarInputStream);
+        } catch (IOException e) {
+            throw new AsdcCatalogException("Failed to retrieve resource TOSCA model from ASDC", e);
+        }
+    }
+
+    /* (non-Javadoc)
+     * @see org.onap.vid.asdc.AsdcClient#getService(java.util.UUID)
+     */
+    public Service getService(UUID uuid) throws AsdcCatalogException {
+
+        String path = VidProperties.getPropertyWithDefault(ModelConstants.ASDC_SVC_API_PATH, ModelConstants.DEFAULT_ASDC_SVC_API_PATH);
+        try {
+            return getClient()
+                    .target(uri)
+                    .path(path + "/" + uuid.toString() + "/metadata")
+                    .request(MediaType.APPLICATION_JSON)
+                    .headers(commonHeaders)
+                    .header(requestIdHeaderKey, getHttpServletRequest().getHeader(requestIdHeaderKey))
+                    .get(Service.class);
+        } catch (ResponseProcessingException e) {
+            //Couldn't convert response to Java type
+            throw new AsdcCatalogException("ASDC response could not be processed", e);
+        } catch (ProcessingException e) {
+            //IO problems during request
+            throw new AsdcCatalogException("Failed to get a response from ASDC service", e);
+        } catch (WebApplicationException e) {
+            //Web service returned data, but the response status wasn't a good one (i.e. non 2xx)
+            throw new AsdcCatalogException(e);
+        }
+    }
+
+    /* (non-Javadoc)
+     * @see org.onap.vid.asdc.AsdcClient#getServiceArtifact(java.util.UUID, java.util.UUID)
+     */
+    public Artifact getServiceArtifact(UUID serviceUuid, UUID artifactUuid) throws AsdcCatalogException {
+        String path = VidProperties.getPropertyWithDefault(ModelConstants.ASDC_SVC_API_PATH, ModelConstants.DEFAULT_ASDC_SVC_API_PATH);
+
+        try {
+            return getClient()
+                    .target(uri)
+                    .path(path + "/" + serviceUuid + "/artifacts/" + artifactUuid)
+                    .request(MediaType.APPLICATION_JSON_TYPE)
+                    .headers(commonHeaders)
+                    .header("Content-Type", MediaType.APPLICATION_JSON)
+                    .header(requestIdHeaderKey, getHttpServletRequest().getHeader(requestIdHeaderKey))
+                    .get(Artifact.class);
+        } catch (ResponseProcessingException e) {
+            //Couldn't convert response to Java type
+            throw new AsdcCatalogException("ASDC response could not be processed", e);
+        } catch (ProcessingException e) {
+            //IO problems during request
+            throw new AsdcCatalogException("Failed to get a response from ASDC service", e);
+        } catch (WebApplicationException e) {
+            //Web service returned data, but the response status wasn't a good one (i.e. non 2xx)
+            throw new AsdcCatalogException(e);
+        }
+    }
+
+    /* (non-Javadoc)
+     * @see org.onap.vid.asdc.AsdcClient#getServices()
+     */
+    public Collection<Service> getServices() throws AsdcCatalogException {
+        String path = VidProperties.getPropertyWithDefault(ModelConstants.ASDC_SVC_API_PATH, ModelConstants.DEFAULT_ASDC_SVC_API_PATH);
+        try {
+            return getClient()
+                    .target(uri)
+                    .path(path)
+                    .request()
+                    .accept(MediaType.APPLICATION_JSON_TYPE)
+                    .headers(commonHeaders)
+                    .header("Content-Type", MediaType.APPLICATION_JSON)
+                    .header(requestIdHeaderKey, getHttpServletRequest().getHeader(requestIdHeaderKey))
+                    .get(new GenericType<Collection<Service>>() {
+                    });
+        } catch (ResponseProcessingException e) {
+            //Couldn't convert response to Java type
+            throw new AsdcCatalogException("ASDC response could not be processed", e);
+        } catch (ProcessingException e) {
+            //IO problems during request
+            throw new AsdcCatalogException("Failed to get a response from ASDC service", e);
+        } catch (WebApplicationException e) {
+            //Web service returned data, but the response status wasn't a good one (i.e. non 2xx)
+            throw new AsdcCatalogException(e);
+        }
+    }
+
+    /* (non-Javadoc)
+     * @see org.onap.vid.asdc.AsdcClient#getServices(java.util.Map)
+     */
+    public Collection<Service> getServices(Map<String, String[]> filter) throws AsdcCatalogException {
+
+        String path = VidProperties.getPropertyWithDefault(ModelConstants.ASDC_SVC_API_PATH, ModelConstants.DEFAULT_ASDC_SVC_API_PATH);
+        WebTarget target = getClient()
+                .target(uri)
+                .path(path);
+
+
+        for (Entry<String, String[]> filterEntry : filter.entrySet()) {
+            target = target.queryParam(filterEntry.getKey(), (Object[]) filterEntry.getValue());
+        }
+
+        try {
+            return target.request()
+                    .accept(MediaType.APPLICATION_JSON_TYPE)
+                    .headers(commonHeaders)
+                    .header("Content-Type", MediaType.APPLICATION_JSON)
+                    .header(requestIdHeaderKey, getHttpServletRequest().getHeader(requestIdHeaderKey))
+                    .get(new GenericType<Collection<Service>>() {
+                    });
+        } catch (ResponseProcessingException e) {
+            //Couldn't convert response to Java type
+            throw new AsdcCatalogException("ASDC response could not be processed", e);
+        } catch (ProcessingException e) {
+            //IO problems during request
+            throw new AsdcCatalogException("Failed to get a response from ASDC service", e);
+        } catch (NotFoundException e) {
+            throw e;
+        } catch (WebApplicationException e) {
+            //Web service returned data, but the response status wasn't a good one (i.e. non 2xx)
+            throw new AsdcCatalogException(e);
+        }
+    }
+
+
+    /* (non-Javadoc)
+     * @see org.onap.vid.asdc.AsdcClient#getServiceToscaModel(java.util.UUID)
+     */
+    public Path getServiceToscaModel(UUID serviceUuid) throws AsdcCatalogException {
+        String path = VidProperties.getPropertyWithDefault(ModelConstants.ASDC_SVC_API_PATH, ModelConstants.DEFAULT_ASDC_SVC_API_PATH);
+        try {
+            final InputStream csarInputStream = (InputStream) getClient()
+                    .target(uri)
+                    .path(path + "/" + serviceUuid + "/toscaModel")
+                    .request(MediaType.APPLICATION_OCTET_STREAM_TYPE)
+                    .headers(commonHeaders)
+                    .header("Content-Type", MediaType.APPLICATION_OCTET_STREAM)
+                    .header(requestIdHeaderKey, getHttpServletRequest().getHeader(requestIdHeaderKey))
+                    .get(InputStream.class);
+
+
+            return getToscaCsar(csarInputStream);
+        } catch (ResponseProcessingException e) {
+            //Couldn't convert response to Java type
+            throw new AsdcCatalogException("ASDC response could not be processed", e);
+        } catch (ProcessingException e) {
+            //IO problems during request
+            throw new AsdcCatalogException("Failed to get a response from ASDC service", e);
+        } catch (WebApplicationException e) {
+            //Web service returned data, but the response status wasn't a good one (i.e. non 2xx)
+            throw new AsdcCatalogException(e);
+        }
+    }
+
+
+    /**
+     * Gets the tosca model.
+     *
+     * @param csarInputStream the csar input stream
+     * @return the tosca model
+     * @throws AsdcCatalogException the asdc catalog exception
+     */
+    private Path getToscaCsar(InputStream csarInputStream) throws AsdcCatalogException {
+        return createTmpFile(csarInputStream);
+    }
+}
+
diff --git a/vid-app-common/src/main/java/org/onap/vid/category/AddCategoryOptionResponse.java b/vid-app-common/src/main/java/org/onap/vid/category/AddCategoryOptionResponse.java
new file mode 100644
index 0000000..89d3963
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/category/AddCategoryOptionResponse.java
@@ -0,0 +1,15 @@
+package org.onap.vid.category;
+
+import org.onap.vid.model.ListOfErrorsResponse;
+
+import java.util.List;
+
+public class AddCategoryOptionResponse extends ListOfErrorsResponse {
+
+    public AddCategoryOptionResponse() {
+    }
+
+    public AddCategoryOptionResponse(List<String> errors) {
+        super(errors);
+    }
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/category/AddCategoryOptionsRequest.java b/vid-app-common/src/main/java/org/onap/vid/category/AddCategoryOptionsRequest.java
new file mode 100644
index 0000000..5db4746
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/category/AddCategoryOptionsRequest.java
@@ -0,0 +1,13 @@
+package org.onap.vid.category;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class AddCategoryOptionsRequest {
+
+	public List<String> options;
+
+	public AddCategoryOptionsRequest() {
+		options = new ArrayList<>();
+	}
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/category/CategoryParameterOptionRep.java b/vid-app-common/src/main/java/org/onap/vid/category/CategoryParameterOptionRep.java
new file mode 100644
index 0000000..355e548
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/category/CategoryParameterOptionRep.java
@@ -0,0 +1,31 @@
+package org.onap.vid.category;
+
+public class CategoryParameterOptionRep {
+
+    private String id;
+    private String name;
+
+    public CategoryParameterOptionRep() {
+    }
+
+    public CategoryParameterOptionRep(String id, String name) {
+        this.id = id;
+        this.name = name;
+    }
+
+    public String getId() {
+        return id;
+    }
+
+    public void setId(String id) {
+        this.id = id;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/category/CategoryParametersResponse.java b/vid-app-common/src/main/java/org/onap/vid/category/CategoryParametersResponse.java
new file mode 100644
index 0000000..be78866
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/category/CategoryParametersResponse.java
@@ -0,0 +1,27 @@
+package org.onap.vid.category;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+import java.util.List;
+import java.util.Map;
+
+public class CategoryParametersResponse {
+
+	private Map<String, List<CategoryParameterOptionRep>> categoryParameters;
+
+	public CategoryParametersResponse() {
+	}
+
+	public CategoryParametersResponse(Map<String, List<CategoryParameterOptionRep>> categoryParameters) {
+		this.categoryParameters = categoryParameters;
+	}
+
+	@JsonProperty("categoryParameters")
+	public Map<String, List<CategoryParameterOptionRep>> getCategoryParameters() {
+		return categoryParameters;
+	}
+
+	public void setCategoryParameters(Map<String, List<CategoryParameterOptionRep>> categoryParameters) {
+		this.categoryParameters = categoryParameters;
+	}
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/changeManagement/ChangeManagementRequest.java b/vid-app-common/src/main/java/org/onap/vid/changeManagement/ChangeManagementRequest.java
new file mode 100644
index 0000000..ec375b6
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/changeManagement/ChangeManagementRequest.java
@@ -0,0 +1,73 @@
+package org.onap.vid.changeManagement;
+
+import java.util.List;
+import java.util.HashMap;
+import java.util.Map;
+import com.fasterxml.jackson.annotation.JsonAnyGetter;
+import com.fasterxml.jackson.annotation.JsonAnySetter;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonPropertyOrder;
+
+@JsonPropertyOrder({
+    "requestDetails",
+		"requestType"
+})
+
+public class ChangeManagementRequest {
+
+	public static class MsoChangeManagementRequest {
+		public final static String SOFTWARE_UPDATE = "inPlaceSoftwareUpdate";
+		public static final String REPLACE = "replace";
+		public final static String CONFIG_UPDATE = "applyUpdatedConfig";
+
+	}
+
+	public final static String VNF_IN_PLACE_SOFTWARE_UPDATE = "vnf in place software update";
+	public static final String UPDATE = "update";
+	public static final String REPLACE = "replace";
+	public final static String CONFIG_UPDATE = "vnf config update";
+
+	@JsonProperty("requestDetails")
+    private List<RequestDetails> requestDetails;
+
+	@JsonProperty("requestType")
+    private String requestType;
+
+	@JsonIgnore
+	private Map<String, Object> additionalProperties = new HashMap<String, Object>();
+    
+	@JsonProperty("requestDetails")
+	public List<RequestDetails> getRequestDetails() {
+		return requestDetails;
+	}
+
+	@JsonProperty("requestDetails")
+	public void setRequestDetails(List<RequestDetails> requestDetails) {
+		this.requestDetails = requestDetails;
+	}
+
+	@JsonProperty("requestType")
+	public String getRequestType() {
+		return requestType;
+	}
+
+	@JsonProperty("requestType")
+	public void setRequestType(String requestType) {
+		this.requestType = requestType;
+	}
+
+	@JsonAnyGetter
+	public Map<String, Object> getAdditionalProperties() {
+	return this.additionalProperties;
+	}
+
+
+	@JsonAnySetter
+	public void setAdditionalProperty(String name, Object value) {
+	this.additionalProperties.put(name, value);
+	}
+
+	
+	
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/changeManagement/ChangeManagementResponse.java b/vid-app-common/src/main/java/org/onap/vid/changeManagement/ChangeManagementResponse.java
new file mode 100644
index 0000000..05d6e04
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/changeManagement/ChangeManagementResponse.java
@@ -0,0 +1,19 @@
+package org.onap.vid.changeManagement;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class ChangeManagementResponse {
+	public List<CmResponse> cmResponses = null;
+
+
+
+	public ChangeManagementResponse(String vnfName) {
+		List<CmResponse> cmResponses = new ArrayList<>();
+		cmResponses.add(new CmResponse(vnfName));
+		this.cmResponses = cmResponses;
+	
+	}
+
+
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/changeManagement/CloudConfiguration.java b/vid-app-common/src/main/java/org/onap/vid/changeManagement/CloudConfiguration.java
new file mode 100644
index 0000000..43d6a6a
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/changeManagement/CloudConfiguration.java
@@ -0,0 +1,55 @@
+package org.onap.vid.changeManagement;
+
+import java.util.HashMap;
+import java.util.Map;
+import com.fasterxml.jackson.annotation.JsonAnyGetter;
+import com.fasterxml.jackson.annotation.JsonAnySetter;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonPropertyOrder;
+
+@JsonInclude(JsonInclude.Include.NON_NULL)
+@JsonPropertyOrder({
+"lcpCloudRegionId",
+"tenantId"
+})
+public class CloudConfiguration {
+	@JsonProperty("lcpCloudRegionId")
+	private String lcpCloudRegionId;
+	@JsonProperty("tenantId")
+	private String tenantId;
+	@JsonIgnore
+	private Map<String, Object> additionalProperties = new HashMap<String, Object>();
+
+	@JsonProperty("lcpCloudRegionId")
+	public String getLcpCloudRegionId() {
+	return lcpCloudRegionId;
+	}
+
+	@JsonProperty("lcpCloudRegionId")
+	public void setLcpCloudRegionId(String lcpCloudRegionId) {
+	this.lcpCloudRegionId = lcpCloudRegionId;
+	}
+
+	@JsonProperty("tenantId")
+	public String getTenantId() {
+	return tenantId;
+	}
+
+	@JsonProperty("tenantId")
+	public void setTenantId(String tenantId) {
+	this.tenantId = tenantId;
+	}
+
+	@JsonAnyGetter
+	public Map<String, Object> getAdditionalProperties() {
+	return this.additionalProperties;
+	}
+
+	@JsonAnySetter
+	public void setAdditionalProperty(String name, Object value) {
+	this.additionalProperties.put(name, value);
+	}
+
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/changeManagement/CmResponse.java b/vid-app-common/src/main/java/org/onap/vid/changeManagement/CmResponse.java
new file mode 100644
index 0000000..8aba012
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/changeManagement/CmResponse.java
@@ -0,0 +1,17 @@
+package org.onap.vid.changeManagement;
+
+public class CmResponse {
+	
+	public String orchestratorRequestId;
+	public String serviceInstanceId;
+	public String vnfInstanceId;
+	public String vnfName;
+	
+	public CmResponse(String vnfName){
+		this.orchestratorRequestId = "Request Id";
+		this.serviceInstanceId = "Service instance Id";
+		this.vnfInstanceId = "Vnf instance Id";
+		this.vnfName = vnfName;
+	}
+
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/changeManagement/GetVnfWorkflowRelationRequest.java b/vid-app-common/src/main/java/org/onap/vid/changeManagement/GetVnfWorkflowRelationRequest.java
new file mode 100644
index 0000000..0412204
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/changeManagement/GetVnfWorkflowRelationRequest.java
@@ -0,0 +1,28 @@
+package org.onap.vid.changeManagement;
+
+import java.util.List;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+public class GetVnfWorkflowRelationRequest {
+
+	public GetVnfWorkflowRelationRequest() {
+	}
+
+	public GetVnfWorkflowRelationRequest(List<VnfDetails> vnfsDetails) {
+		this.vnfsDetails = vnfsDetails;
+	}
+
+	@JsonProperty("vnfsDetails")
+	private List<VnfDetails>  vnfsDetails;
+	
+	@JsonProperty("vnfsDetails")
+	public List<VnfDetails> getVnfDetails() {
+		return vnfsDetails;
+	}
+	
+	@JsonProperty("vnfsDetails")
+	public void setVnfDetails(List<VnfDetails> vnfDetails) {
+		this.vnfsDetails = vnfDetails;
+	}
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/changeManagement/GetWorkflowsResponse.java b/vid-app-common/src/main/java/org/onap/vid/changeManagement/GetWorkflowsResponse.java
new file mode 100644
index 0000000..05295fb
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/changeManagement/GetWorkflowsResponse.java
@@ -0,0 +1,24 @@
+package org.onap.vid.changeManagement;
+
+import java.util.List;
+
+public class GetWorkflowsResponse {
+	private List<String> workflows;
+
+	public GetWorkflowsResponse() {
+	}
+
+	public GetWorkflowsResponse(List<String> workflows) {
+		this.workflows = workflows;
+	}
+
+	public List<String> getWorkflows() {
+		return workflows;
+	}
+
+	public void setWorkflows(List<String> workflows) {
+		this.workflows = workflows;
+	}
+	
+
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/changeManagement/LeanCloudConfiguration.java b/vid-app-common/src/main/java/org/onap/vid/changeManagement/LeanCloudConfiguration.java
new file mode 100644
index 0000000..6011c7e
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/changeManagement/LeanCloudConfiguration.java
@@ -0,0 +1,20 @@
+package org.onap.vid.changeManagement;
+
+/**
+ * Created by Oren on 9/5/17.
+ */
+public class LeanCloudConfiguration {
+
+    public LeanCloudConfiguration() {
+    }
+
+    public LeanCloudConfiguration(org.onap.vid.domain.mso.CloudConfiguration cloudConfiguration) {
+        this.tenantId = cloudConfiguration.getTenantId();
+        this.lcpCloudRegionId = cloudConfiguration.getLcpCloudRegionId();
+
+    }
+    public String lcpCloudRegionId;
+
+    public String tenantId;
+
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/changeManagement/ModelInfo.java b/vid-app-common/src/main/java/org/onap/vid/changeManagement/ModelInfo.java
new file mode 100644
index 0000000..8f44a4b
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/changeManagement/ModelInfo.java
@@ -0,0 +1,138 @@
+package org.onap.vid.changeManagement;
+import java.util.HashMap;
+import java.util.Map;
+import com.fasterxml.jackson.annotation.JsonAnyGetter;
+import com.fasterxml.jackson.annotation.JsonAnySetter;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonPropertyOrder;
+
+@JsonInclude(JsonInclude.Include.NON_NULL)
+@JsonPropertyOrder({
+"modelType",
+"modelInvariantId",
+"modelVersionId",
+"modelName",
+"modelVersion",
+"modelCustomizationName",
+"modelCustomizationId"
+})
+public class ModelInfo {
+
+	public ModelInfo(){
+
+	}
+
+	public ModelInfo(org.onap.vid.domain.mso.ModelInfo modelInfo){
+		this.setModelType(modelInfo.getModelType().toString());
+		this.setModelInvariantId(modelInfo.getModelInvariantId());
+		this.setModelVersionId(modelInfo.getModelNameVersionId());
+		this.setModelName(modelInfo.getModelName());
+		this.setModelVersion(modelInfo.getModelVersion());
+		this.setModelCustomizationId(modelInfo.getModelCustomizationId());
+		this.setModelVersionId(modelInfo.getModelVersionId());
+	}
+
+	
+	@JsonProperty("modelType")
+	private String modelType;
+	@JsonProperty("modelInvariantId")
+	private String modelInvariantId;
+	@JsonProperty("modelVersionId")
+	private String modelVersionId;
+	@JsonProperty("modelName")
+	private String modelName;
+	@JsonProperty("modelVersion")
+	private String modelVersion;
+	@JsonProperty("modelCustomizationName")
+	private String modelCustomizationName;
+	@JsonProperty("modelCustomizationId")
+	private String modelCustomizationId;
+	@JsonIgnore
+	private Map<String, Object> additionalProperties = new HashMap<String, Object>();
+
+	@JsonProperty("modelType")
+	public String getModelType() {
+	return modelType;
+	}
+
+	@JsonProperty("modelType")
+	public void setModelType(String modelType) {
+	this.modelType = modelType;
+	}
+
+	@JsonProperty("modelInvariantId")
+	public String getModelInvariantId() {
+	return modelInvariantId;
+	}
+
+	@JsonProperty("modelInvariantId")
+	public void setModelInvariantId(String modelInvariantId) {
+	this.modelInvariantId = modelInvariantId;
+	}
+
+	@JsonProperty("modelVersionId")
+	public String getModelVersionId() {
+	return modelVersionId;
+	}
+
+	@JsonProperty("modelVersionId")
+	public void setModelVersionId(String modelVersionId) {
+	this.modelVersionId = modelVersionId;
+	}
+
+	@JsonProperty("modelName")
+	public String getModelName() {
+	return modelName;
+	}
+
+	@JsonProperty("modelName")
+	public void setModelName(String modelName) {
+	this.modelName = modelName;
+	}
+
+	@JsonProperty("modelVersion")
+	public String getModelVersion() {
+	return modelVersion;
+	}
+
+	@JsonProperty("modelVersion")
+	public void setModelVersion(String modelVersion) {
+	this.modelVersion = modelVersion;
+	}
+
+	@JsonProperty("modelCustomizationName")
+	public String getModelCustomizationName() {
+	return modelCustomizationName;
+	}
+
+	@JsonProperty("modelCustomizationName")
+	public void setModelCustomizationName(String modelCustomizationName) {
+	this.modelCustomizationName = modelCustomizationName;
+	}
+
+	@JsonProperty("modelCustomizationId")
+	public String getModelCustomizationId() {
+	return modelCustomizationId;
+	}
+
+	@JsonProperty("modelCustomizationId")
+	public void setModelCustomizationId(String modelCustomizationId) {
+	this.modelCustomizationId = modelCustomizationId;
+	}
+
+	@JsonAnyGetter
+	public Map<String, Object> getAdditionalProperties() {
+	return this.additionalProperties;
+	}
+
+	@JsonAnySetter
+	public void setAdditionalProperty(String name, Object value) {
+	this.additionalProperties.put(name, value);
+	}
+
+
+
+
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/changeManagement/ModelInfoOfRelatedInstance.java b/vid-app-common/src/main/java/org/onap/vid/changeManagement/ModelInfoOfRelatedInstance.java
new file mode 100644
index 0000000..7e87609
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/changeManagement/ModelInfoOfRelatedInstance.java
@@ -0,0 +1,122 @@
+package org.onap.vid.changeManagement;
+
+import java.util.HashMap;
+import java.util.Map;
+import com.fasterxml.jackson.annotation.JsonAnyGetter;
+import com.fasterxml.jackson.annotation.JsonAnySetter;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonPropertyOrder;
+
+@JsonInclude(JsonInclude.Include.NON_NULL)
+@JsonPropertyOrder({
+"modelType",
+"modelInvariantId",
+"modelVersionId",
+"modelName",
+"modelVersion",
+"modelCustomizationName",
+"modelCustomizationId"
+})
+
+public class ModelInfoOfRelatedInstance {
+	
+	@JsonProperty("modelType")
+	private String modelType;
+	@JsonProperty("modelInvariantId")
+	private String modelInvariantId;
+	@JsonProperty("modelVersionId")
+	private String modelVersionId;
+	@JsonProperty("modelName")
+	private String modelName;
+	@JsonProperty("modelVersion")
+	private String modelVersion;
+	@JsonProperty("modelCustomizationName")
+	private String modelCustomizationName;
+	@JsonProperty("modelCustomizationId")
+	private String modelCustomizationId;
+	@JsonIgnore
+	private Map<String, Object> additionalProperties = new HashMap<String, Object>();
+
+	@JsonProperty("modelType")
+	public String getModelType() {
+	return modelType;
+	}
+
+	@JsonProperty("modelType")
+	public void setModelType(String modelType) {
+	this.modelType = modelType;
+	}
+
+	@JsonProperty("modelInvariantId")
+	public String getModelInvariantId() {
+	return modelInvariantId;
+	}
+
+	@JsonProperty("modelInvariantId")
+	public void setModelInvariantId(String modelInvariantId) {
+	this.modelInvariantId = modelInvariantId;
+	}
+
+	@JsonProperty("modelVersionId")
+	public String getModelVersionId() {
+	return modelVersionId;
+	}
+
+	@JsonProperty("modelVersionId")
+	public void setModelVersionId(String modelVersionId) {
+	this.modelVersionId = modelVersionId;
+	}
+
+	@JsonProperty("modelName")
+	public String getModelName() {
+	return modelName;
+	}
+
+	@JsonProperty("modelName")
+	public void setModelName(String modelName) {
+	this.modelName = modelName;
+	}
+
+	@JsonProperty("modelVersion")
+	public String getModelVersion() {
+	return modelVersion;
+	}
+
+	@JsonProperty("modelVersion")
+	public void setModelVersion(String modelVersion) {
+	this.modelVersion = modelVersion;
+	}
+
+	@JsonProperty("modelCustomizationName")
+	public String getModelCustomizationName() {
+	return modelCustomizationName;
+	}
+
+	@JsonProperty("modelCustomizationName")
+	public void setModelCustomizationName(String modelCustomizationName) {
+	this.modelCustomizationName = modelCustomizationName;
+	}
+
+	@JsonProperty("modelCustomizationId")
+	public String getModelCustomizationId() {
+	return modelCustomizationId;
+	}
+
+	@JsonProperty("modelCustomizationId")
+	public void setModelCustomizationId(String modelCustomizationId) {
+	this.modelCustomizationId = modelCustomizationId;
+	}
+
+	@JsonAnyGetter
+	public Map<String, Object> getAdditionalProperties() {
+	return this.additionalProperties;
+	}
+
+	@JsonAnySetter
+	public void setAdditionalProperty(String name, Object value) {
+	this.additionalProperties.put(name, value);
+	}
+
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/changeManagement/MsoRequestDetails.java b/vid-app-common/src/main/java/org/onap/vid/changeManagement/MsoRequestDetails.java
new file mode 100644
index 0000000..913fa07
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/changeManagement/MsoRequestDetails.java
@@ -0,0 +1,32 @@
+package org.onap.vid.changeManagement;
+
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * Created by Oren on 9/5/17.
+ */
+public class MsoRequestDetails {
+
+    public ModelInfo modelInfo;
+
+    public LeanCloudConfiguration cloudConfiguration;
+
+    public UpdateRequestInfo requestInfo;
+
+    public List<RelatedInstanceList> relatedInstanceList;
+
+    public Object requestParameters;
+
+    public MsoRequestDetails(RequestDetails r) {
+        this.modelInfo = new ModelInfo(r.getModelInfo());
+        this.cloudConfiguration = new LeanCloudConfiguration(r.getCloudConfiguration());
+        this.requestInfo = new UpdateRequestInfo(r.getRequestInfo());
+        this.relatedInstanceList = new ArrayList<>();
+        this.requestParameters = r.getRequestParameters();
+        relatedInstanceList = r.getRelatedInstList();
+
+
+    }
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/changeManagement/RelatedInstance.java b/vid-app-common/src/main/java/org/onap/vid/changeManagement/RelatedInstance.java
new file mode 100644
index 0000000..c29aee4
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/changeManagement/RelatedInstance.java
@@ -0,0 +1,29 @@
+package org.onap.vid.changeManagement;
+
+import com.fasterxml.jackson.annotation.*;
+
+@JsonInclude(JsonInclude.Include.NON_NULL)
+@JsonPropertyOrder({
+        "instanceId",
+        "modelInfo"
+})
+public class RelatedInstance {
+
+    @JsonProperty("instanceId")
+    public String instanceId;
+
+
+    @JsonProperty("modelInfo")
+    public ModelInfo modelInfo;
+
+    @JsonGetter
+    public String getInstanceId() {
+        return instanceId;
+    }
+
+    @JsonSetter
+    public void setInstanceId(String instanceId) {
+        this.instanceId = instanceId;
+    }
+
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/changeManagement/RelatedInstanceList.java b/vid-app-common/src/main/java/org/onap/vid/changeManagement/RelatedInstanceList.java
new file mode 100644
index 0000000..b3e67a0
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/changeManagement/RelatedInstanceList.java
@@ -0,0 +1,23 @@
+package org.onap.vid.changeManagement;
+
+import com.fasterxml.jackson.annotation.*;
+
+@JsonInclude(JsonInclude.Include.NON_NULL)
+@JsonPropertyOrder({
+        "relatedInstance"
+})
+public class RelatedInstanceList {
+
+    @JsonProperty("relatedInstance")
+    public RelatedInstance relatedInstance;
+
+    @JsonSetter
+    public RelatedInstance getRelatedInstance() {
+        return relatedInstance;
+    }
+
+    @JsonSetter
+    public void setRelatedInstance(RelatedInstance relatedInstance) {
+        this.relatedInstance = relatedInstance;
+    }
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/changeManagement/RequestDetails.java b/vid-app-common/src/main/java/org/onap/vid/changeManagement/RequestDetails.java
new file mode 100644
index 0000000..36452f6
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/changeManagement/RequestDetails.java
@@ -0,0 +1,56 @@
+package org.onap.vid.changeManagement;
+
+import com.fasterxml.jackson.annotation.*;
+
+import java.util.List;
+
+@JsonInclude(JsonInclude.Include.NON_NULL)
+@JsonPropertyOrder({
+"modelInfo",
+"cloudConfiguration",
+"requestInfo",
+"requestParameters",
+"vnfName",
+"vnfInstanceId"
+})
+public class RequestDetails extends org.onap.vid.mso.rest.RequestDetails{
+
+	@JsonProperty("vnfName")
+    private String vnfName;
+	@JsonProperty("vnfInstanceId")
+    private String vnfInstanceId;
+
+	/** The related model list. */
+	@JsonProperty("relatedInstanceList")
+	public List<RelatedInstanceList> relatedInstList;
+
+	@JsonProperty("vnfName")
+	public String getVnfName() {
+		return vnfName;
+	}
+
+	@JsonProperty("vnfName")
+	public void setVnfName(String vnfName) {
+		this.vnfName = vnfName;
+	}
+	@JsonProperty("vnfInstanceId")
+	public String getVnfInstanceId() {
+		return vnfInstanceId;
+	}
+
+	@JsonProperty("vnfInstanceId")
+	public void setVnfInstanceId(String vnfInstanceId) {
+		this.vnfInstanceId = vnfInstanceId;
+	}
+
+	@JsonGetter
+	public List<RelatedInstanceList> getRelatedInstList() {
+		return relatedInstList;
+	}
+
+	@JsonSetter
+	public void setRelatedInstList(List<RelatedInstanceList> relatedInstList) {
+		this.relatedInstList = relatedInstList;
+	}
+
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/changeManagement/RequestDetailsWrapper.java b/vid-app-common/src/main/java/org/onap/vid/changeManagement/RequestDetailsWrapper.java
new file mode 100644
index 0000000..92fb57c
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/changeManagement/RequestDetailsWrapper.java
@@ -0,0 +1,16 @@
+package org.onap.vid.changeManagement;
+
+/**
+ * Created by Oren on 9/5/17.
+ */
+public class RequestDetailsWrapper<T> {
+
+    public RequestDetailsWrapper(T requestDetails) {
+        this.requestDetails = requestDetails;
+    }
+
+    public RequestDetailsWrapper() {
+    }
+
+    public T requestDetails;
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/changeManagement/RequestInfo.java b/vid-app-common/src/main/java/org/onap/vid/changeManagement/RequestInfo.java
new file mode 100644
index 0000000..4aa3724
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/changeManagement/RequestInfo.java
@@ -0,0 +1,69 @@
+package org.onap.vid.changeManagement;
+
+import java.util.HashMap;
+import java.util.Map;
+import com.fasterxml.jackson.annotation.JsonAnyGetter;
+import com.fasterxml.jackson.annotation.JsonAnySetter;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonPropertyOrder;
+
+@JsonInclude(JsonInclude.Include.NON_NULL)
+@JsonPropertyOrder({
+"source",
+"suppressRollback",
+"requestorId"
+})
+public class RequestInfo {
+	@JsonProperty("source")
+	private String source;
+	@JsonProperty("suppressRollback")
+	private Boolean suppressRollback;
+	@JsonProperty("requestorId")
+	private String requestorId;
+	@JsonIgnore
+	private Map<String, Object> additionalProperties = new HashMap<String, Object>();
+
+	@JsonProperty("source")
+	public String getSource() {
+	return source;
+	}
+
+	@JsonProperty("source")
+	public void setSource(String source) {
+	this.source = source;
+	}
+
+	@JsonProperty("suppressRollback")
+	public Boolean getSuppressRollback() {
+	return suppressRollback;
+	}
+
+	@JsonProperty("suppressRollback")
+	public void setSuppressRollback(Boolean suppressRollback) {
+	this.suppressRollback = suppressRollback;
+	}
+
+	@JsonProperty("requestorId")
+	public String getRequestorId() {
+	return requestorId;
+	}
+
+	@JsonProperty("requestorId")
+	public void setRequestorId(String requestorId) {
+	this.requestorId = requestorId;
+	}
+
+	@JsonAnyGetter
+	public Map<String, Object> getAdditionalProperties() {
+	return this.additionalProperties;
+	}
+
+	@JsonAnySetter
+	public void setAdditionalProperty(String name, Object value) {
+	this.additionalProperties.put(name, value);
+	}
+
+
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/changeManagement/UpdateRequestInfo.java b/vid-app-common/src/main/java/org/onap/vid/changeManagement/UpdateRequestInfo.java
new file mode 100644
index 0000000..024e9c3
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/changeManagement/UpdateRequestInfo.java
@@ -0,0 +1,26 @@
+package org.onap.vid.changeManagement;
+
+import org.onap.vid.domain.mso.*;
+
+/**
+ * Created by Oren on 9/5/17.
+ */
+public class UpdateRequestInfo {
+
+    public UpdateRequestInfo() {
+    }
+
+
+    public UpdateRequestInfo(org.onap.vid.domain.mso.RequestInfo requestInfo) {
+        this.requestorId = requestInfo.getRequestorId();
+        this.suppressRollback = requestInfo.getSuppressRollback();
+        this.source = requestInfo.getSource();
+    }
+    public String source;
+
+    public  Boolean suppressRollback;
+
+    public String requestorId;
+
+
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/changeManagement/VnfDetails.java b/vid-app-common/src/main/java/org/onap/vid/changeManagement/VnfDetails.java
new file mode 100644
index 0000000..5cc2f4d
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/changeManagement/VnfDetails.java
@@ -0,0 +1,67 @@
+package org.onap.vid.changeManagement;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.google.common.base.MoreObjects;
+
+public class VnfDetails {
+
+	public VnfDetails() {
+	}
+
+	public VnfDetails(String UUID, String invariantUUID) {
+		this.UUID = UUID;
+		this.invariantUUID = invariantUUID;
+	}
+
+	@JsonProperty("UUID")
+	private String UUID;
+	
+	@JsonProperty("invariantUUID")
+	private String invariantUUID;
+	
+	@JsonProperty("UUID")
+	public String getUUID() {
+		return UUID;
+	}
+	
+	@JsonProperty("UUID")
+	public void setUUID(String uUID) {
+		UUID = uUID;
+	}
+	
+	@JsonProperty("invariantUUID")
+	public String getInvariantUUID() {
+		return invariantUUID;
+	}
+	
+	@JsonProperty("invariantUUID")
+	public void setInvariantUUID(String invariantUUID) {
+		this.invariantUUID = invariantUUID;
+	}
+
+	@Override
+	public boolean equals(Object o) {
+		if (this == o) return true;
+		if (o == null || getClass() != o.getClass()) return false;
+
+		VnfDetails that = (VnfDetails) o;
+
+		if (getUUID() != null ? !getUUID().equals(that.getUUID()) : that.getUUID() != null) return false;
+		return getInvariantUUID() != null ? getInvariantUUID().equals(that.getInvariantUUID()) : that.getInvariantUUID() == null;
+	}
+
+	@Override
+	public int hashCode() {
+		int result = getUUID() != null ? getUUID().hashCode() : 0;
+		result = 31 * result + (getInvariantUUID() != null ? getInvariantUUID().hashCode() : 0);
+		return result;
+	}
+
+	@Override
+	public String toString() {
+		return "VnfDetails{" +
+				"UUID='" + UUID + '\'' +
+				", invariantUUID='" + invariantUUID + '\'' +
+				'}';
+	}
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/changeManagement/VnfDetailsWithWorkflows.java b/vid-app-common/src/main/java/org/onap/vid/changeManagement/VnfDetailsWithWorkflows.java
new file mode 100644
index 0000000..db16299
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/changeManagement/VnfDetailsWithWorkflows.java
@@ -0,0 +1,36 @@
+package org.onap.vid.changeManagement;
+
+import org.onap.vid.model.VNFDao;
+import org.onap.vid.model.VidWorkflow;
+
+import java.util.List;
+import java.util.stream.Collectors;
+
+public class VnfDetailsWithWorkflows extends VnfDetails {
+
+    private List<String> workflows;
+
+    public VnfDetailsWithWorkflows() {
+    }
+
+
+    @SuppressWarnings("WeakerAccess")
+    public VnfDetailsWithWorkflows(String UUID, String invariantUUID, List<String> workflows) {
+        super(UUID, invariantUUID);
+        this.workflows = workflows;
+    }
+
+    public VnfDetailsWithWorkflows(VNFDao vnfDao) {
+        this(vnfDao.getVnfUUID(),
+             vnfDao.getVnfInvariantUUID(),
+             vnfDao.getWorkflows().stream().map(VidWorkflow::getWokflowName).collect(Collectors.toList()));
+    }
+
+    public List<String> getWorkflows() {
+        return workflows;
+    }
+
+    public void setWorkflows(List<String> workflows) {
+        this.workflows = workflows;
+    }
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/changeManagement/VnfWorkflowRelationAllResponse.java b/vid-app-common/src/main/java/org/onap/vid/changeManagement/VnfWorkflowRelationAllResponse.java
new file mode 100644
index 0000000..5c9af66
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/changeManagement/VnfWorkflowRelationAllResponse.java
@@ -0,0 +1,23 @@
+package org.onap.vid.changeManagement;
+
+import java.util.List;
+
+public class VnfWorkflowRelationAllResponse {
+
+    private List<VnfDetailsWithWorkflows> vnfs;
+
+    public VnfWorkflowRelationAllResponse() {
+    }
+
+    public VnfWorkflowRelationAllResponse(List<VnfDetailsWithWorkflows> vnfs) {
+        this.vnfs = vnfs;
+    }
+
+    public List<VnfDetailsWithWorkflows> getVnfs() {
+        return vnfs;
+    }
+
+    public void setVnfs(List<VnfDetailsWithWorkflows> vnfs) {
+        this.vnfs = vnfs;
+    }
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/changeManagement/VnfWorkflowRelationRequest.java b/vid-app-common/src/main/java/org/onap/vid/changeManagement/VnfWorkflowRelationRequest.java
new file mode 100644
index 0000000..cc9abae
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/changeManagement/VnfWorkflowRelationRequest.java
@@ -0,0 +1,31 @@
+package org.onap.vid.changeManagement;
+
+import java.util.List;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+public class VnfWorkflowRelationRequest {
+
+	public VnfWorkflowRelationRequest() {
+	}
+
+	public VnfWorkflowRelationRequest(List<WorkflowsDetail> workflowsDetails) {
+		this.workflowsDetails = workflowsDetails;
+	}
+
+	@JsonProperty("workflowsDetails")
+	private List<WorkflowsDetail> workflowsDetails;
+	
+	@JsonProperty("workflowsDetails")
+	public List<WorkflowsDetail> getWorkflowsDetails() {
+		return workflowsDetails;
+	}
+	
+	@JsonProperty("workflowsDetails")
+	public void setWorkflowsDetails(List<WorkflowsDetail> workflowsDetails) {
+		this.workflowsDetails = workflowsDetails;
+	}
+	
+	
+
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/changeManagement/VnfWorkflowRelationResponse.java b/vid-app-common/src/main/java/org/onap/vid/changeManagement/VnfWorkflowRelationResponse.java
new file mode 100644
index 0000000..98ebc89
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/changeManagement/VnfWorkflowRelationResponse.java
@@ -0,0 +1,15 @@
+package org.onap.vid.changeManagement;
+
+import org.onap.vid.model.ListOfErrorsResponse;
+
+import java.util.List;
+
+public class VnfWorkflowRelationResponse extends ListOfErrorsResponse {
+
+	public VnfWorkflowRelationResponse() {
+	}
+
+	public VnfWorkflowRelationResponse(List<String> errors) {
+		super(errors);
+	}
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/changeManagement/WorkflowsDetail.java b/vid-app-common/src/main/java/org/onap/vid/changeManagement/WorkflowsDetail.java
new file mode 100644
index 0000000..e833ecb
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/changeManagement/WorkflowsDetail.java
@@ -0,0 +1,44 @@
+package org.onap.vid.changeManagement;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.google.common.base.MoreObjects;
+
+public class WorkflowsDetail {
+
+	public WorkflowsDetail() {
+	}
+
+	public WorkflowsDetail(VnfDetails vnfDetails, String workflowName) {
+		this.vnfDetails = vnfDetails;
+		this.workflowName = workflowName;
+	}
+
+	@JsonProperty("vnfDetails")
+	private VnfDetails vnfDetails;
+	
+	@JsonProperty("workflowName")
+	private String workflowName;
+
+	@JsonProperty("vnfDetails")
+	public VnfDetails getVnfDetails() {
+		return vnfDetails;
+	}
+	@JsonProperty("vnfDetails")
+	public void setVnfDetails(VnfDetails vnfDetails) {
+		this.vnfDetails = vnfDetails;
+	}
+	@JsonProperty("workflowName")
+	public String getWorkflowName() {
+		return workflowName;
+	}
+	@JsonProperty("workflowName")
+	public void setWorkflowName(String workflowName) {
+		this.workflowName = workflowName;
+	}
+
+	@Override
+	public String toString() {
+		return vnfDetails +
+				", workflowName='" + workflowName;
+	}
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/client/FakeHttpSession.java b/vid-app-common/src/main/java/org/onap/vid/client/FakeHttpSession.java
new file mode 100644
index 0000000..69ce11f
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/client/FakeHttpSession.java
@@ -0,0 +1,224 @@
+package org.onap.vid.client;
+
+import org.apache.commons.io.IOUtils;
+import org.json.JSONArray;
+import org.json.JSONObject;
+import org.json.JSONTokener;
+
+import javax.servlet.ServletContext;
+import javax.servlet.http.HttpSession;
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.Collections;
+import java.util.Enumeration;
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * Created by pickjonathan on 03/07/2017.
+ */
+public class FakeHttpSession implements HttpSession {
+
+    /**
+     * Setup the creation time
+     */
+    public FakeHttpSession() {
+        File file = new File("resources/roles.json");
+
+        String rolesInputStream = null;
+        try {
+            rolesInputStream = IOUtils.toString(FakeHttpSession.class.getClassLoader().getResourceAsStream("roles.json"),"UTF8");
+        } catch (IOException e) {
+            e.printStackTrace();
+        }
+        JSONTokener tokener = new JSONTokener(rolesInputStream);
+        JSONObject roles = new JSONObject(tokener);
+
+        JSONArray rolesArray = roles.getJSONArray("roles");
+
+        //set permissions to the roles from file.
+        this.setAttribute("role", rolesArray);
+
+        creationTime = System.currentTimeMillis();
+    }
+
+
+    /**
+     * Setup the creation time
+     * @param id The new session id
+     */
+    public FakeHttpSession(String id)
+    {
+        this.id = id;
+        creationTime = System.currentTimeMillis();
+    }
+
+    /* (non-Javadoc)
+     * @see javax.servlet.http.HttpSession#getCreationTime()
+     */
+    public long getCreationTime()
+    {
+        return creationTime;
+    }
+
+    /* (non-Javadoc)
+     * @see javax.servlet.http.HttpSession#getId()
+     */
+    public String getId()
+    {
+        if (id == null)
+        {
+            System.out.println("Inventing data in FakeHttpSession.getId() to remain plausible.");
+            id = "fake";
+        }
+
+        return id;
+    }
+
+    /* (non-Javadoc)
+     * @see javax.servlet.http.HttpSession#getLastAccessedTime()
+     */
+    public long getLastAccessedTime()
+    {
+        return creationTime;
+    }
+
+    /* (non-Javadoc)
+     * @see javax.servlet.http.HttpSession#getServletContext()
+     */
+    public ServletContext getServletContext()
+    {
+        return null;
+    }
+
+    /* (non-Javadoc)
+     * @see javax.servlet.http.HttpSession#setMaxInactiveInterval(int)
+     */
+    public void setMaxInactiveInterval(int maxInactiveInterval)
+    {
+        this.maxInactiveInterval = maxInactiveInterval;
+    }
+
+    /* (non-Javadoc)
+     * @see javax.servlet.http.HttpSession#getMaxInactiveInterval()
+     */
+    public int getMaxInactiveInterval()
+    {
+        return maxInactiveInterval;
+    }
+
+    /**
+     * @see javax.servlet.http.HttpSession#getSessionContext()
+     * @deprecated
+     */
+    @SuppressWarnings({"UnnecessaryFullyQualifiedName"})
+    @Deprecated
+    public javax.servlet.http.HttpSessionContext getSessionContext()
+    {
+        return null;
+    }
+
+    /* (non-Javadoc)
+     * @see javax.servlet.http.HttpSession#getAttribute(java.lang.String)
+     */
+    public Object getAttribute(String name)
+    {
+        return attributes.get(name);
+    }
+
+    /* (non-Javadoc)
+     * @see javax.servlet.http.HttpSession#getValue(java.lang.String)
+     */
+    @Deprecated
+    public Object getValue(String name)
+    {
+        return attributes.get(name);
+    }
+
+    /* (non-Javadoc)
+     * @see javax.servlet.http.HttpSession#getAttributeNames()
+     */
+    public Enumeration<String> getAttributeNames()
+    {
+        return Collections.enumeration(attributes.keySet());
+    }
+
+    /* (non-Javadoc)
+     * @see javax.servlet.http.HttpSession#getValueNames()
+     */
+    @Deprecated
+    public String[] getValueNames()
+    {
+        return attributes.keySet().toArray(new String[attributes.keySet().size()]);
+    }
+
+    /* (non-Javadoc)
+     * @see javax.servlet.http.HttpSession#setAttribute(java.lang.String, java.lang.Object)
+     */
+    public void setAttribute(String name, Object value)
+    {
+        attributes.put(name, value);
+    }
+
+    /* (non-Javadoc)
+     * @see javax.servlet.http.HttpSession#putValue(java.lang.String, java.lang.Object)
+     */
+    @Deprecated
+    public void putValue(String name, Object value)
+    {
+        attributes.put(name, value);
+    }
+
+    /* (non-Javadoc)
+     * @see javax.servlet.http.HttpSession#removeAttribute(java.lang.String)
+     */
+    public void removeAttribute(String name)
+    {
+        attributes.remove(name);
+    }
+
+    /* (non-Javadoc)
+     * @see javax.servlet.http.HttpSession#removeValue(java.lang.String)
+     */
+    @Deprecated
+    public void removeValue(String name)
+    {
+        attributes.remove(name);
+    }
+
+    /* (non-Javadoc)
+     * @see javax.servlet.http.HttpSession#invalidate()
+     */
+    public void invalidate()
+    {
+    }
+
+    /* (non-Javadoc)
+     * @see javax.servlet.http.HttpSession#isNew()
+     */
+    public boolean isNew()
+    {
+        return true;
+    }
+
+    /**
+     * The session id
+     */
+    private String id = null;
+
+    /**
+     * The list of attributes
+     */
+    private Map<String, Object> attributes = new HashMap<String, Object>();
+
+    /**
+     * When were we created
+     */
+    private long creationTime;
+
+    /**
+     * How long before we timeout?
+     */
+    private int maxInactiveInterval = 30 * 60 * 1000;
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/client/HttpBasicClient.java b/vid-app-common/src/main/java/org/onap/vid/client/HttpBasicClient.java
new file mode 100644
index 0000000..d0a34ce
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/client/HttpBasicClient.java
@@ -0,0 +1,67 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * VID
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.vid.client;
+
+
+import java.text.DateFormat;
+import java.text.SimpleDateFormat;
+
+import javax.servlet.ServletContext;
+import javax.ws.rs.client.Client;
+import javax.ws.rs.client.ClientBuilder;
+
+import org.glassfish.jersey.client.ClientConfig;
+import org.glassfish.jersey.client.ClientProperties;
+import org.springframework.beans.factory.annotation.Autowired;
+
+import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
+
+/**
+ *  General HTTP client.
+ */
+
+public class HttpBasicClient{
+	
+	/** The servlet context. */
+	@Autowired 
+	private ServletContext servletContext;
+	
+	/** The logger. */
+	EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(HttpBasicClient.class);
+	
+	/** The Constant dateFormat. */
+	final static DateFormat dateFormat = new SimpleDateFormat("HH:mm:ss:SSSS");
+	
+	/**
+	 * Obtain a basic HTTP client .
+	 *
+	 * @return Client client object
+	 * @throws Exception the exception
+	 */
+	public static Client getClient() throws Exception {
+		
+		ClientConfig config = new ClientConfig();
+		config.property(ClientProperties.SUPPRESS_HTTP_COMPLIANCE_VALIDATION, true);
+		
+		return ClientBuilder.newClient(config)
+				.register(org.onap.vid.aai.util.CustomJacksonJaxBJsonProvider.class);
+	}	
+}  
diff --git a/vid-app-common/src/main/java/org/onap/vid/client/HttpsBasicClient.java b/vid-app-common/src/main/java/org/onap/vid/client/HttpsBasicClient.java
new file mode 100644
index 0000000..28a4d0f
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/client/HttpsBasicClient.java
@@ -0,0 +1,143 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * VID
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.vid.client;
+
+import java.io.File;
+import java.text.DateFormat;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+
+import javax.net.ssl.HostnameVerifier;
+import javax.net.ssl.HttpsURLConnection;
+import javax.net.ssl.SSLContext;
+import javax.net.ssl.SSLSession;
+import javax.ws.rs.client.Client;
+import javax.ws.rs.client.ClientBuilder;
+
+import org.eclipse.jetty.util.security.Password;
+import org.glassfish.jersey.client.ClientConfig;
+import org.glassfish.jersey.client.ClientProperties;
+import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
+import org.openecomp.portalsdk.core.util.SystemProperties;
+import org.onap.vid.properties.VidProperties;
+
+ /**
+  *  General SSL client using the VID tomcat keystore. It doesn't use client certificates.
+  */
+ 
+public class HttpsBasicClient{
+	
+	/** The logger. */
+	static EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(HttpsBasicClient.class);
+	
+	/** The Constant dateFormat. */
+	final static DateFormat dateFormat = new SimpleDateFormat("HH:mm:ss:SSSS");
+	
+	/**
+	 * Retrieve an SSL client.
+	 *
+	 * @return Client The SSL client
+	 * @throws Exception the exception
+	 */
+	public static Client getClient() throws Exception {
+		String methodName = "getClient";
+		ClientConfig config = new ClientConfig();
+		//config.getFeatures().put(JSONConfiguration.FEATURE_POJO_MAPPING, Boolean.TRUE);
+		//config.getClasses().add(org.openecomp.aai.util.CustomJacksonJaxBJsonProvider.class);
+	
+		SSLContext ctx = null;
+		
+		try {
+			
+			config.property(ClientProperties.SUPPRESS_HTTP_COMPLIANCE_VALIDATION, true);
+			
+			String truststore_path = SystemProperties.getProperty(VidProperties.VID_TRUSTSTORE_FILENAME);
+			logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + " " + methodName + " truststore_path=" + truststore_path);
+			String truststore_password = SystemProperties.getProperty(VidProperties.VID_TRUSTSTORE_PASSWD_X);
+			
+			
+			String decrypted_truststore_password = Password.deobfuscate(truststore_password);
+			//logger.debug(dateFormat.format(new Date()) + " " + methodName + " decrypted_truststore_password=" + decrypted_truststore_password);
+			
+			File tr = new File (truststore_path);
+			logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + " " + methodName + " absolute truststore path=" + tr.getAbsolutePath());
+			
+			//String keystore_path = certFilePath + AAIProperties.FILESEPARTOR + SystemProperties.getProperty(AAIProperties.AAI_KEYSTORE_FILENAME);
+			//String keystore_password = SystemProperties.getProperty(AAIProperties.AAI_KEYSTORE_PASSWD_X);
+			//String decrypted_keystore_password = EncryptedPropValue.decryptTriple(keystore_password);
+			
+		    System.setProperty("javax.net.ssl.trustStore", truststore_path);
+		    System.setProperty("javax.net.ssl.trustStorePassword", decrypted_truststore_password);
+			HttpsURLConnection.setDefaultHostnameVerifier( new HostnameVerifier(){
+			    public boolean verify(String string,SSLSession ssls) {
+			        return true;
+			    }
+			});
+	
+			//May need to make the algorithm a parameter. MSO requires TLSv1.1	or TLSv1.2
+			ctx = SSLContext.getInstance("TLSv1.2");
+			
+			/*
+			KeyManagerFactory kmf = null;
+			try {
+				kmf = KeyManagerFactory.getInstance("SunX509");
+				FileInputStream fin = new FileInputStream(keystore_path);
+				KeyStore ks = KeyStore.getInstance("PKCS12");
+				char[] pwd = decrypted_keystore_password.toCharArray();
+				ks.load(fin, pwd);
+				kmf.init(ks, pwd);
+			} catch (Exception e) {
+				System.out.println("Error setting up kmf: exiting");
+				e.printStackTrace();
+				System.exit(1);
+			}
+
+			ctx.init(kmf.getKeyManagers(), null, null);
+			*/
+			ctx.init(null, null, null);
+			//config.getProperties().put(HTTPSProperties.PROPERTY_HTTPS_PROPERTIES,
+			//							new HTTPSProperties( , ctx));
+			
+			return ClientBuilder.newBuilder()
+				.sslContext(ctx)
+				.hostnameVerifier(new HostnameVerifier() {
+					@Override
+					public boolean verify( String s, SSLSession sslSession ) {
+						return true;
+					}
+				}).withConfig(config)
+				.build()
+				.register(org.onap.vid.aai.util.CustomJacksonJaxBJsonProvider.class);
+			
+		} catch (Exception e) {
+			logger.debug(EELFLoggerDelegate.debugLogger, "Error setting up config: exiting");
+			//System.out.println("Error setting up config: exiting");
+			e.printStackTrace();
+			return null;
+		}
+			
+		//Client client = ClientBuilder.newClient(config);
+		// uncomment this line to get more logging for the request/response
+		// client.addFilter(new LoggingFilter(System.out));
+		
+		//return client;
+	}
+}  
diff --git a/vid-app-common/src/main/java/org/onap/vid/controller/AaiController.java b/vid-app-common/src/main/java/org/onap/vid/controller/AaiController.java
new file mode 100644
index 0000000..1719ff6
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/controller/AaiController.java
@@ -0,0 +1,750 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * VID
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.vid.controller;
+
+import org.codehaus.jackson.JsonGenerationException;
+import org.codehaus.jackson.map.JsonMappingException;
+import org.codehaus.jackson.map.ObjectMapper;
+import org.onap.vid.aai.AaiResponse;
+import org.onap.vid.aai.ServiceInstancesSearchResults;
+import org.onap.vid.aai.SubscriberData;
+import org.onap.vid.aai.SubscriberFilteredResults;
+import org.onap.vid.aai.model.AaiGetOperationalEnvironments.OperationalEnvironmentList;
+import org.onap.vid.aai.model.AaiGetPnfs.Pnf;
+import org.onap.vid.aai.model.AaiGetTenatns.GetTenantsResponse;
+import org.onap.vid.aai.util.AAIRestInterface;
+import org.onap.vid.model.VersionByInvariantIdsRequest;
+import org.onap.vid.roles.Role;
+import org.onap.vid.roles.RoleProvider;
+import org.onap.vid.roles.RoleValidator;
+import org.onap.vid.services.AaiService;
+import org.openecomp.portalsdk.core.controller.RestrictedBaseController;
+import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
+import org.openecomp.portalsdk.core.util.SystemProperties;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.MediaType;
+import org.springframework.http.ResponseEntity;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.servlet.HandlerMapping;
+import org.springframework.web.servlet.ModelAndView;
+
+import javax.servlet.ServletContext;
+import javax.servlet.http.HttpServletRequest;
+import javax.ws.rs.BadRequestException;
+import javax.ws.rs.DefaultValue;
+import javax.ws.rs.QueryParam;
+import javax.ws.rs.WebApplicationException;
+import javax.ws.rs.core.Response;
+import java.io.File;
+import java.io.IOException;
+import java.text.DateFormat;
+import java.text.SimpleDateFormat;
+import java.util.*;
+
+import static org.onap.vid.utils.Logging.getMethodName;
+
+/**
+ * Controller to handle a&ai requests.
+ */
+
+@RestController
+public class
+AaiController extends RestrictedBaseController {
+    /**
+     * The Constant dateFormat.
+     */
+    final static DateFormat dateFormat = new SimpleDateFormat("HH:mm:ss:SSSS");
+    /**
+     * The from app id.
+     */
+    protected String fromAppId = "VidAaiController";
+    /**
+     * The logger.
+     */
+    private static final EELFLoggerDelegate LOGGER = EELFLoggerDelegate.getLogger(AaiController.class);
+    /**
+     * The model.
+     */
+    private Map<String, Object> model = new HashMap<String, Object>();
+    /**
+     * The servlet context.
+     */
+    @Autowired
+    private ServletContext servletContext;
+    /**
+     * aai service
+     */
+    @Autowired
+    private AaiService aaiService;
+    @Autowired
+    private RoleProvider roleProvider;
+
+    public AaiController() {
+
+    }
+
+    public AaiController(ServletContext servletContext) {
+        this.servletContext = servletContext;
+
+    }
+
+    /**
+     * Welcome method.
+     *
+     * @param request the request
+     * @return ModelAndView The view
+     */
+    @RequestMapping(value = {"/subscriberSearch"}, method = RequestMethod.GET)
+    public ModelAndView welcome(HttpServletRequest request) {
+        LOGGER.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== AaiController welcome start");
+        return new ModelAndView(getViewName());
+    }
+
+    @RequestMapping(value = {"/aai_get_aic_zones"}, method = RequestMethod.GET)
+    public ResponseEntity<String> getAicZones(HttpServletRequest request) throws JsonGenerationException, JsonMappingException, IOException {
+        LOGGER.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== getAicZones controller start");
+        AaiResponse response = aaiService.getAaiZones();
+        return aaiResponseToResponseEntity(response);
+    }
+
+    @RequestMapping(value = {"/aai_get_aic_zone_for_pnf/{globalCustomerId}/{serviceType}/{serviceId}"}, method = RequestMethod.GET)
+    public ResponseEntity<String> getAicZoneForPnf(@PathVariable("globalCustomerId") String globalCustomerId ,@PathVariable("serviceType") String serviceType , @PathVariable("serviceId") String serviceId ,HttpServletRequest request) throws JsonGenerationException, JsonMappingException, IOException {
+        LOGGER.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== getAicZoneForPnf controller start");
+        AaiResponse response = aaiService.getAicZoneForPnf(globalCustomerId , serviceType , serviceId);
+        return aaiResponseToResponseEntity(response);
+    }
+
+    /**
+     * Get services from a&ai.
+     *
+     * @return ResponseEntity<String> The response entity with the logged in user uuid.
+     * @throws IOException          Signals that an I/O exception has occurred.
+     * @throws InterruptedException the interrupted exception
+     */
+    @RequestMapping(value = {"/getuserID"}, method = RequestMethod.GET)
+    public ResponseEntity<String> getUserID(HttpServletRequest request) throws IOException, InterruptedException {
+
+        String userId = ControllersUtils.extractUserId(request);
+
+        return new ResponseEntity<String>(userId, HttpStatus.OK);
+    }
+
+    /**
+     * Get services from a&ai.
+     *
+     * @return ResponseEntity<String> The response entity
+     * @throws IOException          Signals that an I/O exception has occurred.
+     * @throws InterruptedException the interrupted exception
+     */
+    @RequestMapping(value = "/aai_get_services", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
+    public ResponseEntity<String> doGetServices(HttpServletRequest request) throws IOException, InterruptedException {
+        RoleValidator roleValidator = new RoleValidator(roleProvider.getUserRoles(request));
+
+        AaiResponse subscriberList = aaiService.getServices(roleValidator);
+        ResponseEntity<String> responseEntity = aaiResponseToResponseEntity(subscriberList);
+
+        return responseEntity;
+    }
+
+
+    @RequestMapping(value = {"/aai_get_version_by_invariant_id"}, method = RequestMethod.POST)
+    public ResponseEntity<String> getVersionByInvariantId(HttpServletRequest request, @RequestBody VersionByInvariantIdsRequest versions) throws IOException {
+        ResponseEntity<String> responseEntity;
+        ObjectMapper objectMapper = new ObjectMapper();
+
+        Response result = aaiService.getVersionByInvariantId(versions.versions);
+
+        return new ResponseEntity<String>(result.readEntity(String.class), HttpStatus.OK);
+    }
+
+
+    private ResponseEntity<String> aaiResponseToResponseEntity(AaiResponse aaiResponseData)
+            throws IOException, JsonGenerationException, JsonMappingException {
+        ResponseEntity<String> responseEntity;
+        ObjectMapper objectMapper = new ObjectMapper();
+        if (aaiResponseData.getHttpCode() == 200) {
+            responseEntity = new ResponseEntity<String>(objectMapper.writeValueAsString(aaiResponseData.getT()), HttpStatus.OK);
+        } else {
+            responseEntity = new ResponseEntity<String>(aaiResponseData.getErrorMessage(), HttpStatus.valueOf(aaiResponseData.getHttpCode()));
+        }
+        return responseEntity;
+    }
+
+    /**
+     * Lookup single service instance in a&ai.  Get the service-subscription and customer, too, i guess?
+     *
+     * @param serviceInstanceId the service instance Id
+     * @return ResponseEntity The response entity
+     * @throws IOException          Signals that an I/O exception has occurred.
+     * @throws InterruptedException the interrupted exception
+     */
+    @RequestMapping(value = "/aai_get_service_instance/{service-instance-id}/{service-instance-type}", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
+    public ResponseEntity<String> doGetServiceInstance(@PathVariable("service-instance-id") String serviceInstanceId, @PathVariable("service-instance-type") String serviceInstanceType) throws IOException, InterruptedException {
+        File certiPath = GetCertificatesPath();
+        Response resp = null;
+
+        if (serviceInstanceType.equalsIgnoreCase("Service Instance Id")) {
+            resp = doAaiGet(certiPath.getAbsolutePath(),
+                    "search/nodes-query?search-node-type=service-instance&filter=service-instance-id:EQUALS:"
+                            + serviceInstanceId, false);
+        } else {
+            resp = doAaiGet(certiPath.getAbsolutePath(),
+                    "search/nodes-query?search-node-type=service-instance&filter=service-instance-name:EQUALS:"
+                            + serviceInstanceId, false);
+        }
+        return convertResponseToResponseEntity(resp);
+    }
+
+    /**
+     * Get services from a&ai.
+     *
+     * @param globalCustomerId      the global customer id
+     * @param serviceSubscriptionId the service subscription id
+     * @return ResponseEntity The response entity
+     * @throws IOException          Signals that an I/O exception has occurred.
+     * @throws InterruptedException the interrupted exception
+     */
+    @RequestMapping(value = "/aai_get_service_subscription/{global-customer-id}/{service-subscription-id}", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
+    public ResponseEntity<String> doGetServices(@PathVariable("global-customer-id") String globalCustomerId,
+                                                @PathVariable("service-subscription-id") String serviceSubscriptionId) throws IOException, InterruptedException {
+        File certiPath = GetCertificatesPath();
+        Response resp = doAaiGet(certiPath.getAbsolutePath(), "business/customers/customer/" + globalCustomerId
+                + "/service-subscriptions/service-subscription/" + serviceSubscriptionId + "?depth=0", false);
+        return convertResponseToResponseEntity(resp);
+    }
+
+    /**
+     * Obtain the subscriber list from a&ai.
+     *
+     * @param fullSet the full set
+     * @return ResponseEntity The response entity
+     * @throws IOException          Signals that an I/O exception has occurred.
+     * @throws InterruptedException the interrupted exception
+     */
+    @RequestMapping(value = "/aai_get_subscribers", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
+    public ResponseEntity<String> doGetSubscriberList(HttpServletRequest request, @DefaultValue("n") @QueryParam("fullSet") String fullSet) throws IOException, InterruptedException {
+        return getFullSubscriberList(request);
+    }
+
+    /**
+     * Obtain the Target Prov Status from the System.Properties file.
+     *
+     * @return ResponseEntity The response entity
+     * @throws IOException          Signals that an I/O exception has occurred.
+     * @throws InterruptedException the interrupted exception
+     */
+    @RequestMapping(value = "/get_system_prop_vnf_prov_status", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
+    public ResponseEntity<String> getTargetProvStatus() throws IOException, InterruptedException {
+        String p = SystemProperties.getProperty("aai.vnf.provstatus");
+        return new ResponseEntity<String>(p, HttpStatus.OK);
+    }
+
+
+    /**
+     * Obtain the Target Prov Status from the System.Properties file.
+     *
+     * @return ResponseEntity The response entity
+     * @throws IOException          Signals that an I/O exception has occurred.
+     * @throws InterruptedException the interrupted exception
+     */
+    @RequestMapping(value = "/get_operational_environments", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
+    public AaiResponse<OperationalEnvironmentList> getOperationalEnvironments(@RequestParam(value="operationalEnvironmentType", required = false) String operationalEnvironmentType,
+                                                           @RequestParam(value="operationalEnvironmentStatus", required = false) String operationalEnvironmentStatus) throws IOException, InterruptedException {
+        LOGGER.debug(EELFLoggerDelegate.debugLogger, "start {}({}, {})", getMethodName(), operationalEnvironmentType, operationalEnvironmentStatus);
+        AaiResponse<OperationalEnvironmentList> response = aaiService.getOperationalEnvironments(operationalEnvironmentType,operationalEnvironmentStatus);
+        if (response.getHttpCode() != 200) {
+            String errorMessage = getAaiErrorMessage(response.getErrorMessage());
+            if(errorMessage != null) {
+                response = new AaiResponse<OperationalEnvironmentList>(response.getT(), errorMessage, response.getHttpCode());
+            }
+        }
+
+        LOGGER.debug(EELFLoggerDelegate.debugLogger, "end {}() => {}", getMethodName(), response);
+        return response;
+    }
+
+    /**
+     * Obtain the full subscriber list from a&ai.
+     * <p>
+     * g @return ResponseEntity The response entity
+     *
+     * @throws IOException          Signals that an I/O exception has occurred.
+     * @throws InterruptedException the interrupted exception
+     */
+    @RequestMapping(value = "/aai_get_full_subscribers", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
+    public ResponseEntity<String> getFullSubscriberList(HttpServletRequest request) throws IOException, InterruptedException {
+        ObjectMapper objectMapper = new ObjectMapper();
+        ResponseEntity<String> responseEntity;
+        RoleValidator roleValidator = new RoleValidator(roleProvider.getUserRoles(request));
+        SubscriberFilteredResults subscriberList = aaiService.getFullSubscriberList(roleValidator);
+        if (subscriberList.getHttpCode() == 200) {
+            responseEntity = new ResponseEntity<String>(objectMapper.writeValueAsString(subscriberList.getSubscriberList()), HttpStatus.OK);
+        } else {
+            responseEntity = new ResponseEntity<String>(subscriberList.getErrorMessage(), HttpStatus.valueOf(subscriberList.getHttpCode()));
+        }
+
+
+        return responseEntity;
+    }
+
+
+    @RequestMapping(value = "/get_vnf_data_by_globalid_and_service_type/{globalCustomerId}/{serviceType}",
+            method = RequestMethod.GET,
+            produces = MediaType.APPLICATION_JSON_VALUE)
+    public ResponseEntity<String> getVnfDataByGlobalIdAndServiceType(HttpServletRequest request,
+                                                                     @PathVariable("globalCustomerId") String globalCustomerId,
+                                                                     @PathVariable("serviceType") String serviceType) throws IOException {
+
+        Response resp = aaiService.getVNFData(globalCustomerId, serviceType);
+        return convertResponseToResponseEntity(resp);
+    }
+
+
+    /**
+     * Refresh the subscriber list from a&ai.
+     *
+     * @return ResponseEntity The response entity
+     * @throws IOException Signals that an I/O exception has occurred.
+     */
+    @RequestMapping(value = "/aai_refresh_subscribers", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
+    public ResponseEntity<String> doRefreshSubscriberList() throws IOException {
+        Response resp = getSubscribers(false);
+        return convertResponseToResponseEntity(resp);
+    }
+
+    /**
+     * Refresh the full subscriber list from a&ai.
+     *
+     * @return ResponseEntity The response entity
+     * @throws IOException Signals that an I/O exception has occurred.
+     */
+    @RequestMapping(value = "/aai_refresh_full_subscribers", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
+    public ResponseEntity<String> doRefreshFullSubscriberList() throws IOException {
+        Response resp = getSubscribers(false);
+        return convertResponseToResponseEntity(resp);
+    }
+
+    /**
+     * Get subscriber details from a&ai.
+     *
+     * @param subscriberId the subscriber id
+     * @return ResponseEntity The response entity
+     */
+    @RequestMapping(value = "/aai_sub_details/{subscriberId}", method = RequestMethod.GET)
+    public ResponseEntity<String> GetSubscriberDetails(HttpServletRequest request, @PathVariable("subscriberId") String subscriberId) throws IOException {
+        ObjectMapper objectMapper = new ObjectMapper();
+        ResponseEntity responseEntity;
+        List<Role> roles = roleProvider.getUserRoles(request);
+        RoleValidator roleValidator = new RoleValidator(roles);
+        AaiResponse<SubscriberData> subscriberData = aaiService.getSubscriberData(subscriberId, roleValidator);
+        String httpMessage = subscriberData.getT() != null ?
+                objectMapper.writeValueAsString(subscriberData.getT()) :
+                subscriberData.getErrorMessage();
+
+        responseEntity = new ResponseEntity<String>(httpMessage, HttpStatus.valueOf(subscriberData.getHttpCode()));
+        return responseEntity;
+    }
+
+    /**
+     * Get service instances that match the query from a&ai.
+     *
+     * @param subscriberId the subscriber id
+     * @param instanceIdentifier the service instance name or id.
+     * @param projects the projects that are related to the instance
+     * @param owningEntities the owningEntities that are related to the instance
+     * @return ResponseEntity The response entity
+     */
+    @RequestMapping(value = "/search_service_instances", method = RequestMethod.GET)
+    public ResponseEntity<String> SearchServiceInstances(HttpServletRequest request,
+                                                         @RequestParam(value="subscriberId", required = false) String subscriberId,
+                                                         @RequestParam(value="serviceInstanceIdentifier", required = false) String instanceIdentifier,
+                                                         @RequestParam(value="project", required = false) List<String> projects,
+                                                         @RequestParam(value="owningEntity", required = false) List<String> owningEntities) throws IOException {
+        ObjectMapper objectMapper = new ObjectMapper();
+        ResponseEntity responseEntity;
+
+        List<Role> roles = roleProvider.getUserRoles(request);
+        RoleValidator roleValidator = new RoleValidator(roles);
+
+        AaiResponse<ServiceInstancesSearchResults> searchResult = aaiService.getServiceInstanceSearchResults(subscriberId, instanceIdentifier, roleValidator, owningEntities, projects);
+
+        String httpMessage = searchResult.getT() != null ?
+                objectMapper.writeValueAsString(searchResult.getT()) :
+                searchResult.getErrorMessage();
+
+
+        if(searchResult.getT().serviceInstances.size() == 0){
+            responseEntity = new ResponseEntity<String>(httpMessage, HttpStatus.NOT_FOUND);
+
+        } else {
+            responseEntity = new ResponseEntity<String>(httpMessage, HttpStatus.valueOf(searchResult.getHttpCode()));
+
+        }
+        return responseEntity;
+    }
+
+
+
+    /**
+     * Issue a named query to a&ai.
+     *
+     * @param namedQueryId     the named query id
+     * @param globalCustomerId the global customer id
+     * @param serviceType      the service type
+     * @param serviceInstance  the service instance
+     * @return ResponseEntity The response entity
+     */
+    @RequestMapping(value = "/aai_sub_viewedit/{namedQueryId}/{globalCustomerId}/{serviceType}/{serviceInstance}", method = RequestMethod.GET)
+    public ResponseEntity<String> viewEditGetComponentList(
+            @PathVariable("namedQueryId") String namedQueryId,
+            @PathVariable("globalCustomerId") String globalCustomerId,
+            @PathVariable("serviceType") String serviceType,
+            @PathVariable("serviceInstance") String serviceInstance) {
+
+        String componentListPayload = getComponentListPutPayload(namedQueryId, globalCustomerId, serviceType, serviceInstance);
+        File certiPath = GetCertificatesPath();
+
+        Response resp = doAaiPost(certiPath.getAbsolutePath(), "search/named-query", componentListPayload, false);
+        return convertResponseToResponseEntity(resp);
+    }
+
+    @RequestMapping(value = "/aai_get_vnf_data/{globalCustomerId}/{serviceType}/{serviceInstanceId}", method = RequestMethod.GET)
+    public AaiResponse<String> getVnfData(
+            @PathVariable("globalCustomerId") String globalCustomerId,
+            @PathVariable("serviceType") String serviceType,
+            @PathVariable("serviceInstanceId") String serviceInstanceId) {
+
+        return aaiService.getVNFData(globalCustomerId, serviceType, serviceInstanceId);
+
+    }
+
+
+    /**
+     * Issue a named query to a&ai.
+     *
+     * @param namedQueryId     the named query id
+     * @param globalCustomerId the global customer id
+     * @param serviceType      the service type
+     * @return ResponseEntity The response entity
+     */
+    @RequestMapping(value = "/aai_get_models_by_service_type/{namedQueryId}/{globalCustomerId}/{serviceType}", method = RequestMethod.GET)
+    public ResponseEntity<String> viewEditGetComponentList(
+            @PathVariable("namedQueryId") String namedQueryId,
+            @PathVariable("globalCustomerId") String globalCustomerId,
+            @PathVariable("serviceType") String serviceType) {
+
+        String componentListPayload = getModelsByServiceTypePayload(namedQueryId, globalCustomerId, serviceType);
+        File certiPath = GetCertificatesPath();
+
+        Response resp = doAaiPost(certiPath.getAbsolutePath(), "search/named-query", componentListPayload, false);
+        return convertResponseToResponseEntity(resp);
+    }
+
+    @RequestMapping(value = "/aai_get_vnf_instances/{globalCustomerId}/{serviceType}/{modelVersionId}/{modelInvariantId}/{cloudRegion}", method = RequestMethod.GET)
+    public ResponseEntity<String> getNodeTemplateInstances(
+            @PathVariable("globalCustomerId") String globalCustomerId,
+            @PathVariable("serviceType") String serviceType,
+            @PathVariable("modelVersionId") String modelVersionId,
+            @PathVariable("modelInvariantId") String modelInvariantId,
+            @PathVariable("cloudRegion") String cloudRegion) {
+
+        AaiResponse<String> resp = aaiService.getNodeTemplateInstances(globalCustomerId, serviceType, modelVersionId, modelInvariantId, cloudRegion);
+        return new ResponseEntity<String>(resp.getT(), HttpStatus.valueOf(resp.getHttpCode()));
+    }
+
+    @RequestMapping(value = "/aai_get_by_uri/**", method = RequestMethod.GET)
+    public ResponseEntity<String> getByUri(HttpServletRequest request) {
+        File certiPath = GetCertificatesPath();
+
+        String restOfTheUrl = (String) request.getAttribute(
+                HandlerMapping.PATH_WITHIN_HANDLER_MAPPING_ATTRIBUTE);
+        String formattedUri = restOfTheUrl.replaceFirst("/aai_get_by_uri/", "").replaceFirst("^aai/v[\\d]+/", "");
+
+        Response resp = doAaiGet(certiPath.getAbsolutePath(), formattedUri, false);
+
+        return convertResponseToResponseEntity(resp);
+    }
+
+    @RequestMapping(value = "/aai_get_configuration/{configuration_id}", method = RequestMethod.GET)
+    public ResponseEntity<String> getSpecificConfiguration(@PathVariable("configuration_id") String configurationId) {
+        File certiPath = GetCertificatesPath();
+
+        Response resp = doAaiGet(certiPath.getAbsolutePath(), "network/configurations/configuration/"+configurationId, false);
+
+        return convertResponseToResponseEntity(resp);
+    }
+
+    @RequestMapping(value = "/aai_get_service_instance_pnfs/{globalCustomerId}/{serviceType}/{serviceInstanceId}", method = RequestMethod.GET)
+    public List<String> getServiceInstanceAssociatedPnfs(
+            @PathVariable("globalCustomerId") String globalCustomerId,
+            @PathVariable("serviceType") String serviceType,
+            @PathVariable("serviceInstanceId") String serviceInstanceId) {
+
+        return aaiService.getServiceInstanceAssociatedPnfs(globalCustomerId, serviceType, serviceInstanceId);
+    }
+
+    /**
+     * PNF section
+     */
+    @RequestMapping(value = "/aai_get_pnfs/pnf/{pnf_id}", method = RequestMethod.GET)
+    public ResponseEntity getSpecificPnf(@PathVariable("pnf_id") String pnfId) {
+        //logger.trace(EELFLoggerDelegate.debugLogger, "start {}({})", getMethodName(), pnfId);
+        AaiResponse<Pnf> resp;
+        ResponseEntity<Pnf> re;
+        try {
+            resp = aaiService.getSpecificPnf(pnfId);
+            re = new ResponseEntity<Pnf>(resp.getT(), HttpStatus.valueOf(resp.getHttpCode()));
+        } catch (Exception e){
+            return new ResponseEntity<String>(e.getMessage(), HttpStatus.INTERNAL_SERVER_ERROR);
+        }
+        //logger.trace(EELFLoggerDelegate.debugLogger, "end {}() => {}", getMethodName(), resp.getHttpCode());
+        return re;
+    }
+
+
+    /**
+     * Obtain tenants for a given service type.
+     *
+     * @param globalCustomerId the global customer id
+     * @param serviceType      the service type
+     * @return ResponseEntity The response entity
+     */
+    @RequestMapping(value = "/aai_get_tenants/{global-customer-id}/{service-type}", method = RequestMethod.GET)
+    public ResponseEntity<String> viewEditGetTenantsFromServiceType(HttpServletRequest request,
+                                                                    @PathVariable("global-customer-id") String globalCustomerId, @PathVariable("service-type") String serviceType) {
+
+        ResponseEntity responseEntity;
+        try {
+            ObjectMapper objectMapper = new ObjectMapper();
+            List<Role> roles = roleProvider.getUserRoles(request);
+            RoleValidator roleValidator = new RoleValidator(roles);
+            AaiResponse<GetTenantsResponse[]> response = aaiService.getTenants(globalCustomerId, serviceType, roleValidator);
+            if (response.getHttpCode() == 200) {
+                responseEntity = new ResponseEntity<String>(objectMapper.writeValueAsString(response.getT()), HttpStatus.OK);
+            } else {
+                responseEntity = new ResponseEntity<String>(response.getErrorMessage(), HttpStatus.valueOf(response.getHttpCode()));
+            }
+        } catch (Exception e) {
+            responseEntity = new ResponseEntity<String>("Unable to proccess getTenants reponse", HttpStatus.INTERNAL_SERVER_ERROR);
+        }
+        return responseEntity;
+    }
+
+    @RequestMapping(value = "/aai_get_pnf_instances/{globalCustomerId}/{serviceType}/{modelVersionId}/{modelInvariantId}/{cloudRegion}/{equipVendor}/{equipModel}", method = RequestMethod.GET)
+    public ResponseEntity<String> getPnfInstances(
+            @PathVariable("globalCustomerId") String globalCustomerId,
+            @PathVariable("serviceType") String serviceType,
+            @PathVariable("modelVersionId") String modelVersionId,
+            @PathVariable("modelInvariantId") String modelInvariantId,
+            @PathVariable("cloudRegion") String cloudRegion,
+            @PathVariable("equipVendor") String equipVendor,
+            @PathVariable("equipModel") String equipModel) {
+
+        AaiResponse<String> resp = aaiService.getPNFData(globalCustomerId, serviceType, modelVersionId, modelInvariantId, cloudRegion, equipVendor, equipModel);
+        return new ResponseEntity<String>(resp.getT(), HttpStatus.valueOf(resp.getHttpCode()));
+    }
+
+    private ResponseEntity<String> convertResponseToResponseEntity(Response resp) {
+        ResponseEntity<String> respEnt;
+        ObjectMapper objectMapper = new ObjectMapper();
+        if (resp == null) {
+            respEnt = new ResponseEntity<String>("Failed to fetch data from A&AI, check server logs for details.", HttpStatus.INTERNAL_SERVER_ERROR);
+        } else {
+            respEnt = new ResponseEntity<String>(resp.readEntity(String.class), HttpStatus.valueOf(resp.getStatus()));
+        }
+        return respEnt;
+    }
+
+    /**
+     * Gets the subscribers.
+     *
+     * @param isFullSet the is full set
+     * @return the subscribers
+     */
+    private Response getSubscribers(boolean isFullSet) {
+
+        File certiPath = GetCertificatesPath();
+        String depth = "0";
+
+        Response resp = doAaiGet(certiPath.getAbsolutePath(), "business/customers?subscriber-type=INFRA&depth=" + depth, false);
+        if (resp != null) {
+            LOGGER.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + "getSubscribers() resp=" + resp.getStatusInfo().toString());
+        }
+        return resp;
+    }
+
+    /**
+     * Gets the subscriber details.
+     *
+     * @param subscriberId the subscriber id
+     * @return the subscriber details
+     */
+    private Response getSubscriberDetails(String subscriberId) {
+        File certiPath = GetCertificatesPath();
+        Response resp = doAaiGet(certiPath.getAbsolutePath(), "business/customers/customer/" + subscriberId + "?depth=2", false);
+        //String resp = doAaiGet(certiPath.getAbsolutePath(), "business/customers/customer/" + subscriberId, false);
+        LOGGER.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + "getSubscriberDetails() resp=" + resp.getStatusInfo().toString());
+        return resp;
+    }
+
+    /**
+     * Gets the certificates path.
+     *
+     * @return the file
+     */
+    private File GetCertificatesPath() {
+        if (servletContext != null)
+            return new File(servletContext.getRealPath("/WEB-INF/cert/"));
+        return null;
+    }
+
+    /**
+     * Send a GET request to a&ai.
+     *
+     * @param certiPath the certi path
+     * @param uri       the uri
+     * @param xml       the xml
+     * @return String The response
+     */
+    protected Response doAaiGet(String certiPath, String uri, boolean xml) {
+        String methodName = "getSubscriberList";
+        String transId = UUID.randomUUID().toString();
+        LOGGER.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
+
+        Response resp = null;
+        try {
+
+            AAIRestInterface restContrller = new AAIRestInterface(certiPath);
+            resp = restContrller.RestGet(fromAppId, transId, uri, xml);
+
+        } catch (WebApplicationException e) {
+            final String message = ((BadRequestException) e).getResponse().readEntity(String.class);
+            LOGGER.info(EELFLoggerDelegate.errorLogger, dateFormat.format(new Date()) + "<== " + "." + methodName + message);
+            LOGGER.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + "." + methodName + message);
+        } catch (Exception e) {
+            LOGGER.info(EELFLoggerDelegate.errorLogger, dateFormat.format(new Date()) + "<== " + "." + methodName + e.toString());
+            LOGGER.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + "." + methodName + e.toString());
+        }
+
+        return resp;
+    }
+
+    /**
+     * Send a POST request to a&ai.
+     *
+     * @param certiPath the certi path
+     * @param uri       the uri
+     * @param payload   the payload
+     * @param xml       the xml
+     * @return String The response
+     */
+    protected Response doAaiPost(String certiPath, String uri, String payload, boolean xml) {
+        String methodName = "getSubscriberList";
+        String transId = UUID.randomUUID().toString();
+        LOGGER.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
+
+        Response resp = null;
+        try {
+
+            AAIRestInterface restContrller = new AAIRestInterface(certiPath);
+            resp = restContrller.RestPost(fromAppId, transId, uri, payload, xml);
+
+        } catch (Exception e) {
+            LOGGER.info(EELFLoggerDelegate.errorLogger, dateFormat.format(new Date()) + "<== " + "." + methodName + e.toString());
+            LOGGER.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + "." + methodName + e.toString());
+        }
+
+        return resp;
+    }
+
+    /**
+     * Gets the component list put payload.
+     *
+     * @param namedQueryId     the named query id
+     * @param globalCustomerId the global customer id
+     * @param serviceType      the service type
+     * @param serviceInstance  the service instance
+     * @return the component list put payload
+     */
+    private String getComponentListPutPayload(String namedQueryId, String globalCustomerId, String serviceType, String serviceInstance) {
+        return
+                "		{" +
+                        "    \"instance-filters\": {" +
+                        "        \"instance-filter\": [" +
+                        "            {" +
+                        "                \"customer\": {" +
+                        "                    \"global-customer-id\": \"" + globalCustomerId + "\"" +
+                        "                }," +
+                        "                \"service-instance\": {" +
+                        "                    \"service-instance-id\": \"" + serviceInstance + "\"" +
+                        "                }," +
+                        "                \"service-subscription\": {" +
+                        "                    \"service-type\": \"" + serviceType + "\"" +
+                        "                }" +
+                        "            }" +
+                        "        ]" +
+                        "    }," +
+                        "    \"query-parameters\": {" +
+                        "        \"named-query\": {" +
+                        "            \"named-query-uuid\": \"" + namedQueryId + "\"" +
+                        "        }" +
+                        "    }" +
+                        "}";
+
+    }
+
+    private String getModelsByServiceTypePayload(String namedQueryId, String globalCustomerId, String serviceType) {
+        // TODO Auto-generated method stub
+        return "		{" +
+                "    \"instance-filters\": {" +
+                "        \"instance-filter\": [" +
+                "            {" +
+                "                \"customer\": {" +
+                "                    \"global-customer-id\": \"" + globalCustomerId + "\"" +
+                "                }," +
+                "                \"service-subscription\": {" +
+                "                    \"service-type\": \"" + serviceType + "\"" +
+                "                }" +
+                "            }" +
+                "        ]" +
+                "    }," +
+                "    \"query-parameters\": {" +
+                "        \"named-query\": {" +
+                "            \"named-query-uuid\": \"" + namedQueryId + "\"" +
+                "        }" +
+                "    }" +
+                "}";
+
+    }
+
+    private String getAaiErrorMessage(String message) {
+        try {
+            org.json.JSONObject json = new org.json.JSONObject(message);
+            json = json.getJSONObject("requestError").getJSONObject("serviceException");
+
+            return json.getString("messageId") + ": " + json.getString("text");
+
+        } catch (Exception e) {
+            return null;
+        }
+    }
+}
\ No newline at end of file
diff --git a/vid-app-common/src/main/java/org/onap/vid/controller/ChangeManagementController.java b/vid-app-common/src/main/java/org/onap/vid/controller/ChangeManagementController.java
new file mode 100644
index 0000000..4f307ed
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/controller/ChangeManagementController.java
@@ -0,0 +1,193 @@
+package org.onap.vid.controller;
+
+import com.fasterxml.jackson.databind.ObjectMapper;
+import org.apache.commons.lang3.exception.ExceptionUtils;
+import org.apache.commons.lang3.tuple.Pair;
+import org.json.simple.JSONArray;
+import org.openecomp.portalsdk.core.controller.UnRestrictedBaseController;
+import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
+import org.onap.vid.changeManagement.*;
+import org.onap.vid.exceptions.NotFoundException;
+import org.onap.vid.model.ExceptionResponse;
+import org.onap.vid.model.MsoExceptionResponse;
+import org.onap.vid.mso.MsoResponseWrapper2;
+import org.onap.vid.mso.MsoResponseWrapperInterface;
+import org.onap.vid.mso.rest.Request;
+import org.onap.vid.services.ChangeManagementService;
+import org.onap.vid.services.WorkflowService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.ResponseEntity;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.ws.rs.WebApplicationException;
+import java.io.IOException;
+import java.util.Collection;
+import java.util.Collections;
+
+import static org.onap.vid.utils.Logging.getMethodName;
+import static org.springframework.http.HttpStatus.*;
+
+/**
+ * Controller to handle ChangeManagement feature requests.
+ */
+@RestController
+@RequestMapping(ChangeManagementController.CHANGE_MANAGEMENT)
+public class ChangeManagementController extends UnRestrictedBaseController {
+    private static final String GetWorkflowsResponse = null;
+    public static final String VNF_WORKFLOW_RELATION = "vnf_workflow_relation";
+    public static final String CHANGE_MANAGEMENT = "change-management";
+    public static final String GET_VNF_WORKFLOW_RELATION = "get_vnf_workflow_relation";
+    public static final String SCHEDULER_BY_SCHEDULE_ID = "/scheduler/schedules/{scheduleId}";
+    private static final EELFLoggerDelegate LOGGER = EELFLoggerDelegate.getLogger(ChangeManagementController.class);
+    private String fromAppId;
+    private final WorkflowService workflowService;
+    private final ChangeManagementService changeManagementService;
+    private final ObjectMapper objectMapper;
+
+
+    @Autowired
+    public ChangeManagementController(WorkflowService workflowService, ChangeManagementService changeManagementService, ObjectMapper objectMapper) {
+        this.fromAppId = "VidChangeManagementController";
+        this.workflowService = workflowService;
+        this.changeManagementService = changeManagementService;
+        this.objectMapper = objectMapper;
+    }
+
+    @RequestMapping(value = {"/workflow"}, method = RequestMethod.GET)
+    public ResponseEntity<Collection<String>> getWorkflow(@RequestParam("vnfs") Collection<String> vnfs) throws IOException, InterruptedException {
+        Collection<String> result = this.workflowService.getWorkflowsForVNFs(vnfs);
+        return new ResponseEntity<>(result, OK);
+    }
+
+    @RequestMapping(value = {"/mso"}, method = RequestMethod.GET)
+    public ResponseEntity<Collection<Request>> getMSOChangeManagements() throws Exception, IOException, InterruptedException {
+
+        Collection<Request> result = this.changeManagementService.getMSOChangeManagements();
+        return new ResponseEntity<>(result, OK);
+    }
+
+    @RequestMapping(value = "/workflow/{vnfName}", method = RequestMethod.POST)
+    public ResponseEntity<String> changeManagement(@PathVariable("vnfName") String vnfName,
+                                                   HttpServletRequest request,
+                                                   @RequestBody ChangeManagementRequest changeManagmentRequest)
+            throws Exception {
+        return this.changeManagementService.doChangeManagement(changeManagmentRequest, vnfName);
+    }
+
+    @RequestMapping(value = "/uploadConfigUpdateFile", method = RequestMethod.POST)
+    public @ResponseBody ResponseEntity uploadConfigUpdateFile(@RequestPart("file") MultipartFile file)
+        throws Exception {
+        try {
+            String jsonString = this.changeManagementService.uploadConfigUpdateFile(file);
+            return new ResponseEntity<>(jsonString, HttpStatus.OK);
+        }
+        catch(WebApplicationException e){
+            return new ResponseEntity<>(handleException(e),  HttpStatus.valueOf(e.getResponse().getStatus()));
+        }
+        catch (Exception e) {
+            return new ResponseEntity<>(handleException(e), INTERNAL_SERVER_ERROR);
+        }
+    }
+
+
+    @RequestMapping(value = {"/scheduler"}, method = RequestMethod.GET)
+    public ResponseEntity<JSONArray> getSchedulerChangeManagements() throws IOException, InterruptedException {
+        JSONArray result = this.changeManagementService.getSchedulerChangeManagements();
+        return new ResponseEntity<>(result, OK);
+    }
+
+    @RequestMapping(value = {SCHEDULER_BY_SCHEDULE_ID}, method = RequestMethod.DELETE)
+    public ResponseEntity deleteSchedule(@PathVariable("scheduleId") String scheduleId) throws IOException, InterruptedException {
+        Pair<String, Integer> result = this.changeManagementService.deleteSchedule(scheduleId);
+        return ResponseEntity.status(result.getRight()).build();
+    }
+
+    
+    @RequestMapping(value = {GET_VNF_WORKFLOW_RELATION}, method = RequestMethod.POST)
+    public ResponseEntity getWorkflows(@RequestBody GetVnfWorkflowRelationRequest getVnfWorkflowRelationRequest) throws IOException, InterruptedException {
+        try {
+            GetWorkflowsResponse response = new GetWorkflowsResponse(changeManagementService.getWorkflowsForVnf(getVnfWorkflowRelationRequest));
+            return ResponseEntity.status(OK).body(response);
+        }
+        catch (NotFoundException exception) {
+            LOGGER.error(exception.getMessage(), exception);
+            return new ResponseEntity<>(new VnfWorkflowRelationResponse(Collections.singletonList(exception.getMessage())),HttpStatus.NOT_FOUND);
+        }
+        catch (Exception exception) {
+            return handleException(exception, "Failed to get workflows for vnf");
+        }
+    }
+    
+    @RequestMapping(value = {VNF_WORKFLOW_RELATION}, method = RequestMethod.POST)
+    public ResponseEntity createWorkflowRelation(@RequestBody VnfWorkflowRelationRequest vnfWorkflowRelationRequest) throws IOException, InterruptedException {
+    	VnfWorkflowRelationResponse vnfWorkflowRelationResponse;
+        try {
+            vnfWorkflowRelationResponse = changeManagementService.addVnfWorkflowRelation(vnfWorkflowRelationRequest);
+        }
+        catch (Exception exception) {
+            return handleException(exception, "Failed to add vnf to workflow relation");
+        }
+        
+        return new ResponseEntity<>(vnfWorkflowRelationResponse, OK);
+    }
+
+    @RequestMapping(value = {VNF_WORKFLOW_RELATION}, method = RequestMethod.GET)
+    public ResponseEntity getAllWorkflowRelation() throws IOException, InterruptedException {
+
+        try {
+            VnfWorkflowRelationAllResponse vnfWorkflowRelationAllResponse = changeManagementService.getAllVnfWorkflowRelations();
+            return new ResponseEntity<>(vnfWorkflowRelationAllResponse, OK);
+        }
+        catch (Exception exception) {
+            return handleException(exception, "Failed to get all vnf to workflow relations");
+        }
+    }
+    
+    @RequestMapping(value = {VNF_WORKFLOW_RELATION}, method = RequestMethod.DELETE)
+    public ResponseEntity deleteWorkflowRelation(@RequestBody VnfWorkflowRelationRequest vnfWorkflowRelationRequest) throws IOException, InterruptedException {
+    	VnfWorkflowRelationResponse vnfWorkflowRelationResponse;
+    	try {
+    		vnfWorkflowRelationResponse = changeManagementService.deleteVnfWorkflowRelation(vnfWorkflowRelationRequest);
+        }
+        catch (Exception exception) {
+            return handleException(exception, "Failed to delete vnf from workflow relation");
+        }
+
+        return new ResponseEntity<>(vnfWorkflowRelationResponse, OK);
+    }
+
+    private ResponseEntity handleException(Exception exception, String msg) {
+        LOGGER.error(msg, exception);
+        return new ResponseEntity<>(new VnfWorkflowRelationResponse(Collections.singletonList(msg)), HttpStatus.INTERNAL_SERVER_ERROR);
+    }
+
+
+    private ExceptionResponse handleException(Exception e) {
+        return ControllersUtils.handleException(e, LOGGER);
+    }
+
+    @ExceptionHandler(Exception.class)
+    @ResponseStatus(value=OK) //return 200 for Backwards compatibility with the previous responses to scheduler
+    private MsoResponseWrapperInterface exceptionHandler(Exception e) {
+        return exceptionHandler(e, INTERNAL_SERVER_ERROR);
+    }
+
+    @ExceptionHandler({
+            javax.ws.rs.BadRequestException.class,
+    })
+    @ResponseStatus(value = OK) //return 200 for Backwards compatibility with the previous responses to scheduler
+    public MsoResponseWrapperInterface clientDerivedExceptionAsBadRequest(Exception e) {
+        // same handler, different HTTP Code
+        return exceptionHandler(e, BAD_REQUEST);
+    }
+
+    private MsoResponseWrapperInterface exceptionHandler(Exception e, HttpStatus httpStatus) {
+        LOGGER.error(EELFLoggerDelegate.errorLogger, "{}: {}", getMethodName(), ExceptionUtils.getMessage(e), e);
+        MsoResponseWrapper2<MsoExceptionResponse> responseWrapper2 = new MsoResponseWrapper2<>(httpStatus.value(), new MsoExceptionResponse(e));
+        return responseWrapper2;
+    }
+
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/controller/ControllersUtils.java b/vid-app-common/src/main/java/org/onap/vid/controller/ControllersUtils.java
new file mode 100644
index 0000000..1df4f42
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/controller/ControllersUtils.java
@@ -0,0 +1,40 @@
+package org.onap.vid.controller;
+
+import org.apache.commons.lang3.exception.ExceptionUtils;
+import org.openecomp.portalsdk.core.domain.User;
+import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
+import org.openecomp.portalsdk.core.util.SystemProperties;
+import org.onap.vid.model.ExceptionResponse;
+import org.slf4j.MDC;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpSession;
+
+import static com.att.eelf.configuration.Configuration.MDC_KEY_REQUEST_ID;
+import static org.onap.vid.utils.Logging.getMethodName;
+
+public class ControllersUtils {
+
+
+    public static String extractUserId(HttpServletRequest request) {
+        String userId = "";
+        HttpSession session = request.getSession();
+        if (session != null) {
+            User user = (User) session.getAttribute(SystemProperties.getProperty(SystemProperties.USER_ATTRIBUTE_NAME));
+            if (user != null) {
+                //userId = user.getHrid();
+                userId = user.getLoginId();
+                if (userId == null)
+                    userId = user.getOrgUserId();
+            }
+        }
+        return userId;
+    }
+
+    public static ExceptionResponse handleException(Exception e, EELFLoggerDelegate logger) {
+        logger.error(EELFLoggerDelegate.errorLogger, "{}: {}", getMethodName(), ExceptionUtils.getMessage(e), e);
+
+        ExceptionResponse exceptionResponse = new ExceptionResponse(e);
+        return exceptionResponse;
+    }
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/controller/HealthCheckController.java b/vid-app-common/src/main/java/org/onap/vid/controller/HealthCheckController.java
new file mode 100644
index 0000000..2368649
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/controller/HealthCheckController.java
@@ -0,0 +1,192 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * VID
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.vid.controller;
+
+import org.openecomp.portalsdk.core.controller.UnRestrictedBaseController;
+import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
+import org.openecomp.portalsdk.core.util.SystemProperties;
+import org.onap.vid.dao.FnAppDoaImpl;
+import org.springframework.http.MediaType;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.io.IOException;
+import java.text.DateFormat;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+
+/**
+ * Controller for user profile view. The view is restricted to authenticated
+ * users. The view name resolves to page user_profile.jsp which uses Angular.
+ */
+
+@RestController
+@RequestMapping("/")
+public class HealthCheckController extends UnRestrictedBaseController {
+
+
+	/** The logger. */
+	private static final EELFLoggerDelegate LOGGER = EELFLoggerDelegate.getLogger(HealthCheckController.class);
+		
+		/** The Constant dateFormat. */
+		final static DateFormat dateFormat = new SimpleDateFormat("HH:mm:ss:SSSS");
+		
+	   private static final String HEALTH_CHECK_PATH = "/healthCheck";
+	   
+	   /**
+		 * Model for JSON response with health-check results.
+		 */
+		public class HealthStatus {
+			// Either 200 or 500
+			public int statusCode;
+			
+			// Additional detail in case of error, empty in case of success.
+			public String message;
+			
+			public String date;
+
+			public HealthStatus(int code, String msg) {
+				this.statusCode = code;
+				this.message = msg;
+			}
+			
+			public HealthStatus(int code,String date, String msg) {
+				this.statusCode = code;
+				this.message = msg;
+				this.date=date;
+			}
+
+			public int getStatusCode() {
+				return statusCode;
+			}
+
+			public void setStatusCode(int code) {
+				this.statusCode = code;
+			}
+
+			public String getMessage() {
+				return message;
+			}
+
+			public void setMessage(String msg) {
+				this.message = msg;
+			}
+			
+			public String getDate() {
+				return date;
+			}
+
+			public void setDate(String date) {
+				this.date = date;
+			}
+
+		}
+  
+	   @SuppressWarnings("unchecked")
+		public int getProfileCount(String driver, String URL, String username, String password) {
+		   FnAppDoaImpl doa= new FnAppDoaImpl();
+		   int count= doa.getProfileCount(driver,URL,username,password);
+			return count;
+		}
+	   
+	   
+	   
+		/**
+		 * Obtain the HealthCheck Status from the System.Properties file.
+		 * Used by IDNS for redundancy
+		 * @return ResponseEntity The response entity
+		 * @throws IOException Signals that an I/O exception has occurred.
+		 * @throws InterruptedException the interrupted exception
+		 */	
+		@RequestMapping(value="/healthCheck",method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)  	
+		public HealthStatus gethealthCheckStatusforIDNS() throws IOException, InterruptedException {
+
+			String driver = SystemProperties.getProperty("db.driver");
+			String URL = SystemProperties.getProperty("db.connectionURL");
+			String username = SystemProperties.getProperty("db.userName");
+			String password = SystemProperties.getProperty("db.password");
+			
+			LOGGER.debug(EELFLoggerDelegate.debugLogger, "driver ::" + driver);
+			LOGGER.debug(EELFLoggerDelegate.debugLogger, "URL::" + URL);
+			LOGGER.debug(EELFLoggerDelegate.debugLogger, "username::" + username);
+			LOGGER.debug(EELFLoggerDelegate.debugLogger,"password::" + password);
+			
+			
+			HealthStatus healthStatus = null;   
+			try {
+				LOGGER.debug(EELFLoggerDelegate.debugLogger, "Performing health check");
+				int count=getProfileCount(driver,URL,username,password);
+				LOGGER.debug(EELFLoggerDelegate.debugLogger,"count:::"+count);
+				healthStatus = new HealthStatus(200, "health check succeeded");
+			} catch (Exception ex) {
+			
+				LOGGER.error(EELFLoggerDelegate.errorLogger, "Failed to perform health check", ex);
+				healthStatus = new HealthStatus(500, "health check failed: " + ex.toString());
+			}
+			return healthStatus;
+		}
+		
+		/**
+		 * Obtain the  HealthCheck Status from the System.Properties file.
+		 *
+		 * @return ResponseEntity The response entity
+		 * @throws IOException Signals that an I/O exception has occurred.
+		 * @throws InterruptedException the interrupted exception
+		 * Project :
+		 */	
+		@RequestMapping(value="rest/healthCheck/{User-Agent}/{X-ECOMP-RequestID}",method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)  	
+		public HealthStatus getHealthCheck(
+				@PathVariable("User-Agent") String UserAgent,
+				@PathVariable("X-ECOMP-RequestID") String ECOMPRequestID) throws IOException, InterruptedException {
+
+			String driver = SystemProperties.getProperty("db.driver");
+			String URL = SystemProperties.getProperty("db.connectionURL");
+			String username = SystemProperties.getProperty("db.userName");
+			String password = SystemProperties.getProperty("db.password");
+			
+				LOGGER.debug(EELFLoggerDelegate.debugLogger, "driver ::" + driver);
+				LOGGER.debug(EELFLoggerDelegate.debugLogger, "URL::" + URL);
+				LOGGER.debug(EELFLoggerDelegate.debugLogger, "username::" + username);
+				LOGGER.debug(EELFLoggerDelegate.debugLogger,"password::" + password);
+				
+			
+			HealthStatus healthStatus = null;   
+			try {
+				LOGGER.debug(EELFLoggerDelegate.debugLogger, "Performing health check");
+				LOGGER.debug(EELFLoggerDelegate.debugLogger, "User-Agent" + UserAgent);
+				LOGGER.debug(EELFLoggerDelegate.debugLogger, "X-ECOMP-RequestID" + ECOMPRequestID);
+
+				
+				int count=getProfileCount(driver,URL,username,password);
+				
+				LOGGER.debug(EELFLoggerDelegate.debugLogger,"count:::"+count);
+				healthStatus = new HealthStatus(200,dateFormat.format(new Date()) ,"health check succeeded");
+			} catch (Exception ex) {
+			
+				LOGGER.error(EELFLoggerDelegate.errorLogger, "Failed to perform health check", ex);
+				healthStatus = new HealthStatus(500,dateFormat.format(new Date()),"health check failed: " + ex.toString());
+			}
+			return healthStatus;
+		}
+}
+
diff --git a/vid-app-common/src/main/java/org/onap/vid/controller/LoggerController.java b/vid-app-common/src/main/java/org/onap/vid/controller/LoggerController.java
new file mode 100644
index 0000000..e70c871
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/controller/LoggerController.java
@@ -0,0 +1,115 @@
+package org.onap.vid.controller;
+
+import ch.qos.logback.classic.LoggerContext;
+import ch.qos.logback.core.Appender;
+import ch.qos.logback.core.FileAppender;
+import ch.qos.logback.core.spi.AppenderAttachable;
+import org.apache.commons.io.input.ReversedLinesFileReader;
+import org.apache.commons.lang3.StringUtils;
+import org.openecomp.portalsdk.core.controller.RestrictedBaseController;
+import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
+import org.onap.vid.model.ExceptionResponse;
+import org.onap.vid.roles.Role;
+import org.onap.vid.roles.RoleProvider;
+import org.onap.vid.utils.Streams;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.HttpStatus;
+import org.springframework.web.bind.annotation.*;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.ws.rs.InternalServerErrorException;
+import javax.ws.rs.NotAuthorizedException;
+import java.io.File;
+import java.io.IOException;
+import java.util.List;
+import java.util.Objects;
+import java.util.function.Supplier;
+import java.util.stream.Collectors;
+import java.util.stream.Stream;
+
+import static com.att.eelf.configuration.Configuration.GENERAL_LOGGER_NAME;
+
+
+@RestController
+@RequestMapping("logger")
+public class LoggerController extends RestrictedBaseController {
+
+    private static final EELFLoggerDelegate LOGGER = EELFLoggerDelegate.getLogger(LoggerController.class);
+
+    @Autowired
+    RoleProvider roleProvider;
+
+    @RequestMapping(value = "/{loggerName:audit|error|metrics}", method = RequestMethod.GET)
+    public String getLog(@PathVariable String loggerName, HttpServletRequest request,
+                         @RequestParam(value="limit", defaultValue = "5000") Integer limit) throws IOException {
+
+        List<Role> roles = roleProvider.getUserRoles(request);
+        boolean userPermitted = roleProvider.userPermissionIsReadLogs(roles);
+        if (!userPermitted) {
+            throw new NotAuthorizedException("User not authorized to get logs");
+        }
+
+        String logfilePath = getLogfilePath(loggerName);
+
+        try (final ReversedLinesFileReader reader = new ReversedLinesFileReader(new File(logfilePath))) {
+            Supplier<String> reverseLinesSupplier = () -> {
+                try {
+                    return reader.readLine();
+                } catch (NullPointerException e) {
+                    // EOF Reached
+                    return null;
+                } catch (IOException e) {
+                    throw new InternalServerErrorException("error while reading " + logfilePath, e);
+                }
+            };
+
+            return Streams.takeWhile(
+                    Stream.generate(reverseLinesSupplier),
+                    line -> !StringUtils.contains(line, "Logging is started"))
+                    .limit(limit)
+                    .limit(5_000)
+                    .filter(Objects::nonNull)
+                    .collect(Collectors.joining("\n"));
+        }
+    }
+
+    private String getLogfilePath(String loggerName) {
+        /*
+        Find the requested logger, and pull all of it's appenders.
+        Find the first of the appenders that is a FileAppender, and return it's
+        write-out filename.
+         */
+        LoggerContext context = (LoggerContext) LoggerFactory.getILoggerFactory();
+        return context.getLoggerList().stream()
+                .filter(logger -> logger.getName().equals(GENERAL_LOGGER_NAME + "." + loggerName))
+                .flatMap(this::pullSubAppenders)
+                .flatMap(appender -> {
+                    // Appender might be "attachable", if so - roll-up its sub-appenders
+                    return (appender instanceof AppenderAttachable) ?
+                            pullSubAppenders((AppenderAttachable<?>) appender) : Stream.of(appender);
+                })
+                .filter(appender -> appender instanceof FileAppender)
+                .map(appender -> (FileAppender<?>) appender)
+                .map(FileAppender::getFile)
+                .findFirst()
+                .orElseThrow(() -> new InternalServerErrorException("logfile for " + loggerName + " not found"));
+    }
+
+    private <T> Stream<Appender<T>> pullSubAppenders(AppenderAttachable<T> logger) {
+        return Streams.fromIterator(logger.iteratorForAppenders());
+    }
+
+    @ExceptionHandler({ NotAuthorizedException.class })
+    @ResponseStatus(HttpStatus.UNAUTHORIZED)
+    public String notAuthorizedHandler(NotAuthorizedException e) {
+        return "UNAUTHORIZED";
+    }
+
+    @ExceptionHandler({ IOException.class, InternalServerErrorException.class })
+    @ResponseStatus(HttpStatus.INTERNAL_SERVER_ERROR)
+    public ExceptionResponse ioExceptionHandler(Exception e) {
+        return org.onap.vid.controller.ControllersUtils.handleException(e, LOGGER);
+    }
+
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/controller/MaintenanceController.java b/vid-app-common/src/main/java/org/onap/vid/controller/MaintenanceController.java
new file mode 100644
index 0000000..df1e6e4
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/controller/MaintenanceController.java
@@ -0,0 +1,135 @@
+package org.onap.vid.controller;
+
+
+import org.openecomp.portalsdk.core.controller.UnRestrictedBaseController;
+import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
+import org.onap.vid.category.AddCategoryOptionResponse;
+import org.onap.vid.category.AddCategoryOptionsRequest;
+import org.onap.vid.category.CategoryParameterOptionRep;
+import org.onap.vid.category.CategoryParametersResponse;
+import org.onap.vid.model.CategoryParameter.Family;
+import org.onap.vid.model.CategoryParameterOption;
+import org.onap.vid.services.CategoryParameterService;
+import org.onap.vid.services.CategoryParameterServiceImpl;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.ResponseEntity;
+import org.springframework.web.bind.annotation.*;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.ws.rs.ForbiddenException;
+import java.util.Arrays;
+import java.util.Collections;
+
+import static org.onap.vid.utils.Logging.getMethodName;
+
+/**
+ * Controler for APIs that are used only by vid operators
+ */
+
+@RestController
+@RequestMapping(MaintenanceController.Maintenance)
+public class MaintenanceController extends UnRestrictedBaseController {
+
+    public static final String Maintenance = "maintenance";
+
+    @Autowired
+    protected CategoryParameterService categoryParameterService;
+    private static final EELFLoggerDelegate LOGGER = EELFLoggerDelegate.getLogger(MaintenanceController.class);
+
+    /**
+     * Add list of options to one category parameter
+     * @param request the request
+     * @return the new option
+     * @throws Exception the exception
+     */
+    @RequestMapping(value = "/category_parameter/{categoryName}", method = RequestMethod.POST)
+    public ResponseEntity addCategoryOptions (
+            HttpServletRequest request, @PathVariable String categoryName, @RequestBody AddCategoryOptionsRequest option) throws Exception {
+        LOGGER.debug(EELFLoggerDelegate.debugLogger, "start {}({})", getMethodName());
+        try {
+            AddCategoryOptionResponse response = categoryParameterService.createCategoryParameterOptions(categoryName, option);
+            HttpStatus httpStatus = response.getErrors().size()>0 ? HttpStatus.MULTI_STATUS : HttpStatus.OK;
+            LOGGER.debug(EELFLoggerDelegate.debugLogger, "end {}() => {}", getMethodName(), response);
+            return new ResponseEntity<>(response, httpStatus);
+        }
+        catch (CategoryParameterServiceImpl.UnfoundedCategoryException exception) {
+            return new ResponseEntity<>(new AddCategoryOptionResponse(Collections.singletonList(exception.getMessage())), HttpStatus.NOT_FOUND);
+        }
+        catch (Exception exception) {
+            LOGGER.error("failed to add option to parameter category " + categoryName, exception);
+            return new ResponseEntity<>(HttpStatus.INTERNAL_SERVER_ERROR);
+        }
+    }
+
+    @RequestMapping(value = "/category_parameter/{categoryName}", method = RequestMethod.PUT)
+    public ResponseEntity updateNameForOption (
+            HttpServletRequest request, @PathVariable String categoryName, @RequestBody CategoryParameterOptionRep option) throws Exception {
+        LOGGER.debug(EELFLoggerDelegate.debugLogger, "start {}({})", getMethodName());
+        try {
+            AddCategoryOptionResponse response = categoryParameterService.updateCategoryParameterOption(categoryName, option);
+            HttpStatus httpStatus = response.getErrors().size()>0 ? HttpStatus.MULTI_STATUS : HttpStatus.OK;
+            LOGGER.debug(EELFLoggerDelegate.debugLogger, "end {}() => {}", getMethodName(), response);
+            return new ResponseEntity<>(response, httpStatus);
+        }
+        catch (ForbiddenException exception) {
+            return new ResponseEntity<>(new AddCategoryOptionResponse(Collections.singletonList(exception.getMessage())), HttpStatus.FORBIDDEN);
+        }
+        catch (CategoryParameterServiceImpl.UnfoundedCategoryException|CategoryParameterServiceImpl.UnfoundedCategoryOptionException exception) {
+            return new ResponseEntity<>(new AddCategoryOptionResponse(Collections.singletonList(exception.getMessage())), HttpStatus.NOT_FOUND);
+        }
+        catch (CategoryParameterServiceImpl.AlreadyExistOptionNameException exception) {
+            return new ResponseEntity<>(new AddCategoryOptionResponse(Collections.singletonList(exception.getMessage())), HttpStatus.CONFLICT);
+        }
+        catch (Exception exception) {
+            LOGGER.error("failed to update option to parameter category " + categoryName, exception);
+            return new ResponseEntity<>(HttpStatus.INTERNAL_SERVER_ERROR);
+        }
+    }
+
+    /**
+     * Gets the owning entity properties.
+     * @param request the request
+     * @return the property
+     * @throws Exception the exception
+     */
+    @RequestMapping(value = "/category_parameter", method = RequestMethod.GET)
+    public ResponseEntity getCategoryParameter(HttpServletRequest request, @RequestParam(value="familyName", required = true) Family familyName) throws Exception {
+        LOGGER.debug(EELFLoggerDelegate.debugLogger, "start {}({})", getMethodName());
+        try {
+            CategoryParametersResponse response = categoryParameterService.getCategoryParameters(familyName);
+            LOGGER.debug(EELFLoggerDelegate.debugLogger, "end {}() => {}", getMethodName(), response);
+            return new ResponseEntity<>(response, HttpStatus.OK);
+        }
+        catch (Exception exception) {
+            LOGGER.error("failed to retrieve category parameter list from DB.", exception);
+            return new ResponseEntity<>(HttpStatus.INTERNAL_SERVER_ERROR);
+        }
+    }
+
+
+    /**
+     * Delete option of the category.
+     * @param request the request
+     * @throws Exception the exception
+     */
+    @RequestMapping(value = "/delete_category_parameter/{categoryName}", method = RequestMethod.POST)
+    public ResponseEntity deleteCategoryOption (
+            HttpServletRequest request, @PathVariable String categoryName, @RequestBody CategoryParameterOption option) throws Exception {
+        LOGGER.debug(EELFLoggerDelegate.debugLogger, "start {}({})", getMethodName());
+
+        try {
+            categoryParameterService.deleteCategoryOption(categoryName, option);
+            LOGGER.debug(EELFLoggerDelegate.debugLogger, "end {}() => {}", getMethodName(), HttpStatus.OK);
+            return new ResponseEntity<>(HttpStatus.OK);
+        }
+        catch (CategoryParameterServiceImpl.UnfoundedCategoryException exception) {
+            return new ResponseEntity<>(new AddCategoryOptionResponse(Arrays.asList(exception.getMessage())), HttpStatus.NOT_FOUND);
+        }
+        catch (Exception exception) {
+            LOGGER.error("failed to add/update owning entity option", exception);
+            return new ResponseEntity<>(HttpStatus.INTERNAL_SERVER_ERROR);
+        }
+    }
+
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/controller/MsoConfig.java b/vid-app-common/src/main/java/org/onap/vid/controller/MsoConfig.java
new file mode 100644
index 0000000..2aa52b8
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/controller/MsoConfig.java
@@ -0,0 +1,42 @@
+package org.onap.vid.controller;
+
+import com.fasterxml.jackson.databind.ObjectMapper;
+import org.onap.vid.factories.MsoRequestFactory;
+import org.onap.vid.mso.MsoBusinessLogic;
+import org.onap.vid.mso.MsoBusinessLogicImpl;
+import org.onap.vid.mso.MsoInterface;
+import org.onap.vid.mso.rest.MsoRestClientNew;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+
+
+@Configuration
+public class MsoConfig {
+
+    /**
+     * Gets the object mapper.
+     *
+     * @return the object mapper
+     */
+    @Bean
+    public ObjectMapper getObjectMapper() {
+        return new ObjectMapper();
+    }
+
+    @Bean
+    public MsoRequestFactory createRequestDetailsFactory(){
+        return new MsoRequestFactory();
+    }
+
+    @Bean
+    public MsoInterface getMsoClient(){
+        return new MsoRestClientNew();
+    }
+
+    @Bean
+    public MsoBusinessLogic getMsoBusinessLogic(){
+        return new MsoBusinessLogicImpl(getMsoClient());
+    }
+
+
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/controller/MsoController.java b/vid-app-common/src/main/java/org/onap/vid/controller/MsoController.java
new file mode 100644
index 0000000..1ce1d64
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/controller/MsoController.java
@@ -0,0 +1,655 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * VID
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.vid.controller;
+
+
+import com.fasterxml.jackson.databind.ObjectMapper;
+import org.onap.vid.model.ExceptionResponse;
+import org.onap.vid.mso.MsoBusinessLogic;
+import org.onap.vid.mso.MsoResponseWrapper;
+import org.onap.vid.mso.rest.Request;
+import org.onap.vid.mso.rest.RequestDetails;
+import org.onap.vid.mso.rest.Task;
+import org.openecomp.portalsdk.core.controller.RestrictedBaseController;
+import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.ResponseEntity;
+import org.springframework.web.bind.annotation.*;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.io.PrintWriter;
+import java.io.StringWriter;
+import java.text.DateFormat;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+import java.util.List;
+
+//import java.util.UUID;
+//import org.springframework.http.ResponseEntity;
+//import org.springframework.http.RequestEntity;
+
+/**
+ * The Class MsoController.
+ */
+@RestController
+@RequestMapping("mso")
+public class MsoController extends RestrictedBaseController {
+
+    /**
+     * The logger.
+     */
+    private static final EELFLoggerDelegate LOGGER = EELFLoggerDelegate.getLogger(MsoController.class);
+
+    /**
+     * The Constant dateFormat.
+     */
+    final static DateFormat dateFormat = new SimpleDateFormat("HH:mm:ss:SSSS");
+
+    /**
+     * The Constant SVC_INSTANCE_ID.
+     */
+    public final static String SVC_INSTANCE_ID = "<service_instance_id>";
+    public final static String REQUEST_TYPE = "<request_type>";
+
+    /**
+     * The Constant CONFIGURATION_ID
+     */
+    public final static String CONFIGURATION_ID = "<configuration_id>";
+
+    /**
+     * The Constant VNF_INSTANCE_ID.
+     */
+    public final static String VNF_INSTANCE_ID = "<vnf_instance_id>";
+
+    private final MsoBusinessLogic msoBusinessLogic;
+
+    @Autowired
+    public MsoController(MsoBusinessLogic msoBusinessLogic) {
+        this.msoBusinessLogic = msoBusinessLogic;
+    }
+
+    /**
+     * Creates the svc instance.
+     *
+     * @param request the request
+     * @return the response entity
+     * @throws Exception the exception
+     */
+    @RequestMapping(value = "/mso_create_svc_instance", method = RequestMethod.POST)
+    public ResponseEntity<String> createSvcInstance(HttpServletRequest request, @RequestBody RequestDetails mso_request) throws Exception {
+        String methodName = "createSvcInstance";
+
+        LOGGER.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
+
+        // always return OK, the MSO status code is embedded in the body
+
+        MsoResponseWrapper w = msoBusinessLogic.createSvcInstance(mso_request);
+
+        return (new ResponseEntity<>(w.getResponse(), HttpStatus.OK));
+
+    }
+
+    /**
+     * Creates the vnf.
+     *
+     * @param serviceInstanceId the service instance id
+     * @param request           the request
+     * @return the response entity
+     * @throws Exception the exception
+     */
+    @RequestMapping(value = "/mso_create_vnf_instance/{serviceInstanceId}", method = RequestMethod.POST)
+    public ResponseEntity<String> createVnf(@PathVariable("serviceInstanceId") String serviceInstanceId, HttpServletRequest request, @RequestBody RequestDetails mso_request) throws Exception {
+
+        MsoResponseWrapper w = msoBusinessLogic.createVnf(mso_request, serviceInstanceId);
+
+        // always return OK, the MSO status code is embedded in the body
+
+        return (new ResponseEntity<String>(w.getResponse(), HttpStatus.OK));
+
+    }
+
+    /**
+     * Creates the nw instance.
+     *
+     * @param serviceInstanceId the service instance id
+     * @param request           the request
+     * @return the response entity
+     * @throws Exception the exception
+     */
+    @RequestMapping(value = "/mso_create_nw_instance/{serviceInstanceId}", method = RequestMethod.POST)
+    public ResponseEntity<String> createNwInstance(@PathVariable("serviceInstanceId") String serviceInstanceId, HttpServletRequest request, @RequestBody RequestDetails mso_request) throws Exception {
+        String methodName = "createNwInstance";
+        LOGGER.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start, serviceInstanceId = " + serviceInstanceId);
+
+        MsoResponseWrapper w = msoBusinessLogic.createNwInstance(mso_request, serviceInstanceId);
+
+        return (new ResponseEntity<String>(w.getResponse(), HttpStatus.OK));
+
+    }
+
+    /**
+     * Creates the volume group instance.
+     *
+     * @param serviceInstanceId the service instance id
+     * @param vnfInstanceId     the vnf instance id
+     * @param request           the request
+     * @return the response entity
+     * @throws Exception the exception
+     */
+    @RequestMapping(value = "/mso_create_volumegroup_instance/{serviceInstanceId}/vnfs/{vnfInstanceId}", method = RequestMethod.POST)
+    public ResponseEntity<String> createVolumeGroupInstance(@PathVariable("serviceInstanceId") String serviceInstanceId, @PathVariable("vnfInstanceId") String vnfInstanceId,
+                                                            HttpServletRequest request, @RequestBody RequestDetails mso_request) throws Exception {
+        String methodName = "createVolumeGroupInstance";
+        LOGGER.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
+
+        MsoResponseWrapper w = msoBusinessLogic.createVolumeGroupInstance(mso_request, serviceInstanceId, vnfInstanceId);
+
+        // always return OK, the MSO status code is embedded in the body
+        return (new ResponseEntity<String>(w.getResponse(), HttpStatus.OK));
+    }
+
+    /**
+     * Creates the vf module instance.
+     *
+     * @param serviceInstanceId the service instance id
+     * @param vnfInstanceId     the vnf instance id
+     * @param request           the request
+     * @return the response entity
+     * @throws Exception the exception
+     */
+    @RequestMapping(value = "/mso_create_vfmodule_instance/{serviceInstanceId}/vnfs/{vnfInstanceId}", method = RequestMethod.POST)
+    public ResponseEntity<String> createVfModuleInstance(@PathVariable("serviceInstanceId") String serviceInstanceId,
+                                                         @PathVariable("vnfInstanceId") String vnfInstanceId, HttpServletRequest request, @RequestBody RequestDetails mso_request) throws Exception {
+        String methodName = "createVfModuleInstance";
+
+        LOGGER.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
+
+        MsoResponseWrapper w = msoBusinessLogic.createVfModuleInstance(mso_request, serviceInstanceId, vnfInstanceId);
+
+        // always return OK, the MSO status code is embedded in the body
+
+        return (new ResponseEntity<String>(w.getResponse(), HttpStatus.OK));
+    }
+
+    /**
+     * Creates a configuration instance.
+     *
+     * @param serviceInstanceId the service instance id
+     * @param request           the request
+     * @return the response entity
+     * @throws Exception the exception
+     */
+    @RequestMapping(value = "/mso_create_configuration_instance/{serviceInstanceId}/configurations/", method = RequestMethod.POST)
+    public ResponseEntity<String> createConfigurationInstance(@PathVariable("serviceInstanceId") String serviceInstanceId,
+                                                         HttpServletRequest request, @RequestBody RequestDetails mso_request) throws Exception {
+        String methodName = "createConfigurationInstance";
+        LOGGER.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
+
+        MsoResponseWrapper w = msoBusinessLogic.createConfigurationInstance(mso_request, serviceInstanceId);
+
+        // always return OK, the MSO status code is embedded in the body
+
+        return (new ResponseEntity<>(w.getResponse(), HttpStatus.OK));
+    }
+
+	/**
+     * Delete svc instance.
+     *
+     * @param serviceInstanceId the service instance id
+     * @param request           the request
+     * @return the response entity
+     * @throws Exception the exception
+     */
+    @RequestMapping(value = "/mso_delete_svc_instance/{serviceInstanceId}", method = RequestMethod.POST)
+    public ResponseEntity<String> deleteSvcInstance(@PathVariable("serviceInstanceId") String serviceInstanceId,
+                                                    HttpServletRequest request, @RequestBody RequestDetails mso_request) throws Exception {
+
+        String methodName = "deleteSvcInstance";
+        LOGGER.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
+
+        MsoResponseWrapper w = msoBusinessLogic.deleteSvcInstance(mso_request, serviceInstanceId);
+
+        LOGGER.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " w=" + w.getResponse());
+        // always return OK, the MSO status code is embedded in the body
+
+        return (new ResponseEntity<String>(w.getResponse(), HttpStatus.OK));
+
+    }
+
+    /**
+     * Delete vnf.
+     *
+     * @param serviceInstanceId the service instance id
+     * @param vnfInstanceId     the vnf instance id
+     * @param request           the request
+     * @return the response entity
+     * @throws Exception the exception
+     */
+    @RequestMapping(value = "/mso_delete_vnf_instance/{serviceInstanceId}/vnfs/{vnfInstanceId}", method = RequestMethod.POST)
+
+    public ResponseEntity<String> deleteVnf(@PathVariable("serviceInstanceId") String serviceInstanceId, @PathVariable("vnfInstanceId") String vnfInstanceId,
+                                            HttpServletRequest request, @RequestBody RequestDetails mso_request) throws Exception {
+        String methodName = "deleteVnf";
+
+        LOGGER.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
+
+        MsoResponseWrapper w = msoBusinessLogic.deleteVnf(mso_request, serviceInstanceId, vnfInstanceId);
+
+        // always return OK, the MSO status code is embedded in the body
+        return (new ResponseEntity<String>(w.getResponse(), HttpStatus.OK));
+
+    }
+
+    /**
+     * Delete configuration instance
+     * @param serviceInstanceId the service instance id
+     * @param configurationId the configuration id
+     * @param mso_request the request
+     * @return the response entity
+     * @throws Exception the exception
+     */
+    @RequestMapping(value = "mso_delete_configuration/{serviceInstanceId}/configurations/{configurationId}",
+            method = RequestMethod.POST)
+    public ResponseEntity<String> deleteConfiguration(
+            @PathVariable("serviceInstanceId") String serviceInstanceId,
+            @PathVariable ("configurationId") String configurationId,
+            @RequestBody RequestDetails mso_request) throws Exception {
+
+        String methodName = "deleteConfiguration";
+        LOGGER.debug(EELFLoggerDelegate.debugLogger,
+                dateFormat.format(new Date()) + "<== " + methodName + " start");
+
+        MsoResponseWrapper w = msoBusinessLogic.deleteConfiguration(mso_request, serviceInstanceId, configurationId);
+
+        // always return OK, the MSO status code is embedded in the body
+        return (new ResponseEntity<String>(w.getResponse(), HttpStatus.OK));
+    }
+
+    /**
+     * Activate configuration instance
+     * @param serviceInstanceId the service instace id
+     * @param configurationId the configuration id
+     * @param mso_request the request
+     * @return the response entity
+     * @throws Exception the exception
+     */
+    @RequestMapping(value = "mso_activate_configuration/{serviceInstanceId}/configurations/{configurationId}",
+            method = RequestMethod.POST)
+    public ResponseEntity<String> activateConfiguration(
+            @PathVariable("serviceInstanceId") String serviceInstanceId,
+            @PathVariable("configurationId") String configurationId,
+            @RequestBody RequestDetails mso_request) throws Exception {
+
+        MsoResponseWrapper w = msoBusinessLogic.setConfigurationActiveStatus(mso_request, serviceInstanceId, configurationId, true);
+
+        // always return OK, the MSO status code is embedded in the body
+        return (new ResponseEntity<String>(w.getResponse(), HttpStatus.OK));
+    }
+
+    /**
+     * Deactivate configuration instance
+     * @param serviceInstanceId the service instace id
+     * @param configurationId the configuration id
+     * @param mso_request the request
+     * @return the response entity
+     * @throws Exception the exception
+     */
+    @RequestMapping(value = "mso_deactivate_configuration/{serviceInstanceId}/configurations/{configurationId}",
+            method = RequestMethod.POST)
+    public ResponseEntity<String> deactivateConfiguration(
+            @PathVariable("serviceInstanceId") String serviceInstanceId,
+            @PathVariable("configurationId") String configurationId,
+            @RequestBody RequestDetails mso_request) throws Exception {
+
+        MsoResponseWrapper w = msoBusinessLogic.setConfigurationActiveStatus(mso_request, serviceInstanceId, configurationId, false);
+
+        // always return OK, the MSO status code is embedded in the body
+        return (new ResponseEntity<String>(w.getResponse(), HttpStatus.OK));
+    }
+
+    /**
+     * Disable port on configuration instance
+     * @param serviceInstanceId the service instance id
+     * @param configurationId the configuration instance id
+     * @param mso_request the request
+     * @return the response entity
+     * @throws Exception the exception
+     */
+    @RequestMapping(value = "mso_disable_port_configuration/{serviceInstanceId}/configurations/{configurationId}",
+            method = RequestMethod.POST)
+    public ResponseEntity<String> disablePortOnConfiguration(
+            @PathVariable("serviceInstanceId") String serviceInstanceId,
+            @PathVariable("configurationId") String configurationId,
+            @RequestBody RequestDetails mso_request) throws Exception {
+
+        MsoResponseWrapper w = msoBusinessLogic.setPortOnConfigurationStatus(mso_request, serviceInstanceId, configurationId, false);
+
+        // always return OK, the MSO status code is embedded in the body
+        return (new ResponseEntity<String>(w.getResponse(), HttpStatus.OK));
+    }
+
+    /**
+     * Enable port on configuration instance
+     * @param serviceInstanceId the service instance id
+     * @param configurationId the configuration instance id
+     * @param mso_request the request
+     * @return the response entity
+     * @throws Exception the exception
+     */
+    @RequestMapping(value = "mso_enable_port_configuration/{serviceInstanceId}/configurations/{configurationId}",
+            method = RequestMethod.POST)
+    public ResponseEntity<String> enablePortOnConfiguration(
+            @PathVariable("serviceInstanceId") String serviceInstanceId,
+            @PathVariable("configurationId") String configurationId,
+            @RequestBody RequestDetails mso_request) throws Exception {
+
+        MsoResponseWrapper w = msoBusinessLogic.setPortOnConfigurationStatus(mso_request, serviceInstanceId, configurationId, true);
+
+        // always return OK, the MSO status code is embedded in the body
+        return (new ResponseEntity<String>(w.getResponse(), HttpStatus.OK));
+    }
+
+    /**
+     * Delete vf module.
+     *
+     * @param serviceInstanceId the service instance id
+     * @param vnfInstanceId     the vnf instance id
+     * @param vfModuleId        the vf module id
+     * @param request           the request
+     * @return the response entity
+     * @throws Exception the exception
+     */
+    //mso_delete_vf_module/bc305d54-75b4-431b-adb2-eb6b9e546014/vnfs/fe9000-0009-9999/vfmodules/abeeee-abeeee-abeeee
+    @RequestMapping(value = "/mso_delete_vfmodule_instance/{serviceInstanceId}/vnfs/{vnfInstanceId}/vfModules/{vfModuleId}", method = RequestMethod.POST)
+    public ResponseEntity<String> deleteVfModule(
+            @PathVariable("serviceInstanceId") String serviceInstanceId, @PathVariable("vnfInstanceId") String vnfInstanceId,
+            @PathVariable("vfModuleId") String vfModuleId, HttpServletRequest request, @RequestBody RequestDetails mso_request) throws Exception {
+
+        String methodName = "deleteVfModule";
+        LOGGER.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
+
+        MsoResponseWrapper w = msoBusinessLogic.deleteVfModule(mso_request, serviceInstanceId, vnfInstanceId, vfModuleId);
+
+        // always return OK, the MSO status code is embedded in the body
+        return (new ResponseEntity<String>(w.getResponse(), HttpStatus.OK));
+
+    }
+
+    /**
+     * Delete volume group instance.
+     *
+     * @param serviceInstanceId the service instance id
+     * @param vnfInstanceId     the vnf instance id
+     * @param volumeGroupId     the volume group id
+     * @param request           the request
+     * @return the response entity
+     * @throws Exception the exception
+     */
+    @RequestMapping(value = "/mso_delete_volumegroup_instance/{serviceInstanceId}/vnfs/{vnfInstanceId}/volumeGroups/{volumeGroupId}", method = RequestMethod.POST)
+    public ResponseEntity<String> deleteVolumeGroupInstance(
+            @PathVariable("serviceInstanceId") String serviceInstanceId, @PathVariable("vnfInstanceId") String vnfInstanceId, @PathVariable("volumeGroupId") String volumeGroupId,
+            HttpServletRequest request, @RequestBody RequestDetails mso_request) throws Exception {
+        String methodName = "deleteVolumeGroupInstance";
+        LOGGER.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
+
+        MsoResponseWrapper w = msoBusinessLogic.deleteVolumeGroupInstance(mso_request, serviceInstanceId, vnfInstanceId, volumeGroupId);
+
+        // always return OK, the MSO status code is embedded in the body
+        return (new ResponseEntity<String>(w.getResponse(), HttpStatus.OK));
+    }
+
+    /**
+     * Delete nw instance.
+     *
+     * @param serviceInstanceId the service instance id
+     * @param networkInstanceId the network instance id
+     * @param request           the request
+     * @return the response entity
+     * @throws Exception the exception
+     */
+    @RequestMapping(value = "/mso_delete_nw_instance/{serviceInstanceId}/networks/{networkInstanceId}", method = RequestMethod.POST)
+    public ResponseEntity<String> deleteNwInstance(@PathVariable("serviceInstanceId") String serviceInstanceId,
+                                                   @PathVariable("networkInstanceId") String networkInstanceId, HttpServletRequest request, @RequestBody RequestDetails mso_request) throws Exception {
+        String methodName = "deleteNwInstance";
+        LOGGER.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
+
+        MsoResponseWrapper w = msoBusinessLogic.deleteNwInstance(mso_request, serviceInstanceId, networkInstanceId);
+
+        // always return OK, the MSO status code is embedded in the body
+        return (new ResponseEntity<String>(w.getResponse(), HttpStatus.OK));
+
+    }
+
+    /**
+     * Gets the orchestration request.
+     *
+     * @param requestId the request id
+     * @param request   the request
+     * @return the orchestration request
+     * @throws Exception the exception
+     */
+    @RequestMapping(value = "/mso_get_orch_req/{requestId}", method = RequestMethod.GET)
+    public ResponseEntity<String> getOrchestrationRequest(@PathVariable("requestId") String requestId,
+                                                          HttpServletRequest request) throws Exception {
+
+        String methodName = "getOrchestrationRequest";
+        LOGGER.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
+
+
+        MsoResponseWrapper w = msoBusinessLogic.getOrchestrationRequest(requestId);
+
+        // always return OK, the MSO status code is embedded in the body
+        return (new ResponseEntity<String>(w.getResponse(), HttpStatus.OK));
+    }
+
+
+    /**
+     * Gets the orchestration requests.
+     *
+     * @param filterString the filter string
+     * @param request      the request
+     * @return the orchestration requests
+     * @throws Exception the exception
+     */
+    @RequestMapping(value = "/mso_get_orch_reqs/{filterString}", method = RequestMethod.GET)
+    public ResponseEntity<String> getOrchestrationRequests(@PathVariable("filterString") String filterString,
+                                                           HttpServletRequest request) throws Exception {
+
+        String methodName = "getOrchestrationRequests";
+        LOGGER.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
+
+
+        MsoResponseWrapper w = msoBusinessLogic.getOrchestrationRequests(filterString);
+
+        // always return OK, the MSO status code is embedded in the body
+        return (new ResponseEntity<String>(w.getResponse(), HttpStatus.OK));
+    }
+
+
+    /**
+     * activate to a pnf instance.
+     *
+     * @param serviceInstanceId the id of the service.
+     * @param requestDetails the body of the request.
+     * @return the response entity
+     * @throws Exception the exception
+     */
+    @RequestMapping(value = "/mso_activate_service_instance/{serviceInstanceId}", method = RequestMethod.POST)
+    public ResponseEntity<String> activateServiceInstance(@PathVariable("serviceInstanceId") String serviceInstanceId, @RequestBody RequestDetails requestDetails) throws Exception {
+        String methodName = "activateServiceInstance";
+        LOGGER.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
+
+        MsoResponseWrapper w = msoBusinessLogic.setServiceInstanceStatus(requestDetails, serviceInstanceId, true);
+        return new ResponseEntity<>(w.getResponse(), HttpStatus.OK);
+    }
+
+    /**
+     * deactivate a service instance.
+     *
+     * @param serviceInstanceId the id of the service.
+     * @param requestDetails the body of the request.
+     * @return the response entity
+     * @throws Exception the exception
+     */
+    @RequestMapping(value = "/mso_deactivate_service_instance/{serviceInstanceId}", method = RequestMethod.POST)
+    public ResponseEntity<String> deactivateServiceInstance(@PathVariable("serviceInstanceId") String serviceInstanceId, @RequestBody RequestDetails requestDetails) throws Exception {
+        String methodName = "deactivateServiceInstance";
+        LOGGER.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
+
+        MsoResponseWrapper w = msoBusinessLogic.setServiceInstanceStatus(requestDetails, serviceInstanceId, false);
+        return new ResponseEntity<>(w.getResponse(), HttpStatus.OK);
+    }
+
+
+    /**
+     * Gets the orchestration requests for the dashboard.
+     *  currently its all the orchestration requests with RequestType updateInstance or replaceInstance.
+     * @return the orchestration requests
+     * @throws Exception the exception
+     */
+    @RequestMapping(value = "/mso_get_orch_reqs/dashboard", method = RequestMethod.GET)
+    public List<Request> getOrchestrationRequestsForDashboard() throws Exception {
+
+        String methodName = "getOrchestrationRequestsForDashboard";
+        LOGGER.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
+
+
+        return msoBusinessLogic.getOrchestrationRequestsForDashboard();
+    }
+
+    /**
+     * Gets the Manual Tasks for the given request id.
+     *
+     * @param originalRequestId the id of the original request.
+     * @return the tasks
+     * @throws Exception the exception
+     */
+    @RequestMapping(value = "/mso_get_man_task/{originalRequestId}", method = RequestMethod.GET)
+    public List<Task> getManualTasksByRequestId(@PathVariable("originalRequestId") String originalRequestId) throws Exception {
+
+        String methodName = "getManualTasksByRequestId";
+        LOGGER.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
+
+        return  msoBusinessLogic.getManualTasksByRequestId(originalRequestId);
+    }
+
+
+
+    /**
+     * Complete the manual task.
+     *
+     * @param taskId the id of the task to complete.
+     * @param requestDetails the body of the request.
+     * @return the response entity
+     * @throws Exception the exception
+     */
+    @RequestMapping(value = "/mso_post_man_task/{taskId}", method = RequestMethod.POST)
+    public ResponseEntity<String> manualTaskComplete(@PathVariable("taskId") String taskId , @RequestBody RequestDetails requestDetails) throws Exception {
+
+        String methodName = "manualTaskComplete";
+        LOGGER.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
+
+        MsoResponseWrapper w = msoBusinessLogic.completeManualTask(requestDetails, taskId);
+        return new ResponseEntity<String>(w.getResponse(), HttpStatus.OK);
+    }
+
+    @RequestMapping(value = "/mso_remove_relationship/{serviceInstanceId}", method = RequestMethod.POST)
+    public ResponseEntity<String> removeRelationshipFromServiceInstance(@PathVariable("serviceInstanceId") String serviceInstanceId ,
+                                                                        @RequestBody RequestDetails requestDetails) throws Exception {
+
+        String methodName = "removeRelationshipFromServiceInstance";
+        LOGGER.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
+
+        MsoResponseWrapper w;
+        try {
+            w = msoBusinessLogic.removeRelationshipFromServiceInstance(requestDetails, serviceInstanceId);
+        } catch (Exception e){
+            LOGGER.error("Internal error when calling MSO controller logic for {}", methodName, e);
+            return new ResponseEntity<>(e.getMessage(), HttpStatus.INTERNAL_SERVER_ERROR);
+        }
+        return new ResponseEntity<>(w.getResponse(), HttpStatus.OK);
+    }
+
+    @RequestMapping(value = "/mso_add_relationship/{serviceInstanceId}", method = RequestMethod.POST)
+    public ResponseEntity<String> addRelationshipToServiceInstance(@PathVariable("serviceInstanceId") String serviceInstanceId ,
+                                                                        @RequestBody RequestDetails requestDetails) throws Exception {
+
+        String methodName = "addRelationshipToServiceInstance";
+        LOGGER.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
+
+        MsoResponseWrapper w;
+        try {
+            w = msoBusinessLogic.addRelationshipToServiceInstance(requestDetails, serviceInstanceId);
+        } catch (Exception e){
+            LOGGER.error("Internal error when calling MSO controller logic for {}", methodName, e);
+            return new ResponseEntity<>(e.getMessage(), HttpStatus.INTERNAL_SERVER_ERROR);
+        }
+        return new ResponseEntity<>(w.getResponse(), HttpStatus.OK);
+    }
+
+
+    /**
+     * Exception handler.
+     *
+     * @param e        the e
+     * @param response the response
+     * @throws IOException Signals that an I/O exception has occurred.
+     */
+    @ExceptionHandler(Exception.class)
+    private void exceptionHandler(Exception e, HttpServletResponse response) throws IOException {
+
+		/*
+         * The following "logger.error" lines "should" be sufficient for logging the exception.
+		 * However, the console output in my Eclipse environment is NOT showing ANY of the
+		 * logger statements in this class. Thus the temporary "e.printStackTrace" statement
+		 * is also included.
+		 */
+
+        String methodName = "exceptionHandler";
+        LOGGER.error(EELFLoggerDelegate.errorLogger, dateFormat.format(new Date()) + "<== " + "." + methodName + e.toString());
+        StringWriter sw = new StringWriter();
+        e.printStackTrace(new PrintWriter(sw));
+        LOGGER.error(EELFLoggerDelegate.errorLogger, sw.toString());
+
+		/*
+         *  Temporary - IF the above  mentioned "logger.error" glitch is resolved ...
+		 *  this statement could be removed since it would then likely result in duplicate
+		 *  trace output. 
+		 */
+        e.printStackTrace(System.err);
+
+        response.setContentType("application/json; charset=UTF-8");
+        response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
+
+        ExceptionResponse exceptionResponse = new ExceptionResponse();
+        exceptionResponse.setException(e.getClass().toString().replaceFirst("^.*\\.", ""));
+        exceptionResponse.setMessage(e.getMessage());
+
+        response.getWriter().write(new ObjectMapper().writeValueAsString(exceptionResponse));
+
+        response.flushBuffer();
+
+    }
+
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/controller/OperationalEnvironmentController.java b/vid-app-common/src/main/java/org/onap/vid/controller/OperationalEnvironmentController.java
new file mode 100644
index 0000000..e57aab3
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/controller/OperationalEnvironmentController.java
@@ -0,0 +1,354 @@
+package org.onap.vid.controller;
+
+import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.google.common.base.MoreObjects;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.commons.lang3.exception.ExceptionUtils;
+import org.openecomp.portalsdk.core.controller.RestrictedBaseController;
+import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
+import org.onap.vid.changeManagement.RequestDetailsWrapper;
+import org.onap.vid.model.ExceptionResponse;
+import org.onap.vid.model.RequestReferencesContainer;
+import org.onap.vid.mso.MsoBusinessLogic;
+import org.onap.vid.mso.MsoResponseWrapper2;
+import org.onap.vid.mso.RestMsoImplementation;
+import org.onap.vid.mso.RestObject;
+import org.onap.vid.mso.model.OperationalEnvironmentActivateInfo;
+import org.onap.vid.mso.model.OperationalEnvironmentDeactivateInfo;
+import org.onap.vid.mso.rest.MsoRestClientNew;
+import org.onap.vid.mso.rest.OperationalEnvironment.OperationEnvironmentRequestDetails;
+import org.onap.vid.mso.rest.RequestDetails;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.HttpStatus;
+import org.springframework.web.bind.MissingServletRequestParameterException;
+import org.springframework.web.bind.annotation.*;
+
+import javax.servlet.http.HttpServletRequest;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+import java.util.stream.Collectors;
+import java.util.stream.Stream;
+
+import static org.onap.vid.utils.Logging.getMethodCallerName;
+import static org.onap.vid.utils.Logging.getMethodName;
+import static org.springframework.http.HttpStatus.INTERNAL_SERVER_ERROR;
+
+@RestController
+@RequestMapping("operationalEnvironment")
+public class OperationalEnvironmentController extends RestrictedBaseController {
+
+    private static final EELFLoggerDelegate LOGGER = EELFLoggerDelegate.getLogger(OperationalEnvironmentController.class);
+    private final RestMsoImplementation restMso;
+    private final MsoBusinessLogic msoBusinessLogic;
+
+    private static final Pattern RECOVERY_ACTION_MESSAGE_PATTERN = Pattern.compile("String value \'(.*)\': value not");
+
+
+    @Autowired
+    public OperationalEnvironmentController(MsoBusinessLogic msoBusinessLogic, MsoRestClientNew msoClientInterface) {
+        this.restMso = msoClientInterface;
+        this.msoBusinessLogic = msoBusinessLogic;
+    }
+
+    @RequestMapping(value = "/create", method = RequestMethod.POST)
+    public MsoResponseWrapper2 createOperationalEnvironment(HttpServletRequest request, @RequestBody OperationalEnvironmentCreateBody operationalEnvironment) throws Exception {
+        LOGGER.debug(EELFLoggerDelegate.debugLogger, "start {}({})", getMethodName(), operationalEnvironment);
+        String userId = ControllersUtils.extractUserId(request);
+        RequestDetailsWrapper<OperationEnvironmentRequestDetails> requestDetailsWrapper = msoBusinessLogic.convertParametersToRequestDetails(operationalEnvironment, userId);
+        String path = msoBusinessLogic.getOperationalEnvironmentCreationPath();
+        RestObject<RequestReferencesContainer> msoResponse = restMso.PostForObject(requestDetailsWrapper, "",
+                path, RequestReferencesContainer.class);
+        debugEnd(msoResponse);
+        return new MsoResponseWrapper2<>(msoResponse);
+    }
+
+    @RequestMapping(value = "/activate", method = RequestMethod.POST)
+    public MsoResponseWrapper2 activate(HttpServletRequest request,
+                                        @RequestParam("operationalEnvironment") String operationalEnvironmentId,
+                                        @RequestBody OperationalEnvironmentActivateBody activateRequest) throws Exception {
+
+        verifyIsNotEmpty(operationalEnvironmentId, "operationalEnvironment");
+
+        //manifest is null in case of wrong manifest structure (deserialization failure of the manifest)
+        if (activateRequest.getManifest()==null || activateRequest.getManifest().getServiceModelList()==null) {
+            throw new BadManifestException("Manifest structure is wrong");
+        }
+
+        String userId = ControllersUtils.extractUserId(request);
+
+        OperationalEnvironmentActivateInfo activateInfo = new OperationalEnvironmentActivateInfo(activateRequest, userId, operationalEnvironmentId);
+        debugStart(activateInfo);
+
+        String path = msoBusinessLogic.getOperationalEnvironmentActivationPath(activateInfo);
+        RequestDetailsWrapper<RequestDetails> requestDetailsWrapper = msoBusinessLogic.createOperationalEnvironmentActivationRequestDetails(activateInfo);
+
+        RestObject<RequestReferencesContainer> msoResponse = restMso.PostForObject(requestDetailsWrapper, "",
+                path, RequestReferencesContainer.class);
+
+        debugEnd(msoResponse);
+        return new MsoResponseWrapper2<>(msoResponse);
+    }
+
+    @RequestMapping(value = "/deactivate", method = RequestMethod.POST)
+    public MsoResponseWrapper2 deactivate(HttpServletRequest request,
+                                          @RequestParam("operationalEnvironment") String operationalEnvironmentId,
+                                          @RequestBody Map deactivationRequest) throws Exception {
+
+        verifyIsNotEmpty(operationalEnvironmentId, "operationalEnvironment");
+
+        String userId = ControllersUtils.extractUserId(request);
+
+        OperationalEnvironmentDeactivateInfo deactivateInfo = new OperationalEnvironmentDeactivateInfo(userId, operationalEnvironmentId);
+        debugStart(deactivateInfo);
+
+        String path = msoBusinessLogic.getOperationalEnvironmentDeactivationPath(deactivateInfo);
+        RequestDetailsWrapper<RequestDetails> requestDetailsWrapper =  msoBusinessLogic.createOperationalEnvironmentDeactivationRequestDetails(deactivateInfo);
+
+        RestObject<RequestReferencesContainer> msoResponse = restMso.PostForObject(requestDetailsWrapper, "",
+                path, RequestReferencesContainer.class);
+
+        debugEnd(msoResponse);
+        return new MsoResponseWrapper2<>(msoResponse);
+    }
+
+    @RequestMapping(value = "/requestStatus", method = RequestMethod.GET)
+    public MsoResponseWrapper2 status(HttpServletRequest request, @RequestParam("requestId") String requestId) throws Exception {
+
+        LOGGER.debug(EELFLoggerDelegate.debugLogger, "start {}({})", getMethodName(), requestId);
+
+        verifyIsNotEmpty(requestId, "requestId");
+        String path = msoBusinessLogic.getCloudResourcesRequestsStatusPath(requestId);
+
+        final RestObject<HashMap> msoResponse = restMso.GetForObject("", path, HashMap.class);
+
+        LOGGER.debug(EELFLoggerDelegate.debugLogger, "end {}() => {}", getMethodName(), msoResponse);
+        return new MsoResponseWrapper2<>(msoResponse);
+    }
+
+    @ExceptionHandler(Exception.class)
+    @ResponseStatus(value=INTERNAL_SERVER_ERROR)
+    private ExceptionResponse exceptionHandler(Exception e) {
+        return ControllersUtils.handleException(e, LOGGER);
+    }
+
+    @ExceptionHandler({
+            org.springframework.web.bind.MissingServletRequestParameterException.class,
+            BadManifestException.class
+    })
+    @ResponseStatus(value = HttpStatus.BAD_REQUEST)
+    public ExceptionResponse clientDerivedExceptionAsBadRequest(Exception e) {
+        // same handler, different HTTP Code
+        return exceptionHandler(e);
+    }
+
+    @ExceptionHandler({
+            org.springframework.http.converter.HttpMessageNotReadableException.class,
+    })
+    @ResponseStatus(value = HttpStatus.BAD_REQUEST)
+    public ExceptionResponse handlingHttpMessageNotReadableException(Exception e) {
+        //in case of wrong value in manifest for RecoveryAction the message contains the class name.
+        //The wrong value is in also part of this messages
+        //within the pattern of: String value '<WRONG_VALUE>': value not
+        //so we use regex to find the wrong value
+        if (e.getMessage().contains(OperationalEnvironmentRecoveryAction.class.getName())) {
+            LOGGER.error(EELFLoggerDelegate.errorLogger, "{}: {}", getMethodName(), ExceptionUtils.getMessage(e), e);
+            String message = "Wrong value for RecoveryAction in manifest. Allowed options are: "+OperationalEnvironmentRecoveryAction.options;
+
+            Matcher matcher = RECOVERY_ACTION_MESSAGE_PATTERN.matcher(e.getMessage());
+            if (matcher.find()) {
+                String wrongValue = matcher.group(1);
+                message = message+". Wrong value is: "+wrongValue;
+            }
+            return new ExceptionResponse(new BadManifestException(message));
+        }
+        return exceptionHandler(e);
+    }
+
+
+    public enum OperationalEnvironmentRecoveryAction {
+        abort,
+        retry,
+        skip;
+
+        public static final String options = Stream.of(OperationalEnvironmentRecoveryAction.values()).map(OperationalEnvironmentRecoveryAction::name).collect(Collectors.joining(", "));
+    }
+
+    public static class ActivateServiceModel {
+        private String serviceModelVersionId;
+        private OperationalEnvironmentRecoveryAction recoveryAction;
+
+        public ActivateServiceModel() {
+        }
+
+        public ActivateServiceModel(String serviceModelVersionId, OperationalEnvironmentRecoveryAction recoveryAction) {
+            this.serviceModelVersionId = serviceModelVersionId;
+            this.recoveryAction = recoveryAction;
+        }
+
+        public String getServiceModelVersionId() {
+            return serviceModelVersionId;
+        }
+
+        public void setServiceModelVersionId(String serviceModelVersionId) {
+            this.serviceModelVersionId = serviceModelVersionId;
+        }
+
+        public OperationalEnvironmentRecoveryAction getRecoveryAction() {
+            return recoveryAction;
+        }
+
+        public void setRecoveryAction(OperationalEnvironmentRecoveryAction recoveryAction) {
+            this.recoveryAction = recoveryAction;
+        }
+    }
+
+    @JsonIgnoreProperties(ignoreUnknown = true)
+    public static class OperationalEnvironmentManifest {
+
+
+        private List<ActivateServiceModel> serviceModelList;
+
+        public OperationalEnvironmentManifest() {
+        }
+
+        public OperationalEnvironmentManifest(List<ActivateServiceModel> serviceModelList) {
+            this.serviceModelList = serviceModelList;
+        }
+
+        public List<ActivateServiceModel> getServiceModelList() {
+            return serviceModelList;
+        }
+
+        public void setServiceModelList(List<ActivateServiceModel> serviceModelList) {
+            this.serviceModelList = serviceModelList;
+        }
+    }
+
+    public static class OperationalEnvironmentActivateBody {
+        private final String relatedInstanceId;
+        private final String relatedInstanceName;
+        private final String workloadContext;
+        private final OperationalEnvironmentManifest manifest;
+
+        public OperationalEnvironmentActivateBody(@JsonProperty(value = "relatedInstanceId", required = true) String relatedInstanceId,
+                                                  @JsonProperty(value = "relatedInstanceName", required = true) String relatedInstanceName,
+                                                  @JsonProperty(value = "workloadContext", required = true) String workloadContext,
+                                                  @JsonProperty(value = "manifest", required = true) OperationalEnvironmentManifest manifest) {
+            this.relatedInstanceId = relatedInstanceId;
+            this.relatedInstanceName = relatedInstanceName;
+            this.workloadContext = workloadContext;
+            this.manifest = manifest;
+        }
+
+
+        public String getRelatedInstanceId() {
+            return relatedInstanceId;
+        }
+
+        public String getRelatedInstanceName() {
+            return relatedInstanceName;
+        }
+
+        public String getWorkloadContext() {
+            return workloadContext;
+        }
+
+        public OperationalEnvironmentManifest getManifest() {
+            return manifest;
+        }
+
+        @Override
+        public String toString() {
+            return MoreObjects.toStringHelper(this)
+                    .add("relatedInstanceId", relatedInstanceId)
+                    .add("relatedInstanceName", relatedInstanceName)
+                    .add("workloadContext", workloadContext)
+                    .add("manifest", manifest)
+                    .toString();
+        }
+    }
+
+    public static class OperationalEnvironmentCreateBody {
+        private final String instanceName;
+        private final String ecompInstanceId;
+        private final String ecompInstanceName;
+        private final String operationalEnvironmentType;
+        private final String tenantContext;
+        private final String workloadContext;
+
+        public OperationalEnvironmentCreateBody(@JsonProperty(value = "instanceName", required = true) String instanceName,
+                                                @JsonProperty(value = "ecompInstanceId", required = true) String ecompInstanceId,
+                                                @JsonProperty(value = "ecompInstanceName", required = true) String ecompInstanceName,
+                                                @JsonProperty(value = "operationalEnvironmentType", required = true) String operationalEnvironmentType,
+                                                @JsonProperty(value = "tenantContext", required = true) String tenantContext,
+                                                @JsonProperty(value = "workloadContext", required = true) String workloadContext) {
+            this.instanceName = instanceName;
+            this.ecompInstanceId = ecompInstanceId;
+            this.ecompInstanceName = ecompInstanceName;
+            this.operationalEnvironmentType = operationalEnvironmentType;
+            this.tenantContext = tenantContext;
+            this.workloadContext = workloadContext;
+        }
+
+        public String getInstanceName() {
+            return instanceName;
+        }
+
+        public String getEcompInstanceId() {
+            return ecompInstanceId;
+        }
+
+        public String getEcompInstanceName() {
+            return ecompInstanceName;
+        }
+
+        public String getOperationalEnvironmentType() {
+            return operationalEnvironmentType;
+        }
+
+        public String getTenantContext() {
+            return tenantContext;
+        }
+
+        public String getWorkloadContext() {
+            return workloadContext;
+        }
+
+        @Override
+        public String toString() {
+            return MoreObjects.toStringHelper(this)
+                    .add("instanceName", instanceName)
+                    .add("ecompInstanceId", ecompInstanceId)
+                    .add("ecompInstanceName", ecompInstanceName)
+                    .add("operationalEnvironmentType", operationalEnvironmentType)
+                    .add("tenantContext", tenantContext)
+                    .add("workloadContext", workloadContext)
+                    .toString();
+        }
+    }
+
+    private void debugEnd(RestObject<RequestReferencesContainer> msoResponse) {
+        LOGGER.debug(EELFLoggerDelegate.debugLogger, "end {}() => {}", getMethodCallerName(), msoResponse);
+    }
+
+    private void debugStart(Object requestInfo) {
+        LOGGER.debug(EELFLoggerDelegate.debugLogger, "start {}({})", getMethodCallerName(), requestInfo);
+    }
+
+    private void verifyIsNotEmpty(String fieldValue, String fieldName) throws MissingServletRequestParameterException {
+        if (StringUtils.isEmpty(fieldValue)) {
+            throw new MissingServletRequestParameterException(fieldName, "String");
+        }
+    }
+
+    public static class BadManifestException extends RuntimeException {
+        public BadManifestException(String message) {
+            super(message);
+        }
+    }
+
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/controller/PolicyController.java b/vid-app-common/src/main/java/org/onap/vid/controller/PolicyController.java
new file mode 100644
index 0000000..4e9ec25
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/controller/PolicyController.java
@@ -0,0 +1,84 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * VID
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package  org.onap.vid.controller;
+
+import org.json.simple.JSONObject;
+import org.openecomp.portalsdk.core.controller.RestrictedBaseController;
+import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
+import org.onap.vid.policy.*;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.ResponseEntity;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.servlet.http.HttpServletRequest;
+import java.util.UUID;
+
+/**
+ * Controller to handle Policy requests.
+ */
+
+@RestController
+public class PolicyController extends RestrictedBaseController{	
+		
+	/** The logger. */
+	private static final EELFLoggerDelegate LOGGER = EELFLoggerDelegate.getLogger(PolicyController.class);
+	
+	@RequestMapping(value="/get_policy",method = RequestMethod.POST)	
+	public ResponseEntity<String> getPolicyInfo( HttpServletRequest request, @RequestBody JSONObject policy_request) throws Exception {	
+		
+		LOGGER.debug("#####################POLICY API CALL STARTED ###############"+ PolicyProperties.POLICY_GET_CONFIG_VAL);
+		LOGGER.debug("#####################Policy Request ###############"+policy_request.toString());
+
+		String path = PolicyProperties.getProperty(PolicyProperties.POLICY_GET_CONFIG_VAL);
+		PolicyResponseWrapper policyResWrapper = getPolicyConfig(policy_request,path);
+		
+		LOGGER.debug("$$$$$$$$$$$$$$$$$$$$$$ " + new ResponseEntity<String>(policyResWrapper.getResponse(), HttpStatus.OK).toString());
+		
+		return ( new ResponseEntity<String>(policyResWrapper.getResponse(), HttpStatus.valueOf(policyResWrapper.getStatus())) );		
+	}
+	
+	protected static PolicyResponseWrapper getPolicyConfig(JSONObject request, String path) throws Exception {
+		String methodName = "getPolicyConfig";
+		String uuid = UUID.randomUUID().toString();
+		LOGGER.debug(  "starting getPolicyConfig ");
+		
+		try {
+			//STARTING REST API CALL AS AN FACTORY INSTACE
+			PolicyRestInterfaceIfc restController = PolicyRestInterfaceFactory.getInstance();	
+			
+			RestObject<String> restObjStr = new RestObject<String>();
+			String str = new String();
+			restObjStr.set(str);
+			restController.<String>Post(str, request, uuid, path, restObjStr );
+			PolicyResponseWrapper policyRespWrapper = PolicyUtil.wrapResponse (restObjStr);
+			
+			LOGGER.debug( "<== " + methodName + " w=" + policyRespWrapper.getResponse());
+			return policyRespWrapper;
+		} catch (Exception e) {
+			LOGGER.debug(  "EXCEPTION in getPolicyConfig <== " + "." + methodName + e.toString());
+			throw e;
+		}
+	}
+}
+
diff --git a/vid-app-common/src/main/java/org/onap/vid/controller/PropertyController.java b/vid-app-common/src/main/java/org/onap/vid/controller/PropertyController.java
new file mode 100644
index 0000000..2d282ed
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/controller/PropertyController.java
@@ -0,0 +1,132 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * VID
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.vid.controller;
+
+import org.openecomp.portalsdk.core.controller.RestrictedBaseController;
+import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
+import org.openecomp.portalsdk.core.util.SystemProperties;
+import org.onap.vid.category.CategoryParametersResponse;
+import org.onap.vid.model.CategoryParameter.Family;
+import org.onap.vid.services.CategoryParameterService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.ResponseEntity;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.servlet.ModelAndView;
+
+import javax.servlet.http.HttpServletRequest;
+import java.text.DateFormat;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+
+import static org.onap.vid.utils.Logging.getMethodName;
+
+/**
+ * The Class PropertyController.
+ */
+@RestController
+public class PropertyController extends RestrictedBaseController{
+	
+
+	/** The logger. */
+	private static final EELFLoggerDelegate LOGGER = EELFLoggerDelegate.getLogger(PropertyController.class);
+	
+	/** The Constant dateFormat. */
+	final protected static DateFormat dateFormat = new SimpleDateFormat("HH:mm:ss:SSSS");
+
+	@Autowired
+	protected CategoryParameterService categoryParameterService;
+
+	
+	/**
+	 * Welcome.
+	 *
+	 * @param request the request
+	 * @return the model and view
+	 */
+	@RequestMapping(value = {"/propertyhome" }, method = RequestMethod.GET)
+	public ModelAndView welcome(HttpServletRequest request) {
+		LOGGER.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== PropertyController welcome start");
+		return new ModelAndView(getViewName());		
+	}
+	
+	/**
+	 * Gets the property.
+	 *
+	 * @param name the name
+	 * @param defaultvalue the defaultvalue
+	 * @param request the request
+	 * @return the property
+	 * @throws Exception the exception
+	 */
+	@RequestMapping(value = "/get_property/{name}/{defaultvalue}", method = RequestMethod.GET)
+	public ResponseEntity<String> getProperty (@PathVariable("name") String name, @PathVariable("defaultvalue") String defaultvalue,
+			HttpServletRequest request) throws Exception {
+		
+		String methodName = "getProperty";	
+		ResponseEntity<String> resp = null;
+		String pvalue = null;
+		LOGGER.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
+		
+		try {
+			// convert "_" to "." in the property name
+			if (name == null || name.length() == 0 ) {
+				return ( new ResponseEntity<String> (defaultvalue, HttpStatus.OK));
+			}
+			// convert "_" to "." in the property name
+			String propertyName = name.replace('_', '.');
+			pvalue = SystemProperties.getProperty(propertyName);
+			if ( ( pvalue == null ) || ( pvalue.length() == 0 ) ) {
+				pvalue = defaultvalue;
+			}
+			resp = new ResponseEntity<String>(pvalue, HttpStatus.OK);
+		}
+		catch (Exception e) {
+			LOGGER.info(EELFLoggerDelegate.errorLogger, dateFormat.format(new Date()) +  "<== " + "." + methodName + e.toString());
+			LOGGER.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) +  "<== " + "." + methodName + e.toString());
+			throw e;
+		}
+		LOGGER.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " returning " + pvalue);
+  		return ( resp );
+	}
+
+	/**
+	 * Gets the owning entity properties.
+	 * @param request the request
+	 * @return the property
+	 * @throws Exception the exception
+	 */
+	@RequestMapping(value = "/category_parameter", method = RequestMethod.GET)
+	public ResponseEntity getCategoryParameter(HttpServletRequest request, @RequestParam(value="familyName", required = true) Family familyName) throws Exception {
+		LOGGER.debug(EELFLoggerDelegate.debugLogger, "start {}({})", getMethodName());
+		try {
+			CategoryParametersResponse response = categoryParameterService.getCategoryParameters(familyName);
+			LOGGER.debug(EELFLoggerDelegate.debugLogger, "end {}() => {}", getMethodName(), response);
+			return new ResponseEntity<>(response, HttpStatus.OK);
+		}
+		catch (Exception exception) {
+			LOGGER.error("failed to retrieve category parameter list from DB.", exception);
+			return new ResponseEntity<>(HttpStatus.INTERNAL_SERVER_ERROR);
+		}
+	}
+
+
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/controller/RoleGeneratorController.java b/vid-app-common/src/main/java/org/onap/vid/controller/RoleGeneratorController.java
new file mode 100644
index 0000000..3e15153
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/controller/RoleGeneratorController.java
@@ -0,0 +1,31 @@
+package org.onap.vid.controller;
+
+import fj.test.Bool;
+import org.json.JSONObject;
+import org.openecomp.portalsdk.core.controller.UnRestrictedBaseController;
+import org.onap.vid.services.RoleGeneratorService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.MediaType;
+import org.springframework.http.ResponseEntity;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.servlet.http.HttpServletRequest;
+
+@RestController
+public class RoleGeneratorController extends UnRestrictedBaseController {
+    @Autowired
+    private RoleGeneratorService roleGeneratorService;
+    public static final String GENERATE_ROLE_SCRIPT = "generateRoleScript";
+    @RequestMapping(value =  GENERATE_ROLE_SCRIPT +"/{firstRun}", method = RequestMethod.GET )
+    public ResponseEntity<String> generateRoleScript (@PathVariable("firstRun") boolean firstRun) throws Exception {
+        ResponseEntity<String> response = null;
+        String query = roleGeneratorService.generateRoleScript(firstRun);
+        response = new ResponseEntity<String>(query, HttpStatus.OK);
+        return response;
+    }
+
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/controller/VidController.java b/vid-app-common/src/main/java/org/onap/vid/controller/VidController.java
new file mode 100644
index 0000000..c93d802
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/controller/VidController.java
@@ -0,0 +1,149 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * VID
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.vid.controller;
+
+import org.openecomp.portalsdk.core.controller.RestrictedBaseController;
+import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
+import org.openecomp.sdc.tosca.parser.exceptions.SdcToscaParserException;
+import org.onap.vid.asdc.AsdcCatalogException;
+import org.onap.vid.asdc.beans.SecureServices;
+import org.onap.vid.exceptions.VidServiceUnavailableException;
+import org.onap.vid.model.ServiceModel;
+import org.onap.vid.roles.Role;
+import org.onap.vid.roles.RoleProvider;
+import org.onap.vid.services.AaiService;
+import org.onap.vid.services.VidService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.servlet.ModelAndView;
+
+import javax.servlet.http.HttpServletRequest;
+import java.util.List;
+
+//import org.onap.vid.model.Service;
+
+@RestController
+public class VidController extends RestrictedBaseController {
+
+	private static final EELFLoggerDelegate LOG = EELFLoggerDelegate.getLogger(VidController.class);
+
+	private final VidService service;
+
+	@Autowired
+	public VidController(VidService vidService) throws SdcToscaParserException{
+
+		service = vidService;
+	}
+
+	@Autowired
+	private AaiService aaiService;
+
+	@Autowired
+	RoleProvider roleProvider;
+
+//	/**
+//	 * Gets the services.
+//	 *
+//	 * @param request the request
+//	 * @return the services
+//	 * @throws VidServiceUnavailableException the vid service unavailable exception
+//	 */
+//	@RequestMapping(value={"/rest/models/services"}, method = RequestMethod.GET)
+//	public SecureServices getServices(HttpServletRequest request) throws VidServiceUnavailableException {
+//		try {
+//			AaiService aaiService = new AaiServiceImpl();
+//			LOG.info("Start API for browse ASDC was called");
+//			SecureServices secureServices = new SecureServices();
+//			Map<String, String[]> requestParams = request.getParameterMap();
+//			List<Role> roles = roleProvider.getUserRoles(request);
+//			secureServices.setServices(aaiService.getServicesByDistributionStatus());
+//			secureServices.setServices(service.getServices(requestParams));
+//			secureServices.setReadOnly(roleProvider.userPermissionIsReadOnly(roles));
+//			return secureServices;
+//		} catch (AsdcCatalogException e) {
+//			LOG.error("Failed to retrieve service definitions from SDC", e);
+//			throw new VidServiceUnavailableException("Failed to retrieve service definitions from SDC", e);
+//		} catch (Throwable t) {
+//			LOG.debug("Unexpected error while retrieving service definitions from SDC: " + t.getMessage() + ":", t);
+//			t.printStackTrace();
+//			throw new VidServiceUnavailableException("Unexpected error while retrieving service definitions from SDC: " + t.getMessage(), t);
+//		}
+//	}
+
+	/**
+	 * Gets the services.
+	 *
+	 * @param request the request
+	 * @return the services
+	 * @throws VidServiceUnavailableException the vid service unavailable exception
+	 */
+	@RequestMapping(value={"/rest/models/services"}, method = RequestMethod.GET)
+	public SecureServices getServices(HttpServletRequest request) throws VidServiceUnavailableException {
+		try {
+			LOG.info("Start API for browse ASDC was called");
+			SecureServices secureServices = new SecureServices();
+			List<Role> roles = roleProvider.getUserRoles(request);
+			secureServices.setServices(aaiService.getServicesByDistributionStatus());
+			secureServices.setReadOnly(roleProvider.userPermissionIsReadOnly(roles));
+			return secureServices;
+		}
+		catch (Exception t) {
+			LOG.debug("Unexpected error while retrieving service definitions from A&AI: " + t.getMessage() + ":", t);
+			t.printStackTrace();
+			throw new VidServiceUnavailableException("Unexpected error while retrieving service definitions from A&AI: " + t.getMessage(), t);
+		}
+	}
+
+
+
+	/**
+	 * Gets the services.
+	 *
+	 * @param uuid the uuid
+	 * @return the services
+	 * @throws VidServiceUnavailableException the vid service unavailable exception
+	 */
+	@RequestMapping(value={"/rest/models/services/{uuid}"}, method = RequestMethod.GET)
+	public ServiceModel getServices(@PathVariable("uuid") String uuid, HttpServletRequest request) throws VidServiceUnavailableException {
+		try {
+			return service.getService(uuid);
+		} catch (AsdcCatalogException e) {
+			LOG.error("Failed to retrieve service definitions from SDC", e);
+			throw new VidServiceUnavailableException("Failed to retrieve service definitions from SDC", e);
+		}
+	}
+
+
+	/**
+	 * Gets the services view.
+	 *
+	 * @param request the request
+	 * @return the services view
+	 * @throws VidServiceUnavailableException the vid service unavailable exception
+	 */
+	@RequestMapping(value={"/serviceModels"}, method=RequestMethod.GET)
+	public ModelAndView getServicesView(HttpServletRequest request) throws VidServiceUnavailableException {
+		return new ModelAndView("serviceModels");
+	}
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/controller/ViewLogController.java b/vid-app-common/src/main/java/org/onap/vid/controller/ViewLogController.java
new file mode 100644
index 0000000..4a87df1
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/controller/ViewLogController.java
@@ -0,0 +1,65 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * VID
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.vid.controller;
+
+import org.openecomp.portalsdk.core.controller.RestrictedBaseController;
+import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.servlet.ModelAndView;
+
+import javax.servlet.ServletContext;
+import javax.servlet.http.HttpServletRequest;
+import java.text.DateFormat;
+import java.text.SimpleDateFormat;
+
+
+/**
+ * The Class ViewLogController.
+ */
+@RestController
+public class ViewLogController extends RestrictedBaseController{
+	
+	/** The logger. */
+	private static final EELFLoggerDelegate LOGGER = EELFLoggerDelegate.getLogger(ViewLogController.class);
+	
+	/** The Constant dateFormat. */
+	final static DateFormat dateFormat = new SimpleDateFormat("HH:mm:ss:SSSS");
+	
+	/** The servlet context. */
+	private @Autowired ServletContext servletContext;
+	
+	/**
+	 * Welcome.
+	 *
+	 * @param request the request
+	 * @return the model and view
+	 */
+	@RequestMapping(value = {"/viewlog" }, method = RequestMethod.GET)
+	public ModelAndView welcome(HttpServletRequest request) {
+		
+ 	return new ModelAndView(getViewName());		
+	}
+	
+
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/controller/WebConfig.java b/vid-app-common/src/main/java/org/onap/vid/controller/WebConfig.java
new file mode 100644
index 0000000..2838e7f
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/controller/WebConfig.java
@@ -0,0 +1,123 @@
+package org.onap.vid.controller;
+
+import com.fasterxml.jackson.databind.ObjectMapper;
+import org.apache.commons.io.IOUtils;
+import org.json.JSONObject;
+import org.json.JSONTokener;
+import org.onap.vid.aai.AaiClient;
+import org.onap.vid.aai.AaiClientInterface;
+import org.onap.vid.asdc.AsdcClient;
+import org.onap.vid.asdc.local.LocalAsdcClient;
+import org.onap.vid.asdc.memory.InMemoryAsdcClient;
+import org.onap.vid.asdc.parser.ToscaParserImpl2;
+import org.onap.vid.asdc.rest.RestfulAsdcClient;
+import org.onap.vid.properties.AsdcClientConfiguration;
+import org.onap.vid.properties.AsdcClientConfiguration.AsdcClientType;
+import org.onap.vid.services.AaiService;
+import org.onap.vid.services.AaiServiceImpl;
+import org.onap.vid.services.VidService;
+import org.onap.vid.services.VidServiceImpl;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+
+import javax.net.ssl.SSLContext;
+import javax.ws.rs.client.Client;
+import javax.ws.rs.client.ClientBuilder;
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.security.KeyManagementException;
+import java.security.NoSuchAlgorithmException;
+import java.util.Arrays;
+
+@Configuration
+public class WebConfig {
+
+    /**
+     * Gets the object mapper.
+     *
+     * @return the object mapper
+     */
+    @Bean
+    public ObjectMapper getObjectMapper() {
+        return new ObjectMapper();
+    }
+
+
+
+
+    @Bean
+    public VidService vidService(AsdcClient asdcClient) {
+        return new VidServiceImpl(asdcClient);
+    }
+
+    @Bean
+    public AaiService getAaiService(){
+        return new AaiServiceImpl();
+    }
+
+    @Bean
+    public AaiClientInterface getAaiClientInterface(){
+        return new AaiClient();
+    }
+
+    @Bean
+    public AsdcClient asdcClient(AsdcClientConfiguration asdcClientConfig) throws IOException {
+        switch (asdcClientConfig.getAsdcClientType()) {
+            case IN_MEMORY:
+                final InputStream asdcCatalogFile = VidController.class.getClassLoader().getResourceAsStream("catalog.json");
+                final JSONTokener tokener = new JSONTokener(asdcCatalogFile);
+                final JSONObject catalog = new JSONObject(tokener);
+
+                return new InMemoryAsdcClient.Builder().catalog(catalog).build();
+            case REST:
+
+                final String protocol = asdcClientConfig.getAsdcClientProtocol();
+                final String host = asdcClientConfig.getAsdcClientHost();
+                final int port = asdcClientConfig.getAsdcClientPort();
+                final String auth = asdcClientConfig.getAsdcClientAuth();
+                Client cl = null;
+                if (protocol.equalsIgnoreCase("https")) {
+                    try {
+                        SSLContext ctx = SSLContext.getInstance("TLSv1.2");
+                        ctx.init(null, null, null);
+                        cl = ClientBuilder.newBuilder().sslContext(ctx).build();
+                    } catch (NoSuchAlgorithmException n) {
+                        throw new RuntimeException("SDC Client could not be instantiated due to unsupported protocol TLSv1.2", n);
+                    } catch (KeyManagementException k) {
+                        throw new RuntimeException("SDC Client could not be instantiated due to a key management exception", k);
+                    }
+                } else {
+                    cl = ClientBuilder.newBuilder().build();
+                }
+
+                try {
+                    final URI uri = new URI(protocol + "://" + host + ":" + port + "/");
+                    return new RestfulAsdcClient.Builder(cl, uri)
+                            .auth(auth)
+                            .build();
+                } catch (URISyntaxException e) {
+                    throw new RuntimeException("SDC Client could not be instantiated due to a syntax error in the URI", e);
+                }
+
+            case LOCAL:
+
+                final InputStream asdcServicesFile = VidController.class.getClassLoader().getResourceAsStream("sdcservices.json");
+
+                final JSONTokener jsonTokener = new JSONTokener(IOUtils.toString(asdcServicesFile));
+                final JSONObject sdcServicesCatalog = new JSONObject(jsonTokener);
+
+                return new LocalAsdcClient.Builder().catalog(sdcServicesCatalog).build();
+
+            default:
+                throw new RuntimeException(asdcClientConfig.getAsdcClientType() + " is invalid; must be one of " + Arrays.toString(AsdcClientType.values()));
+        }
+    }
+
+    @Bean
+    public ToscaParserImpl2 getToscaParser() {
+        return new ToscaParserImpl2();
+    }
+
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/controller/filter/PromiseEcompRequestIdFilter.java b/vid-app-common/src/main/java/org/onap/vid/controller/filter/PromiseEcompRequestIdFilter.java
new file mode 100644
index 0000000..a83fa28
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/controller/filter/PromiseEcompRequestIdFilter.java
@@ -0,0 +1,94 @@
+package org.onap.vid.controller.filter;
+
+
+import com.google.common.collect.ImmutableList;
+import org.apache.commons.lang3.StringUtils;
+import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
+import org.springframework.web.filter.GenericFilterBean;
+
+import javax.servlet.FilterChain;
+import javax.servlet.ServletException;
+import javax.servlet.ServletRequest;
+import javax.servlet.ServletResponse;
+import javax.servlet.annotation.WebFilter;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletRequestWrapper;
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.util.Collections;
+import java.util.Enumeration;
+import java.util.UUID;
+
+import static org.openecomp.portalsdk.core.util.SystemProperties.ECOMP_REQUEST_ID;
+
+@WebFilter(urlPatterns = "/*")
+public class PromiseEcompRequestIdFilter extends GenericFilterBean {
+
+    private final static EELFLoggerDelegate LOGGER = EELFLoggerDelegate.getLogger(PromiseEcompRequestIdFilter.class);
+    private final static String REQUEST_ID_RESPONSE_HEADER = ECOMP_REQUEST_ID + "-echo";
+
+
+    @Override
+    public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain)
+            throws IOException, ServletException {
+
+        if (request instanceof HttpServletRequest) {
+            request = wrapIfNeeded(request);
+
+            if (response instanceof HttpServletResponse) {
+                final String actualRequestId = ((HttpServletRequest) request).getHeader(ECOMP_REQUEST_ID);
+                ((HttpServletResponse) response).addHeader(REQUEST_ID_RESPONSE_HEADER, actualRequestId);
+            }
+        }
+
+        chain.doFilter(request, response);
+    }
+
+    public static ServletRequest wrapIfNeeded(ServletRequest request) {
+        final HttpServletRequest httpRequest = (HttpServletRequest) request;
+        final String originalRequestId = httpRequest.getHeader(ECOMP_REQUEST_ID);
+
+        if (StringUtils.isEmpty(originalRequestId)) {
+            request = new PromiseEcompRequestIdRequestWrapper(httpRequest);
+        }
+
+        return request;
+    }
+
+    private static class PromiseEcompRequestIdRequestWrapper extends HttpServletRequestWrapper {
+
+        private final UUID requestId;
+
+        PromiseEcompRequestIdRequestWrapper(HttpServletRequest request) {
+            super(request);
+            requestId = UUID.randomUUID();
+        }
+
+        @Override
+        public String getHeader(String name) {
+            return isRequestIdHeaderName(name) ?
+                    requestId.toString() : super.getHeader(name);
+        }
+
+        @Override
+        public Enumeration<String> getHeaders(String name) {
+            if (isRequestIdHeaderName(name)) {
+                return Collections.enumeration(Collections.singleton(requestId.toString()));
+            } else {
+                return super.getHeaders(name);
+            }
+        }
+
+        @Override
+        public Enumeration<String> getHeaderNames() {
+            return Collections.enumeration(ImmutableList.<String>builder()
+                    .add(ECOMP_REQUEST_ID)
+                    .addAll(Collections.list(super.getHeaderNames()))
+                    .build());
+        }
+
+        private boolean isRequestIdHeaderName(String name) {
+            return ECOMP_REQUEST_ID.equalsIgnoreCase(name);
+        }
+    }
+}
\ No newline at end of file
diff --git a/vid-app-common/src/main/java/org/onap/vid/controller/filter/TempFilterForCORS.java b/vid-app-common/src/main/java/org/onap/vid/controller/filter/TempFilterForCORS.java
new file mode 100644
index 0000000..02dcde0
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/controller/filter/TempFilterForCORS.java
@@ -0,0 +1,48 @@
+package org.onap.vid.controller.filter;
+
+import org.apache.commons.lang3.StringUtils;
+import org.openecomp.portalsdk.core.util.SystemProperties;
+import org.springframework.web.filter.GenericFilterBean;
+
+import javax.servlet.FilterChain;
+import javax.servlet.ServletException;
+import javax.servlet.ServletRequest;
+import javax.servlet.ServletResponse;
+import javax.servlet.annotation.WebFilter;
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+
+@WebFilter(urlPatterns = "/*")
+public class TempFilterForCORS extends GenericFilterBean {
+
+    private static final String ENV_MODE = "env.mode";
+    private Boolean devMode = null;
+
+     //dev mode is initialized here since @WebFilter doesn't support @Autowired
+    //So we are sure that SystemProperties bean was initialed only after the first call to doFilter
+    private boolean isDevMode() {
+        if (devMode!=null) {
+            return devMode;
+        }
+        else {
+            if (!SystemProperties.containsProperty(ENV_MODE)) {
+                devMode = Boolean.FALSE;
+                return devMode;
+            }
+
+            String envMode = SystemProperties.getProperty(ENV_MODE);
+            devMode = StringUtils.equalsIgnoreCase(envMode, "dev") ;
+        }
+        return devMode;
+    }
+
+    @Override
+    public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {
+
+        if (isDevMode() && response instanceof HttpServletResponse) {
+            ((HttpServletResponse) response).addHeader("Access-Control-Allow-Origin", "http://localhost:3000");
+            ((HttpServletResponse) response).addHeader("Access-Control-Allow-Credentials", "true");
+        }
+        chain.doFilter(request, response);
+    }
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/controller/test/TestAaiController.java b/vid-app-common/src/main/java/org/onap/vid/controller/test/TestAaiController.java
new file mode 100644
index 0000000..29e7a4d
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/controller/test/TestAaiController.java
@@ -0,0 +1,87 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * VID
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.vid.controller.test;
+
+import org.codehaus.jackson.map.ObjectMapper;
+import org.openecomp.portalsdk.core.controller.RestrictedBaseController;
+import org.onap.vid.model.ExceptionResponse;
+import org.springframework.web.bind.annotation.*;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+
+/**
+ * The Class TestAaiController.
+ */
+@RestController
+@RequestMapping("testaai")
+public class TestAaiController extends RestrictedBaseController {
+
+	/**
+	 * Gets the subscription service type list.
+	 *
+	 * @param globalCustomerId the global customer id
+	 * @param request the request
+	 * @return the subscription service type list
+	 * @throws Exception the exception
+	 */
+	@RequestMapping(value = "/getSubscriptionServiceTypeList/{globalCustomerId}", method = RequestMethod.GET)
+	public String getSubscriptionServiceTypeList(@PathVariable("globalCustomerId") String globalCustomerId, HttpServletRequest request)
+			throws Exception {
+
+		System.err.println("GET SUBSCRIPTION SERVICE TYPE LIST: globalCustomerId: " + globalCustomerId);
+
+		return "[\"vMOG\", \"sevice type 2\", \"sevice type 3\", \"sevice type 4\"]";
+	}
+
+	/**
+	 * Exception.
+	 *
+	 * @param e the e
+	 * @param response the response
+	 * @throws IOException Signals that an I/O exception has occurred.
+	 */
+	@ExceptionHandler(Exception.class)
+	private void exception(Exception e, HttpServletResponse response) throws IOException {
+
+		/*
+		 * This logging step should preferably be replaced with an appropriate
+		 * logging method consistent whatever logging mechanism the rest of the
+		 * application code uses.
+		 */
+
+		e.printStackTrace(System.err);
+
+		response.setContentType("application/json; charset=UTF-8");
+		response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
+
+		ExceptionResponse exceptionResponse = new ExceptionResponse();
+		exceptionResponse.setException(e.getClass().toString().replaceFirst("^.*\\.", ""));
+		exceptionResponse.setMessage(e.getMessage());
+
+		response.getWriter().write(new ObjectMapper().writeValueAsString(exceptionResponse));
+
+		response.flushBuffer();
+
+	}
+
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/controller/test/TestAsdcController.java b/vid-app-common/src/main/java/org/onap/vid/controller/test/TestAsdcController.java
new file mode 100644
index 0000000..2b289b9
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/controller/test/TestAsdcController.java
@@ -0,0 +1,106 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * VID
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package  org.onap.vid.controller.test;
+
+import org.codehaus.jackson.map.ObjectMapper;
+import org.openecomp.portalsdk.core.controller.RestrictedBaseController;
+import org.onap.vid.model.ExceptionResponse;
+import org.springframework.web.bind.annotation.*;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+
+/**
+ * The Class TestAsdcController.
+ */
+@RestController
+@RequestMapping("testasdc")
+public class TestAsdcController extends RestrictedBaseController {
+
+	/**
+	 * Gets the model.
+	 *
+	 * @param modelId the model id
+	 * @param request the request
+	 * @return the model
+	 * @throws Exception the exception
+	 */
+	@RequestMapping(value = "/getModel/{modelId}", method = RequestMethod.GET)
+	public String getModel(@PathVariable("modelId") String modelId, HttpServletRequest request) throws Exception {
+
+		System.err.println("SDC: GET MODEL: modelId: " + modelId);
+
+		// @formatter:off
+		return
+				"{" +
+						"\"uuid\": \"5be686dc-fdca-4d54-8548-5d0ed23e962b\"," +
+						"\"invariantUUID\": \"e5962da9-fe4f-433a-bc99-b43e0d88a9a1\"," +
+						"\"name\": \"DE220127\"," +
+						"\"version\": \"0.1\"," +
+						"\"inputs\": {" +
+						"\"defaultGateway\": {" +
+						"\"type\": \"String\"," +
+						"\"default\": \"192.168.1.1\"," +
+						"\"description\": \"Router default gateway - use any valid IPv4 address\"" +
+						"}," +
+						"\"subnetMask\": {" +
+						"\"type\": \"String\"," +
+						"\"default\": \"255.255.255.0\"," +
+						"\"description\": \"Router subnet mask - example (255.255.255.0)\"" +
+						"}" +
+						"}" +
+						"}";
+		// @formatter:on
+	}
+
+	/**
+	 * Exception.
+	 *
+	 * @param e the e
+	 * @param response the response
+	 * @throws IOException Signals that an I/O exception has occurred.
+	 */
+	@ExceptionHandler(Exception.class)
+	private void exception(Exception e, HttpServletResponse response) throws IOException {
+
+		/*
+		 * This logging step should preferably be replaced with an appropriate
+		 * logging method consistent whatever logging mechanism the rest of the
+		 * application code uses.
+		 */
+
+		e.printStackTrace(System.err);
+
+		response.setContentType("application/json; charset=UTF-8");
+		response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
+
+		ExceptionResponse exceptionResponse = new ExceptionResponse();
+		exceptionResponse.setException(e.getClass().toString().replaceFirst("^.*\\.", ""));
+		exceptionResponse.setMessage(e.getMessage());
+
+		response.getWriter().write(new ObjectMapper().writeValueAsString(exceptionResponse));
+
+		response.flushBuffer();
+
+	}
+
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/controller/test/TestMsoController.java b/vid-app-common/src/main/java/org/onap/vid/controller/test/TestMsoController.java
new file mode 100644
index 0000000..9d6a3de
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/controller/test/TestMsoController.java
@@ -0,0 +1,723 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * VID
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package  org.onap.vid.controller.test;
+
+import org.codehaus.jackson.map.ObjectMapper;
+import org.openecomp.portalsdk.core.controller.RestrictedBaseController;
+import org.onap.vid.model.ExceptionResponse;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.ResponseEntity;
+import org.springframework.web.bind.annotation.*;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.util.stream.Collectors;
+
+/*
+ * The "TestMsoController" class is primarily designed to help test "msoCommitController.js"
+ * 
+ * This class expects and receives JSON data in the same format as expected
+ * in the "real" application version of this code. However, string versions of JSON are
+ * maintained internally here instead of marshalled / unmarshalled JSON objects.
+ * The primary reasons for this were to encapsulate all the test code in this single file and
+ * minimize the time required to support initial test cases.
+ * 
+ * The non-test equivalent of this controller could alternatively incorporate POJO objects
+ * instead of strings. However, the same data format sent to / received from the browser
+ * JavaScript code would still be expected.
+ * 
+ * Two specific mechanisms used in this test class may be useful to the application version:
+ * 
+ * 		1) The use of "{variable}" elements in @RequestMappings along with the corresponding
+ * 		@PathVariable declarations.
+ * 
+ * 		2) The use of @ExceptionHandler for general purpose exception handler.
+ * 		(See @ExceptionHandler comments)
+ *
+ * This class is intended to be used in either:
+ * 
+ * 		A) Eclipse environments
+ * 	OR
+ * 		B) Linux environments with ONLY a single user running tests.
+ *		The "quick and dirty" error simulation approach used here makes use of static states for some
+ *		scenarios. Thus multiple users simultaneously testing in Linux environments
+ *		may have contention issues.
+ */
+
+/**
+ * The Class TestMsoController.
+ */
+@RestController
+@RequestMapping("testmso")
+public class TestMsoController extends RestrictedBaseController {
+
+	/*
+	 * Artificial delay (in milliseconds) added before responding to create /
+	 * delete requests
+	 */
+
+	/** The Constant TEST_DELAY_SHORT_MSEC. */
+	private final static int TEST_DELAY_SHORT_MSEC = 1000;
+
+	/*
+	 * Long delay to simulate non-responsive server test
+	 */
+
+	/** The Constant TEST_DELAY_LONG_MSEC. */
+	private final static int TEST_DELAY_LONG_MSEC = 15000;
+
+	/*
+	 * Default number of polls expected before transaction complete.
+	 */
+
+	/** The Constant MAXIMUM_POLLS_DEFAULT. */
+	private final static int MAXIMUM_POLLS_DEFAULT = 4;
+
+	/*
+	 * Number of polls to simulate "maximum polls exceeded" test.
+	 */
+
+	/** The Constant MAXIMUM_POLLS_LARGE. */
+	private final static int MAXIMUM_POLLS_LARGE = 10;
+
+	/*
+	 * Simulated error types. The GUI front end is expected to set these values
+	 * in the "modelName" field of the "mso_create_svc_instance" request.
+	 */
+
+	/** The Constant ERROR_POLICY_EXCEPTION. */
+	private final static String ERROR_POLICY_EXCEPTION = "ERROR_POLICY_EXCEPTION";
+
+	/** The Constant ERROR_SERVICE_EXCEPTION. */
+	private final static String ERROR_SERVICE_EXCEPTION = "ERROR_SERVICE_EXCEPTION";
+
+	/** The Constant ERROR_POLL_FAILURE. */
+	private final static String ERROR_POLL_FAILURE = "ERROR_POLL_FAILURE";
+
+	/** The Constant ERROR_INVALID_FIELD_INITIAL. */
+	private final static String ERROR_INVALID_FIELD_INITIAL = "ERROR_INVALID_FIELD_INITIAL";
+
+	/** The Constant ERROR_INVALID_FIELD_POLL. */
+	private final static String ERROR_INVALID_FIELD_POLL = "ERROR_INVALID_FIELD_POLL";
+
+	/** The Constant ERROR_GENERAL_SERVER_EXCEPTION. */
+	private final static String ERROR_GENERAL_SERVER_EXCEPTION = "ERROR_GENERAL_SERVER_EXCEPTION";
+
+	/** The Constant ERROR_MAX_POLLS. */
+	private final static String ERROR_MAX_POLLS = "ERROR_MAX_POLLS";
+
+	/** The Constant ERROR_SERVER_TIMEOUT_INITIAL. */
+	private final static String ERROR_SERVER_TIMEOUT_INITIAL = "ERROR_SERVER_TIMEOUT_INITIAL";
+
+	/** The Constant ERROR_SERVER_TIMEOUT_POLL. */
+	private final static String ERROR_SERVER_TIMEOUT_POLL = "ERROR_SERVER_TIMEOUT_POLL";
+
+	/** The simulated error. */
+	private String simulatedError = "";
+
+	/** The maximum polls. */
+	private int maximumPolls = 0;
+
+	/** The attempt count. */
+	private int attemptCount = 0;
+
+	/**
+	 * Creates the svc instance.
+	 *
+	 * @param request the request
+	 * @return the response entity
+	 * @throws Exception the exception
+	 */
+	@RequestMapping(value = "/mso_create_svc_instance", method = RequestMethod.POST)
+	public ResponseEntity<String> createSvcInstance(HttpServletRequest request) throws Exception {
+		readAndLogRequest("CREATE SERVICE INSTANCE", request);
+		Thread.sleep(TEST_DELAY_SHORT_MSEC);
+		maximumPolls = MAXIMUM_POLLS_DEFAULT; // Simulates MSO polling behavior
+		attemptCount = 0;
+
+		/*
+		 * This block of code simulates various errors and would NOT be expected
+		 * in a non-test method
+		 */
+		System.err.println("simulatedError: " + simulatedError);
+
+		if (simulatedError.equals(ERROR_POLICY_EXCEPTION)) {
+			return new ResponseEntity<String>(policyExceptionResponse, HttpStatus.OK);
+		}
+		if (simulatedError.equals(ERROR_SERVICE_EXCEPTION)) {
+			return new ResponseEntity<String>(serviceExceptionResponse, HttpStatus.OK);
+		}
+		if (simulatedError.equals(ERROR_INVALID_FIELD_INITIAL)) {
+			/*
+			 * Force invalid response field name. Return
+			 * "XXXXXrequestReferences" instead of "requestReferences"
+			 */
+			return new ResponseEntity<String>(acceptResponse.replace("requestReferences", "XXXXXrequestReferences"),
+					HttpStatus.OK);
+		}
+
+		if (simulatedError.equals(ERROR_GENERAL_SERVER_EXCEPTION)) {
+			throw new IOException("an example of an IO exception");
+		}
+
+		if (simulatedError.equals(ERROR_SERVER_TIMEOUT_INITIAL)) {
+			Thread.sleep(TEST_DELAY_LONG_MSEC);
+		}
+
+		if (simulatedError.equals(ERROR_MAX_POLLS)) {
+			maximumPolls = MAXIMUM_POLLS_LARGE;
+		}
+
+		/*
+		 * End of block of simulated error code.
+		 */
+
+		return new ResponseEntity<String>(acceptResponse, HttpStatus.OK);
+	}
+
+	/**
+	 * Delete svc instance.
+	 *
+	 * @param serviceInstanceId the service instance id
+	 * @param request the request
+	 * @return the response entity
+	 * @throws Exception the exception
+	 */
+	@RequestMapping(value = "/mso_delete_svc_instance/{serviceInstanceId}", method = RequestMethod.POST)
+	public ResponseEntity<String> deleteSvcInstance(@PathVariable("serviceInstanceId") String serviceInstanceId,
+													HttpServletRequest request) throws Exception {
+		readAndLogRequest("DELETE SERVICE INSTANCE: serviceInstanceId: " + serviceInstanceId, request);
+		Thread.sleep(TEST_DELAY_SHORT_MSEC);
+		maximumPolls = MAXIMUM_POLLS_DEFAULT; // Simulates MSO polling behavior
+		attemptCount = 0;
+		return new ResponseEntity<String>(acceptResponse, HttpStatus.OK);
+	}
+
+	/**
+	 * Creates the vnf instance.
+	 *
+	 * @param serviceInstanceId the service instance id
+	 * @param request the request
+	 * @return the response entity
+	 * @throws Exception the exception
+	 */
+	@RequestMapping(value = "/mso_create_vnf_instance/{serviceInstanceId}", method = RequestMethod.POST)
+	public ResponseEntity<String> createVnfInstance(@PathVariable("serviceInstanceId") String serviceInstanceId,
+													HttpServletRequest request) throws Exception {
+		readAndLogRequest("CREATE VNF INSTANCE: serviceInstanceId: " + serviceInstanceId, request);
+		Thread.sleep(TEST_DELAY_SHORT_MSEC);
+		maximumPolls = MAXIMUM_POLLS_DEFAULT; // Simulates MSO polling behavior
+		attemptCount = 0;
+		return new ResponseEntity<String>(acceptResponse, HttpStatus.OK);
+	}
+
+	/**
+	 * Delete vnf instance.
+	 *
+	 * @param serviceInstanceId the service instance id
+	 * @param vnfInstanceId the vnf instance id
+	 * @param request the request
+	 * @return the response entity
+	 * @throws Exception the exception
+	 */
+	@RequestMapping(value = "/mso_delete_vnf_instance/{serviceInstanceId}/vnfs/{vnfInstanceId}", method = RequestMethod.POST)
+	public ResponseEntity<String> deleteVnfInstance(@PathVariable("serviceInstanceId") String serviceInstanceId,
+													@PathVariable("vnfInstanceId") String vnfInstanceId, HttpServletRequest request) throws Exception {
+		readAndLogRequest(
+				"DELETE VNF INSTANCE: serviceInstanceId: " + serviceInstanceId + " vnfInstanceId: " + vnfInstanceId,
+				request);
+		Thread.sleep(TEST_DELAY_SHORT_MSEC);
+		maximumPolls = MAXIMUM_POLLS_DEFAULT; // Simulates MSO polling behavior
+		attemptCount = 0;
+		return new ResponseEntity<String>(acceptResponse, HttpStatus.OK);
+	}
+
+	/**
+	 * Creates the vf module instance.
+	 *
+	 * @param serviceInstanceId the service instance id
+	 * @param vnfInstanceId the vnf instance id
+	 * @param request the request
+	 * @return the response entity
+	 * @throws Exception the exception
+	 */
+	// /serviceInstances/v2/ff305d54-75b4-431b-adb2-eb6b9e5ff000/vnfs/ff305d54-75b4-ff1b-adb2-eb6b9e5460ff/vfModules
+	@RequestMapping(value = "/mso_create_vfmodule_instance/{serviceInstanceId}/vnfs/{vnfInstanceId}", method = RequestMethod.POST)
+	public ResponseEntity<String> createVfModuleInstance(@PathVariable("serviceInstanceId") String serviceInstanceId,
+														 @PathVariable("vnfInstanceId") String vnfInstanceId, HttpServletRequest request) throws Exception {
+		readAndLogRequest("CREATE VF MODULE INSTANCE: serviceInstanceId: " + serviceInstanceId + " vnfInstanceId: "
+				+ vnfInstanceId, request);
+		Thread.sleep(TEST_DELAY_SHORT_MSEC);
+		maximumPolls = MAXIMUM_POLLS_DEFAULT; // Simulates MSO polling behavior
+		attemptCount = 0;
+		return new ResponseEntity<String>(acceptResponse, HttpStatus.OK);
+	}
+
+	/**
+	 * Delete vf module instance.
+	 *
+	 * @param serviceInstanceId the service instance id
+	 * @param vnfInstanceId the vnf instance id
+	 * @param vfModuleInstanceId the vf module instance id
+	 * @param request the request
+	 * @return the response entity
+	 * @throws Exception the exception
+	 */
+	// /serviceInstances/v2/ff305d54-75b4-431b-adb2-eb6b9e5ff000/vnfs/ff305d54-75b4-ff1b-adb2-eb6b9e5460ff/vfModules/ff305d54-75b4-ff1b-bdb2-eb6b9e5460ff
+	@RequestMapping(value = "/mso_delete_vfmodule_instance/{serviceInstanceId}/vnfs/{vnfInstanceId}/vfModules/{vfModuleInstanceId}", method = RequestMethod.POST)
+	public ResponseEntity<String> deleteVfModuleInstance(@PathVariable("serviceInstanceId") String serviceInstanceId,
+														 @PathVariable("vnfInstanceId") String vnfInstanceId,
+														 @PathVariable("vfModuleInstanceId") String vfModuleInstanceId, HttpServletRequest request)
+			throws Exception {
+		readAndLogRequest("DELETE VF MODULE INSTANCE: serviceInstanceId: " + serviceInstanceId + " vnfInstanceId: "
+				+ vnfInstanceId + " vfModuleInstanceId: " + vfModuleInstanceId, request);
+		Thread.sleep(TEST_DELAY_SHORT_MSEC);
+		maximumPolls = MAXIMUM_POLLS_DEFAULT; // Simulates MSO polling behavior
+		attemptCount = 0;
+		return new ResponseEntity<String>(acceptResponse, HttpStatus.OK);
+	}
+
+	// POST
+	/**
+	 * Creates the volume group instance.
+	 *
+	 * @param serviceInstanceId the service instance id
+	 * @param vnfInstanceId the vnf instance id
+	 * @param request the request
+	 * @return the response entity
+	 * @throws Exception the exception
+	 */
+	// /serviceInstances/v2/ff305d54-75b4-431b-adb2-eb6b9e5ff000/volumeGroups
+	@RequestMapping(value = "/mso_create_volumegroup_instance/{serviceInstanceId}/vnfs/{vnfInstanceId}", method = RequestMethod.POST)
+	public ResponseEntity<String> createVolumeGroupInstance(@PathVariable("serviceInstanceId") String serviceInstanceId,
+															@PathVariable("vnfInstanceId") String vnfInstanceId, HttpServletRequest request) throws Exception {
+		readAndLogRequest("CREATE VOLUME GROUP INSTANCE: seviceInstanceId: " + serviceInstanceId + " vnfInstanceId: "
+				+ vnfInstanceId, request);
+		Thread.sleep(TEST_DELAY_SHORT_MSEC);
+		maximumPolls = MAXIMUM_POLLS_DEFAULT; // Simulates MSO polling behavior
+		attemptCount = 0;
+		return new ResponseEntity<String>(acceptResponse, HttpStatus.OK);
+	}
+
+	/**
+	 * Delete volume group instance.
+	 *
+	 * @param serviceInstanceId the service instance id
+	 * @param vnfInstanceId the vnf instance id
+	 * @param volumeGroupInstanceId the volume group instance id
+	 * @param request the request
+	 * @return the response entity
+	 * @throws Exception the exception
+	 */
+	// /serviceInstances/v2/ff305d54-75b4-431b-adb2-eb6b9e5ff000/volumeGroups/ff305d54-75b4-ff1b-cdb2-eb6b9e5460ff
+	@RequestMapping(value = "/mso_delete_volumegroup_instance/{serviceInstanceId}/vnfs/{vnfInstanceId}/volumeGroups/{volumeGroupInstanceId}", method = RequestMethod.POST)
+	public ResponseEntity<String> deleteVolumeGroupInstance(@PathVariable("serviceInstanceId") String serviceInstanceId,
+															@PathVariable("vnfInstanceId") String vnfInstanceId,
+															@PathVariable("volumeGroupInstanceId") String volumeGroupInstanceId, HttpServletRequest request)
+			throws Exception {
+		readAndLogRequest("DELETE NW INSTANCE: serviceInstanceId: " + serviceInstanceId + " vnfInstanceId: "
+				+ vnfInstanceId + " volumeGroupInstanceId: " + volumeGroupInstanceId, request);
+		Thread.sleep(TEST_DELAY_SHORT_MSEC);
+		maximumPolls = MAXIMUM_POLLS_DEFAULT; // Simulates MSO polling behavior
+		attemptCount = 0;
+		return new ResponseEntity<String>(acceptResponse, HttpStatus.OK);
+	}
+
+	/**
+	 * Creates the nw instance.
+	 *
+	 * @param serviceInstanceId the service instance id
+	 * @param request the request
+	 * @return the response entity
+	 * @throws Exception the exception
+	 */
+	@RequestMapping(value = "/mso_create_nw_instance/{serviceInstanceId}", method = RequestMethod.POST)
+	public ResponseEntity<String> createNwInstance(@PathVariable("serviceInstanceId") String serviceInstanceId,
+												   HttpServletRequest request) throws Exception {
+		readAndLogRequest("CREATE NW INSTANCE: serviceInstanceId: " + serviceInstanceId, request);
+		Thread.sleep(TEST_DELAY_SHORT_MSEC);
+		maximumPolls = MAXIMUM_POLLS_DEFAULT; // Simulates MSO polling behavior
+		attemptCount = 0;
+		return new ResponseEntity<String>(acceptResponse, HttpStatus.OK);
+	}
+
+	/**
+	 * Delete nw instance.
+	 *
+	 * @param serviceInstanceId the service instance id
+	 * @param networkInstanceId the network instance id
+	 * @param request the request
+	 * @return the response entity
+	 * @throws Exception the exception
+	 */
+	@RequestMapping(value = "/mso_delete_nw_instance/{serviceInstanceId}/networks/{networkInstanceId}", method = RequestMethod.POST)
+	public ResponseEntity<String> deleteNwInstance(@PathVariable("serviceInstanceId") String serviceInstanceId,
+												   @PathVariable("networkInstanceId") String networkInstanceId, HttpServletRequest request) throws Exception {
+		readAndLogRequest("DELETE NW INSTANCE: serviceInstanceId: " + serviceInstanceId + " networkInstanceId: "
+				+ networkInstanceId, request);
+		Thread.sleep(TEST_DELAY_SHORT_MSEC);
+		maximumPolls = MAXIMUM_POLLS_DEFAULT; // Simulates MSO polling behavior
+		attemptCount = 0;
+		return new ResponseEntity<String>(acceptResponse, HttpStatus.OK);
+	}
+
+	/**
+	 * Gets the orchestration request.
+	 *
+	 * @param requestId the request id
+	 * @param request the request
+	 * @return the orchestration request
+	 * @throws Exception the exception
+	 */
+	@RequestMapping(value = "/mso_get_orch_req/{requestId}", method = RequestMethod.GET)
+	public ResponseEntity<String> getOrchestrationRequest(@PathVariable("requestId") String requestId,
+														  HttpServletRequest request) throws Exception {
+
+		System.err.println("GET ORCHESTRATION REQUEST: requestId: " + requestId);
+
+		/*
+		 * This block of code simulates various errors and would NOT be expected
+		 * in a non-test method
+		 */
+
+		if (simulatedError.equals(ERROR_INVALID_FIELD_POLL)) {
+			/*
+			 * Force invalid response field name. Return "XXXXXrequestStatus"
+			 * instead of "requestStatus"
+			 */
+			return new ResponseEntity<String>(inProgressResponse.replace("requestStatus", "XXXXXrequestStatus"),
+					HttpStatus.OK);
+		}
+
+		if (simulatedError.equals(ERROR_POLL_FAILURE)) {
+			/*
+			 * Force status field with "Failure"
+			 */
+			return new ResponseEntity<String>(inProgressResponse.replace("InProgress", "Failure"), HttpStatus.OK);
+		}
+
+		if (simulatedError.equals(ERROR_SERVER_TIMEOUT_POLL)) {
+			Thread.sleep(TEST_DELAY_LONG_MSEC);
+		}
+
+		/*
+		 * End of block of simulated error code.
+		 */
+
+		/*
+		 * This logic simulates how MSO might behave ... i.e. return different
+		 * results depending on the value of 'maximumPolls'.
+		 *
+		 */
+		int percentProgress = (++attemptCount * 100) / maximumPolls;
+
+		System.err.println("attempts: " + attemptCount + " max: " + maximumPolls + " percent: " + percentProgress);
+
+		String response = inProgressResponse.replace("\"50\"", "\"" + Integer.toString(percentProgress) + "\"");
+
+		if (attemptCount < maximumPolls) {
+			if (attemptCount > 1) {
+				response = response.replace("vLan setup", "setup step " + Integer.toString(attemptCount));
+			}
+			return new ResponseEntity<String>(response, HttpStatus.OK);
+		} else {
+			return new ResponseEntity<String>(
+					response.replace("InProgress", "Complete").replace("vLan setup complete", ""), HttpStatus.OK);
+		}
+	}
+
+	/**
+	 * Gets the orchestration requests.
+	 *
+	 * @param filterString the filter string
+	 * @param request the request
+	 * @return the orchestration requests
+	 * @throws Exception the exception
+	 */
+	@RequestMapping(value = "/mso_get_orch_reqs/{filterString}", method = RequestMethod.GET)
+	public ResponseEntity<String> getOrchestrationRequests(@PathVariable("filterString") String filterString,
+														   HttpServletRequest request) throws Exception {
+
+		System.err.println("GET ORCHESTRATION REQUESTS: filterString: " + filterString);
+
+		return new ResponseEntity<String>(getOrchestrationRequestsResponse, HttpStatus.OK);
+
+	}
+
+	/*
+	 * General purpose exception handler that could be used in application code.
+	 * 
+	 * The method returns exceptions as error code 500. Both the exception type
+	 * and message are written as a JSON object.
+	 * 
+	 * See the following references:
+	 * 
+	 * 1) The ExceptionResponse POJO.
+	 * 
+	 * 2) The "getHttpErrorMessage" function in "utilityService.js" - an example
+	 * of how the browser JavaScript code can interpret this response.
+	 */
+
+	/**
+	 * Exception.
+	 *
+	 * @param e the e
+	 * @param response the response
+	 * @throws IOException Signals that an I/O exception has occurred.
+	 */
+	@ExceptionHandler(Exception.class)
+	private void exception(Exception e, HttpServletResponse response) throws IOException {
+
+		/*
+		 * This logging step should preferably be replaced with an appropriate
+		 * logging method consistent whatever logging mechanism the rest of the
+		 * application code uses.
+		 */
+
+		e.printStackTrace(System.err);
+
+		response.setContentType("application/json; charset=UTF-8");
+		response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
+
+		ExceptionResponse exceptionResponse = new ExceptionResponse();
+		exceptionResponse.setException(e.getClass().toString().replaceFirst("^.*\\.", ""));
+		exceptionResponse.setMessage(e.getMessage());
+
+		response.getWriter().write(new ObjectMapper().writeValueAsString(exceptionResponse));
+
+		response.flushBuffer();
+
+	}
+
+	/*
+	 * 'readAndLogRequest' only intended to be used for testing.
+	 * 
+	 * The method reads JSON from the input stream and thus prevents other
+	 * mechanisms from reading the input.
+	 */
+
+	/**
+	 * Read and log request.
+	 *
+	 * @param label the label
+	 * @param request the request
+	 * @throws Exception the exception
+	 */
+	private void readAndLogRequest(String label, HttpServletRequest request) throws Exception {
+		String input = request.getReader().lines().collect(Collectors.joining(System.lineSeparator()));
+
+		ObjectMapper mapper = new ObjectMapper();
+		Object json = mapper.readValue(input, Object.class);
+
+		System.err.println(label + "\n" + mapper.writerWithDefaultPrettyPrinter().writeValueAsString(json));
+
+		/*
+		 * Only needed for error simulation ...
+		 */
+		if (input.matches("^.*modelName.*$")) {
+			simulatedError = input.replaceAll("^.*\"modelName\":\"", "").replaceAll("\".*$", "");
+		}
+	}
+
+	/*
+	 * Various test responses:
+	 */
+
+	// @formatter:off
+
+	/** The accept response. */
+	/*
+	 * Sample responses to initial create / delete transaction
+	 */
+	private String acceptResponse =
+			"{" +
+					"  \"status\": 202," +
+					"  \"entity\": {" +
+					"      \"requestReferences\": {" +
+					"         \"instanceId\": \"bc305d54-75b4-431b-adb2-eb6b9e546014\"," +
+					"         \"requestId\": \"rq1234d1-5a33-55df-13ab-12abad84e331\"" +
+					"      }" +
+					"  }" +
+					"}";
+
+	/** The policy exception response. */
+	private String policyExceptionResponse =
+			"{" +
+					"  \"status\": 400," +
+					"  \"entity\": { " +
+					"    \"requestError\": {" +
+					"      \"policyException\": {" +
+					"        \"messageId\": \"POL9003\"," +
+					"        \"text\": \"Message content size exceeds the allowable limit\"" +
+					"      }" +
+					"    }" +
+					"  }" +
+					"}";
+
+	/** The service exception response. */
+	private String serviceExceptionResponse =
+			"{" +
+					"  \"status\": 400," +
+					"  \"entity\": { " +
+					"    \"requestError\": {" +
+					"      \"serviceException\": {" +
+					"        \"messageId\": \"SVC2000\"," +
+					"        \"text\": \"Missing Parameter: %1. Error code is %2\"," +
+					"        \"variables\": [" +
+					"          \"severity\"," +
+					"          \"400\"" +
+					"        ]" +
+					"      }" +
+					"    }" +
+					"  }" +
+					"}" +
+					"";
+
+	/** The in progress response. */
+	/*
+	 * Sample response to subsequent getOrchestrationRequest
+	 */
+	private String inProgressResponse =
+			"{" +
+					"   \"status\": 200," +
+					"   \"entity\": {" +
+					"      \"request\": {" +
+					"         \"requestId\": \"rq1234d1-5a33-55df-13ab-12abad84e333\"," +
+					"         \"startTime\": \"Thu, 04 Jun 2009 02:51:59 GMT\"," +
+					"         \"instanceIds\": {" +
+					"            \"serviceInstanceId\": \"bc305d54-75b4-431b-adb2-eb6b9e546014\"" +
+					"         }," +
+					"         \"requestScope\": \"service\"," +
+					"         \"requestType\": \"createInstance\"," +
+					"         \"requestDetails\": {" +
+					"            \"modelInfo\": {" +
+					"               \"modelType\": \"service\"," +
+					"               \"modelId\": \"sn5256d1-5a33-55df-13ab-12abad84e764\"," +
+					"               \"modelNameVersionId\": \"ab6478e4-ea33-3346-ac12-ab121484a333\"," +
+					"               \"modelName\": \"WanBonding\"," +
+					"               \"modelVersion\": \"1\"" +
+					"            }," +
+					"            \"subscriberInfo\": {" +
+					"                \"globalSubscriberId\": \"C12345\"," +
+					"                \"subscriberName\": \"General Electric Division 12\"" +
+					"            }," +
+					"            \"requestParameters\": {" +
+					"               \"vpnId\": \"1a2b3c4d5e6f\"," +
+					"               \"productName\": \"Trinity\"," +
+					"               \"customerId\": \"icore9883749\"" +
+					"            }" +
+					"         }," +
+					"         \"requestStatus\": {" +
+					"            \"timestamp\": \"Thu, 04 Jun 2009 02:53:39 GMT\"," +
+					"            \"requestState\": \"InProgress\"," +
+					"            \"statusMessage\": \"vLan setup complete\"," +
+					"            \"percentProgress\": \"50\"" +
+					"         }" +
+					"      }" +
+					"   }" +
+					"}";
+	
+	/*
+	 * Sample response to subsequent getOrchestrationRequests
+	 */
+
+	/** The get orchestration requests response. */
+	private String getOrchestrationRequestsResponse =
+			"{" +
+					"   \"status\": 200," +
+					"   \"entity\": {" +
+					"      \"requestList\": [" +
+					"         {" +
+					"            \"request\": {" +
+					"               \"requestId\": \"rq1234d1-5a33-55df-13ab-12abad84e333\"," +
+					"               \"startTime\": \"Thu, 04 Jun 2009 02:51:59 GMT\"," +
+					"               \"finishTime\": \"Thu, 04 Jun 2009 02:55:59 GMT\"," +
+					"               \"instanceReferences\": {" +
+					"                  \"serviceInstanceId\": \"bc305d54-75b4-431b-adb2-eb6b9e546014\"" +
+					"               }," +
+					"               \"requestScope\": \"service\"," +
+					"               \"requestType\": \"createInstance\"," +
+					"               \"requestDetails\": {" +
+					"                  \"modelInfo\": {" +
+					"                     \"modelType\": \"service\"," +
+					"                     \"modelId\": \"sn5256d1-5a33-55df-13ab-12abad84e764\"," +
+					"                     \"modelNameVersionId\": \"ab6478e4-ea33-3346-ac12-ab121484a333\"," +
+					"                     \"modelName\": \"WanBonding\"," +
+					"                     \"modelVersion\": \"1\"" +
+					"                  }," +
+					"                  \"subscriberInfo\": {" +
+					"                      \"globalSubscriberId\": \"C12345\"," +
+					"                      \"subscriberName\": \"General Electric Division 12\"" +
+					"                  }," +
+					"                  \"requestParameters\": {" +
+					"                     \"vpnId\": \"1a2b3c4d5e6f\"," +
+					"                     \"productName\": \"Trinity\"," +
+					"                     \"customerId\": \"icore9883749\"" +
+					"                  }" +
+					"               }," +
+					"               \"requestStatus\": {" +
+					"                  \"timestamp\": \"Thu, 04 Jun 2009 02:54:49 GMT\"," +
+					"                  \"requestState\": \"complete\"," +
+					"                  \"statusMessage\": \"Resource Created\"," +
+					"                  \"percentProgress\": \"100\"" +
+					"               }" +
+					"            }" +
+					"         }," +
+					"         {" +
+					"            \"request\": {" +
+					"               \"requestId\": \"rq1234d1-5a33-55df-13ab-12abad84e334\"," +
+					"               \"startTime\": \"Thu, 04 Jun 2009 03:52:59 GMT\"," +
+					"               \"instanceReferences\": {" +
+					"                  \"serviceInstanceId\": \"bc305d54-75b4-431b-adb2-eb6b9e546014\"" +
+					"               }," +
+					"               \"requestScope\": \"service\"," +
+					"               \"requestType\": \"updateInstance\"," +
+					"               \"requestDetails\": {" +
+					"                  \"modelInfo\": {" +
+					"                     \"modelType\": \"service\"," +
+					"                     \"modelId\": \"sn5256d1-5a33-55df-13ab-12abad84e764\"," +
+					"                     \"modelNameVersionId\": \"ab6478e4-ea33-3346-ac12-ab121484a333\"," +
+					"                     \"modelName\": \"WanBonding\"," +
+					"                     \"modelVersion\": \"1\"" +
+					"                  }," +
+					"                  \"subscriberInfo\": {" +
+					"                      \"globalSubscriberId\": \"C12345\"," +
+					"                      \"subscriberName\": \"General Electric Division 12\"" +
+					"                  }," +
+					"                  \"requestParameters\": {" +
+					"                     \"vpnId\": \"1a2b3c4d5e70\"," +
+					"                     \"productName\": \"Trinity\"," +
+					"                     \"customerId\": \"icore9883749\"" +
+					"                  }" +
+					"               }," +
+					"               \"requestStatus\": {" +
+					"                  \"timestamp\": \"Thu, 04 Jun 2009 03:53:39 GMT\"," +
+					"                  \"requestState\": \"InProgress\"," +
+					"                  \"statusMessage\": \"vLan setup complete\"," +
+					"                  \"percentProgress\": \"50\"" +
+					"               }" +
+					"            }" +
+					"         }" +
+					"      ]" +
+					"   }" +
+					"}";
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/controller/test/TestPageController.java b/vid-app-common/src/main/java/org/onap/vid/controller/test/TestPageController.java
new file mode 100644
index 0000000..48ccdf8
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/controller/test/TestPageController.java
@@ -0,0 +1,55 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * VID
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package  org.onap.vid.controller.test;
+
+import org.openecomp.portalsdk.core.controller.RestrictedBaseController;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.servlet.ModelAndView;
+
+/**
+ * The Class TestPageController.
+ */
+@Controller
+public class TestPageController extends RestrictedBaseController {
+
+	/**
+	 * Test mso page.
+	 *
+	 * @return the model and view
+	 */
+	@RequestMapping(value = { "testMso.htm" }, method = RequestMethod.GET)
+	public ModelAndView testMsoPage() {
+		return new ModelAndView(getViewName());
+	}
+
+	/**
+	 * Test view edit page.
+	 *
+	 * @return the model and view
+	 */
+	@RequestMapping(value = { "testViewEdit" }, method = RequestMethod.GET)
+	public ModelAndView testViewEditPage() {
+		return new ModelAndView(getViewName());
+	}
+
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/dao/FnAppDoaImpl.java b/vid-app-common/src/main/java/org/onap/vid/dao/FnAppDoaImpl.java
new file mode 100644
index 0000000..c27d17e
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/dao/FnAppDoaImpl.java
@@ -0,0 +1,112 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * VID
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.vid.dao;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.URI;
+import java.net.URL;
+import java.sql.Connection;
+import java.sql.DriverManager;
+import java.sql.PreparedStatement;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.util.Properties;
+
+import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
+
+
+public class FnAppDoaImpl {
+
+	/** The logger. */
+	static EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(FnAppDoaImpl.class);
+		
+		public int getProfileCount(String driver, String URL, String username, String password) {
+			Connection dbc = null;
+			PreparedStatement pst = null;
+			ResultSet rs = null;
+			String q = null;
+			int count = 0;
+			try {
+				 	dbc = getConnection(driver,URL,username,password);
+				   logger.debug(EELFLoggerDelegate.debugLogger, "getConnection:::"+ dbc);
+				q = "select count(*) from fn_app";
+					pst = dbc.prepareStatement(q);
+					rs = pst.executeQuery();
+					
+					if (rs.next())
+						count = rs.getInt(1);
+			} catch(Exception ex) {
+				logger.error(EELFLoggerDelegate.errorLogger, "Failed to perform health check", ex);
+			} finally {
+				cleanup(rs,pst,dbc);
+			}
+			logger.debug(EELFLoggerDelegate.debugLogger, "count:::"+ count);
+			return count;
+		}
+
+		public static Connection getConnection(String driver2, String url, String username, String password) throws IOException, SQLException, ClassNotFoundException{
+			java.sql.Connection con=null;
+		
+			if( url!=null && username!=null && password!=null ){
+			    con = DriverManager.getConnection(url, username, password);
+			}
+			
+			   System.out.println("Connection Successful");		    	
+			return con;
+			
+		}
+		
+		public static void cleanup(ResultSet rs, PreparedStatement st, Connection c) {
+			if (rs != null) {
+				try {
+					rs.close();
+				} catch (Exception e) {
+					if (logger != null)
+						logger.error("Error when trying to close result set", e);
+				}
+			}
+			if (st != null) {
+				try {
+					st.close();
+				} catch (Exception e) {
+					if (logger != null)
+						logger.error("Error when trying to close statement", e);
+				}
+			}
+			if (c != null) {
+				try {
+					c.rollback();
+				} catch (Exception e) {
+					if (logger != null)
+						logger.error("Error when trying to rollback connection", e);
+				}
+				try {
+					c.close();
+				} catch (Exception e) {
+					if (logger != null)
+						logger.error("Error when trying to close connection", e);
+				}
+			}
+		}
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/dao/ProfileDao.java b/vid-app-common/src/main/java/org/onap/vid/dao/ProfileDao.java
new file mode 100644
index 0000000..e6a8a4e
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/dao/ProfileDao.java
@@ -0,0 +1,45 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * VID
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.vid.dao;
+
+import java.util.List;
+import org.openecomp.portalsdk.core.domain.Profile;
+
+/**
+ * The Interface ProfileDao.
+ */
+public interface ProfileDao {
+	
+	/**
+	 * Find all.
+	 *
+	 * @return the list
+	 */
+	List<Profile> findAll();
+	
+	/**
+	 * Gets the profile.
+	 *
+	 * @param id the id
+	 * @return the profile
+	 */
+	Profile getProfile(int id);
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/exceptions/NotFoundException.java b/vid-app-common/src/main/java/org/onap/vid/exceptions/NotFoundException.java
new file mode 100644
index 0000000..0616aa1
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/exceptions/NotFoundException.java
@@ -0,0 +1,12 @@
+package org.onap.vid.exceptions;
+
+public class NotFoundException extends RuntimeException {
+
+     public NotFoundException(String message) {
+        super(message);
+    }
+
+    public NotFoundException(String message, Throwable cause) {
+        super(message, cause);
+    }
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/exceptions/VidServiceUnavailableException.java b/vid-app-common/src/main/java/org/onap/vid/exceptions/VidServiceUnavailableException.java
new file mode 100644
index 0000000..622b34c
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/exceptions/VidServiceUnavailableException.java
@@ -0,0 +1,69 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * VID
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.vid.exceptions;
+
+import org.springframework.http.HttpStatus;
+import org.springframework.web.bind.annotation.ResponseStatus;
+
+/**
+ * The Class VidServiceUnavailableException.
+ */
+@ResponseStatus(value=HttpStatus.SERVICE_UNAVAILABLE)
+public class VidServiceUnavailableException extends Exception {
+
+	/** The Constant serialVersionUID. */
+	private static final long serialVersionUID = 1L;
+
+	/**
+	 * Instantiates a new vid service unavailable exception.
+	 */
+	public VidServiceUnavailableException() {
+		super();
+	}
+	
+	/**
+	 * Instantiates a new vid service unavailable exception.
+	 *
+	 * @param msg the msg
+	 */
+	public VidServiceUnavailableException(String msg) {
+		super(msg);
+	}
+	
+	/**
+	 * Instantiates a new vid service unavailable exception.
+	 *
+	 * @param t the t
+	 */
+	public VidServiceUnavailableException(Throwable t) {
+		super(t);
+	}
+	
+	/**
+	 * Instantiates a new vid service unavailable exception.
+	 *
+	 * @param msg the msg
+	 * @param t the t
+	 */
+	public VidServiceUnavailableException(String msg, Throwable t) {
+		super(msg, t);
+	}
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/factories/MsoRequestFactory.java b/vid-app-common/src/main/java/org/onap/vid/factories/MsoRequestFactory.java
new file mode 100644
index 0000000..22bfa47
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/factories/MsoRequestFactory.java
@@ -0,0 +1,15 @@
+package org.onap.vid.factories;
+
+import org.onap.vid.mso.rest.RequestDetails;
+
+/**
+ * Created by pickjonathan on 19/06/2017.
+ */
+public class MsoRequestFactory {
+
+    public RequestDetails createMsoRequest(String path)
+    {
+        return null;
+    }
+
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/logging/VidLoggerAspect.java b/vid-app-common/src/main/java/org/onap/vid/logging/VidLoggerAspect.java
new file mode 100644
index 0000000..e4e0edb
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/logging/VidLoggerAspect.java
@@ -0,0 +1,85 @@
+package org.onap.vid.logging;
+
+import org.apache.commons.lang3.StringUtils;
+import org.aspectj.lang.ProceedingJoinPoint;
+import org.aspectj.lang.annotation.Around;
+import org.aspectj.lang.annotation.Aspect;
+import org.aspectj.lang.annotation.Pointcut;
+import org.openecomp.portalsdk.core.logging.aspect.EELFLoggerAdvice;
+import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
+import org.openecomp.portalsdk.core.util.SystemProperties;
+import org.springframework.beans.factory.annotation.Autowired;
+
+import java.net.InetAddress;
+import java.net.UnknownHostException;
+
+import static com.att.eelf.configuration.Configuration.MDC_SERVER_FQDN;
+
+
+@Aspect
+@org.springframework.context.annotation.Configuration
+public class VidLoggerAspect {
+
+    private String canonicalHostName;
+    @Autowired
+    EELFLoggerAdvice advice;
+
+    public VidLoggerAspect() {
+        try {
+            final InetAddress localHost = InetAddress.getLocalHost();
+            canonicalHostName = localHost.getCanonicalHostName();
+        } catch (UnknownHostException e) {
+            // YOLO
+            canonicalHostName = null;
+        }
+    }
+
+    @Pointcut("execution(public * org.onap.vid.controller.*Controller.*(..))")
+    public void vidControllers() {}
+
+    @Around("vidControllers() && (" +
+            "  @within(org.openecomp.portalsdk.core.logging.aspect.AuditLog)" +
+            "  || @annotation(org.openecomp.portalsdk.core.logging.aspect.AuditLog)" +
+            "  || @annotation(org.springframework.web.bind.annotation.RequestMapping)" +
+            ")")
+    public Object logAuditMethodClassAround(ProceedingJoinPoint joinPoint) throws Throwable {
+        return logAroundMethod(joinPoint, SystemProperties.SecurityEventTypeEnum.INCOMING_REST_MESSAGE);
+    }
+
+    private Object logAroundMethod(ProceedingJoinPoint joinPoint, SystemProperties.SecurityEventTypeEnum securityEventType) throws Throwable {
+        //Before
+        Object[] passOnArgs = new Object[] {joinPoint.getSignature().getDeclaringType().getName(),joinPoint.getSignature().getName()};
+        Object[] returnArgs = advice.before(securityEventType, joinPoint.getArgs(), passOnArgs);
+
+        fixServerFqdnInMDC();
+
+        //Execute the actual method
+        Object result;
+        String restStatus = "COMPLETE";
+        try {
+            result = joinPoint.proceed();
+        } catch(Exception e) {
+            restStatus = "ERROR";
+            throw e;
+        } finally {
+            fixStatusCodeInMDC(restStatus);
+            advice.after(securityEventType, restStatus, joinPoint.getArgs(), returnArgs, passOnArgs);
+        }
+
+        return result;
+    }
+
+    // Set the status code into MDC *before* the metrics log is written by advice.after()
+    private void fixStatusCodeInMDC(String restStatus) {
+        EELFLoggerDelegate.mdcPut(SystemProperties.STATUS_CODE, restStatus);
+    }
+
+    // Override the non-canonical hostname set by EELFLoggerDelegate::setGlobalLoggingContext()
+    // that was invoked by advice.before() (and some other SDK cases)
+    private void fixServerFqdnInMDC() {
+        if (!StringUtils.isBlank(canonicalHostName)) {
+            EELFLoggerDelegate.mdcPut(MDC_SERVER_FQDN, canonicalHostName);
+        }
+    }
+
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/model/CategoryParameter.java b/vid-app-common/src/main/java/org/onap/vid/model/CategoryParameter.java
new file mode 100644
index 0000000..e293999
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/model/CategoryParameter.java
@@ -0,0 +1,120 @@
+package org.onap.vid.model;
+
+//import org.hibernate.annotations.Table;
+import org.openecomp.portalsdk.core.domain.support.DomainVo;
+import org.onap.vid.controller.MaintenanceController;
+
+//import javax.persistence.*;
+import javax.persistence.*;
+import java.io.Serializable;
+import java.util.Date;
+import java.util.HashSet;
+import java.util.Set;
+
+@Entity
+@Table(name = "vid_category_parameter", uniqueConstraints = @UniqueConstraint(columnNames = "name"))
+public class CategoryParameter extends DomainVo {
+
+    public enum Family {
+        PARAMETER_STANDARDIZATION,
+        TENANT_ISOLATION
+    }
+
+    private String name;
+    private boolean idSupported;
+
+    @Column(name = "FAMILY")
+    @Enumerated(EnumType.STRING)
+    private String family;
+
+    public String getFamily() {
+        return family;
+    }
+
+    public void setFamily(String family) {
+        this.family = family;
+    }
+
+    private Set<CategoryParameterOption> options = new HashSet<>(0);
+
+    @Override
+    @Id
+    @GeneratedValue(strategy = GenerationType.IDENTITY)
+    @Column(name = "CATEGORY_ID")
+    public Long getId() {
+        return super.getId();
+    }
+
+    @Override
+    @Column(name = "CREATED_DATE")
+    public Date getCreated() {
+        return super.getCreated();
+    }
+
+    @Override
+    @Column(name = "MODIFIED_DATE")
+    public Date getModified() {
+        return super.getModified();
+    }
+
+    @Override
+    @Transient
+    public Long getCreatedId() {
+        return super.getCreatedId();
+    }
+
+    @Override
+    @Transient
+    public Long getModifiedId() {
+        return super.getModifiedId();
+    }
+
+    @Column(name = "NAME", unique = true, nullable = false, length=50)
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    @Override
+    @Transient
+    public Serializable getAuditUserId() {
+        return super.getAuditUserId();
+    }
+
+    @Override
+    @Transient
+    public Long getRowNum() {
+        return super.getRowNum();
+    }
+
+    @Override
+    @Transient
+    public Set getAuditTrail() {
+        return super.getAuditTrail();
+    }
+
+    @OneToMany(fetch = FetchType.EAGER, mappedBy = "categoryParameter")
+    public Set<CategoryParameterOption> getOptions() {
+        return options;
+    }
+
+    public void setOptions(Set<CategoryParameterOption> options) {
+        this.options = options;
+    }
+
+    public boolean addOption(CategoryParameterOption option) {
+        return options.add(option);
+    }
+
+    @Column(name = "ID_SUPPORTED")
+    public boolean isIdSupported() {
+        return idSupported;
+    }
+
+    public void setIdSupported(boolean idSupported) {
+        this.idSupported = idSupported;
+    }
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/model/CategoryParameterOption.java b/vid-app-common/src/main/java/org/onap/vid/model/CategoryParameterOption.java
new file mode 100644
index 0000000..39efb2c
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/model/CategoryParameterOption.java
@@ -0,0 +1,139 @@
+package org.onap.vid.model;
+
+import org.openecomp.portalsdk.core.domain.support.DomainVo;
+
+import javax.persistence.*;
+import java.io.Serializable;
+import java.util.Date;
+import java.util.Set;
+
+@Entity
+@Table(name = "vid_category_parameter_option")
+public class CategoryParameterOption extends DomainVo {
+
+    private Long id;
+    private String appId;
+    private String name;
+
+    private CategoryParameter categoryParameter;
+
+    public CategoryParameterOption() {
+    }
+
+    public CategoryParameterOption(String appId, String name, CategoryParameter categoryParameter) {
+        setAppId(appId);
+        setName(name);
+        setCategoryParameter(categoryParameter);
+    }
+
+    @Id
+    @GeneratedValue(strategy = GenerationType.IDENTITY)
+    @Column(name = "CATEGORY_OPT_DB_ID")
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    @Column(name = "CATEGORY_OPT_APP_ID")
+    public String getAppId() {
+        return appId;
+    }
+
+    public void setAppId(String appId) {
+        this.appId = appId;
+    }
+
+    @Column(name = "NAME")
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    @ManyToOne
+    @JoinColumn(name="CATEGORY_ID", nullable=false)
+    public CategoryParameter getCategoryParameter() {
+        return categoryParameter;
+    }
+
+    public void setCategoryParameter(CategoryParameter categoryParameter) {
+        this.categoryParameter = categoryParameter;
+    }
+
+    @Override
+    @Column(name = "CREATED_DATE")
+    public Date getCreated() {
+        return super.getCreated();
+    }
+
+    @Override
+    @Column(name = "MODIFIED_DATE")
+    public Date getModified() {
+        return super.getModified();
+    }
+
+    @Override
+    @Transient
+    public Long getCreatedId() {
+        return super.getCreatedId();
+    }
+
+    @Override
+    @Transient
+    public Long getModifiedId() {
+        return super.getModifiedId();
+    }
+
+    @Override
+    @Transient
+    public Serializable getAuditUserId() {
+        return super.getAuditUserId();
+    }
+
+    @Override
+    @Transient
+    public Long getRowNum() {
+        return super.getRowNum();
+    }
+
+    @Override
+    @Transient
+    public Set getAuditTrail() {
+        return super.getAuditTrail();
+    }
+
+    @Override
+    public boolean equals(Object o) {
+        if (this == o) return true;
+        if (o == null || getClass() != o.getClass()) return false;
+
+        CategoryParameterOption that = (CategoryParameterOption) o;
+
+        if (getAppId() != null ? !getAppId().equals(that.getAppId()) : that.getAppId() != null) return false;
+        if (getName() != null ? !getName().equals(that.getName()) : that.getName() != null) return false;
+        return getCategoryParameter() != null ? getCategoryParameter().equals(that.getCategoryParameter()) : that.getCategoryParameter() == null;
+    }
+
+    @Override
+    public int hashCode() {
+        int result = getAppId() != null ? getAppId().hashCode() : 0;
+        result = 31 * result + (getName() != null ? getName().hashCode() : 0);
+        result = 31 * result + (getCategoryParameter() != null ? getCategoryParameter().hashCode() : 0);
+        return result;
+    }
+
+    @Override
+    public String toString() {
+        return "CategoryParameterOption{" +
+                "id=" + id +
+                ", key='" + appId + '\'' +
+                ", value='" + name + '\'' +
+                ", categoryParameterId=" + categoryParameter.getId() +
+                '}';
+    }
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/model/CommandProperty.java b/vid-app-common/src/main/java/org/onap/vid/model/CommandProperty.java
new file mode 100644
index 0000000..4f5ee17
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/model/CommandProperty.java
@@ -0,0 +1,93 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * VID
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.vid.model;
+
+import java.util.Map;
+
+/**
+ * The Class Command Property.
+ */
+public class CommandProperty {
+	
+	/** The display name for this input */
+	private String displayName;
+	
+	/** The command, "get_input" */
+	private String command;
+	
+	/** The input name we refer to back under the inputs section */
+	private String inputName;
+
+	/**
+	 * Gets the display name.
+	 *
+	 * @return the displayName
+	 */
+	public String getDisplayName() {
+		return displayName;
+	}
+	/**
+	 * Gets the command.
+	 *
+	 * @return the command
+	 */
+	public String getCommand() {
+		return command;
+	}
+	/**
+	 * Gets the inputName.
+	 *
+	 * @return the inputName
+	 */
+	public String getInputName() {
+		return inputName;
+	}
+	/**
+	 * Sets the display name value.
+	 *
+	 * @param i the new get_input value
+	 */
+	public void setDisplayName(String i) {
+		this.displayName = i;
+	}
+	/**
+	 * Sets the command value.
+	 *
+	 * @param i the new command value
+	 */
+	public void setCommand(String i) {
+		this.command = i;
+	}
+	
+	/**
+	 * Sets the input name value.
+	 *
+	 * @param i the new input name value
+	 */
+	public void setInputName(String i) {
+		this.inputName=i;
+	}
+	
+	public String toString () {
+		String result = "displayName=" + displayName + " command=" + command + " inputName" + inputName;
+		return result;
+	}
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/model/ExceptionResponse.java b/vid-app-common/src/main/java/org/onap/vid/model/ExceptionResponse.java
new file mode 100644
index 0000000..444a4ba
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/model/ExceptionResponse.java
@@ -0,0 +1,91 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * VID
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.vid.model;
+
+import org.slf4j.MDC;
+
+import static com.att.eelf.configuration.Configuration.MDC_KEY_REQUEST_ID;
+
+/**
+ * The Class ExceptionResponse.
+ */
+public class ExceptionResponse {
+
+	public ExceptionResponse() {
+	}
+
+	/** The exception. */
+	private String exception;
+	
+	/** The message. */
+	private String message;
+
+	public ExceptionResponse(String exception, String message) {
+		this.exception = exception;
+		this.message = message;
+	}
+
+	public ExceptionResponse(Exception exception) {
+		setException(exception);
+	}
+
+	/**
+	 * Gets the exception.
+	 *
+	 * @return the exception
+	 */
+	public String getException() {
+		return exception;
+	}
+
+	/**
+	 * Sets the exception.
+	 *
+	 * @param exception the new exception
+	 */
+	public void setException(String exception) {
+		this.exception = exception;
+	}
+
+	public void setException(Exception exception) {
+		setException(exception.getClass().toString().replaceFirst("^.*[\\.$]", ""));
+		setMessage(exception.getMessage() + " (Request id: " + MDC.get(MDC_KEY_REQUEST_ID) + ")");
+	}
+
+	/**
+	 * Gets the message.
+	 *
+	 * @return the message
+	 */
+	public String getMessage() {
+		return message;
+	}
+
+	/**
+	 * Sets the message.
+	 *
+	 * @param message the new message
+	 */
+	public void setMessage(String message) {
+		this.message = message;
+	}
+
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/model/ExceptionTranslator.java b/vid-app-common/src/main/java/org/onap/vid/model/ExceptionTranslator.java
new file mode 100644
index 0000000..c600243
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/model/ExceptionTranslator.java
@@ -0,0 +1,39 @@
+package org.onap.vid.model;
+
+import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.exception.ExceptionUtils;
+import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
+import org.springframework.web.bind.annotation.ControllerAdvice;
+import org.springframework.web.bind.annotation.ExceptionHandler;
+import org.springframework.web.bind.annotation.ResponseBody;
+import org.springframework.web.method.annotation.MethodArgumentTypeMismatchException;
+
+import static org.onap.vid.utils.Logging.getMethodCallerName;
+
+@ControllerAdvice
+public class ExceptionTranslator {
+
+    /** The logger. */
+    EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(ExceptionTranslator.class);
+
+    @ExceptionHandler(MethodArgumentTypeMismatchException.class)
+    @ResponseBody
+    public ExceptionResponse handleMethodArgumentTypeMismatchException(MethodArgumentTypeMismatchException e) {
+        logger.error(EELFLoggerDelegate.errorLogger, "{}: {}", getMethodCallerName(), ExceptionUtils.getMessage(e), e);
+        Class<?> type = e.getRequiredType();
+        String message;
+        if (type.isEnum()) {
+            message = "The parameter " + e.getName() + " must have a value among : " + StringUtils.join(type.getEnumConstants(), ", ");
+        }
+        else {
+            message = "The parameter " + e.getName() + " must be of type " + type.getTypeName();
+        }
+        return new  ExceptionResponse(new ArgumentTypeMismatchException(message));
+    }
+
+    public static class ArgumentTypeMismatchException extends RuntimeException {
+        public ArgumentTypeMismatchException(String message) {
+            super(message);
+        }
+    }
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/model/ListOfErrorsResponse.java b/vid-app-common/src/main/java/org/onap/vid/model/ListOfErrorsResponse.java
new file mode 100644
index 0000000..9339d7c
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/model/ListOfErrorsResponse.java
@@ -0,0 +1,24 @@
+package org.onap.vid.model;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class ListOfErrorsResponse {
+    protected List<String> errors;
+
+    public ListOfErrorsResponse() {
+        this.errors = new ArrayList<>();
+    }
+
+    public ListOfErrorsResponse(List<String> errors) {
+        this.errors = errors;
+    }
+
+    public List<String> getErrors() {
+        return errors;
+    }
+
+    public void setErrors(List<String> errors) {
+        this.errors = errors;
+    }
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/model/ModelConstants.java b/vid-app-common/src/main/java/org/onap/vid/model/ModelConstants.java
new file mode 100644
index 0000000..cb1a5f9
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/model/ModelConstants.java
@@ -0,0 +1,44 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * VID
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.vid.model;
+/**
+ * The Class ModelConstants
+ */
+public class ModelConstants {
+	
+	/** The Constant GET_INPUT_TAG. */
+	public final static String GET_INPUT_TAG = "get_input";
+	
+	public static final String ASDC_MODEL_NAMESPACE = "asdc.model.namespace";
+	public static final String ASDC_SVC_API_PATH = "sdc.svc.api.path";
+	public static final String ASDC_RESOURCE_API_PATH = "sdc.resource.api.path";
+	
+	public static final String DEFAULT_ASDC_MODEL_NAMESPACE = "org.openecomp.";
+	public static final String DEFAULT_ASDC_SVC_API_PATH = "sdc/v1/catalog/services";
+	public static final String DEFAULT_ASDC_RESOURCE_API_PATH = "sdc/v1/catalog/resources";
+	
+	public final static String VF_MODULE = "groups.VfModule";
+	public final static String VNF = "resource.vf";
+	public final static String NETWORK = "resource.vl";
+
+	public final static String ROLE_DELIMITER = "___";
+	
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/model/ModelUtil.java b/vid-app-common/src/main/java/org/onap/vid/model/ModelUtil.java
new file mode 100644
index 0000000..897c6e7
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/model/ModelUtil.java
@@ -0,0 +1,45 @@
+/**
+ * 
+ */
+package org.onap.vid.model;
+
+/**
+ * The Class ModelUtil.
+ *
+ */
+public class ModelUtil {
+	/**
+	 * Gets the tags for the given element according to the configured namespace
+	 * @param namespaces the namespace list from the configuration
+	 * @param constantValue the constant portion of the tag name, i.e. resource.vf...
+	 * @return the tags
+	 */
+	public static String[] getTags ( String[] namespaces, String constantValue ) {
+		String[] tags;
+		if ( namespaces == null || namespaces.length == 0 ) {
+			return null;
+		}
+		int le = namespaces.length;
+		tags = new String[le];
+		for ( int i = 0; i < le; i++ ) {
+			tags[i] = namespaces[i] + constantValue;
+		}
+		return (tags);
+	}
+	/**
+	 * Determine if a note template type matches a set of configurable tags
+	 * @param type the node template type
+	 * @param tags the model configurable namespaces
+	 * @return true if type starts with a tag in the array, false otherwise
+	 */
+	public static boolean isType ( String type, String[] tags ) {
+		if ( (tags != null) && (tags.length > 0) ) {
+			for ( int i = 0; i < tags.length; i++ ) {
+				if ( type.startsWith (tags[i]) ) {
+					return (true);
+				}
+			}
+		}
+		return (false);
+	}
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/model/MsoExceptionResponse.java b/vid-app-common/src/main/java/org/onap/vid/model/MsoExceptionResponse.java
new file mode 100644
index 0000000..0fe49d6
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/model/MsoExceptionResponse.java
@@ -0,0 +1,32 @@
+package org.onap.vid.model;
+
+public class MsoExceptionResponse {
+
+    public static class ServiceException {
+
+        public ServiceException(String messageId, String text) {
+            this.messageId = messageId;
+            this.text = text;
+        }
+
+        public ServiceException() {
+        }
+
+        public String messageId;
+        public String text;
+    }
+
+    public ServiceException serviceException;
+
+    public MsoExceptionResponse() {
+    }
+
+    public MsoExceptionResponse(String messageId, String text) {
+        this.serviceException = new ServiceException(messageId, text);
+    }
+
+    public MsoExceptionResponse(Exception exception) {
+        ExceptionResponse exceptionResponse = new ExceptionResponse(exception);
+        this.serviceException = new ServiceException(exceptionResponse.getException(), exceptionResponse.getMessage());
+    }
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/model/Network.java b/vid-app-common/src/main/java/org/onap/vid/model/Network.java
new file mode 100644
index 0000000..ef342e4
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/model/Network.java
@@ -0,0 +1,62 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * VID
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.vid.model;
+
+import org.onap.vid.asdc.beans.tosca.NodeTemplate;
+
+/**
+ * The Class Network.
+ */
+public class Network extends Node {
+	
+	/** The model customization name. */
+	private String modelCustomizationName;
+	
+	/**
+	 * Instantiates a new network.
+	 */
+	public Network() {
+		super();
+	}
+	/**
+	 * Gets the model customization name.
+	 *
+	 * @return the model customization name
+	 */
+	public String getModelCustomizationName() {
+		return modelCustomizationName;
+	}
+	/**
+	 * Sets the model customization name.
+	 *
+	 * @param modelCustomizationName the new model customization name
+	 */
+	public void setModelCustomizationName(String modelCustomizationName) {
+		this.modelCustomizationName = modelCustomizationName;
+	}
+	
+	public void extractNetwork(String modelCustomizationName, NodeTemplate nodeTemplate) {
+		
+		super.extractNode(nodeTemplate);	
+		setModelCustomizationName(modelCustomizationName);
+		
+	}
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/model/NewNetwork.java b/vid-app-common/src/main/java/org/onap/vid/model/NewNetwork.java
new file mode 100644
index 0000000..9f1ffd3
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/model/NewNetwork.java
@@ -0,0 +1,56 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * VID
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.vid.model;
+
+import org.onap.vid.asdc.beans.tosca.NodeTemplate;
+
+/**
+ * The Class Network.
+ */
+public class NewNetwork extends NewNode {
+
+	/** The model customization name. */
+	private String modelCustomizationName;
+
+	/**
+	 * Instantiates a new network.
+	 */
+	public NewNetwork() {
+		super();
+	}
+	/**
+	 * Gets the model customization name.
+	 *
+	 * @return the model customization name
+	 */
+	public String getModelCustomizationName() {
+		return modelCustomizationName;
+	}
+	/**
+	 * Sets the model customization name.
+	 *
+	 * @param modelCustomizationName the new model customization name
+	 */
+	public void setModelCustomizationName(String modelCustomizationName) {
+		this.modelCustomizationName = modelCustomizationName;
+	}
+	
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/model/NewNode.java b/vid-app-common/src/main/java/org/onap/vid/model/NewNode.java
new file mode 100644
index 0000000..89a808b
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/model/NewNode.java
@@ -0,0 +1,209 @@
+package org.onap.vid.model;
+
+import java.text.DateFormat;
+import java.text.SimpleDateFormat;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
+import org.onap.vid.asdc.beans.tosca.Input;
+
+
+public class NewNode {
+	
+	/** The Constant LOG. */
+	private static final EELFLoggerDelegate LOG = EELFLoggerDelegate.getLogger(Node.class);
+	
+	/** The Constant dateFormat. */
+	final static DateFormat dateFormat = new SimpleDateFormat("HH:mm:ss:SSSS");
+
+	/** The uuid. */
+	private String uuid;
+	
+	/** The invariant uuid. */
+	private String invariantUuid;
+	
+	/** The description. */
+	private String description;
+	
+	/** The name. */
+	private String name;
+	
+	/** The version. */
+	private String version;
+	
+	/** The model customization uuid. */
+	private String customizationUuid;
+	
+	/** The inputs. */
+	private Map<String, Input> inputs;
+	
+	/** The get_input or other constructs from node template properties. */
+	private Map<String, CommandProperty> commands;
+	
+	/** The get_input or other constructs from node template properties. */
+	private Map<String, String> properties;
+	/**
+	 * Instantiates a new node.
+	 */
+	public NewNode() {
+		this.commands = new HashMap<String, CommandProperty>();
+		this.properties = new HashMap<String, String>();
+	}
+	
+	/**
+	 * Gets the uuid.
+	 *
+	 * @return the uuid
+	 */
+	public String getUuid() {
+		return uuid;
+	}
+
+	/**
+	 * Gets the invariant uuid.
+	 *
+	 * @return the invariant uuid
+	 */
+	public String getInvariantUuid() {
+		return invariantUuid;
+	}
+
+	/**
+	 * Gets the description.
+	 *
+	 * @return the description
+	 */
+	public String getDescription() {
+		return description;
+	}
+
+	/**
+	 * Gets the name.
+	 *
+	 * @return the name
+	 */
+	public String getName() {
+		return name;
+	}
+
+	/**
+	 * Gets the version.
+	 *
+	 * @return the version
+	 */
+	public String getVersion() {
+		return version;
+	}
+	
+	/**
+	 * Gets the customization uuid.
+	 *
+	 * @return the model customization uuid
+	 */
+	public String getCustomizationUuid() {
+		return customizationUuid;
+	}
+	/**
+	 * Gets the inputs.
+	 *
+	 * @return the inputs
+	 */
+	public Map<String, Input> getInputs() {
+		return inputs;
+	}
+	/**
+	 * Gets the commands.
+	 *
+	 * @return the commands
+	 */
+	public Map<String, CommandProperty> getCommands() {
+		return commands;
+	}
+	/**
+	 * Gets the properties.
+	 *
+	 * @return the properties
+	 */
+	public Map<String, String> getProperties() {
+		return properties;
+	}
+	/**
+	 * Sets the uuid.
+	 *
+	 * @param uuid the new uuid
+	 */
+	public void setUuid(String uuid) {
+		this.uuid = uuid;
+	}
+
+	/**
+	 * Sets the invariant uuid.
+	 *
+	 * @param invariantUuid the new invariant uuid
+	 */
+	public void setInvariantUuid(String invariantUuid) {
+		this.invariantUuid = invariantUuid;
+	}
+
+	/**
+	 * Sets the description.
+	 *
+	 * @param description the new description
+	 */
+	public void setDescription(String description) {
+		this.description = description;
+	}
+
+	/**
+	 * Sets the name.
+	 *
+	 * @param name the new name
+	 */
+	public void setName(String name) {
+		this.name = name;
+	}
+
+	/**
+	 * Sets the version.
+	 *
+	 * @param version the new version
+	 */
+	public void setVersion(String version) {
+		this.version = version;
+	}
+	/**
+	 * Sets the customization uuid.
+	 *
+	 * @param u the new customization uuid
+	 */
+	public void setCustomizationUuid(String u) {
+		this.customizationUuid = u;
+	}
+
+	/**
+	 * Sets the inputs.
+	 *
+	 * @param inputs the inputs
+	 */
+	public void setInputs(Map<String, Input> inputs) {
+		this.inputs = inputs;
+	}
+	/**
+	 * Sets the commands.
+	 *
+	 * @param m the commands
+	 */
+	public void setCommands( Map<String, CommandProperty>m ) {
+		commands = m;
+	}
+	/**
+	 * Sets the properties.
+	 *
+	 * @param p the properties
+	 */
+	public void setProperties( Map<String, String>p) {
+		properties = p;
+	}
+
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/model/NewService.java b/vid-app-common/src/main/java/org/onap/vid/model/NewService.java
new file mode 100644
index 0000000..1346c0d
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/model/NewService.java
@@ -0,0 +1,252 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * VID
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.vid.model;
+
+import java.util.Map;
+import java.util.UUID;
+
+import org.onap.vid.asdc.beans.tosca.Input;
+
+/**
+ * The Class Service.
+ */
+public class NewService {
+
+	/** The uuid. */
+	private String uuid;
+	
+	/** The invariant uuid. */
+	private String invariantUuid;
+	
+	/** The name. */
+	private String name;
+	
+	/** The version. */
+	private String version;
+	
+	/** The tosca model URL. */
+	private String toscaModelURL;
+	
+	/** The category. */
+	private String category;
+	
+	/** The description. */
+	private String description;
+	
+	/** The service ecomp naming flag */
+	private String serviceEcompNaming;
+	
+	/** The inputs. */
+	private Map<String, Input> inputs;
+	
+	/**
+	 * Gets the uuid.
+	 *
+	 * @return the uuid
+	 */
+	public String getUuid() {
+		return uuid;
+	}
+	
+	/**
+	 * Gets the invariant uuid.
+	 *
+	 * @return the invariant uuid
+	 */
+	public String getInvariantUuid() {
+		return invariantUuid;
+	}
+	
+	/**
+	 * Gets the name.
+	 *
+	 * @return the name
+	 */
+	public String getName() {
+		return name;
+	}
+	
+	/**
+	 * Gets the version.
+	 *
+	 * @return the version
+	 */
+	public String getVersion() {
+		return version;
+	}
+	
+	/**
+	 * Gets the tosca model URL.
+	 *
+	 * @return the tosca model URL
+	 */
+	public String getToscaModelURL() {
+		return toscaModelURL;
+	}
+	
+	/**
+	 * Gets the category.
+	 *
+	 * @return the category
+	 */
+	public String getCategory() {
+		return category;
+	}
+	
+	/**
+	 * Gets the description.
+	 *
+	 * @return the description
+	 */
+	public String getDescription() {
+		return description;
+	}
+	
+	/**
+	 * Gets the inputs.
+	 *
+	 * @return the inputs
+	 */
+	public Map<String, Input> getInputs() {
+		return inputs;
+	}
+	/**
+	 * Get the serviceEcompNaming value
+	 *
+	 * @return serviceEcompNaming
+	 */
+	public String getServiceEcompNaming() {
+		return serviceEcompNaming;
+	} 
+	/**
+	 * Sets the uuid.
+	 *
+	 * @param uuid the new uuid
+	 */
+	public void setUuid(String uuid) {
+		this.uuid = uuid;
+	}
+	
+	/**
+	 * Sets the invariant uuid.
+	 *
+	 * @param invariantUuid the new invariant uuid
+	 */
+	public void setInvariantUuid(String invariantUuid) {
+		this.invariantUuid = invariantUuid;
+	}
+	
+	/**
+	 * Sets the name.
+	 *
+	 * @param name the new name
+	 */
+	public void setName(String name) {
+		this.name = name;
+	}
+	
+	/**
+	 * Sets the version.
+	 *
+	 * @param version the new version
+	 */
+	public void setVersion(String version) {
+		this.version = version;
+	}
+	
+	/**
+	 * Sets the tosca model URL.
+	 *
+	 * @param toscaModelURL the new tosca model URL
+	 */
+	public void setToscaModelURL(String toscaModelURL) {
+		this.toscaModelURL = toscaModelURL;
+	}
+	
+	/**
+	 * Sets the category.
+	 *
+	 * @param category the new category
+	 */
+	public void setCategory(String category) {
+		this.category = category;
+	}
+	
+	/**
+	 * Sets the description.
+	 *
+	 * @param description the new description
+	 */
+	public void setDescription(String description) {
+		this.description = description;
+	}
+	
+	/**
+	 * Sets the inputs.
+	 *
+	 * @param inputs the inputs
+	 */
+	public void setInputs(Map<String, Input> inputs) {
+		this.inputs = inputs;
+	}
+	/**
+	 * Sets the service ecomp naming.
+	 *
+	 * @param serviceEcompNaming the new service ecomp naming
+	 */
+	public void setServiceEcompNaming(String serviceEcompNaming) {
+		this.serviceEcompNaming = serviceEcompNaming;
+	}
+	/* (non-Javadoc)
+	 * @see java.lang.Object#hashCode()
+	 */
+	@Override
+	public int hashCode() {
+		final UUID uuid = UUID.fromString(getUuid());
+		
+		return uuid.hashCode();
+	}
+	
+	/* (non-Javadoc)
+	 * @see java.lang.Object#equals(java.lang.Object)
+	 */
+	@Override
+	public boolean equals(Object o) {
+		if (o == this) return true;
+		if (!(o instanceof NewService)) return false;
+		
+		final NewService service = (NewService) o;
+		
+		return (service.getUuid().equals(getUuid()));
+	}
+	/*public static void extractVfModuleCustomizationUUID (Service s, String vnfCustomizationName, VfModule vfMod ) {
+		
+		//Look for vnfCustomizationName..vfModuleCustomizationName
+		String nameToFind = vnfCustomizationName + ".." + vfMod.getModelCustomizationName();
+		for (Entry<UUID, VfModule> vfModuleComponent : s.getVfModules().entrySet()) {
+			VfModule xMod = vfModuleComponent.getValue();
+			if ( (xMod.getModelCustomizationName() != null) && (xMod.getModelCustomizationName().equalsIgnoreCase(nameToFind)) ) {
+				vfMod.setCustomizationUuid( xMod.getCustomizationUuid());
+				return;
+			}
+		}
+	}*/
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/model/NewServiceModel.java b/vid-app-common/src/main/java/org/onap/vid/model/NewServiceModel.java
new file mode 100644
index 0000000..e343b6d
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/model/NewServiceModel.java
@@ -0,0 +1,288 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * VID
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.vid.model;
+
+import java.text.DateFormat;
+import java.text.SimpleDateFormat;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Map.Entry;
+
+import org.onap.vid.asdc.beans.tosca.Group;
+import org.onap.vid.asdc.beans.tosca.ToscaModel;
+import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
+import org.onap.vid.properties.VidProperties;
+/**
+ * The Class ServiceModel.
+ */
+
+public class NewServiceModel {
+
+	/** The Constant LOG. */
+	private static final EELFLoggerDelegate LOG = EELFLoggerDelegate.getLogger(NewServiceModel.class);
+	
+	/** The Constant dateFormat. */
+	final static DateFormat dateFormat = new SimpleDateFormat("HH:mm:ss:SSSS");
+	/** The service. */
+	private Service service;
+	
+	/** The vnfs. */
+	private Map<String, VNF> vnfs;
+	
+	/** The networks. */
+	private Map<String, Network> networks;
+
+	/** 
+	 * The vf modules. The VNF also has vfmodules but the vfmodules at the service level may have additional info
+	 * that is not present in the VNF, like the vf module customization String 
+	 */
+	private Map<String, VfModule> vfModules;
+	/**
+	 * The volume groups. The VNF also has volume groups but the volume groups will be populated at the service level
+	 * for newer models
+	 */
+	private Map<String, VolumeGroup> volumeGroups;
+
+	private Map<String, PortMirroringConfig> configurations;
+
+	private Map<String, ServiceProxy> serviceProxies;
+
+	private Map<String, Node> pnfs;
+
+	/**
+	 * Instantiates a new service model.
+	 */
+	public NewServiceModel() {}
+	
+	/**
+	 * Gets the service.
+	 *
+	 * @return the service
+	 */
+	public Service getService() {
+		return service;
+	}
+
+	/**
+	 * Gets the vnfs.
+	 *
+	 * @return the vnfs
+	 */
+	public Map<String, VNF> getVnfs() {
+		return vnfs;
+	}
+
+	/**
+	 * Gets the networks.
+	 *
+	 * @return the networks
+	 */
+	public Map<String, Network> getNetworks() {
+		return networks;
+	}
+
+	/**
+	 * Sets the service.
+	 *
+	 * @param service the new service
+	 */
+	public void setService(Service service) {
+		this.service = service;
+	}
+
+	/**
+	 * Sets the vnfs.
+	 *
+	 * @param vnfs the vnfs
+	 */
+	public void setVnfs(Map<String, VNF> vnfs) {
+		this.vnfs = vnfs;
+	}
+
+	/**
+	 * Sets the networks.
+	 *
+	 * @param networks the networks
+	 */
+	public void setNetworks(Map<String, Network> networks) {
+		this.networks = networks;
+	}
+	/**
+	 * Gets the vf modules.
+	 *
+	 * @return the vf modules
+	 */
+	public Map<String, VfModule> getVfModules() {
+		return vfModules;
+	}
+	/**
+	 * Gets the volume groups.
+	 *
+	 * @return the volume groups
+	 */
+	public Map<String, VolumeGroup> getVolumeGroups() {
+		return volumeGroups;
+	}
+
+	public Map<String, PortMirroringConfig> getConfigurations() {
+		return configurations;
+	}
+
+	public Map<String, ServiceProxy> getServiceProxies() {
+		return serviceProxies;
+	}
+
+	/**
+	 * Sets the vf modules.
+	 *
+	 * @param vfModules the vf modules
+	 */
+
+
+	public void setVfModules(Map<String, VfModule> vfModules) {
+		this.vfModules = vfModules;
+	}
+	/**
+	 * Sets the volume groups.
+	 *
+	 * @param volumeGroups the volume groups
+	 */
+	public void setVolumeGroups(Map<String, VolumeGroup> volumeGroups) {
+		this.volumeGroups = volumeGroups;
+	}
+
+
+	public Map<String, Node> getPnfs() {
+		return pnfs;
+	}
+
+	public void setPnfs(Map<String, Node> pnfs) {
+		this.pnfs = pnfs;
+	}
+
+	/**
+	 * Extract service.
+	 *
+	 * @param serviceToscaModel the service tosca model
+	 * @param asdcServiceMetadata the asdc service metadata
+	 * @return the service
+	 */
+	public static Service extractService(ToscaModel serviceToscaModel, org.onap.vid.asdc.beans.Service asdcServiceMetadata) {
+		
+		final Service service = new Service();
+		
+		service.setCategory(serviceToscaModel.getMetadata().getCategory());
+		service.setInvariantUuid(serviceToscaModel.getMetadata().getInvariantUUID());
+		service.setName(serviceToscaModel.getMetadata().getName());
+		service.setUuid(serviceToscaModel.getMetadata().getUUID());
+		service.setDescription(serviceToscaModel.getMetadata().getDescription());
+		service.setServiceEcompNaming(serviceToscaModel.getMetadata().getServiceEcompNaming());
+		service.setInputs(serviceToscaModel.gettopology_template().getInputs());
+		//FIXME: SDC is not sending the Version with the Tosca Model for 1610 - they should send it in 1702
+		//THIS IS A TEMPORARY FIX, AT SOME POINT UNCOMMENT ME
+		//service.setVersion(serviceToscaModel.getMetadata().getVersion());
+		service.setVersion(asdcServiceMetadata.getVersion());
+
+		return service;
+	}
+	public static void extractGroups (ToscaModel serviceToscaModel,NewServiceModel serviceModel) {
+		// Get the groups. The groups may duplicate the groups that are in the VNF model and have
+		// additional data like the VF module customization String>
+		
+		final Map<String, VfModule> vfModules = new HashMap<String, VfModule> ();
+		final Map<String, VolumeGroup> volumeGroups = new HashMap<String, VolumeGroup> ();
+		
+		String asdcModelNamespace = VidProperties.getAsdcModelNamespace();
+    	String vfModuleTag = asdcModelNamespace + ModelConstants.VF_MODULE;
+    	
+		for (Entry<String, Group> component : serviceToscaModel.gettopology_template().getGroups().entrySet()) {
+			final Group group = component.getValue();
+			final String type = group.getType();
+			final String customizationName = component.getKey();
+			
+			if (type.startsWith(vfModuleTag)) {
+				VfModule vfMod = VfModule.extractVfModule(customizationName, group);
+				vfModules.put(customizationName, vfMod);
+				if ( vfMod.isVolumeGroupAllowed() ) {
+					//volume groups have the same customization name as the vf module
+					volumeGroups.put(customizationName, VolumeGroup.extractVolumeGroup(customizationName,group));
+				}
+			}
+		}
+		// add this point vfModules and volume groups are disconnected from VNF
+		serviceModel.setVfModules (vfModules);
+		serviceModel.setVolumeGroups (volumeGroups);
+		
+	}
+	/**
+	 * Populate the vf modules and volume groups that we may have under the service level under each VNF.
+	 */
+//	public void associateGroups() {
+//		String methodName = "associateGroups()";
+//        LOG.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + methodName + " start");
+//		// go through the vnfs, get the vnf normalized name and look for a vf module with a customization name that starts
+//		// with vnf + ".."
+//		String vnfCustomizationName = null;
+//		String normalizedVnfCustomizationName = null;
+//		String vfModuleCustomizationName = null;
+//		NewVNF tmpVnf = null;
+//
+//		if ( ( getVnfs() != null ) && (!(getVnfs().isEmpty())) ) {
+//			for (Entry<String, NewVNF> vnfComponent : getVnfs().entrySet()) {
+//				vnfCustomizationName = vnfComponent.getValue().getModelCustomizationName();
+//				normalizedVnfCustomizationName = VNF.normalizeName(vnfCustomizationName);
+//
+//				LOG.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + methodName +
+//						" VNF customizationName=" + vnfCustomizationName + "normalized customization name=" + normalizedVnfCustomizationName);
+//
+//				// now check to see if there is a vf module with customization name that starts with normalizedVnfCustomizationName
+//
+//				if (( getVfModules() != null ) && (!(getVfModules().isEmpty()))) {
+//					for (Entry<String, VfModule> vfModuleComponent : getVfModules().entrySet()) {
+//						vfModuleCustomizationName = vfModuleComponent.getValue().getModelCustomizationName();
+//
+//						LOG.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + methodName +
+//								" VF Module customizationName=" + vfModuleCustomizationName );
+//						if ( vfModuleCustomizationName.startsWith(normalizedVnfCustomizationName + ".." )) {
+//
+//							// this vf module belongs to the VNF
+//							tmpVnf = vnfComponent.getValue();
+//							(tmpVnf.getVfModules()).put(vfModuleComponent.getKey(), vfModuleComponent.getValue());
+//
+//							LOG.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + methodName +
+//									" Associated VF Module customizationName=" + vfModuleComponent.getKey() + " with VNF customization name=" + vnfCustomizationName);
+//
+//							// now find if this vf module has volume groups, if so, find the volume group with the same customization name and put it under the VNF
+//							if ( vfModuleComponent.getValue().isVolumeGroupAllowed() ) {
+//								if (( getVolumeGroups() != null ) && (!(getVolumeGroups().isEmpty()))) {
+//									if (getVolumeGroups().containsKey((vfModuleCustomizationName))) {
+//										(vnfComponent.getValue().getVolumeGroups()).put(vfModuleCustomizationName, (getVolumeGroups()).get(vfModuleCustomizationName));
+//									}
+//								}
+//							}
+//						}
+//					}
+//				}
+//			}
+//		}
+		
+//	}
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/model/NewVNF.java b/vid-app-common/src/main/java/org/onap/vid/model/NewVNF.java
new file mode 100644
index 0000000..8e8c89f
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/model/NewVNF.java
@@ -0,0 +1,123 @@
+package org.onap.vid.model;
+
+import java.text.DateFormat;
+import java.text.SimpleDateFormat;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.regex.Pattern;
+
+import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
+import org.onap.vid.asdc.beans.tosca.NodeTemplate;
+
+public class NewVNF extends NewNode {
+	
+	/** The Constant LOG. */
+	private static final EELFLoggerDelegate LOG = EELFLoggerDelegate.getLogger(VNF.class);
+	
+	/** The Constant dateFormat. */
+	final static DateFormat dateFormat = new SimpleDateFormat("HH:mm:ss:SSSS");
+
+	/** The pattern used to normalize VNF names */
+	final static Pattern COMPONENT_INSTANCE_NAME_DELIMETER_PATTERN = Pattern.compile("[\\.\\-]+");
+	
+	/** The model customization name. */
+	private String modelCustomizationName;
+	
+	/** The vf modules. */
+	private Map<String, VfModule> vfModules = new HashMap<String, VfModule>();
+	
+	/** The volume groups. */
+	private Map<String, VolumeGroup> volumeGroups = new HashMap<String, VolumeGroup>();
+	
+	/**
+	 * Instantiates a newvnf.
+	 */
+	public NewVNF() {
+		super();
+	}
+
+	/**
+	 * Gets the model customization name.
+	 *
+	 * @return the model customization name
+	 */
+	public String getModelCustomizationName() {
+		return modelCustomizationName;
+	}
+
+	/**
+	 * Gets the vf modules.
+	 *
+	 * @return the vf modules
+	 */
+	public Map<String, VfModule> getVfModules() {
+		return vfModules;
+	}
+
+	/**
+	 * Sets the vf modules.
+	 *
+	 * @param vfModules the vf modules
+	 */
+	public void setVfModules(Map<String, VfModule> vfModules) {
+		this.vfModules = vfModules;
+	}
+
+	/**
+	 * Gets the volume groups.
+	 *
+	 * @return the volume groups
+	 */
+	public Map<String, VolumeGroup> getVolumeGroups() {
+		return volumeGroups;
+	}
+
+	/**
+	 * Sets the volume groups.
+	 *
+	 * @param volumeGroups the volume groups
+	 */
+	public void setVolumeGroups(Map<String, VolumeGroup> volumeGroups) {
+		this.volumeGroups = volumeGroups;
+	}
+
+
+	/**
+	 * Sets the model customization name.
+	 *
+	 * @param modelCustomizationName the new model customization name
+	 */
+	public void setModelCustomizationName(String modelCustomizationName) {
+		this.modelCustomizationName = modelCustomizationName;
+	}
+	/**
+	 * Normalize the VNF name
+	 * @param originalName
+	 * @return the normalized name
+	 */
+	public static String normalizeName (String originalName) {
+
+		String normalizedName = originalName.toLowerCase();
+		normalizedName = COMPONENT_INSTANCE_NAME_DELIMETER_PATTERN.matcher(normalizedName).replaceAll(" ");
+		String[] splitArr = null;
+		
+		try {
+			splitArr = normalizedName.split(" ");
+		}
+		catch (Exception ex ) {
+			return (normalizedName);
+		}
+		StringBuffer sb = new StringBuffer();
+		if ( splitArr != null ) {
+			for (String splitElement : splitArr) {
+				sb.append(splitElement);
+			}
+			return (sb.toString());
+		}
+		else {
+			return (normalizedName);
+		}
+		
+	}
+
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/model/Node.java b/vid-app-common/src/main/java/org/onap/vid/model/Node.java
new file mode 100644
index 0000000..7623a38
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/model/Node.java
@@ -0,0 +1,322 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * VID
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.vid.model;
+
+import java.text.DateFormat;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Map.Entry;
+
+import org.onap.vid.asdc.beans.tosca.Input;
+import org.onap.vid.asdc.beans.tosca.NodeTemplate;
+
+import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
+/**
+ * The Class Node.
+ */
+public class Node {
+	/** The Constant LOG. */
+	private static final EELFLoggerDelegate LOG = EELFLoggerDelegate.getLogger(Node.class);
+	
+	/** The Constant dateFormat. */
+	final static DateFormat dateFormat = new SimpleDateFormat("HH:mm:ss:SSSS");
+
+	/** The uuid. */
+	private String uuid;
+	
+	/** The invariant uuid. */
+	private String invariantUuid;
+	
+	/** The description. */
+	private String description;
+	
+	/** The name. */
+	private String name;
+	
+	/** The version. */
+	private String version;
+	
+	/** The model customization uuid. */
+	private String customizationUuid;
+	
+	/** The inputs. */
+	private Map<String, Input> inputs;
+	
+	/** The get_input or other constructs from node template properties. */
+	private Map<String, CommandProperty> commands;
+	
+	/** The get_input or other constructs from node template properties. */
+	private Map<String, String> properties;
+
+	/** Type from Metadata */
+	private String type;
+	/**
+	 * Instantiates a new node.
+	 */
+	public Node() {
+		this.commands = new HashMap<String, CommandProperty>();
+		this.properties = new HashMap<String, String>();
+	}
+	
+	/**
+	 * Gets the uuid.
+	 *
+	 * @return the uuid
+	 */
+	public String getUuid() {
+		return uuid;
+	}
+
+	/**
+	 * Gets the invariant uuid.
+	 *
+	 * @return the invariant uuid
+	 */
+	public String getInvariantUuid() {
+		return invariantUuid;
+	}
+
+	/**
+	 * Gets the description.
+	 *
+	 * @return the description
+	 */
+	public String getDescription() {
+		return description;
+	}
+
+	/**
+	 * Gets the name.
+	 *
+	 * @return the name
+	 */
+	public String getName() {
+		return name;
+	}
+
+	/**
+	 * Gets the version.
+	 *
+	 * @return the version
+	 */
+	public String getVersion() {
+		return version;
+	}
+	
+	/**
+	 * Gets the customization uuid.
+	 *
+	 * @return the model customization uuid
+	 */
+	public String getCustomizationUuid() {
+		return customizationUuid;
+	}
+	/**
+	 * Gets the inputs.
+	 *
+	 * @return the inputs
+	 */
+	public Map<String, Input> getInputs() {
+		return inputs;
+	}
+	/**
+	 * Gets the commands.
+	 *
+	 * @return the commands
+	 */
+	public Map<String, CommandProperty> getCommands() {
+		return commands;
+	}
+	/**
+	 * Gets the properties.
+	 *
+	 * @return the properties
+	 */
+	public Map<String, String> getProperties() {
+		return properties;
+	}
+	/**
+	 * Sets the uuid.
+	 *
+	 * @param uuid the new uuid
+	 */
+	public void setUuid(String uuid) {
+		this.uuid = uuid;
+	}
+
+	/**
+	 * Sets the invariant uuid.
+	 *
+	 * @param invariantUuid the new invariant uuid
+	 */
+	public void setInvariantUuid(String invariantUuid) {
+		this.invariantUuid = invariantUuid;
+	}
+
+	/**
+	 * Sets the description.
+	 *
+	 * @param description the new description
+	 */
+	public void setDescription(String description) {
+		this.description = description;
+	}
+
+	/**
+	 * Sets the name.
+	 *
+	 * @param name the new name
+	 */
+	public void setName(String name) {
+		this.name = name;
+	}
+
+	/**
+	 * Sets the version.
+	 *
+	 * @param version the new version
+	 */
+	public void setVersion(String version) {
+		this.version = version;
+	}
+	/**
+	 * Sets the customization uuid.
+	 *
+	 * @param u the new customization uuid
+	 */
+	public void setCustomizationUuid(String u) {
+		this.customizationUuid = u;
+	}
+
+	/**
+	 * Sets the inputs.
+	 *
+	 * @param inputs the inputs
+	 */
+	public void setInputs(Map<String, Input> inputs) {
+		this.inputs = inputs;
+	}
+	/**
+	 * Sets the commands.
+	 *
+	 * @param m the commands
+	 */
+	public void setCommands( Map<String, CommandProperty>m ) {
+		commands = m;
+	}
+	/**
+	 * Sets the properties.
+	 *
+	 * @param p the properties
+	 */
+	public void setProperties( Map<String, String>p) {
+		properties = p;
+	}
+
+
+	/**
+	 * @return metadata type
+	 */
+	public String getType() {
+		return type;
+	}
+
+	/**
+	 * Set metadata type
+	 *
+	 * @param type e.g. VF/CP/SERVICE_PROXY
+	 */
+	public void setType(String type) {
+		this.type = type;
+	}
+
+	/**
+	 * Extract node.
+	 *
+	 * @param modelCustomizationName the model customization name
+	 * @param nodeTemplate the node template
+	 * @return the node
+	 */
+	public void extractNode (NodeTemplate nodeTemplate) {
+		
+		String methodName = "extractNode";
+		
+		setUuid(nodeTemplate.getMetadata().getUUID());
+		setInvariantUuid(nodeTemplate.getMetadata().getInvariantUUID());
+		setDescription(nodeTemplate.getMetadata().getDescription());
+		setName(nodeTemplate.getMetadata().getName());
+		setVersion(nodeTemplate.getMetadata().getVersion());
+		// add customizationUUID
+		setCustomizationUuid(nodeTemplate.getMetadata().getCustomizationUUID());
+
+		try {
+			// nodeTemplate.getProperties() map of String->Object
+			for (Entry<String, Object> e : nodeTemplate.getProperties().entrySet()) {
+				
+				String k = e.getKey();
+				
+				LOG.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + methodName + " node template property: " + k );
+				
+				if ( e.getValue() != null ) {
+					LOG.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + methodName + "  property: " + 
+							k + "=" + e.getValue());
+					//LOG.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + methodName + " V class name: " +
+					//	 e.getValue().getClass().getName());
+					Class<?> c = e.getValue().getClass();
+					if ( c.getName().equalsIgnoreCase(java.lang.String.class.getName())) {
+						getProperties().put (k, (String)e.getValue());
+					}
+					else {
+						Class<?>[] interfaces = e.getValue().getClass().getInterfaces();
+
+						for(Class<?> ifc: interfaces ) {
+							//LOG.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + methodName + " ifc name: " +
+							//	 ifc.getName());
+							if ( ifc.getName().equalsIgnoreCase(java.util.Map.class.getName()) ) {
+								// only extract get_input for now
+								@SuppressWarnings("unchecked")
+								HashMap<String,String> v = (HashMap<String,String>)e.getValue();
+								for (Entry<String, String> entry : v.entrySet()) {
+									// only include get_input for now
+									if ( ModelConstants.GET_INPUT_TAG.equalsIgnoreCase ( entry.getKey() ) ) {
+										CommandProperty cp = new CommandProperty();
+										cp.setCommand(entry.getKey());
+										cp.setInputName(entry.getValue());
+										cp.setDisplayName(k);
+										getCommands().put(k,cp);
+									}
+								}
+							}
+						}
+
+					}
+				}
+			}
+		}
+		catch ( Exception e ) {
+			LOG.error(EELFLoggerDelegate.errorLogger, dateFormat.format(new Date()) + methodName + " Unable to parse node properties: e=" + 
+					e.toString());
+		}
+	}
+
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/model/PortMirroringConfig.java b/vid-app-common/src/main/java/org/onap/vid/model/PortMirroringConfig.java
new file mode 100644
index 0000000..dd3d5db
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/model/PortMirroringConfig.java
@@ -0,0 +1,77 @@
+package org.onap.vid.model;
+
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
+import org.openecomp.sdc.toscaparser.api.NodeTemplate;
+import org.openecomp.sdc.toscaparser.api.RequirementAssignments;
+
+import java.text.DateFormat;
+import java.text.SimpleDateFormat;
+import java.util.List;
+
+public class PortMirroringConfig extends Node {
+
+    /** The Constant LOG. */
+    private static final EELFLoggerDelegate LOG = EELFLoggerDelegate.getLogger(PortMirroringConfig.class);
+
+    /** The Constant dateFormat. */
+    final static DateFormat dateFormat = new SimpleDateFormat("HH:mm:ss:SSSS");
+
+    /** The model customization name. */
+    private String modelCustomizationName;
+
+    /** The port miroring requirements for source/collector */
+    @JsonIgnore
+    private RequirementAssignments requirementAssignments;
+
+    private List<String> sourceNodes;
+
+    private List<String> collectorNodes;
+
+    private boolean configurationByPolicy;
+
+    public PortMirroringConfig() {
+        super();
+        this.configurationByPolicy = false;
+    }
+
+    public String getModelCustomizationName() {
+        return modelCustomizationName;
+    }
+
+    public void setModelCustomizationName(String modelCustomizationName) {
+        this.modelCustomizationName = modelCustomizationName;
+    }
+
+    public RequirementAssignments getRequirementAssignments() {
+        return requirementAssignments;
+    }
+
+    public void setRequirementAssignments(RequirementAssignments requirementAssignments) {
+        this.requirementAssignments = requirementAssignments;
+    }
+
+    public List<String> getSourceNodes() {
+        return sourceNodes;
+    }
+
+    public void setSourceNodes(List<String> sourceNodes) {
+        this.sourceNodes = sourceNodes;
+    }
+
+    public List<String> getCollectorNodes() {
+        return collectorNodes;
+    }
+
+    public void setCollectorNodes(List<String> collectorNodes) {
+        this.collectorNodes = collectorNodes;
+    }
+
+    public void setConfigurationByPolicy(boolean configurationByPolicy) {
+        this.configurationByPolicy = configurationByPolicy;
+    }
+
+    public boolean isConfigurationByPolicy() {
+        return configurationByPolicy;
+    }
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/model/ProxyResponse.java b/vid-app-common/src/main/java/org/onap/vid/model/ProxyResponse.java
new file mode 100644
index 0000000..1931fa3
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/model/ProxyResponse.java
@@ -0,0 +1,30 @@
+package org.onap.vid.model;
+
+import com.google.common.base.MoreObjects;
+
+/**
+ * Created by Oren on 7/10/17.
+ */
+public class ProxyResponse {
+
+    protected String errorMessage;
+
+    protected int httpCode;
+
+    public String getErrorMessage() {
+        return errorMessage;
+    }
+
+
+    public int getHttpCode() {
+        return httpCode;
+    }
+
+    @Override
+    public String toString() {
+        return MoreObjects.toStringHelper(this)
+                .add("httpCode", httpCode)
+                .add("errorMessage", errorMessage)
+                .toString();
+    }
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/model/RequestReferencesContainer.java b/vid-app-common/src/main/java/org/onap/vid/model/RequestReferencesContainer.java
new file mode 100644
index 0000000..9c12a52
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/model/RequestReferencesContainer.java
@@ -0,0 +1,42 @@
+package org.onap.vid.model;
+
+import com.fasterxml.jackson.annotation.*;
+import com.google.common.base.MoreObjects;
+import org.onap.vid.domain.mso.RequestReferences;
+
+import java.util.HashMap;
+import java.util.Map;
+
+@JsonInclude(JsonInclude.Include.NON_NULL)
+public class RequestReferencesContainer {
+    private final RequestReferences requestReferences;
+
+    @JsonIgnore
+    private Map<String, Object> additionalProperties = new HashMap<String, Object>();
+
+    @JsonAnyGetter
+    public Map<String, Object> getAdditionalProperties() {
+        return this.additionalProperties;
+    }
+
+    @JsonAnySetter
+    public void setAdditionalProperty(String name, Object value) {
+        this.additionalProperties.put(name, value);
+    }
+
+    public RequestReferencesContainer(@JsonProperty("requestReferences") RequestReferences requestReferences) {
+        this.requestReferences = requestReferences;
+    }
+
+    public RequestReferences getRequestReferences() {
+        return requestReferences;
+    }
+
+    @Override
+    public String toString() {
+        return MoreObjects.toStringHelper(this)
+                .add("requestReferences", requestReferences)
+                .add("additionalProperties", additionalProperties)
+                .toString();
+    }
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/model/Resource.java b/vid-app-common/src/main/java/org/onap/vid/model/Resource.java
new file mode 100644
index 0000000..184f9ee
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/model/Resource.java
@@ -0,0 +1,28 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * VID
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.vid.model;
+
+/**
+ * The Class Resource.
+ */
+public class Resource {
+
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/model/Result.java b/vid-app-common/src/main/java/org/onap/vid/model/Result.java
new file mode 100644
index 0000000..c972bcc
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/model/Result.java
@@ -0,0 +1,58 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * VID
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.vid.model;
+
+/**
+ * The Class Result.
+ */
+public class Result {
+	
+	/** The result. */
+	private String result;
+	
+	/**
+	 * Instantiates a new result.
+	 *
+	 * @param result the result
+	 */
+	public Result(String result) {
+		this.result = result;
+	}
+
+	/**
+	 * Gets the result.
+	 *
+	 * @return the result
+	 */
+	public String getResult() {
+		return result;
+	}
+
+	/**
+	 * Sets the result.
+	 *
+	 * @param result the new result
+	 */
+	public void setResult(String result) {
+		this.result = result;
+	}
+	
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/model/Service.java b/vid-app-common/src/main/java/org/onap/vid/model/Service.java
new file mode 100644
index 0000000..b0597c6
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/model/Service.java
@@ -0,0 +1,283 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * VID
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.vid.model;
+
+import org.onap.vid.asdc.beans.tosca.Input;
+
+import java.util.Map;
+import java.util.UUID;
+
+/**
+ * The Class Service.
+ */
+public class Service {
+
+	/** The uuid. */
+	private String uuid;
+	
+	/** The invariant uuid. */
+	private String invariantUuid;
+	
+	/** The name. */
+	private String name;
+	
+	/** The version. */
+	private String version;
+	
+	/** The tosca model URL. */
+	private String toscaModelURL;
+	
+	/** The category. */
+	private String category;
+
+	/** The Service Type. */
+	private String serviceType;
+
+	/** The Service Role */
+	private String serviceRole;
+	
+	/** The description. */
+	private String description;
+	
+	/** The service ecomp naming flag */
+	private String serviceEcompNaming;
+
+	private String instantiationType;
+
+
+	/** The inputs. */
+	private Map<String, Input> inputs;
+	
+	/**
+	 * Gets the uuid.
+	 *
+	 * @return the uuid
+	 */
+	public String getUuid() {
+		return uuid;
+	}
+	
+	/**
+	 * Gets the invariant uuid.
+	 *
+	 * @return the invariant uuid
+	 */
+	public String getInvariantUuid() {
+		return invariantUuid;
+	}
+	
+	/**
+	 * Gets the name.
+	 *
+	 * @return the name
+	 */
+	public String getName() {
+		return name;
+	}
+	
+	/**
+	 * Gets the version.
+	 *
+	 * @return the version
+	 */
+	public String getVersion() {
+		return version;
+	}
+	
+	/**
+	 * Gets the tosca model URL.
+	 *
+	 * @return the tosca model URL
+	 */
+	public String getToscaModelURL() {
+		return toscaModelURL;
+	}
+	
+	/**
+	 * Gets the category.
+	 *
+	 * @return the category
+	 */
+	public String getCategory() {
+		return category;
+	}
+	
+	/**
+	 * Gets the description.
+	 *
+	 * @return the description
+	 */
+	public String getDescription() {
+		return description;
+	}
+	
+	/**
+	 * Gets the inputs.
+	 *
+	 * @return the inputs
+	 */
+	public Map<String, Input> getInputs() {
+		return inputs;
+	}
+	/**
+	 * Get the serviceEcompNaming value
+	 *
+	 * @return serviceEcompNaming
+	 */
+	public String getServiceEcompNaming() {
+		return serviceEcompNaming;
+	}
+
+
+	public String getInstantiationType() { return instantiationType; }
+
+	public void setInstantiationType(String instantiationType) { this.instantiationType = instantiationType; }
+	/**
+	 * Sets the uuid.
+	 *
+	 * @param uuid the new uuid
+	 */
+	public void setUuid(String uuid) {
+		this.uuid = uuid;
+	}
+	
+	/**
+	 * Sets the invariant uuid.
+	 *
+	 * @param invariantUuid the new invariant uuid
+	 */
+	public void setInvariantUuid(String invariantUuid) {
+		this.invariantUuid = invariantUuid;
+	}
+	
+	/**
+	 * Sets the name.
+	 *
+	 * @param name the new name
+	 */
+	public void setName(String name) {
+		this.name = name;
+	}
+	
+	/**
+	 * Sets the version.
+	 *
+	 * @param version the new version
+	 */
+	public void setVersion(String version) {
+		this.version = version;
+	}
+	
+	/**
+	 * Sets the tosca model URL.
+	 *
+	 * @param toscaModelURL the new tosca model URL
+	 */
+	public void setToscaModelURL(String toscaModelURL) {
+		this.toscaModelURL = toscaModelURL;
+	}
+	
+	/**
+	 * Sets the category.
+	 *
+	 * @param category the new category
+	 */
+	public void setCategory(String category) {
+		this.category = category;
+	}
+	
+	/**
+	 * Sets the description.
+	 *
+	 * @param description the new description
+	 */
+	public void setDescription(String description) {
+		this.description = description;
+	}
+	
+	/**
+	 * Sets the inputs.
+	 *
+	 * @param inputs the inputs
+	 */
+	public void setInputs(Map<String, Input> inputs) {
+		this.inputs = inputs;
+	}
+	/**
+	 * Sets the service ecomp naming.
+	 *
+	 * @param serviceEcompNaming the new service ecomp naming
+	 */
+	public void setServiceEcompNaming(String serviceEcompNaming) {
+		this.serviceEcompNaming = serviceEcompNaming;
+	}
+	/* (non-Javadoc)
+	 * @see java.lang.Object#hashCode()
+	 */
+	@Override
+	public int hashCode() {
+		final UUID uuid = UUID.fromString(getUuid());
+		
+		return uuid.hashCode();
+	}
+	
+	/* (non-Javadoc)
+	 * @see java.lang.Object#equals(java.lang.Object)
+	 */
+	@Override
+	public boolean equals(Object o) {
+		if (o == this) return true;
+		if (!(o instanceof Service)) return false;
+		
+		final Service service = (Service) o;
+		
+		return (service.getUuid().equals(getUuid()));
+	}
+
+	public String getServiceType() {
+		return serviceType;
+	}
+
+	public void setServiceType(String serviceType) {
+		this.serviceType = serviceType;
+	}
+
+	public String getServiceRole() {
+		return serviceRole;
+	}
+
+	public void setServiceRole(String serviceRole) {
+		this.serviceRole = serviceRole;
+	}
+
+	/*public static void extractVfModuleCustomizationUUID (Service s, String vnfCustomizationName, VfModule vfMod ) {
+		
+		//Look for vnfCustomizationName..vfModuleCustomizationName
+		String nameToFind = vnfCustomizationName + ".." + vfMod.getModelCustomizationName();
+		for (Entry<UUID, VfModule> vfModuleComponent : s.getVfModules().entrySet()) {
+			VfModule xMod = vfModuleComponent.getValue();
+			if ( (xMod.getModelCustomizationName() != null) && (xMod.getModelCustomizationName().equalsIgnoreCase(nameToFind)) ) {
+				vfMod.setCustomizationUuid( xMod.getCustomizationUuid());
+				return;
+			}
+		}
+	}*/
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/model/ServiceInstanceSearchResult.java b/vid-app-common/src/main/java/org/onap/vid/model/ServiceInstanceSearchResult.java
new file mode 100644
index 0000000..abf60d6
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/model/ServiceInstanceSearchResult.java
@@ -0,0 +1,139 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * VID
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.vid.model;
+
+public class ServiceInstanceSearchResult {
+
+	private String serviceInstanceId;
+
+	private String globalCustomerId;
+
+	private String serviceType;
+
+	private String serviceInstanceName;
+
+	private String subscriberName;
+
+	private String aaiModelInvariantId;
+
+	private String aaiModelVersionId;
+
+	private boolean isPermitted;
+
+	public ServiceInstanceSearchResult(){
+
+	}
+	public ServiceInstanceSearchResult(String serviceInstanceId, String globalCustomerId, String serviceType,
+									   String serviceInstanceName, String subscriberName, String aaiModelInvariantId,
+									   String aaiModelVersionId, boolean isPermitted) {
+		this.serviceInstanceId = serviceInstanceId;
+		this.globalCustomerId = globalCustomerId;
+		this.serviceType = serviceType;
+		this.serviceInstanceName = serviceInstanceName;
+		this.subscriberName = subscriberName;
+		this.aaiModelInvariantId = aaiModelInvariantId;
+		this.aaiModelVersionId = aaiModelVersionId;
+		this.isPermitted = isPermitted;
+	}
+
+	public String getServiceInstanceId() {
+		return serviceInstanceId;
+	}
+
+	public void setServiceInstanceId(String serviceInstanceId) {
+		this.serviceInstanceId = serviceInstanceId;
+	}
+
+	public String getGlobalCustomerId() {
+		return globalCustomerId;
+	}
+
+	public void setGlobalCustomerId(String globalCustomerId) {
+		this.globalCustomerId = globalCustomerId;
+	}
+
+	public String getServiceType() {
+		return serviceType;
+	}
+
+	public void setServiceType(String serviceType) {
+		this.serviceType = serviceType;
+	}
+
+	public String getServiceInstanceName() {
+		return serviceInstanceName;
+	}
+
+	public void setServiceInstanceName(String serviceInstanceName) {
+		this.serviceInstanceName = serviceInstanceName;
+	}
+
+	public String getSubscriberName() {
+		return subscriberName;
+	}
+
+	public void setSubscriberName(String subscriberName) {
+		this.subscriberName = subscriberName;
+	}
+
+	public String getAaiModelInvariantId() {
+		return aaiModelInvariantId;
+	}
+
+	public void setAaiModelInvariantId(String aaiModelInvariantId) {
+		this.aaiModelInvariantId = aaiModelInvariantId;
+	}
+
+	public String getAaiModelVersionId() {
+		return aaiModelVersionId;
+	}
+
+	public void setAaiModelVersionId(String aaiModelVersionId) {
+		this.aaiModelVersionId = aaiModelVersionId;
+	}
+
+	public boolean getIsPermitted() {
+		return isPermitted;
+	}
+
+	public void setIsPermitted(boolean isPermitted) {
+		this.isPermitted = isPermitted;
+	}
+
+	@Override
+	public boolean equals(Object other){
+		if (other instanceof ServiceInstanceSearchResult) {
+			ServiceInstanceSearchResult serviceInstanceSearchResultOther = (ServiceInstanceSearchResult) other;
+			if (this.getServiceInstanceId().equals(serviceInstanceSearchResultOther.getServiceInstanceId())) {
+				return true;
+			}
+		}
+		return false;
+
+	}
+
+	@Override
+	public int hashCode() {
+		int result = 17;
+		result = 31 * result + serviceInstanceId.hashCode();
+		return result;
+	}
+}
\ No newline at end of file
diff --git a/vid-app-common/src/main/java/org/onap/vid/model/ServiceModel.java b/vid-app-common/src/main/java/org/onap/vid/model/ServiceModel.java
new file mode 100644
index 0000000..dab18d5
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/model/ServiceModel.java
@@ -0,0 +1,330 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * VID
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.vid.model;
+
+import java.text.DateFormat;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Map.Entry;
+
+import org.onap.vid.asdc.beans.tosca.Group;
+import org.onap.vid.asdc.beans.tosca.NodeTemplate;
+import org.onap.vid.asdc.beans.tosca.ToscaModel;
+import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
+import org.onap.vid.properties.VidProperties;
+/**
+ * The Class ServiceModel.
+ */
+@SuppressWarnings("ALL")
+public class ServiceModel {
+
+	/** The Constant LOG. */
+	private static final EELFLoggerDelegate LOG = EELFLoggerDelegate.getLogger(ServiceModel.class);
+	
+	/** The Constant dateFormat. */
+	final static DateFormat dateFormat = new SimpleDateFormat("HH:mm:ss:SSSS");
+	/** The service. */
+	private Service service;
+	
+	/** The vnfs. */
+	private Map<String, VNF> vnfs;
+	
+	/** The networks. */
+	private Map<String, Network> networks;
+
+	/** Port Mirroring Configuration node templates */
+	private Map<String, PortMirroringConfig> configurations;
+
+	/** Service Proxy Nodes */
+	private Map<String, ServiceProxy> serviceProxies;
+
+	/**
+	 * The vf modules. The VNF also has vfmodules but the vfmodules at the service level may have additional info
+	 * that is not present in the VNF, like the vf module customization String 
+	 */
+	private Map<String, VfModule> vfModules;
+	/** 
+	 * The volume groups. The VNF also has volume groups but the volume groups will be populated at the service level 
+	 * for newer models 
+	 */
+	private Map<String, VolumeGroup> volumeGroups;
+
+	/** The pnfs. */
+	private Map<String, Node> pnfs;
+	/**
+	 * Instantiates a new service model.
+	 */
+	public ServiceModel() {}
+	
+	/**
+	 * Gets the service.
+	 *
+	 * @return the service
+	 */
+	public Service getService() {
+		return service;
+	}
+
+	/**
+	 * Gets the vnfs.
+	 *
+	 * @return the vnfs
+	 */
+	public Map<String, VNF> getVnfs() {
+		return vnfs;
+	}
+
+	/**
+	 * Gets the networks.
+	 *
+	 * @return the networks
+	 */
+	public Map<String, Network> getNetworks() {
+		return networks;
+	}
+
+
+	/**
+	 * Gets the pnfs.
+	 *
+	 * @return the pnfs
+	 */
+	public Map<String, Node> getPnfs() {
+		return pnfs;
+	}
+
+
+	/**
+	 * Gets the Configuration Node Templates
+	 *
+	 * @return the configuration type node templates
+	 */
+	public Map<String, PortMirroringConfig> getConfigurations() {
+		return configurations;
+	}
+
+	/**
+	 * Gets the Service Proxy Node Templates
+	 *
+	 * @return the Service Proxy type node templates
+	 */
+	public Map<String, ServiceProxy> getServiceProxies() {
+		return serviceProxies;
+	}
+
+	/**
+	 * Sets the service.
+	 *
+	 * @param service the new service
+	 */
+	public void setService(Service service) {
+		this.service = service;
+	}
+
+	/**
+	 * Sets the vnfs.
+	 *
+	 * @param vnfs the vnfs
+	 */
+	public void setVnfs(Map<String, VNF> vnfs) {
+		this.vnfs = vnfs;
+	}
+
+	/**
+	 * Sets the networks.
+	 *
+	 * @param networks the networks
+	 */
+	public void setNetworks(Map<String, Network> networks) {
+		this.networks = networks;
+	}
+
+	/**
+	 * Sets the configuraion node templates.
+	 *
+	 * @param configurations
+	 */
+	public void setConfigurations(Map<String, PortMirroringConfig> configurations) {
+		this.configurations = configurations;
+	}
+
+	/**
+	 * Sets the service proxy node templates.
+	 *
+	 * @param serviceProxies
+	 */
+	public void setServiceProxies(Map<String, ServiceProxy> serviceProxies) {
+		this.serviceProxies = serviceProxies;
+	}
+
+	/**
+	 * Gets the vf modules.
+	 *
+	 * @return the vf modules
+	 */
+	public Map<String, VfModule> getVfModules() {
+		return vfModules;
+	}
+
+
+	/**
+	 * Gets the volume groups.
+	 *
+	 * @return the volume groups
+	 */
+	public Map<String, VolumeGroup> getVolumeGroups() {
+		return volumeGroups;
+	}
+	/**
+	 * Sets the vf modules.
+	 *
+	 * @param vfModules the vf modules
+	 */
+	public void setVfModules(Map<String, VfModule> vfModules) {
+		this.vfModules = vfModules;
+	}
+	/**
+	 * Sets the volume groups.
+	 *
+	 * @param volumeGroups the volume groups
+	 */
+	public void setVolumeGroups(Map<String, VolumeGroup> volumeGroups) {
+		this.volumeGroups = volumeGroups;
+	}
+	/**
+	 * Sets the pnfs.
+	 *
+	 * @param pnfs the pnfs
+	 */
+	public void setPnfs(Map<String,Node> pnfs) {this.pnfs = pnfs;}
+
+	/**
+	 * Extract service.
+	 *
+	 * @param serviceToscaModel the service tosca model
+	 * @param asdcServiceMetadata the asdc service metadata
+	 * @return the service
+	 */
+	public static Service extractService(ToscaModel serviceToscaModel, org.onap.vid.asdc.beans.Service asdcServiceMetadata) {
+		
+		final Service service = new Service();
+		
+		service.setCategory(serviceToscaModel.getMetadata().getCategory());
+		service.setInvariantUuid(serviceToscaModel.getMetadata().getInvariantUUID());
+		service.setName(serviceToscaModel.getMetadata().getName());
+		service.setUuid(serviceToscaModel.getMetadata().getUUID());
+		service.setDescription(serviceToscaModel.getMetadata().getDescription());
+		service.setServiceEcompNaming(serviceToscaModel.getMetadata().getServiceEcompNaming());
+		service.setInputs(serviceToscaModel.gettopology_template().getInputs());
+		//FIXME: SDC is not sending the Version with the Tosca Model for 1610 - they should send it in 1702
+		//THIS IS A TEMPORARY FIX, AT SOME POINT UNCOMMENT ME
+		//service.setVersion(serviceToscaModel.getMetadata().getVersion());
+		service.setVersion(asdcServiceMetadata.getVersion());
+
+		return service;
+	}
+	public static void extractGroups (ToscaModel serviceToscaModel,ServiceModel serviceModel) {
+		// Get the groups. The groups may duplicate the groups that are in the VNF model and have
+		// additional data like the VF module customization String>
+		
+		final Map<String, VfModule> vfModules = new HashMap<String, VfModule> ();
+		final Map<String, VolumeGroup> volumeGroups = new HashMap<String, VolumeGroup> ();
+		
+		String asdcModelNamespace = VidProperties.getAsdcModelNamespace();
+    	String vfModuleTag = asdcModelNamespace + ModelConstants.VF_MODULE;
+    	
+		for (Entry<String, Group> component : serviceToscaModel.gettopology_template().getGroups().entrySet()) {
+			final Group group = component.getValue();
+			final String type = group.getType();
+			final String customizationName = component.getKey();
+			
+			if (type.startsWith(vfModuleTag)) {
+				VfModule vfMod = VfModule.extractVfModule(customizationName, group);
+				vfModules.put(customizationName, vfMod);
+				if ( vfMod.isVolumeGroupAllowed() ) {
+					//volume groups have the same customization name as the vf module
+					volumeGroups.put(customizationName, VolumeGroup.extractVolumeGroup(customizationName,group));
+				}
+			}
+		}
+		// add this point vfModules and volume groups are disconnected from VNF
+		serviceModel.setVfModules (vfModules);
+		serviceModel.setVolumeGroups (volumeGroups);
+		
+	}
+	/**
+	 * Populate the vf modules and volume groups that we may have under the service level under each VNF.
+	 */
+	public void associateGroups() {
+		String methodName = "associateGroups()";
+        LOG.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + methodName + " start");
+		// go through the vnfs, get the vnf normalized name and look for a vf module with a customization name that starts
+		// with vnf + ".."
+		String vnfCustomizationName = null;
+		String normalizedVnfCustomizationName = null;
+		String vfModuleCustomizationName = null;
+		VNF tmpVnf = null;
+		
+		if ( ( getVnfs() != null ) && (!(getVnfs().isEmpty())) ) {
+			for (Entry<String, VNF> vnfComponent : getVnfs().entrySet()) {
+				vnfCustomizationName = vnfComponent.getValue().getModelCustomizationName();
+				normalizedVnfCustomizationName = VNF.normalizeName(vnfCustomizationName);
+				
+				LOG.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + methodName + 
+						" VNF customizationName=" + vnfCustomizationName + "normalized customization name=" + normalizedVnfCustomizationName);
+				
+				// now check to see if there is a vf module with customization name that starts with normalizedVnfCustomizationName
+				
+				if (( getVfModules() != null ) && (!(getVfModules().isEmpty()))) {
+					for (Entry<String, VfModule> vfModuleComponent : getVfModules().entrySet()) {
+						vfModuleCustomizationName = vfModuleComponent.getValue().getModelCustomizationName();
+						
+						LOG.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + methodName + 
+								" VF Module customizationName=" + vfModuleCustomizationName );
+						if ( vfModuleCustomizationName.startsWith(normalizedVnfCustomizationName + ".." )) {
+							
+							// this vf module belongs to the VNF
+							tmpVnf = vnfComponent.getValue();
+							(tmpVnf.getVfModules()).put(vfModuleComponent.getKey(), vfModuleComponent.getValue());
+							
+							LOG.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + methodName + 
+									" Associated VF Module customizationName=" + vfModuleComponent.getKey() + " with VNF customization name=" + vnfCustomizationName);
+							
+							// now find if this vf module has volume groups, if so, find the volume group with the same customization name and put it under the VNF
+							if ( vfModuleComponent.getValue().isVolumeGroupAllowed() ) {
+								if (( getVolumeGroups() != null ) && (!(getVolumeGroups().isEmpty()))) {
+									if (getVolumeGroups().containsKey((vfModuleCustomizationName))) {
+										(vnfComponent.getValue().getVolumeGroups()).put(vfModuleCustomizationName, (getVolumeGroups()).get(vfModuleCustomizationName));
+									}
+								}	
+							}
+						}
+					}
+				}
+			}
+		}
+		
+	}
+
+
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/model/ServiceProxy.java b/vid-app-common/src/main/java/org/onap/vid/model/ServiceProxy.java
new file mode 100644
index 0000000..f412a1e
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/model/ServiceProxy.java
@@ -0,0 +1,46 @@
+package org.onap.vid.model;
+
+import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
+
+import java.text.DateFormat;
+import java.text.SimpleDateFormat;
+
+public class ServiceProxy extends Node {
+
+    /** The Constant LOG. */
+    private static final EELFLoggerDelegate LOG = EELFLoggerDelegate.getLogger(ServiceProxy.class);
+
+    /** The Constant dateFormat. */
+    final static DateFormat dateFormat = new SimpleDateFormat("HH:mm:ss:SSSS");
+
+    private String sourceModelUuid;
+
+    private String sourceModelInvariant;
+
+    private String sourceModelName;
+
+    public String getSourceModelUuid() {
+        return sourceModelUuid;
+    }
+
+    public void setSourceModelUuid(String sourceModelUuid) {
+        this.sourceModelUuid = sourceModelUuid;
+    }
+
+    public String getSourceModelInvariant() {
+        return sourceModelInvariant;
+    }
+
+    public void setSourceModelInvariant(String sourceModelInvariant) {
+        this.sourceModelInvariant = sourceModelInvariant;
+    }
+
+    public String getSourceModelName() {
+        return sourceModelName;
+    }
+
+    public void setSourceModelName(String sourceModelName) {
+        this.sourceModelName = sourceModelName;
+    }
+
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/model/Subscriber.java b/vid-app-common/src/main/java/org/onap/vid/model/Subscriber.java
new file mode 100644
index 0000000..70711b8
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/model/Subscriber.java
@@ -0,0 +1,26 @@
+package org.onap.vid.model;
+
+
+import org.codehaus.jackson.annotate.JsonProperty;
+
+/**
+ * Created by Oren on 7/4/17.
+ */
+public class Subscriber {
+
+    @JsonProperty("global-customer-id")
+    public String globalCustomerId;
+
+    @JsonProperty("subscriber-name")
+    public String subscriberName;
+
+    @JsonProperty("subscriber-type")
+    public String subscriberType;
+
+    @JsonProperty("resource-version")
+    public String resourceVersion;
+
+
+
+
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/model/SubscriberList.java b/vid-app-common/src/main/java/org/onap/vid/model/SubscriberList.java
new file mode 100644
index 0000000..5f93597
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/model/SubscriberList.java
@@ -0,0 +1,15 @@
+package org.onap.vid.model;
+
+import org.openecomp.portalsdk.core.web.support.UserUtils;
+
+import java.util.List;
+
+/**
+ * Created by Oren on 7/4/17.
+ */
+public class SubscriberList {
+
+    public List<Subscriber> customer;
+
+
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/model/VNF.java b/vid-app-common/src/main/java/org/onap/vid/model/VNF.java
new file mode 100644
index 0000000..e558e95
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/model/VNF.java
@@ -0,0 +1,165 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * VID
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.vid.model;
+
+import java.util.Map;
+import java.text.DateFormat;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.Map.Entry;
+import java.util.regex.Pattern;
+
+import org.onap.vid.asdc.beans.tosca.NodeTemplate;
+
+import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
+import org.onap.vid.controller.VidController;
+
+import org.onap.vid.asdc.beans.tosca.Group;
+import org.onap.vid.asdc.beans.tosca.Input;
+
+/**
+ * The Class VNF.
+ */
+public class VNF extends Node {
+	
+	/** The Constant LOG. */
+	private static final EELFLoggerDelegate LOG = EELFLoggerDelegate.getLogger(VNF.class);
+	
+	/** The Constant dateFormat. */
+	final static DateFormat dateFormat = new SimpleDateFormat("HH:mm:ss:SSSS");
+
+	/** The pattern used to normalize VNF names */
+	final static Pattern COMPONENT_INSTANCE_NAME_DELIMETER_PATTERN = Pattern.compile("[\\.\\-]+");
+	
+	/** The model customization name. */
+	private String modelCustomizationName;
+	
+	/** The vf modules. */
+	private Map<String, VfModule> vfModules = new HashMap<String, VfModule>();
+	
+	/** The volume groups. */
+	private Map<String, VolumeGroup> volumeGroups = new HashMap<String, VolumeGroup>();
+	
+	/**
+	 * Instantiates a new vnf.
+	 */
+	public VNF() {
+		super();
+	}
+
+	/**
+	 * Gets the model customization name.
+	 *
+	 * @return the model customization name
+	 */
+	public String getModelCustomizationName() {
+		return modelCustomizationName;
+	}
+	
+	/**
+	 * Gets the vf modules.
+	 *
+	 * @return the vf modules
+	 */
+	public Map<String, VfModule> getVfModules() {
+		return vfModules;
+	}
+
+	/**
+	 * Sets the vf modules.
+	 *
+	 * @param vfModules the vf modules
+	 */
+	public void setVfModules(Map<String, VfModule> vfModules) {
+		this.vfModules = vfModules;
+	}
+
+	/**
+	 * Gets the volume groups.
+	 *
+	 * @return the volume groups
+	 */
+	public Map<String, VolumeGroup> getVolumeGroups() {
+		return volumeGroups;
+	}
+
+	/**
+	 * Sets the volume groups.
+	 *
+	 * @param volumeGroups the volume groups
+	 */
+	public void setVolumeGroups(Map<String, VolumeGroup> volumeGroups) {
+		this.volumeGroups = volumeGroups;
+	}
+
+	/**
+	 * Extract vnf.
+	 *
+	 * @param modelCustomizationName the model customization name
+	 * @param nodeTemplate the node template
+	 * @return the vnf
+	 */
+	public void extractVnf(String modelCustomizationName, NodeTemplate nodeTemplate) {
+		
+		super.extractNode(nodeTemplate);	
+		setModelCustomizationName(modelCustomizationName);
+		
+	}
+
+	/**
+	 * Sets the model customization name.
+	 *
+	 * @param modelCustomizationName the new model customization name
+	 */
+	public void setModelCustomizationName(String modelCustomizationName) {
+		this.modelCustomizationName = modelCustomizationName;
+	}
+	/**
+	 * Normalize the VNF name
+	 * @param originalName
+	 * @return the normalized name
+	 */
+	public static String normalizeName (String originalName) {
+
+		String normalizedName = originalName.toLowerCase();
+		normalizedName = COMPONENT_INSTANCE_NAME_DELIMETER_PATTERN.matcher(normalizedName).replaceAll(" ");
+		String[] splitArr = null;
+		
+		try {
+			splitArr = normalizedName.split(" ");
+		}
+		catch (Exception ex ) {
+			return (normalizedName);
+		}
+		StringBuffer sb = new StringBuffer();
+		if ( splitArr != null ) {
+			for (String splitElement : splitArr) {
+				sb.append(splitElement);
+			}
+			return (sb.toString());
+		}
+		else {
+			return (normalizedName);
+		}
+		
+	}
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/model/VNFDao.java b/vid-app-common/src/main/java/org/onap/vid/model/VNFDao.java
new file mode 100644
index 0000000..13e2ebb
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/model/VNFDao.java
@@ -0,0 +1,105 @@
+package org.onap.vid.model;
+
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import org.openecomp.portalsdk.core.domain.support.DomainVo;
+
+import javax.persistence.*;
+import java.io.Serializable;
+import java.util.Date;
+import java.util.HashSet;
+import java.util.Set;
+
+@Entity
+@Table(name = "vid_vnf")
+public class VNFDao extends DomainVo {
+
+    private String vnfUUID;
+    private String vnfInvariantUUID;
+    private Set<VidWorkflow> workflows = new HashSet<>(0);
+
+    @Id
+    @GeneratedValue(strategy = GenerationType.IDENTITY)
+    @Column(name = "VNF_DB_ID")
+    @JsonIgnore
+    public Long getId() {
+        return id;
+    }
+
+    @Override
+    @Column(name = "CREATED_DATE")
+    @JsonIgnore
+    public Date getCreated() {
+        return super.getCreated();
+    }
+
+    @Override
+    @Column(name = "MODIFIED_DATE")
+    @JsonIgnore
+    public Date getModified() {
+        return super.getModified();
+    }
+
+    @Override
+    @Transient
+    @JsonIgnore
+    public Long getCreatedId() {
+        return super.getCreatedId();
+    }
+
+    @Override
+    @Transient
+    @JsonIgnore
+    public Long getModifiedId() {
+        return super.getModifiedId();
+    }
+
+    @Override
+    @Transient
+    @JsonIgnore
+    public Serializable getAuditUserId() {
+        return super.getAuditUserId();
+    }
+
+    @Override
+    @Transient
+    @JsonIgnore
+    public Long getRowNum() {
+        return super.getRowNum();
+    }
+
+    @Override
+    @Transient
+    @JsonIgnore
+    public Set getAuditTrail() {
+        return super.getAuditTrail();
+    }
+
+    @Column(name = "VNF_APP_UUID")
+    public String getVnfUUID() {
+        return vnfUUID;
+    }
+    
+    @Column(name = "VNF_APP_INVARIANT_UUID")
+    public String getVnfInvariantUUID() {
+        return vnfInvariantUUID;
+    }
+    
+
+    public void setVnfUUID(String vnfUUID) {
+        this.vnfUUID = vnfUUID;
+    }
+    
+    public void setVnfInvariantUUID(String vnfInvariantUUID) {
+		this.vnfInvariantUUID = vnfInvariantUUID;
+	}
+
+    @ManyToMany(cascade = CascadeType.ALL, fetch =FetchType.EAGER )
+    @JoinTable(name = "vid_vnf_workflow", joinColumns = { @JoinColumn(name = "VNF_DB_ID") }, inverseJoinColumns = { @JoinColumn(name = "WORKFLOW_DB_ID") })
+    public Set<VidWorkflow> getWorkflows() {
+        return workflows;
+    }
+
+    public void setWorkflows(Set<VidWorkflow> workflows) {
+        this.workflows = workflows;
+    }
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/model/VersionByInvariantIdsRequest.java b/vid-app-common/src/main/java/org/onap/vid/model/VersionByInvariantIdsRequest.java
new file mode 100644
index 0000000..907f493
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/model/VersionByInvariantIdsRequest.java
@@ -0,0 +1,11 @@
+package org.onap.vid.model;
+
+import java.util.List;
+
+/**
+ * Created by Oren on 9/5/17.
+ */
+public class VersionByInvariantIdsRequest {
+
+    public List<String> versions;
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/model/VfModule.java b/vid-app-common/src/main/java/org/onap/vid/model/VfModule.java
new file mode 100644
index 0000000..ac19587
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/model/VfModule.java
@@ -0,0 +1,308 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * VID
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.vid.model;
+
+import java.text.DateFormat;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Map.Entry;
+import org.onap.vid.asdc.beans.tosca.Group;
+
+import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
+
+/**
+ * The Class VfModule.
+ */
+public class VfModule {
+
+	/** The Constant LOG. */
+	private static final EELFLoggerDelegate LOG = EELFLoggerDelegate.getLogger(VfModule.class);
+	
+	/** The Constant dateFormat. */
+	final static DateFormat dateFormat = new SimpleDateFormat("HH:mm:ss:SSSS");
+	
+	/** The uuid. */
+	private String uuid;
+	
+	/** The invariant uuid. */
+	private String invariantUuid;
+	
+	/** The customization uuid. */
+	private String customizationUuid;
+	
+	/** The description. */
+	private String description;
+	
+	/** The name. */
+	private String name;
+	
+	/** The version. */
+	private String version;
+	
+	/** The volume group allowed. */
+	private boolean volumeGroupAllowed;
+	
+	/** The get_input or other constructs for VF Module. */
+	private Map<String, CommandProperty> commands;
+	
+	/** The model customization name. */
+	private String modelCustomizationName;
+	
+	/**
+	 * Instantiates a new vf module.
+	 */
+	public VfModule() {
+		commands = new HashMap<String, CommandProperty>();
+	}
+	/**
+	 * Gets the model customization name.
+	 *
+	 * @return the model customization name
+	 */
+	public String getModelCustomizationName() {
+		return modelCustomizationName;
+	}
+	/**
+	 * Gets the uuid.
+	 *
+	 * @return the uuid
+	 */
+	public String getUuid() {
+		return uuid;
+	}
+
+	/**
+	 * Gets the invariant uuid.
+	 *
+	 * @return the invariant uuid
+	 */
+	public String getInvariantUuid() {
+		return invariantUuid;
+	}
+	/**
+	 * Gets the customization uuid.
+	 *
+	 * @return the invariant uuid
+	 */
+	public String getCustomizationUuid() {
+		return customizationUuid;
+	}
+	/**
+	 * Gets the description.
+	 *
+	 * @return the description
+	 */
+	public String getDescription() {
+		return description;
+	}
+	/**
+	 * Gets the commands.
+	 *
+	 * @return the commands
+	 */
+	public Map<String, CommandProperty> getCommands() {
+		return commands;
+	}
+	/**
+	 * Gets the name.
+	 *
+	 * @return the name
+	 */
+	public String getName() {
+		return name;
+	}
+
+	/**
+	 * Gets the version.
+	 *
+	 * @return the version
+	 */
+	public String getVersion() {
+		return version;
+	}
+
+	/**
+	 * Checks if is volume group allowed.
+	 *
+	 * @return true, if is volume group allowed
+	 */
+	public boolean isVolumeGroupAllowed() {
+		return volumeGroupAllowed;
+	}
+	
+	/**
+	 * Sets the uuid.
+	 *
+	 * @param uuid the new uuid
+	 */
+	public void setUuid(String uuid) {
+		this.uuid = uuid;
+	}
+
+	/**
+	 * Sets the invariant uuid.
+	 *
+	 * @param invariantUuid the new invariant uuid
+	 */
+	public void setInvariantUuid(String invariantUuid) {
+		this.invariantUuid = invariantUuid;
+	}
+	/**
+	 * Sets the customization uuid.
+	 *
+	 * @param customizationUuid the new customization uuid
+	 */
+	public void setCustomizationUuid(String customizationUuid) {
+		this.customizationUuid = customizationUuid;
+	}
+	/**
+	 * Sets the description.
+	 *
+	 * @param description the new description
+	 */
+	public void setDescription(String description) {
+		this.description = description;
+	}
+
+	/**
+	 * Sets the name.
+	 *
+	 * @param name the new name
+	 */
+	public void setName(String name) {
+		this.name = name;
+	}
+
+	/**
+	 * Sets the version.
+	 *
+	 * @param version the new version
+	 */
+	public void setVersion(String version) {
+		this.version = version;
+	}
+
+	/**
+	 * Sets the volume group allowed.
+	 *
+	 * @param volumeGroupAllowed the new volume group allowed
+	 */
+	public void setVolumeGroupAllowed(boolean volumeGroupAllowed) {
+		this.volumeGroupAllowed = volumeGroupAllowed;
+	}
+	/**
+	 * Sets the commands.
+	 *
+	 * @param m the commands
+	 */
+	public void setCommands( Map<String, CommandProperty>m ) {
+		commands = m;
+	}
+	/**
+	 * Sets the model customization name.
+	 *
+	 * @param modelCustomizationName the new model customization name
+	 */
+	public void setModelCustomizationName(String modelCustomizationName) {
+		this.modelCustomizationName = modelCustomizationName;
+	}
+	/**
+	 * Extract vf module.
+	 *
+	 * @param group the group
+	 * @return the vf module
+	 */
+	public static  VfModule extractVfModule(String modelCustomizationName, Group group) {
+		
+		String methodName = "extractVfModule";
+
+		final VfModule vfModule = new VfModule();
+		
+		try {
+			vfModule.setUuid(group.getMetadata().getVfModuleModelUUID());
+			vfModule.setInvariantUuid(group.getMetadata().getVfModuleModelInvariantUUID());
+			vfModule.setDescription(group.getMetadata().getDescription());
+			vfModule.setName(group.getMetadata().getVfModuleModelName());
+			vfModule.setVersion(group.getMetadata().getVfModuleModelVersion());
+			vfModule.setCustomizationUuid(group.getMetadata().getVfModuleModelCustomizationUUID());
+			vfModule.setModelCustomizationName (modelCustomizationName);
+			
+			if (group.getProperties().containsKey("volume_group")) {
+				if (group.getProperties().get("volume_group") != null) {
+				
+					Class<?> c = group.getProperties().get("volume_group").getClass();
+					LOG.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + methodName + " class name=" + 
+							c.getName());
+					
+					if ( c.getName().equalsIgnoreCase(Boolean.class.getName()) ) {
+						Boolean b = (Boolean)group.getProperties().get("volume_group");
+						vfModule.setVolumeGroupAllowed( b.booleanValue() );
+					}
+				}
+			} else {
+				vfModule.setVolumeGroupAllowed(false);
+			}
+		}
+		catch ( Exception e ) {
+			LOG.error(EELFLoggerDelegate.errorLogger, dateFormat.format(new Date()) + methodName + " Unable to parse VF Module from group: e=" + 
+					e.toString());
+		}
+		/* Not extracting other types of properties for 1702
+		 try {
+			
+			for (Entry<String, Object> e : group.getProperties().entrySet()) {
+				
+				String k = e.getKey();
+				if ( e.getValue() != null ) {
+					LOG.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + methodName + " property: " + 
+							k + "=" + e.getValue());
+					LOG.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + methodName + " V class name: " +
+							 e.getValue().getClass().getName());
+					 Class<?>[] interfaces = e.getValue().getClass().getInterfaces();
+					 
+					 for(Class<?> ifc: interfaces ){
+						 LOG.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + methodName + " ifc name: " +
+								 ifc.getName());
+				     }
+					 
+					// only extract get_input for now
+					for (Entry<String, String> entry : v.entrySet()) {
+						// only include get_input for now
+						if ( ModelConstants.GET_INPUT_TAG.equalsIgnoreCase ( entry.getKey() ) ) {
+							CommandProperty cp = new CommandProperty();
+							cp.setDisplayName(entry.getValue());
+							cp.setCommand(entry.getKey());
+							cp.setInputName(k);
+							(vfModule.getCommands()).put(k,cp);
+						}
+					} 
+				}
+			}
+		}
+		catch ( Exception e ) {
+			LOG.error(EELFLoggerDelegate.errorLogger, dateFormat.format(new Date()) + methodName + " Unable to parse VF Module properties: e=" + 
+					e.toString());
+		}*/
+		return vfModule;
+	}
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/model/VidWorkflow.java b/vid-app-common/src/main/java/org/onap/vid/model/VidWorkflow.java
new file mode 100644
index 0000000..985289b
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/model/VidWorkflow.java
@@ -0,0 +1,83 @@
+package org.onap.vid.model;
+
+
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import org.openecomp.portalsdk.core.domain.support.DomainVo;
+
+import javax.persistence.*;
+import java.io.Serializable;
+import java.util.Date;
+import java.util.Set;
+
+@Entity
+@Table(name = "vid_workflow")
+public class VidWorkflow extends DomainVo {
+
+    private String wokflowName;
+
+    @Id
+    @GeneratedValue(strategy = GenerationType.IDENTITY)
+    @Column(name = "WORKFLOW_DB_ID")
+    @JsonIgnore
+    public Long getId() {
+        return id;
+    }
+
+    @Override
+    @Column(name = "CREATED_DATE")
+    @JsonIgnore
+    public Date getCreated() {
+        return super.getCreated();
+    }
+
+    @Override
+    @Column(name = "MODIFIED_DATE")
+    @JsonIgnore
+    public Date getModified() {
+        return super.getModified();
+    }
+
+    @Override
+    @Transient
+    @JsonIgnore
+    public Long getCreatedId() {
+        return super.getCreatedId();
+    }
+
+    @Override
+    @Transient
+    @JsonIgnore
+    public Long getModifiedId() {
+        return super.getModifiedId();
+    }
+
+    @Override
+    @Transient
+    @JsonIgnore
+    public Serializable getAuditUserId() {
+        return super.getAuditUserId();
+    }
+
+    @Override
+    @Transient
+    @JsonIgnore
+    public Long getRowNum() {
+        return super.getRowNum();
+    }
+
+    @Override
+    @Transient
+    @JsonIgnore
+    public Set getAuditTrail() {
+        return super.getAuditTrail();
+    }
+
+    @Column(name = "WORKFLOW_APP_NAME")
+    public String getWokflowName() {
+        return wokflowName;
+    }
+
+    public void setWokflowName(String wokflowName) {
+        this.wokflowName = wokflowName;
+    }
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/model/VolumeGroup.java b/vid-app-common/src/main/java/org/onap/vid/model/VolumeGroup.java
new file mode 100644
index 0000000..969c287
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/model/VolumeGroup.java
@@ -0,0 +1,196 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * VID
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.vid.model;
+
+import org.onap.vid.asdc.beans.tosca.Group;
+
+/**
+ * The Class VolumeGroup.
+ */
+public class VolumeGroup {
+
+	/** The uuid. */
+	private String uuid;
+	
+	/** The invariant uuid. */
+	private String invariantUuid;
+	
+	/** The description. */
+	private String description;
+	
+	/** The name. */
+	private String name;
+	
+	/** The version. */
+	private String version;
+	
+	/** The customization uuid. */
+	private String customizationUuid;
+	
+	/** The customization uuid. */
+	private String modelCustomizationName;
+	/**
+	 * Instantiates a new volume group.
+	 */
+	public VolumeGroup() {}
+
+	/**
+	 * Gets the uuid.
+	 *
+	 * @return the uuid
+	 */
+	public String getUuid() {
+		return uuid;
+	}
+	/**
+	 * Gets the customization uuid.
+	 *
+	 * @return the customization uuid
+	 */
+	public String getCustomizationUuid() {
+		return customizationUuid;
+	}
+	/**
+	 * Gets the customization name.
+	 *
+	 * @return the customization name
+	 */
+	public String getModelCustomizationName() {
+		return modelCustomizationName;
+	}
+	/**
+	 * Gets the invariant uuid.
+	 *
+	 * @return the invariant uuid
+	 */
+	public String getInvariantUuid() {
+		return invariantUuid;
+	}
+
+	/**
+	 * Gets the description.
+	 *
+	 * @return the description
+	 */
+	public String getDescription() {
+		return description;
+	}
+
+	/**
+	 * Gets the name.
+	 *
+	 * @return the name
+	 */
+	public String getName() {
+		return name;
+	}
+
+	/**
+	 * Gets the version.
+	 *
+	 * @return the version
+	 */
+	public String getVersion() {
+		return version;
+	}
+
+	/**
+	 * Sets the uuid.
+	 *
+	 * @param uuid the new uuid
+	 */
+	public void setUuid(String uuid) {
+		this.uuid = uuid;
+	}
+
+	/**
+	 * Sets the invariant uuid.
+	 *
+	 * @param invariantUuid the new invariant uuid
+	 */
+	public void setInvariantUuid(String invariantUuid) {
+		this.invariantUuid = invariantUuid;
+	}
+
+	/**
+	 * Sets the description.
+	 *
+	 * @param description the new description
+	 */
+	public void setDescription(String description) {
+		this.description = description;
+	}
+
+	/**
+	 * Sets the name.
+	 *
+	 * @param name the new name
+	 */
+	public void setName(String name) {
+		this.name = name;
+	}
+
+	/**
+	 * Sets the version.
+	 *
+	 * @param version the new version
+	 */
+	public void setVersion(String version) {
+		this.version = version;
+	}
+	/**
+	 * Sets the customization uuid.
+	 *
+	 * @param u the new customization uuid
+	 */
+	public void setCustomizationUuid(String u) {
+		this.customizationUuid = u;
+		
+	}
+	/**
+	 * Sets the customization name.
+	 *
+	 * @param u the new customization name
+	 */
+	public void setModelCustomizationName(String u) {
+		this.modelCustomizationName = u;
+		
+	}
+	/**
+	 * Extract volume group.
+	 *
+	 * @param group the group
+	 * @return the volume group
+	 */
+	public static VolumeGroup extractVolumeGroup(String modelCustomizationName, Group group) {
+		final VolumeGroup volumeGroup = new VolumeGroup();
+		
+		volumeGroup.setUuid(group.getMetadata().getVfModuleModelUUID());
+		volumeGroup.setInvariantUuid(group.getMetadata().getVfModuleModelInvariantUUID());
+		volumeGroup.setDescription(group.getMetadata().getDescription());
+		volumeGroup.setName(group.getMetadata().getVfModuleModelName());
+		volumeGroup.setVersion(group.getMetadata().getVfModuleModelVersion());
+		volumeGroup.setCustomizationUuid(group.getMetadata().getVfModuleModelCustomizationUUID());
+		volumeGroup.setModelCustomizationName(modelCustomizationName);
+		return volumeGroup;
+	}
+
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/model/Workflow.java b/vid-app-common/src/main/java/org/onap/vid/model/Workflow.java
new file mode 100644
index 0000000..346138d
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/model/Workflow.java
@@ -0,0 +1,47 @@
+package org.onap.vid.model;
+
+
+import java.util.Collection;
+
+public class Workflow {
+    //Private members:
+    private int id;
+    private String workflowName;
+    private Collection<String> vnfNames;
+
+
+    //Constructors:
+    public Workflow() {}
+
+    public Workflow(int id, String workflowName, Collection<String> vnfNames) {
+        this.id = id;
+        this.workflowName = workflowName;
+        this.vnfNames = vnfNames;
+    }
+
+
+    //Setters and getters:
+    public int getId() {
+        return id;
+    }
+
+    public String getWorkflowName() {
+        return workflowName;
+    }
+
+    public Collection<String> getVnfNames() {
+        return this.vnfNames;
+    }
+
+    public void setId(int id) {
+        this.id = id;
+    }
+
+    public void setWorkflowName(String workflowName) {
+        this.workflowName = workflowName;
+    }
+
+    public void setVnfName(Collection<String> vnfNames) {
+        this.vnfNames = vnfNames;
+    }
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/mso/MsoBusinessLogic.java b/vid-app-common/src/main/java/org/onap/vid/mso/MsoBusinessLogic.java
new file mode 100644
index 0000000..c197299
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/mso/MsoBusinessLogic.java
@@ -0,0 +1,99 @@
+package org.onap.vid.mso;
+
+import org.onap.vid.changeManagement.RequestDetailsWrapper;
+import org.onap.vid.controller.OperationalEnvironmentController;
+import org.onap.vid.mso.model.OperationalEnvironmentActivateInfo;
+import org.onap.vid.mso.model.OperationalEnvironmentDeactivateInfo;
+import org.onap.vid.mso.rest.OperationalEnvironment.OperationEnvironmentRequestDetails;
+import org.onap.vid.mso.rest.Request;
+import org.onap.vid.mso.rest.RequestDetails;
+import org.onap.vid.mso.rest.Task;
+
+import java.util.List;
+
+public interface MsoBusinessLogic {
+
+    // this function should get params from tosca and send them to instance at mso, then return success response.
+    MsoResponseWrapper createSvcInstance(RequestDetails msoRequest) throws Exception;
+
+    MsoResponseWrapper createVnf(RequestDetails requestDetails, String serviceInstanceId) throws Exception;
+
+    MsoResponseWrapper createNwInstance(RequestDetails requestDetails, String serviceInstanceId) throws Exception;
+
+    MsoResponseWrapper createVolumeGroupInstance(RequestDetails requestDetails, String serviceInstanceId, String vnfInstanceId) throws Exception;
+
+    MsoResponseWrapper createVfModuleInstance(RequestDetails requestDetails, String serviceInstanceId, String vnfInstanceId) throws Exception;
+
+    MsoResponseWrapper createConfigurationInstance(RequestDetails requestDetails, String serviceInstanceId) throws Exception;
+
+    MsoResponseWrapper deleteSvcInstance(RequestDetails requestDetails, String serviceInstanceId) throws Exception;
+
+    MsoResponseWrapper deleteVnf(RequestDetails requestDetails, String serviceInstanceId, String vnfInstanceId) throws Exception;
+
+    MsoResponseWrapper deleteVfModule(RequestDetails requestDetails, String serviceInstanceId, String vnfInstanceId, String vfModuleId) throws Exception;
+
+    MsoResponseWrapper deleteVolumeGroupInstance(RequestDetails requestDetails, String serviceInstanceId, String vnfInstanceId, String volumeGroupId)throws Exception;
+
+    MsoResponseWrapper deleteNwInstance(RequestDetails requestDetails, String serviceInstanceId, String networkInstanceId) throws Exception;
+
+    MsoResponseWrapper getOrchestrationRequest(String requestId)throws Exception;
+
+    MsoResponseWrapper getOrchestrationRequests(String filterString)throws Exception;
+
+    List<Request> getOrchestrationRequestsForDashboard()throws Exception;
+
+    List<Task> getManualTasksByRequestId(String originalRequestId)throws Exception;
+
+    MsoResponseWrapper completeManualTask(RequestDetails requestDetails, String taskId)throws Exception;
+
+    MsoResponseWrapper activateServiceInstance(RequestDetails requestDetails, String serviceInstanceId)throws Exception;
+
+    MsoResponseWrapperInterface updateVnf(org.onap.vid.changeManagement.RequestDetails requestDetails, String serviceInstanceId, String vnfInstanceId) throws Exception;
+
+    MsoResponseWrapperInterface replaceVnf(org.onap.vid.changeManagement.RequestDetails requestDetails, String serviceInstanceId, String vnfInstanceId) throws Exception;
+
+    MsoResponseWrapperInterface updateVnfSoftware(org.onap.vid.changeManagement.RequestDetails requestDetails, String serviceInstanceId, String vnfInstanceId) throws Exception;
+
+    MsoResponseWrapperInterface updateVnfConfig(org.onap.vid.changeManagement.RequestDetails requestDetails, String serviceInstanceId, String vnfInstanceId) throws Exception;
+
+    MsoResponseWrapper deleteConfiguration(
+            RequestDetails requestDetails,
+            String serviceInstanceId,
+            String configurationId) throws Exception;
+
+    MsoResponseWrapper setConfigurationActiveStatus(
+            RequestDetails requestDetails,
+            String serviceInstanceId,
+            String configurationId,
+            boolean isActivate) throws Exception;
+
+    MsoResponseWrapper setPortOnConfigurationStatus(
+            RequestDetails requestDetails,
+            String serviceInstanceId,
+            String configurationId,
+            boolean isEnable) throws Exception;
+
+    RequestDetailsWrapper<RequestDetails> createOperationalEnvironmentActivationRequestDetails(OperationalEnvironmentActivateInfo details);
+
+    String getOperationalEnvironmentActivationPath(OperationalEnvironmentActivateInfo details);
+
+    RequestDetailsWrapper<RequestDetails> createOperationalEnvironmentDeactivationRequestDetails(OperationalEnvironmentDeactivateInfo details);
+
+    String getCloudResourcesRequestsStatusPath(String requestId);
+
+    String getOperationalEnvironmentDeactivationPath(OperationalEnvironmentDeactivateInfo details);
+
+    String getOperationalEnvironmentCreationPath();
+
+    RequestDetailsWrapper<OperationEnvironmentRequestDetails> convertParametersToRequestDetails(OperationalEnvironmentController.OperationalEnvironmentCreateBody input, String userId);
+
+    MsoResponseWrapper removeRelationshipFromServiceInstance(RequestDetails requestDetails, String serviceInstanceId) throws Exception;
+
+    MsoResponseWrapper addRelationshipToServiceInstance(RequestDetails requestDetails, String serviceInstanceId) throws  Exception;
+
+    MsoResponseWrapper setServiceInstanceStatus(RequestDetails requestDetails , String serviceInstanceId, boolean isActivate)throws Exception;
+
+    RequestDetailsWrapper generateInPlaceMsoRequest(org.onap.vid.changeManagement.RequestDetails requestDetails) throws Exception;
+
+    RequestDetailsWrapper generateConfigMsoRequest(org.onap.vid.changeManagement.RequestDetails requestDetails) throws Exception;
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/mso/MsoBusinessLogicImpl.java b/vid-app-common/src/main/java/org/onap/vid/mso/MsoBusinessLogicImpl.java
new file mode 100644
index 0000000..6ad6b5f
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/mso/MsoBusinessLogicImpl.java
@@ -0,0 +1,800 @@
+package org.onap.vid.mso;
+
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.databind.DeserializationFeature;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.databind.SerializationFeature;
+import com.google.common.collect.ImmutableList;
+import com.google.common.collect.ImmutableMap;
+import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
+import org.openecomp.portalsdk.core.util.SystemProperties;
+import org.onap.vid.changeManagement.ChangeManagementRequest;
+import org.onap.vid.changeManagement.RequestDetailsWrapper;
+import org.onap.vid.controller.OperationalEnvironmentController;
+import org.onap.vid.domain.mso.RequestInfo;
+import org.onap.vid.mso.model.OperationalEnvironmentActivateInfo;
+import org.onap.vid.mso.model.OperationalEnvironmentDeactivateInfo;
+import org.onap.vid.mso.rest.OperationalEnvironment.OperationEnvironmentRequestDetails;
+import org.onap.vid.mso.rest.*;
+import org.springframework.beans.factory.annotation.Autowired;
+
+import javax.ws.rs.BadRequestException;
+import java.text.DateFormat;
+import java.text.SimpleDateFormat;
+import java.util.*;
+import java.util.regex.Pattern;
+
+import static org.onap.vid.changeManagement.ChangeManagementRequest.MsoChangeManagementRequest;
+import static org.onap.vid.controller.MsoController.*;
+import static org.onap.vid.mso.MsoProperties.*;
+
+public class MsoBusinessLogicImpl implements MsoBusinessLogic {
+
+    /**
+     * The Constant dateFormat.
+     */
+    final static DateFormat dateFormat = new SimpleDateFormat("HH:mm:ss:SSSS");
+    final static Pattern SOFTWARE_VERSION_PATTERN = Pattern.compile("^[A-Za-z0-9.\\-]+$");
+    final static Pattern NUMBER_PATTERN = Pattern.compile("^[0-9]+$");
+    private static final String ACTIVATE = "/activate";
+    private static final String DEACTIVATE = "/deactivate";
+    private static final String ENABLE_PORT = "/enablePort";
+    private static final String DISABLE_PORT = "/disablePort";
+    private final static String RESOURCE_TYPE_OPERATIONAL_ENVIRONMENT = "operationalEnvironment";
+    private final static String SOURCE_OPERATIONAL_ENVIRONMENT = "VID";
+    final static private ObjectMapper objectMapper = new ObjectMapper();
+    /**
+     * The Mso REST client
+     * This should be replaced with mso client factory.
+     */
+    private final MsoInterface msoClientInterface;
+    /**
+     * The logger.
+     */
+    private static final EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(MsoBusinessLogicImpl.class);
+
+    @Autowired
+    public MsoBusinessLogicImpl(MsoInterface msoClientInterface) {
+        this.msoClientInterface = msoClientInterface;
+    }
+
+    static String validateEndpointPath(String endpointEnvVariable) {
+        String endpoint = SystemProperties.getProperty(endpointEnvVariable);
+        if (endpoint == null || endpoint.isEmpty()) {
+            throw new RuntimeException(endpointEnvVariable + " env variable is not defined");
+        }
+        return endpoint;
+    }
+
+    // this function should get params from tosca and send them to instance at mso, then return success response.
+    @Override
+    public MsoResponseWrapper createSvcInstance(RequestDetails msoRequest) throws Exception {
+        String methodName = "createSvcInstance ";
+        logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
+
+        String endpoint;
+        try {
+            endpoint = validateEndpointPath(MsoProperties.MSO_REST_API_SVC_INSTANCE);
+        } catch (Exception exception) {
+            throw exception;
+        }
+
+        return msoClientInterface.createSvcInstance(msoRequest, endpoint);
+    }
+
+    void validateLineOfBusiness(RequestDetails requestDetails) {
+
+        Object value = requestDetails.getAdditionalProperties();
+
+        for(String prop: ImmutableList.of("requestDetails", "lineOfBusiness", "lineOfBusinessName")) {
+            if(value==null ||!(value instanceof Map)) {
+                value = null;
+                break;
+            }
+            else {
+                value = ((Map)value).get(prop);
+            }
+        }
+
+        if(value == null || value.toString().isEmpty()) {
+            throw new BadRequestException("lineOfBusiness is required");
+        }
+
+    }
+
+    @Override
+    public MsoResponseWrapper createVnf(RequestDetails requestDetails, String serviceInstanceId) throws Exception {
+        String methodName = "createVnf";
+        logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
+
+        String endpoint;
+        try {
+            endpoint = validateEndpointPath(MsoProperties.MSO_REST_API_VNF_INSTANCE);
+        } catch (Exception exception) {
+            throw exception;
+        }
+
+        String vnf_endpoint = endpoint.replaceFirst(SVC_INSTANCE_ID, serviceInstanceId);
+        return msoClientInterface.createVnf(requestDetails, vnf_endpoint);
+    }
+
+    @Override
+    public MsoResponseWrapper createNwInstance(RequestDetails requestDetails, String serviceInstanceId) throws Exception {
+        String methodName = "createNwInstance";
+        logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
+
+        String endpoint;
+        try {
+            endpoint = validateEndpointPath(MsoProperties.MSO_REST_API_NETWORK_INSTANCE);
+        } catch (Exception exception) {
+            throw exception;
+        }
+
+        String nw_endpoint = endpoint.replaceFirst(SVC_INSTANCE_ID, serviceInstanceId);
+        return msoClientInterface.createNwInstance(requestDetails, nw_endpoint);
+    }
+
+    @Override
+    public MsoResponseWrapper createVolumeGroupInstance(RequestDetails requestDetails, String serviceInstanceId, String vnfInstanceId) throws Exception {
+        String methodName = "createVolumeGroupInstance";
+        logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
+
+        String endpoint;
+        try {
+            endpoint = validateEndpointPath(MsoProperties.MSO_REST_API_VOLUME_GROUP_INSTANCE);
+        } catch (Exception exception) {
+            throw exception;
+        }
+
+        String vnf_endpoint = endpoint.replaceFirst(SVC_INSTANCE_ID, serviceInstanceId);
+        vnf_endpoint = vnf_endpoint.replaceFirst(VNF_INSTANCE_ID, vnfInstanceId);
+
+        return msoClientInterface.createVolumeGroupInstance(requestDetails, vnf_endpoint);
+    }
+
+    @Override
+    public MsoResponseWrapper createVfModuleInstance(RequestDetails requestDetails, String serviceInstanceId, String vnfInstanceId) throws Exception {
+        String methodName = "createVfModuleInstance";
+        logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
+
+        String endpoint;
+        try {
+            endpoint = validateEndpointPath(MsoProperties.MSO_REST_API_VF_MODULE_INSTANCE);
+        } catch (Exception exception) {
+            throw exception;
+        }
+
+        String partial_endpoint = endpoint.replaceFirst(SVC_INSTANCE_ID, serviceInstanceId);
+        String vf_module_endpoint = partial_endpoint.replaceFirst(VNF_INSTANCE_ID, vnfInstanceId);
+
+        return msoClientInterface.createVfModuleInstance(requestDetails, vf_module_endpoint);
+    }
+
+    @Override
+    public MsoResponseWrapper createConfigurationInstance(RequestDetails requestDetails, String serviceInstanceId) throws Exception {
+        String methodName = "createConfigurationInstance";
+        logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
+
+        String endpoint = validateEndpointPath(MsoProperties.MSO_REST_API_CONFIGURATIONS);
+        endpoint = endpoint.replace(SVC_INSTANCE_ID, serviceInstanceId);
+
+        return msoClientInterface.createConfigurationInstance(requestDetails, endpoint);
+    }
+
+    @Override
+    public MsoResponseWrapper deleteSvcInstance(RequestDetails requestDetails, String serviceInstanceId) throws Exception {
+        String methodName = "deleteSvcInstance";
+        logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
+
+        String endpoint;
+        try {
+            endpoint = validateEndpointPath(MsoProperties.MSO_REST_API_SVC_INSTANCE);
+        } catch (Exception exception) {
+            throw exception;
+        }
+
+        String svc_endpoint = endpoint + "/" + serviceInstanceId;
+
+        return msoClientInterface.deleteSvcInstance(requestDetails, svc_endpoint);
+    }
+
+    @Override
+    public MsoResponseWrapper deleteVnf(RequestDetails requestDetails, String serviceInstanceId, String vnfInstanceId) throws Exception {
+        String methodName = "deleteVnf";
+        logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
+
+        String endpoint;
+        try {
+            endpoint = validateEndpointPath(MsoProperties.MSO_REST_API_VNF_INSTANCE);
+        } catch (Exception exception) {
+            throw exception;
+        }
+        String vnf_endpoint = endpoint.replaceFirst(SVC_INSTANCE_ID, serviceInstanceId);
+        vnf_endpoint = vnf_endpoint + '/' + vnfInstanceId;
+
+        return msoClientInterface.deleteVnf(requestDetails, vnf_endpoint);
+    }
+
+    @Override
+    public MsoResponseWrapper deleteVfModule(RequestDetails requestDetails, String serviceInstanceId, String vnfInstanceId, String vfModuleId) throws Exception {
+        String methodName = "deleteVfModule";
+        logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
+
+        String endpoint;
+        try {
+            endpoint = validateEndpointPath(MsoProperties.MSO_REST_API_VF_MODULE_INSTANCE);
+        } catch (Exception exception) {
+            throw exception;
+        }
+
+        String vf__modules_endpoint = endpoint.replaceFirst(SVC_INSTANCE_ID, serviceInstanceId).replaceFirst(VNF_INSTANCE_ID, vnfInstanceId);
+
+        String delete_vf_endpoint = vf__modules_endpoint + '/' + vfModuleId;
+
+        return msoClientInterface.deleteVfModule(requestDetails, delete_vf_endpoint);
+    }
+
+    @Override
+    public MsoResponseWrapper deleteVolumeGroupInstance(RequestDetails requestDetails, String serviceInstanceId, String vnfInstanceId, String volumeGroupId) throws Exception {
+        String methodName = "deleteVolumeGroupInstance";
+        logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
+
+        String endpoint;
+        try {
+            endpoint = validateEndpointPath(MsoProperties.MSO_REST_API_VOLUME_GROUP_INSTANCE);
+        } catch (Exception exception) {
+            throw exception;
+        }
+
+        String svc_endpoint = endpoint.replaceFirst(SVC_INSTANCE_ID, serviceInstanceId);
+        String vnf_endpoint = svc_endpoint.replaceFirst(VNF_INSTANCE_ID, vnfInstanceId);
+        String delete_volume_group_endpoint = vnf_endpoint + "/" + volumeGroupId;
+
+        return msoClientInterface.deleteVolumeGroupInstance(requestDetails, delete_volume_group_endpoint);
+    }
+
+    @Override
+    public MsoResponseWrapper deleteNwInstance(RequestDetails requestDetails, String serviceInstanceId, String networkInstanceId) throws Exception {
+        String methodName = "deleteNwInstance";
+        logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
+
+        String endpoint;
+        try {
+            endpoint = validateEndpointPath(MsoProperties.MSO_REST_API_NETWORK_INSTANCE);
+        } catch (Exception exception) {
+            throw exception;
+        }
+
+        String svc_endpoint = endpoint.replaceFirst(SVC_INSTANCE_ID, serviceInstanceId);
+        String delete_nw_endpoint = svc_endpoint + "/" + networkInstanceId;
+
+        return msoClientInterface.deleteNwInstance(requestDetails, delete_nw_endpoint);
+    }
+
+    @Override
+    public MsoResponseWrapper getOrchestrationRequest(String requestId) throws Exception {
+        String methodName = "getOrchestrationRequest";
+        logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
+        MsoResponseWrapper w = null;
+        try {
+            String p = SystemProperties.getProperty(MsoProperties.MSO_REST_API_GET_ORC_REQ);
+            String path = p + "/" + requestId;
+
+            RestObject<String> restObjStr = new RestObject<String>();
+            String str = new String();
+            restObjStr.set(str);
+
+            msoClientInterface.getOrchestrationRequest(str, "", path, restObjStr);
+
+            return MsoUtil.wrapResponse(restObjStr);
+
+        } catch (Exception e) {
+            logger.error(EELFLoggerDelegate.errorLogger, dateFormat.format(new Date()) + "<== " + "." + methodName + e.toString());
+            logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + "." + methodName + e.toString());
+            throw e;
+        }
+    }
+
+    @Override
+    public MsoResponseWrapper getOrchestrationRequests(String filterString) throws Exception {
+        String methodName = "getOrchestrationRequest";
+        logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
+        MsoResponseWrapper w = null;
+        try {
+            String p = SystemProperties.getProperty(MsoProperties.MSO_REST_API_GET_ORC_REQS);
+            String path = p + filterString;
+
+            RestObject<String> restObjStr = new RestObject<String>();
+            String str = new String();
+            restObjStr.set(str);
+
+            msoClientInterface.getOrchestrationRequest(str, "", path, restObjStr);
+
+            return MsoUtil.wrapResponse(restObjStr);
+
+        } catch (Exception e) {
+            logger.error(EELFLoggerDelegate.errorLogger, dateFormat.format(new Date()) + "<== " + "." + methodName + e.toString());
+            logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + "." + methodName + e.toString());
+            throw e;
+        }
+    }
+
+    @Override
+    public List<Request> getOrchestrationRequestsForDashboard() throws Exception {
+        String methodName = "getOrchestrationRequestsForDashboard";
+        logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
+        List<Request> filteredOrchestrationRequests = new ArrayList<>();
+        try {
+            String path = SystemProperties.getProperty(MsoProperties.MSO_REST_API_GET_ORC_REQS);
+            path += "filter=modelType:EQUALS:vnf";
+            RestObject<String> restObjStr = new RestObject<String>();
+            String str = new String();
+            restObjStr.set(str);
+
+            MsoResponseWrapper msoResponseWrapper = msoClientInterface.getOrchestrationRequestsForDashboard(str, "", path, restObjStr);
+            List<RequestWrapper> allOrchestrationRequests = deserializeOrchestrationRequestsJson(msoResponseWrapper.getEntity());
+
+            ;
+            for (RequestWrapper currentRequest : allOrchestrationRequests) {
+                if ((currentRequest.getRequest() != null) && (currentRequest.getRequest().getRequestScope() == Request.RequestScope.VNF) && ((currentRequest.getRequest().getRequestType() ==
+                        Request.RequestType.REPLACE_INSTANCE) || (currentRequest.getRequest().getRequestType() ==
+                        Request.RequestType.UPDATE_INSTANCE))) {
+                    filteredOrchestrationRequests.add(currentRequest.getRequest());
+                }
+            }
+        } catch (Exception e) {
+            logger.error(EELFLoggerDelegate.errorLogger, dateFormat.format(new Date()) + "<== " + "." + methodName + e.toString());
+            logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + "." + methodName + e.toString());
+        }
+        return filteredOrchestrationRequests;
+
+    }
+
+    private List<RequestWrapper> deserializeOrchestrationRequestsJson(String orchestrationRequestsJson) throws Exception {
+        String methodName = "deserializeOrchestrationRequestsJson";
+        logger.debug(dateFormat.format(new Date()) + "<== " + methodName + " start");
+
+        ObjectMapper mapper = new ObjectMapper();
+        mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
+        mapper.configure(DeserializationFeature.READ_ENUMS_USING_TO_STRING, true);
+        RequestList requestList = mapper.readValue(orchestrationRequestsJson, RequestList.class);
+        return requestList.getRequestList();
+    }
+
+
+    @Override
+    public List<Task> getManualTasksByRequestId(String originalRequestId) throws Exception {
+        String methodName = "getManualTasksByRequestId";
+        logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
+
+        try {
+            String p = SystemProperties.getProperty(MsoProperties.MSO_REST_API_GET_MAN_TASKS);
+            String path = p + "?originalRequestId=" + originalRequestId;
+
+            RestObject<String> restObjStr = new RestObject<String>();
+            String str = new String();
+            restObjStr.set(str);
+
+            MsoResponseWrapper msoResponseWrapper = msoClientInterface.getManualTasksByRequestId(str, "", path, restObjStr);
+            return deserializeManualTasksJson(msoResponseWrapper.getEntity());
+
+        } catch (Exception e) {
+            logger.error(EELFLoggerDelegate.errorLogger, dateFormat.format(new Date()) + "<== " + "." + methodName + e.toString());
+            logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + "." + methodName + e.toString());
+            throw e;
+        }
+    }
+
+    private List<Task> deserializeManualTasksJson(String manualTasksJson) throws Exception {
+        String methodName = "deserializeManualTasksJson";
+        logger.debug(dateFormat.format(new Date()) + "<== " + methodName + " start");
+
+        ObjectMapper mapper = new ObjectMapper();
+        TaskList taskList = mapper.readValue(manualTasksJson, TaskList.class);
+        return taskList.getTaskList();
+    }
+
+
+    @Override
+    public MsoResponseWrapper completeManualTask(RequestDetails requestDetails, String taskId) throws Exception {
+        String methodName = "completeManualTask";
+        logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
+        MsoResponseWrapper w = null;
+        try {
+            String p = SystemProperties.getProperty(MsoProperties.MSO_REST_API_GET_MAN_TASKS);
+            String path = p + "/" + taskId + "/complete";
+
+            RestObject<String> restObjStr = new RestObject<String>();
+            String str = new String();
+            restObjStr.set(str);
+
+            msoClientInterface.completeManualTask(requestDetails, str, "", path, restObjStr);
+
+            return MsoUtil.wrapResponse(restObjStr);
+
+        } catch (Exception e) {
+            logger.error(EELFLoggerDelegate.errorLogger, dateFormat.format(new Date()) + "<== " + "." + methodName + e.toString());
+            logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + "." + methodName + e.toString());
+            throw e;
+        }
+    }
+
+    @Override
+    public MsoResponseWrapper activateServiceInstance(RequestDetails requestDetails, String serviceInstanceId) throws Exception {
+        String methodName = "activateServiceInstance";
+        logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
+        try {
+            String serviceEndpoint = SystemProperties.getProperty(MsoProperties.MSO_REST_API_SVC_INSTANCE);
+            String activateServicePath = serviceEndpoint + "/" + serviceInstanceId + "/activate";
+
+            RestObject<String> restObjStr = new RestObject<>();
+            String str = "";
+            restObjStr.set(str);
+
+            msoClientInterface.setServiceInstanceStatus(requestDetails, str, "", activateServicePath, restObjStr);
+
+            return MsoUtil.wrapResponse(restObjStr);
+
+        } catch (Exception e) {
+            logger.error(EELFLoggerDelegate.errorLogger, dateFormat.format(new Date()) + "<== " + "." + methodName + e.toString());
+            logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + "." + methodName + e.toString());
+            throw e;
+        }
+    }
+
+
+    @Override
+    public MsoResponseWrapperInterface updateVnf(org.onap.vid.changeManagement.RequestDetails requestDetails, String serviceInstanceId, String vnfInstanceId) throws Exception {
+        String methodName = "updateVnf";
+        logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
+
+        String endpoint;
+        try {
+            endpoint = validateEndpointPath(MsoProperties.MSO_REST_API_VNF_INSTANCE);
+        } catch (Exception exception) {
+            throw exception;
+        }
+        String vnf_endpoint = endpoint.replaceFirst(SVC_INSTANCE_ID, serviceInstanceId);
+        vnf_endpoint = vnf_endpoint + '/' + vnfInstanceId;
+        return msoClientInterface.updateVnf(requestDetails, vnf_endpoint);
+    }
+
+    @Override
+    public MsoResponseWrapperInterface replaceVnf(org.onap.vid.changeManagement.RequestDetails requestDetails, String serviceInstanceId, String vnfInstanceId) throws Exception {
+        String methodName = "replaceVnf";
+        logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
+
+        String endpoint;
+        try {
+            endpoint = validateEndpointPath(MsoProperties.MSO_REST_API_VNF_CHANGE_MANAGEMENT_INSTANCE);
+        } catch (Exception exception) {
+            throw exception;
+        }
+        String vnf_endpoint = endpoint.replaceFirst(SVC_INSTANCE_ID, serviceInstanceId);
+        vnf_endpoint = vnf_endpoint.replace(VNF_INSTANCE_ID, vnfInstanceId);
+        vnf_endpoint = vnf_endpoint.replace(REQUEST_TYPE, MsoChangeManagementRequest.REPLACE);
+        return msoClientInterface.replaceVnf(requestDetails, vnf_endpoint);
+    }
+
+    public RequestDetailsWrapper generateInPlaceMsoRequest(org.onap.vid.changeManagement.RequestDetails requestDetails) throws Exception {
+        validateUpdateVnfSoftwarePayload(requestDetails);
+        RequestDetails inPlaceSoftwareUpdateRequest = new RequestDetails();
+        inPlaceSoftwareUpdateRequest.setCloudConfiguration(requestDetails.getCloudConfiguration());
+        inPlaceSoftwareUpdateRequest.setRequestParameters(requestDetails.getRequestParameters());
+        inPlaceSoftwareUpdateRequest.setRequestInfo(requestDetails.getRequestInfo());
+        RequestDetailsWrapper requestDetailsWrapper = new RequestDetailsWrapper();
+        requestDetailsWrapper.requestDetails = inPlaceSoftwareUpdateRequest;
+        return requestDetailsWrapper;
+    }
+
+    @Override
+    public RequestDetailsWrapper generateConfigMsoRequest(org.onap.vid.changeManagement.RequestDetails requestDetails) throws Exception {
+        validateUpdateVnfConfig(requestDetails);
+        RequestDetails ConfigUpdateRequest = new RequestDetails();
+        ConfigUpdateRequest.setRequestParameters(requestDetails.getRequestParameters());
+        ConfigUpdateRequest.setRequestInfo(requestDetails.getRequestInfo());
+        RequestDetailsWrapper requestDetailsWrapper = new RequestDetailsWrapper();
+        requestDetailsWrapper.requestDetails = ConfigUpdateRequest;
+        return requestDetailsWrapper;
+    }
+
+    @Override
+    public MsoResponseWrapperInterface updateVnfSoftware(org.onap.vid.changeManagement.RequestDetails requestDetails, String serviceInstanceId, String vnfInstanceId) throws Exception {
+        String methodName = "updateVnfSoftware";
+        logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
+        String vnf_endpoint = getChangeManagementEndpoint(serviceInstanceId, vnfInstanceId, MsoChangeManagementRequest.SOFTWARE_UPDATE); //workflow name in mso is different than workflow name in vid UI
+        RequestDetailsWrapper finalRequestDetails = generateInPlaceMsoRequest(requestDetails);
+        return msoClientInterface.changeManagementUpdate(finalRequestDetails, vnf_endpoint);
+    }
+
+    @Override
+    public MsoResponseWrapperInterface updateVnfConfig(org.onap.vid.changeManagement.RequestDetails requestDetails, String serviceInstanceId, String vnfInstanceId) throws Exception {
+        String methodName = "updateVnfConfig";
+        logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
+        RequestDetailsWrapper finalRequestDetails = generateConfigMsoRequest(requestDetails);
+        String vnf_endpoint = getChangeManagementEndpoint(serviceInstanceId, vnfInstanceId, MsoChangeManagementRequest.CONFIG_UPDATE);
+        return msoClientInterface.changeManagementUpdate(finalRequestDetails, vnf_endpoint);
+    }
+
+    private String getChangeManagementEndpoint(String serviceInstanceId, String vnfInstanceId, String vnfRequestType) {
+        String endpoint  = validateEndpointPath(MsoProperties.MSO_REST_API_VNF_CHANGE_MANAGEMENT_INSTANCE);
+        String vnf_endpoint = endpoint.replaceFirst(SVC_INSTANCE_ID, serviceInstanceId);
+        vnf_endpoint = vnf_endpoint.replace(VNF_INSTANCE_ID, vnfInstanceId);
+        vnf_endpoint = vnf_endpoint.replace(REQUEST_TYPE, vnfRequestType);
+        return vnf_endpoint;
+    }
+
+    private Map getChangeManagementPayload(RequestDetails requestDetails, String message) throws Exception{
+        if(requestDetails.getRequestParameters()==null||requestDetails.getRequestParameters().getAdditionalProperties()==null){
+            throw new BadRequestException(message);
+        }
+        Object payloadRaw=requestDetails.getRequestParameters().getAdditionalProperties().get("payload");
+        try{
+            return objectMapper.readValue((String)payloadRaw,Map.class);
+        }
+        catch(Exception exception){
+            throw new BadRequestException(message);
+        }
+    }
+
+    private void validateUpdateVnfSoftwarePayload(RequestDetails requestDetails) throws Exception {
+        final String noValidPayloadMsg = "No valid payload in " + ChangeManagementRequest.VNF_IN_PLACE_SOFTWARE_UPDATE + " request";
+
+        Map payload = getChangeManagementPayload(requestDetails, noValidPayloadMsg);
+        validateUpdateVnfSoftwarePayloadProperty(payload, noValidPayloadMsg, "existing-software-version", SOFTWARE_VERSION_PATTERN);
+        validateUpdateVnfSoftwarePayloadProperty(payload, noValidPayloadMsg, "new-software-version", SOFTWARE_VERSION_PATTERN);
+
+        //if "operations-timeout" is not integer, trying to read it as String that represent a number
+        if (!(payload.get("operations-timeout") instanceof Integer)) {
+            validateUpdateVnfSoftwarePayloadProperty(payload, noValidPayloadMsg, "operations-timeout", NUMBER_PATTERN);
+        }
+
+    }
+
+    private void validateUpdateVnfSoftwarePayloadProperty(Map payload, String noValidPayloadMsg, String propertyName, Pattern pattern) {
+        Object forValidation = payload.get(propertyName);
+        final String noValidPayloadPropertyMsg = noValidPayloadMsg + ", " + propertyName + " property is not valid";
+        if (!(forValidation instanceof String)) {
+            throw new BadRequestException(noValidPayloadPropertyMsg);
+        }
+        if (!pattern.matcher((String) forValidation).matches()) {
+            throw new BadRequestException(noValidPayloadPropertyMsg);
+        }
+    }
+
+    private void validateUpdateVnfConfig(RequestDetails requestDetails) throws Exception {
+        final String noValidPayloadMsg = "No valid payload in " + ChangeManagementRequest.CONFIG_UPDATE + " request";
+
+        Map payload = getChangeManagementPayload(requestDetails, noValidPayloadMsg);
+        validateConfigUpdateVnfPayloadProperty(payload, noValidPayloadMsg, "request-parameters");
+        validateConfigUpdateVnfPayloadProperty(payload, noValidPayloadMsg, "configuration-parameters");
+    }
+
+    private void validateConfigUpdateVnfPayloadProperty(Map payload, String noValidPayloadMsg, String propertyName) {
+        Object forValidation = payload.get(propertyName);
+        final String noValidPayloadPropertyMsg = noValidPayloadMsg+ ", "+ propertyName + " property is not valid";
+        if(!payload.containsKey(propertyName)) {
+            throw new BadRequestException( noValidPayloadPropertyMsg);
+        }
+    }
+
+    @Override
+    public MsoResponseWrapper deleteConfiguration(
+            RequestDetails requestDetails,
+            String serviceInstanceId,
+            String configurationId) throws Exception {
+
+        String methodName = "deleteConfiguration";
+        logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
+
+        String endpoint = validateEndpointPath(MsoProperties.MSO_REST_API_CONFIGURATION_INSTANCE);
+        endpoint = endpoint.replace(SVC_INSTANCE_ID, serviceInstanceId);
+        endpoint = endpoint.replace(CONFIGURATION_ID, configurationId);
+
+        return msoClientInterface.deleteConfiguration(requestDetails, endpoint);
+    }
+
+    @Override
+    public MsoResponseWrapper setConfigurationActiveStatus(
+            RequestDetails requestDetails,
+            String serviceInstanceId,
+            String configurationId,
+            boolean isActivate) throws Exception {
+
+        String methodName = "setConfigurationActiveStatus";
+        logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
+
+        String endpoint = validateEndpointPath(MsoProperties.MSO_REST_API_CONFIGURATION_INSTANCE);
+        endpoint = endpoint.replace(SVC_INSTANCE_ID, serviceInstanceId);
+        endpoint = endpoint.replace(CONFIGURATION_ID, configurationId);
+
+        String isActivateState = (isActivate ? ACTIVATE : DEACTIVATE);
+        endpoint = endpoint + isActivateState;
+
+        return msoClientInterface.setConfigurationActiveStatus(requestDetails, endpoint);
+    }
+
+    @Override
+    public MsoResponseWrapper setServiceInstanceStatus(RequestDetails requestDetails , String serviceInstanceId, boolean isActivate)throws Exception{
+        String methodName = "setServiceInstanceStatus";
+        logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
+        try {
+            String serviceEndpoint = validateEndpointPath(MsoProperties.MSO_REST_API_SVC_INSTANCE);
+            String endpoint = serviceEndpoint + "/" + serviceInstanceId;
+
+            String isActivateState = (isActivate ? ACTIVATE : DEACTIVATE);
+            endpoint = endpoint + isActivateState;
+
+
+            RestObject<String> restObjStr = new RestObject<>();
+            String str = "";
+            restObjStr.set(str);
+
+            msoClientInterface.setServiceInstanceStatus(requestDetails , str, "", endpoint, restObjStr);
+
+            return MsoUtil.wrapResponse(restObjStr);
+
+        } catch (Exception e) {
+            logger.error(EELFLoggerDelegate.errorLogger, dateFormat.format(new Date()) + "<== " + "." + methodName + e.toString());
+            logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + "." + methodName + e.toString());
+            throw e;
+        }
+    }
+
+    @Override
+    public MsoResponseWrapper setPortOnConfigurationStatus(
+            RequestDetails requestDetails,
+            String serviceInstanceId,
+            String configurationId,
+            boolean isEnable) throws Exception {
+        String methodName = "setPortOnConfigurationStatus";
+        logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
+
+        String endpoint = validateEndpointPath(MsoProperties.MSO_REST_API_CONFIGURATION_INSTANCE);
+        endpoint = endpoint.replace(SVC_INSTANCE_ID, serviceInstanceId);
+        endpoint = endpoint.replace(CONFIGURATION_ID, configurationId);
+
+        String isEnablePortStatus = (isEnable ? ENABLE_PORT : DISABLE_PORT);
+        endpoint = endpoint + isEnablePortStatus;
+
+        return msoClientInterface.setPortOnConfigurationStatus(requestDetails, endpoint);
+    }
+
+
+    @Override
+    public  RequestDetailsWrapper<RequestDetails> createOperationalEnvironmentActivationRequestDetails(OperationalEnvironmentActivateInfo details) {
+        RequestDetails requestDetails = new RequestDetails();
+        RequestInfo requestInfo = new RequestInfo();
+        requestInfo.setAdditionalProperty("resourceType", RESOURCE_TYPE_OPERATIONAL_ENVIRONMENT);
+        requestInfo.setSource(SOURCE_OPERATIONAL_ENVIRONMENT);
+        requestInfo.setRequestorId(details.getUserId());
+        requestDetails.setRequestInfo(requestInfo);
+
+        org.onap.vid.domain.mso.RelatedInstance relatedInstance = new org.onap.vid.domain.mso.RelatedInstance();
+        relatedInstance.setAdditionalProperty("resourceType", RESOURCE_TYPE_OPERATIONAL_ENVIRONMENT);
+        relatedInstance.setInstanceId(details.getRelatedInstanceId());
+        relatedInstance.setInstanceName(details.getRelatedInstanceName());
+        requestDetails.setAdditionalProperty("relatedInstanceList", Collections.singletonList(ImmutableMap.of("relatedInstance", relatedInstance)));
+
+        org.onap.vid.domain.mso.RequestParameters requestParameters = new org.onap.vid.domain.mso.RequestParameters();
+        requestParameters.setUserParams(null);
+        requestParameters.setAdditionalProperty("operationalEnvironmentType", "VNF");
+        requestParameters.setAdditionalProperty("workloadContext", details.getWorkloadContext());
+        requestParameters.setAdditionalProperty("manifest", details.getManifest());
+        requestDetails.setRequestParameters(requestParameters);
+
+        RequestDetailsWrapper<RequestDetails> requestDetailsWrapper = new RequestDetailsWrapper<>(requestDetails);
+
+        debugRequestDetails(requestDetailsWrapper);
+
+        return requestDetailsWrapper;
+    }
+
+    @Override
+    public String getOperationalEnvironmentActivationPath(OperationalEnvironmentActivateInfo details) {
+        String path = validateEndpointPath(MSO_REST_API_OPERATIONAL_ENVIRONMENT_ACTIVATE);
+        path = path.replace("<operational_environment_id>", details.getOperationalEnvironmentId());
+        return path;
+    }
+
+    @Override
+    public RequestDetailsWrapper<RequestDetails> createOperationalEnvironmentDeactivationRequestDetails(OperationalEnvironmentDeactivateInfo details) {
+        RequestDetails requestDetails = new RequestDetails();
+
+        RequestInfo requestInfo = new RequestInfo();
+        requestInfo.setAdditionalProperty("resourceType", RESOURCE_TYPE_OPERATIONAL_ENVIRONMENT);
+        requestInfo.setSource(SOURCE_OPERATIONAL_ENVIRONMENT);
+        requestInfo.setRequestorId(details.getUserId());
+        requestDetails.setRequestInfo(requestInfo);
+
+        org.onap.vid.domain.mso.RequestParameters requestParameters = new org.onap.vid.domain.mso.RequestParameters();
+        requestParameters.setUserParams(null);
+        requestParameters.setAdditionalProperty("operationalEnvironmentType", "VNF");
+        requestDetails.setRequestParameters(requestParameters);
+        RequestDetailsWrapper<RequestDetails> requestDetailsWrapper = new RequestDetailsWrapper<>(requestDetails);
+        debugRequestDetails(requestDetailsWrapper);
+        return requestDetailsWrapper;
+    }
+
+    @Override
+    public String getCloudResourcesRequestsStatusPath(String requestId) {
+        String path = validateEndpointPath(MSO_REST_API_CLOUD_RESOURCES_REQUEST_STATUS);
+        path = path.replace("<request_id>", requestId);
+        return path;
+    }
+
+    @Override
+    public String getOperationalEnvironmentDeactivationPath(OperationalEnvironmentDeactivateInfo details) {
+        String path = validateEndpointPath(MSO_REST_API_OPERATIONAL_ENVIRONMENT_DEACTIVATE);
+        path = path.replace("<operational_environment_id>", details.getOperationalEnvironmentId());
+        return path;
+    }
+
+    private void debugRequestDetails(Object requestDetails) {
+        if (logger.isDebugEnabled()) {
+            String requestDetailsAsString;
+            try {
+                requestDetailsAsString = new ObjectMapper().enable(SerializationFeature.INDENT_OUTPUT).writeValueAsString(requestDetails);
+            } catch (JsonProcessingException e) {
+                requestDetailsAsString = "error: cannot stringify RequestDetails";
+            }
+            logger.debug(EELFLoggerDelegate.debugLogger, "requestDetailsAsString: {}", requestDetailsAsString);
+        }
+    }
+
+    @Override
+    public String getOperationalEnvironmentCreationPath() {
+        String path = validateEndpointPath(MSO_REST_API_OPERATIONAL_ENVIRONMENT_CREATE);
+        return path;
+    }
+
+    @Override
+    public RequestDetailsWrapper<OperationEnvironmentRequestDetails> convertParametersToRequestDetails(OperationalEnvironmentController.OperationalEnvironmentCreateBody input, String userId) {
+        OperationEnvironmentRequestDetails.RequestInfo requestInfo = new OperationEnvironmentRequestDetails.RequestInfo(
+                RESOURCE_TYPE_OPERATIONAL_ENVIRONMENT,
+                input.getInstanceName(),
+                SOURCE_OPERATIONAL_ENVIRONMENT,
+                userId);
+
+        OperationEnvironmentRequestDetails.RelatedInstance relatedInstance = new OperationEnvironmentRequestDetails.RelatedInstance(
+                RESOURCE_TYPE_OPERATIONAL_ENVIRONMENT,
+                input.getEcompInstanceId(),
+                input.getEcompInstanceName());
+
+        List<OperationEnvironmentRequestDetails.RelatedInstance> relatedInstanceList = Collections.singletonList((relatedInstance));
+
+        OperationEnvironmentRequestDetails.RequestParameters requestParameters = new OperationEnvironmentRequestDetails.RequestParameters(
+                input.getOperationalEnvironmentType(),
+                input.getTenantContext(),
+                input.getWorkloadContext());
+
+        OperationEnvironmentRequestDetails requestDetails = new OperationEnvironmentRequestDetails(requestInfo, relatedInstanceList, requestParameters);
+        RequestDetailsWrapper<OperationEnvironmentRequestDetails> requestDetailsWrapper = new RequestDetailsWrapper<>(requestDetails);
+        debugRequestDetails(requestDetailsWrapper);
+        return requestDetailsWrapper;
+    }
+
+    @Override
+    public MsoResponseWrapper removeRelationshipFromServiceInstance(RequestDetails requestDetails, String serviceInstanceId) throws Exception {
+        String methodName = "removeRelationshipFromServiceInstance";
+        logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
+
+        String serviceEndpoint = SystemProperties.getProperty(MsoProperties.MSO_REST_API_SVC_INSTANCE);
+        String removeRelationshipsPath = serviceEndpoint + "/" + serviceInstanceId + "/removeRelationships";
+
+        return msoClientInterface.removeRelationshipFromServiceInstance(requestDetails, removeRelationshipsPath);
+    }
+
+    @Override
+    public MsoResponseWrapper addRelationshipToServiceInstance(RequestDetails requestDetails, String serviceInstanceId) throws Exception {
+        String methodName = "addRelationshipToServiceInstance";
+        logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
+
+        String serviceEndpoint = SystemProperties.getProperty(MsoProperties.MSO_REST_API_SVC_INSTANCE);
+        String addRelationshipsPath = serviceEndpoint + "/" + serviceInstanceId + "/addRelationships";
+
+        return msoClientInterface.addRelationshipToServiceInstance(requestDetails, addRelationshipsPath);
+    }
+
+
+}
\ No newline at end of file
diff --git a/vid-app-common/src/main/java/org/onap/vid/mso/MsoInterface.java b/vid-app-common/src/main/java/org/onap/vid/mso/MsoInterface.java
new file mode 100644
index 0000000..2d09630
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/mso/MsoInterface.java
@@ -0,0 +1,85 @@
+package org.onap.vid.mso;
+
+import org.onap.vid.changeManagement.RequestDetailsWrapper;
+import org.onap.vid.mso.rest.RequestDetails;
+
+/**
+ * Created by pickjonathan on 21/06/2017.
+ */
+public interface MsoInterface {
+
+    /**
+     * This function will post MSO service with information about how to instantiate the requested service
+     * @param requestDetails The details about the service as they come from the web.
+     * @return MsoResponseWrapper containing information about the service instantiation
+     * --> success : see JSON at resources folder mso_create_instance_response.
+     * --> failure : would return 200 with failure data.
+     * @throws Exception
+     */
+    MsoResponseWrapper createSvcInstance(RequestDetails requestDetails, String endpoint) throws Exception;
+
+    /**
+     * will create a virtual network function using MSO service.
+     * @param requestDetails - information about the vnf to create
+     * @return - the response body recived from MSO
+     * @throws Exception
+     */
+    MsoResponseWrapper createVnf(RequestDetails requestDetails, String endpoint) throws Exception;
+
+    MsoResponseWrapper createNwInstance(RequestDetails requestDetails, String endpoint) throws Exception;
+    /**
+     *
+     * @param requestDetails
+     * @param path
+     * @return
+     * @throws Exception
+     */
+    MsoResponseWrapper createVolumeGroupInstance(RequestDetails requestDetails, String path) throws Exception;
+
+    /**
+     *
+     * @param requestDetails
+     * @return
+     * @throws Exception
+     */
+    MsoResponseWrapper createVfModuleInstance(RequestDetails requestDetails, String endpoint) throws Exception;
+
+    MsoResponseWrapper createConfigurationInstance(RequestDetails requestDetails, String endpoint) throws Exception;
+
+    MsoResponseWrapper deleteSvcInstance(RequestDetails requestDetails, String endpoint) throws Exception;
+
+    MsoResponseWrapper deleteVnf(RequestDetails requestDetails, String endpoint) throws Exception;
+
+    MsoResponseWrapper deleteVfModule(RequestDetails requestDetails, String endpoint) throws Exception;
+
+    MsoResponseWrapper deleteVolumeGroupInstance(RequestDetails requestDetails, String endpoint) throws Exception;
+
+    MsoResponseWrapper deleteNwInstance(RequestDetails requestDetails, String endpoint) throws Exception;
+
+    void getOrchestrationRequest(String t, String sourceId, String endpoint, RestObject restObject) throws Exception;
+
+    MsoResponseWrapper getOrchestrationRequestsForDashboard(String t , String sourceId , String endpoint , RestObject restObject) throws Exception;
+
+    MsoResponseWrapper getManualTasksByRequestId(String t , String sourceId , String endpoint , RestObject restObject) throws Exception;
+
+    MsoResponseWrapper completeManualTask(RequestDetails requestDetails, String t, String sourceId, String endpoint, RestObject restObject) throws Exception;
+
+	MsoResponseWrapper updateVnf(org.onap.vid.changeManagement.RequestDetails requestDetails, String vnf_endpoint)  throws Exception;
+
+	MsoResponseWrapper replaceVnf(org.onap.vid.changeManagement.RequestDetails requestDetails, String vnf_endpoint)  throws Exception;
+
+    MsoResponseWrapper deleteConfiguration(RequestDetails requestDetails, String pmc_endpoint) throws Exception;
+
+    MsoResponseWrapper setConfigurationActiveStatus(RequestDetails requestDetails, String endpoint) throws Exception;
+
+    MsoResponseWrapper setPortOnConfigurationStatus(RequestDetails requestDetails, String endpoint) throws Exception;
+
+    void setServiceInstanceStatus(RequestDetails requestDetails, String t, String sourceId, String endpoint, RestObject<String> restObject) throws Exception;
+
+    MsoResponseWrapperInterface changeManagementUpdate(RequestDetailsWrapper requestDetails, String endpoint) throws Exception;
+
+    MsoResponseWrapper removeRelationshipFromServiceInstance(RequestDetails requestDetails, String endpoint) throws Exception;
+
+    MsoResponseWrapper addRelationshipToServiceInstance(RequestDetails requestDetails, String addRelationshipsPath) throws Exception;
+}
+
diff --git a/vid-app-common/src/main/java/org/onap/vid/mso/MsoProperties.java b/vid-app-common/src/main/java/org/onap/vid/mso/MsoProperties.java
new file mode 100644
index 0000000..607d841
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/mso/MsoProperties.java
@@ -0,0 +1,119 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * VID
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.vid.mso;
+
+import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
+import org.openecomp.portalsdk.core.util.SystemProperties;
+
+import java.text.DateFormat;
+import java.text.SimpleDateFormat;
+
+/**
+ * The Class MsoProperties.
+ */
+public class MsoProperties extends SystemProperties {
+
+	/** The Constant MSO_SERVER_URL. */
+	//VID Properties related to MSO
+	public static final String MSO_SERVER_URL = "mso.server.url";
+
+	/** The Constant MSO_DME2_SERVER_URL. */
+	public static final String MSO_DME2_SERVER_URL = "mso.dme2.server.url";
+
+	/** The Constant MSO_DME2_CLIENT_TIMEOUT. */
+	public static final String MSO_DME2_CLIENT_TIMEOUT = "mso.dme2.client.timeout";
+	
+	/** The Constant MSO_DME2_CLIENT_READ_TIMEOUT. */
+	public static final String MSO_DME2_CLIENT_READ_TIMEOUT = "mso.dme2.client.read.timeout";
+	
+	/** The Constant MSO_SERVER_URL_DEFAULT. */
+	public static final String MSO_SERVER_URL_DEFAULT= "";
+	
+	/** The Constant MSO_POLLING_INTERVAL_MSECS. */
+	// number of msecs to wait between polling requests
+	public static final String MSO_POLLING_INTERVAL_MSECS = "mso.polling.interval.msecs";
+
+	/** The Constant MSO_POLLING_INTERVAL_MSECS_DEFAULT. */
+	public static final String MSO_POLLING_INTERVAL_MSECS_DEFAULT = "60000";
+	
+	/** The Constant MSO_DME2_ENABLED. */
+	public static final String MSO_DME2_ENABLED = "mso.dme2.enabled";
+	
+	/** The Constant MSO_MAX_POLLS. */
+	public static final String MSO_MAX_POLLS = "mso.max.polls";
+	
+	/** The Constant MSO_MAX_POLLS_DEFAULT. */
+	public static final String MSO_MAX_POLLS_DEFAULT = "10"; //10
+	
+	/** The Constant MSO_USER_NAME. */
+	public static final String MSO_USER_NAME = "mso.user.name"; //m03346
+	
+	/** The Constant MSO_PASSWORD. */
+	public static final String MSO_PASSWORD = "mso.password.x";
+	
+	/** The Constant MSO_REST_API_SVC_INSTANCE. */
+	public static final String MSO_REST_API_SVC_INSTANCE = "mso.restapi.svc.instance"; // /serviceInstances/v2
+	
+	/** The Constant MSO_REST_API_VNF_INSTANCE. */
+	public static final String MSO_REST_API_VNF_INSTANCE = "mso.restapi.vnf.instance"; // /serviceInstances/v2/{service_instance_id}/vnfs
+	
+	/** The Constant MSO_REST_API_VNF_CHANGE_MANAGEMENT_INSTANCE. */
+	public static final String MSO_REST_API_VNF_CHANGE_MANAGEMENT_INSTANCE = "mso.restapi.vnf.changemanagement.instance"; // /serviceInstances/v2/{service_instance_id}/vnfs/{request_type}
+	
+	/** The Constant MSO_REST_API_NETWORK_INSTANCE. */
+	public static final String MSO_REST_API_NETWORK_INSTANCE = "mso.restapi.network.instance"; // /serviceInstances/v2/{serviceInstanceId}/networks
+	
+	/** The Constant MSO_REST_API_GET_ORC_REQ. */
+	public static final String MSO_REST_API_GET_ORC_REQ = "mso.restapi.get.orc.req";
+	
+	/** The Constant MSO_REST_API_GET_ORC_REQS. */
+	public static final String MSO_REST_API_GET_ORC_REQS = "mso.restapi.get.orc.reqs";
+
+	/** The Constant MSO_REST_API_GET_MAN_TASK. */
+	public static final String MSO_REST_API_GET_MAN_TASKS = "mso.restapi.get.man.tasks";
+
+	/** The Constant MSO_REST_API_VF_MODULE_INSTANCE. */
+	public static final String MSO_REST_API_VF_MODULE_INSTANCE = "mso.restapi.vf.module.instance";
+
+	/** The Constant MSO_REST_API_VOLUME_GROUP_INSTANCE. */
+	public static final String MSO_REST_API_VOLUME_GROUP_INSTANCE = "mso.restapi.volume.group.instance"; //serviceInstances/v2/{serviceInstanceId}/volumeGroups
+
+	/** The Constant MSO_REST_API_CONFIGURATION_INSTANCE. */
+	public static final String MSO_REST_API_CONFIGURATIONS = "mso.restapi.configurations"; //serviceInstances/v5/{serviceInstanceId}/configurations/
+	public static final String MSO_REST_API_CONFIGURATION_INSTANCE = "mso.restapi.configuration.instance"; //serviceInstances/v5/{serviceInstanceId}/configurations/{configurationId}
+
+	/** The Constant MSO_REST_API_OPERATIONAL_ENVIRONMENT */
+	public static final String MSO_REST_API_OPERATIONAL_ENVIRONMENT_ACTIVATE = "mso.restapi.operationalEnvironment.activate";
+	public static final String MSO_REST_API_OPERATIONAL_ENVIRONMENT_DEACTIVATE = "mso.restapi.operationalEnvironment.deactivate";
+
+	/** The Constant MSO_REST_API_OPERATIONAL_ENVIRONMENT_CREATE */
+	public static final String MSO_REST_API_OPERATIONAL_ENVIRONMENT_CREATE = "mso.restapi.operationalEnvironment.create";
+
+	/** The Constant MSO_REST_API_CLOUD_RESOURCES_REQUEST_STATUS */
+	public static final String MSO_REST_API_CLOUD_RESOURCES_REQUEST_STATUS = "mso.restapi.operationalEnvironment.cloudResourcesRequests.status";
+
+	/** The logger. */
+	public EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(MsoProperties.class);
+	
+	/** The Constant dateFormat. */
+	final static DateFormat dateFormat = new SimpleDateFormat("HH:mm:ss:SSSS");
+	
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/mso/MsoResponseWrapper.java b/vid-app-common/src/main/java/org/onap/vid/mso/MsoResponseWrapper.java
new file mode 100644
index 0000000..b890114
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/mso/MsoResponseWrapper.java
@@ -0,0 +1,129 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * VID
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.vid.mso;
+
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonPropertyOrder;
+import org.apache.commons.lang.builder.ToStringBuilder;
+
+import javax.ws.rs.core.Response;
+
+/**
+ * This wrapper encapsulates the MSO response in the format expected by the pages.
+ */
+@JsonInclude(JsonInclude.Include.NON_NULL)
+@JsonPropertyOrder({
+	    "status",
+	    "entity"
+})
+
+public class MsoResponseWrapper implements MsoResponseWrapperInterface {
+
+
+    public MsoResponseWrapper() {
+    }
+
+    public MsoResponseWrapper(Response response) {
+        setEntity(response.readEntity(String.class));
+        setStatus(response.getStatus());
+    }
+
+
+    /** The status. */
+	@JsonProperty("status")
+	private int status;
+	
+	/** The entity. */
+	@JsonProperty("entity")
+	private String entity;
+
+	/**
+	 * Gets the entity.
+	 *
+	 * @return the entity
+	 */
+	@Override
+	@JsonProperty("entity")
+    public String getEntity() {
+        return entity;
+    }
+
+	/**
+	 * Gets the status.
+	 *
+	 * @return the status
+	 */
+	@Override
+	@JsonProperty("status")
+    public int getStatus() {
+        return status;
+    }
+	
+	/**
+	 * Sets the status.
+	 *
+	 * @param v the new status
+	 */
+	@JsonProperty("status")
+    public void setStatus(int v) {
+        this.status = v;
+    }
+	
+	/**
+	 * Sets the entity.
+	 *
+	 * @param v the new entity
+	 */
+	@JsonProperty("entity")
+    public void setEntity(String v) {
+        this.entity = v;
+    }
+    
+    /* (non-Javadoc)
+     * @see java.lang.Object#toString()
+     */
+    @Override
+    public String toString() {
+        return ToStringBuilder.reflectionToString(this);
+    }
+    
+    /**
+     * Gets the response.
+     *
+     * @return the response
+     */
+    @org.codehaus.jackson.annotate.JsonIgnore
+    @com.fasterxml.jackson.annotation.JsonIgnore
+    public String getResponse () {
+    	
+    	StringBuilder b = new StringBuilder ("{ \"status\": ");
+        b.append(getStatus()).append(", \"entity\": " );
+        if (this.getEntity() == null || this.getEntity().isEmpty()) {
+        	b.append("\"\"");
+		} else {
+			b.append(this.getEntity());
+		}
+        b.append("}");
+        return (b.toString());
+    }
+    
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/mso/MsoResponseWrapper2.java b/vid-app-common/src/main/java/org/onap/vid/mso/MsoResponseWrapper2.java
new file mode 100644
index 0000000..5a73a04
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/mso/MsoResponseWrapper2.java
@@ -0,0 +1,60 @@
+package org.onap.vid.mso;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonPropertyOrder;
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.databind.ObjectMapper;
+
+@JsonPropertyOrder({
+	    "status",
+	    "entity"
+})
+
+/*
+This is a brother of MsoResponseWrapper. I (Ittay) think it's better.
+It is generic, immutable, and has some knowledge about RestObject.
+The serialized "entity" field may be either String or nested object.
+ */
+public class MsoResponseWrapper2<T> implements MsoResponseWrapperInterface {
+
+    final static ObjectMapper objectMapper = new ObjectMapper();
+
+	private final int status;
+	private final T entity;
+    private final String raw;
+
+    public MsoResponseWrapper2(RestObject<T> msoResponse) {
+        this.status = msoResponse.getStatusCode();
+        this.entity = msoResponse.get();
+        this.raw = msoResponse.getRaw();
+    }
+
+    public MsoResponseWrapper2(
+            @JsonProperty(value = "status", required = true) int status,
+            @JsonProperty(value = "entity", required = true) T entity) {
+        this.status = status;
+        this.entity = entity;
+        this.raw = null;
+    }
+
+    public int getStatus() {
+		return status;
+	}
+
+    @Override
+    @org.codehaus.jackson.annotate.JsonIgnore
+    @com.fasterxml.jackson.annotation.JsonIgnore
+    public String getResponse() {
+        try {
+            return objectMapper.writeValueAsString(this);
+        } catch (JsonProcessingException e) {
+            return getEntity() != null ? getEntity().toString() : null;
+        }
+    }
+
+    @JsonProperty
+	public Object getEntity() {
+		return entity != null ? entity : raw;
+	}
+
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/mso/MsoResponseWrapperInterface.java b/vid-app-common/src/main/java/org/onap/vid/mso/MsoResponseWrapperInterface.java
new file mode 100644
index 0000000..ad251bd
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/mso/MsoResponseWrapperInterface.java
@@ -0,0 +1,15 @@
+package org.onap.vid.mso;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+public interface MsoResponseWrapperInterface {
+    @JsonProperty("entity")
+    Object getEntity();
+
+    @JsonProperty("status")
+    int getStatus();
+
+    @org.codehaus.jackson.annotate.JsonIgnore
+    @com.fasterxml.jackson.annotation.JsonIgnore
+    String getResponse();
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/mso/MsoUtil.java b/vid-app-common/src/main/java/org/onap/vid/mso/MsoUtil.java
new file mode 100644
index 0000000..eae705a
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/mso/MsoUtil.java
@@ -0,0 +1,126 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * VID
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.vid.mso;
+
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import org.glassfish.jersey.client.ClientResponse;
+import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
+
+import java.text.DateFormat;
+import java.text.SimpleDateFormat;
+
+import static org.onap.vid.utils.Logging.getMethodName;
+
+/**
+ * The Class MsoUtil.
+ */
+public class MsoUtil {
+	
+	/** The logger. */
+	private static final EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(MsoUtil.class);
+	
+	/** The Constant dateFormat. */
+	final static DateFormat dateFormat = new SimpleDateFormat("HH:mm:ss:SSSS");
+	
+	/**
+	 * Wrap response.
+	 *
+	 * @param body the body
+	 * @param statusCode the status code
+	 * @return the mso response wrapper
+	 */
+	public static MsoResponseWrapper wrapResponse ( String body, int statusCode ) {
+		
+		MsoResponseWrapper w = new MsoResponseWrapper();
+		w.setStatus (statusCode);
+		w.setEntity(body);
+		
+		return w;
+	}
+
+	/**
+	 * Wrap response.
+	 *
+	 * @param cres the cres
+	 * @return the mso response wrapper
+	 */
+	public static MsoResponseWrapper wrapResponse (ClientResponse cres) {	
+		String resp_str = "";
+		if ( cres != null ) {
+			resp_str = cres.readEntity(String.class);
+		}
+		int statuscode = cres.getStatus();
+		MsoResponseWrapper w = MsoUtil.wrapResponse ( resp_str, statuscode );
+		return (w);
+	}
+	
+	/**
+	 * Wrap response.
+	 *
+	 * @param rs the rs
+	 * @return the mso response wrapper
+	 */
+	public static MsoResponseWrapper wrapResponse (RestObject<String> rs) {
+		String resp_str = null;
+		int status = 0;
+		if ( rs != null ) {
+			resp_str = rs.get() != null ? rs.get() : rs.getRaw();
+			status = rs.getStatusCode();
+		}
+		MsoResponseWrapper w = MsoUtil.wrapResponse ( resp_str, status );
+		return (w);
+	}	
+	
+	/**
+	 * Convert pojo to string.
+	 *
+	 * @param <T> the generic type
+	 * @param t the t
+	 * @return the string
+	 * @throws JsonProcessingException the json processing exception
+	 */
+	public static <T> String convertPojoToString ( T t ) {
+		
+		String methodName = "convertPojoToString";
+		ObjectMapper mapper = new ObjectMapper();
+		String r_json_str = "";
+	    if ( t != null ) {
+		    try {
+		    	r_json_str = mapper.writeValueAsString(t);
+		    }
+		    catch ( com.fasterxml.jackson.core.JsonProcessingException j ) {
+		    	logger.debug(EELFLoggerDelegate.debugLogger,getMethodName() + " Unable to parse object of type " + t.getClass().getName() + " as json", j);
+		    }
+	    }
+	    return (r_json_str);
+	}
+	
+	/**
+	 * The main method.
+	 *
+	 * @param args the arguments
+	 */
+	public static void main(String[] args) {
+		// TODO Auto-generated method stub
+
+	}
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/mso/RestMsoImplementation.java b/vid-app-common/src/main/java/org/onap/vid/mso/RestMsoImplementation.java
new file mode 100644
index 0000000..8cee23b
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/mso/RestMsoImplementation.java
@@ -0,0 +1,380 @@
+package org.onap.vid.mso;
+
+import com.att.eelf.configuration.EELFLogger;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import org.apache.commons.codec.binary.Base64;
+import org.eclipse.jetty.util.security.Password;
+import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
+import org.openecomp.portalsdk.core.util.SystemProperties;
+import org.onap.vid.client.HttpBasicClient;
+import org.onap.vid.client.HttpsBasicClient;
+import org.onap.vid.mso.rest.RequestDetails;
+import org.onap.vid.mso.rest.RestInterface;
+import org.onap.vid.utils.Logging;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.HttpMethod;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.ws.rs.client.Client;
+import javax.ws.rs.client.Entity;
+import javax.ws.rs.client.Invocation;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.MultivaluedHashMap;
+import javax.ws.rs.core.Response;
+import java.text.DateFormat;
+import java.text.SimpleDateFormat;
+import java.util.Collections;
+import java.util.Date;
+
+import static org.onap.vid.utils.Logging.*;
+
+/**
+ * Created by pickjonathan on 26/06/2017.
+ */
+public class RestMsoImplementation implements RestInterface {
+
+    /**
+     * The logger.
+     */
+    EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(RestMsoImplementation.class);
+    final private EELFLogger outgoingRequestsLogger = Logging.getRequestsLogger("mso");
+
+    /**
+     * The Constant dateFormat.
+     */
+    final static DateFormat dateFormat = new SimpleDateFormat("HH:mm:ss:SSSS");
+
+    /** The client. */
+    private static Client client = null;
+
+    /** The common headers. */
+    //private MultivaluedHashMap<String, Object> commonHeaders;
+    /**
+     * Instantiates a new mso rest interface.
+     */
+
+    @SuppressWarnings("Duplicates")
+    @Override
+    public MultivaluedHashMap<String, Object> initMsoClient()
+    {
+        final String methodname = "initRestClient()";
+
+        final String username = SystemProperties.getProperty(MsoProperties.MSO_USER_NAME);
+        final String password = SystemProperties.getProperty(MsoProperties.MSO_PASSWORD);
+        final String mso_url = SystemProperties.getProperty(MsoProperties.MSO_SERVER_URL);
+        final String decrypted_password = Password.deobfuscate(password);
+
+        String authString = username + ":" + decrypted_password;
+
+        byte[] authEncBytes = Base64.encodeBase64(authString.getBytes());
+        String authStringEnc = new String(authEncBytes);
+
+        MultivaluedHashMap<String, Object> commonHeaders = new MultivaluedHashMap();
+        commonHeaders.put("Authorization",  Collections.singletonList(("Basic " + authStringEnc)));
+        commonHeaders.put(requestIdHeaderKey, Collections.singletonList(getHttpServletRequest().getHeader(requestIdHeaderKey)));
+    	//Pass calling application identifier to SO
+  		commonHeaders.put("X-FromAppId", Collections.singletonList(SystemProperties.getProperty(SystemProperties.APP_DISPLAY_NAME)));
+
+        boolean use_ssl = true;
+        if ( (mso_url != null) && ( !(mso_url.isEmpty()) ) ) {
+            if ( mso_url.startsWith("https")) {
+                use_ssl = true;
+            }
+            else {
+                use_ssl = false;
+            }
+        }
+        if (client == null) {
+
+            try {
+                if ( use_ssl ) {
+                    //logger.info(EELFLoggerDelegate.errorLogger, dateFormat.format(new Date()) +  methodname + " getting HttpsBasicClient with username=" + username
+                    //		+ " password=" + password);
+                    client = HttpsBasicClient.getClient();
+                }
+                else {
+                    //logger.info(EELFLoggerDelegate.errorLogger, dateFormat.format(new Date()) +  methodname + " getting HttpsBasicClient with username=" + username
+                    //		+ " password=" + password);
+                    client = HttpBasicClient.getClient();
+                }
+            } catch (Exception e) {
+                logger.info(EELFLoggerDelegate.errorLogger, dateFormat.format(new Date()) +  methodname + " Unable to get the SSL client");
+            }
+        }
+
+        return commonHeaders;
+    }
+
+    public <T> void  Get (T t, String sourceId, String path, RestObject<T> restObject ) throws Exception {
+        String methodName = "Get";
+
+        logger.debug(EELFLoggerDelegate.debugLogger, methodName + " start");
+
+        String url="";
+        restObject.set(t);
+
+        url = SystemProperties.getProperty(MsoProperties.MSO_SERVER_URL) + path;
+
+        MultivaluedHashMap<String, Object> commonHeaders = initMsoClient();
+        Logging.logRequest(outgoingRequestsLogger, HttpMethod.GET, url);
+        final Response cres = client.target(url)
+                .request()
+                .accept("application/json")
+                .headers(commonHeaders)
+                .get();
+        Logging.logResponse(outgoingRequestsLogger, HttpMethod.GET, url, cres);
+        int status = cres.getStatus();
+        restObject.setStatusCode (status);
+
+        if (status == 200 || status == 202) {
+            t = (T) cres.readEntity(t.getClass());
+            restObject.set(t);
+            logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + methodName + " REST api was successfull!");
+
+        } else {
+            throw new Exception(methodName + " with status="+ status + ", url= " + url );
+        }
+
+        logger.debug(EELFLoggerDelegate.debugLogger,methodName + " received status=" + status );
+
+        return;
+    }
+
+    public <T> RestObject<T> GetForObject(String sourceID, String path, Class<T> clazz) throws Exception {
+        final String methodName = getMethodName();
+        logger.debug(EELFLoggerDelegate.debugLogger, "start {}->{}({}, {}, {})", getMethodCallerName(), methodName, sourceID, path, clazz);
+
+        String url = SystemProperties.getProperty(MsoProperties.MSO_SERVER_URL) + path;
+        logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " +  methodName + " sending request to url= " + url);
+
+        MultivaluedHashMap<String, Object> commonHeaders = initMsoClient();
+        Logging.logRequest(outgoingRequestsLogger, HttpMethod.GET, url);
+        final Response cres = client.target(url)
+                .request()
+                .accept("application/json")
+                .headers(commonHeaders)
+                .get();
+        Logging.logResponse(outgoingRequestsLogger, HttpMethod.GET, url, cres);
+        final RestObject<T> restObject = cresToRestObject(cres, clazz);
+        int status = cres.getStatus();
+
+        if (status == 200 || status == 202) {
+            logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + methodName + " REST api was successfull!");
+        } else {
+            logger.debug(EELFLoggerDelegate.debugLogger,dateFormat.format(new Date()) + "<== " + methodName + " with status="+status+", url="+url);
+        }
+
+        logger.debug(EELFLoggerDelegate.debugLogger,methodName + " received status=" + status );
+
+        return restObject;
+    }
+
+    @Override
+    public <T> void Delete(T t, RequestDetails r, String sourceID, String path, RestObject<T> restObject) {
+
+        String methodName = "Delete";
+        String url="";
+        Response cres = null;
+
+        logger.debug(EELFLoggerDelegate.debugLogger,dateFormat.format(new Date()) + "<== " +  methodName + " start");
+
+        try {
+            MultivaluedHashMap<String, Object> commonHeaders = initMsoClient();
+
+            url = SystemProperties.getProperty(MsoProperties.MSO_SERVER_URL) + path;
+            Logging.logRequest(outgoingRequestsLogger, HttpMethod.DELETE, url, r);
+            cres = client.target(url)
+                    .request()
+                    .accept("application/json")
+                    .headers(commonHeaders)
+                    //.entity(r)
+                    .build("DELETE", Entity.entity(r, MediaType.APPLICATION_JSON)).invoke();
+            Logging.logResponse(outgoingRequestsLogger, HttpMethod.DELETE, url, cres);
+            int status = cres.getStatus();
+            restObject.setStatusCode (status);
+
+            if (status == 404) { // resource not found
+                String msg = "Resource does not exist...: " + cres.getStatus();
+                logger.debug(EELFLoggerDelegate.debugLogger,dateFormat.format(new Date()) + "<== " + msg);
+            } else if (status == 200  || status == 204){
+                logger.debug(EELFLoggerDelegate.debugLogger,dateFormat.format(new Date()) + "<== " + "Resource " + url + " deleted");
+            } else if (status == 202) {
+                String msg = "Delete in progress: " + status;
+                logger.debug(EELFLoggerDelegate.debugLogger,dateFormat.format(new Date()) + "<== " + msg);
+            }
+            else {
+                String msg = "Deleting Resource failed: " + status;
+                logger.debug(EELFLoggerDelegate.debugLogger,dateFormat.format(new Date()) + "<== " + msg);
+            }
+
+            try {
+                t = (T) cres.readEntity(t.getClass());
+                restObject.set(t);
+            }
+            catch ( Exception e ) {
+                logger.debug(EELFLoggerDelegate.debugLogger,dateFormat.format(new Date()) + "<== " + methodName + " No response entity, this is probably ok, e="
+                        + e.getMessage());
+            }
+
+        }
+        catch (Exception e)
+        {
+            logger.debug(EELFLoggerDelegate.debugLogger,dateFormat.format(new Date()) + "<== " + methodName + " with url="+url+ ", Exception: " + e.toString());
+            throw e;
+
+        }
+    }
+
+    public <T> RestObject<T> PostForObject(Object requestDetails, String sourceID, String path, Class<T> clazz) throws RuntimeException {
+        logger.debug(EELFLoggerDelegate.debugLogger, "start {}->{}({}, {}, {}, {})", getMethodCallerName(), getMethodName(), requestDetails, sourceID, path, clazz);
+        RestObject<T> restObject = new RestObject<>();
+        Post(clazz, requestDetails, sourceID, path, restObject);
+        return restObject;
+    }
+
+    @Override
+    public <T> void Post(T t, Object r, String sourceID, String path, RestObject<T> restObject) throws RuntimeException {
+        logger.debug(EELFLoggerDelegate.debugLogger, "start {}->{}({}, {}, {}, {})", getMethodCallerName(), getMethodName(), t.getClass(), r, sourceID, path);
+        Post(t.getClass(), r, sourceID, path, restObject);
+    }
+
+    public Invocation.Builder prepareClient(String path, String methodName) {
+        MultivaluedHashMap<String, Object> commonHeaders = initMsoClient();
+
+        String url = SystemProperties.getProperty(MsoProperties.MSO_SERVER_URL) + path;
+        logger.debug(EELFLoggerDelegate.debugLogger,dateFormat.format(new Date()) + "<== " +  methodName + " sending request to url= " + url);
+        // Change the content length
+        return client.target(url)
+                .request()
+                .accept("application/json")
+                .headers(commonHeaders);
+    }
+
+
+
+    public <T> void Post(Class<?> tClass, Object requestDetails, String sourceID, String path, RestObject<T> restObject) throws RuntimeException {
+        String methodName = "Post";
+        String url="";
+
+        try {
+
+            MultivaluedHashMap<String, Object> commonHeaders = initMsoClient();
+
+            url = SystemProperties.getProperty(MsoProperties.MSO_SERVER_URL) + path;
+            Logging.logRequest(outgoingRequestsLogger, HttpMethod.POST, url, requestDetails);
+            // Change the content length
+            final Response cres = client.target(url)
+                    .request()
+                    .accept("application/json")
+                    .headers(commonHeaders)
+                    .post(Entity.entity(requestDetails, MediaType.APPLICATION_JSON));
+            Logging.logResponse(outgoingRequestsLogger, HttpMethod.POST, url, cres);
+
+            final RestObject<T> cresToRestObject = cresToRestObject(cres, tClass);
+            restObject.set(cresToRestObject.get());
+            restObject.setStatusCode(cresToRestObject.getStatusCode());
+            restObject.setRaw(cresToRestObject.getRaw());
+
+            int status = cres.getStatus();
+            restObject.setStatusCode (status);
+
+            if ( status >= 200 && status <= 299 ) {
+                logger.info(EELFLoggerDelegate.errorLogger, dateFormat.format(new Date()) + "<== " + methodName + " REST api POST was successful!");
+                logger.debug(EELFLoggerDelegate.debugLogger,dateFormat.format(new Date()) + "<== " + methodName + " REST api POST was successful!");
+
+            } else {
+                logger.debug(EELFLoggerDelegate.debugLogger,dateFormat.format(new Date()) + "<== " + methodName + " with status="+status+", url="+url);
+            }
+
+        } catch (Exception e)
+        {
+            logger.debug(EELFLoggerDelegate.debugLogger,dateFormat.format(new Date()) + "<== " + methodName + " with url="+url+ ", Exception: " + e.toString());
+            throw e;
+
+        }
+
+        logger.debug(EELFLoggerDelegate.debugLogger, "end {}() => ({}){}", getMethodName(), tClass, restObject);
+    }
+
+    private <T> RestObject<T> cresToRestObject(Response cres, Class<?> tClass) {
+        RestObject<T> restObject = new RestObject<>();
+
+        String rawEntity = null;
+        try {
+            cres.bufferEntity();
+            rawEntity = cres.readEntity(String.class);
+            T t = (T) new ObjectMapper().readValue(rawEntity, tClass);
+            restObject.set(t);
+        }
+        catch ( Exception e ) {
+            try {
+                restObject.setRaw(rawEntity);
+                logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + getMethodCallerName() + " Error reading response entity as " + tClass + ": , e="
+                        + e.getMessage() + ", Entity=" + rawEntity);
+            } catch (Exception e2) {
+                logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + getMethodCallerName() + " No response entity, this is probably ok, e="
+                        + e.getMessage());
+            }
+        }
+
+        int status = cres.getStatus();
+        restObject.setStatusCode (status);
+
+        return restObject;
+
+    }
+
+    @Override
+    public <T> void Put(T t, org.onap.vid.changeManagement.RequestDetailsWrapper r, String sourceID, String path, RestObject<T> restObject) throws Exception {
+
+        String methodName = "Put";
+        String url="";
+
+        logger.debug(EELFLoggerDelegate.debugLogger,dateFormat.format(new Date()) + "<== " +  methodName + " start");
+
+//	        logRequest (r);
+        try {
+
+            MultivaluedHashMap<String, Object> commonHeaders = initMsoClient();
+
+            url = SystemProperties.getProperty(MsoProperties.MSO_SERVER_URL) + path;
+            Logging.logRequest(outgoingRequestsLogger, HttpMethod.PUT, url, r);
+            // Change the content length
+            final Response cres = client.target(url)
+                    .request()
+                    .accept("application/json")
+                    .headers(commonHeaders)
+                    //.header("content-length", 201)
+                    //.header("X-FromAppId",  sourceID)
+                    .put(Entity.entity(r, MediaType.APPLICATION_JSON));
+
+            Logging.logResponse(outgoingRequestsLogger, HttpMethod.PUT, url, cres);
+
+            try {
+                t = (T) cres.readEntity(t.getClass());
+                restObject.set(t);
+            }
+            catch ( Exception e ) {
+                logger.debug(EELFLoggerDelegate.debugLogger,dateFormat.format(new Date()) + "<== " + methodName + " No response entity, this is probably ok, e="
+                        + e.getMessage());
+            }
+
+            int status = cres.getStatus();
+            restObject.setStatusCode (status);
+
+            if ( status >= 200 && status <= 299 ) {
+                logger.info(EELFLoggerDelegate.errorLogger, dateFormat.format(new Date()) + "<== " + methodName + " REST api POST was successful!");
+                logger.debug(EELFLoggerDelegate.debugLogger,dateFormat.format(new Date()) + "<== " + methodName + " REST api POST was successful!");
+
+            } else {
+                logger.debug(EELFLoggerDelegate.debugLogger,dateFormat.format(new Date()) + "<== " + methodName + " with status="+status+", url="+url);
+            }
+
+        } catch (Exception e)
+        {
+            logger.debug(EELFLoggerDelegate.debugLogger,dateFormat.format(new Date()) + "<== " + methodName + " with url="+url+ ", Exception: " + e.toString());
+            throw e;
+
+        }
+    }
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/mso/RestObject.java b/vid-app-common/src/main/java/org/onap/vid/mso/RestObject.java
new file mode 100644
index 0000000..4e2bea0
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/mso/RestObject.java
@@ -0,0 +1,131 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * VID
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.vid.mso;
+
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.google.common.base.MoreObjects;
+import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
+
+import javax.ws.rs.core.Response;
+import java.text.DateFormat;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+
+import static org.onap.vid.utils.Logging.getMethodCallerName;
+
+/**
+ * The Class RestObject.
+ *
+ * @param <T> the generic type
+ */
+public class RestObject<T> {
+
+    final static DateFormat dateFormat = new SimpleDateFormat("HH:mm:ss:SSSS");
+
+    final static ObjectMapper objectMapper = new ObjectMapper();
+
+	/**
+	 * Generic version of the RestObject class.
+	 *
+	 */
+    // T stands for "Type"
+    private T t;
+    
+    // The string source of t, if available
+    private String rawT;
+
+    /** The status code. */
+    private int statusCode= 0;
+
+    public RestObject() {
+    }
+
+    public RestObject(Response cres, Class<?> tClass, EELFLoggerDelegate logger) {
+
+        String rawEntity = null;
+        try {
+            cres.bufferEntity();
+            rawEntity = cres.readEntity(String.class);
+            T t = (T) objectMapper.readValue(rawEntity, tClass);
+            this.set(t);
+        }
+        catch ( Exception e ) {
+            try {
+                this.setRaw(rawEntity);
+                logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + getMethodCallerName() + " Error reading response entity as " + tClass + ": , e="
+                        + e.getMessage() + ", Entity=" + rawEntity);
+            } catch (Exception e2) {
+                logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + getMethodCallerName() + " No response entity, this is probably ok, e="
+                        + e.getMessage());
+            }
+        }
+
+        int status = cres.getStatus();
+        this.setStatusCode (status);
+    }
+
+
+    /**
+     * Sets the.
+     *
+     * @param t the t
+     */
+    public void set(T t) { this.t = t; }
+    
+    /**
+     * Gets the.
+     *
+     * @return the t
+     */
+    public T get() { return t; }
+	
+    /**
+     * Sets the status code.
+     *
+     * @param v the new status code
+     */
+    public void setStatusCode(int v) { this.statusCode = v; }
+    
+    /**
+     * Gets the status code.
+     *
+     * @return the status code
+     */
+    public int getStatusCode() { return this.statusCode; }
+
+    public String getRaw() {
+        return rawT;
+    }
+
+    public void setRaw(String rawT) {
+        this.rawT = rawT;
+    }
+
+    @Override
+    public String toString() {
+        return MoreObjects.toStringHelper(this)
+                .add("t", t)
+                .add("rawT", rawT)
+                .add("statusCode", statusCode)
+                .toString();
+    }
+}
+
diff --git a/vid-app-common/src/main/java/org/onap/vid/mso/model/OperationalEnvironmentActivateInfo.java b/vid-app-common/src/main/java/org/onap/vid/mso/model/OperationalEnvironmentActivateInfo.java
new file mode 100644
index 0000000..bca643a
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/mso/model/OperationalEnvironmentActivateInfo.java
@@ -0,0 +1,33 @@
+package org.onap.vid.mso.model;
+
+import com.google.common.base.MoreObjects;
+import org.onap.vid.controller.OperationalEnvironmentController;
+
+public class OperationalEnvironmentActivateInfo extends OperationalEnvironmentController.OperationalEnvironmentActivateBody {
+    private final String userId;
+    private final String operationalEnvironmentId;
+
+    public OperationalEnvironmentActivateInfo(OperationalEnvironmentController.OperationalEnvironmentActivateBody o, String userId, String operationalEnvironmentId) {
+        super(o.getRelatedInstanceId(), o.getRelatedInstanceName(), o.getWorkloadContext(), o.getManifest());
+
+        this.userId = userId;
+        this.operationalEnvironmentId = operationalEnvironmentId;
+    }
+
+    public String getUserId() {
+        return userId;
+    }
+
+    public String getOperationalEnvironmentId() {
+        return operationalEnvironmentId;
+    }
+
+    @Override
+    public String toString() {
+        return MoreObjects.toStringHelper(this)
+                .add("operationalEnvironmentId", operationalEnvironmentId)
+                .add("userId", userId)
+                .add("super", super.toString())
+                .toString();
+    }
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/mso/model/OperationalEnvironmentDeactivateInfo.java b/vid-app-common/src/main/java/org/onap/vid/mso/model/OperationalEnvironmentDeactivateInfo.java
new file mode 100644
index 0000000..1a756ed
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/mso/model/OperationalEnvironmentDeactivateInfo.java
@@ -0,0 +1,29 @@
+package org.onap.vid.mso.model;
+
+import com.google.common.base.MoreObjects;
+
+public class OperationalEnvironmentDeactivateInfo {
+    private final String userId;
+    private final String operationalEnvironmentId;
+
+    public OperationalEnvironmentDeactivateInfo(String userId, String operationalEnvironmentId) {
+        this.userId = userId;
+        this.operationalEnvironmentId = operationalEnvironmentId;
+    }
+
+    public String getUserId() {
+        return userId;
+    }
+
+    public String getOperationalEnvironmentId() {
+        return operationalEnvironmentId;
+    }
+
+    @Override
+    public String toString() {
+        return MoreObjects.toStringHelper(this)
+                .add("operationalEnvironmentId", operationalEnvironmentId)
+                .add("userId", userId)
+                .toString();
+    }
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/mso/rest/AsyncRequestStatus.java b/vid-app-common/src/main/java/org/onap/vid/mso/rest/AsyncRequestStatus.java
new file mode 100644
index 0000000..f47e16f
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/mso/rest/AsyncRequestStatus.java
@@ -0,0 +1,123 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * VID
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.vid.mso.rest;
+
+//import java.util.HashMap;
+//import java.util.Map;
+//import javax.annotation.Generated;
+
+import org.onap.vid.domain.mso.InstanceIds;
+import org.onap.vid.domain.mso.RequestStatus;
+//import com.fasterxml.jackson.annotation.JsonAnyGetter;
+//import com.fasterxml.jackson.annotation.JsonAnySetter;
+//import com.fasterxml.jackson.annotation.JsonCreator;
+//import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonProperty;
+//import com.fasterxml.jackson.annotation.JsonPropertyOrder;
+//import com.fasterxml.jackson.annotation.JsonValue;
+import org.apache.commons.lang.builder.EqualsBuilder;
+import org.apache.commons.lang.builder.HashCodeBuilder;
+import org.apache.commons.lang.builder.ToStringBuilder;
+
+
+/**
+ * request structure.
+ */
+@JsonInclude(JsonInclude.Include.NON_NULL)
+
+public class AsyncRequestStatus extends org.onap.vid.domain.mso.AsyncRequestStatus {
+
+    
+    /** The instance ids. */
+    private InstanceIds instanceIds;
+   
+    /** The request status. */
+    private RequestStatus requestStatus;
+
+    /* (non-Javadoc)
+     * @see org.openecomp.vid.domain.mso.AsyncRequestStatus#getInstanceIds()
+     */
+    public InstanceIds getInstanceIds() {
+        return instanceIds;
+    }
+
+    /**
+     * Sets the instance ids.
+     *
+     * @param instanceIds the new instance ids
+     */
+    public void setInstanceIds(InstanceIds instanceIds) {
+        this.instanceIds = instanceIds;
+    }
+
+    
+    /**
+     * (Required).
+     *
+     * @return     The requestStatus
+     */
+    @JsonProperty("requestStatus")
+    public RequestStatus getRequestStatus() {
+        return requestStatus;
+    }
+
+    /**
+     * (Required).
+     *
+     * @param requestStatus     The requestStatus
+     */
+    @JsonProperty("requestStatus")
+    public void setRequestStatus(RequestStatus requestStatus) {
+        this.requestStatus = requestStatus;
+    }
+    
+    /* (non-Javadoc)
+     * @see org.openecomp.vid.domain.mso.AsyncRequestStatus#toString()
+     */
+    @Override
+    public String toString() {
+        return ToStringBuilder.reflectionToString(this);
+    }
+
+    /* (non-Javadoc)
+     * @see org.openecomp.vid.domain.mso.AsyncRequestStatus#hashCode()
+     */
+    @Override
+    public int hashCode() {
+        return new HashCodeBuilder().append(getCorrelator()).append(getFinishTime()).append(instanceIds).append(getRequestId()).append(getRequestScope()).append(getRequestStatus()).append(getRequestType()).append(getStartTime()).append(getAdditionalProperties()).toHashCode();
+    }
+
+    /* (non-Javadoc)
+     * @see org.openecomp.vid.domain.mso.AsyncRequestStatus#equals(java.lang.Object)
+     */
+    @Override
+    public boolean equals(Object other) {
+        if (other == this) {
+            return true;
+        }
+        if ((other instanceof AsyncRequestStatus) == false) {
+            return false;
+        }
+        AsyncRequestStatus rhs = ((AsyncRequestStatus) other);
+        return new EqualsBuilder().append(getCorrelator(), rhs.getCorrelator()).append(getFinishTime(), rhs.getFinishTime()).append(instanceIds, rhs.instanceIds).append(getRequestId(), rhs.getRequestId()).append(getRequestScope(), rhs.getRequestScope()).append(getRequestStatus(), rhs.getRequestStatus()).append(getRequestType(), rhs.getRequestType()).append(getStartTime(), rhs.getStartTime()).append(getAdditionalProperties(), rhs.getAdditionalProperties()).isEquals();
+    }
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/mso/rest/MsoRestClientNew.java b/vid-app-common/src/main/java/org/onap/vid/mso/rest/MsoRestClientNew.java
new file mode 100644
index 0000000..9bb5403
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/mso/rest/MsoRestClientNew.java
@@ -0,0 +1,435 @@
+package org.onap.vid.mso.rest;
+
+import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
+import org.onap.vid.changeManagement.MsoRequestDetails;
+import org.onap.vid.changeManagement.RequestDetailsWrapper;
+import org.onap.vid.model.RequestReferencesContainer;
+import org.onap.vid.mso.*;
+
+import java.text.DateFormat;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+
+
+/**
+ * Created by pickjonathan on 21/06/2017.
+ */
+public class MsoRestClientNew extends RestMsoImplementation implements MsoInterface {
+
+    /**
+     * The Constant dateFormat.
+     */
+    final static DateFormat dateFormat = new SimpleDateFormat("HH:mm:ss:SSSS");
+    private final String ORIGINAL_REQUEST_ID = "originalRequestId";
+    /**
+     * The logger.
+     */
+    EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(MsoRestClientNew.class);
+
+    @Override
+    public MsoResponseWrapper createSvcInstance(RequestDetails requestDetails, String endpoint) throws Exception {
+        String methodName = "createSvcInstance ";
+        logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
+
+        return createInstance(requestDetails, endpoint);
+    }
+
+    @Override
+    public MsoResponseWrapper createVnf(RequestDetails requestDetails, String endpoint) throws Exception {
+
+        String methodName = "createVnf";
+        logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
+
+        return createInstance(requestDetails, endpoint);
+    }
+
+    @Override
+    public MsoResponseWrapper createNwInstance(RequestDetails requestDetails, String endpoint) throws Exception {
+
+        String methodName = "createNwInstance";
+        logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
+
+        return createInstance(requestDetails, endpoint);
+    }
+
+    @Override
+    public MsoResponseWrapper createVolumeGroupInstance(RequestDetails requestDetails, String endpoint) throws Exception {
+        String methodName = "createVolumeGroupInstance";
+        logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
+
+        return createInstance(requestDetails, endpoint);
+    }
+
+    @Override
+    public MsoResponseWrapper createVfModuleInstance(RequestDetails requestDetails, String endpoint) throws Exception {
+        String methodName = "createVfModuleInstance";
+        logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
+
+        return createInstance(requestDetails, endpoint);
+    }
+
+    @Override
+    public MsoResponseWrapper createConfigurationInstance(RequestDetails requestDetails, String endpoint) throws Exception {
+        String methodName = "createConfigurationInstance";
+        logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
+
+        return createInstance(requestDetails, endpoint);
+    }
+
+    @Override
+    public MsoResponseWrapper deleteSvcInstance(RequestDetails requestDetails, String endpoint) throws Exception {
+        String methodName = "deleteSvcInstance";
+        logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
+
+        return deleteInstance(requestDetails, endpoint);
+    }
+
+    @Override
+    public MsoResponseWrapper deleteVnf(RequestDetails requestDetails, String endpoint) throws Exception {
+        String methodName = "deleteVnf";
+        logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
+
+        return deleteInstance(requestDetails, endpoint);
+    }
+
+    @Override
+    public MsoResponseWrapper deleteVfModule(RequestDetails requestDetails, String endpoint) throws Exception {
+        String methodName = "deleteVfModule";
+        logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
+
+        return deleteInstance(requestDetails, endpoint);
+    }
+
+    @Override
+    public MsoResponseWrapper deleteVolumeGroupInstance(RequestDetails requestDetails, String endpoint) throws Exception {
+        String methodName = "deleteVolumeGroupInstance";
+        logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
+
+        return deleteInstance(requestDetails, endpoint);
+    }
+
+    @Override
+    public MsoResponseWrapper deleteNwInstance(RequestDetails requestDetails, String endpoint) throws Exception {
+        String methodName = "deleteNwInstance";
+        logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
+
+        return deleteInstance(requestDetails, endpoint);
+    }
+
+    @Override
+    public void getOrchestrationRequest(String t, String sourceId, String endpoint, RestObject restObject) throws Exception {
+        Get(t, sourceId, endpoint, restObject);
+    }
+
+    public void getManualTasks(String t, String sourceId, String endpoint, RestObject restObject) throws Exception {
+        Get(t, sourceId, endpoint, restObject);
+    }
+
+
+    public MsoResponseWrapper createInstance(RequestDetails request, String path) throws Exception {
+        String methodName = "createInstance";
+        logger.debug(dateFormat.format(new Date()) + "<== " + methodName + " start");
+
+        try {
+            RestObject<String> restObjStr = new RestObject<String>();
+
+            String str = new String();
+
+            restObjStr.set(str);
+
+            Post(str, request, "", path, restObjStr);
+            MsoResponseWrapper w = MsoUtil.wrapResponse(restObjStr);
+
+            return w;
+        } catch (Exception e) {
+            logger.error(EELFLoggerDelegate.errorLogger, dateFormat.format(new Date()) + "<== " + "." + methodName + e.toString());
+            logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + "." + methodName + e.toString());
+            throw e;
+        }
+    }
+
+
+    /**
+     * Delete instance.
+     *
+     * @param request the request
+     * @param path    the path
+     * @return the mso response wrapper
+     * @throws Exception the exception
+     */
+    public MsoResponseWrapper deleteInstance(RequestDetails request, String path) throws Exception {
+        String methodName = "deleteInstance";
+        logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
+
+        try {
+            logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " calling Delete, path =[" + path + "]");
+
+            RestObject<String> restObjStr = new RestObject<String>();
+            String str = new String();
+            restObjStr.set(str);
+            Delete(str, request, "", path, restObjStr);
+            MsoResponseWrapper w = MsoUtil.wrapResponse(restObjStr);
+
+            logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " w=" + w.getResponse());
+            return w;
+
+        } catch (Exception e) {
+            logger.error(EELFLoggerDelegate.errorLogger, dateFormat.format(new Date()) + "<== " + "." + methodName + e.toString());
+            logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + "." + methodName + e.toString());
+            throw e;
+        }
+
+    }
+
+    public MsoResponseWrapper getOrchestrationRequestsForDashboard(String t, String sourceId, String endpoint, RestObject restObject) throws Exception {
+        String methodName = "getOrchestrationRequestsForDashboard";
+        logger.debug(dateFormat.format(new Date()) + "<== " + methodName + " start");
+
+        try {
+            getOrchestrationRequest(t, sourceId, endpoint, restObject);
+            MsoResponseWrapper w = MsoUtil.wrapResponse(restObject);
+            logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " w=" + w.getResponse());
+
+            return w;
+
+        } catch (Exception e) {
+            logger.error(EELFLoggerDelegate.errorLogger, dateFormat.format(new Date()) + "<== " + "." + methodName + e.toString());
+            logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + "." + methodName + e.toString());
+            throw e;
+        }
+    }
+
+    public MsoResponseWrapper getManualTasksByRequestId(String t, String sourceId, String endpoint, RestObject restObject) throws Exception {
+        String methodName = "getManualTasksByRequestId";
+        logger.debug(dateFormat.format(new Date()) + "<== " + methodName + " start");
+
+        try {
+            getManualTasks(t, sourceId, endpoint, restObject);
+            MsoResponseWrapper w = MsoUtil.wrapResponse(restObject);
+            logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " w=" + w.getResponse());
+
+            return MsoUtil.wrapResponse(restObject);
+
+        } catch (Exception e) {
+            logger.error(EELFLoggerDelegate.errorLogger, dateFormat.format(new Date()) + "<== " + "." + methodName + e.toString());
+            logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + "." + methodName + e.toString());
+            throw e;
+        }
+    }
+
+
+    @Override
+    public MsoResponseWrapper completeManualTask(RequestDetails requestDetails, String t, String sourceId, String endpoint, RestObject restObject) throws Exception {
+        String methodName = "completeManualTask";
+        logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " calling Complete ");
+        try {
+
+            Post(t, requestDetails, sourceId, endpoint, restObject);
+            MsoResponseWrapper w = MsoUtil.wrapResponse(restObject);
+
+            logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " w=" + w.getResponse());
+            return w;
+
+        } catch (Exception e) {
+            logger.error(EELFLoggerDelegate.errorLogger, dateFormat.format(new Date()) + "<== " + "." + methodName + e.toString());
+            logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + "." + methodName + e.toString());
+            throw e;
+        }
+    }
+
+    @Override
+    public MsoResponseWrapper replaceVnf(org.onap.vid.changeManagement.RequestDetails requestDetails, String endpoint) throws Exception {
+        String methodName = "replaceVnf";
+        logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
+        return replaceInstance(requestDetails, endpoint);
+    }
+
+    @Override
+    public MsoResponseWrapper deleteConfiguration(RequestDetails requestDetails, String pmc_endpoint)
+            throws Exception {
+        String methodName = "deleteConfiguration";
+        logger.debug(EELFLoggerDelegate.debugLogger,
+                dateFormat.format(new Date()) + "<== " + methodName + " start");
+
+        return deleteInstance(requestDetails, pmc_endpoint);
+    }
+
+    @Override
+    public MsoResponseWrapper setConfigurationActiveStatus(RequestDetails request, String path) throws Exception {
+        String methodName = "setConfigurationActiveStatus";
+        logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
+
+        try {
+            logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " calling change configuration active status, path =[" + path + "]");
+
+            RestObject<String> restObjStr = new RestObject<String>();
+            String str = new String();
+            restObjStr.set(str);
+            Post(str, request, "", path, restObjStr);
+            MsoResponseWrapper msoResponseWrapperObject = MsoUtil.wrapResponse(restObjStr);
+
+            return msoResponseWrapperObject;
+        } catch (Exception e) {
+            logger.info(EELFLoggerDelegate.errorLogger, dateFormat.format(new Date()) + "<== " + "." + methodName + e.toString());
+            logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + "." + methodName + e.toString());
+            throw e;
+        }
+    }
+
+    @Override
+    public MsoResponseWrapper setPortOnConfigurationStatus(RequestDetails request, String path) throws Exception {
+        String methodName = "setPortOnConfigurationStatus";
+        logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
+
+        try {
+            logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " calling change port configuration status, path =[" + path + "]");
+
+            RestObject<String> restObjStr = new RestObject<String>();
+            String str = new String();
+            restObjStr.set(str);
+            Post(str, request, "", path, restObjStr);
+            MsoResponseWrapper msoResponseWrapperObject = MsoUtil.wrapResponse(restObjStr);
+
+            return msoResponseWrapperObject;
+        } catch (Exception e) {
+            logger.info(EELFLoggerDelegate.errorLogger, dateFormat.format(new Date()) + "<== " + "." + methodName + e.toString());
+            logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + "." + methodName + e.toString());
+            throw e;
+        }
+    }
+
+    @Override
+    public MsoResponseWrapperInterface changeManagementUpdate(RequestDetailsWrapper requestDetails, String endpoint) throws Exception {
+        RestObject<RequestReferencesContainer> msoResponse = PostForObject(requestDetails, "", endpoint, RequestReferencesContainer.class);
+        return new MsoResponseWrapper2<>(msoResponse);
+    }
+
+    public MsoResponseWrapper replaceInstance(org.onap.vid.changeManagement.RequestDetails request, String path) throws Exception {
+        String methodName = "replaceInstance";
+        logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
+
+        try {
+
+
+            logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " calling Replace VNF, path =[" + path + "]");
+            RestObject<String> restObjStr = new RestObject<String>();
+            String str = new String();
+            restObjStr.set(str);
+            RequestDetailsWrapper requestDetailsWrapper = new RequestDetailsWrapper();
+            requestDetailsWrapper.requestDetails = new MsoRequestDetails(request);
+
+            Post(str, requestDetailsWrapper, "", path, restObjStr);
+            MsoResponseWrapper msoResponseWrapperObject = MsoUtil.wrapResponse(restObjStr);
+            int status = msoResponseWrapperObject.getStatus();
+            if (status == 202) {
+                logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName +
+                        ",post succeeded, msoResponseWrapperObject response:" + msoResponseWrapperObject.getResponse());
+            } else {
+                logger.error(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName +
+                        ": post failed, msoResponseWrapperObject status" + status + ", response:" + msoResponseWrapperObject.getResponse());
+
+                // TODO
+            }
+            return msoResponseWrapperObject;
+
+        } catch (Exception e) {
+            logger.info(EELFLoggerDelegate.errorLogger, dateFormat.format(new Date()) + "<== " + "." + methodName + e.toString());
+            logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + "." + methodName + e.toString());
+            throw e;
+        }
+
+    }
+
+    @Override
+    public MsoResponseWrapper updateVnf(org.onap.vid.changeManagement.RequestDetails requestDetails, String endpoint) throws Exception {
+        String methodName = "updateVnf";
+        logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
+        RequestDetailsWrapper wrapper = new RequestDetailsWrapper();
+        wrapper.requestDetails = new MsoRequestDetails(requestDetails);
+        return updateInstance(requestDetails, endpoint);
+    }
+
+    public MsoResponseWrapper updateInstance(org.onap.vid.changeManagement.RequestDetails request, String path) throws Exception {
+        String methodName = "updateInstance";
+        logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
+
+        try {
+            logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " calling Delete, path =[" + path + "]");
+            RestObject<String> restObjStr = new RestObject<String>();
+            String str = new String();
+            restObjStr.set(str);
+            RequestDetailsWrapper requestDetailsWrapper = new RequestDetailsWrapper();
+            requestDetailsWrapper.requestDetails = new MsoRequestDetails(request);
+            Put(str, requestDetailsWrapper, "", path, restObjStr);
+            MsoResponseWrapper w = MsoUtil.wrapResponse(restObjStr);
+
+            logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " w=" + w.getResponse());
+            return w;
+
+        } catch (Exception e) {
+            logger.info(EELFLoggerDelegate.errorLogger, dateFormat.format(new Date()) + "<== " + "." + methodName + e.toString());
+            logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + "." + methodName + e.toString());
+            throw e;
+        }
+
+    }
+
+    public void setServiceInstanceStatus(RequestDetails requestDetails, String t, String sourceId, String endpoint, RestObject<String> restObject) throws Exception {
+        String methodName = "activateServiceInstance";
+        logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start ");
+        try {
+
+            Post(t, requestDetails, sourceId, endpoint, restObject);
+            MsoResponseWrapper w = MsoUtil.wrapResponse(restObject);
+
+            logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " w =" + w.getResponse());
+
+        } catch (Exception e) {
+            logger.error(EELFLoggerDelegate.errorLogger, dateFormat.format(new Date()) + "<== " + "." + methodName + e.toString());
+            logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + "." + methodName + e.toString());
+            throw e;
+        }
+    }
+
+    @Override
+    public MsoResponseWrapper removeRelationshipFromServiceInstance(RequestDetails requestDetails, String endpoint) throws Exception {
+        String methodName = "removeRelationshipFromServiceInstance";
+        logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
+
+        try {
+            logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " calling Remove relationship from service instance, path =[" + endpoint + "]");
+
+            RestObject<String> restObjStr = new RestObject<String>();
+            String str = "";
+            restObjStr.set(str);
+            Post(str, requestDetails, "", endpoint, restObjStr);
+
+            return MsoUtil.wrapResponse(restObjStr);
+        } catch (Exception e) {
+            logger.info(EELFLoggerDelegate.errorLogger, dateFormat.format(new Date()) + "<== " + "." + methodName + e.toString());
+            logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + "." + methodName + e.toString());
+            throw e;
+        }
+    }
+
+    @Override
+    public MsoResponseWrapper addRelationshipToServiceInstance(RequestDetails requestDetails, String addRelationshipsPath) throws Exception {
+        String methodName = "addRelationshipToServiceInstance";
+        logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
+
+        try {
+            logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " calling Add relationship to service instance, path =[" + addRelationshipsPath + "]");
+
+            RestObject<String> restObjStr = new RestObject<>();
+            restObjStr.set("");
+            Post("", requestDetails, "", addRelationshipsPath, restObjStr);
+
+            return MsoUtil.wrapResponse(restObjStr);
+        } catch (Exception e) {
+            logger.info(EELFLoggerDelegate.errorLogger, dateFormat.format(new Date()) + "<== " + "." + methodName + e.toString());
+            logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + "." + methodName + e.toString());
+            throw e;
+        }
+    }
+
+}
\ No newline at end of file
diff --git a/vid-app-common/src/main/java/org/onap/vid/mso/rest/OperationalEnvironment/OperationEnvironmentRequestDetails.java b/vid-app-common/src/main/java/org/onap/vid/mso/rest/OperationalEnvironment/OperationEnvironmentRequestDetails.java
new file mode 100644
index 0000000..2f6d233
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/mso/rest/OperationalEnvironment/OperationEnvironmentRequestDetails.java
@@ -0,0 +1,120 @@
+package org.onap.vid.mso.rest.OperationalEnvironment;
+
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonTypeInfo;
+import com.fasterxml.jackson.annotation.JsonTypeName;
+
+import java.util.List;
+
+public class OperationEnvironmentRequestDetails {
+    private final RequestInfo requestInfo;
+    private final List<RelatedInstance> relatedInstanceList;
+    private final RequestParameters requestParameters;
+
+    public OperationEnvironmentRequestDetails(@JsonProperty(value = "requestInfo", required = true) RequestInfo requestInfo,
+                                              @JsonProperty(value = "relatedInstanceList", required = true) List<RelatedInstance> relatedInstanceList,
+                                              @JsonProperty(value = "requestParameters", required = true) RequestParameters requestParameters) {
+        this.requestInfo = requestInfo;
+        this.relatedInstanceList = relatedInstanceList;
+        this.requestParameters = requestParameters;
+    }
+
+    public RequestInfo getRequestInfo() {
+        return requestInfo;
+    }
+
+    public List<RelatedInstance> getRelatedInstanceList() {
+        return relatedInstanceList;
+    }
+
+    public RequestParameters getRequestParameters() {
+        return requestParameters;
+    }
+
+    public static class RequestInfo {
+        private final String resourceType;
+        private final String instanceName;
+        private final String source;
+        private final String requestorId;
+
+        public RequestInfo(@JsonProperty(value = "resourceType", required = true) String resourceType,
+                           @JsonProperty(value = "instanceName", required = true) String instanceName,
+                           @JsonProperty(value = "source", required = true) String source,
+                           @JsonProperty(value = "requestorId", required = true) String requestorId) {
+            this.resourceType = resourceType;
+            this.instanceName = instanceName;
+            this.source = source;
+            this.requestorId = requestorId;
+        }
+
+        public String getResourceType() {
+            return resourceType;
+        }
+
+        public String getInstanceName() {
+            return instanceName;
+        }
+
+        public String getSource() {
+            return source;
+        }
+
+        public String getRequestorId() {
+            return requestorId;
+        }
+    }
+
+    public static class RequestParameters {
+        private final String operationalEnvironmentType;
+        private final String tenantContext;
+        private final String workloadContext;
+
+        public RequestParameters(@JsonProperty(value = "operationalEnvironmentType", required = true) String operationalEnvironmentType,
+                                 @JsonProperty(value = "tenantContext", required = true) String tenantContext,
+                                 @JsonProperty(value = "workloadContext", required = true) String workloadContext) {
+            this.operationalEnvironmentType = operationalEnvironmentType;
+            this.tenantContext = tenantContext;
+            this.workloadContext = workloadContext;
+        }
+        public String getOperationalEnvironmentType() {
+            return operationalEnvironmentType;
+        }
+
+        public String getTenantContext() {
+            return tenantContext;
+        }
+
+        public String getWorkloadContext() {
+            return workloadContext;
+        }
+    }
+
+    @JsonTypeName("relatedInstance")
+    @JsonTypeInfo(include = JsonTypeInfo.As.WRAPPER_OBJECT, use = JsonTypeInfo.Id.NAME)
+    public static class RelatedInstance {
+        private final String resourceType;
+        private final String instanceId;
+        private final String instanceName;
+
+        public String getResourceType() {
+            return resourceType;
+        }
+
+        public String getInstanceId() {
+            return instanceId;
+        }
+
+        public String getInstanceName() {
+            return instanceName;
+        }
+
+        public RelatedInstance(@JsonProperty(value = "instanceName", required = true) String resourceType,
+                               @JsonProperty(value = "instanceId", required = true) String instanceId,
+                               @JsonProperty(value = "instanceName", required = true) String instanceName) {
+            this.resourceType = resourceType;
+            this.instanceId = instanceId;
+            this.instanceName = instanceName;
+        }
+    }
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/mso/rest/RelatedInstance.java b/vid-app-common/src/main/java/org/onap/vid/mso/rest/RelatedInstance.java
new file mode 100644
index 0000000..b7f1203
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/mso/rest/RelatedInstance.java
@@ -0,0 +1,125 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * VID
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.vid.mso.rest;
+
+import java.util.HashMap;
+import java.util.Map;
+import javax.annotation.Generated;
+import com.fasterxml.jackson.annotation.JsonAnyGetter;
+import com.fasterxml.jackson.annotation.JsonAnySetter;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonPropertyOrder;
+import org.apache.commons.lang.builder.EqualsBuilder;
+import org.apache.commons.lang.builder.HashCodeBuilder;
+import org.apache.commons.lang.builder.ToStringBuilder;
+
+
+/**
+ * modelInfo and optional instanceId and instanceName for a model related to the modelInfo being operated on.
+ */
+@JsonInclude(JsonInclude.Include.NON_NULL)
+@Generated("org.jsonschema2pojo")
+@JsonPropertyOrder({
+    "instanceName",
+    "instanceId",
+    "modelInfo"
+})
+public class RelatedInstance extends org.onap.vid.domain.mso.RelatedInstance{
+
+
+    /** The model info. */
+    @JsonProperty("modelInfo")
+    private org.onap.vid.domain.mso.ModelInfo modelInfo;
+    
+    /** The additional properties. */
+    @JsonIgnore
+    private Map<String, Object> additionalProperties = new HashMap<String, Object>();
+
+    /**
+     * (Required).
+     *
+     * @return     The modelInfo
+     */
+    @JsonProperty("modelInfo")
+    public org.onap.vid.domain.mso.ModelInfo getModelInfo() {
+        return modelInfo;
+    }
+
+    /**
+     * (Required).
+     *
+     * @param modelInfo     The modelInfo
+     */
+    @JsonProperty("modelInfo")
+    public void setModelInfo(org.onap.vid.domain.mso.ModelInfo modelInfo) {
+        this.modelInfo = modelInfo;
+    }
+
+    /* (non-Javadoc)
+     * @see org.openecomp.vid.domain.mso.RelatedInstance#toString()
+     */
+    @Override
+    public String toString() {
+        return ToStringBuilder.reflectionToString(this);
+    }
+
+    /* (non-Javadoc)
+     * @see org.openecomp.vid.domain.mso.RelatedInstance#getAdditionalProperties()
+     */
+    @JsonAnyGetter
+    public Map<String, Object> getAdditionalProperties() {
+        return this.additionalProperties;
+    }
+
+    /* (non-Javadoc)
+     * @see org.openecomp.vid.domain.mso.RelatedInstance#setAdditionalProperty(java.lang.String, java.lang.Object)
+     */
+    @JsonAnySetter
+    public void setAdditionalProperty(String name, Object value) {
+        this.additionalProperties.put(name, value);
+    }
+
+    /* (non-Javadoc)
+     * @see org.openecomp.vid.domain.mso.RelatedInstance#hashCode()
+     */
+    @Override
+    public int hashCode() {
+        return new HashCodeBuilder().append(getInstanceName()).append(getInstanceId()).append(modelInfo).append(additionalProperties).toHashCode();
+    }
+
+    /* (non-Javadoc)
+     * @see org.openecomp.vid.domain.mso.RelatedInstance#equals(java.lang.Object)
+     */
+    @Override
+    public boolean equals(Object other) {
+        if (other == this) {
+            return true;
+        }
+        if ((other instanceof RelatedInstance) == false) {
+            return false;
+        }
+        RelatedInstance rhs = ((RelatedInstance) other);
+        return new EqualsBuilder().append(getInstanceName(), rhs.getInstanceName()).append(getInstanceId(), rhs.getInstanceId()).append(modelInfo, rhs.getModelInfo()).append(additionalProperties, rhs.additionalProperties).isEquals();
+    }
+
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/mso/rest/RelatedModel.java b/vid-app-common/src/main/java/org/onap/vid/mso/rest/RelatedModel.java
new file mode 100644
index 0000000..39722e1
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/mso/rest/RelatedModel.java
@@ -0,0 +1,125 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * VID
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.vid.mso.rest;
+
+import java.util.HashMap;
+import java.util.Map;
+import com.fasterxml.jackson.annotation.JsonAnyGetter;
+import com.fasterxml.jackson.annotation.JsonAnySetter;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonPropertyOrder;
+import org.apache.commons.lang.builder.EqualsBuilder;
+import org.apache.commons.lang.builder.HashCodeBuilder;
+import org.apache.commons.lang.builder.ToStringBuilder;
+
+
+/**
+ * modelInfo and optional instance id for a model related to the modelInfo being operated on.
+ */
+@JsonInclude(JsonInclude.Include.NON_NULL)
+@JsonPropertyOrder({
+    "instanceId",
+    "modelInfo"
+})
+public class RelatedModel extends org.onap.vid.domain.mso.RelatedModel {
+    
+    /** (Required). */
+    @JsonProperty("modelInfo")
+    private org.onap.vid.domain.mso.ModelInfo modelInfo;
+
+//    /** The related model object instance list. */
+//    @JsonProperty("instanceId")
+//    private org.openecomp.vid.domain.mso.InstanceIds instanceId;
+    
+    /** The additional properties. */
+    @JsonIgnore
+    private Map<String, Object> additionalProperties = new HashMap<String, Object>();
+
+    /**
+     * (Required).
+     *
+     * @return     The modelInfo
+     */
+    @JsonProperty("modelInfo")
+    public org.onap.vid.domain.mso.ModelInfo getModelInfo() {
+        return modelInfo;
+    }
+
+    /**
+     * (Required).
+     *
+     * @param modelInfo     The modelInfo
+     */
+    @JsonProperty("modelInfo")
+    public void setModelInfo(org.onap.vid.domain.mso.ModelInfo modelInfo) {
+        this.modelInfo = modelInfo;
+    }
+
+    /* (non-Javadoc)
+     * @see org.openecomp.vid.domain.mso.RelatedModel#toString()
+     */
+    @Override
+    public String toString() {
+        return ToStringBuilder.reflectionToString(this);
+    }
+
+    /* (non-Javadoc)
+     * @see org.openecomp.vid.domain.mso.RelatedModel#getAdditionalProperties()
+     */
+    @JsonAnyGetter
+    public Map<String, Object> getAdditionalProperties() {
+        return this.additionalProperties;
+    }
+
+    /* (non-Javadoc)
+     * @see org.openecomp.vid.domain.mso.RelatedModel#setAdditionalProperty(java.lang.String, java.lang.Object)
+     */
+    @JsonAnySetter
+    public void setAdditionalProperty(String name, Object value) {
+        this.additionalProperties.put(name, value);
+    }
+
+    /* (non-Javadoc)
+     * @see org.openecomp.vid.domain.mso.RelatedModel#hashCode()
+     */
+    @Override
+    public int hashCode() {
+        return new HashCodeBuilder().append(getInstanceId()).append(modelInfo).append(additionalProperties).toHashCode();
+    }
+
+    /* (non-Javadoc)
+     * @see org.openecomp.vid.domain.mso.RelatedModel#equals(java.lang.Object)
+     */
+    @Override
+    public boolean equals(Object other) {
+        if (other == this) {
+            return true;
+        }
+        if ((other instanceof RelatedModel) == false) {
+            return false;
+        }
+        RelatedModel rhs = ((RelatedModel) other);
+        return new EqualsBuilder().append(getInstanceId(), rhs.getInstanceId()).append(modelInfo, rhs.modelInfo).append(additionalProperties, rhs.additionalProperties).isEquals();
+    }
+
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/mso/rest/Request.java b/vid-app-common/src/main/java/org/onap/vid/mso/rest/Request.java
new file mode 100644
index 0000000..b1a84ab
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/mso/rest/Request.java
@@ -0,0 +1,146 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * VID
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.vid.mso.rest;
+
+//import java.util.HashMap;
+//import java.util.Map;
+//import javax.annotation.Generated;
+
+import org.apache.commons.lang3.builder.HashCodeBuilder;
+import org.onap.vid.domain.mso.InstanceIds;
+import org.onap.vid.domain.mso.RequestStatus;
+//import com.fasterxml.jackson.annotation.JsonAnyGetter;
+//import com.fasterxml.jackson.annotation.JsonAnySetter;
+//import com.fasterxml.jackson.annotation.JsonCreator;
+//import com.fasterxml.jackson.annotation.JsonIgnore;
+//import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonProperty;
+//import com.fasterxml.jackson.annotation.JsonPropertyOrder;
+//import com.fasterxml.jackson.annotation.JsonValue;
+import org.apache.commons.lang.builder.EqualsBuilder;
+//import org.apache.commons.lang.builder.HashCodeBuilder;
+import org.apache.commons.lang.builder.ToStringBuilder;
+
+
+/**
+ * request structure.
+ */
+public class Request extends org.onap.vid.domain.mso.Request {
+
+ 
+    /** The instance ids. */
+    private InstanceIds instanceIds;
+    
+    /** The request details. */
+    private RequestDetails requestDetails;
+    
+    /** The request status. */
+    private RequestStatus requestStatus;
+ 
+    
+    /* (non-Javadoc)
+     * @see org.openecomp.vid.domain.mso.Request#getInstanceIds()
+     */
+    @JsonProperty("instanceIds")
+    public InstanceIds getInstanceIds() {
+        return instanceIds;
+    }
+
+    /**
+     * Sets the instance ids.
+     *
+     * @param instanceIds     The instanceIds
+     */
+    @JsonProperty("instanceIds")
+    public void setInstanceIds(InstanceIds instanceIds) {
+        this.instanceIds = instanceIds;
+    }
+
+    /**
+     * (Required).
+     *
+     * @return     The requestDetails
+     */
+    @JsonProperty("requestDetails")
+    public RequestDetails getRequestDetails() {
+        return requestDetails;
+    }
+
+    /**
+     * (Required).
+     *
+     * @param requestDetails     The requestDetails
+     */
+    @JsonProperty("requestDetails")
+    public void setRequestDetails(RequestDetails requestDetails) {
+        this.requestDetails = requestDetails;
+    }
+
+    
+    /**
+     * Gets the request status.
+     *
+     * @return     The requestStatus
+     */
+    @JsonProperty("requestStatus")
+    public RequestStatus getRequestStatus() {
+        return requestStatus;
+    }
+
+    /**
+     * Sets the request status.
+     *
+     * @param requestStatus     The requestStatus
+     */
+    @JsonProperty("requestStatus")
+    public void setRequestStatus(RequestStatus requestStatus) {
+        this.requestStatus = requestStatus;
+    }
+
+  
+    /* (non-Javadoc)
+     * @see org.openecomp.vid.domain.mso.Request#toString()
+     */
+    @Override
+    public String toString() {
+        return ToStringBuilder.reflectionToString(this);
+    }
+    
+    /* (non-Javadoc)
+     * @see org.openecomp.vid.domain.mso.Request#equals(java.lang.Object)
+     */
+    @Override
+    public boolean equals(Object other) {
+        if (other == this) {
+            return true;
+        }
+        if ((other instanceof Request) == false) {
+            return false;
+        }
+        Request rhs = ((Request) other);
+        return new EqualsBuilder().append(getFinishTime(), rhs.getFinishTime()).append(getInstanceIds(), rhs.getInstanceIds()).append(getRequestDetails(), rhs.getRequestDetails()).append(getRequestId(), rhs.getRequestId()).append(getRequestScope(), rhs.getRequestScope()).append(getRequestStatus(), rhs.getRequestStatus()).append(getRequestType(), rhs.getRequestType()).append(getStartTime(), rhs.getStartTime()).append(getAdditionalProperties(), rhs.getAdditionalProperties()).isEquals();
+    }
+
+    @Override
+    public int hashCode() {
+        return new HashCodeBuilder(17, 37).append(getFinishTime()).append(getInstanceIds()).append(getRequestDetails()).append(getRequestId()).append(getRequestScope()).append(getRequestStatus()).append(getRequestType()).append(getStartTime()).append(getAdditionalProperties()).toHashCode();
+    }
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/mso/rest/RequestDetails.java b/vid-app-common/src/main/java/org/onap/vid/mso/rest/RequestDetails.java
new file mode 100644
index 0000000..1e05989
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/mso/rest/RequestDetails.java
@@ -0,0 +1,235 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * VID
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.vid.mso.rest;
+
+import java.util.HashMap;
+import java.util.Map;
+import java.util.List;
+
+import org.onap.vid.domain.mso.*;
+import org.onap.vid.domain.mso.SubscriberInfo;
+import com.fasterxml.jackson.annotation.JsonAnyGetter;
+import com.fasterxml.jackson.annotation.JsonAnySetter;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonPropertyOrder;
+import org.apache.commons.lang.builder.EqualsBuilder;
+import org.apache.commons.lang.builder.HashCodeBuilder;
+import org.apache.commons.lang.builder.ToStringBuilder;
+
+
+/**
+ * aggregates the context, configuraiton and detailed parameters associated with the request into a single structure.
+ */
+@JsonInclude(JsonInclude.Include.NON_NULL)
+@JsonPropertyOrder({
+        "cloudConfiguration",
+        "modelInfo",
+        "relatedModelList",
+        "requestInfo",
+        "subscriberInfo",
+        "requestParameters"
+})
+public class RequestDetails{
+
+    /** The cloud configuration. */
+    @JsonProperty("cloudConfiguration")
+    private CloudConfiguration cloudConfiguration;
+
+    /** The model info. */
+    @JsonProperty("modelInfo")
+    private ModelInfo modelInfo;
+
+    /** The related model list. */
+    @JsonProperty("relatedModelList")
+    private List<RelatedModel> relatedInstanceList;
+
+    /** The request info. */
+    @JsonProperty("requestInfo")
+    private RequestInfo requestInfo;
+
+    /** The subscriber info. */
+    @JsonProperty("subscriberInfo")
+    private SubscriberInfo subscriberInfo;
+
+    /** The request parameters. */
+    @JsonProperty("requestParameters")
+    private RequestParameters requestParameters;
+
+    /** The additional properties. */
+    @JsonIgnore
+    private Map<String, Object> additionalProperties = new HashMap<String, Object>();
+
+    /**
+     * Gets the cloud configuration.
+     *
+     * @return     The cloudConfiguration
+     */
+    @JsonProperty("cloudConfiguration")
+    public CloudConfiguration getCloudConfiguration() {
+        return cloudConfiguration;
+    }
+
+    /**
+     * Sets the cloud configuration.
+     *
+     * @param cloudConfiguration     The cloudConfiguration
+     */
+    @JsonProperty("cloudConfiguration")
+    public void setCloudConfiguration(CloudConfiguration cloudConfiguration) {
+        this.cloudConfiguration = cloudConfiguration;
+    }
+
+    /**
+     * Gets the model info.
+     *
+     * @return     The modelInfo
+     */
+    @JsonProperty("modelInfo")
+    public ModelInfo getModelInfo() {
+        return modelInfo;
+    }
+
+    /**
+     * Sets the model info.
+     *
+     * @param modelInfo     The modelInfo
+     */
+    @JsonProperty("modelInfo")
+    public void setModelInfo(ModelInfo modelInfo) {
+        this.modelInfo = modelInfo;
+    }
+    /**
+     * Gets the related instance list.
+     *
+     * @return     The relatedInstanceList
+     */
+    @JsonProperty("relatedInstanceList")
+    public List<RelatedModel> getRelatedInstanceList() {
+        return relatedInstanceList;
+    }
+
+    /**
+     * Sets the related model list.
+     *
+     * @param relatedInstanceList     The relatedInstanceList
+     */
+    @JsonProperty("relatedInstanceList")
+    public void setRelatedInstanceList( List<RelatedModel> relatedInstanceList) {
+        this.relatedInstanceList = relatedInstanceList;
+    }
+
+    /**
+     * Gets the request info.
+     *
+     * @return     The requestInfo
+     */
+    @JsonProperty("requestInfo")
+    public RequestInfo getRequestInfo() {
+        return requestInfo;
+    }
+
+    /**
+     * Sets the request info.
+     *
+     * @param requestInfo     The requestInfo
+     */
+    @JsonProperty("requestInfo")
+    public void setRequestInfo(RequestInfo requestInfo) {
+        this.requestInfo = requestInfo;
+    }
+
+    /**
+     * Gets the subscriber info.
+     *
+     * @return     The subscriberInfo
+     */
+    @JsonProperty("subscriberInfo")
+    public SubscriberInfo getSubscriberInfo() {
+        return subscriberInfo;
+    }
+
+    /**
+     * Sets the subscriber info.
+     *
+     * @param subscriberInfo     The subscriberInfo
+     */
+    @JsonProperty("subscriberInfo")
+    public void setSubscriberInfo(SubscriberInfo subscriberInfo) {
+        this.subscriberInfo = subscriberInfo;
+    }
+
+    /* (non-Javadoc)
+     * @see org.openecomp.vid.domain.mso.RequestDetails#toString()
+     */
+    @Override
+    public String toString() {
+        return ToStringBuilder.reflectionToString(this);
+    }
+
+    /* (non-Javadoc)
+     * @see org.openecomp.vid.domain.mso.RequestDetails#getAdditionalProperties()
+     */
+    @JsonAnyGetter
+    public Map<String, Object> getAdditionalProperties() {
+        return this.additionalProperties;
+    }
+
+    /* (non-Javadoc)
+     * @see org.openecomp.vid.domain.mso.RequestDetails#setAdditionalProperty(java.lang.String, java.lang.Object)
+     */
+    @JsonAnySetter
+    public void setAdditionalProperty(String name, Object value) {
+        this.additionalProperties.put(name, value);
+    }
+
+    /* (non-Javadoc)
+     * @see org.openecomp.vid.domain.mso.RequestDetails#hashCode()
+     */
+    @Override
+    public int hashCode() {
+        return new HashCodeBuilder().append(cloudConfiguration).append(modelInfo).append(relatedInstanceList).append(requestInfo).append(getRequestParameters()).append(subscriberInfo).append(additionalProperties).toHashCode();
+    }
+
+    /* (non-Javadoc)
+     * @see org.openecomp.vid.domain.mso.RequestDetails#equals(java.lang.Object)
+     */
+    @Override
+    public boolean equals(Object other) {
+        if (other == this) {
+            return true;
+        }
+        if ((other instanceof RequestDetails) == false) {
+            return false;
+        }
+        RequestDetails rhs = ((RequestDetails) other);
+        return new EqualsBuilder().append(cloudConfiguration, rhs.cloudConfiguration).append(modelInfo, rhs.modelInfo).append(relatedInstanceList, rhs.relatedInstanceList).append(requestInfo, rhs.requestInfo).append(getRequestParameters(), rhs.getRequestParameters()).append(subscriberInfo, rhs.subscriberInfo).append(additionalProperties, rhs.additionalProperties).isEquals();
+    }
+
+    public RequestParameters getRequestParameters() {
+        return requestParameters;
+    }
+
+    public void setRequestParameters(RequestParameters requestParameters) {
+        this.requestParameters = requestParameters;
+    }
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/mso/rest/RequestList.java b/vid-app-common/src/main/java/org/onap/vid/mso/rest/RequestList.java
new file mode 100644
index 0000000..8f8272c
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/mso/rest/RequestList.java
@@ -0,0 +1,137 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * VID
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.vid.mso.rest;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.annotation.Generated;
+
+import com.fasterxml.jackson.annotation.JsonAnyGetter;
+import com.fasterxml.jackson.annotation.JsonAnySetter;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonPropertyOrder;
+
+//import com.fasterxml.jackson.annotation.JsonInclude;
+//import com.fasterxml.jackson.annotation.JsonProperty;
+//import com.fasterxml.jackson.annotation.JsonPropertyOrder;
+import org.apache.commons.lang.builder.EqualsBuilder;
+import org.apache.commons.lang.builder.HashCodeBuilder;
+import org.apache.commons.lang.builder.ToStringBuilder;
+import java.util.List;
+
+/**
+ * List of relatedModel structures that are related to a modelInfo being operated on.
+ */
+@JsonInclude(JsonInclude.Include.NON_NULL)
+@Generated("org.jsonschema2pojo")
+@JsonPropertyOrder({
+    "finishTime",
+    "instanceIds",
+    "requestDetails",
+    "requestId",
+    "requestScope",
+    "requestStatus",
+    "requestType",
+    "startTime"
+})
+
+public class RequestList {
+    
+    /** The request list. */
+    private List<RequestWrapper> requestList;
+    
+    /** The additional properties. */
+    @JsonIgnore
+    private Map<String, Object> additionalProperties = new HashMap<String, Object>();
+
+    /**
+     * (Required).
+     *
+     * @return     The RelatedModel List
+     */
+    public List<RequestWrapper> getRequestList() {
+        return requestList;
+    }
+
+    /**
+     * Sets the request list.
+     *
+     * @param l the new request list
+     */
+    public void setRequestList(List<RequestWrapper> l) {
+        this.requestList = l;
+    }
+
+    /* (non-Javadoc)
+     * @see java.lang.Object#toString()
+     */
+    @Override
+    public String toString() {
+        return ToStringBuilder.reflectionToString(this);
+    }
+
+    /**
+     * Gets the additional properties.
+     *
+     * @return the additional properties
+     */
+    @JsonAnyGetter
+    public Map<String, Object> getAdditionalProperties() {
+        return this.additionalProperties;
+    }
+
+    /**
+     * Sets the additional property.
+     *
+     * @param name the name
+     * @param value the value
+     */
+    @JsonAnySetter
+    public void setAdditionalProperty(String name, Object value) {
+        this.additionalProperties.put(name, value);
+    }
+
+    /* (non-Javadoc)
+     * @see java.lang.Object#hashCode()
+     */
+    @Override
+    public int hashCode() {
+        return new HashCodeBuilder().append(getRequestList()).append(additionalProperties).toHashCode();
+    }
+
+    /* (non-Javadoc)
+     * @see java.lang.Object#equals(java.lang.Object)
+     */
+    @Override
+    public boolean equals(Object other) {
+        if (other == this) {
+            return true;
+        }
+        if ((other instanceof RequestList) == false) {
+            return false;
+        }
+        RequestList rhs = ((RequestList) other);
+        return new EqualsBuilder().append(getRequestList(), rhs.getRequestList()).append(additionalProperties, rhs.additionalProperties).isEquals();
+    }
+
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/mso/rest/RequestWrapper.java b/vid-app-common/src/main/java/org/onap/vid/mso/rest/RequestWrapper.java
new file mode 100644
index 0000000..c93d0e5
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/mso/rest/RequestWrapper.java
@@ -0,0 +1,35 @@
+package org.onap.vid.mso.rest;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+/**
+ * request wrapper structure.
+ */
+public class RequestWrapper {
+
+
+    /** The request. */
+    private Request request;
+
+
+    /**
+     * Gets the request.
+     *
+     * @return     The requestDetails
+     */
+    @JsonProperty("request")
+    public Request getRequest() {
+        return request;
+    }
+
+    /**
+     * Sets the request.
+     *
+     * @param request     The request
+     */
+    @JsonProperty
+    public void setRequest(Request request) {
+        this.request = request;
+    }
+
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/mso/rest/Response.java b/vid-app-common/src/main/java/org/onap/vid/mso/rest/Response.java
new file mode 100644
index 0000000..ee074f3
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/mso/rest/Response.java
@@ -0,0 +1,54 @@
+package org.onap.vid.mso.rest;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+public class Response {
+
+    /** The status. */
+    private int status;
+
+    /** The entity. */
+    private RequestList entity;
+
+    /**
+     * Gets the status.
+     *
+     * @return     The status
+     */
+    @JsonProperty("status")
+    public int getStatus() {
+        return status;
+    }
+
+    /**
+     * Sets the status.
+     *
+     * @param status     The status
+     */
+    @JsonProperty("status")
+    public void setStatus(int status) {
+        this.status = status;
+    }
+
+    /**
+     * Gets the entity.
+     *
+     * @return     The entity
+     */
+    @JsonProperty("entity")
+    public RequestList getEntity() {
+        return entity;
+    }
+
+    /**
+     * Sets the entity.
+     *
+     * @param entity     The entity
+     */
+    @JsonProperty("entity")
+    public void setEntity(RequestList entity) {
+        this.entity = entity;
+    }
+
+
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/mso/rest/RestInterface.java b/vid-app-common/src/main/java/org/onap/vid/mso/rest/RestInterface.java
new file mode 100644
index 0000000..9fc95fc
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/mso/rest/RestInterface.java
@@ -0,0 +1,68 @@
+package org.onap.vid.mso.rest;
+
+import org.onap.vid.mso.RestObject;
+
+import javax.ws.rs.core.MultivaluedHashMap;
+
+/**
+ * Created by pickjonathan on 26/06/2017.
+ */
+public interface RestInterface {
+
+    /**
+     * Inits the rest client.
+     */
+    MultivaluedHashMap<String, Object> initMsoClient();
+
+    /**
+     * Gets the.
+     *
+     * @param <T> the generic type
+     * @param t the t
+     * @param sourceId the source id
+     * @param path the path
+     * @param restObject the rest object
+     * @throws Exception the exception
+     */
+    <T> void Get (T t, String sourceId, String path, RestObject<T> restObject ) throws Exception;
+
+    /**
+     * Delete.
+     *
+     * @param <T> the generic type
+     * @param t the t
+     * @param r the r
+     * @param sourceID the source ID
+     * @param path the path
+     * @param restObject the rest object
+     * @throws Exception the exception
+     */
+    <T> void Delete(T t, RequestDetails r, String sourceID, String path, RestObject<T> restObject) throws Exception;
+
+    /**
+     * Post.
+     *
+     * @param <T> the generic type
+     * @param t the t
+     * @param r the r
+     * @param sourceID the source ID
+     * @param path the path
+     * @param restObject the rest object
+     * @throws Exception the exception
+     */
+    <T> void Post(T t, Object r, String sourceID, String path, RestObject<T> restObject) throws Exception;
+
+    /**
+     * Put.
+     *
+     * @param <T> the generic type
+     * @param t the t
+     * @param r the r
+     * @param sourceID the source ID
+     * @param path the path
+     * @param restObject the rest object
+     * @throws Exception the exception
+     */
+    <T> void Put(T t, org.onap.vid.changeManagement.RequestDetailsWrapper r, String sourceID, String path, RestObject<T> restObject) throws Exception;
+
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/mso/rest/Task.java b/vid-app-common/src/main/java/org/onap/vid/mso/rest/Task.java
new file mode 100644
index 0000000..79aaaea
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/mso/rest/Task.java
@@ -0,0 +1,119 @@
+package org.onap.vid.mso.rest;
+
+import java.util.List;
+
+public class Task {
+
+    private String taskId;
+    private String type;
+    private String nfRole;
+    private String subscriptionServiceType;
+    private String originalRequestId;
+    private String originalRequestorId;
+    private String errorSource;
+    private String errorCode;
+    private String errorMessage;
+    private String buildingBlockName;
+    private String buildingBlockStep;
+    private List<String> validResponses;
+
+
+    public String getTaskId() {
+        return taskId;
+    }
+
+    public void setTaskId(String taskId) {
+        this.taskId = taskId;
+    }
+
+    public String getType() {
+        return type;
+    }
+
+    public void setType(String type) {
+        this.type = type;
+    }
+
+    public String getNfRole() {
+        return nfRole;
+    }
+
+    public void setNfRole(String nfRole) {
+        this.nfRole = nfRole;
+    }
+
+    public String getSubscriptionServiceType() {
+        return subscriptionServiceType;
+    }
+
+    public void setSubscriptionServiceType(String subscriptionServiceType) {
+        this.subscriptionServiceType = subscriptionServiceType;
+    }
+
+    public String getOriginalRequestId() {
+        return originalRequestId;
+    }
+
+    public void setOriginalRequestId(String originalRequestId) {
+        this.originalRequestId = originalRequestId;
+    }
+
+    public String getOriginalRequestorId() {
+        return originalRequestorId;
+    }
+
+    public void setOriginalRequestorId(String originalRequestorId) {
+        this.originalRequestorId = originalRequestorId;
+    }
+
+    public String getErrorSource() {
+        return errorSource;
+    }
+
+    public void setErrorSource(String errorSource) {
+        this.errorSource = errorSource;
+    }
+
+    public String getErrorCode() {
+        return errorCode;
+    }
+
+    public void setErrorCode(String errorCode) {
+        this.errorCode = errorCode;
+    }
+
+    public String getErrorMessage() {
+        return errorMessage;
+    }
+
+    public void setErrorMessage(String errorMessage) {
+        this.errorMessage = errorMessage;
+    }
+
+    public String getBuildingBlockName() {
+        return buildingBlockName;
+    }
+
+    public void setBuildingBlockName(String buildingBlockName) {
+        this.buildingBlockName = buildingBlockName;
+    }
+
+    public String getBuildingBlockStep() {
+        return buildingBlockStep;
+    }
+
+    public void setBuildingBlockStep(String buildingBlockStep) {
+        this.buildingBlockStep = buildingBlockStep;
+    }
+
+    public List<String> getValidResponses() {
+        return validResponses;
+    }
+
+    public void setValidResponses(List<String> validResponses) {
+        this.validResponses = validResponses;
+    }
+
+
+
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/mso/rest/TaskList.java b/vid-app-common/src/main/java/org/onap/vid/mso/rest/TaskList.java
new file mode 100644
index 0000000..bbff333
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/mso/rest/TaskList.java
@@ -0,0 +1,16 @@
+package org.onap.vid.mso.rest;
+
+import java.util.List;
+
+public class TaskList {
+
+    public List<Task> getTaskList() {
+        return taskList;
+    }
+
+    public void setTaskList(List<Task> taskList) {
+        this.taskList = taskList;
+    }
+
+    private List<Task> taskList;
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/policy/PolicyProperties.java b/vid-app-common/src/main/java/org/onap/vid/policy/PolicyProperties.java
new file mode 100644
index 0000000..2afb2d4
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/policy/PolicyProperties.java
@@ -0,0 +1,26 @@
+package org.onap.vid.policy;
+
+import org.openecomp.portalsdk.core.util.SystemProperties;
+
+
+public class PolicyProperties extends SystemProperties {
+	
+	public static final String POLICY_CLIENTAUTH_VAL =  "policy.ClientAuth";
+	
+	public static final String POLICY_CLIENT_MECHID_VAL =  "policy.client.mechId";
+	
+	public static final String POLICY_CLIENT_PASSWORD_VAL =  "policy.client.password";
+	
+	public static final String POLICY_USERNAME_VAL =  "policy.username";
+	
+	public static final String POLICY_PASSWORD_VAL =  "policy.password";
+	
+	public static final String POLICY_AUTHORIZATION_VAL = "policy.Authorization";
+	
+	public static final String POLICY_SERVER_URL_VAL = "policy.server.url";
+	
+	public static final String POLICY_ENVIRONMENT_VAL = "policy.environment";
+	
+	public static final String POLICY_GET_CONFIG_VAL = "policy.get.config"; 
+	
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/policy/PolicyResponseWrapper.java b/vid-app-common/src/main/java/org/onap/vid/policy/PolicyResponseWrapper.java
new file mode 100644
index 0000000..d5a4d12
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/policy/PolicyResponseWrapper.java
@@ -0,0 +1,56 @@
+package org.onap.vid.policy;
+
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonPropertyOrder;
+import org.apache.commons.lang.builder.ToStringBuilder;
+
+/**
+ * This wrapper encapsulates the Policy response
+ */
+@JsonInclude(JsonInclude.Include.NON_NULL)
+@JsonPropertyOrder({
+	    "status",
+	    "entity"
+})
+
+public class PolicyResponseWrapper {
+	
+	@JsonProperty("status")
+	private int status;
+
+	@JsonProperty("entity")
+	private String entity;
+
+	@JsonProperty("entity")
+    public String getEntity() {
+        return entity;
+    }
+	
+	@JsonProperty("status")
+    public int getStatus() {
+        return status;
+    }	
+	
+	@JsonProperty("status")
+    public void setStatus(int v) {
+        this.status = v;
+    }
+
+	@JsonProperty("entity")
+    public void setEntity(String v) {
+        this.entity = v;
+    }
+
+    @Override
+    public String toString() {
+        return ToStringBuilder.reflectionToString(this);
+    }
+
+    public String getResponse () {
+    	
+    	StringBuilder b = new StringBuilder ("{ \"status\": ");
+        b.append(getStatus()).append(", \"entity\": " ).append(this.getEntity()).append("}");
+        return (b.toString());
+    }
+}
\ No newline at end of file
diff --git a/vid-app-common/src/main/java/org/onap/vid/policy/PolicyRestInt.java b/vid-app-common/src/main/java/org/onap/vid/policy/PolicyRestInt.java
new file mode 100644
index 0000000..b58fe28
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/policy/PolicyRestInt.java
@@ -0,0 +1,66 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * VID
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.vid.policy;
+
+import com.fasterxml.jackson.databind.ObjectMapper;
+import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
+import org.onap.vid.policy.rest.RequestDetails;
+
+import java.text.DateFormat;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+
+public class PolicyRestInt {
+	
+	/** The logger. */
+	private static final EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(PolicyRestInt.class);
+	
+	/** The Constant dateFormat. */
+	final static DateFormat dateFormat = new SimpleDateFormat("HH:mm:ss:SSSS");
+	
+	/** The request date format. */
+	public DateFormat requestDateFormat = new SimpleDateFormat("EEE, dd MMM YYYY HH:mm:ss z");
+	
+	public PolicyRestInt() {
+		requestDateFormat.setTimeZone(java.util.TimeZone.getTimeZone("GMT"));
+	}
+
+	/**
+	 * Log request.
+	 *
+	 * @param r the r
+	 */
+	public void logRequest ( RequestDetails r ) {
+    	String methodName = "logRequest";
+	    ObjectMapper mapper = new ObjectMapper();
+	    String r_json_str = "";
+	    if ( r != null ) {
+	    	r_json_str = r.toString();
+		    try {
+		    	r_json_str = mapper.writeValueAsString(r);
+		    }
+		    catch ( com.fasterxml.jackson.core.JsonProcessingException j ) {
+		    	logger.debug(EELFLoggerDelegate.debugLogger,dateFormat.format(new Date()) + "<== " +  methodName + " Unable to parse request as json");
+		    }
+	    }
+	    logger.debug(EELFLoggerDelegate.debugLogger,dateFormat.format(new Date()) + "<== " +  methodName + " Request=(" + r_json_str + ")");  
+    }
+}
\ No newline at end of file
diff --git a/vid-app-common/src/main/java/org/onap/vid/policy/PolicyRestInterface.java b/vid-app-common/src/main/java/org/onap/vid/policy/PolicyRestInterface.java
new file mode 100644
index 0000000..875586d
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/policy/PolicyRestInterface.java
@@ -0,0 +1,233 @@
+package org.onap.vid.policy;
+
+import org.apache.commons.codec.binary.Base64;
+import org.eclipse.jetty.util.security.Password;
+import org.json.simple.JSONObject;
+import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
+import org.openecomp.portalsdk.core.util.SystemProperties;
+import org.onap.vid.client.HttpBasicClient;
+import org.onap.vid.policy.rest.RequestDetails;
+
+import javax.ws.rs.client.Client;
+import javax.ws.rs.client.Entity;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.MultivaluedHashMap;
+import javax.ws.rs.core.Response;
+import java.text.DateFormat;
+import java.text.SimpleDateFormat;
+import java.util.Collections;
+import java.util.Date;
+
+public class PolicyRestInterface extends PolicyRestInt implements PolicyRestInterfaceIfc {
+
+	/** The logger. */
+	private static final EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(PolicyRestInterface.class);
+	
+	/** The Constant dateFormat. */
+	final static DateFormat dateFormat = new SimpleDateFormat("HH:mm:ss:SSSS");
+	
+	/** The client. */
+	private static Client client = null;
+	
+	/** The common headers. */
+	private MultivaluedHashMap<String, Object> commonHeaders;
+	
+	public PolicyRestInterface() {
+		super();
+	}
+	
+	public void initRestClient()
+	{
+		final String methodname = "initRestClient()";
+		
+		//final String clientAuth = SystemProperties.getProperty(PolicyProperties.POLICY_CLIENTAUTH_VAL);
+		//final String authorization = SystemProperties.getProperty(PolicyProperties.POLICY_AUTHORIZATION_VAL);
+		final String mechId = SystemProperties.getProperty(PolicyProperties.POLICY_CLIENT_MECHID_VAL);
+		final String clientPassword = SystemProperties.getProperty(PolicyProperties.POLICY_CLIENT_PASSWORD_VAL);
+		final String username = SystemProperties.getProperty(PolicyProperties.POLICY_USERNAME_VAL);
+		final String password = SystemProperties.getProperty(PolicyProperties.POLICY_PASSWORD_VAL);
+		final String environment = SystemProperties.getProperty(PolicyProperties.POLICY_ENVIRONMENT_VAL);
+				
+		final String decrypted_client_password = Password.deobfuscate(clientPassword);		
+		String mechAuthString = mechId + ":" + decrypted_client_password;		
+		byte[] mechAuthEncBytes = Base64.encodeBase64(mechAuthString.getBytes());
+		String clientAuth = new String(mechAuthEncBytes);
+		
+		final String decrypted_password = Password.deobfuscate(password);		
+		String authString = username + ":" + decrypted_password;		
+		byte[] authEncBytes = Base64.encodeBase64(authString.getBytes());
+		String authorization = new String(authEncBytes);
+		
+		commonHeaders = new MultivaluedHashMap<String, Object> ();
+		commonHeaders.put("ClientAuth",  Collections.singletonList((Object) ("Basic " + clientAuth)));
+		commonHeaders.put("Authorization",  Collections.singletonList((Object) ("Basic " + authorization)));
+		commonHeaders.put("Environment",  Collections.singletonList((Object) (environment)));
+		
+		if (client == null) {
+			
+			try {
+				client = HttpBasicClient.getClient();
+			} catch (Exception e) {
+				System.out.println(  methodname + " Unable to get the SSL client");
+			}
+		}
+	}
+	
+	@SuppressWarnings("unchecked")
+	public <T> void  Get (T t, String sourceId, String path, RestObject<T> restObject ) throws Exception {
+		String methodName = "Get";
+		
+		logger.debug(EELFLoggerDelegate.debugLogger, methodName + " start");
+		
+		String url="";
+		restObject.set(t);
+		
+		url = SystemProperties.getProperty(PolicyProperties.POLICY_SERVER_URL_VAL) + path;
+        logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " +  methodName + " sending request to url= " + url);
+		
+        initRestClient();
+		
+		final Response cres = client.target(url)
+			 .request()
+	         .accept("application/json")
+	         .headers(commonHeaders)
+	         .get();
+		
+		int status = cres.getStatus();
+		restObject.setStatusCode (status);
+		
+		if (status == 200) {
+			 t = (T) cres.readEntity(t.getClass());
+			 restObject.set(t);
+			 logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + methodName + " REST api was successfull!");
+		    
+		 } else {
+		     throw new Exception(methodName + " with status="+ status + ", url= " + url );
+		 }
+
+		logger.debug(EELFLoggerDelegate.debugLogger,methodName + " received status=" + status );
+		
+		return;
+	}
+   
+   @SuppressWarnings("unchecked")
+   	public <T> void Delete(T t, RequestDetails r, String sourceID, String path, RestObject<T> restObject) {
+	 
+		String methodName = "Delete";
+		String url="";
+		Response cres = null;
+		
+		logger.debug(EELFLoggerDelegate.debugLogger,dateFormat.format(new Date()) + "<== " +  methodName + " start");
+		logRequest (r);
+
+		try {
+			initRestClient();
+			
+			url = SystemProperties.getProperty(PolicyProperties.POLICY_SERVER_URL_VAL) + path;
+			logger.debug(EELFLoggerDelegate.debugLogger,dateFormat.format(new Date()) + " methodName sending request to: " + url);
+	
+			cres = client.target(url)
+					 .request()
+			         .accept("application/json")
+	        		 .headers(commonHeaders)
+			         //.entity(r)
+			         .build("DELETE", Entity.entity(r, MediaType.APPLICATION_JSON)).invoke();
+			       //  .method("DELETE", Entity.entity(r, MediaType.APPLICATION_JSON));
+			         //.delete(Entity.entity(r, MediaType.APPLICATION_JSON));
+			
+			int status = cres.getStatus();
+	    	restObject.setStatusCode (status);
+	    	
+			if (status == 404) { // resource not found
+				String msg = "Resource does not exist...: " + cres.getStatus();
+				logger.debug(EELFLoggerDelegate.debugLogger,dateFormat.format(new Date()) + "<== " + msg);
+			} else if (status == 200  || status == 204){
+				logger.debug(EELFLoggerDelegate.debugLogger,dateFormat.format(new Date()) + "<== " + "Resource " + url + " deleted");
+			} else if (status == 202) {
+				String msg = "Delete in progress: " + status;
+				logger.debug(EELFLoggerDelegate.debugLogger,dateFormat.format(new Date()) + "<== " + msg);
+			}
+			else {
+				String msg = "Deleting Resource failed: " + status;
+					logger.debug(EELFLoggerDelegate.debugLogger,dateFormat.format(new Date()) + "<== " + msg);
+			}
+			
+			try {
+	   			t = (T) cres.readEntity(t.getClass());
+	   			restObject.set(t);
+            }
+            catch ( Exception e ) {
+            	logger.debug(EELFLoggerDelegate.debugLogger,dateFormat.format(new Date()) + "<== " + methodName + " No response entity, this is probably ok, e="
+            			+ e.getMessage());
+            }
+   
+        } 
+		catch (Exception e)
+        {
+        	 logger.debug(EELFLoggerDelegate.debugLogger,dateFormat.format(new Date()) + "<== " + methodName + " with url="+url+ ", Exception: " + e.toString());
+        	 throw e;
+        
+        }
+	}
+	
+	@SuppressWarnings("unchecked")
+	public <T> void Post(T t, JSONObject requestDetails, String uuid, String path, RestObject<T> restObject) throws Exception {
+		
+        String methodName = "Post";
+        String url="";
+
+        System.out.println( "POST policy rest interface");
+       
+     //   logRequest (requestDetails);
+        try {
+            
+            initRestClient();    
+    
+            url = SystemProperties.getProperty(PolicyProperties.POLICY_SERVER_URL_VAL) + path;
+            System.out.println( "<== " +  methodName + " sending request to url= " + url);
+            // Change the content length
+            final Response cres = client.target(url)
+            	 .request()
+                 .accept("application/json")
+	        	 .headers(commonHeaders)
+                 //.header("content-length", 201)
+                 //.header("X-FromAppId",  sourceID)
+                 .post(Entity.entity(requestDetails, MediaType.APPLICATION_JSON));
+            
+            try {
+	   			t = (T) cres.readEntity(t.getClass());
+	   			restObject.set(t);
+            }
+            catch ( Exception e ) {
+            	
+            	System.out.println("<== " + methodName + " No response entity, this is probably ok, e=" + e.getMessage());
+            }
+
+            int status = cres.getStatus();
+    		restObject.setStatusCode (status);
+    		
+    		if ( status >= 200 && status <= 299 ) {
+    			System.out.println( "<== " + methodName + " REST api POST was successful!");
+    		
+             } else {
+            	 System.out.println( "<== " + methodName + " with status="+status+", url="+url);
+             }    
+   
+        } catch (Exception e)
+        {
+        	System.out.println( "<== " + methodName + " with url="+url+ ", Exception: " + e.toString());
+        	 throw e;
+        
+        }
+    }
+	
+	public <T> T getInstance(Class<T> clazz) throws IllegalAccessException, InstantiationException
+	{
+		return clazz.newInstance();
+	}
+
+	@Override
+	public void logRequest(RequestDetails r) {
+		// TODO Auto-generated method stub
+	} 	
+}
\ No newline at end of file
diff --git a/vid-app-common/src/main/java/org/onap/vid/policy/PolicyRestInterfaceFactory.java b/vid-app-common/src/main/java/org/onap/vid/policy/PolicyRestInterfaceFactory.java
new file mode 100644
index 0000000..40cb854
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/policy/PolicyRestInterfaceFactory.java
@@ -0,0 +1,14 @@
+
+package org.onap.vid.policy;
+
+public class PolicyRestInterfaceFactory {
+
+	
+	public static PolicyRestInterfaceIfc getInstance () {
+		PolicyRestInterfaceIfc obj = null;
+
+		obj = new PolicyRestInterface();
+		
+		return ( obj );
+	}
+}
\ No newline at end of file
diff --git a/vid-app-common/src/main/java/org/onap/vid/policy/PolicyRestInterfaceIfc.java b/vid-app-common/src/main/java/org/onap/vid/policy/PolicyRestInterfaceIfc.java
new file mode 100644
index 0000000..59b0ad3
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/policy/PolicyRestInterfaceIfc.java
@@ -0,0 +1,58 @@
+
+package org.onap.vid.policy;
+
+import org.json.simple.JSONObject;
+import org.onap.vid.policy.rest.RequestDetails;
+
+public interface PolicyRestInterfaceIfc {	
+	/**
+	 * Inits the rest client.
+	 */
+	public void initRestClient();
+	
+	/**
+	 * Gets the.
+	 *
+	 * @param <T> the generic type
+	 * @param t the t
+	 * @param sourceId the source id
+	 * @param path the path
+	 * @param restObject the rest object
+	 * @throws Exception the exception
+	 */
+	public <T> void Get (T t, String sourceId, String path, RestObject<T> restObject ) throws Exception;
+	
+	/**
+	 * Delete.
+	 *
+	 * @param <T> the generic type
+	 * @param t the t
+	 * @param r the r
+	 * @param sourceID the source ID
+	 * @param path the path
+	 * @param restObject the rest object
+	 * @throws Exception the exception
+	 */
+	public <T> void Delete(T t, RequestDetails r, String sourceID, String path, RestObject<T> restObject) throws Exception;
+	
+	/**
+	 * Post.
+	 *
+	 * @param <T> the generic type
+	 * @param t the t
+	 * @param r the r
+	 * @param sourceID the source ID
+	 * @param path the path
+	 * @param restObject the rest object
+	 * @throws Exception the exception
+	 */
+	public <T> void Post(T t, JSONObject r, String sourceID, String path, RestObject<T> restObject) throws Exception;
+	
+	/***
+	 * Log request.
+	 *
+	 * @param r the r
+	 */
+	public void logRequest ( RequestDetails r  );
+	
+}
\ No newline at end of file
diff --git a/vid-app-common/src/main/java/org/onap/vid/policy/PolicyUtil.java b/vid-app-common/src/main/java/org/onap/vid/policy/PolicyUtil.java
new file mode 100644
index 0000000..6083528
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/policy/PolicyUtil.java
@@ -0,0 +1,71 @@
+package org.onap.vid.policy;
+
+import java.text.DateFormat;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+
+import org.glassfish.jersey.client.ClientResponse;
+import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
+import org.onap.vid.policy.PolicyResponseWrapper;
+import org.onap.vid.policy.PolicyUtil;
+import org.onap.vid.policy.RestObject;
+
+import com.fasterxml.jackson.databind.ObjectMapper;
+
+public class PolicyUtil {
+	
+	private static EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(PolicyUtil.class);
+	
+	final static DateFormat dateFormat = new SimpleDateFormat("HH:mm:ss:SSSS");
+	
+	public static PolicyResponseWrapper wrapResponse ( String body, int statusCode ) {
+		
+		PolicyResponseWrapper w = new PolicyResponseWrapper();
+		w.setStatus (statusCode);
+		w.setEntity(body);
+		
+		return w;
+	}
+	
+	public static PolicyResponseWrapper wrapResponse (ClientResponse cres) {	
+		String resp_str = "";
+		if ( cres != null ) {
+			resp_str = cres.readEntity(String.class);
+		}
+		int statuscode = cres.getStatus();
+		PolicyResponseWrapper w = PolicyUtil.wrapResponse ( resp_str, statuscode );
+		return (w);
+	}
+	
+	public static PolicyResponseWrapper wrapResponse (RestObject<String> rs) {	
+		String resp_str = "";
+		int status = 0;
+		if ( rs != null ) {
+			resp_str = rs.get();
+			status = rs.getStatusCode();
+		}
+		PolicyResponseWrapper w = PolicyUtil.wrapResponse ( resp_str, status );
+		return (w);
+	}
+	
+	public static <T> String convertPojoToString ( T t ) throws com.fasterxml.jackson.core.JsonProcessingException {
+		
+		String methodName = "convertPojoToString";
+		ObjectMapper mapper = new ObjectMapper();
+		String r_json_str = "";
+	    if ( t != null ) {
+		    try {
+		    	r_json_str = mapper.writeValueAsString(t);
+		    }
+		    catch ( com.fasterxml.jackson.core.JsonProcessingException j ) {
+		    	logger.debug(EELFLoggerDelegate.debugLogger,dateFormat.format(new Date()) + "<== " +  methodName + " Unable to parse object as json");
+		    }
+	    }
+	    return (r_json_str);
+	}
+	
+	
+	public static void main(String[] args) {
+		// TODO Auto-generated method stub		
+	}
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/policy/RestObject.java b/vid-app-common/src/main/java/org/onap/vid/policy/RestObject.java
new file mode 100644
index 0000000..81b354e
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/policy/RestObject.java
@@ -0,0 +1,68 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * VID
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.vid.policy;
+
+/**
+ * The Class RestObject.
+ *
+ * @param <T> the generic type
+ */
+public class RestObject<T> {
+
+	/**
+	 * Generic version of the RestObject class.
+	 *
+	 */
+    // T stands for "Type"
+    private T t;
+    
+    /** The status code. */
+    private int statusCode= 0;
+    
+    /**
+     * Sets the.
+     *
+     * @param t the t
+     */
+    public void set(T t) { this.t = t; }
+    
+    /**
+     * Gets the.
+     *
+     * @return the t
+     */
+    public T get() { return t; }
+	
+    /**
+     * Sets the status code.
+     *
+     * @param v the new status code
+     */
+    public void setStatusCode(int v) { this.statusCode = v; }
+    
+    /**
+     * Gets the status code.
+     *
+     * @return the status code
+     */
+    public int getStatusCode() { return this.statusCode; }
+    
+}
\ No newline at end of file
diff --git a/vid-app-common/src/main/java/org/onap/vid/policy/rest/RequestDetails.java b/vid-app-common/src/main/java/org/onap/vid/policy/rest/RequestDetails.java
new file mode 100644
index 0000000..81e2f2d
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/policy/rest/RequestDetails.java
@@ -0,0 +1,107 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * VID
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.vid.policy.rest;
+
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonPropertyOrder;
+
+/*
+	[
+	  {
+	    "policyConfigMessage": "Config Retrieved! ",
+	    "policyConfigStatus": "CONFIG_RETRIEVED",
+	    "type": "JSON",
+	    "config": "{\"service\":\"TimeLimitAndVerticalTopology\",\"policyName\":\"SNIRO_CM_1707.Demo_TimeLimitAndVerticalTopology_zone_localTime\",\"description\":\"dev instance\",\"templateVersion\":\"1702.03\",\"version\":\"1707\",\"priority\":\"4\",\"riskType\":\"test\",\"riskLevel\":\"3\",\"guard\":\"False\",\"content\":{\"serviceType\":\"networkOnDemand\",\"identity\":\"vnf_upgrade_policy\",\"policyScope\":{\"serviceType\":[\"networkOnDemand\"],\"aicZone\":[\" \"],\"entityType\":[\"vnf\"]},\"timeSchedule\":{\"allowedPeriodicTime\":[{\"day\":\"weekday\",\"timeRange\":[{\"start_time\":\"04:00:00\",\"end_time\":\"13:00:00\"}]}]},\"nodeType\":[\"vnf\"],\"type\":\"timeLimitAndVerticalTopology\",\"conflictScope\":\"vnf_zone\"}}",
+	    "policyName": "SNIRO_CM_1707.Config_MS_Demo_TimeLimitAndVerticalTopology_zone_localTime.1.xml",
+	    "policyVersion": "1",
+	    "matchingConditions": {
+	      "ECOMPName": "SNIRO-Placement",
+	      "ConfigName": "",
+	      "service": "TimeLimitAndVerticalTopology",
+	      "uuid": "",
+	      "Location": ""
+	    },
+	    "responseAttributes": {},
+	    "property": null
+	  },
+	  {
+	    "policyConfigMessage": "Config Retrieved! ",
+	    "policyConfigStatus": "CONFIG_RETRIEVED",
+	    "type": "JSON",
+	    "config": "{\"service\":\"TimeLimitAndVerticalTopology\",\"policyName\":\"SNIRO_CM_1707.Demo_TimeLimitAndVerticalTopology_pserver_localTime\",\"description\":\"dev instance\",\"templateVersion\":\"1702.03\",\"version\":\"1707\",\"priority\":\"4\",\"riskType\":\"test\",\"riskLevel\":\"3\",\"guard\":\"False\",\"content\":{\"serviceType\":\"networkOnDemand\",\"identity\":\"vnf_upgrade_policy\",\"policyScope\":{\"serviceType\":[\"networkOnDemand\"],\"aicZone\":[\" \"],\"entityType\":[\"vnf\"]},\"timeSchedule\":{\"allowedPeriodicTime\":[{\"day\":\"weekday\",\"timeRange\":[{\"start_time\":\"04:00:00\",\"end_time\":\"13:00:00\"}]}]},\"nodeType\":[\"vnf\"],\"type\":\"timeLimitAndVerticalTopology\",\"conflictScope\":\"vnf_pserver\"}}",
+	    "policyName": "SNIRO_CM_1707.Config_MS_Demo_TimeLimitAndVerticalTopology_pserver_localTime.1.xml",
+	    "policyVersion": "1",
+	    "matchingConditions": {
+	      "ECOMPName": "SNIRO-Placement",
+	      "ConfigName": "",
+	      "service": "TimeLimitAndVerticalTopology",
+	      "uuid": "",
+	      "Location": ""
+	    },
+	    "responseAttributes": {},
+	    "property": null
+	  },
+	  {
+	    "policyConfigMessage": "Config Retrieved! ",
+	    "policyConfigStatus": "CONFIG_RETRIEVED",
+	    "type": "JSON",
+	    "config": "{\"service\":\"TimeLimitAndVerticalTopology\",\"policyName\":\"SNIRO_CM_1707.Demo_TimeLimitAndVerticalTopology_vnf_localTime\",\"description\":\"dev instance\",\"templateVersion\":\"1702.03\",\"version\":\"1707\",\"priority\":\"4\",\"riskType\":\"test\",\"riskLevel\":\"3\",\"guard\":\"False\",\"content\":{\"serviceType\":\"networkOnDemand\",\"identity\":\"vnf_upgrade_policy\",\"policyScope\":{\"serviceType\":[\"networkOnDemand\"],\"aicZone\":[\" \"],\"entityType\":[\"vnf\"]},\"timeSchedule\":{\"allowedPeriodicTime\":[{\"day\":\"weekday\",\"timeRange\":[{\"start_time\":\"04:00:00\",\"end_time\":\"13:00:00\"}]}]},\"nodeType\":[\"vnf\"],\"type\":\"timeLimitAndVerticalTopology\",\"conflictScope\":\"vnf\"}}",
+	    "policyName": "SNIRO_CM_1707.Config_MS_Demo_TimeLimitAndVerticalTopology_vnf_localTime.1.xml",
+	    "policyVersion": "1",
+	    "matchingConditions": {
+	      "ECOMPName": "SNIRO-Placement",
+	      "ConfigName": "",
+	      "service": "TimeLimitAndVerticalTopology",
+	      "uuid": "",
+	      "Location": ""
+	    },
+	    "responseAttributes": {},
+	    "property": null
+	  }
+	]
+*/
+@JsonInclude(JsonInclude.Include.NON_NULL)
+@JsonPropertyOrder({
+    "policyConfigMessage",
+    "policyConfigStatus",
+    "type",
+    "config",
+    "policyName",
+    "policyVersion",
+    "matchingConditions"
+})
+public class RequestDetails {
+	
+	@JsonProperty("policyName")
+    private String policyName;	 
+    
+	@JsonProperty("policyName")
+    public String getPolicyName() {
+        return policyName;
+    }
+
+    @JsonProperty("policyName")
+    public void setPolicyName(String policyName) {
+        this.policyName = policyName;
+    }
+    
+}
\ No newline at end of file
diff --git a/vid-app-common/src/main/java/org/onap/vid/properties/AsdcClientConfiguration.java b/vid-app-common/src/main/java/org/onap/vid/properties/AsdcClientConfiguration.java
new file mode 100644
index 0000000..c767967
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/properties/AsdcClientConfiguration.java
@@ -0,0 +1,124 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * VID
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.vid.properties;
+
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.context.annotation.PropertySource;
+import org.springframework.context.annotation.PropertySources;
+import org.springframework.context.support.PropertySourcesPlaceholderConfigurer;
+
+/**
+ * The Class AsdcClientConfiguration.
+ */
+@Configuration
+
+@PropertySources({
+		@PropertySource(value="asdc.properties",  ignoreResourceNotFound = true),
+		@PropertySource(value="${container.classpath:}/WEB-INF/conf/asdc.properties", ignoreResourceNotFound = true)
+})
+public class AsdcClientConfiguration {
+
+    @Bean
+    public static PropertySourcesPlaceholderConfigurer propertySourcesPlaceholderConfigurer() {
+        return new PropertySourcesPlaceholderConfigurer();
+    }
+
+	@Value("${asdc.client.type}")
+	private AsdcClientType asdcClientType;
+
+	/** The asdc client host. */
+	@Value("${asdc.client.rest.host}")
+	private String asdcClientHost;
+
+	/** The asdc client port. */
+	@Value("${asdc.client.rest.port}")
+	private int asdcClientPort;
+
+	/** The asdc client auth. */
+	@Value("${asdc.client.rest.auth}")
+	public String asdcClientAuth;
+
+	/** The asdc client protocol. */
+	@Value("${asdc.client.rest.protocol}")
+	public String asdcClientProtocol;
+
+	/**
+	 * Gets the asdc client type.
+	 *
+	 * @return the asdc client type
+	 */
+	public AsdcClientType getAsdcClientType() {
+		return asdcClientType;
+	}
+
+	/**
+	 * Gets the asdc client host.
+	 *
+	 * @return the asdc client host
+	 */
+	public String getAsdcClientHost() {
+		return asdcClientHost;
+	}
+
+	/**
+	 * Gets the asdc client port.
+	 *
+	 * @return the asdc client port
+	 */
+	public int getAsdcClientPort() {
+		return asdcClientPort;
+	}
+
+	/**
+	 * Gets the asdc client auth.
+	 *
+	 * @return the asdc client auth
+	 */
+	public String getAsdcClientAuth() {
+		return asdcClientAuth;
+	}
+
+	/**
+	 * Gets the asdc client protocol.
+	 *
+	 * @return the asdc client protocol
+	 */
+	public String getAsdcClientProtocol() {
+		return asdcClientProtocol;
+	}
+
+	/**
+	 * The Enum AsdcClientType.
+	 */
+	public enum AsdcClientType {
+
+		/** The in memory. */
+		IN_MEMORY,
+
+		/** The rest. */
+		REST,
+
+		/** The local. */
+		LOCAL
+	}
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/properties/MsoClientConfiguration.java b/vid-app-common/src/main/java/org/onap/vid/properties/MsoClientConfiguration.java
new file mode 100644
index 0000000..ca58a95
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/properties/MsoClientConfiguration.java
@@ -0,0 +1,9 @@
+package org.onap.vid.properties;
+
+/**
+ * Created by pickjonathan on 20/06/2017.
+ */
+public class MsoClientConfiguration {
+
+
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/properties/VidProperties.java b/vid-app-common/src/main/java/org/onap/vid/properties/VidProperties.java
new file mode 100644
index 0000000..9108ae1
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/properties/VidProperties.java
@@ -0,0 +1,93 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * VID
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.vid.properties;
+
+import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
+import org.openecomp.portalsdk.core.util.SystemProperties;
+import org.onap.vid.model.ModelConstants;
+
+import java.text.DateFormat;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+/**
+ * The Class VidProperties.
+ */
+public class VidProperties extends SystemProperties {
+
+	//VID General Properties
+	
+	/** The Constant VID_TRUSTSTORE_FILENAME. */
+	public static final String VID_TRUSTSTORE_FILENAME = "vid.truststore.filename";
+	
+	/** The Constant VID_TRUSTSTORE_PASSWD_X. */
+	public static final String VID_TRUSTSTORE_PASSWD_X = "vid.truststore.passwd.x";
+	
+	/** The Constant FILESEPARATOR. */
+	public static final String FILESEPARATOR = (System.getProperty("file.separator") == null) ? "/" : System.getProperty("file.separator");
+	
+	/** The Constant LOG. */
+	private static final EELFLoggerDelegate LOG = EELFLoggerDelegate.getLogger(VidProperties.class);
+	
+	/** The Constant dateFormat. */
+	final static DateFormat dateFormat = new SimpleDateFormat("HH:mm:ss:SSSS");
+	/**
+	 * Gets the asdc model namespace prefix property
+	 * 
+	 * @return the property value or a default value
+	 */
+	public static String getAsdcModelNamespace() {
+		String methodName = "getAsdcModelNamespace ";
+		String asdcModelNamespace = ModelConstants.DEFAULT_ASDC_MODEL_NAMESPACE;
+	    try {
+	        asdcModelNamespace = SystemProperties.getProperty(ModelConstants.ASDC_MODEL_NAMESPACE);
+	        if ( asdcModelNamespace == null || asdcModelNamespace.isEmpty()) {
+		    	asdcModelNamespace = ModelConstants.DEFAULT_ASDC_MODEL_NAMESPACE;
+		    }
+	    }
+	    catch ( Exception e ) {
+	    	LOG.error (EELFLoggerDelegate.errorLogger, dateFormat.format(new Date()) + methodName + "unable to find the value, using the default "
+	    			+ ModelConstants.DEFAULT_ASDC_MODEL_NAMESPACE);
+	    	asdcModelNamespace = ModelConstants.DEFAULT_ASDC_MODEL_NAMESPACE;
+	    }
+	    return (asdcModelNamespace);
+	}
+	/**
+	 * Gets the specified property value. If the property is not defined, returns a default value.
+	 * 
+	 * @return the property value or a default value
+	 */
+	public static String getPropertyWithDefault ( String propName, String defaultValue ) {
+		String methodName = "getPropertyWithDefault ";
+		String propValue = defaultValue;
+	    try {
+	        propValue = SystemProperties.getProperty(propName);
+	        if ( propValue == null || propValue.isEmpty()) {
+		    	propValue = defaultValue;
+		    }
+	    }
+	    catch ( Exception e ) {
+	    	LOG.error (EELFLoggerDelegate.errorLogger, dateFormat.format(new Date()) + methodName + "unable to find the value, using the default "
+	    			+ defaultValue);
+	    	propValue = defaultValue;
+	    }
+	    return (propValue);
+	}
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/roles/EcompRole.java b/vid-app-common/src/main/java/org/onap/vid/roles/EcompRole.java
new file mode 100644
index 0000000..63492cd
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/roles/EcompRole.java
@@ -0,0 +1,5 @@
+package org.onap.vid.roles;
+
+public enum EcompRole {
+	READ;
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/roles/Role.java b/vid-app-common/src/main/java/org/onap/vid/roles/Role.java
new file mode 100644
index 0000000..902da5b
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/roles/Role.java
@@ -0,0 +1,48 @@
+package org.onap.vid.roles;
+
+/**
+ * Created by Oren on 7/1/17.
+ */
+
+public class Role {
+
+    private EcompRole ecompRole;
+
+    private String subscribeName;
+
+    private String serviceType;
+
+    private String tenant;
+
+    public Role(EcompRole ecompRole, String subscribeName, String serviceType, String tenant) {
+        this.ecompRole = ecompRole;
+        this.subscribeName = subscribeName;
+        this.serviceType = serviceType;
+        this.tenant = tenant;
+    }
+
+    public EcompRole getEcompRole() {
+        return ecompRole;
+    }
+
+
+    public String getSubscribeName() {
+        return subscribeName;
+    }
+
+    public void setSubscribeName(String subscribeName) {
+        this.subscribeName = subscribeName;
+    }
+
+    public String getServiceType() {
+        return serviceType;
+    }
+
+
+    public String getTenant() {
+        return tenant;
+    }
+
+
+
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/roles/RoleProvider.java b/vid-app-common/src/main/java/org/onap/vid/roles/RoleProvider.java
new file mode 100644
index 0000000..63cc2bb
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/roles/RoleProvider.java
@@ -0,0 +1,138 @@
+package org.onap.vid.roles;
+
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
+import org.openecomp.portalsdk.core.web.support.UserUtils;
+import org.onap.vid.aai.AaiResponse;
+import org.onap.vid.aai.exceptions.RoleParsingException;
+import org.onap.vid.model.ModelConstants;
+import org.onap.vid.model.Subscriber;
+import org.onap.vid.model.SubscriberList;
+import org.onap.vid.services.AaiService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import javax.annotation.PostConstruct;
+import javax.servlet.http.HttpServletRequest;
+import java.util.*;
+
+//import org.codehaus.jackson.map.ObjectMapper;
+
+/**
+ * Created by Oren on 7/1/17.
+ */
+
+@Component
+public class RoleProvider {
+
+    private static final EELFLoggerDelegate LOG = EELFLoggerDelegate.getLogger(RoleProvider.class);
+    final String readPermissionString = "read";
+    SubscriberList subscribers;
+    ObjectMapper om = new ObjectMapper();
+    @Autowired
+    private AaiService aaiService;
+
+    public static List<String> extractRoleFromSession(HttpServletRequest request) {
+
+        return new ArrayList<String>();
+
+    }
+
+    @PostConstruct
+    public void init() {
+        LOG.debug(EELFLoggerDelegate.debugLogger, "Role provider => init method started");
+        AaiResponse<SubscriberList> subscribersResponse = aaiService.getFullSubscriberList();
+        subscribers = subscribersResponse.getT();
+        LOG.debug(EELFLoggerDelegate.debugLogger, "Role provider => init method finished");
+    }
+
+    public List<Role> getUserRoles(HttpServletRequest request) throws JsonProcessingException {
+        String logPrefix = "Role Provider (" + UserUtils.getUserId(request) + ") ==>";
+
+        LOG.debug(EELFLoggerDelegate.debugLogger, logPrefix + "Entering to get user role for user " + UserUtils.getUserId(request));
+
+        List<Role> roleList = new ArrayList<>();
+        HashMap roles = UserUtils.getRoles(request);
+        for (Object role : roles.keySet()) {
+            org.openecomp.portalsdk.core.domain.Role sdkRol = (org.openecomp.portalsdk.core.domain.Role) roles.get(role);
+
+            LOG.debug(EELFLoggerDelegate.debugLogger, logPrefix + "Role " + sdkRol.getName() + " is being proccessed");
+            try {
+                if (sdkRol.getName().contains(readPermissionString)) {
+                    LOG.debug(EELFLoggerDelegate.debugLogger, logPrefix + " Role " + sdkRol.getName() + " contain " + readPermissionString);
+
+                    continue;
+                }
+                String[] roleParts = splitRole((sdkRol.getName()), logPrefix);
+                roleList.add(createRoleFromStringArr(roleParts, logPrefix));
+                String msg = String.format(logPrefix + " User %s got permissions %s", UserUtils.getUserId(request), Arrays.toString(roleParts));
+                LOG.debug(EELFLoggerDelegate.debugLogger, msg);
+            } catch (RoleParsingException e) {
+                LOG.error(logPrefix + " Failed to parse permission");
+
+            }
+        }
+
+        return roleList;
+    }
+
+    public String[] splitRole(String roleAsString, String logPrefix) {
+        LOG.debug(EELFLoggerDelegate.debugLogger, logPrefix + "Spliting role = " + roleAsString + "With delimeter = " + ModelConstants.ROLE_DELIMITER);
+        return roleAsString.split(ModelConstants.ROLE_DELIMITER);
+    }
+
+    public boolean userPermissionIsReadOnly(List<Role> roles) {
+
+        return (!(roles.size() > 0));
+    }
+
+    public boolean userPermissionIsReadLogs(List<Role> roles){
+        for(Role role: roles){
+            if(role.getServiceType().equals("LOGS")){
+                if(role.getTenant().equals("PERMITTED")){
+                    return true;
+                }
+            }
+        }
+        return false;
+    }
+
+    private String replaceSubscriberNameToGlobalCustomerID(String subscriberName, String logPrefix) throws JsonProcessingException {
+        if (subscribers == null) {
+            LOG.debug(EELFLoggerDelegate.debugLogger, "replaceSubscriberNameToGlobalCustomerID calling init method");
+            init();
+        }
+        LOG.debug(EELFLoggerDelegate.debugLogger, logPrefix + "subscribers list size is  " + subscribers.customer.size() + " with the values " + om.writeValueAsString(subscribers.customer));
+        LOG.debug(EELFLoggerDelegate.debugLogger, logPrefix + "subscribers list size is  " + subscribers.customer.size() + " with the values " + om.writeValueAsString(subscribers.customer));
+
+
+        Optional<Subscriber> s = subscribers.customer.stream().filter(x -> x.subscriberName.equals(subscriberName)).findFirst();
+        //Fixing bug of logging "optional get" before isPresent
+        String replacement = s.isPresent() ? s.get().globalCustomerId : "";
+        LOG.debug(EELFLoggerDelegate.debugLogger, logPrefix + "Subscribername " + subscriberName + " changed to  " + replacement);
+        return replacement;
+    }
+
+    public Role createRoleFromStringArr(String[] roleParts, String rolePrefix) throws JsonProcessingException, RoleParsingException {
+        String globalCustomerID = replaceSubscriberNameToGlobalCustomerID(roleParts[0], rolePrefix);
+        try {
+            if (roleParts.length > 2) {
+                return new Role(EcompRole.READ, globalCustomerID, roleParts[1], roleParts[2]);
+            } else {
+                return new Role(EcompRole.READ, globalCustomerID, roleParts[1], null);
+            }
+        } catch (ArrayIndexOutOfBoundsException e) {
+            if (roleParts.length > 0)
+                LOG.debug(EELFLoggerDelegate.debugLogger, "Could not parse role ", roleParts[0]);
+            else {
+                LOG.debug(EELFLoggerDelegate.debugLogger, "Got empty role, Could not parse it ");
+
+            }
+            throw new RoleParsingException();
+        }
+
+    }
+
+}
+
diff --git a/vid-app-common/src/main/java/org/onap/vid/roles/RoleValidator.java b/vid-app-common/src/main/java/org/onap/vid/roles/RoleValidator.java
new file mode 100644
index 0000000..f4f17fa
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/roles/RoleValidator.java
@@ -0,0 +1,57 @@
+package org.onap.vid.roles;
+
+import org.onap.vid.mso.rest.RequestDetails;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * Created by Oren on 7/12/17.
+ */
+public class RoleValidator {
+
+    private List<Role> userRoles;
+
+    public RoleValidator(List<Role> roles) {
+        this.userRoles = roles;
+    }
+
+    public boolean isSubscriberPermitted(String subscriberName) {
+        for (Role role : userRoles) {
+            if (role.getSubscribeName().equals(subscriberName))
+                return true;
+        }
+        return false;
+    }
+
+    public boolean isServicePermitted(String subscriberName, String serviceType) {
+        for (Role role : userRoles) {
+            if (role.getSubscribeName().equals(subscriberName) && role.getServiceType().equals(serviceType))
+                return true;
+        }
+        return false;
+    }
+
+    public boolean isMsoRequestValid(RequestDetails mso_request) {
+        try {
+            String globalSubscriberIdRequested = (String) ((Map) ((Map) mso_request.getAdditionalProperties().get("requestDetails")).get("subscriberInfo")).get("globalSubscriberId");
+            String serviceType = (String) ((Map) ((Map) mso_request.getAdditionalProperties().get("requestDetails")).get("requestParameters")).get("subscriptionServiceType");
+            return isServicePermitted(globalSubscriberIdRequested, serviceType);
+        } catch (Exception e) {
+            //Until we'll get the exact information regarding the tenants and the global customer id, we'll return true on unknown requests to mso
+            return true;
+        }
+//        return false;
+    }
+
+    public boolean isTenantPermitted(String globalCustomerId, String serviceType, String tenantName) {
+        for (Role role : userRoles) {
+            if (role.getSubscribeName().equals(globalCustomerId)
+                    && role.getServiceType().equals(serviceType)
+                    && (role.getTenant() == null || role.getTenant().equalsIgnoreCase(tenantName))) {
+                return true;
+            }
+        }
+        return false;
+    }
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/scheduler/RestObject.java b/vid-app-common/src/main/java/org/onap/vid/scheduler/RestObject.java
new file mode 100644
index 0000000..4accb55
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/scheduler/RestObject.java
@@ -0,0 +1,44 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * VID
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.vid.scheduler;
+
+
+public class RestObject<T> {
+	
+    private T t;
+   
+    private int statusCode= 0;
+    
+    public String uuid;
+    
+    public void set(T t) { this.t = t; }
+    
+    public T get() { return t; }
+	   
+    public void setStatusCode(int v) { this.statusCode = v; }
+       
+    public int getStatusCode() { return this.statusCode; }
+        
+    public void setUUID(String uuid) { this.uuid = uuid; }
+    
+    public String getUUID() { return this.uuid; }
+}
+
diff --git a/vid-app-common/src/main/java/org/onap/vid/scheduler/RestObjects/RestObject.java b/vid-app-common/src/main/java/org/onap/vid/scheduler/RestObjects/RestObject.java
new file mode 100644
index 0000000..ff1ffb4
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/scheduler/RestObjects/RestObject.java
@@ -0,0 +1,39 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * VID
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.vid.scheduler.RestObjects;
+
+
+public class RestObject<T> {
+	
+    private T t;
+   
+    private int statusCode= 0;
+        
+    public void set(T t) { this.t = t; }
+    
+    public T get() { return t; }
+	   
+    public void setStatusCode(int v) { this.statusCode = v; }
+       
+    public int getStatusCode() { return this.statusCode; }
+        
+}
+
diff --git a/vid-app-common/src/main/java/org/onap/vid/scheduler/SchedulerProperties.java b/vid-app-common/src/main/java/org/onap/vid/scheduler/SchedulerProperties.java
new file mode 100644
index 0000000..bb5f6eb
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/scheduler/SchedulerProperties.java
@@ -0,0 +1,19 @@
+package org.onap.vid.scheduler;
+
+import org.openecomp.portalsdk.core.util.SystemProperties;
+
+
+public class SchedulerProperties extends SystemProperties { 
+	
+	public static final String SCHEDULER_USER_NAME_VAL =  "scheduler.user.name";
+		
+	public static final String SCHEDULER_PASSWORD_VAL = "scheduler.password";
+	
+	public static final String SCHEDULER_SERVER_URL_VAL = "scheduler.server.url";
+
+	public static final String SCHEDULER_GET_SCHEDULES = "scheduler.get.schedules";
+
+	public static final String SCHEDULER_DELETE_SCHEDULE = "scheduler.delete.schedule";
+
+
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/scheduler/SchedulerRestInterface.java b/vid-app-common/src/main/java/org/onap/vid/scheduler/SchedulerRestInterface.java
new file mode 100644
index 0000000..2077e7a
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/scheduler/SchedulerRestInterface.java
@@ -0,0 +1,214 @@
+package org.onap.vid.scheduler;
+
+import java.util.Collections;
+import javax.ws.rs.client.Client;
+import javax.ws.rs.client.Entity;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.MultivaluedHashMap;
+import javax.ws.rs.core.Response;
+
+import org.apache.commons.codec.binary.Base64;
+import org.eclipse.jetty.util.security.Password;
+import org.json.simple.JSONObject;
+import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
+import org.openecomp.portalsdk.core.util.SystemProperties;
+import org.onap.vid.client.HttpBasicClient;
+import org.onap.vid.client.HttpsBasicClient;
+import org.onap.vid.scheduler.SchedulerProperties;
+import org.onap.vid.scheduler.RestObjects.RestObject;
+import org.springframework.stereotype.Service;
+
+import static org.onap.vid.utils.Logging.getHttpServletRequest;
+import static org.onap.vid.utils.Logging.requestIdHeaderKey;
+
+@Service
+public class SchedulerRestInterface implements SchedulerRestInterfaceIfc {
+
+	private static Client client = null;
+		
+	private MultivaluedHashMap<String, Object> commonHeaders;
+	
+	/** The logger. */
+	static EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(SchedulerRestInterface.class);
+	
+	public SchedulerRestInterface() {
+		super();
+	}
+	
+	public void initRestClient()
+	{	
+		System.out.println( "\t <== Starting to initialize rest client ");
+		
+		final String username;
+		final String password;
+		
+		/*Setting user name based on properties*/
+		String retrievedUsername = SystemProperties.getProperty(SchedulerProperties.SCHEDULER_USER_NAME_VAL);
+		if(retrievedUsername.isEmpty()) {
+			username = "";
+		} else {
+			username = retrievedUsername;
+		}
+		
+		/*Setting password based on properties*/
+		String retrievedPassword = SystemProperties.getProperty(SchedulerProperties.SCHEDULER_PASSWORD_VAL);
+		if(retrievedPassword.isEmpty()) {
+			password = "";
+		} else {
+			if (retrievedPassword.contains("OBF:")) {
+				password = Password.deobfuscate(retrievedPassword);
+			} else {
+				password = retrievedPassword;
+			}
+		}
+		
+		String authString = username + ":" + password;
+				
+		byte[] authEncBytes = Base64.encodeBase64(authString.getBytes());
+		String authStringEnc = new String(authEncBytes);
+
+		commonHeaders = new MultivaluedHashMap<String, Object> ();
+		commonHeaders.put("Authorization",  Collections.singletonList((Object) ("Basic " + authStringEnc)));		
+					
+		try {
+			if ( !username.isEmpty() ) { 
+				
+				client = HttpsBasicClient.getClient();
+			}
+			else {
+				
+				client = HttpBasicClient.getClient();
+			}
+		} catch (Exception e) {
+			System.out.println( " <== Unable to initialize rest client ");
+		}
+		
+		System.out.println( "\t<== Client Initialized \n");
+	}
+		
+	@SuppressWarnings("unchecked")
+	public <T> void Get (T t, String sourceId, String path, org.onap.vid.scheduler.RestObject<T> restObject ) throws Exception {
+		
+		String methodName = "Get";
+		String url = SystemProperties.getProperty(SchedulerProperties.SCHEDULER_SERVER_URL_VAL) + path;
+		
+		
+		System.out.println( "<== URL FOR GET : " + url + "\n");
+
+        initRestClient();
+		
+		final Response cres = client.target(url)
+			 .request()
+	         .accept("application/json")
+	         .headers(commonHeaders)
+			 .header(requestIdHeaderKey, getHttpServletRequest().getHeader(requestIdHeaderKey))
+			 .get();
+				
+		int status = cres.getStatus();
+		restObject.setStatusCode (status);
+		
+		if (status == 200) {
+			 t = (T) cres.readEntity(t.getClass());
+			 restObject.set(t);
+			
+		 } else {
+		     throw new Exception(methodName + " with status="+ status + ", url= " + url );
+		 }
+
+		return;
+	}
+		
+	@SuppressWarnings("unchecked")
+	public <T> void Post(T t, JSONObject requestDetails, String path, RestObject<T> restObject) throws Exception {
+		
+        String methodName = "Post";
+        String url = SystemProperties.getProperty(SchedulerProperties.SCHEDULER_SERVER_URL_VAL) + path;
+		        
+        System.out.println( "<== URL FOR POST : " + url + "\n");
+     
+        try {
+            
+            initRestClient();    
+    
+            // Change the content length
+            final Response cres = client.target(url)
+            	 .request()
+                 .accept("application/json")
+	        	 .headers(commonHeaders)
+				 .header(requestIdHeaderKey, getHttpServletRequest().getHeader(requestIdHeaderKey))
+				 .post(Entity.entity(requestDetails, MediaType.APPLICATION_JSON));
+            
+            try {
+	   			t = (T) cres.readEntity(t.getClass());
+	   			restObject.set(t);
+            }
+            catch ( Exception e ) {
+            	
+            	System.out.println("<== " + methodName + " : No response entity, this is probably ok, e=" + e.getMessage());
+            }
+
+            int status = cres.getStatus();
+    		restObject.setStatusCode (status);    		
+    		    		
+    		if ( status >= 200 && status <= 299 ) {
+    			    			
+    			System.out.println( "<== " + methodName + " : REST api POST was successful!" + "\n");
+    		
+             } else {
+            	 System.out.println( "<== " + methodName + " : FAILED with http status : "+status+", url = " + url + "\n");
+             }    
+   
+        } catch (Exception e)
+        {
+        	System.out.println( "<== " + methodName + " : with url="+url+ ", Exception: " + e.toString() + "\n");
+        	throw e;        
+        }
+    }
+
+	@Override
+	public void logRequest(JSONObject requestDetails) {}
+
+	@SuppressWarnings("unchecked")
+   	public <T> void Delete(T t, String sourceID, String path, org.onap.vid.scheduler.RestObject<T> restObject) {
+	 
+		String url="";
+		Response cres = null;
+		
+		try {
+			initRestClient();
+			
+			url = SystemProperties.getProperty(SchedulerProperties.SCHEDULER_SERVER_URL_VAL) + path;
+		
+			cres = client.target(url)
+					 .request()
+			         .accept("application/json")
+	        		 .headers(commonHeaders)
+					 .header(requestIdHeaderKey, getHttpServletRequest().getHeader(requestIdHeaderKey))
+			         //.entity(r)
+			         .delete();
+			       //  .method("DELETE", Entity.entity(r, MediaType.APPLICATION_JSON));
+			         //.delete(Entity.entity(r, MediaType.APPLICATION_JSON));
+			
+			int status = cres.getStatus();
+	    	restObject.setStatusCode (status);
+	    			
+			try {
+	   			t = (T) cres.readEntity(t.getClass());
+	   			restObject.set(t);
+            }
+            catch ( Exception e ) {
+            }
+   
+        } 
+		catch (Exception e)
+        {     	
+        	 throw e;        
+        }
+	}
+	
+	public <T> T getInstance(Class<T> clazz) throws IllegalAccessException, InstantiationException
+	{
+		return clazz.newInstance();
+	}
+
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/scheduler/SchedulerRestInterfaceFactory.java b/vid-app-common/src/main/java/org/onap/vid/scheduler/SchedulerRestInterfaceFactory.java
new file mode 100644
index 0000000..1c3bea9
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/scheduler/SchedulerRestInterfaceFactory.java
@@ -0,0 +1,15 @@
+
+package org.onap.vid.scheduler;
+
+public class SchedulerRestInterfaceFactory {
+
+	
+	public static SchedulerRestInterfaceIfc getInstance () {
+		SchedulerRestInterfaceIfc obj = null;
+
+		obj = new SchedulerRestInterface();
+		
+		return ( obj );
+	}
+
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/scheduler/SchedulerRestInterfaceIfc.java b/vid-app-common/src/main/java/org/onap/vid/scheduler/SchedulerRestInterfaceIfc.java
new file mode 100644
index 0000000..7be8480
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/scheduler/SchedulerRestInterfaceIfc.java
@@ -0,0 +1,23 @@
+
+package org.onap.vid.scheduler;
+
+import org.json.simple.JSONObject;
+import org.onap.vid.scheduler.RestObjects.RestObject;
+import org.springframework.stereotype.Service;
+
+@Service
+public interface SchedulerRestInterfaceIfc {
+
+	public void initRestClient();
+
+	public <T> void Get (T t, String sourceId, String path, org.onap.vid.scheduler.RestObject<T> restObject ) throws Exception;
+
+	public <T> void Delete(T t, String sourceID, String path, org.onap.vid.scheduler.RestObject<T> restObject)
+			throws Exception;
+
+	public <T> void Post(T t, JSONObject r, String path, RestObject<T> restObject) throws Exception;
+
+	public void logRequest(JSONObject requestDetails);
+}
+
+
diff --git a/vid-app-common/src/main/java/org/onap/vid/services/AaiService.java b/vid-app-common/src/main/java/org/onap/vid/services/AaiService.java
new file mode 100644
index 0000000..4e86281
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/services/AaiService.java
@@ -0,0 +1,63 @@
+package org.onap.vid.services;
+
+import org.codehaus.jackson.JsonParseException;
+import org.codehaus.jackson.map.JsonMappingException;
+import org.onap.vid.aai.AaiResponse;
+import org.onap.vid.aai.SubscriberFilteredResults;
+import org.onap.vid.aai.model.AaiGetPnfs.Pnf;
+import org.onap.vid.aai.model.AaiGetOperationalEnvironments.OperationalEnvironmentList;
+import org.onap.vid.aai.model.AaiGetOperationalEnvironments.OperationalEnvironmentList;
+import org.onap.vid.aai.model.AaiGetTenatns.GetTenantsResponse;
+import org.onap.vid.asdc.beans.Service;
+import org.onap.vid.model.ServiceInstanceSearchResult;
+import org.onap.vid.model.SubscriberList;
+import org.onap.vid.roles.RoleValidator;
+
+import javax.ws.rs.core.Response;
+
+import java.io.IOException;
+import java.util.Collection;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * Created by Oren on 7/4/17.
+ */
+public interface AaiService {
+
+
+    SubscriberFilteredResults getFullSubscriberList(RoleValidator roleValidator);
+
+    AaiResponse getSubscriberData(String subscriberId, RoleValidator roleValidator);
+
+    AaiResponse getServiceInstanceSearchResults(String subscriberId, String instanceIdentifier, RoleValidator roleProvider, List<String> owningEntities, List<String> projects);
+
+    AaiResponse<SubscriberList> getFullSubscriberList();
+
+    AaiResponse getServices(RoleValidator roleValidator);
+    
+    AaiResponse getAaiZones();
+
+    AaiResponse<OperationalEnvironmentList> getOperationalEnvironments(String operationalEnvironmentType, String operationalEnvironmentStatus);
+
+    AaiResponse getAicZoneForPnf(String globalCustomerId , String serviceType , String serviceId);
+
+    Response getVNFData(String globalSubscriberId, String serviceType);
+
+    AaiResponse<GetTenantsResponse[]> getTenants(String globalCustomerId, String serviceType, RoleValidator roleValidator);
+
+    AaiResponse getVNFData(String globalSubscriberId, String serviceType, String serviceInstanceId);
+
+    AaiResponse getNodeTemplateInstances(String globalCustomerId, String serviceType, String modelVersionId, String modelInvariantId, String cloudRegion);
+
+    Response getVersionByInvariantId(List<String> modelInvariantId);
+
+    Collection<Service> getServicesByDistributionStatus();
+
+    AaiResponse<Pnf> getSpecificPnf(String pnfId);
+
+    List<String> getServiceInstanceAssociatedPnfs(String globalCustomerId, String serviceType, String serviceInstanceId);
+
+    AaiResponse getPNFData(String globalCustomerId, String serviceType, String modelVersionId, String modelInvariantId, String cloudRegion, String equipVendor, String equipModel);
+
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/services/AaiServiceImpl.java b/vid-app-common/src/main/java/org/onap/vid/services/AaiServiceImpl.java
new file mode 100644
index 0000000..ffb4380
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/services/AaiServiceImpl.java
@@ -0,0 +1,435 @@
+package org.onap.vid.services;
+
+import org.apache.http.HttpStatus;
+import org.onap.vid.aai.model.AaiGetAicZone.AicZones;
+import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
+import org.onap.vid.aai.*;
+import org.onap.vid.aai.ServiceInstance;
+import org.onap.vid.aai.ServiceSubscription;
+import org.onap.vid.aai.Services;
+import org.onap.vid.aai.model.AaiGetOperationalEnvironments.OperationalEnvironmentList;
+import org.onap.vid.aai.model.AaiGetPnfs.Pnf;
+import org.onap.vid.aai.model.AaiGetServicesRequestModel.GetServicesAAIRespone;
+import org.onap.vid.aai.model.AaiGetTenatns.GetTenantsResponse;
+import org.onap.vid.aai.model.*;
+import org.onap.vid.asdc.beans.Service;
+import org.onap.vid.model.ServiceInstanceSearchResult;
+import org.onap.vid.model.SubscriberList;
+import org.onap.vid.roles.RoleValidator;
+import org.onap.vid.utils.Intersection;
+import org.springframework.beans.factory.annotation.Autowired;
+
+import javax.ws.rs.core.Response;
+import java.io.UnsupportedEncodingException;
+import java.net.URLEncoder;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+import java.util.stream.Collectors;
+
+/**
+ * Created by Oren on 7/4/17.
+ */
+public class AaiServiceImpl implements AaiService {
+    private String serviceInstanceId = "service-instance.service-instance-id";
+    private String serviceType = "service-subscription.service-type";
+    private String customerId = "customer.global-customer-id";
+    private String serviceInstanceName = "service-instance.service-instance-name";
+    private int indexOfSubscriberName = 6;
+
+    @Autowired
+    private AaiClientInterface aaiClient;
+
+    EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(AaiServiceImpl.class);
+
+    private List<Service> convertModelToService(Model model) {
+        List<Service> services = new ArrayList<>();
+        String category = "";
+
+        if(validateModel(model)){
+            if(model.getModelType() != null)
+                category = model.getModelType();
+
+            for (ModelVer modelVer: model.getModelVers().getModelVer()) {
+                Service service = new Service();
+                if (modelVer.getModelVersionId() != null)
+                    service.setUuid(modelVer.getModelVersionId());
+                if(model.getModelInvariantId() != null)
+                    service.setInvariantUUID(model.getModelInvariantId());
+                if(modelVer.getModelVersion() != null)
+                    service.setVersion(modelVer.getModelVersion());
+                if(modelVer.getModelName() != null)
+                    service.setName(modelVer.getModelName());
+                if(modelVer.getDistributionStatus() != null)
+                    service.setDistributionStatus(Service.DistributionStatus.valueOf(modelVer.getDistributionStatus()));
+                service.setCategory(category);
+
+                services.add(service);
+            }
+        } else {
+            return null;
+        }
+
+        return services;
+    }
+
+    private boolean validateModel(Model model){
+        if(model != null){
+            if(model.getModelVers() != null && model.getModelVers().getModelVer() != null && model.getModelVers().getModelVer().get(0).getModelVersionId() != null){
+                return true;
+            }
+        }
+        return false;
+    }
+
+    private List<ServiceInstanceSearchResult> getServicesByOwningEntityId(List<String> owningEntities, RoleValidator roleValidator) {
+        AaiResponse<OwningEntityResponse> owningEntityResponse = aaiClient.getServicesByOwningEntityId(owningEntities);
+        List<ServiceInstanceSearchResult> serviceInstanceSearchResultList = new ArrayList<>();
+        if (owningEntityResponse.getT() != null) {
+            for (OwningEntity owningEntity : owningEntityResponse.getT().getOwningEntity()) {
+                if (owningEntity.getRelationshipList() != null) {
+                    serviceInstanceSearchResultList = convertRelationshipToSearchResult(owningEntity, serviceInstanceSearchResultList, roleValidator);
+                }
+            }
+        }
+        return serviceInstanceSearchResultList;
+    }
+
+    private List<ServiceInstanceSearchResult> getServicesByProjectNames(List<String> projectNames, RoleValidator roleValidator) {
+        AaiResponse<ProjectResponse> projectByIdResponse = aaiClient.getServicesByProjectNames(projectNames);
+        List<ServiceInstanceSearchResult> serviceInstanceSearchResultList = new ArrayList<>();
+        if (projectByIdResponse.getT() != null) {
+            for (Project project : projectByIdResponse.getT().getProject()) {
+                if (project.getRelationshipList() != null)
+                    serviceInstanceSearchResultList = convertRelationshipToSearchResult(project, serviceInstanceSearchResultList, roleValidator);
+            }
+        }
+        return serviceInstanceSearchResultList;
+    }
+
+    private List<ServiceInstanceSearchResult> convertRelationshipToSearchResult(AaiRelationResponse owningEntityResponse, List<ServiceInstanceSearchResult> serviceInstanceSearchResultList, RoleValidator roleValidator) {
+        if (owningEntityResponse.getRelationshipList().getRelationship() != null) {
+            List<Relationship> relationshipList = owningEntityResponse.getRelationshipList().getRelationship();
+            for (Relationship relationship : relationshipList) {
+                ServiceInstanceSearchResult serviceInstanceSearchResult = new ServiceInstanceSearchResult();
+                extractRelationshipData(relationship, serviceInstanceSearchResult, roleValidator);
+                extractRelatedToProperty(relationship, serviceInstanceSearchResult);
+                serviceInstanceSearchResultList.add(serviceInstanceSearchResult);
+            }
+        }
+        return serviceInstanceSearchResultList;
+    }
+
+    private void extractRelationshipData(Relationship relationship, ServiceInstanceSearchResult serviceInstanceSearchResult, RoleValidator roleValidator) {
+        List<RelationshipData> relationshipDataList = relationship.getRelationDataList();
+        if (relationshipDataList != null) {
+            setSubscriberName(relationship, serviceInstanceSearchResult);
+            for (RelationshipData relationshipData : relationshipDataList) {
+                String key = relationshipData.getRelationshipKey();
+                if (key.equals(serviceInstanceId)) {
+                    serviceInstanceSearchResult.setServiceInstanceId(relationshipData.getRelationshipValue());
+                } else if (key.equals(serviceType)) {
+                    serviceInstanceSearchResult.setServiceType(relationshipData.getRelationshipValue());
+                } else if (key.equals(customerId)) {
+                    serviceInstanceSearchResult.setGlobalCustomerId(relationshipData.getRelationshipValue());
+                }
+            }
+
+            boolean isPermitted = roleValidator.isServicePermitted(serviceInstanceSearchResult.getSubscriberName(), serviceInstanceSearchResult.getServiceType());
+            serviceInstanceSearchResult.setIsPermitted(isPermitted);
+        }
+    }
+
+    private void setSubscriberName(Relationship relationship, ServiceInstanceSearchResult serviceInstanceSearchResult) {
+        String relatedLink = relationship.getRelatedLink();
+        String[] subsciber = relatedLink.split("/");
+        serviceInstanceSearchResult.setSubscriberName(subsciber[indexOfSubscriberName]);
+    }
+
+    private void extractRelatedToProperty(Relationship relationship, ServiceInstanceSearchResult serviceInstanceSearchResult) {
+        List<RelatedToProperty> relatedToPropertyList = relationship.getRelatedToPropertyList();
+        if (relatedToPropertyList != null) {
+            for (RelatedToProperty relatedToProperty : relatedToPropertyList) {
+                if (relatedToProperty.getPropertyKey().equals(serviceInstanceName)) {
+                    serviceInstanceSearchResult.setServiceInstanceName(relatedToProperty.getPropertyValue());
+                }
+            }
+        }
+    }
+
+    @Override
+    public SubscriberFilteredResults getFullSubscriberList(RoleValidator roleValidator) {
+        AaiResponse<SubscriberList> subscriberResponse = aaiClient.getAllSubscribers();
+        SubscriberFilteredResults subscriberFilteredResults =
+                new SubscriberFilteredResults(roleValidator, subscriberResponse.getT(),
+                        subscriberResponse.getErrorMessage(),
+                        subscriberResponse.getHttpCode());
+
+        return subscriberFilteredResults;
+    }
+
+    @Override
+    public AaiResponse<OperationalEnvironmentList> getOperationalEnvironments(String operationalEnvironmentType, String operationalEnvironmentStatus) {
+        AaiResponse<OperationalEnvironmentList> subscriberResponse = aaiClient.getOperationalEnvironments(operationalEnvironmentType, operationalEnvironmentStatus);
+        return subscriberResponse;
+    }
+
+    @Override
+    public AaiResponse<SubscriberList> getFullSubscriberList() {
+        AaiResponse<SubscriberList> subscriberResponse = aaiClient.getAllSubscribers();
+        return subscriberResponse;
+    }
+
+    @Override
+    public AaiResponse getSubscriberData(String subscriberId, RoleValidator roleValidator) {
+        AaiResponse<Services> subscriberResponse = aaiClient.getSubscriberData(subscriberId);
+        String subscriberGlobalId = subscriberResponse.getT().globalCustomerId;
+        for (ServiceSubscription serviceSubscription : subscriberResponse.getT().serviceSubscriptions.serviceSubscription) {
+            String serviceType = serviceSubscription.serviceType;
+            serviceSubscription.isPermitted = roleValidator.isServicePermitted(subscriberGlobalId, serviceType);
+        }
+        return subscriberResponse;
+
+    }
+
+    @Override
+    public AaiResponse getServiceInstanceSearchResults(String subscriberId, String instanceIdentifier, RoleValidator roleValidator, List<String> owningEntities, List<String> projects) {
+        List<List<ServiceInstanceSearchResult>> resultList = new ArrayList<>();
+        ServiceInstancesSearchResults serviceInstancesSearchResults = new ServiceInstancesSearchResults();
+
+        if (subscriberId != null || instanceIdentifier != null) {
+            resultList.add(getServicesBySubscriber(subscriberId, instanceIdentifier, roleValidator));
+        }
+        if (owningEntities != null) {
+            resultList.add(getServicesByOwningEntityId(owningEntities, roleValidator));
+        }
+        if (projects != null) {
+            resultList.add(getServicesByProjectNames(projects, roleValidator));
+        }
+        if (resultList.size() > 0) {
+            Intersection<ServiceInstanceSearchResult> intersection = new Intersection<>();
+            serviceInstancesSearchResults.serviceInstances = intersection.intersectMultipileArray(resultList);
+        }
+
+        return new AaiResponse<>(serviceInstancesSearchResults, null, HttpStatus.SC_OK);
+    }
+
+
+    private List<ServiceInstanceSearchResult> getServicesBySubscriber(String subscriberId, String instanceIdentifier, RoleValidator roleValidator) {
+        AaiResponse<Services> subscriberResponse = aaiClient.getSubscriberData(subscriberId);
+        String subscriberGlobalId = subscriberResponse.getT().globalCustomerId;
+        String subscriberName = subscriberResponse.getT().subscriberName;
+        ServiceSubscriptions serviceSubscriptions = subscriberResponse.getT().serviceSubscriptions;
+
+        return getSearchResultsForSubscriptions(serviceSubscriptions, subscriberId, instanceIdentifier, roleValidator, subscriberGlobalId, subscriberName);
+
+    }
+
+
+    private ArrayList<ServiceInstanceSearchResult> getSearchResultsForSubscriptions(ServiceSubscriptions serviceSubscriptions, String subscriberId, String instanceIdentifier, RoleValidator roleValidator, String subscriberGlobalId, String subscriberName) {
+        ArrayList<ServiceInstanceSearchResult> results = new ArrayList<>();
+
+        if (serviceSubscriptions != null) {
+            for (ServiceSubscription serviceSubscription : serviceSubscriptions.serviceSubscription) {
+                String serviceType = serviceSubscription.serviceType;
+                serviceSubscription.isPermitted = roleValidator.isServicePermitted(subscriberGlobalId, serviceType);
+                ArrayList<ServiceInstanceSearchResult> resultsForSubscription = getSearchResultsForSingleSubscription(serviceSubscription, subscriberId, instanceIdentifier, subscriberName, serviceType);
+                results.addAll(resultsForSubscription);
+            }
+        }
+
+        return results;
+    }
+
+    private ArrayList<ServiceInstanceSearchResult> getSearchResultsForSingleSubscription(ServiceSubscription serviceSubscription, String subscriberId, String instanceIdentifier, String subscriberName, String serviceType) {
+        ArrayList<ServiceInstanceSearchResult> results = new ArrayList<>();
+
+        if (serviceSubscription.serviceInstances != null) {
+            for (ServiceInstance serviceInstance : serviceSubscription.serviceInstances.serviceInstance) {
+                ServiceInstanceSearchResult serviceInstanceSearchResult =
+                        new ServiceInstanceSearchResult(serviceInstance.serviceInstanceId, subscriberId, serviceType, serviceInstance.serviceInstanceName,
+                                subscriberName, serviceInstance.modelInvariantId, serviceInstance.modelVersionId, serviceSubscription.isPermitted);
+
+                if (instanceIdentifier == null) {
+                    results.add(serviceInstanceSearchResult);
+                } else if (serviceInstanceMatchesIdentifier(instanceIdentifier, serviceInstance)) {
+                    results.add(serviceInstanceSearchResult);
+                }
+            }
+        }
+
+        return results;
+    }
+
+    private boolean serviceInstanceMatchesIdentifier(String instanceIdentifier, ServiceInstance serviceInstance) {
+        return instanceIdentifier.equals(serviceInstance.serviceInstanceId) || instanceIdentifier.equals(serviceInstance.serviceInstanceName);
+    }
+
+    @Override
+    public Response getVersionByInvariantId(List<String> modelInvariantId) {
+        try {
+            return aaiClient.getVersionByInvariantId(modelInvariantId);
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        return null;
+    }
+
+    @Override
+    public AaiResponse<Pnf> getSpecificPnf(String pnfId) {
+        return aaiClient.getSpecificPnf(pnfId);
+    }
+
+    @Override
+    public AaiResponse getPNFData(String globalCustomerId, String serviceType, String modelVersionId, String modelInvariantId, String cloudRegion, String equipVendor, String equipModel) {
+        return aaiClient.getPNFData(globalCustomerId, serviceType, modelVersionId, modelInvariantId, cloudRegion, equipVendor, equipModel);
+    }
+
+
+
+    @Override
+    public AaiResponse getServices(RoleValidator roleValidator) {
+        AaiResponse<GetServicesAAIRespone> subscriberResponse = aaiClient.getServices();
+        if (subscriberResponse.getT() != null)
+            for (org.onap.vid.aai.model.AaiGetServicesRequestModel.Service service : subscriberResponse.getT().service) {
+                service.isPermitted = true;
+            }
+        return subscriberResponse;
+    }
+
+    @Override
+    public AaiResponse<GetTenantsResponse[]> getTenants(String globalCustomerId, String serviceType, RoleValidator roleValidator) {
+        AaiResponse<GetTenantsResponse[]> aaiGetTenantsResponse = aaiClient.getTenants(globalCustomerId, serviceType);
+        GetTenantsResponse[] tenants = aaiGetTenantsResponse.getT();
+        if (tenants != null) {
+            for (int i = 0; i < tenants.length; i++) {
+                tenants[i].isPermitted = roleValidator.isTenantPermitted(globalCustomerId, serviceType, tenants[i].tenantName);
+            }
+        }
+        return aaiGetTenantsResponse;
+
+
+    }
+
+    @Override
+    public AaiResponse getVNFData(String globalSubscriberId, String serviceType, String serviceInstanceId) {
+        return aaiClient.getVNFData(globalSubscriberId, serviceType, serviceInstanceId);
+    }
+
+    @Override
+    public Response getVNFData(String globalSubscriberId, String serviceType) {
+        return aaiClient.getVNFData(globalSubscriberId, serviceType);
+    }
+
+    @Override
+    public AaiResponse getAaiZones() {
+        AaiResponse<AicZones> response = aaiClient.getAllAicZones();
+        return response;
+    }
+
+    @Override
+    public AaiResponse getAicZoneForPnf(String globalCustomerId, String serviceType, String serviceId) {
+        String aicZone = "";
+
+        AaiResponse<ServiceRelationships> serviceInstanceResp = aaiClient.getServiceInstance(globalCustomerId, serviceType, serviceId);
+        if (serviceInstanceResp.getT() != null) {
+            List<String> aicZoneList = getRelationshipDataByType(serviceInstanceResp.getT().getRelationshipList(), "zone", "zone.zone-id");
+            if (aicZoneList.size() > 0) {
+                aicZone = aicZoneList.get(0);
+            } else {
+                logger.warn("aic zone not found for service instance " + serviceId);
+            }
+        } else {
+            if (serviceInstanceResp.getErrorMessage() != null) {
+                logger.error("get service instance " + serviceId + " return error", serviceInstanceResp.getErrorMessage());
+                return new AaiResponse(aicZone , serviceInstanceResp.getErrorMessage() ,serviceInstanceResp.getHttpCode());
+            } else {
+                logger.warn("get service instance " + serviceId + " return empty body");
+                return new AaiResponse(aicZone , "get service instance " + serviceId + " return empty body" ,serviceInstanceResp.getHttpCode());
+            }
+        }
+
+        return new AaiResponse(aicZone , null ,HttpStatus.SC_OK);
+    }
+
+    @Override
+    public AaiResponse getNodeTemplateInstances(String globalCustomerId, String serviceType, String modelVersionId, String modelInvariantId, String cloudRegion) {
+        return aaiClient.getNodeTemplateInstances(globalCustomerId, serviceType, modelVersionId, modelInvariantId, cloudRegion);
+    }
+
+    @Override
+    public Collection<Service> getServicesByDistributionStatus() {
+        AaiResponse<GetServiceModelsByDistributionStatusResponse> serviceModelsByDistributionStatusResponse = aaiClient.getServiceModelsByDistributionStatus();
+        Collection<Service> services = new ArrayList<>();
+        if (serviceModelsByDistributionStatusResponse.getT() != null) {
+            List<Result> results = serviceModelsByDistributionStatusResponse.getT().getResults();
+            for (Result result : results) {
+                if(result.getModel() != null) {
+                    List<Service> service = convertModelToService(result.getModel());
+                    if (service != null) {
+                        services.addAll(service);
+                    }
+                }
+            }
+        }
+        return services;
+    }
+
+    @Override
+    public List<String> getServiceInstanceAssociatedPnfs(String globalCustomerId, String serviceType, String serviceInstanceId) {
+        List<String> pnfs = new ArrayList<>();
+
+        AaiResponse<ServiceRelationships> serviceInstanceResp = aaiClient.getServiceInstance(globalCustomerId, serviceType, serviceInstanceId);
+        if (serviceInstanceResp.getT() != null) {
+            List<String> logicalLinks = getRelationshipDataByType(serviceInstanceResp.getT().getRelationshipList(), "logical-link", "logical-link.link-name");
+            for (String logicalLink : logicalLinks) {
+                String link = "";
+                try {
+                    link = URLEncoder.encode(logicalLink, "UTF-8");
+                    AaiResponse<LogicalLinkResponse> logicalLinkResp = aaiClient.getLogicalLink(link);
+                    if (logicalLinkResp.getT() != null) {
+                        //lag-interface is the key for pnf - approved by Bracha
+                        List<String> linkPnfs = getRelationshipDataByType(logicalLinkResp.getT().getRelationshipList(), "lag-interface", "pnf.pnf-name");
+                        if (linkPnfs.size() > 0) {
+                            pnfs.addAll(linkPnfs);
+                        } else {
+                            logger.warn("no pnf found for logical link " + logicalLink);
+                        }
+                    } else {
+                        if (logicalLinkResp.getErrorMessage() != null) {
+                            logger.error("get logical link " + logicalLink + " return error", logicalLinkResp.getErrorMessage());
+                        } else {
+                            logger.warn("get logical link " + logicalLink + " return empty body");
+                        }
+                    }
+                } catch (UnsupportedEncodingException e) {
+                    logger.error("Failed to encode logical link: " + logicalLink, e.getMessage());
+                }
+            }
+        } else {
+            if (serviceInstanceResp.getErrorMessage() != null) {
+                logger.error("get service instance " + serviceInstanceId + " return error", serviceInstanceResp.getErrorMessage());
+            } else {
+                logger.warn("get service instance " + serviceInstanceId + " return empty body");
+            }
+        }
+
+        return pnfs.stream().distinct().collect(Collectors.toList());
+    }
+
+    private List<String> getRelationshipDataByType(RelationshipList relationshipList, String relationshipType, String relationshipDataKey) {
+        List<String> relationshipValues = new ArrayList<>();
+        for (Relationship relationship : relationshipList.getRelationship()) {
+            if (relationship.getRelatedTo().equals(relationshipType)) {
+                relationshipValues.addAll( relationship.getRelationDataList().stream()
+                        .filter(rel -> rel.getRelationshipKey().equals(relationshipDataKey))
+                        .map(RelationshipData::getRelationshipValue)
+                        .collect(Collectors.toList())
+                );
+            }
+        }
+
+
+        return relationshipValues;
+    }
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/services/CategoryParameterService.java b/vid-app-common/src/main/java/org/onap/vid/services/CategoryParameterService.java
new file mode 100644
index 0000000..a140007
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/services/CategoryParameterService.java
@@ -0,0 +1,18 @@
+package org.onap.vid.services;
+
+import java.io.IOException;
+
+import org.onap.vid.category.AddCategoryOptionResponse;
+import org.onap.vid.category.CategoryParameterOptionRep;
+import org.onap.vid.category.CategoryParametersResponse;
+import org.onap.vid.category.AddCategoryOptionsRequest;
+import org.onap.vid.model.CategoryParameterOption;
+import org.onap.vid.model.CategoryParameter.Family;
+
+public interface CategoryParameterService {
+	
+	CategoryParametersResponse getCategoryParameters(Family familyName) throws IOException;
+	AddCategoryOptionResponse createCategoryParameterOptions(String categoryName, AddCategoryOptionsRequest option) throws IOException;
+	AddCategoryOptionResponse updateCategoryParameterOption(String categoryName, CategoryParameterOptionRep option);
+	void deleteCategoryOption(String categoryName, CategoryParameterOption option) throws IOException;
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/services/CategoryParameterServiceImpl.java b/vid-app-common/src/main/java/org/onap/vid/services/CategoryParameterServiceImpl.java
new file mode 100644
index 0000000..02d3521
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/services/CategoryParameterServiceImpl.java
@@ -0,0 +1,144 @@
+package org.onap.vid.services;
+
+import java.io.IOException;
+import java.util.*;
+import java.util.stream.Collectors;
+
+import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
+import org.openecomp.portalsdk.core.service.DataAccessService;
+import org.onap.vid.category.AddCategoryOptionResponse;
+import org.onap.vid.category.CategoryParameterOptionRep;
+import org.onap.vid.model.CategoryParameter;
+import org.onap.vid.model.CategoryParameterOption;
+import org.onap.vid.category.AddCategoryOptionsRequest;
+import org.onap.vid.category.CategoryParametersResponse;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.onap.vid.model.CategoryParameter.Family;
+
+import javax.ws.rs.ForbiddenException;
+
+
+@Service
+public class CategoryParameterServiceImpl implements CategoryParameterService {
+
+    @Autowired
+    private DataAccessService dataAccessService;
+
+    private static final EELFLoggerDelegate LOG = EELFLoggerDelegate.getLogger(CategoryParameterServiceImpl.class);
+
+    public static class UnfoundedCategoryException extends RuntimeException {
+
+        public UnfoundedCategoryException(String message) {
+            super(message);
+        }
+    }
+
+    public static class UnfoundedCategoryOptionException extends RuntimeException {
+
+        public UnfoundedCategoryOptionException(String message) {
+            super(message);
+        }
+    }
+
+    public static class AlreadyExistOptionNameException extends RuntimeException {
+
+        public AlreadyExistOptionNameException(String message) {
+            super(message);
+        }
+    }
+
+    @Override
+    public CategoryParametersResponse getCategoryParameters(Family familyName) throws IOException {
+        List<CategoryParameter> categoryParameters = dataAccessService.getList(CategoryParameter.class, String.format(" where family = '%s' ",familyName), null, null);
+        return convertToCategoryParametersResponse(categoryParameters);
+    }
+
+    private CategoryParametersResponse convertToCategoryParametersResponse(List<CategoryParameter> categoryParameters) {
+        Comparator<CategoryParameterOptionRep> comparator = Comparator.comparing(CategoryParameterOptionRep::getName, String.CASE_INSENSITIVE_ORDER);
+        Map<String, List<CategoryParameterOptionRep>> categoryParametersMap = categoryParameters.stream().collect(Collectors.toMap(
+                CategoryParameter::getName,
+                x ->  x.getOptions().stream().map(opt -> new CategoryParameterOptionRep(opt.getAppId(), opt.getName())).sorted(comparator).collect(Collectors.toList())));
+        return new CategoryParametersResponse(categoryParametersMap);
+    }
+
+    @Override
+    public AddCategoryOptionResponse createCategoryParameterOptions(String categoryName, AddCategoryOptionsRequest optionsRequest) throws IOException, UnfoundedCategoryException {
+
+        AddCategoryOptionResponse response = new AddCategoryOptionResponse(new ArrayList<>());
+        CategoryParameter categoryParameter = getCategoryParameter(categoryName);
+        Set<String> categoryOptions = categoryParameter.getOptions().stream().map(CategoryParameterOption::getName).collect(Collectors.toSet());
+        for (String optionName : optionsRequest.options) {
+            if (categoryOptions.contains(optionName)) {
+                response.getErrors().add(String.format("Option %s already exist for category %s", optionName, categoryName));
+                continue;
+            }
+            String appId = categoryParameter.isIdSupported() ? UUID.randomUUID().toString() : optionName;
+            CategoryParameterOption categoryParameterOption = new CategoryParameterOption(appId, optionName, categoryParameter);
+            dataAccessService.saveDomainObject(categoryParameterOption, null);
+        }
+
+        return response;
+    }
+
+    private CategoryParameter getCategoryParameter( String categoryName) {
+        List<CategoryParameter> categoryParameters = dataAccessService.getList(CategoryParameter.class, String.format(" where name = '%s' ", categoryName), null, null);
+        if (categoryParameters.size() != 1) {
+            String msg = "There is no category parameter with name " + categoryName;
+            LOG.debug(msg);
+            throw new UnfoundedCategoryException(msg);
+        }
+
+
+        return categoryParameters.get(0);
+    }
+
+    @Override
+    public AddCategoryOptionResponse updateCategoryParameterOption(String categoryName, CategoryParameterOptionRep option) {
+        AddCategoryOptionResponse response = new AddCategoryOptionResponse(new ArrayList<>());
+        CategoryParameter categoryParameter = getCategoryParameter(categoryName);
+        if (!categoryParameter.isIdSupported()) {
+            String msg = "Updating option name for category: " + categoryName + ", is not allowed";
+            LOG.debug(msg);
+            throw new ForbiddenException(msg);
+        }
+        Optional<CategoryParameterOption> categoryParameterOptionOptional = categoryParameter.getOptions().stream().filter(x->x.getAppId().equals(option.getId())).findFirst();
+        if (!categoryParameterOptionOptional.isPresent()) {
+            String msg = "There is no option with id "+option.getId() + " for category " + categoryName;
+            LOG.debug(msg);
+            throw new UnfoundedCategoryOptionException(msg);
+        }
+        CategoryParameterOption categoryParameterOption = categoryParameterOptionOptional.get();
+        Optional<CategoryParameterOption> alreadyExistOptionWithName = categoryParameter.getOptions().stream().filter(x->x.getName().equals(option.getName())).findFirst();
+        if (alreadyExistOptionWithName.isPresent() && !alreadyExistOptionWithName.get().getAppId().equals(categoryParameterOption.getAppId())) {
+            String msg = "Option with name "+option.getName() + " already exist for category " + categoryName;
+            LOG.debug(msg);
+            throw new AlreadyExistOptionNameException(msg);
+        }
+
+        categoryParameterOption.setName(option.getName());
+        dataAccessService.saveDomainObject(categoryParameterOption, null);
+
+        return response;
+    }
+
+    @Override
+    public void deleteCategoryOption(String categoryName, CategoryParameterOption option) throws IOException {
+        List<CategoryParameter> categoryParameters = dataAccessService.getList(CategoryParameter.class, String.format(" where name = '%s'", categoryName), null, null);
+        if (categoryParameters.size() != 1) {
+            String msg = "There is no category parameter with name " + categoryName;
+            LOG.debug(msg);
+            throw new UnfoundedCategoryException(msg);
+        }
+        CategoryParameter categoryParameter = categoryParameters.get(0);
+        Set<CategoryParameterOption> categoryOptions = categoryParameter.getOptions();
+        for (CategoryParameterOption categoryOption: categoryOptions) {
+            if(categoryOption.getName().equals(option.getName()))
+            {
+                dataAccessService.deleteDomainObject(categoryOption, null);
+            }
+        }
+    }
+
+}
+
diff --git a/vid-app-common/src/main/java/org/onap/vid/services/ChangeManagementService.java b/vid-app-common/src/main/java/org/onap/vid/services/ChangeManagementService.java
new file mode 100644
index 0000000..bf08331
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/services/ChangeManagementService.java
@@ -0,0 +1,32 @@
+package org.onap.vid.services;
+
+import fj.data.Either;
+import org.apache.commons.lang3.tuple.Pair;
+import org.json.JSONObject;
+import org.onap.vid.changeManagement.*;
+import org.json.simple.JSONArray;
+import org.onap.vid.mso.rest.Request;
+import org.springframework.http.ResponseEntity;
+import org.springframework.web.multipart.MultipartFile;
+
+import java.util.Collection;
+import java.util.List;
+
+public interface ChangeManagementService {
+    Collection<Request> getMSOChangeManagements() throws Exception;
+	ResponseEntity<String> doChangeManagement(ChangeManagementRequest request, String vnfName) throws Exception;
+    JSONArray getSchedulerChangeManagements();
+
+    /**
+     * Deleting a scheduled flow.
+     * @param scheduleId - the ID of the schedule.
+     * @return - a pair, left - String representation of the response, right - response code.
+     */
+    Pair<String, Integer> deleteSchedule(String scheduleId);
+    VnfWorkflowRelationResponse addVnfWorkflowRelation(VnfWorkflowRelationRequest vnfWorkflowRelationRequest);
+    List<String> getWorkflowsForVnf(GetVnfWorkflowRelationRequest getVnfWorkflowRelationRequest);
+    VnfWorkflowRelationResponse deleteVnfWorkflowRelation(VnfWorkflowRelationRequest vnfWorkflowRelationRequest);
+    VnfWorkflowRelationAllResponse getAllVnfWorkflowRelations();
+    String uploadConfigUpdateFile(MultipartFile file) throws Exception;
+
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/services/ChangeManagementServiceImpl.java b/vid-app-common/src/main/java/org/onap/vid/services/ChangeManagementServiceImpl.java
new file mode 100644
index 0000000..078f449
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/services/ChangeManagementServiceImpl.java
@@ -0,0 +1,303 @@
+package org.onap.vid.services;
+
+import org.apache.commons.lang3.tuple.ImmutablePair;
+import org.apache.commons.lang3.tuple.Pair;
+import org.hibernate.NonUniqueObjectException;
+import org.json.JSONObject;
+import org.json.simple.JSONArray;
+import org.json.simple.parser.JSONParser;
+import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
+import org.openecomp.portalsdk.core.service.DataAccessService;
+import org.openecomp.portalsdk.core.util.SystemProperties;
+import org.onap.vid.changeManagement.*;
+import org.onap.vid.exceptions.NotFoundException;
+import org.onap.vid.model.VNFDao;
+import org.onap.vid.model.VidWorkflow;
+import org.onap.vid.mso.MsoBusinessLogic;
+import org.onap.vid.mso.MsoResponseWrapperInterface;
+import org.onap.vid.mso.rest.Request;
+import org.onap.vid.scheduler.SchedulerProperties;
+import org.onap.vid.scheduler.SchedulerRestInterfaceFactory;
+import org.onap.vid.scheduler.SchedulerRestInterfaceIfc;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.ResponseEntity;
+import org.springframework.stereotype.Service;
+import org.springframework.util.StringUtils;
+import org.springframework.web.multipart.MultipartFile;
+
+import javax.ws.rs.BadRequestException;
+import java.util.*;
+import java.util.stream.Collectors;
+
+
+@Service
+public class ChangeManagementServiceImpl implements ChangeManagementService {
+
+    private final static String primaryKey = "payload";
+    private final static Set<String> requiredKeys = new HashSet<>(Arrays.asList("request-parameters", "configuration-parameters"));
+    private final DataAccessService dataAccessService;
+    private EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(ChangeManagementServiceImpl.class);
+    private MsoBusinessLogic msoBusinessLogic;
+    @Autowired
+    private CsvService csvService;
+
+    @Autowired
+    public ChangeManagementServiceImpl(DataAccessService dataAccessService, MsoBusinessLogic msoBusinessLogic) {
+        this.dataAccessService = dataAccessService;
+        this.msoBusinessLogic = msoBusinessLogic;
+    }
+
+    @Override
+    public Collection<Request> getMSOChangeManagements() throws Exception {
+        Collection<Request> result = null;
+            return msoBusinessLogic.getOrchestrationRequestsForDashboard();
+    }
+
+    private RequestDetails findRequestByVnfName(List<RequestDetails> requests, String vnfName) {
+
+        if (requests == null)
+            return null;
+
+        for (RequestDetails requestDetails : requests) {
+            if (requestDetails.getVnfName().equals(vnfName)) {
+                return requestDetails;
+            }
+        }
+
+        return null;
+    }
+
+    @Override
+    public ResponseEntity<String> doChangeManagement(ChangeManagementRequest request, String vnfName) throws Exception {
+        if (request == null)
+            return null;
+        ResponseEntity<String> response;
+        RequestDetails currentRequestDetails = findRequestByVnfName(request.getRequestDetails(), vnfName);
+        MsoResponseWrapperInterface msoResponseWrapperObject = null;
+        if (currentRequestDetails != null) {
+
+            String serviceInstanceId = extractServiceInstanceId(currentRequestDetails, request.getRequestType());
+            String vnfInstanceId = extractVnfInstanceId(currentRequestDetails, request.getRequestType());
+            String requestType = request.getRequestType();
+            try {
+                switch (requestType.toLowerCase()) {
+                    case ChangeManagementRequest.UPDATE: {
+                        msoResponseWrapperObject = msoBusinessLogic.updateVnf(currentRequestDetails, serviceInstanceId, vnfInstanceId);
+                        break;
+                    }
+                    case ChangeManagementRequest.REPLACE: {
+                        msoResponseWrapperObject = msoBusinessLogic.replaceVnf(currentRequestDetails, serviceInstanceId, vnfInstanceId);
+                        break;
+                    }
+                    case ChangeManagementRequest.VNF_IN_PLACE_SOFTWARE_UPDATE: {
+                        msoResponseWrapperObject = msoBusinessLogic.updateVnfSoftware(currentRequestDetails, serviceInstanceId, vnfInstanceId);
+                        break;
+                    }
+                    case ChangeManagementRequest.CONFIG_UPDATE: {
+                        msoResponseWrapperObject = msoBusinessLogic.updateVnfConfig(currentRequestDetails, serviceInstanceId, vnfInstanceId);
+                        break;
+                    }
+                }
+                response = new ResponseEntity<String>(msoResponseWrapperObject.getResponse(), HttpStatus.OK);
+                return response;
+            } catch (Exception e) {
+                logger.error("Failure during doChangeManagement with request " + request.toString(), e);
+                throw e;
+            }
+
+        }
+
+        // AH:TODO: return ChangeManagementResponse
+        return null;
+    }
+
+    private String extractVnfInstanceId(RequestDetails currentRequestDetails, String requestType) {
+        if (currentRequestDetails.getVnfInstanceId() == null) {
+            logger.error("Failed to extract vnfInstanceId");
+            throw new BadRequestException("No vnfInstanceId in request " + requestType);
+        }
+        return currentRequestDetails.getVnfInstanceId();
+    }
+
+    private String extractServiceInstanceId(RequestDetails currentRequestDetails, String requestType) {
+        try {
+            String serviceInstanceId = currentRequestDetails.getRelatedInstList().get(0).getRelatedInstance().getInstanceId();
+            serviceInstanceId.toString(); //throw exception in case that serviceInstanceId is null...
+            return serviceInstanceId;
+        } catch (Exception e) {
+            logger.error("Failed to extract serviceInstanceId");
+            throw new BadRequestException("No instanceId in request " + requestType);
+        }
+    }
+
+    @Override
+    public JSONArray getSchedulerChangeManagements() {
+        JSONArray result = null;
+        try {
+            String path = SystemProperties.getProperty(SchedulerProperties.SCHEDULER_GET_SCHEDULES);
+            org.onap.vid.scheduler.RestObject<String> restObject = new org.onap.vid.scheduler.RestObject<>();
+            SchedulerRestInterfaceIfc restClient = SchedulerRestInterfaceFactory.getInstance();
+
+            String str = new String();
+            restObject.set(str);
+            restClient.Get(str, "", path, restObject);
+            String restCallResult = restObject.get();
+            JSONParser parser = new JSONParser();
+            Object parserResult = parser.parse(restCallResult);
+            result = (JSONArray) parserResult;
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+
+        return result;
+    }
+
+    @Override
+    public Pair<String, Integer> deleteSchedule(String scheduleId) {
+        try {
+            String path = String.format(SystemProperties.getProperty(SchedulerProperties.SCHEDULER_DELETE_SCHEDULE), scheduleId);
+            org.onap.vid.scheduler.RestObject<String> restObject = new org.onap.vid.scheduler.RestObject<>();
+            SchedulerRestInterfaceIfc restClient = SchedulerRestInterfaceFactory.getInstance();
+            String str = new String();
+            restObject.set(str);
+            restClient.Delete(str, "", path, restObject);
+            String restCallResult = restObject.get();
+            return new ImmutablePair<>(restCallResult, restObject.getStatusCode());
+        } catch (Exception e) {
+            logger.error(e.getMessage(), e);
+            return new ImmutablePair<>(e.getMessage(), HttpStatus.INTERNAL_SERVER_ERROR.value());
+        }
+    }
+
+    @Override
+    public VnfWorkflowRelationResponse addVnfWorkflowRelation(VnfWorkflowRelationRequest vnfWorkflowRelationRequest) {
+        VnfWorkflowRelationResponse vnfWorkflowRelationResponse = new VnfWorkflowRelationResponse();
+        for (WorkflowsDetail workflowsDetail : vnfWorkflowRelationRequest.getWorkflowsDetails()) {
+            if (StringUtils.isEmpty(workflowsDetail.getVnfDetails().getUUID()) ||
+                    StringUtils.isEmpty(workflowsDetail.getVnfDetails().getInvariantUUID())) {
+                vnfWorkflowRelationResponse.getErrors().add("Using empty UUID or invariantUUID is not allowed. Relation details: " + workflowsDetail.toString());
+                continue;
+            }
+            @SuppressWarnings("unchecked") List<VNFDao> vnfList = dataAccessService.getList(VNFDao.class, getVnfQueryString(workflowsDetail.getVnfDetails().getUUID(), workflowsDetail.getVnfDetails().getInvariantUUID()), null, null);
+            if (vnfList.size() == 0) {
+                vnfList.add(saveNewVnf(workflowsDetail));
+            }
+            @SuppressWarnings("unchecked") List<VidWorkflow> workflowList = dataAccessService.getList(VidWorkflow.class, String.format(" where wokflowName = '%s'", workflowsDetail.getWorkflowName()), null, null);
+            if (workflowList.size() == 0) {
+                vnfWorkflowRelationResponse.getErrors().add("Not Found instance of workflow " + workflowsDetail.getWorkflowName() + " for vnf with UUID " + workflowsDetail.getVnfDetails().getUUID() + " and with invariantUUID " + workflowsDetail.getVnfDetails().getInvariantUUID());
+                continue;
+            }
+            vnfList.get(0).getWorkflows().add(workflowList.get(0));
+            try {
+                dataAccessService.saveDomainObject(vnfList.get(0), null);
+            } catch (NonUniqueObjectException e) {
+                //In case the relation already exists, we continue running on the list
+            }
+        }
+        return vnfWorkflowRelationResponse;
+    }
+
+    @Override
+    public VnfWorkflowRelationResponse deleteVnfWorkflowRelation(VnfWorkflowRelationRequest vnfWorkflowRelationRequest) {
+        VnfWorkflowRelationResponse vnfWorkflowRelationResponse = new VnfWorkflowRelationResponse();
+        for (WorkflowsDetail workflowsDetail : vnfWorkflowRelationRequest.getWorkflowsDetails()) {
+            @SuppressWarnings("unchecked") List<VNFDao> vnfList = dataAccessService.getList(VNFDao.class, getVnfQueryString(workflowsDetail.getVnfDetails().getUUID(), workflowsDetail.getVnfDetails().getInvariantUUID()), null, null);
+            if (vnfList.size() != 1) {
+                vnfWorkflowRelationResponse.getErrors().add("Found " + vnfList.size() + " instances of vnf with UUID " + workflowsDetail.getVnfDetails().getUUID() + " and vnfInvariantUUID " + workflowsDetail.getVnfDetails().getInvariantUUID());
+                continue;
+            }
+            VidWorkflow vidWorkflow = getWorkflowOfVnf(vnfList.get(0), workflowsDetail.getWorkflowName());
+            if (vidWorkflow == null) {
+                vnfWorkflowRelationResponse.getErrors().add("Not Found instance of workflow " + workflowsDetail.getWorkflowName() + " for vnf with UUID " + workflowsDetail.getVnfDetails().getUUID() + " and with invariantUUID " + workflowsDetail.getVnfDetails().getInvariantUUID());
+                continue;
+            }
+            vnfList.get(0).getWorkflows().remove(vidWorkflow);
+            dataAccessService.saveDomainObject(vnfList.get(0), null);
+        }
+        return vnfWorkflowRelationResponse;
+
+    }
+
+    @Override
+    public List<String> getWorkflowsForVnf(GetVnfWorkflowRelationRequest getVnfWorkflowRelationRequest) {
+        List<VNFDao> vnfDaoList = new ArrayList<>();
+        List<Set<String>> workflowsList = new ArrayList<>();
+        getVnfDaoList(vnfDaoList, getVnfWorkflowRelationRequest);
+        getWorkflowsList(workflowsList, vnfDaoList);
+        return intersectWorkflows(workflowsList);
+    }
+
+    private void getVnfDaoList(List<VNFDao> vnfDaoList, GetVnfWorkflowRelationRequest getVnfWorkflowRelationRequest) {
+        for (VnfDetails vnfDetails : getVnfWorkflowRelationRequest.getVnfDetails()) {
+            @SuppressWarnings("unchecked") List<VNFDao> vnfList = dataAccessService.getList(VNFDao.class, getVnfQueryString(vnfDetails.getUUID(), vnfDetails.getInvariantUUID()), null, null);
+            if (vnfList.size() != 1) {
+                throw new NotFoundException("Found" + vnfList.size() + " instances of vnf with UUID" + vnfDetails.getUUID() + " and vnfInvariantUUID" + vnfDetails.getInvariantUUID());
+            }
+            vnfDaoList.add(vnfList.get(0));
+        }
+    }
+
+    private void getWorkflowsList(List<Set<String>> workflowsList, List<VNFDao> vnfDaoList) {
+        for (VNFDao vnfDao : vnfDaoList) {
+            Set<String> tempWorkflows = vnfDao.getWorkflows().stream().map(VidWorkflow::getWokflowName).collect(Collectors.toSet());
+            workflowsList.add(tempWorkflows);
+        }
+    }
+
+    private List<String> intersectWorkflows(List<Set<String>> workflowsList) {
+        Set<String> workflows = workflowsList.get(0);
+        for (Set<String> workflow : workflowsList) {
+            workflows.retainAll(workflow);
+        }
+        return new ArrayList<>(workflows);
+    }
+
+    private String getVnfQueryString(String UUID, String invariantUUID) {
+        return " where vnfInvariantUUID = '" + invariantUUID + "' and vnfUUID = '" + UUID + "'";
+    }
+
+    private VidWorkflow getWorkflowOfVnf(VNFDao vnfDao, String workflowName) {
+        VidWorkflow vidWorkflowRes = null;
+        for (VidWorkflow vidWorkflow : vnfDao.getWorkflows()) {
+            if (vidWorkflow.getWokflowName().equals(workflowName)) {
+                vidWorkflowRes = vidWorkflow;
+            }
+        }
+        return vidWorkflowRes;
+    }
+
+    private VNFDao saveNewVnf(WorkflowsDetail workflowsDetail) {
+        VNFDao vnfDao = new VNFDao();
+        vnfDao.setVnfUUID(workflowsDetail.getVnfDetails().getUUID());
+        vnfDao.setVnfInvariantUUID(workflowsDetail.getVnfDetails().getInvariantUUID());
+        dataAccessService.saveDomainObject(vnfDao, null);
+        return vnfDao;
+    }
+
+    @Override
+    public VnfWorkflowRelationAllResponse getAllVnfWorkflowRelations() {
+        @SuppressWarnings("unchecked") List<VNFDao> vnfList = dataAccessService.getList(VNFDao.class, null);
+        return new VnfWorkflowRelationAllResponse(
+                vnfList.stream()
+                        .map(VnfDetailsWithWorkflows::new)
+                        .collect(Collectors.toList()));
+    }
+
+    @Override
+    public String uploadConfigUpdateFile(MultipartFile file)
+            throws Exception {
+        JSONObject json = csvService.convertCsvToJson(csvService.readCsv(file));
+        if (!validateJsonOutput(json))
+            throw new BadRequestException("Invalid csv file");
+        json = json.getJSONObject(primaryKey);
+        json = new JSONObject().put(primaryKey, json.toString());
+        return json.toString();
+    }
+
+    private boolean validateJsonOutput(org.json.JSONObject json) {
+        if (!json.has(primaryKey) || !json.getJSONObject(primaryKey).keySet().containsAll(requiredKeys))
+            return false;
+        return true;
+    }
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/services/CsvService.java b/vid-app-common/src/main/java/org/onap/vid/services/CsvService.java
new file mode 100644
index 0000000..248068f
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/services/CsvService.java
@@ -0,0 +1,15 @@
+package org.onap.vid.services;
+
+import org.json.JSONObject;
+import org.springframework.web.multipart.MultipartFile;
+
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.util.List;
+
+public interface CsvService {
+    List<String[]> readCsv(String filePath) throws IOException;
+    JSONObject convertCsvToJson (List<String[]> myEntries) throws InstantiationException, IllegalAccessException;
+    List<String[]> readCsv(MultipartFile file) throws IOException;
+
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/services/CsvServiceImpl.java b/vid-app-common/src/main/java/org/onap/vid/services/CsvServiceImpl.java
new file mode 100644
index 0000000..8152dae
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/services/CsvServiceImpl.java
@@ -0,0 +1,250 @@
+//package org.onap.vid.services;
+//
+////import com.opencsv.CSVReader;
+//import org.json.JSONArray;
+//import org.json.JSONObject;
+//import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
+//import org.springframework.stereotype.Service;
+//import org.springframework.web.multipart.MultipartFile;
+//
+//import javax.ws.rs.BadRequestException;
+//import java.io.FileNotFoundException;
+//import java.io.FileReader;
+//import java.io.IOException;
+//import java.io.InputStreamReader;
+//import java.util.ArrayList;
+//import java.util.Arrays;
+//import java.util.List;
+//
+//import static org.onap.vid.utils.Logging.getMethodName;
+//
+//@Service
+//public class CsvServiceImpl implements CsvService{
+//
+//
+//    /** The logger. */
+//    static EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(CsvServiceImpl.class);
+//
+//    private static final String arrayRegex = "\\[(.*?)\\]";
+//
+//
+//    /**
+//     * In UTF-8 the first line starts with "\uFEFF" so need to remove it
+//     * @param line is first line contains BOM
+//     * @return line after change
+//     */
+//    private String [] removeBOMFromCsv(String [] line){
+//        if (line.length>0)
+//            line[0] = line[0].replaceFirst("\uFEFF","").replaceFirst("ï»¿","");
+//        return line;
+//    }
+//
+//    /**
+//     * read a csv file and puts its content in list of string arrays (without the empty lines)
+//     * @param filePath - the path of file to read
+//     * @return the content of file
+//     * @throws IOException
+//     */
+//    /*@Override
+//    public List<String[]> readCsv(String filePath) throws IOException {
+//        CSVReader reader = new CSVReader(new FileReader(filePath));
+//        return readCsv(reader);
+//    }
+//
+//    @Override
+//    public List<String[]> readCsv(MultipartFile file) throws IOException {
+//        CSVReader reader = new CSVReader(new InputStreamReader(file.getInputStream()));
+//        return readCsv(reader);
+//    }
+//
+//    private List<String[]> addLineWithoutSpaces(List<String[]> myEntries, String [] line){
+//        line = Arrays.stream(line).filter(x -> !"".equals(x)).toArray(String[]::new);
+//        if(line.length > 0)
+//            myEntries.add(line);
+//        return myEntries;
+//    }
+//
+//
+//    private  List<String[]> readCsv(CSVReader reader) throws IOException {
+//        try {
+//            List<String[]> myEntries = new ArrayList<>() ;
+//            String [] line;
+//            Boolean firstLine = true;
+//            while ((line = reader.readNext())!= null) {
+//                if (firstLine) {
+//                    line = removeBOMFromCsv(line);
+//                    firstLine = false;
+//                }
+//                myEntries = addLineWithoutSpaces(myEntries, line);
+//            }
+//            return myEntries;
+//        }
+//        catch (Exception e){
+//            logger.error("error during reading CSV file. exception:" + e.getMessage());
+//            throw e;
+//        }
+//
+//    }*/
+//
+//    /**
+//     * main function that call to the recursive function with initial parameters
+//     * @param myEntries - the matrix with file content
+//     * @return the json
+//     * @throws IOException
+//     * @throws InstantiationException
+//     * @throws IllegalAccessException
+//     */
+//    @Override
+//    public JSONObject convertCsvToJson (List<String[]> myEntries) throws InstantiationException, IllegalAccessException {
+//        try {
+//            return buildJSON(myEntries, 0, 0, myEntries.size(), JSONObject.class);
+//        }
+//        catch (Exception e){
+//            logger.error("error during parsing CSV file. exception:" + e.getMessage());
+//            throw e;
+//        }
+//
+//    }
+//
+//    /**
+//     * it goes over the matrix column while the values are the same and returns the index of changed value
+//     * @param myEntries the matrix
+//     * @param i row index refer to the whole matrix
+//     * @param j column index
+//     * @param numLines the length of the current inner matrix
+//     * @param startLine row index of inner matrix
+//     * @return the index of changed line
+//     */
+//    private int findIndexOfChangedLine(List<String[]> myEntries, final int i, final int j, final int numLines, final int startLine) {
+//        int k;
+//        for(k = 0; k + i - startLine < numLines && myEntries.get(i)[j].equals(myEntries.get(k + i)[j]) ; k++);
+//        return k;
+//    }
+//
+//    /**
+//     *  check in array if its first element or if the key already exist in the previous item
+//     * @param jsonArray - the array to search in
+//     * @param key - the key to check
+//     * @return if exists or first element return true, otherwise- false
+//     */
+//    private Boolean keyExistsOrFirstElement( JSONArray jsonArray,String key){
+//        Boolean exists = false;
+//        Boolean first = false;
+//        JSONObject lastItem = lastItemInArray(jsonArray);
+//        if (lastItem == null) {
+//            first = true;
+//        }
+//        else {
+//            if (lastItem.has(key)) {
+//                exists = true;
+//            }
+//        }
+//        return exists||first;
+//    }
+//
+//    /**
+//     * return last json in json array
+//     * @param jsonArray
+//     * @return last item or null if the array is empty
+//     */
+//    private JSONObject lastItemInArray(JSONArray jsonArray){
+//        JSONObject lastItem = null;
+//        if(jsonArray.length()>0) {
+//            lastItem = (JSONObject) jsonArray.get(jsonArray.length() - 1);
+//        }
+//        return lastItem;
+//    }
+//
+//    /**
+//     * append current json to the main json
+//     * @param json - the main json to append to it
+//     * @param key - key to append
+//     * @param values - value(s) to append
+//     * @param <T> can be JSONObject or JSONArray
+//     * @param <E> string or jsonObject or jsonArray
+//     * @return json after put
+//     * @throws IllegalAccessException
+//     * @throws InstantiationException
+//     */
+//    private <T, E> T putJson(T json, String key, E values) throws IllegalAccessException, InstantiationException {
+//        if (json instanceof JSONArray){
+//            JSONArray currentJson= ((JSONArray)json);
+//            if (values == null) //array of strings (for last item)
+//            {
+//                currentJson.put(key);
+//            }
+//            else {
+//                if (keyExistsOrFirstElement(currentJson, key)) {
+//                    currentJson.put(new JSONObject().put(key, values));
+//                } else {
+//                    JSONObject lastItem = lastItemInArray(currentJson);
+//                    lastItem.put(key, values);
+//                }
+//            }
+//        }
+//        if (json instanceof JSONObject){
+//            if (values == null)
+//                throw new BadRequestException("Invalid csv file");
+//            ((JSONObject)json).put(key,values);
+//        }
+//        return json;
+//    }
+//
+//
+//    /**
+//     *  recursive function to build JSON. Each time it counts the same values in left and send the smaller matrix
+//     *  (until the changed value) to the next time.
+//     *
+//     * @param myEntries - the whole matrix
+//     * @param i- row index of the whole matrix
+//     * @param j - column index
+//     * @param numLines - number of lines of inner matrix (num of same values in the left column)
+//     * @param clazz JSONArray or JSONObject
+//     * @param <T> JSONArray or JSONObject
+//     * @return the json object
+//     * @throws IllegalAccessException
+//     * @throws InstantiationException
+//     */
+//    private <T> T buildJSON(List<String[]> myEntries, int i, final int j, final int numLines, Class<T> clazz) throws IllegalAccessException, InstantiationException {
+//        logger.debug(EELFLoggerDelegate.debugLogger, "start {}({}, {}, {})", getMethodName(), i, j, numLines);
+//        T json = clazz.newInstance();
+//        int startLine = i;
+//        while(i < numLines + startLine){
+//            String[] currentRow = myEntries.get(i);
+//            int length = currentRow.length;
+//            int currentDuplicateRows = findIndexOfChangedLine(myEntries,i,j,numLines, startLine);
+//            String key = currentRow[j];
+//            if (j == length-1) {
+//                json = putJson(json,currentRow[j],null);
+//
+//            }
+//            else
+//            {
+//                if (key.matches(arrayRegex)){
+//                    JSONArray arrayObjects = buildJSON(myEntries, i, j + 1, currentDuplicateRows, JSONArray.class);
+//                    json = putJson(json,key.replaceAll("\\[","").replaceAll("]",""),arrayObjects);
+//                }
+//                else {
+//                    if (j < length - 2) {
+//                        json = putJson(json, currentRow[j], buildJSON(myEntries, i, j + 1, currentDuplicateRows, JSONObject.class));
+//                    }
+//                    else
+//                    {
+//                        if (j == length - 2)//last object
+//                        {
+//                            if(currentDuplicateRows > 1) {
+//                                throw new BadRequestException("Invalid csv file");
+//                            }
+//                            json = putJson(json, currentRow[j], currentRow[j + 1]);
+//                        }
+//                    }
+//                }
+//            }
+//            i += currentDuplicateRows;
+//        }
+//        logger.debug(EELFLoggerDelegate.debugLogger, "end {} json = {}", getMethodName(), json);
+//        return json;
+//    }
+//
+//}
+//
diff --git a/vid-app-common/src/main/java/org/onap/vid/services/RoleGenaratorServiceImpl.java b/vid-app-common/src/main/java/org/onap/vid/services/RoleGenaratorServiceImpl.java
new file mode 100644
index 0000000..ea2cea5
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/services/RoleGenaratorServiceImpl.java
@@ -0,0 +1,164 @@
+package org.onap.vid.services;
+
+import jline.internal.Log;
+import org.junit.Test;
+import org.onap.vid.aai.*;
+import org.onap.vid.model.ModelConstants;
+import org.onap.vid.model.Subscriber;
+import org.onap.vid.model.SubscriberList;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.HashMap;
+
+@Service
+public class RoleGenaratorServiceImpl implements RoleGeneratorService {
+
+    @Autowired
+    AaiClientInterface client;
+
+    public static final String dbName =  "vid_portal";
+    public static final String  tblName = "fn_role";
+    public static final String tempDelimiter ="***";
+    public static final String oldDelimiter = "_";
+
+    @Override
+    public String generateRoleScript(Boolean firstRun) {
+        String query =  "USE " + dbName + ";\r\n" +
+                "SET SQL_SAFE_UPDATES = 0;\r\n";
+        try {
+            AaiResponse<SubscriberList> subscribers = client.getAllSubscribers();
+            if (firstRun) {
+                query += replaceRolesToTempDelimiter("subscriber",buildSubscribersValuesForMappingsTable(subscribers.getT()));
+            }
+            query += addAvailableRolesCombination(firstRun, subscribers);
+
+        }
+        catch (Exception e) {
+            Log.error("There was an error in updating roles "+e.getMessage());
+        }
+        return query;
+    }
+
+    private String addAvailableRolesCombination(Boolean firstRun, AaiResponse<SubscriberList> subscribers) {
+        String query, availableRoles="";
+        HashMap<String,String> servicesNames = new HashMap<String,String>();
+        for (Subscriber subscriber: subscribers.getT().customer) {
+            AaiResponse<Services> subscriberResponse = client.getSubscriberData(subscriber.globalCustomerId);
+            for(ServiceSubscription service: subscriberResponse.getT().serviceSubscriptions.serviceSubscription) {
+                servicesNames.put(service.serviceType,"");
+                String roleName = "'" + subscriber.subscriberName + ModelConstants.ROLE_DELIMITER + service.serviceType + "'";
+                availableRoles += "("+roleName+"),";
+
+
+            }
+        }
+        availableRoles = availableRoles.substring(0,availableRoles.length()-1);
+        query = createTemporaryTableAvailableRoles(availableRoles);
+        if (firstRun){
+            query += replaceRolesToTempDelimiter("service",buildServicesValuesForMappingsTable(servicesNames));
+            query += replaceToNewDelimiter();
+            query += deleteWrongRecords();
+
+        }
+        query += insertAvailableRolesToFnRole();
+        query += dropTemporaryTable("available_roles");
+        return query;
+    }
+
+    private String buildSubscribersValuesForMappingsTable(SubscriberList subscribers){
+        String query="";
+        for (Subscriber subscriber : subscribers.customer) {
+            String subscriberName = subscriber.subscriberName.contains(oldDelimiter) ? subscriber.subscriberName.replace(oldDelimiter, tempDelimiter) : subscriber.subscriberName;
+            query = query + "('" + subscriber.globalCustomerId + "','" + subscriberName + "') ,";
+        }
+        if(query.length() > 0)
+            query = query.substring(0, query.length()-1) + ";\r\n";
+        return query;
+    }
+
+    private String buildServicesValuesForMappingsTable(HashMap<String,String> servicesNames){
+        final String[] query = {""};
+        servicesNames.forEach((k,v)->{
+            if (k.contains(oldDelimiter)) {
+                query[0] += "('" + k + "' ,'" + k.replace(oldDelimiter, tempDelimiter) +"'),";
+            }
+        });
+        if(query[0].length() > 0)
+            query[0] = query[0].substring(0, query[0].length()-1) + ";\r\n";
+        return query[0];
+    }
+
+    private String replaceRolesToTempDelimiter(String entityName, String valuesForMappingsTable ) {
+
+        AaiResponse<Services> services = client.getServices();
+        String query = "";
+        if (valuesForMappingsTable.length() > 0) {
+            query = "CREATE TEMPORARY TABLE IF NOT EXISTS " + entityName + "Mappings(mapKey VARCHAR(255),mapValue VARCHAR(255));\r\n" +
+                    "INSERT INTO " + entityName + "Mappings VALUES ";
+            query += valuesForMappingsTable;
+            query += "UPDATE " + tblName + "\r\n" +
+                    "INNER JOIN " + entityName + "Mappings ON role_name LIKE concat('%',mapKey, '%')\r\n" +
+                    "SET ROLE_NAME = REPLACE(ROLE_NAME, mapKey, mapValue) ;  \r\n" +
+                    dropTemporaryTable(entityName + "Mappings");
+        }
+        return query;
+    }
+
+    private String replaceToNewDelimiter(){
+        String query =  "UPDATE " + tblName + "\r\n" +
+                "SET ROLE_NAME = REPLACE(ROLE_NAME, '" + oldDelimiter + "', '" + ModelConstants.ROLE_DELIMITER + "');\r\n" ;
+        query += "UPDATE fn_role\r\n" +
+                "SET ROLE_NAME = REPLACE(ROLE_NAME, '" + tempDelimiter + "', '" + oldDelimiter + "');\r\n" ;
+        return query;
+    }
+
+    private String insertAvailableRolesToFnRole(){
+        String query="INSERT INTO fn_role (ROLE_NAME, ACTIVE_YN, PRIORITY)\r\n" +
+                "SELECT RNAME, 'Y', 5\r\n" +
+                "FROM available_roles\r\n" +
+                "WHERE NOT EXISTS (SELECT ROLE_NAME\r\n" +
+                "FROM fn_role \r\n" +
+                "where RNAME = ROLE_NAME);\r\n";
+        return query;
+    }
+
+
+
+    private String createTemporaryTableAvailableRoles(String availableRoles) {
+        String query = "CREATE TEMPORARY TABLE IF NOT EXISTS available_roles(rname VARCHAR(255));\r\n";
+        query += "INSERT INTO available_roles VALUES "+availableRoles+";\r\n";
+                return query;
+    }
+
+    private String deleteWrongRecords(){
+        String query ="CREATE TEMPORARY TABLE IF NOT EXISTS wrong_roles(roleID INT);\r\n" +
+                "INSERT INTO wrong_roles (roleID)\r\n" +
+                "SELECT ROLE_ID FROM fn_role LEFT JOIN available_roles ON role_name LIKE concat(rname, '%')\r\n" +
+                "WHERE available_roles.rname IS NULL AND ROLE_ID NOT IN (1,16);\r\n";
+        query += deleteCascade();
+        query += dropTemporaryTable("wrong_roles");
+        return query;
+    }
+
+    private String deleteCascade() {
+        String query = deleteFromTableByRoles("fn_role_composite", "PARENT_ROLE_ID");
+        query = query.substring(0, query.length()-1);
+        query += " OR wrong_roles.ROLEID = fn_role_composite.CHILD_ROLE_ID;\r\n";
+        query += deleteFromTableByRoles("fn_role_function", "ROLE_ID")+ "\r\n";
+        query += deleteFromTableByRoles("fn_user_role", "ROLE_ID")+ "\r\n";
+        query += deleteFromTableByRoles("fn_role", "ROLE_ID")+ "\r\n";
+        return query;
+    }
+
+    private String deleteFromTableByRoles(String table, String column) {
+        String query = "DELETE FROM " + table + "\r\n";
+        query += "using  " + table + " inner join wrong_roles\r\n" +
+                "where wrong_roles.ROLEID = " + table + "." + column + ";";
+        return query;
+    }
+
+    private String dropTemporaryTable(String table) {
+        return "DROP TEMPORARY TABLE IF EXISTS " + table + ";\r\n";
+    }
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/services/RoleGeneratorService.java b/vid-app-common/src/main/java/org/onap/vid/services/RoleGeneratorService.java
new file mode 100644
index 0000000..2bc96a5
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/services/RoleGeneratorService.java
@@ -0,0 +1,5 @@
+package org.onap.vid.services;
+
+public interface RoleGeneratorService {
+    String generateRoleScript(Boolean firstRun);
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/services/VidService.java b/vid-app-common/src/main/java/org/onap/vid/services/VidService.java
new file mode 100644
index 0000000..328fad0
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/services/VidService.java
@@ -0,0 +1,17 @@
+package org.onap.vid.services;
+
+import org.onap.vid.asdc.AsdcCatalogException;
+import org.onap.vid.asdc.beans.Service;
+import org.onap.vid.model.ServiceModel;
+
+import java.util.Collection;
+import java.util.Map;
+
+public interface VidService {
+
+	Collection<Service> getServices(Map<String, String[]> requestParams)
+			throws AsdcCatalogException;
+
+	ServiceModel getService(String uuid) throws AsdcCatalogException;
+
+}
\ No newline at end of file
diff --git a/vid-app-common/src/main/java/org/onap/vid/services/VidServiceImpl.java b/vid-app-common/src/main/java/org/onap/vid/services/VidServiceImpl.java
new file mode 100644
index 0000000..8196643
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/services/VidServiceImpl.java
@@ -0,0 +1,79 @@
+package org.onap.vid.services;
+
+import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
+import org.openecomp.sdc.tosca.parser.exceptions.SdcToscaParserException;
+import org.onap.vid.asdc.AsdcCatalogException;
+import org.onap.vid.asdc.AsdcClient;
+import org.onap.vid.asdc.beans.Service;
+import org.onap.vid.asdc.parser.ToscaParser;
+import org.onap.vid.asdc.parser.ToscaParserImpl;
+import org.onap.vid.asdc.parser.ToscaParserImpl2;
+import org.onap.vid.model.ServiceModel;
+import org.springframework.beans.factory.annotation.Autowired;
+
+import java.nio.file.Path;
+import java.util.Collection;
+import java.util.Map;
+import java.util.UUID;
+
+/**
+ * The Class VidController.
+ */
+
+public class VidServiceImpl implements VidService {
+    /**
+     * The Constant LOG.
+     */
+    private static final EELFLoggerDelegate LOG = EELFLoggerDelegate.getLogger(VidServiceImpl.class);
+    /**
+     * The Constant dateFormat.
+     */
+    protected final AsdcClient asdcClient;
+    @Autowired
+    private ToscaParserImpl2 toscaParser;
+
+    public VidServiceImpl(AsdcClient asdcClient) {
+        this.asdcClient = asdcClient;
+    }
+
+    /*
+     * (non-Javadoc)
+     *
+     * @see org.openecomp.vid.controller.VidService#getServices(java.util.Map)
+     */
+    @Override
+    public Collection<Service> getServices(Map<String, String[]> requestParams)
+            throws AsdcCatalogException {
+        return asdcClient.getServices(requestParams);
+    }
+
+    /*
+     * (non-Javadoc)
+     *
+     * @see org.openecomp.vid.controller.VidService#getService(java.lang.String)
+     */
+    @Override
+    public ServiceModel getService(String uuid) throws AsdcCatalogException {
+        final Path serviceCsar = asdcClient.getServiceToscaModel(UUID.fromString(uuid));
+        ToscaParser tosca = new ToscaParserImpl();
+        serviceCsar.toFile().getAbsolutePath();
+        ServiceModel serviceModel = null;
+        try {
+            final Service asdcServiceMetadata = asdcClient.getService(UUID.fromString(uuid));
+            return getServiceModel(uuid, serviceCsar, tosca, asdcServiceMetadata);
+        } catch (Exception e) {
+            LOG.error("Failed to download and proccess service from ASDC", e);
+        }
+        return serviceModel;
+    }
+
+    private ServiceModel getServiceModel(String uuid, Path serviceCsar, ToscaParser tosca, Service asdcServiceMetadata) throws Exception {
+        try {
+            return toscaParser.makeServiceModel(serviceCsar, asdcServiceMetadata);
+        } catch (SdcToscaParserException e) {
+            return tosca.makeServiceModel(uuid, serviceCsar, asdcServiceMetadata);
+        }
+    }
+
+
+}
\ No newline at end of file
diff --git a/vid-app-common/src/main/java/org/onap/vid/services/WorkflowService.java b/vid-app-common/src/main/java/org/onap/vid/services/WorkflowService.java
new file mode 100644
index 0000000..ea13908
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/services/WorkflowService.java
@@ -0,0 +1,9 @@
+package org.onap.vid.services;
+
+import org.onap.vid.model.Workflow;
+import java.util.Collection;
+
+public interface WorkflowService {
+    Collection<String> getWorkflowsForVNFs(Collection<String> vnfNames);
+    Collection<String> getAllWorkflows();
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/services/WorkflowServiceImpl.java b/vid-app-common/src/main/java/org/onap/vid/services/WorkflowServiceImpl.java
new file mode 100644
index 0000000..037c49c
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/services/WorkflowServiceImpl.java
@@ -0,0 +1,40 @@
+package org.onap.vid.services;
+
+import org.onap.vid.model.Workflow;
+import org.springframework.stereotype.Service;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.stream.Collectors;
+
+@Service
+public class WorkflowServiceImpl implements WorkflowService {
+    //TODO: Add the list of workflows hard coded or from DB.
+    private ArrayList<Workflow> workflows = new ArrayList<>(Arrays.asList(
+            new Workflow(0, "Upgrade", new ArrayList<>(Arrays.asList("VNF1", "VNF2", "VNF3", "VNF4"))),
+            new Workflow(1, "Clean", new ArrayList<>(Arrays.asList("VNF1", "VNF2", "VNF3"))),
+            new Workflow(2, "Reinstall", new ArrayList<>(Arrays.asList("VNF1", "VNF2", "VNF4"))),
+            new Workflow(3, "Dump", new ArrayList<>(Arrays.asList("VNF1", "VNF3", "VNF4"))),
+            new Workflow(4, "Flush", new ArrayList<>(Arrays.asList("VNF2", "VNF3", "VNF4")))
+    ));
+
+    @Override
+    public Collection<String> getWorkflowsForVNFs(Collection<String> vnfNames) {
+        Collection<String> result = workflows.stream()
+                .filter(workflow -> workflow.getVnfNames().containsAll(vnfNames))
+                .map(workflow -> workflow.getWorkflowName())
+                .distinct()
+                .collect(Collectors.toList());
+
+        return result;
+    }
+
+    @Override
+    public Collection<String> getAllWorkflows() {
+        return workflows.stream()
+                .map(workflow -> workflow.getWorkflowName())
+                .distinct()
+                .collect(Collectors.toList());
+    }
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/utils/Intersection.java b/vid-app-common/src/main/java/org/onap/vid/utils/Intersection.java
new file mode 100644
index 0000000..6e0d1fc
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/utils/Intersection.java
@@ -0,0 +1,31 @@
+package org.onap.vid.utils;
+
+import java.util.List;
+import java.util.stream.Collectors;
+
+/**
+ * Created by moriya1 on 10/10/2017.
+ */
+public class Intersection<T> {
+    public List<T> intersectMultipileArray(List<List<T>> lists) {
+        if (lists.size() == 1) {
+            return lists.get(0);
+        } else {
+            List<T> intersectResult = intersectTwoArrays(lists.get(0),lists.get(1));
+
+            lists.remove(0);
+            lists.remove(0);
+            lists.add(0,intersectResult);
+            return intersectMultipileArray(lists);
+        }
+
+    }
+
+    public List<T> intersectTwoArrays(List<T> list1, List<T> list2) {
+
+        List<T> intersect = list1.stream()
+                .filter(list2::contains)
+                .collect(Collectors.toList());
+        return intersect;
+    }
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/utils/Logging.java b/vid-app-common/src/main/java/org/onap/vid/utils/Logging.java
new file mode 100644
index 0000000..16dde56
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/utils/Logging.java
@@ -0,0 +1,105 @@
+package org.onap.vid.utils;
+
+import com.att.eelf.configuration.EELFLogger;
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
+import org.openecomp.portalsdk.core.util.SystemProperties;
+import org.springframework.http.HttpMethod;
+import org.springframework.web.context.request.RequestContextHolder;
+import org.springframework.web.context.request.ServletRequestAttributes;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.ws.rs.ProcessingException;
+import javax.ws.rs.core.Response;
+import java.util.Arrays;
+import java.util.Optional;
+
+import static org.onap.vid.utils.Streams.not;
+
+public class Logging {
+
+    private Logging() {
+    }
+
+    public static final String HTTP_REQUESTS_OUTGOING = "http.requests.outgoing.";
+
+    public static final String requestIdHeaderKey = SystemProperties.ECOMP_REQUEST_ID;
+
+    private static ObjectMapper objectMapper = new ObjectMapper();
+
+    public static String getMethodName() {
+        return getMethodName(0);
+    }
+
+    public static String getMethodCallerName() {
+        return getMethodName(1);
+    }
+
+    private static String getMethodName(int depth) {
+        final StackTraceElement[] stackTrace = Thread.currentThread().getStackTrace();
+        String thisClassName = stackTrace[1].getClassName();
+        final Optional<String> caller =
+                Arrays.stream(stackTrace)
+                        .skip(1)
+                        .filter(not(frame -> frame.getClassName().equals(thisClassName)))
+                        .skip(depth)
+                        .map(StackTraceElement::getMethodName)
+                        .findFirst();
+        return caller.orElse("<unknonwn method name>");
+    }
+
+    public static EELFLogger getRequestsLogger(String serverName) {
+        return EELFLoggerDelegate.getLogger(HTTP_REQUESTS_OUTGOING +serverName);
+    }
+
+    public static void logRequest(final EELFLogger logger, final HttpMethod method, final String url, final Object body) {
+        if (!logger.isDebugEnabled()) {
+            return;
+        }
+
+        if (body == null) {
+            logRequest(logger, method, url);
+            return;
+        }
+
+        try {
+            String bodyAsJson = objectMapper.writeValueAsString(body);
+            logger.debug("Sending  {} {} Body: {}", method.name(), url, bodyAsJson);
+        } catch (JsonProcessingException e) {
+            logRequest(logger, method, url);
+            logger.debug("Failed to parse object in logRequest. {}", body);
+        }
+    }
+
+    public static void logRequest(final EELFLogger logger, final HttpMethod method, final String url) {
+        logger.debug("Sending  {} {}", method.name(), url);
+    }
+
+    public static <T> void logResponse(final EELFLogger logger, final HttpMethod method, final String url, final Response response, final Class<T> entityClass) {
+        if (!logger.isDebugEnabled()) {
+            return;
+        }
+        if (response == null) {
+            logger.debug("Received {} {} response: null", method.name(), url);
+            return;
+        }
+        try {
+            response.bufferEntity();
+            logger.debug("Received {} {} Status: {} . Body: {}", method.name(), url, response.getStatus(), response.readEntity(entityClass));
+        }
+        catch (ProcessingException | IllegalStateException e) {
+            logger.debug("Received {} {} Status: {} . Failed to read response as {}", method.name(), url, response.getStatus(), entityClass.getName());
+        }
+    }
+
+    public static void logResponse(final EELFLogger logger, final HttpMethod method, final String url, final Response response) {
+        logResponse(logger, method, url, response, String.class);
+    }
+
+    public static HttpServletRequest getHttpServletRequest(){
+        return ((ServletRequestAttributes) RequestContextHolder.currentRequestAttributes()).getRequest();
+    }
+
+
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/utils/Streams.java b/vid-app-common/src/main/java/org/onap/vid/utils/Streams.java
new file mode 100644
index 0000000..7f81b22
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/utils/Streams.java
@@ -0,0 +1,47 @@
+package org.onap.vid.utils;
+
+import java.util.Iterator;
+import java.util.Spliterator;
+import java.util.Spliterators;
+import java.util.function.Consumer;
+import java.util.function.Predicate;
+import java.util.stream.Stream;
+import java.util.stream.StreamSupport;
+
+public class Streams {
+    public static <R> Predicate<R> not(Predicate<R> predicate) {
+        return predicate.negate();
+    }
+
+    public static <T> Stream<T> fromIterator(final Iterator<T> iterator) {
+        Iterable<T> iterable = () -> iterator;
+        return StreamSupport.<T>stream(iterable.spliterator(), false);
+    }
+
+
+    // https://stackoverflow.com/questions/20746429/limit-a-stream-by-a-predicate
+    private static <T> Spliterator<T> takeWhile(
+            Spliterator<T> splitr, Predicate<? super T> predicate) {
+        return new Spliterators.AbstractSpliterator<T>(splitr.estimateSize(), 0) {
+            boolean stillGoing = true;
+            @Override public boolean tryAdvance(Consumer<? super T> consumer) {
+                if (stillGoing) {
+                    boolean hadNext = splitr.tryAdvance(elem -> {
+                        if (predicate.test(elem)) {
+                            consumer.accept(elem);
+                        } else {
+                            stillGoing = false;
+                        }
+                    });
+                    return hadNext && stillGoing;
+                }
+                return false;
+            }
+        };
+    }
+
+    public static <T> Stream<T> takeWhile(Stream<T> stream, Predicate<? super T> predicate) {
+        return StreamSupport.stream(takeWhile(stream.spliterator(), predicate), false);
+    }
+
+}
diff --git a/vid-app-common/src/main/java/org/openecomp/aai/util/AAIProperties.java b/vid-app-common/src/main/java/org/openecomp/aai/util/AAIProperties.java
deleted file mode 100755
index 9716ba8..0000000
--- a/vid-app-common/src/main/java/org/openecomp/aai/util/AAIProperties.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * VID
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *      http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.aai.util;
-
-
-import org.openecomp.portalsdk.core.util.SystemProperties;
-
-/**
- * The Class AAIProperties.
- */
-public class AAIProperties extends SystemProperties {
-
-	/** The Constant AAI_SERVER_URL_BASE. */
-	//VID Specific
-	public static final String AAI_SERVER_URL_BASE = "aai.server.url.base";
-	
-	/** The Constant AAI_SERVER_URL. */
-	public static final String AAI_SERVER_URL = "aai.server.url";
-	
-	/** The Constant AAI_OLDSERVER_URL_BASE. */
-	public static final String AAI_OLDSERVER_URL_BASE = "aai.oldserver.url.base";
-	
-	/** The Constant AAI_OLDSERVER_URL. */
-	public static final String AAI_OLDSERVER_URL = "aai.oldserver.url";
-	
-	/** The Constant AAI_TRUSTSTORE_FILENAME. */
-	public static final String AAI_TRUSTSTORE_FILENAME = "aai.truststore.filename";
-	
-	/** The Constant AAI_TRUSTSTORE_PASSWD_X. */
-	public static final String AAI_TRUSTSTORE_PASSWD_X = "aai.truststore.passwd.x";
-	
-	/** The Constant AAI_KEYSTORE_FILENAME. */
-	public static final String AAI_KEYSTORE_FILENAME = "aai.keystore.filename";
-	
-	/** The Constant AAI_KEYSTORE_PASSWD_X. */
-	public static final String AAI_KEYSTORE_PASSWD_X = "aai.keystore.passwd.x";
-		
-	/** The Constant AAI_VID_USERNAME. */
-	public static final String AAI_VID_USERNAME = "aai.vid.username";
-
-	/** The Constant AAI_VID_PASSWD_X. */
-	public static final String AAI_VID_PASSWD_X = "aai.vid.passwd.x";
-	
-	/** The Constant FILESEPARTOR. */
-	public static final String FILESEPARTOR = (System.getProperty("file.separator") == null) ? "/" : System.getProperty("file.separator");
-
-	/** The Constant AAI_USE_CLIENT_CERT */
-	public static final String AAI_USE_CLIENT_CERT = "aai.use.client.cert";
-	
-}
diff --git a/vid-app-common/src/main/java/org/openecomp/aai/util/AAIRestInterface.java b/vid-app-common/src/main/java/org/openecomp/aai/util/AAIRestInterface.java
deleted file mode 100755
index d9bb5c1..0000000
--- a/vid-app-common/src/main/java/org/openecomp/aai/util/AAIRestInterface.java
+++ /dev/null
@@ -1,356 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * VID
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *      http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-package org.openecomp.aai.util;
-
-
-import java.io.UnsupportedEncodingException;
-import java.net.MalformedURLException;
-import java.net.URI;
-import java.net.URISyntaxException;
-import java.net.URL;
-import java.net.URLEncoder;
-import java.security.KeyManagementException;
-import java.text.DateFormat;
-import java.text.SimpleDateFormat;
-import java.util.Base64;
-import java.util.Date;
-import java.util.UUID;
-
-import javax.ws.rs.client.Client;
-import javax.ws.rs.client.Entity;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
-
-import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
-import org.openecomp.portalsdk.core.util.SystemProperties;
-import org.eclipse.jetty.util.security.Password;
-import org.openecomp.aai.util.AAIProperties;
-import org.openecomp.aai.util.HttpsAuthClient;
-/**
- * The Class AAIRestInterface.
- */
-public class AAIRestInterface {
-
-	/** The logger. */
-	EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(AAIRestInterface.class);
-	
-	/** The Constant dateFormat. */
-	final static DateFormat dateFormat = new SimpleDateFormat("HH:mm:ss:SSSS");
-	
-	/** The client. */
-	private static Client client = null;
-
-	/** The rest srvr base URL. */
-	private String restSrvrBaseURL;
-	
-	/** The certificate path. */
-	public String certificatePath = "";
-	
-	/**
-	 * Instantiates a new AAI rest interface.
-	 *
-	 * @param certPath the cert path
-	 */
-	public AAIRestInterface(String certPath)
-	{
-		certificatePath = certPath;
-	}
-	
-	/**
-	 * Encode URL.
-	 *
-	 * @param nodeKey the node key
-	 * @return the string
-	 * @throws UnsupportedEncodingException the unsupported encoding exception
-	 */
-	public String encodeURL (String nodeKey) throws UnsupportedEncodingException {
-		return URLEncoder.encode(nodeKey, "UTF-8").replaceAll("\\+", "%20");
-	}
-	
-	/**
-	 * Inits the rest client.
-	 */
-	private void initRestClient()
-	{
-		String methodName = "initRestClient";
-		
-		if (client == null) {
-			try {
-				client = HttpsAuthClient.getClient(certificatePath);
-			}
-			catch (KeyManagementException e){
-				logger.info(EELFLoggerDelegate.errorLogger, dateFormat.format(new Date()) +  "<== KeyManagementException in " + methodName + e.toString());
-				logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) +  "<== KeyManagementException in " + methodName + e.toString());
-			} catch (Exception e) {
-				logger.info(EELFLoggerDelegate.errorLogger, dateFormat.format(new Date()) +  "<== Exception in REST call to DB in initRestClient" + e.toString());
-				logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) +  "<== Exception in REST call to DB : " + e.toString());
-			}
-		}
-	}
-	
-	/**
-	 * Sets the rest srvr base URL.
-	 *
-	 * @param baseURL the base URL
-	 */
-	public void SetRestSrvrBaseURL(String baseURL)
-	{
-		if (baseURL == null)
-		{
-			logger.info(EELFLoggerDelegate.errorLogger, dateFormat.format(new Date()) +  "<== REST Server base URL cannot be null.");
-			logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) +  "<== REST Server base URL cannot be null.");
-		}
-			
-		restSrvrBaseURL = baseURL;
-	}
-	
-	/**
-	 * Gets the rest srvr base URL.
-	 *
-	 * @return the rest srvr base URL
-	 */
-	public String getRestSrvrBaseURL() 
-	{
-		return restSrvrBaseURL;
-	}
-	
-	
-	/**
-	 * Rest get.
-	 *
-	 * @param fromAppId the from app id
-	 * @param transId the trans id
-	 * @param requestUri the request uri
-	 * @param xml the xml
-	 * @return the string
-	 * @throws UnsupportedEncodingException 
-	 */
-	public Response RestGet(String fromAppId, String transId, String requestUri, boolean xml) throws UnsupportedEncodingException  {
-		String methodName = "RestGet";
-		
-		String responseType = "application/json";
-		if (xml)
-          	responseType = "application/xml";
-		  
-		initRestClient();
-
-		String clientCert = SystemProperties.getProperty(AAIProperties.AAI_USE_CLIENT_CERT);
-		
-		boolean useClientCert = false;
-		if (clientCert != null && 
-				SystemProperties.getProperty(AAIProperties.AAI_USE_CLIENT_CERT).equalsIgnoreCase("true")) {
-			useClientCert  = true;
-		}
-		String url = "";
-		logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
-	
-		url = SystemProperties.getProperty(AAIProperties.AAI_SERVER_URL) + requestUri;
-		
-	    try {
-	    	// what is the point of this, just to check syntax??
-		    URL urlObj= new URL(url);
-			URI uri = new URI(urlObj.getProtocol(), urlObj.getUserInfo(), urlObj.getHost(), urlObj.getPort(), urlObj.getPath(), urlObj.getQuery(), urlObj.getRef());
-			url = uri.toASCIIString();
-	    } catch (URISyntaxException | MalformedURLException e) {
-	    	 logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " +  methodName + " bad URL");
-	    	 return null;
-		}
-	    logger.debug(dateFormat.format(new Date()) + "<== " + url + " for the get REST API");
-
-	    final Response cres;
-	    if (useClientCert == true) { 
-	    	 cres = client.target(url)
-	    			 .request()
-	    	         .accept(responseType)
-	    	         .header("X-TransactionId", transId)
-	    	         .header("X-FromAppId",  fromAppId)
-	    	         .header("Content-Type", "application/json")
-	    	         .get();
-	    } else { 
-			
-			String vidUsername = SystemProperties.getProperty(AAIProperties.AAI_VID_USERNAME);
-			String vidPassword = Password.deobfuscate(SystemProperties.getProperty(AAIProperties.AAI_VID_PASSWD_X));
-			String encodeThis = vidUsername + ":" + vidPassword;
-			
-			cres = client.target(url)
-					.request()
-					.accept(responseType)
-					.header("X-TransactionId", transId)
-					.header("X-FromAppId",  fromAppId)
-					.header("Content-Type", "application/json")
-					.header("Authorization", "Basic " + Base64.getEncoder().encodeToString(encodeThis.getBytes("utf-8")))
-					.get();
-	    }
-//		String r = cres.readEntity(String.class);
-		if (cres.getStatus() == 200) {
-			logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " REST api GET was successful!");
-			logger.info(EELFLoggerDelegate.errorLogger, dateFormat.format(new Date()) + "<== " + methodName + " REST api GET was successful!");
-		} else {
-			logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName +" with status="+cres.getStatus()+", url="+url);
-		}
-		return cres;
-//		 logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName +" resp=" + r );
-//		 return r;
-	}
-	
-	
-	/**
-	 * Delete.
-	 *
-	 * @param sourceID the source ID
-	 * @param transId the trans id
-	 * @param path the path
-	 * @return true, if successful
-	 */
-	public boolean Delete(String sourceID,  String transId,  String path) {
-		String methodName = "Delete";
-		String url="";
-		transId += ":" + UUID.randomUUID().toString();
-		logger.debug(dateFormat.format(new Date()) + "<== " +  methodName + " start");
-		
-		initRestClient();
-		String request = "{}";
-		url = SystemProperties.getProperty(AAIProperties.AAI_SERVER_URL) + path;			
-		final Response cres = client.target(url)
-				 .request()
-		         .accept("application/json")
-		         .header("X-TransactionId", transId)
-		         .header("X-FromAppId",  sourceID)
-		         //.entity(request)
-		         .delete();
-		
-		if (cres.getStatus() == 404) { // resource not found
-			String msg = "Resource does not exist...: " + cres.getStatus()
-					+ ":" + cres.readEntity(String.class);
-			logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + msg);
-			return false;
-		} else if (cres.getStatus() == 200  || cres.getStatus() == 204){
-			logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + "Resource " + url + " deleted");
-			return true;
-		} else {
-			String msg = "Deleting Resource failed: " + cres.getStatus()
-				+ ":" + cres.readEntity(String.class);
-			logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + msg);
-		}
-
-		return false;
-	}
-	
-	
-	/**
-     * Rest put.
-     *
-     * @param fromAppId the from app id
-     * @param transId the trans id
-     * @param path the path
-     * @param payload the payload
-     * @param xml the xml
-     * @return the string
-     */
-    public Response RestPut(String fromAppId,  String transId,  String path, String payload, boolean xml) {
-        String methodName = "RestPost";
-        String url="";
-        transId = UUID.randomUUID().toString();
-        logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " +  methodName + " start");       
-        
-        try {
-            
-        	String responseType = "application/json";
-        	if (xml)
-               	responseType = "application/xml";
-        	   
-            initRestClient();    
-    
-            url = SystemProperties.getProperty(AAIProperties.AAI_SERVER_URL) + path;
-
-            final Response cres = client.target(url)
-                 .request()
-                 .accept(responseType)
-                 .header("X-TransactionId", transId)
-                 .header("X-FromAppId",  fromAppId)
-                 .put(Entity.entity(payload, MediaType.APPLICATION_JSON));
-            
-        	if (cres.getStatus() == 200 && cres.getStatus() <= 299) {
-        		logger.info(EELFLoggerDelegate.errorLogger, dateFormat.format(new Date()) + "<== " + methodName + " REST api POST was successful!");
-    			logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " REST api POST was successful!");
-             } else {
-    			logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName +" with status="+cres.getStatus()+", url="+url);
-    		}
-    		return cres;
-        } catch (Exception e) {
-        	logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " with url="+url+ ", Exception: " + e.toString());
-        }
-        return null;
-    }
-	
-	
-    
-    /**
-     * Rest post.
-     *
-     * @param fromAppId the from app id
-     * @param transId the trans id
-     * @param path the path
-     * @param payload the payload
-     * @param xml the xml
-     * @return the string
-     */
-    public Response RestPost(String fromAppId,  String transId,  String path, String payload, boolean xml) {
-        String methodName = "RestPost";
-        String url="";
-        transId = UUID.randomUUID().toString();
-        logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " +  methodName + " start");       
-        
-        try {
-            
-        	String responseType = "application/json";
-        	if (xml)
-               	responseType = "application/xml";
-        	   
-            initRestClient();    
-    
-            url = SystemProperties.getProperty(AAIProperties.AAI_SERVER_URL_BASE) + path;
-
-            String vidUsername = SystemProperties.getProperty(AAIProperties.AAI_VID_USERNAME);
-			String vidPassword = Password.deobfuscate(SystemProperties.getProperty(AAIProperties.AAI_VID_PASSWD_X));
-			String encodeThis = vidUsername + ":" + vidPassword;
-			
-            final Response cres = client.target(url)
-                 .request()
-                 .accept(responseType)
-                 .header("X-TransactionId", transId)
-                 .header("X-FromAppId",  fromAppId)
-                 .header("Authorization", "Basic " + Base64.getEncoder().encodeToString(encodeThis.getBytes("utf-8")))
-                 .post(Entity.entity(payload, MediaType.APPLICATION_JSON));
-            
-        	if (cres.getStatus() == 200 && cres.getStatus() <= 299) {
-        		logger.info(EELFLoggerDelegate.errorLogger, dateFormat.format(new Date()) + "<== " + methodName + " REST api POST was successful!");
-    			logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " REST api POST was successful!");
-             } else {
-    			logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName +" with status="+cres.getStatus()+", url="+url);
-    		}
-    		return cres;
-        } catch (Exception e) {
-        	logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " with url="+url+ ", Exception: " + e.toString());
-        }
-        return null;
-    }
-    
-}
diff --git a/vid-app-common/src/main/java/org/openecomp/aai/util/CustomJacksonJaxBJsonProvider.java b/vid-app-common/src/main/java/org/openecomp/aai/util/CustomJacksonJaxBJsonProvider.java
deleted file mode 100755
index 1ed0792..0000000
--- a/vid-app-common/src/main/java/org/openecomp/aai/util/CustomJacksonJaxBJsonProvider.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * VID
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *      http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.aai.util;
-
-
-import javax.ws.rs.ext.Provider;
-
-import com.fasterxml.jackson.annotation.JsonInclude;
-import com.fasterxml.jackson.databind.DeserializationFeature;
-import com.fasterxml.jackson.databind.ObjectMapper;
-import com.fasterxml.jackson.databind.SerializationFeature;
-import com.fasterxml.jackson.jaxrs.json.JacksonJaxbJsonProvider;
-import com.fasterxml.jackson.module.jaxb.JaxbAnnotationModule;
-
-/**
- * The Class CustomJacksonJaxBJsonProvider.
- */
-@Provider
-public class CustomJacksonJaxBJsonProvider extends JacksonJaxbJsonProvider {
-
-	    /** The common mapper. */
-    	private static ObjectMapper commonMapper = null;
-
-	    /**
-    	 * Instantiates a new custom jackson jax B json provider.
-    	 */
-    	public CustomJacksonJaxBJsonProvider() {
-	        if (commonMapper == null) {
-	            ObjectMapper mapper = new ObjectMapper();
-
-	            mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL);
-	            
-	            mapper.configure(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS, false);
-	            mapper.configure(SerializationFeature.INDENT_OUTPUT, false);
-	            mapper.configure(SerializationFeature.WRAP_ROOT_VALUE, false);
-
-	            mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
-	            mapper.configure(DeserializationFeature.UNWRAP_ROOT_VALUE, false);
-
-	            mapper.registerModule(new JaxbAnnotationModule());
-
-	            commonMapper = mapper;
-	        }
-	        super.setMapper(commonMapper);
-	    }
-	    
-	    /**
-    	 * Gets the mapper.
-    	 *
-    	 * @return the mapper
-    	 */
-    	public ObjectMapper getMapper() {
-	    	return commonMapper;
-	    }
-}
diff --git a/vid-app-common/src/main/java/org/openecomp/aai/util/HttpsAuthClient.java b/vid-app-common/src/main/java/org/openecomp/aai/util/HttpsAuthClient.java
deleted file mode 100755
index 3323b3f..0000000
--- a/vid-app-common/src/main/java/org/openecomp/aai/util/HttpsAuthClient.java
+++ /dev/null
@@ -1,140 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * VID
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *      http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.aai.util;
-
-
-import java.io.FileInputStream;
-import java.security.KeyManagementException;
-import java.security.KeyStore;
-
-import javax.net.ssl.HostnameVerifier;
-import javax.net.ssl.HttpsURLConnection;
-import javax.net.ssl.KeyManagerFactory;
-import javax.net.ssl.SSLContext;
-import javax.net.ssl.SSLSession;
-import javax.ws.rs.client.Client;
-import javax.ws.rs.client.ClientBuilder;
-
-import org.eclipse.jetty.util.security.Password;
-import org.glassfish.jersey.client.ClientConfig;
-import org.glassfish.jersey.client.HttpUrlConnectorProvider;
-import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
-import org.openecomp.portalsdk.core.util.SystemProperties;
-/**
- * The Class HttpsAuthClient.
- */
-public class HttpsAuthClient{
-	/** The logger. */
-	static EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(HttpsAuthClient.class);
-	
-	/**
-	 * Gets the client.
-	 *
-	 * @param certFilePath the cert file path
-	 * @return the client
-	 * @throws KeyManagementException the key management exception
-	 */
-	public static Client getClient(String certFilePath) throws KeyManagementException {
-
-		ClientConfig config = new ClientConfig();
-		//config.getFeatures().put(JSONConfiguration.FEATURE_POJO_MAPPING, Boolean.TRUE);
-		//config.getClasses().add(org.openecomp.aai.util.CustomJacksonJaxBJsonProvider.class);
-
-		try {
-			
-		    config.property(HttpUrlConnectorProvider.SET_METHOD_WORKAROUND, Boolean.TRUE );
-			
-			config.connectorProvider(new HttpUrlConnectorProvider().useSetMethodWorkaround());
-			String truststore_path = certFilePath + AAIProperties.FILESEPARTOR + SystemProperties.getProperty(AAIProperties.AAI_TRUSTSTORE_FILENAME);
-			String truststore_password = SystemProperties.getProperty(AAIProperties.AAI_TRUSTSTORE_PASSWD_X);
-			String decrypted_truststore_password = Password.deobfuscate(truststore_password);
-			
-			boolean useClientCert = false;
-			
-			String keystore_path = certFilePath + AAIProperties.FILESEPARTOR + SystemProperties.getProperty(AAIProperties.AAI_KEYSTORE_FILENAME);
-			String keystore_password = SystemProperties.getProperty(AAIProperties.AAI_KEYSTORE_PASSWD_X);
-			String decrypted_keystore_password = Password.deobfuscate(keystore_password);
-			
-			String clientCert = SystemProperties.getProperty(AAIProperties.AAI_USE_CLIENT_CERT);
-			
-			if (clientCert != null && 
-					SystemProperties.getProperty(AAIProperties.AAI_USE_CLIENT_CERT).equalsIgnoreCase("true")) {
-				useClientCert = true;
-			}
-			
-  		    System.setProperty("javax.net.ssl.trustStore", truststore_path);
-		    System.setProperty("javax.net.ssl.trustStorePassword", decrypted_truststore_password);
-			HttpsURLConnection.setDefaultHostnameVerifier( new HostnameVerifier(){
-			    public boolean verify(String string,SSLSession ssls) {
-			        return true;
-			    }
-			});
-	
-			final SSLContext ctx = SSLContext.getInstance("TLS");
-			
-			KeyManagerFactory kmf = null;
-			if (useClientCert) {
-			
-				try {
-					kmf = KeyManagerFactory.getInstance("SunX509");
-					FileInputStream fin = new FileInputStream(keystore_path);
-					KeyStore ks = KeyStore.getInstance("PKCS12");
-					char[] pwd = decrypted_keystore_password.toCharArray();
-					ks.load(fin, pwd);
-					kmf.init(ks, pwd);
-				} catch (Exception e) {
-					//System.out.println("Error setting up kmf: exiting");
-					logger.debug(EELFLoggerDelegate.debugLogger, "Error setting up kmf: exiting");
-					e.printStackTrace();
-					return null;
-				}
-				ctx.init(kmf.getKeyManagers(), null, null);
-			
-				return ClientBuilder.newBuilder()
-						.sslContext(ctx)
-						.hostnameVerifier(new HostnameVerifier() {
-							@Override
-							public boolean verify( String s, SSLSession sslSession ) {
-								return true;
-							}
-						}).withConfig(config)
-						.build()
-						.register(org.openecomp.aai.util.CustomJacksonJaxBJsonProvider.class);
-			} else { 
-				return ClientBuilder.newBuilder()
-						.hostnameVerifier(new HostnameVerifier() {
-							@Override
-							public boolean verify( String s, SSLSession sslSession ) {
-								return true;
-							}
-						}).withConfig(config)
-						.build()
-						.register(org.openecomp.aai.util.CustomJacksonJaxBJsonProvider.class);
-			}
-		} catch (Exception e) {
-			logger.debug(EELFLoggerDelegate.debugLogger, "Error setting up config: exiting");
-			//System.out.println("Error setting up config: exiting");
-			e.printStackTrace();
-			System.exit(1);
-			return null;
-		}
-	}
-}  
diff --git a/vid-app-common/src/main/java/org/openecomp/aai/util/HttpsComponentsClient.java b/vid-app-common/src/main/java/org/openecomp/aai/util/HttpsComponentsClient.java
deleted file mode 100755
index a041c65..0000000
--- a/vid-app-common/src/main/java/org/openecomp/aai/util/HttpsComponentsClient.java
+++ /dev/null
@@ -1,99 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * VID
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *      http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.aai.util;
-
-import java.io.FileInputStream;
-import java.security.KeyManagementException;
-import java.security.KeyStore;
-
-import javax.net.ssl.SSLContext;
-
-import org.apache.http.conn.ssl.SSLContextBuilder;
-import org.apache.http.impl.client.CloseableHttpClient;
-import org.apache.http.conn.ssl.SSLConnectionSocketFactory;
-import org.apache.http.impl.client.HttpClients;
-import org.eclipse.jetty.util.security.Password;
-import org.openecomp.portalsdk.core.util.SystemProperties;
-
-
-/**
- * The Class HttpsComponentsClient.
- */
-public class HttpsComponentsClient{
-	
-	/**
-	 * Gets the client.
-	 *
-	 * @param certFilePath the cert file path
-	 * @return the client
-	 * @throws KeyManagementException the key management exception
-	 */
-	public static CloseableHttpClient getClient(String certFilePath) throws Exception {
-		CloseableHttpClient httpclient = null;
-		try {
-			
-			String truststore_path = certFilePath + AAIProperties.FILESEPARTOR + SystemProperties.getProperty(AAIProperties.AAI_TRUSTSTORE_FILENAME);
-			String truststore_password = SystemProperties.getProperty(AAIProperties.AAI_TRUSTSTORE_PASSWD_X);
-			String decrypted_truststore_password = Password.deobfuscate(truststore_password);
-			String keystore_path = certFilePath + AAIProperties.FILESEPARTOR + SystemProperties.getProperty(AAIProperties.AAI_KEYSTORE_FILENAME);
-			String keystore_password = SystemProperties.getProperty(AAIProperties.AAI_KEYSTORE_PASSWD_X);
-			String decrypted_keystore_password = Password.deobfuscate(keystore_password);
-			
-			SSLContextBuilder sslContextB = new SSLContextBuilder();
-			
-			KeyStore ks = KeyStore.getInstance("PKCS12");
-			FileInputStream fin = new FileInputStream(keystore_path);
-			char[] pwd = decrypted_keystore_password.toCharArray();
-			ks.load(fin, pwd);
-			
-			sslContextB.loadKeyMaterial(ks, pwd);
-			
-			KeyStore ts = KeyStore.getInstance("JKS");
-			FileInputStream fin1 = new FileInputStream(truststore_path);
-			char[] pwd1 = decrypted_truststore_password.toCharArray();
-			ts.load(fin1, pwd1);
-			
-			sslContextB.loadTrustMaterial(ts);
-			sslContextB.loadKeyMaterial(ks, pwd);
-			sslContextB.useTLS();
-			
-			SSLContext sslcontext = sslContextB.build();
-			
-			SSLConnectionSocketFactory sslFactory = new SSLConnectionSocketFactory(
-	                sslcontext,
-	                new String[] { "TLSv1.1", "TLSv1.2" },
-	                null,
-	            	SSLConnectionSocketFactory.ALLOW_ALL_HOSTNAME_VERIFIER );
-		
-			httpclient = HttpClients.custom()
-	                .setSSLSocketFactory(sslFactory)
-	                .build();
-
-
-		} catch (Exception e) {
-			throw e;
-		}
-		return httpclient;
-	}
-
-
-	
-}  
diff --git a/vid-app-common/src/main/java/org/openecomp/aai/util/JettyObfuscationConversionCommandLineUtil.java b/vid-app-common/src/main/java/org/openecomp/aai/util/JettyObfuscationConversionCommandLineUtil.java
deleted file mode 100755
index e31b0c1..0000000
--- a/vid-app-common/src/main/java/org/openecomp/aai/util/JettyObfuscationConversionCommandLineUtil.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * VID
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *      http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.aai.util;
-
-
-import org.apache.commons.cli.BasicParser;
-import org.apache.commons.cli.CommandLine;
-import org.apache.commons.cli.CommandLineParser;
-import org.apache.commons.cli.Options;
-import org.apache.commons.cli.ParseException;
-import org.eclipse.jetty.util.security.Password;
-
-
-public class JettyObfuscationConversionCommandLineUtil {
-	/**
-	 * The main method.
-	 *
-	 * @param args the arguments
-	 */
-	public static void main(String[] args){
-		Options options = new Options();
-		options.addOption("e", true, "obfuscate the given string");
-		options.addOption("d", true, "deobfuscate the given string");
-		
-		CommandLineParser parser = new BasicParser();
-		
-		try {
-			CommandLine cmd = parser.parse(options, args);
-			String toProcess = null;
-			
-			if (cmd.hasOption("e")){
-				toProcess = cmd.getOptionValue("e");
-				String encoded = Password.obfuscate(toProcess);
-				System.out.println(encoded);
-			} else if (cmd.hasOption("d")) {
-				toProcess = cmd.getOptionValue("d");
-				String decoded_str = Password.deobfuscate(toProcess);
-				System.out.println(decoded_str);
-			} else {
-				usage();
-			}
-		} catch (ParseException e) {
-			System.out.println("failed to parse input");
-			System.out.println(e.toString());
-			usage();
-		} catch (Exception e) {
-			System.out.println("exception:" + e.toString());
-		}
-	}
-	
-	/**
-	 * Usage.
-	 */
-	private static void usage(){
-		System.out.println("usage:");;
-		System.out.println("-e [string] to obfuscate");
-		System.out.println("-d [string] to deobfuscate");
-		System.out.println("-h help");
-	}
-}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/RelatedTo.java b/vid-app-common/src/main/java/org/openecomp/vid/RelatedTo.java
deleted file mode 100644
index 48ca497..0000000
--- a/vid-app-common/src/main/java/org/openecomp/vid/RelatedTo.java
+++ /dev/null
@@ -1,36 +0,0 @@
-package org.openecomp.vid;
-
-import com.fasterxml.jackson.annotation.*;
-import org.codehaus.jackson.annotate.JsonProperty;
-
-import java.util.HashMap;
-import java.util.Map;
-
-@JsonInclude(JsonInclude.Include.NON_NULL)
-@JsonPropertyOrder({
-        "id",
-        "node-type",
-        "url"
-})
-public class RelatedTo {
-
-    @JsonProperty("id")
-    public String id;
-    @JsonProperty("node-type")
-    public String nodeType;
-    @JsonProperty("url")
-    public String url;
-    @JsonIgnore
-    private Map<String, Object> additionalProperties = new HashMap<String, Object>();
-
-    @JsonAnyGetter
-    public Map<String, Object> getAdditionalProperties() {
-        return this.additionalProperties;
-    }
-
-    @JsonAnySetter
-    public void setAdditionalProperty(String name, Object value) {
-        this.additionalProperties.put(name, value);
-    }
-
-}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/aai/AaiClient.java b/vid-app-common/src/main/java/org/openecomp/vid/aai/AaiClient.java
deleted file mode 100644
index 0f07f20..0000000
--- a/vid-app-common/src/main/java/org/openecomp/vid/aai/AaiClient.java
+++ /dev/null
@@ -1,352 +0,0 @@
-package org.openecomp.vid.aai;
-
-import org.apache.http.HttpStatus;
-import org.codehaus.jackson.map.ObjectMapper;
-import org.ecomp.aai.model.AaiAICZones.AicZones;
-import org.json.simple.JSONArray;
-import org.json.simple.JSONObject;
-import org.json.simple.parser.JSONParser;
-import org.openecomp.aai.util.AAIRestInterface;
-import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
-import org.openecomp.vid.aai.model.ServiceRelationships;
-import org.openecomp.vid.aai.model.AaiGetServicesRequestModel.GetServicesAAIRespone;
-import org.openecomp.vid.aai.model.AaiGetTenatns.GetTenantsResponse;
-import org.openecomp.vid.model.SubscriberList;
-import org.springframework.beans.factory.annotation.Autowired;
-
-import javax.servlet.ServletContext;
-import javax.ws.rs.BadRequestException;
-import javax.ws.rs.WebApplicationException;
-import javax.ws.rs.core.Response;
-import java.io.File;
-import java.io.IOException;
-import java.text.DateFormat;
-import java.text.SimpleDateFormat;
-import java.util.Date;
-import java.util.Iterator;
-import java.util.List;
-import java.util.UUID;
-
-
-/**
- * Created by Oren on 7/4/17.
- */
-public class AaiClient implements AaiClientInterface {
-
-    /**
-     * The Constant dateFormat.
-     */
-    final static DateFormat dateFormat = new SimpleDateFormat("HH:mm:ss:SSSS");
-    protected String fromAppId = "VidAaiController";
-    @Autowired
-    ServletContext servletContext;
-    /**
-     * The logger
-     */
-
-    EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(AaiClient.class);
-
-
-    public AaiClient() {
-        //        certiPath = getCertificatesFile().getAbsolutePath();
-        //        depth = "0";
-    }
-
-    public AaiClient(ServletContext context) {
-        servletContext = context;
-    }
-
-
-    private static String checkForNull(String local) {
-        if (local != null)
-            return local;
-        else
-            return "";
-
-    }
-
-    @Override
-    public AaiResponse<SubscriberList> getAllSubscribers() {
-        String certiPath = getCertificatesFile().getAbsolutePath();
-        String depth = "0";
-        Response resp = doAaiGet(certiPath, "business/customers?subscriber-type=INFRA&depth=" + depth, false);
-        return proccessAaiResponse(resp, SubscriberList.class, null);
-    }
-
-
-    @Override
-    public AaiResponse getAllAicZones() {
-        String certiPath = getCertificatesFile().getAbsolutePath();
-        Response resp = doAaiGet(certiPath, "network/zones", false);
-        AaiResponse aaiAicZones = proccessAaiResponse(resp, AicZones.class, null);
-        return aaiAicZones;
-    }
-    
-    
-	@Override
-	public AaiResponse<String> getAicZoneForPnf(String globalCustomerId , String serviceType , String serviceId) {
-		String certiPath = getCertificatesFile().getAbsolutePath();
-		String aicZonePath = "business/customers/customer/" + globalCustomerId + "/service-subscriptions/service-subscription/" + serviceType + "/service-instances/service-instance/" + serviceId;
-		Response resp = doAaiGet(certiPath , aicZonePath , false);
-		AaiResponse<ServiceRelationships> aaiResponse = proccessAaiResponse(resp , ServiceRelationships.class , null);
-		ServiceRelationships serviceRelationships = (ServiceRelationships)aaiResponse.getT();
-		String aicZone = serviceRelationships.getRelationshipList().getRelationship().get(0).getRelatedToPropertyList().get(0).getPropertyValue();
-		AaiResponse<String> aaiAicZonaForPnfResponse = new AaiResponse(aicZone , null ,HttpStatus.SC_OK);
-		return  aaiAicZonaForPnfResponse;
-	}
-    
-
-    @Override
-    public AaiResponse getVNFData() {
-        String certiPath = getCertificatesFile().getAbsolutePath();
-        String payload = "{\"start\": [\"/business/customers/customer/e433710f-9217-458d-a79d-1c7aff376d89/service-subscriptions/service-subscription/VIRTUAL%20USP/service-instances/service-instance/3f93c7cb-2fd0-4557-9514-e189b7b04f9d\"],	\"query\": \"query/vnf-topology-fromServiceInstance\"}";
-        Response resp = doAaiPut(certiPath, "query?format=simple", payload, false);
-        return proccessAaiResponse(resp, AaiGetVnfResponse.class, null);
-
-    }
-
-    @Override
-    public Response getVNFData(String globalSubscriberId, String serviceType) {
-        String certiPath = getCertificatesFile().getAbsolutePath();
-        String payload = "{\"start\": [\"business/customers/customer/" + globalSubscriberId + "/service-subscriptions/service-subscription/"+ serviceType +"/service-instances\"]," +
-                "\"query\": \"query/vnf-topology-fromServiceInstance\"}";
-        return doAaiPut(certiPath, "query?format=simple", payload, false);
-
-    }
-
-    @Override
-    public AaiResponse getVNFData(String globalSubscriberId, String serviceType, String serviceInstanceId) {
-        String certiPath = getCertificatesFile().getAbsolutePath();
-        String payload = "{\"start\": [\"/business/customers/customer/" + globalSubscriberId + "/service-subscriptions/service-subscription/" + serviceType + "/service-instances/service-instance/" + serviceInstanceId + "\"],	\"query\": \"query/vnf-topology-fromServiceInstance\"}";
-        Response resp = doAaiPut(certiPath, "query?format=simple", payload, false);
-        return proccessAaiResponse(resp, AaiGetVnfResponse.class, null);
-    }
-
-    @Override
-    public Response getVersionByInvariantId(List<String> modelInvariantId) {
-        File certiPath = getCertificatesFile();
-        StringBuilder sb = new StringBuilder();
-        for (String id : modelInvariantId){
-            sb.append("&model-invariant-id=");
-            sb.append(id);
-
-        }
-        Response resp = doAaiGet(certiPath.getAbsolutePath(), "service-design-and-creation/models?depth=2"+ sb.toString(), false);
-        return resp;
-    }
-
-    @Override
-    public AaiResponse getSubscriberData(String subscriberId) {
-        File certiPath = getCertificatesFile();
-        String depth = "2";
-        AaiResponse subscriberDataResponse;
-        Response resp = doAaiGet(certiPath.getAbsolutePath(), "business/customers/customer/" + subscriberId + "?depth=" + depth, false);
-        subscriberDataResponse = proccessAaiResponse(resp, Services.class, null);
-        return subscriberDataResponse;
-    }
-
-    @Override
-    public AaiResponse getServices() {
-        File certiPath = getCertificatesFile();
-        Response resp = doAaiGet(certiPath.getAbsolutePath(), "service-design-and-creation/services", false);
-        AaiResponse<GetServicesAAIRespone> getServicesResponse = proccessAaiResponse(resp, GetServicesAAIRespone.class, null);
-
-        return getServicesResponse;
-    }
-
-    @Override
-    public AaiResponse getTenants(String globalCustomerId, String serviceType) {
-        File certiPath = getCertificatesFile();
-        String url = "business/customers/customer/" + globalCustomerId + "/service-subscriptions/service-subscription/" + serviceType;
-
-        Response resp = doAaiGet(certiPath.getAbsolutePath(), url, false);
-        String responseAsString = parseForTenantsByServiceSubscription(resp.readEntity(String.class));
-
-        AaiResponse<GetTenantsResponse[]> getTenantsResponse = proccessAaiResponse(resp, GetTenantsResponse[].class, responseAsString);
-        return getTenantsResponse;
-    }
-
-    private AaiResponse proccessAaiResponse(Response resp, Class classType, String responseBody) {
-        AaiResponse subscriberDataResponse;
-        if (resp == null) {
-            subscriberDataResponse = new AaiResponse<>(null, null, HttpStatus.SC_INTERNAL_SERVER_ERROR);
-            logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + "Invalid response from AAI");
-        } else {
-            logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + "getSubscribers() resp=" + resp.getStatusInfo().toString());
-            if (resp.getStatus() != HttpStatus.SC_OK) {
-                logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + "Invalid response from AAI");
-                subscriberDataResponse = new AaiResponse<>(null, resp.readEntity(String.class), resp.getStatus());
-            } else {
-                String finalResponse;
-                try {
-                    if (responseBody != null) {
-                        finalResponse = responseBody;
-                    } else {
-                        finalResponse = resp.readEntity(String.class);
-                    }
-
-                    subscriberDataResponse = new AaiResponse<>((new ObjectMapper().readValue(finalResponse, classType)), null, HttpStatus.SC_OK);
-
-                } catch (IOException e) {
-                    subscriberDataResponse = new AaiResponse<>(null, null, HttpStatus.SC_INTERNAL_SERVER_ERROR);
-                }
-
-            }
-        }
-        return subscriberDataResponse;
-    }
-
-    private File getCertificatesFile() {
-        if (servletContext != null)
-            return new File(servletContext.getRealPath("/WEB-INF/cert/"));
-        return null;
-    }
-
-    @SuppressWarnings("all")
-    protected Response doAaiGet(String certiPath, String uri, boolean xml) {
-        String methodName = "doAaiGet";
-        String transId = UUID.randomUUID().toString();
-        logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
-
-        Response resp = null;
-        try {
-
-            AAIRestInterface restContrller = new AAIRestInterface(certiPath);
-            resp = restContrller.RestGet(fromAppId, transId, uri, xml);
-
-        } catch (WebApplicationException e) {
-            final String message = ((BadRequestException) e).getResponse().readEntity(String.class);
-            logger.info(EELFLoggerDelegate.errorLogger, dateFormat.format(new Date()) + "<== " + "." + methodName + message);
-            logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + "." + methodName + message);
-        } catch (Exception e) {
-            logger.info(EELFLoggerDelegate.errorLogger, dateFormat.format(new Date()) + "<== " + "." + methodName + e.toString());
-            logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + "." + methodName + e.toString());
-        }
-
-        return resp;
-    }
-
-    private String parseForTenantsByServiceSubscription(String resp) {
-        String tenantList = "";
-
-        try {
-            JSONParser jsonParser = new JSONParser();
-
-            JSONObject jsonObject = (JSONObject) jsonParser.parse(resp);
-
-            return parseServiceSubscriptionObjectForTenants(jsonObject);
-        } catch (Exception ex) {
-
-        }
-
-        return tenantList;
-    }
-
-    protected Response doAaiPut(String certiPath, String uri, String payload, boolean xml) {
-        String methodName = "doAaiPut";
-        String transId = UUID.randomUUID().toString();
-        logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
-
-        Response resp = null;
-        try {
-
-            AAIRestInterface restContrller = new AAIRestInterface(certiPath);
-            resp = restContrller.RestPut(fromAppId, transId, uri, payload, xml);
-
-        } catch (Exception e) {
-            logger.info(EELFLoggerDelegate.errorLogger, dateFormat.format(new Date()) + "<== " + "." + methodName + e.toString());
-            logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + "." + methodName + e.toString());
-        }
-
-        return resp;
-    }
-
-
-    public static String parseServiceSubscriptionObjectForTenants(JSONObject jsonObject) {
-
-        JSONArray tenantArray = new JSONArray();
-        boolean bconvert = false;
-
-        try {
-            JSONObject relationShipListsObj = (JSONObject) jsonObject.get("relationship-list");
-            if (relationShipListsObj != null) {
-                JSONArray rShipArray = (JSONArray) relationShipListsObj.get("relationship");
-                if (rShipArray != null) {
-                    Iterator i1 = rShipArray.iterator();
-
-                    while (i1.hasNext()) {
-
-                        JSONObject inner1Obj = (JSONObject) i1.next();
-
-                        if (inner1Obj == null)
-                            continue;
-
-                        String relatedTo = checkForNull((String) inner1Obj.get("related-to"));
-                        if (relatedTo.equalsIgnoreCase("tenant")) {
-                            JSONObject tenantNewObj = new JSONObject();
-
-                            String relatedLink = checkForNull((String) inner1Obj.get("related-link"));
-                            tenantNewObj.put("link", relatedLink);
-
-                            JSONArray rDataArray = (JSONArray) inner1Obj.get("relationship-data");
-                            if (rDataArray != null) {
-                                Iterator i2 = rDataArray.iterator();
-
-                                while (i2.hasNext()) {
-                                    JSONObject inner2Obj = (JSONObject) i2.next();
-
-                                    if (inner2Obj == null)
-                                        continue;
-
-                                    String rShipKey = checkForNull((String) inner2Obj.get("relationship-key"));
-                                    String rShipVal = checkForNull((String) inner2Obj.get("relationship-value"));
-                                    if (rShipKey.equalsIgnoreCase("cloud-region.cloud-owner")) {
-                                        tenantNewObj.put("cloudOwner", rShipVal);
-                                    } else if (rShipKey.equalsIgnoreCase("cloud-region.cloud-region-id")) {
-                                        tenantNewObj.put("cloudRegionID", rShipVal);
-                                    }
-
-                                    if (rShipKey.equalsIgnoreCase("tenant.tenant-id")) {
-                                        tenantNewObj.put("tenantID", rShipVal);
-                                    }
-                                }
-                            }
-
-                            JSONArray relatedTPropArray = (JSONArray) inner1Obj.get("related-to-property");
-                            if (relatedTPropArray != null) {
-                                Iterator i3 = relatedTPropArray.iterator();
-
-                                while (i3.hasNext()) {
-                                    JSONObject inner3Obj = (JSONObject) i3.next();
-
-                                    if (inner3Obj == null)
-                                        continue;
-
-                                    String propKey = checkForNull((String) inner3Obj.get("property-key"));
-                                    String propVal = checkForNull((String) inner3Obj.get("property-value"));
-                                    if (propKey.equalsIgnoreCase("tenant.tenant-name")) {
-                                        tenantNewObj.put("tenantName", propVal);
-                                    }
-                                }
-                            }
-                            bconvert = true;
-                            tenantArray.add(tenantNewObj);
-                        }
-                    }
-
-                }
-            }
-        } catch (NullPointerException ex) {
-
-
-        }
-
-        if (bconvert)
-            return tenantArray.toJSONString();
-        else
-            return "";
-
-    }
-
-
-}
\ No newline at end of file
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/aai/AaiClientInterface.java b/vid-app-common/src/main/java/org/openecomp/vid/aai/AaiClientInterface.java
deleted file mode 100644
index f1b1ba2..0000000
--- a/vid-app-common/src/main/java/org/openecomp/vid/aai/AaiClientInterface.java
+++ /dev/null
@@ -1,33 +0,0 @@
-package org.openecomp.vid.aai;
-
-import org.openecomp.vid.aai.model.AaiGetTenatns.GetTenantsResponse;
-import org.openecomp.vid.model.SubscriberList;
-
-import javax.ws.rs.core.Response;
-import java.util.List;
-
-/**
- * Created by Oren on 7/4/17.
- */
-public interface AaiClientInterface {
-
-    AaiResponse<SubscriberList> getAllSubscribers();
-
-    AaiResponse getSubscriberData(String subscriberId);
-
-    AaiResponse getServices();
-
-    AaiResponse<GetTenantsResponse[]> getTenants(String globalCustomerId, String serviceType);
-    
-    AaiResponse getAllAicZones();
-    
-    AaiResponse getAicZoneForPnf(String globalCustomerId , String serviceType , String serviceId);
-
-	AaiResponse getVNFData();
-
-    Response getVNFData(String globalSubscriberId, String serviceType);
-
-    AaiResponse getVNFData(String globalSubscriberId, String serviceType, String serviceInstanceId);
-
-    Response getVersionByInvariantId(List<String> modelInvariantId);
-}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/aai/AaiGetVnfResponse.java b/vid-app-common/src/main/java/org/openecomp/vid/aai/AaiGetVnfResponse.java
deleted file mode 100644
index 7c9d44b..0000000
--- a/vid-app-common/src/main/java/org/openecomp/vid/aai/AaiGetVnfResponse.java
+++ /dev/null
@@ -1,28 +0,0 @@
-package org.openecomp.vid.aai;
-
-import com.fasterxml.jackson.annotation.*;
-
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-@JsonInclude(JsonInclude.Include.NON_NULL)
-@JsonPropertyOrder({
-        "results"
-})
-public class AaiGetVnfResponse {
-    @JsonProperty("results")
-    public List<VnfResult> results = null;
-    @JsonIgnore
-    private Map<String, Object> additionalProperties = new HashMap<String, Object>();
-
-    @JsonAnyGetter
-    public Map<String, Object> getAdditionalProperties() {
-        return this.additionalProperties;
-    }
-
-    @JsonAnySetter
-    public void setAdditionalProperty(String name, Object value) {
-        this.additionalProperties.put(name, value);
-    }
-}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/aai/AaiResponse.java b/vid-app-common/src/main/java/org/openecomp/vid/aai/AaiResponse.java
deleted file mode 100644
index 337d137..0000000
--- a/vid-app-common/src/main/java/org/openecomp/vid/aai/AaiResponse.java
+++ /dev/null
@@ -1,21 +0,0 @@
-package org.openecomp.vid.aai;
-
-import org.openecomp.vid.model.ProxyResponse;
-
-/**
- * Created by Oren on 7/10/17.
- */
-public class AaiResponse<T> extends ProxyResponse{
-
-    T t;
-
-    public AaiResponse(T t, String errorMessage, int aaiHttpCode) {
-        this.t = t;
-        this.errorMessage = errorMessage;
-        this.httpCode = aaiHttpCode;
-    }
-
-    public T getT() {
-        return t;
-    }
-}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/aai/ServiceInstance.java b/vid-app-common/src/main/java/org/openecomp/vid/aai/ServiceInstance.java
deleted file mode 100644
index 45f7947..0000000
--- a/vid-app-common/src/main/java/org/openecomp/vid/aai/ServiceInstance.java
+++ /dev/null
@@ -1,33 +0,0 @@
-package org.openecomp.vid.aai;
-
-import org.codehaus.jackson.annotate.JsonIgnoreProperties;
-import org.codehaus.jackson.annotate.JsonProperty;
-
-@JsonIgnoreProperties(ignoreUnknown = true)
-public class ServiceInstance {
-	
-	@JsonProperty("service-instance-id")
-	public String serviceInstanceId;
-
-	@JsonProperty("service-instance-name")
-	public String serviceInstanceName;
-	
-	@JsonProperty("persona-model-id")
-	public String personaModelId;
-	
-	@JsonProperty("persona-model-version")
-	public String personaModelVersion;
-	
-	@JsonProperty("resource-version")
-	public String resourceVersion;
-	
-	@JsonProperty("orchestration-status")
-	public String orchestrationStatus;
-
-	@JsonProperty("model-invariant-id")
-	public String modelInvariantId;
-
-	@JsonProperty("model-version-id")
-	public String modelVersionId;
-
-}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/aai/ServiceInstances.java b/vid-app-common/src/main/java/org/openecomp/vid/aai/ServiceInstances.java
deleted file mode 100644
index 063317e..0000000
--- a/vid-app-common/src/main/java/org/openecomp/vid/aai/ServiceInstances.java
+++ /dev/null
@@ -1,14 +0,0 @@
-package org.openecomp.vid.aai;
-
-import org.codehaus.jackson.annotate.JsonIgnoreProperties;
-import org.codehaus.jackson.annotate.JsonProperty;
-
-import java.util.List;
-
-@JsonIgnoreProperties(ignoreUnknown = true)
-public class ServiceInstances {
-	
-	@JsonProperty("service-instance")
-	public List<ServiceInstance> serviceInstance;
-
-}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/aai/ServiceProperties.java b/vid-app-common/src/main/java/org/openecomp/vid/aai/ServiceProperties.java
deleted file mode 100644
index 113f113..0000000
--- a/vid-app-common/src/main/java/org/openecomp/vid/aai/ServiceProperties.java
+++ /dev/null
@@ -1,90 +0,0 @@
-package org.openecomp.vid.aai;
-
-import com.fasterxml.jackson.annotation.*;
-import org.codehaus.jackson.annotate.JsonProperty;
-
-import java.util.HashMap;
-import java.util.Map;
-
-@JsonInclude(JsonInclude.Include.NON_NULL)
-@JsonPropertyOrder({
-        "service-instance-id",
-        "service-instance-name",
-        "model-invariant-id",
-        "model-version-id",
-        "resource-version",
-        "orchestration-status",
-        "global-customer-id",
-        "subscriber-name",
-        "subscriber-type",
-        "vnf-id",
-        "vnf-name",
-        "vnf-type",
-        "service-id",
-        "prov-status",
-        "in-maint",
-        "is-closed-loop-disabled",
-        "model-customization-id",
-        "nf-type",
-        "nf-function",
-        "nf-role",
-        "nf-naming-code"
-})
-public class ServiceProperties {
-
-    @JsonProperty("service-instance-id")
-    public String serviceInstanceId;
-    @JsonProperty("service-instance-name")
-    public String serviceInstanceName;
-    @JsonProperty("model-invariant-id")
-    public String modelInvariantId;
-    @JsonProperty("model-version-id")
-    public String modelVersionId;
-    @JsonProperty("resource-version")
-    public String resourceVersion;
-    @JsonProperty("orchestration-status")
-    public String orchestrationStatus;
-    @JsonProperty("global-customer-id")
-    public String globalCustomerId;
-    @JsonProperty("subscriber-name")
-    public String subscriberName;
-    @JsonProperty("subscriber-type")
-    public String subscriberType;
-    @JsonProperty("vnf-id")
-    public String vnfId;
-    @JsonProperty("vnf-name")
-    public String vnfName;
-    @JsonProperty("vnf-type")
-    public String vnfType;
-    @JsonProperty("service-id")
-    public String serviceId;
-    @JsonProperty("prov-status")
-    public String provStatus;
-    @JsonProperty("in-maint")
-    public Boolean inMaint;
-    @JsonProperty("is-closed-loop-disabled")
-    public Boolean isClosedLoopDisabled;
-    @JsonProperty("model-customization-id")
-    public String modelCustomizationId;
-    @JsonProperty("nf-type")
-    public String nfType;
-    @JsonProperty("nf-function")
-    public String nfFunction;
-    @JsonProperty("nf-role")
-    public String nfRole;
-    @JsonProperty("nf-naming-code")
-    public String nfNamingCode;
-    @JsonIgnore
-    private Map<String, Object> additionalProperties = new HashMap<String, Object>();
-
-    @JsonAnyGetter
-    public Map<String, Object> getAdditionalProperties() {
-        return this.additionalProperties;
-    }
-
-    @JsonAnySetter
-    public void setAdditionalProperty(String name, Object value) {
-        this.additionalProperties.put(name, value);
-    }
-
-}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/aai/ServiceSubscription.java b/vid-app-common/src/main/java/org/openecomp/vid/aai/ServiceSubscription.java
deleted file mode 100644
index 6a178d9..0000000
--- a/vid-app-common/src/main/java/org/openecomp/vid/aai/ServiceSubscription.java
+++ /dev/null
@@ -1,20 +0,0 @@
-package org.openecomp.vid.aai;
-
-import org.codehaus.jackson.annotate.JsonIgnoreProperties;
-import org.codehaus.jackson.annotate.JsonProperty;
-
-@JsonIgnoreProperties(ignoreUnknown = true)
-public class ServiceSubscription {
-	
-    @JsonProperty("service-type")
-    public String serviceType;
-
-    @JsonProperty("resource-version")
-    public String resourceVersion;
-
-    @JsonProperty("service-instances")
-    public ServiceInstances serviceInstances;
-
-    @JsonProperty("is-permitted")
-    public boolean isPermitted =false;
-}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/aai/ServiceSubscriptions.java b/vid-app-common/src/main/java/org/openecomp/vid/aai/ServiceSubscriptions.java
deleted file mode 100644
index eaadba2..0000000
--- a/vid-app-common/src/main/java/org/openecomp/vid/aai/ServiceSubscriptions.java
+++ /dev/null
@@ -1,17 +0,0 @@
-package org.openecomp.vid.aai;
-
-import org.codehaus.jackson.annotate.JsonIgnoreProperties;
-import org.codehaus.jackson.annotate.JsonProperty;
-
-import java.util.List;
-
-/**
- * Created by Oren on 7/9/17.
- */
-@JsonIgnoreProperties(ignoreUnknown = true)
-
-public class ServiceSubscriptions {
-
-    @JsonProperty("service-subscription")
-    public List<ServiceSubscription> serviceSubscription;
-}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/aai/Services.java b/vid-app-common/src/main/java/org/openecomp/vid/aai/Services.java
deleted file mode 100644
index e8148a9..0000000
--- a/vid-app-common/src/main/java/org/openecomp/vid/aai/Services.java
+++ /dev/null
@@ -1,24 +0,0 @@
-package org.openecomp.vid.aai;
-
-import org.codehaus.jackson.annotate.JsonIgnoreProperties;
-import org.codehaus.jackson.annotate.JsonProperty;
-
-@JsonIgnoreProperties(ignoreUnknown = true)
-public class Services {
-    @JsonProperty("global-customer-id")
-    public String globalCustomerId;
-
-    @JsonProperty("subscriber-name")
-    public String subscriberName;
-
-    @JsonProperty("subscriber-type")
-    public String subscriberType;
-
-    @JsonProperty("resource-version")
-    public String resourceVersion;
-    
-    @JsonProperty("service-subscriptions")
-    public ServiceSubscriptions serviceSubscriptions;
-
-
-}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/aai/SubscriberAaiResponse.java b/vid-app-common/src/main/java/org/openecomp/vid/aai/SubscriberAaiResponse.java
deleted file mode 100644
index 53304e9..0000000
--- a/vid-app-common/src/main/java/org/openecomp/vid/aai/SubscriberAaiResponse.java
+++ /dev/null
@@ -1,24 +0,0 @@
-package org.openecomp.vid.aai;
-
-import org.openecomp.vid.model.ProxyResponse;
-import org.openecomp.vid.model.SubscriberList;
-
-/**
- * Created by Oren on 7/5/17.
- */
-public class SubscriberAaiResponse extends ProxyResponse {
-
-
-    private SubscriberList subscriberList;
-
-    public SubscriberAaiResponse(SubscriberList subscriberList, String errorMessage, int aaiHttpCode) {
-        this.subscriberList = subscriberList;
-        this.errorMessage = errorMessage;
-        this.httpCode = aaiHttpCode;
-    }
-
-
-    public SubscriberList getSubscriberList() {
-        return subscriberList;
-    }
-}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/aai/SubscriberData.java b/vid-app-common/src/main/java/org/openecomp/vid/aai/SubscriberData.java
deleted file mode 100644
index efaa478..0000000
--- a/vid-app-common/src/main/java/org/openecomp/vid/aai/SubscriberData.java
+++ /dev/null
@@ -1,7 +0,0 @@
-package org.openecomp.vid.aai;
-
-/**
- * Created by Oren on 7/10/17.
- */
-public class SubscriberData {
-}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/aai/SubscriberFilteredResults.java b/vid-app-common/src/main/java/org/openecomp/vid/aai/SubscriberFilteredResults.java
deleted file mode 100644
index c2afee3..0000000
--- a/vid-app-common/src/main/java/org/openecomp/vid/aai/SubscriberFilteredResults.java
+++ /dev/null
@@ -1,29 +0,0 @@
-package org.openecomp.vid.aai;
-
-import org.openecomp.vid.model.ProxyResponse;
-import org.openecomp.vid.model.SubscriberList;
-import org.openecomp.vid.roles.RoleValidator;
-
-/**
- * Created by Oren on 7/5/17.
- */
-
-public class SubscriberFilteredResults extends ProxyResponse {
-
-    private SubscriberListWithFilterData subscriberList;
-
-    public SubscriberFilteredResults(RoleValidator roleValidator,SubscriberList subscribers, String errorMessage, int aaiHttpCode) {
-        this.subscriberList = new SubscriberListWithFilterData(subscribers,roleValidator);
-        this.errorMessage = errorMessage;
-        this.httpCode = aaiHttpCode;
-    }
-
-
-    public SubscriberListWithFilterData getSubscriberList() {
-        return subscriberList;
-    }
-
-    public void setSubscriberList(SubscriberListWithFilterData subscriberList) {
-        this.subscriberList = subscriberList;
-    }
-}
\ No newline at end of file
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/aai/SubscriberListWithFilterData.java b/vid-app-common/src/main/java/org/openecomp/vid/aai/SubscriberListWithFilterData.java
deleted file mode 100644
index 75f505f..0000000
--- a/vid-app-common/src/main/java/org/openecomp/vid/aai/SubscriberListWithFilterData.java
+++ /dev/null
@@ -1,31 +0,0 @@
-package org.openecomp.vid.aai;
-
-import org.openecomp.vid.model.Subscriber;
-import org.openecomp.vid.model.SubscriberList;
-import org.openecomp.vid.roles.RoleValidator;
-
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * Created by Oren on 7/5/17.
- */
-public class SubscriberListWithFilterData {
-
-    public SubscriberListWithFilterData(SubscriberList subscriberList, RoleValidator roleValidator){
-        List<Subscriber> subscribers = subscriberList.customer;
-        List<SubscriberWithFilter> subscribersWithFilter = new ArrayList<>();
-        for (Subscriber subscriber :subscribers){
-            SubscriberWithFilter subscriberWithFilter = new SubscriberWithFilter();
-            subscriberWithFilter.setIsPermitted(roleValidator.isSubscriberPermitted(subscriber.globalCustomerId));
-            subscriberWithFilter.subscriberType = subscriber.subscriberType;
-            subscriberWithFilter.resourceVersion = subscriber.resourceVersion;
-            subscriberWithFilter.subscriberName = subscriber.subscriberName;
-            subscriberWithFilter.globalCustomerId = subscriber.globalCustomerId;
-            subscribersWithFilter.add(subscriberWithFilter);
-        }
-        this.customer = subscribersWithFilter;
-     }
-
-    public List<SubscriberWithFilter> customer;
-}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/aai/SubscriberWithFilter.java b/vid-app-common/src/main/java/org/openecomp/vid/aai/SubscriberWithFilter.java
deleted file mode 100644
index abd9c0f..0000000
--- a/vid-app-common/src/main/java/org/openecomp/vid/aai/SubscriberWithFilter.java
+++ /dev/null
@@ -1,21 +0,0 @@
-package org.openecomp.vid.aai;
-
-import org.codehaus.jackson.annotate.JsonProperty;
-import org.openecomp.vid.model.Subscriber;
-
-/**
- * Created by Oren on 7/5/17.
- */
-public class SubscriberWithFilter extends Subscriber{
-
-    @JsonProperty("is-permitted")
-    private boolean isPermitted;
-
-    public boolean getIsPermitted() {
-        return isPermitted;
-    }
-
-    public void setIsPermitted(boolean isPermitted) {
-        this.isPermitted = isPermitted;
-    }
-}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/aai/VnfResult.java b/vid-app-common/src/main/java/org/openecomp/vid/aai/VnfResult.java
deleted file mode 100644
index b8294e5..0000000
--- a/vid-app-common/src/main/java/org/openecomp/vid/aai/VnfResult.java
+++ /dev/null
@@ -1,44 +0,0 @@
-package org.openecomp.vid.aai;
-
-import com.fasterxml.jackson.annotation.*;
-import org.codehaus.jackson.annotate.JsonProperty;
-import org.openecomp.vid.RelatedTo;
-
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-
-@JsonInclude(JsonInclude.Include.NON_NULL)
-@JsonPropertyOrder({
-        "id",
-        "node-type",
-        "url",
-        "properties",
-        "related-to"
-})
-public class VnfResult {
-
-    @JsonProperty("id")
-    public String id;
-    @JsonProperty("node-type")
-    public String nodeType;
-    @JsonProperty("url")
-    public String url;
-    @JsonProperty("properties")
-    public ServiceProperties properties;
-    @JsonProperty("related-to")
-    public List<RelatedTo> relatedTo = null;
-    @JsonIgnore
-    private Map<String, Object> additionalProperties = new HashMap<String, Object>();
-
-    @JsonAnyGetter
-    public Map<String, Object> getAdditionalProperties() {
-        return this.additionalProperties;
-    }
-
-    @JsonAnySetter
-    public void setAdditionalProperty(String name, Object value) {
-        this.additionalProperties.put(name, value);
-    }
-}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/aai/exceptions/InvalidAAIResponseException.java b/vid-app-common/src/main/java/org/openecomp/vid/aai/exceptions/InvalidAAIResponseException.java
deleted file mode 100644
index f84c09a..0000000
--- a/vid-app-common/src/main/java/org/openecomp/vid/aai/exceptions/InvalidAAIResponseException.java
+++ /dev/null
@@ -1,7 +0,0 @@
-package org.openecomp.vid.aai.exceptions;
-
-/**
- * Created by Oren on 7/4/17.
- */
-public class InvalidAAIResponseException extends Exception {
-}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/aai/model/AaiGetServicesRequestModel/GetServicesAAIRespone.java b/vid-app-common/src/main/java/org/openecomp/vid/aai/model/AaiGetServicesRequestModel/GetServicesAAIRespone.java
deleted file mode 100644
index 27c38ce..0000000
--- a/vid-app-common/src/main/java/org/openecomp/vid/aai/model/AaiGetServicesRequestModel/GetServicesAAIRespone.java
+++ /dev/null
@@ -1,11 +0,0 @@
-package org.openecomp.vid.aai.model.AaiGetServicesRequestModel;
-
-import org.codehaus.jackson.annotate.JsonIgnoreProperties;
-import org.codehaus.jackson.annotate.JsonProperty;
-
-import java.util.List;
-@JsonIgnoreProperties(ignoreUnknown = true)
-public class GetServicesAAIRespone {
-
-    public List<Service> service;
-}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/aai/model/AaiGetServicesRequestModel/Service.java b/vid-app-common/src/main/java/org/openecomp/vid/aai/model/AaiGetServicesRequestModel/Service.java
deleted file mode 100644
index 977e57e..0000000
--- a/vid-app-common/src/main/java/org/openecomp/vid/aai/model/AaiGetServicesRequestModel/Service.java
+++ /dev/null
@@ -1,21 +0,0 @@
-package org.openecomp.vid.aai.model.AaiGetServicesRequestModel;
-
-import org.codehaus.jackson.annotate.JsonIgnoreProperties;
-import org.codehaus.jackson.annotate.JsonProperty;
-
-/**
- * Created by Oren on 7/17/17.
- */
-
-@JsonIgnoreProperties(ignoreUnknown = true)
-public class Service {
-    @JsonProperty("service-id")
-    public String serviceId;
-    @JsonProperty("service-description")
-    public String serviceDescription;
-    @JsonProperty("resource-version")
-    public String resourceVersion;
-    @JsonProperty("is-permitted")
-    public boolean isPermitted;
-
-}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/aai/model/AaiGetTenatns/GetTenantsResponse.java b/vid-app-common/src/main/java/org/openecomp/vid/aai/model/AaiGetTenatns/GetTenantsResponse.java
deleted file mode 100644
index 5e88bf3..0000000
--- a/vid-app-common/src/main/java/org/openecomp/vid/aai/model/AaiGetTenatns/GetTenantsResponse.java
+++ /dev/null
@@ -1,26 +0,0 @@
-package org.openecomp.vid.aai.model.AaiGetTenatns;
-
-import org.codehaus.jackson.annotate.JsonIgnoreProperties;
-import org.codehaus.jackson.annotate.JsonProperty;
-
-/**
- * Created by Oren on 7/18/17.
- */
-@JsonIgnoreProperties(ignoreUnknown = true)
-public class GetTenantsResponse {
-
-    @JsonProperty("cloudRegionID")
-    public String cloudRegionId;
-
-    @JsonProperty("tenantName")
-    public String tenantName;
-
-    @JsonProperty("tenantID")
-    public String tenantID;
-
-    @JsonProperty("is-permitted")
-    public boolean isPermitted;
-
-
-
-}
\ No newline at end of file
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/aai/model/RelatedToProperty.java b/vid-app-common/src/main/java/org/openecomp/vid/aai/model/RelatedToProperty.java
deleted file mode 100644
index c9f28ed..0000000
--- a/vid-app-common/src/main/java/org/openecomp/vid/aai/model/RelatedToProperty.java
+++ /dev/null
@@ -1,34 +0,0 @@
-package org.openecomp.vid.aai.model;
-
-import org.codehaus.jackson.annotate.JsonProperty;
-
-public class RelatedToProperty {
-	
-	public String getPropertyKey() {
-		return propertyKey;
-	}
-
-
-	public void setPropertyKey(String propertyKey) {
-		this.propertyKey = propertyKey;
-	}
-
-
-	public String getPropertyValue() {
-		return propertyValue;
-	}
-
-
-	public void setPropertyValue(String propertyValue) {
-		this.propertyValue = propertyValue;
-	}
-
-
-	@JsonProperty("property-key")
-	public String propertyKey;
-	
-	
-	@JsonProperty("property-value")
-	public String propertyValue;
-
-}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/aai/model/Relationship.java b/vid-app-common/src/main/java/org/openecomp/vid/aai/model/Relationship.java
deleted file mode 100644
index 7960941..0000000
--- a/vid-app-common/src/main/java/org/openecomp/vid/aai/model/Relationship.java
+++ /dev/null
@@ -1,55 +0,0 @@
-package org.openecomp.vid.aai.model;
-
-import java.util.List;
-
-import org.codehaus.jackson.annotate.JsonProperty;
-
-public class Relationship {
-	
-	@JsonProperty("related-to")
-	public String relatedTo;
-	
-	@JsonProperty("related-link")
-	public String relatedLink;
-	
-	@JsonProperty("relationship-data")
-	public List<RelationshipData> relationshipData;
-	
-	@JsonProperty("related-to-property")
-	public List<RelatedToProperty> relatedToProperty;
-
-	
-	public String getRelatedTo() {
-		return relatedTo;
-	}
-
-	public void setRelatedTo(String relatedTo) {
-		this.relatedTo = relatedTo;
-	}
-
-	public String getRelatedLink() {
-		return relatedLink;
-	}
-
-	public void setRelatedLink(String relatedLink) {
-		this.relatedLink = relatedLink;
-	}
-
-	public List<RelationshipData> getRelationDataList() {
-		return relationshipData;
-	}
-
-	public void setRelationDataList(List<RelationshipData> relationDataList) {
-		this.relationshipData = relationDataList;
-	}
-
-	public List<RelatedToProperty> getRelatedToPropertyList() {
-		return relatedToProperty;
-	}
-
-	public void setRelatedToPropertyList(List<RelatedToProperty> relatedToPropertyList) {
-		this.relatedToProperty = relatedToPropertyList;
-	}
-
-
-}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/aai/model/RelationshipData.java b/vid-app-common/src/main/java/org/openecomp/vid/aai/model/RelationshipData.java
deleted file mode 100644
index 21af2f5..0000000
--- a/vid-app-common/src/main/java/org/openecomp/vid/aai/model/RelationshipData.java
+++ /dev/null
@@ -1,29 +0,0 @@
-package org.openecomp.vid.aai.model;
-
-import org.codehaus.jackson.annotate.JsonProperty;
-
-public class RelationshipData {
-	
-	public String getRelationshipKey() {
-		return relationshipKey;
-	}
-
-	public void setRelationshipKey(String relationshipKey) {
-		this.relationshipKey = relationshipKey;
-	}
-
-	public String getRelationshipValue() {
-		return relationshipValue;
-	}
-
-	public void setRelationshipValue(String relationshipValue) {
-		this.relationshipValue = relationshipValue;
-	}
-
-	@JsonProperty("relationship-key")
-	public String relationshipKey;
-	
-	@JsonProperty("relationship-value")
-	public String relationshipValue;
-
-}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/aai/model/RelationshipList.java b/vid-app-common/src/main/java/org/openecomp/vid/aai/model/RelationshipList.java
deleted file mode 100644
index cdb7af4..0000000
--- a/vid-app-common/src/main/java/org/openecomp/vid/aai/model/RelationshipList.java
+++ /dev/null
@@ -1,24 +0,0 @@
-package org.openecomp.vid.aai.model;
-
-import java.util.List;
-
-import org.codehaus.jackson.annotate.JsonProperty;
-
-public class RelationshipList {
-	
-	
-	public List<Relationship> getRelationship() {
-		return relationship;
-	}
-
-	public void setRelationship(List<Relationship> relationship) {
-		this.relationship = relationship;
-	}
-
-	@JsonProperty("relationship")
-	public List<Relationship> relationship;
-	
-	
-	
-
-}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/aai/model/ServiceInstance.java b/vid-app-common/src/main/java/org/openecomp/vid/aai/model/ServiceInstance.java
deleted file mode 100644
index 9fe4c06..0000000
--- a/vid-app-common/src/main/java/org/openecomp/vid/aai/model/ServiceInstance.java
+++ /dev/null
@@ -1,26 +0,0 @@
-package org.openecomp.vid.aai.model;
-
-import org.codehaus.jackson.annotate.JsonProperty;
-
-public class ServiceInstance {
-	
-	@JsonProperty("service-instance-id")
-	public String serviceInstanceId;
-
-	@JsonProperty("service-instance-name")
-	public String serviceInstanceName;
-	
-	@JsonProperty("persona-model-id")
-	public String personaModelId;
-	
-	@JsonProperty("persona-model-version")
-	public String personaModelVersion;
-	
-	@JsonProperty("resource-version")
-	public String resourceVersion;
-	
-	@JsonProperty("orchestration-status")
-	public String orchestrationStatus;
-
-	
-}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/aai/model/ServiceInstances.java b/vid-app-common/src/main/java/org/openecomp/vid/aai/model/ServiceInstances.java
deleted file mode 100644
index 163ed04..0000000
--- a/vid-app-common/src/main/java/org/openecomp/vid/aai/model/ServiceInstances.java
+++ /dev/null
@@ -1,12 +0,0 @@
-package org.openecomp.vid.aai.model;
-
-import java.util.List;
-
-import org.codehaus.jackson.annotate.JsonProperty;
-
-public class ServiceInstances {
-	
-	@JsonProperty("service-instance")
-	public List<ServiceInstance> serviceInstance;
-
-}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/aai/model/ServiceRelationships.java b/vid-app-common/src/main/java/org/openecomp/vid/aai/model/ServiceRelationships.java
deleted file mode 100644
index 9bedd85..0000000
--- a/vid-app-common/src/main/java/org/openecomp/vid/aai/model/ServiceRelationships.java
+++ /dev/null
@@ -1,90 +0,0 @@
-package org.openecomp.vid.aai.model;
-
-import org.codehaus.jackson.annotate.JsonProperty;
-
-public class ServiceRelationships {
-	
-	@JsonProperty("service-instance-id")
-	public String serviceInstanceId;
-
-	@JsonProperty("service-instance-name")
-	public String serviceInstanceName;
-
-	@JsonProperty("model-invariant-id")
-	public String modelInvariantId;
-	
-	@JsonProperty("model-version-id")
-	public String modelVersionId;
-
-	@JsonProperty("resource-version")
-	public String resourceVersion;
-	
-	@JsonProperty("orchestration-status")
-	public String orchestrationStatus;
-
-	@JsonProperty("relationship-list")
-	public RelationshipList relationshipList;
-
-
-	public String getServiceInstanceId() {
-		return serviceInstanceId;
-	}
-
-	public void setServiceInstanceId(String serviceInstanceId) {
-		this.serviceInstanceId = serviceInstanceId;
-	}
-
-	public String getServiceInstanceName() {
-		return serviceInstanceName;
-	}
-
-	public void setServiceInstanceName(String serviceInstanceName) {
-		this.serviceInstanceName = serviceInstanceName;
-	}
-
-	public String getModelInvariantId() {
-		return modelInvariantId;
-	}
-
-	public void setModelInvariantId(String modelInvariantId) {
-		this.modelInvariantId = modelInvariantId;
-	}
-
-	public String getModelVersionId() {
-		return modelVersionId;
-	}
-
-	public void setModelVersionId(String modelVersionId) {
-		this.modelVersionId = modelVersionId;
-	}
-
-	public String getResourceVersion() {
-		return resourceVersion;
-	}
-
-	public void setResourceVersion(String resourceVersion) {
-		this.resourceVersion = resourceVersion;
-	}
-
-	public String getOrchestrationStatus() {
-		return orchestrationStatus;
-	}
-
-	public void setOrchestrationStatus(String orchestrationStatus) {
-		this.orchestrationStatus = orchestrationStatus;
-	}
-
-	public RelationshipList getRelationshipList() {
-		return relationshipList;
-	}
-
-	public void setRelationshipList(RelationshipList relationshipList) {
-		this.relationshipList = relationshipList;
-	}
-
-
-
-	
-	
-
-}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/aai/model/ServiceSubscription.java b/vid-app-common/src/main/java/org/openecomp/vid/aai/model/ServiceSubscription.java
deleted file mode 100644
index 02ddfd1..0000000
--- a/vid-app-common/src/main/java/org/openecomp/vid/aai/model/ServiceSubscription.java
+++ /dev/null
@@ -1,17 +0,0 @@
-package org.openecomp.vid.aai.model;
-
-import org.codehaus.jackson.annotate.JsonProperty;
-
-public class ServiceSubscription {
-	
-    @JsonProperty("service-type")
-    public String serviceType;
-
-    @JsonProperty("resource-version")
-    public String resourceVersion;
-
-    @JsonProperty("service-instances")
-    public ServiceInstances serviceInstances;
-
-
-}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/aai/model/Services.java b/vid-app-common/src/main/java/org/openecomp/vid/aai/model/Services.java
deleted file mode 100644
index 6e7b890..0000000
--- a/vid-app-common/src/main/java/org/openecomp/vid/aai/model/Services.java
+++ /dev/null
@@ -1,24 +0,0 @@
-package org.openecomp.vid.aai.model;
-
-import java.util.List;
-
-import org.codehaus.jackson.annotate.JsonProperty;
-
-public class Services {
-    @JsonProperty("global-customer-id")
-    public String globalCustomerId;
-
-    @JsonProperty("subscriber-name")
-    public String subscriberName;
-
-    @JsonProperty("subscriber-type")
-    public String subscriberType;
-
-    @JsonProperty("resource-version")
-    public String resourceVersion;
-    
-    @JsonProperty("service-subscriptions")
-    public List<ServiceSubscription> serviceSubscriptions;
-
-
-}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/asdc/AsdcCatalogException.java b/vid-app-common/src/main/java/org/openecomp/vid/asdc/AsdcCatalogException.java
deleted file mode 100755
index c807872..0000000
--- a/vid-app-common/src/main/java/org/openecomp/vid/asdc/AsdcCatalogException.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * VID
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *      http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.vid.asdc;
-
-/**
- * The Class AsdcCatalogException.
- */
-public class AsdcCatalogException extends Exception {
-	
-	/** The Constant serialVersionUID. */
-	private static final long serialVersionUID = 1L;
-
-	/**
-	 * Instantiates a new sdc catalog exception.
-	 *
-	 * @param msg the msg
-	 */
-	public AsdcCatalogException(String msg) {
-		super(msg);
-	}
-	
-	/**
-	 * Instantiates a new sdc catalog exception.
-	 *
-	 * @param cause the cause
-	 */
-	public AsdcCatalogException(Throwable cause) {
-		super(cause);
-	}
-	
-	/**
-	 * Instantiates a new sdc catalog exception.
-	 *
-	 * @param msg the msg
-	 * @param t the t
-	 */
-	public AsdcCatalogException(String msg, Throwable t) {
-		super(msg, t);
-	}
-}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/asdc/AsdcClient.java b/vid-app-common/src/main/java/org/openecomp/vid/asdc/AsdcClient.java
deleted file mode 100755
index 314ea03..0000000
--- a/vid-app-common/src/main/java/org/openecomp/vid/asdc/AsdcClient.java
+++ /dev/null
@@ -1,129 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * VID
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *      http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.vid.asdc;
-
-import java.io.IOException;
-import java.nio.file.Path;
-import java.util.Collection;
-import java.util.Map;
-import java.util.UUID;
-
-import org.openecomp.vid.asdc.beans.Artifact;
-import org.openecomp.vid.asdc.beans.Resource;
-import org.openecomp.vid.asdc.beans.Service;
-
-/**
- * The Interface AsdcClient.
- */
-public interface AsdcClient {
-	
-	/**
-	 * Gets the resource.
-	 *
-	 * @param uuid the uuid
-	 * @return the resource
-	 * @throws AsdcCatalogException the sdc catalog exception
-	 */
-	public Resource getResource(UUID uuid) throws AsdcCatalogException;
-	
-	/**
-	 * Gets the resources.
-	 *
-	 * @return the resources
-	 * @throws AsdcCatalogException the sdc catalog exception
-	 */
-	public Collection<Resource> getResources() throws AsdcCatalogException;
-	
-	/**
-	 * Gets the resources.
-	 *
-	 * @param filter the filter
-	 * @return the resources
-	 * @throws AsdcCatalogException the sdc catalog exception
-	 */
-	public Collection<Resource> getResources(Map<String, String[]> filter) throws AsdcCatalogException;
-	
-	/**
-	 * Gets the resource artifact.
-	 *
-	 * @param resourceUuid the resource uuid
-	 * @param artifactUuid the artifact uuid
-	 * @return the resource artifact
-	 * @throws AsdcCatalogException the sdc catalog exception
-	 */
-	public Artifact getResourceArtifact(UUID resourceUuid, UUID artifactUuid) throws AsdcCatalogException;
-	
-	/**
-	 * Gets the resource tosca model.
-	 *
-	 * @param uuid the uuid
-	 * @return the resource tosca model
-	 * @throws AsdcCatalogException the sdc catalog exception
-	 */
-	public Path getResourceToscaModel(UUID uuid) throws AsdcCatalogException;
-	
-	/**
-	 * Gets the service.
-	 *
-	 * @param uuid the uuid
-	 * @return the service
-	 * @throws AsdcCatalogException the sdc catalog exception
-	 */
-	public Service getService(UUID uuid) throws AsdcCatalogException;
-	
-	/**
-	 * Gets the services.
-	 *
-	 * @return the services
-	 * @throws AsdcCatalogException the sdc catalog exception
-	 */
-	public Collection<Service> getServices() throws AsdcCatalogException;
-	
-	/**
-	 * Gets the services.
-	 *
-	 * @param filter the filter
-	 * @return the services
-	 * @throws AsdcCatalogException the asdc catalog exception
-	 */
-	public Collection<Service> getServices(Map<String, String[]> filter) throws AsdcCatalogException;
-	
-	/**
-	 * Gets the service artifact.
-	 *
-	 * @param serviceUuid the service uuid
-	 * @param artifactUuid the artifact uuid
-	 * @return the service artifact
-	 * @throws AsdcCatalogException the asdc catalog exception
-	 */
-	public Artifact getServiceArtifact(UUID serviceUuid, UUID artifactUuid) throws AsdcCatalogException;
-	
-	/**
-	 * Gets the service tosca model.
-	 *
-	 * @param uuid the uuid
-	 * @return the service tosca model
-	 * @throws AsdcCatalogException the asdc catalog exception
-	 */
-	public Path getServiceToscaModel(UUID uuid) throws AsdcCatalogException;
-	
-	//TODO: Collect TOSCA information from CSAR
-}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/asdc/beans/Artifact.java b/vid-app-common/src/main/java/org/openecomp/vid/asdc/beans/Artifact.java
deleted file mode 100755
index 4974d44..0000000
--- a/vid-app-common/src/main/java/org/openecomp/vid/asdc/beans/Artifact.java
+++ /dev/null
@@ -1,314 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * VID
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *      http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.vid.asdc.beans;
-
-import java.util.UUID;
-
-/**
- * The Class Artifact.
- */
-public class Artifact {
-
-/*
- * SDC has widened this to a String type for 1610.
-	public enum Type {
-		HEAT,
-		HEAT_ENV,
-		HEAT_VOL,
-		HEAT_NET,
-		HEAT_NESTED,
-		HEAT_ARTIFACT,
-		YANG_XML,
-		VNF_CATALOG,
-		VF_LICENSE,
-		VENDOR_LICENSE,
-		ASSET_INVENTORY_PROFILE,
-		ASSET_QUERY_SPEC,
-		APPC_CONFIG,
-		VF_MODULES_METADATA,
-		DCAE_TOSCA,
-		DCAE_JSON,
-		DCAE_EMF,
-		DCAE_DOC,
-		DCAE_BLUEPRINT,
-		DCAE_EVENT,
-		DCAE_INVENTORY_TOSCA,
-		DCAE_INVENTORY_JSON,
-		DCAE_INVENTORY_EMF,
-		DCAE_INVENTORY_DOC,
-		DCAE_INVENTORY_BLUEPRINT,
-		DCAE_INVENTORY_EVENT,
-		OTHER,
-		AAI_SERVICE_MODEL //HEY! READ ME! YES, YOU!  I AM A TEMPORARY FIX, PLEASE REMOVE ME BECAUSE I AM A FRAUD.  I DON'T BELONG HERE.
-						  //Warm Regards,
-						  //	*The* Artifact.Type.AAI_SERVICE_MODEL Constant
-	}
-	*/
-	
-	/** The artifact name. */
-	private String artifactName;
-	
-	/** The artifact label. */
-	private String artifactLabel;
-	
-	/** The artifact group type. */
-	private String artifactGroupType;
-	
-	/** The artifact type. */
-	private String artifactType;
-	
-	/** The artifact URL. */
-	private String artifactURL;
-	
-	/** The artifact description. */
-	private String artifactDescription;
-	
-	/** The artifact timeout. */
-	private int artifactTimeout;
-	
-	/** The artifact checksum. */
-	private String artifactChecksum;
-	
-	/** The artifact UUID. */
-	private String artifactUUID;
-	
-	/** The artifact version. */
-	private String artifactVersion;
-	
-	/** The generated from UUID. */
-	private String generatedFromUUID;
-	
-	/**
-	 * Gets the artifact name.
-	 *
-	 * @return the artifact name
-	 */
-	public String getArtifactName() {
-		return artifactName;
-	}
-	
-	/**
-	 * Gets the artifact type.
-	 *
-	 * @return the artifact type
-	 */
-	public String getArtifactType() {
-		return artifactType;
-	}
-	/**
-	 * Gets the artifact group type.
-	 *
-	 * @return the artifact group type
-	 */
-	public String getArtifactGroupType() {
-		return artifactGroupType;
-	}
-	
-	/**
-	 * Gets the artifact label.
-	 *
-	 * @return the artifact label
-	 */
-	public String getArtifactLabel() {
-		return artifactLabel;
-	}
-	/**
-	 * Gets the artifact URL.
-	 *
-	 * @return the artifact URL
-	 */
-	public String getArtifactURL() {
-		return artifactURL;
-	}
-	
-	/**
-	 * Gets the artifact description.
-	 *
-	 * @return the artifact description
-	 */
-	public String getArtifactDescription() {
-		return artifactDescription;
-	}
-	
-	/**
-	 * Gets the artifact timeout.
-	 *
-	 * @return the artifact timeout
-	 */
-	public int getArtifactTimeout() {
-		return artifactTimeout;
-	}
-	
-	/**
-	 * Gets the artifact checksum.
-	 *
-	 * @return the artifact checksum
-	 */
-	public String getArtifactChecksum() {
-		return artifactChecksum;
-	}
-	
-	/**
-	 * Gets the artifact UUID.
-	 *
-	 * @return the artifact UUID
-	 */
-	public String getArtifactUUID() {
-		return artifactUUID;
-	}
-	
-	/**
-	 * Gets the artifact version.
-	 *
-	 * @return the artifact version
-	 */
-	public String getArtifactVersion() {
-		return artifactVersion;
-	}
-	
-	/**
-	 * Gets the generated from UUID.
-	 *
-	 * @return the generated from UUID
-	 */
-	public String getGeneratedFromUUID() {
-		return generatedFromUUID;
-	}
-	
-	/**
-	 * Sets the artifact name.
-	 *
-	 * @param artifactName the new artifact name
-	 */
-	public void setArtifactName(String artifactName) {
-		this.artifactName = artifactName;
-	}
-	
-	/**
-	 * Sets the artifact type.
-	 *
-	 * @param artifactType the new artifact type
-	 */
-	public void setArtifactType(String artifactType) {
-		this.artifactType = artifactType;
-	}
-	/**
-	 * Sets the artifact group type.
-	 *
-	 * @param artifactGroupType the new artifact group type
-	 */
-	public void setArtifactGroupType(String artifactGroupType) {
-		this.artifactGroupType = artifactGroupType;
-	}
-	/**
-	 * Sets the artifact label.
-	 *
-	 * @param artifactGroupType the new artifact label
-	 */
-	public void setArtifactLabel(String artifactLabel) {
-		this.artifactLabel = artifactLabel;
-	}
-	/**
-	 * Sets the artifact URL.
-	 *
-	 * @param artifactURL the new artifact URL
-	 */
-	public void setArtifactURL(String artifactURL) {
-		this.artifactURL = artifactURL;
-	}
-	
-	/**
-	 * Sets the artifact description.
-	 *
-	 * @param artifactDescription the new artifact description
-	 */
-	public void setArtifactDescription(String artifactDescription) {
-		this.artifactDescription = artifactDescription;
-	}
-	
-	/**
-	 * Sets the artifact timeout.
-	 *
-	 * @param artifactTimeout the new artifact timeout
-	 */
-	public void setArtifactTimeout(int artifactTimeout) {
-		this.artifactTimeout = artifactTimeout;
-	}
-	
-	/**
-	 * Sets the artifact checksum.
-	 *
-	 * @param artifactChecksum the new artifact checksum
-	 */
-	public void setArtifactChecksum(String artifactChecksum) {
-		this.artifactChecksum = artifactChecksum;
-	}
-	
-	/**
-	 * Sets the artifact UUID.
-	 *
-	 * @param artifactUUID the new artifact UUID
-	 */
-	public void setArtifactUUID(String artifactUUID) {
-		this.artifactUUID = artifactUUID;
-	}
-	
-	/**
-	 * Sets the artifact version.
-	 *
-	 * @param artifactVersion the new artifact version
-	 */
-	public void setArtifactVersion(String artifactVersion) {
-		this.artifactVersion = artifactVersion;
-	}
-	
-	/**
-	 * Sets the generated from UUID.
-	 *
-	 * @param generatedFromUUID the new generated from UUID
-	 */
-	public void setGeneratedFromUUID(String generatedFromUUID) {
-		this.generatedFromUUID = generatedFromUUID;
-	}
-	
-	/* (non-Javadoc)
-	 * @see java.lang.Object#hashCode()
-	 */
-	@Override
-	public int hashCode() {
-		final UUID uuid = UUID.fromString(getArtifactUUID());
-		
-		return uuid.hashCode();
-	}
-	
-	/* (non-Javadoc)
-	 * @see java.lang.Object#equals(java.lang.Object)
-	 */
-	@Override
-	public boolean equals(Object o) {
-		if (o == this) return true;
-		if (!(o instanceof Artifact)) return false;
-		
-		final Artifact artifact = (Artifact) o;
-		
-		return (artifact.getArtifactUUID().equals(getArtifactUUID()));
-	}
-}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/asdc/beans/Resource.java b/vid-app-common/src/main/java/org/openecomp/vid/asdc/beans/Resource.java
deleted file mode 100755
index 000aae1..0000000
--- a/vid-app-common/src/main/java/org/openecomp/vid/asdc/beans/Resource.java
+++ /dev/null
@@ -1,429 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * VID
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *      http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.vid.asdc.beans;
-
-import java.util.Collection;
-import java.util.UUID;
-
-/**
- * The Class Resource.
- */
-public class Resource {
-
-	/**
-	 * The Enum Type.
-	 */
-	public enum Type { 
-		
-		/** The vf. */
-		VF, 
-		
-		/** The vfc. */
-		VFC, 
-		
-		/** The cp. */
-		CP, 
-		
-		/** The vl. */
-		VL,
-		
-		/** The vfcmt. */
-		VFCMT
-	}
-	
-	/**
-	 * The Enum LifecycleState.
-	 */
-	public enum LifecycleState {
-		
-		/** The not certified checkout. */
-		NOT_CERTIFIED_CHECKOUT,
-		
-		/** The not certified checkin. */
-		NOT_CERTIFIED_CHECKIN,
-		
-		/** The ready for certification. */
-		READY_FOR_CERTIFICATION,
-		
-		/** The certification in progress. */
-		CERTIFICATION_IN_PROGRESS,
-		
-		/** The certified. */
-		CERTIFIED
-	}
-	
-	/** The uuid. */
-	private String uuid;
-	
-	/** The invariant UUID. */
-	private String invariantUUID;
-	
-	/** The name. */
-	private String name;
-	
-	/** The description. */
-	private String description;
-	
-	/** The version. */
-	private String version;
-	
-	/** The tosca model URL. */
-	private String toscaModelURL;
-	
-	/** The category. */
-	private String category;
-	
-	/** The sub category. */
-	private String subCategory;
-	
-	/** The resource type. */
-	private Resource.Type resourceType;
-	
-	/** The lifecycle state. */
-	private Resource.LifecycleState lifecycleState;
-	
-	/** The last updater user ID. */
-	private String lastUpdaterUserId;
-	
-	/** The last updater full name. */
-	private String lastUpdaterFullName;
-	
-	/** The tosca model. */
-	private String toscaModel;
-	
-	/** The tosca resource name. */
-	private String toscaResourceName;
-	
-	/** The artifacts. */
-	private Collection<Artifact> artifacts;
-	
-	/** The resources. */
-	private Collection<SubResource> resources;
-	
-	/**
-	 * Gets the uuid.
-	 *
-	 * @return the uuid
-	 */
-	public String getUuid() {
-		return uuid;
-	}
-	
-	/**
-	 * Gets the invariant UUID.
-	 *
-	 * @return the invariant UUID
-	 */
-	public String getInvariantUUID() {
-		return invariantUUID;
-	}
-	
-	/**
-	 * Gets the name.
-	 *
-	 * @return the name
-	 */
-	public String getName() {
-		return name;
-	}
-	
-	/**
-	 * Gets the description.
-	 *
-	 * @return the description
-	 */
-	public String getDescription() {
-		return description;
-	}
-	
-	/**
-	 * Gets the version.
-	 *
-	 * @return the version
-	 */
-	public String getVersion() {
-		return version;
-	}
-	
-	/**
-	 * Gets the tosca model URL.
-	 *
-	 * @return the tosca model URL
-	 */
-	public String getToscaModelURL() {
-		return toscaModelURL;
-	}
-	
-	/**
-	 * Gets the category.
-	 *
-	 * @return the category
-	 */
-	public String getCategory() {
-		return category;
-	}
-	
-	/**
-	 * Gets the sub category.
-	 *
-	 * @return the sub category
-	 */
-	public String getSubCategory() {
-		return subCategory;
-	}
-	
-	/**
-	 * Gets the resource type.
-	 *
-	 * @return the resource type
-	 */
-	public Resource.Type getResourceType() {
-		return resourceType;
-	}
-	
-	/**
-	 * Gets the lifecycle state.
-	 *
-	 * @return the lifecycle state
-	 */
-	public Resource.LifecycleState getLifecycleState() {
-		return lifecycleState;
-	}
-	
-	/**
-	 * Gets the last updater user ID.
-	 *
-	 * @return the last updater user ID
-	 */
-	public String getLastUpdaterUserId() {
-		return lastUpdaterUserId;
-	}
-	
-	/**
-	 * Gets the last updater full name.
-	 *
-	 * @return the last updater full name
-	 */
-	public String getLastUpdaterFullName() {
-		return lastUpdaterFullName;
-	}
-	
-	/**
-	 * Gets the tosca model.
-	 *
-	 * @return the tosca model
-	 */
-	public String getToscaModel() {
-		return toscaModel;
-	}
-	
-	/**
-	 * Gets the tosca resource name.
-	 *
-	 * @return the tosca resource name
-	 */
-	public String getToscaResourceName() {
-		return toscaResourceName;
-	}
-	
-	/**
-	 * Gets the artifacts.
-	 *
-	 * @return the artifacts
-	 */
-	public Collection<Artifact> getArtifacts() {
-		return artifacts;
-	}
-	
-	/**
-	 * Gets the resources.
-	 *
-	 * @return the resources
-	 */
-	public Collection<SubResource> getResources() {
-		return resources;
-	}
-	
-	/**
-	 * Sets the uuid.
-	 *
-	 * @param uuid the new uuid
-	 */
-	public void setUuid(String uuid) {
-		this.uuid = uuid;
-	}
-	
-	/**
-	 * Sets the invariant UUID.
-	 *
-	 * @param invariantUUID the new invariant UUID
-	 */
-	public void setInvariantUUID(String invariantUUID) {
-		this.invariantUUID = invariantUUID;
-	}
-	
-	/**
-	 * Sets the name.
-	 *
-	 * @param name the new name
-	 */
-	public void setName(String name) {
-		this.name = name;
-	}
-	/**
-	 * Sets the description.
-	 *
-	 * @param name the new description
-	 */
-	public void setDescription(String description) {
-		this.description = description;
-	}
-	/**
-	 * Sets the version.
-	 *
-	 * @param version the new version
-	 */
-	public void setVersion(String version) {
-		this.version = version;
-	}
-	
-	/**
-	 * Sets the tosca model URL.
-	 *
-	 * @param toscaModelURL the new tosca model URL
-	 */
-	public void setToscaModelURL(String toscaModelURL) {
-		this.toscaModelURL = toscaModelURL;
-	}
-	
-	/**
-	 * Sets the category.
-	 *
-	 * @param category the new category
-	 */
-	public void setCategory(String category) {
-		this.category = category;
-	}
-	
-	/**
-	 * Sets the sub category.
-	 *
-	 * @param subCategory the new sub category
-	 */
-	public void setSubCategory(String subCategory) {
-		this.subCategory = subCategory;
-	}
-	
-	/**
-	 * Sets the resource type.
-	 *
-	 * @param resourceType the new resource type
-	 */
-	public void setResourceType(Resource.Type resourceType) {
-		this.resourceType = resourceType;
-	}
-	
-	/**
-	 * Sets the lifecycle state.
-	 *
-	 * @param lifecycleState the new lifecycle state
-	 */
-	public void setLifecycleState(Resource.LifecycleState lifecycleState) {
-		this.lifecycleState = lifecycleState;
-	}
-	
-	/**
-	 * Sets the last updater user ID.
-	 *
-	 * @param lastUpdaterUserId the new last updater user ID
-	 */
-	public void setLastUpdaterUserId(String lastUpdaterUserId) {
-		this.lastUpdaterUserId = lastUpdaterUserId;
-	}
-	
-	/**
-	 * Sets the last updater full name.
-	 *
-	 * @param lastUpdaterFullName the new last updater full name
-	 */
-	public void setLastUpdaterFullName(String lastUpdaterFullName) {
-		this.lastUpdaterFullName = lastUpdaterFullName;
-	}
-	
-	/**
-	 * Sets the tosca model.
-	 *
-	 * @param toscaModel the new tosca model
-	 */
-	public void setToscaModel(String toscaModel) {
-		this.toscaModel = toscaModel;
-	}
-	
-	/**
-	 * Sets the tosca resource name.
-	 *
-	 * @param toscaResourceName the new tosca resource name
-	 */
-	public void setToscaResourceName(String toscaResourceName) {
-		this.toscaResourceName = toscaResourceName;
-	}
-	
-	/**
-	 * Sets the artifacts.
-	 *
-	 * @param artifacts the new artifacts
-	 */
-	public void setArtifacts(Collection<Artifact> artifacts) {
-		this.artifacts = artifacts;
-	}
-	
-	/**
-	 * Sets the resources.
-	 *
-	 * @param resources the new resources
-	 */
-	public void setResources(Collection<SubResource> resources) {
-		this.resources = resources;
-	}
-
-	/* (non-Javadoc)
-	 * @see java.lang.Object#hashCode()
-	 */
-	@Override
-	public int hashCode() {
-		final UUID uuid = UUID.fromString(getUuid());
-		
-		return uuid.hashCode();
-	}
-	
-	/* (non-Javadoc)
-	 * @see java.lang.Object#equals(java.lang.Object)
-	 */
-	@Override
-	public boolean equals(Object o) {
-		if (o == this) return true;
-		if (!(o instanceof Resource)) return false;
-		
-		final Resource resource = (Resource) o;
-		
-		return (resource.getUuid().equals(getUuid()));
-	}
-}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/asdc/beans/SecureService.java b/vid-app-common/src/main/java/org/openecomp/vid/asdc/beans/SecureService.java
deleted file mode 100644
index 1372472..0000000
--- a/vid-app-common/src/main/java/org/openecomp/vid/asdc/beans/SecureService.java
+++ /dev/null
@@ -1,9 +0,0 @@
-package org.openecomp.vid.asdc.beans;
-
-/**
- * Created by Oren on 6/27/17.
- */
-public class SecureService extends  Service{
-
-    public boolean isPermmited = true;
-}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/asdc/beans/SecureServices.java b/vid-app-common/src/main/java/org/openecomp/vid/asdc/beans/SecureServices.java
deleted file mode 100644
index 0fcd792..0000000
--- a/vid-app-common/src/main/java/org/openecomp/vid/asdc/beans/SecureServices.java
+++ /dev/null
@@ -1,31 +0,0 @@
-package org.openecomp.vid.asdc.beans;
-
-import java.util.Collection;
-import java.util.List;
-
-/**
- * Created by Oren on 6/27/17.
- */
-public class SecureServices {
-
-    private Collection<Service> services;
-    //Disable roles until AAF integration finishes
-    private boolean isReadOnly = false;
-
-    public void setServices(Collection<Service> services) {
-        this.services = services;
-    }
-
-    public Collection<Service> getServices() {
-
-        return services;
-    }
-    public boolean isReadOnly() {
-        return isReadOnly;
-    }
-
-    public void setReadOnly(boolean readOnly) {
-        isReadOnly = readOnly;
-    }
-
-}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/asdc/beans/Service.java b/vid-app-common/src/main/java/org/openecomp/vid/asdc/beans/Service.java
deleted file mode 100755
index 2a83cbe..0000000
--- a/vid-app-common/src/main/java/org/openecomp/vid/asdc/beans/Service.java
+++ /dev/null
@@ -1,351 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * VID
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *      http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.vid.asdc.beans;
-
-import java.util.Collection;
-import java.util.UUID;
-/**
- * The Class Service.
- */
-public class Service {
-
-	/**
-	 * The Enum DistributionStatus.
-	 */
-	public enum DistributionStatus { 
-		
-		/** The distribution not approved. */
-		DISTRIBUTION_NOT_APPROVED,
-		
-		/** The distribution approved. */
-		DISTRIBUTION_APPROVED,
-		
-		/** The distributed. */
-		DISTRIBUTED,
-		
-		/** The distribution rejected. */
-		DISTRIBUTION_REJECTED
-	}
-	
-	/**
-	 * The Enum LifecycleState.
-	 */
-	public enum LifecycleState {
-		
-		/** The not certified checkout. */
-		NOT_CERTIFIED_CHECKOUT,
-		
-		/** The not certified checkin. */
-		NOT_CERTIFIED_CHECKIN,
-		
-		/** The ready for certification. */
-		READY_FOR_CERTIFICATION,
-		
-		/** The certification in progress. */
-		CERTIFICATION_IN_PROGRESS,
-		
-		/** The certified. */
-		CERTIFIED
-	}
-	
-	/** The uuid. */
-	private String uuid;
-	
-	/** The invariant UUID. */
-	private String invariantUUID;
-	
-	/** The name. */
-	private String name;
-	
-	/** The version. */
-	private String version;
-	
-	/** The tosca model URL. */
-	private String toscaModelURL;
-	
-	/** The category. */
-	private String category;
-	
-	/** The lifecycle state. */
-	private Service.LifecycleState lifecycleState;
-	
-	/** The last updater user uid. */
-	private String lastUpdaterUserId;
-	
-	/** The last updater full name. */
-	private String lastUpdaterFullName;
-	
-	/** The distribution status. */
-	private Service.DistributionStatus distributionStatus;
-	
-	/** The artifacts. */
-	private Collection<Artifact> artifacts;
-	
-	/** The resources. */
-	private Collection<SubResource> resources;
-	
-	/**
-	 * Gets the uuid.
-	 *
-	 * @return the uuid
-	 */
-	public String getUuid() {
-		return uuid;
-	}
-	
-	/**
-	 * Gets the invariant UUID.
-	 *
-	 * @return the invariant UUID
-	 */
-	public String getInvariantUUID() {
-		return invariantUUID;
-	}
-	
-	/**
-	 * Gets the name.
-	 *
-	 * @return the name
-	 */
-	public String getName() {
-		return name;
-	}
-	
-	/**
-	 * Gets the version.
-	 *
-	 * @return the version
-	 */
-	public String getVersion() {
-		return version;
-	}
-	
-	/**
-	 * Gets the tosca model URL.
-	 *
-	 * @return the tosca model URL
-	 */
-	public String getToscaModelURL() {
-		return toscaModelURL;
-	}
-	
-	/**
-	 * Gets the category.
-	 *
-	 * @return the category
-	 */
-	public String getCategory() {
-		return category;
-	}
-	
-	/**
-	 * Gets the lifecycle state.
-	 *
-	 * @return the lifecycle state
-	 */
-	public Service.LifecycleState getLifecycleState() {
-		return lifecycleState;
-	}
-	
-	/**
-	 * Gets the last updater user uid.
-	 *
-	 * @return the last updater user uid
-	 */
-	public String getLastUpdaterUserId() {
-		return lastUpdaterUserId;
-	}
-	
-	/**
-	 * Gets the last updater full name.
-	 *
-	 * @return the last updater full name
-	 */
-	public String getLastUpdaterFullName() {
-		return lastUpdaterFullName;
-	}
-	
-	/**
-	 * Gets the distribution status.
-	 *
-	 * @return the distribution status
-	 */
-	public Service.DistributionStatus getDistributionStatus() {
-		return distributionStatus;
-	}
-	
-	/**
-	 * Gets the artifacts.
-	 *
-	 * @return the artifacts
-	 */
-	public Collection<Artifact> getArtifacts() {
-		return artifacts;
-	}
-	
-	/**
-	 * Gets the resources.
-	 *
-	 * @return the resources
-	 */
-	public Collection<SubResource> getResources() {
-		return resources;
-	}
-	
-	/**
-	 * Sets the uuid.
-	 *
-	 * @param uuid the new uuid
-	 */
-	public void setUuid(String uuid) {
-		this.uuid = uuid;
-	}
-	
-	/**
-	 * Sets the invariant UUID.
-	 *
-	 * @param invariantUUID the new invariant UUID
-	 */
-	public void setInvariantUUID(String invariantUUID) {
-		this.invariantUUID = invariantUUID;
-	}
-	
-	/**
-	 * Sets the name.
-	 *
-	 * @param name the new name
-	 */
-	public void setName(String name) {
-		this.name = name;
-	}
-	
-	/**
-	 * Sets the version.
-	 *
-	 * @param version the new version
-	 */
-	public void setVersion(String version) {
-		this.version = version;
-	}
-	
-	/**
-	 * Sets the tosca model URL.
-	 *
-	 * @param toscaModelURL the new tosca model URL
-	 */
-	public void setToscaModelURL(String toscaModelURL) {
-		this.toscaModelURL = toscaModelURL;
-	}
-	
-	/**
-	 * Sets the category.
-	 *
-	 * @param category the new category
-	 */
-	public void setCategory(String category) {
-		this.category = category;
-	}
-	
-	/**
-	 * Sets the lifecycle state.
-	 *
-	 * @param lifecycleState the new lifecycle state
-	 */
-	public void setLifecycleState(Service.LifecycleState lifecycleState) {
-		this.lifecycleState = lifecycleState;
-	}
-	
-	/**
-	 * Sets the last updater user uid.
-	 *
-	 * @param lastUpdaterUserId the new last updater user uid
-	 */
-	public void set(String lastUpdaterUserId) {
-		this.lastUpdaterUserId = lastUpdaterUserId;
-	}
-	
-	/**
-	 * Sets the last updater full name.
-	 *
-	 * @param lastUpdaterFullName the new last updater full name
-	 */
-	public void setLastUpdaterFullName(String lastUpdaterFullName) {
-		this.lastUpdaterFullName = lastUpdaterFullName;
-	}
-	
-	/**
-	 * Sets the distribution status.
-	 *
-	 * @param distributionStatus the new distribution status
-	 */
-	public void setDistributionStatus(Service.DistributionStatus distributionStatus) {
-		this.distributionStatus = distributionStatus;
-	}
-	
-	/**
-	 * Sets the artifacts.
-	 *
-	 * @param artifacts the new artifacts
-	 */
-	public void setArtifacts(Collection<Artifact> artifacts) {
-		this.artifacts = artifacts;
-	}
-	
-	/**
-	 * Sets the resources.
-	 *
-	 * @param resources the new resources
-	 */
-	public void setResources(Collection<SubResource> resources) {
-		this.resources = resources;
-	}
-
-	/* (non-Javadoc)
-	 * @see java.lang.Object#toString()
-	 */
-	@Override
-	public String toString() {
-		return uuid;
-	}
-	
-	/* (non-Javadoc)
-	 * @see java.lang.Object#hashCode()
-	 */
-	@Override
-	public int hashCode() {
-		final UUID uuid = UUID.fromString(getUuid());
-		
-		return uuid.hashCode();
-	}
-	
-	/* (non-Javadoc)
-	 * @see java.lang.Object#equals(java.lang.Object)
-	 */
-	@Override
-	public boolean equals(Object o) {
-		if (o == this) return true;
-		if (!(o instanceof Service)) return false;
-		
-		final Service service = (Service) o;
-		
-		return (service.getUuid().equals(getUuid()));
-	}
-}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/asdc/beans/SubResource.java b/vid-app-common/src/main/java/org/openecomp/vid/asdc/beans/SubResource.java
deleted file mode 100755
index cd3ec7f..0000000
--- a/vid-app-common/src/main/java/org/openecomp/vid/asdc/beans/SubResource.java
+++ /dev/null
@@ -1,175 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * VID
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *      http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.vid.asdc.beans;
-
-import java.util.Collection;
-/**
- * The Class SubResource.
- */
-public class SubResource {
-
-	/** The resource instance name. */
-	private String resourceInstanceName;
-	
-	/** The resource name. */
-	private String resourceName;
-	
-	/** The resource invariant UUID. */
-	private String resourceInvariantUUID;
-	
-	/** The resource version. */
-	private String resourceVersion;
-	
-	/** The resource type. */
-	private String resourceType;
-	
-	/** The resource UUID. */
-	private String resourceUUID;
-	
-	/** The artifacts. */
-	private Collection<Artifact> artifacts;
-	
-	/**
-	 * Gets the resource instance name.
-	 *
-	 * @return the resource instance name
-	 */
-	public String getResourceInstanceName() {
-		return resourceInstanceName;
-	}
-	
-	/**
-	 * Gets the resource name.
-	 *
-	 * @return the resource name
-	 */
-	public String getResourceName() {
-		return resourceName;
-	}
-	
-	/**
-	 * Gets the resource invariant UUID.
-	 *
-	 * @return the resource invariant UUID
-	 */
-	public String getResourceInvariantUUID() {
-		return resourceInvariantUUID;
-	}
-	
-	/**
-	 * Gets the resource version.
-	 *
-	 * @return the resource version
-	 */
-	public String getResourceVersion() {
-		return resourceVersion;
-	}
-	
-	/**
-	 * Gets the resoucre type.
-	 *
-	 * @return the resoucre type
-	 */
-	public String getResoucreType() {
-		return resourceType;
-	}
-	
-	/**
-	 * Gets the resource UUID.
-	 *
-	 * @return the resource UUID
-	 */
-	public String getResourceUUID() {
-		return resourceUUID;
-	}
-	
-	/**
-	 * Gets the artifacts.
-	 *
-	 * @return the artifacts
-	 */
-	public Collection<Artifact> getArtifacts() {
-		return artifacts;
-	}
-	
-	/**
-	 * Sets the resource instance name.
-	 *
-	 * @param resourceInstanceName the new resource instance name
-	 */
-	public void setResourceInstanceName(String resourceInstanceName) {
-		this.resourceInstanceName = resourceInstanceName;
-	}
-	
-	/**
-	 * Sets the resource name.
-	 *
-	 * @param resourceName the new resource name
-	 */
-	public void setResourceName(String resourceName) {
-		this.resourceName = resourceName;
-	}
-	
-	/**
-	 * Sets the resource invariant UUID.
-	 *
-	 * @param resourceInvariantUUID the new resource invariant UUID
-	 */
-	public void setResourceInvariantUUID(String resourceInvariantUUID) {
-		this.resourceInvariantUUID = resourceInvariantUUID;
-	}
-	
-	/**
-	 * Sets the resource version.
-	 *
-	 * @param resourceVersion the new resource version
-	 */
-	public void setResourceVersion(String resourceVersion) {
-		this.resourceVersion = resourceVersion;
-	}
-	
-	/**
-	 * Sets the resoucre type.
-	 *
-	 * @param resourceType the new resoucre type
-	 */
-	public void setResoucreType(String resourceType) {
-		this.resourceType = resourceType;
-	}
-	
-	/**
-	 * Sets the resource UUID.
-	 *
-	 * @param resourceUUID the new resource UUID
-	 */
-	public void setResourceUUID(String resourceUUID) {
-		this.resourceUUID = resourceUUID;
-	}
-	
-	/**
-	 * Sets the artifacts.
-	 *
-	 * @param artifacts the new artifacts
-	 */
-	public void setArtifacts(Collection<Artifact> artifacts) {
-		this.artifacts = artifacts;
-	}
-}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/asdc/beans/tosca/Capability.java b/vid-app-common/src/main/java/org/openecomp/vid/asdc/beans/tosca/Capability.java
deleted file mode 100755
index 0d3f17a..0000000
--- a/vid-app-common/src/main/java/org/openecomp/vid/asdc/beans/tosca/Capability.java
+++ /dev/null
@@ -1,140 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * VID
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *      http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.vid.asdc.beans.tosca;
-
-import java.util.Collection;
-import java.util.Map;
-
-/**
- * The Class Capability.
- */
-public class Capability {
-
-	/** The type. */
-	private String type; //FIXME: Make an enumeration?
-	
-	/** The description. */
-	private String description;
-	
-	/** The occurrences. */
-	private Collection<String> occurrences; //FIXME: Make an enumeration?
-	
-	/** The properties. */
-	private Map<String, Property> properties;
-	
-	/** The valid source types. */
-	private Collection<String> valid_source_types; //FIXME: Make an enumeration?
-	
-	/**
-	 * Instantiates a new capability.
-	 */
-	public Capability() {}
-	
-	/**
-	 * Gets the type.
-	 *
-	 * @return the type
-	 */
-	public String getType() {
-		return type;
-	}
-	
-	/**
-	 * Gets the description.
-	 *
-	 * @return the description
-	 */
-	public String getDescription() {
-		return description;
-	}
-	
-	/**
-	 * Gets the occurrences.
-	 *
-	 * @return the occurrences
-	 */
-	public Collection<String> getOccurrences() {
-		return occurrences;
-	}
-	
-	/**
-	 * Gets the properties.
-	 *
-	 * @return the properties
-	 */
-	public Map<String, Property> getProperties() {
-		return properties;
-	}
-	
-	/**
-	 * Gets the valid source types.
-	 *
-	 * @return the valid source types
-	 */
-	public Collection<String> getValid_source_types() {
-		return valid_source_types;
-	}
-	
-	/**
-	 * Sets the type.
-	 *
-	 * @param type the new type
-	 */
-	public void setType(String type) {
-		this.type = type;
-	}
-	
-	/**
-	 * Sets the description.
-	 *
-	 * @param description the new description
-	 */
-	public void setDescription(String description) {
-		this.description = description;
-	}
-	
-	/**
-	 * Sets the occurrences.
-	 *
-	 * @param occurrences the new occurrences
-	 */
-	public void setOccurrences(Collection<String> occurrences) {
-		this.occurrences = occurrences;
-	}
-	
-	/**
-	 * Sets the properties.
-	 *
-	 * @param properties the properties
-	 */
-	public void setProperties(Map<String, Property> properties) {
-		this.properties = properties;
-	}
-	
-	/**
-	 * Sets the valid source types.
-	 *
-	 * @param valid_source_types the new valid source types
-	 */
-	public void setValid_source_types(Collection<String> valid_source_types) {
-		this.valid_source_types = valid_source_types;
-	}
-}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/asdc/beans/tosca/Constraint.java b/vid-app-common/src/main/java/org/openecomp/vid/asdc/beans/tosca/Constraint.java
deleted file mode 100755
index a91f383..0000000
--- a/vid-app-common/src/main/java/org/openecomp/vid/asdc/beans/tosca/Constraint.java
+++ /dev/null
@@ -1,199 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * VID
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *      http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-package org.openecomp.vid.asdc.beans.tosca;
-import java.util.List;
-import java.util.ArrayList;
-
-/**
- * The Class Constraint.
- */
-
-public class Constraint {
-	private  List<Object> valid_values;  
-	private Object equal;
-	private Object greater_than;
-	private Object greater_or_equal;
-	private Object less_than;
-	private Object less_or_equal;
-	private List<Object> in_range;
-	private Object length;
-	private Object min_length;
-	private Object max_length;
-	
-	/**
-	 * Instantiates a new Constraint.
-	 */
-	public Constraint() {
-		valid_values = new ArrayList<Object>();
-		in_range = new ArrayList<Object>();
-	}
-	
-	/**
-	 * Gets the valid_values.
-	 *
-	 * @return the valid_values
-	 */
-	public List<Object> getvalid_values() {
-		return valid_values;
-	}
-	/**
-	 * Gets equal.
-	 *
-	 * @return equal
-	 */
-	public Object getEqual() {
-		return equal;
-	}
-	/**
-	 * Gets greater_than.
-	 *
-	 * @return greater_than
-	 */
-	public Object getGreater_than() {
-		return greater_than;
-	}
-	/**
-	 * Gets greater_or_equal.
-	 *
-	 * @return greater_or_equal
-	 */
-	public Object getGreater_or_equal() {
-		return greater_or_equal;
-	}
-	/**
-	 * Gets less_than.
-	 *
-	 * @return less_than
-	 */
-	public Object getLess_than() {
-		return less_than;
-	}
-	/**
-	 * Gets less_or_equal.
-	 *
-	 * @return less_or_equal
-	 */
-	public Object getLess_or_equal() {
-		return less_or_equal;
-	}
-	/**
-	 * Gets in_range.
-	 *
-	 * @return in_range
-	 */
-	public List<Object> getIn_range() {
-		return in_range;
-	}
-	/**
-	 * Gets length.
-	 *
-	 * @return length
-	 */
-	public Object getLength() {
-		return length;
-	}
-	/**
-	 * Gets min_length.
-	 *
-	 * @return min_length
-	 */
-	public Object getMin_length() {
-		return min_length;
-	}
-	/**
-	 * Gets max_length.
-	 *
-	 * @return max_length
-	 */
-	public Object getMax_length() {
-		return max_length;
-	}
-	/**
-	 * Sets the valid_values.
-	 *
-	 * @param op the new valid_values
-	 */
-	public void setvalid_values(List<Object> vlist) {
-		this.valid_values = vlist;
-	}
-	/**
-	 * Sets equal.
-	 *
-	 * @param e the new equal
-	 */
-	public void setEqual(Object e) {
-		this.equal = e;
-	}
-	/**
-	 * Sets greater_than.
-	 *
-	 * @param e the new greater_than
-	 */
-	public void setGreater_than(Object e) {
-		this.greater_than = e;
-	}
-	/**
-	 * Sets less_than.
-	 *
-	 * @param e the new less_than
-	 */
-	public void setLess_than(Object e) {
-		this.less_than = e;
-	}
-	/**
-	 * Sets in_range.
-	 *
-	 * @param e the new in_range
-	 */
-	public void setIn_range(List<Object> e) {
-		this.in_range = e;
-	}
-	/**
-	 * Sets length.
-	 *
-	 * @param e the length
-	 */
-	public void setLength(Object e) {
-		this.length = e;
-	}
-	/**
-	 * Sets min_length.
-	 *
-	 * @param e the min_length
-	 */
-	public void setMin_length(Object e) {
-		this.min_length = e;
-	}
-	/**
-	 * Sets max_length.
-	 *
-	 * @param e the max_length
-	 */
-	public void setMax_length(Object e) {
-		this.max_length = e;
-	}
-	/* (non-Javadoc)
-	 * @see java.lang.Object#toString()
-	 */
-	@Override
-	public String toString() {
-		return "valid_values=" + valid_values;
-	}
-}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/asdc/beans/tosca/Group.java b/vid-app-common/src/main/java/org/openecomp/vid/asdc/beans/tosca/Group.java
deleted file mode 100755
index 4d31faa..0000000
--- a/vid-app-common/src/main/java/org/openecomp/vid/asdc/beans/tosca/Group.java
+++ /dev/null
@@ -1,135 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * VID
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *      http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.vid.asdc.beans.tosca;
-
-import java.util.Collection;
-import java.util.Map;
-
-/**
- * The Class Group.
- */
-public class Group {
-
-	/** The type. */
-	private String type;
-	
-	/** The members. */
-	private Collection<String> members;
-	
-	/** The metadata. */
-	private ToscaMetadata metadata;
-	
-	/** The vf module type. */
-	private String vf_module_type;
-	
-	/** The properties. */
-	private Map<String, Object> properties;
-	
-	/**
-	 * Gets the metadata.
-	 *
-	 * @return the metadata
-	 */
-	public ToscaMetadata getMetadata() {
-		return metadata;
-	}
-	
-	/**
-	 * Sets the metadata.
-	 *
-	 * @param metadata the new metadata
-	 */
-	public void setMetadata(ToscaMetadata metadata) {
-		this.metadata = metadata;
-	}
-	
-	/**
-	 * Gets the members.
-	 *
-	 * @return the members
-	 */
-	public Collection<String> getMembers() {
-		return members;
-	}
-	
-	/**
-	 * Sets the members.
-	 *
-	 * @param members the new members
-	 */
-	public void setMembers(Collection<String> members) {
-		this.members = members;
-	}
-	
-	/**
-	 * Gets the type.
-	 *
-	 * @return the type
-	 */
-	public String getType() {
-		return type;
-	}
-	
-	/**
-	 * Sets the type.
-	 *
-	 * @param type the new type
-	 */
-	public void setType(String type) {
-		this.type = type;
-	}
-	
-	/**
-	 * Gets the vf module type.
-	 *
-	 * @return the vf module type
-	 */
-	public String getvf_module_type() {
-		return vf_module_type;
-	}
-	
-	/**
-	 * Sets the vf module type.
-	 *
-	 * @param vf_module_type the new vf module type
-	 */
-	public void setvf_module_type(String vf_module_type) {
-		this.vf_module_type = vf_module_type;
-	}
-	
-	/**
-	 * Gets the properties.
-	 *
-	 * @return the properties
-	 */
-	public Map<String, Object> getProperties() {
-		return properties;
-	}
-	
-	/**
-	 * Sets the properties.
-	 *
-	 * @param properties the properties
-	 */
-	public void setProperties(Map<String, Object> properties) {
-		this.properties = properties;
-	}
-}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/asdc/beans/tosca/Import.java b/vid-app-common/src/main/java/org/openecomp/vid/asdc/beans/tosca/Import.java
deleted file mode 100755
index d64a580..0000000
--- a/vid-app-common/src/main/java/org/openecomp/vid/asdc/beans/tosca/Import.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * VID
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *      http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.vid.asdc.beans.tosca;
-
-/**
- * The Class Import.
- */
-public class Import {
-
-	/** The file. */
-	private String file;
-
-	/**
-	 * Gets the file.
-	 *
-	 * @return the file
-	 */
-	public String getFile() {
-		return file;
-	}
-
-	/**
-	 * Sets the file.
-	 *
-	 * @param file the new file
-	 */
-	public void setFile(String file) {
-		this.file = file;
-	}
-}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/asdc/beans/tosca/Input.java b/vid-app-common/src/main/java/org/openecomp/vid/asdc/beans/tosca/Input.java
deleted file mode 100755
index e5eec01..0000000
--- a/vid-app-common/src/main/java/org/openecomp/vid/asdc/beans/tosca/Input.java
+++ /dev/null
@@ -1,168 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * VID
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *      http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.vid.asdc.beans.tosca;
-
-import org.openecomp.sdc.toscaparser.api.elements.constraints.*;
-
-import java.util.List;
-import java.util.ArrayList;
-
-// TODO: Auto-generated Javadoc
-/**
- * The Class Input.
- */
-public class Input {
-
-	/** The type. */
-	private String type;
-	
-	/** The description. */
-	private String description;
-	
-	/** The default. */
-	private Object _default;
-	
-	/** The entry schema. */
-	private Input entry_schema;
-	
-	/** The constraints */
-	private List<org.openecomp.sdc.toscaparser.api.elements.constraints.Constraint> constraints;
-	
-	/** The required field. If not set, the default is true */
-	private boolean required = true;
-	
-	/**
-	 * Instantiates a new input.
-	 */
-	public Input() {
-		constraints = new ArrayList<org.openecomp.sdc.toscaparser.api.elements.constraints.Constraint>();
-	}
-	
-	/**
-	 * Gets the type.
-	 *
-	 * @return the type
-	 */
-	public String getType() {
-		return type;
-	}
-	
-	/**
-	 * Sets the type.
-	 *
-	 * @param type the new type
-	 */
-	public void setType(String type) {
-		this.type = type;
-	}
-	/**
-	 * Gets the required field.
-	 *
-	 * @return the required field
-	 */
-	public boolean getRequired() {
-		return required;
-	}
-	/**
-	 * Sets the required value.
-	 *
-	 * @param required the new required value
-	 */
-	public void setRequired(boolean required) {
-		this.required = required;
-	}
-	/**
-	 * Gets the description.
-	 *
-	 * @return the description
-	 */
-	public String getDescription() {
-		return description;
-	}
-	
-	/**
-	 * Sets the description.
-	 *
-	 * @param description the new description
-	 */
-	public void setDescription(String description) {
-		this.description = description;
-	}
-	
-	/**
-	 * Gets the default.
-	 *
-	 * @return the default
-	 */
-	public Object getDefault() {
-		return _default;
-	}
-	
-	/**
-	 * Sets the default.
-	 *
-	 * @param _default the new default
-	 */
-	public void setDefault(Object _default) {
-		this._default = _default;
-	}
-	
-	/**
-	 * Gets the entry schema.
-	 *
-	 * @return the entry schema
-	 */
-	public Input getentry_schema() {
-		return entry_schema;
-	}
-	/**
-	 * Sets the entry schema.
-	 *
-	 * @param the entry schema
-	 */
-	public void setentry_schema(Input s) {
-		this.entry_schema = s;
-	}
-	/**
-	 * Sets the constraints.
-	 *
-	 * @param c the new constraints
-	 */
-	public void setConstraints(List<org.openecomp.sdc.toscaparser.api.elements.constraints.Constraint> c) {
-		this.constraints = c;
-	}
-	/**
-	 * Gets the constraints
-	 *
-	 * @return the constraints
-	 */
-	public List<org.openecomp.sdc.toscaparser.api.elements.constraints.Constraint> getConstraints() {
-		return constraints;
-	}
-	
-	/* (non-Javadoc)
-	 * @see java.lang.Object#toString()
-	 */
-	@Override
-	public String toString() {
-		return "type=" + type + ",description=" + description + ",default=" + _default;
-	}
-}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/asdc/beans/tosca/NodeTemplate.java b/vid-app-common/src/main/java/org/openecomp/vid/asdc/beans/tosca/NodeTemplate.java
deleted file mode 100755
index 97740b3..0000000
--- a/vid-app-common/src/main/java/org/openecomp/vid/asdc/beans/tosca/NodeTemplate.java
+++ /dev/null
@@ -1,117 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * VID
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *      http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.vid.asdc.beans.tosca;
-
-import java.util.Map;
-import java.util.HashMap;
-
-/**
- * The Class NodeTemplate.
- */
-public class NodeTemplate {
-
-	/** The type. */
-	private String type;
-	
-	/** The metadata. */
-	private ToscaMetadata metadata;
-	
-	/** The properties. */
-	private Map<String, Object> properties; //HEAT?
-	
-	/** The requirements. */
-	private Object requirements;
-	
-	public NodeTemplate () {
-		properties = new HashMap<String,Object>();
-	}
-	/**
-	 * Gets the type.
-	 *
-	 * @return the type
-	 */
-	public String getType() {
-		return type;
-	}
-	
-	/**
-	 * Sets the type.
-	 *
-	 * @param type the new type
-	 */
-	public void setType(String type) {
-		this.type = type;
-	}
-	
-	/**
-	 * Gets the metadata.
-	 *
-	 * @return the metadata
-	 */
-	public ToscaMetadata getMetadata() {
-		return metadata;
-	}
-	
-	/**
-	 * Sets the metadata.
-	 *
-	 * @param metadata the new metadata
-	 */
-	public void setMetadata(ToscaMetadata metadata) {
-		this.metadata = metadata;
-	}
-	
-	/**
-	 * Gets the properties.
-	 *
-	 * @return the properties
-	 */
-	public Map<String, Object> getProperties() {
-		return properties;
-	}
-	
-	/**
-	 * Sets the properties.
-	 *
-	 * @param properties the properties
-	 */
-	public void setProperties(Map<String, Object> properties) {
-		this.properties = properties;
-	}
-	
-	/**
-	 * Gets the requirements.
-	 *
-	 * @return the requirements
-	 */
-	public Object getRequirements() {
-		return requirements;
-	}
-	
-	/**
-	 * Sets the requirements.
-	 *
-	 * @param requirements the new requirements
-	 */
-	public void setRequirements(Object requirements) {
-		this.requirements = requirements;
-	}
-}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/asdc/beans/tosca/Property.java b/vid-app-common/src/main/java/org/openecomp/vid/asdc/beans/tosca/Property.java
deleted file mode 100755
index 16b921e..0000000
--- a/vid-app-common/src/main/java/org/openecomp/vid/asdc/beans/tosca/Property.java
+++ /dev/null
@@ -1,157 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * VID
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *      http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.vid.asdc.beans.tosca;
-
-/**
- * The Class Property.
- */
-public class Property {
-
-	/** The type. */
-	private String type;
-	
-	/** The description. */
-	private String description;
-	
-	/** The entry schema. */
-	private Schema entry_schema;
-	
-	/** The default. */
-	private String _default;
-	
-	/** The required. */
-	private boolean required;
-	
-	/**
-	 * Instantiates a new property.
-	 */
-	private Property() {}
-	
-	/**
-	 * Gets the type.
-	 *
-	 * @return the type
-	 */
-	public String getType() {
-		return type;
-	}
-
-	/**
-	 * Gets the description.
-	 *
-	 * @return the description
-	 */
-	public String getDescription() {
-		return description;
-	}
-
-	/**
-	 * Gets the entry schema.
-	 *
-	 * @return the entry schema
-	 */
-	public Schema getEntry_schema() {
-		return entry_schema;
-	}
-
-	/**
-	 * Gets the default.
-	 *
-	 * @return the default
-	 */
-	public String get_default() {
-		return _default;
-	}
-
-	/**
-	 * Sets the type.
-	 *
-	 * @param type the new type
-	 */
-	public void setType(String type) {
-		this.type = type;
-	}
-
-	/**
-	 * Sets the description.
-	 *
-	 * @param description the new description
-	 */
-	public void setDescription(String description) {
-		this.description = description;
-	}
-
-	/**
-	 * Sets the entry schema.
-	 *
-	 * @param entry_schema the new entry schema
-	 */
-	public void setEntry_schema(Schema entry_schema) {
-		this.entry_schema = entry_schema;
-	}
-
-	/**
-	 * Sets the default.
-	 *
-	 * @param _default the new default
-	 */
-	public void set_default(String _default) {
-		this._default = _default;
-	}
-
-	/**
-	 * Gets the default.
-	 *
-	 * @return the default
-	 */
-	public String getDefault() {
-		return _default;
-	}
-	
-	/**
-	 * Checks if is required.
-	 *
-	 * @return true, if is required
-	 */
-	public boolean isRequired() {
-		return required;
-	}
-	
-	/**
-	 * Sets the default.
-	 *
-	 * @param _default the new default
-	 */
-	public void setDefault(String _default) {
-		this._default = _default;
-	}
-	
-	/**
-	 * Sets the required.
-	 *
-	 * @param required the new required
-	 */
-	public void setRequired(boolean required) {
-		this.required = required;
-	}
-	
-	
-}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/asdc/beans/tosca/Requirement.java b/vid-app-common/src/main/java/org/openecomp/vid/asdc/beans/tosca/Requirement.java
deleted file mode 100755
index acb2509..0000000
--- a/vid-app-common/src/main/java/org/openecomp/vid/asdc/beans/tosca/Requirement.java
+++ /dev/null
@@ -1,120 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * VID
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *      http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.vid.asdc.beans.tosca;
-
-import java.util.Collection;
-
-/**
- * The Class Requirement.
- */
-public class Requirement {
-
-	/** The occurrences. */
-	private Collection<String> occurrences;
-	
-	/** The capability. */
-	private String capability;
-	
-	/** The node. */
-	private String node;
-	
-	/** The relationship. */
-	private String relationship;
-	
-	/**
-	 * Instantiates a new requirement.
-	 */
-	private Requirement() {}
-	
-	/**
-	 * Gets the occurrences.
-	 *
-	 * @return the occurrences
-	 */
-	public Collection<String> getOccurrences() {
-		return occurrences;
-	}
-	
-	/**
-	 * Gets the capability.
-	 *
-	 * @return the capability
-	 */
-	public String getCapability() {
-		return capability;
-	}
-	
-	/**
-	 * Gets the node.
-	 *
-	 * @return the node
-	 */
-	public String getNode() {
-		return node;
-	}
-	
-	/**
-	 * Gets the relationship.
-	 *
-	 * @return the relationship
-	 */
-	public String getRelationship() {
-		return relationship;
-	}
-	
-	/**
-	 * Sets the occurrences.
-	 *
-	 * @param occurrences the new occurrences
-	 */
-	public void setOccurrences(Collection<String> occurrences) {
-		this.occurrences = occurrences;
-	}
-	
-	/**
-	 * Sets the capability.
-	 *
-	 * @param capability the new capability
-	 */
-	public void setCapability(String capability) {
-		this.capability = capability;
-	}
-	
-	/**
-	 * Sets the node.
-	 *
-	 * @param node the new node
-	 */
-	public void setNode(String node) {
-		this.node = node;
-	}
-	
-	/**
-	 * Sets the relationship.
-	 *
-	 * @param relationship the new relationship
-	 */
-	public void setRelationship(String relationship) {
-		this.relationship = relationship;
-	}
-	
-	
-}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/asdc/beans/tosca/Schema.java b/vid-app-common/src/main/java/org/openecomp/vid/asdc/beans/tosca/Schema.java
deleted file mode 100755
index f77c1b4..0000000
--- a/vid-app-common/src/main/java/org/openecomp/vid/asdc/beans/tosca/Schema.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * VID
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *      http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.vid.asdc.beans.tosca;
-
-/**
- * The Class Schema.
- */
-public class Schema {
-
-	/** The type. */
-	public String type;
-
-	/**
-	 * Instantiates a new schema.
-	 */
-	public Schema() {}
-	
-	/**
-	 * Gets the type.
-	 *
-	 * @return the type
-	 */
-	public String getType() {
-		return type;
-	}
-
-	/**
-	 * Sets the type.
-	 *
-	 * @param type the new type
-	 */
-	public void setType(String type) {
-		this.type = type;
-	}
-}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/asdc/beans/tosca/SubstitutionMappings.java b/vid-app-common/src/main/java/org/openecomp/vid/asdc/beans/tosca/SubstitutionMappings.java
deleted file mode 100755
index f59f246..0000000
--- a/vid-app-common/src/main/java/org/openecomp/vid/asdc/beans/tosca/SubstitutionMappings.java
+++ /dev/null
@@ -1,101 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * VID
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *      http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.vid.asdc.beans.tosca;
-
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * The Class SubstitutionMappings.
- */
-public class SubstitutionMappings {
-
-	/** The node type. */
-	private String node_type;
-	
-	/** The capabilities. */
-	private Map<String, Object> capabilities;
-	
-	/** The requirements. */
-	private Map<String, Object> requirements;
-	
-	/**
-	 * Instantiates a new substitution mappings.
-	 */
-	public SubstitutionMappings() {
-		capabilities = new HashMap<String, Object> ();
-		requirements = new HashMap<String, Object> ();
-	}
-	
-	/**
-	 * Gets the node type.
-	 *
-	 * @return the node type
-	 */
-	public String getnode_type() {
-		return node_type;
-	}
-	
-	/**
-	 * Sets the node type.
-	 *
-	 * @param node_type the new node type
-	 */
-	public void setnode_type(String node_type) {
-		this.node_type = node_type;
-	}
-
-	/**
-	 * Gets the capabilities.
-	 *
-	 * @return the capabilities
-	 */
-	public Map<String, Object> getCapabilities() {
-		return capabilities;
-	}
-
-	/**
-	 * Sets the capabilities.
-	 *
-	 * @param capabilities the capabilities
-	 */
-	public void setCapabilities(Map<String, Object> capabilities) {
-		this.capabilities = capabilities;
-	}
-
-	/**
-	 * Gets the requirements.
-	 *
-	 * @return the requirements
-	 */
-	public Map<String, Object> getRequirements() {
-		return requirements;
-	}
-
-	/**
-	 * Sets the requirements.
-	 *
-	 * @param requirements the requirements
-	 */
-	public void setRequirements(Map<String, Object> requirements) {
-		this.requirements = requirements;
-	}
-}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/asdc/beans/tosca/TopologyTemplate.java b/vid-app-common/src/main/java/org/openecomp/vid/asdc/beans/tosca/TopologyTemplate.java
deleted file mode 100755
index 25b2c2c..0000000
--- a/vid-app-common/src/main/java/org/openecomp/vid/asdc/beans/tosca/TopologyTemplate.java
+++ /dev/null
@@ -1,124 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * VID
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *      http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.vid.asdc.beans.tosca;
-
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * The Class TopologyTemplate.
- */
-public class TopologyTemplate {
-	
-	/** The substitution mappings. */
-	private SubstitutionMappings substitution_mappings;
-	
-	/** The inputs. */
-	private Map<String, Input> inputs;
-	
-	/** The node templates. */
-	private Map<String, NodeTemplate> node_templates;
-	
-	/** The groups. */
-	private Map<String, Group> groups;
-	
-	/**
-	 * Instantiates a new topology template.
-	 */
-	public TopologyTemplate() {
-		substitution_mappings = new SubstitutionMappings();
-		inputs = new HashMap<String, Input> ();
-		node_templates = new HashMap<String, NodeTemplate> ();
-		groups = new HashMap<String, Group> ();
-	}
-	
-	/**
-	 * Gets the substitution mappings.
-	 *
-	 * @return the substitution mappings
-	 */
-	public SubstitutionMappings getsubstitution_mappings() {
-		return this.substitution_mappings;
-	}
-	
-	/**
-	 * Sets the substitution mappings.
-	 *
-	 * @param substitution_mappings the new substitution mappings
-	 */
-	public void setsubstitution_mappings(SubstitutionMappings substitution_mappings) {
-		this.substitution_mappings = substitution_mappings;
-	}
-	
-	/**
-	 * Gets the inputs.
-	 *
-	 * @return the inputs
-	 */
-	public Map<String, Input> getInputs() {
-		return inputs;
-	}
-	
-	/**
-	 * Sets the inputs.
-	 *
-	 * @param inputs the inputs
-	 */
-	public void setInputs(Map<String, Input> inputs) {
-		this.inputs = inputs;
-	}
-	
-	/**
-	 * Gets the node templates.
-	 *
-	 * @return the node templates
-	 */
-	public Map<String, NodeTemplate> getnode_templates() {
-		return node_templates;
-	}
-	
-	/**
-	 * Setnode templates.
-	 *
-	 * @param node_templates the node templates
-	 */
-	public void setnode_templates(Map<String, NodeTemplate> node_templates) {
-		this.node_templates = node_templates;
-	}
-
-	/**
-	 * Gets the groups.
-	 *
-	 * @return the groups
-	 */
-	public Map<String, Group> getGroups() {
-		return groups;
-	}
-
-	/**
-	 * Sets the groups.
-	 *
-	 * @param groups the groups
-	 */
-	public void setGroups(Map<String, Group> groups) {
-		this.groups = groups;
-	}
-}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/asdc/beans/tosca/ToscaCsar.java b/vid-app-common/src/main/java/org/openecomp/vid/asdc/beans/tosca/ToscaCsar.java
deleted file mode 100755
index 9e9e1d0..0000000
--- a/vid-app-common/src/main/java/org/openecomp/vid/asdc/beans/tosca/ToscaCsar.java
+++ /dev/null
@@ -1,101 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * VID
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *      http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.vid.asdc.beans.tosca;
-
-import java.util.Collection;
-import java.util.LinkedList;
-
-/**
- * The Class ToscaCsar.
- */
-public class ToscaCsar {
-
-	/** The parent. */
-	private final ToscaModel parent;
-	
-	/** The children. */
-	private final Collection<ToscaModel> children;
-	
-	/**
-	 * The Class Builder.
-	 */
-	public static class Builder {
-		
-		/** The parent. */
-		private final ToscaModel parent;
-		
-		/** The children. */
-		private Collection<ToscaModel> children = new LinkedList<ToscaModel> ();
-		
-		/**
-		 * Instantiates a new builder.
-		 *
-		 * @param parent the parent
-		 */
-		public Builder(ToscaModel parent) {
-			this.parent = parent;
-		}
-		
-		/**
-		 * Adds the vnf.
-		 *
-		 * @param child the child
-		 * @return the builder
-		 */
-		public Builder addVnf(ToscaModel child) {
-			children.add(child);
-			return this;
-		}
-		
-		/**
-		 * Builds the.
-		 *
-		 * @return the tosca csar
-		 */
-		public ToscaCsar build() {
-			return new ToscaCsar(this);
-		}
-	}
-	
-	/**
-	 * Instantiates a new tosca csar.
-	 *
-	 * @param builder the builder
-	 */
-	public ToscaCsar(Builder builder) {
-		this.parent = builder.parent;
-		this.children = builder.children;
-	}
-	
-	/**
-	 * Gets the parent.
-	 *
-	 * @return the parent
-	 */
-	public ToscaModel getParent() { return parent; }
-	
-	/**
-	 * Gets the children.
-	 *
-	 * @return the children
-	 */
-	public Collection<ToscaModel> getChildren() { return children; }
-}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/asdc/beans/tosca/ToscaMeta.java b/vid-app-common/src/main/java/org/openecomp/vid/asdc/beans/tosca/ToscaMeta.java
deleted file mode 100755
index a5295c4..0000000
--- a/vid-app-common/src/main/java/org/openecomp/vid/asdc/beans/tosca/ToscaMeta.java
+++ /dev/null
@@ -1,124 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * VID
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *      http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.vid.asdc.beans.tosca;
-
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.util.HashMap;
-import java.util.Map;
-
-import org.openecomp.vid.asdc.AsdcCatalogException;
-
-/**
- * The Class ToscaMeta.
- */
-public class ToscaMeta {
-
-	/** The metadata. */
-	private final Map<String, String> metadata;
-	
-	/**
-	 * Instantiates a new tosca meta.
-	 *
-	 * @param builder the builder
-	 * @throws IOException Signals that an I/O exception has occurred.
-	 * @throws AsdcCatalogException the asdc catalog exception
-	 */
-	private ToscaMeta(Builder builder) throws IOException, AsdcCatalogException {
-		metadata = new HashMap<String, String> ();
-		
-		read(builder.inputStream);
-	}
-	
-	/**
-	 * The Class Builder.
-	 */
-	public static class Builder {
-		
-		/** The input stream. */
-		private final InputStream inputStream;
-		
-		/**
-		 * Instantiates a new builder.
-		 *
-		 * @param inputStream the input stream
-		 */
-		public Builder(InputStream inputStream) {
-			this.inputStream = inputStream;
-		}
-		
-		/**
-		 * Builds the.
-		 *
-		 * @return the tosca meta
-		 * @throws IOException Signals that an I/O exception has occurred.
-		 * @throws AsdcCatalogException the asdc catalog exception
-		 */
-		public ToscaMeta build() throws IOException, AsdcCatalogException {
-			return new ToscaMeta(this);
-		}
-	}
-	
-	/**
-	 * Gets the.
-	 *
-	 * @param property the property
-	 * @return the string
-	 */
-	public String get(String property) {
-		return metadata.get(property);
-	}
-	
-	/**
-	 * Read.
-	 *
-	 * @param inputStream the input stream
-	 * @throws IOException Signals that an I/O exception has occurred.
-	 * @throws AsdcCatalogException the asdc catalog exception
-	 */
-	private void read(InputStream inputStream) throws IOException, AsdcCatalogException {
-		
-		final BufferedReader br = new BufferedReader(new InputStreamReader(inputStream));
-		
-		String line;
-		
-		try {
-			while ((line = br.readLine()) != null) {
-				if ( line.length() > 0 ) {
-					final String[] entry = line.split(":");
-					
-					if (entry.length != 2) throw new AsdcCatalogException("TOSCA.meta file cannot be parsed (more than 1 colon found on a single line");
-					if (!entry[1].startsWith(" ")) throw new AsdcCatalogException("TOSCA.meta file cannot be parsed (: not immediately followed by ' ')");
-					
-					metadata.put(entry[0], entry[1].substring(1));
-				}
-			}
-		} catch (IOException e) {
-			metadata.clear();
-			throw e;
-		} catch (AsdcCatalogException e) {
-			metadata.clear();
-			throw e;
-		}
-	}
-}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/asdc/beans/tosca/ToscaMetadata.java b/vid-app-common/src/main/java/org/openecomp/vid/asdc/beans/tosca/ToscaMetadata.java
deleted file mode 100755
index d42c1f1..0000000
--- a/vid-app-common/src/main/java/org/openecomp/vid/asdc/beans/tosca/ToscaMetadata.java
+++ /dev/null
@@ -1,461 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * VID
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *      http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.vid.asdc.beans.tosca;
-
-/**
- * The Class ToscaMetadata.
- */
-public class ToscaMetadata {
-
-	/** The template name. */
-	private String template_name;
-	
-	/** The invariant UUID. */
-	private String invariantUUID;
-	
-	/** The customization UUID. */
-	private String customizationUUID;
-	
-	/** The uuid. */
-	private String uuid;
-	
-	/** The version. */
-	private String version;
-	
-	/** The name. */
-	private String name;
-	
-	/** The description. */
-	private String description;
-	
-	/** The category. */
-	private String category;
-	
-	/** The subcategory. */
-	private String subcategory;
-	
-	/** The type. */
-	private String type;
-	
-	/** The resource vendor. */
-	private String resourceVendor;
-	
-	/** The resource vendor release. */
-	private String resourceVendorRelease;
-	
-	/** The service ecomp naming. */
-	private String serviceEcompNaming;
-	
-	/** The ecomp generated naming - duplicate for serviceEcompNaming */
-	private boolean ecompGeneratedNaming;
-	
-	/** The naming policy */
-	private String namingPolicy;
-	
-	/** The service homing. */
-	private boolean serviceHoming;
-	
-	/** The vf module model name. */
-	//ToscaMetadata for VF Modules
-	private String vfModuleModelName;
-	
-	/** The vf module model invariant UUID. */
-	private String vfModuleModelInvariantUUID;
-	
-	/** The vf module model customization UUID. */
-	private String vfModuleModelCustomizationUUID;
-	
-	/** The vf module model UUID. */
-	private String vfModuleModelUUID;
-	
-	/** The vf module model version. */
-	private String vfModuleModelVersion;
-	
-	/**
-	 * Instantiates a new tosca metadata.
-	 */
-	public ToscaMetadata() {}
-	
-	/**
-	 * Gets the type.
-	 *
-	 * @return the type
-	 */
-	public String getType() {
-		return type;
-	}
-	
-	/**
-	 * Gets the invariant UUID.
-	 *
-	 * @return the invariant UUID
-	 */
-	public String getInvariantUUID() {
-		  return invariantUUID;
-	}
-	/**
-	 * Gets the customization UUID.
-	 *
-	 * @return the customization UUID
-	 */
-	public String getCustomizationUUID() {
-		  return customizationUUID;
-	}
-	/**
-	 * Gets the uuid.
-	 *
-	 * @return the uuid
-	 */
-	public String getUUID() {
-		return uuid;
-	}
-
-	/**
-	 * Gets the version.
-	 *
-	 * @return the version
-	 */
-	public String getVersion() {
-		return version;
-	}
-
-	/**
-	 * Gets the name.
-	 *
-	 * @return the name
-	 */
-	public String getName() {
-		return name;
-	}
-
-	/**
-	 * Gets the description.
-	 *
-	 * @return the description
-	 */
-	public String getDescription() {
-		return description;
-	}
-
-	/**
-	 * Gets the category.
-	 *
-	 * @return the category
-	 */
-	public String getCategory() {
-		return category;
-	}
-
-	/**
-	 * Gets the subcategory.
-	 *
-	 * @return the subcategory
-	 */
-	public String getSubcategory() {
-		return subcategory;
-	}
-
-	/**
-	 * Gets the resource vendor.
-	 *
-	 * @return the resource vendor
-	 */
-	public String getResourceVendor() {
-		return resourceVendor;
-	}
-
-	/**
-	 * Gets the resource vendor release.
-	 *
-	 * @return the resource vendor release
-	 */
-	public String getResourceVendorRelease() {
-		return resourceVendorRelease;
-	}
-
-	/**
-	 * Returns the value of service ecomp naming.
-	 *
-	 * @return serviceEcompNaming
-	 */
-	public String getServiceEcompNaming() {
-		return serviceEcompNaming;
-	}
-	/**
-	 * Returns the value of the naming policy.
-	 *
-	 * @return namingPolicy
-	 */
-	public String getNamingPolicy() {
-		return namingPolicy;
-	}
-	/**
-	 * Checks if is service homing.
-	 *
-	 * @return true, if is service homing
-	 */
-	public boolean isServiceHoming() {
-		return serviceHoming;
-	}
-	/**
-	 * Checks if is ecomp generated naming.
-	 *
-	 * @return true, if ecomp generated naming is true
-	 */
-	public boolean isEcompGeneratedNaming() {
-		return ecompGeneratedNaming;
-	}
-	/**
-	 * Sets the type.
-	 *
-	 * @param type the new type
-	 */
-	public void setType(String type) {
-		this.type = type;
-	}
-	
-	/**
-	 * Sets the invariant UUID.
-	 *
-	 * @param invariantUUID the new invariant UUID
-	 */
-	public void setInvariantUUID(String invariantUUID) {
-		this.invariantUUID = invariantUUID;
-	}
-	/**
-	 * Sets the naming policy.
-	 *
-	 * @param namingPolicy the new naming policy
-	 */
-	public void setNamingPolicy(String namingPolicy) {
-		this.namingPolicy = namingPolicy;
-	}
-	/**
-	 * Sets the uuid.
-	 *
-	 * @param uuid the new uuid
-	 */
-	public void setUUID(String uuid) {
-		this.uuid = uuid;
-	}
-	/**
-	 * Sets the customization uuid.
-	 *
-	 * @param u the new customization uuid
-	 */
-	public void setCustomizationUUID(String u) {
-		this.customizationUUID = u;
-	}
-	/**
-	 * Sets the version.
-	 *
-	 * @param version the new version
-	 */
-	public void setVersion(String version) {
-		this.version = version;
-	}
-
-	/**
-	 * Sets the name.
-	 *
-	 * @param name the new name
-	 */
-	public void setName(String name) {
-		this.name = name;
-	}
-
-	/**
-	 * Sets the description.
-	 *
-	 * @param description the new description
-	 */
-	public void setDescription(String description) {
-		this.description = description;
-	}
-
-	/**
-	 * Sets the category.
-	 *
-	 * @param category the new category
-	 */
-	public void setCategory(String category) {
-		this.category = category;
-	}
-
-	/**
-	 * Sets the service ecomp naming.
-	 *
-	 * @param serviceEcompNaming the new service ecomp naming
-	 */
-	public void setServiceEcompNaming(String serviceEcompNaming) {
-		this.serviceEcompNaming = serviceEcompNaming;
-	}
-
-	/**
-	 * Sets the service homing.
-	 *
-	 * @param serviceHoming the new service homing
-	 */
-	public void setServiceHoming(boolean serviceHoming) {
-		this.serviceHoming = serviceHoming;
-	}
-	/**
-	 * Sets the ecomp generated naming.
-	 *
-	 * @param ecompGeneratedNaming the new ecomp generated naming
-	 */
-	public void setEcompGeneratedNaming(boolean ecompGeneratedNaming) {
-		this.ecompGeneratedNaming = ecompGeneratedNaming;
-	}
-	/**
-	 * Gets the template name.
-	 *
-	 * @return the template name
-	 */
-	public String gettemplate_name() {
-		return template_name;
-	}
-	
-	/**
-	 * Sets the template name.
-	 *
-	 * @param template_name the new template name
-	 */
-	public void settemplate_name(String template_name) {
-		this.template_name = template_name;
-	}
-	
-	/**
-	 * Sets the subcategory.
-	 *
-	 * @param subcategory the new subcategory
-	 */
-	public void setSubcategory(String subcategory) {
-		this.subcategory = subcategory;
-	}
-	
-	/**
-	 * Sets the resource vendor.
-	 *
-	 * @param resourceVendor the new resource vendor
-	 */
-	public void setResourceVendor(String resourceVendor) {
-		this.resourceVendor = resourceVendor;
-	}
-
-	/**
-	 * Sets the resource vendor release.
-	 *
-	 * @param resourceVendorRelease the new resource vendor release
-	 */
-	public void setResourceVendorRelease(String resourceVendorRelease) {
-		this.resourceVendorRelease = resourceVendorRelease;
-	}
-
-	/**
-	 * Gets the vf module model name.
-	 *
-	 * @return the vf module model name
-	 */
-	public String getVfModuleModelName() {
-		return vfModuleModelName;
-	}
-
-	/**
-	 * Sets the vf module model name.
-	 *
-	 * @param vfModuleModelName the new vf module model name
-	 */
-	public void setVfModuleModelName(String vfModuleModelName) {
-		this.vfModuleModelName = vfModuleModelName;
-	}
-
-	/**
-	 * Gets the vf module model invariant UUID.
-	 *
-	 * @return the vf module model invariant UUID
-	 */
-	public String getVfModuleModelInvariantUUID() {
-		return vfModuleModelInvariantUUID;
-	}
-
-	/**
-	 * Sets the vf module model invariant UUID.
-	 *
-	 * @param vfModuleModelInvariantUUID the new vf module model invariant UUID
-	 */
-	public void setVfModuleModelInvariantUUID(String vfModuleModelInvariantUUID) {
-		this.vfModuleModelInvariantUUID = vfModuleModelInvariantUUID;
-	}
-
-	/**
-	 * Gets the vf module model UUID.
-	 *
-	 * @return the vf module model UUID
-	 */
-	public String getVfModuleModelUUID() {
-		return vfModuleModelUUID;
-	}
-
-	/**
-	 * Sets the vf module model UUID.
-	 *
-	 * @param vfModuleModelUUID the new vf module model UUID
-	 */
-	public void setVfModuleModelUUID(String vfModuleModelUUID) {
-		this.vfModuleModelUUID = vfModuleModelUUID;
-	}
-
-	/**
-	 * Gets the vf module model version.
-	 *
-	 * @return the vf module model version
-	 */
-	public String getVfModuleModelVersion() {
-		return vfModuleModelVersion;
-	}
-
-	/**
-	 * Sets the vf module model version.
-	 *
-	 * @param vfModuleModelVersion the new vf module model version
-	 */
-	public void setVfModuleModelVersion(String vfModuleModelVersion) {
-		this.vfModuleModelVersion = vfModuleModelVersion;
-	}
-	/**
-	 * Sets the vf module customization uuid.
-	 *
-	 * @param u the new vf module model customization uuid
-	 */
-	public void setVfModuleModelCustomizationUUID(String u) {
-		this.vfModuleModelCustomizationUUID = u;
-	}
-	/**
-	 * Gets the vf module model customization uuid.
-	 *
-	 * @return the vf module model customization uuid
-	 */
-	public String getVfModuleModelCustomizationUUID() {
-		
-		return vfModuleModelCustomizationUUID;
-	}
-}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/asdc/beans/tosca/ToscaModel.java b/vid-app-common/src/main/java/org/openecomp/vid/asdc/beans/tosca/ToscaModel.java
deleted file mode 100755
index 77fbe91..0000000
--- a/vid-app-common/src/main/java/org/openecomp/vid/asdc/beans/tosca/ToscaModel.java
+++ /dev/null
@@ -1,166 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * VID
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *      http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.vid.asdc.beans.tosca;
-
-import java.util.Collection;
-import java.util.LinkedList;
-import java.util.Map;
-
-/**
- * The Class ToscaModel.
- */
-public class ToscaModel {
-
-	/** The tosca definitions version. */
-	private String tosca_definitions_version;
-	
-	/** The description. */
-	private String description;
-	
-	/** The metadata. */
-	private ToscaMetadata metadata;
-	
-	/** The topology template. */
-	private TopologyTemplate topology_template;
-	
-	/** The imports. */
-	private Collection<Map<String, Map<String, String>>> imports;
-	
-	/** The node types. */
-	private Map<String, Object> node_types;
-	
-	/**
-	 * Instantiates a new tosca model.
-	 */
-	public ToscaModel() {
-		metadata = new ToscaMetadata();
-		topology_template = new TopologyTemplate();
-		imports = new LinkedList<Map<String, Map<String, String>>> ();
-	}
-	
-	/**
-	 * Gets the metadata.
-	 *
-	 * @return the metadata
-	 */
-	public ToscaMetadata getMetadata() {
-		return metadata;
-	}
-	
-	/**
-	 * Sets the metadata.
-	 *
-	 * @param metadata the new metadata
-	 */
-	public void setMetadata(ToscaMetadata metadata) {
-		this.metadata = metadata;
-	}
-	
-	/**
-	 * Gets the tosca definitions version.
-	 *
-	 * @return the tosca definitions version
-	 */
-	public String gettosca_definitions_version() {
-		return tosca_definitions_version;
-	}
-	
-	/**
-	 * Sets the tosca definitions version.
-	 *
-	 * @param tosca_definitions_version the new tosca definitions version
-	 */
-	public void settosca_definitions_version(String tosca_definitions_version) {
-		this.tosca_definitions_version = tosca_definitions_version;
-	}
-	
-	/**
-	 * Gets the topology template.
-	 *
-	 * @return the topology template
-	 */
-	public TopologyTemplate gettopology_template() {
-		return topology_template;
-	}
-	
-	/**
-	 * Sets the topology template.
-	 *
-	 * @param topology_template the new topology template
-	 */
-	public void settopology_template(TopologyTemplate topology_template) {
-		this.topology_template = topology_template;
-	}
-
-	/**
-	 * Gets the description.
-	 *
-	 * @return the description
-	 */
-	public String getDescription() {
-		return description;
-	}
-
-	/**
-	 * Sets the description.
-	 *
-	 * @param description the new description
-	 */
-	public void setDescription(String description) {
-		this.description = description;
-	}
-
-	/**
-	 * Gets the imports.
-	 *
-	 * @return the imports
-	 */
-	public Collection<Map<String, Map<String, String>>> getImports() {
-		return imports;
-	}
-
-	/**
-	 * Sets the imports.
-	 *
-	 * @param imports the imports
-	 */
-	public void setImports(Collection<Map<String, Map<String, String>>> imports) {
-		this.imports = imports;
-	}
-	
-	/**
-	 * Gets the node types.
-	 *
-	 * @return the node types
-	 */
-	public Map<String, Object> getnode_types() {
-		return node_types;
-	}
-	
-	/**
-	 * Setnode types.
-	 *
-	 * @param node_types the node types
-	 */
-	public void setnode_types(Map<String, Object> node_types) { 
-		this.node_types = node_types;
-	}
-}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/asdc/local/LocalAsdcClient.java b/vid-app-common/src/main/java/org/openecomp/vid/asdc/local/LocalAsdcClient.java
deleted file mode 100644
index 696e189..0000000
--- a/vid-app-common/src/main/java/org/openecomp/vid/asdc/local/LocalAsdcClient.java
+++ /dev/null
@@ -1,393 +0,0 @@
-package org.openecomp.vid.asdc.local;
-
-import org.codehaus.jackson.JsonParseException;
-import org.codehaus.jackson.map.JsonMappingException;
-import org.codehaus.jackson.map.ObjectMapper;
-import org.json.JSONArray;
-import org.json.JSONObject;
-import org.openecomp.vid.asdc.AsdcCatalogException;
-import org.openecomp.vid.asdc.AsdcClient;
-import org.openecomp.vid.asdc.beans.Artifact;
-import org.openecomp.vid.asdc.beans.Resource;
-import org.openecomp.vid.asdc.beans.Service;
-import org.openecomp.vid.asdc.beans.tosca.ToscaCsar;
-import org.openecomp.vid.asdc.beans.tosca.ToscaMeta;
-import org.openecomp.vid.asdc.beans.tosca.ToscaModel;
-import org.yaml.snakeyaml.Yaml;
-
-import java.io.File;
-import java.io.IOException;
-import java.io.InputStream;
-import java.nio.file.Files;
-import java.nio.file.Path;
-import java.nio.file.Paths;
-import java.nio.file.StandardCopyOption;
-import java.util.*;
-import java.util.zip.ZipFile;
-
-/**
- * The Class LocalAsdcClient.
- */
-public class LocalAsdcClient implements AsdcClient {
-
-
-    /**
-     * The catalog.
-     */
-    private final JSONObject catalog;
-
-    /**
-     * The mapper.
-     */
-    private final ObjectMapper mapper;
-
-    /**
-     * The Class Builder.
-     */
-    public static class Builder {
-
-        /**
-         * The catalog.
-         */
-        private JSONObject catalog = new JSONObject()
-                .put("resources", new JSONObject())
-                .put("services", new JSONObject());
-
-        /**
-         * The mapper.
-         */
-        private ObjectMapper mapper = new ObjectMapper();
-
-        /**
-         * Instantiates a new builder.
-         */
-        public Builder() {
-        }
-
-        /**
-         * Catalog.
-         *
-         * @param catalog the catalog
-         * @return the builder
-         */
-        public org.openecomp.vid.asdc.local.LocalAsdcClient.Builder catalog(JSONObject catalog) {
-            this.catalog = catalog;
-            return this;
-        }
-
-        /**
-         * Mapper.
-         *
-         * @param mapper the mapper
-         * @return the builder
-         */
-        public org.openecomp.vid.asdc.local.LocalAsdcClient.Builder mapper(ObjectMapper mapper) {
-            this.mapper = mapper;
-            return this;
-        }
-
-        /**
-         * Builds the.
-         *
-         * @return the in local sdc client
-         */
-        public org.openecomp.vid.asdc.local.LocalAsdcClient build() {
-            return new org.openecomp.vid.asdc.local.LocalAsdcClient(this);
-        }
-    }
-
-    /**
-     * Instantiates a new in local sdc client.
-     *
-     * @param builder the builder
-     */
-    private LocalAsdcClient(org.openecomp.vid.asdc.local.LocalAsdcClient.Builder builder) {
-        catalog = builder.catalog;
-        mapper = builder.mapper;
-    }
-
-    /**
-     * Gets the catalog.
-     *
-     * @return the catalog
-     */
-    private JSONObject getCatalog() {
-        return catalog;
-    }
-
-    /**
-     * Gets the mapper.
-     *
-     * @return the mapper
-     */
-    private ObjectMapper getMapper() {
-        return mapper;
-    }
-
-    /**
-     * Convert.
-     *
-     * @param <T>   the generic type
-     * @param json  the json
-     * @param clazz the clazz
-     * @return the t
-     * @throws AsdcCatalogException the sdc catalog exception
-     */
-    private <T> T convert(JSONObject json, Class<T> clazz) throws AsdcCatalogException {
-        try {
-            return getMapper().readValue(json.toString(), clazz);
-        } catch (JsonParseException e) {
-            throw new AsdcCatalogException("Failed to parse SDC response (bad data)", e);
-        } catch (JsonMappingException e) {
-            throw new AsdcCatalogException("Failed to map SDC response to internal VID data structure(s)", e);
-        } catch (IOException e) {
-            throw new AsdcCatalogException("Failed to get a response from SDC", e);
-        }
-    }
-
-    /* (non-Javadoc)
-     * @see org.openecomp.vid.asdc.AsdcClient#getResource(java.util.UUID)
-     */
-    public Resource getResource(UUID uuid) throws AsdcCatalogException {
-        final JSONObject resource = getCatalog().getJSONObject("resources")
-                .getJSONObject(uuid.toString());
-        return convert(resource, Resource.class);
-    }
-
-    /* (non-Javadoc)
-     * @see org.openecomp.vid.asdc.AsdcClient#getResources()
-     */
-    public Collection<Resource> getResources() throws AsdcCatalogException {
-        final Collection<Resource> resources = new LinkedList<Resource>();
-
-        for (String key : getCatalog().getJSONObject("resources").keySet()) {
-            final JSONObject json = getCatalog().getJSONObject("resources").getJSONObject(key);
-            final Resource resource = convert(json, Resource.class);
-            resources.add(resource);
-        }
-
-        return resources;
-    }
-
-    /* (non-Javadoc)
-     * @see org.openecomp.vid.asdc.AsdcClient#getResources(java.util.Map)
-     */
-    public Collection<Resource> getResources(Map<String, String[]> filter) throws AsdcCatalogException {
-        final Collection<Resource> resources = new LinkedList<Resource>();
-
-        for (String key : getCatalog().getJSONObject("resources").keySet()) {
-            final JSONObject json = getCatalog().getJSONObject("resources").getJSONObject(key);
-
-            boolean filterMatch = true;
-
-            for (Map.Entry<String, String[]> entry : filter.entrySet()) {
-                for (int i = 0; i < entry.getValue().length; i++) {
-                    if (!json.getString(entry.getKey()).equals(entry.getValue()[i])) {
-                        filterMatch = false;
-                        break;
-                    }
-                }
-            }
-
-            if (filterMatch) resources.add(convert(json, Resource.class));
-        }
-
-        return resources;
-    }
-
-    /* (non-Javadoc)
-     * @see org.openecomp.vid.asdc.AsdcClient#getService(java.util.UUID)
-     */
-    public Service getService(UUID uuid) throws AsdcCatalogException {
-
-        JSONObject serviceJsonObject = null;
-        final JSONArray categoryJsonArray = getCatalog().getJSONArray("services");
-
-        for (int i = 0; i < categoryJsonArray.length() ; i++) {
-            JSONObject jsonServiceObject = categoryJsonArray.getJSONObject(i);
-            if (jsonServiceObject.get("uuid").equals(uuid.toString())) {
-                serviceJsonObject = jsonServiceObject;
-                break;
-            }
-        }
-
-        if (serviceJsonObject != null)
-            return convert(serviceJsonObject, Service.class);
-        else return null;
-    }
-
-    /* (non-Javadoc)
-     * @see org.openecomp.vid.asdc.AsdcClient#getServices()
-     */
-    public Collection<Service> getServices() throws AsdcCatalogException {
-        final Collection<Service> services = new LinkedList<Service>();
-
-        JSONArray servicesArr = getCatalog().getJSONArray("services");
-
-        for (Object objService : servicesArr) {
-            JSONObject jsonServiceItem = (JSONObject) objService;
-            final Service service = convert(jsonServiceItem, Service.class);
-            services.add(service);
-        }
-
-        return services;
-    }
-
-    /* (non-Javadoc)
-     * @see org.openecompt.vid.asdc.AsdcClient#getServices(java.util.Map)
-     */
-    public Collection<Service> getServices(Map<String, String[]> filter) throws AsdcCatalogException {
-        final Collection<Service> services = new LinkedList<Service>();
-
-        JSONArray catalogServices = catalog.getJSONArray("services");
-
-        for (int i = 0; i < catalogServices.length(); i++) {
-
-            JSONObject serviceJson = catalogServices.getJSONObject(i);
-
-            boolean filterMatch = true;
-
-            for (Map.Entry<String, String[]> entry : filter.entrySet()) {
-                for (int j = 0; j < entry.getValue().length; j++) {
-                    if (!serviceJson.getString(entry.getKey()).equals(entry.getValue()[j])) {
-                        filterMatch = false;
-                        break;
-                    }
-                }
-            }
-            if (filterMatch) services.add(convert(serviceJson, Service.class));
-        }
-        return services;
-    }
-
-    /* (non-Javadoc)
-     * @see org.openecomp.vid.asdc.AsdcClient#getResourceArtifact(java.util.UUID, java.util.UUID)
-     */
-    public Artifact getResourceArtifact(UUID resourceUuid, UUID artifactUuid) throws AsdcCatalogException {
-        final  JSONArray artifacts = getCatalog().getJSONObject("resources")
-                .getJSONObject(resourceUuid.toString())
-                .getJSONArray("artifacts");
-
-        for (int i = 0; i < artifacts.length(); i++) {
-            final JSONObject artifact = artifacts.getJSONObject(i);
-
-            if (artifact.getString("artifactUUID").equals(artifactUuid.toString())) {
-                return convert(artifact, Artifact.class);
-            }
-        }
-
-        return null;
-    }
-
-    /* (non-Javadoc)
-     * @see org.openecomp.vid.asdc.AsdcClient#getServiceArtifact(java.util.UUID, java.util.UUID)
-     */
-    public Artifact getServiceArtifact(UUID serviceUuid, UUID artifactUuid) throws AsdcCatalogException {
-        final JSONArray artifacts = getCatalog().getJSONObject("services")
-                .getJSONObject(serviceUuid.toString())
-                .getJSONArray("artifacts");
-
-        for (int i = 0; i < artifacts.length(); i++) {
-            final JSONObject artifact = artifacts.getJSONObject(i);
-
-            if (artifact.getString("artifactUUID").equals(artifactUuid.toString())) {
-                return convert(artifact, Artifact.class);
-            }
-        }
-
-        return null;
-    }
-
-    /* (non-Javadoc)
-     * @see org.openecomp.vid.asdc.AsdcClient#getResourceToscaModel(java.util.UUID)
-     */
-    public Path getResourceToscaModel(UUID resourceUuid) throws AsdcCatalogException {
-        final String toscaModelURL = getCatalog().getJSONObject("resources")
-                .getJSONObject(resourceUuid.toString())
-                .getString("toscaModelURL");
-
-
-        final InputStream toscaModelStream = getClass().getClassLoader().getResourceAsStream(toscaModelURL);
-
-        if (toscaModelStream == null) return null;
-
-        return null;//getToscaModel(toscaModelStream);
-    }
-
-    /* (non-Javadoc)
-     * @see org.openecomp.vid.asdc.AsdcClient#getServiceToscaModel(java.util.UUID)
-     */
-    public Path getServiceToscaModel(UUID serviceUuid) throws AsdcCatalogException {
-
-        String toscaModelURL = null;
-
-        final JSONArray categoryJsonArray = getCatalog().getJSONArray("services");
-
-        for (int i = 0; i < categoryJsonArray.length() ; i++) {
-
-            JSONObject jsonServiceObject = categoryJsonArray.getJSONObject(i);
-            if (jsonServiceObject.get("uuid").equals(serviceUuid.toString())) {
-                toscaModelURL = jsonServiceObject.getString("toscaModelURL");
-                break;
-            }
-        }
-
-        if (toscaModelURL==null){
-            return null;
-        }
-        
-        final InputStream toscaModelStream = getClass().getClassLoader().getResourceAsStream(toscaModelURL);
-
-        ClassLoader classLoader = getClass().getClassLoader();
-        File file = new File(classLoader.getResource(toscaModelURL).getFile());
-        Path path = Paths.get(file.getPath());
-
-        if (toscaModelStream == null) return null;
-
-        return path;
-    }
-
-    /**
-     * Gets the tosca model.
-     *
-     * @param csarInputStream the csar input stream
-     * @return the tosca model
-     * @throws AsdcCatalogException the asdc catalog exception
-     */
-    private ToscaCsar getToscaModel(InputStream csarInputStream) throws AsdcCatalogException {
-        final Path csarFile;
-
-        try {
-            csarFile = Files.createTempFile("csar", ".zip");
-            Files.copy(csarInputStream, csarFile, StandardCopyOption.REPLACE_EXISTING);
-        } catch (IOException e) {
-            throw new AsdcCatalogException("Caught IOException while creating CSAR", e);
-        }
-
-        try (final ZipFile csar = new ZipFile(csarFile.toFile())) {
-
-            final InputStream toscaMetaStream = csar.getInputStream(csar.getEntry("TOSCA-Metadata/TOSCA.meta"));
-            final ToscaMeta toscaMeta = new ToscaMeta.Builder(toscaMetaStream).build();
-            final String entryDefinitions = toscaMeta.get("Entry-Definitions");
-            final InputStream toscaParentEntryYamlStream = csar.getInputStream(csar.getEntry(entryDefinitions));
-
-            final Yaml yaml = new Yaml();
-            final ToscaModel parentModel = yaml.loadAs(toscaParentEntryYamlStream, ToscaModel.class);
-
-            final ToscaCsar.Builder csarBuilder = new ToscaCsar.Builder(parentModel);
-
-            for (Map<String, Map<String, String>> imports : parentModel.getImports()) {
-                for (Map.Entry<String, Map<String, String>> entry : imports.entrySet()) {
-                    final InputStream toscaChildEntryYamlStream = csar.getInputStream(csar.getEntry("Definitions/" + entry.getValue().get("file")));
-                    final ToscaModel childModel = yaml.loadAs(toscaChildEntryYamlStream, ToscaModel.class);
-                    csarBuilder.addVnf(childModel);
-                }
-            }
-
-            return csarBuilder.build();
-        } catch (IOException e) {
-            throw new AsdcCatalogException("Caught IOException while processing CSAR", e);
-        }
-    }
-
-}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/asdc/memory/InMemoryAsdcClient.java b/vid-app-common/src/main/java/org/openecomp/vid/asdc/memory/InMemoryAsdcClient.java
deleted file mode 100755
index 2b783d4..0000000
--- a/vid-app-common/src/main/java/org/openecomp/vid/asdc/memory/InMemoryAsdcClient.java
+++ /dev/null
@@ -1,372 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * VID
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 	
- *      http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.vid.asdc.memory;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.nio.file.Files;
-import java.nio.file.Path;
-import java.nio.file.StandardCopyOption;
-import java.util.Collection;
-import java.util.LinkedList;
-import java.util.Map;
-import java.util.Map.Entry;
-import java.util.UUID;
-import java.util.zip.ZipFile;
-
-import org.codehaus.jackson.JsonParseException;
-import org.codehaus.jackson.map.JsonMappingException;
-import org.codehaus.jackson.map.ObjectMapper;
-import org.json.JSONArray;
-import org.json.JSONObject;
-import org.yaml.snakeyaml.Yaml;
-
-import org.openecomp.vid.asdc.AsdcCatalogException;
-import org.openecomp.vid.asdc.AsdcClient;
-import org.openecomp.vid.asdc.beans.Artifact;
-import org.openecomp.vid.asdc.beans.Resource;
-import org.openecomp.vid.asdc.beans.Service;
-import org.openecomp.vid.asdc.beans.tosca.ToscaCsar;
-import org.openecomp.vid.asdc.beans.tosca.ToscaMeta;
-import org.openecomp.vid.asdc.beans.tosca.ToscaModel;
-
-/**
- * The Class InMemoryAsdcClient.
- */
-public class InMemoryAsdcClient implements AsdcClient {
-
-	/** The catalog. */
-	private final JSONObject catalog;
-	
-	/** The mapper. */
-	private final ObjectMapper mapper;
-
-	/**
-	 * The Class Builder.
-	 */
-	public static class Builder {
-		
-		/** The catalog. */
-		private JSONObject catalog = new JSONObject()
-										.put("resources", new JSONObject())
-										.put("services", new JSONObject());
-		
-		/** The mapper. */
-		private ObjectMapper mapper = new ObjectMapper();
-
-		/**
-		 * Instantiates a new builder.
-		 */
-		public Builder() {}
-		
-		/**
-		 * Catalog.
-		 *
-		 * @param catalog the catalog
-		 * @return the builder
-		 */
-		public Builder catalog(JSONObject catalog) {
-			this.catalog = catalog;
-			return this;
-		}
-		
-		/**
-		 * Mapper.
-		 *
-		 * @param mapper the mapper
-		 * @return the builder
-		 */
-		public Builder mapper(ObjectMapper mapper) {
-			this.mapper = mapper;
-			return this;
-		}
-		
-		/**
-		 * Builds the.
-		 *
-		 * @return the in memory sdc client
-		 */
-		public InMemoryAsdcClient build() {
-			return new InMemoryAsdcClient(this);
-		}
-	}
-	
-	/**
-	 * Instantiates a new in memory sdc client.
-	 *
-	 * @param builder the builder
-	 */
-	InMemoryAsdcClient(Builder builder) {
-		catalog = builder.catalog;
-		mapper = builder.mapper;
-	}
-	
-	/**
-	 * Gets the catalog.
-	 *
-	 * @return the catalog
-	 */
-	private JSONObject getCatalog() {
-		return catalog;
-	}
-	
-	/**
-	 * Gets the mapper.
-	 *
-	 * @return the mapper
-	 */
-	private ObjectMapper getMapper() {
-		return mapper;
-	}
-	
-	/**
-	 * Convert.
-	 *
-	 * @param <T> the generic type
-	 * @param json the json
-	 * @param clazz the clazz
-	 * @return the t
-	 * @throws AsdcCatalogException the sdc catalog exception
-	 */
-	private <T> T convert(JSONObject json, Class<T> clazz) throws AsdcCatalogException {
-		try {
-			return getMapper().readValue(json.toString(), clazz);
-		} catch (JsonParseException e) {
-			throw new AsdcCatalogException("Failed to parse SDC response (bad data)", e);
-		} catch (JsonMappingException e) {
-			throw new AsdcCatalogException("Failed to map SDC response to internal VID data structure(s)", e);
-		} catch (IOException e) {
-			throw new AsdcCatalogException("Failed to get a response from SDC", e);
-		}
-	}
-	
-	/* (non-Javadoc)
-	 * @see org.openecomp.vid.asdc.AsdcClient#getResource(java.util.UUID)
-	 */
-	public Resource getResource(UUID uuid) throws AsdcCatalogException {
-		final JSONObject resource = getCatalog().getJSONObject("resources")
-										.getJSONObject(uuid.toString());
-		return convert(resource, Resource.class);
-	}
-
-	/* (non-Javadoc)
-	 */
-	public Collection<Resource> getResources() throws AsdcCatalogException {
-		final Collection<Resource> resources = new LinkedList<Resource> ();
-		
-		for (String key : getCatalog().getJSONObject("resources").keySet()) {
-			final JSONObject json = getCatalog().getJSONObject("resources").getJSONObject(key);
-			final Resource resource = convert(json, Resource.class);
-			resources.add(resource);
-		}
-		
-		return resources;
-	}
-
-	/* (non-Javadoc)
-	 * @see org.openecomp.vid.asdc.AsdcClient#getResources(java.util.Map)
-	 */
-	public Collection<Resource> getResources(Map<String, String[]> filter) throws AsdcCatalogException {
-		final Collection<Resource> resources = new LinkedList<Resource> ();
-		
-		for (String key : getCatalog().getJSONObject("resources").keySet()) {
-			final JSONObject json = getCatalog().getJSONObject("resources").getJSONObject(key);
-			
-			boolean filterMatch = true;
-			
-			for (Entry<String, String[]> entry : filter.entrySet()) {
-				for (int i = 0; i < entry.getValue().length; i++) {
-					if (!json.getString(entry.getKey()).equals(entry.getValue()[i])) {
-						filterMatch = false;
-						break;
-					}
-				}
-			}
-			
-			if (filterMatch) resources.add(convert(json, Resource.class));
-		}
-		
-		return resources;
-	}
-
-	/* (non-Javadoc)
-	 * @see org.openecomp.vid.asdc.AsdcClient#getService(java.util.UUID)
-	 */
-	public Service getService(UUID uuid) throws AsdcCatalogException {
-		final JSONObject service = getCatalog().getJSONObject("services")
-				.getJSONObject(uuid.toString());
-		return convert(service, Service.class);
-	}
-
-	/* (non-Javadoc)
-	 * @see org.openecomp.vid.asdc.AsdcClient#getServices()
-	 */
-	public Collection<Service> getServices() throws AsdcCatalogException {
-		final Collection<Service> services = new LinkedList<Service> ();
-		
-		for (String key : getCatalog().getJSONObject("services").keySet()) {
-			final JSONObject json = getCatalog().getJSONObject("services").getJSONObject(key);
-			final Service service = convert(json, Service.class);
-			services.add(service);
-		}
-		
-		return services;
-	}
-
-	/* (non-Javadoc)
-	 * @see org.openecompt.vid.asdc.AsdcClient#getServices(java.util.Map)
-	 */
-	public Collection<Service> getServices(Map<String, String[]> filter) throws AsdcCatalogException {
-		final Collection<Service> services = new LinkedList<Service> ();
-		
-		for (String key : getCatalog().getJSONObject("services").keySet()) {
-			final JSONObject json = getCatalog().getJSONObject("services").getJSONObject(key);
-			
-			boolean filterMatch = true;
-			
-			for (Entry<String, String[]> entry : filter.entrySet()) {
-				for (int i = 0; i < entry.getValue().length; i++) {
-					if (!json.getString(entry.getKey()).equals(entry.getValue()[i])) {
-						filterMatch = false;
-						break;
-					}
-				}
-			}
-			
-			if (filterMatch) services.add(convert(json, Service.class));
-		}
-		
-		return services;
-	}
-
-	/* (non-Javadoc)
-	 * @see org.openecomp.vid.asdc.AsdcClient#getResourceArtifact(java.util.UUID, java.util.UUID)
-	 */
-	public Artifact getResourceArtifact(UUID resourceUuid, UUID artifactUuid) throws AsdcCatalogException {
-		final JSONArray artifacts = getCatalog().getJSONObject("resources")
-				.getJSONObject(resourceUuid.toString())
-				.getJSONArray("artifacts");
-		
-		for (int i = 0; i < artifacts.length(); i++) {
-			final JSONObject artifact = artifacts.getJSONObject(i);
-			
-			if (artifact.getString("artifactUUID").equals(artifactUuid.toString())) {
-				return convert(artifact, Artifact.class);
-			}
-		}
-		
-		return null;
-	}
-
-	/* (non-Javadoc)
-	 * @see org.openecomp.vid.asdc.AsdcClient#getServiceArtifact(java.util.UUID, java.util.UUID)
-	 */
-	public Artifact getServiceArtifact(UUID serviceUuid, UUID artifactUuid) throws AsdcCatalogException {
-		final JSONArray artifacts = getCatalog().getJSONObject("services")
-				.getJSONObject(serviceUuid.toString())
-				.getJSONArray("artifacts");
-		
-		for (int i = 0; i < artifacts.length(); i++) {
-			final JSONObject artifact = artifacts.getJSONObject(i);
-			
-			if (artifact.getString("artifactUUID").equals(artifactUuid.toString())) {
-				return convert(artifact, Artifact.class);
-			}
-		}
-		
-		return null;
-	}
-
-	/* (non-Javadoc)
-	 * @see org.openecomp.vid.asdc.AsdcClient#getResourceToscaModel(java.util.UUID)
-	 */
-	public Path getResourceToscaModel(UUID resourceUuid) throws AsdcCatalogException {
-		final String toscaModelURL = getCatalog().getJSONObject("resources")
-				.getJSONObject(resourceUuid.toString())
-				.getString("toscaModelURL");
-
-
-		final InputStream toscaModelStream = getClass().getClassLoader().getResourceAsStream(toscaModelURL);
-		
-		if (toscaModelStream == null) return null;
-		
-		return null;//getToscaModel(toscaModelStream);
-	}
-
-	/* (non-Javadoc)
-	 * @see org.openecomp.vid.asdc.AsdcClient#getServiceToscaModel(java.util.UUID)
-	 */
-	public Path getServiceToscaModel(UUID serviceUuid) throws AsdcCatalogException {
-		final String toscaModelURL = getCatalog().getJSONObject("services")
-						.getJSONObject(serviceUuid.toString())
-						.getString("toscaModelURL");
-		
-		final InputStream toscaModelStream = getClass().getClassLoader().getResourceAsStream(toscaModelURL);
-		
-		if (toscaModelStream == null) return null;
-		
-		return null;//getToscaModel(toscaModelStream);
-	}
-
-	/**
-	 * Gets the tosca model.
-	 *
-	 * @param csarInputStream the csar input stream
-	 * @return the tosca model
-	 * @throws AsdcCatalogException the asdc catalog exception
-	 */
-	private ToscaCsar getToscaModel(InputStream csarInputStream) throws AsdcCatalogException {
-		final Path csarFile;
-		
-		try {
-			csarFile = Files.createTempFile("csar", ".zip");
-			Files.copy(csarInputStream, csarFile, StandardCopyOption.REPLACE_EXISTING);
-		} catch (IOException e) {
-			throw new AsdcCatalogException("Caught IOException while creating CSAR", e);
-		}
-		
-		try (final ZipFile csar = new ZipFile(csarFile.toFile())) {
-			
-			final InputStream toscaMetaStream = csar.getInputStream(csar.getEntry("TOSCA-Metadata/TOSCA.meta"));
-			final ToscaMeta toscaMeta = new ToscaMeta.Builder(toscaMetaStream).build();
-			final String entryDefinitions = toscaMeta.get("Entry-Definitions");
-			final InputStream toscaParentEntryYamlStream = csar.getInputStream(csar.getEntry(entryDefinitions));
-			
-			final Yaml yaml = new Yaml();
-			final ToscaModel parentModel = yaml.loadAs(toscaParentEntryYamlStream, ToscaModel.class);
-
-			final ToscaCsar.Builder csarBuilder = new ToscaCsar.Builder(parentModel);
-			
-			for (Map<String, Map<String, String>> imports : parentModel.getImports()) {
-				for (Entry<String, Map<String, String>> entry : imports.entrySet()) {
-					final InputStream toscaChildEntryYamlStream = csar.getInputStream(csar.getEntry("Definitions/" + entry.getValue().get("file")));
-					final ToscaModel childModel = yaml.loadAs(toscaChildEntryYamlStream, ToscaModel.class);
-					csarBuilder.addVnf(childModel);
-				}
-			}
-			
-			return csarBuilder.build();
-		} catch (IOException e) {
-			throw new AsdcCatalogException("Caught IOException while processing CSAR", e);
-		}
-	}
-
-}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/asdc/parser/ToscaParser.java b/vid-app-common/src/main/java/org/openecomp/vid/asdc/parser/ToscaParser.java
deleted file mode 100644
index eb16698..0000000
--- a/vid-app-common/src/main/java/org/openecomp/vid/asdc/parser/ToscaParser.java
+++ /dev/null
@@ -1,15 +0,0 @@
-package org.openecomp.vid.asdc.parser;
-
-import java.nio.file.Path;
-
-import org.openecomp.sdc.tosca.parser.exceptions.SdcToscaParserException;
-import org.openecomp.vid.asdc.AsdcCatalogException;
-import org.openecomp.vid.asdc.beans.tosca.ToscaCsar;
-import org.openecomp.vid.asdc.beans.Service;
-import org.openecomp.vid.model.ServiceModel;
-
-public interface ToscaParser{
-	ToscaCsar parse(Path path) throws AsdcCatalogException;
-	
-	ServiceModel makeServiceModel(String uuid,Path path,Service asdcServiceMetadata) throws Exception;
-}
\ No newline at end of file
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/asdc/parser/ToscaParserImpl.java b/vid-app-common/src/main/java/org/openecomp/vid/asdc/parser/ToscaParserImpl.java
deleted file mode 100644
index bea5da8..0000000
--- a/vid-app-common/src/main/java/org/openecomp/vid/asdc/parser/ToscaParserImpl.java
+++ /dev/null
@@ -1,225 +0,0 @@
-package org.openecomp.vid.asdc.parser;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.nio.file.Path;
-import java.text.DateFormat;
-import java.text.SimpleDateFormat;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Set;
-import java.util.UUID;
-import java.util.Map.Entry;
-import java.util.zip.ZipFile;
-
-import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
-import org.openecomp.sdc.tosca.parser.exceptions.SdcToscaParserException;
-import org.openecomp.vid.asdc.AsdcCatalogException;
-import org.openecomp.vid.asdc.beans.Service;
-import org.openecomp.vid.asdc.beans.tosca.NodeTemplate;
-import org.openecomp.vid.asdc.beans.tosca.ToscaCsar;
-import org.openecomp.vid.asdc.beans.tosca.ToscaMeta;
-import org.openecomp.vid.asdc.beans.tosca.ToscaModel;
-import org.openecomp.vid.model.ModelConstants;
-import org.openecomp.vid.model.Network;
-import org.openecomp.vid.model.Node;
-import org.openecomp.vid.model.ServiceModel;
-import org.openecomp.vid.model.VNF;
-import org.openecomp.vid.properties.VidProperties;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.yaml.snakeyaml.Yaml;
-import org.yaml.snakeyaml.error.YAMLException;
-
-public class ToscaParserImpl implements ToscaParser {
-	/** The Constant LOG. */
-	static final EELFLoggerDelegate LOG = EELFLoggerDelegate.getLogger(ToscaParserImpl.class);
-
-	@Autowired
-	private final static DateFormat dateFormat = new SimpleDateFormat("HH:mm:ss:SSSS");
-
-
-	private static final String asdcModelNamespace = VidProperties.getAsdcModelNamespace();
-	private static final String vnfTag = asdcModelNamespace + ModelConstants.VNF;
-	private static final String networkTag = asdcModelNamespace + ModelConstants.NETWORK;
-	private static final String vfModuleTag = asdcModelNamespace + ModelConstants.VF_MODULE;
-
-	
-	@Override
-	public ToscaCsar parse(Path path) throws AsdcCatalogException {
-		return getToscaCsar(path);
-	}
-
-	private ToscaCsar getToscaCsar(final Path csarFile) throws AsdcCatalogException {
-		try (final ZipFile csar = new ZipFile(csarFile.toFile())) {
-
-			final InputStream toscaMetaStream = csar.getInputStream(csar.getEntry("TOSCA-Metadata/TOSCA.meta"));
-			final ToscaMeta toscaMeta = new ToscaMeta.Builder(toscaMetaStream).build();
-			final String entryDefinitions = toscaMeta.get("Entry-Definitions");
-			final InputStream toscaParentEntryYamlStream = csar.getInputStream(csar.getEntry(entryDefinitions));
-
-			try {
-				final Yaml yaml = new Yaml();
-				final ToscaModel parentModel = yaml.loadAs(toscaParentEntryYamlStream, ToscaModel.class);
-
-				final ToscaCsar.Builder csarBuilder = new ToscaCsar.Builder(parentModel);
-
-				for (Map<String, Map<String, String>> imports : parentModel.getImports()) {
-					LOG.debug("imports = " + imports.toString());
-					for (Entry<String, Map<String, String>> entry : imports.entrySet()) {
-						if (entry.getValue() != null) {
-							String fname = entry.getValue().get("file");
-							if ((fname != null) && (fname.startsWith("service") || fname.startsWith("resource"))) {
-								LOG.debug("fname = " + fname);
-								final InputStream toscaChildEntryYamlStream = csar
-										.getInputStream(csar.getEntry("Definitions/" + fname));
-								
-								final ToscaModel childModel = yaml.loadAs(toscaChildEntryYamlStream, ToscaModel.class);
-								csarBuilder.addVnf(childModel);
-							}
-						}
-					}
-				}
-
-				return csarBuilder.build();
-			} catch (YAMLException e) {
-				throw new AsdcCatalogException("Caught exception while processing TOSCA YAML", e);
-			}
-		} catch (IOException e) {
-			throw new AsdcCatalogException("Caught IOException while processing CSAR", e);
-		}
-	}
-	
-	public ServiceModel makeServiceModel(String uuid, final Path serviceCsar,Service service ) throws AsdcCatalogException, SdcToscaParserException {
-		 
-			
-		final ServiceModel serviceModel = new ServiceModel();
-		ToscaCsar toscaCsar = getToscaCsar(serviceCsar);
-		String methodName = "getServices";
-		LOG.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + methodName + " start");
-		Boolean isNewFlow = false;
-		final Map<String, VNF> vnfs = new HashMap<String, VNF>();
-		final Map<String, Network> networks = new HashMap<String, Network>();
-		final ToscaModel asdcServiceToscaModel = toscaCsar.getParent();
-		serviceModel.setService(ServiceModel.extractService(asdcServiceToscaModel, service));
-
-
-		populateVnfsAndNetwork(methodName, isNewFlow, vnfs, networks, asdcServiceToscaModel, serviceModel);
-
-		// If we see customization uuid under vnf or network, follow 1702 flow
-		if (isNewFlow) {
-			return (getCustomizedServices(asdcServiceToscaModel, serviceModel));
-		} else {
-			VNF vnf = null;
-			for (ToscaModel vnfModel : toscaCsar.getChildren()) {
-				// using uuid to match should only be valid for 1610 models
-				final String vnfUuid = (vnfModel.getMetadata().getUUID());
-				// find the VNF with that uuid, uuid is not the key anymore
-				vnf = findVNFAccordingToUUID(vnfs, vnfUuid);
-				if (vnf == null) {
-					LOG.warn("Couldn't find VNF object " + vnfUuid + ". Problem with Tosca model?");
-					continue;
-				}
-				extractAndUpdateInputs(vnf, vnfModel);
-				ServiceModel.extractGroups(vnfModel, serviceModel);
-			}
-
-			serviceModel.setVnfs(vnfs);
-			serviceModel.setNetworks(networks);
-			return serviceModel;
-		}
-	}
-
-	private VNF findVNFAccordingToUUID(final Map<String, VNF> vnfs,  final String vnfUuid) {
-		VNF vnf = null;
-		for (Entry<String, VNF> vnfComp : vnfs.entrySet()) {
-			if (((vnfComp.getValue().getUuid()).equalsIgnoreCase(vnfUuid))) {
-				// found the vnf
-				vnf = vnfComp.getValue();
-			}
-		}
-		return vnf;
-	}
-
-	private void extractAndUpdateInputs(VNF vnf, ToscaModel vnfModel) {
-		vnf.setInputs(vnfModel.gettopology_template().getInputs());
-	}
-
-	private static void populateVnfsAndNetwork(String methodName, Boolean isNewFlow, final Map<String, VNF> vnfs,
-			final Map<String, Network> networks, final ToscaModel asdcServiceToscaModel, ServiceModel serviceModel)
-					throws AsdcCatalogException, SdcToscaParserException {
-		for (Entry<String, NodeTemplate> component : extractNodeTemplates(asdcServiceToscaModel)) {
-			final String modelCustomizationName = component.getKey();
-			LOG.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + methodName
-					+ " model customization name: " + modelCustomizationName);
-			final NodeTemplate nodeTemplate = component.getValue();
-			final String type = nodeTemplate.getType();
-
-			if (type.startsWith(vnfTag)) {
-				LOG.debug(EELFLoggerDelegate.debugLogger,
-						dateFormat.format(new Date()) + methodName + " found node template type: " + type);
-				final VNF vnf = new VNF();
-				vnf.extractVnf(modelCustomizationName, nodeTemplate);
-//				populateNodeVersionIfMissing(nodeTemplate, vnf,service);
-				LOG.debug(EELFLoggerDelegate.debugLogger,
-						dateFormat.format(new Date()) + methodName + " VNF commands: " + vnf.getCommands());
-				vnfs.put(modelCustomizationName, vnf);
-				isNewFlow = isNewFlow(vnf);
-			}
-			// Networks
-			if (type.startsWith(networkTag)) {
-				LOG.debug(EELFLoggerDelegate.debugLogger,
-						dateFormat.format(new Date()) + methodName + " found node template type: " + type);
-				final Network network = new Network();
-				network.extractNetwork(modelCustomizationName, nodeTemplate);
-//				populateNodeVersionIfMissing(nodeTemplate, network, service);
-				isNewFlow = isNewFlow(network);
-				networks.put(modelCustomizationName, network);
-
-			}
-		}
-		serviceModel.setVnfs(vnfs);
-		serviceModel.setNetworks(networks);
-
-	}
-
-	private static Set<Entry<String, NodeTemplate>> extractNodeTemplates(final ToscaModel asdcServiceToscaModel) {
-		return asdcServiceToscaModel.gettopology_template().getnode_templates().entrySet();
-	}
-
-	private static boolean isNewFlow(Node node) {
-		return (node.getCustomizationUuid() != null) && (node.getCustomizationUuid().length() > 0);
-	}
-
-	private static boolean isNodeVersionMissing(Node Node) {
-		return Node.getVersion() == null;
-	}
-
-	private static void populateNodeVersionIfMissing(final NodeTemplate nodeTemplate, final Node node, Service service)
-			throws AsdcCatalogException {
-		if (isNodeVersionMissing(node)) {
-			node.setVersion(service.getVersion());
-		}
-	}
-	
-	private ServiceModel getCustomizedServices(ToscaModel asdcServiceToscaModel, ServiceModel serviceModel) {
-		String methodName = "asdcServiceToscaModel";
-		LOG.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + methodName + " start");
-
-		// asdcServiceToscaModel should have vf modules and vol groups populated
-		// at this point but
-		// they are not associated with the VNFs
-		ServiceModel.extractGroups(asdcServiceToscaModel,serviceModel);
-		// Now put the vf modules and volume groups under the VNF they belong
-		// too
-		serviceModel.associateGroups();
-		return (serviceModel);
-	}
-
-
-	private UUID extractUUIDFromNodeTemplate(final NodeTemplate nodeTemplate) {
-		return UUID.fromString(nodeTemplate.getMetadata().getUUID());
-	}
-
-
-}
\ No newline at end of file
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/asdc/parser/ToscaParserImpl2.java b/vid-app-common/src/main/java/org/openecomp/vid/asdc/parser/ToscaParserImpl2.java
deleted file mode 100644
index f364d0b..0000000
--- a/vid-app-common/src/main/java/org/openecomp/vid/asdc/parser/ToscaParserImpl2.java
+++ /dev/null
@@ -1,254 +0,0 @@
-package org.openecomp.vid.asdc.parser;
-
-import org.openecomp.sdc.tosca.parser.api.ISdcCsarHelper;
-import org.openecomp.sdc.tosca.parser.exceptions.SdcToscaParserException;
-import org.openecomp.sdc.tosca.parser.impl.FilterType;
-import org.openecomp.sdc.tosca.parser.impl.SdcToscaParserFactory;
-import org.openecomp.sdc.toscaparser.api.Group;
-import org.openecomp.sdc.toscaparser.api.NodeTemplate;
-import org.openecomp.sdc.toscaparser.api.Property;
-import org.openecomp.sdc.toscaparser.api.parameters.Input;
-import org.openecomp.vid.asdc.beans.Service;
-import org.openecomp.vid.model.*;
-
-import java.nio.file.Path;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-public class ToscaParserImpl2 {
-
-    
-	public class Constants {
-		public final static String uuid = "UUID";
-		public final static String description = "description";
-		public final static String serviceType = "serviceType";
-        public final static String serviceRole = "serviceRole";
-        public final static String ecompGeneratedNaming = "ecompGeneratedNaming";
-
-        public final static String customizationUUID = "customizationUUID";
-		public final static String vfModuleModelVersion = "vfModuleModelVersion";
-		public final static String vfModuleModelCustomizationUUID = "vfModuleModelCustomizationUUID";
-		public final static String volume_group = "volume_group";
-		public final static String vfModuleModelInvariantUUID = "vfModuleModelInvariantUUID";
-		public final static String vfModuleModelUUID = "vfModuleModelUUID";
-		public final static String invariantUUID = "invariantUUID";
-		public final static String version = "version";
-		public final static String name = "name";
-		public final static String category = "category";
-		public final static String vfModuleModelName = "vfModuleModelName";
-		public final static String getInput = "get_input";
-	}
-	
-	public ToscaParserImpl2() {
-
-    }
-
-    public ServiceModel makeServiceModel(Path path, Service asdcServiceMetadata) throws Exception {
-        ServiceModel serviceModel = new ServiceModel();
-        SdcToscaParserFactory factory = SdcToscaParserFactory.getInstance();
-        ISdcCsarHelper sdcCsarHelper = factory.getSdcCsarHelper(path.toFile().getAbsolutePath()); //, false);
-        serviceModel.setService(extractServiceFromCsar(asdcServiceMetadata, sdcCsarHelper));
-        serviceModel.setVolumeGroups(extractVolumeGroups(sdcCsarHelper));
-        serviceModel.setVfModules(extractVfModuleFromCsar(sdcCsarHelper));
-        serviceModel.setVnfs(extractVnfsFromCsar(serviceModel,sdcCsarHelper));
-        serviceModel.setNetworks(extractNetworksFromCsar(sdcCsarHelper));
-        return serviceModel;
-    }
-
-    private  org.openecomp.vid.model.Service extractServiceFromCsar(Service asdcServiceMetadata, ISdcCsarHelper csarHelper) throws SdcToscaParserException {
-        org.openecomp.vid.model.Service service = new  org.openecomp.vid.model.Service();
-
-        service.setName(csarHelper.getServiceMetadata().getValue(Constants.name));
-        service.setCategory(csarHelper.getServiceMetadata().getValue(Constants.category));
-        service.setInvariantUuid(csarHelper.getServiceMetadata().getValue(Constants.invariantUUID));
-        service.setUuid(csarHelper.getServiceMetadata().getValue(Constants.uuid));
-        service.setVersion(asdcServiceMetadata.getVersion());
-        service.setDescription(csarHelper.getServiceMetadata().getValue(Constants.description));
-        service.setInputs(inputsListToInputsMap(csarHelper.getServiceInputs()));
-        service.setServiceEcompNaming(csarHelper.getServiceMetadata().getValue(Constants.ecompGeneratedNaming));
-        service.setServiceType(csarHelper.getServiceMetadata().getValue(Constants.serviceType));
-        service.setServiceRole(csarHelper.getServiceMetadata().getValue(Constants.serviceRole));
-
-        return service;
-    }
-    
-    private Map<String, VNF> extractVnfsFromCsar(ServiceModel serviceModel,ISdcCsarHelper csarHelper) {
-        List<NodeTemplate> nodeTemplates = csarHelper.getServiceVfList();
-        Map<String, VNF> vnfsMaps = new HashMap<String, VNF>();
-
-        for (NodeTemplate nodeTemplate : nodeTemplates) {
-            VNF vnf = new VNF();
-            populateNodeFromNodeTemplate(nodeTemplate, csarHelper, vnf);
-
-            vnf.setModelCustomizationName(nodeTemplate.getName());
-            Map<String, VfModule> vfModuleHashMap = getVfModulesFromVF(csarHelper, vnf.getCustomizationUuid());
-            vnf.setVfModules(vfModuleHashMap);
-
-            Map<String, VolumeGroup> volumeGroupMap = getVolumeGroupsFromVF(csarHelper, vnf.getCustomizationUuid());
-            vnf.setVolumeGroups(volumeGroupMap);
-
-            vnfsMaps.put(nodeTemplate.getName(), vnf);
-        }
-        return vnfsMaps;
-    }
-
-    private Map<String, VfModule> getVfModulesFromVF(ISdcCsarHelper csarHelper, String vfUuid) {
-        Map<String,VfModule> vfModuleHashMap = new HashMap<String,VfModule>();
-        for (Group group : csarHelper.getVfModulesByVf(vfUuid)) {
-            vfModuleHashMap.put(group.getName(), populateVfModuleFromGroup(group));
-        }
-        return vfModuleHashMap;
-    }
-
-    private Map<String, VolumeGroup> getVolumeGroupsFromVF(ISdcCsarHelper csarHelper, String vfCustomizationUuid) {
-        Map<String,VolumeGroup> volumeGroupMap = new HashMap<String,VolumeGroup>();
-        List<Group> groups = csarHelper.getVfModulesByVf(vfCustomizationUuid);
-        for (Group group : groups) {
-            boolean isVolumeGroup = Boolean.valueOf(group.getPropertyValue(Constants.volume_group).toString());
-            if (isVolumeGroup) {
-                volumeGroupMap.put(group.getName(), populateVolumeGroupFromGroup(group));
-            }
-        }
-        return volumeGroupMap;
-    }
-
-    private Map<String, Network> extractNetworksFromCsar(ISdcCsarHelper csarHelper) {
-        List<NodeTemplate> nodeTemplates = csarHelper.getServiceVlList();
-        Map<String, Network> networksMap = new HashMap<String, Network>();
-
-        for (NodeTemplate nodeTemplate : nodeTemplates) {
-            Network newNetwork = new Network();
-            populateNodeFromNodeTemplate(nodeTemplate, csarHelper, newNetwork);
-            newNetwork.setModelCustomizationName(nodeTemplate.getName());
-            networksMap.put(nodeTemplate.getName(), newNetwork);
-        }
-        return networksMap;
-    }
-
-    private Map<String, VfModule> extractVfModuleFromCsar(ISdcCsarHelper csarHelper) {
-        List<NodeTemplate> serviceVfList = csarHelper.getServiceVfList();
-        HashMap<String, VfModule> vfModuleHashMap = new HashMap<>();
-
-        for (NodeTemplate nodeTemplate : serviceVfList) {
-            Map<String, VfModule> nodeTemplateVfModule =
-                    getVfModulesFromVF(csarHelper, nodeTemplate.getMetaData().getValue(Constants.customizationUUID));
-            vfModuleHashMap.putAll(nodeTemplateVfModule);
-        }
-        return vfModuleHashMap;
-    }
-
-    private Map<String, VolumeGroup> extractVolumeGroups(ISdcCsarHelper csarHelper) {
-        HashMap<String, VolumeGroup> volumeGroupHashMap = new HashMap<>();
-        for (NodeTemplate nodeTemplate : csarHelper.getServiceVfList()) {
-            Map<String, VolumeGroup> nodeTemplateVolumeGroups =
-                    getVolumeGroupsFromVF(csarHelper, csarHelper.getNodeTemplateCustomizationUuid(nodeTemplate));
-            volumeGroupHashMap.putAll(nodeTemplateVolumeGroups);
-        }
-        return volumeGroupHashMap;
-    }
-
-    private Map<String, org.openecomp.vid.asdc.beans.tosca.Input> inputsListToInputsMap(List<org.openecomp.sdc.toscaparser.api.parameters.Input> inputList) {
-        Map<String, org.openecomp.vid.asdc.beans.tosca.Input> inputs = new HashMap<>();
-        for (org.openecomp.sdc.toscaparser.api.parameters.Input input : inputList) {
-            inputs.put(input.getName(), convertInput(input, new org.openecomp.vid.asdc.beans.tosca.Input()));
-        }
-        return inputs;
-    }
-
-    private Node populateNodeFromNodeTemplate(NodeTemplate nodeTemplate, ISdcCsarHelper csarHelper, Node newNode) {
-        newNode.setCustomizationUuid(csarHelper.getNodeTemplateCustomizationUuid(nodeTemplate));
-        newNode.setDescription(nodeTemplate.getMetaData().getValue(Constants.description));
-        newNode.setInvariantUuid(nodeTemplate.getMetaData().getValue(Constants.invariantUUID));
-        newNode.setUuid(nodeTemplate.getMetaData().getValue(Constants.uuid));
-        newNode.setName(nodeTemplate.getMetaData().getValue(Constants.name));
-        newNode.setVersion(nodeTemplate.getMetaData().getValue(Constants.version));
-        newNode.setInputs(extractInputsAndCommandsForNodeTemplate(nodeTemplate, csarHelper, newNode));
-        Map<String, String> propertiesMap = setPropertiesOfVnf(nodeTemplate.getPropertiesObjects());
-        newNode.setProperties(propertiesMap);
-        return newNode;
-    }
-
-    private VfModule populateVfModuleFromGroup(Group group){
-        VfModule vfModule = new VfModule();
-
-        vfModule.setVersion(group.getMetadata().getValue(Constants.vfModuleModelVersion));
-        vfModule.setCustomizationUuid(group.getMetadata().getValue(Constants.vfModuleModelCustomizationUUID));
-        vfModule.setModelCustomizationName(group.getMetadata().getValue(Constants.vfModuleModelName));
-        vfModule.setName(group.getMetadata().getValue(Constants.vfModuleModelName));
-        vfModule.setVolumeGroupAllowed(Boolean.valueOf((group.getPropertyValue(Constants.volume_group)).toString()));
-        vfModule.setDescription(group.getDescription());
-        vfModule.setInvariantUuid(group.getMetadata().getValue(Constants.vfModuleModelInvariantUUID));
-        vfModule.setUuid(group.getMetadata().getValue(Constants.vfModuleModelUUID));
-        return vfModule;
-    }
-
-    private VolumeGroup populateVolumeGroupFromGroup(Group group){
-        VolumeGroup volumeGroup = new VolumeGroup();
-        volumeGroup.setDescription(group.getDescription());
-        volumeGroup.setInvariantUuid(group.getMetadata().getValue(Constants.vfModuleModelInvariantUUID));
-        volumeGroup.setName(group.getMetadata().getValue(Constants.vfModuleModelName));
-        volumeGroup.setModelCustomizationName(group.getMetadata().getValue(Constants.vfModuleModelName));
-        volumeGroup.setVersion(group.getMetadata().getValue(Constants.vfModuleModelVersion));
-        volumeGroup.setUuid(group.getMetadata().getValue(Constants.vfModuleModelUUID));
-        volumeGroup.setCustomizationUuid(group.getMetadata().getValue(Constants.vfModuleModelCustomizationUUID));
-
-        return volumeGroup;
-    }
-
-
-    private Map<String, org.openecomp.vid.asdc.beans.tosca.Input> extractInputsAndCommandsForNodeTemplate(NodeTemplate nodeTemplate, ISdcCsarHelper csarHelper, Node newNode){
-        Map<String, org.openecomp.vid.asdc.beans.tosca.Input> inputMap = new HashMap<>();
-        Map<String, CommandProperty> commandPropertyMap = new HashMap<>();
-
-        List<Input> inputs = csarHelper.getServiceInputs();
-        Map<String, String> properties  = csarHelper.filterNodeTemplatePropertiesByValue(nodeTemplate, FilterType.CONTAINS, Constants.getInput);
-        for (Map.Entry<String, String> property : properties.entrySet()) {
-            String inputKey = property.getValue();
-            String key = extractInputValue(inputKey);
-            for (Input input: inputs){
-                if(input.getName().equals(key)){
-                    org.openecomp.vid.asdc.beans.tosca.Input localInput = new org.openecomp.vid.asdc.beans.tosca.Input();
-                    localInput = convertInput(input, localInput);
-                    String name = property.getKey();
-                    commandPropertyMap.put(name, extractCommands(name, key));
-                    inputMap.put(name, localInput);
-                }
-            }
-        }
-        newNode.setCommands(commandPropertyMap);
-        return inputMap;
-    }
-
-    private String extractInputValue(String inputKey) {
-        return inputKey.substring(inputKey.indexOf(":") + 1);
-    }
-
-    private org.openecomp.vid.asdc.beans.tosca.Input convertInput(Input parserInput, org.openecomp.vid.asdc.beans.tosca.Input localInput){
-        localInput.setDefault(parserInput.getDefault());
-        localInput.setDescription(parserInput.getDescription());
-        localInput.setRequired(parserInput.isRequired());
-        localInput.setType(parserInput.getType());
-        localInput.setConstraints(parserInput.getConstraints());
-//        localInput.setentry_schema()
-        return localInput;
-    }
-
-    private CommandProperty extractCommands(String displayName, String inputName){
-        CommandProperty commandProperty = new CommandProperty();
-        commandProperty.setDisplayName(displayName);
-        commandProperty.setCommand(Constants.getInput);
-        commandProperty.setInputName(inputName);
-        return commandProperty;
-    }
-
-    private Map<String, String> setPropertiesOfVnf(List<Property> properties) {
-        Map<String, String> propertiesMap = new HashMap<String, String>();
-        for (Property property : properties) {
-            propertiesMap.put(property.getName(), property.getValue().toString());
-        }
-        return propertiesMap;
-    }
-
-
-}
\ No newline at end of file
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/asdc/rest/RestfulAsdcClient.java b/vid-app-common/src/main/java/org/openecomp/vid/asdc/rest/RestfulAsdcClient.java
deleted file mode 100755
index 67375aa..0000000
--- a/vid-app-common/src/main/java/org/openecomp/vid/asdc/rest/RestfulAsdcClient.java
+++ /dev/null
@@ -1,467 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * VID
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *      http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.vid.asdc.rest;
-
-import com.fasterxml.jackson.jaxrs.json.JacksonJsonProvider;
-import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
-import org.openecomp.vid.asdc.AsdcCatalogException;
-import org.openecomp.vid.asdc.AsdcClient;
-import org.openecomp.vid.asdc.beans.Artifact;
-import org.openecomp.vid.asdc.beans.Resource;
-import org.openecomp.vid.asdc.beans.Service;
-import org.openecomp.vid.asdc.parser.ToscaParserImpl;
-import org.openecomp.vid.model.ModelConstants;
-import org.openecomp.vid.properties.VidProperties;
-
-import javax.ws.rs.NotFoundException;
-import javax.ws.rs.ProcessingException;
-import javax.ws.rs.WebApplicationException;
-import javax.ws.rs.client.Client;
-import javax.ws.rs.client.ResponseProcessingException;
-import javax.ws.rs.client.WebTarget;
-import javax.ws.rs.core.GenericType;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.MultivaluedHashMap;
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.URI;
-import java.nio.file.Files;
-import java.nio.file.Path;
-import java.nio.file.StandardCopyOption;
-import java.text.DateFormat;
-import java.text.SimpleDateFormat;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.Map;
-import java.util.Map.Entry;
-import java.util.UUID;
-
-/**
- * The Class RestfulAsdcClient.
- */
-@SuppressWarnings("Duplicates")
-public class RestfulAsdcClient implements AsdcClient {
-
-    /**
-     * The Class Builder.
-     */
-    public static class Builder {
-
-        /**
-         * The client.
-         */
-        private final Client client;
-
-        /**
-         * The uri.
-         */
-        private final URI uri;
-
-        /**
-         * The auth.
-         */
-        private String auth = null;
-
-        /**
-         * Instantiates a new builder.
-         *
-         * @param client the client
-         * @param uri    the uri
-         */
-        public Builder(Client client, URI uri) {
-            this.client = client;
-            this.client.register(JacksonJsonProvider.class);
-            this.uri = uri;
-        }
-
-        /**
-         * Auth.
-         *
-         * @param auth the auth
-         * @return the builder
-         */
-        public Builder auth(String auth) {
-            this.auth = auth;
-            return this;
-        }
-
-        /**
-         * Builds the.
-         *
-         * @return the restful asdc client
-         */
-        public RestfulAsdcClient build() {
-            return new RestfulAsdcClient(this);
-        }
-    }
-
-    /**
-     * The Constant LOG.
-     */
-    static final EELFLoggerDelegate LOG = EELFLoggerDelegate.getLogger(RestfulAsdcClient.class);
-
-    /**
-     * The Constant dateFormat.
-     */
-    final static DateFormat dateFormat = new SimpleDateFormat("HH:mm:ss:SSSS");
-
-    /**
-     * The client.
-     */
-    private final Client client;
-
-    /**
-     * The uri.
-     */
-    private final URI uri;
-
-    /**
-     * The common headers.
-     */
-    private final MultivaluedHashMap<String, Object> commonHeaders;
-
-    /**
-     * The auth.
-     */
-    private final String auth;
-
-    ToscaParserImpl p = new ToscaParserImpl();
-
-    /**
-     * Instantiates a new restful asdc client.
-     *
-     * @param builder the builder
-     */
-    private RestfulAsdcClient(Builder builder) {
-        client = builder.client;
-        uri = builder.uri;
-        auth = builder.auth;
-
-        commonHeaders = new MultivaluedHashMap<String, Object>();
-        commonHeaders.put("X-ECOMP-InstanceID", Collections.singletonList((Object) "VID"));
-        commonHeaders.put("Authorization", Collections.singletonList((Object) (auth)));
-    }
-
-    private Path createTmpFile(InputStream csarInputStream) throws AsdcCatalogException {
-        final Path csarFile;
-        try {
-            csarFile = Files.createTempFile("csar", ".zip");
-            Files.copy(csarInputStream, csarFile, StandardCopyOption.REPLACE_EXISTING);
-        } catch (IOException e) {
-            throw new AsdcCatalogException("Caught IOException while creating CSAR", e);
-        }
-        return csarFile;
-    }
-
-    /**
-     * Gets the client.
-     *
-     * @return the client
-     */
-    private Client getClient() {
-        return client;
-    }
-
-    /* (non-Javadoc)
-     * @see org.openecomp.vid.asdc.AsdcClient#getResource(java.util.UUID)
-     */
-    public Resource getResource(UUID uuid) throws AsdcCatalogException {
-
-        String path = VidProperties.getPropertyWithDefault(ModelConstants.ASDC_RESOURCE_API_PATH, ModelConstants.DEFAULT_ASDC_RESOURCE_API_PATH);
-        try {
-            return getClient()
-                    .target(uri)
-                    .path(path + "/" + uuid.toString() + "/metadata")
-                    .request(MediaType.APPLICATION_JSON_TYPE)
-                    .headers(commonHeaders)
-                    .header("Content-Type", MediaType.APPLICATION_JSON)
-                    .get(Resource.class);
-        } catch (ResponseProcessingException e) {
-            //Couldn't convert response to Java type
-            throw new AsdcCatalogException("ASDC response could not be processed", e);
-        } catch (ProcessingException e) {
-            //IO problems during request
-            throw new AsdcCatalogException("Failed to get a response from ASDC service", e);
-        } catch (WebApplicationException e) {
-            //Web service returned data, but the response status wasn't a good one (i.e. non 2xx)
-            throw new AsdcCatalogException(e);
-        }
-    }
-
-    /* (non-Javadoc)
-     * @see org.openecomp.vid.asdc.AsdcClient#getResourceArtifact(java.util.UUID, java.util.UUID)
-     */
-    public Artifact getResourceArtifact(UUID resourceUuid, UUID artifactUuid) throws AsdcCatalogException {
-        String path = VidProperties.getPropertyWithDefault(ModelConstants.ASDC_RESOURCE_API_PATH, ModelConstants.DEFAULT_ASDC_RESOURCE_API_PATH);
-        try {
-            return getClient()
-                    .target(uri)
-                    .path(path + "/" + resourceUuid + "/artifacts/" + artifactUuid)
-                    .request(MediaType.APPLICATION_JSON_TYPE)
-                    .headers(commonHeaders)
-                    .header("Content-Type", MediaType.APPLICATION_JSON)
-                    .get(Artifact.class);
-        } catch (ResponseProcessingException e) {
-            //Couldn't convert response to Java type
-            throw new AsdcCatalogException("ASDC response could not be processed", e);
-        } catch (ProcessingException e) {
-            //IO problems during request
-            throw new AsdcCatalogException("Failed to get a response from ASDC service", e);
-        } catch (WebApplicationException e) {
-            //Web service returned data, but the response status wasn't a good one (i.e. non 2xx)
-            throw new AsdcCatalogException(e);
-        }
-    }
-
-    /* (non-Javadoc)
-     * @see org.openecomp.vid.asdc.AsdcClient#getResources()
-     */
-    public Collection<Resource> getResources() throws AsdcCatalogException {
-        String path = VidProperties.getPropertyWithDefault(ModelConstants.ASDC_RESOURCE_API_PATH, ModelConstants.DEFAULT_ASDC_RESOURCE_API_PATH);
-        try {
-            return getClient()
-                    .target(uri)
-                    .path(path)
-                    .request(MediaType.APPLICATION_JSON_TYPE)
-                    .headers(commonHeaders)
-                    .header("Content-Type", MediaType.APPLICATION_JSON)
-                    .get(new GenericType<Collection<Resource>>() {
-                    });
-        } catch (ResponseProcessingException e) {
-            //Couldn't convert response to Java type
-            throw new AsdcCatalogException("ASDC response could not be processed", e);
-        } catch (ProcessingException e) {
-            //IO problems during request
-            throw new AsdcCatalogException("Failed to get a response from ASDC service", e);
-        } catch (WebApplicationException e) {
-            //Web service returned data, but the response status wasn't a good one (i.e. non 2xx)
-            throw new AsdcCatalogException(e);
-        }
-    }
-
-    /* (non-Javadoc)
-     * @see org.openecomp.vid.asdc.AsdcClient#getResources(java.util.Map)
-     */
-    public Collection<Resource> getResources(Map<String, String[]> filter) throws AsdcCatalogException {
-        String path = VidProperties.getPropertyWithDefault(ModelConstants.ASDC_RESOURCE_API_PATH, ModelConstants.DEFAULT_ASDC_RESOURCE_API_PATH);
-        WebTarget target = getClient()
-                .target(uri)
-                .path(path);
-
-        for (Entry<String, String[]> filterEntry : filter.entrySet()) {
-            target = target.queryParam(filterEntry.getKey(), (Object[]) filterEntry.getValue());
-        }
-
-        try {
-            return target.request()
-                    .accept(MediaType.APPLICATION_JSON_TYPE)
-                    .headers(commonHeaders)
-                    .header("Content-Type", MediaType.APPLICATION_JSON)
-                    .get(new GenericType<Collection<Resource>>() {
-                    });
-        } catch (ResponseProcessingException e) {
-            //Couldn't convert response to Java type
-            throw new AsdcCatalogException("ASDC response could not be processed", e);
-        } catch (ProcessingException e) {
-            //IO problems during request
-            throw new AsdcCatalogException("Failed to get a response from ASDC service", e);
-        } catch (NotFoundException e) {
-            throw e;
-        } catch (WebApplicationException e) {
-            //Web service returned data, but the response status wasn't a good one (i.e. non 2xx)
-            throw new AsdcCatalogException(e);
-        }
-    }
-
-    /* (non-Javadoc)
-     * @see org.openecomp.vid.asdc.AsdcClient#getResourceToscaModel(java.util.UUID)
-     */
-    public Path getResourceToscaModel(UUID resourceUuid) throws AsdcCatalogException {
-        String path = VidProperties.getPropertyWithDefault(ModelConstants.ASDC_RESOURCE_API_PATH, ModelConstants.DEFAULT_ASDC_RESOURCE_API_PATH);
-        try (final InputStream csarInputStream = (InputStream) getClient()
-                .target(uri)
-                .path(path + "/" + resourceUuid + "/toscaModel")
-                .request(MediaType.APPLICATION_OCTET_STREAM_TYPE)
-                .headers(commonHeaders)
-                .header("Content-Type", MediaType.APPLICATION_OCTET_STREAM)
-                .get(InputStream.class)) {
-
-            return getToscaCsar(csarInputStream);
-        } catch (IOException e) {
-            throw new AsdcCatalogException("Failed to retrieve resource TOSCA model from ASDC", e);
-        }
-    }
-
-    /* (non-Javadoc)
-     * @see org.openecomp.vid.asdc.AsdcClient#getService(java.util.UUID)
-     */
-    public Service getService(UUID uuid) throws AsdcCatalogException {
-
-        String path = VidProperties.getPropertyWithDefault(ModelConstants.ASDC_SVC_API_PATH, ModelConstants.DEFAULT_ASDC_SVC_API_PATH);
-        try {
-            return getClient()
-                    .target(uri)
-                    .path(path + "/" + uuid.toString() + "/metadata")
-                    .request(MediaType.APPLICATION_JSON)
-                    .headers(commonHeaders)
-                    .get(Service.class);
-        } catch (ResponseProcessingException e) {
-            //Couldn't convert response to Java type
-            throw new AsdcCatalogException("ASDC response could not be processed", e);
-        } catch (ProcessingException e) {
-            //IO problems during request
-            throw new AsdcCatalogException("Failed to get a response from ASDC service", e);
-        } catch (WebApplicationException e) {
-            //Web service returned data, but the response status wasn't a good one (i.e. non 2xx)
-            throw new AsdcCatalogException(e);
-        }
-    }
-
-    /* (non-Javadoc)
-     * @see org.openecomp.vid.asdc.AsdcClient#getServiceArtifact(java.util.UUID, java.util.UUID)
-     */
-    public Artifact getServiceArtifact(UUID serviceUuid, UUID artifactUuid) throws AsdcCatalogException {
-        String path = VidProperties.getPropertyWithDefault(ModelConstants.ASDC_SVC_API_PATH, ModelConstants.DEFAULT_ASDC_SVC_API_PATH);
-		
-        try {
-            return getClient()
-                    .target(uri)
-                    .path(path + "/" + serviceUuid + "/artifacts/" + artifactUuid)
-                    .request(MediaType.APPLICATION_JSON_TYPE)
-                    .headers(commonHeaders)
-                    .header("Content-Type", MediaType.APPLICATION_JSON)
-                    .get(Artifact.class);
-        } catch (ResponseProcessingException e) {
-            //Couldn't convert response to Java type
-            throw new AsdcCatalogException("ASDC response could not be processed", e);
-        } catch (ProcessingException e) {
-            //IO problems during request
-            throw new AsdcCatalogException("Failed to get a response from ASDC service", e);
-        } catch (WebApplicationException e) {
-            //Web service returned data, but the response status wasn't a good one (i.e. non 2xx)
-            throw new AsdcCatalogException(e);
-        }
-    }
-
-    /* (non-Javadoc)
-     * @see org.openecomp.vid.asdc.AsdcClient#getServices()
-     */
-    public Collection<Service> getServices() throws AsdcCatalogException {
-        String path = VidProperties.getPropertyWithDefault(ModelConstants.ASDC_SVC_API_PATH, ModelConstants.DEFAULT_ASDC_SVC_API_PATH);
-        try {
-            return getClient()
-                    .target(uri)
-                    .path(path)
-                    .request()
-                    .accept(MediaType.APPLICATION_JSON_TYPE)
-                    .headers(commonHeaders)
-                    .header("Content-Type", MediaType.APPLICATION_JSON)
-                    .get(new GenericType<Collection<Service>>() {
-                    });
-        } catch (ResponseProcessingException e) {
-            //Couldn't convert response to Java type
-            throw new AsdcCatalogException("ASDC response could not be processed", e);
-        } catch (ProcessingException e) {
-            //IO problems during request
-            throw new AsdcCatalogException("Failed to get a response from ASDC service", e);
-        } catch (WebApplicationException e) {
-            //Web service returned data, but the response status wasn't a good one (i.e. non 2xx)
-            throw new AsdcCatalogException(e);
-        }
-    }
-
-    /* (non-Javadoc)
-     * @see org.openecomp.vid.asdc.AsdcClient#getServices(java.util.Map)
-     */
-    public Collection<Service> getServices(Map<String, String[]> filter) throws AsdcCatalogException {
-
-        String path = VidProperties.getPropertyWithDefault(ModelConstants.ASDC_SVC_API_PATH, ModelConstants.DEFAULT_ASDC_SVC_API_PATH);
-        WebTarget target = getClient()
-                .target(uri)
-                .path(path);
-
-
-        for (Entry<String, String[]> filterEntry : filter.entrySet()) {
-            target = target.queryParam(filterEntry.getKey(), (Object[]) filterEntry.getValue());
-        }
-
-        try {
-            return target.request()
-                    .accept(MediaType.APPLICATION_JSON_TYPE)
-                    .headers(commonHeaders)
-                    .header("Content-Type", MediaType.APPLICATION_JSON)
-                    .get(new GenericType<Collection<Service>>() {
-                    });
-        } catch (ResponseProcessingException e) {
-            //Couldn't convert response to Java type
-            throw new AsdcCatalogException("ASDC response could not be processed", e);
-        } catch (ProcessingException e) {
-            //IO problems during request
-            throw new AsdcCatalogException("Failed to get a response from ASDC service", e);
-        } catch (NotFoundException e) {
-            throw e;
-        } catch (WebApplicationException e) {
-            //Web service returned data, but the response status wasn't a good one (i.e. non 2xx)
-            throw new AsdcCatalogException(e);
-        }
-    }
-
-
-    /* (non-Javadoc)
-     * @see org.openecomp.vid.asdc.AsdcClient#getServiceToscaModel(java.util.UUID)
-     */
-    public Path getServiceToscaModel(UUID serviceUuid) throws AsdcCatalogException {
-        String path = VidProperties.getPropertyWithDefault(ModelConstants.ASDC_SVC_API_PATH, ModelConstants.DEFAULT_ASDC_SVC_API_PATH);
-        try {
-            final InputStream csarInputStream = (InputStream) getClient()
-                    .target(uri)
-                    .path(path + "/" + serviceUuid + "/toscaModel")
-                    .request(MediaType.APPLICATION_OCTET_STREAM_TYPE)
-                    .headers(commonHeaders)
-                    .header("Content-Type", MediaType.APPLICATION_OCTET_STREAM)
-                    .get(InputStream.class);
-
-
-            return getToscaCsar(csarInputStream);
-        } catch (ResponseProcessingException e) {
-            //Couldn't convert response to Java type
-            throw new AsdcCatalogException("ASDC response could not be processed", e);
-        } catch (ProcessingException e) {
-            //IO problems during request
-            throw new AsdcCatalogException("Failed to get a response from ASDC service", e);
-        } catch (WebApplicationException e) {
-            //Web service returned data, but the response status wasn't a good one (i.e. non 2xx)
-            throw new AsdcCatalogException(e);
-        }
-    }
-
-
-    /**
-     * Gets the tosca model.
-     *
-     * @param csarInputStream the csar input stream
-     * @return the tosca model
-     * @throws AsdcCatalogException the asdc catalog exception
-     */
-    private Path getToscaCsar(InputStream csarInputStream) throws AsdcCatalogException {
-        return createTmpFile(csarInputStream);
-    }
-}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/changeManagement/ChangeManagementRequest.java b/vid-app-common/src/main/java/org/openecomp/vid/changeManagement/ChangeManagementRequest.java
deleted file mode 100644
index adcb546..0000000
--- a/vid-app-common/src/main/java/org/openecomp/vid/changeManagement/ChangeManagementRequest.java
+++ /dev/null
@@ -1,63 +0,0 @@
-package org.openecomp.vid.changeManagement;
-
-import java.util.List;
-import java.util.HashMap;
-import java.util.Map;
-import com.fasterxml.jackson.annotation.JsonAnyGetter;
-import com.fasterxml.jackson.annotation.JsonAnySetter;
-import com.fasterxml.jackson.annotation.JsonIgnore;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import com.fasterxml.jackson.annotation.JsonPropertyOrder;
-
-@JsonPropertyOrder({
-    "requestDetails",
-		"requestType"
-})
-
-public class ChangeManagementRequest {
-	
-    public ChangeManagementRequest() {}
-
-	@JsonProperty("requestDetails")
-    private List<RequestDetails> requestDetails;
-
-	@JsonProperty("requestType")
-    private String requestType;
-
-	@JsonIgnore
-	private Map<String, Object> additionalProperties = new HashMap<String, Object>();
-    
-	@JsonProperty("requestDetails")
-	public List<RequestDetails> getRequestDetails() {
-		return requestDetails;
-	}
-
-	@JsonProperty("requestDetails")
-	public void setRequestDetails(List<RequestDetails> requestDetails) {
-		this.requestDetails = requestDetails;
-	}
-
-	@JsonProperty("requestType")
-	public String getRequestType() {
-		return requestType;
-	}
-
-	@JsonProperty("requestType")
-	public void setRequestType(String requestType) {
-		this.requestType = requestType;
-	}
-
-	@JsonAnyGetter
-	public Map<String, Object> getAdditionalProperties() {
-	return this.additionalProperties;
-	}
-
-
-	@JsonAnySetter
-	public void setAdditionalProperty(String name, Object value) {
-	this.additionalProperties.put(name, value);
-	}
-
-	
-	
-}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/changeManagement/ChangeManagementResponse.java b/vid-app-common/src/main/java/org/openecomp/vid/changeManagement/ChangeManagementResponse.java
deleted file mode 100644
index 10ba035..0000000
--- a/vid-app-common/src/main/java/org/openecomp/vid/changeManagement/ChangeManagementResponse.java
+++ /dev/null
@@ -1,19 +0,0 @@
-package org.openecomp.vid.changeManagement;
-
-import java.util.ArrayList;
-import java.util.List;
-
-public class ChangeManagementResponse {
-	public List<CmResponse> cmResponses = null;
-
-
-
-	public ChangeManagementResponse(String vnfName) {
-		List<CmResponse> cmResponses = new ArrayList<>();
-		cmResponses.add(new CmResponse(vnfName));
-		this.cmResponses = cmResponses;
-	
-	}
-
-
-}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/changeManagement/CloudConfiguration.java b/vid-app-common/src/main/java/org/openecomp/vid/changeManagement/CloudConfiguration.java
deleted file mode 100644
index a5debc6..0000000
--- a/vid-app-common/src/main/java/org/openecomp/vid/changeManagement/CloudConfiguration.java
+++ /dev/null
@@ -1,55 +0,0 @@
-package org.openecomp.vid.changeManagement;
-
-import java.util.HashMap;
-import java.util.Map;
-import com.fasterxml.jackson.annotation.JsonAnyGetter;
-import com.fasterxml.jackson.annotation.JsonAnySetter;
-import com.fasterxml.jackson.annotation.JsonIgnore;
-import com.fasterxml.jackson.annotation.JsonInclude;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import com.fasterxml.jackson.annotation.JsonPropertyOrder;
-
-@JsonInclude(JsonInclude.Include.NON_NULL)
-@JsonPropertyOrder({
-"lcpCloudRegionId",
-"tenantId"
-})
-public class CloudConfiguration {
-	@JsonProperty("lcpCloudRegionId")
-	private String lcpCloudRegionId;
-	@JsonProperty("tenantId")
-	private String tenantId;
-	@JsonIgnore
-	private Map<String, Object> additionalProperties = new HashMap<String, Object>();
-
-	@JsonProperty("lcpCloudRegionId")
-	public String getLcpCloudRegionId() {
-	return lcpCloudRegionId;
-	}
-
-	@JsonProperty("lcpCloudRegionId")
-	public void setLcpCloudRegionId(String lcpCloudRegionId) {
-	this.lcpCloudRegionId = lcpCloudRegionId;
-	}
-
-	@JsonProperty("tenantId")
-	public String getTenantId() {
-	return tenantId;
-	}
-
-	@JsonProperty("tenantId")
-	public void setTenantId(String tenantId) {
-	this.tenantId = tenantId;
-	}
-
-	@JsonAnyGetter
-	public Map<String, Object> getAdditionalProperties() {
-	return this.additionalProperties;
-	}
-
-	@JsonAnySetter
-	public void setAdditionalProperty(String name, Object value) {
-	this.additionalProperties.put(name, value);
-	}
-
-}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/changeManagement/CmResponse.java b/vid-app-common/src/main/java/org/openecomp/vid/changeManagement/CmResponse.java
deleted file mode 100644
index 70e09d8..0000000
--- a/vid-app-common/src/main/java/org/openecomp/vid/changeManagement/CmResponse.java
+++ /dev/null
@@ -1,17 +0,0 @@
-package org.openecomp.vid.changeManagement;
-
-public class CmResponse {
-	
-	public String orchestratorRequestId;
-	public String serviceInstanceId;
-	public String vnfInstanceId;
-	public String vnfName;
-	
-	public CmResponse(String vnfName){
-		this.orchestratorRequestId = "Request Id";
-		this.serviceInstanceId = "Service instance Id";
-		this.vnfInstanceId = "Vnf instance Id";
-		this.vnfName = vnfName;
-	}
-
-}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/changeManagement/LeanCloudConfiguration.java b/vid-app-common/src/main/java/org/openecomp/vid/changeManagement/LeanCloudConfiguration.java
deleted file mode 100644
index 663ff8c..0000000
--- a/vid-app-common/src/main/java/org/openecomp/vid/changeManagement/LeanCloudConfiguration.java
+++ /dev/null
@@ -1,20 +0,0 @@
-package org.openecomp.vid.changeManagement;
-
-/**
- * Created by Oren on 9/5/17.
- */
-public class LeanCloudConfiguration {
-
-    public LeanCloudConfiguration() {
-    }
-
-    public LeanCloudConfiguration(org.openecomp.vid.domain.mso.CloudConfiguration cloudConfiguration) {
-        this.tenantId = cloudConfiguration.getTenantId();
-        this.lcpCloudRegionId = cloudConfiguration.getLcpCloudRegionId();
-
-    }
-    public String lcpCloudRegionId;
-
-    public String tenantId;
-
-}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/changeManagement/ModelInfo.java b/vid-app-common/src/main/java/org/openecomp/vid/changeManagement/ModelInfo.java
deleted file mode 100644
index 517628c..0000000
--- a/vid-app-common/src/main/java/org/openecomp/vid/changeManagement/ModelInfo.java
+++ /dev/null
@@ -1,138 +0,0 @@
-package org.openecomp.vid.changeManagement;
-import java.util.HashMap;
-import java.util.Map;
-import com.fasterxml.jackson.annotation.JsonAnyGetter;
-import com.fasterxml.jackson.annotation.JsonAnySetter;
-import com.fasterxml.jackson.annotation.JsonIgnore;
-import com.fasterxml.jackson.annotation.JsonInclude;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import com.fasterxml.jackson.annotation.JsonPropertyOrder;
-
-@JsonInclude(JsonInclude.Include.NON_NULL)
-@JsonPropertyOrder({
-"modelType",
-"modelInvariantId",
-"modelVersionId",
-"modelName",
-"modelVersion",
-"modelCustomizationName",
-"modelCustomizationId"
-})
-public class ModelInfo {
-
-	public ModelInfo(){
-
-	}
-
-	public ModelInfo(org.openecomp.vid.domain.mso.ModelInfo modelInfo){
-		this.setModelType(modelInfo.getModelType().toString());
-		this.setModelInvariantId(modelInfo.getModelInvariantId());
-		this.setModelVersionId(modelInfo.getModelNameVersionId());
-		this.setModelName(modelInfo.getModelName());
-		this.setModelVersion(modelInfo.getModelVersion());
-		this.setModelCustomizationId(modelInfo.getModelCustomizationId());
-		this.setModelVersionId(modelInfo.getModelVersionId());
-	}
-
-	
-	@JsonProperty("modelType")
-	private String modelType;
-	@JsonProperty("modelInvariantId")
-	private String modelInvariantId;
-	@JsonProperty("modelVersionId")
-	private String modelVersionId;
-	@JsonProperty("modelName")
-	private String modelName;
-	@JsonProperty("modelVersion")
-	private String modelVersion;
-	@JsonProperty("modelCustomizationName")
-	private String modelCustomizationName;
-	@JsonProperty("modelCustomizationId")
-	private String modelCustomizationId;
-	@JsonIgnore
-	private Map<String, Object> additionalProperties = new HashMap<String, Object>();
-
-	@JsonProperty("modelType")
-	public String getModelType() {
-	return modelType;
-	}
-
-	@JsonProperty("modelType")
-	public void setModelType(String modelType) {
-	this.modelType = modelType;
-	}
-
-	@JsonProperty("modelInvariantId")
-	public String getModelInvariantId() {
-	return modelInvariantId;
-	}
-
-	@JsonProperty("modelInvariantId")
-	public void setModelInvariantId(String modelInvariantId) {
-	this.modelInvariantId = modelInvariantId;
-	}
-
-	@JsonProperty("modelVersionId")
-	public String getModelVersionId() {
-	return modelVersionId;
-	}
-
-	@JsonProperty("modelVersionId")
-	public void setModelVersionId(String modelVersionId) {
-	this.modelVersionId = modelVersionId;
-	}
-
-	@JsonProperty("modelName")
-	public String getModelName() {
-	return modelName;
-	}
-
-	@JsonProperty("modelName")
-	public void setModelName(String modelName) {
-	this.modelName = modelName;
-	}
-
-	@JsonProperty("modelVersion")
-	public String getModelVersion() {
-	return modelVersion;
-	}
-
-	@JsonProperty("modelVersion")
-	public void setModelVersion(String modelVersion) {
-	this.modelVersion = modelVersion;
-	}
-
-	@JsonProperty("modelCustomizationName")
-	public String getModelCustomizationName() {
-	return modelCustomizationName;
-	}
-
-	@JsonProperty("modelCustomizationName")
-	public void setModelCustomizationName(String modelCustomizationName) {
-	this.modelCustomizationName = modelCustomizationName;
-	}
-
-	@JsonProperty("modelCustomizationId")
-	public String getModelCustomizationId() {
-	return modelCustomizationId;
-	}
-
-	@JsonProperty("modelCustomizationId")
-	public void setModelCustomizationId(String modelCustomizationId) {
-	this.modelCustomizationId = modelCustomizationId;
-	}
-
-	@JsonAnyGetter
-	public Map<String, Object> getAdditionalProperties() {
-	return this.additionalProperties;
-	}
-
-	@JsonAnySetter
-	public void setAdditionalProperty(String name, Object value) {
-	this.additionalProperties.put(name, value);
-	}
-
-
-
-
-}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/changeManagement/ModelInfoOfRelatedInstance.java b/vid-app-common/src/main/java/org/openecomp/vid/changeManagement/ModelInfoOfRelatedInstance.java
deleted file mode 100644
index c60ed2f..0000000
--- a/vid-app-common/src/main/java/org/openecomp/vid/changeManagement/ModelInfoOfRelatedInstance.java
+++ /dev/null
@@ -1,122 +0,0 @@
-package org.openecomp.vid.changeManagement;
-
-import java.util.HashMap;
-import java.util.Map;
-import com.fasterxml.jackson.annotation.JsonAnyGetter;
-import com.fasterxml.jackson.annotation.JsonAnySetter;
-import com.fasterxml.jackson.annotation.JsonIgnore;
-import com.fasterxml.jackson.annotation.JsonInclude;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import com.fasterxml.jackson.annotation.JsonPropertyOrder;
-
-@JsonInclude(JsonInclude.Include.NON_NULL)
-@JsonPropertyOrder({
-"modelType",
-"modelInvariantId",
-"modelVersionId",
-"modelName",
-"modelVersion",
-"modelCustomizationName",
-"modelCustomizationId"
-})
-
-public class ModelInfoOfRelatedInstance {
-	
-	@JsonProperty("modelType")
-	private String modelType;
-	@JsonProperty("modelInvariantId")
-	private String modelInvariantId;
-	@JsonProperty("modelVersionId")
-	private String modelVersionId;
-	@JsonProperty("modelName")
-	private String modelName;
-	@JsonProperty("modelVersion")
-	private String modelVersion;
-	@JsonProperty("modelCustomizationName")
-	private String modelCustomizationName;
-	@JsonProperty("modelCustomizationId")
-	private String modelCustomizationId;
-	@JsonIgnore
-	private Map<String, Object> additionalProperties = new HashMap<String, Object>();
-
-	@JsonProperty("modelType")
-	public String getModelType() {
-	return modelType;
-	}
-
-	@JsonProperty("modelType")
-	public void setModelType(String modelType) {
-	this.modelType = modelType;
-	}
-
-	@JsonProperty("modelInvariantId")
-	public String getModelInvariantId() {
-	return modelInvariantId;
-	}
-
-	@JsonProperty("modelInvariantId")
-	public void setModelInvariantId(String modelInvariantId) {
-	this.modelInvariantId = modelInvariantId;
-	}
-
-	@JsonProperty("modelVersionId")
-	public String getModelVersionId() {
-	return modelVersionId;
-	}
-
-	@JsonProperty("modelVersionId")
-	public void setModelVersionId(String modelVersionId) {
-	this.modelVersionId = modelVersionId;
-	}
-
-	@JsonProperty("modelName")
-	public String getModelName() {
-	return modelName;
-	}
-
-	@JsonProperty("modelName")
-	public void setModelName(String modelName) {
-	this.modelName = modelName;
-	}
-
-	@JsonProperty("modelVersion")
-	public String getModelVersion() {
-	return modelVersion;
-	}
-
-	@JsonProperty("modelVersion")
-	public void setModelVersion(String modelVersion) {
-	this.modelVersion = modelVersion;
-	}
-
-	@JsonProperty("modelCustomizationName")
-	public String getModelCustomizationName() {
-	return modelCustomizationName;
-	}
-
-	@JsonProperty("modelCustomizationName")
-	public void setModelCustomizationName(String modelCustomizationName) {
-	this.modelCustomizationName = modelCustomizationName;
-	}
-
-	@JsonProperty("modelCustomizationId")
-	public String getModelCustomizationId() {
-	return modelCustomizationId;
-	}
-
-	@JsonProperty("modelCustomizationId")
-	public void setModelCustomizationId(String modelCustomizationId) {
-	this.modelCustomizationId = modelCustomizationId;
-	}
-
-	@JsonAnyGetter
-	public Map<String, Object> getAdditionalProperties() {
-	return this.additionalProperties;
-	}
-
-	@JsonAnySetter
-	public void setAdditionalProperty(String name, Object value) {
-	this.additionalProperties.put(name, value);
-	}
-
-}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/changeManagement/MsoRequestDetails.java b/vid-app-common/src/main/java/org/openecomp/vid/changeManagement/MsoRequestDetails.java
deleted file mode 100644
index 9e442f2..0000000
--- a/vid-app-common/src/main/java/org/openecomp/vid/changeManagement/MsoRequestDetails.java
+++ /dev/null
@@ -1,31 +0,0 @@
-package org.openecomp.vid.changeManagement;
-
-
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * Created by Oren on 9/5/17.
- */
-public class MsoRequestDetails {
-
-    public ModelInfo modelInfo;
-
-    public LeanCloudConfiguration cloudConfiguration;
-
-    public UpdateRequestInfo requestInfo;
-
-    public List<RelatedInstanceList> relatedInstanceList;
-
-    public RequestParameters requestParameters;
-
-    public MsoRequestDetails(RequestDetails r) {
-        this.modelInfo = new ModelInfo(r.getModelInfo());
-        this.cloudConfiguration = new LeanCloudConfiguration(r.getCloudConfiguration());
-        this.requestInfo = new UpdateRequestInfo(r.getRequestInfo());
-        this.relatedInstanceList = new ArrayList<>();
-        relatedInstanceList = r.getRelatedInstList();
-
-
-    }
-}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/changeManagement/RelatedInstance.java b/vid-app-common/src/main/java/org/openecomp/vid/changeManagement/RelatedInstance.java
deleted file mode 100644
index 49368c2..0000000
--- a/vid-app-common/src/main/java/org/openecomp/vid/changeManagement/RelatedInstance.java
+++ /dev/null
@@ -1,29 +0,0 @@
-package org.openecomp.vid.changeManagement;
-
-import com.fasterxml.jackson.annotation.*;
-
-@JsonInclude(JsonInclude.Include.NON_NULL)
-@JsonPropertyOrder({
-        "instanceId",
-        "modelInfo"
-})
-public class RelatedInstance {
-
-    @JsonProperty("instanceId")
-    public String instanceId;
-
-
-    @JsonProperty("modelInfo")
-    public ModelInfo modelInfo;
-
-    @JsonGetter
-    public String getInstanceId() {
-        return instanceId;
-    }
-
-    @JsonSetter
-    public void setInstanceId(String instanceId) {
-        this.instanceId = instanceId;
-    }
-
-}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/changeManagement/RelatedInstanceList.java b/vid-app-common/src/main/java/org/openecomp/vid/changeManagement/RelatedInstanceList.java
deleted file mode 100644
index 21a41c3..0000000
--- a/vid-app-common/src/main/java/org/openecomp/vid/changeManagement/RelatedInstanceList.java
+++ /dev/null
@@ -1,23 +0,0 @@
-package org.openecomp.vid.changeManagement;
-
-import com.fasterxml.jackson.annotation.*;
-
-@JsonInclude(JsonInclude.Include.NON_NULL)
-@JsonPropertyOrder({
-        "relatedInstance"
-})
-public class RelatedInstanceList {
-
-    @JsonProperty("relatedInstance")
-    public RelatedInstance relatedInstance;
-
-    @JsonSetter
-    public RelatedInstance getRelatedInstance() {
-        return relatedInstance;
-    }
-
-    @JsonSetter
-    public void setRelatedInstance(RelatedInstance relatedInstance) {
-        this.relatedInstance = relatedInstance;
-    }
-}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/changeManagement/RequestDetails.java b/vid-app-common/src/main/java/org/openecomp/vid/changeManagement/RequestDetails.java
deleted file mode 100644
index 94e4c44..0000000
--- a/vid-app-common/src/main/java/org/openecomp/vid/changeManagement/RequestDetails.java
+++ /dev/null
@@ -1,56 +0,0 @@
-package org.openecomp.vid.changeManagement;
-
-import com.fasterxml.jackson.annotation.*;
-
-import java.util.List;
-
-@JsonInclude(JsonInclude.Include.NON_NULL)
-@JsonPropertyOrder({
-"modelInfo",
-"cloudConfiguration",
-"requestInfo",
-"requestParameters",
-"vnfName",
-"vnfInstanceId"
-})
-public class RequestDetails extends org.openecomp.vid.mso.rest.RequestDetails{
-
-	@JsonProperty("vnfName")
-    private String vnfName;
-	@JsonProperty("vnfInstanceId")
-    private String vnfInstanceId;
-
-	/** The related model list. */
-	@JsonProperty("relatedInstanceList")
-	public List<RelatedInstanceList> relatedInstList;
-
-	@JsonProperty("vnfName")
-	public String getVnfName() {
-		return vnfName;
-	}
-
-	@JsonProperty("vnfName")
-	public void setVnfName(String vnfName) {
-		this.vnfName = vnfName;
-	}
-	@JsonProperty("vnfInstanceId")
-	public String getVnfInstanceId() {
-		return vnfInstanceId;
-	}
-
-	@JsonProperty("vnfInstanceId")
-	public void setVnfInstanceId(String vnfInstanceId) {
-		this.vnfInstanceId = vnfInstanceId;
-	}
-
-	@JsonGetter
-	public List<RelatedInstanceList> getRelatedInstList() {
-		return relatedInstList;
-	}
-
-	@JsonSetter
-	public void setRelatedInstList(List<RelatedInstanceList> relatedInstList) {
-		this.relatedInstList = relatedInstList;
-	}
-
-}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/changeManagement/RequestDetailsWrapper.java b/vid-app-common/src/main/java/org/openecomp/vid/changeManagement/RequestDetailsWrapper.java
deleted file mode 100644
index 2f49aff..0000000
--- a/vid-app-common/src/main/java/org/openecomp/vid/changeManagement/RequestDetailsWrapper.java
+++ /dev/null
@@ -1,9 +0,0 @@
-package org.openecomp.vid.changeManagement;
-
-/**
- * Created by Oren on 9/5/17.
- */
-public class RequestDetailsWrapper {
-
-    public MsoRequestDetails requestDetails;
-}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/changeManagement/RequestInfo.java b/vid-app-common/src/main/java/org/openecomp/vid/changeManagement/RequestInfo.java
deleted file mode 100644
index a7236c4..0000000
--- a/vid-app-common/src/main/java/org/openecomp/vid/changeManagement/RequestInfo.java
+++ /dev/null
@@ -1,69 +0,0 @@
-package org.openecomp.vid.changeManagement;
-
-import java.util.HashMap;
-import java.util.Map;
-import com.fasterxml.jackson.annotation.JsonAnyGetter;
-import com.fasterxml.jackson.annotation.JsonAnySetter;
-import com.fasterxml.jackson.annotation.JsonIgnore;
-import com.fasterxml.jackson.annotation.JsonInclude;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import com.fasterxml.jackson.annotation.JsonPropertyOrder;
-
-@JsonInclude(JsonInclude.Include.NON_NULL)
-@JsonPropertyOrder({
-"source",
-"suppressRollback",
-"requestorId"
-})
-public class RequestInfo {
-	@JsonProperty("source")
-	private String source;
-	@JsonProperty("suppressRollback")
-	private Boolean suppressRollback;
-	@JsonProperty("requestorId")
-	private String requestorId;
-	@JsonIgnore
-	private Map<String, Object> additionalProperties = new HashMap<String, Object>();
-
-	@JsonProperty("source")
-	public String getSource() {
-	return source;
-	}
-
-	@JsonProperty("source")
-	public void setSource(String source) {
-	this.source = source;
-	}
-
-	@JsonProperty("suppressRollback")
-	public Boolean getSuppressRollback() {
-	return suppressRollback;
-	}
-
-	@JsonProperty("suppressRollback")
-	public void setSuppressRollback(Boolean suppressRollback) {
-	this.suppressRollback = suppressRollback;
-	}
-
-	@JsonProperty("requestorId")
-	public String getRequestorId() {
-	return requestorId;
-	}
-
-	@JsonProperty("requestorId")
-	public void setRequestorId(String requestorId) {
-	this.requestorId = requestorId;
-	}
-
-	@JsonAnyGetter
-	public Map<String, Object> getAdditionalProperties() {
-	return this.additionalProperties;
-	}
-
-	@JsonAnySetter
-	public void setAdditionalProperty(String name, Object value) {
-	this.additionalProperties.put(name, value);
-	}
-
-
-}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/changeManagement/RequestParameters.java b/vid-app-common/src/main/java/org/openecomp/vid/changeManagement/RequestParameters.java
deleted file mode 100644
index 37cad47..0000000
--- a/vid-app-common/src/main/java/org/openecomp/vid/changeManagement/RequestParameters.java
+++ /dev/null
@@ -1,44 +0,0 @@
-package org.openecomp.vid.changeManagement;
-
-import java.util.HashMap;
-import java.util.Map;
-import com.fasterxml.jackson.annotation.JsonAnyGetter;
-import com.fasterxml.jackson.annotation.JsonAnySetter;
-import com.fasterxml.jackson.annotation.JsonIgnore;
-import com.fasterxml.jackson.annotation.JsonInclude;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import com.fasterxml.jackson.annotation.JsonPropertyOrder;
-
-@JsonInclude(JsonInclude.Include.NON_NULL)
-@JsonPropertyOrder({
-"usePreload"
-})
-
-public class RequestParameters {
-	
-
-	@JsonProperty("usePreload")
-	private Boolean usePreload;
-	@JsonIgnore
-	private Map<String, Object> additionalProperties = new HashMap<String, Object>();
-
-	@JsonProperty("usePreload")
-	public Boolean getUsePreload() {
-	return usePreload;
-	}
-
-	@JsonProperty("usePreload")
-	public void setUsePreload(Boolean usePreload) {
-	this.usePreload = usePreload;
-	}
-
-	@JsonAnyGetter
-	public Map<String, Object> getAdditionalProperties() {
-	return this.additionalProperties;
-	}
-
-	@JsonAnySetter
-	public void setAdditionalProperty(String name, Object value) {
-	this.additionalProperties.put(name, value);
-	}
-}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/changeManagement/UpdateRequestInfo.java b/vid-app-common/src/main/java/org/openecomp/vid/changeManagement/UpdateRequestInfo.java
deleted file mode 100644
index ab81894..0000000
--- a/vid-app-common/src/main/java/org/openecomp/vid/changeManagement/UpdateRequestInfo.java
+++ /dev/null
@@ -1,26 +0,0 @@
-package org.openecomp.vid.changeManagement;
-
-import org.openecomp.vid.domain.mso.*;
-
-/**
- * Created by Oren on 9/5/17.
- */
-public class UpdateRequestInfo {
-
-    public UpdateRequestInfo() {
-    }
-
-
-    public UpdateRequestInfo(org.openecomp.vid.domain.mso.RequestInfo requestInfo) {
-        this.requestorId = requestInfo.getRequestorId();
-        this.suppressRollback = requestInfo.getSuppressRollback();
-        this.source = requestInfo.getSource();
-    }
-    public String source;
-
-    public  Boolean suppressRollback;
-
-    public String requestorId;
-
-
-}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/client/FakeHttpSession.java b/vid-app-common/src/main/java/org/openecomp/vid/client/FakeHttpSession.java
deleted file mode 100644
index 226e6c4..0000000
--- a/vid-app-common/src/main/java/org/openecomp/vid/client/FakeHttpSession.java
+++ /dev/null
@@ -1,224 +0,0 @@
-package org.openecomp.vid.client;
-
-import org.apache.commons.io.IOUtils;
-import org.json.JSONArray;
-import org.json.JSONObject;
-import org.json.JSONTokener;
-
-import javax.servlet.ServletContext;
-import javax.servlet.http.HttpSession;
-import java.io.File;
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.Collections;
-import java.util.Enumeration;
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * Created by pickjonathan on 03/07/2017.
- */
-public class FakeHttpSession implements HttpSession {
-
-    /**
-     * Setup the creation time
-     */
-    public FakeHttpSession() {
-        File file = new File("resources/roles.json");
-
-        String rolesInputStream = null;
-        try {
-            rolesInputStream = IOUtils.toString(FakeHttpSession.class.getClassLoader().getResourceAsStream("roles.json"),"UTF8");
-        } catch (IOException e) {
-            e.printStackTrace();
-        }
-        JSONTokener tokener = new JSONTokener(rolesInputStream);
-        JSONObject roles = new JSONObject(tokener);
-
-        JSONArray rolesArray = roles.getJSONArray("roles");
-
-        //set permissions to the roles from file.
-        this.setAttribute("role", rolesArray);
-
-        creationTime = System.currentTimeMillis();
-    }
-
-
-    /**
-     * Setup the creation time
-     * @param id The new session id
-     */
-    public FakeHttpSession(String id)
-    {
-        this.id = id;
-        creationTime = System.currentTimeMillis();
-    }
-
-    /* (non-Javadoc)
-     * @see javax.servlet.http.HttpSession#getCreationTime()
-     */
-    public long getCreationTime()
-    {
-        return creationTime;
-    }
-
-    /* (non-Javadoc)
-     * @see javax.servlet.http.HttpSession#getId()
-     */
-    public String getId()
-    {
-        if (id == null)
-        {
-            System.out.println("Inventing data in FakeHttpSession.getId() to remain plausible.");
-            id = "fake";
-        }
-
-        return id;
-    }
-
-    /* (non-Javadoc)
-     * @see javax.servlet.http.HttpSession#getLastAccessedTime()
-     */
-    public long getLastAccessedTime()
-    {
-        return creationTime;
-    }
-
-    /* (non-Javadoc)
-     * @see javax.servlet.http.HttpSession#getServletContext()
-     */
-    public ServletContext getServletContext()
-    {
-        return null;
-    }
-
-    /* (non-Javadoc)
-     * @see javax.servlet.http.HttpSession#setMaxInactiveInterval(int)
-     */
-    public void setMaxInactiveInterval(int maxInactiveInterval)
-    {
-        this.maxInactiveInterval = maxInactiveInterval;
-    }
-
-    /* (non-Javadoc)
-     * @see javax.servlet.http.HttpSession#getMaxInactiveInterval()
-     */
-    public int getMaxInactiveInterval()
-    {
-        return maxInactiveInterval;
-    }
-
-    /**
-     * @see javax.servlet.http.HttpSession#getSessionContext()
-     * @deprecated
-     */
-    @SuppressWarnings({"UnnecessaryFullyQualifiedName"})
-    @Deprecated
-    public javax.servlet.http.HttpSessionContext getSessionContext()
-    {
-        return null;
-    }
-
-    /* (non-Javadoc)
-     * @see javax.servlet.http.HttpSession#getAttribute(java.lang.String)
-     */
-    public Object getAttribute(String name)
-    {
-        return attributes.get(name);
-    }
-
-    /* (non-Javadoc)
-     * @see javax.servlet.http.HttpSession#getValue(java.lang.String)
-     */
-    @Deprecated
-    public Object getValue(String name)
-    {
-        return attributes.get(name);
-    }
-
-    /* (non-Javadoc)
-     * @see javax.servlet.http.HttpSession#getAttributeNames()
-     */
-    public Enumeration<String> getAttributeNames()
-    {
-        return Collections.enumeration(attributes.keySet());
-    }
-
-    /* (non-Javadoc)
-     * @see javax.servlet.http.HttpSession#getValueNames()
-     */
-    @Deprecated
-    public String[] getValueNames()
-    {
-        return attributes.keySet().toArray(new String[attributes.keySet().size()]);
-    }
-
-    /* (non-Javadoc)
-     * @see javax.servlet.http.HttpSession#setAttribute(java.lang.String, java.lang.Object)
-     */
-    public void setAttribute(String name, Object value)
-    {
-        attributes.put(name, value);
-    }
-
-    /* (non-Javadoc)
-     * @see javax.servlet.http.HttpSession#putValue(java.lang.String, java.lang.Object)
-     */
-    @Deprecated
-    public void putValue(String name, Object value)
-    {
-        attributes.put(name, value);
-    }
-
-    /* (non-Javadoc)
-     * @see javax.servlet.http.HttpSession#removeAttribute(java.lang.String)
-     */
-    public void removeAttribute(String name)
-    {
-        attributes.remove(name);
-    }
-
-    /* (non-Javadoc)
-     * @see javax.servlet.http.HttpSession#removeValue(java.lang.String)
-     */
-    @Deprecated
-    public void removeValue(String name)
-    {
-        attributes.remove(name);
-    }
-
-    /* (non-Javadoc)
-     * @see javax.servlet.http.HttpSession#invalidate()
-     */
-    public void invalidate()
-    {
-    }
-
-    /* (non-Javadoc)
-     * @see javax.servlet.http.HttpSession#isNew()
-     */
-    public boolean isNew()
-    {
-        return true;
-    }
-
-    /**
-     * The session id
-     */
-    private String id = null;
-
-    /**
-     * The list of attributes
-     */
-    private Map<String, Object> attributes = new HashMap<String, Object>();
-
-    /**
-     * When were we created
-     */
-    private long creationTime;
-
-    /**
-     * How long before we timeout?
-     */
-    private int maxInactiveInterval = 30 * 60 * 1000;
-}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/client/HttpBasicClient.java b/vid-app-common/src/main/java/org/openecomp/vid/client/HttpBasicClient.java
deleted file mode 100755
index ef2ade9..0000000
--- a/vid-app-common/src/main/java/org/openecomp/vid/client/HttpBasicClient.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * VID
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *      http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.vid.client;
-
-
-import java.text.DateFormat;
-import java.text.SimpleDateFormat;
-
-import javax.servlet.ServletContext;
-import javax.ws.rs.client.Client;
-import javax.ws.rs.client.ClientBuilder;
-
-import org.glassfish.jersey.client.ClientConfig;
-import org.glassfish.jersey.client.ClientProperties;
-import org.springframework.beans.factory.annotation.Autowired;
-
-import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
-
-/**
- *  General HTTP client.
- */
-
-public class HttpBasicClient{
-	
-	/** The servlet context. */
-	@Autowired 
-	private ServletContext servletContext;
-	
-	/** The logger. */
-	EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(HttpBasicClient.class);
-	
-	/** The Constant dateFormat. */
-	final static DateFormat dateFormat = new SimpleDateFormat("HH:mm:ss:SSSS");
-	
-	/**
-	 * Obtain a basic HTTP client .
-	 *
-	 * @return Client client object
-	 * @throws Exception the exception
-	 */
-	public static Client getClient() throws Exception {
-		
-		ClientConfig config = new ClientConfig();
-		config.property(ClientProperties.SUPPRESS_HTTP_COMPLIANCE_VALIDATION, true);
-		
-		return ClientBuilder.newClient(config)
-				.register(org.openecomp.aai.util.CustomJacksonJaxBJsonProvider.class);
-	}	
-}  
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/client/HttpsBasicClient.java b/vid-app-common/src/main/java/org/openecomp/vid/client/HttpsBasicClient.java
deleted file mode 100755
index 676a7e7..0000000
--- a/vid-app-common/src/main/java/org/openecomp/vid/client/HttpsBasicClient.java
+++ /dev/null
@@ -1,143 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * VID
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *      http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.vid.client;
-
-import java.io.File;
-import java.text.DateFormat;
-import java.text.SimpleDateFormat;
-import java.util.Date;
-
-import javax.net.ssl.HostnameVerifier;
-import javax.net.ssl.HttpsURLConnection;
-import javax.net.ssl.SSLContext;
-import javax.net.ssl.SSLSession;
-import javax.ws.rs.client.Client;
-import javax.ws.rs.client.ClientBuilder;
-
-import org.eclipse.jetty.util.security.Password;
-import org.glassfish.jersey.client.ClientConfig;
-import org.glassfish.jersey.client.ClientProperties;
-import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
-import org.openecomp.portalsdk.core.util.SystemProperties;
-import org.openecomp.vid.properties.VidProperties;
-
- /**
-  *  General SSL client using the VID tomcat keystore. It doesn't use client certificates.
-  */
- 
-public class HttpsBasicClient{
-	
-	/** The logger. */
-	static EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(HttpsBasicClient.class);
-	
-	/** The Constant dateFormat. */
-	final static DateFormat dateFormat = new SimpleDateFormat("HH:mm:ss:SSSS");
-	
-	/**
-	 * Retrieve an SSL client.
-	 *
-	 * @return Client The SSL client
-	 * @throws Exception the exception
-	 */
-	public static Client getClient() throws Exception {
-		String methodName = "getClient";
-		ClientConfig config = new ClientConfig();
-		//config.getFeatures().put(JSONConfiguration.FEATURE_POJO_MAPPING, Boolean.TRUE);
-		//config.getClasses().add(org.openecomp.aai.util.CustomJacksonJaxBJsonProvider.class);
-	
-		SSLContext ctx = null;
-		
-		try {
-			
-			config.property(ClientProperties.SUPPRESS_HTTP_COMPLIANCE_VALIDATION, true);
-			
-			String truststore_path = SystemProperties.getProperty(VidProperties.VID_TRUSTSTORE_FILENAME);
-			logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + " " + methodName + " truststore_path=" + truststore_path);
-			String truststore_password = SystemProperties.getProperty(VidProperties.VID_TRUSTSTORE_PASSWD_X);
-			
-			
-			String decrypted_truststore_password = Password.deobfuscate(truststore_password);
-			//logger.debug(dateFormat.format(new Date()) + " " + methodName + " decrypted_truststore_password=" + decrypted_truststore_password);
-			
-			File tr = new File (truststore_path);
-			logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + " " + methodName + " absolute truststore path=" + tr.getAbsolutePath());
-			
-			//String keystore_path = certFilePath + AAIProperties.FILESEPARTOR + SystemProperties.getProperty(AAIProperties.AAI_KEYSTORE_FILENAME);
-			//String keystore_password = SystemProperties.getProperty(AAIProperties.AAI_KEYSTORE_PASSWD_X);
-			//String decrypted_keystore_password = EncryptedPropValue.decryptTriple(keystore_password);
-			
-		    System.setProperty("javax.net.ssl.trustStore", truststore_path);
-		    System.setProperty("javax.net.ssl.trustStorePassword", decrypted_truststore_password);
-			HttpsURLConnection.setDefaultHostnameVerifier( new HostnameVerifier(){
-			    public boolean verify(String string,SSLSession ssls) {
-			        return true;
-			    }
-			});
-	
-			//May need to make the algorithm a parameter. MSO requires TLSv1.1	or TLSv1.2
-			ctx = SSLContext.getInstance("TLSv1.2");
-			
-			/*
-			KeyManagerFactory kmf = null;
-			try {
-				kmf = KeyManagerFactory.getInstance("SunX509");
-				FileInputStream fin = new FileInputStream(keystore_path);
-				KeyStore ks = KeyStore.getInstance("PKCS12");
-				char[] pwd = decrypted_keystore_password.toCharArray();
-				ks.load(fin, pwd);
-				kmf.init(ks, pwd);
-			} catch (Exception e) {
-				System.out.println("Error setting up kmf: exiting");
-				e.printStackTrace();
-				System.exit(1);
-			}
-
-			ctx.init(kmf.getKeyManagers(), null, null);
-			*/
-			ctx.init(null, null, null);
-			//config.getProperties().put(HTTPSProperties.PROPERTY_HTTPS_PROPERTIES,
-			//							new HTTPSProperties( , ctx));
-			
-			return ClientBuilder.newBuilder()
-				.sslContext(ctx)
-				.hostnameVerifier(new HostnameVerifier() {
-					@Override
-					public boolean verify( String s, SSLSession sslSession ) {
-						return true;
-					}
-				}).withConfig(config)
-				.build()
-				.register(org.openecomp.aai.util.CustomJacksonJaxBJsonProvider.class);
-			
-		} catch (Exception e) {
-			logger.debug(EELFLoggerDelegate.debugLogger, "Error setting up config: exiting");
-			//System.out.println("Error setting up config: exiting");
-			e.printStackTrace();
-			return null;
-		}
-			
-		//Client client = ClientBuilder.newClient(config);
-		// uncomment this line to get more logging for the request/response
-		// client.addFilter(new LoggingFilter(System.out));
-		
-		//return client;
-	}
-}  
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/controller/AaiController.java b/vid-app-common/src/main/java/org/openecomp/vid/controller/AaiController.java
deleted file mode 100755
index a8bdf39..0000000
--- a/vid-app-common/src/main/java/org/openecomp/vid/controller/AaiController.java
+++ /dev/null
@@ -1,952 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * VID
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *      http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.vid.controller;
-
-import org.codehaus.jackson.JsonGenerationException;
-import org.codehaus.jackson.map.JsonMappingException;
-import org.codehaus.jackson.map.ObjectMapper;
-import org.json.simple.JSONArray;
-import org.json.simple.JSONObject;
-import org.json.simple.parser.JSONParser;
-import org.openecomp.aai.util.AAIRestInterface;
-import org.openecomp.portalsdk.core.controller.RestrictedBaseController;
-import org.openecomp.portalsdk.core.domain.User;
-import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
-import org.openecomp.portalsdk.core.util.SystemProperties;
-import org.openecomp.vid.aai.AaiResponse;
-import org.openecomp.vid.aai.SubscriberData;
-import org.openecomp.vid.aai.SubscriberFilteredResults;
-import org.openecomp.vid.aai.model.AaiGetTenatns.GetTenantsResponse;
-import org.openecomp.vid.model.VersionByInvariantIdsRequest;
-import org.openecomp.vid.roles.Role;
-import org.openecomp.vid.roles.RoleProvider;
-import org.openecomp.vid.roles.RoleValidator;
-import org.openecomp.vid.services.AaiService;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.http.HttpStatus;
-import org.springframework.http.MediaType;
-import org.springframework.http.ResponseEntity;
-import org.springframework.web.bind.annotation.*;
-import org.springframework.web.servlet.ModelAndView;
-
-import javax.servlet.ServletContext;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpSession;
-import javax.ws.rs.BadRequestException;
-import javax.ws.rs.DefaultValue;
-import javax.ws.rs.QueryParam;
-import javax.ws.rs.WebApplicationException;
-import javax.ws.rs.core.Response;
-import java.io.File;
-import java.io.IOException;
-import java.text.DateFormat;
-import java.text.SimpleDateFormat;
-import java.util.*;
-
-/**
- * Controller to handle a&ai requests.
- */
-
-@RestController
-public class AaiController extends RestrictedBaseController {
-
-    /**
-     * The Constant dateFormat.
-     */
-    final static DateFormat dateFormat = new SimpleDateFormat("HH:mm:ss:SSSS");
-    /**
-     * The from app id.
-     */
-    protected String fromAppId = "VidAaiController";
-    /**
-     * The view name.
-     */
-    String viewName;
-    /**
-     * The logger.
-     */
-    EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(AaiController.class);
-    /**
-     * The model.
-     */
-    private Map<String, Object> model = new HashMap<String, Object>();
-    /**
-     * The servlet context.
-     */
-    @Autowired
-    private ServletContext servletContext;
-    /**
-     * aai service
-     */
-    @Autowired
-    private AaiService aaiService;
-    public AaiController() {
-
-    }
-
-    public AaiController(ServletContext servletContext) {
-        this.servletContext = servletContext;
-
-    }
-
-    /**
-     * Return tenant details.
-     *
-     * @param jsonObject the json object
-     * @return String The parsing results
-     */
-    public static String parseCustomerObjectForTenants(JSONObject jsonObject) {
-
-        JSONArray tenantArray = new JSONArray();
-        boolean bconvert = false;
-
-        try {
-
-            JSONObject serviceSubsObj = (JSONObject) jsonObject.get("service-subscriptions");
-
-            if (serviceSubsObj != null) {
-                JSONArray srvcSubArray = (JSONArray) serviceSubsObj.get("service-subscription");
-
-                if (srvcSubArray != null) {
-                    Iterator i = srvcSubArray.iterator();
-
-                    while (i.hasNext()) {
-
-                        JSONObject innerObj = (JSONObject) i.next();
-
-                        if (innerObj == null)
-                            continue;
-
-                        JSONObject relationShipListsObj = (JSONObject) innerObj.get("relationship-list");
-                        if (relationShipListsObj != null) {
-                            JSONArray rShipArray = (JSONArray) relationShipListsObj.get("relationship");
-                            if (rShipArray != null) {
-                                Iterator i1 = rShipArray.iterator();
-
-                                while (i1.hasNext()) {
-
-                                    JSONObject inner1Obj = (JSONObject) i1.next();
-
-                                    if (inner1Obj == null)
-                                        continue;
-
-                                    String relatedTo = checkForNull((String) inner1Obj.get("related-to"));
-                                    if (relatedTo.equalsIgnoreCase("tenant")) {
-                                        JSONObject tenantNewObj = new JSONObject();
-
-                                        String relatedLink = checkForNull((String) inner1Obj.get("related-link"));
-                                        tenantNewObj.put("link", relatedLink);
-
-                                        JSONArray rDataArray = (JSONArray) inner1Obj.get("relationship-data");
-                                        if (rDataArray != null) {
-                                            Iterator i2 = rDataArray.iterator();
-
-                                            while (i2.hasNext()) {
-                                                JSONObject inner2Obj = (JSONObject) i2.next();
-
-                                                if (inner2Obj == null)
-                                                    continue;
-
-                                                String rShipKey = checkForNull((String) inner2Obj.get("relationship-key"));
-                                                String rShipVal = checkForNull((String) inner2Obj.get("relationship-value"));
-                                                if (rShipKey.equalsIgnoreCase("cloud-region.cloud-owner")) {
-                                                    tenantNewObj.put("cloudOwner", rShipVal);
-                                                } else if (rShipKey.equalsIgnoreCase("cloud-region.cloud-region-id")) {
-                                                    tenantNewObj.put("cloudRegionID", rShipVal);
-                                                }
-
-                                                if (rShipKey.equalsIgnoreCase("tenant.tenant-id")) {
-                                                    tenantNewObj.put("tenantID", rShipVal);
-                                                }
-                                            }
-                                        }
-
-                                        JSONArray relatedTPropArray = (JSONArray) inner1Obj.get("related-to-property");
-                                        if (relatedTPropArray != null) {
-                                            Iterator i3 = relatedTPropArray.iterator();
-
-                                            while (i3.hasNext()) {
-                                                JSONObject inner3Obj = (JSONObject) i3.next();
-
-                                                if (inner3Obj == null)
-                                                    continue;
-
-                                                String propKey = checkForNull((String) inner3Obj.get("property-key"));
-                                                String propVal = checkForNull((String) inner3Obj.get("property-value"));
-                                                if (propKey.equalsIgnoreCase("tenant.tenant-name")) {
-                                                    tenantNewObj.put("tenantName", propVal);
-                                                }
-                                            }
-                                        }
-                                        bconvert = true;
-                                        tenantArray.add(tenantNewObj);
-                                    }
-                                }
-                            }
-                        }
-                    }
-                }
-            }
-        } catch (NullPointerException ex) {
-
-
-        }
-
-        if (bconvert)
-            return tenantArray.toJSONString();
-        else
-            return "";
-
-    }
-
-
-    /**
-     * Retrieve the service subscription from the jsonObject.
-     *
-     * @param jsonObject the json object
-     * @return String
-     */
-    public static String parseServiceSubscriptionObjectForTenants(JSONObject jsonObject) {
-
-        JSONArray tenantArray = new JSONArray();
-        boolean bconvert = false;
-
-        try {
-            JSONObject relationShipListsObj = (JSONObject) jsonObject.get("relationship-list");
-            if (relationShipListsObj != null) {
-                JSONArray rShipArray = (JSONArray) relationShipListsObj.get("relationship");
-                if (rShipArray != null) {
-                    Iterator i1 = rShipArray.iterator();
-
-                    while (i1.hasNext()) {
-
-                        JSONObject inner1Obj = (JSONObject) i1.next();
-
-                        if (inner1Obj == null)
-                            continue;
-
-                        String relatedTo = checkForNull((String) inner1Obj.get("related-to"));
-                        if (relatedTo.equalsIgnoreCase("tenant")) {
-                            JSONObject tenantNewObj = new JSONObject();
-
-                            String relatedLink = checkForNull((String) inner1Obj.get("related-link"));
-                            tenantNewObj.put("link", relatedLink);
-
-                            JSONArray rDataArray = (JSONArray) inner1Obj.get("relationship-data");
-                            if (rDataArray != null) {
-                                Iterator i2 = rDataArray.iterator();
-
-                                while (i2.hasNext()) {
-                                    JSONObject inner2Obj = (JSONObject) i2.next();
-
-                                    if (inner2Obj == null)
-                                        continue;
-
-                                    String rShipKey = checkForNull((String) inner2Obj.get("relationship-key"));
-                                    String rShipVal = checkForNull((String) inner2Obj.get("relationship-value"));
-                                    if (rShipKey.equalsIgnoreCase("cloud-region.cloud-owner")) {
-                                        tenantNewObj.put("cloudOwner", rShipVal);
-                                    } else if (rShipKey.equalsIgnoreCase("cloud-region.cloud-region-id")) {
-                                        tenantNewObj.put("cloudRegionID", rShipVal);
-                                    }
-
-                                    if (rShipKey.equalsIgnoreCase("tenant.tenant-id")) {
-                                        tenantNewObj.put("tenantID", rShipVal);
-                                    }
-                                }
-                            }
-
-                            JSONArray relatedTPropArray = (JSONArray) inner1Obj.get("related-to-property");
-                            if (relatedTPropArray != null) {
-                                Iterator i3 = relatedTPropArray.iterator();
-
-                                while (i3.hasNext()) {
-                                    JSONObject inner3Obj = (JSONObject) i3.next();
-
-                                    if (inner3Obj == null)
-                                        continue;
-
-                                    String propKey = checkForNull((String) inner3Obj.get("property-key"));
-                                    String propVal = checkForNull((String) inner3Obj.get("property-value"));
-                                    if (propKey.equalsIgnoreCase("tenant.tenant-name")) {
-                                        tenantNewObj.put("tenantName", propVal);
-                                    }
-                                }
-                            }
-                            bconvert = true;
-                            tenantArray.add(tenantNewObj);
-                        }
-                    }
-
-                }
-            }
-        } catch (NullPointerException ex) {
-
-
-        }
-
-        if (bconvert)
-            return tenantArray.toJSONString();
-        else
-            return "";
-
-    }
-
-    /**
-     * Check for null.
-     *
-     * @param local the local
-     * @return the string
-     */
-    private static String checkForNull(String local) {
-        if (local != null)
-            return local;
-        else
-            return "";
-
-    }
-
-    /**
-     * Welcome method.
-     *
-     * @param request the request
-     * @return ModelAndView The view
-     */
-    @RequestMapping(value = {"/subscriberSearch"}, method = RequestMethod.GET)
-    public ModelAndView welcome(HttpServletRequest request) {
-        logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== AaiController welcome start");
-        return new ModelAndView(getViewName());
-    }
-
-    @RequestMapping(value = {"/aai_get_aic_zones"}, method = RequestMethod.GET)
-    public ResponseEntity<String> getAicZones(HttpServletRequest request) throws JsonGenerationException, JsonMappingException, IOException {
-        logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== getAicZones controller start");
-        AaiResponse response = aaiService.getAaiZones();
-        return aaiResponseToResponseEntity(response);
-    }
-    
-    @RequestMapping(value = {"/aai_get_aic_zone_for_pnf/{globalCustomerId}/{serviceType}/{serviceId}"}, method = RequestMethod.GET)
-    public ResponseEntity<String> getAicZoneForPnf(@PathVariable("globalCustomerId") String globalCustomerId ,@PathVariable("serviceType") String serviceType , @PathVariable("serviceId") String serviceId ,HttpServletRequest request) throws JsonGenerationException, JsonMappingException, IOException {
-        logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== getAicZoneForPnf controller start");
-        AaiResponse response = aaiService.getAicZoneForPnf(globalCustomerId , serviceType , serviceId);
-        return aaiResponseToResponseEntity(response);
-    }
-
-    /* (non-Javadoc)
-     * @see org.openecomp.portalsdk.core.controller.RestrictedBaseController#getViewName()
-     */
-    public String getViewName() {
-        return viewName;
-    }
-
-    /* (non-Javadoc)
-     * @see org.openecomp.portalsdk.core.controller.RestrictedBaseController#setViewName(java.lang.String)
-     */
-    public void setViewName(String viewName) {
-        this.viewName = viewName;
-    }
-
-    /**
-     * Get services from a&ai.
-     *
-     * @return ResponseEntity<String> The response entity with the logged in user uuid.
-     * @throws IOException          Signals that an I/O exception has occurred.
-     * @throws InterruptedException the interrupted exception
-     */
-    @RequestMapping(value = {"/getuserID"}, method = RequestMethod.GET)
-    public ResponseEntity<String> getUserID(HttpServletRequest request) throws IOException, InterruptedException {
-
-        String userId = "";
-        HttpSession session = request.getSession();
-        if (session != null) {
-            User user = (User) session.getAttribute(SystemProperties.getProperty(SystemProperties.USER_ATTRIBUTE_NAME));
-            if (user != null) {
-                //userId = user.getHrid();
-                userId = user.getLoginId();
-                if (userId == null)
-                    userId = user.getOrgUserId();
-            }
-        }
-
-        return new ResponseEntity<String>(userId, HttpStatus.OK);
-    }
-
-    /**
-     * Get services from a&ai.
-     *
-     * @return ResponseEntity<String> The response entity
-     * @throws IOException          Signals that an I/O exception has occurred.
-     * @throws InterruptedException the interrupted exception
-     */
-    @RequestMapping(value = "/aai_get_services", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
-    public ResponseEntity<String> doGetServices(HttpServletRequest request) throws IOException, InterruptedException {
-
-        RoleValidator roleValidator = new RoleValidator(new RoleProvider().getUserRoles(request));
-
-        AaiResponse subscriberList = aaiService.getServices(roleValidator);
-        ResponseEntity<String> responseEntity = aaiResponseToResponseEntity(subscriberList);
-
-        return responseEntity;
-    }
-
-
-    @RequestMapping(value = {"/aai_get_version_by_invariant_id"}, method = RequestMethod.POST)
-    public ResponseEntity<String> getVersionByInvariantId(HttpServletRequest request, @RequestBody VersionByInvariantIdsRequest versions) throws IOException {
-        ResponseEntity<String> responseEntity;
-        ObjectMapper objectMapper = new ObjectMapper();
-
-        Response result = aaiService.getVersionByInvariantId(versions.versions);
-
-        return new ResponseEntity<String>(result.readEntity(String.class), HttpStatus.OK);
-    }
-
-
-    private ResponseEntity<String> aaiResponseToResponseEntity(AaiResponse aaiResponseData)
-            throws IOException, JsonGenerationException, JsonMappingException {
-        ResponseEntity<String> responseEntity;
-        ObjectMapper objectMapper = new ObjectMapper();
-        if (aaiResponseData.getHttpCode() == 200) {
-            responseEntity = new ResponseEntity<String>(objectMapper.writeValueAsString(aaiResponseData.getT()), HttpStatus.OK);
-        } else {
-            responseEntity = new ResponseEntity<String>(aaiResponseData.getErrorMessage(), HttpStatus.valueOf(aaiResponseData.getHttpCode()));
-        }
-        return responseEntity;
-    }
-
-    /**
-     * Lookup single service instance in a&ai.  Get the service-subscription and customer, too, i guess?
-     *
-     * @param serviceInstanceId the service instance Id
-     * @return ResponseEntity The response entity
-     * @throws IOException          Signals that an I/O exception has occurred.
-     * @throws InterruptedException the interrupted exception
-     */
-    @RequestMapping(value = "/aai_get_service_instance/{service-instance-id}/{service-instance-type}", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
-    public ResponseEntity<String> doGetServiceInstance(@PathVariable("service-instance-id") String serviceInstanceId, @PathVariable("service-instance-type") String serviceInstanceType) throws IOException, InterruptedException {
-        File certiPath = GetCertificatesPath();
-        Response resp = null;
-
-        if (serviceInstanceType.equalsIgnoreCase("Service Instance Id")) {
-            resp = doAaiGet(certiPath.getAbsolutePath(),
-                    "search/nodes-query?search-node-type=service-instance&filter=service-instance-id:EQUALS:"
-                            + serviceInstanceId, false);
-        } else {
-            resp = doAaiGet(certiPath.getAbsolutePath(),
-                    "search/nodes-query?search-node-type=service-instance&filter=service-instance-name:EQUALS:"
-                            + serviceInstanceId, false);
-        }
-        return convertResponseToResponseEntity(resp);
-    }
-
-    /**
-     * Get services from a&ai.
-     *
-     * @param globalCustomerId      the global customer id
-     * @param serviceSubscriptionId the service subscription id
-     * @return ResponseEntity The response entity
-     * @throws IOException          Signals that an I/O exception has occurred.
-     * @throws InterruptedException the interrupted exception
-     */
-    @RequestMapping(value = "/aai_get_service_subscription/{global-customer-id}/{service-subscription-id}", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
-    public ResponseEntity<String> doGetServices(@PathVariable("global-customer-id") String globalCustomerId,
-                                                @PathVariable("service-subscription-id") String serviceSubscriptionId) throws IOException, InterruptedException {
-        File certiPath = GetCertificatesPath();
-        Response resp = doAaiGet(certiPath.getAbsolutePath(), "business/customers/customer/" + globalCustomerId
-                + "/service-subscriptions/service-subscription/" + serviceSubscriptionId + "?depth=0", false);
-        return convertResponseToResponseEntity(resp);
-    }
-
-    /**
-     * Obtain the subscriber list from a&ai.
-     *
-     * @param fullSet the full set
-     * @return ResponseEntity The response entity
-     * @throws IOException          Signals that an I/O exception has occurred.
-     * @throws InterruptedException the interrupted exception
-     */
-    @RequestMapping(value = "/aai_get_subscribers", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
-    public ResponseEntity<String> doGetSubscriberList(HttpServletRequest request, @DefaultValue("n") @QueryParam("fullSet") String fullSet) throws IOException, InterruptedException {
-        return getFullSubscriberList(request);
-    }
-
-    /**
-     * Obtain the Target Prov Status from the System.Properties file.
-     *
-     * @return ResponseEntity The response entity
-     * @throws IOException          Signals that an I/O exception has occurred.
-     * @throws InterruptedException the interrupted exception
-     */
-    @RequestMapping(value = "/get_system_prop_vnf_prov_status", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
-    public ResponseEntity<String> getTargetProvStatus() throws IOException, InterruptedException {
-        String p = SystemProperties.getProperty("aai.vnf.provstatus");
-        return new ResponseEntity<String>(p, HttpStatus.OK);
-    }
-
-    /**
-     * Obtain the full subscriber list from a&ai.
-     * <p>
-     * g @return ResponseEntity The response entity
-     *
-     * @throws IOException          Signals that an I/O exception has occurred.
-     * @throws InterruptedException the interrupted exception
-     */
-    @RequestMapping(value = "/aai_get_full_subscribers", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
-    public ResponseEntity<String> getFullSubscriberList(HttpServletRequest request) throws IOException, InterruptedException {
-        ObjectMapper objectMapper = new ObjectMapper();
-        ResponseEntity<String> responseEntity;
-        RoleValidator roleValidator = new RoleValidator(new RoleProvider().getUserRoles(request));
-        SubscriberFilteredResults subscriberList = aaiService.getFullSubscriberList(roleValidator);
-        if (subscriberList.getHttpCode() == 200) {
-            responseEntity = new ResponseEntity<String>(objectMapper.writeValueAsString(subscriberList.getSubscriberList()), HttpStatus.OK);
-        } else {
-            responseEntity = new ResponseEntity<String>(subscriberList.getErrorMessage(), HttpStatus.valueOf(subscriberList.getHttpCode()));
-        }
-
-
-        return responseEntity;
-    }
-
-
-    @RequestMapping(value = "/get_vnf_data_by_globalid_and_service_type/{globalCustomerId}/{serviceType}",
-            method = RequestMethod.GET,
-            produces = MediaType.APPLICATION_JSON_VALUE)
-    public ResponseEntity<String> getVnfDataByGlobalIdAndServiceType(HttpServletRequest request,
-                                                                     @PathVariable("globalCustomerId") String globalCustomerId,
-                                                                     @PathVariable("serviceType") String serviceType) throws IOException {
-
-        Response resp = aaiService.getVNFData(globalCustomerId, serviceType);
-        return convertResponseToResponseEntity(resp);
-    }
-
-
-    /**
-     * Refresh the subscriber list from a&ai.
-     *
-     * @return ResponseEntity The response entity
-     * @throws IOException Signals that an I/O exception has occurred.
-     */
-    @RequestMapping(value = "/aai_refresh_subscribers", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
-    public ResponseEntity<String> doRefreshSubscriberList() throws IOException {
-        Response resp = getSubscribers(false);
-        return convertResponseToResponseEntity(resp);
-    }
-
-    /**
-     * Refresh the full subscriber list from a&ai.
-     *
-     * @return ResponseEntity The response entity
-     * @throws IOException Signals that an I/O exception has occurred.
-     */
-    @RequestMapping(value = "/aai_refresh_full_subscribers", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
-    public ResponseEntity<String> doRefreshFullSubscriberList() throws IOException {
-        Response resp = getSubscribers(false);
-        return convertResponseToResponseEntity(resp);
-    }
-
-    /**
-     * Get subscriber details from a&ai.
-     *
-     * @param subscriberId the subscriber id
-     * @return ResponseEntity The response entity
-     */
-    @RequestMapping(value = "/aai_sub_details/{subscriberId}", method = RequestMethod.GET)
-    public ResponseEntity<String> GetSubscriberDetails(HttpServletRequest request, @PathVariable("subscriberId") String subscriberId) throws IOException {
-        ObjectMapper objectMapper = new ObjectMapper();
-        ResponseEntity responseEntity;
-        List<Role> roles = new RoleProvider().getUserRoles(request);
-        RoleValidator roleValidator = new RoleValidator(roles);
-        AaiResponse<SubscriberData> subscriberData = aaiService.getSubscriberData(subscriberId, roleValidator);
-        String httpMessage = subscriberData.getT() != null ?
-                objectMapper.writeValueAsString(subscriberData.getT()) :
-                subscriberData.getErrorMessage();
-
-        responseEntity = new ResponseEntity<String>(httpMessage, HttpStatus.valueOf(subscriberData.getHttpCode()));
-        return responseEntity;
-    }
-
-    /**
-     * Issue a named query to a&ai.
-     *
-     * @param namedQueryId     the named query id
-     * @param globalCustomerId the global customer id
-     * @param serviceType      the service type
-     * @param serviceInstance  the service instance
-     * @return ResponseEntity The response entity
-     */
-    @RequestMapping(value = "/aai_sub_viewedit/{namedQueryId}/{globalCustomerId}/{serviceType}/{serviceInstance}", method = RequestMethod.GET)
-    public ResponseEntity<String> viewEditGetComponentList(
-            @PathVariable("namedQueryId") String namedQueryId,
-            @PathVariable("globalCustomerId") String globalCustomerId,
-            @PathVariable("serviceType") String serviceType,
-            @PathVariable("serviceInstance") String serviceInstance) {
-
-        String componentListPayload = getComponentListPutPayload(namedQueryId, globalCustomerId, serviceType, serviceInstance);
-        File certiPath = GetCertificatesPath();
-
-        Response resp = doAaiPost(certiPath.getAbsolutePath(), "search/named-query", componentListPayload, false);
-        return convertResponseToResponseEntity(resp);
-    }
-
-
-    @RequestMapping(value = "/aai_get_vnf_data/{globalCustomerId}/{serviceType}/{serviceInstanceId}", method = RequestMethod.GET)
-    public AaiResponse<String> getVnfData(
-            @PathVariable("globalCustomerId") String globalCustomerId,
-            @PathVariable("serviceType") String serviceType,
-            @PathVariable("serviceInstanceId") String serviceInstanceId) {
-
-        return aaiService.getVNFData(globalCustomerId, serviceType, serviceInstanceId);
-
-    }
-
-
-    //	@RequestMapping(value="/aai_get_tenants/{global-customer-id}", method = RequestMethod.GET)
-    //	public ResponseEntity<String> viewEditGetComponentList(
-    //			@PathVariable("global-customer-id") String globalCustomerId) {
-    //		return new ResponseEntity<String>(getTenants(globalCustomerId), HttpStatus.OK);
-    //	}
-
-    /**
-     * Issue a named query to a&ai.
-     *
-     * @param namedQueryId     the named query id
-     * @param globalCustomerId the global customer id
-     * @param serviceType      the service type
-     * @return ResponseEntity The response entity
-     */
-    @RequestMapping(value = "/aai_get_models_by_service_type/{namedQueryId}/{globalCustomerId}/{serviceType}", method = RequestMethod.GET)
-    public ResponseEntity<String> viewEditGetComponentList(
-            @PathVariable("namedQueryId") String namedQueryId,
-            @PathVariable("globalCustomerId") String globalCustomerId,
-            @PathVariable("serviceType") String serviceType) {
-
-        String componentListPayload = getModelsByServiceTypePayload(namedQueryId, globalCustomerId, serviceType);
-        File certiPath = GetCertificatesPath();
-
-        Response resp = doAaiPost(certiPath.getAbsolutePath(), "search/named-query", componentListPayload, false);
-        return convertResponseToResponseEntity(resp);
-    }
-
-    /**
-     * Parses the for tenants.
-     *
-     * @param resp the resp
-     * @return the string
-     */
-    private String parseForTenants(String resp) {
-        String tenantList = "";
-
-        try {
-            JSONParser jsonParser = new JSONParser();
-
-            JSONObject jsonObject = (JSONObject) jsonParser.parse(resp);
-
-            return parseCustomerObjectForTenants(jsonObject);
-        } catch (Exception ex) {
-
-        }
-
-        return tenantList;
-    }
-
-    /**
-     * Parses the for tenants by service subscription.
-     *
-     * @param resp the resp
-     * @return the string
-     */
-    private String parseForTenantsByServiceSubscription(String resp) {
-        String tenantList = "";
-
-        try {
-            JSONParser jsonParser = new JSONParser();
-
-            JSONObject jsonObject = (JSONObject) jsonParser.parse(resp);
-
-            return parseServiceSubscriptionObjectForTenants(jsonObject);
-        } catch (Exception ex) {
-
-        }
-
-        return tenantList;
-    }
-
-    /**
-     * Obtain tenants for a given service type.
-     *
-     * @param globalCustomerId the global customer id
-     * @param serviceType      the service type
-     * @return ResponseEntity The response entity
-     */
-    @RequestMapping(value = "/aai_get_tenants/{global-customer-id}/{service-type}", method = RequestMethod.GET)
-    public ResponseEntity<String> viewEditGetTenantsFromServiceType(HttpServletRequest request,
-                                                                    @PathVariable("global-customer-id") String globalCustomerId, @PathVariable("service-type") String serviceType) {
-
-        ResponseEntity responseEntity;
-        try {
-            ObjectMapper objectMapper = new ObjectMapper();
-            List<Role> roles = new RoleProvider().getUserRoles(request);
-            RoleValidator roleValidator = new RoleValidator(roles);
-            AaiResponse<GetTenantsResponse[]> response = aaiService.getTenants(globalCustomerId, serviceType, roleValidator);
-            if (response.getHttpCode() == 200) {
-                responseEntity = new ResponseEntity<String>(objectMapper.writeValueAsString(response.getT()), HttpStatus.OK);
-            } else {
-                responseEntity = new ResponseEntity<String>(response.getErrorMessage(), HttpStatus.valueOf(response.getHttpCode()));
-            }
-        } catch (Exception e) {
-            responseEntity = new ResponseEntity<String>("Unable to proccess getTenants reponse", HttpStatus.INTERNAL_SERVER_ERROR);
-        }
-        return responseEntity;
-    }
-
-
-    private ResponseEntity<String> convertResponseToResponseEntity(Response resp) {
-        ResponseEntity<String> respEnt;
-        ObjectMapper objectMapper = new ObjectMapper();
-        if (resp == null) {
-            respEnt = new ResponseEntity<String>("Failed to fetch data from A&AI, check server logs for details.", HttpStatus.INTERNAL_SERVER_ERROR);
-        } else {
-            respEnt = new ResponseEntity<String>(resp.readEntity(String.class), HttpStatus.valueOf(resp.getStatus()));
-        }
-        return respEnt;
-    }
-
-    /**
-     * Gets the tenants.
-     *
-     * @param globalCustomerId the global customer id
-     * @return the tenants
-     */
-    private ResponseEntity<String> getTenants(String globalCustomerId) {
-        File certiPath = GetCertificatesPath();
-        Response resp = doAaiGet(certiPath.getAbsolutePath(), "business/customers/customer/" + globalCustomerId, false);
-
-        ResponseEntity<String> respEnt;
-        if (resp.getStatus() >= 200 && resp.getStatus() <= 299) {
-            respEnt = new ResponseEntity<String>(parseForTenants((String) resp.readEntity(String.class)), HttpStatus.OK);
-        } else {
-            respEnt = new ResponseEntity<String>((String) resp.readEntity(String.class), HttpStatus.valueOf(resp.getStatus()));
-        }
-        return respEnt;
-
-    }
-
-    /**
-     * Gets the tenants from service type.
-     *
-     * @param globalCustomerId the global customer id
-     * @param serviceType      the service type
-     * @return the tenants from service type
-     */
-    private ResponseEntity<String> getTenantsFromServiceType(String globalCustomerId, String serviceType) {
-
-
-        File certiPath = GetCertificatesPath();
-        String url = "business/customers/customer/" + globalCustomerId + "/service-subscriptions/service-subscription/" + serviceType;
-
-        Response resp = doAaiGet(certiPath.getAbsolutePath(), url, false);
-
-        ResponseEntity<String> respEnt;
-        if (resp.getStatus() >= 200 && resp.getStatus() <= 299) {
-            respEnt = new ResponseEntity<String>(parseForTenantsByServiceSubscription((String) resp.readEntity(String.class)), HttpStatus.OK);
-        } else {
-            respEnt = new ResponseEntity<String>((String) resp.readEntity(String.class), HttpStatus.valueOf(resp.getStatus()));
-        }
-        return respEnt;
-
-    }
-
-    /**
-     * Gets the services.
-     *
-     * @return the services
-     */
-    private Response getServices() {
-        File certiPath = GetCertificatesPath();
-        Response resp = doAaiGet(certiPath.getAbsolutePath(), "service-design-and-creation/services", false);
-        logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + "getServices() resp=" + resp.getStatusInfo());
-
-        //model.put("aai_get_services", resp);
-        return resp;
-    }
-
-    /**
-     * Gets the subscribers.
-     *
-     * @param isFullSet the is full set
-     * @return the subscribers
-     */
-    private Response getSubscribers(boolean isFullSet) {
-
-        File certiPath = GetCertificatesPath();
-        String depth = "0";
-
-        Response resp = doAaiGet(certiPath.getAbsolutePath(), "business/customers?subscriber-type=INFRA&depth=" + depth, false);
-        if (resp != null) {
-            logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + "getSubscribers() resp=" + resp.getStatusInfo().toString());
-        }
-        return resp;
-    }
-
-    /**
-     * Gets the subscriber details.
-     *
-     * @param subscriberId the subscriber id
-     * @return the subscriber details
-     */
-    private Response getSubscriberDetails(String subscriberId) {
-        File certiPath = GetCertificatesPath();
-        Response resp = doAaiGet(certiPath.getAbsolutePath(), "business/customers/customer/" + subscriberId + "?depth=2", false);
-        //String resp = doAaiGet(certiPath.getAbsolutePath(), "business/customers/customer/" + subscriberId, false);
-        logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + "getSubscriberDetails() resp=" + resp.getStatusInfo().toString());
-        return resp;
-    }
-
-    /**
-     * Gets the certificates path.
-     *
-     * @return the file
-     */
-    private File GetCertificatesPath() {
-        if (servletContext != null)
-            return new File(servletContext.getRealPath("/WEB-INF/cert/"));
-        return null;
-    }
-
-    /**
-     * Send a GET request to a&ai.
-     *
-     * @param certiPath the certi path
-     * @param uri       the uri
-     * @param xml       the xml
-     * @return String The response
-     */
-    protected Response doAaiGet(String certiPath, String uri, boolean xml) {
-        String methodName = "getSubscriberList";
-        String transId = UUID.randomUUID().toString();
-        logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
-
-        Response resp = null;
-        try {
-
-            AAIRestInterface restContrller = new AAIRestInterface(certiPath);
-            resp = restContrller.RestGet(fromAppId, transId, uri, xml);
-
-        } catch (WebApplicationException e) {
-            final String message = ((BadRequestException) e).getResponse().readEntity(String.class);
-            logger.info(EELFLoggerDelegate.errorLogger, dateFormat.format(new Date()) + "<== " + "." + methodName + message);
-            logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + "." + methodName + message);
-        } catch (Exception e) {
-            logger.info(EELFLoggerDelegate.errorLogger, dateFormat.format(new Date()) + "<== " + "." + methodName + e.toString());
-            logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + "." + methodName + e.toString());
-        }
-
-        return resp;
-    }
-
-    /**
-     * Send a POST request to a&ai.
-     *
-     * @param certiPath the certi path
-     * @param uri       the uri
-     * @param payload   the payload
-     * @param xml       the xml
-     * @return String The response
-     */
-    protected Response doAaiPost(String certiPath, String uri, String payload, boolean xml) {
-        String methodName = "getSubscriberList";
-        String transId = UUID.randomUUID().toString();
-        logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
-
-        Response resp = null;
-        try {
-
-            AAIRestInterface restContrller = new AAIRestInterface(certiPath);
-            resp = restContrller.RestPost(fromAppId, transId, uri, payload, xml);
-
-        } catch (Exception e) {
-            logger.info(EELFLoggerDelegate.errorLogger, dateFormat.format(new Date()) + "<== " + "." + methodName + e.toString());
-            logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + "." + methodName + e.toString());
-        }
-
-        return resp;
-    }
-
-    /**
-     * Gets the component list put payload.
-     *
-     * @param namedQueryId     the named query id
-     * @param globalCustomerId the global customer id
-     * @param serviceType      the service type
-     * @param serviceInstance  the service instance
-     * @return the component list put payload
-     */
-    private String getComponentListPutPayload(String namedQueryId, String globalCustomerId, String serviceType, String serviceInstance) {
-        return
-                "		{" +
-                        "    \"instance-filters\": {" +
-                        "        \"instance-filter\": [" +
-                        "            {" +
-                        "                \"customer\": {" +
-                        "                    \"global-customer-id\": \"" + globalCustomerId + "\"" +
-                        "                }," +
-                        "                \"service-instance\": {" +
-                        "                    \"service-instance-id\": \"" + serviceInstance + "\"" +
-                        "                }," +
-                        "                \"service-subscription\": {" +
-                        "                    \"service-type\": \"" + serviceType + "\"" +
-                        "                }" +
-                        "            }" +
-                        "        ]" +
-                        "    }," +
-                        "    \"query-parameters\": {" +
-                        "        \"named-query\": {" +
-                        "            \"named-query-uuid\": \"" + namedQueryId + "\"" +
-                        "        }" +
-                        "    }" +
-                        "}";
-
-    }
-
-    private String getModelsByServiceTypePayload(String namedQueryId, String globalCustomerId, String serviceType) {
-        // TODO Auto-generated method stub
-        return "		{" +
-                "    \"instance-filters\": {" +
-                "        \"instance-filter\": [" +
-                "            {" +
-                "                \"customer\": {" +
-                "                    \"global-customer-id\": \"" + globalCustomerId + "\"" +
-                "                }," +
-                "                \"service-subscription\": {" +
-                "                    \"service-type\": \"" + serviceType + "\"" +
-                "                }" +
-                "            }" +
-                "        ]" +
-                "    }," +
-                "    \"query-parameters\": {" +
-                "        \"named-query\": {" +
-                "            \"named-query-uuid\": \"" + namedQueryId + "\"" +
-                "        }" +
-                "    }" +
-                "}";
-
-    }
-}
-
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/controller/BrowseServiceTypesController.java b/vid-app-common/src/main/java/org/openecomp/vid/controller/BrowseServiceTypesController.java
deleted file mode 100755
index 0698cfd..0000000
--- a/vid-app-common/src/main/java/org/openecomp/vid/controller/BrowseServiceTypesController.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * VID
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *      http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.vid.controller;
-
-
-
-import java.text.DateFormat;
-import java.text.SimpleDateFormat;
-
-
-import javax.servlet.ServletContext;
-import javax.servlet.http.HttpServletRequest;
-
-import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
-import org.springframework.beans.factory.annotation.Autowired;
-
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestMethod;
-import org.springframework.web.bind.annotation.RestController;
-import org.springframework.web.servlet.ModelAndView;
-import org.openecomp.portalsdk.core.controller.RestrictedBaseController;
-
-
-/**
- * The Class BrowseServiceTypesController.
- */
-@RestController
-public class BrowseServiceTypesController extends RestrictedBaseController{
-	
-	/** The view name. */
-	String viewName;
-	
-	/** The logger. */
-	EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(BrowseServiceTypesController.class);
-	
-	/** The Constant dateFormat. */
-	final static DateFormat dateFormat = new SimpleDateFormat("HH:mm:ss:SSSS");
-	
-	/** The servlet context. */
-	private @Autowired ServletContext servletContext;
-	
-	/**
-	 * Welcome.
-	 *
-	 * @param request the request
-	 * @return the model and view
-	 */
-	@RequestMapping(value = {"/browseservicetypes" }, method = RequestMethod.GET)
-	public ModelAndView welcome(HttpServletRequest request) {
-		
- 	return new ModelAndView(getViewName());		
-	}
-	
-	/* (non-Javadoc)
-	 * @see org.openecomp.portalsdk.core.controller.RestrictedBaseController#getViewName()
-	 */
-	public String getViewName() {
-		return viewName;
-	}
-	
-	/* (non-Javadoc)
-	 * @see org.openecomp.portalsdk.core.controller.RestrictedBaseController#setViewName(java.lang.String)
-	 */
-	public void setViewName(String viewName) {
-		this.viewName = viewName;
-	}
-
-
-}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/controller/ChangeManagementController.java b/vid-app-common/src/main/java/org/openecomp/vid/controller/ChangeManagementController.java
deleted file mode 100644
index 1af7154..0000000
--- a/vid-app-common/src/main/java/org/openecomp/vid/controller/ChangeManagementController.java
+++ /dev/null
@@ -1,71 +0,0 @@
-package org.openecomp.vid.controller;
-
-import org.json.simple.JSONArray;
-import org.openecomp.portalsdk.core.controller.UnRestrictedBaseController;
-import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
-import org.openecomp.vid.services.ChangeManagementService;
-import org.openecomp.vid.services.WorkflowService;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.http.HttpStatus;
-import org.springframework.http.ResponseEntity;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestMethod;
-import org.springframework.web.bind.annotation.RequestParam;
-import org.springframework.web.bind.annotation.RestController;
-
-import org.openecomp.vid.changeManagement.ChangeManagementRequest;
-import org.openecomp.vid.mso.rest.Request;
-
-import java.io.IOException;
-import java.util.Collection;
-
-import javax.servlet.http.HttpServletRequest;
-
-/**
- * Controller to handle ChangeManagement feature requests.
- */
-@RestController
-@RequestMapping("change-management")
-public class ChangeManagementController extends UnRestrictedBaseController {
-    private EELFLoggerDelegate logger;
-    private String fromAppId;
-    private final WorkflowService workflowService;
-    private final ChangeManagementService changeManagementService;
-
-    @Autowired
-    public ChangeManagementController(WorkflowService workflowService, ChangeManagementService changeManagementService) {
-        this.logger = EELFLoggerDelegate.getLogger(ChangeManagementController.class);
-        this.fromAppId = "VidChangeManagementController";
-        this.workflowService = workflowService;
-        this.changeManagementService = changeManagementService;
-    }
-
-    @RequestMapping(value = {"/workflow"}, method = RequestMethod.GET)
-    public ResponseEntity<Collection<String>> getWorkflow(@RequestParam("vnfs") Collection<String> vnfs) throws IOException, InterruptedException {
-        Collection<String> result = this.workflowService.getWorkflowsForVNFs(vnfs);
-        return new ResponseEntity<>(result, HttpStatus.OK);
-    }
-
-    @RequestMapping(value = {"/mso"}, method = RequestMethod.GET)
-    public ResponseEntity<Collection<Request>> getMSOChangeManagements() throws IOException, InterruptedException {
-        Collection<Request> result = this.changeManagementService.getMSOChangeManagements();
-        return new ResponseEntity<>(result, HttpStatus.OK);
-    }
-
-    @RequestMapping(value = "/workflow/{vnfName}", method = RequestMethod.POST)
-    public ResponseEntity<String> changeManagement(@PathVariable("vnfName") String vnfName,
-                                                   HttpServletRequest request,
-                                                   @RequestBody ChangeManagementRequest changeManagmentRequest)
-            throws Exception {
-        return this.changeManagementService.doChangeManagement(changeManagmentRequest, vnfName);
-    }
-
-
-    @RequestMapping(value = {"/scheduler"}, method = RequestMethod.GET)
-    public ResponseEntity<JSONArray> getSchedulerChangeManagements() throws IOException, InterruptedException {
-        JSONArray result = this.changeManagementService.getSchedulerChangeManagements();
-        return new ResponseEntity<>(result, HttpStatus.OK);
-    }
-}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/controller/HealthCheckController.java b/vid-app-common/src/main/java/org/openecomp/vid/controller/HealthCheckController.java
deleted file mode 100755
index abef8d6..0000000
--- a/vid-app-common/src/main/java/org/openecomp/vid/controller/HealthCheckController.java
+++ /dev/null
@@ -1,196 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * VID
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *      http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.vid.controller;
-
-import java.io.IOException;
-import java.sql.Connection;
-import java.sql.DriverManager;
-import java.sql.SQLException;
-import java.text.DateFormat;
-import java.text.SimpleDateFormat;
-import java.util.Date;
-
-import org.springframework.http.MediaType;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestMethod;
-import org.springframework.web.bind.annotation.RestController;
-
-import org.openecomp.portalsdk.core.controller.UnRestrictedBaseController;
-import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
-import org.openecomp.portalsdk.core.util.SystemProperties;
-import org.openecomp.vid.dao.FnAppDoaImpl;
-
-/**
- * Controller for user profile view. The view is restricted to authenticated
- * users. The view name resolves to page user_profile.jsp which uses Angular.
- */
-
-@RestController
-@RequestMapping("/")
-public class HealthCheckController extends UnRestrictedBaseController {
-
-
-	/** The logger. */
-		EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(HealthCheckController.class);
-		
-		/** The Constant dateFormat. */
-		final static DateFormat dateFormat = new SimpleDateFormat("HH:mm:ss:SSSS");
-		
-	   private static final String HEALTH_CHECK_PATH = "/healthCheck";
-	   
-	   /**
-		 * Model for JSON response with health-check results.
-		 */
-		public class HealthStatus {
-			// Either 200 or 500
-			public int statusCode;
-			
-			// Additional detail in case of error, empty in case of success.
-			public String message;
-			
-			public String date;
-
-			public HealthStatus(int code, String msg) {
-				this.statusCode = code;
-				this.message = msg;
-			}
-			
-			public HealthStatus(int code,String date, String msg) {
-				this.statusCode = code;
-				this.message = msg;
-				this.date=date;
-			}
-
-			public int getStatusCode() {
-				return statusCode;
-			}
-
-			public void setStatusCode(int code) {
-				this.statusCode = code;
-			}
-
-			public String getMessage() {
-				return message;
-			}
-
-			public void setMessage(String msg) {
-				this.message = msg;
-			}
-			
-			public String getDate() {
-				return date;
-			}
-
-			public void setDate(String date) {
-				this.date = date;
-			}
-
-		}
-  
-	   @SuppressWarnings("unchecked")
-		public int getProfileCount(String driver, String URL, String username, String password) {
-		   FnAppDoaImpl doa= new FnAppDoaImpl();
-		   int count= doa.getProfileCount(driver,URL,username,password);
-			return count;
-		}
-	   
-	   
-	   
-		/**
-		 * Obtain the HealthCheck Status from the System.Properties file.
-		 * Used by IDNS for redundancy
-		 * @return ResponseEntity The response entity
-		 * @throws IOException Signals that an I/O exception has occurred.
-		 * @throws InterruptedException the interrupted exception
-		 */	
-		@RequestMapping(value="/healthCheck",method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)  	
-		public HealthStatus gethealthCheckStatusforIDNS() throws IOException, InterruptedException {
-
-			String driver = SystemProperties.getProperty("db.driver");
-			String URL = SystemProperties.getProperty("db.connectionURL");
-			String username = SystemProperties.getProperty("db.userName");
-			String password = SystemProperties.getProperty("db.password");
-			
-			logger.debug(EELFLoggerDelegate.debugLogger, "driver ::" + driver);
-			logger.debug(EELFLoggerDelegate.debugLogger, "URL::" + URL);
-			logger.debug(EELFLoggerDelegate.debugLogger, "username::" + username);
-			logger.debug(EELFLoggerDelegate.debugLogger,"password::" + password);
-			
-			
-			HealthStatus healthStatus = null;   
-			try {
-				logger.debug(EELFLoggerDelegate.debugLogger, "Performing health check");
-				int count=getProfileCount(driver,URL,username,password);
-				logger.debug(EELFLoggerDelegate.debugLogger,"count:::"+count);
-				healthStatus = new HealthStatus(200, "health check succeeded");
-			} catch (Exception ex) {
-			
-				logger.error(EELFLoggerDelegate.errorLogger, "Failed to perform health check", ex);
-				healthStatus = new HealthStatus(500, "health check failed: " + ex.toString());
-			}
-			return healthStatus;
-		}
-		
-		/**
-		 * Obtain the  HealthCheck Status from the System.Properties file.
-		 *
-		 * @return ResponseEntity The response entity
-		 * @throws IOException Signals that an I/O exception has occurred.
-		 * @throws InterruptedException the interrupted exception
-		 * Project :
-		 */	
-		@RequestMapping(value="rest/healthCheck/{User-Agent}/{X-ECOMP-RequestID}",method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)  	
-		public HealthStatus getHealthCheck(
-				@PathVariable("User-Agent") String UserAgent,
-				@PathVariable("X-ECOMP-RequestID") String ECOMPRequestID) throws IOException, InterruptedException {
-
-			String driver = SystemProperties.getProperty("db.driver");
-			String URL = SystemProperties.getProperty("db.connectionURL");
-			String username = SystemProperties.getProperty("db.userName");
-			String password = SystemProperties.getProperty("db.password");
-			
-				logger.debug(EELFLoggerDelegate.debugLogger, "driver ::" + driver);
-				logger.debug(EELFLoggerDelegate.debugLogger, "URL::" + URL);
-				logger.debug(EELFLoggerDelegate.debugLogger, "username::" + username);
-				logger.debug(EELFLoggerDelegate.debugLogger,"password::" + password);
-				
-			
-			HealthStatus healthStatus = null;   
-			try {
-				logger.debug(EELFLoggerDelegate.debugLogger, "Performing health check");
-				logger.debug(EELFLoggerDelegate.debugLogger, "User-Agent" + UserAgent);
-				logger.debug(EELFLoggerDelegate.debugLogger, "X-ECOMP-RequestID" + ECOMPRequestID);
-
-				
-				int count=getProfileCount(driver,URL,username,password);
-				
-				logger.debug(EELFLoggerDelegate.debugLogger,"count:::"+count);
-				healthStatus = new HealthStatus(200,dateFormat.format(new Date()) ,"health check succeeded");
-			} catch (Exception ex) {
-			
-				logger.error(EELFLoggerDelegate.errorLogger, "Failed to perform health check", ex);
-				healthStatus = new HealthStatus(500,dateFormat.format(new Date()),"health check failed: " + ex.toString());
-			}
-			return healthStatus;
-		}
-}
-
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/controller/MsoConfig.java b/vid-app-common/src/main/java/org/openecomp/vid/controller/MsoConfig.java
deleted file mode 100644
index e0b5920..0000000
--- a/vid-app-common/src/main/java/org/openecomp/vid/controller/MsoConfig.java
+++ /dev/null
@@ -1,29 +0,0 @@
-package org.openecomp.vid.controller;
-
-import com.fasterxml.jackson.databind.ObjectMapper;
-import org.openecomp.vid.factories.MsoRequestFactory;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
-
-
-@Configuration
-public class MsoConfig {
-
-    /**
-     * Gets the object mapper.
-     *
-     * @return the object mapper
-     */
-    @Bean
-    public ObjectMapper getObjectMapper() {
-        return new ObjectMapper();
-    }
-
-    @Bean
-    public MsoRequestFactory createRequestDetailsFactory(){
-        return new MsoRequestFactory();
-    }
-
-
-
-}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/controller/MsoController.java b/vid-app-common/src/main/java/org/openecomp/vid/controller/MsoController.java
deleted file mode 100755
index 451b19d..0000000
--- a/vid-app-common/src/main/java/org/openecomp/vid/controller/MsoController.java
+++ /dev/null
@@ -1,770 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * VID
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *      http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.vid.controller;
-
-
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.InputStreamReader;
-import java.io.OutputStream;
-import java.io.PrintWriter;
-import java.io.StringWriter;
-import java.text.DateFormat;
-import java.text.SimpleDateFormat;
-import java.util.ArrayList;
-//import java.util.UUID;
-import java.util.Date;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Scanner;
-import java.util.stream.Collectors;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.codehaus.jackson.JsonEncoding;
-import org.codehaus.jackson.JsonFactory;
-import org.codehaus.jackson.JsonGenerator;
-import org.codehaus.jackson.JsonParser;
-import org.codehaus.jackson.JsonToken;
-import org.glassfish.jersey.client.ClientResponse;
-import org.json.simple.JSONArray;
-import org.json.simple.JSONObject;
-import org.json.simple.parser.JSONParser;
-import org.openecomp.vid.model.ExceptionResponse;
-import org.openecomp.vid.mso.*;
-import org.openecomp.vid.mso.rest.*;
-import org.springframework.http.HttpStatus;
-//import org.springframework.http.ResponseEntity;
-//import org.springframework.http.RequestEntity;
-import org.springframework.http.ResponseEntity;
-import org.springframework.web.bind.annotation.ExceptionHandler;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestMethod;
-import org.springframework.web.bind.annotation.RestController;
-import org.springframework.web.servlet.ModelAndView;
-
-import org.openecomp.portalsdk.core.controller.RestrictedBaseController;
-import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
-import org.openecomp.portalsdk.core.util.SystemProperties;
-import com.fasterxml.jackson.databind.ObjectMapper;
-import com.fasterxml.jackson.databind.ObjectReader;
-import com.fasterxml.jackson.databind.DeserializationFeature;
-
-/**
- * The Class MsoController.
- */
-@RestController
-@RequestMapping("mso")
-public class MsoController extends RestrictedBaseController {
-
-    /**
-     * The view name.
-     */
-    String viewName;
-
-    /**
-     * The logger.
-     */
-    EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(MsoController.class);
-
-    /**
-     * The Constant dateFormat.
-     */
-    final static DateFormat dateFormat = new SimpleDateFormat("HH:mm:ss:SSSS");
-
-    /**
-     * The Constant SVC_INSTANCE_ID.
-     */
-    public final static String SVC_INSTANCE_ID = "<service_instance_id>";
-    public final static String REQUEST_TYPE = "<request_type>";
-
-    /**
-     * The Constant VNF_INSTANCE_ID.
-     */
-    public final static String VNF_INSTANCE_ID = "<vnf_instance_id>";
-
-    /**
-     * Welcome.
-     *
-     * @param request the request
-     * @return the model and view
-
-    public ModelAndView welcome(HttpServletRequest request) {
-    logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== MsoController welcome start");
-    logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + " MSO_SERVER_URL=" +
-    SystemProperties.getProperty(MsoProperties.MSO_SERVER_URL) );
-    return new ModelAndView(getViewName());
-    }
-     */
-
-	/* (non-Javadoc)
-     * @see org.openecomp.portalsdk.core.controller.RestrictedBaseController#getViewName()
-	 
-	public String getViewName() {
-		return viewName;
-	}
-	*/
-
-	/* (non-Javadoc)
-     * @see org.openecomp.portalsdk.core.controller.RestrictedBaseController#setViewName(java.lang.String)
-	 
-	public void setViewName(String viewName) {
-		this.viewName = viewName;
-	}
-	*/
-
-    /**
-     * Creates the svc instance.
-     *
-     * @param request the request
-     * @return the response entity
-     * @throws Exception the exception
-     */
-    @RequestMapping(value = "/mso_create_svc_instance", method = RequestMethod.POST)
-    public ResponseEntity<String> createSvcInstance(HttpServletRequest request, @RequestBody RequestDetails mso_request) throws Exception {
-        String methodName = "createSvcInstance";
-
-        logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
-
-        MsoBusinessLogic mbl = new MsoBusinessLogic();
-        // always return OK, the MSO status code is embedded in the body
-
-        MsoResponseWrapper w = mbl.createSvcInstance(mso_request);
-
-        return (new ResponseEntity<String>(w.getResponse(), HttpStatus.OK));
-
-    }
-
-
-    /**
-     * Creates the svc instance.
-     *
-     * @param request the request
-     * @return the response entity
-     * @throws Exception the exception
-     */
-
-    public ResponseEntity<String> createSvcInstanceNewRest(HttpServletRequest request, @RequestBody RequestDetails mso_request) throws Exception {
-        String methodName = "createSvcInstance";
-
-        logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
-
-        MsoBusinessLogicNew mbln = new MsoBusinessLogicNew();
-
-        // always return OK, the MSO status code is embedded in the body
-
-        MsoResponseWrapper w = mbln.createSvcInstanceRest(mso_request);
-
-        if (w == null) {
-            return null;
-        }
-        return (new ResponseEntity<String>(w.getResponse(), HttpStatus.OK));
-
-    }
-
-    /**
-     * Creates the svc instance.
-     *
-     * @param request the request
-     * @return the response entity
-     * @throws Exception the exception
-     */
-
-    public ResponseEntity<String> createSvcInstanceNew(HttpServletRequest request, @RequestBody RequestDetails mso_request) throws Exception {
-        String methodName = "createSvcInstance";
-
-        logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
-
-        MsoBusinessLogicNew mbln = new MsoBusinessLogicNew();
-        // always return OK, the MSO status code is embedded in the body
-
-        MsoResponseWrapper w = mbln.createSvcInstance(mso_request);
-
-        if (w == null) {
-            return null;
-        }
-
-        return (new ResponseEntity<String>(w.getResponse(), HttpStatus.OK));
-
-    }
-
-    /**
-     * Creates the vnf.
-     *
-     * @param serviceInstanceId the service instance id
-     * @param request           the request
-     * @return the response entity
-     * @throws Exception the exception
-     */
-    @RequestMapping(value = "/mso_create_vnf_instance/{serviceInstanceId}", method = RequestMethod.POST)
-    public ResponseEntity<String> createVnf(@PathVariable("serviceInstanceId") String serviceInstanceId, HttpServletRequest request, @RequestBody RequestDetails mso_request) throws Exception {
-
-        MsoBusinessLogic mbl = new MsoBusinessLogic();
-
-        MsoResponseWrapper w = mbl.createVnf(mso_request, serviceInstanceId);
-
-        // always return OK, the MSO status code is embedded in the body
-
-        return (new ResponseEntity<String>(w.getResponse(), HttpStatus.OK));
-
-    }
-
-    /**
-     * Creates the nw instance.
-     *
-     * @param serviceInstanceId the service instance id
-     * @param request           the request
-     * @return the response entity
-     * @throws Exception the exception
-     */
-    @RequestMapping(value = "/mso_create_nw_instance/{serviceInstanceId}", method = RequestMethod.POST)
-    public ResponseEntity<String> createNwInstance(@PathVariable("serviceInstanceId") String serviceInstanceId, HttpServletRequest request, @RequestBody RequestDetails mso_request) throws Exception {
-        String methodName = "createNwInstance";
-        logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start, serviceInstanceId = " + serviceInstanceId);
-
-        MsoBusinessLogic mbl = new MsoBusinessLogic();
-
-        MsoResponseWrapper w = mbl.createNwInstance(mso_request, serviceInstanceId);
-
-        return (new ResponseEntity<String>(w.getResponse(), HttpStatus.OK));
-
-    }
-
-    /**
-     * Creates the volume group instance.
-     *
-     * @param serviceInstanceId the service instance id
-     * @param vnfInstanceId     the vnf instance id
-     * @param request           the request
-     * @return the response entity
-     * @throws Exception the exception
-     */
-    @RequestMapping(value = "/mso_create_volumegroup_instance/{serviceInstanceId}/vnfs/{vnfInstanceId}", method = RequestMethod.POST)
-    public ResponseEntity<String> createVolumeGroupInstance(@PathVariable("serviceInstanceId") String serviceInstanceId, @PathVariable("vnfInstanceId") String vnfInstanceId,
-                                                            HttpServletRequest request, @RequestBody RequestDetails mso_request) throws Exception {
-        String methodName = "createVolumeGroupInstance";
-        logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
-
-        MsoBusinessLogic mbl = new MsoBusinessLogic();
-
-        MsoResponseWrapper w = mbl.createVolumeGroupInstance(mso_request, serviceInstanceId, vnfInstanceId);
-
-        // always return OK, the MSO status code is embedded in the body
-        return (new ResponseEntity<String>(w.getResponse(), HttpStatus.OK));
-    }
-
-    /**
-     * Creates the vf module instance.
-     *
-     * @param serviceInstanceId the service instance id
-     * @param vnfInstanceId     the vnf instance id
-     * @param request           the request
-     * @return the response entity
-     * @throws Exception the exception
-     */
-    @RequestMapping(value = "/mso_create_vfmodule_instance/{serviceInstanceId}/vnfs/{vnfInstanceId}", method = RequestMethod.POST)
-    public ResponseEntity<String> createVfModuleInstance(@PathVariable("serviceInstanceId") String serviceInstanceId,
-                                                         @PathVariable("vnfInstanceId") String vnfInstanceId, HttpServletRequest request, @RequestBody RequestDetails mso_request) throws Exception {
-        String methodName = "createVfModuleInstance";
-
-        logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
-
-        MsoBusinessLogic mbl = new MsoBusinessLogic();
-
-        MsoResponseWrapper w = mbl.createVfModuleInstance(mso_request, serviceInstanceId, vnfInstanceId);
-
-        // always return OK, the MSO status code is embedded in the body
-
-        return (new ResponseEntity<String>(w.getResponse(), HttpStatus.OK));
-    }
-
-	/**
-	 * Creates the instance.
-	 *
-	 * @param request the request
-	 * @param path the path
-	 * @return the mso response wrapper
-	 * @throws ClientHandlerException the client handler exception
-	 * @throws Exception the exception
-	 */
-	protected MsoResponseWrapper createInstance(RequestDetails request, String path) throws Exception {
-		String methodName = "createInstance";
-		logger.debug(dateFormat.format(new Date()) + "<== " + methodName + " start");
-
-        try {
-            MsoRestInterfaceIfc restController = new MsoRestInterface();
-            logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " calling Post, request = (" + request + ")");
-
-            RestObject<String> restObjStr = new RestObject<String>();
-            String str = new String();
-            restObjStr.set(str);
-            restController.<String>Post(str, request, "", path, restObjStr);
-            MsoResponseWrapper w = MsoUtil.wrapResponse(restObjStr);
-
-			logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " w=" + w.getResponse());
-			return w;
-		} catch (Exception e) {
-			logger.info(EELFLoggerDelegate.errorLogger, dateFormat.format(new Date()) +  "<== " + "." + methodName + e.toString());
-			logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) +  "<== " + "." + methodName + e.toString());
-			throw e;
-		}
-	}
-
-    /**
-     * Delete svc instance.
-     *
-     * @param serviceInstanceId the service instance id
-     * @param request           the request
-     * @return the response entity
-     * @throws Exception the exception
-     */
-    @RequestMapping(value = "/mso_delete_svc_instance/{serviceInstanceId}", method = RequestMethod.POST)
-    public ResponseEntity<String> deleteSvcInstance(@PathVariable("serviceInstanceId") String serviceInstanceId,
-                                                    HttpServletRequest request, @RequestBody RequestDetails mso_request) throws Exception {
-
-        String methodName = "deleteSvcInstance";
-        logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
-
-        MsoBusinessLogic mbl = new MsoBusinessLogic();
-
-        MsoResponseWrapper w = mbl.deleteSvcInstance(mso_request, serviceInstanceId);
-
-        logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " w=" + w.getResponse());
-        // always return OK, the MSO status code is embedded in the body
-
-        return (new ResponseEntity<String>(w.getResponse(), HttpStatus.OK));
-
-    }
-
-    /**
-     * Delete vnf.
-     *
-     * @param serviceInstanceId the service instance id
-     * @param vnfInstanceId     the vnf instance id
-     * @param request           the request
-     * @return the response entity
-     * @throws Exception the exception
-     */
-    @RequestMapping(value = "/mso_delete_vnf_instance/{serviceInstanceId}/vnfs/{vnfInstanceId}", method = RequestMethod.POST)
-
-    public ResponseEntity<String> deleteVnf(@PathVariable("serviceInstanceId") String serviceInstanceId, @PathVariable("vnfInstanceId") String vnfInstanceId,
-                                            HttpServletRequest request, @RequestBody RequestDetails mso_request) throws Exception {
-        String methodName = "deleteVnf";
-
-        logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
-
-        MsoBusinessLogic mlb = new MsoBusinessLogic();
-
-        MsoResponseWrapper w = mlb.deleteVnf(mso_request, serviceInstanceId, vnfInstanceId);
-
-        // always return OK, the MSO status code is embedded in the body
-        return (new ResponseEntity<String>(w.getResponse(), HttpStatus.OK));
-
-    }
-
-    /**
-     * Delete vf module.
-     *
-     * @param serviceInstanceId the service instance id
-     * @param vnfInstanceId     the vnf instance id
-     * @param vfModuleId        the vf module id
-     * @param request           the request
-     * @return the response entity
-     * @throws Exception the exception
-     */
-    //mso_delete_vf_module/bc305d54-75b4-431b-adb2-eb6b9e546014/vnfs/fe9000-0009-9999/vfmodules/abeeee-abeeee-abeeee
-    @RequestMapping(value = "/mso_delete_vfmodule_instance/{serviceInstanceId}/vnfs/{vnfInstanceId}/vfModules/{vfModuleId}", method = RequestMethod.POST)
-    public ResponseEntity<String> deleteVfModule(
-            @PathVariable("serviceInstanceId") String serviceInstanceId, @PathVariable("vnfInstanceId") String vnfInstanceId,
-            @PathVariable("vfModuleId") String vfModuleId, HttpServletRequest request, @RequestBody RequestDetails mso_request) throws Exception {
-
-        String methodName = "deleteVfModule";
-        logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
-
-        MsoBusinessLogic mbl = new MsoBusinessLogic();
-
-        MsoResponseWrapper w = mbl.deleteVfModule(mso_request, serviceInstanceId, vnfInstanceId, vfModuleId);
-
-        // always return OK, the MSO status code is embedded in the body
-        return (new ResponseEntity<String>(w.getResponse(), HttpStatus.OK));
-
-    }
-
-    /**
-     * Delete volume group instance.
-     *
-     * @param serviceInstanceId the service instance id
-     * @param vnfInstanceId     the vnf instance id
-     * @param volumeGroupId     the volume group id
-     * @param request           the request
-     * @return the response entity
-     * @throws Exception the exception
-     */
-    @RequestMapping(value = "/mso_delete_volumegroup_instance/{serviceInstanceId}/vnfs/{vnfInstanceId}/volumeGroups/{volumeGroupId}", method = RequestMethod.POST)
-    public ResponseEntity<String> deleteVolumeGroupInstance(
-            @PathVariable("serviceInstanceId") String serviceInstanceId, @PathVariable("vnfInstanceId") String vnfInstanceId, @PathVariable("volumeGroupId") String volumeGroupId,
-            HttpServletRequest request, @RequestBody RequestDetails mso_request) throws Exception {
-        String methodName = "deleteVolumeGroupInstance";
-        logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
-
-        MsoBusinessLogic mbl = new MsoBusinessLogic();
-
-        MsoResponseWrapper w = mbl.deleteVolumeGroupInstance(mso_request, serviceInstanceId, vnfInstanceId, volumeGroupId);
-
-        // always return OK, the MSO status code is embedded in the body
-        return (new ResponseEntity<String>(w.getResponse(), HttpStatus.OK));
-    }
-
-    /**
-     * Delete nw instance.
-     *
-     * @param serviceInstanceId the service instance id
-     * @param networkInstanceId the network instance id
-     * @param request           the request
-     * @return the response entity
-     * @throws Exception the exception
-     */
-    @RequestMapping(value = "/mso_delete_nw_instance/{serviceInstanceId}/networks/{networkInstanceId}", method = RequestMethod.POST)
-    public ResponseEntity<String> deleteNwInstance(@PathVariable("serviceInstanceId") String serviceInstanceId,
-                                                   @PathVariable("networkInstanceId") String networkInstanceId, HttpServletRequest request, @RequestBody RequestDetails mso_request) throws Exception {
-        String methodName = "deleteNwInstance";
-        logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
-
-        MsoBusinessLogic mbl = new MsoBusinessLogic();
-
-        MsoResponseWrapper w = mbl.deleteNwInstance(mso_request, serviceInstanceId, networkInstanceId);
-
-        // always return OK, the MSO status code is embedded in the body
-        return (new ResponseEntity<String>(w.getResponse(), HttpStatus.OK));
-
-    }
-
-    /**
-     * Gets the orchestration request.
-     *
-     * @param requestId the request id
-     * @param request   the request
-     * @return the orchestration request
-     * @throws Exception the exception
-     */
-    @RequestMapping(value = "/mso_get_orch_req/{requestId}", method = RequestMethod.GET)
-    public ResponseEntity<String> getOrchestrationRequest(@PathVariable("requestId") String requestId,
-                                                          HttpServletRequest request) throws Exception {
-
-        String methodName = "getOrchestrationRequest";
-        logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
-
-
-        MsoBusinessLogic mbl = new MsoBusinessLogic();
-
-        MsoResponseWrapper w = mbl.getOrchestrationRequest(requestId);
-
-        // always return OK, the MSO status code is embedded in the body
-        return (new ResponseEntity<String>(w.getResponse(), HttpStatus.OK));
-    }
-
-
-    /**
-     * Gets the orchestration requests.
-     *
-     * @param filterString the filter string
-     * @param request      the request
-     * @return the orchestration requests
-     * @throws Exception the exception
-     */
-    @RequestMapping(value = "/mso_get_orch_reqs/{filterString}", method = RequestMethod.GET)
-    public ResponseEntity<String> getOrchestrationRequests(@PathVariable("filterString") String filterString,
-                                                           HttpServletRequest request) throws Exception {
-
-        String methodName = "getOrchestrationRequests";
-        logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
-
-
-        MsoBusinessLogic mbl = new MsoBusinessLogic();
-
-        MsoResponseWrapper w = mbl.getOrchestrationRequests(filterString);
-
-        // always return OK, the MSO status code is embedded in the body
-        return (new ResponseEntity<String>(w.getResponse(), HttpStatus.OK));
-    }
-
-
-    /**
-     * activate to a pnf instance.
-     *
-     * @param serviceInstanceId the id of the service.
-     * @param requestDetails the body of the request.
-     * @return the response entity
-     * @throws Exception the exception
-     */
-    @RequestMapping(value = "/mso_activate_service_instance/{serviceInstanceId}", method = RequestMethod.POST)
-    public ResponseEntity<String> activateServiceInstance(@PathVariable("serviceInstanceId") String serviceInstanceId, @RequestBody RequestDetails requestDetails) throws Exception {
-        String methodName = "activateServiceInstance";
-        logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
-
-        MsoBusinessLogic mbl = new MsoBusinessLogic();
-
-        MsoResponseWrapper w = mbl.activateServiceInstance(requestDetails, serviceInstanceId);
-        return new ResponseEntity<>(w.getResponse(), HttpStatus.OK);
-    }
-
-
-    /**
-     * Gets the orchestration requests for the dashboard.
-     *  currently its all the orchestration requests with RequestType updateInstance or replaceInstance.
-     * @return the orchestration requests
-     * @throws Exception the exception
-     */
-    @RequestMapping(value = "/mso_get_orch_reqs/dashboard", method = RequestMethod.GET)
-    public List<Request> getOrchestrationRequestsForDashboard() throws Exception {
-
-        String methodName = "getOrchestrationRequestsForDashboard";
-        logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
-
-
-        MsoBusinessLogic mbl = new MsoBusinessLogic();
-
-        return mbl.getOrchestrationRequestsForDashboard();
-    }
-
-    /**
-     * Gets the Manual Tasks for the given request id.
-     *
-     * @param originalRequestId the id of the original request.
-     * @return the tasks
-     * @throws Exception the exception
-     */
-    @RequestMapping(value = "/mso_get_man_task/{originalRequestId}", method = RequestMethod.GET)
-    public List<Task> getManualTasksByRequestId(@PathVariable("originalRequestId") String originalRequestId) throws Exception {
-
-        String methodName = "getManualTasksByRequestId";
-        logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
-
-
-        MsoBusinessLogic mbl = new MsoBusinessLogic();
-
-        return  mbl.getManualTasksByRequestId(originalRequestId);
-    }
-
-
-
-    /**
-     * Complete the manual task.
-     *
-     * @param taskId the id of the task to complete.
-     * @param requestDetails the body of the request.
-     * @return the response entity
-     * @throws Exception the exception
-     */
-    @RequestMapping(value = "/mso_post_man_task/{taskId}", method = RequestMethod.POST)
-    public ResponseEntity<String> manualTaskComplete(@PathVariable("taskId") String taskId , @RequestBody RequestDetails requestDetails) throws Exception {
-
-        String methodName = "manualTaskComplete";
-        logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
-
-        MsoBusinessLogic mbl = new MsoBusinessLogic();
-
-        MsoResponseWrapper w = mbl.completeManualTask(requestDetails, taskId);
-        return new ResponseEntity<String>(w.getResponse(), HttpStatus.OK);
-    }
-
-
-
-
-
-    /**
-     * Gets the orchestration requests for svc instance.
-     *
-     * @param svc_instance_id the svc instance id
-     * @return the orchestration requests for svc instance
-     * @throws Exception the exception
-     */
-//    public MsoResponseWrapper getOrchestrationRequestsForSvcInstance(String svc_instance_id) throws Exception {
-
-//        String methodName = "getOrchestrationRequestsForSvcInstance";
-//        logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
-//        MsoResponseWrapper w = null;
-//
-//        try {
-//            MsoRestInterfaceIfc restController = MsoRestInterfaceFactory.getInstance();
-//            String p = SystemProperties.getProperty(MsoProperties.MSO_REST_API_GET_ORC_REQS);
-//            String path = p + svc_instance_id;
-//
-//            RestObject<String> restObjStr = new RestObject<String>();
-//            String str = new String();
-//            restObjStr.set(str);
-//
-//            restController.<String>Get(str, "", path, restObjStr);
-//            w = MsoUtil.wrapResponse(restObjStr);
-//            logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " w=" + w.getResponse());
-//
-//        } catch (Exception e) {
-//            logger.info(EELFLoggerDelegate.errorLogger, dateFormat.format(new Date()) + "<== " + "." + methodName + e.toString());
-//            logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + "." + methodName + e.toString());
-//            throw e;
-//        }
-//        return w;
-//    }
-
-    /**
-     * Exception handler.
-     *
-     * @param e        the e
-     * @param response the response
-     * @throws IOException Signals that an I/O exception has occurred.
-     */
-    @ExceptionHandler(Exception.class)
-    private void exceptionHandler(Exception e, HttpServletResponse response) throws IOException {
-
-		/*
-         * The following "logger.error" lines "should" be sufficient for logging the exception.
-		 * However, the console output in my Eclipse environment is NOT showing ANY of the
-		 * logger statements in this class. Thus the temporary "e.printStackTrace" statement
-		 * is also included.
-		 */
-
-        String methodName = "exceptionHandler";
-        logger.error(EELFLoggerDelegate.errorLogger, dateFormat.format(new Date()) + "<== " + "." + methodName + e.toString());
-        StringWriter sw = new StringWriter();
-        e.printStackTrace(new PrintWriter(sw));
-        logger.error(EELFLoggerDelegate.errorLogger, sw.toString());
-
-		/*
-         *  Temporary - IF the above  mentioned "logger.error" glitch is resolved ...
-		 *  this statement could be removed since it would then likely result in duplicate
-		 *  trace output. 
-		 */
-        e.printStackTrace(System.err);
-
-        response.setContentType("application/json; charset=UTF-8");
-        response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
-
-        ExceptionResponse exceptionResponse = new ExceptionResponse();
-        exceptionResponse.setException(e.getClass().toString().replaceFirst("^.*\\.", ""));
-        exceptionResponse.setMessage(e.getMessage());
-
-        response.getWriter().write(new ObjectMapper().writeValueAsString(exceptionResponse));
-
-        response.flushBuffer();
-
-    }
-
-    /**
-     * Parses the orchestration requests for svc instance.
-     *
-     * @param resp the resp
-     * @return the list
-     * @throws ParseException the parse exception
-     * @throws Exception      the exception
-     */
-    @SuppressWarnings("unchecked")
-    public List<JSONObject> parseOrchestrationRequestsForSvcInstance(ClientResponse resp) throws org.json.simple.parser.ParseException, Exception {
-
-        String methodName = "parseOrchestrationRequestsForSvcInstance";
-
-        ArrayList<JSONObject> json_list = new ArrayList<JSONObject>();
-
-        String rlist_str = resp.readEntity(String.class);
-        logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + "." + methodName + " Response string: " + rlist_str);
-
-        JSONParser parser = new JSONParser();
-        try {
-            Object obj = parser.parse(rlist_str);
-
-            JSONObject jsonObject = (JSONObject) obj;
-
-            JSONArray requestList = (JSONArray) jsonObject.get("requestList");
-
-            if (requestList != null && !(requestList.isEmpty()))
-                for (Object container : requestList) {
-
-                    JSONObject containerJsonObj = (JSONObject) container;
-                    //logger.debug(dateFormat.format(new Date()) +  "<== " + "." + methodName + " reqJsonObj: " + containerJsonObj.toJSONString());
-                    JSONObject reqJsonObj = (JSONObject) containerJsonObj.get("request");
-
-                    //logger.debug(dateFormat.format(new Date()) +  "<== " + "." + methodName + " reqJsonObj.requestId: " +
-                    //	reqJsonObj.get("requestId") );
-                    JSONObject result = new JSONObject();
-
-                    result.put("requestId", reqJsonObj.get("requestId"));
-                    if (reqJsonObj.get("requestType") != null) {
-                        result.put("requestType", (reqJsonObj.get("requestType").toString()));
-                    }
-                    JSONObject req_status = (JSONObject) reqJsonObj.get("requestStatus");
-                    if (req_status != null) {
-                        result.put("timestamp", (req_status.get("timestamp")));
-                        result.put("requestState", (req_status.get("requestState")));
-                        result.put("statusMessage", (req_status.get("statusMessage")));
-                        result.put("percentProgress", (req_status.get("percentProgress")));
-                    }
-                    json_list.add(result);
-                }
-        } catch (org.json.simple.parser.ParseException pe) {
-            logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + "." + methodName + " Parse exception: " + pe.toString());
-            throw pe;
-        } catch (Exception e) {
-            logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + "." + methodName + " Exception: " + e.toString());
-            throw e;
-        }
-        return (json_list);
-    }
-
-    /**
-     * Retrieve request object.
-     *
-     * @param request the request
-     * @return the request details
-     * @throws Exception the exception
-     */
-    public RequestDetails retrieveRequestObject(HttpServletRequest request, @RequestBody RequestDetails mso_request) throws Exception {
-
-        String methodName = "retrieveRequestObject";
-        logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
-
-        ObjectMapper mapper = new ObjectMapper();
-        //JSON from String to Object
-        //RequestDetails mso_request;
-
-        try {
-            //mso_request = new RequestDetails();
-            //mso_request = mapper.readValue(request.getInputStream(), RequestDetails.class);
-        } catch (Exception e) {
-            logger.error(EELFLoggerDelegate.errorLogger, dateFormat.format(new Date()) + "<== " + methodName + " Unable to read json object RequestDetails e=" + e.getMessage());
-            throw e;
-        }
-        if (mso_request == null) {
-            logger.error(EELFLoggerDelegate.errorLogger, dateFormat.format(new Date()) + "<== " + methodName + " mso_request is null");
-            throw new Exception("RequestDetails is missing");
-        }
-        try {
-            String json_req = mapper.writeValueAsString(mso_request);
-            logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " request=[" + json_req + "]");
-        } catch (Exception e) {
-            logger.error(EELFLoggerDelegate.errorLogger, dateFormat.format(new Date()) + "<== " + methodName + " Unable to convert RequestDetails to json string e=" + e.getMessage());
-            throw e;
-        }
-        return (mso_request);
-    }
-}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/controller/PolicyController.java b/vid-app-common/src/main/java/org/openecomp/vid/controller/PolicyController.java
deleted file mode 100644
index 83e177a..0000000
--- a/vid-app-common/src/main/java/org/openecomp/vid/controller/PolicyController.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * VID
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *      http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package  org.openecomp.vid.controller;
-
-import java.util.UUID;
-
-import javax.servlet.http.HttpServletRequest;
-
-import org.json.simple.JSONObject;
-import org.openecomp.portalsdk.core.controller.RestrictedBaseController;
-import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
-import org.openecomp.vid.policy.PolicyProperties;
-import org.openecomp.vid.policy.PolicyResponseWrapper;
-import org.openecomp.vid.policy.PolicyRestInterfaceFactory;
-import org.openecomp.vid.policy.PolicyRestInterfaceIfc;
-import org.openecomp.vid.policy.PolicyUtil;
-import org.openecomp.vid.policy.RestObject;
-import org.springframework.http.HttpStatus;
-import org.springframework.http.ResponseEntity;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestMethod;
-import org.springframework.web.bind.annotation.RestController;
-
-/**
- * Controller to handle Policy requests.
- */
-
-@RestController
-public class PolicyController extends RestrictedBaseController{	
-		
-	/** The logger. */
-	static EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(PolicyController.class);
-	
-	@RequestMapping(value="/get_policy",method = RequestMethod.POST)	
-	public ResponseEntity<String> getPolicyInfo( HttpServletRequest request, @RequestBody JSONObject policy_request) throws Exception {	
-		
-		logger.debug("#####################POLICY API CALL STARTED ###############"+ PolicyProperties.POLICY_GET_CONFIG_VAL);
-		logger.debug("#####################Policy Request ###############"+policy_request.toString());
-
-		String path = PolicyProperties.getProperty(PolicyProperties.POLICY_GET_CONFIG_VAL);
-		PolicyResponseWrapper policyResWrapper = getPolicyConfig(policy_request,path);
-		
-		logger.debug("$$$$$$$$$$$$$$$$$$$$$$ " + new ResponseEntity<String>(policyResWrapper.getResponse(), HttpStatus.OK).toString());
-		
-		return ( new ResponseEntity<String>(policyResWrapper.getResponse(), HttpStatus.valueOf(policyResWrapper.getStatus())) );		
-	}
-	
-	protected static PolicyResponseWrapper getPolicyConfig(JSONObject request, String path) throws Exception {
-		String methodName = "getPolicyConfig";
-		String uuid = UUID.randomUUID().toString();
-		logger.debug(  "starting getPolicyConfig ");
-		
-		try {
-			//STARTING REST API CALL AS AN FACTORY INSTACE
-			PolicyRestInterfaceIfc restController = PolicyRestInterfaceFactory.getInstance();	
-			
-			RestObject<String> restObjStr = new RestObject<String>();
-			String str = new String();
-			restObjStr.set(str);
-			restController.<String>Post(str, request, uuid, path, restObjStr );
-			PolicyResponseWrapper policyRespWrapper = PolicyUtil.wrapResponse (restObjStr);
-			
-			logger.debug( "<== " + methodName + " w=" + policyRespWrapper.getResponse());
-			return policyRespWrapper;
-		} catch (Exception e) {
-			logger.debug(  "EXCEPTION in getPolicyConfig <== " + "." + methodName + e.toString());
-			throw e;
-		}
-	}
-}
-
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/controller/PropertyController.java b/vid-app-common/src/main/java/org/openecomp/vid/controller/PropertyController.java
deleted file mode 100755
index 9008076..0000000
--- a/vid-app-common/src/main/java/org/openecomp/vid/controller/PropertyController.java
+++ /dev/null
@@ -1,122 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * VID
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *      http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.vid.controller;
-
-import java.text.DateFormat;
-import java.text.SimpleDateFormat;
-import java.util.Date;
-
-import javax.servlet.http.HttpServletRequest;
-
-import org.springframework.http.HttpStatus;
-import org.springframework.http.ResponseEntity;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestMethod;
-import org.springframework.web.bind.annotation.RestController;
-import org.springframework.web.servlet.ModelAndView;
-
-import org.openecomp.portalsdk.core.controller.RestrictedBaseController;
-import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
-import org.openecomp.portalsdk.core.util.SystemProperties;
-
-/**
- * The Class PropertyController.
- */
-@RestController
-public class PropertyController extends RestrictedBaseController{
-	
-	/** The view name. */
-	String viewName;
-	
-	/** The logger. */
-	EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(PropertyController.class);
-	
-	/** The Constant dateFormat. */
-	final static DateFormat dateFormat = new SimpleDateFormat("HH:mm:ss:SSSS");
-	
-	/**
-	 * Welcome.
-	 *
-	 * @param request the request
-	 * @return the model and view
-	 */
-	@RequestMapping(value = {"/propertyhome" }, method = RequestMethod.GET)
-	public ModelAndView welcome(HttpServletRequest request) {
-		logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== PropertyController welcome start");
-		return new ModelAndView(getViewName());		
-	}
-	
-	/* (non-Javadoc)
-	 * @see org.openecomp.portalsdk.core.controller.RestrictedBaseController#getViewName()
-	 */
-	public String getViewName() {
-		return viewName;
-	}
-	
-	/* (non-Javadoc)
-	 * @see org.openecomp.portalsdk.core.controller.RestrictedBaseController#setViewName(java.lang.String)
-	 */
-	public void setViewName(String _viewName) {
-		this.viewName = _viewName;
-	}
-	
-	/**
-	 * Gets the property.
-	 *
-	 * @param name the name
-	 * @param defaultvalue the defaultvalue
-	 * @param request the request
-	 * @return the property
-	 * @throws Exception the exception
-	 */
-	@RequestMapping(value = "/get_property/{name}/{defaultvalue}", method = RequestMethod.GET)
-	public ResponseEntity<String> getProperty (@PathVariable("name") String name, @PathVariable("defaultvalue") String defaultvalue,
-			HttpServletRequest request) throws Exception {
-		
-		String methodName = "getProperty";	
-		ResponseEntity<String> resp = null;
-		String pvalue = null;
-		logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
-		
-		try {
-			// convert "_" to "." in the property name
-			if (name == null || name.length() == 0 ) {
-				return ( new ResponseEntity<String> (defaultvalue, HttpStatus.OK));
-			}
-			// convert "_" to "." in the property name
-			String propertyName = name.replace('_', '.');
-			pvalue = SystemProperties.getProperty(propertyName);
-			if ( ( pvalue == null ) || ( pvalue.length() == 0 ) ) {
-				pvalue = defaultvalue;
-			}
-			resp = new ResponseEntity<String>(pvalue, HttpStatus.OK);
-		}
-		catch (Exception e) {
-			logger.info(EELFLoggerDelegate.errorLogger, dateFormat.format(new Date()) +  "<== " + "." + methodName + e.toString());
-			logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) +  "<== " + "." + methodName + e.toString());
-			throw e;
-		}
-		logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " returning " + pvalue);
-  		return ( resp );
-	}
-
-}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/controller/SchedulerController.java b/vid-app-common/src/main/java/org/openecomp/vid/controller/SchedulerController.java
deleted file mode 100644
index 0fd2079..0000000
--- a/vid-app-common/src/main/java/org/openecomp/vid/controller/SchedulerController.java
+++ /dev/null
@@ -1,244 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * VID
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *      http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.vid.controller;
-
-import java.text.DateFormat;
-import java.text.SimpleDateFormat;
-import java.util.Date;
-import java.util.UUID;
-
-import javax.servlet.http.HttpServletRequest;
-
-import org.json.simple.JSONObject;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.http.HttpStatus;
-import org.springframework.http.ResponseEntity;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestMethod;
-import org.springframework.web.bind.annotation.RestController;
-
-import org.openecomp.portalsdk.core.controller.RestrictedBaseController;
-import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
-import org.openecomp.portalsdk.core.util.SystemProperties;
-import org.openecomp.vid.scheduler.RestObjects.GetTimeSlotsRestObject;
-import org.openecomp.vid.scheduler.RestObjects.PostCreateNewVnfRestObject;
-import org.openecomp.vid.scheduler.RestObjects.PostSubmitVnfChangeRestObject;
-import org.openecomp.vid.scheduler.SchedulerProperties;
-import org.openecomp.vid.scheduler.SchedulerRestInterface;
-import org.openecomp.vid.scheduler.SchedulerResponseWrappers.GetTimeSlotsWrapper;
-import org.openecomp.vid.scheduler.SchedulerResponseWrappers.PostCreateNewVnfWrapper;
-import org.openecomp.vid.scheduler.SchedulerResponseWrappers.PostSubmitVnfChangeTimeSlotsWrapper;
-import org.openecomp.vid.scheduler.SchedulerUtil;
-
-/**
- * Controller to handle Scheduler requests.
- */
-
-@RestController
-public class SchedulerController extends RestrictedBaseController {
-	
-	static EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(SchedulerController.class);
-	
-	/** The request date format. */
-	public DateFormat requestDateFormat = new SimpleDateFormat("EEE, dd MMM YYYY HH:mm:ss z");
-
-    @Autowired
-    private SchedulerRestInterface restController;
-
-	/*
-     *
-	 *	GET SCHEDULER CONTROLLERS
-	 *
-	 */
-
-    @RequestMapping(value = "/get_time_slots/{scheduler_request}", method = RequestMethod.GET)
-    public ResponseEntity<String> getTimeSlots(HttpServletRequest request, @PathVariable("scheduler_request") String scheduler_request) throws Exception {
-    	
-    	Date startingTime = new Date();
-    	String startTimeRequest = requestDateFormat.format(startingTime);
-    	 
-        System.out.println("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n");
-        System.out.println(startTimeRequest + " | Controller Scheduler GET : /get_time_slots/{scheduler_request} \n");
-        System.out.println("Original Request : \n " + scheduler_request + '\n');
-
-        String path = SystemProperties.getProperty(SchedulerProperties.SCHEDULER_GET_TIME_SLOTS) + scheduler_request;
-
-        GetTimeSlotsWrapper schedulerResWrapper = getTimeSlots(scheduler_request, path, scheduler_request);
-        
-        Date endTime = new Date();
-    	String endTimeRequest = requestDateFormat.format(endTime);
-        System.out.println(endTimeRequest + " | Controller Scheduler - GET\n");
-
-        return (new ResponseEntity<String>(schedulerResWrapper.getResponse(), HttpStatus.OK));
-
-    }
-
-    protected GetTimeSlotsWrapper getTimeSlots(String request, String path, String uuid) throws Exception {
-
-        try {
-            //STARTING REST API CALL AS AN FACTORY INSTACE
-            System.out.println("<== Get Time Slots Request START \n");
-
-            GetTimeSlotsRestObject<String> restObjStr = new GetTimeSlotsRestObject<String>();
-            String str = new String();
-
-            restObjStr.set(str);
-
-            restController.<String>Get(str, uuid, path, restObjStr);
-            GetTimeSlotsWrapper schedulerRespWrapper = SchedulerUtil.getTimeSlotsWrapResponse(restObjStr);
-
-            System.out.println("<== Get Time Slots Request END : Response = " + schedulerRespWrapper.getResponse() + '\n');
-
-            return schedulerRespWrapper;
-
-        } catch (Exception e) {
-            System.out.println("<== Get Time Slots Request ERROR : " + e.toString() + '\n');
-            throw e;
-        }
-    }
-
-	/*
-	 *
-	 *	POST SCHEDULER CONTROLLERS
-	 *
-	 */
-
-    @SuppressWarnings("unchecked")
-    @RequestMapping(value = "/post_create_new_vnf_change", method = RequestMethod.POST)
-    public ResponseEntity<String> postCreateNewVNFChange(HttpServletRequest request, @RequestBody JSONObject scheduler_request) throws Exception {
-
-    	Date startingTime = new Date();
-    	String startTimeRequest = requestDateFormat.format(startingTime);
-
-        System.out.println("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n");
-        System.out.println(startTimeRequest + " | Controller Scheduler POST : post_create_new_vnf_change \n");
-
-        //Generating uuid
-        String uuid = UUID.randomUUID().toString();
-
-        scheduler_request.put("scheduleId", uuid);
-        System.out.println("<== UUID : " + uuid + '\n');
-
-        //adding uuid to the request payload
-        scheduler_request.put("scheduleId", uuid);
-
-        System.out.println("<== UUID : " + uuid + '\n');
-        System.out.println("Original Request : \n " + scheduler_request.toString() + '\n');
-
-        String path = SystemProperties.getProperty(SchedulerProperties.SCHEDULER_CREATE_NEW_VNF_CHANGE_INSTANCE_VAL) + uuid;
-
-        PostCreateNewVnfWrapper responseWrapper = postSchedulingRequest(scheduler_request, path, uuid);
-        
-        Date endTime = new Date();
-    	String endTimeRequest = requestDateFormat.format(endTime);
-        System.out.println(endTimeRequest + " | Controller Scheduler - POST\n");
-
-        return (new ResponseEntity<String>(responseWrapper.getResponse(), HttpStatus.OK));
-    }
-
-    protected PostCreateNewVnfWrapper postSchedulingRequest(JSONObject request, String path, String uuid) throws Exception {
-
-        try {
-            //STARTING REST API CALL AS AN FACTORY INSTACE
-            System.out.println("<== Post Create New Vnf Scheduling Request START \n");
-
-            PostCreateNewVnfRestObject<String> restObjStr = new PostCreateNewVnfRestObject<String>();
-            String str = new String();
-
-            restObjStr.set(str);
-            restController.<String>Post(str, request, path, restObjStr);
-
-            int status = restObjStr.getStatusCode();
-            if (status >= 200 && status <= 299) {
-                restObjStr.setUUID(uuid);
-            }
-
-            PostCreateNewVnfWrapper responseWrapper = SchedulerUtil.postCreateNewVnfWrapResponse(restObjStr);
-
-            System.out.println("<== Post Create New Vnf Scheduling Request END : Response = " + responseWrapper.getResponse() + '\n');
-
-            return responseWrapper;
-
-        } catch (Exception e) {
-            System.out.println("<== Post Create New Vnf Scheduling Request ERROR : " + e.toString() + '\n');
-            throw e;
-        }
-    }
-
-    @RequestMapping(value = "/submit_vnf_change_timeslots", method = RequestMethod.POST)
-    public ResponseEntity<String> postSubmitVnfChangeTimeslots(HttpServletRequest request, @RequestBody JSONObject scheduler_request) throws Exception {
-
-    	Date startingTime = new Date();
-    	String startTimeRequest = requestDateFormat.format(startingTime);
-
-        System.out.println("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n");
-        System.out.println(startTimeRequest + " | Controller Scheduler POST : submit_vnf_change_timeslots \n");
-
-        //Generating uuid
-        String uuid = (String) scheduler_request.get("scheduleId");
-        scheduler_request.remove("scheduleId");
-
-        System.out.println("<== UUID : " + uuid + '\n');
-        System.out.println("Original Request : \n " + scheduler_request.toString() + '\n');
-
-        String path = SystemProperties.getProperty(SchedulerProperties.SCHEDULER_SUBMIT_NEW_VNF_CHANGE).replace("{scheduleId}", uuid);
-
-        PostSubmitVnfChangeTimeSlotsWrapper responseWrapper = postSubmitSchedulingRequest(scheduler_request, path, uuid);
-        
-        Date endTime = new Date();
-    	String endTimeRequest = requestDateFormat.format(endTime);
-        System.out.println(endTimeRequest + " | Controller Scheduler - POST Submit\n");
-
-        return (new ResponseEntity<String>(responseWrapper.getResponse(), HttpStatus.OK));
-    }
-
-    protected PostSubmitVnfChangeTimeSlotsWrapper postSubmitSchedulingRequest(JSONObject request, String path, String uuid) throws Exception {
-
-        try {
-            //STARTING REST API CALL AS AN FACTORY INSTACE
-            System.out.println("<== Post Submit Scheduling Request START \n");
-
-            PostSubmitVnfChangeRestObject<String> restObjStr = new PostSubmitVnfChangeRestObject<String>();
-            String str = new String();
-
-            restObjStr.set(str);
-            restController.<String>Post(str, request, path, restObjStr);
-
-            int status = restObjStr.getStatusCode();
-            if (status >= 200 && status <= 299) {
-                restObjStr.setUUID(uuid);
-            }
-
-            PostSubmitVnfChangeTimeSlotsWrapper responseWrapper = SchedulerUtil.postSubmitNewVnfWrapResponse(restObjStr);
-
-            System.out.println("<== Post Submit Scheduling Request END : Response = " + responseWrapper.getResponse() + '\n');
-
-            return responseWrapper;
-
-        } catch (Exception e) {
-            System.out.println("<== Post Submit Scheduling Request ERROR : " + e.toString() + '\n');
-            throw e;
-        }
-    }
-}
-
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/controller/VidController.java b/vid-app-common/src/main/java/org/openecomp/vid/controller/VidController.java
deleted file mode 100755
index f21036e..0000000
--- a/vid-app-common/src/main/java/org/openecomp/vid/controller/VidController.java
+++ /dev/null
@@ -1,119 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * VID
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *      http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.vid.controller;
-
-import org.openecomp.portalsdk.core.controller.RestrictedBaseController;
-import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
-import org.openecomp.sdc.tosca.parser.exceptions.SdcToscaParserException;
-import org.openecomp.vid.asdc.AsdcCatalogException;
-import org.openecomp.vid.asdc.beans.SecureServices;
-import org.openecomp.vid.exceptions.VidServiceUnavailableException;
-import org.openecomp.vid.model.ServiceModel;
-import org.openecomp.vid.roles.Role;
-import org.openecomp.vid.roles.RoleProvider;
-import org.openecomp.vid.roles.RoleValidator;
-import org.openecomp.vid.services.VidService;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestMethod;
-import org.springframework.web.bind.annotation.RestController;
-import org.springframework.web.servlet.ModelAndView;
-
-import javax.servlet.http.HttpServletRequest;
-import java.util.List;
-import java.util.Map;
-
-//import org.openecomp.vid.model.Service;
-
-@RestController
-public class VidController extends RestrictedBaseController {
-	
-	private static final EELFLoggerDelegate LOG = EELFLoggerDelegate.getLogger(VidController.class);
-
-	private final VidService service;
-
-	@Autowired
-	public VidController(VidService vidService) throws SdcToscaParserException{
-
-		service = vidService;
-	}
-//	
-	/**
-	 * Gets the services.
-	 *
-	 * @param request the request
-	 * @return the services
-	 * @throws VidServiceUnavailableException the vid service unavailable exception
-	 */
-	@RequestMapping(value={"/rest/models/services"}, method = RequestMethod.GET)
-	public SecureServices getServices(HttpServletRequest request) throws VidServiceUnavailableException {
-		try {
-			LOG.info("Start API for browse ASDC was called");
-			SecureServices secureServices = new SecureServices();
-			RoleProvider roleProvider = new RoleProvider();
-			Map<String, String[]> requestParams = request.getParameterMap();
-			List<Role> roles = new RoleProvider().getUserRoles(request);
-			secureServices.setServices(service.getServices(requestParams));
-			//Disable roles until AAF integration finishes
-			//secureServices.setReadOnly(roleProvider.userPermissionIsReadOnly(roles));
-			return secureServices;
-		} catch (AsdcCatalogException e) {
-			LOG.error("Failed to retrieve service definitions from SDC", e);
-			throw new VidServiceUnavailableException("Failed to retrieve service definitions from SDC", e);
-		} catch (Throwable t) {
-			LOG.debug("Unexpected error while retrieving service definitions from SDC: " + t.getMessage() + ":", t);
-			t.printStackTrace();
-			throw new VidServiceUnavailableException("Unexpected error while retrieving service definitions from SDC: " + t.getMessage(), t);
-		}
-	}
-	
-	/**
-	 * Gets the services.
-	 *
-	 * @param uuid the uuid
-	 * @return the services
-	 * @throws VidServiceUnavailableException the vid service unavailable exception
-	 */
-	@RequestMapping(value={"/rest/models/services/{uuid}"}, method = RequestMethod.GET)
-	public ServiceModel getServices(@PathVariable("uuid") String uuid, HttpServletRequest request) throws VidServiceUnavailableException {
-		try {
-//			RoleValidator roleValidator = new RoleValidator(new RoleProvider().getUserRoles(request));
-			return service.getService(uuid);
-		} catch (AsdcCatalogException e) {
-			LOG.error("Failed to retrieve service definitions from SDC", e);
-			throw new VidServiceUnavailableException("Failed to retrieve service definitions from SDC", e);
-		}
-	}
-
-
-	/**
-	 * Gets the services view.
-	 *
-	 * @param request the request
-	 * @return the services view
-	 * @throws VidServiceUnavailableException the vid service unavailable exception
-	 */
-	@RequestMapping(value={"/serviceModels"}, method=RequestMethod.GET)
-	public ModelAndView getServicesView(HttpServletRequest request) throws VidServiceUnavailableException {
-		return new ModelAndView("serviceModels");
-	}
-}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/controller/ViewEditSubController.java b/vid-app-common/src/main/java/org/openecomp/vid/controller/ViewEditSubController.java
deleted file mode 100755
index e23b99b..0000000
--- a/vid-app-common/src/main/java/org/openecomp/vid/controller/ViewEditSubController.java
+++ /dev/null
@@ -1,107 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * VID
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *      http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.vid.controller;
-
-
-import java.io.File;
-import java.text.DateFormat;
-import java.util.HashMap;
-import java.util.Map;
-
-
-
-
-import javax.servlet.ServletContext;
-import javax.servlet.http.HttpServletRequest;
-
-import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestMethod;
-import org.springframework.web.bind.annotation.RestController;
-import org.springframework.web.servlet.ModelAndView;
-
-import org.openecomp.portalsdk.core.controller.RestrictedBaseController;
-
-
-/**
- * The Class ViewEditSubController.
- */
-@RestController
-public class ViewEditSubController extends RestrictedBaseController{
-	
-	/** The view name. */
-	String viewName;
-	
-	/** The logger. */
-	EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(ViewEditSubController.class);
-	
-	/** The model. */
-	private Map<String, Object> model = new HashMap<String, Object>();
-	
-	/** The servlet context. */
-	private @Autowired ServletContext servletContext;
-	
-	/**
-	 * Welcome.
-	 *
-	 * @param request the request
-	 * @return the model and view
-	 */
-	@RequestMapping(value = {"/vieweditsub" }, method = RequestMethod.GET)
-	public ModelAndView welcome(HttpServletRequest request) {
-		return new ModelAndView("vieweditsub","model", model);
-    //	return new ModelAndView(getViewName());		
-	}
-	
-	/**
-	 * Post subscriber.
-	 *
-	 * @param request the request
-	 */
-	@RequestMapping(value="/vieweditsub/subedit", method = RequestMethod.POST)
-	public void PostSubscriber(HttpServletRequest request) {
-		
-		String        subID = request.getParameter("subscriberID");
-		model.put("subInfo", subID);
-		
-	}
-	
-	/* (non-Javadoc)
-	 * @see org.openecomp.portalsdk.core.controller.RestrictedBaseController#getViewName()
-	 */
-	public String getViewName() {
-		return viewName;
-	}
-	
-	/* (non-Javadoc)
-	 * @see org.openecomp.portalsdk.core.controller.RestrictedBaseController#setViewName(java.lang.String)
-	 */
-	public void setViewName(String viewName) {
-		this.viewName = viewName;
-	}
-
-
-	
-
-}
-
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/controller/ViewLogController.java b/vid-app-common/src/main/java/org/openecomp/vid/controller/ViewLogController.java
deleted file mode 100755
index 31e6498..0000000
--- a/vid-app-common/src/main/java/org/openecomp/vid/controller/ViewLogController.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * VID
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *      http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.vid.controller;
-
-import java.text.DateFormat;
-import java.text.SimpleDateFormat;
-
-import javax.servlet.ServletContext;
-import javax.servlet.http.HttpServletRequest;
-
-import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
-import org.springframework.beans.factory.annotation.Autowired;
-
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestMethod;
-import org.springframework.web.bind.annotation.RestController;
-import org.springframework.web.servlet.ModelAndView;
-import org.openecomp.portalsdk.core.controller.RestrictedBaseController;
-
-
-/**
- * The Class ViewLogController.
- */
-@RestController
-public class ViewLogController extends RestrictedBaseController{
-	
-	/** The view name. */
-	String viewName;
-	
-	/** The logger. */
-	EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(ViewLogController.class);
-	
-	/** The Constant dateFormat. */
-	final static DateFormat dateFormat = new SimpleDateFormat("HH:mm:ss:SSSS");
-	
-	/** The servlet context. */
-	private @Autowired ServletContext servletContext;
-	
-	/**
-	 * Welcome.
-	 *
-	 * @param request the request
-	 * @return the model and view
-	 */
-	@RequestMapping(value = {"/viewlog" }, method = RequestMethod.GET)
-	public ModelAndView welcome(HttpServletRequest request) {
-		
- 	return new ModelAndView(getViewName());		
-	}
-	
-	/* (non-Javadoc)
-	 * @see org.openecomp.portalsdk.core.controller.RestrictedBaseController#getViewName()
-	 */
-	public String getViewName() {
-		return viewName;
-	}
-	
-	/* (non-Javadoc)
-	 * @see org.openecomp.portalsdk.core.controller.RestrictedBaseController#setViewName(java.lang.String)
-	 */
-	public void setViewName(String viewName) {
-		this.viewName = viewName;
-	}
-
-
-}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/controller/WebConfig.java b/vid-app-common/src/main/java/org/openecomp/vid/controller/WebConfig.java
deleted file mode 100644
index 1e13d0e..0000000
--- a/vid-app-common/src/main/java/org/openecomp/vid/controller/WebConfig.java
+++ /dev/null
@@ -1,122 +0,0 @@
-package org.openecomp.vid.controller;
-
-import com.fasterxml.jackson.databind.ObjectMapper;
-import org.apache.commons.io.IOUtils;
-import org.json.JSONObject;
-import org.json.JSONTokener;
-import org.openecomp.vid.aai.AaiClient;
-import org.openecomp.vid.aai.AaiClientInterface;
-import org.openecomp.vid.asdc.AsdcClient;
-import org.openecomp.vid.asdc.local.LocalAsdcClient;
-import org.openecomp.vid.asdc.memory.InMemoryAsdcClient;
-import org.openecomp.vid.asdc.parser.ToscaParserImpl2;
-import org.openecomp.vid.asdc.rest.RestfulAsdcClient;
-import org.openecomp.vid.properties.AsdcClientConfiguration;
-import org.openecomp.vid.properties.AsdcClientConfiguration.AsdcClientType;
-import org.openecomp.vid.services.AaiService;
-import org.openecomp.vid.services.AaiServiceImpl;
-import org.openecomp.vid.services.VidService;
-import org.openecomp.vid.services.VidServiceImpl;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
-
-import javax.net.ssl.SSLContext;
-import javax.ws.rs.client.Client;
-import javax.ws.rs.client.ClientBuilder;
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.URI;
-import java.net.URISyntaxException;
-import java.security.KeyManagementException;
-import java.security.NoSuchAlgorithmException;
-import java.util.Arrays;
-
-@Configuration
-public class WebConfig {
-
-    /**
-     * Gets the object mapper.
-     *
-     * @return the object mapper
-     */
-    @Bean
-    public ObjectMapper getObjectMapper() {
-        return new ObjectMapper();
-    }
-
-
-
-    @Bean
-    public VidService vidService(AsdcClient asdcClient) {
-        return new VidServiceImpl(asdcClient);
-    }
-
-    @Bean
-    public AaiService getAaiService(){
-        return new AaiServiceImpl();
-    }
-
-    @Bean
-    public AaiClientInterface getAaiClientInterface(){
-        return new AaiClient();
-    }
-
-    @Bean
-    public AsdcClient asdcClient(AsdcClientConfiguration asdcClientConfig) throws IOException {
-        switch (asdcClientConfig.getAsdcClientType()) {
-            case IN_MEMORY:
-                final InputStream asdcCatalogFile = VidController.class.getClassLoader().getResourceAsStream("catalog.json");
-                final JSONTokener tokener = new JSONTokener(asdcCatalogFile);
-                final JSONObject catalog = new JSONObject(tokener);
-
-                return new InMemoryAsdcClient.Builder().catalog(catalog).build();
-            case REST:
-
-                final String protocol = asdcClientConfig.getAsdcClientProtocol();
-                final String host = asdcClientConfig.getAsdcClientHost();
-                final int port = asdcClientConfig.getAsdcClientPort();
-                final String auth = asdcClientConfig.getAsdcClientAuth();
-                Client cl = null;
-                if (protocol.equalsIgnoreCase("https")) {
-                    try {
-                        SSLContext ctx = SSLContext.getInstance("TLSv1.2");
-                        ctx.init(null, null, null);
-                        cl = ClientBuilder.newBuilder().sslContext(ctx).build();
-                    } catch (NoSuchAlgorithmException n) {
-                        throw new RuntimeException("SDC Client could not be instantiated due to unsupported protocol TLSv1.2", n);
-                    } catch (KeyManagementException k) {
-                        throw new RuntimeException("SDC Client could not be instantiated due to a key management exception", k);
-                    }
-                } else {
-                    cl = ClientBuilder.newBuilder().build();
-                }
-
-                try {
-                    final URI uri = new URI(protocol + "://" + host + ":" + port + "/");
-                    return new RestfulAsdcClient.Builder(cl, uri)
-                            .auth(auth)
-                            .build();
-                } catch (URISyntaxException e) {
-                    throw new RuntimeException("SDC Client could not be instantiated due to a syntax error in the URI", e);
-                }
-
-            case LOCAL:
-
-                final InputStream asdcServicesFile = VidController.class.getClassLoader().getResourceAsStream("sdcservices.json");
-
-                final JSONTokener jsonTokener = new JSONTokener(IOUtils.toString(asdcServicesFile));
-                final JSONObject sdcServicesCatalog = new JSONObject(jsonTokener);
-
-                return new LocalAsdcClient.Builder().catalog(sdcServicesCatalog).build();
-
-            default:
-                throw new RuntimeException(asdcClientConfig.getAsdcClientType() + " is invalid; must be one of " + Arrays.toString(AsdcClientType.values()));
-        }
-    }
-
-    @Bean
-    public ToscaParserImpl2 getToscaParser() {
-        return new ToscaParserImpl2();
-    }
-
-}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/controller/test/TestAaiController.java b/vid-app-common/src/main/java/org/openecomp/vid/controller/test/TestAaiController.java
deleted file mode 100755
index 7901741..0000000
--- a/vid-app-common/src/main/java/org/openecomp/vid/controller/test/TestAaiController.java
+++ /dev/null
@@ -1,93 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * VID
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *      http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.vid.controller.test;
-
-import java.io.IOException;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.codehaus.jackson.map.ObjectMapper;
-import org.openecomp.vid.model.ExceptionResponse;
-import org.springframework.web.bind.annotation.ExceptionHandler;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestMethod;
-import org.springframework.web.bind.annotation.RestController;
-
-import org.openecomp.portalsdk.core.controller.RestrictedBaseController;
-
-/**
- * The Class TestAaiController.
- */
-@RestController
-@RequestMapping("testaai")
-public class TestAaiController extends RestrictedBaseController {
-
-	/**
-	 * Gets the subscription service type list.
-	 *
-	 * @param globalCustomerId the global customer id
-	 * @param request the request
-	 * @return the subscription service type list
-	 * @throws Exception the exception
-	 */
-	@RequestMapping(value = "/getSubscriptionServiceTypeList/{globalCustomerId}", method = RequestMethod.GET)
-	public String getSubscriptionServiceTypeList(@PathVariable("globalCustomerId") String globalCustomerId, HttpServletRequest request)
-			throws Exception {
-
-		System.err.println("GET SUBSCRIPTION SERVICE TYPE LIST: globalCustomerId: " + globalCustomerId);
-
-		return "[\"vMOG\", \"sevice type 2\", \"sevice type 3\", \"sevice type 4\"]";
-	}
-
-	/**
-	 * Exception.
-	 *
-	 * @param e the e
-	 * @param response the response
-	 * @throws IOException Signals that an I/O exception has occurred.
-	 */
-	@ExceptionHandler(Exception.class)
-	private void exception(Exception e, HttpServletResponse response) throws IOException {
-
-		/*
-		 * This logging step should preferably be replaced with an appropriate
-		 * logging method consistent whatever logging mechanism the rest of the
-		 * application code uses.
-		 */
-
-		e.printStackTrace(System.err);
-
-		response.setContentType("application/json; charset=UTF-8");
-		response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
-
-		ExceptionResponse exceptionResponse = new ExceptionResponse();
-		exceptionResponse.setException(e.getClass().toString().replaceFirst("^.*\\.", ""));
-		exceptionResponse.setMessage(e.getMessage());
-
-		response.getWriter().write(new ObjectMapper().writeValueAsString(exceptionResponse));
-
-		response.flushBuffer();
-
-	}
-
-}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/controller/test/TestAsdcController.java b/vid-app-common/src/main/java/org/openecomp/vid/controller/test/TestAsdcController.java
deleted file mode 100755
index 84a56b3..0000000
--- a/vid-app-common/src/main/java/org/openecomp/vid/controller/test/TestAsdcController.java
+++ /dev/null
@@ -1,112 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * VID
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *      http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package  org.openecomp.vid.controller.test;
-
-import java.io.IOException;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.codehaus.jackson.map.ObjectMapper;
-import org.openecomp.vid.model.ExceptionResponse;
-import org.springframework.web.bind.annotation.ExceptionHandler;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestMethod;
-import org.springframework.web.bind.annotation.RestController;
-
-import org.openecomp.portalsdk.core.controller.RestrictedBaseController;
-
-/**
- * The Class TestAsdcController.
- */
-@RestController
-@RequestMapping("testasdc")
-public class TestAsdcController extends RestrictedBaseController {
-
-	/**
-	 * Gets the model.
-	 *
-	 * @param modelId the model id
-	 * @param request the request
-	 * @return the model
-	 * @throws Exception the exception
-	 */
-	@RequestMapping(value = "/getModel/{modelId}", method = RequestMethod.GET)
-	public String getModel(@PathVariable("modelId") String modelId, HttpServletRequest request) throws Exception {
-
-		System.err.println("SDC: GET MODEL: modelId: " + modelId);
-
-		// @formatter:off
-		return
-		   "{" +
-		       "\"uuid\": \"5be686dc-fdca-4d54-8548-5d0ed23e962b\"," +
-		       "\"invariantUUID\": \"e5962da9-fe4f-433a-bc99-b43e0d88a9a1\"," +
-		       "\"name\": \"DE220127\"," +
-		       "\"version\": \"0.1\"," +       
-	           "\"inputs\": {" +
-	             "\"defaultGateway\": {" +
-	                    "\"type\": \"String\"," +
-	                    "\"default\": \"192.168.1.1\"," +
-	                    "\"description\": \"Router default gateway - use any valid IPv4 address\"" +
-	             "}," +
-	             "\"subnetMask\": {" +
-	                    "\"type\": \"String\"," +
-	                    "\"default\": \"255.255.255.0\"," +
-	                    "\"description\": \"Router subnet mask - example (255.255.255.0)\"" +
-	             "}" +
-	            "}" +
-			"}";
-		// @formatter:on
-	}
-
-	/**
-	 * Exception.
-	 *
-	 * @param e the e
-	 * @param response the response
-	 * @throws IOException Signals that an I/O exception has occurred.
-	 */
-	@ExceptionHandler(Exception.class)
-	private void exception(Exception e, HttpServletResponse response) throws IOException {
-
-		/*
-		 * This logging step should preferably be replaced with an appropriate
-		 * logging method consistent whatever logging mechanism the rest of the
-		 * application code uses.
-		 */
-
-		e.printStackTrace(System.err);
-
-		response.setContentType("application/json; charset=UTF-8");
-		response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
-
-		ExceptionResponse exceptionResponse = new ExceptionResponse();
-		exceptionResponse.setException(e.getClass().toString().replaceFirst("^.*\\.", ""));
-		exceptionResponse.setMessage(e.getMessage());
-
-		response.getWriter().write(new ObjectMapper().writeValueAsString(exceptionResponse));
-
-		response.flushBuffer();
-
-	}
-
-}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/controller/test/TestMsoController.java b/vid-app-common/src/main/java/org/openecomp/vid/controller/test/TestMsoController.java
deleted file mode 100755
index 02c29f6..0000000
--- a/vid-app-common/src/main/java/org/openecomp/vid/controller/test/TestMsoController.java
+++ /dev/null
@@ -1,729 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * VID
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *      http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package  org.openecomp.vid.controller.test;
-
-import java.io.IOException;
-import java.util.stream.Collectors;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.codehaus.jackson.map.ObjectMapper;
-import org.openecomp.vid.model.ExceptionResponse;
-import org.springframework.http.HttpStatus;
-import org.springframework.http.ResponseEntity;
-import org.springframework.web.bind.annotation.ExceptionHandler;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestMethod;
-import org.springframework.web.bind.annotation.RestController;
-
-import org.openecomp.portalsdk.core.controller.RestrictedBaseController;
-
-/*
- * The "TestMsoController" class is primarily designed to help test "msoCommitController.js"
- * 
- * This class expects and receives JSON data in the same format as expected
- * in the "real" application version of this code. However, string versions of JSON are
- * maintained internally here instead of marshalled / unmarshalled JSON objects.
- * The primary reasons for this were to encapsulate all the test code in this single file and
- * minimize the time required to support initial test cases.
- * 
- * The non-test equivalent of this controller could alternatively incorporate POJO objects
- * instead of strings. However, the same data format sent to / received from the browser
- * JavaScript code would still be expected.
- * 
- * Two specific mechanisms used in this test class may be useful to the application version:
- * 
- * 		1) The use of "{variable}" elements in @RequestMappings along with the corresponding
- * 		@PathVariable declarations.
- * 
- * 		2) The use of @ExceptionHandler for general purpose exception handler.
- * 		(See @ExceptionHandler comments)
- *
- * This class is intended to be used in either:
- * 
- * 		A) Eclipse environments
- * 	OR
- * 		B) Linux environments with ONLY a single user running tests.
- *		The "quick and dirty" error simulation approach used here makes use of static states for some
- *		scenarios. Thus multiple users simultaneously testing in Linux environments
- *		may have contention issues.
- */
-
-/**
- * The Class TestMsoController.
- */
-@RestController
-@RequestMapping("testmso")
-public class TestMsoController extends RestrictedBaseController {
-
-	/*
-	 * Artificial delay (in milliseconds) added before responding to create /
-	 * delete requests
-	 */
-
-	/** The Constant TEST_DELAY_SHORT_MSEC. */
-	private final static int TEST_DELAY_SHORT_MSEC = 1000;
-
-	/*
-	 * Long delay to simulate non-responsive server test
-	 */
-
-	/** The Constant TEST_DELAY_LONG_MSEC. */
-	private final static int TEST_DELAY_LONG_MSEC = 15000;
-
-	/*
-	 * Default number of polls expected before transaction complete.
-	 */
-
-	/** The Constant MAXIMUM_POLLS_DEFAULT. */
-	private final static int MAXIMUM_POLLS_DEFAULT = 4;
-
-	/*
-	 * Number of polls to simulate "maximum polls exceeded" test.
-	 */
-
-	/** The Constant MAXIMUM_POLLS_LARGE. */
-	private final static int MAXIMUM_POLLS_LARGE = 10;
-
-	/*
-	 * Simulated error types. The GUI front end is expected to set these values
-	 * in the "modelName" field of the "mso_create_svc_instance" request.
-	 */
-
-	/** The Constant ERROR_POLICY_EXCEPTION. */
-	private final static String ERROR_POLICY_EXCEPTION = "ERROR_POLICY_EXCEPTION";
-	
-	/** The Constant ERROR_SERVICE_EXCEPTION. */
-	private final static String ERROR_SERVICE_EXCEPTION = "ERROR_SERVICE_EXCEPTION";
-	
-	/** The Constant ERROR_POLL_FAILURE. */
-	private final static String ERROR_POLL_FAILURE = "ERROR_POLL_FAILURE";
-	
-	/** The Constant ERROR_INVALID_FIELD_INITIAL. */
-	private final static String ERROR_INVALID_FIELD_INITIAL = "ERROR_INVALID_FIELD_INITIAL";
-	
-	/** The Constant ERROR_INVALID_FIELD_POLL. */
-	private final static String ERROR_INVALID_FIELD_POLL = "ERROR_INVALID_FIELD_POLL";
-	
-	/** The Constant ERROR_GENERAL_SERVER_EXCEPTION. */
-	private final static String ERROR_GENERAL_SERVER_EXCEPTION = "ERROR_GENERAL_SERVER_EXCEPTION";
-	
-	/** The Constant ERROR_MAX_POLLS. */
-	private final static String ERROR_MAX_POLLS = "ERROR_MAX_POLLS";
-	
-	/** The Constant ERROR_SERVER_TIMEOUT_INITIAL. */
-	private final static String ERROR_SERVER_TIMEOUT_INITIAL = "ERROR_SERVER_TIMEOUT_INITIAL";
-	
-	/** The Constant ERROR_SERVER_TIMEOUT_POLL. */
-	private final static String ERROR_SERVER_TIMEOUT_POLL = "ERROR_SERVER_TIMEOUT_POLL";
-
-	/** The simulated error. */
-	private String simulatedError = "";
-	
-	/** The maximum polls. */
-	private int maximumPolls = 0;
-	
-	/** The attempt count. */
-	private int attemptCount = 0;
-
-	/**
-	 * Creates the svc instance.
-	 *
-	 * @param request the request
-	 * @return the response entity
-	 * @throws Exception the exception
-	 */
-	@RequestMapping(value = "/mso_create_svc_instance", method = RequestMethod.POST)
-	public ResponseEntity<String> createSvcInstance(HttpServletRequest request) throws Exception {
-		readAndLogRequest("CREATE SERVICE INSTANCE", request);
-		Thread.sleep(TEST_DELAY_SHORT_MSEC);
-		maximumPolls = MAXIMUM_POLLS_DEFAULT; // Simulates MSO polling behavior
-		attemptCount = 0;
-
-		/*
-		 * This block of code simulates various errors and would NOT be expected
-		 * in a non-test method
-		 */
-		System.err.println("simulatedError: " + simulatedError);
-
-		if (simulatedError.equals(ERROR_POLICY_EXCEPTION)) {
-			return new ResponseEntity<String>(policyExceptionResponse, HttpStatus.OK);
-		}
-		if (simulatedError.equals(ERROR_SERVICE_EXCEPTION)) {
-			return new ResponseEntity<String>(serviceExceptionResponse, HttpStatus.OK);
-		}
-		if (simulatedError.equals(ERROR_INVALID_FIELD_INITIAL)) {
-			/*
-			 * Force invalid response field name. Return
-			 * "XXXXXrequestReferences" instead of "requestReferences"
-			 */
-			return new ResponseEntity<String>(acceptResponse.replace("requestReferences", "XXXXXrequestReferences"),
-					HttpStatus.OK);
-		}
-
-		if (simulatedError.equals(ERROR_GENERAL_SERVER_EXCEPTION)) {
-			throw new IOException("an example of an IO exception");
-		}
-
-		if (simulatedError.equals(ERROR_SERVER_TIMEOUT_INITIAL)) {
-			Thread.sleep(TEST_DELAY_LONG_MSEC);
-		}
-
-		if (simulatedError.equals(ERROR_MAX_POLLS)) {
-			maximumPolls = MAXIMUM_POLLS_LARGE;
-		}
-
-		/*
-		 * End of block of simulated error code.
-		 */
-
-		return new ResponseEntity<String>(acceptResponse, HttpStatus.OK);
-	}
-
-	/**
-	 * Delete svc instance.
-	 *
-	 * @param serviceInstanceId the service instance id
-	 * @param request the request
-	 * @return the response entity
-	 * @throws Exception the exception
-	 */
-	@RequestMapping(value = "/mso_delete_svc_instance/{serviceInstanceId}", method = RequestMethod.POST)
-	public ResponseEntity<String> deleteSvcInstance(@PathVariable("serviceInstanceId") String serviceInstanceId,
-			HttpServletRequest request) throws Exception {
-		readAndLogRequest("DELETE SERVICE INSTANCE: serviceInstanceId: " + serviceInstanceId, request);
-		Thread.sleep(TEST_DELAY_SHORT_MSEC);
-		maximumPolls = MAXIMUM_POLLS_DEFAULT; // Simulates MSO polling behavior
-		attemptCount = 0;
-		return new ResponseEntity<String>(acceptResponse, HttpStatus.OK);
-	}
-
-	/**
-	 * Creates the vnf instance.
-	 *
-	 * @param serviceInstanceId the service instance id
-	 * @param request the request
-	 * @return the response entity
-	 * @throws Exception the exception
-	 */
-	@RequestMapping(value = "/mso_create_vnf_instance/{serviceInstanceId}", method = RequestMethod.POST)
-	public ResponseEntity<String> createVnfInstance(@PathVariable("serviceInstanceId") String serviceInstanceId,
-			HttpServletRequest request) throws Exception {
-		readAndLogRequest("CREATE VNF INSTANCE: serviceInstanceId: " + serviceInstanceId, request);
-		Thread.sleep(TEST_DELAY_SHORT_MSEC);
-		maximumPolls = MAXIMUM_POLLS_DEFAULT; // Simulates MSO polling behavior
-		attemptCount = 0;
-		return new ResponseEntity<String>(acceptResponse, HttpStatus.OK);
-	}
-
-	/**
-	 * Delete vnf instance.
-	 *
-	 * @param serviceInstanceId the service instance id
-	 * @param vnfInstanceId the vnf instance id
-	 * @param request the request
-	 * @return the response entity
-	 * @throws Exception the exception
-	 */
-	@RequestMapping(value = "/mso_delete_vnf_instance/{serviceInstanceId}/vnfs/{vnfInstanceId}", method = RequestMethod.POST)
-	public ResponseEntity<String> deleteVnfInstance(@PathVariable("serviceInstanceId") String serviceInstanceId,
-			@PathVariable("vnfInstanceId") String vnfInstanceId, HttpServletRequest request) throws Exception {
-		readAndLogRequest(
-				"DELETE VNF INSTANCE: serviceInstanceId: " + serviceInstanceId + " vnfInstanceId: " + vnfInstanceId,
-				request);
-		Thread.sleep(TEST_DELAY_SHORT_MSEC);
-		maximumPolls = MAXIMUM_POLLS_DEFAULT; // Simulates MSO polling behavior
-		attemptCount = 0;
-		return new ResponseEntity<String>(acceptResponse, HttpStatus.OK);
-	}
-
-	/**
-	 * Creates the vf module instance.
-	 *
-	 * @param serviceInstanceId the service instance id
-	 * @param vnfInstanceId the vnf instance id
-	 * @param request the request
-	 * @return the response entity
-	 * @throws Exception the exception
-	 */
-	// /serviceInstances/v2/ff305d54-75b4-431b-adb2-eb6b9e5ff000/vnfs/ff305d54-75b4-ff1b-adb2-eb6b9e5460ff/vfModules
-	@RequestMapping(value = "/mso_create_vfmodule_instance/{serviceInstanceId}/vnfs/{vnfInstanceId}", method = RequestMethod.POST)
-	public ResponseEntity<String> createVfModuleInstance(@PathVariable("serviceInstanceId") String serviceInstanceId,
-			@PathVariable("vnfInstanceId") String vnfInstanceId, HttpServletRequest request) throws Exception {
-		readAndLogRequest("CREATE VF MODULE INSTANCE: serviceInstanceId: " + serviceInstanceId + " vnfInstanceId: "
-				+ vnfInstanceId, request);
-		Thread.sleep(TEST_DELAY_SHORT_MSEC);
-		maximumPolls = MAXIMUM_POLLS_DEFAULT; // Simulates MSO polling behavior
-		attemptCount = 0;
-		return new ResponseEntity<String>(acceptResponse, HttpStatus.OK);
-	}
-
-	/**
-	 * Delete vf module instance.
-	 *
-	 * @param serviceInstanceId the service instance id
-	 * @param vnfInstanceId the vnf instance id
-	 * @param vfModuleInstanceId the vf module instance id
-	 * @param request the request
-	 * @return the response entity
-	 * @throws Exception the exception
-	 */
-	// /serviceInstances/v2/ff305d54-75b4-431b-adb2-eb6b9e5ff000/vnfs/ff305d54-75b4-ff1b-adb2-eb6b9e5460ff/vfModules/ff305d54-75b4-ff1b-bdb2-eb6b9e5460ff
-	@RequestMapping(value = "/mso_delete_vfmodule_instance/{serviceInstanceId}/vnfs/{vnfInstanceId}/vfModules/{vfModuleInstanceId}", method = RequestMethod.POST)
-	public ResponseEntity<String> deleteVfModuleInstance(@PathVariable("serviceInstanceId") String serviceInstanceId,
-			@PathVariable("vnfInstanceId") String vnfInstanceId,
-			@PathVariable("vfModuleInstanceId") String vfModuleInstanceId, HttpServletRequest request)
-			throws Exception {
-		readAndLogRequest("DELETE VF MODULE INSTANCE: serviceInstanceId: " + serviceInstanceId + " vnfInstanceId: "
-				+ vnfInstanceId + " vfModuleInstanceId: " + vfModuleInstanceId, request);
-		Thread.sleep(TEST_DELAY_SHORT_MSEC);
-		maximumPolls = MAXIMUM_POLLS_DEFAULT; // Simulates MSO polling behavior
-		attemptCount = 0;
-		return new ResponseEntity<String>(acceptResponse, HttpStatus.OK);
-	}
-
-	// POST
-	/**
-	 * Creates the volume group instance.
-	 *
-	 * @param serviceInstanceId the service instance id
-	 * @param vnfInstanceId the vnf instance id
-	 * @param request the request
-	 * @return the response entity
-	 * @throws Exception the exception
-	 */
-	// /serviceInstances/v2/ff305d54-75b4-431b-adb2-eb6b9e5ff000/volumeGroups
-	@RequestMapping(value = "/mso_create_volumegroup_instance/{serviceInstanceId}/vnfs/{vnfInstanceId}", method = RequestMethod.POST)
-	public ResponseEntity<String> createVolumeGroupInstance(@PathVariable("serviceInstanceId") String serviceInstanceId,
-			@PathVariable("vnfInstanceId") String vnfInstanceId, HttpServletRequest request) throws Exception {
-		readAndLogRequest("CREATE VOLUME GROUP INSTANCE: seviceInstanceId: " + serviceInstanceId + " vnfInstanceId: "
-				+ vnfInstanceId, request);
-		Thread.sleep(TEST_DELAY_SHORT_MSEC);
-		maximumPolls = MAXIMUM_POLLS_DEFAULT; // Simulates MSO polling behavior
-		attemptCount = 0;
-		return new ResponseEntity<String>(acceptResponse, HttpStatus.OK);
-	}
-
-	/**
-	 * Delete volume group instance.
-	 *
-	 * @param serviceInstanceId the service instance id
-	 * @param vnfInstanceId the vnf instance id
-	 * @param volumeGroupInstanceId the volume group instance id
-	 * @param request the request
-	 * @return the response entity
-	 * @throws Exception the exception
-	 */
-	// /serviceInstances/v2/ff305d54-75b4-431b-adb2-eb6b9e5ff000/volumeGroups/ff305d54-75b4-ff1b-cdb2-eb6b9e5460ff
-	@RequestMapping(value = "/mso_delete_volumegroup_instance/{serviceInstanceId}/vnfs/{vnfInstanceId}/volumeGroups/{volumeGroupInstanceId}", method = RequestMethod.POST)
-	public ResponseEntity<String> deleteVolumeGroupInstance(@PathVariable("serviceInstanceId") String serviceInstanceId,
-			@PathVariable("vnfInstanceId") String vnfInstanceId,
-			@PathVariable("volumeGroupInstanceId") String volumeGroupInstanceId, HttpServletRequest request)
-			throws Exception {
-		readAndLogRequest("DELETE NW INSTANCE: serviceInstanceId: " + serviceInstanceId + " vnfInstanceId: "
-				+ vnfInstanceId + " volumeGroupInstanceId: " + volumeGroupInstanceId, request);
-		Thread.sleep(TEST_DELAY_SHORT_MSEC);
-		maximumPolls = MAXIMUM_POLLS_DEFAULT; // Simulates MSO polling behavior
-		attemptCount = 0;
-		return new ResponseEntity<String>(acceptResponse, HttpStatus.OK);
-	}
-
-	/**
-	 * Creates the nw instance.
-	 *
-	 * @param serviceInstanceId the service instance id
-	 * @param request the request
-	 * @return the response entity
-	 * @throws Exception the exception
-	 */
-	@RequestMapping(value = "/mso_create_nw_instance/{serviceInstanceId}", method = RequestMethod.POST)
-	public ResponseEntity<String> createNwInstance(@PathVariable("serviceInstanceId") String serviceInstanceId,
-			HttpServletRequest request) throws Exception {
-		readAndLogRequest("CREATE NW INSTANCE: serviceInstanceId: " + serviceInstanceId, request);
-		Thread.sleep(TEST_DELAY_SHORT_MSEC);
-		maximumPolls = MAXIMUM_POLLS_DEFAULT; // Simulates MSO polling behavior
-		attemptCount = 0;
-		return new ResponseEntity<String>(acceptResponse, HttpStatus.OK);
-	}
-
-	/**
-	 * Delete nw instance.
-	 *
-	 * @param serviceInstanceId the service instance id
-	 * @param networkInstanceId the network instance id
-	 * @param request the request
-	 * @return the response entity
-	 * @throws Exception the exception
-	 */
-	@RequestMapping(value = "/mso_delete_nw_instance/{serviceInstanceId}/networks/{networkInstanceId}", method = RequestMethod.POST)
-	public ResponseEntity<String> deleteNwInstance(@PathVariable("serviceInstanceId") String serviceInstanceId,
-			@PathVariable("networkInstanceId") String networkInstanceId, HttpServletRequest request) throws Exception {
-		readAndLogRequest("DELETE NW INSTANCE: serviceInstanceId: " + serviceInstanceId + " networkInstanceId: "
-				+ networkInstanceId, request);
-		Thread.sleep(TEST_DELAY_SHORT_MSEC);
-		maximumPolls = MAXIMUM_POLLS_DEFAULT; // Simulates MSO polling behavior
-		attemptCount = 0;
-		return new ResponseEntity<String>(acceptResponse, HttpStatus.OK);
-	}
-
-	/**
-	 * Gets the orchestration request.
-	 *
-	 * @param requestId the request id
-	 * @param request the request
-	 * @return the orchestration request
-	 * @throws Exception the exception
-	 */
-	@RequestMapping(value = "/mso_get_orch_req/{requestId}", method = RequestMethod.GET)
-	public ResponseEntity<String> getOrchestrationRequest(@PathVariable("requestId") String requestId,
-			HttpServletRequest request) throws Exception {
-
-		System.err.println("GET ORCHESTRATION REQUEST: requestId: " + requestId);
-
-		/*
-		 * This block of code simulates various errors and would NOT be expected
-		 * in a non-test method
-		 */
-
-		if (simulatedError.equals(ERROR_INVALID_FIELD_POLL)) {
-			/*
-			 * Force invalid response field name. Return "XXXXXrequestStatus"
-			 * instead of "requestStatus"
-			 */
-			return new ResponseEntity<String>(inProgressResponse.replace("requestStatus", "XXXXXrequestStatus"),
-					HttpStatus.OK);
-		}
-
-		if (simulatedError.equals(ERROR_POLL_FAILURE)) {
-			/*
-			 * Force status field with "Failure"
-			 */
-			return new ResponseEntity<String>(inProgressResponse.replace("InProgress", "Failure"), HttpStatus.OK);
-		}
-
-		if (simulatedError.equals(ERROR_SERVER_TIMEOUT_POLL)) {
-			Thread.sleep(TEST_DELAY_LONG_MSEC);
-		}
-
-		/*
-		 * End of block of simulated error code.
-		 */
-
-		/*
-		 * This logic simulates how MSO might behave ... i.e. return different
-		 * results depending on the value of 'maximumPolls'.
-		 *
-		 */
-		int percentProgress = (++attemptCount * 100) / maximumPolls;
-
-		System.err.println("attempts: " + attemptCount + " max: " + maximumPolls + " percent: " + percentProgress);
-
-		String response = inProgressResponse.replace("\"50\"", "\"" + Integer.toString(percentProgress) + "\"");
-
-		if (attemptCount < maximumPolls) {
-			if (attemptCount > 1) {
-				response = response.replace("vLan setup", "setup step " + Integer.toString(attemptCount));
-			}
-			return new ResponseEntity<String>(response, HttpStatus.OK);
-		} else {
-			return new ResponseEntity<String>(
-					response.replace("InProgress", "Complete").replace("vLan setup complete", ""), HttpStatus.OK);
-		}
-	}
-
-	/**
-	 * Gets the orchestration requests.
-	 *
-	 * @param filterString the filter string
-	 * @param request the request
-	 * @return the orchestration requests
-	 * @throws Exception the exception
-	 */
-	@RequestMapping(value = "/mso_get_orch_reqs/{filterString}", method = RequestMethod.GET)
-	public ResponseEntity<String> getOrchestrationRequests(@PathVariable("filterString") String filterString,
-			HttpServletRequest request) throws Exception {
-
-		System.err.println("GET ORCHESTRATION REQUESTS: filterString: " + filterString);
-
-		return new ResponseEntity<String>(getOrchestrationRequestsResponse, HttpStatus.OK);
-
-	}
-
-	/*
-	 * General purpose exception handler that could be used in application code.
-	 * 
-	 * The method returns exceptions as error code 500. Both the exception type
-	 * and message are written as a JSON object.
-	 * 
-	 * See the following references:
-	 * 
-	 * 1) The ExceptionResponse POJO.
-	 * 
-	 * 2) The "getHttpErrorMessage" function in "utilityService.js" - an example
-	 * of how the browser JavaScript code can interpret this response.
-	 */
-
-	/**
-	 * Exception.
-	 *
-	 * @param e the e
-	 * @param response the response
-	 * @throws IOException Signals that an I/O exception has occurred.
-	 */
-	@ExceptionHandler(Exception.class)
-	private void exception(Exception e, HttpServletResponse response) throws IOException {
-
-		/*
-		 * This logging step should preferably be replaced with an appropriate
-		 * logging method consistent whatever logging mechanism the rest of the
-		 * application code uses.
-		 */
-
-		e.printStackTrace(System.err);
-
-		response.setContentType("application/json; charset=UTF-8");
-		response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
-
-		ExceptionResponse exceptionResponse = new ExceptionResponse();
-		exceptionResponse.setException(e.getClass().toString().replaceFirst("^.*\\.", ""));
-		exceptionResponse.setMessage(e.getMessage());
-
-		response.getWriter().write(new ObjectMapper().writeValueAsString(exceptionResponse));
-
-		response.flushBuffer();
-
-	}
-
-	/*
-	 * 'readAndLogRequest' only intended to be used for testing.
-	 * 
-	 * The method reads JSON from the input stream and thus prevents other
-	 * mechanisms from reading the input.
-	 */
-
-	/**
-	 * Read and log request.
-	 *
-	 * @param label the label
-	 * @param request the request
-	 * @throws Exception the exception
-	 */
-	private void readAndLogRequest(String label, HttpServletRequest request) throws Exception {
-		String input = request.getReader().lines().collect(Collectors.joining(System.lineSeparator()));
-
-		ObjectMapper mapper = new ObjectMapper();
-		Object json = mapper.readValue(input, Object.class);
-
-		System.err.println(label + "\n" + mapper.writerWithDefaultPrettyPrinter().writeValueAsString(json));
-
-		/*
-		 * Only needed for error simulation ...
-		 */
-		if (input.matches("^.*modelName.*$")) {
-			simulatedError = input.replaceAll("^.*\"modelName\":\"", "").replaceAll("\".*$", "");
-		}
-	}
-
-	/*
-	 * Various test responses:
-	 */
-
-	// @formatter:off
-
-	/** The accept response. */
-	/*
-	 * Sample responses to initial create / delete transaction
-	 */
-	private String acceptResponse =
-	   "{" +
-	    "  \"status\": 202," +
-	    "  \"entity\": {" +
-	    "      \"requestReferences\": {" +
-	    "         \"instanceId\": \"bc305d54-75b4-431b-adb2-eb6b9e546014\"," +
-	    "         \"requestId\": \"rq1234d1-5a33-55df-13ab-12abad84e331\"" +
-	    "      }" +
-	    "  }" +
-	    "}";
-	
-	/** The policy exception response. */
-	private String policyExceptionResponse = 
-		"{" + 
-		"  \"status\": 400," + 
-		"  \"entity\": { " + 
-		"    \"requestError\": {" + 
-		"      \"policyException\": {" + 
-		"        \"messageId\": \"POL9003\"," + 
-		"        \"text\": \"Message content size exceeds the allowable limit\"" + 
-		"      }" + 
-		"    }" + 
-		"  }" + 
-		"}";
-
-	/** The service exception response. */
-	private String serviceExceptionResponse =
-		"{" + 
-		"  \"status\": 400," + 
-		"  \"entity\": { " + 
-		"    \"requestError\": {" + 
-		"      \"serviceException\": {" + 
-		"        \"messageId\": \"SVC2000\"," + 
-		"        \"text\": \"Missing Parameter: %1. Error code is %2\"," + 
-		"        \"variables\": [" + 
-		"          \"severity\"," + 
-		"          \"400\"" + 
-		"        ]" + 
-		"      }" + 
-		"    }" + 
-		"  }" + 
-		"}" + 
-		"";
-	
-	/** The in progress response. */
-	/*
-	 * Sample response to subsequent getOrchestrationRequest
-	 */
-	private String inProgressResponse =
-		"{" +
-		"   \"status\": 200," +
-		"   \"entity\": {" +
-		"      \"request\": {" +
-		"         \"requestId\": \"rq1234d1-5a33-55df-13ab-12abad84e333\"," +
-		"         \"startTime\": \"Thu, 04 Jun 2009 02:51:59 GMT\"," +
-		"         \"instanceIds\": {" +
-		"            \"serviceInstanceId\": \"bc305d54-75b4-431b-adb2-eb6b9e546014\"" +
-		"         }," +
-		"         \"requestScope\": \"service\"," +
-		"         \"requestType\": \"createInstance\"," +
-		"         \"requestDetails\": {" +
-		"            \"modelInfo\": {" +
-		"               \"modelType\": \"service\"," +
-		"               \"modelId\": \"sn5256d1-5a33-55df-13ab-12abad84e764\"," +
-		"               \"modelNameVersionId\": \"ab6478e4-ea33-3346-ac12-ab121484a333\"," +
-		"               \"modelName\": \"WanBonding\"," +
-		"               \"modelVersion\": \"1\"" +
-		"            }," +
-		"            \"subscriberInfo\": {" +
-		"                \"globalSubscriberId\": \"C12345\"," +
-		"                \"subscriberName\": \"General Electric Division 12\"" +
-		"            }," +
-		"            \"requestParameters\": {" +
-		"               \"vpnId\": \"1a2b3c4d5e6f\"," +
-		"               \"productName\": \"Trinity\"," +
-		"               \"customerId\": \"icore9883749\"" +
-		"            }" +
-		"         }," +
-		"         \"requestStatus\": {" +
-		"            \"timestamp\": \"Thu, 04 Jun 2009 02:53:39 GMT\"," +
-		"            \"requestState\": \"InProgress\"," +
-		"            \"statusMessage\": \"vLan setup complete\"," +
-		"            \"percentProgress\": \"50\"" +
-		"         }" +
-		"      }" +
-		"   }" +
-		"}";
-	
-	/*
-	 * Sample response to subsequent getOrchestrationRequests
-	 */
-	
-	/** The get orchestration requests response. */
-	private String getOrchestrationRequestsResponse = 
-		"{" +
-		"   \"status\": 200," +
-		"   \"entity\": {" +
-		"      \"requestList\": [" +
-		"         {" +
-		"            \"request\": {" +
-		"               \"requestId\": \"rq1234d1-5a33-55df-13ab-12abad84e333\"," +
-		"               \"startTime\": \"Thu, 04 Jun 2009 02:51:59 GMT\"," +
-		"               \"finishTime\": \"Thu, 04 Jun 2009 02:55:59 GMT\"," +
-		"               \"instanceReferences\": {" +
-		"                  \"serviceInstanceId\": \"bc305d54-75b4-431b-adb2-eb6b9e546014\"" +
-		"               }," +
-		"               \"requestScope\": \"service\"," +
-		"               \"requestType\": \"createInstance\"," +
-		"               \"requestDetails\": {" +
-		"                  \"modelInfo\": {" +
-		"                     \"modelType\": \"service\"," +
-		"                     \"modelId\": \"sn5256d1-5a33-55df-13ab-12abad84e764\"," +
-		"                     \"modelNameVersionId\": \"ab6478e4-ea33-3346-ac12-ab121484a333\"," +
-		"                     \"modelName\": \"WanBonding\"," +
-		"                     \"modelVersion\": \"1\"" +
-		"                  }," +
-		"                  \"subscriberInfo\": {" +
-		"                      \"globalSubscriberId\": \"C12345\"," +
-		"                      \"subscriberName\": \"General Electric Division 12\"" +
-		"                  }," +
-		"                  \"requestParameters\": {" +
-		"                     \"vpnId\": \"1a2b3c4d5e6f\"," +
-		"                     \"productName\": \"Trinity\"," +
-		"                     \"customerId\": \"icore9883749\"" +
-		"                  }" +
-		"               }," +
-		"               \"requestStatus\": {" +
-		"                  \"timestamp\": \"Thu, 04 Jun 2009 02:54:49 GMT\"," +
-		"                  \"requestState\": \"complete\"," +
-		"                  \"statusMessage\": \"Resource Created\"," +
-		"                  \"percentProgress\": \"100\"" +
-		"               }" +
-		"            }" +
-		"         }," +
-		"         {" +
-		"            \"request\": {" +
-		"               \"requestId\": \"rq1234d1-5a33-55df-13ab-12abad84e334\"," +
-		"               \"startTime\": \"Thu, 04 Jun 2009 03:52:59 GMT\"," +
-		"               \"instanceReferences\": {" +
-		"                  \"serviceInstanceId\": \"bc305d54-75b4-431b-adb2-eb6b9e546014\"" +
-		"               }," +
-		"               \"requestScope\": \"service\"," +
-		"               \"requestType\": \"updateInstance\"," +
-		"               \"requestDetails\": {" +
-		"                  \"modelInfo\": {" +
-		"                     \"modelType\": \"service\"," +
-		"                     \"modelId\": \"sn5256d1-5a33-55df-13ab-12abad84e764\"," +
-		"                     \"modelNameVersionId\": \"ab6478e4-ea33-3346-ac12-ab121484a333\"," +
-		"                     \"modelName\": \"WanBonding\"," +
-		"                     \"modelVersion\": \"1\"" +
-		"                  }," +
-		"                  \"subscriberInfo\": {" +
-		"                      \"globalSubscriberId\": \"C12345\"," +
-		"                      \"subscriberName\": \"General Electric Division 12\"" +
-		"                  }," +
-		"                  \"requestParameters\": {" +
-		"                     \"vpnId\": \"1a2b3c4d5e70\"," +
-		"                     \"productName\": \"Trinity\"," +
-		"                     \"customerId\": \"icore9883749\"" +
-		"                  }" +
-		"               }," +
-		"               \"requestStatus\": {" +
-		"                  \"timestamp\": \"Thu, 04 Jun 2009 03:53:39 GMT\"," +
-		"                  \"requestState\": \"InProgress\"," +
-		"                  \"statusMessage\": \"vLan setup complete\"," +
-		"                  \"percentProgress\": \"50\"" +
-		"               }" +
-		"            }" +
-		"         }" +
-		"      ]" +
-		"   }" +
-		"}";
-}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/controller/test/TestPageController.java b/vid-app-common/src/main/java/org/openecomp/vid/controller/test/TestPageController.java
deleted file mode 100755
index 92f86f0..0000000
--- a/vid-app-common/src/main/java/org/openecomp/vid/controller/test/TestPageController.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * VID
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *      http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package  org.openecomp.vid.controller.test;
-
-import org.springframework.stereotype.Controller;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestMethod;
-import org.springframework.web.servlet.ModelAndView;
-
-import org.openecomp.portalsdk.core.controller.RestrictedBaseController;
-
-/**
- * The Class TestPageController.
- */
-@Controller
-public class TestPageController extends RestrictedBaseController {
-
-	/**
-	 * Test mso page.
-	 *
-	 * @return the model and view
-	 */
-	@RequestMapping(value = { "testMso.htm" }, method = RequestMethod.GET)
-	public ModelAndView testMsoPage() {
-		return new ModelAndView(getViewName());
-	}
-
-	/**
-	 * Test view edit page.
-	 *
-	 * @return the model and view
-	 */
-	@RequestMapping(value = { "testViewEdit" }, method = RequestMethod.GET)
-	public ModelAndView testViewEditPage() {
-		return new ModelAndView(getViewName());
-	}
-
-}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/dao/FnAppDoaImpl.java b/vid-app-common/src/main/java/org/openecomp/vid/dao/FnAppDoaImpl.java
deleted file mode 100755
index 6d2810a..0000000
--- a/vid-app-common/src/main/java/org/openecomp/vid/dao/FnAppDoaImpl.java
+++ /dev/null
@@ -1,112 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * VID
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *      http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.vid.dao;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.URI;
-import java.net.URL;
-import java.sql.Connection;
-import java.sql.DriverManager;
-import java.sql.PreparedStatement;
-import java.sql.ResultSet;
-import java.sql.SQLException;
-import java.util.Properties;
-
-import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
-
-
-public class FnAppDoaImpl {
-
-	/** The logger. */
-	static EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(FnAppDoaImpl.class);
-		
-		public int getProfileCount(String driver, String URL, String username, String password) {
-			Connection dbc = null;
-			PreparedStatement pst = null;
-			ResultSet rs = null;
-			String q = null;
-			int count = 0;
-			try {
-				 	dbc = getConnection(driver,URL,username,password);
-				   logger.debug(EELFLoggerDelegate.debugLogger, "getConnection:::"+ dbc);
-				q = "select count(*) from fn_app";
-					pst = dbc.prepareStatement(q);
-					rs = pst.executeQuery();
-					
-					if (rs.next())
-						count = rs.getInt(1);
-			} catch(Exception ex) {
-				logger.error(EELFLoggerDelegate.errorLogger, "Failed to perform health check", ex);
-			} finally {
-				cleanup(rs,pst,dbc);
-			}
-			logger.debug(EELFLoggerDelegate.debugLogger, "count:::"+ count);
-			return count;
-		}
-
-		public static Connection getConnection(String driver2, String url, String username, String password) throws IOException, SQLException, ClassNotFoundException{
-			java.sql.Connection con=null;
-		
-			if( url!=null && username!=null && password!=null ){
-			    con = DriverManager.getConnection(url, username, password);
-			}
-			
-			   System.out.println("Connection Successful");		    	
-			return con;
-			
-		}
-		
-		public static void cleanup(ResultSet rs, PreparedStatement st, Connection c) {
-			if (rs != null) {
-				try {
-					rs.close();
-				} catch (Exception e) {
-					if (logger != null)
-						logger.error("Error when trying to close result set", e);
-				}
-			}
-			if (st != null) {
-				try {
-					st.close();
-				} catch (Exception e) {
-					if (logger != null)
-						logger.error("Error when trying to close statement", e);
-				}
-			}
-			if (c != null) {
-				try {
-					c.rollback();
-				} catch (Exception e) {
-					if (logger != null)
-						logger.error("Error when trying to rollback connection", e);
-				}
-				try {
-					c.close();
-				} catch (Exception e) {
-					if (logger != null)
-						logger.error("Error when trying to close connection", e);
-				}
-			}
-		}
-}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/dao/ProfileDao.java b/vid-app-common/src/main/java/org/openecomp/vid/dao/ProfileDao.java
deleted file mode 100755
index 256a4bd..0000000
--- a/vid-app-common/src/main/java/org/openecomp/vid/dao/ProfileDao.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * VID
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *      http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.vid.dao;
-
-import java.util.List;
-import org.openecomp.portalsdk.core.domain.Profile;
-
-/**
- * The Interface ProfileDao.
- */
-public interface ProfileDao {
-	
-	/**
-	 * Find all.
-	 *
-	 * @return the list
-	 */
-	List<Profile> findAll();
-	
-	/**
-	 * Gets the profile.
-	 *
-	 * @param id the id
-	 * @return the profile
-	 */
-	Profile getProfile(int id);
-}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/exceptions/VidServiceUnavailableException.java b/vid-app-common/src/main/java/org/openecomp/vid/exceptions/VidServiceUnavailableException.java
deleted file mode 100755
index fcd897f..0000000
--- a/vid-app-common/src/main/java/org/openecomp/vid/exceptions/VidServiceUnavailableException.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * VID
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *      http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.vid.exceptions;
-
-import org.springframework.http.HttpStatus;
-import org.springframework.web.bind.annotation.ResponseStatus;
-
-/**
- * The Class VidServiceUnavailableException.
- */
-@ResponseStatus(value=HttpStatus.SERVICE_UNAVAILABLE)
-public class VidServiceUnavailableException extends Exception {
-
-	/** The Constant serialVersionUID. */
-	private static final long serialVersionUID = 1L;
-
-	/**
-	 * Instantiates a new vid service unavailable exception.
-	 */
-	public VidServiceUnavailableException() {
-		super();
-	}
-	
-	/**
-	 * Instantiates a new vid service unavailable exception.
-	 *
-	 * @param msg the msg
-	 */
-	public VidServiceUnavailableException(String msg) {
-		super(msg);
-	}
-	
-	/**
-	 * Instantiates a new vid service unavailable exception.
-	 *
-	 * @param t the t
-	 */
-	public VidServiceUnavailableException(Throwable t) {
-		super(t);
-	}
-	
-	/**
-	 * Instantiates a new vid service unavailable exception.
-	 *
-	 * @param msg the msg
-	 * @param t the t
-	 */
-	public VidServiceUnavailableException(String msg, Throwable t) {
-		super(msg, t);
-	}
-}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/factories/MsoRequestFactory.java b/vid-app-common/src/main/java/org/openecomp/vid/factories/MsoRequestFactory.java
deleted file mode 100644
index 9cc9c5f..0000000
--- a/vid-app-common/src/main/java/org/openecomp/vid/factories/MsoRequestFactory.java
+++ /dev/null
@@ -1,15 +0,0 @@
-package org.openecomp.vid.factories;
-
-import org.openecomp.vid.mso.rest.RequestDetails;
-
-/**
- * Created by pickjonathan on 19/06/2017.
- */
-public class MsoRequestFactory {
-
-    public RequestDetails createMsoRequest(String path)
-    {
-        return null;
-    }
-
-}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/model/CommandProperty.java b/vid-app-common/src/main/java/org/openecomp/vid/model/CommandProperty.java
deleted file mode 100755
index 740f9d7..0000000
--- a/vid-app-common/src/main/java/org/openecomp/vid/model/CommandProperty.java
+++ /dev/null
@@ -1,93 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * VID
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *      http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.vid.model;
-
-import java.util.Map;
-
-/**
- * The Class Command Property.
- */
-public class CommandProperty {
-	
-	/** The display name for this input */
-	private String displayName;
-	
-	/** The command, "get_input" */
-	private String command;
-	
-	/** The input name we refer to back under the inputs section */
-	private String inputName;
-
-	/**
-	 * Gets the display name.
-	 *
-	 * @return the displayName
-	 */
-	public String getDisplayName() {
-		return displayName;
-	}
-	/**
-	 * Gets the command.
-	 *
-	 * @return the command
-	 */
-	public String getCommand() {
-		return command;
-	}
-	/**
-	 * Gets the inputName.
-	 *
-	 * @return the inputName
-	 */
-	public String getInputName() {
-		return inputName;
-	}
-	/**
-	 * Sets the display name value.
-	 *
-	 * @param i the new get_input value
-	 */
-	public void setDisplayName(String i) {
-		this.displayName = i;
-	}
-	/**
-	 * Sets the command value.
-	 *
-	 * @param i the new command value
-	 */
-	public void setCommand(String i) {
-		this.command = i;
-	}
-	
-	/**
-	 * Sets the input name value.
-	 *
-	 * @param i the new input name value
-	 */
-	public void setInputName(String i) {
-		this.inputName=i;
-	}
-	
-	public String toString () {
-		String result = "displayName=" + displayName + " command=" + command + " inputName" + inputName;
-		return result;
-	}
-}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/model/ExceptionResponse.java b/vid-app-common/src/main/java/org/openecomp/vid/model/ExceptionResponse.java
deleted file mode 100755
index 686971d..0000000
--- a/vid-app-common/src/main/java/org/openecomp/vid/model/ExceptionResponse.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * VID
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *      http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.vid.model;
-
-/**
- * The Class ExceptionResponse.
- */
-public class ExceptionResponse {
-
-	/** The exception. */
-	private String exception;
-	
-	/** The message. */
-	private String message;
-
-	/**
-	 * Gets the exception.
-	 *
-	 * @return the exception
-	 */
-	public String getException() {
-		return exception;
-	}
-
-	/**
-	 * Sets the exception.
-	 *
-	 * @param exception the new exception
-	 */
-	public void setException(String exception) {
-		this.exception = exception;
-	}
-
-	/**
-	 * Gets the message.
-	 *
-	 * @return the message
-	 */
-	public String getMessage() {
-		return message;
-	}
-
-	/**
-	 * Sets the message.
-	 *
-	 * @param message the new message
-	 */
-	public void setMessage(String message) {
-		this.message = message;
-	}
-
-}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/model/ModelConstants.java b/vid-app-common/src/main/java/org/openecomp/vid/model/ModelConstants.java
deleted file mode 100755
index af5f0db..0000000
--- a/vid-app-common/src/main/java/org/openecomp/vid/model/ModelConstants.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * VID
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *      http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.vid.model;
-/**
- * The Class ModelConstants
- */
-public class ModelConstants {
-	
-	/** The Constant GET_INPUT_TAG. */
-	public final static String GET_INPUT_TAG = "get_input";
-	
-	public static final String ASDC_MODEL_NAMESPACE = "asdc.model.namespace";
-	public static final String ASDC_SVC_API_PATH = "sdc.svc.api.path";
-	public static final String ASDC_RESOURCE_API_PATH = "sdc.resource.api.path";
-	
-	public static final String DEFAULT_ASDC_MODEL_NAMESPACE = "org.openecomp.";
-	public static final String DEFAULT_ASDC_SVC_API_PATH = "sdc/v1/catalog/services";
-	public static final String DEFAULT_ASDC_RESOURCE_API_PATH = "sdc/v1/catalog/resources";
-	
-	public final static String VF_MODULE = "groups.VfModule";
-	public final static String VNF = "resource.vf";
-	public final static String NETWORK = "resource.vl";
-	
-}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/model/ModelUtil.java b/vid-app-common/src/main/java/org/openecomp/vid/model/ModelUtil.java
deleted file mode 100644
index f020818..0000000
--- a/vid-app-common/src/main/java/org/openecomp/vid/model/ModelUtil.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/**
- * 
- */
-package org.openecomp.vid.model;
-
-/**
- * The Class ModelUtil.
- *
- */
-public class ModelUtil {
-	/**
-	 * Gets the tags for the given element according to the configured namespace
-	 * @param namespaces the namespace list from the configuration
-	 * @param constantValue the constant portion of the tag name, i.e. resource.vf...
-	 * @return the tags
-	 */
-	public static String[] getTags ( String[] namespaces, String constantValue ) {
-		String[] tags;
-		if ( namespaces == null || namespaces.length == 0 ) {
-			return null;
-		}
-		int le = namespaces.length;
-		tags = new String[le];
-		for ( int i = 0; i < le; i++ ) {
-			tags[i] = namespaces[i] + constantValue;
-		}
-		return (tags);
-	}
-	/**
-	 * Determine if a note template type matches a set of configurable tags
-	 * @param type the node template type
-	 * @param tags the model configurable namespaces
-	 * @return true if type starts with a tag in the array, false otherwise
-	 */
-	public static boolean isType ( String type, String[] tags ) {
-		if ( (tags != null) && (tags.length > 0) ) {
-			for ( int i = 0; i < tags.length; i++ ) {
-				if ( type.startsWith (tags[i]) ) {
-					return (true);
-				}
-			}
-		}
-		return (false);
-	}
-}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/model/Network.java b/vid-app-common/src/main/java/org/openecomp/vid/model/Network.java
deleted file mode 100755
index e763496..0000000
--- a/vid-app-common/src/main/java/org/openecomp/vid/model/Network.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * VID
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *      http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.vid.model;
-
-import org.openecomp.vid.asdc.beans.tosca.NodeTemplate;
-
-/**
- * The Class Network.
- */
-public class Network extends Node {
-	
-	/** The model customization name. */
-	private String modelCustomizationName;
-	
-	/**
-	 * Instantiates a new network.
-	 */
-	public Network() {
-		super();
-	}
-	/**
-	 * Gets the model customization name.
-	 *
-	 * @return the model customization name
-	 */
-	public String getModelCustomizationName() {
-		return modelCustomizationName;
-	}
-	/**
-	 * Sets the model customization name.
-	 *
-	 * @param modelCustomizationName the new model customization name
-	 */
-	public void setModelCustomizationName(String modelCustomizationName) {
-		this.modelCustomizationName = modelCustomizationName;
-	}
-	
-	public void extractNetwork(String modelCustomizationName, NodeTemplate nodeTemplate) {
-		
-		super.extractNode(nodeTemplate);	
-		setModelCustomizationName(modelCustomizationName);
-		
-	}
-}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/model/NewNetwork.java b/vid-app-common/src/main/java/org/openecomp/vid/model/NewNetwork.java
deleted file mode 100644
index 48e3a55..0000000
--- a/vid-app-common/src/main/java/org/openecomp/vid/model/NewNetwork.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * VID
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *      http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.vid.model;
-
-import org.openecomp.vid.asdc.beans.tosca.NodeTemplate;
-
-/**
- * The Class Network.
- */
-public class NewNetwork extends NewNode {
-
-	/** The model customization name. */
-	private String modelCustomizationName;
-
-	/**
-	 * Instantiates a new network.
-	 */
-	public NewNetwork() {
-		super();
-	}
-	/**
-	 * Gets the model customization name.
-	 *
-	 * @return the model customization name
-	 */
-	public String getModelCustomizationName() {
-		return modelCustomizationName;
-	}
-	/**
-	 * Sets the model customization name.
-	 *
-	 * @param modelCustomizationName the new model customization name
-	 */
-	public void setModelCustomizationName(String modelCustomizationName) {
-		this.modelCustomizationName = modelCustomizationName;
-	}
-	
-}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/model/NewNode.java b/vid-app-common/src/main/java/org/openecomp/vid/model/NewNode.java
deleted file mode 100644
index 681131f..0000000
--- a/vid-app-common/src/main/java/org/openecomp/vid/model/NewNode.java
+++ /dev/null
@@ -1,209 +0,0 @@
-package org.openecomp.vid.model;
-
-import java.text.DateFormat;
-import java.text.SimpleDateFormat;
-import java.util.HashMap;
-import java.util.Map;
-
-import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
-import org.openecomp.vid.asdc.beans.tosca.Input;
-
-
-public class NewNode {
-	
-	/** The Constant LOG. */
-	private static final EELFLoggerDelegate LOG = EELFLoggerDelegate.getLogger(Node.class);
-	
-	/** The Constant dateFormat. */
-	final static DateFormat dateFormat = new SimpleDateFormat("HH:mm:ss:SSSS");
-
-	/** The uuid. */
-	private String uuid;
-	
-	/** The invariant uuid. */
-	private String invariantUuid;
-	
-	/** The description. */
-	private String description;
-	
-	/** The name. */
-	private String name;
-	
-	/** The version. */
-	private String version;
-	
-	/** The model customization uuid. */
-	private String customizationUuid;
-	
-	/** The inputs. */
-	private Map<String, Input> inputs;
-	
-	/** The get_input or other constructs from node template properties. */
-	private Map<String, CommandProperty> commands;
-	
-	/** The get_input or other constructs from node template properties. */
-	private Map<String, String> properties;
-	/**
-	 * Instantiates a new node.
-	 */
-	public NewNode() {
-		this.commands = new HashMap<String, CommandProperty>();
-		this.properties = new HashMap<String, String>();
-	}
-	
-	/**
-	 * Gets the uuid.
-	 *
-	 * @return the uuid
-	 */
-	public String getUuid() {
-		return uuid;
-	}
-
-	/**
-	 * Gets the invariant uuid.
-	 *
-	 * @return the invariant uuid
-	 */
-	public String getInvariantUuid() {
-		return invariantUuid;
-	}
-
-	/**
-	 * Gets the description.
-	 *
-	 * @return the description
-	 */
-	public String getDescription() {
-		return description;
-	}
-
-	/**
-	 * Gets the name.
-	 *
-	 * @return the name
-	 */
-	public String getName() {
-		return name;
-	}
-
-	/**
-	 * Gets the version.
-	 *
-	 * @return the version
-	 */
-	public String getVersion() {
-		return version;
-	}
-	
-	/**
-	 * Gets the customization uuid.
-	 *
-	 * @return the model customization uuid
-	 */
-	public String getCustomizationUuid() {
-		return customizationUuid;
-	}
-	/**
-	 * Gets the inputs.
-	 *
-	 * @return the inputs
-	 */
-	public Map<String, Input> getInputs() {
-		return inputs;
-	}
-	/**
-	 * Gets the commands.
-	 *
-	 * @return the commands
-	 */
-	public Map<String, CommandProperty> getCommands() {
-		return commands;
-	}
-	/**
-	 * Gets the properties.
-	 *
-	 * @return the properties
-	 */
-	public Map<String, String> getProperties() {
-		return properties;
-	}
-	/**
-	 * Sets the uuid.
-	 *
-	 * @param uuid the new uuid
-	 */
-	public void setUuid(String uuid) {
-		this.uuid = uuid;
-	}
-
-	/**
-	 * Sets the invariant uuid.
-	 *
-	 * @param invariantUuid the new invariant uuid
-	 */
-	public void setInvariantUuid(String invariantUuid) {
-		this.invariantUuid = invariantUuid;
-	}
-
-	/**
-	 * Sets the description.
-	 *
-	 * @param description the new description
-	 */
-	public void setDescription(String description) {
-		this.description = description;
-	}
-
-	/**
-	 * Sets the name.
-	 *
-	 * @param name the new name
-	 */
-	public void setName(String name) {
-		this.name = name;
-	}
-
-	/**
-	 * Sets the version.
-	 *
-	 * @param version the new version
-	 */
-	public void setVersion(String version) {
-		this.version = version;
-	}
-	/**
-	 * Sets the customization uuid.
-	 *
-	 * @param u the new customization uuid
-	 */
-	public void setCustomizationUuid(String u) {
-		this.customizationUuid = u;
-	}
-
-	/**
-	 * Sets the inputs.
-	 *
-	 * @param inputs the inputs
-	 */
-	public void setInputs(Map<String, Input> inputs) {
-		this.inputs = inputs;
-	}
-	/**
-	 * Sets the commands.
-	 *
-	 * @param m the commands
-	 */
-	public void setCommands( Map<String, CommandProperty>m ) {
-		commands = m;
-	}
-	/**
-	 * Sets the properties.
-	 *
-	 * @param p the properties
-	 */
-	public void setProperties( Map<String, String>p) {
-		properties = p;
-	}
-
-}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/model/NewService.java b/vid-app-common/src/main/java/org/openecomp/vid/model/NewService.java
deleted file mode 100644
index 1dcf022..0000000
--- a/vid-app-common/src/main/java/org/openecomp/vid/model/NewService.java
+++ /dev/null
@@ -1,252 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * VID
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *      http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.vid.model;
-
-import java.util.Map;
-import java.util.UUID;
-
-import org.openecomp.vid.asdc.beans.tosca.Input;
-
-/**
- * The Class Service.
- */
-public class NewService {
-
-	/** The uuid. */
-	private String uuid;
-	
-	/** The invariant uuid. */
-	private String invariantUuid;
-	
-	/** The name. */
-	private String name;
-	
-	/** The version. */
-	private String version;
-	
-	/** The tosca model URL. */
-	private String toscaModelURL;
-	
-	/** The category. */
-	private String category;
-	
-	/** The description. */
-	private String description;
-	
-	/** The service ecomp naming flag */
-	private String serviceEcompNaming;
-	
-	/** The inputs. */
-	private Map<String, Input> inputs;
-	
-	/**
-	 * Gets the uuid.
-	 *
-	 * @return the uuid
-	 */
-	public String getUuid() {
-		return uuid;
-	}
-	
-	/**
-	 * Gets the invariant uuid.
-	 *
-	 * @return the invariant uuid
-	 */
-	public String getInvariantUuid() {
-		return invariantUuid;
-	}
-	
-	/**
-	 * Gets the name.
-	 *
-	 * @return the name
-	 */
-	public String getName() {
-		return name;
-	}
-	
-	/**
-	 * Gets the version.
-	 *
-	 * @return the version
-	 */
-	public String getVersion() {
-		return version;
-	}
-	
-	/**
-	 * Gets the tosca model URL.
-	 *
-	 * @return the tosca model URL
-	 */
-	public String getToscaModelURL() {
-		return toscaModelURL;
-	}
-	
-	/**
-	 * Gets the category.
-	 *
-	 * @return the category
-	 */
-	public String getCategory() {
-		return category;
-	}
-	
-	/**
-	 * Gets the description.
-	 *
-	 * @return the description
-	 */
-	public String getDescription() {
-		return description;
-	}
-	
-	/**
-	 * Gets the inputs.
-	 *
-	 * @return the inputs
-	 */
-	public Map<String, Input> getInputs() {
-		return inputs;
-	}
-	/**
-	 * Get the serviceEcompNaming value
-	 *
-	 * @return serviceEcompNaming
-	 */
-	public String getServiceEcompNaming() {
-		return serviceEcompNaming;
-	} 
-	/**
-	 * Sets the uuid.
-	 *
-	 * @param uuid the new uuid
-	 */
-	public void setUuid(String uuid) {
-		this.uuid = uuid;
-	}
-	
-	/**
-	 * Sets the invariant uuid.
-	 *
-	 * @param invariantUuid the new invariant uuid
-	 */
-	public void setInvariantUuid(String invariantUuid) {
-		this.invariantUuid = invariantUuid;
-	}
-	
-	/**
-	 * Sets the name.
-	 *
-	 * @param name the new name
-	 */
-	public void setName(String name) {
-		this.name = name;
-	}
-	
-	/**
-	 * Sets the version.
-	 *
-	 * @param version the new version
-	 */
-	public void setVersion(String version) {
-		this.version = version;
-	}
-	
-	/**
-	 * Sets the tosca model URL.
-	 *
-	 * @param toscaModelURL the new tosca model URL
-	 */
-	public void setToscaModelURL(String toscaModelURL) {
-		this.toscaModelURL = toscaModelURL;
-	}
-	
-	/**
-	 * Sets the category.
-	 *
-	 * @param category the new category
-	 */
-	public void setCategory(String category) {
-		this.category = category;
-	}
-	
-	/**
-	 * Sets the description.
-	 *
-	 * @param description the new description
-	 */
-	public void setDescription(String description) {
-		this.description = description;
-	}
-	
-	/**
-	 * Sets the inputs.
-	 *
-	 * @param inputs the inputs
-	 */
-	public void setInputs(Map<String, Input> inputs) {
-		this.inputs = inputs;
-	}
-	/**
-	 * Sets the service ecomp naming.
-	 *
-	 * @param serviceEcompNaming the new service ecomp naming
-	 */
-	public void setServiceEcompNaming(String serviceEcompNaming) {
-		this.serviceEcompNaming = serviceEcompNaming;
-	}
-	/* (non-Javadoc)
-	 * @see java.lang.Object#hashCode()
-	 */
-	@Override
-	public int hashCode() {
-		final UUID uuid = UUID.fromString(getUuid());
-		
-		return uuid.hashCode();
-	}
-	
-	/* (non-Javadoc)
-	 * @see java.lang.Object#equals(java.lang.Object)
-	 */
-	@Override
-	public boolean equals(Object o) {
-		if (o == this) return true;
-		if (!(o instanceof NewService)) return false;
-		
-		final NewService service = (NewService) o;
-		
-		return (service.getUuid().equals(getUuid()));
-	}
-	/*public static void extractVfModuleCustomizationUUID (Service s, String vnfCustomizationName, VfModule vfMod ) {
-		
-		//Look for vnfCustomizationName..vfModuleCustomizationName
-		String nameToFind = vnfCustomizationName + ".." + vfMod.getModelCustomizationName();
-		for (Entry<UUID, VfModule> vfModuleComponent : s.getVfModules().entrySet()) {
-			VfModule xMod = vfModuleComponent.getValue();
-			if ( (xMod.getModelCustomizationName() != null) && (xMod.getModelCustomizationName().equalsIgnoreCase(nameToFind)) ) {
-				vfMod.setCustomizationUuid( xMod.getCustomizationUuid());
-				return;
-			}
-		}
-	}*/
-}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/model/NewServiceModel.java b/vid-app-common/src/main/java/org/openecomp/vid/model/NewServiceModel.java
deleted file mode 100644
index 6fda979..0000000
--- a/vid-app-common/src/main/java/org/openecomp/vid/model/NewServiceModel.java
+++ /dev/null
@@ -1,259 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * VID
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *      http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.vid.model;
-
-import java.text.DateFormat;
-import java.text.SimpleDateFormat;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Map.Entry;
-
-import org.openecomp.vid.asdc.beans.tosca.Group;
-import org.openecomp.vid.asdc.beans.tosca.ToscaModel;
-import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
-import org.openecomp.vid.properties.VidProperties;
-/**
- * The Class ServiceModel.
- */
-public class NewServiceModel {
-
-	/** The Constant LOG. */
-	private static final EELFLoggerDelegate LOG = EELFLoggerDelegate.getLogger(NewServiceModel.class);
-	
-	/** The Constant dateFormat. */
-	final static DateFormat dateFormat = new SimpleDateFormat("HH:mm:ss:SSSS");
-	/** The service. */
-	private Service service;
-	
-	/** The vnfs. */
-	private Map<String, VNF> vnfs;
-	
-	/** The networks. */
-	private Map<String, Network> networks;
-
-	/** 
-	 * The vf modules. The VNF also has vfmodules but the vfmodules at the service level may have additional info
-	 * that is not present in the VNF, like the vf module customization String 
-	 */
-	private Map<String, VfModule> vfModules;
-	/**
-	 * The volume groups. The VNF also has volume groups but the volume groups will be populated at the service level
-	 * for newer models
-	 */
-	private Map<String, VolumeGroup> volumeGroups;
-	/**
-	 * Instantiates a new service model.
-	 */
-	public NewServiceModel() {}
-	
-	/**
-	 * Gets the service.
-	 *
-	 * @return the service
-	 */
-	public Service getService() {
-		return service;
-	}
-
-	/**
-	 * Gets the vnfs.
-	 *
-	 * @return the vnfs
-	 */
-	public Map<String, VNF> getVnfs() {
-		return vnfs;
-	}
-
-	/**
-	 * Gets the networks.
-	 *
-	 * @return the networks
-	 */
-	public Map<String, Network> getNetworks() {
-		return networks;
-	}
-
-	/**
-	 * Sets the service.
-	 *
-	 * @param service the new service
-	 */
-	public void setService(Service service) {
-		this.service = service;
-	}
-
-	/**
-	 * Sets the vnfs.
-	 *
-	 * @param vnfs the vnfs
-	 */
-	public void setVnfs(Map<String, VNF> vnfs) {
-		this.vnfs = vnfs;
-	}
-
-	/**
-	 * Sets the networks.
-	 *
-	 * @param networks the networks
-	 */
-	public void setNetworks(Map<String, Network> networks) {
-		this.networks = networks;
-	}
-	/**
-	 * Gets the vf modules.
-	 *
-	 * @return the vf modules
-	 */
-	public Map<String, VfModule> getVfModules() {
-		return vfModules;
-	}
-	/**
-	 * Gets the volume groups.
-	 *
-	 * @return the volume groups
-	 */
-	public Map<String, VolumeGroup> getVolumeGroups() {
-		return volumeGroups;
-	}
-	/**
-	 * Sets the vf modules.
-	 *
-	 * @param vfModules the vf modules
-	 */
-	public void setVfModules(Map<String, VfModule> vfModules) {
-		this.vfModules = vfModules;
-	}
-	/**
-	 * Sets the volume groups.
-	 *
-	 * @param volumeGroups the volume groups
-	 */
-	public void setVolumeGroups(Map<String, VolumeGroup> volumeGroups) {
-		this.volumeGroups = volumeGroups;
-	}
-	/**
-	 * Extract service.
-	 *
-	 * @param serviceToscaModel the service tosca model
-	 * @param asdcServiceMetadata the asdc service metadata
-	 * @return the service
-	 */
-	public static Service extractService(ToscaModel serviceToscaModel, org.openecomp.vid.asdc.beans.Service asdcServiceMetadata) {
-		
-		final Service service = new Service();
-		
-		service.setCategory(serviceToscaModel.getMetadata().getCategory());
-		service.setInvariantUuid(serviceToscaModel.getMetadata().getInvariantUUID());
-		service.setName(serviceToscaModel.getMetadata().getName());
-		service.setUuid(serviceToscaModel.getMetadata().getUUID());
-		service.setDescription(serviceToscaModel.getMetadata().getDescription());
-		service.setServiceEcompNaming(serviceToscaModel.getMetadata().getServiceEcompNaming());
-		service.setInputs(serviceToscaModel.gettopology_template().getInputs());
-		//FIXME: SDC is not sending the Version with the Tosca Model for 1610 - they should send it in 1702
-		//THIS IS A TEMPORARY FIX, AT SOME POINT UNCOMMENT ME
-		//service.setVersion(serviceToscaModel.getMetadata().getVersion());
-		service.setVersion(asdcServiceMetadata.getVersion());
-
-		return service;
-	}
-	public static void extractGroups (ToscaModel serviceToscaModel,NewServiceModel serviceModel) {
-		// Get the groups. The groups may duplicate the groups that are in the VNF model and have
-		// additional data like the VF module customization String>
-		
-		final Map<String, VfModule> vfModules = new HashMap<String, VfModule> ();
-		final Map<String, VolumeGroup> volumeGroups = new HashMap<String, VolumeGroup> ();
-		
-		String asdcModelNamespace = VidProperties.getAsdcModelNamespace();
-    	String vfModuleTag = asdcModelNamespace + ModelConstants.VF_MODULE;
-    	
-		for (Entry<String, Group> component : serviceToscaModel.gettopology_template().getGroups().entrySet()) {
-			final Group group = component.getValue();
-			final String type = group.getType();
-			final String customizationName = component.getKey();
-			
-			if (type.startsWith(vfModuleTag)) {
-				VfModule vfMod = VfModule.extractVfModule(customizationName, group);
-				vfModules.put(customizationName, vfMod);
-				if ( vfMod.isVolumeGroupAllowed() ) {
-					//volume groups have the same customization name as the vf module
-					volumeGroups.put(customizationName, VolumeGroup.extractVolumeGroup(customizationName,group));
-				}
-			}
-		}
-		// add this point vfModules and volume groups are disconnected from VNF
-		serviceModel.setVfModules (vfModules);
-		serviceModel.setVolumeGroups (volumeGroups);
-		
-	}
-	/**
-	 * Populate the vf modules and volume groups that we may have under the service level under each VNF.
-	 */
-//	public void associateGroups() {
-//		String methodName = "associateGroups()";
-//        LOG.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + methodName + " start");
-//		// go through the vnfs, get the vnf normalized name and look for a vf module with a customization name that starts
-//		// with vnf + ".."
-//		String vnfCustomizationName = null;
-//		String normalizedVnfCustomizationName = null;
-//		String vfModuleCustomizationName = null;
-//		NewVNF tmpVnf = null;
-//
-//		if ( ( getVnfs() != null ) && (!(getVnfs().isEmpty())) ) {
-//			for (Entry<String, NewVNF> vnfComponent : getVnfs().entrySet()) {
-//				vnfCustomizationName = vnfComponent.getValue().getModelCustomizationName();
-//				normalizedVnfCustomizationName = VNF.normalizeName(vnfCustomizationName);
-//
-//				LOG.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + methodName +
-//						" VNF customizationName=" + vnfCustomizationName + "normalized customization name=" + normalizedVnfCustomizationName);
-//
-//				// now check to see if there is a vf module with customization name that starts with normalizedVnfCustomizationName
-//
-//				if (( getVfModules() != null ) && (!(getVfModules().isEmpty()))) {
-//					for (Entry<String, VfModule> vfModuleComponent : getVfModules().entrySet()) {
-//						vfModuleCustomizationName = vfModuleComponent.getValue().getModelCustomizationName();
-//
-//						LOG.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + methodName +
-//								" VF Module customizationName=" + vfModuleCustomizationName );
-//						if ( vfModuleCustomizationName.startsWith(normalizedVnfCustomizationName + ".." )) {
-//
-//							// this vf module belongs to the VNF
-//							tmpVnf = vnfComponent.getValue();
-//							(tmpVnf.getVfModules()).put(vfModuleComponent.getKey(), vfModuleComponent.getValue());
-//
-//							LOG.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + methodName +
-//									" Associated VF Module customizationName=" + vfModuleComponent.getKey() + " with VNF customization name=" + vnfCustomizationName);
-//
-//							// now find if this vf module has volume groups, if so, find the volume group with the same customization name and put it under the VNF
-//							if ( vfModuleComponent.getValue().isVolumeGroupAllowed() ) {
-//								if (( getVolumeGroups() != null ) && (!(getVolumeGroups().isEmpty()))) {
-//									if (getVolumeGroups().containsKey((vfModuleCustomizationName))) {
-//										(vnfComponent.getValue().getVolumeGroups()).put(vfModuleCustomizationName, (getVolumeGroups()).get(vfModuleCustomizationName));
-//									}
-//								}
-//							}
-//						}
-//					}
-//				}
-//			}
-//		}
-		
-//	}
-}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/model/NewVNF.java b/vid-app-common/src/main/java/org/openecomp/vid/model/NewVNF.java
deleted file mode 100644
index e84f963..0000000
--- a/vid-app-common/src/main/java/org/openecomp/vid/model/NewVNF.java
+++ /dev/null
@@ -1,123 +0,0 @@
-package org.openecomp.vid.model;
-
-import java.text.DateFormat;
-import java.text.SimpleDateFormat;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.regex.Pattern;
-
-import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
-import org.openecomp.vid.asdc.beans.tosca.NodeTemplate;
-
-public class NewVNF extends NewNode {
-	
-	/** The Constant LOG. */
-	private static final EELFLoggerDelegate LOG = EELFLoggerDelegate.getLogger(VNF.class);
-	
-	/** The Constant dateFormat. */
-	final static DateFormat dateFormat = new SimpleDateFormat("HH:mm:ss:SSSS");
-
-	/** The pattern used to normalize VNF names */
-	final static Pattern COMPONENT_INSTANCE_NAME_DELIMETER_PATTERN = Pattern.compile("[\\.\\-]+");
-	
-	/** The model customization name. */
-	private String modelCustomizationName;
-	
-	/** The vf modules. */
-	private Map<String, VfModule> vfModules = new HashMap<String, VfModule>();
-	
-	/** The volume groups. */
-	private Map<String, VolumeGroup> volumeGroups = new HashMap<String, VolumeGroup>();
-	
-	/**
-	 * Instantiates a newvnf.
-	 */
-	public NewVNF() {
-		super();
-	}
-
-	/**
-	 * Gets the model customization name.
-	 *
-	 * @return the model customization name
-	 */
-	public String getModelCustomizationName() {
-		return modelCustomizationName;
-	}
-
-	/**
-	 * Gets the vf modules.
-	 *
-	 * @return the vf modules
-	 */
-	public Map<String, VfModule> getVfModules() {
-		return vfModules;
-	}
-
-	/**
-	 * Sets the vf modules.
-	 *
-	 * @param vfModules the vf modules
-	 */
-	public void setVfModules(Map<String, VfModule> vfModules) {
-		this.vfModules = vfModules;
-	}
-
-	/**
-	 * Gets the volume groups.
-	 *
-	 * @return the volume groups
-	 */
-	public Map<String, VolumeGroup> getVolumeGroups() {
-		return volumeGroups;
-	}
-
-	/**
-	 * Sets the volume groups.
-	 *
-	 * @param volumeGroups the volume groups
-	 */
-	public void setVolumeGroups(Map<String, VolumeGroup> volumeGroups) {
-		this.volumeGroups = volumeGroups;
-	}
-
-
-	/**
-	 * Sets the model customization name.
-	 *
-	 * @param modelCustomizationName the new model customization name
-	 */
-	public void setModelCustomizationName(String modelCustomizationName) {
-		this.modelCustomizationName = modelCustomizationName;
-	}
-	/**
-	 * Normalize the VNF name
-	 * @param originalName
-	 * @return the normalized name
-	 */
-	public static String normalizeName (String originalName) {
-
-		String normalizedName = originalName.toLowerCase();
-		normalizedName = COMPONENT_INSTANCE_NAME_DELIMETER_PATTERN.matcher(normalizedName).replaceAll(" ");
-		String[] splitArr = null;
-		
-		try {
-			splitArr = normalizedName.split(" ");
-		}
-		catch (Exception ex ) {
-			return (normalizedName);
-		}
-		StringBuffer sb = new StringBuffer();
-		if ( splitArr != null ) {
-			for (String splitElement : splitArr) {
-				sb.append(splitElement);
-			}
-			return (sb.toString());
-		}
-		else {
-			return (normalizedName);
-		}
-		
-	}
-
-}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/model/Node.java b/vid-app-common/src/main/java/org/openecomp/vid/model/Node.java
deleted file mode 100755
index 1352653..0000000
--- a/vid-app-common/src/main/java/org/openecomp/vid/model/Node.java
+++ /dev/null
@@ -1,301 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * VID
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *      http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.vid.model;
-
-import java.text.DateFormat;
-import java.text.SimpleDateFormat;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Map.Entry;
-
-import org.openecomp.vid.asdc.beans.tosca.Input;
-import org.openecomp.vid.asdc.beans.tosca.NodeTemplate;
-
-import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
-/**
- * The Class Node.
- */
-public class Node {
-	/** The Constant LOG. */
-	private static final EELFLoggerDelegate LOG = EELFLoggerDelegate.getLogger(Node.class);
-	
-	/** The Constant dateFormat. */
-	final static DateFormat dateFormat = new SimpleDateFormat("HH:mm:ss:SSSS");
-
-	/** The uuid. */
-	private String uuid;
-	
-	/** The invariant uuid. */
-	private String invariantUuid;
-	
-	/** The description. */
-	private String description;
-	
-	/** The name. */
-	private String name;
-	
-	/** The version. */
-	private String version;
-	
-	/** The model customization uuid. */
-	private String customizationUuid;
-	
-	/** The inputs. */
-	private Map<String, Input> inputs;
-	
-	/** The get_input or other constructs from node template properties. */
-	private Map<String, CommandProperty> commands;
-	
-	/** The get_input or other constructs from node template properties. */
-	private Map<String, String> properties;
-	/**
-	 * Instantiates a new node.
-	 */
-	public Node() {
-		this.commands = new HashMap<String, CommandProperty>();
-		this.properties = new HashMap<String, String>();
-	}
-	
-	/**
-	 * Gets the uuid.
-	 *
-	 * @return the uuid
-	 */
-	public String getUuid() {
-		return uuid;
-	}
-
-	/**
-	 * Gets the invariant uuid.
-	 *
-	 * @return the invariant uuid
-	 */
-	public String getInvariantUuid() {
-		return invariantUuid;
-	}
-
-	/**
-	 * Gets the description.
-	 *
-	 * @return the description
-	 */
-	public String getDescription() {
-		return description;
-	}
-
-	/**
-	 * Gets the name.
-	 *
-	 * @return the name
-	 */
-	public String getName() {
-		return name;
-	}
-
-	/**
-	 * Gets the version.
-	 *
-	 * @return the version
-	 */
-	public String getVersion() {
-		return version;
-	}
-	
-	/**
-	 * Gets the customization uuid.
-	 *
-	 * @return the model customization uuid
-	 */
-	public String getCustomizationUuid() {
-		return customizationUuid;
-	}
-	/**
-	 * Gets the inputs.
-	 *
-	 * @return the inputs
-	 */
-	public Map<String, Input> getInputs() {
-		return inputs;
-	}
-	/**
-	 * Gets the commands.
-	 *
-	 * @return the commands
-	 */
-	public Map<String, CommandProperty> getCommands() {
-		return commands;
-	}
-	/**
-	 * Gets the properties.
-	 *
-	 * @return the properties
-	 */
-	public Map<String, String> getProperties() {
-		return properties;
-	}
-	/**
-	 * Sets the uuid.
-	 *
-	 * @param uuid the new uuid
-	 */
-	public void setUuid(String uuid) {
-		this.uuid = uuid;
-	}
-
-	/**
-	 * Sets the invariant uuid.
-	 *
-	 * @param invariantUuid the new invariant uuid
-	 */
-	public void setInvariantUuid(String invariantUuid) {
-		this.invariantUuid = invariantUuid;
-	}
-
-	/**
-	 * Sets the description.
-	 *
-	 * @param description the new description
-	 */
-	public void setDescription(String description) {
-		this.description = description;
-	}
-
-	/**
-	 * Sets the name.
-	 *
-	 * @param name the new name
-	 */
-	public void setName(String name) {
-		this.name = name;
-	}
-
-	/**
-	 * Sets the version.
-	 *
-	 * @param version the new version
-	 */
-	public void setVersion(String version) {
-		this.version = version;
-	}
-	/**
-	 * Sets the customization uuid.
-	 *
-	 * @param u the new customization uuid
-	 */
-	public void setCustomizationUuid(String u) {
-		this.customizationUuid = u;
-	}
-
-	/**
-	 * Sets the inputs.
-	 *
-	 * @param inputs the inputs
-	 */
-	public void setInputs(Map<String, Input> inputs) {
-		this.inputs = inputs;
-	}
-	/**
-	 * Sets the commands.
-	 *
-	 * @param m the commands
-	 */
-	public void setCommands( Map<String, CommandProperty>m ) {
-		commands = m;
-	}
-	/**
-	 * Sets the properties.
-	 *
-	 * @param p the properties
-	 */
-	public void setProperties( Map<String, String>p) {
-		properties = p;
-	}
-	/**
-	 * Extract node.
-	 *
-	 * @param modelCustomizationName the model customization name
-	 * @param nodeTemplate the node template
-	 * @return the node
-	 */
-	public void extractNode (NodeTemplate nodeTemplate) {
-		
-		String methodName = "extractNode";
-		
-		setUuid(nodeTemplate.getMetadata().getUUID());
-		setInvariantUuid(nodeTemplate.getMetadata().getInvariantUUID());
-		setDescription(nodeTemplate.getMetadata().getDescription());
-		setName(nodeTemplate.getMetadata().getName());
-		setVersion(nodeTemplate.getMetadata().getVersion());
-		// add customizationUUID
-		setCustomizationUuid(nodeTemplate.getMetadata().getCustomizationUUID());
-
-		try {
-			// nodeTemplate.getProperties() map of String->Object
-			for (Entry<String, Object> e : nodeTemplate.getProperties().entrySet()) {
-				
-				String k = e.getKey();
-				
-				LOG.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + methodName + " node template property: " + k );
-				
-				if ( e.getValue() != null ) {
-					LOG.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + methodName + "  property: " + 
-							k + "=" + e.getValue());
-					//LOG.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + methodName + " V class name: " +
-					//	 e.getValue().getClass().getName());
-					Class<?> c = e.getValue().getClass();
-					if ( c.getName().equalsIgnoreCase(java.lang.String.class.getName())) {
-						getProperties().put (k, (String)e.getValue());
-					}
-					else {
-						Class<?>[] interfaces = e.getValue().getClass().getInterfaces();
-
-						for(Class<?> ifc: interfaces ) {
-							//LOG.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + methodName + " ifc name: " +
-							//	 ifc.getName());
-							if ( ifc.getName().equalsIgnoreCase(java.util.Map.class.getName()) ) {
-								// only extract get_input for now
-								@SuppressWarnings("unchecked")
-								HashMap<String,String> v = (HashMap<String,String>)e.getValue();
-								for (Entry<String, String> entry : v.entrySet()) {
-									// only include get_input for now
-									if ( ModelConstants.GET_INPUT_TAG.equalsIgnoreCase ( entry.getKey() ) ) {
-										CommandProperty cp = new CommandProperty();
-										cp.setCommand(entry.getKey());
-										cp.setInputName(entry.getValue());
-										cp.setDisplayName(k);
-										getCommands().put(k,cp);
-									}
-								}
-							}
-						}
-
-					}
-				}
-			}
-		}
-		catch ( Exception e ) {
-			LOG.error(EELFLoggerDelegate.errorLogger, dateFormat.format(new Date()) + methodName + " Unable to parse node properties: e=" + 
-					e.toString());
-		}
-	}
-
-}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/model/ProxyResponse.java b/vid-app-common/src/main/java/org/openecomp/vid/model/ProxyResponse.java
deleted file mode 100644
index 132c54a..0000000
--- a/vid-app-common/src/main/java/org/openecomp/vid/model/ProxyResponse.java
+++ /dev/null
@@ -1,21 +0,0 @@
-package org.openecomp.vid.model;
-
-/**
- * Created by Oren on 7/10/17.
- */
-public class ProxyResponse {
-
-    protected String errorMessage;
-
-    protected int httpCode;
-
-    public String getErrorMessage() {
-        return errorMessage;
-    }
-
-
-    public int getHttpCode() {
-        return httpCode;
-    }
-
-}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/model/Resource.java b/vid-app-common/src/main/java/org/openecomp/vid/model/Resource.java
deleted file mode 100755
index 4dcc975..0000000
--- a/vid-app-common/src/main/java/org/openecomp/vid/model/Resource.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * VID
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *      http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.vid.model;
-
-/**
- * The Class Resource.
- */
-public class Resource {
-
-}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/model/Result.java b/vid-app-common/src/main/java/org/openecomp/vid/model/Result.java
deleted file mode 100755
index d8bf6eb..0000000
--- a/vid-app-common/src/main/java/org/openecomp/vid/model/Result.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * VID
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *      http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.vid.model;
-
-/**
- * The Class Result.
- */
-public class Result {
-	
-	/** The result. */
-	private String result;
-	
-	/**
-	 * Instantiates a new result.
-	 *
-	 * @param result the result
-	 */
-	public Result(String result) {
-		this.result = result;
-	}
-
-	/**
-	 * Gets the result.
-	 *
-	 * @return the result
-	 */
-	public String getResult() {
-		return result;
-	}
-
-	/**
-	 * Sets the result.
-	 *
-	 * @param result the new result
-	 */
-	public void setResult(String result) {
-		this.result = result;
-	}
-	
-}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/model/Service.java b/vid-app-common/src/main/java/org/openecomp/vid/model/Service.java
deleted file mode 100755
index c6269b9..0000000
--- a/vid-app-common/src/main/java/org/openecomp/vid/model/Service.java
+++ /dev/null
@@ -1,276 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * VID
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *      http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.vid.model;
-
-import java.util.Map;
-import java.util.UUID;
-import java.util.Map.Entry;
-
-import org.openecomp.vid.asdc.beans.tosca.Input;
-
-/**
- * The Class Service.
- */
-public class Service {
-
-	/** The uuid. */
-	private String uuid;
-	
-	/** The invariant uuid. */
-	private String invariantUuid;
-	
-	/** The name. */
-	private String name;
-	
-	/** The version. */
-	private String version;
-	
-	/** The tosca model URL. */
-	private String toscaModelURL;
-	
-	/** The category. */
-	private String category;
-
-	/** The Service Type. */
-	private String serviceType;
-
-	/** The Service Role */
-	private String serviceRole;
-	
-	/** The description. */
-	private String description;
-	
-	/** The service ecomp naming flag */
-	private String serviceEcompNaming;
-	
-	/** The inputs. */
-	private Map<String, Input> inputs;
-	
-	/**
-	 * Gets the uuid.
-	 *
-	 * @return the uuid
-	 */
-	public String getUuid() {
-		return uuid;
-	}
-	
-	/**
-	 * Gets the invariant uuid.
-	 *
-	 * @return the invariant uuid
-	 */
-	public String getInvariantUuid() {
-		return invariantUuid;
-	}
-	
-	/**
-	 * Gets the name.
-	 *
-	 * @return the name
-	 */
-	public String getName() {
-		return name;
-	}
-	
-	/**
-	 * Gets the version.
-	 *
-	 * @return the version
-	 */
-	public String getVersion() {
-		return version;
-	}
-	
-	/**
-	 * Gets the tosca model URL.
-	 *
-	 * @return the tosca model URL
-	 */
-	public String getToscaModelURL() {
-		return toscaModelURL;
-	}
-	
-	/**
-	 * Gets the category.
-	 *
-	 * @return the category
-	 */
-	public String getCategory() {
-		return category;
-	}
-	
-	/**
-	 * Gets the description.
-	 *
-	 * @return the description
-	 */
-	public String getDescription() {
-		return description;
-	}
-	
-	/**
-	 * Gets the inputs.
-	 *
-	 * @return the inputs
-	 */
-	public Map<String, Input> getInputs() {
-		return inputs;
-	}
-	/**
-	 * Get the serviceEcompNaming value
-	 *
-	 * @return serviceEcompNaming
-	 */
-	public String getServiceEcompNaming() {
-		return serviceEcompNaming;
-	} 
-	/**
-	 * Sets the uuid.
-	 *
-	 * @param uuid the new uuid
-	 */
-	public void setUuid(String uuid) {
-		this.uuid = uuid;
-	}
-	
-	/**
-	 * Sets the invariant uuid.
-	 *
-	 * @param invariantUuid the new invariant uuid
-	 */
-	public void setInvariantUuid(String invariantUuid) {
-		this.invariantUuid = invariantUuid;
-	}
-	
-	/**
-	 * Sets the name.
-	 *
-	 * @param name the new name
-	 */
-	public void setName(String name) {
-		this.name = name;
-	}
-	
-	/**
-	 * Sets the version.
-	 *
-	 * @param version the new version
-	 */
-	public void setVersion(String version) {
-		this.version = version;
-	}
-	
-	/**
-	 * Sets the tosca model URL.
-	 *
-	 * @param toscaModelURL the new tosca model URL
-	 */
-	public void setToscaModelURL(String toscaModelURL) {
-		this.toscaModelURL = toscaModelURL;
-	}
-	
-	/**
-	 * Sets the category.
-	 *
-	 * @param category the new category
-	 */
-	public void setCategory(String category) {
-		this.category = category;
-	}
-	
-	/**
-	 * Sets the description.
-	 *
-	 * @param description the new description
-	 */
-	public void setDescription(String description) {
-		this.description = description;
-	}
-	
-	/**
-	 * Sets the inputs.
-	 *
-	 * @param inputs the inputs
-	 */
-	public void setInputs(Map<String, Input> inputs) {
-		this.inputs = inputs;
-	}
-	/**
-	 * Sets the service ecomp naming.
-	 *
-	 * @param serviceEcompNaming the new service ecomp naming
-	 */
-	public void setServiceEcompNaming(String serviceEcompNaming) {
-		this.serviceEcompNaming = serviceEcompNaming;
-	}
-	/* (non-Javadoc)
-	 * @see java.lang.Object#hashCode()
-	 */
-	@Override
-	public int hashCode() {
-		final UUID uuid = UUID.fromString(getUuid());
-		
-		return uuid.hashCode();
-	}
-	
-	/* (non-Javadoc)
-	 * @see java.lang.Object#equals(java.lang.Object)
-	 */
-	@Override
-	public boolean equals(Object o) {
-		if (o == this) return true;
-		if (!(o instanceof Service)) return false;
-		
-		final Service service = (Service) o;
-		
-		return (service.getUuid().equals(getUuid()));
-	}
-
-	public String getServiceType() {
-		return serviceType;
-	}
-
-	public void setServiceType(String serviceType) {
-		this.serviceType = serviceType;
-	}
-
-	public String getServiceRole() {
-		return serviceRole;
-	}
-
-	public void setServiceRole(String serviceRole) {
-		this.serviceRole = serviceRole;
-	}
-
-	/*public static void extractVfModuleCustomizationUUID (Service s, String vnfCustomizationName, VfModule vfMod ) {
-		
-		//Look for vnfCustomizationName..vfModuleCustomizationName
-		String nameToFind = vnfCustomizationName + ".." + vfMod.getModelCustomizationName();
-		for (Entry<UUID, VfModule> vfModuleComponent : s.getVfModules().entrySet()) {
-			VfModule xMod = vfModuleComponent.getValue();
-			if ( (xMod.getModelCustomizationName() != null) && (xMod.getModelCustomizationName().equalsIgnoreCase(nameToFind)) ) {
-				vfMod.setCustomizationUuid( xMod.getCustomizationUuid());
-				return;
-			}
-		}
-	}*/
-}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/model/ServiceModel.java b/vid-app-common/src/main/java/org/openecomp/vid/model/ServiceModel.java
deleted file mode 100755
index e879fd4..0000000
--- a/vid-app-common/src/main/java/org/openecomp/vid/model/ServiceModel.java
+++ /dev/null
@@ -1,261 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * VID
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *      http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.vid.model;
-
-import java.text.DateFormat;
-import java.text.SimpleDateFormat;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Map.Entry;
-
-import org.openecomp.vid.asdc.beans.tosca.Group;
-import org.openecomp.vid.asdc.beans.tosca.ToscaModel;
-import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
-import org.openecomp.vid.properties.VidProperties;
-/**
- * The Class ServiceModel.
- */
-@SuppressWarnings("ALL")
-public class ServiceModel {
-
-	/** The Constant LOG. */
-	private static final EELFLoggerDelegate LOG = EELFLoggerDelegate.getLogger(ServiceModel.class);
-	
-	/** The Constant dateFormat. */
-	final static DateFormat dateFormat = new SimpleDateFormat("HH:mm:ss:SSSS");
-	/** The service. */
-	private Service service;
-	
-	/** The vnfs. */
-	private Map<String, VNF> vnfs;
-	
-	/** The networks. */
-	private Map<String, Network> networks;
-
-	/** 
-	 * The vf modules. The VNF also has vfmodules but the vfmodules at the service level may have additional info
-	 * that is not present in the VNF, like the vf module customization String 
-	 */
-	private Map<String, VfModule> vfModules;
-	/** 
-	 * The volume groups. The VNF also has volume groups but the volume groups will be populated at the service level 
-	 * for newer models 
-	 */
-	private Map<String, VolumeGroup> volumeGroups;
-	/**
-	 * Instantiates a new service model.
-	 */
-	public ServiceModel() {}
-	
-	/**
-	 * Gets the service.
-	 *
-	 * @return the service
-	 */
-	public Service getService() {
-		return service;
-	}
-
-	/**
-	 * Gets the vnfs.
-	 *
-	 * @return the vnfs
-	 */
-	public Map<String, VNF> getVnfs() {
-		return vnfs;
-	}
-
-	/**
-	 * Gets the networks.
-	 *
-	 * @return the networks
-	 */
-	public Map<String, Network> getNetworks() {
-		return networks;
-	}
-
-	/**
-	 * Sets the service.
-	 *
-	 * @param service the new service
-	 */
-	public void setService(Service service) {
-		this.service = service;
-	}
-
-	/**
-	 * Sets the vnfs.
-	 *
-	 * @param vnfs the vnfs
-	 */
-	public void setVnfs(Map<String, VNF> vnfs) {
-		this.vnfs = vnfs;
-	}
-
-	/**
-	 * Sets the networks.
-	 *
-	 * @param networks the networks
-	 */
-	public void setNetworks(Map<String, Network> networks) {
-		this.networks = networks;
-	}
-	/**
-	 * Gets the vf modules.
-	 *
-	 * @return the vf modules
-	 */
-	public Map<String, VfModule> getVfModules() {
-		return vfModules;
-	}
-	/**
-	 * Gets the volume groups.
-	 *
-	 * @return the volume groups
-	 */
-	public Map<String, VolumeGroup> getVolumeGroups() {
-		return volumeGroups;
-	}
-	/**
-	 * Sets the vf modules.
-	 *
-	 * @param vfModules the vf modules
-	 */
-	public void setVfModules(Map<String, VfModule> vfModules) {
-		this.vfModules = vfModules;
-	}
-	/**
-	 * Sets the volume groups.
-	 *
-	 * @param volumeGroups the volume groups
-	 */
-	public void setVolumeGroups(Map<String, VolumeGroup> volumeGroups) {
-		this.volumeGroups = volumeGroups;
-	}
-	/**
-	 * Extract service.
-	 *
-	 * @param serviceToscaModel the service tosca model
-	 * @param asdcServiceMetadata the asdc service metadata
-	 * @return the service
-	 */
-	public static Service extractService(ToscaModel serviceToscaModel, org.openecomp.vid.asdc.beans.Service asdcServiceMetadata) {
-		
-		final Service service = new Service();
-		
-		service.setCategory(serviceToscaModel.getMetadata().getCategory());
-		service.setInvariantUuid(serviceToscaModel.getMetadata().getInvariantUUID());
-		service.setName(serviceToscaModel.getMetadata().getName());
-		service.setUuid(serviceToscaModel.getMetadata().getUUID());
-		service.setDescription(serviceToscaModel.getMetadata().getDescription());
-		service.setServiceEcompNaming(serviceToscaModel.getMetadata().getServiceEcompNaming());
-		service.setInputs(serviceToscaModel.gettopology_template().getInputs());
-		//FIXME: SDC is not sending the Version with the Tosca Model for 1610 - they should send it in 1702
-		//THIS IS A TEMPORARY FIX, AT SOME POINT UNCOMMENT ME
-		service.setVersion(serviceToscaModel.getMetadata().getVersion());
-		//service.setVersion(asdcServiceMetadata.getVersion());
-
-		return service;
-	}
-	public static void extractGroups (ToscaModel serviceToscaModel,ServiceModel serviceModel) {
-		// Get the groups. The groups may duplicate the groups that are in the VNF model and have
-		// additional data like the VF module customization String>
-		
-		final Map<String, VfModule> vfModules = new HashMap<String, VfModule> ();
-		final Map<String, VolumeGroup> volumeGroups = new HashMap<String, VolumeGroup> ();
-		
-		String asdcModelNamespace = VidProperties.getAsdcModelNamespace();
-    	String vfModuleTag = asdcModelNamespace + ModelConstants.VF_MODULE;
-    	
-		for (Entry<String, Group> component : serviceToscaModel.gettopology_template().getGroups().entrySet()) {
-			final Group group = component.getValue();
-			final String type = group.getType();
-			final String customizationName = component.getKey();
-			
-			if (type.startsWith(vfModuleTag)) {
-				VfModule vfMod = VfModule.extractVfModule(customizationName, group);
-				vfModules.put(customizationName, vfMod);
-				if ( vfMod.isVolumeGroupAllowed() ) {
-					//volume groups have the same customization name as the vf module
-					volumeGroups.put(customizationName, VolumeGroup.extractVolumeGroup(customizationName,group));
-				}
-			}
-		}
-		// add this point vfModules and volume groups are disconnected from VNF
-		serviceModel.setVfModules (vfModules);
-		serviceModel.setVolumeGroups (volumeGroups);
-		
-	}
-	/**
-	 * Populate the vf modules and volume groups that we may have under the service level under each VNF.
-	 */
-	public void associateGroups() {
-		String methodName = "associateGroups()";
-        LOG.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + methodName + " start");
-		// go through the vnfs, get the vnf normalized name and look for a vf module with a customization name that starts
-		// with vnf + ".."
-		String vnfCustomizationName = null;
-		String normalizedVnfCustomizationName = null;
-		String vfModuleCustomizationName = null;
-		VNF tmpVnf = null;
-		
-		if ( ( getVnfs() != null ) && (!(getVnfs().isEmpty())) ) {
-			for (Entry<String, VNF> vnfComponent : getVnfs().entrySet()) {
-				vnfCustomizationName = vnfComponent.getValue().getModelCustomizationName();
-				normalizedVnfCustomizationName = VNF.normalizeName(vnfCustomizationName);
-				
-				LOG.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + methodName + 
-						" VNF customizationName=" + vnfCustomizationName + "normalized customization name=" + normalizedVnfCustomizationName);
-				
-				// now check to see if there is a vf module with customization name that starts with normalizedVnfCustomizationName
-				
-				if (( getVfModules() != null ) && (!(getVfModules().isEmpty()))) {
-					for (Entry<String, VfModule> vfModuleComponent : getVfModules().entrySet()) {
-						vfModuleCustomizationName = vfModuleComponent.getValue().getModelCustomizationName();
-						
-						LOG.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + methodName + 
-								" VF Module customizationName=" + vfModuleCustomizationName );
-						if ( vfModuleCustomizationName.startsWith(normalizedVnfCustomizationName + ".." )) {
-							
-							// this vf module belongs to the VNF
-							tmpVnf = vnfComponent.getValue();
-							(tmpVnf.getVfModules()).put(vfModuleComponent.getKey(), vfModuleComponent.getValue());
-							
-							LOG.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + methodName + 
-									" Associated VF Module customizationName=" + vfModuleComponent.getKey() + " with VNF customization name=" + vnfCustomizationName);
-							
-							// now find if this vf module has volume groups, if so, find the volume group with the same customization name and put it under the VNF
-							if ( vfModuleComponent.getValue().isVolumeGroupAllowed() ) {
-								if (( getVolumeGroups() != null ) && (!(getVolumeGroups().isEmpty()))) {
-									if (getVolumeGroups().containsKey((vfModuleCustomizationName))) {
-										(vnfComponent.getValue().getVolumeGroups()).put(vfModuleCustomizationName, (getVolumeGroups()).get(vfModuleCustomizationName));
-									}
-								}	
-							}
-						}
-					}
-				}
-			}
-		}
-		
-	}
-}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/model/Subscriber.java b/vid-app-common/src/main/java/org/openecomp/vid/model/Subscriber.java
deleted file mode 100644
index c5db6fd..0000000
--- a/vid-app-common/src/main/java/org/openecomp/vid/model/Subscriber.java
+++ /dev/null
@@ -1,26 +0,0 @@
-package org.openecomp.vid.model;
-
-
-import org.codehaus.jackson.annotate.JsonProperty;
-
-/**
- * Created by Oren on 7/4/17.
- */
-public class Subscriber {
-
-    @JsonProperty("global-customer-id")
-    public String globalCustomerId;
-
-    @JsonProperty("subscriber-name")
-    public String subscriberName;
-
-    @JsonProperty("subscriber-type")
-    public String subscriberType;
-
-    @JsonProperty("resource-version")
-    public String resourceVersion;
-
-
-
-
-}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/model/SubscriberList.java b/vid-app-common/src/main/java/org/openecomp/vid/model/SubscriberList.java
deleted file mode 100644
index 7f593e4..0000000
--- a/vid-app-common/src/main/java/org/openecomp/vid/model/SubscriberList.java
+++ /dev/null
@@ -1,15 +0,0 @@
-package org.openecomp.vid.model;
-
-import org.openecomp.portalsdk.core.web.support.UserUtils;
-
-import java.util.List;
-
-/**
- * Created by Oren on 7/4/17.
- */
-public class SubscriberList {
-
-    public List<Subscriber> customer;
-
-
-}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/model/VNF.java b/vid-app-common/src/main/java/org/openecomp/vid/model/VNF.java
deleted file mode 100755
index 62e101e..0000000
--- a/vid-app-common/src/main/java/org/openecomp/vid/model/VNF.java
+++ /dev/null
@@ -1,165 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * VID
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *      http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.vid.model;
-
-import java.util.Map;
-import java.text.DateFormat;
-import java.text.SimpleDateFormat;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.Map.Entry;
-import java.util.regex.Pattern;
-
-import org.openecomp.vid.asdc.beans.tosca.NodeTemplate;
-
-import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
-import org.openecomp.vid.controller.VidController;
-
-import org.openecomp.vid.asdc.beans.tosca.Group;
-import org.openecomp.vid.asdc.beans.tosca.Input;
-
-/**
- * The Class VNF.
- */
-public class VNF extends Node {
-	
-	/** The Constant LOG. */
-	private static final EELFLoggerDelegate LOG = EELFLoggerDelegate.getLogger(VNF.class);
-	
-	/** The Constant dateFormat. */
-	final static DateFormat dateFormat = new SimpleDateFormat("HH:mm:ss:SSSS");
-
-	/** The pattern used to normalize VNF names */
-	final static Pattern COMPONENT_INSTANCE_NAME_DELIMETER_PATTERN = Pattern.compile("[\\.\\-]+");
-	
-	/** The model customization name. */
-	private String modelCustomizationName;
-	
-	/** The vf modules. */
-	private Map<String, VfModule> vfModules = new HashMap<String, VfModule>();
-	
-	/** The volume groups. */
-	private Map<String, VolumeGroup> volumeGroups = new HashMap<String, VolumeGroup>();
-	
-	/**
-	 * Instantiates a new vnf.
-	 */
-	public VNF() {
-		super();
-	}
-
-	/**
-	 * Gets the model customization name.
-	 *
-	 * @return the model customization name
-	 */
-	public String getModelCustomizationName() {
-		return modelCustomizationName;
-	}
-	
-	/**
-	 * Gets the vf modules.
-	 *
-	 * @return the vf modules
-	 */
-	public Map<String, VfModule> getVfModules() {
-		return vfModules;
-	}
-
-	/**
-	 * Sets the vf modules.
-	 *
-	 * @param vfModules the vf modules
-	 */
-	public void setVfModules(Map<String, VfModule> vfModules) {
-		this.vfModules = vfModules;
-	}
-
-	/**
-	 * Gets the volume groups.
-	 *
-	 * @return the volume groups
-	 */
-	public Map<String, VolumeGroup> getVolumeGroups() {
-		return volumeGroups;
-	}
-
-	/**
-	 * Sets the volume groups.
-	 *
-	 * @param volumeGroups the volume groups
-	 */
-	public void setVolumeGroups(Map<String, VolumeGroup> volumeGroups) {
-		this.volumeGroups = volumeGroups;
-	}
-
-	/**
-	 * Extract vnf.
-	 *
-	 * @param modelCustomizationName the model customization name
-	 * @param nodeTemplate the node template
-	 * @return the vnf
-	 */
-	public void extractVnf(String modelCustomizationName, NodeTemplate nodeTemplate) {
-		
-		super.extractNode(nodeTemplate);	
-		setModelCustomizationName(modelCustomizationName);
-		
-	}
-
-	/**
-	 * Sets the model customization name.
-	 *
-	 * @param modelCustomizationName the new model customization name
-	 */
-	public void setModelCustomizationName(String modelCustomizationName) {
-		this.modelCustomizationName = modelCustomizationName;
-	}
-	/**
-	 * Normalize the VNF name
-	 * @param originalName
-	 * @return the normalized name
-	 */
-	public static String normalizeName (String originalName) {
-
-		String normalizedName = originalName.toLowerCase();
-		normalizedName = COMPONENT_INSTANCE_NAME_DELIMETER_PATTERN.matcher(normalizedName).replaceAll(" ");
-		String[] splitArr = null;
-		
-		try {
-			splitArr = normalizedName.split(" ");
-		}
-		catch (Exception ex ) {
-			return (normalizedName);
-		}
-		StringBuffer sb = new StringBuffer();
-		if ( splitArr != null ) {
-			for (String splitElement : splitArr) {
-				sb.append(splitElement);
-			}
-			return (sb.toString());
-		}
-		else {
-			return (normalizedName);
-		}
-		
-	}
-}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/model/VersionByInvariantIdsRequest.java b/vid-app-common/src/main/java/org/openecomp/vid/model/VersionByInvariantIdsRequest.java
deleted file mode 100644
index 7c86165..0000000
--- a/vid-app-common/src/main/java/org/openecomp/vid/model/VersionByInvariantIdsRequest.java
+++ /dev/null
@@ -1,11 +0,0 @@
-package org.openecomp.vid.model;
-
-import java.util.List;
-
-/**
- * Created by Oren on 9/5/17.
- */
-public class VersionByInvariantIdsRequest {
-
-    public List<String> versions;
-}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/model/VfModule.java b/vid-app-common/src/main/java/org/openecomp/vid/model/VfModule.java
deleted file mode 100755
index 3f6f1da..0000000
--- a/vid-app-common/src/main/java/org/openecomp/vid/model/VfModule.java
+++ /dev/null
@@ -1,308 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * VID
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *      http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.vid.model;
-
-import java.text.DateFormat;
-import java.text.SimpleDateFormat;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Map.Entry;
-import org.openecomp.vid.asdc.beans.tosca.Group;
-
-import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
-
-/**
- * The Class VfModule.
- */
-public class VfModule {
-
-	/** The Constant LOG. */
-	private static final EELFLoggerDelegate LOG = EELFLoggerDelegate.getLogger(VfModule.class);
-	
-	/** The Constant dateFormat. */
-	final static DateFormat dateFormat = new SimpleDateFormat("HH:mm:ss:SSSS");
-	
-	/** The uuid. */
-	private String uuid;
-	
-	/** The invariant uuid. */
-	private String invariantUuid;
-	
-	/** The customization uuid. */
-	private String customizationUuid;
-	
-	/** The description. */
-	private String description;
-	
-	/** The name. */
-	private String name;
-	
-	/** The version. */
-	private String version;
-	
-	/** The volume group allowed. */
-	private boolean volumeGroupAllowed;
-	
-	/** The get_input or other constructs for VF Module. */
-	private Map<String, CommandProperty> commands;
-	
-	/** The model customization name. */
-	private String modelCustomizationName;
-	
-	/**
-	 * Instantiates a new vf module.
-	 */
-	public VfModule() {
-		commands = new HashMap<String, CommandProperty>();
-	}
-	/**
-	 * Gets the model customization name.
-	 *
-	 * @return the model customization name
-	 */
-	public String getModelCustomizationName() {
-		return modelCustomizationName;
-	}
-	/**
-	 * Gets the uuid.
-	 *
-	 * @return the uuid
-	 */
-	public String getUuid() {
-		return uuid;
-	}
-
-	/**
-	 * Gets the invariant uuid.
-	 *
-	 * @return the invariant uuid
-	 */
-	public String getInvariantUuid() {
-		return invariantUuid;
-	}
-	/**
-	 * Gets the customization uuid.
-	 *
-	 * @return the invariant uuid
-	 */
-	public String getCustomizationUuid() {
-		return customizationUuid;
-	}
-	/**
-	 * Gets the description.
-	 *
-	 * @return the description
-	 */
-	public String getDescription() {
-		return description;
-	}
-	/**
-	 * Gets the commands.
-	 *
-	 * @return the commands
-	 */
-	public Map<String, CommandProperty> getCommands() {
-		return commands;
-	}
-	/**
-	 * Gets the name.
-	 *
-	 * @return the name
-	 */
-	public String getName() {
-		return name;
-	}
-
-	/**
-	 * Gets the version.
-	 *
-	 * @return the version
-	 */
-	public String getVersion() {
-		return version;
-	}
-
-	/**
-	 * Checks if is volume group allowed.
-	 *
-	 * @return true, if is volume group allowed
-	 */
-	public boolean isVolumeGroupAllowed() {
-		return volumeGroupAllowed;
-	}
-	
-	/**
-	 * Sets the uuid.
-	 *
-	 * @param uuid the new uuid
-	 */
-	public void setUuid(String uuid) {
-		this.uuid = uuid;
-	}
-
-	/**
-	 * Sets the invariant uuid.
-	 *
-	 * @param invariantUuid the new invariant uuid
-	 */
-	public void setInvariantUuid(String invariantUuid) {
-		this.invariantUuid = invariantUuid;
-	}
-	/**
-	 * Sets the customization uuid.
-	 *
-	 * @param customizationUuid the new customization uuid
-	 */
-	public void setCustomizationUuid(String customizationUuid) {
-		this.customizationUuid = customizationUuid;
-	}
-	/**
-	 * Sets the description.
-	 *
-	 * @param description the new description
-	 */
-	public void setDescription(String description) {
-		this.description = description;
-	}
-
-	/**
-	 * Sets the name.
-	 *
-	 * @param name the new name
-	 */
-	public void setName(String name) {
-		this.name = name;
-	}
-
-	/**
-	 * Sets the version.
-	 *
-	 * @param version the new version
-	 */
-	public void setVersion(String version) {
-		this.version = version;
-	}
-
-	/**
-	 * Sets the volume group allowed.
-	 *
-	 * @param volumeGroupAllowed the new volume group allowed
-	 */
-	public void setVolumeGroupAllowed(boolean volumeGroupAllowed) {
-		this.volumeGroupAllowed = volumeGroupAllowed;
-	}
-	/**
-	 * Sets the commands.
-	 *
-	 * @param m the commands
-	 */
-	public void setCommands( Map<String, CommandProperty>m ) {
-		commands = m;
-	}
-	/**
-	 * Sets the model customization name.
-	 *
-	 * @param modelCustomizationName the new model customization name
-	 */
-	public void setModelCustomizationName(String modelCustomizationName) {
-		this.modelCustomizationName = modelCustomizationName;
-	}
-	/**
-	 * Extract vf module.
-	 *
-	 * @param group the group
-	 * @return the vf module
-	 */
-	public static  VfModule extractVfModule(String modelCustomizationName, Group group) {
-		
-		String methodName = "extractVfModule";
-
-		final VfModule vfModule = new VfModule();
-		
-		try {
-			vfModule.setUuid(group.getMetadata().getVfModuleModelUUID());
-			vfModule.setInvariantUuid(group.getMetadata().getVfModuleModelInvariantUUID());
-			vfModule.setDescription(group.getMetadata().getDescription());
-			vfModule.setName(group.getMetadata().getVfModuleModelName());
-			vfModule.setVersion(group.getMetadata().getVfModuleModelVersion());
-			vfModule.setCustomizationUuid(group.getMetadata().getVfModuleModelCustomizationUUID());
-			vfModule.setModelCustomizationName (modelCustomizationName);
-			
-			if (group.getProperties().containsKey("volume_group")) {
-				if (group.getProperties().get("volume_group") != null) {
-				
-					Class<?> c = group.getProperties().get("volume_group").getClass();
-					LOG.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + methodName + " class name=" + 
-							c.getName());
-					
-					if ( c.getName().equalsIgnoreCase(Boolean.class.getName()) ) {
-						Boolean b = (Boolean)group.getProperties().get("volume_group");
-						vfModule.setVolumeGroupAllowed( b.booleanValue() );
-					}
-				}
-			} else {
-				vfModule.setVolumeGroupAllowed(false);
-			}
-		}
-		catch ( Exception e ) {
-			LOG.error(EELFLoggerDelegate.errorLogger, dateFormat.format(new Date()) + methodName + " Unable to parse VF Module from group: e=" + 
-					e.toString());
-		}
-		/* Not extracting other types of properties for 1702
-		 try {
-			
-			for (Entry<String, Object> e : group.getProperties().entrySet()) {
-				
-				String k = e.getKey();
-				if ( e.getValue() != null ) {
-					LOG.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + methodName + " property: " + 
-							k + "=" + e.getValue());
-					LOG.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + methodName + " V class name: " +
-							 e.getValue().getClass().getName());
-					 Class<?>[] interfaces = e.getValue().getClass().getInterfaces();
-					 
-					 for(Class<?> ifc: interfaces ){
-						 LOG.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + methodName + " ifc name: " +
-								 ifc.getName());
-				     }
-					 
-					// only extract get_input for now
-					for (Entry<String, String> entry : v.entrySet()) {
-						// only include get_input for now
-						if ( ModelConstants.GET_INPUT_TAG.equalsIgnoreCase ( entry.getKey() ) ) {
-							CommandProperty cp = new CommandProperty();
-							cp.setDisplayName(entry.getValue());
-							cp.setCommand(entry.getKey());
-							cp.setInputName(k);
-							(vfModule.getCommands()).put(k,cp);
-						}
-					} 
-				}
-			}
-		}
-		catch ( Exception e ) {
-			LOG.error(EELFLoggerDelegate.errorLogger, dateFormat.format(new Date()) + methodName + " Unable to parse VF Module properties: e=" + 
-					e.toString());
-		}*/
-		return vfModule;
-	}
-}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/model/VolumeGroup.java b/vid-app-common/src/main/java/org/openecomp/vid/model/VolumeGroup.java
deleted file mode 100755
index baa5351..0000000
--- a/vid-app-common/src/main/java/org/openecomp/vid/model/VolumeGroup.java
+++ /dev/null
@@ -1,196 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * VID
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *      http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.vid.model;
-
-import org.openecomp.vid.asdc.beans.tosca.Group;
-
-/**
- * The Class VolumeGroup.
- */
-public class VolumeGroup {
-
-	/** The uuid. */
-	private String uuid;
-	
-	/** The invariant uuid. */
-	private String invariantUuid;
-	
-	/** The description. */
-	private String description;
-	
-	/** The name. */
-	private String name;
-	
-	/** The version. */
-	private String version;
-	
-	/** The customization uuid. */
-	private String customizationUuid;
-	
-	/** The customization uuid. */
-	private String modelCustomizationName;
-	/**
-	 * Instantiates a new volume group.
-	 */
-	public VolumeGroup() {}
-
-	/**
-	 * Gets the uuid.
-	 *
-	 * @return the uuid
-	 */
-	public String getUuid() {
-		return uuid;
-	}
-	/**
-	 * Gets the customization uuid.
-	 *
-	 * @return the customization uuid
-	 */
-	public String getCustomizationUuid() {
-		return customizationUuid;
-	}
-	/**
-	 * Gets the customization name.
-	 *
-	 * @return the customization name
-	 */
-	public String getModelCustomizationName() {
-		return modelCustomizationName;
-	}
-	/**
-	 * Gets the invariant uuid.
-	 *
-	 * @return the invariant uuid
-	 */
-	public String getInvariantUuid() {
-		return invariantUuid;
-	}
-
-	/**
-	 * Gets the description.
-	 *
-	 * @return the description
-	 */
-	public String getDescription() {
-		return description;
-	}
-
-	/**
-	 * Gets the name.
-	 *
-	 * @return the name
-	 */
-	public String getName() {
-		return name;
-	}
-
-	/**
-	 * Gets the version.
-	 *
-	 * @return the version
-	 */
-	public String getVersion() {
-		return version;
-	}
-
-	/**
-	 * Sets the uuid.
-	 *
-	 * @param uuid the new uuid
-	 */
-	public void setUuid(String uuid) {
-		this.uuid = uuid;
-	}
-
-	/**
-	 * Sets the invariant uuid.
-	 *
-	 * @param invariantUuid the new invariant uuid
-	 */
-	public void setInvariantUuid(String invariantUuid) {
-		this.invariantUuid = invariantUuid;
-	}
-
-	/**
-	 * Sets the description.
-	 *
-	 * @param description the new description
-	 */
-	public void setDescription(String description) {
-		this.description = description;
-	}
-
-	/**
-	 * Sets the name.
-	 *
-	 * @param name the new name
-	 */
-	public void setName(String name) {
-		this.name = name;
-	}
-
-	/**
-	 * Sets the version.
-	 *
-	 * @param version the new version
-	 */
-	public void setVersion(String version) {
-		this.version = version;
-	}
-	/**
-	 * Sets the customization uuid.
-	 *
-	 * @param u the new customization uuid
-	 */
-	public void setCustomizationUuid(String u) {
-		this.customizationUuid = u;
-		
-	}
-	/**
-	 * Sets the customization name.
-	 *
-	 * @param u the new customization name
-	 */
-	public void setModelCustomizationName(String u) {
-		this.modelCustomizationName = u;
-		
-	}
-	/**
-	 * Extract volume group.
-	 *
-	 * @param group the group
-	 * @return the volume group
-	 */
-	public static VolumeGroup extractVolumeGroup(String modelCustomizationName, Group group) {
-		final VolumeGroup volumeGroup = new VolumeGroup();
-		
-		volumeGroup.setUuid(group.getMetadata().getVfModuleModelUUID());
-		volumeGroup.setInvariantUuid(group.getMetadata().getVfModuleModelInvariantUUID());
-		volumeGroup.setDescription(group.getMetadata().getDescription());
-		volumeGroup.setName(group.getMetadata().getVfModuleModelName());
-		volumeGroup.setVersion(group.getMetadata().getVfModuleModelVersion());
-		volumeGroup.setCustomizationUuid(group.getMetadata().getVfModuleModelCustomizationUUID());
-		volumeGroup.setModelCustomizationName(modelCustomizationName);
-		return volumeGroup;
-	}
-
-}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/model/Workflow.java b/vid-app-common/src/main/java/org/openecomp/vid/model/Workflow.java
deleted file mode 100644
index 6032ec5..0000000
--- a/vid-app-common/src/main/java/org/openecomp/vid/model/Workflow.java
+++ /dev/null
@@ -1,47 +0,0 @@
-package org.openecomp.vid.model;
-
-
-import java.util.Collection;
-
-public class Workflow {
-    //Private members:
-    private int id;
-    private String workflowName;
-    private Collection<String> vnfNames;
-
-
-    //Constructors:
-    public Workflow() {}
-
-    public Workflow(int id, String workflowName, Collection<String> vnfNames) {
-        this.id = id;
-        this.workflowName = workflowName;
-        this.vnfNames = vnfNames;
-    }
-
-
-    //Setters and getters:
-    public int getId() {
-        return id;
-    }
-
-    public String getWorkflowName() {
-        return workflowName;
-    }
-
-    public Collection<String> getVnfNames() {
-        return this.vnfNames;
-    }
-
-    public void setId(int id) {
-        this.id = id;
-    }
-
-    public void setWorkflowName(String workflowName) {
-        this.workflowName = workflowName;
-    }
-
-    public void setVnfName(Collection<String> vnfNames) {
-        this.vnfNames = vnfNames;
-    }
-}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/mso/MsoBusinessLogic.java b/vid-app-common/src/main/java/org/openecomp/vid/mso/MsoBusinessLogic.java
deleted file mode 100644
index f6847e4..0000000
--- a/vid-app-common/src/main/java/org/openecomp/vid/mso/MsoBusinessLogic.java
+++ /dev/null
@@ -1,416 +0,0 @@
-package org.openecomp.vid.mso;
-
-import com.fasterxml.jackson.databind.DeserializationFeature;
-import com.fasterxml.jackson.databind.ObjectMapper;
-import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
-import org.openecomp.portalsdk.core.util.SystemProperties;
-import org.openecomp.vid.controller.MsoController;
-import org.openecomp.vid.mso.rest.*;
-
-import java.text.DateFormat;
-import java.text.SimpleDateFormat;
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.List;
-
-import static org.openecomp.vid.controller.MsoController.SVC_INSTANCE_ID;
-import static org.openecomp.vid.controller.MsoController.REQUEST_TYPE;
-import static org.openecomp.vid.controller.MsoController.VNF_INSTANCE_ID;
-
-/**
- * Created by pickjonathan on 19/06/2017.
- */
-public class MsoBusinessLogic {
-
-    /**
-     * The Mso REST client
-     * This should be replaced with mso client factory.
-     */
-    private MsoInterface msoClientInterface;
-
-    /**
-     * The logger.
-     */
-    EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(MsoController.class);
-
-    /**
-     * The Constant dateFormat.
-     */
-    final static DateFormat dateFormat = new SimpleDateFormat("HH:mm:ss:SSSS");
-
-    public MsoBusinessLogic() {
-        msoClientInterface = MsoRestInterfaceFactory.getInstance();
-    }
-
-    // this function should get params from tosca and send them to instance at mso, then return success response.
-    public MsoResponseWrapper createSvcInstance(RequestDetails msoRequest) throws Exception {
-        String methodName = "createSvcInstance ";
-        logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
-
-        String endpoint;
-        try {
-            endpoint = validateEndpointPath(MsoProperties.MSO_REST_API_SVC_INSTANCE);
-        } catch (Exception exception) {
-            throw exception;
-        }
-
-        return msoClientInterface.createSvcInstance(msoRequest, endpoint);
-    }
-
-    public MsoResponseWrapper createVnf(RequestDetails requestDetails, String serviceInstanceId) throws Exception {
-        String methodName = "createVnf";
-        logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
-
-        String endpoint;
-        try {
-            endpoint = validateEndpointPath(MsoProperties.MSO_REST_API_VNF_INSTANCE);
-        } catch (Exception exception) {
-            throw exception;
-        }
-
-        String vnf_endpoint = endpoint.replaceFirst(SVC_INSTANCE_ID, serviceInstanceId);
-        return msoClientInterface.createVnf(requestDetails, vnf_endpoint);
-    }
-
-    public MsoResponseWrapper createNwInstance(RequestDetails requestDetails, String serviceInstanceId) throws Exception {
-        String methodName = "createNwInstance";
-        logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
-
-        String endpoint;
-        try {
-            endpoint = validateEndpointPath(MsoProperties.MSO_REST_API_NETWORK_INSTANCE);
-        } catch (Exception exception) {
-            throw exception;
-        }
-
-        String nw_endpoint = endpoint.replaceFirst(SVC_INSTANCE_ID, serviceInstanceId);
-        return msoClientInterface.createNwInstance(requestDetails, nw_endpoint);
-    }
-
-    public MsoResponseWrapper createVolumeGroupInstance(RequestDetails requestDetails, String serviceInstanceId, String vnfInstanceId) throws Exception {
-        String methodName = "createVolumeGroupInstance";
-        logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
-
-        String endpoint;
-        try {
-            endpoint = validateEndpointPath(MsoProperties.MSO_REST_API_VOLUME_GROUP_INSTANCE);
-        } catch (Exception exception) {
-            throw exception;
-        }
-
-        String vnf_endpoint = endpoint.replaceFirst(SVC_INSTANCE_ID, serviceInstanceId);
-        vnf_endpoint = vnf_endpoint.replaceFirst(VNF_INSTANCE_ID, vnfInstanceId);
-
-        return msoClientInterface.createVolumeGroupInstance(requestDetails, vnf_endpoint);
-    }
-
-    public MsoResponseWrapper createVfModuleInstance(RequestDetails requestDetails, String serviceInstanceId, String vnfInstanceId) throws Exception{
-        String methodName = "createVfModuleInstance";
-        logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
-
-        String endpoint;
-        try {
-            endpoint = validateEndpointPath(MsoProperties.MSO_REST_API_VF_MODULE_INSTANCE);
-        } catch (Exception exception) {
-            throw exception;
-        }
-
-        String partial_endpoint = endpoint.replaceFirst(SVC_INSTANCE_ID, serviceInstanceId);
-        String vf_module_endpoint = partial_endpoint.replaceFirst(VNF_INSTANCE_ID, vnfInstanceId);
-
-        return msoClientInterface.createVfModuleInstance(requestDetails, vf_module_endpoint);
-    }
-
-    public MsoResponseWrapper deleteSvcInstance(RequestDetails requestDetails, String serviceInstanceId) throws Exception{
-        String methodName = "deleteSvcInstance";
-        logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
-
-        String endpoint;
-        try {
-            endpoint = validateEndpointPath(MsoProperties.MSO_REST_API_SVC_INSTANCE);
-        } catch (Exception exception) {
-            throw exception;
-        }
-
-        String svc_endpoint = endpoint + "/" + serviceInstanceId;
-
-        return msoClientInterface.deleteSvcInstance(requestDetails, svc_endpoint);
-    }
-
-    public MsoResponseWrapper deleteVnf(RequestDetails requestDetails, String serviceInstanceId, String vnfInstanceId) throws Exception{
-        String methodName = "deleteVnf";
-        logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
-
-        String endpoint;
-        try {
-            endpoint = validateEndpointPath(MsoProperties.MSO_REST_API_VNF_INSTANCE);
-        } catch (Exception exception) {
-            throw exception;
-        }
-        String vnf_endpoint = endpoint.replaceFirst(SVC_INSTANCE_ID, serviceInstanceId);
-        vnf_endpoint = vnf_endpoint + '/' + vnfInstanceId;
-
-        return msoClientInterface.deleteVnf(requestDetails, vnf_endpoint);
-    }
-
-    public MsoResponseWrapper deleteVfModule(RequestDetails requestDetails, String serviceInstanceId, String vnfInstanceId, String vfModuleId) throws Exception{
-        String methodName = "deleteVfModule";
-        logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
-
-        String endpoint;
-        try {
-            endpoint = validateEndpointPath(MsoProperties.MSO_REST_API_VF_MODULE_INSTANCE);
-        } catch (Exception exception) {
-            throw exception;
-        }
-
-        String vf__modules_endpoint = endpoint.replaceFirst(SVC_INSTANCE_ID, serviceInstanceId).replaceFirst(VNF_INSTANCE_ID, vnfInstanceId);
-
-        String delete_vf_endpoint = vf__modules_endpoint + '/' + vfModuleId;
-
-        return msoClientInterface.deleteVfModule(requestDetails, delete_vf_endpoint);
-    }
-
-    public MsoResponseWrapper deleteVolumeGroupInstance(RequestDetails requestDetails, String serviceInstanceId, String vnfInstanceId, String volumeGroupId)throws Exception{
-        String methodName = "deleteVolumeGroupInstance";
-        logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
-
-        String endpoint;
-        try {
-            endpoint = validateEndpointPath(MsoProperties.MSO_REST_API_VOLUME_GROUP_INSTANCE);
-        } catch (Exception exception) {
-            throw exception;
-        }
-
-        String svc_endpoint = endpoint.replaceFirst(SVC_INSTANCE_ID, serviceInstanceId);
-        String vnf_endpoint = svc_endpoint.replaceFirst(VNF_INSTANCE_ID, vnfInstanceId);
-        String delete_volume_group_endpoint = vnf_endpoint + "/" + volumeGroupId;
-
-        return msoClientInterface.deleteVolumeGroupInstance(requestDetails, delete_volume_group_endpoint);
-    }
-
-    public MsoResponseWrapper deleteNwInstance(RequestDetails requestDetails, String serviceInstanceId, String networkInstanceId) throws Exception{
-        String methodName = "deleteNwInstance";
-        logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
-
-        String endpoint;
-        try {
-            endpoint = validateEndpointPath(MsoProperties.MSO_REST_API_NETWORK_INSTANCE);
-        } catch (Exception exception) {
-            throw exception;
-        }
-
-        String svc_endpoint = endpoint.replaceFirst(SVC_INSTANCE_ID, serviceInstanceId);
-        String delete_nw_endpoint = svc_endpoint + "/" + networkInstanceId;
-
-        return msoClientInterface.deleteNwInstance(requestDetails, delete_nw_endpoint);
-    }
-
-    public MsoResponseWrapper getOrchestrationRequest(String requestId)throws Exception{
-        String methodName = "getOrchestrationRequest";
-        logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
-        MsoResponseWrapper w = null;
-        try {
-            String p = SystemProperties.getProperty(MsoProperties.MSO_REST_API_GET_ORC_REQ);
-            String path = p + "/" + requestId;
-
-            RestObject<String> restObjStr = new RestObject<String>();
-            String str = new String();
-            restObjStr.set(str);
-
-            msoClientInterface.getOrchestrationRequest(str, "", path, restObjStr);
-
-            return MsoUtil.wrapResponse(restObjStr);
-
-        } catch (Exception e) {
-            logger.error(EELFLoggerDelegate.errorLogger, dateFormat.format(new Date()) + "<== " + "." + methodName + e.toString());
-            logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + "." + methodName + e.toString());
-            throw e;
-        }
-    }
-
-    public MsoResponseWrapper getOrchestrationRequests(String filterString)throws Exception{
-        String methodName = "getOrchestrationRequest";
-        logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
-        MsoResponseWrapper w = null;
-        try {
-            String p = SystemProperties.getProperty(MsoProperties.MSO_REST_API_GET_ORC_REQS);
-            String path = p + filterString;
-
-            RestObject<String> restObjStr = new RestObject<String>();
-            String str = new String();
-            restObjStr.set(str);
-
-            msoClientInterface.getOrchestrationRequest(str, "", path, restObjStr);
-
-            return MsoUtil.wrapResponse(restObjStr);
-
-        } catch (Exception e) {
-            logger.error(EELFLoggerDelegate.errorLogger, dateFormat.format(new Date()) + "<== " + "." + methodName + e.toString());
-            logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + "." + methodName + e.toString());
-            throw e;
-        }
-    }
-
-    public List<Request> getOrchestrationRequestsForDashboard()throws Exception{
-        String methodName = "getOrchestrationRequestsForDashboard";
-        logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
-
-        try {
-            String path = SystemProperties.getProperty(MsoProperties.MSO_REST_API_GET_ORC_REQS);
-            path += "filter=modelType:EQUALS:vnf";
-            RestObject<String> restObjStr = new RestObject<String>();
-            String str = new String();
-            restObjStr.set(str);
-
-            MsoResponseWrapper msoResponseWrapper =  msoClientInterface.getOrchestrationRequestsForDashboard(str, "", path, restObjStr);
-            List<RequestWrapper> allOrchestrationRequests = deserializeOrchestrationRequestsJson(msoResponseWrapper.getEntity());
-
-            List<Request> filteredOrchestrationRequests = new ArrayList<>();
-            for (RequestWrapper currentRequest:allOrchestrationRequests){
-                if ((currentRequest.getRequest() != null) && (currentRequest.getRequest().getRequestScope() == Request.RequestScope.VNF) && ((currentRequest.getRequest().getRequestType() ==
-                        Request.RequestType.REPLACE_INSTANCE)||(currentRequest.getRequest().getRequestType() ==
-                        Request.RequestType.UPDATE_INSTANCE) )) {
-                    filteredOrchestrationRequests.add(currentRequest.getRequest());
-                }
-            }
-            return filteredOrchestrationRequests;
-        } catch (Exception e) {
-            logger.error(EELFLoggerDelegate.errorLogger, dateFormat.format(new Date()) + "<== " + "." + methodName + e.toString());
-            logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + "." + methodName + e.toString());
-            throw e;
-        }
-
-    }
-
-    private List<RequestWrapper> deserializeOrchestrationRequestsJson(String orchestrationRequestsJson) throws Exception {
-        String methodName = "deserializeOrchestrationRequestsJson";
-        logger.debug(dateFormat.format(new Date()) + "<== " + methodName + " start");
-
-        ObjectMapper mapper = new ObjectMapper();
-        mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
-        mapper.configure(DeserializationFeature.READ_ENUMS_USING_TO_STRING, true);
-        RequestList requestList = mapper.readValue(orchestrationRequestsJson , RequestList.class);
-        return requestList.getRequestList();
-    }
-
-
-    public List<Task> getManualTasksByRequestId(String originalRequestId)throws Exception{
-        String methodName = "getManualTasksByRequestId";
-        logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
-
-        try {
-            String p = SystemProperties.getProperty(MsoProperties.MSO_REST_API_GET_MAN_TASKS);
-            String path = p + "?originalRequestId=" + originalRequestId;
-
-            RestObject<String> restObjStr = new RestObject<String>();
-            String str = new String();
-            restObjStr.set(str);
-
-            MsoResponseWrapper msoResponseWrapper = msoClientInterface.getManualTasksByRequestId(str, "", path, restObjStr);
-            return deserializeManualTasksJson(msoResponseWrapper.getEntity());
-
-        } catch (Exception e) {
-            logger.error(EELFLoggerDelegate.errorLogger, dateFormat.format(new Date()) + "<== " + "." + methodName + e.toString());
-            logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + "." + methodName + e.toString());
-            throw e;
-        }
-    }
-
-    private List<Task> deserializeManualTasksJson(String manualTasksJson) throws Exception{
-        String methodName = "deserializeManualTasksJson";
-        logger.debug(dateFormat.format(new Date()) + "<== " + methodName + " start");
-
-        ObjectMapper mapper = new ObjectMapper();
-        TaskList taskList = mapper.readValue(manualTasksJson , TaskList.class);
-        return taskList.getTaskList();
-    }
-
-
-    public MsoResponseWrapper completeManualTask(RequestDetails requestDetails , String taskId)throws Exception{
-        String methodName = "completeManualTask";
-        logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
-        MsoResponseWrapper w = null;
-        try {
-            String p = SystemProperties.getProperty(MsoProperties.MSO_REST_API_GET_MAN_TASKS);
-            String path = p + "/" + taskId + "/complete";
-
-            RestObject<String> restObjStr = new RestObject<String>();
-            String str = new String();
-            restObjStr.set(str);
-
-            msoClientInterface.completeManualTask(requestDetails , str, "", path, restObjStr);
-
-            return MsoUtil.wrapResponse(restObjStr);
-
-        } catch (Exception e) {
-            logger.error(EELFLoggerDelegate.errorLogger, dateFormat.format(new Date()) + "<== " + "." + methodName + e.toString());
-            logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + "." + methodName + e.toString());
-            throw e;
-        }
-    }
-
-    public MsoResponseWrapper activateServiceInstance(RequestDetails requestDetails , String serviceInstanceId)throws Exception{
-        String methodName = "activateServiceInstance";
-        logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
-        try {
-            String path ="/" + serviceInstanceId  + "/activate";
-
-            RestObject<String> restObjStr = new RestObject<>();
-            String str = "";
-            restObjStr.set(str);
-
-            msoClientInterface.activateServiceInstance(requestDetails , str, "", path, restObjStr);
-
-            return MsoUtil.wrapResponse(restObjStr);
-
-        } catch (Exception e) {
-            logger.error(EELFLoggerDelegate.errorLogger, dateFormat.format(new Date()) + "<== " + "." + methodName + e.toString());
-            logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + "." + methodName + e.toString());
-            throw e;
-        }
-    }
-
-
-
-
-    private String validateEndpointPath(String endpointEnvVariable) throws Exception {
-        String endpoint = SystemProperties.getProperty(endpointEnvVariable);
-        if (endpoint == null || endpoint.isEmpty()) {
-            throw new Exception(endpointEnvVariable + " env variable is not defined");
-        }
-        return endpoint;
-    }
-
-	public MsoResponseWrapper updateVnf(org.openecomp.vid.changeManagement.RequestDetails requestDetails, String serviceInstanceId, String vnfInstanceId) throws Exception {
-	   String methodName = "updateVnf";
-       logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
-       
-       String endpoint;
-        try {
-            endpoint = validateEndpointPath(MsoProperties.MSO_REST_API_VNF_INSTANCE);
-        } catch (Exception exception) {
-            throw exception;
-        }
-        String vnf_endpoint = endpoint.replaceFirst(SVC_INSTANCE_ID, serviceInstanceId);
-        vnf_endpoint = vnf_endpoint + '/' + vnfInstanceId;
-        return msoClientInterface.updateVnf(requestDetails, vnf_endpoint);		
-	}
-	
-	public MsoResponseWrapper replaceVnf(org.openecomp.vid.changeManagement.RequestDetails requestDetails, String serviceInstanceId, String vnfInstanceId) throws Exception {
-		String methodName = "replaceVnf";
-		logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
-		
-		String endpoint;
-		try {
-			endpoint = validateEndpointPath(MsoProperties.MSO_REST_API_VNF_CHANGE_MANAGEMENT_INSTANCE);
-		} catch (Exception exception) {
-			throw exception;
-		}
-		String vnf_endpoint = endpoint.replaceFirst(SVC_INSTANCE_ID, serviceInstanceId);
-		vnf_endpoint = vnf_endpoint.replace(VNF_INSTANCE_ID, vnfInstanceId);
-		vnf_endpoint = vnf_endpoint.replace(REQUEST_TYPE, "replace"); //No Constants file, TODO: once you create - add it.
-		return msoClientInterface.replaceVnf(requestDetails, vnf_endpoint);		
-	}
-
-}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/mso/MsoClientFactory.java b/vid-app-common/src/main/java/org/openecomp/vid/mso/MsoClientFactory.java
deleted file mode 100644
index fb0ead4..0000000
--- a/vid-app-common/src/main/java/org/openecomp/vid/mso/MsoClientFactory.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * VID
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.vid.mso;
-
-import org.openecomp.vid.mso.rest.MsoRestClientNew;
-
-/**
- * A factory for creating MsoRestInterface objects.
- */
-public class MsoClientFactory {
-
-    /**
-     * MSO client factory that creates the right client according to env.
-     * @return
-     */
-    public static MsoInterface getInstance() {
-        return new MsoRestClientNew();
-    }
-}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/mso/MsoInterface.java b/vid-app-common/src/main/java/org/openecomp/vid/mso/MsoInterface.java
deleted file mode 100644
index cdeb1bb..0000000
--- a/vid-app-common/src/main/java/org/openecomp/vid/mso/MsoInterface.java
+++ /dev/null
@@ -1,75 +0,0 @@
-package org.openecomp.vid.mso;
-
-import org.openecomp.vid.mso.rest.Request;
-import org.openecomp.vid.mso.rest.RequestDetails;
-import org.openecomp.vid.mso.rest.Task;
-
-import java.util.List;
-
-/**
- * Created by pickjonathan on 21/06/2017.
- */
-public interface MsoInterface {
-
-    /**
-     * This function will post MSO service with information about how to instantiate the requested service
-     * @param requestDetails The details about the service as they come from the web.
-     * @return MsoResponseWrapper containing information about the service instantiation
-     * --> success : see JSON at resources folder mso_create_instance_response.
-     * --> failure : would return 200 with failure data.
-     * @throws Exception
-     */
-    MsoResponseWrapper createSvcInstance(RequestDetails requestDetails, String endpoint) throws Exception;
-
-    /**
-     * will create a virtual network function using MSO service.
-     * @param requestDetails - information about the vnf to create
-     * @return - the response body recived from MSO
-     * @throws Exception
-     */
-    MsoResponseWrapper createVnf(RequestDetails requestDetails, String endpoint) throws Exception;
-
-    MsoResponseWrapper createNwInstance(RequestDetails requestDetails, String endpoint) throws Exception;
-    /**
-     *
-     * @param requestDetails
-     * @param path
-     * @return
-     * @throws Exception
-     */
-    MsoResponseWrapper createVolumeGroupInstance(RequestDetails requestDetails, String path) throws Exception;
-
-    /**
-     *
-     * @param requestDetails
-     * @return
-     * @throws Exception
-     */
-    MsoResponseWrapper createVfModuleInstance(RequestDetails requestDetails, String endpoint) throws Exception;
-
-    MsoResponseWrapper deleteSvcInstance(RequestDetails requestDetails, String endpoint) throws Exception;
-
-    MsoResponseWrapper deleteVnf(RequestDetails requestDetails, String endpoint) throws Exception;
-
-    MsoResponseWrapper deleteVfModule(RequestDetails requestDetails, String endpoint) throws Exception;
-
-    MsoResponseWrapper deleteVolumeGroupInstance(RequestDetails requestDetails, String endpoint) throws Exception;
-
-    MsoResponseWrapper deleteNwInstance(RequestDetails requestDetails, String endpoint) throws Exception;
-
-    void getOrchestrationRequest(String t, String sourceId, String endpoint, RestObject restObject) throws Exception;
-
-    MsoResponseWrapper getOrchestrationRequestsForDashboard(String t , String sourceId , String endpoint , RestObject restObject) throws Exception;
-
-    MsoResponseWrapper getManualTasksByRequestId(String t , String sourceId , String endpoint , RestObject restObject) throws Exception;
-
-    MsoResponseWrapper completeManualTask(RequestDetails requestDetails, String t, String sourceId, String endpoint, RestObject restObject) throws Exception;
-
-	MsoResponseWrapper updateVnf(org.openecomp.vid.changeManagement.RequestDetails requestDetails, String vnf_endpoint)  throws Exception;
-
-	MsoResponseWrapper replaceVnf(org.openecomp.vid.changeManagement.RequestDetails requestDetails, String vnf_endpoint)  throws Exception;
-
-
-    void activateServiceInstance(RequestDetails requestDetails, String t, String sourceId, String endpoint, RestObject<String> restObject) throws Exception;
-
-}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/mso/MsoLocalClient.java b/vid-app-common/src/main/java/org/openecomp/vid/mso/MsoLocalClient.java
deleted file mode 100644
index 0179400..0000000
--- a/vid-app-common/src/main/java/org/openecomp/vid/mso/MsoLocalClient.java
+++ /dev/null
@@ -1,85 +0,0 @@
-package org.openecomp.vid.mso;
-
-import org.apache.commons.io.IOUtils;
-import org.json.JSONObject;
-import org.json.JSONTokener;
-import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
-import org.openecomp.vid.changeManagement.ChangeManagementRequest;
-import org.openecomp.vid.controller.VidController;
-import org.openecomp.vid.mso.rest.RequestDetails;
-
-import javax.ws.rs.client.Client;
-import javax.ws.rs.core.MultivaluedHashMap;
-import java.io.InputStream;
-import java.text.DateFormat;
-import java.text.SimpleDateFormat;
-
-/**
- * Created by pickjonathan on 20/06/2017.
- */
-public class MsoLocalClient implements MsoRestInterfaceIfc {
-
-    /**
-     * The logger.
-     */
-    EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(MsoLocalClient.class);
-
-    /**
-     * The Constant dateFormat.
-     */
-    final static DateFormat dateFormat = new SimpleDateFormat("HH:mm:ss:SSSS");
-
-    /**
-     * The client.
-     */
-    private static Client client = null;
-
-    /**
-     * The common headers.
-     */
-    private MultivaluedHashMap<String, Object> commonHeaders;
-
-    /**
-     * Instantiates a new mso rest interface.
-     */
-    public MsoLocalClient() {
-        super();
-    }
-
-    public void initMsoClient() {
-        final String methodname = "initRestClient()";
-    }
-
-    @Override
-    public <T> void Get(T t, String sourceId, String path, RestObject<T> restObject) throws Exception {
-
-    }
-
-    @Override
-    public <T> void Delete(T t, RequestDetails r, String sourceID, String path, RestObject<T> restObject) throws Exception {
-
-    }
-
-    @Override
-    public <T> void Post(T t, RequestDetails r, String sourceID, String path, RestObject<T> restObject) throws Exception {
-        initMsoClient();
-
-        final InputStream asdcServicesFile = MsoLocalClient.class.getClassLoader().getResourceAsStream("mso_create_instance_response.json");
-
-        t = (T) IOUtils.toString(asdcServicesFile);
-        restObject.setStatusCode(200);
-        restObject.set(t);
-    }
-
-    @Override
-    public void logRequest(RequestDetails r) {
-
-    }
-
-	@Override
-	public <T> void Put(T t, ChangeManagementRequest r, String sourceID, String path, RestObject<T> restObject)
-			throws Exception {
-		
-		
-	}
-}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/mso/MsoLocalClientNew.java b/vid-app-common/src/main/java/org/openecomp/vid/mso/MsoLocalClientNew.java
deleted file mode 100644
index 1b15df7..0000000
--- a/vid-app-common/src/main/java/org/openecomp/vid/mso/MsoLocalClientNew.java
+++ /dev/null
@@ -1,216 +0,0 @@
-package org.openecomp.vid.mso;
-
-import com.fasterxml.jackson.databind.DeserializationFeature;
-import com.fasterxml.jackson.databind.ObjectMapper;
-import org.apache.commons.io.IOUtils;
-import org.apache.commons.lang3.NotImplementedException;
-import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
-import org.openecomp.vid.mso.rest.*;
-
-import java.io.InputStream;
-import java.text.DateFormat;
-import java.text.SimpleDateFormat;
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.List;
-
-/**
- * Created by pickjonathan on 21/06/2017.
- */
-public class MsoLocalClientNew implements MsoInterface {
-
-
-    /**
-     * The logger.
-     */
-    EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(MsoLocalClient.class);
-
-    /**
-     * The Constant dateFormat.
-     */
-    final static DateFormat dateFormat = new SimpleDateFormat("HH:mm:ss:SSSS");
-
-
-    @Override
-    public MsoResponseWrapper createSvcInstance(RequestDetails requestDetails, String endpoint) throws Exception {
-
-        String methodName = "createSvcInstance ";
-        logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
-        MsoResponseWrapper w = createInstance(requestDetails, "");
-
-        return w;
-    }
-
-    public MsoResponseWrapper createInstance(RequestDetails request, String path) throws Exception {
-        String methodName = "createInstance";
-        logger.debug(dateFormat.format(new Date()) + "<== " + methodName + " start");
-
-        try {
-            RestObject<String> restObjStr = new RestObject<String>();
-
-            String str = new String();
-
-            restObjStr.set(str);
-
-            final InputStream asdcServicesFile = MsoLocalClient.class.getClassLoader().getResourceAsStream("mso_create_instance_response.json");
-
-            restObjStr.setStatusCode(200);
-            restObjStr.set(IOUtils.toString(asdcServicesFile));
-
-            MsoResponseWrapper w = MsoUtil.wrapResponse(restObjStr);
-
-            return w;
-        } catch (Exception e) {
-            logger.error(EELFLoggerDelegate.errorLogger, dateFormat.format(new Date()) + "<== " + "." + methodName + e.toString());
-            logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + "." + methodName + e.toString());
-            throw e;
-        }
-    }
-
-    @Override
-    public MsoResponseWrapper createVnf(RequestDetails requestDetails, String endpoint) throws Exception {
-        return null;
-    }
-
-    @Override
-    public MsoResponseWrapper createNwInstance(RequestDetails requestDetails, String endpoint) throws Exception {
-        return null;
-    }
-
-    @Override
-    public MsoResponseWrapper createVolumeGroupInstance(RequestDetails requestDetails, String path) throws Exception {
-        return null;
-    }
-
-    @Override
-    public MsoResponseWrapper createVfModuleInstance(RequestDetails requestDetails, String endpoint) throws Exception {
-        return null;
-    }
-
-    @Override
-    public MsoResponseWrapper deleteSvcInstance(RequestDetails requestDetails, String endpoint) throws Exception {
-        return null;
-    }
-
-    @Override
-    public MsoResponseWrapper deleteVnf(RequestDetails requestDetails, String endpoint) throws Exception {
-        return null;
-    }
-
-    @Override
-    public MsoResponseWrapper deleteVfModule(RequestDetails requestDetails, String endpoint) throws Exception {
-        return null;
-    }
-
-    @Override
-    public MsoResponseWrapper deleteVolumeGroupInstance(RequestDetails requestDetails, String endpoint) throws Exception {
-        return null;
-    }
-
-    @Override
-    public MsoResponseWrapper deleteNwInstance(RequestDetails requestDetails, String endpoint) throws Exception {
-        return null;
-    }
-
-    @Override
-    public void getOrchestrationRequest(String t, String sourceId, String endpoint, RestObject restObject) throws Exception { }
-
-    @Override
-    public MsoResponseWrapper getOrchestrationRequestsForDashboard(String t, String sourceId, String endpoint, RestObject restObject) throws Exception {
-        String methodName = "getOrchestrationRequestsForDashboard";
-        logger.debug(dateFormat.format(new Date()) + "<== " + methodName + " start");
-
-        try {
-
-            final InputStream asdcServicesFile = MsoLocalClient.class.getClassLoader().getResourceAsStream("mso_get_orchestration_requests.json");
-
-            restObject.setStatusCode(200);
-            restObject.set(IOUtils.toString(asdcServicesFile));
-
-            MsoResponseWrapper w = MsoUtil.wrapResponse(restObject);
-
-            return w;
-        } catch (Exception e) {
-            logger.error(EELFLoggerDelegate.errorLogger, dateFormat.format(new Date()) + "<== " + "." + methodName + e.toString());
-            logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + "." + methodName + e.toString());
-            throw e;
-        }
-    }
-
-    public void activateServiceInstance(RequestDetails requestDetails, String t, String sourceId, String endpoint, RestObject<String> restObject) throws Exception{
-        String methodName = "activateServiceInstance";
-        logger.debug(dateFormat.format(new Date()) + "<== " + methodName + " start");
-
-        try {
-
-            final InputStream asdcServicesFile = MsoLocalClient.class.getClassLoader().getResourceAsStream("mso_activate_service_instance.json");
-
-            restObject.setStatusCode(200);
-            restObject.set(IOUtils.toString(asdcServicesFile));
-
-        } catch (Exception e) {
-            logger.error(EELFLoggerDelegate.errorLogger, dateFormat.format(new Date()) + "<== " + "." + methodName + e.toString());
-            logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + "." + methodName + e.toString());
-            throw e;
-        }
-    }
-
-
-    @Override
-    public MsoResponseWrapper getManualTasksByRequestId(String t, String sourceId, String endpoint, RestObject restObject) throws Exception {
-        String methodName = "getManualTasksByRequestId";
-        logger.debug(dateFormat.format(new Date()) + "<== " + methodName + " start");
-
-        try {
-
-            final InputStream asdcServicesFile = MsoLocalClient.class.getClassLoader().getResourceAsStream("mso_get_manual_task_by_request_id.json");
-
-            restObject.setStatusCode(200);
-            restObject.set(IOUtils.toString(asdcServicesFile));
-
-            MsoResponseWrapper w = MsoUtil.wrapResponse(restObject);
-
-            return w;
-        } catch (Exception e) {
-            logger.error(EELFLoggerDelegate.errorLogger, dateFormat.format(new Date()) + "<== " + "." + methodName + e.toString());
-            logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + "." + methodName + e.toString());
-            throw e;
-        }
-    }
-
-    @Override
-    public MsoResponseWrapper completeManualTask(RequestDetails requestDetails, String t, String sourceId, String endpoint, RestObject restObject) throws Exception {
-        String methodName = "getManualTasksByRequestId";
-        logger.debug(dateFormat.format(new Date()) + "<== " + methodName + " start");
-
-        try {
-
-            final InputStream asdcServicesFile = MsoLocalClient.class.getClassLoader().getResourceAsStream("mso_complete_manual_task.json");
-
-            restObject.setStatusCode(200);
-            restObject.set(IOUtils.toString(asdcServicesFile));
-
-            MsoResponseWrapper w = MsoUtil.wrapResponse(restObject);
-
-            return w;
-        } catch (Exception e) {
-            logger.error(EELFLoggerDelegate.errorLogger, dateFormat.format(new Date()) + "<== " + "." + methodName + e.toString());
-            logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + "." + methodName + e.toString());
-            throw e;
-        }
-    }
-
-	@Override
-	public MsoResponseWrapper replaceVnf(org.openecomp.vid.changeManagement.RequestDetails requestDetails, String vnf_endpoint) throws Exception {
-        throw new NotImplementedException("Function was not implemented at this point.");
-	}
-
-
-
-	@Override
-	public MsoResponseWrapper updateVnf(org.openecomp.vid.changeManagement.RequestDetails requestDetails,
-			String vnf_endpoint) {
-        // TODO Auto-generated method stub
-        return null;
-    }
-}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/mso/MsoProperties.java b/vid-app-common/src/main/java/org/openecomp/vid/mso/MsoProperties.java
deleted file mode 100755
index 0eed0e1..0000000
--- a/vid-app-common/src/main/java/org/openecomp/vid/mso/MsoProperties.java
+++ /dev/null
@@ -1,105 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * VID
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *      http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.vid.mso;
-
-import org.openecomp.portalsdk.core.util.SystemProperties;
-
-import java.text.DateFormat;
-import java.text.SimpleDateFormat;
-import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
-
-/**
- * The Class MsoProperties.
- */
-public class MsoProperties extends SystemProperties {
-
-	/** The Constant MSO_SERVER_URL. */
-	//VID Properties related to MSO
-	public static final String MSO_SERVER_URL = "mso.server.url";
-
-	/** The Constant MSO_DME2_SERVER_URL. */
-	public static final String MSO_DME2_SERVER_URL = "mso.dme2.server.url";
-
-	/** The Constant MSO_DME2_CLIENT_TIMEOUT. */
-	public static final String MSO_DME2_CLIENT_TIMEOUT = "mso.dme2.client.timeout";
-	
-	/** The Constant MSO_DME2_CLIENT_READ_TIMEOUT. */
-	public static final String MSO_DME2_CLIENT_READ_TIMEOUT = "mso.dme2.client.read.timeout";
-	
-	/** The Constant MSO_SERVER_URL_DEFAULT. */
-	public static final String MSO_SERVER_URL_DEFAULT= "";
-	
-	/** The Constant MSO_POLLING_INTERVAL_MSECS. */
-	// number of msecs to wait between polling requests
-	public static final String MSO_POLLING_INTERVAL_MSECS = "mso.polling.interval.msecs";
-
-	/** The Constant MSO_POLLING_INTERVAL_MSECS_DEFAULT. */
-	public static final String MSO_POLLING_INTERVAL_MSECS_DEFAULT = "60000";
-	
-	/** The Constant MSO_DME2_ENABLED. */
-	public static final String MSO_DME2_ENABLED = "mso.dme2.enabled";
-	
-	/** The Constant MSO_MAX_POLLS. */
-	public static final String MSO_MAX_POLLS = "mso.max.polls";
-	
-	/** The Constant MSO_MAX_POLLS_DEFAULT. */
-	public static final String MSO_MAX_POLLS_DEFAULT = "10"; //10
-	
-	/** The Constant MSO_USER_NAME. */
-	public static final String MSO_USER_NAME = "mso.user.name"; //m03346
-	
-	/** The Constant MSO_PASSWORD. */
-	public static final String MSO_PASSWORD = "mso.password.x";
-	
-	/** The Constant MSO_REST_API_SVC_INSTANCE. */
-	public static final String MSO_REST_API_SVC_INSTANCE = "mso.restapi.svc.instance"; // /serviceInstances/v2
-	
-	/** The Constant MSO_REST_API_VNF_INSTANCE. */
-	public static final String MSO_REST_API_VNF_INSTANCE = "mso.restapi.vnf.instance"; // /serviceInstances/v2/{service_instance_id}/vnfs
-	
-	/** The Constant MSO_REST_API_VNF_CHANGE_MANAGEMENT_INSTANCE. */
-	public static final String MSO_REST_API_VNF_CHANGE_MANAGEMENT_INSTANCE = "mso.restapi.vnf.changemanagement.instance"; // /serviceInstances/v2/{service_instance_id}/vnfs/{request_type}
-	
-	/** The Constant MSO_REST_API_NETWORK_INSTANCE. */
-	public static final String MSO_REST_API_NETWORK_INSTANCE = "mso.restapi.network.instance"; // /serviceInstances/v2/{serviceInstanceId}/networks
-	
-	/** The Constant MSO_REST_API_GET_ORC_REQ. */
-	public static final String MSO_REST_API_GET_ORC_REQ = "mso.restapi.get.orc.req";
-	
-	/** The Constant MSO_REST_API_GET_ORC_REQS. */
-	public static final String MSO_REST_API_GET_ORC_REQS = "mso.restapi.get.orc.reqs";
-
-	/** The Constant MSO_REST_API_GET_MAN_TASK. */
-	public static final String MSO_REST_API_GET_MAN_TASKS = "mso.restapi.get.man.tasks";
-
-	/** The Constant MSO_REST_API_VF_MODULE_INSTANCE. */
-	public static final String MSO_REST_API_VF_MODULE_INSTANCE = "mso.restapi.vf.module.instance";
-
-	/** The Constant MSO_REST_API_VOLUME_GROUP_INSTANCE. */
-	public static final String MSO_REST_API_VOLUME_GROUP_INSTANCE = "mso.restapi.volume.group.instance"; //serviceInstances/v2/{serviceInstanceId}/volumeGroups
-	
-	/** The logger. */
-	public EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(MsoProperties.class);
-	
-	/** The Constant dateFormat. */
-	final static DateFormat dateFormat = new SimpleDateFormat("HH:mm:ss:SSSS");
-	
-}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/mso/MsoResponseWrapper.java b/vid-app-common/src/main/java/org/openecomp/vid/mso/MsoResponseWrapper.java
deleted file mode 100755
index d5a4a87..0000000
--- a/vid-app-common/src/main/java/org/openecomp/vid/mso/MsoResponseWrapper.java
+++ /dev/null
@@ -1,107 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * VID
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *      http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.vid.mso;
-
-import com.fasterxml.jackson.annotation.JsonInclude;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import com.fasterxml.jackson.annotation.JsonPropertyOrder;
-import org.apache.commons.lang.builder.ToStringBuilder;
-
-/**
- * This wrapper encapsulates the MSO response in the format expected by the pages.
- */
-@JsonInclude(JsonInclude.Include.NON_NULL)
-@JsonPropertyOrder({
-	    "status",
-	    "entity"
-})
-
-public class MsoResponseWrapper  {
-	
-	/** The status. */
-	@JsonProperty("status")
-	private int status;
-	
-	/** The entity. */
-	@JsonProperty("entity")
-	private String entity;
-	
-	/**
-	 * Gets the entity.
-	 *
-	 * @return the entity
-	 */
-	@JsonProperty("entity")
-    public String getEntity() {
-        return entity;
-    }
-
-	/**
-	 * Gets the status.
-	 *
-	 * @return the status
-	 */
-	@JsonProperty("status")
-    public int getStatus() {
-        return status;
-    }
-	
-	/**
-	 * Sets the status.
-	 *
-	 * @param v the new status
-	 */
-	@JsonProperty("status")
-    public void setStatus(int v) {
-        this.status = v;
-    }
-	
-	/**
-	 * Sets the entity.
-	 *
-	 * @param v the new entity
-	 */
-	@JsonProperty("entity")
-    public void setEntity(String v) {
-        this.entity = v;
-    }
-    
-    /* (non-Javadoc)
-     * @see java.lang.Object#toString()
-     */
-    @Override
-    public String toString() {
-        return ToStringBuilder.reflectionToString(this);
-    }
-    
-    /**
-     * Gets the response.
-     *
-     * @return the response
-     */
-    public String getResponse () {
-    	
-    	StringBuilder b = new StringBuilder ("{ \"status\": ");
-        b.append(getStatus()).append(", \"entity\": " ).append(this.getEntity()).append("}");
-        return (b.toString());
-    }
-    
-}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/mso/MsoRestInt.java b/vid-app-common/src/main/java/org/openecomp/vid/mso/MsoRestInt.java
deleted file mode 100755
index b9f2dbc..0000000
--- a/vid-app-common/src/main/java/org/openecomp/vid/mso/MsoRestInt.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * VID
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *      http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.vid.mso;
-
-import java.text.DateFormat;
-import java.text.SimpleDateFormat;
-import java.util.Date;
-
-import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
-import com.fasterxml.jackson.databind.ObjectMapper;
-
-/**
- * The Class MsoRestInt.
- */
-public class MsoRestInt {
-	
-	/** The logger. */
-	EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(MsoRestInterface.class);
-	
-	/** The Constant dateFormat. */
-	final static DateFormat dateFormat = new SimpleDateFormat("HH:mm:ss:SSSS");
-	
-	/** The request date format. */
-	public DateFormat requestDateFormat = new SimpleDateFormat("EEE, dd MMM YYYY HH:mm:ss z");
-	
-	/**
-	 * Instantiates a new mso rest int.
-	 */
-	public MsoRestInt() {
-		requestDateFormat.setTimeZone(java.util.TimeZone.getTimeZone("GMT"));
-	}
-	
-	/**
-	 * Log request.
-	 *
-	 * @param r the r
-	 */
-	public void logRequest ( org.openecomp.vid.mso.rest.RequestDetails r ) {
-    	String methodName = "logRequest";
-	    ObjectMapper mapper = new ObjectMapper();
-	    String r_json_str = "";
-	    if ( r != null ) {
-	    	r_json_str = r.toString();
-		    try {
-		    	r_json_str = mapper.writeValueAsString(r);
-		    }
-		    catch ( com.fasterxml.jackson.core.JsonProcessingException j ) {
-		    	logger.debug(EELFLoggerDelegate.debugLogger,dateFormat.format(new Date()) + "<== " +  methodName + " Unable to parse request as json");
-		    }
-	    }
-	    logger.debug(EELFLoggerDelegate.debugLogger,dateFormat.format(new Date()) + "<== " +  methodName + " Request=(" + r_json_str + ")");  
-    }
-}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/mso/MsoRestInterface.java b/vid-app-common/src/main/java/org/openecomp/vid/mso/MsoRestInterface.java
deleted file mode 100755
index 5b331e9..0000000
--- a/vid-app-common/src/main/java/org/openecomp/vid/mso/MsoRestInterface.java
+++ /dev/null
@@ -1,352 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * VID
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *      http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.vid.mso;
-
-
-import java.text.DateFormat;
-import java.text.SimpleDateFormat;
-import java.util.Collections;
-import java.util.Date;
-
-import javax.ws.rs.client.Client;
-import javax.ws.rs.client.Entity;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.MultivaluedHashMap;
-import javax.ws.rs.core.Response;
-
-import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
-import org.openecomp.portalsdk.core.util.SystemProperties;
-
-import org.apache.commons.codec.binary.Base64;
-import org.eclipse.jetty.util.security.Password;
-import org.openecomp.vid.changeManagement.ChangeManagementRequest;
-import org.openecomp.vid.client.HttpBasicClient;
-import org.openecomp.vid.client.HttpsBasicClient;
-import org.openecomp.vid.mso.rest.RequestDetails;
-
-/**
- * The Class MsoRestInterface.
- */
-public class MsoRestInterface extends MsoRestInt implements MsoRestInterfaceIfc {
-
-	/** The logger. */
-	EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(MsoRestInterface.class);
-	
-	/** The Constant dateFormat. */
-	final static DateFormat dateFormat = new SimpleDateFormat("HH:mm:ss:SSSS");
-	
-	/** The client. */
-	private static Client client = null;
-	
-	/** The common headers. */
-	private MultivaluedHashMap<String, Object> commonHeaders;
-
-	/**
-	 * Instantiates a new mso rest interface.
-	 */
-	public MsoRestInterface() {
-		super();
-	}
-	
-	/* (non-Javadoc)
-	 * @see org.openecomp.vid.mso.MsoRestInterfaceIfc#initRestClient()
-	 */
-	public void initMsoClient()
-	{
-		final String methodname = "initRestClient()";
-		
-		final String username = SystemProperties.getProperty(MsoProperties.MSO_USER_NAME);
-		final String password = SystemProperties.getProperty(MsoProperties.MSO_PASSWORD);
-		final String mso_url = SystemProperties.getProperty(MsoProperties.MSO_SERVER_URL);
-		final String decrypted_password = Password.deobfuscate(password);
-		
-		String authString = username + ":" + decrypted_password;
-		
-		byte[] authEncBytes = Base64.encodeBase64(authString.getBytes());
-		String authStringEnc = new String(authEncBytes);
-
-		commonHeaders = new MultivaluedHashMap<String, Object> ();
-		commonHeaders.put("Authorization",  Collections.singletonList((Object) ("Basic " + authStringEnc)));
-		//Pass calling application identifier to SO
-		commonHeaders.put("X-FromAppId",
-				Collections.singletonList(SystemProperties.getProperty(SystemProperties.APP_DISPLAY_NAME)));
-
-		boolean use_ssl = true;
-		if ( (mso_url != null) && ( !(mso_url.isEmpty()) ) ) {
-			if ( mso_url.startsWith("https")) {
-				use_ssl = true;
-			}
-			else {
-				use_ssl = false;
-			}
-		}
-		if (client == null) {
-			
-			try {
-				if ( use_ssl ) { 
-					//logger.info(EELFLoggerDelegate.errorLogger, dateFormat.format(new Date()) +  methodname + " getting HttpsBasicClient with username=" + username
-					//		+ " password=" + password);
-					client = HttpsBasicClient.getClient();
-				}
-				else {
-					//logger.info(EELFLoggerDelegate.errorLogger, dateFormat.format(new Date()) +  methodname + " getting HttpsBasicClient with username=" + username
-					//		+ " password=" + password);
-					client = HttpBasicClient.getClient();
-				}
-			} catch (Exception e) {
-				logger.info(EELFLoggerDelegate.errorLogger, dateFormat.format(new Date()) +  methodname + " Unable to get the SSL client");
-			}
-		}
-	}
-	
-	/* (non-Javadoc)
-	 * @see org.openecomp.vid.mso.MsoRestInterfaceIfc#Get(java.lang.Object, java.lang.String, java.lang.String, org.openecomp.vid.mso.RestObject)
-	 */
-	@SuppressWarnings("unchecked")
-	public <T> void  Get (T t, String sourceId, String path, RestObject<T> restObject ) throws Exception {
-		String methodName = "Get";
-		
-		logger.debug(EELFLoggerDelegate.debugLogger, methodName + " start");
-		
-		String url="";
-		restObject.set(t);
-		
-		url = SystemProperties.getProperty(MsoProperties.MSO_SERVER_URL) + path;
-        logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " +  methodName + " sending request to url= " + url);
-		
-        initMsoClient();
-		
-		final Response cres = client.target(url)
-			 .request()
-	         .accept("application/json")
-	         .headers(commonHeaders)
-	         .get();
-		
-		int status = cres.getStatus();
-		restObject.setStatusCode (status);
-		
-		if (status == 200) {
-			 t = (T) cres.readEntity(t.getClass());
-			 restObject.set(t);
-			 logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + methodName + " REST api was successfull!");
-		    
-		 } else {
-		     throw new Exception(methodName + " with status="+ status + ", url= " + url );
-		 }
-
-		logger.debug(EELFLoggerDelegate.debugLogger,methodName + " received status=" + status );
-		
-		return;
-	}
-   
-   /* (non-Javadoc)
-    * @see org.openecomp.vid.mso.MsoRestInterfaceIfc#Delete(java.lang.Object, org.openecomp.vid.mso.rest.RequestDetails, java.lang.String, java.lang.String, org.openecomp.vid.mso.RestObject)
-    */
-   @SuppressWarnings("unchecked")
-	 public <T> void Delete(T t, RequestDetails r, String sourceID, String path, RestObject<T> restObject) {
-	 
-		String methodName = "Delete";
-		String url="";
-		Response cres = null;
-		
-		logger.debug(EELFLoggerDelegate.debugLogger,dateFormat.format(new Date()) + "<== " +  methodName + " start");
-		logRequest (r);
-
-		try {
-			initMsoClient();
-			
-			url = SystemProperties.getProperty(MsoProperties.MSO_SERVER_URL) + path;
-			logger.debug(EELFLoggerDelegate.debugLogger,dateFormat.format(new Date()) + " methodName sending request to: " + url);
-	
-			cres = client.target(url)
-					 .request()
-			         .accept("application/json")
-	        		 .headers(commonHeaders)
-			         //.entity(r)
-			         .build("DELETE", Entity.entity(r, MediaType.APPLICATION_JSON)).invoke();
-			       //  .method("DELETE", Entity.entity(r, MediaType.APPLICATION_JSON));
-			         //.delete(Entity.entity(r, MediaType.APPLICATION_JSON));
-			
-			int status = cres.getStatus();
-	    	restObject.setStatusCode (status);
-	    	
-			if (status == 404) { // resource not found
-				String msg = "Resource does not exist...: " + cres.getStatus();
-				logger.debug(EELFLoggerDelegate.debugLogger,dateFormat.format(new Date()) + "<== " + msg);
-			} else if (status == 200  || status == 204){
-				logger.debug(EELFLoggerDelegate.debugLogger,dateFormat.format(new Date()) + "<== " + "Resource " + url + " deleted");
-			} else if (status == 202) {
-				String msg = "Delete in progress: " + status;
-				logger.debug(EELFLoggerDelegate.debugLogger,dateFormat.format(new Date()) + "<== " + msg);
-			}
-			else {
-				String msg = "Deleting Resource failed: " + status;
-					logger.debug(EELFLoggerDelegate.debugLogger,dateFormat.format(new Date()) + "<== " + msg);
-			}
-			
-			try {
-	   			t = (T) cres.readEntity(t.getClass());
-	   			restObject.set(t);
-            }
-            catch ( Exception e ) {
-            	logger.debug(EELFLoggerDelegate.debugLogger,dateFormat.format(new Date()) + "<== " + methodName + " No response entity, this is probably ok, e="
-            			+ e.getMessage());
-            }
-   
-        } 
-		catch (Exception e)
-        {
-        	 logger.debug(EELFLoggerDelegate.debugLogger,dateFormat.format(new Date()) + "<== " + methodName + " with url="+url+ ", Exception: " + e.toString());
-        	 throw e;
-        
-        }
-	}
-	
-	/* (non-Javadoc)
-	 * @see org.openecomp.vid.mso.MsoRestInterfaceIfc#Post(java.lang.Object, org.openecomp.vid.mso.rest.RequestDetails, java.lang.String, java.lang.String, org.openecomp.vid.mso.RestObject)
-	 */
-	@SuppressWarnings("unchecked")
-	public <T> void Post(T t, RequestDetails r, String sourceID, String path, RestObject<T> restObject) throws Exception {
-
-        String methodName = "Post";
-        String url="";
-        
-        logger.debug(EELFLoggerDelegate.debugLogger,dateFormat.format(new Date()) + "<== " +  methodName + " start");
-       
-        logRequest (r);
-        try {
-
-			initMsoClient();
-
-            url = SystemProperties.getProperty(MsoProperties.MSO_SERVER_URL) + path;
-            logger.debug(EELFLoggerDelegate.debugLogger,dateFormat.format(new Date()) + "<== " +  methodName + " sending request to url= " + url);
-            // Change the content length
-            final Response cres = client.target(url)
-            	 .request()
-                 .accept("application/json")
-	        	 .headers(commonHeaders)
-                 //.header("content-length", 201)
-                 //.header("X-FromAppId",  sourceID)
-                 .post(Entity.entity(r, MediaType.APPLICATION_JSON));
-            
-            try {
-	   			t = (T) cres.readEntity(t.getClass());
-	   			restObject.set(t);
-            }
-            catch ( Exception e ) {
-            	logger.debug(EELFLoggerDelegate.debugLogger,dateFormat.format(new Date()) + "<== " + methodName + " No response entity, this is probably ok, e="
-            			+ e.getMessage());
-            }
-
-            int status = cres.getStatus();
-    		restObject.setStatusCode (status);
-    		
-    		if ( status >= 200 && status <= 299 ) {
-    			logger.info(EELFLoggerDelegate.errorLogger, dateFormat.format(new Date()) + "<== " + methodName + " REST api POST was successful!");
-    			logger.debug(EELFLoggerDelegate.debugLogger,dateFormat.format(new Date()) + "<== " + methodName + " REST api POST was successful!");
-    		
-             } else {
-            	 logger.debug(EELFLoggerDelegate.debugLogger,dateFormat.format(new Date()) + "<== " + methodName + " with status="+status+", url="+url);
-             }    
-   
-        } catch (Exception e)
-        {
-        	 logger.debug(EELFLoggerDelegate.debugLogger,dateFormat.format(new Date()) + "<== " + methodName + " with url="+url+ ", Exception: " + e.toString());
-        	 throw e;
-        
-        }
-    }
-	
-	
-	/* (non-Javadoc)
-	 * @see org.openecomp.vid.mso.MsoRestInterfaceIfc#Put(java.lang.Object, org.openecomp.vid.mso.rest.RequestDetails, java.lang.String, java.lang.String, org.openecomp.vid.mso.RestObject)
-	 */
-	@SuppressWarnings("unchecked")
-	public <T> void Put(T t, ChangeManagementRequest r, String sourceID, String path, RestObject<T> restObject) throws Exception {
-
-        String methodName = "Put";
-        String url="";
-        
-        logger.debug(EELFLoggerDelegate.debugLogger,dateFormat.format(new Date()) + "<== " +  methodName + " start");
-       
-//        logRequest (r);
-        try {
-            
-            initMsoClient();    
-    
-            url = SystemProperties.getProperty(MsoProperties.MSO_SERVER_URL) + path;
-            logger.debug(EELFLoggerDelegate.debugLogger,dateFormat.format(new Date()) + "<== " +  methodName + " sending request to url= " + url);
-            // Change the content length
-            final Response cres = client.target(url)
-            	 .request()
-                 .accept("application/json")
-	        	 .headers(commonHeaders)
-                 //.header("content-length", 201)
-                 //.header("X-FromAppId",  sourceID)
-                 .put(Entity.entity(r, MediaType.APPLICATION_JSON));
-            
-            try {
-	   			t = (T) cres.readEntity(t.getClass());
-	   			restObject.set(t);
-            }
-            catch ( Exception e ) {
-            	logger.debug(EELFLoggerDelegate.debugLogger,dateFormat.format(new Date()) + "<== " + methodName + " No response entity, this is probably ok, e="
-            			+ e.getMessage());
-            }
-
-            int status = cres.getStatus();
-    		restObject.setStatusCode (status);
-    		
-    		if ( status >= 200 && status <= 299 ) {
-    			logger.info(EELFLoggerDelegate.errorLogger, dateFormat.format(new Date()) + "<== " + methodName + " REST api POST was successful!");
-    			logger.debug(EELFLoggerDelegate.debugLogger,dateFormat.format(new Date()) + "<== " + methodName + " REST api POST was successful!");
-    		
-             } else {
-            	 logger.debug(EELFLoggerDelegate.debugLogger,dateFormat.format(new Date()) + "<== " + methodName + " with status="+status+", url="+url);
-             }    
-   
-        } catch (Exception e)
-        {
-        	 logger.debug(EELFLoggerDelegate.debugLogger,dateFormat.format(new Date()) + "<== " + methodName + " with url="+url+ ", Exception: " + e.toString());
-        	 throw e;
-        
-        }
-    }
-
-	
-    /**
-     * Gets the single instance of MsoRestInterface.
-     *
-     * @param <T> the generic type
-     * @param clazz the clazz
-     * @return single instance of MsoRestInterface
-     * @throws IllegalAccessException the illegal access exception
-     * @throws InstantiationException the instantiation exception
-     */
-    public <T> T getInstance(Class<T> clazz) throws IllegalAccessException, InstantiationException
-	{
-		return clazz.newInstance();
-	}
-
-
-	
-    
-}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/mso/MsoRestInterfaceFactory.java b/vid-app-common/src/main/java/org/openecomp/vid/mso/MsoRestInterfaceFactory.java
deleted file mode 100755
index ab12c7b..0000000
--- a/vid-app-common/src/main/java/org/openecomp/vid/mso/MsoRestInterfaceFactory.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * VID
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *      http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.vid.mso;
-
-import org.openecomp.portalsdk.core.util.SystemProperties;
-import org.openecomp.vid.mso.rest.MsoRestClientNew;
-
-/**
- * A factory for creating MsoRestInterface objects.
- */
-public class MsoRestInterfaceFactory {
-
-    /**
-     * Gets the single instance of MsoRestInterfaceFactory.
-     *
-     * @return single instance of MsoRestInterfaceFactory
-     */
-    public static MsoInterface getInstance() {
-        String msoPropertyName = "mso.client.type";
-        if (SystemProperties.containsProperty(msoPropertyName) &&
-                SystemProperties.getProperty(msoPropertyName).equals("LOCAL")) {
-            return new MsoLocalClientNew();
-        } else
-            return new MsoRestClientNew();
-    }
-}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/mso/MsoRestInterfaceIfc.java b/vid-app-common/src/main/java/org/openecomp/vid/mso/MsoRestInterfaceIfc.java
deleted file mode 100755
index 4ff13ed..0000000
--- a/vid-app-common/src/main/java/org/openecomp/vid/mso/MsoRestInterfaceIfc.java
+++ /dev/null
@@ -1,92 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * VID
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *      http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.vid.mso;
-
-import org.openecomp.vid.changeManagement.ChangeManagementRequest;
-import org.openecomp.vid.mso.rest.RequestDetails;
-
-/**
- * The Interface MsoRestInterfaceIfc.
- */
-public interface MsoRestInterfaceIfc {
-	
-	/**
-	 * Inits the rest client.
-	 */
-	public void initMsoClient();
-	
-	/**
-	 * Gets the.
-	 *
-	 * @param <T> the generic type
-	 * @param t the t
-	 * @param sourceId the source id
-	 * @param path the path
-	 * @param restObject the rest object
-	 * @throws Exception the exception
-	 */
-	public <T> void Get (T t, String sourceId, String path, RestObject<T> restObject ) throws Exception;
-	
-	/**
-	 * Delete.
-	 *
-	 * @param <T> the generic type
-	 * @param t the t
-	 * @param r the r
-	 * @param sourceID the source ID
-	 * @param path the path
-	 * @param restObject the rest object
-	 * @throws Exception the exception
-	 */
-	public <T> void Delete(T t, RequestDetails r, String sourceID, String path, RestObject<T> restObject) throws Exception;
-	
-	/**
-	 * Post.
-	 *
-	 * @param <T> the generic type
-	 * @param t the t
-	 * @param r the r
-	 * @param sourceID the source ID
-	 * @param path the path
-	 * @param restObject the rest object
-	 * @throws Exception the exception
-	 */
-	public <T> void Post(T t, RequestDetails r, String sourceID, String path, RestObject<T> restObject) throws Exception;
-	
-	/**
-	 * Put.
-	 *
-	 * @param <T> the generic type
-	 * @param t the t
-	 * @param r the r
-	 * @param sourceID the source ID
-	 * @param path the path
-	 * @param restObject the rest object
-	 * @throws Exception the exception
-	 */
-	public <T> void Put(T t, ChangeManagementRequest r, String sourceID, String path, RestObject<T> restObject) throws Exception ;
-	/***
-	 * Log request.
-	 *
-	 * @param r the r
-	 */
-	public void logRequest ( RequestDetails r  );
-}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/mso/MsoUtil.java b/vid-app-common/src/main/java/org/openecomp/vid/mso/MsoUtil.java
deleted file mode 100755
index 2c0148b..0000000
--- a/vid-app-common/src/main/java/org/openecomp/vid/mso/MsoUtil.java
+++ /dev/null
@@ -1,125 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * VID
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *      http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.vid.mso;
-import java.text.DateFormat;
-import java.text.SimpleDateFormat;
-import java.util.Date;
-
-import org.glassfish.jersey.client.ClientResponse;
-
-import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
-import org.openecomp.vid.controller.MsoController;
-import com.fasterxml.jackson.databind.ObjectMapper;
-
-/**
- * The Class MsoUtil.
- */
-public class MsoUtil {
-	
-	/** The logger. */
-	private static EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(MsoController.class);
-	
-	/** The Constant dateFormat. */
-	final static DateFormat dateFormat = new SimpleDateFormat("HH:mm:ss:SSSS");
-	
-	/**
-	 * Wrap response.
-	 *
-	 * @param body the body
-	 * @param statusCode the status code
-	 * @return the mso response wrapper
-	 */
-	public static MsoResponseWrapper wrapResponse ( String body, int statusCode ) {
-		
-		MsoResponseWrapper w = new MsoResponseWrapper();
-		w.setStatus (statusCode);
-		w.setEntity(body);
-		
-		return w;
-	}
-	
-	/**
-	 * Wrap response.
-	 *
-	 * @param cres the cres
-	 * @return the mso response wrapper
-	 */
-	public static MsoResponseWrapper wrapResponse (ClientResponse cres) {	
-		String resp_str = "";
-		if ( cres != null ) {
-			resp_str = cres.readEntity(String.class);
-		}
-		int statuscode = cres.getStatus();
-		MsoResponseWrapper w = MsoUtil.wrapResponse ( resp_str, statuscode );
-		return (w);
-	}
-	
-	/**
-	 * Wrap response.
-	 *
-	 * @param rs the rs
-	 * @return the mso response wrapper
-	 */
-	public static MsoResponseWrapper wrapResponse (RestObject<String> rs) {	
-		String resp_str = "";
-		int status = 0;
-		if ( rs != null ) {
-			resp_str = rs.get();
-			status = rs.getStatusCode();
-		}
-		MsoResponseWrapper w = MsoUtil.wrapResponse ( resp_str, status );
-		return (w);
-	}	
-	
-	/**
-	 * Convert pojo to string.
-	 *
-	 * @param <T> the generic type
-	 * @param t the t
-	 * @return the string
-	 * @throws JsonProcessingException the json processing exception
-	 */
-	public static <T> String convertPojoToString ( T t ) throws com.fasterxml.jackson.core.JsonProcessingException {
-		
-		String methodName = "convertPojoToString";
-		ObjectMapper mapper = new ObjectMapper();
-		String r_json_str = "";
-	    if ( t != null ) {
-		    try {
-		    	r_json_str = mapper.writeValueAsString(t);
-		    }
-		    catch ( com.fasterxml.jackson.core.JsonProcessingException j ) {
-		    	logger.debug(EELFLoggerDelegate.debugLogger,dateFormat.format(new Date()) + "<== " +  methodName + " Unable to parse object as json");
-		    }
-	    }
-	    return (r_json_str);
-	}
-	
-	/**
-	 * The main method.
-	 *
-	 * @param args the arguments
-	 */
-	public static void main(String[] args) {
-		// TODO Auto-generated method stub
-
-	}
-}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/mso/RestMsoImplementation.java b/vid-app-common/src/main/java/org/openecomp/vid/mso/RestMsoImplementation.java
deleted file mode 100644
index ba0fdfa..0000000
--- a/vid-app-common/src/main/java/org/openecomp/vid/mso/RestMsoImplementation.java
+++ /dev/null
@@ -1,326 +0,0 @@
-package org.openecomp.vid.mso;
-
-import com.fasterxml.jackson.databind.ObjectMapper;
-import org.apache.commons.codec.binary.Base64;
-import org.eclipse.jetty.util.security.Password;
-import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
-import org.openecomp.portalsdk.core.util.SystemProperties;
-import org.openecomp.vid.changeManagement.MsoRequestDetails;
-import org.openecomp.vid.client.HttpBasicClient;
-import org.openecomp.vid.client.HttpsBasicClient;
-import org.openecomp.vid.mso.rest.RequestDetails;
-import org.openecomp.vid.mso.rest.RestInterface;
-
-import javax.ws.rs.client.Client;
-import javax.ws.rs.client.Entity;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.MultivaluedHashMap;
-import javax.ws.rs.core.Response;
-import java.text.DateFormat;
-import java.text.SimpleDateFormat;
-import java.util.Collections;
-import java.util.Date;
-
-/**
- * Created by pickjonathan on 26/06/2017.
- */
-public class RestMsoImplementation implements RestInterface {
-
-    /**
-     * The logger.
-     */
-    EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(RestMsoImplementation.class);
-
-    /**
-     * The Constant dateFormat.
-     */
-    final static DateFormat dateFormat = new SimpleDateFormat("HH:mm:ss:SSSS");
-
-    /** The client. */
-    private static Client client = null;
-
-    /** The common headers. */
-    private MultivaluedHashMap<String, Object> commonHeaders;
-    /**
-     * Instantiates a new mso rest interface.
-     */
-
-    @Override
-    public void initMsoClient()
-    {
-        final String methodname = "initRestClient()";
-
-        final String username = SystemProperties.getProperty(MsoProperties.MSO_USER_NAME);
-        final String password = SystemProperties.getProperty(MsoProperties.MSO_PASSWORD);
-        final String mso_url = SystemProperties.getProperty(MsoProperties.MSO_SERVER_URL);
-        final String decrypted_password = Password.deobfuscate(password);
-
-        String authString = username + ":" + decrypted_password;
-
-        byte[] authEncBytes = Base64.encodeBase64(authString.getBytes());
-        String authStringEnc = new String(authEncBytes);
-
-        commonHeaders = new MultivaluedHashMap<String, Object>();
-        commonHeaders.put("Authorization",  Collections.singletonList((Object) ("Basic " + authStringEnc)));
-
-        boolean use_ssl = true;
-        if ( (mso_url != null) && ( !(mso_url.isEmpty()) ) ) {
-            if ( mso_url.startsWith("https")) {
-                use_ssl = true;
-            }
-            else {
-                use_ssl = false;
-            }
-        }
-        if (client == null) {
-
-            try {
-                if ( use_ssl ) {
-                    //logger.info(EELFLoggerDelegate.errorLogger, dateFormat.format(new Date()) +  methodname + " getting HttpsBasicClient with username=" + username
-                    //		+ " password=" + password);
-                    client = HttpsBasicClient.getClient();
-                }
-                else {
-                    //logger.info(EELFLoggerDelegate.errorLogger, dateFormat.format(new Date()) +  methodname + " getting HttpsBasicClient with username=" + username
-                    //		+ " password=" + password);
-                    client = HttpBasicClient.getClient();
-                }
-            } catch (Exception e) {
-                logger.info(EELFLoggerDelegate.errorLogger, dateFormat.format(new Date()) +  methodname + " Unable to get the SSL client");
-            }
-        }
-    }
-
-    public <T> void  Get (T t, String sourceId, String path, RestObject<T> restObject ) throws Exception {
-        String methodName = "Get";
-
-        logger.debug(EELFLoggerDelegate.debugLogger, methodName + " start");
-
-        String url="";
-        restObject.set(t);
-
-        url = SystemProperties.getProperty(MsoProperties.MSO_SERVER_URL) + path;
-        logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " +  methodName + " sending request to url= " + url);
-
-        initMsoClient();
-
-        final Response cres = client.target(url)
-                .request()
-                .accept("application/json")
-                .headers(commonHeaders)
-                .get();
-
-        int status = cres.getStatus();
-        restObject.setStatusCode (status);
-
-        if (status == 200 || status == 202) {
-            t = (T) cres.readEntity(t.getClass());
-            restObject.set(t);
-            logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + methodName + " REST api was successfull!");
-
-        } else {
-            throw new Exception(methodName + " with status="+ status + ", url= " + url );
-        }
-
-        logger.debug(EELFLoggerDelegate.debugLogger,methodName + " received status=" + status );
-
-        return;
-    }
-
-    @Override
-    public <T> void Delete(T t, RequestDetails r, String sourceID, String path, RestObject<T> restObject) {
-
-        String methodName = "Delete";
-        String url="";
-        Response cres = null;
-
-        logger.debug(EELFLoggerDelegate.debugLogger,dateFormat.format(new Date()) + "<== " +  methodName + " start");
-        logRequest (r);
-
-        try {
-            initMsoClient();
-
-            url = SystemProperties.getProperty(MsoProperties.MSO_SERVER_URL) + path;
-            logger.debug(EELFLoggerDelegate.debugLogger,dateFormat.format(new Date()) + " methodName sending request to: " + url);
-
-            cres = client.target(url)
-                    .request()
-                    .accept("application/json")
-                    .headers(commonHeaders)
-                    //.entity(r)
-                    .build("DELETE", Entity.entity(r, MediaType.APPLICATION_JSON)).invoke();
-            //  .method("DELETE", Entity.entity(r, MediaType.APPLICATION_JSON));
-            //.delete(Entity.entity(r, MediaType.APPLICATION_JSON));
-
-            int status = cres.getStatus();
-            restObject.setStatusCode (status);
-
-            if (status == 404) { // resource not found
-                String msg = "Resource does not exist...: " + cres.getStatus();
-                logger.debug(EELFLoggerDelegate.debugLogger,dateFormat.format(new Date()) + "<== " + msg);
-            } else if (status == 200  || status == 204){
-                logger.debug(EELFLoggerDelegate.debugLogger,dateFormat.format(new Date()) + "<== " + "Resource " + url + " deleted");
-            } else if (status == 202) {
-                String msg = "Delete in progress: " + status;
-                logger.debug(EELFLoggerDelegate.debugLogger,dateFormat.format(new Date()) + "<== " + msg);
-            }
-            else {
-                String msg = "Deleting Resource failed: " + status;
-                logger.debug(EELFLoggerDelegate.debugLogger,dateFormat.format(new Date()) + "<== " + msg);
-            }
-
-            try {
-                t = (T) cres.readEntity(t.getClass());
-                restObject.set(t);
-            }
-            catch ( Exception e ) {
-                logger.debug(EELFLoggerDelegate.debugLogger,dateFormat.format(new Date()) + "<== " + methodName + " No response entity, this is probably ok, e="
-                        + e.getMessage());
-            }
-
-        }
-        catch (Exception e)
-        {
-            logger.debug(EELFLoggerDelegate.debugLogger,dateFormat.format(new Date()) + "<== " + methodName + " with url="+url+ ", Exception: " + e.toString());
-            throw e;
-
-        }
-    }
-    
-    @Override
-    public <T> void Post(T t, RequestDetails r, String sourceID, String path, RestObject<T> restObject) throws Exception {
-        String methodName = "Post";
-        String url="";
-
-        logger.debug(EELFLoggerDelegate.debugLogger,dateFormat.format(new Date()) + "<== " +  methodName + " start");
-
-        logRequest (r);
-        try {
-
-            initMsoClient();
-
-            url = SystemProperties.getProperty(MsoProperties.MSO_SERVER_URL) + path;
-            logger.debug(EELFLoggerDelegate.debugLogger,dateFormat.format(new Date()) + "<== " +  methodName + " sending request to url= " + url);
-            // Change the content length
-            final Response cres = client.target(url)
-                    .request()
-                    .accept("application/json")
-                    .headers(commonHeaders)
-                    //.header("content-length", 201)
-                    //.header("X-FromAppId",  sourceID)
-                    .post(Entity.entity(r, MediaType.APPLICATION_JSON));
-
-            try {
-                t = (T) cres.readEntity(t.getClass());
-                restObject.set(t);
-            }
-            catch ( Exception e ) {
-                logger.debug(EELFLoggerDelegate.debugLogger,dateFormat.format(new Date()) + "<== " + methodName + " No response entity, this is probably ok, e="
-                        + e.getMessage());
-            }
-
-            int status = cres.getStatus();
-            restObject.setStatusCode (status);
-
-            if ( status >= 200 && status <= 299 ) {
-                logger.info(EELFLoggerDelegate.errorLogger, dateFormat.format(new Date()) + "<== " + methodName + " REST api POST was successful!");
-                logger.debug(EELFLoggerDelegate.debugLogger,dateFormat.format(new Date()) + "<== " + methodName + " REST api POST was successful!");
-
-            } else {
-                logger.debug(EELFLoggerDelegate.debugLogger,dateFormat.format(new Date()) + "<== " + methodName + " with status="+status+", url="+url);
-            }
-
-        } catch (Exception e)
-        {
-            logger.debug(EELFLoggerDelegate.debugLogger,dateFormat.format(new Date()) + "<== " + methodName + " with url="+url+ ", Exception: " + e.toString());
-            throw e;
-
-        }
-    }
-
-    @Override
-    public void logRequest(RequestDetails r) {
-        String methodName = "logRequest";
-        ObjectMapper mapper = new ObjectMapper();
-        String r_json_str = "";
-        if ( r != null ) {
-            r_json_str = r.toString();
-            try {
-                r_json_str = mapper.writeValueAsString(r);
-            }
-            catch ( com.fasterxml.jackson.core.JsonProcessingException j ) {
-                logger.debug(EELFLoggerDelegate.debugLogger,dateFormat.format(new Date()) + "<== " +  methodName + " Unable to parse request as json");
-            }
-        }
-        logger.debug(EELFLoggerDelegate.debugLogger,dateFormat.format(new Date()) + "<== " +  methodName + " Request=(" + r_json_str + ")");
-    }
-    
-    @Override
-    public void logRequest(org.openecomp.vid.changeManagement.RequestDetails r) {
-        String methodName = "logRequest";
-        ObjectMapper mapper = new ObjectMapper();
-        String r_json_str = "";
-        if ( r != null ) {
-            r_json_str = r.toString();
-            try {
-                r_json_str = mapper.writeValueAsString(r);
-            }
-            catch ( com.fasterxml.jackson.core.JsonProcessingException j ) {
-                logger.debug(EELFLoggerDelegate.debugLogger,dateFormat.format(new Date()) + "<== " +  methodName + " Unable to parse request as json");
-            }
-        }
-        logger.debug(EELFLoggerDelegate.debugLogger,dateFormat.format(new Date()) + "<== " +  methodName + " Request=(" + r_json_str + ")");
-    }
-
-	@Override
-	public <T> void Put(T t, org.openecomp.vid.changeManagement.RequestDetailsWrapper r, String sourceID, String path, RestObject<T> restObject) throws Exception {
-		
-	     String methodName = "Put";
-	        String url="";
-
-	        logger.debug(EELFLoggerDelegate.debugLogger,dateFormat.format(new Date()) + "<== " +  methodName + " start");
-
-//	        logRequest (r);
-	        try {
-
-	            initMsoClient();
-
-	            url = SystemProperties.getProperty(MsoProperties.MSO_SERVER_URL) + path;
-	            logger.debug(EELFLoggerDelegate.debugLogger,dateFormat.format(new Date()) + "<== " +  methodName + " sending request to url= " + url);
-	            // Change the content length
-	            final Response cres = client.target(url)
-	                    .request()
-	                    .accept("application/json")
-	                    .headers(commonHeaders)
-	                    //.header("content-length", 201)
-	                    //.header("X-FromAppId",  sourceID)
-	                    .put(Entity.entity(r, MediaType.APPLICATION_JSON));
-
-	            try {
-	                t = (T) cres.readEntity(t.getClass());
-	                restObject.set(t);
-	            }
-	            catch ( Exception e ) {
-	                logger.debug(EELFLoggerDelegate.debugLogger,dateFormat.format(new Date()) + "<== " + methodName + " No response entity, this is probably ok, e="
-	                        + e.getMessage());
-	            }
-
-	            int status = cres.getStatus();
-	            restObject.setStatusCode (status);
-
-	            if ( status >= 200 && status <= 299 ) {
-	                logger.info(EELFLoggerDelegate.errorLogger, dateFormat.format(new Date()) + "<== " + methodName + " REST api POST was successful!");
-	                logger.debug(EELFLoggerDelegate.debugLogger,dateFormat.format(new Date()) + "<== " + methodName + " REST api POST was successful!");
-
-	            } else {
-	                logger.debug(EELFLoggerDelegate.debugLogger,dateFormat.format(new Date()) + "<== " + methodName + " with status="+status+", url="+url);
-	            }
-
-	        } catch (Exception e)
-	        {
-	            logger.debug(EELFLoggerDelegate.debugLogger,dateFormat.format(new Date()) + "<== " + methodName + " with url="+url+ ", Exception: " + e.toString());
-	            throw e;
-
-	        }		
-	}
-}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/mso/RestObject.java b/vid-app-common/src/main/java/org/openecomp/vid/mso/RestObject.java
deleted file mode 100755
index 881409e..0000000
--- a/vid-app-common/src/main/java/org/openecomp/vid/mso/RestObject.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * VID
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *      http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.vid.mso;
-
-/**
- * The Class RestObject.
- *
- * @param <T> the generic type
- */
-public class RestObject<T> {
-
-	/**
-	 * Generic version of the RestObject class.
-	 *
-	 */
-    // T stands for "Type"
-    private T t;
-    
-    /** The status code. */
-    private int statusCode= 0;
-    
-    /**
-     * Sets the.
-     *
-     * @param t the t
-     */
-    public void set(T t) { this.t = t; }
-    
-    /**
-     * Gets the.
-     *
-     * @return the t
-     */
-    public T get() { return t; }
-	
-    /**
-     * Sets the status code.
-     *
-     * @param v the new status code
-     */
-    public void setStatusCode(int v) { this.statusCode = v; }
-    
-    /**
-     * Gets the status code.
-     *
-     * @return the status code
-     */
-    public int getStatusCode() { return this.statusCode; }
-}
-
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/mso/rest/AsyncRequestStatus.java b/vid-app-common/src/main/java/org/openecomp/vid/mso/rest/AsyncRequestStatus.java
deleted file mode 100755
index 1395f9a..0000000
--- a/vid-app-common/src/main/java/org/openecomp/vid/mso/rest/AsyncRequestStatus.java
+++ /dev/null
@@ -1,123 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * VID
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *      http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.vid.mso.rest;
-
-//import java.util.HashMap;
-//import java.util.Map;
-//import javax.annotation.Generated;
-
-import org.openecomp.vid.domain.mso.InstanceIds;
-import org.openecomp.vid.domain.mso.RequestStatus;
-//import com.fasterxml.jackson.annotation.JsonAnyGetter;
-//import com.fasterxml.jackson.annotation.JsonAnySetter;
-//import com.fasterxml.jackson.annotation.JsonCreator;
-//import com.fasterxml.jackson.annotation.JsonIgnore;
-import com.fasterxml.jackson.annotation.JsonInclude;
-import com.fasterxml.jackson.annotation.JsonProperty;
-//import com.fasterxml.jackson.annotation.JsonPropertyOrder;
-//import com.fasterxml.jackson.annotation.JsonValue;
-import org.apache.commons.lang.builder.EqualsBuilder;
-import org.apache.commons.lang.builder.HashCodeBuilder;
-import org.apache.commons.lang.builder.ToStringBuilder;
-
-
-/**
- * request structure.
- */
-@JsonInclude(JsonInclude.Include.NON_NULL)
-
-public class AsyncRequestStatus extends org.openecomp.vid.domain.mso.AsyncRequestStatus {
-
-    
-    /** The instance ids. */
-    private InstanceIds instanceIds;
-   
-    /** The request status. */
-    private RequestStatus requestStatus;
-
-    /* (non-Javadoc)
-     * @see org.openecomp.vid.domain.mso.AsyncRequestStatus#getInstanceIds()
-     */
-    public InstanceIds getInstanceIds() {
-        return instanceIds;
-    }
-
-    /**
-     * Sets the instance ids.
-     *
-     * @param instanceIds the new instance ids
-     */
-    public void setInstanceIds(InstanceIds instanceIds) {
-        this.instanceIds = instanceIds;
-    }
-
-    
-    /**
-     * (Required).
-     *
-     * @return     The requestStatus
-     */
-    @JsonProperty("requestStatus")
-    public RequestStatus getRequestStatus() {
-        return requestStatus;
-    }
-
-    /**
-     * (Required).
-     *
-     * @param requestStatus     The requestStatus
-     */
-    @JsonProperty("requestStatus")
-    public void setRequestStatus(RequestStatus requestStatus) {
-        this.requestStatus = requestStatus;
-    }
-    
-    /* (non-Javadoc)
-     * @see org.openecomp.vid.domain.mso.AsyncRequestStatus#toString()
-     */
-    @Override
-    public String toString() {
-        return ToStringBuilder.reflectionToString(this);
-    }
-
-    /* (non-Javadoc)
-     * @see org.openecomp.vid.domain.mso.AsyncRequestStatus#hashCode()
-     */
-    @Override
-    public int hashCode() {
-        return new HashCodeBuilder().append(getCorrelator()).append(getFinishTime()).append(instanceIds).append(getRequestId()).append(getRequestScope()).append(getRequestStatus()).append(getRequestType()).append(getStartTime()).append(getAdditionalProperties()).toHashCode();
-    }
-
-    /* (non-Javadoc)
-     * @see org.openecomp.vid.domain.mso.AsyncRequestStatus#equals(java.lang.Object)
-     */
-    @Override
-    public boolean equals(Object other) {
-        if (other == this) {
-            return true;
-        }
-        if ((other instanceof AsyncRequestStatus) == false) {
-            return false;
-        }
-        AsyncRequestStatus rhs = ((AsyncRequestStatus) other);
-        return new EqualsBuilder().append(getCorrelator(), rhs.getCorrelator()).append(getFinishTime(), rhs.getFinishTime()).append(instanceIds, rhs.instanceIds).append(getRequestId(), rhs.getRequestId()).append(getRequestScope(), rhs.getRequestScope()).append(getRequestStatus(), rhs.getRequestStatus()).append(getRequestType(), rhs.getRequestType()).append(getStartTime(), rhs.getStartTime()).append(getAdditionalProperties(), rhs.getAdditionalProperties()).isEquals();
-    }
-}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/mso/rest/MsoBusinessLogicNew.java b/vid-app-common/src/main/java/org/openecomp/vid/mso/rest/MsoBusinessLogicNew.java
deleted file mode 100644
index 1afb2df..0000000
--- a/vid-app-common/src/main/java/org/openecomp/vid/mso/rest/MsoBusinessLogicNew.java
+++ /dev/null
@@ -1,67 +0,0 @@
-package org.openecomp.vid.mso.rest;
-
-import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
-import org.openecomp.vid.mso.MsoClientFactory;
-import org.openecomp.vid.mso.MsoInterface;
-import org.openecomp.vid.mso.MsoResponseWrapper;
-
-import java.text.DateFormat;
-import java.text.SimpleDateFormat;
-import java.util.Date;
-
-/**
- * Created by pickjonathan on 21/06/2017.
- * This class was created only for testing the new logic.
- * It is not used by any of the controllers binded to the ui.
- * This can be deleted in the future in order to keep a cleaner project.
- * If deleting please dont forget to delete the controllers, factory and all involved in the assert test.
- */
-public class MsoBusinessLogicNew {
-
-    /**
-     * \
-     * The MSO Client
-     */
-    private MsoInterface msoClient;
-
-    private MsoInterface msoRestTempClient;
-
-    /**
-     * The logger.
-     */
-    EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(MsoBusinessLogicNew.class);
-
-    /**
-     * The Constant dateFormat.
-     */
-    final static DateFormat dateFormat = new SimpleDateFormat("HH:mm:ss:SSSS");
-
-    public MsoBusinessLogicNew() {
-        msoClient = MsoClientFactory.getInstance();
-        msoRestTempClient = new MsoRestClientNew();
-    }
-
-    public MsoResponseWrapper createSvcInstance(RequestDetails msoRequest) throws Exception {
-        String methodName = "createSvcInstance ";
-        logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
-
-//        String endpoint = SystemProperties.getProperty(MsoProperties.MSO_REST_API_SVC_INSTANCE);
-//
-//        MsoResponseWrapper w = createInstance(msoRequest, p);
-
-        MsoResponseWrapper w = msoClient.createSvcInstance(msoRequest, "");
-
-        return w;
-    }
-
-
-    public MsoResponseWrapper createSvcInstanceRest(RequestDetails msoRequest) throws Exception {
-        String methodName = "createSvcInstance ";
-        logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
-
-
-        MsoResponseWrapper w = msoRestTempClient.createSvcInstance(msoRequest, "");
-
-        return w;
-    }
-}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/mso/rest/MsoRestClientNew.java b/vid-app-common/src/main/java/org/openecomp/vid/mso/rest/MsoRestClientNew.java
deleted file mode 100644
index 1beeafb..0000000
--- a/vid-app-common/src/main/java/org/openecomp/vid/mso/rest/MsoRestClientNew.java
+++ /dev/null
@@ -1,333 +0,0 @@
-package org.openecomp.vid.mso.rest;
-
-import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
-import org.openecomp.vid.changeManagement.MsoRequestDetails;
-import org.openecomp.vid.changeManagement.RequestDetailsWrapper;
-import org.openecomp.vid.mso.*;
-import java.text.DateFormat;
-import java.text.SimpleDateFormat;
-import java.util.Date;
-
-
-/**
- * Created by pickjonathan on 21/06/2017.
- */
-public class MsoRestClientNew extends RestMsoImplementation implements MsoInterface {
-
-    /**
-     * The logger.
-     */
-    EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(MsoRestClientNew.class);
-
-    /**
-     * The Constant dateFormat.
-     */
-    final static DateFormat dateFormat = new SimpleDateFormat("HH:mm:ss:SSSS");
-
-    private final String ORIGINAL_REQUEST_ID = "originalRequestId";
-
-
-    @Override
-    public MsoResponseWrapper createSvcInstance(RequestDetails requestDetails, String endpoint) throws Exception {
-        String methodName = "createSvcInstance ";
-        logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
-
-        return createInstance(requestDetails, endpoint);
-    }
-
-    @Override
-    public MsoResponseWrapper createVnf(RequestDetails requestDetails, String endpoint) throws Exception {
-
-        String methodName = "createVnf";
-        logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
-
-        return createInstance(requestDetails, endpoint);
-    }
-
-    @Override
-    public MsoResponseWrapper createNwInstance(RequestDetails requestDetails, String endpoint) throws Exception {
-
-        String methodName = "createNwInstance";
-        logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
-
-        return createInstance(requestDetails, endpoint);
-    }
-
-    @Override
-    public MsoResponseWrapper createVolumeGroupInstance(RequestDetails requestDetails, String endpoint) throws Exception {
-        String methodName = "createVolumeGroupInstance";
-        logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
-
-        return createInstance(requestDetails, endpoint);
-    }
-
-    @Override
-    public MsoResponseWrapper createVfModuleInstance(RequestDetails requestDetails, String endpoint) throws Exception {
-        String methodName = "createVfModuleInstance";
-        logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
-
-        return createInstance(requestDetails, endpoint);
-    }
-
-    @Override
-    public MsoResponseWrapper deleteSvcInstance(RequestDetails requestDetails, String endpoint) throws Exception {
-        String methodName = "deleteSvcInstance";
-        logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
-
-        return deleteInstance(requestDetails, endpoint);
-    }
-
-    @Override
-    public MsoResponseWrapper deleteVnf(RequestDetails requestDetails, String endpoint) throws Exception {
-        String methodName = "deleteVnf";
-        logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
-
-        return deleteInstance(requestDetails, endpoint);
-    }
-
-    @Override
-    public MsoResponseWrapper deleteVfModule(RequestDetails requestDetails, String endpoint) throws Exception {
-        String methodName = "deleteVfModule";
-        logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
-
-        return deleteInstance(requestDetails, endpoint);
-    }
-
-    @Override
-    public MsoResponseWrapper deleteVolumeGroupInstance(RequestDetails requestDetails, String endpoint) throws Exception {
-        String methodName = "deleteVolumeGroupInstance";
-        logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
-
-        return deleteInstance(requestDetails, endpoint);
-    }
-
-    @Override
-    public MsoResponseWrapper deleteNwInstance(RequestDetails requestDetails, String endpoint) throws Exception {
-        String methodName = "deleteNwInstance";
-        logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
-
-        return deleteInstance(requestDetails, endpoint);
-    }
-
-    @Override
-    public void getOrchestrationRequest(String t, String sourceId, String endpoint, RestObject restObject) throws Exception {
-        Get(t, sourceId, endpoint, restObject);
-    }
-
-    public void getManualTasks(String t, String sourceId, String endpoint, RestObject restObject) throws Exception {
-        Get(t, sourceId, endpoint, restObject);
-    }
-
-
-    public MsoResponseWrapper createInstance(RequestDetails request, String path) throws Exception {
-        String methodName = "createInstance";
-        logger.debug(dateFormat.format(new Date()) + "<== " + methodName + " start");
-
-        try {
-            RestObject<String> restObjStr = new RestObject<String>();
-
-            String str = new String();
-
-            restObjStr.set(str);
-
-            Post(str, request, "", path, restObjStr);
-            MsoResponseWrapper w = MsoUtil.wrapResponse(restObjStr);
-
-            return w;
-        } catch (Exception e) {
-            logger.error(EELFLoggerDelegate.errorLogger, dateFormat.format(new Date()) + "<== " + "." + methodName + e.toString());
-            logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + "." + methodName + e.toString());
-            throw e;
-        }
-    }
-
-
-    /**
-     * Delete instance.
-     *
-     * @param request the request
-     * @param path    the path
-     * @return the mso response wrapper
-     * @throws Exception the exception
-     */
-    public MsoResponseWrapper deleteInstance(RequestDetails request, String path) throws Exception {
-        String methodName = "deleteInstance";
-        logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
-
-        try {
-            logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " calling Delete, path =[" + path + "]");
-
-            RestObject<String> restObjStr = new RestObject<String>();
-            String str = new String();
-            restObjStr.set(str);
-            Delete(str, request, "", path, restObjStr);
-            MsoResponseWrapper w = MsoUtil.wrapResponse(restObjStr);
-
-            logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " w=" + w.getResponse());
-            return w;
-
-        } catch (Exception e) {
-            logger.error(EELFLoggerDelegate.errorLogger, dateFormat.format(new Date()) + "<== " + "." + methodName + e.toString());
-            logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + "." + methodName + e.toString());
-            throw e;
-        }
-
-    }
-
-    public MsoResponseWrapper getOrchestrationRequestsForDashboard(String t, String sourceId, String endpoint, RestObject restObject) throws Exception{
-        String methodName = "getOrchestrationRequestsForDashboard";
-        logger.debug(dateFormat.format(new Date()) + "<== " + methodName + " start");
-
-        try {
-            getOrchestrationRequest(t, sourceId, endpoint, restObject);
-            MsoResponseWrapper w = MsoUtil.wrapResponse(restObject);
-            logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " w=" + w.getResponse());
-
-            return w;
-
-        } catch (Exception e){
-            logger.error(EELFLoggerDelegate.errorLogger, dateFormat.format(new Date()) + "<== " + "." + methodName + e.toString());
-            logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + "." + methodName + e.toString());
-            throw e;
-        }
-    }
-
-    public MsoResponseWrapper getManualTasksByRequestId(String t , String sourceId , String endpoint , RestObject restObject) throws Exception{
-        String methodName = "getManualTasksByRequestId";
-        logger.debug(dateFormat.format(new Date()) + "<== " + methodName + " start");
-
-        try {
-            getManualTasks(t , sourceId , endpoint , restObject);
-            MsoResponseWrapper w = MsoUtil.wrapResponse(restObject);
-            logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " w=" + w.getResponse());
-
-            return MsoUtil.wrapResponse(restObject);
-
-        } catch (Exception e){
-            logger.error(EELFLoggerDelegate.errorLogger, dateFormat.format(new Date()) + "<== " + "." + methodName + e.toString());
-            logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + "." + methodName + e.toString());
-            throw e;
-        }
-    }
-
-
-
-    @Override
-    public MsoResponseWrapper completeManualTask(RequestDetails requestDetails, String t, String sourceId, String endpoint, RestObject restObject) throws Exception {
-        String methodName = "completeManualTask";
-        logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " calling Complete ");
-        try {
-
-            Post(t, requestDetails , sourceId, endpoint, restObject);
-            MsoResponseWrapper w = MsoUtil.wrapResponse(restObject);
-
-            logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " w=" + w.getResponse());
-            return w;
-
-        } catch (Exception e) {
-            logger.error(EELFLoggerDelegate.errorLogger, dateFormat.format(new Date()) + "<== " + "." + methodName + e.toString());
-            logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + "." + methodName + e.toString());
-            throw e;
-        }
-    }
-
-    @Override
-    public MsoResponseWrapper replaceVnf(org.openecomp.vid.changeManagement.RequestDetails requestDetails, String endpoint) throws Exception {
-        String methodName = "replaceVnf";
-        logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
-
-        return replaceInstance(requestDetails, endpoint);
-    }
-
-    public MsoResponseWrapper replaceInstance(org.openecomp.vid.changeManagement.RequestDetails request, String path) throws Exception {
-        String methodName = "replaceInstance";
-        logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
-
-        try {
-            logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " calling Replace VNF, path =[" + path + "]");
-
-            RestObject<String> restObjStr = new RestObject<String>();
-            String str = new String();
-            restObjStr.set(str);
-            RequestDetailsWrapper requestDetailsWrapper = new RequestDetailsWrapper();
-            requestDetailsWrapper.requestDetails = new MsoRequestDetails(request);
-
-            Post(str, request, "", path, restObjStr);
-            MsoResponseWrapper msoResponseWrapperObject = MsoUtil.wrapResponse(restObjStr);
-            int status = msoResponseWrapperObject.getStatus();
-            if (status == 202){
-	            logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName +
-	            		",post succeeded, msoResponseWrapperObject response:" + msoResponseWrapperObject.getResponse());
-            }
-            else {
-            		logger.error(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName +
-            				": post failed, msoResponseWrapperObject status" + status + ", response:" + msoResponseWrapperObject.getResponse());
-
-            		// TODO
-            }
-            return msoResponseWrapperObject;
-
-        } catch (Exception e) {
-            logger.info(EELFLoggerDelegate.errorLogger, dateFormat.format(new Date()) + "<== " + "." + methodName + e.toString());
-            logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + "." + methodName + e.toString());
-            throw e;
-        }
-
-    }
-
-    @Override
-    public MsoResponseWrapper updateVnf(org.openecomp.vid.changeManagement.RequestDetails requestDetails, String endpoint) throws Exception {
-        String methodName = "updateVnf";
-        logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
-        RequestDetailsWrapper wrapper = new RequestDetailsWrapper();
-        wrapper.requestDetails = new MsoRequestDetails(requestDetails);;
-        return updateInstance(requestDetails, endpoint);
-    }
-
-    public MsoResponseWrapper updateInstance(org.openecomp.vid.changeManagement.RequestDetails request, String path) throws Exception {
-        String methodName = "updateInstance";
-        logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
-
-        try {
-            logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " calling Delete, path =[" + path + "]");
-
-            RestObject<String> restObjStr = new RestObject<String>();
-            String str = new String();
-            restObjStr.set(str);
-            RequestDetailsWrapper requestDetailsWrapper = new RequestDetailsWrapper();
-            requestDetailsWrapper.requestDetails = new MsoRequestDetails(request);
-
-
-
-            Put(str, requestDetailsWrapper, "", path, restObjStr);
-            MsoResponseWrapper w = MsoUtil.wrapResponse(restObjStr);
-
-            logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " w=" + w.getResponse());
-            return w;
-
-        } catch (Exception e) {
-            logger.info(EELFLoggerDelegate.errorLogger, dateFormat.format(new Date()) + "<== " + "." + methodName + e.toString());
-            logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + "." + methodName + e.toString());
-            throw e;
-        }
-
-    }
-
-    public void activateServiceInstance(RequestDetails requestDetails, String t, String sourceId, String endpoint, RestObject<String> restObject) throws Exception{
-        String methodName = "activateServiceInstance";
-        logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start ");
-        try {
-
-            Post(t, requestDetails , sourceId, endpoint, restObject);
-            MsoResponseWrapper w = MsoUtil.wrapResponse(restObject);
-
-            logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " w =" + w.getResponse());
-
-        } catch (Exception e) {
-            logger.error(EELFLoggerDelegate.errorLogger, dateFormat.format(new Date()) + "<== " + "." + methodName + e.toString());
-            logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + "." + methodName + e.toString());
-            throw e;
-        }
-    }
-
-}
\ No newline at end of file
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/mso/rest/RelatedInstance.java b/vid-app-common/src/main/java/org/openecomp/vid/mso/rest/RelatedInstance.java
deleted file mode 100755
index b68f7c1..0000000
--- a/vid-app-common/src/main/java/org/openecomp/vid/mso/rest/RelatedInstance.java
+++ /dev/null
@@ -1,125 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * VID
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *      http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.vid.mso.rest;
-
-import java.util.HashMap;
-import java.util.Map;
-import javax.annotation.Generated;
-import com.fasterxml.jackson.annotation.JsonAnyGetter;
-import com.fasterxml.jackson.annotation.JsonAnySetter;
-import com.fasterxml.jackson.annotation.JsonIgnore;
-import com.fasterxml.jackson.annotation.JsonInclude;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import com.fasterxml.jackson.annotation.JsonPropertyOrder;
-import org.apache.commons.lang.builder.EqualsBuilder;
-import org.apache.commons.lang.builder.HashCodeBuilder;
-import org.apache.commons.lang.builder.ToStringBuilder;
-
-
-/**
- * modelInfo and optional instanceId and instanceName for a model related to the modelInfo being operated on.
- */
-@JsonInclude(JsonInclude.Include.NON_NULL)
-@Generated("org.jsonschema2pojo")
-@JsonPropertyOrder({
-    "instanceName",
-    "instanceId",
-    "modelInfo"
-})
-public class RelatedInstance extends org.openecomp.vid.domain.mso.RelatedInstance{
-
-
-    /** The model info. */
-    @JsonProperty("modelInfo")
-    private org.openecomp.vid.domain.mso.ModelInfo modelInfo;
-    
-    /** The additional properties. */
-    @JsonIgnore
-    private Map<String, Object> additionalProperties = new HashMap<String, Object>();
-
-    /**
-     * (Required).
-     *
-     * @return     The modelInfo
-     */
-    @JsonProperty("modelInfo")
-    public org.openecomp.vid.domain.mso.ModelInfo getModelInfo() {
-        return modelInfo;
-    }
-
-    /**
-     * (Required).
-     *
-     * @param modelInfo     The modelInfo
-     */
-    @JsonProperty("modelInfo")
-    public void setModelInfo(org.openecomp.vid.domain.mso.ModelInfo modelInfo) {
-        this.modelInfo = modelInfo;
-    }
-
-    /* (non-Javadoc)
-     * @see org.openecomp.vid.domain.mso.RelatedInstance#toString()
-     */
-    @Override
-    public String toString() {
-        return ToStringBuilder.reflectionToString(this);
-    }
-
-    /* (non-Javadoc)
-     * @see org.openecomp.vid.domain.mso.RelatedInstance#getAdditionalProperties()
-     */
-    @JsonAnyGetter
-    public Map<String, Object> getAdditionalProperties() {
-        return this.additionalProperties;
-    }
-
-    /* (non-Javadoc)
-     * @see org.openecomp.vid.domain.mso.RelatedInstance#setAdditionalProperty(java.lang.String, java.lang.Object)
-     */
-    @JsonAnySetter
-    public void setAdditionalProperty(String name, Object value) {
-        this.additionalProperties.put(name, value);
-    }
-
-    /* (non-Javadoc)
-     * @see org.openecomp.vid.domain.mso.RelatedInstance#hashCode()
-     */
-    @Override
-    public int hashCode() {
-        return new HashCodeBuilder().append(getInstanceName()).append(getInstanceId()).append(modelInfo).append(additionalProperties).toHashCode();
-    }
-
-    /* (non-Javadoc)
-     * @see org.openecomp.vid.domain.mso.RelatedInstance#equals(java.lang.Object)
-     */
-    @Override
-    public boolean equals(Object other) {
-        if (other == this) {
-            return true;
-        }
-        if ((other instanceof RelatedInstance) == false) {
-            return false;
-        }
-        RelatedInstance rhs = ((RelatedInstance) other);
-        return new EqualsBuilder().append(getInstanceName(), rhs.getInstanceName()).append(getInstanceId(), rhs.getInstanceId()).append(modelInfo, rhs.getModelInfo()).append(additionalProperties, rhs.additionalProperties).isEquals();
-    }
-
-}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/mso/rest/RelatedModel.java b/vid-app-common/src/main/java/org/openecomp/vid/mso/rest/RelatedModel.java
deleted file mode 100755
index 427d71d..0000000
--- a/vid-app-common/src/main/java/org/openecomp/vid/mso/rest/RelatedModel.java
+++ /dev/null
@@ -1,125 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * VID
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *      http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.vid.mso.rest;
-
-import java.util.HashMap;
-import java.util.Map;
-import com.fasterxml.jackson.annotation.JsonAnyGetter;
-import com.fasterxml.jackson.annotation.JsonAnySetter;
-import com.fasterxml.jackson.annotation.JsonIgnore;
-import com.fasterxml.jackson.annotation.JsonInclude;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import com.fasterxml.jackson.annotation.JsonPropertyOrder;
-import org.apache.commons.lang.builder.EqualsBuilder;
-import org.apache.commons.lang.builder.HashCodeBuilder;
-import org.apache.commons.lang.builder.ToStringBuilder;
-
-
-/**
- * modelInfo and optional instance id for a model related to the modelInfo being operated on.
- */
-@JsonInclude(JsonInclude.Include.NON_NULL)
-@JsonPropertyOrder({
-    "instanceId",
-    "modelInfo"
-})
-public class RelatedModel extends org.openecomp.vid.domain.mso.RelatedModel {
-    
-    /** (Required). */
-    @JsonProperty("modelInfo")
-    private org.openecomp.vid.domain.mso.ModelInfo modelInfo;
-
-//    /** The related model object instance list. */
-//    @JsonProperty("instanceId")
-//    private org.openecomp.vid.domain.mso.InstanceIds instanceId;
-    
-    /** The additional properties. */
-    @JsonIgnore
-    private Map<String, Object> additionalProperties = new HashMap<String, Object>();
-
-    /**
-     * (Required).
-     *
-     * @return     The modelInfo
-     */
-    @JsonProperty("modelInfo")
-    public org.openecomp.vid.domain.mso.ModelInfo getModelInfo() {
-        return modelInfo;
-    }
-
-    /**
-     * (Required).
-     *
-     * @param modelInfo     The modelInfo
-     */
-    @JsonProperty("modelInfo")
-    public void setModelInfo(org.openecomp.vid.domain.mso.ModelInfo modelInfo) {
-        this.modelInfo = modelInfo;
-    }
-
-    /* (non-Javadoc)
-     * @see org.openecomp.vid.domain.mso.RelatedModel#toString()
-     */
-    @Override
-    public String toString() {
-        return ToStringBuilder.reflectionToString(this);
-    }
-
-    /* (non-Javadoc)
-     * @see org.openecomp.vid.domain.mso.RelatedModel#getAdditionalProperties()
-     */
-    @JsonAnyGetter
-    public Map<String, Object> getAdditionalProperties() {
-        return this.additionalProperties;
-    }
-
-    /* (non-Javadoc)
-     * @see org.openecomp.vid.domain.mso.RelatedModel#setAdditionalProperty(java.lang.String, java.lang.Object)
-     */
-    @JsonAnySetter
-    public void setAdditionalProperty(String name, Object value) {
-        this.additionalProperties.put(name, value);
-    }
-
-    /* (non-Javadoc)
-     * @see org.openecomp.vid.domain.mso.RelatedModel#hashCode()
-     */
-    @Override
-    public int hashCode() {
-        return new HashCodeBuilder().append(getInstanceId()).append(modelInfo).append(additionalProperties).toHashCode();
-    }
-
-    /* (non-Javadoc)
-     * @see org.openecomp.vid.domain.mso.RelatedModel#equals(java.lang.Object)
-     */
-    @Override
-    public boolean equals(Object other) {
-        if (other == this) {
-            return true;
-        }
-        if ((other instanceof RelatedModel) == false) {
-            return false;
-        }
-        RelatedModel rhs = ((RelatedModel) other);
-        return new EqualsBuilder().append(getInstanceId(), rhs.getInstanceId()).append(modelInfo, rhs.modelInfo).append(additionalProperties, rhs.additionalProperties).isEquals();
-    }
-
-}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/mso/rest/Request.java b/vid-app-common/src/main/java/org/openecomp/vid/mso/rest/Request.java
deleted file mode 100755
index c8f7b8b..0000000
--- a/vid-app-common/src/main/java/org/openecomp/vid/mso/rest/Request.java
+++ /dev/null
@@ -1,140 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * VID
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *      http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.vid.mso.rest;
-
-//import java.util.HashMap;
-//import java.util.Map;
-//import javax.annotation.Generated;
-
-import org.openecomp.vid.domain.mso.InstanceIds;
-import org.openecomp.vid.domain.mso.RequestStatus;
-//import com.fasterxml.jackson.annotation.JsonAnyGetter;
-//import com.fasterxml.jackson.annotation.JsonAnySetter;
-//import com.fasterxml.jackson.annotation.JsonCreator;
-//import com.fasterxml.jackson.annotation.JsonIgnore;
-//import com.fasterxml.jackson.annotation.JsonInclude;
-import com.fasterxml.jackson.annotation.JsonProperty;
-//import com.fasterxml.jackson.annotation.JsonPropertyOrder;
-//import com.fasterxml.jackson.annotation.JsonValue;
-import org.apache.commons.lang.builder.EqualsBuilder;
-//import org.apache.commons.lang.builder.HashCodeBuilder;
-import org.apache.commons.lang.builder.ToStringBuilder;
-
-
-/**
- * request structure.
- */
-public class Request extends org.openecomp.vid.domain.mso.Request {
-
- 
-    /** The instance ids. */
-    private InstanceIds instanceIds;
-    
-    /** The request details. */
-    private RequestDetails requestDetails;
-    
-    /** The request status. */
-    private RequestStatus requestStatus;
- 
-    
-    /* (non-Javadoc)
-     * @see org.openecomp.vid.domain.mso.Request#getInstanceIds()
-     */
-    @JsonProperty("instanceIds")
-    public InstanceIds getInstanceIds() {
-        return instanceIds;
-    }
-
-    /**
-     * Sets the instance ids.
-     *
-     * @param instanceIds     The instanceIds
-     */
-    @JsonProperty("instanceIds")
-    public void setInstanceIds(InstanceIds instanceIds) {
-        this.instanceIds = instanceIds;
-    }
-
-    /**
-     * (Required).
-     *
-     * @return     The requestDetails
-     */
-    @JsonProperty("requestDetails")
-    public RequestDetails getRequestDetails() {
-        return requestDetails;
-    }
-
-    /**
-     * (Required).
-     *
-     * @param requestDetails     The requestDetails
-     */
-    @JsonProperty("requestDetails")
-    public void setRequestDetails(RequestDetails requestDetails) {
-        this.requestDetails = requestDetails;
-    }
-
-    
-    /**
-     * Gets the request status.
-     *
-     * @return     The requestStatus
-     */
-    @JsonProperty("requestStatus")
-    public RequestStatus getRequestStatus() {
-        return requestStatus;
-    }
-
-    /**
-     * Sets the request status.
-     *
-     * @param requestStatus     The requestStatus
-     */
-    @JsonProperty("requestStatus")
-    public void setRequestStatus(RequestStatus requestStatus) {
-        this.requestStatus = requestStatus;
-    }
-
-  
-    /* (non-Javadoc)
-     * @see org.openecomp.vid.domain.mso.Request#toString()
-     */
-    @Override
-    public String toString() {
-        return ToStringBuilder.reflectionToString(this);
-    }
-    
-    /* (non-Javadoc)
-     * @see org.openecomp.vid.domain.mso.Request#equals(java.lang.Object)
-     */
-    @Override
-    public boolean equals(Object other) {
-        if (other == this) {
-            return true;
-        }
-        if ((other instanceof Request) == false) {
-            return false;
-        }
-        Request rhs = ((Request) other);
-        return new EqualsBuilder().append(getFinishTime(), rhs.getFinishTime()).append(getInstanceIds(), rhs.getInstanceIds()).append(getRequestDetails(), rhs.getRequestDetails()).append(getRequestId(), rhs.getRequestId()).append(getRequestScope(), rhs.getRequestScope()).append(getRequestStatus(), rhs.getRequestStatus()).append(getRequestType(), rhs.getRequestType()).append(getStartTime(), rhs.getStartTime()).append(getAdditionalProperties(), rhs.getAdditionalProperties()).isEquals();
-    }
-}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/mso/rest/RequestDetails.java b/vid-app-common/src/main/java/org/openecomp/vid/mso/rest/RequestDetails.java
deleted file mode 100755
index 0cf697e..0000000
--- a/vid-app-common/src/main/java/org/openecomp/vid/mso/rest/RequestDetails.java
+++ /dev/null
@@ -1,232 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * VID
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *      http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.vid.mso.rest;
-
-import java.util.HashMap;
-import java.util.Map;
-import java.util.List;
-//import javax.annotation.Generated;
-
-import org.openecomp.vid.domain.mso.CloudConfiguration;
-import org.openecomp.vid.domain.mso.ModelInfo;
-import org.openecomp.vid.domain.mso.RequestInfo;
-import org.openecomp.vid.domain.mso.RequestParameters;
-import org.openecomp.vid.domain.mso.SubscriberInfo;
-import com.fasterxml.jackson.annotation.JsonAnyGetter;
-import com.fasterxml.jackson.annotation.JsonAnySetter;
-import com.fasterxml.jackson.annotation.JsonIgnore;
-import com.fasterxml.jackson.annotation.JsonInclude;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import com.fasterxml.jackson.annotation.JsonPropertyOrder;
-import org.apache.commons.lang.builder.EqualsBuilder;
-import org.apache.commons.lang.builder.HashCodeBuilder;
-import org.apache.commons.lang.builder.ToStringBuilder;
-
-
-/**
- * aggregates the context, configuraiton and detailed parameters associated with the request into a single structure.
- */
-@JsonInclude(JsonInclude.Include.NON_NULL)
-@JsonPropertyOrder({
-    "cloudConfiguration",
-    "modelInfo",
-    "relatedModelList",
-    "requestInfo",
-    "subscriberInfo",
-    "requestParameters"
-})
-public class RequestDetails extends org.openecomp.vid.domain.mso.RequestDetails {
-
-    /** The cloud configuration. */
-    @JsonProperty("cloudConfiguration")
-    private CloudConfiguration cloudConfiguration;
-    
-    /** The model info. */
-    @JsonProperty("modelInfo")
-    private ModelInfo modelInfo;
-    
-    /** The related model list. */
-    @JsonProperty("relatedModelList")
-    private List<RelatedModel> relatedInstanceList;
-    
-    /** The request info. */
-    @JsonProperty("requestInfo")
-    private RequestInfo requestInfo;
-    
-    /** The subscriber info. */
-    @JsonProperty("subscriberInfo")
-    private SubscriberInfo subscriberInfo;
-    
-    /** The request parameters. */
-    @JsonProperty("requestParameters")
-    private RequestParameters requestParameters;
-    
-    /** The additional properties. */
-    @JsonIgnore
-    private Map<String, Object> additionalProperties = new HashMap<String, Object>();
-
-    /**
-     * Gets the cloud configuration.
-     *
-     * @return     The cloudConfiguration
-     */
-    @JsonProperty("cloudConfiguration")
-    public CloudConfiguration getCloudConfiguration() {
-        return cloudConfiguration;
-    }
-
-    /**
-     * Sets the cloud configuration.
-     *
-     * @param cloudConfiguration     The cloudConfiguration
-     */
-    @JsonProperty("cloudConfiguration")
-    public void setCloudConfiguration(CloudConfiguration cloudConfiguration) {
-        this.cloudConfiguration = cloudConfiguration;
-    }
-
-    /**
-     * Gets the model info.
-     *
-     * @return     The modelInfo
-     */
-    @JsonProperty("modelInfo")
-    public ModelInfo getModelInfo() {
-        return modelInfo;
-    }
-
-    /**
-     * Sets the model info.
-     *
-     * @param modelInfo     The modelInfo
-     */
-    @JsonProperty("modelInfo")
-    public void setModelInfo(ModelInfo modelInfo) {
-        this.modelInfo = modelInfo;
-    }
-    /**
-     * Gets the related instance list.
-     *
-     * @return     The relatedInstanceList
-     */
-    @JsonProperty("relatedInstanceList")
-    public List<RelatedModel> getRelatedInstanceList() {
-        return relatedInstanceList;
-    }
-
-    /**
-     * Sets the related model list.
-     *
-     * @param relatedInstanceList     The relatedInstanceList
-     */
-    @JsonProperty("relatedInstanceList")
-    public void setRelatedInstanceList( List<RelatedModel> relatedInstanceList) {
-        this.relatedInstanceList = relatedInstanceList;
-    }
-
-    /**
-     * Gets the request info.
-     *
-     * @return     The requestInfo
-     */
-    @JsonProperty("requestInfo")
-    public RequestInfo getRequestInfo() {
-        return requestInfo;
-    }
-
-    /**
-     * Sets the request info.
-     *
-     * @param requestInfo     The requestInfo
-     */
-    @JsonProperty("requestInfo")
-    public void setRequestInfo(RequestInfo requestInfo) {
-        this.requestInfo = requestInfo;
-    }
-    
-    /**
-     * Gets the subscriber info.
-     *
-     * @return     The subscriberInfo
-     */
-    @JsonProperty("subscriberInfo")
-    public SubscriberInfo getSubscriberInfo() {
-        return subscriberInfo;
-    }
-
-    /**
-     * Sets the subscriber info.
-     *
-     * @param subscriberInfo     The subscriberInfo
-     */
-    @JsonProperty("subscriberInfo")
-    public void setSubscriberInfo(SubscriberInfo subscriberInfo) {
-        this.subscriberInfo = subscriberInfo;
-    }
-
-    /* (non-Javadoc)
-     * @see org.openecomp.vid.domain.mso.RequestDetails#toString()
-     */
-    @Override
-    public String toString() {
-        return ToStringBuilder.reflectionToString(this);
-    }
-
-    /* (non-Javadoc)
-     * @see org.openecomp.vid.domain.mso.RequestDetails#getAdditionalProperties()
-     */
-    @JsonAnyGetter
-    public Map<String, Object> getAdditionalProperties() {
-        return this.additionalProperties;
-    }
-
-    /* (non-Javadoc)
-     * @see org.openecomp.vid.domain.mso.RequestDetails#setAdditionalProperty(java.lang.String, java.lang.Object)
-     */
-    @JsonAnySetter
-    public void setAdditionalProperty(String name, Object value) {
-        this.additionalProperties.put(name, value);
-    }
-
-    /* (non-Javadoc)
-     * @see org.openecomp.vid.domain.mso.RequestDetails#hashCode()
-     */
-    @Override
-    public int hashCode() {
-        return new HashCodeBuilder().append(cloudConfiguration).append(modelInfo).append(relatedInstanceList).append(requestInfo).append(getRequestParameters()).append(subscriberInfo).append(additionalProperties).toHashCode();
-    }
-
-    /* (non-Javadoc)
-     * @see org.openecomp.vid.domain.mso.RequestDetails#equals(java.lang.Object)
-     */
-    @Override
-    public boolean equals(Object other) {
-        if (other == this) {
-            return true;
-        }
-        if ((other instanceof RequestDetails) == false) {
-            return false;
-        }
-        RequestDetails rhs = ((RequestDetails) other);
-        return new EqualsBuilder().append(cloudConfiguration, rhs.cloudConfiguration).append(modelInfo, rhs.modelInfo).append(relatedInstanceList, rhs.relatedInstanceList).append(requestInfo, rhs.requestInfo).append(getRequestParameters(), rhs.getRequestParameters()).append(subscriberInfo, rhs.subscriberInfo).append(additionalProperties, rhs.additionalProperties).isEquals();
-    }
-
-}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/mso/rest/RequestList.java b/vid-app-common/src/main/java/org/openecomp/vid/mso/rest/RequestList.java
deleted file mode 100755
index 8a57c74..0000000
--- a/vid-app-common/src/main/java/org/openecomp/vid/mso/rest/RequestList.java
+++ /dev/null
@@ -1,137 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * VID
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *      http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.vid.mso.rest;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import javax.annotation.Generated;
-
-import com.fasterxml.jackson.annotation.JsonAnyGetter;
-import com.fasterxml.jackson.annotation.JsonAnySetter;
-import com.fasterxml.jackson.annotation.JsonIgnore;
-import com.fasterxml.jackson.annotation.JsonInclude;
-import com.fasterxml.jackson.annotation.JsonPropertyOrder;
-
-//import com.fasterxml.jackson.annotation.JsonInclude;
-//import com.fasterxml.jackson.annotation.JsonProperty;
-//import com.fasterxml.jackson.annotation.JsonPropertyOrder;
-import org.apache.commons.lang.builder.EqualsBuilder;
-import org.apache.commons.lang.builder.HashCodeBuilder;
-import org.apache.commons.lang.builder.ToStringBuilder;
-import java.util.List;
-
-/**
- * List of relatedModel structures that are related to a modelInfo being operated on.
- */
-@JsonInclude(JsonInclude.Include.NON_NULL)
-@Generated("org.jsonschema2pojo")
-@JsonPropertyOrder({
-    "finishTime",
-    "instanceIds",
-    "requestDetails",
-    "requestId",
-    "requestScope",
-    "requestStatus",
-    "requestType",
-    "startTime"
-})
-
-public class RequestList {
-    
-    /** The request list. */
-    private List<RequestWrapper> requestList;
-    
-    /** The additional properties. */
-    @JsonIgnore
-    private Map<String, Object> additionalProperties = new HashMap<String, Object>();
-
-    /**
-     * (Required).
-     *
-     * @return     The RelatedModel List
-     */
-    public List<RequestWrapper> getRequestList() {
-        return requestList;
-    }
-
-    /**
-     * Sets the request list.
-     *
-     * @param l the new request list
-     */
-    public void setRequestList(List<RequestWrapper> l) {
-        this.requestList = l;
-    }
-
-    /* (non-Javadoc)
-     * @see java.lang.Object#toString()
-     */
-    @Override
-    public String toString() {
-        return ToStringBuilder.reflectionToString(this);
-    }
-
-    /**
-     * Gets the additional properties.
-     *
-     * @return the additional properties
-     */
-    @JsonAnyGetter
-    public Map<String, Object> getAdditionalProperties() {
-        return this.additionalProperties;
-    }
-
-    /**
-     * Sets the additional property.
-     *
-     * @param name the name
-     * @param value the value
-     */
-    @JsonAnySetter
-    public void setAdditionalProperty(String name, Object value) {
-        this.additionalProperties.put(name, value);
-    }
-
-    /* (non-Javadoc)
-     * @see java.lang.Object#hashCode()
-     */
-    @Override
-    public int hashCode() {
-        return new HashCodeBuilder().append(getRequestList()).append(additionalProperties).toHashCode();
-    }
-
-    /* (non-Javadoc)
-     * @see java.lang.Object#equals(java.lang.Object)
-     */
-    @Override
-    public boolean equals(Object other) {
-        if (other == this) {
-            return true;
-        }
-        if ((other instanceof RequestList) == false) {
-            return false;
-        }
-        RequestList rhs = ((RequestList) other);
-        return new EqualsBuilder().append(getRequestList(), rhs.getRequestList()).append(additionalProperties, rhs.additionalProperties).isEquals();
-    }
-
-}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/mso/rest/RequestWrapper.java b/vid-app-common/src/main/java/org/openecomp/vid/mso/rest/RequestWrapper.java
deleted file mode 100644
index b0e9fa1..0000000
--- a/vid-app-common/src/main/java/org/openecomp/vid/mso/rest/RequestWrapper.java
+++ /dev/null
@@ -1,35 +0,0 @@
-package org.openecomp.vid.mso.rest;
-
-import com.fasterxml.jackson.annotation.JsonProperty;
-
-/**
- * request wrapper structure.
- */
-public class RequestWrapper {
-
-
-    /** The request. */
-    private Request request;
-
-
-    /**
-     * Gets the request.
-     *
-     * @return     The requestDetails
-     */
-    @JsonProperty("request")
-    public Request getRequest() {
-        return request;
-    }
-
-    /**
-     * Sets the request.
-     *
-     * @param request     The request
-     */
-    @JsonProperty
-    public void setRequest(Request request) {
-        this.request = request;
-    }
-
-}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/mso/rest/Response.java b/vid-app-common/src/main/java/org/openecomp/vid/mso/rest/Response.java
deleted file mode 100644
index ee3a8bf..0000000
--- a/vid-app-common/src/main/java/org/openecomp/vid/mso/rest/Response.java
+++ /dev/null
@@ -1,54 +0,0 @@
-package org.openecomp.vid.mso.rest;
-
-import com.fasterxml.jackson.annotation.JsonProperty;
-
-public class Response {
-
-    /** The status. */
-    private int status;
-
-    /** The entity. */
-    private RequestList entity;
-
-    /**
-     * Gets the status.
-     *
-     * @return     The status
-     */
-    @JsonProperty("status")
-    public int getStatus() {
-        return status;
-    }
-
-    /**
-     * Sets the status.
-     *
-     * @param status     The status
-     */
-    @JsonProperty("status")
-    public void setStatus(int status) {
-        this.status = status;
-    }
-
-    /**
-     * Gets the entity.
-     *
-     * @return     The entity
-     */
-    @JsonProperty("entity")
-    public RequestList getEntity() {
-        return entity;
-    }
-
-    /**
-     * Sets the entity.
-     *
-     * @param entity     The entity
-     */
-    @JsonProperty("entity")
-    public void setEntity(RequestList entity) {
-        this.entity = entity;
-    }
-
-
-}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/mso/rest/RestInterface.java b/vid-app-common/src/main/java/org/openecomp/vid/mso/rest/RestInterface.java
deleted file mode 100644
index 1e27335..0000000
--- a/vid-app-common/src/main/java/org/openecomp/vid/mso/rest/RestInterface.java
+++ /dev/null
@@ -1,81 +0,0 @@
-package org.openecomp.vid.mso.rest;
-
-import org.openecomp.vid.mso.RestObject;
-
-/**
- * Created by pickjonathan on 26/06/2017.
- */
-public interface RestInterface {
-
-    /**
-     * Inits the rest client.
-     */
-    public void initMsoClient();
-
-    /**
-     * Gets the.
-     *
-     * @param <T> the generic type
-     * @param t the t
-     * @param sourceId the source id
-     * @param path the path
-     * @param restObject the rest object
-     * @throws Exception the exception
-     */
-    public <T> void Get (T t, String sourceId, String path, RestObject<T> restObject ) throws Exception;
-
-    /**
-     * Delete.
-     *
-     * @param <T> the generic type
-     * @param t the t
-     * @param r the r
-     * @param sourceID the source ID
-     * @param path the path
-     * @param restObject the rest object
-     * @throws Exception the exception
-     */
-    public <T> void Delete(T t, RequestDetails r, String sourceID, String path, RestObject<T> restObject) throws Exception;
-
-    /**
-     * Post.
-     *
-     * @param <T> the generic type
-     * @param t the t
-     * @param r the r
-     * @param sourceID the source ID
-     * @param path the path
-     * @param restObject the rest object
-     * @throws Exception the exception
-     */
-    public <T> void Post(T t, RequestDetails r, String sourceID, String path, RestObject<T> restObject) throws Exception;
-    
-    /**
-     * Put.
-     *
-     * @param <T> the generic type
-     * @param t the t
-     * @param r the r
-     * @param sourceID the source ID
-     * @param path the path
-     * @param restObject the rest object
-     * @throws Exception the exception
-     */
-    public <T> void Put(T t, org.openecomp.vid.changeManagement.RequestDetailsWrapper r, String sourceID, String path, RestObject<T> restObject) throws Exception;
-
-
-    /***
-     * Log request.
-     *
-     * @param r the r
-     */
-    public void logRequest ( RequestDetails r  );
-    /***
-     * Log request.
-     *
-     * @param r the r
-     */
-    public void logRequest(org.openecomp.vid.changeManagement.RequestDetails r);
-
-
-}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/mso/rest/Task.java b/vid-app-common/src/main/java/org/openecomp/vid/mso/rest/Task.java
deleted file mode 100644
index 8d72890..0000000
--- a/vid-app-common/src/main/java/org/openecomp/vid/mso/rest/Task.java
+++ /dev/null
@@ -1,119 +0,0 @@
-package org.openecomp.vid.mso.rest;
-
-import java.util.List;
-
-public class Task {
-
-    private String taskId;
-    private String type;
-    private String nfRole;
-    private String subscriptionServiceType;
-    private String originalRequestId;
-    private String originalRequestorId;
-    private String errorSource;
-    private String errorCode;
-    private String errorMessage;
-    private String buildingBlockName;
-    private String buildingBlockStep;
-    private List<String> validResponses;
-
-
-    public String getTaskId() {
-        return taskId;
-    }
-
-    public void setTaskId(String taskId) {
-        this.taskId = taskId;
-    }
-
-    public String getType() {
-        return type;
-    }
-
-    public void setType(String type) {
-        this.type = type;
-    }
-
-    public String getNfRole() {
-        return nfRole;
-    }
-
-    public void setNfRole(String nfRole) {
-        this.nfRole = nfRole;
-    }
-
-    public String getSubscriptionServiceType() {
-        return subscriptionServiceType;
-    }
-
-    public void setSubscriptionServiceType(String subscriptionServiceType) {
-        this.subscriptionServiceType = subscriptionServiceType;
-    }
-
-    public String getOriginalRequestId() {
-        return originalRequestId;
-    }
-
-    public void setOriginalRequestId(String originalRequestId) {
-        this.originalRequestId = originalRequestId;
-    }
-
-    public String getOriginalRequestorId() {
-        return originalRequestorId;
-    }
-
-    public void setOriginalRequestorId(String originalRequestorId) {
-        this.originalRequestorId = originalRequestorId;
-    }
-
-    public String getErrorSource() {
-        return errorSource;
-    }
-
-    public void setErrorSource(String errorSource) {
-        this.errorSource = errorSource;
-    }
-
-    public String getErrorCode() {
-        return errorCode;
-    }
-
-    public void setErrorCode(String errorCode) {
-        this.errorCode = errorCode;
-    }
-
-    public String getErrorMessage() {
-        return errorMessage;
-    }
-
-    public void setErrorMessage(String errorMessage) {
-        this.errorMessage = errorMessage;
-    }
-
-    public String getBuildingBlockName() {
-        return buildingBlockName;
-    }
-
-    public void setBuildingBlockName(String buildingBlockName) {
-        this.buildingBlockName = buildingBlockName;
-    }
-
-    public String getBuildingBlockStep() {
-        return buildingBlockStep;
-    }
-
-    public void setBuildingBlockStep(String buildingBlockStep) {
-        this.buildingBlockStep = buildingBlockStep;
-    }
-
-    public List<String> getValidResponses() {
-        return validResponses;
-    }
-
-    public void setValidResponses(List<String> validResponses) {
-        this.validResponses = validResponses;
-    }
-
-
-
-}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/mso/rest/TaskList.java b/vid-app-common/src/main/java/org/openecomp/vid/mso/rest/TaskList.java
deleted file mode 100644
index 7232364..0000000
--- a/vid-app-common/src/main/java/org/openecomp/vid/mso/rest/TaskList.java
+++ /dev/null
@@ -1,16 +0,0 @@
-package org.openecomp.vid.mso.rest;
-
-import java.util.List;
-
-public class TaskList {
-
-    public List<Task> getTaskList() {
-        return taskList;
-    }
-
-    public void setTaskList(List<Task> taskList) {
-        this.taskList = taskList;
-    }
-
-    private List<Task> taskList;
-}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/policy/PolicyProperties.java b/vid-app-common/src/main/java/org/openecomp/vid/policy/PolicyProperties.java
deleted file mode 100644
index d273aa6..0000000
--- a/vid-app-common/src/main/java/org/openecomp/vid/policy/PolicyProperties.java
+++ /dev/null
@@ -1,26 +0,0 @@
-package org.openecomp.vid.policy;
-
-import org.openecomp.portalsdk.core.util.SystemProperties;
-
-
-public class PolicyProperties extends SystemProperties {
-	
-	public static final String POLICY_CLIENTAUTH_VAL =  "policy.ClientAuth";
-	
-	public static final String POLICY_CLIENT_MECHID_VAL =  "policy.client.mechId";
-	
-	public static final String POLICY_CLIENT_PASSWORD_VAL =  "policy.client.password";
-	
-	public static final String POLICY_USERNAME_VAL =  "policy.username";
-	
-	public static final String POLICY_PASSWORD_VAL =  "policy.password";
-	
-	public static final String POLICY_AUTHORIZATION_VAL = "policy.Authorization";
-	
-	public static final String POLICY_SERVER_URL_VAL = "policy.server.url";
-	
-	public static final String POLICY_ENVIRONMENT_VAL = "policy.environment";
-	
-	public static final String POLICY_GET_CONFIG_VAL = "policy.get.config"; 
-	
-}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/policy/PolicyResponseWrapper.java b/vid-app-common/src/main/java/org/openecomp/vid/policy/PolicyResponseWrapper.java
deleted file mode 100644
index 02ca0f0..0000000
--- a/vid-app-common/src/main/java/org/openecomp/vid/policy/PolicyResponseWrapper.java
+++ /dev/null
@@ -1,56 +0,0 @@
-package org.openecomp.vid.policy;
-
-import com.fasterxml.jackson.annotation.JsonInclude;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import com.fasterxml.jackson.annotation.JsonPropertyOrder;
-import org.apache.commons.lang.builder.ToStringBuilder;
-
-/**
- * This wrapper encapsulates the Policy response
- */
-@JsonInclude(JsonInclude.Include.NON_NULL)
-@JsonPropertyOrder({
-	    "status",
-	    "entity"
-})
-
-public class PolicyResponseWrapper {
-	
-	@JsonProperty("status")
-	private int status;
-
-	@JsonProperty("entity")
-	private String entity;
-
-	@JsonProperty("entity")
-    public String getEntity() {
-        return entity;
-    }
-	
-	@JsonProperty("status")
-    public int getStatus() {
-        return status;
-    }	
-	
-	@JsonProperty("status")
-    public void setStatus(int v) {
-        this.status = v;
-    }
-
-	@JsonProperty("entity")
-    public void setEntity(String v) {
-        this.entity = v;
-    }
-
-    @Override
-    public String toString() {
-        return ToStringBuilder.reflectionToString(this);
-    }
-
-    public String getResponse () {
-    	
-    	StringBuilder b = new StringBuilder ("{ \"status\": ");
-        b.append(getStatus()).append(", \"entity\": " ).append(this.getEntity()).append("}");
-        return (b.toString());
-    }
-}
\ No newline at end of file
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/policy/PolicyRestInt.java b/vid-app-common/src/main/java/org/openecomp/vid/policy/PolicyRestInt.java
deleted file mode 100644
index 7c075a5..0000000
--- a/vid-app-common/src/main/java/org/openecomp/vid/policy/PolicyRestInt.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * VID
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *      http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.vid.policy;
-
-import java.text.DateFormat;
-import java.text.SimpleDateFormat;
-import java.util.Date;
-
-import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
-import org.openecomp.vid.policy.rest.RequestDetails;
-
-import com.fasterxml.jackson.databind.ObjectMapper;
-
-public class PolicyRestInt {
-	
-	/** The logger. */
-	EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(PolicyRestInterface.class);
-	
-	/** The Constant dateFormat. */
-	final static DateFormat dateFormat = new SimpleDateFormat("HH:mm:ss:SSSS");
-	
-	/** The request date format. */
-	public DateFormat requestDateFormat = new SimpleDateFormat("EEE, dd MMM YYYY HH:mm:ss z");
-	
-	public PolicyRestInt() {
-		requestDateFormat.setTimeZone(java.util.TimeZone.getTimeZone("GMT"));
-	}
-
-	/**
-	 * Log request.
-	 *
-	 * @param r the r
-	 */
-	public void logRequest ( RequestDetails r ) {
-    	String methodName = "logRequest";
-	    ObjectMapper mapper = new ObjectMapper();
-	    String r_json_str = "";
-	    if ( r != null ) {
-	    	r_json_str = r.toString();
-		    try {
-		    	r_json_str = mapper.writeValueAsString(r);
-		    }
-		    catch ( com.fasterxml.jackson.core.JsonProcessingException j ) {
-		    	logger.debug(EELFLoggerDelegate.debugLogger,dateFormat.format(new Date()) + "<== " +  methodName + " Unable to parse request as json");
-		    }
-	    }
-	    logger.debug(EELFLoggerDelegate.debugLogger,dateFormat.format(new Date()) + "<== " +  methodName + " Request=(" + r_json_str + ")");  
-    }
-}
\ No newline at end of file
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/policy/PolicyRestInterface.java b/vid-app-common/src/main/java/org/openecomp/vid/policy/PolicyRestInterface.java
deleted file mode 100644
index d6a59da..0000000
--- a/vid-app-common/src/main/java/org/openecomp/vid/policy/PolicyRestInterface.java
+++ /dev/null
@@ -1,234 +0,0 @@
-package org.openecomp.vid.policy;
-
-import java.text.DateFormat;
-import java.text.SimpleDateFormat;
-import java.util.Collections;
-import java.util.Date;
-
-import javax.ws.rs.client.Client;
-import javax.ws.rs.client.Entity;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.MultivaluedHashMap;
-import javax.ws.rs.core.Response;
-
-import org.apache.commons.codec.binary.Base64;
-import org.eclipse.jetty.util.security.Password;
-import org.json.simple.JSONObject;
-import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
-import org.openecomp.portalsdk.core.util.SystemProperties;
-import org.openecomp.vid.client.HttpBasicClient;
-import org.openecomp.vid.policy.rest.RequestDetails;
-
-public class PolicyRestInterface extends PolicyRestInt implements PolicyRestInterfaceIfc {
-
-	/** The logger. */
-	EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(PolicyRestInterface.class);
-	
-	/** The Constant dateFormat. */
-	final static DateFormat dateFormat = new SimpleDateFormat("HH:mm:ss:SSSS");
-	
-	/** The client. */
-	private static Client client = null;
-	
-	/** The common headers. */
-	private MultivaluedHashMap<String, Object> commonHeaders;
-	
-	public PolicyRestInterface() {
-		super();
-	}
-	
-	public void initRestClient()
-	{
-		final String methodname = "initRestClient()";
-		
-		//final String clientAuth = SystemProperties.getProperty(PolicyProperties.POLICY_CLIENTAUTH_VAL);
-		//final String authorization = SystemProperties.getProperty(PolicyProperties.POLICY_AUTHORIZATION_VAL);
-		final String mechId = SystemProperties.getProperty(PolicyProperties.POLICY_CLIENT_MECHID_VAL);
-		final String clientPassword = SystemProperties.getProperty(PolicyProperties.POLICY_CLIENT_PASSWORD_VAL);
-		final String username = SystemProperties.getProperty(PolicyProperties.POLICY_USERNAME_VAL);
-		final String password = SystemProperties.getProperty(PolicyProperties.POLICY_PASSWORD_VAL);
-		final String environment = SystemProperties.getProperty(PolicyProperties.POLICY_ENVIRONMENT_VAL);
-				
-		final String decrypted_client_password = Password.deobfuscate(clientPassword);		
-		String mechAuthString = mechId + ":" + decrypted_client_password;		
-		byte[] mechAuthEncBytes = Base64.encodeBase64(mechAuthString.getBytes());
-		String clientAuth = new String(mechAuthEncBytes);
-		
-		final String decrypted_password = Password.deobfuscate(password);		
-		String authString = username + ":" + decrypted_password;		
-		byte[] authEncBytes = Base64.encodeBase64(authString.getBytes());
-		String authorization = new String(authEncBytes);
-		
-		commonHeaders = new MultivaluedHashMap<String, Object> ();
-		commonHeaders.put("ClientAuth",  Collections.singletonList((Object) ("Basic " + clientAuth)));
-		commonHeaders.put("Authorization",  Collections.singletonList((Object) ("Basic " + authorization)));
-		commonHeaders.put("Environment",  Collections.singletonList((Object) (environment)));
-		
-		if (client == null) {
-			
-			try {
-				client = HttpBasicClient.getClient();
-			} catch (Exception e) {
-				System.out.println(  methodname + " Unable to get the SSL client");
-			}
-		}
-	}
-	
-	@SuppressWarnings("unchecked")
-	public <T> void  Get (T t, String sourceId, String path, RestObject<T> restObject ) throws Exception {
-		String methodName = "Get";
-		
-		logger.debug(EELFLoggerDelegate.debugLogger, methodName + " start");
-		
-		String url="";
-		restObject.set(t);
-		
-		url = SystemProperties.getProperty(PolicyProperties.POLICY_SERVER_URL_VAL) + path;
-        logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " +  methodName + " sending request to url= " + url);
-		
-        initRestClient();
-		
-		final Response cres = client.target(url)
-			 .request()
-	         .accept("application/json")
-	         .headers(commonHeaders)
-	         .get();
-		
-		int status = cres.getStatus();
-		restObject.setStatusCode (status);
-		
-		if (status == 200) {
-			 t = (T) cres.readEntity(t.getClass());
-			 restObject.set(t);
-			 logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + methodName + " REST api was successfull!");
-		    
-		 } else {
-		     throw new Exception(methodName + " with status="+ status + ", url= " + url );
-		 }
-
-		logger.debug(EELFLoggerDelegate.debugLogger,methodName + " received status=" + status );
-		
-		return;
-	}
-   
-   @SuppressWarnings("unchecked")
-   	public <T> void Delete(T t, RequestDetails r, String sourceID, String path, RestObject<T> restObject) {
-	 
-		String methodName = "Delete";
-		String url="";
-		Response cres = null;
-		
-		logger.debug(EELFLoggerDelegate.debugLogger,dateFormat.format(new Date()) + "<== " +  methodName + " start");
-		logRequest (r);
-
-		try {
-			initRestClient();
-			
-			url = SystemProperties.getProperty(PolicyProperties.POLICY_SERVER_URL_VAL) + path;
-			logger.debug(EELFLoggerDelegate.debugLogger,dateFormat.format(new Date()) + " methodName sending request to: " + url);
-	
-			cres = client.target(url)
-					 .request()
-			         .accept("application/json")
-	        		 .headers(commonHeaders)
-			         //.entity(r)
-			         .build("DELETE", Entity.entity(r, MediaType.APPLICATION_JSON)).invoke();
-			       //  .method("DELETE", Entity.entity(r, MediaType.APPLICATION_JSON));
-			         //.delete(Entity.entity(r, MediaType.APPLICATION_JSON));
-			
-			int status = cres.getStatus();
-	    	restObject.setStatusCode (status);
-	    	
-			if (status == 404) { // resource not found
-				String msg = "Resource does not exist...: " + cres.getStatus();
-				logger.debug(EELFLoggerDelegate.debugLogger,dateFormat.format(new Date()) + "<== " + msg);
-			} else if (status == 200  || status == 204){
-				logger.debug(EELFLoggerDelegate.debugLogger,dateFormat.format(new Date()) + "<== " + "Resource " + url + " deleted");
-			} else if (status == 202) {
-				String msg = "Delete in progress: " + status;
-				logger.debug(EELFLoggerDelegate.debugLogger,dateFormat.format(new Date()) + "<== " + msg);
-			}
-			else {
-				String msg = "Deleting Resource failed: " + status;
-					logger.debug(EELFLoggerDelegate.debugLogger,dateFormat.format(new Date()) + "<== " + msg);
-			}
-			
-			try {
-	   			t = (T) cres.readEntity(t.getClass());
-	   			restObject.set(t);
-            }
-            catch ( Exception e ) {
-            	logger.debug(EELFLoggerDelegate.debugLogger,dateFormat.format(new Date()) + "<== " + methodName + " No response entity, this is probably ok, e="
-            			+ e.getMessage());
-            }
-   
-        } 
-		catch (Exception e)
-        {
-        	 logger.debug(EELFLoggerDelegate.debugLogger,dateFormat.format(new Date()) + "<== " + methodName + " with url="+url+ ", Exception: " + e.toString());
-        	 throw e;
-        
-        }
-	}
-	
-	@SuppressWarnings("unchecked")
-	public <T> void Post(T t, JSONObject requestDetails, String uuid, String path, RestObject<T> restObject) throws Exception {
-		
-        String methodName = "Post";
-        String url="";
-
-        System.out.println( "POST policy rest interface");
-       
-     //   logRequest (requestDetails);
-        try {
-            
-            initRestClient();    
-    
-            url = SystemProperties.getProperty(PolicyProperties.POLICY_SERVER_URL_VAL) + path;
-            System.out.println( "<== " +  methodName + " sending request to url= " + url);
-            // Change the content length
-            final Response cres = client.target(url)
-            	 .request()
-                 .accept("application/json")
-	        	 .headers(commonHeaders)
-                 //.header("content-length", 201)
-                 //.header("X-FromAppId",  sourceID)
-                 .post(Entity.entity(requestDetails, MediaType.APPLICATION_JSON));
-            
-            try {
-	   			t = (T) cres.readEntity(t.getClass());
-	   			restObject.set(t);
-            }
-            catch ( Exception e ) {
-            	
-            	System.out.println("<== " + methodName + " No response entity, this is probably ok, e=" + e.getMessage());
-            }
-
-            int status = cres.getStatus();
-    		restObject.setStatusCode (status);
-    		
-    		if ( status >= 200 && status <= 299 ) {
-    			System.out.println( "<== " + methodName + " REST api POST was successful!");
-    		
-             } else {
-            	 System.out.println( "<== " + methodName + " with status="+status+", url="+url);
-             }    
-   
-        } catch (Exception e)
-        {
-        	System.out.println( "<== " + methodName + " with url="+url+ ", Exception: " + e.toString());
-        	 throw e;
-        
-        }
-    }
-	
-	public <T> T getInstance(Class<T> clazz) throws IllegalAccessException, InstantiationException
-	{
-		return clazz.newInstance();
-	}
-
-	@Override
-	public void logRequest(RequestDetails r) {
-		// TODO Auto-generated method stub
-	} 	
-}
\ No newline at end of file
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/policy/PolicyRestInterfaceFactory.java b/vid-app-common/src/main/java/org/openecomp/vid/policy/PolicyRestInterfaceFactory.java
deleted file mode 100644
index 1570875..0000000
--- a/vid-app-common/src/main/java/org/openecomp/vid/policy/PolicyRestInterfaceFactory.java
+++ /dev/null
@@ -1,14 +0,0 @@
-
-package org.openecomp.vid.policy;
-
-public class PolicyRestInterfaceFactory {
-
-	
-	public static PolicyRestInterfaceIfc getInstance () {
-		PolicyRestInterfaceIfc obj = null;
-
-		obj = new PolicyRestInterface();
-		
-		return ( obj );
-	}
-}
\ No newline at end of file
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/policy/PolicyRestInterfaceIfc.java b/vid-app-common/src/main/java/org/openecomp/vid/policy/PolicyRestInterfaceIfc.java
deleted file mode 100644
index f56924b..0000000
--- a/vid-app-common/src/main/java/org/openecomp/vid/policy/PolicyRestInterfaceIfc.java
+++ /dev/null
@@ -1,58 +0,0 @@
-
-package org.openecomp.vid.policy;
-
-import org.json.simple.JSONObject;
-import org.openecomp.vid.policy.rest.RequestDetails;
-
-public interface PolicyRestInterfaceIfc {	
-	/**
-	 * Inits the rest client.
-	 */
-	public void initRestClient();
-	
-	/**
-	 * Gets the.
-	 *
-	 * @param <T> the generic type
-	 * @param t the t
-	 * @param sourceId the source id
-	 * @param path the path
-	 * @param restObject the rest object
-	 * @throws Exception the exception
-	 */
-	public <T> void Get (T t, String sourceId, String path, RestObject<T> restObject ) throws Exception;
-	
-	/**
-	 * Delete.
-	 *
-	 * @param <T> the generic type
-	 * @param t the t
-	 * @param r the r
-	 * @param sourceID the source ID
-	 * @param path the path
-	 * @param restObject the rest object
-	 * @throws Exception the exception
-	 */
-	public <T> void Delete(T t, RequestDetails r, String sourceID, String path, RestObject<T> restObject) throws Exception;
-	
-	/**
-	 * Post.
-	 *
-	 * @param <T> the generic type
-	 * @param t the t
-	 * @param r the r
-	 * @param sourceID the source ID
-	 * @param path the path
-	 * @param restObject the rest object
-	 * @throws Exception the exception
-	 */
-	public <T> void Post(T t, JSONObject r, String sourceID, String path, RestObject<T> restObject) throws Exception;
-	
-	/***
-	 * Log request.
-	 *
-	 * @param r the r
-	 */
-	public void logRequest ( RequestDetails r  );
-	
-}
\ No newline at end of file
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/policy/PolicyUtil.java b/vid-app-common/src/main/java/org/openecomp/vid/policy/PolicyUtil.java
deleted file mode 100644
index ceda7c4..0000000
--- a/vid-app-common/src/main/java/org/openecomp/vid/policy/PolicyUtil.java
+++ /dev/null
@@ -1,71 +0,0 @@
-package org.openecomp.vid.policy;
-
-import java.text.DateFormat;
-import java.text.SimpleDateFormat;
-import java.util.Date;
-
-import org.glassfish.jersey.client.ClientResponse;
-import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
-import org.openecomp.vid.policy.PolicyResponseWrapper;
-import org.openecomp.vid.policy.PolicyUtil;
-import org.openecomp.vid.policy.RestObject;
-
-import com.fasterxml.jackson.databind.ObjectMapper;
-
-public class PolicyUtil {
-	
-	private static EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(PolicyUtil.class);
-	
-	final static DateFormat dateFormat = new SimpleDateFormat("HH:mm:ss:SSSS");
-	
-	public static PolicyResponseWrapper wrapResponse ( String body, int statusCode ) {
-		
-		PolicyResponseWrapper w = new PolicyResponseWrapper();
-		w.setStatus (statusCode);
-		w.setEntity(body);
-		
-		return w;
-	}
-	
-	public static PolicyResponseWrapper wrapResponse (ClientResponse cres) {	
-		String resp_str = "";
-		if ( cres != null ) {
-			resp_str = cres.readEntity(String.class);
-		}
-		int statuscode = cres.getStatus();
-		PolicyResponseWrapper w = PolicyUtil.wrapResponse ( resp_str, statuscode );
-		return (w);
-	}
-	
-	public static PolicyResponseWrapper wrapResponse (RestObject<String> rs) {	
-		String resp_str = "";
-		int status = 0;
-		if ( rs != null ) {
-			resp_str = rs.get();
-			status = rs.getStatusCode();
-		}
-		PolicyResponseWrapper w = PolicyUtil.wrapResponse ( resp_str, status );
-		return (w);
-	}
-	
-	public static <T> String convertPojoToString ( T t ) throws com.fasterxml.jackson.core.JsonProcessingException {
-		
-		String methodName = "convertPojoToString";
-		ObjectMapper mapper = new ObjectMapper();
-		String r_json_str = "";
-	    if ( t != null ) {
-		    try {
-		    	r_json_str = mapper.writeValueAsString(t);
-		    }
-		    catch ( com.fasterxml.jackson.core.JsonProcessingException j ) {
-		    	logger.debug(EELFLoggerDelegate.debugLogger,dateFormat.format(new Date()) + "<== " +  methodName + " Unable to parse object as json");
-		    }
-	    }
-	    return (r_json_str);
-	}
-	
-	
-	public static void main(String[] args) {
-		// TODO Auto-generated method stub		
-	}
-}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/policy/RestObject.java b/vid-app-common/src/main/java/org/openecomp/vid/policy/RestObject.java
deleted file mode 100644
index de085f2..0000000
--- a/vid-app-common/src/main/java/org/openecomp/vid/policy/RestObject.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * VID
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *      http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.vid.policy;
-
-/**
- * The Class RestObject.
- *
- * @param <T> the generic type
- */
-public class RestObject<T> {
-
-	/**
-	 * Generic version of the RestObject class.
-	 *
-	 */
-    // T stands for "Type"
-    private T t;
-    
-    /** The status code. */
-    private int statusCode= 0;
-    
-    /**
-     * Sets the.
-     *
-     * @param t the t
-     */
-    public void set(T t) { this.t = t; }
-    
-    /**
-     * Gets the.
-     *
-     * @return the t
-     */
-    public T get() { return t; }
-	
-    /**
-     * Sets the status code.
-     *
-     * @param v the new status code
-     */
-    public void setStatusCode(int v) { this.statusCode = v; }
-    
-    /**
-     * Gets the status code.
-     *
-     * @return the status code
-     */
-    public int getStatusCode() { return this.statusCode; }
-    
-}
\ No newline at end of file
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/policy/rest/RequestDetails.java b/vid-app-common/src/main/java/org/openecomp/vid/policy/rest/RequestDetails.java
deleted file mode 100644
index 93e80d6..0000000
--- a/vid-app-common/src/main/java/org/openecomp/vid/policy/rest/RequestDetails.java
+++ /dev/null
@@ -1,107 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * VID
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *      http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.vid.policy.rest;
-
-import com.fasterxml.jackson.annotation.JsonInclude;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import com.fasterxml.jackson.annotation.JsonPropertyOrder;
-
-/*
-	[
-	  {
-	    "policyConfigMessage": "Config Retrieved! ",
-	    "policyConfigStatus": "CONFIG_RETRIEVED",
-	    "type": "JSON",
-	    "config": "{\"service\":\"TimeLimitAndVerticalTopology\",\"policyName\":\"SNIRO_CM_1707.Demo_TimeLimitAndVerticalTopology_zone_localTime\",\"description\":\"dev instance\",\"templateVersion\":\"1702.03\",\"version\":\"1707\",\"priority\":\"4\",\"riskType\":\"test\",\"riskLevel\":\"3\",\"guard\":\"False\",\"content\":{\"serviceType\":\"networkOnDemand\",\"identity\":\"vnf_upgrade_policy\",\"policyScope\":{\"serviceType\":[\"networkOnDemand\"],\"aicZone\":[\" \"],\"entityType\":[\"vnf\"]},\"timeSchedule\":{\"allowedPeriodicTime\":[{\"day\":\"weekday\",\"timeRange\":[{\"start_time\":\"04:00:00\",\"end_time\":\"13:00:00\"}]}]},\"nodeType\":[\"vnf\"],\"type\":\"timeLimitAndVerticalTopology\",\"conflictScope\":\"vnf_zone\"}}",
-	    "policyName": "SNIRO_CM_1707.Config_MS_Demo_TimeLimitAndVerticalTopology_zone_localTime.1.xml",
-	    "policyVersion": "1",
-	    "matchingConditions": {
-	      "ECOMPName": "SNIRO-Placement",
-	      "ConfigName": "",
-	      "service": "TimeLimitAndVerticalTopology",
-	      "uuid": "",
-	      "Location": ""
-	    },
-	    "responseAttributes": {},
-	    "property": null
-	  },
-	  {
-	    "policyConfigMessage": "Config Retrieved! ",
-	    "policyConfigStatus": "CONFIG_RETRIEVED",
-	    "type": "JSON",
-	    "config": "{\"service\":\"TimeLimitAndVerticalTopology\",\"policyName\":\"SNIRO_CM_1707.Demo_TimeLimitAndVerticalTopology_pserver_localTime\",\"description\":\"dev instance\",\"templateVersion\":\"1702.03\",\"version\":\"1707\",\"priority\":\"4\",\"riskType\":\"test\",\"riskLevel\":\"3\",\"guard\":\"False\",\"content\":{\"serviceType\":\"networkOnDemand\",\"identity\":\"vnf_upgrade_policy\",\"policyScope\":{\"serviceType\":[\"networkOnDemand\"],\"aicZone\":[\" \"],\"entityType\":[\"vnf\"]},\"timeSchedule\":{\"allowedPeriodicTime\":[{\"day\":\"weekday\",\"timeRange\":[{\"start_time\":\"04:00:00\",\"end_time\":\"13:00:00\"}]}]},\"nodeType\":[\"vnf\"],\"type\":\"timeLimitAndVerticalTopology\",\"conflictScope\":\"vnf_pserver\"}}",
-	    "policyName": "SNIRO_CM_1707.Config_MS_Demo_TimeLimitAndVerticalTopology_pserver_localTime.1.xml",
-	    "policyVersion": "1",
-	    "matchingConditions": {
-	      "ECOMPName": "SNIRO-Placement",
-	      "ConfigName": "",
-	      "service": "TimeLimitAndVerticalTopology",
-	      "uuid": "",
-	      "Location": ""
-	    },
-	    "responseAttributes": {},
-	    "property": null
-	  },
-	  {
-	    "policyConfigMessage": "Config Retrieved! ",
-	    "policyConfigStatus": "CONFIG_RETRIEVED",
-	    "type": "JSON",
-	    "config": "{\"service\":\"TimeLimitAndVerticalTopology\",\"policyName\":\"SNIRO_CM_1707.Demo_TimeLimitAndVerticalTopology_vnf_localTime\",\"description\":\"dev instance\",\"templateVersion\":\"1702.03\",\"version\":\"1707\",\"priority\":\"4\",\"riskType\":\"test\",\"riskLevel\":\"3\",\"guard\":\"False\",\"content\":{\"serviceType\":\"networkOnDemand\",\"identity\":\"vnf_upgrade_policy\",\"policyScope\":{\"serviceType\":[\"networkOnDemand\"],\"aicZone\":[\" \"],\"entityType\":[\"vnf\"]},\"timeSchedule\":{\"allowedPeriodicTime\":[{\"day\":\"weekday\",\"timeRange\":[{\"start_time\":\"04:00:00\",\"end_time\":\"13:00:00\"}]}]},\"nodeType\":[\"vnf\"],\"type\":\"timeLimitAndVerticalTopology\",\"conflictScope\":\"vnf\"}}",
-	    "policyName": "SNIRO_CM_1707.Config_MS_Demo_TimeLimitAndVerticalTopology_vnf_localTime.1.xml",
-	    "policyVersion": "1",
-	    "matchingConditions": {
-	      "ECOMPName": "SNIRO-Placement",
-	      "ConfigName": "",
-	      "service": "TimeLimitAndVerticalTopology",
-	      "uuid": "",
-	      "Location": ""
-	    },
-	    "responseAttributes": {},
-	    "property": null
-	  }
-	]
-*/
-@JsonInclude(JsonInclude.Include.NON_NULL)
-@JsonPropertyOrder({
-    "policyConfigMessage",
-    "policyConfigStatus",
-    "type",
-    "config",
-    "policyName",
-    "policyVersion",
-    "matchingConditions"
-})
-public class RequestDetails {
-	
-	@JsonProperty("policyName")
-    private String policyName;	 
-    
-	@JsonProperty("policyName")
-    public String getPolicyName() {
-        return policyName;
-    }
-
-    @JsonProperty("policyName")
-    public void setPolicyName(String policyName) {
-        this.policyName = policyName;
-    }
-    
-}
\ No newline at end of file
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/properties/AsdcClientConfiguration.java b/vid-app-common/src/main/java/org/openecomp/vid/properties/AsdcClientConfiguration.java
deleted file mode 100755
index 232023b..0000000
--- a/vid-app-common/src/main/java/org/openecomp/vid/properties/AsdcClientConfiguration.java
+++ /dev/null
@@ -1,124 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * VID
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *      http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.vid.properties;
-
-import org.springframework.beans.factory.annotation.Value;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
-import org.springframework.context.annotation.PropertySource;
-import org.springframework.context.annotation.PropertySources;
-import org.springframework.context.support.PropertySourcesPlaceholderConfigurer;
-
-/**
- * The Class AsdcClientConfiguration.
- */
-@Configuration
-
-@PropertySources({
-		@PropertySource(value="asdc.properties",  ignoreResourceNotFound = true),
-		@PropertySource(value="${container.classpath:}/WEB-INF/conf/asdc.properties", ignoreResourceNotFound = true)
-})
-public class AsdcClientConfiguration {
-
-    @Bean
-    public static PropertySourcesPlaceholderConfigurer propertySourcesPlaceholderConfigurer() {
-        return new PropertySourcesPlaceholderConfigurer();
-    }
-
-	@Value("${asdc.client.type}")
-	private AsdcClientType asdcClientType;
-
-	/** The asdc client host. */
-	@Value("${asdc.client.rest.host}")
-	private String asdcClientHost;
-
-	/** The asdc client port. */
-	@Value("${asdc.client.rest.port}")
-	private int asdcClientPort;
-
-	/** The asdc client auth. */
-	@Value("${asdc.client.rest.auth}")
-	public String asdcClientAuth;
-
-	/** The asdc client protocol. */
-	@Value("${asdc.client.rest.protocol}")
-	public String asdcClientProtocol;
-
-	/**
-	 * Gets the asdc client type.
-	 *
-	 * @return the asdc client type
-	 */
-	public AsdcClientType getAsdcClientType() {
-		return asdcClientType;
-	}
-
-	/**
-	 * Gets the asdc client host.
-	 *
-	 * @return the asdc client host
-	 */
-	public String getAsdcClientHost() {
-		return asdcClientHost;
-	}
-
-	/**
-	 * Gets the asdc client port.
-	 *
-	 * @return the asdc client port
-	 */
-	public int getAsdcClientPort() {
-		return asdcClientPort;
-	}
-
-	/**
-	 * Gets the asdc client auth.
-	 *
-	 * @return the asdc client auth
-	 */
-	public String getAsdcClientAuth() {
-		return asdcClientAuth;
-	}
-
-	/**
-	 * Gets the asdc client protocol.
-	 *
-	 * @return the asdc client protocol
-	 */
-	public String getAsdcClientProtocol() {
-		return asdcClientProtocol;
-	}
-
-	/**
-	 * The Enum AsdcClientType.
-	 */
-	public enum AsdcClientType {
-
-		/** The in memory. */
-		IN_MEMORY,
-
-		/** The rest. */
-		REST,
-
-		/** The local. */
-		LOCAL
-	}
-}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/properties/MsoClientConfiguration.java b/vid-app-common/src/main/java/org/openecomp/vid/properties/MsoClientConfiguration.java
deleted file mode 100644
index f7a331a..0000000
--- a/vid-app-common/src/main/java/org/openecomp/vid/properties/MsoClientConfiguration.java
+++ /dev/null
@@ -1,9 +0,0 @@
-package org.openecomp.vid.properties;
-
-/**
- * Created by pickjonathan on 20/06/2017.
- */
-public class MsoClientConfiguration {
-
-
-}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/properties/VidProperties.java b/vid-app-common/src/main/java/org/openecomp/vid/properties/VidProperties.java
deleted file mode 100755
index 141b9b2..0000000
--- a/vid-app-common/src/main/java/org/openecomp/vid/properties/VidProperties.java
+++ /dev/null
@@ -1,93 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * VID
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *      http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.vid.properties;
-import java.text.DateFormat;
-import java.text.SimpleDateFormat;
-import java.util.Date;
-import org.openecomp.vid.model.ModelConstants;
-import org.openecomp.portalsdk.core.util.SystemProperties;
-import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
-
-import org.openecomp.vid.controller.VidController;
-/**
- * The Class VidProperties.
- */
-public class VidProperties extends SystemProperties {
-
-	//VID General Properties
-	
-	/** The Constant VID_TRUSTSTORE_FILENAME. */
-	public static final String VID_TRUSTSTORE_FILENAME = "vid.truststore.filename";
-	
-	/** The Constant VID_TRUSTSTORE_PASSWD_X. */
-	public static final String VID_TRUSTSTORE_PASSWD_X = "vid.truststore.passwd.x";
-	
-	/** The Constant FILESEPARATOR. */
-	public static final String FILESEPARATOR = (System.getProperty("file.separator") == null) ? "/" : System.getProperty("file.separator");
-	
-	/** The Constant LOG. */
-	private static final EELFLoggerDelegate LOG = EELFLoggerDelegate.getLogger(VidController.class);
-	
-	/** The Constant dateFormat. */
-	final static DateFormat dateFormat = new SimpleDateFormat("HH:mm:ss:SSSS");
-	/**
-	 * Gets the asdc model namespace prefix property
-	 * 
-	 * @return the property value or a default value
-	 */
-	public static String getAsdcModelNamespace() {
-		String methodName = "getAsdcModelNamespace ";
-		String asdcModelNamespace = ModelConstants.DEFAULT_ASDC_MODEL_NAMESPACE;
-	    try {
-	        asdcModelNamespace = SystemProperties.getProperty(ModelConstants.ASDC_MODEL_NAMESPACE);
-	        if ( asdcModelNamespace == null || asdcModelNamespace.isEmpty()) {
-		    	asdcModelNamespace = ModelConstants.DEFAULT_ASDC_MODEL_NAMESPACE;
-		    }
-	    }
-	    catch ( Exception e ) {
-	    	LOG.error (EELFLoggerDelegate.errorLogger, dateFormat.format(new Date()) + methodName + "unable to find the value, using the default "
-	    			+ ModelConstants.DEFAULT_ASDC_MODEL_NAMESPACE);
-	    	asdcModelNamespace = ModelConstants.DEFAULT_ASDC_MODEL_NAMESPACE;
-	    }
-	    return (asdcModelNamespace);
-	}
-	/**
-	 * Gets the specified property value. If the property is not defined, returns a default value.
-	 * 
-	 * @return the property value or a default value
-	 */
-	public static String getPropertyWithDefault ( String propName, String defaultValue ) {
-		String methodName = "getPropertyWithDefault ";
-		String propValue = defaultValue;
-	    try {
-	        propValue = SystemProperties.getProperty(propName);
-	        if ( propValue == null || propValue.isEmpty()) {
-		    	propValue = defaultValue;
-		    }
-	    }
-	    catch ( Exception e ) {
-	    	LOG.error (EELFLoggerDelegate.errorLogger, dateFormat.format(new Date()) + methodName + "unable to find the value, using the default "
-	    			+ defaultValue);
-	    	propValue = defaultValue;
-	    }
-	    return (propValue);
-	}
-}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/roles/EcompRole.java b/vid-app-common/src/main/java/org/openecomp/vid/roles/EcompRole.java
deleted file mode 100644
index 5242f5a..0000000
--- a/vid-app-common/src/main/java/org/openecomp/vid/roles/EcompRole.java
+++ /dev/null
@@ -1,5 +0,0 @@
-package org.openecomp.vid.roles;
-
-public enum EcompRole {
-	READ;
-}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/roles/Role.java b/vid-app-common/src/main/java/org/openecomp/vid/roles/Role.java
deleted file mode 100644
index f818e48..0000000
--- a/vid-app-common/src/main/java/org/openecomp/vid/roles/Role.java
+++ /dev/null
@@ -1,48 +0,0 @@
-package org.openecomp.vid.roles;
-
-/**
- * Created by Oren on 7/1/17.
- */
-
-public class Role {
-
-    private EcompRole ecompRole;
-
-    private String subscribeName;
-
-    private String serviceType;
-
-    private String tenant;
-
-    public Role(EcompRole ecompRole, String serviceName, String serviceType, String tenant) {
-        this.ecompRole = ecompRole;
-        this.subscribeName = serviceName;
-        this.serviceType = serviceType;
-        this.tenant = tenant;
-    }
-
-    public EcompRole getEcompRole() {
-        return ecompRole;
-    }
-
-
-    public String getSubscribeName() {
-        return subscribeName;
-    }
-
-    public void setSubscribeName(String subscribeName) {
-        this.subscribeName = subscribeName;
-    }
-
-    public String getServiceType() {
-        return serviceType;
-    }
-
-
-    public String getTenant() {
-        return tenant;
-    }
-
-
-
-}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/roles/RoleProvider.java b/vid-app-common/src/main/java/org/openecomp/vid/roles/RoleProvider.java
deleted file mode 100644
index 2ed5bdb..0000000
--- a/vid-app-common/src/main/java/org/openecomp/vid/roles/RoleProvider.java
+++ /dev/null
@@ -1,64 +0,0 @@
-package org.openecomp.vid.roles;
-
-import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
-import org.openecomp.portalsdk.core.web.support.UserUtils;
-
-import javax.servlet.http.HttpServletRequest;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-
-/**
- * Created by Oren on 7/1/17.
- */
-public class RoleProvider {
-
-    private static final EELFLoggerDelegate LOG = EELFLoggerDelegate.getLogger(RoleProvider.class);
-    final String readPermissionString = "read";
-    final String roleStringDelimiter = "_";
-
-    public static List<String> extractRoleFromSession(HttpServletRequest request) {
-
-        return new ArrayList<String>();
-
-    }
-
-    public List<Role> getUserRoles(HttpServletRequest request) {
-        List<Role> roleList = new ArrayList<>();
-		//Disable roles until AAF integration finishes
-        /*HashMap roles = UserUtils.getRoles(request);
-        for (Object role : roles.keySet()) {
-            org.openecomp.portalsdk.core.domain.Role sdkRol = (org.openecomp.portalsdk.core.domain.Role) roles.get(role);
-            try {
-                if (sdkRol.getName().contains(readPermissionString))
-                    continue;
-                String[] roleParts = splitRole((sdkRol.getName()));
-                roleList.add(createRoleFromStringArr(roleParts));
-            } catch (Exception e) {
-                LOG.error("Failed to parse permission", e);
-
-            }
-        }*/
-
-        return roleList;
-    }
-
-    public String[] splitRole(String roleAsString) {
-        return roleAsString.split(roleStringDelimiter);
-    }
-
-    public boolean userPermissionIsReadOnly(List<Role> roles) {
-
-        return (!(roles.size() > 0));
-    }
-
-    public Role createRoleFromStringArr(String[] roleParts) {
-        if (roleParts.length > 2) {
-            return new Role(EcompRole.READ, roleParts[0], roleParts[1], roleParts[2]);
-        } else {
-            return new Role(EcompRole.READ, roleParts[0], roleParts[1], null);
-        }
-    }
-
-}
-
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/roles/RoleValidator.java b/vid-app-common/src/main/java/org/openecomp/vid/roles/RoleValidator.java
deleted file mode 100644
index 9031524..0000000
--- a/vid-app-common/src/main/java/org/openecomp/vid/roles/RoleValidator.java
+++ /dev/null
@@ -1,67 +0,0 @@
-package org.openecomp.vid.roles;
-
-import org.openecomp.vid.mso.rest.RequestDetails;
-
-import java.util.List;
-import java.util.Map;
-
-/**
- * Created by Oren on 7/12/17.
- */
-public class RoleValidator {
-
-	//Disable roles until AAF integration finishes
-	private boolean disableRoles = true;
-    private List<Role> userRoles;
-
-    public RoleValidator(List<Role> roles) {
-        this.userRoles = roles;
-    }
-
-    public boolean isSubscriberPermitted(String subscriberName) {
-    	if(this.disableRoles) return true;
-    	
-        for (Role role : userRoles) {
-            if (role.getSubscribeName().equals(subscriberName))
-                return true;
-        }
-        return false;
-    }
-
-    public boolean isServicePermitted(String subscriberName, String serviceType) {
-    	if(this.disableRoles) return true;
-    	
-        for (Role role : userRoles) {
-            if (role.getSubscribeName().equals(subscriberName) && role.getServiceType().equals(serviceType))
-                return true;
-        }
-        return false;
-    }
-
-    public boolean isMsoRequestValid(RequestDetails mso_request) {
-    	if(this.disableRoles) return true;
-    	
-        try {
-            String globalSubscriberIdRequested = (String) ((Map) ((Map) mso_request.getAdditionalProperties().get("requestDetails")).get("subscriberInfo")).get("globalSubscriberId");
-            String serviceType = (String) ((Map) ((Map) mso_request.getAdditionalProperties().get("requestDetails")).get("requestParameters")).get("subscriptionServiceType");
-            return isServicePermitted(globalSubscriberIdRequested, serviceType);
-        } catch (Exception e) {
-            //Until we'll get the exact information regarding the tenants and the global customer id, we'll return true on unknown requests to mso
-            return true;
-        }
-//        return false;
-    }
-
-    public boolean isTenantPermitted(String globalCustomerId, String serviceType, String tenant) {
-    	if(this.disableRoles) return true;
-    	
-        for (Role role : userRoles) {
-            if (role.getSubscribeName().equals(globalCustomerId)
-                    && role.getServiceType().equals(serviceType)
-                    && (role.getTenant() == null || role.getTenant().equals(tenant))) {
-                return true;
-            }
-        }
-        return false;
-    }
-}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/scheduler/RestObject.java b/vid-app-common/src/main/java/org/openecomp/vid/scheduler/RestObject.java
deleted file mode 100644
index 57b3683..0000000
--- a/vid-app-common/src/main/java/org/openecomp/vid/scheduler/RestObject.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * VID
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *      http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.vid.scheduler;
-
-
-public class RestObject<T> {
-	
-    private T t;
-   
-    private int statusCode= 0;
-    
-    public String uuid;
-    
-    public void set(T t) { this.t = t; }
-    
-    public T get() { return t; }
-	   
-    public void setStatusCode(int v) { this.statusCode = v; }
-       
-    public int getStatusCode() { return this.statusCode; }
-        
-    public void setUUID(String uuid) { this.uuid = uuid; }
-    
-    public String getUUID() { return this.uuid; }
-}
-
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/scheduler/RestObjects/GetTimeSlotsRestObject.java b/vid-app-common/src/main/java/org/openecomp/vid/scheduler/RestObjects/GetTimeSlotsRestObject.java
deleted file mode 100644
index 614b557..0000000
--- a/vid-app-common/src/main/java/org/openecomp/vid/scheduler/RestObjects/GetTimeSlotsRestObject.java
+++ /dev/null
@@ -1,11 +0,0 @@
-package org.openecomp.vid.scheduler.RestObjects;
-
-public class GetTimeSlotsRestObject<T> extends org.openecomp.vid.scheduler.RestObject<T> {
-
-	public String uuid;
-	
-	public void setUUID(String uuid) { this.uuid = uuid; }
-	    
-	public String getUUID() { return this.uuid; }
-
-}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/scheduler/RestObjects/PostCreateNewVnfRestObject.java b/vid-app-common/src/main/java/org/openecomp/vid/scheduler/RestObjects/PostCreateNewVnfRestObject.java
deleted file mode 100644
index 86cbab8..0000000
--- a/vid-app-common/src/main/java/org/openecomp/vid/scheduler/RestObjects/PostCreateNewVnfRestObject.java
+++ /dev/null
@@ -1,10 +0,0 @@
-package org.openecomp.vid.scheduler.RestObjects;
-
-public class PostCreateNewVnfRestObject<T> extends RestObject<T> {
-	
-	public String uuid;
-	
-	public void setUUID(String uuid) { this.uuid = uuid; }
-	    
-	public String getUUID() { return this.uuid; }
-}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/scheduler/RestObjects/PostSubmitVnfChangeRestObject.java b/vid-app-common/src/main/java/org/openecomp/vid/scheduler/RestObjects/PostSubmitVnfChangeRestObject.java
deleted file mode 100644
index 6fb56f6..0000000
--- a/vid-app-common/src/main/java/org/openecomp/vid/scheduler/RestObjects/PostSubmitVnfChangeRestObject.java
+++ /dev/null
@@ -1,10 +0,0 @@
-package org.openecomp.vid.scheduler.RestObjects;
-
-public class PostSubmitVnfChangeRestObject<T> extends RestObject<T> {
-	
-	public String uuid;
-	
-	public void setUUID(String uuid) { this.uuid = uuid; }
-	    
-	public String getUUID() { return this.uuid; }
-}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/scheduler/RestObjects/RestObject.java b/vid-app-common/src/main/java/org/openecomp/vid/scheduler/RestObjects/RestObject.java
deleted file mode 100644
index 2d0eec7..0000000
--- a/vid-app-common/src/main/java/org/openecomp/vid/scheduler/RestObjects/RestObject.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * VID
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *      http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.vid.scheduler.RestObjects;
-
-
-public class RestObject<T> {
-	
-    private T t;
-   
-    private int statusCode= 0;
-        
-    public void set(T t) { this.t = t; }
-    
-    public T get() { return t; }
-	   
-    public void setStatusCode(int v) { this.statusCode = v; }
-       
-    public int getStatusCode() { return this.statusCode; }
-        
-}
-
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/scheduler/SchedulerProperties.java b/vid-app-common/src/main/java/org/openecomp/vid/scheduler/SchedulerProperties.java
deleted file mode 100644
index 15855b7..0000000
--- a/vid-app-common/src/main/java/org/openecomp/vid/scheduler/SchedulerProperties.java
+++ /dev/null
@@ -1,24 +0,0 @@
-package org.openecomp.vid.scheduler;
-
-import org.openecomp.portalsdk.core.util.SystemProperties;
-
-
-public class SchedulerProperties extends SystemProperties { 
-	
-	public static final String SCHEDULER_USER_NAME_VAL =  "scheduler.user.name";
-		
-	public static final String SCHEDULER_PASSWORD_VAL = "scheduler.password";
-	
-	public static final String SCHEDULER_SERVER_URL_VAL = "scheduler.server.url";
-	
-	public static final String SCHEDULER_CREATE_NEW_VNF_CHANGE_INSTANCE_VAL = "scheduler.create.new.vnf.change.instance";
-
-	public static final String SCHEDULER_GET_TIME_SLOTS = "scheduler.get.time.slots";
-
-	public static final String SCHEDULER_SUBMIT_NEW_VNF_CHANGE = "scheduler.submit.new.vnf.change";
-
-	public static final String SCHEDULER_GET_SCHEDULES = "scheduler.get.schedules";
-
-	public static final String GET_VERSION_BY_INVARIANT_ID = "aai_get_version_by_invariant_id";
-
-}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/scheduler/SchedulerResponseWrapper.java b/vid-app-common/src/main/java/org/openecomp/vid/scheduler/SchedulerResponseWrapper.java
deleted file mode 100644
index 5f148c0..0000000
--- a/vid-app-common/src/main/java/org/openecomp/vid/scheduler/SchedulerResponseWrapper.java
+++ /dev/null
@@ -1,71 +0,0 @@
-package org.openecomp.vid.scheduler;
-
-import com.fasterxml.jackson.annotation.JsonInclude;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import com.fasterxml.jackson.annotation.JsonPropertyOrder;
-import org.apache.commons.lang.builder.ToStringBuilder;
-
-/**
- * This wrapper encapsulates the Scheduler response
- */
-@JsonInclude(JsonInclude.Include.NON_NULL)
-@JsonPropertyOrder({
-	    "status",
-	    "entity",
-	    "uuid"
-})
-
-public class SchedulerResponseWrapper {
-	
-	@JsonProperty("status")
-	private int status;
-
-	@JsonProperty("entity")
-	private String entity;
-	
-	@JsonProperty("uuid")
-	private String uuid;
-
-	@JsonProperty("entity")
-    public String getEntity() {
-        return entity;
-    }
-	
-	@JsonProperty("status")
-    public int getStatus() {
-        return status;
-    }
-	
-	@JsonProperty("uuid")
-    public String getUuid() {
-        return uuid;
-    }	
-	
-	@JsonProperty("status")
-    public void setStatus(int v) {
-        this.status = v;
-    }
-
-	@JsonProperty("entity")
-    public void setEntity(String v) {
-        this.entity = v;
-    }
-	
-	@JsonProperty("uuid")
-    public void setUuid(String v) {
-        this.uuid = v;
-    }	
-
-    @Override
-    public String toString() {
-        return ToStringBuilder.reflectionToString(this);
-    }
-
-    public String getResponse () {
-    	
-    	StringBuilder b = new StringBuilder ("{ \"status\": ");
-    	b.append(getStatus()).append(", \"entity\": \" " ).append(this.getEntity()).append("\" ,\"uuid\": \"" ).append(this.getUuid()).append("\"}");
-        return (b.toString());
-    }
-
-}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/scheduler/SchedulerResponseWrappers/GetTimeSlotsWrapper.java b/vid-app-common/src/main/java/org/openecomp/vid/scheduler/SchedulerResponseWrappers/GetTimeSlotsWrapper.java
deleted file mode 100644
index e5001d4..0000000
--- a/vid-app-common/src/main/java/org/openecomp/vid/scheduler/SchedulerResponseWrappers/GetTimeSlotsWrapper.java
+++ /dev/null
@@ -1,5 +0,0 @@
-package org.openecomp.vid.scheduler.SchedulerResponseWrappers;
-
-public class GetTimeSlotsWrapper extends SchedulerResponseWrapper {
-
-}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/scheduler/SchedulerResponseWrappers/PostCreateNewVnfWrapper.java b/vid-app-common/src/main/java/org/openecomp/vid/scheduler/SchedulerResponseWrappers/PostCreateNewVnfWrapper.java
deleted file mode 100644
index f1baeaf..0000000
--- a/vid-app-common/src/main/java/org/openecomp/vid/scheduler/SchedulerResponseWrappers/PostCreateNewVnfWrapper.java
+++ /dev/null
@@ -1,39 +0,0 @@
-package org.openecomp.vid.scheduler.SchedulerResponseWrappers;
-
-import org.apache.commons.lang.builder.ToStringBuilder;
-
-import com.fasterxml.jackson.annotation.JsonInclude;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import com.fasterxml.jackson.annotation.JsonPropertyOrder;
-
-@JsonInclude(JsonInclude.Include.NON_NULL)
-@JsonPropertyOrder({
-	    "uuid"
-})
-public class PostCreateNewVnfWrapper extends SchedulerResponseWrapper {
-
-	@JsonProperty("uuid")
-	private String uuid;
-	
-	@JsonProperty("uuid")
-    public String getUuid() {
-        return uuid;
-    }
-	
-	@JsonProperty("uuid")
-    public void setUuid(String v) {
-        this.uuid = v;
-    }
-	
-	@Override
-    public String toString() {
-        return ToStringBuilder.reflectionToString(this);
-    }
-
-    public String getResponse () {
-    	
-    	StringBuilder b = new StringBuilder ("{ \"status\": ");
-    	b.append(getStatus()).append(", \"entity\": \" " ).append(this.getEntity()).append("\" ,\"uuid\": \"" ).append(this.getUuid()).append("\"}");
-    	return (b.toString());
-    }	
-}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/scheduler/SchedulerResponseWrappers/PostSubmitVnfChangeTimeSlotsWrapper.java b/vid-app-common/src/main/java/org/openecomp/vid/scheduler/SchedulerResponseWrappers/PostSubmitVnfChangeTimeSlotsWrapper.java
deleted file mode 100644
index 86e4c0a..0000000
--- a/vid-app-common/src/main/java/org/openecomp/vid/scheduler/SchedulerResponseWrappers/PostSubmitVnfChangeTimeSlotsWrapper.java
+++ /dev/null
@@ -1,38 +0,0 @@
-package org.openecomp.vid.scheduler.SchedulerResponseWrappers;
-
-import org.apache.commons.lang.builder.ToStringBuilder;
-
-import com.fasterxml.jackson.annotation.JsonInclude;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import com.fasterxml.jackson.annotation.JsonPropertyOrder;
-
-@JsonInclude(JsonInclude.Include.NON_NULL)
-@JsonPropertyOrder({
-	    "uuid"
-})
-public class PostSubmitVnfChangeTimeSlotsWrapper extends SchedulerResponseWrapper  {
-	@JsonProperty("uuid")
-	private String uuid;
-	
-	@JsonProperty("uuid")
-    public String getUuid() {
-        return uuid;
-    }
-	
-	@JsonProperty("uuid")
-    public void setUuid(String v) {
-        this.uuid = v;
-    }
-	
-	@Override
-    public String toString() {
-        return ToStringBuilder.reflectionToString(this);
-    }
-
-    public String getResponse () {
-    	
-    	StringBuilder b = new StringBuilder ("{ \"status\": ");
-    	b.append(getStatus()).append(", \"entity\": \" " ).append(this.getEntity()).append("\" ,\"uuid\": \"" ).append(this.getUuid()).append("\"}");
-    	return (b.toString());
-    }	
-}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/scheduler/SchedulerResponseWrappers/SchedulerResponseWrapper.java b/vid-app-common/src/main/java/org/openecomp/vid/scheduler/SchedulerResponseWrappers/SchedulerResponseWrapper.java
deleted file mode 100644
index 081ed3d..0000000
--- a/vid-app-common/src/main/java/org/openecomp/vid/scheduler/SchedulerResponseWrappers/SchedulerResponseWrapper.java
+++ /dev/null
@@ -1,57 +0,0 @@
-package org.openecomp.vid.scheduler.SchedulerResponseWrappers;
-
-import com.fasterxml.jackson.annotation.JsonInclude;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import com.fasterxml.jackson.annotation.JsonPropertyOrder;
-import org.apache.commons.lang.builder.ToStringBuilder;
-
-/**
- * This wrapper encapsulates the Scheduler response
- */
-@JsonInclude(JsonInclude.Include.NON_NULL)
-@JsonPropertyOrder({
-	    "status",
-	    "entity"
-})
-
-public class SchedulerResponseWrapper {
-	
-	@JsonProperty("status")
-	private int status;
-
-	@JsonProperty("entity")
-	private String entity;
-
-	@JsonProperty("entity")
-    public String getEntity() {
-        return entity;
-    }
-	
-	@JsonProperty("status")
-    public int getStatus() {
-        return status;
-    }
-	
-	@JsonProperty("status")
-    public void setStatus(int v) {
-        this.status = v;
-    }
-
-	@JsonProperty("entity")
-    public void setEntity(String v) {
-        this.entity = v;
-    }
-	
-    @Override
-    public String toString() {
-        return ToStringBuilder.reflectionToString(this);
-    }
-
-    public String getResponse () {
-    	
-    	StringBuilder b = new StringBuilder ("{ \"status\": ");
-    
-    	b.append(getStatus()).append(", \"entity\": " ).append(this.getEntity()).append("}");
-        return (b.toString());
-    }
-}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/scheduler/SchedulerRestInt.java b/vid-app-common/src/main/java/org/openecomp/vid/scheduler/SchedulerRestInt.java
deleted file mode 100644
index 32b3a9c..0000000
--- a/vid-app-common/src/main/java/org/openecomp/vid/scheduler/SchedulerRestInt.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * VID
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *      http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.vid.scheduler;
-
-import java.text.DateFormat;
-import java.text.SimpleDateFormat;
-
-import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
-
-public class SchedulerRestInt {
-	
-	/** The logger. */
-	EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(SchedulerRestInterface.class);
-	
-	/** The Constant dateFormat. */
-	final static DateFormat dateFormat = new SimpleDateFormat("HH:mm:ss:SSSS");
-	
-	/** The request date format. */
-	public DateFormat requestDateFormat = new SimpleDateFormat("EEE, dd MMM YYYY HH:mm:ss z");
-	
-	public SchedulerRestInt() {
-		requestDateFormat.setTimeZone(java.util.TimeZone.getTimeZone("GMT"));
-	}
-}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/scheduler/SchedulerRestInterface.java b/vid-app-common/src/main/java/org/openecomp/vid/scheduler/SchedulerRestInterface.java
deleted file mode 100644
index 5f529f3..0000000
--- a/vid-app-common/src/main/java/org/openecomp/vid/scheduler/SchedulerRestInterface.java
+++ /dev/null
@@ -1,208 +0,0 @@
-package org.openecomp.vid.scheduler;
-
-import java.util.Collections;
-import javax.ws.rs.client.Client;
-import javax.ws.rs.client.Entity;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.MultivaluedHashMap;
-import javax.ws.rs.core.Response;
-
-import org.apache.commons.codec.binary.Base64;
-import org.eclipse.jetty.util.security.Password;
-import org.json.simple.JSONObject;
-import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
-import org.openecomp.portalsdk.core.util.SystemProperties;
-import org.openecomp.vid.client.HttpBasicClient;
-import org.openecomp.vid.client.HttpsBasicClient;
-import org.openecomp.vid.scheduler.SchedulerProperties;
-import org.openecomp.vid.scheduler.RestObjects.RestObject;
-import org.springframework.stereotype.Service;
-
-@Service
-public class SchedulerRestInterface implements SchedulerRestInterfaceIfc {
-
-	private static Client client = null;
-		
-	private MultivaluedHashMap<String, Object> commonHeaders;
-	
-	/** The logger. */
-	static EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(SchedulerRestInterface.class);
-	
-	public SchedulerRestInterface() {
-		super();
-	}
-	
-	public void initRestClient()
-	{	
-		System.out.println( "\t <== Starting to initialize rest client ");
-		
-		final String username;
-		final String password;
-		
-		/*Setting user name based on properties*/
-		String retrievedUsername = SystemProperties.getProperty(SchedulerProperties.SCHEDULER_USER_NAME_VAL);
-		if(retrievedUsername.isEmpty()) {
-			username = "";
-		} else {
-			username = retrievedUsername;
-		}
-		
-		/*Setting password based on properties*/
-		String retrievedPassword = SystemProperties.getProperty(SchedulerProperties.SCHEDULER_PASSWORD_VAL);
-		if(retrievedPassword.isEmpty()) {
-			password = "";
-		} else {
-			if (retrievedPassword.contains("OBF:")) {
-				password = Password.deobfuscate(retrievedPassword);
-			} else {
-				password = retrievedPassword;
-			}
-		}
-		
-		String authString = username + ":" + password;
-				
-		byte[] authEncBytes = Base64.encodeBase64(authString.getBytes());
-		String authStringEnc = new String(authEncBytes);
-
-		commonHeaders = new MultivaluedHashMap<String, Object> ();
-		commonHeaders.put("Authorization",  Collections.singletonList((Object) ("Basic " + authStringEnc)));		
-					
-		try {
-			if ( !username.isEmpty() ) { 
-				
-				client = HttpsBasicClient.getClient();
-			}
-			else {
-				
-				client = HttpBasicClient.getClient();
-			}
-		} catch (Exception e) {
-			System.out.println( " <== Unable to initialize rest client ");
-		}
-		
-		System.out.println( "\t<== Client Initialized \n");
-	}
-		
-	@SuppressWarnings("unchecked")
-	public <T> void Get (T t, String sourceId, String path, org.openecomp.vid.scheduler.RestObject<T> restObject ) throws Exception {
-		
-		String methodName = "Get";
-		String url = SystemProperties.getProperty(SchedulerProperties.SCHEDULER_SERVER_URL_VAL) + path;
-		
-		
-		System.out.println( "<== URL FOR GET : " + url + "\n");
-
-        initRestClient();
-		
-		final Response cres = client.target(url)
-			 .request()
-	         .accept("application/json")
-	         .headers(commonHeaders)
-	         .get();
-				
-		int status = cres.getStatus();
-		restObject.setStatusCode (status);
-		
-		if (status == 200) {
-			 t = (T) cres.readEntity(t.getClass());
-			 restObject.set(t);
-			
-		 } else {
-		     throw new Exception(methodName + " with status="+ status + ", url= " + url );
-		 }
-
-		return;
-	}
-		
-	@SuppressWarnings("unchecked")
-	public <T> void Post(T t, JSONObject requestDetails, String path, RestObject<T> restObject) throws Exception {
-		
-        String methodName = "Post";
-        String url = SystemProperties.getProperty(SchedulerProperties.SCHEDULER_SERVER_URL_VAL) + path;
-		        
-        System.out.println( "<== URL FOR POST : " + url + "\n");
-     
-        try {
-            
-            initRestClient();    
-    
-            // Change the content length
-            final Response cres = client.target(url)
-            	 .request()
-                 .accept("application/json")
-	        	 .headers(commonHeaders)
-                 .post(Entity.entity(requestDetails, MediaType.APPLICATION_JSON));
-            
-            try {
-	   			t = (T) cres.readEntity(t.getClass());
-	   			restObject.set(t);
-            }
-            catch ( Exception e ) {
-            	
-            	System.out.println("<== " + methodName + " : No response entity, this is probably ok, e=" + e.getMessage());
-            }
-
-            int status = cres.getStatus();
-    		restObject.setStatusCode (status);    		
-    		    		
-    		if ( status >= 200 && status <= 299 ) {
-    			    			
-    			System.out.println( "<== " + methodName + " : REST api POST was successful!" + "\n");
-    		
-             } else {
-            	 System.out.println( "<== " + methodName + " : FAILED with http status : "+status+", url = " + url + "\n");
-             }    
-   
-        } catch (Exception e)
-        {
-        	System.out.println( "<== " + methodName + " : with url="+url+ ", Exception: " + e.toString() + "\n");
-        	throw e;        
-        }
-    }
-
-	@Override
-	public void logRequest(JSONObject requestDetails) {}
-
-	@SuppressWarnings("unchecked")
-   	public <T> void Delete(T t, JSONObject requestDetails, String sourceID, String path, RestObject<T> restObject) {
-	 
-		String url="";
-		Response cres = null;
-		
-		try {
-			initRestClient();
-			
-			url = SystemProperties.getProperty(SchedulerProperties.SCHEDULER_SERVER_URL_VAL) + path;
-		
-			cres = client.target(url)
-					 .request()
-			         .accept("application/json")
-	        		 .headers(commonHeaders)
-			         //.entity(r)
-			         .build("DELETE", Entity.entity(requestDetails, MediaType.APPLICATION_JSON)).invoke();
-			       //  .method("DELETE", Entity.entity(r, MediaType.APPLICATION_JSON));
-			         //.delete(Entity.entity(r, MediaType.APPLICATION_JSON));
-			
-			int status = cres.getStatus();
-	    	restObject.setStatusCode (status);
-	    			
-			try {
-	   			t = (T) cres.readEntity(t.getClass());
-	   			restObject.set(t);
-            }
-            catch ( Exception e ) {
-            }
-   
-        } 
-		catch (Exception e)
-        {     	
-        	 throw e;        
-        }
-	}
-	
-	public <T> T getInstance(Class<T> clazz) throws IllegalAccessException, InstantiationException
-	{
-		return clazz.newInstance();
-	}
-
-}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/scheduler/SchedulerRestInterfaceFactory.java b/vid-app-common/src/main/java/org/openecomp/vid/scheduler/SchedulerRestInterfaceFactory.java
deleted file mode 100644
index bf7bd88..0000000
--- a/vid-app-common/src/main/java/org/openecomp/vid/scheduler/SchedulerRestInterfaceFactory.java
+++ /dev/null
@@ -1,15 +0,0 @@
-
-package org.openecomp.vid.scheduler;
-
-public class SchedulerRestInterfaceFactory {
-
-	
-	public static SchedulerRestInterfaceIfc getInstance () {
-		SchedulerRestInterfaceIfc obj = null;
-
-		obj = new SchedulerRestInterface();
-		
-		return ( obj );
-	}
-
-}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/scheduler/SchedulerRestInterfaceIfc.java b/vid-app-common/src/main/java/org/openecomp/vid/scheduler/SchedulerRestInterfaceIfc.java
deleted file mode 100644
index 839ab34..0000000
--- a/vid-app-common/src/main/java/org/openecomp/vid/scheduler/SchedulerRestInterfaceIfc.java
+++ /dev/null
@@ -1,21 +0,0 @@
-
-package org.openecomp.vid.scheduler;
-
-import org.json.simple.JSONObject;
-import org.openecomp.vid.scheduler.RestObjects.RestObject;
-import org.springframework.stereotype.Service;
-
-@Service
-public interface SchedulerRestInterfaceIfc {
-
-	public void initRestClient();
-
-	public <T> void Get (T t, String sourceId, String path, org.openecomp.vid.scheduler.RestObject<T> restObject ) throws Exception;
-
-	public <T> void Delete(T t, JSONObject requestDetails, String sourceID, String path, RestObject<T> restObject)
-			throws Exception;
-
-	public <T> void Post(T t, JSONObject r, String path, RestObject<T> restObject) throws Exception;
-
-	public void logRequest(JSONObject requestDetails);
-}
\ No newline at end of file
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/scheduler/SchedulerUtil.java b/vid-app-common/src/main/java/org/openecomp/vid/scheduler/SchedulerUtil.java
deleted file mode 100644
index f82f474..0000000
--- a/vid-app-common/src/main/java/org/openecomp/vid/scheduler/SchedulerUtil.java
+++ /dev/null
@@ -1,100 +0,0 @@
-package org.openecomp.vid.scheduler;
-
-import java.text.DateFormat;
-import java.text.SimpleDateFormat;
-import java.util.Date;
-
-import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
-import org.openecomp.vid.scheduler.SchedulerResponseWrappers.GetTimeSlotsWrapper;
-import org.openecomp.vid.scheduler.SchedulerResponseWrappers.PostCreateNewVnfWrapper;
-import org.openecomp.vid.scheduler.SchedulerResponseWrappers.PostSubmitVnfChangeTimeSlotsWrapper;
-import org.openecomp.vid.scheduler.SchedulerUtil;
-import org.openecomp.vid.scheduler.RestObjects.GetTimeSlotsRestObject;
-import org.openecomp.vid.scheduler.RestObjects.PostCreateNewVnfRestObject;
-import org.openecomp.vid.scheduler.RestObjects.PostSubmitVnfChangeRestObject;
-
-import com.fasterxml.jackson.databind.ObjectMapper;
-
-public class SchedulerUtil {
-	
-	private static EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(SchedulerUtil.class);
-	
-	final static DateFormat dateFormat = new SimpleDateFormat("HH:mm:ss:SSSS");
-
-	public static GetTimeSlotsWrapper getTimeSlotsWrapResponse (GetTimeSlotsRestObject<String> rs) {	
-		
-		String resp_str = "";
-		int status = 0;
-		
-		if ( rs != null ) {
-			resp_str = rs.get();
-			status = rs.getStatusCode();
-		}
-				
-		GetTimeSlotsWrapper w = new GetTimeSlotsWrapper();
-		
-		w.setEntity(resp_str);
-		w.setStatus (status);
-		
-		return (w);
-	}
-	
-	public static PostSubmitVnfChangeTimeSlotsWrapper postSubmitNewVnfWrapResponse (PostSubmitVnfChangeRestObject<String> rs) {	
-		
-		String resp_str = "";
-		int status = 0;
-		String uuid = "";
-		
-		if ( rs != null ) {
-			resp_str = rs.get();
-			status = rs.getStatusCode();
-			uuid = rs.getUUID();
-		}
-				
-		PostSubmitVnfChangeTimeSlotsWrapper w = new PostSubmitVnfChangeTimeSlotsWrapper();
-		
-		w.setEntity(resp_str);
-		w.setStatus (status);
-		w.setUuid(uuid);
-		
-		return (w);
-	}
-	
-	public static PostCreateNewVnfWrapper postCreateNewVnfWrapResponse (PostCreateNewVnfRestObject<String> rs) {	
-		
-		String resp_str = "";
-		int status = 0;
-		String uuid = "";
-		
-		if ( rs != null ) {
-			resp_str = rs.get();
-			status = rs.getStatusCode();
-			uuid = rs.getUUID();
-		}
-				
-		PostCreateNewVnfWrapper w = new PostCreateNewVnfWrapper();
-		
-		w.setEntity(resp_str);
-		w.setStatus (status);
-		w.setUuid(uuid);
-		
-		return (w);
-	}
-	
-	public static <T> String convertPojoToString ( T t ) throws com.fasterxml.jackson.core.JsonProcessingException {
-		
-		String methodName = "convertPojoToString";
-		ObjectMapper mapper = new ObjectMapper();
-		String r_json_str = "";
-	    if ( t != null ) {
-		    try {
-		    	r_json_str = mapper.writeValueAsString(t);
-		    }
-		    catch ( com.fasterxml.jackson.core.JsonProcessingException j ) {
-		    	logger.debug(EELFLoggerDelegate.debugLogger,dateFormat.format(new Date()) + "<== " +  methodName + " Unable to parse object as json");
-		    }
-	    }
-	    return (r_json_str);
-	}
-	
-}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/scheduler/rest/RequestDetails.java b/vid-app-common/src/main/java/org/openecomp/vid/scheduler/rest/RequestDetails.java
deleted file mode 100644
index 746fd9b..0000000
--- a/vid-app-common/src/main/java/org/openecomp/vid/scheduler/rest/RequestDetails.java
+++ /dev/null
@@ -1,106 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * VID
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *      http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.vid.scheduler.rest;
-
-import java.util.HashMap;
-import java.util.Map;
-import java.util.List;
-//import javax.annotation.Generated;
-
-import org.openecomp.vid.domain.mso.CloudConfiguration;
-import org.openecomp.vid.domain.mso.ModelInfo;
-import org.openecomp.vid.domain.mso.RequestInfo;
-import org.openecomp.vid.domain.mso.RequestParameters;
-import org.openecomp.vid.domain.mso.SubscriberInfo;
-import com.fasterxml.jackson.annotation.JsonAnyGetter;
-import com.fasterxml.jackson.annotation.JsonAnySetter;
-import com.fasterxml.jackson.annotation.JsonIgnore;
-import com.fasterxml.jackson.annotation.JsonInclude;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import com.fasterxml.jackson.annotation.JsonPropertyOrder;
-import org.apache.commons.lang.builder.EqualsBuilder;
-import org.apache.commons.lang.builder.HashCodeBuilder;
-import org.apache.commons.lang.builder.ToStringBuilder;
-
-/*
- * "domain" : "ChangeManagement",
-	"scheduleId" : "3569b875-d40e-4adb-a288-a74f4b59ec1c",
-	"scheduleName" : "VnfUpgrade/DWF",
-	"userId" : "jf9860@att.com",
-	"domainData" : {
-		"WorkflowName" : "HEAT Stack Software Update for vNFs"
-	},
-	"status" : "PendingOptimization",
-	"schedulingInfo" : {
-		"scheduleId" : "ChangeManagement.3569b875-d40e-4adb-a288-a74f4b59ec1c",
-		"normalDurationInSecs" : 60,
-		"AdditionalDurationInSecs" : 0,
-		"concurrencyLimit" : 10,
-		"policyId" : ["SNIRO.TimeLimitAndVerticalTopology"],
-		"groups" : [{
-				"groupId" : " group1",
-				"node" : ["satmo415vbc", "satmo455vbc"],
-				"changeWindows" : [{
-						"startTime" : "2017-02-15T01:00:00Z",
-						"finishTime" : "2017-02-15T02:00:00Z"
-					}
-				]
-			}, {
-				"groupId" : " group2",
-				"node" : ["satmo555vbc"],
-				"changeWindows" : [{
-						"startTime" : "2017-02-15T01:00:00Z",
-						"finishTime" : "2017-02-15T02:00:00Z"
-					}, {
-						"startTime" : "2017-02-15T05:00:00Z",
-						"finishTime" : "2017-02-15T05:30:00Z"
-					}
-				]
-			}
-		]
-*/
-@JsonInclude(JsonInclude.Include.NON_NULL)
-@JsonPropertyOrder({
-    "domain",
-    "scheduleId",
-    "scheduleName",
-    "userId",
-    "domainData",
-    "status",
-    "schcedulingInfo"
-})
-public class RequestDetails {
-	
-	@JsonProperty("domain")
-    private String domain;
-	 
-	 
-    
-	@JsonProperty("domain")
-    public String getDomain() {
-        return domain;
-    }
-
-    @JsonProperty("domain")
-    public void setDomain(String domain) {
-        this.domain = domain;
-    }
-}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/services/AaiService.java b/vid-app-common/src/main/java/org/openecomp/vid/services/AaiService.java
deleted file mode 100644
index d3bacad..0000000
--- a/vid-app-common/src/main/java/org/openecomp/vid/services/AaiService.java
+++ /dev/null
@@ -1,34 +0,0 @@
-package org.openecomp.vid.services;
-
-import org.openecomp.vid.aai.AaiResponse;
-import org.openecomp.vid.aai.SubscriberFilteredResults;
-import org.openecomp.vid.aai.model.AaiGetTenatns.GetTenantsResponse;
-import org.openecomp.vid.roles.RoleValidator;
-
-import javax.ws.rs.core.Response;
-import java.util.List;
-
-/**
- * Created by Oren on 7/4/17.
- */
-public interface AaiService {
-
-
-    SubscriberFilteredResults getFullSubscriberList(RoleValidator roleValidator);
-
-    AaiResponse getSubscriberData(String subscriberId, RoleValidator roleValidator);
-
-    AaiResponse getServices(RoleValidator roleValidator);
-    
-    AaiResponse getAaiZones();
-
-    AaiResponse getAicZoneForPnf(String globalCustomerId , String serviceType , String serviceId);
-
-    Response getVNFData(String globalSubscriberId, String serviceType);
-
-    AaiResponse<GetTenantsResponse[]> getTenants(String globalCustomerId, String serviceType, RoleValidator roleValidator);
-
-    AaiResponse getVNFData(String globalSubscriberId, String serviceType, String serviceInstanceId);
-
-    Response getVersionByInvariantId(List<String> modelInvariantId);
-}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/services/AaiServiceImpl.java b/vid-app-common/src/main/java/org/openecomp/vid/services/AaiServiceImpl.java
deleted file mode 100644
index cb09628..0000000
--- a/vid-app-common/src/main/java/org/openecomp/vid/services/AaiServiceImpl.java
+++ /dev/null
@@ -1,101 +0,0 @@
-package org.openecomp.vid.services;
-
-import org.ecomp.aai.model.AaiAICZones.AicZones;
-import org.openecomp.portalsdk.core.util.SystemProperties;
-import org.openecomp.vid.aai.*;
-import org.openecomp.vid.aai.model.AaiGetServicesRequestModel.*;
-import org.openecomp.vid.aai.model.AaiGetTenatns.GetTenantsResponse;
-import org.openecomp.vid.model.*;
-import org.openecomp.vid.roles.RoleValidator;
-import org.openecomp.vid.scheduler.SchedulerProperties;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.http.ResponseEntity;
-
-import javax.ws.rs.core.Response;
-
-import java.util.List;
-
-/**
- * Created by Oren on 7/4/17.
- */
-public class AaiServiceImpl implements AaiService {
-
-
-    @Autowired
-    private AaiClientInterface aaiClient;
-
-
-    @Override
-    public SubscriberFilteredResults getFullSubscriberList(RoleValidator roleValidator) {
-        AaiResponse<SubscriberList> subscriberResponse = aaiClient.getAllSubscribers();
-        SubscriberFilteredResults subscriberFilteredResults =
-                new SubscriberFilteredResults(roleValidator,subscriberResponse.getT(),
-                        subscriberResponse.getErrorMessage(),
-                        subscriberResponse.getHttpCode());
-
-        return subscriberFilteredResults;
-    }
-
-    @Override
-    public AaiResponse getSubscriberData(String subscriberId, RoleValidator roleProvider) {
-        AaiResponse<Services> subscriberResponse = aaiClient.getSubscriberData(subscriberId);
-        String subscriberGlobalId = subscriberResponse.getT().globalCustomerId;
-        for (ServiceSubscription serviceSubscription : subscriberResponse.getT().serviceSubscriptions.serviceSubscription) {
-            String serviceType = serviceSubscription.serviceType;
-            serviceSubscription.isPermitted = roleProvider.isServicePermitted(subscriberGlobalId,serviceType);
-        }
-        return subscriberResponse;
-
-    }
-
-    @Override
-    public Response getVersionByInvariantId(List<String> modelInvariantId) {
-        try {
-            return aaiClient.getVersionByInvariantId(modelInvariantId);
-        }catch (Exception e){
-            e.printStackTrace();
-        }
-        return null;
-    }
-
-    @Override
-    public AaiResponse getServices(RoleValidator roleValidator) {
-        AaiResponse<GetServicesAAIRespone> subscriberResponse = aaiClient.getServices();
-        for (org.openecomp.vid.aai.model.AaiGetServicesRequestModel.Service service :subscriberResponse.getT().service){
-            service.isPermitted = true;
-        }
-        return subscriberResponse;
-    }
-
-    @Override
-    public AaiResponse<GetTenantsResponse[]> getTenants(String globalCustomerId, String serviceType, RoleValidator roleValidator) {
-        AaiResponse<GetTenantsResponse[]> aaiGetTenantsResponse = aaiClient.getTenants(globalCustomerId,serviceType);
-        GetTenantsResponse[] tenants = aaiGetTenantsResponse.getT();
-        for (int i=0;i<tenants.length;i++){
-            tenants[i].isPermitted = roleValidator.isTenantPermitted(globalCustomerId,serviceType, tenants[i].tenantID);
-        }
-        return aaiGetTenantsResponse;
-    }
-
-    @Override
-    public AaiResponse getVNFData(String globalSubscriberId, String serviceType, String serviceInstanceId) {
-        return aaiClient.getVNFData(globalSubscriberId,serviceType,serviceInstanceId);
-    }
-
-    @Override
-    public Response getVNFData(String globalSubscriberId, String serviceType) {
-        return aaiClient.getVNFData(globalSubscriberId,serviceType);
-    }
-
-    @Override
-	public AaiResponse getAaiZones() {
-		AaiResponse<AicZones> response = aaiClient.getAllAicZones();
-		return response;
-	}
-
-	@Override
-	public AaiResponse getAicZoneForPnf(String globalCustomerId , String serviceType , String serviceId) {
-		AaiResponse<AicZones> response = aaiClient.getAicZoneForPnf(globalCustomerId , serviceType , serviceId);
-		return response;
-	}
-}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/services/ChangeManagementService.java b/vid-app-common/src/main/java/org/openecomp/vid/services/ChangeManagementService.java
deleted file mode 100644
index 3ac5282..0000000
--- a/vid-app-common/src/main/java/org/openecomp/vid/services/ChangeManagementService.java
+++ /dev/null
@@ -1,14 +0,0 @@
-package org.openecomp.vid.services;
-
-import org.openecomp.vid.changeManagement.ChangeManagementRequest;
-import org.json.simple.JSONArray;
-import org.openecomp.vid.mso.rest.Request;
-import org.springframework.http.ResponseEntity;
-
-import java.util.Collection;
-
-public interface ChangeManagementService {
-    Collection<Request> getMSOChangeManagements();
-	ResponseEntity<String> doChangeManagement(ChangeManagementRequest request, String vnfName);
-    JSONArray getSchedulerChangeManagements();
-}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/services/ChangeManagementServiceImpl.java b/vid-app-common/src/main/java/org/openecomp/vid/services/ChangeManagementServiceImpl.java
deleted file mode 100644
index 7e69d8f..0000000
--- a/vid-app-common/src/main/java/org/openecomp/vid/services/ChangeManagementServiceImpl.java
+++ /dev/null
@@ -1,109 +0,0 @@
-package org.openecomp.vid.services;
-
-import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
-import org.openecomp.vid.changeManagement.ChangeManagementRequest;
-import org.openecomp.vid.changeManagement.RequestDetails;
-import org.openecomp.vid.mso.MsoBusinessLogic;
-import org.openecomp.vid.mso.MsoResponseWrapper;
-import org.openecomp.vid.controller.MsoController;
-import org.openecomp.portalsdk.core.util.SystemProperties;
-import org.openecomp.vid.scheduler.*;
-
-import org.springframework.http.HttpStatus;
-import org.springframework.http.ResponseEntity;
-import org.openecomp.vid.mso.rest.Request;
-import org.springframework.stereotype.Service;
-import org.json.simple.JSONArray;
-import org.json.simple.parser.JSONParser;
-
-import java.util.Date;
-import java.util.List;
-import java.util.Collection;
-
-
-@Service
-public class ChangeManagementServiceImpl implements ChangeManagementService {
-    @Override
-    public Collection<Request> getMSOChangeManagements() {
-        Collection<Request> result = null;
-		MsoBusinessLogic msoBusinessLogic = new MsoBusinessLogic();
-		try {
-            result = msoBusinessLogic.getOrchestrationRequestsForDashboard();
-        } catch (Exception e) {
-            e.printStackTrace();
-        }
-
-        return result;
-    }
-
-    private RequestDetails findRequestByVnfName(List<RequestDetails> requests, String vnfName){
-
-    	if (requests == null)
-    		return null;
-
-    	for(RequestDetails requestDetails: requests){
-			if(requestDetails.getVnfName().equals(vnfName)){
-				return requestDetails;
-			}
-		}
-
-		return null;
-	}
-
-	@Override
-	public ResponseEntity<String> doChangeManagement(ChangeManagementRequest request, String vnfName) {
-		if (request == null)
-			return null;
-		ResponseEntity<String> response = null;
-		RequestDetails currentRequestDetails = findRequestByVnfName(request.getRequestDetails(), vnfName);
-		MsoResponseWrapper msoResponseWrapperObject = null;
-		if(currentRequestDetails != null){
-			MsoBusinessLogic msoBusinessLogicObject = new MsoBusinessLogic();
-			String serviceInstanceId = currentRequestDetails.getRelatedInstList().get(0).getRelatedInstance().getInstanceId();
-			String vnfInstanceId = currentRequestDetails.getVnfInstanceId();
-			try {
-				if (request.getRequestType().equalsIgnoreCase("update")) {
-					
-					 msoResponseWrapperObject = msoBusinessLogicObject.updateVnf(currentRequestDetails, serviceInstanceId, vnfInstanceId);
-				}
-				else if (request.getRequestType().equalsIgnoreCase("replace"))
-				{
-					msoResponseWrapperObject = msoBusinessLogicObject.replaceVnf(currentRequestDetails, serviceInstanceId, vnfInstanceId);
-//					throw new NotImplementedException();
-				}
-				response = new ResponseEntity<String>(msoResponseWrapperObject.getResponse(), HttpStatus.OK);
-				return response;
-			} catch (Exception e) {
-				e.printStackTrace();
-			}
-
-		}
-
-		// AH:TODO: return ChangeManagementResponse
-		return null;
-	}
-
-    @Override
-    public JSONArray getSchedulerChangeManagements() {
-        JSONArray result = null;
-        try {
-            String path = SystemProperties.getProperty(SchedulerProperties.SCHEDULER_GET_SCHEDULES);
-            org.openecomp.vid.scheduler.RestObject<String> restObject = new org.openecomp.vid.scheduler.RestObject<>();
-            SchedulerRestInterfaceIfc restClient = SchedulerRestInterfaceFactory.getInstance();
-
-            String str = new String();
-            restObject.set(str);
-            restClient.Get(str, "", path, restObject);
-            String restCallResult = restObject.get();
-            JSONParser parser = new JSONParser();
-            Object parserResult = parser.parse(restCallResult);
-            result = (JSONArray) parserResult;
-        } catch (Exception e) {
-            e.printStackTrace();
-        }
-
-        return result;
-    }
-
-
-}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/services/VidService.java b/vid-app-common/src/main/java/org/openecomp/vid/services/VidService.java
deleted file mode 100644
index 4fb0ff1..0000000
--- a/vid-app-common/src/main/java/org/openecomp/vid/services/VidService.java
+++ /dev/null
@@ -1,17 +0,0 @@
-package org.openecomp.vid.services;
-
-import org.openecomp.vid.asdc.AsdcCatalogException;
-import org.openecomp.vid.asdc.beans.Service;
-import org.openecomp.vid.model.ServiceModel;
-
-import java.util.Collection;
-import java.util.Map;
-
-public interface VidService {
-
-	Collection<Service> getServices(Map<String, String[]> requestParams)
-			throws AsdcCatalogException;
-
-	ServiceModel getService(String uuid) throws AsdcCatalogException;
-
-}
\ No newline at end of file
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/services/VidServiceImpl.java b/vid-app-common/src/main/java/org/openecomp/vid/services/VidServiceImpl.java
deleted file mode 100644
index f647af4..0000000
--- a/vid-app-common/src/main/java/org/openecomp/vid/services/VidServiceImpl.java
+++ /dev/null
@@ -1,77 +0,0 @@
-package org.openecomp.vid.services;
-
-import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
-import org.openecomp.sdc.tosca.parser.exceptions.SdcToscaParserException;
-import org.openecomp.vid.asdc.AsdcCatalogException;
-import org.openecomp.vid.asdc.AsdcClient;
-import org.openecomp.vid.asdc.beans.Service;
-import org.openecomp.vid.asdc.parser.ToscaParser;
-import org.openecomp.vid.asdc.parser.ToscaParserImpl;
-import org.openecomp.vid.asdc.parser.ToscaParserImpl2;
-import org.openecomp.vid.model.ServiceModel;
-import org.springframework.beans.factory.annotation.Autowired;
-
-import java.nio.file.Path;
-import java.text.DateFormat;
-import java.text.SimpleDateFormat;
-import java.util.*;
-
-/**
- * The Class VidController.
- */
-
-public class VidServiceImpl implements VidService {
-    /**
-     * The Constant LOG.
-     */
-    private static final EELFLoggerDelegate LOG = EELFLoggerDelegate.getLogger(VidServiceImpl.class);
-    /**
-     * The Constant dateFormat.
-     */
-    private final static DateFormat dateFormat = new SimpleDateFormat("HH:mm:ss:SSSS");
-    protected final AsdcClient asdcClient;
-    @Autowired
-    private ToscaParserImpl2 toscaParser;
-
-    public VidServiceImpl(AsdcClient asdcClient) {
-        this.asdcClient = asdcClient;
-    }
-
-    /*
-     * (non-Javadoc)
-     *
-     * @see org.openecomp.vid.controller.VidService#getServices(java.util.Map)
-     */
-    @Override
-    public Collection<Service> getServices(Map<String, String[]> requestParams)
-            throws AsdcCatalogException {
-        return asdcClient.getServices(requestParams);
-    }
-
-    /*
-     * (non-Javadoc)
-     *
-     * @see org.openecomp.vid.controller.VidService#getService(java.lang.String)
-     */
-    @Override
-    public ServiceModel getService(String uuid) throws AsdcCatalogException {
-        final Path serviceCsar = asdcClient.getServiceToscaModel(UUID.fromString(uuid));
-        ToscaParser tosca = new ToscaParserImpl();
-        serviceCsar.toFile().getAbsolutePath();
-        ServiceModel serviceModel = null;
-        try {
-            final Service asdcServiceMetadata = asdcClient.getService(UUID.fromString(uuid));
-            try {
-                serviceModel = toscaParser.makeServiceModel(serviceCsar, asdcServiceMetadata);
-            }
-            catch (SdcToscaParserException e){
-                serviceModel = tosca.makeServiceModel(uuid, serviceCsar, asdcServiceMetadata);
-            }
-        } catch (Exception e) {
-            e.printStackTrace();
-        }
-        return serviceModel;
-    }
-
-
-}
\ No newline at end of file
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/services/WorkflowService.java b/vid-app-common/src/main/java/org/openecomp/vid/services/WorkflowService.java
deleted file mode 100644
index 7f43433..0000000
--- a/vid-app-common/src/main/java/org/openecomp/vid/services/WorkflowService.java
+++ /dev/null
@@ -1,9 +0,0 @@
-package org.openecomp.vid.services;
-
-import org.openecomp.vid.model.Workflow;
-import java.util.Collection;
-
-public interface WorkflowService {
-    Collection<String> getWorkflowsForVNFs(Collection<String> vnfNames);
-    Collection<String> getAllWorkflows();
-}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/services/WorkflowServiceImpl.java b/vid-app-common/src/main/java/org/openecomp/vid/services/WorkflowServiceImpl.java
deleted file mode 100644
index deb5060..0000000
--- a/vid-app-common/src/main/java/org/openecomp/vid/services/WorkflowServiceImpl.java
+++ /dev/null
@@ -1,40 +0,0 @@
-package org.openecomp.vid.services;
-
-import org.openecomp.vid.model.Workflow;
-import org.springframework.stereotype.Service;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.stream.Collectors;
-
-@Service
-public class WorkflowServiceImpl implements WorkflowService {
-    //TODO: Add the list of workflows hard coded or from DB.
-    private ArrayList<Workflow> workflows = new ArrayList<>(Arrays.asList(
-            new Workflow(0, "Upgrade", new ArrayList<>(Arrays.asList("VNF1", "VNF2", "VNF3", "VNF4"))),
-            new Workflow(1, "Clean", new ArrayList<>(Arrays.asList("VNF1", "VNF2", "VNF3"))),
-            new Workflow(2, "Reinstall", new ArrayList<>(Arrays.asList("VNF1", "VNF2", "VNF4"))),
-            new Workflow(3, "Dump", new ArrayList<>(Arrays.asList("VNF1", "VNF3", "VNF4"))),
-            new Workflow(4, "Flush", new ArrayList<>(Arrays.asList("VNF2", "VNF3", "VNF4")))
-    ));
-
-    @Override
-    public Collection<String> getWorkflowsForVNFs(Collection<String> vnfNames) {
-        Collection<String> result = workflows.stream()
-                .filter(workflow -> workflow.getVnfNames().containsAll(vnfNames))
-                .map(workflow -> workflow.getWorkflowName())
-                .distinct()
-                .collect(Collectors.toList());
-
-        return result;
-    }
-
-    @Override
-    public Collection<String> getAllWorkflows() {
-        return workflows.stream()
-                .map(workflow -> workflow.getWorkflowName())
-                .distinct()
-                .collect(Collectors.toList());
-    }
-}
diff --git a/vid-app-common/src/main/resources/2f80c596.zip b/vid-app-common/src/main/resources/2f80c596.zip
new file mode 100644
index 0000000..30935c6
--- /dev/null
+++ b/vid-app-common/src/main/resources/2f80c596.zip
Binary files differ
diff --git a/vid-app-common/src/main/resources/aai_config_instance_view_edit.json b/vid-app-common/src/main/resources/aai_config_instance_view_edit.json
new file mode 100644
index 0000000..7920c6d
--- /dev/null
+++ b/vid-app-common/src/main/resources/aai_config_instance_view_edit.json
@@ -0,0 +1,81 @@
+{
+  "model-name":"Proxy-Config-Instance",
+  "configuration":{
+    "configuration-id": "9533-config-LB1113",
+    "configuration-name": "configuration-name-9533",
+    "configuration-type": "configuration-type-9533",
+    "configuration-sub-type": "configuration-sub-type-9533",
+    "model-invariant-id": "model-invariant-id-9533",
+    "model-version-id": "model-version-id-9533",
+    "orchestration-status": "Active",
+    "operational-status": "",
+    "configuration-selflink": "",
+    "model-customization-id": "model-customization-id-9533",
+    "resource-version": "1504038855716"
+  },
+  "extra-properties": {
+  },
+  "inventory-response-items":{
+    "inventory-response-item":[
+      {
+        "model-name":"VidPcrf051517..pcrf_nimbus_pcm..module-4",
+        "l-interface": {
+          "interface-name": "9533lInterface-LB1113",
+          "interface-role": "8ni",
+          "v6-wan-link-ip": "Pnr",
+          "selflink": "Un56B",
+          "interface-id": "o74n",
+          "macaddr": "8an6",
+          "network-name": "kjOn",
+          "management-option": "0Rn7",
+          "interface-description": "XPnLr",
+          "is-port-mirrored": true,
+          "resource-version": "1504038598348",
+          "in-maint": false,
+          "is-ip-unnumbered": false,
+          "relationship-list": {
+            "relationship": [
+              {
+                "related-to": "logical-link",
+                "related-link": "/aai/v11/network/logical-links/logical-link/logicallink-987654321-21-LB1113",
+                "relationship-data": [
+                  {
+                    "relationship-key": "logical-link.link-name",
+                    "relationship-value": "logicallink-987654321-21-LB1113"
+                  }
+                ]
+              }
+            ]
+          },
+          "l3-interface-ipv4-address-list": [
+            {
+              "l3-interface-ipv4-address": "112.121.144.16",
+              "l3-interface-ipv4-prefix-length": 59,
+              "vlan-id-inner": 917,
+              "vlan-id-outer": 519,
+              "is-floating": true,
+              "resource-version": "1504038598353",
+              "neutron-network-id": "HX6m54p1akX",
+              "neutron-subnet-id": "nbmX5okGg"
+            }
+          ],
+          "l3-interface-ipv6-address-list": [
+            {
+              "l3-interface-ipv6-address": "2001:232E:2333:2322:122C:CDD:2AE3:3E4",
+              "l3-interface-ipv6-prefix-length": 76,
+              "vlan-id-inner": 27,
+              "vlan-id-outer": 710,
+              "is-floating": true,
+              "resource-version": "1504038598364",
+              "neutron-network-id": "xBR0OOToQ",
+              "neutron-subnet-id": "4E0gZLH"
+            }
+          ]
+        },
+        "extra-properties":{
+
+        }
+      }
+    ]
+  }
+}
\ No newline at end of file
diff --git a/vid-app-common/src/main/resources/aai_get_node_template_instances.json b/vid-app-common/src/main/resources/aai_get_node_template_instances.json
new file mode 100644
index 0000000..97c452a
--- /dev/null
+++ b/vid-app-common/src/main/resources/aai_get_node_template_instances.json
@@ -0,0 +1,101 @@
+{"results": [
+  {
+    "id": "1976357096",
+    "node-type": "generic-vnf",
+    "url": "/aai/v11/network/generic-vnfs/generic-vnf/VNF-1-9887-jc689q",
+    "properties":       {
+      "vnf-id": "0846287b-65bf-45a6-88f6-6a1af4149fac",
+      "vnf-name": "vnf9887-1jc689q",
+      "vnf-name2": "notused",
+      "vnf-type": "VRR",
+      "service-id": "VRRaaS",
+      "regional-resource-zone": "notusedforMobility",
+      "prov-status": "PREPROV",
+      "operational-status": "",
+      "license-key": "novalue",
+      "equipment-role": "VRR",
+      "orchestration-status": "Created",
+      "heat-stack-id": "1234",
+      "mso-catalog-key": "msokey",
+      "ipv4-oam-address": "135.60.77.25",
+      "ipv4-loopback0-address": "12.60.77.25",
+      "nm-lan-v6-address": "2001:1890:1F8:2075::1:4",
+      "management-v6-address": "2001:1890:1F8:2075::1:5",
+      "in-maint": false,
+      "is-closed-loop-disabled": false,
+      "resource-version": "1505337418309",
+      "model-invariant-id": "96129eb9-f0de-4e05-8af2-73146473f766",
+      "model-version-id": "5761e0a7-c6df-4d8a-9ebd-b8f445054dec",
+      "widget-model-id": "78789",
+      "widget-model-version": "7",
+      "nf-function": "nf-function in ASDC",
+      "nf-role": "nf-role in ASDC",
+      "nf-naming-code": "code in ASDC",
+      "selflink": "pathToController"
+    },
+    "related-to":       [
+      {
+        "id": "1689710648",
+        "node-type": "service-instance",
+        "url": "/aai/v11/business/customers/customer/customer-9887-jc689q/service-subscriptions/service-subscription/VRR/service-instances/service-instance/SI-9887-jc689q"
+      },
+      {
+        "id": "1362120784",
+        "node-type": "vserver",
+        "url": "/aai/v11/cloud-infrastructure/cloud-regions/cloud-region/cloudOwner-id-9887-jc689q/cloudRegion-id-9887-jc689q/tenants/tenant/tenant-id-9887-jc689q/vservers/vserver/vserver-id-2-9887-jc689q"
+      },
+      {
+        "id": "2017317104",
+        "node-type": "vserver",
+        "url": "/aai/v11/cloud-infrastructure/cloud-regions/cloud-region/cloudOwner-id-9887-jc689q/cloudRegion-id-9887-jc689q/tenants/tenant/tenant-id-9887-jc689q/vservers/vserver/vserver-id-1-9887-jc689q"
+      }
+    ]
+  },
+  {
+    "id": "2362269792",
+    "node-type": "generic-vnf",
+    "url": "/aai/v11/network/generic-vnfs/generic-vnf/VNF-2-9887-jc689q",
+    "properties":       {
+      "vnf-id": "c187e9fe-40c3-4862-b73e-84ff056205f6",
+      "vnf-name": "vnf9887-2jc689q",
+      "vnf-name2": "notused",
+      "vnf-type": "VRR",
+      "service-id": "VRRaaS",
+      "regional-resource-zone": "notusedforMobility",
+      "prov-status": "PREPROV",
+      "operational-status": "",
+      "license-key": "novalue",
+      "equipment-role": "VRR",
+      "orchestration-status": "Created",
+      "heat-stack-id": "1234",
+      "mso-catalog-key": "msokey",
+      "ipv4-oam-address": "135.60.77.25",
+      "ipv4-loopback0-address": "12.60.77.25",
+      "nm-lan-v6-address": "2001:1890:1F8:2075::1:4",
+      "management-v6-address": "2001:1890:1F8:2075::1:5",
+      "in-maint": false,
+      "is-closed-loop-disabled": false,
+      "resource-version": "1505337418754",
+      "model-invariant-id": "96129eb9-f0de-4e05-8af2-73146473f766",
+      "model-version-id": "5761e0a7-c6df-4d8a-9ebd-b8f445054dec",
+      "widget-model-id": "78789",
+      "widget-model-version": "7",
+      "nf-function": "nf-function in ASDC",
+      "nf-role": "nf-role in ASDC",
+      "nf-naming-code": "code in ASDC",
+      "selflink": "pathToController"
+    },
+    "related-to":       [
+      {
+        "id": "1689710648",
+        "node-type": "service-instance",
+        "url": "/aai/v11/business/customers/customer/customer-9887-jc689q/service-subscriptions/service-subscription/VRR/service-instances/service-instance/SI-9887-jc689q"
+      },
+      {
+        "id": "1689706552",
+        "node-type": "vserver",
+        "url": "/aai/v11/cloud-infrastructure/cloud-regions/cloud-region/cloudOwner-id-9887-jc689q/cloudRegion-id-9887-jc689q/tenants/tenant/tenant-id-9887-jc689q/vservers/vserver/vserver-id-3-9887-jc689q"
+      }
+    ]
+  }
+]}
\ No newline at end of file
diff --git a/vid-app-common/src/main/resources/adiod.zip b/vid-app-common/src/main/resources/adiod.zip
new file mode 100644
index 0000000..415fa48
--- /dev/null
+++ b/vid-app-common/src/main/resources/adiod.zip
Binary files differ
diff --git a/vid-app-common/src/main/resources/csar317927061915233480.zip b/vid-app-common/src/main/resources/csar317927061915233480.zip
new file mode 100644
index 0000000..36ac9f9
--- /dev/null
+++ b/vid-app-common/src/main/resources/csar317927061915233480.zip
Binary files differ
diff --git a/vid-app-common/src/main/resources/generateRoleScript.sh b/vid-app-common/src/main/resources/generateRoleScript.sh
new file mode 100644
index 0000000..cf73b74
--- /dev/null
+++ b/vid-app-common/src/main/resources/generateRoleScript.sh
@@ -0,0 +1,3 @@
+firstRun=${1-false}
+url=http://127.0.0.1:8080/vid/generateRoleScript/$firstRun
+wget -O roles.sql $url
\ No newline at end of file
diff --git a/vid-app-common/src/main/resources/json/mso/modelInfo b/vid-app-common/src/main/resources/json/mso/modelInfo
index dcb3112..d368e35 100755
--- a/vid-app-common/src/main/resources/json/mso/modelInfo
+++ b/vid-app-common/src/main/resources/json/mso/modelInfo
@@ -33,6 +33,7 @@
 			"description": "short description of the entity being operated on",
 			"type": "string",
 			"enum": [
+			    "pnf",
 				"network",
 				"service",
 				"vfModule",
diff --git a/vid-app-common/src/main/resources/json/mso/requestStatus b/vid-app-common/src/main/resources/json/mso/requestStatus
index 11b2856..75b7215 100755
--- a/vid-app-common/src/main/resources/json/mso/requestStatus
+++ b/vid-app-common/src/main/resources/json/mso/requestStatus
@@ -8,15 +8,6 @@
         },
         "requestState": {
             "description": "short description of the instantiation state",
-            "enum": [
-                "COMPLETE",
-                "FAILED",
-                "IN_PROGRESS",
-                "PENDING",
-                "UNLOCKED",
-                "COMPLETED",
-                ""
-            ],
             "type": "string"
         },
         "statusMessage": {
diff --git a/vid-app-common/src/main/resources/owning-entity-properties.JSON b/vid-app-common/src/main/resources/owning-entity-properties.JSON
new file mode 100644
index 0000000..a86c28c
--- /dev/null
+++ b/vid-app-common/src/main/resources/owning-entity-properties.JSON
@@ -0,0 +1,17 @@
+{
+	"owningEntityProperties" : {
+		"platform": {
+			"Platform-name": "Platform-name"
+		},
+		"project": {
+			"Project-name": "Project-name"
+		},
+		"lineOfBusiness": {
+			"Line-of-business-name": "Line-of-business-name"
+		},		
+		"owningEntity": {
+			"Owning-entity-id": "Owning-entity-name"
+		}	
+	}			
+}
+	
diff --git a/vid-app-common/src/main/resources/pnf.csar b/vid-app-common/src/main/resources/pnf.zip
similarity index 100%
rename from vid-app-common/src/main/resources/pnf.csar
rename to vid-app-common/src/main/resources/pnf.zip
Binary files differ
diff --git a/vid-app-common/src/main/resources/scripts/category_parameter.sh b/vid-app-common/src/main/resources/scripts/category_parameter.sh
new file mode 100644
index 0000000..0ff1c73
--- /dev/null
+++ b/vid-app-common/src/main/resources/scripts/category_parameter.sh
@@ -0,0 +1,64 @@
+#!/bin/bash
+usage() { echo -e "Usage: $0 [-o <ADD|GET>] [-p <FILE_PATH>] [-c category_name] [-f FAMILY]" 1>&2; exit 1; }
+while getopts ":o:p:c:f:" opt; do
+    case ${opt} in
+        o)
+            OPERATION=${OPTARG}
+            ;;
+        p)
+            FILE=${OPTARG}
+            ;;
+        c)
+            CATEGORY=${OPTARG}
+            ;;
+        f)
+            FAMILY=${OPTARG}
+            ;;
+        *)
+            usage
+            ;;
+    esac
+done
+shift $((OPTIND-1))
+if [ -z "${FILE}" ] || [ -z "${OPERATION}" ]; then
+    usage
+fi
+if [ ${OPERATION} != 'ADD' ] && [ ${OPERATION} != 'GET' ]; then
+   usage
+fi
+if [ ${OPERATION} = 'ADD' ]; then
+    if [ -z "${CATEGORY}" ] ; then
+        usage
+    fi
+    OPERATION='POST'
+fi
+if [ ${OPERATION} = 'GET' ]; then
+    if [ -z "${FAMILY}" ] ; then
+        usage
+    fi
+fi
+URL="http://127.0.0.1:8080/vid/maintenance/category_parameter"
+if [ ${OPERATION} = 'GET' ]; then
+    FULLURL="${URL}?familyName=${FAMILY}"
+    echo "Sending request: ${FULLURL}"
+    echo -e "------------------------\nwget output:"
+    wget -nv -O "${FILE}" "${FULLURL}"
+    RC=$?
+    echo "---------------------------"
+    if [ $RC -eq 0 ]; then
+        echo "Result saved to ${FILE}"
+    else
+       echo "Failed to get category parameters list"
+    fi
+else
+    BODY=$(cat ${FILE} | awk '  BEGIN {  ; print " {\"options\" : [ "}   {  gsub(/ /, "", $0) ; printf "%s\"%s\"",separator,$1 ;separator = ", ";} END { printf " ]} "}')
+    FULLURL="${URL}/${CATEGORY}"
+    echo "Sending request: ${FULLURL} ${OPERATION} ${BODY}"
+    echo -e "------------------------\nwget output:"
+    wget --method="${OPERATION}" --body-data="${BODY}" --header=Content-Type:application/json --content-on-error -nv -O - "${FULLURL}"
+    RC=$?
+    echo "---------------------------"
+    if [ $RC -ne 0 ]; then
+       echo "Failed to ADD options to category ${CATEGORY}"
+    fi
+fi
diff --git a/vid-app-common/src/main/resources/scripts/update_category_option_name.sh b/vid-app-common/src/main/resources/scripts/update_category_option_name.sh
new file mode 100644
index 0000000..5ff5058
--- /dev/null
+++ b/vid-app-common/src/main/resources/scripts/update_category_option_name.sh
@@ -0,0 +1,34 @@
+#!/bin/bash
+usage() { echo -e "Usage: $0 [-c category_name] [-i option_id] [-n option_updated_name]" 1>&2; exit 1; }
+while getopts ":c:i:n:" opt; do
+    case ${opt} in
+        i)
+            ID=${OPTARG}
+            ;;
+        n)
+            NAME=${OPTARG}
+            ;;
+        c)
+            CATEGORY=${OPTARG}
+            ;;
+        *)
+            usage
+            ;;
+    esac
+done
+shift $((OPTIND-1))
+if [ -z "${ID}" ] || [ -z "${NAME}" ] || [ -z "${CATEGORY}" ]; then
+    usage
+fi
+URL="http://127.0.0.1:8080/vid/maintenance/category_parameter/"
+OPERATION="PUT"
+FULLURL="${URL}${CATEGORY}"
+BODY="{\"id\":\"${ID}\",\"name\":\"${NAME}\"}"
+echo "Sending request: ${FULLURL} ${OPERATION} ${BODY}"
+echo -e "------------------------\nwget output:"
+wget --method="${OPERATION}" --body-data="${BODY}" --header=Content-Type:application/json --content-on-error -nv -O - "${FULLURL}"
+RC=$?
+echo "---------------------------"
+if [ $RC -ne 0 ]; then
+   echo "Failed to update option name ${NAME} for option id ${ID} of category ${CATEGORY}"
+fi
\ No newline at end of file
diff --git a/vid-app-common/src/main/resources/scripts/vnf_wf.sh b/vid-app-common/src/main/resources/scripts/vnf_wf.sh
new file mode 100644
index 0000000..69cb595
--- /dev/null
+++ b/vid-app-common/src/main/resources/scripts/vnf_wf.sh
@@ -0,0 +1,49 @@
+#!/bin/bash
+usage() { echo -e "Usage: $0 [-o <ADD|DELETE|GET>] [-p <FILE_PATH>]\nCSV File Format: VNF_UUID,VNF_invariantUUID,workflowName" 1>&2; exit 1; }
+while getopts ":o:p:" opt; do
+    case ${opt} in
+        o)
+            OPERATION=${OPTARG}
+            ;;
+        p)
+            FILE=${OPTARG}
+            ;;
+        *)
+            usage
+            ;;
+    esac
+done
+shift $((OPTIND-1))
+if [ -z "${FILE}" ] || [ -z "${OPERATION}" ]; then
+    usage
+fi
+if [ ${OPERATION} != 'ADD' ] && [ ${OPERATION} != 'DELETE' ] && [ ${OPERATION} != 'GET' ]; then
+   usage
+fi
+if [ ${OPERATION} = 'ADD' ]; then
+	OPERATION='POST'
+fi
+URL="http://127.0.0.1:8080/vid/change-management/vnf_workflow_relation"
+if [ ${OPERATION} = 'GET' ]; then
+    echo "Sending request for get all vnf_workflow_relation"
+    echo -e "------------------------\nwget output:"
+    wget -nv -O "${FILE}" "${URL}"
+    RC=$?
+    echo "---------------------------"
+    if [ $RC -eq 0 ]; then
+        echo "Result saved to ${FILE}"
+    else
+       echo "Failed to get vnf to workflows relations"
+    fi
+else
+    BODY=$(cat ${FILE} | awk '  BEGIN {  FS=","; print " {\"workflowsDetails\" : [ "}   {  gsub(/ /, "", $1) ; gsub(/ /, "", $2) ; gsub(/^[ \t]+/,"",$3); gsub(/[ \t]+$/,"",$3); printf "%s{\"vnfDetails\":{\"UUID\":\"%s\",\"invariantUUID\":\"%s\"},\"workflowName\":\"%s\"}",separator,$1,$2,$3 ;separator = ", ";} END { printf " ]} "}')
+    echo "Sending request: ${OPERATION} ${BODY}"
+    echo -e "------------------------\nwget output:"
+    wget --method="${OPERATION}" --body-data="${BODY}" --header=Content-Type:application/json --content-on-error -nv -O - "${URL}"
+    RC=$?
+    echo "---------------------------"
+    if [ $RC -ne 0 ]; then
+       echo "Failed to ADD/DELETE vnf to workflows relations"
+    fi
+fi
+
diff --git a/vid-app-common/src/main/resources/sdcservices.json b/vid-app-common/src/main/resources/sdcservices.json
index 81a08d9..1d936f6 100644
--- a/vid-app-common/src/main/resources/sdcservices.json
+++ b/vid-app-common/src/main/resources/sdcservices.json
@@ -4,7 +4,7 @@
       "uuid": "48a52540-8772-4368-9cdb-1f124ea5c931",
       "invariantUUID": "f430728a-4530-42be-a577-1206b9484cef",
       "name": "4-27_vMME_Service",
-      "version": "0.1",
+      "version": "1.0",
       "toscaModelURL": "./service-vf-csar.zip",
       "category": "Mobility",
       "lifecycleState": "CERTIFIED",
@@ -15,10 +15,10 @@
       "resources": null
     },
     {
-      "uuid": "68101369-6f08-4e99-9a28-fa6327d344f3",
+      "uuid": "cb49608f-5a24-4789-b0f7-2595473cb997",
       "invariantUUID": "0311f998-9268-4fd6-bbba-afff15087b72",
       "name": "4-27_vMME_Service",
-      "version": "0.1",
+      "version": "1.0",
       "toscaModelURL": "./service-vl-csar.zip",
       "category": "Mobility",
       "lifecycleState": "CERTIFIED",
@@ -32,8 +32,78 @@
       "uuid": "73e1322a-8a9a-49dc-9558-b0c5c5770e4a",
       "invariantUUID": "f430728a-4530-42be-a577-1206b9484cef",
       "name": "4-27_vMME_Service",
-      "version": "0.1",
-      "toscaModelURL": "./pnf.csar",
+      "version": "1.0",
+      "toscaModelURL": "./pnf.zip",
+      "category": "Mobility",
+      "lifecycleState": "CERTIFIED",
+      "lastUpdaterUserId": "rg276b",
+      "lastUpdaterFullName": null,
+      "distributionStatus": "DISTRIBUTED",
+      "artifacts": null,
+      "resources": null
+    },
+    {
+      "uuid": "240376de-870e-48df-915a-31f140eedd2c",
+      "invariantUUID": "709d1be4-9a3f-4a29-8c4d-a20465e808a3",
+      "name": "Demo Service",
+      "version": "1.0",
+      "toscaModelURL": "./service-DemoService1-csar.csar",
+      "category": "Mobility",
+      "lifecycleState": "CERTIFIED",
+      "lastUpdaterUserId": "rg276b",
+      "lastUpdaterFullName": null,
+      "distributionStatus": "DISTRIBUTED",
+      "artifacts": null,
+      "resources": null
+    },
+    {
+      "uuid": "32671332-a7ee-4df6-9609-db50ce5eaee7",
+      "invariantUUID": "598e3f9e-3244-4d8f-a8e0-0e5d7a29eda9",
+      "name": "ADIOD vMX vPE_BV Service 488",
+      "version": "1.0",
+      "toscaModelURL": "./adiod.zip",
+      "category": "Mobility",
+      "lifecycleState": "CERTIFIED",
+      "lastUpdaterUserId": "rg276b",
+      "lastUpdaterFullName": null,
+      "distributionStatus": "DISTRIBUTED",
+      "artifacts": null,
+      "resources": null
+    },
+    {
+      "uuid": "55a48870-d99e-41a8-a3b4-a8d748333139",
+      "invariantUUID": "3d89efc0-19ca-4df7-9818-028e1fc6f708",
+      "name": "AMP PH SVC",
+      "version": "1.0",
+      "toscaModelURL": "./service-AmpPhSvc-csar.zip",
+      "category": "Mobility",
+      "lifecycleState": "CERTIFIED",
+      "lastUpdaterUserId": "rg276b",
+      "lastUpdaterFullName": null,
+      "distributionStatus": "DISTRIBUTED",
+      "artifacts": null,
+      "resources": null
+    },
+    {
+      "uuid": "2f80c596-27e5-4ca9-b5bb-e03a7fd4c0fd",
+      "invariantUUID": "e49fbd11-e60c-4a8e-b4bf-30fbe8f4fcc0",
+      "name": "action-data",
+      "version": "1.0",
+      "toscaModelURL": "./2f80c596.zip",
+      "category": "Mobility",
+      "lifecycleState": "CERTIFIED",
+      "lastUpdaterUserId": "rg276b",
+      "lastUpdaterFullName": null,
+      "distributionStatus": "DISTRIBUTED",
+      "artifacts": null,
+      "resources": null
+    },
+    {
+      "uuid": "ee6d61be-4841-4f98-8f23-5de9da846ca7",
+      "invariantUUID": "b7d923c9-6175-41f1-91ba-4565c4953408",
+      "name": "Multiple pProbes",
+      "version": "1.0",
+      "toscaModelURL": "./service-Servicecontainermultiplepprobes-csar.csar",
       "category": "Mobility",
       "lifecycleState": "CERTIFIED",
       "lastUpdaterUserId": "rg276b",
diff --git a/vid-app-common/src/main/resources/service-AmpPhSvc-csar.zip b/vid-app-common/src/main/resources/service-AmpPhSvc-csar.zip
new file mode 100644
index 0000000..6d5002c
--- /dev/null
+++ b/vid-app-common/src/main/resources/service-AmpPhSvc-csar.zip
Binary files differ
diff --git a/vid-app-common/src/main/resources/service-David-csar.csar b/vid-app-common/src/main/resources/service-David-csar.csar
new file mode 100644
index 0000000..fcf1c64
--- /dev/null
+++ b/vid-app-common/src/main/resources/service-David-csar.csar
Binary files differ
diff --git a/vid-app-common/src/main/resources/service-DemoService1-csar.csar b/vid-app-common/src/main/resources/service-DemoService1-csar.csar
new file mode 100644
index 0000000..0e34dc5
--- /dev/null
+++ b/vid-app-common/src/main/resources/service-DemoService1-csar.csar
Binary files differ
diff --git a/vid-app-common/src/main/resources/service-Servicecontainermultiplepprobes-csar.csar b/vid-app-common/src/main/resources/service-Servicecontainermultiplepprobes-csar.csar
new file mode 100644
index 0000000..81691fe
--- /dev/null
+++ b/vid-app-common/src/main/resources/service-Servicecontainermultiplepprobes-csar.csar
Binary files differ
diff --git a/vid-app-common/src/main/resources/test.csv b/vid-app-common/src/main/resources/test.csv
new file mode 100644
index 0000000..a0b09b7
--- /dev/null
+++ b/vid-app-common/src/main/resources/test.csv
@@ -0,0 +1,5 @@
+ee6d61be-4841-4f98-8f23-5de9da846ca7,95c75a48-6f86-498f-b1a6-e9179a83d9c7,Update
+ee6d61be-4841-4f98-8f23-5de9da846ca7,95c75a48-6f86-498f-b1a6-e9179a83d9c7,  VNF In Place Software Update
+418f32e5-484a-4073-8fa9-fab7d497459f,709d1be4-9a3f-4a29-8c4d-a20465e808a3,  VNF In Place Software Update
+fa06db34-f8e3-42d9-8e51-a76816eb0f0d,0ebfb706-a846-4715-b0d0-fe0be09458d7,  VNF In Place Software Update  
+fa06db34-f8e3-42d9-8e51-a76816eb0f0d, 87447b67-29e3-4244-8038-990a8c70259a,Replace
\ No newline at end of file
diff --git a/vid-app-common/src/main/webapp/app/vid/external/upload-file/ng-file-upload.min.js b/vid-app-common/src/main/webapp/app/vid/external/upload-file/ng-file-upload.min.js
new file mode 100644
index 0000000..4bfe942
--- /dev/null
+++ b/vid-app-common/src/main/webapp/app/vid/external/upload-file/ng-file-upload.min.js
@@ -0,0 +1,3 @@
+/*! 12.2.13 */
+!window.XMLHttpRequest||window.FileAPI&&FileAPI.shouldLoad||(window.XMLHttpRequest.prototype.setRequestHeader=function(a){return function(b,c){if("__setXHR_"===b){var d=c(this);d instanceof Function&&d(this)}else a.apply(this,arguments)}}(window.XMLHttpRequest.prototype.setRequestHeader));var ngFileUpload=angular.module("ngFileUpload",[]);ngFileUpload.version="12.2.13",ngFileUpload.service("UploadBase",["$http","$q","$timeout",function(a,b,c){function d(d){function e(a){j.notify&&j.notify(a),k.progressFunc&&c(function(){k.progressFunc(a)})}function h(a){return null!=d._start&&g?{loaded:a.loaded+d._start,total:d._file&&d._file.size||a.total,type:a.type,config:d,lengthComputable:!0,target:a.target}:a}function i(){a(d).then(function(a){if(g&&d._chunkSize&&!d._finished&&d._file){var b=d._file&&d._file.size||0;e({loaded:Math.min(d._end,b),total:b,config:d,type:"progress"}),f.upload(d,!0)}else d._finished&&delete d._finished,j.resolve(a)},function(a){j.reject(a)},function(a){j.notify(a)})}d.method=d.method||"POST",d.headers=d.headers||{};var j=d._deferred=d._deferred||b.defer(),k=j.promise;return d.disableProgress||(d.headers.__setXHR_=function(){return function(a){a&&a.upload&&a.upload.addEventListener&&(d.__XHR=a,d.xhrFn&&d.xhrFn(a),a.upload.addEventListener("progress",function(a){a.config=d,e(h(a))},!1),a.upload.addEventListener("load",function(a){a.lengthComputable&&(a.config=d,e(h(a)))},!1))}}),g?d._chunkSize&&d._end&&!d._finished?(d._start=d._end,d._end+=d._chunkSize,i()):d.resumeSizeUrl?a.get(d.resumeSizeUrl).then(function(a){d._start=d.resumeSizeResponseReader?d.resumeSizeResponseReader(a.data):parseInt((null==a.data.size?a.data:a.data.size).toString()),d._chunkSize&&(d._end=d._start+d._chunkSize),i()},function(a){throw a}):d.resumeSize?d.resumeSize().then(function(a){d._start=a,d._chunkSize&&(d._end=d._start+d._chunkSize),i()},function(a){throw a}):(d._chunkSize&&(d._start=0,d._end=d._start+d._chunkSize),i()):i(),k.success=function(a){return k.then(function(b){a(b.data,b.status,b.headers,d)}),k},k.error=function(a){return k.then(null,function(b){a(b.data,b.status,b.headers,d)}),k},k.progress=function(a){return k.progressFunc=a,k.then(null,null,function(b){a(b)}),k},k.abort=k.pause=function(){return d.__XHR&&c(function(){d.__XHR.abort()}),k},k.xhr=function(a){return d.xhrFn=function(b){return function(){b&&b.apply(k,arguments),a.apply(k,arguments)}}(d.xhrFn),k},f.promisesCount++,k["finally"]&&k["finally"]instanceof Function&&k["finally"](function(){f.promisesCount--}),k}function e(a){var b={};for(var c in a)a.hasOwnProperty(c)&&(b[c]=a[c]);return b}var f=this;f.promisesCount=0,this.isResumeSupported=function(){return window.Blob&&window.Blob.prototype.slice};var g=this.isResumeSupported();this.isUploadInProgress=function(){return f.promisesCount>0},this.rename=function(a,b){return a.ngfName=b,a},this.jsonBlob=function(a){null==a||angular.isString(a)||(a=JSON.stringify(a));var b=new window.Blob([a],{type:"application/json"});return b._ngfBlob=!0,b},this.json=function(a){return angular.toJson(a)},this.isFile=function(a){return null!=a&&(a instanceof window.Blob||a.flashId&&a.name&&a.size)},this.upload=function(a,b){function c(b,c){if(b._ngfBlob)return b;if(a._file=a._file||b,null!=a._start&&g){a._end&&a._end>=b.size&&(a._finished=!0,a._end=b.size);var d=b.slice(a._start,a._end||b.size);return d.name=b.name,d.ngfName=b.ngfName,a._chunkSize&&(c.append("_chunkSize",a._chunkSize),c.append("_currentChunkSize",a._end-a._start),c.append("_chunkNumber",Math.floor(a._start/a._chunkSize)),c.append("_totalSize",a._file.size)),d}return b}function h(b,d,e){if(void 0!==d)if(angular.isDate(d)&&(d=d.toISOString()),angular.isString(d))b.append(e,d);else if(f.isFile(d)){var g=c(d,b),i=e.split(",");i[1]&&(g.ngfName=i[1].replace(/^\s+|\s+$/g,""),e=i[0]),a._fileKey=a._fileKey||e,b.append(e,g,g.ngfName||g.name)}else if(angular.isObject(d)){if(d.$$ngfCircularDetection)throw"ngFileUpload: Circular reference in config.data. Make sure specified data for Upload.upload() has no circular reference: "+e;d.$$ngfCircularDetection=!0;try{for(var j in d)if(d.hasOwnProperty(j)&&"$$ngfCircularDetection"!==j){var k=null==a.objectKey?"[i]":a.objectKey;d.length&&parseInt(j)>-1&&(k=null==a.arrayKey?k:a.arrayKey),h(b,d[j],e+k.replace(/[ik]/g,j))}}finally{delete d.$$ngfCircularDetection}}else b.append(e,d)}function i(){a._chunkSize=f.translateScalars(a.resumeChunkSize),a._chunkSize=a._chunkSize?parseInt(a._chunkSize.toString()):null,a.headers=a.headers||{},a.headers["Content-Type"]=void 0,a.transformRequest=a.transformRequest?angular.isArray(a.transformRequest)?a.transformRequest:[a.transformRequest]:[],a.transformRequest.push(function(b){var c,d=new window.FormData;b=b||a.fields||{},a.file&&(b.file=a.file);for(c in b)if(b.hasOwnProperty(c)){var e=b[c];a.formDataAppender?a.formDataAppender(d,c,e):h(d,e,c)}return d})}return b||(a=e(a)),a._isDigested||(a._isDigested=!0,i()),d(a)},this.http=function(b){return b=e(b),b.transformRequest=b.transformRequest||function(b){return window.ArrayBuffer&&b instanceof window.ArrayBuffer||b instanceof window.Blob?b:a.defaults.transformRequest[0].apply(this,arguments)},b._chunkSize=f.translateScalars(b.resumeChunkSize),b._chunkSize=b._chunkSize?parseInt(b._chunkSize.toString()):null,d(b)},this.translateScalars=function(a){if(angular.isString(a)){if(a.search(/kb/i)===a.length-2)return parseFloat(1024*a.substring(0,a.length-2));if(a.search(/mb/i)===a.length-2)return parseFloat(1048576*a.substring(0,a.length-2));if(a.search(/gb/i)===a.length-2)return parseFloat(1073741824*a.substring(0,a.length-2));if(a.search(/b/i)===a.length-1)return parseFloat(a.substring(0,a.length-1));if(a.search(/s/i)===a.length-1)return parseFloat(a.substring(0,a.length-1));if(a.search(/m/i)===a.length-1)return parseFloat(60*a.substring(0,a.length-1));if(a.search(/h/i)===a.length-1)return parseFloat(3600*a.substring(0,a.length-1))}return a},this.urlToBlob=function(c){var d=b.defer();return a({url:c,method:"get",responseType:"arraybuffer"}).then(function(a){var b=new Uint8Array(a.data),e=a.headers("content-type")||"image/WebP",f=new window.Blob([b],{type:e}),g=c.match(/.*\/(.+?)(\?.*)?$/);g.length>1&&(f.name=g[1]),d.resolve(f)},function(a){d.reject(a)}),d.promise},this.setDefaults=function(a){this.defaults=a||{}},this.defaults={},this.version=ngFileUpload.version}]),ngFileUpload.service("Upload",["$parse","$timeout","$compile","$q","UploadExif",function(a,b,c,d,e){function f(a,b,c){var e=[i.emptyPromise()];return angular.forEach(a,function(d,f){0===d.type.indexOf("image/jpeg")&&i.attrGetter("ngfFixOrientation",b,c,{$file:d})&&e.push(i.happyPromise(i.applyExifRotation(d),d).then(function(b){a.splice(f,1,b)}))}),d.all(e)}function g(a,b,c,e){var f=i.attrGetter("ngfResize",b,c);if(!f||!i.isResizeSupported()||!a.length)return i.emptyPromise();if(f instanceof Function){var g=d.defer();return f(a).then(function(d){h(d,a,b,c,e).then(function(a){g.resolve(a)},function(a){g.reject(a)})},function(a){g.reject(a)})}return h(f,a,b,c,e)}function h(a,b,c,e,f){function g(d,g){if(0===d.type.indexOf("image")){if(a.pattern&&!i.validatePattern(d,a.pattern))return;a.resizeIf=function(a,b){return i.attrGetter("ngfResizeIf",c,e,{$width:a,$height:b,$file:d})};var j=i.resize(d,a);h.push(j),j.then(function(a){b.splice(g,1,a)},function(a){d.$error="resize",(d.$errorMessages=d.$errorMessages||{}).resize=!0,d.$errorParam=(a?(a.message?a.message:a)+": ":"")+(d&&d.name),f.$ngfValidations.push({name:"resize",valid:!1}),i.applyModelValidation(f,b)})}}for(var h=[i.emptyPromise()],j=0;j<b.length;j++)g(b[j],j);return d.all(h)}var i=e;return i.getAttrWithDefaults=function(a,b){if(null!=a[b])return a[b];var c=i.defaults[b];return null==c?c:angular.isString(c)?c:JSON.stringify(c)},i.attrGetter=function(b,c,d,e){var f=this.getAttrWithDefaults(c,b);if(!d)return f;try{return e?a(f)(d,e):a(f)(d)}catch(g){if(b.search(/min|max|pattern/i))return f;throw g}},i.shouldUpdateOn=function(a,b,c){var d=i.attrGetter("ngfModelOptions",b,c);return d&&d.updateOn?d.updateOn.split(" ").indexOf(a)>-1:!0},i.emptyPromise=function(){var a=d.defer(),c=arguments;return b(function(){a.resolve.apply(a,c)}),a.promise},i.rejectPromise=function(){var a=d.defer(),c=arguments;return b(function(){a.reject.apply(a,c)}),a.promise},i.happyPromise=function(a,c){var e=d.defer();return a.then(function(a){e.resolve(a)},function(a){b(function(){throw a}),e.resolve(c)}),e.promise},i.updateModel=function(c,d,e,h,j,k,l){function m(f,g,j,l,m){d.$$ngfPrevValidFiles=f,d.$$ngfPrevInvalidFiles=g;var n=f&&f.length?f[0]:null,o=g&&g.length?g[0]:null;c&&(i.applyModelValidation(c,f),c.$setViewValue(m?n:f)),h&&a(h)(e,{$files:f,$file:n,$newFiles:j,$duplicateFiles:l,$invalidFiles:g,$invalidFile:o,$event:k});var p=i.attrGetter("ngfModelInvalid",d);p&&b(function(){a(p).assign(e,m?o:g)}),b(function(){})}function n(){function a(a,b){return a.name===b.name&&(a.$ngfOrigSize||a.size)===(b.$ngfOrigSize||b.size)&&a.type===b.type}function b(b){var c;for(c=0;c<r.length;c++)if(a(b,r[c]))return!0;for(c=0;c<s.length;c++)if(a(b,s[c]))return!0;return!1}if(j){q=[],t=[];for(var c=0;c<j.length;c++)b(j[c])?t.push(j[c]):q.push(j[c])}}function o(a){return angular.isArray(a)?a:[a]}function p(){function a(){b(function(){m(w?r.concat(v):v,w?s.concat(u):u,j,t,x)},z&&z.debounce?z.debounce.change||z.debounce:0)}var f=y?q:v;g(f,d,e,c).then(function(){y?i.validate(q,w?r.length:0,c,d,e).then(function(b){v=b.validsFiles,u=b.invalidsFiles,a()}):a()},function(){for(var b=0;b<f.length;b++){var c=f[b];if("resize"===c.$error){var d=v.indexOf(c);d>-1&&(v.splice(d,1),u.push(c)),a()}}})}var q,r,s,t=[],u=[],v=[];r=d.$$ngfPrevValidFiles||[],s=d.$$ngfPrevInvalidFiles||[],c&&c.$modelValue&&(r=o(c.$modelValue));var w=i.attrGetter("ngfKeep",d,e);q=(j||[]).slice(0),("distinct"===w||i.attrGetter("ngfKeepDistinct",d,e)===!0)&&n(d,e);var x=!w&&!i.attrGetter("ngfMultiple",d,e)&&!i.attrGetter("multiple",d);if(!w||q.length){i.attrGetter("ngfBeforeModelChange",d,e,{$files:j,$file:j&&j.length?j[0]:null,$newFiles:q,$duplicateFiles:t,$event:k});var y=i.attrGetter("ngfValidateAfterResize",d,e),z=i.attrGetter("ngfModelOptions",d,e);i.validate(q,w?r.length:0,c,d,e).then(function(a){l?m(q,[],j,t,x):(z&&z.allowInvalid||y?v=q:(v=a.validFiles,u=a.invalidFiles),i.attrGetter("ngfFixOrientation",d,e)&&i.isExifSupported()?f(v,d,e).then(function(){p()}):p())})}},i}]),ngFileUpload.directive("ngfSelect",["$parse","$timeout","$compile","Upload",function(a,b,c,d){function e(a){var b=a.match(/Android[^\d]*(\d+)\.(\d+)/);if(b&&b.length>2){var c=d.defaults.androidFixMinorVersion||4;return parseInt(b[1])<4||parseInt(b[1])===c&&parseInt(b[2])<c}return-1===a.indexOf("Chrome")&&/.*Windows.*Safari.*/.test(a)}function f(a,b,c,d,f,h,i,j){function k(){return"input"===b[0].tagName.toLowerCase()&&c.type&&"file"===c.type.toLowerCase()}function l(){return t("ngfChange")||t("ngfSelect")}function m(b){if(j.shouldUpdateOn("change",c,a)){var e=b.__files_||b.target&&b.target.files,f=[];if(!e)return;for(var g=0;g<e.length;g++)f.push(e[g]);j.updateModel(d,c,a,l(),f.length?f:null,b)}}function n(a,d){function e(b){a.attr("id","ngf-"+b),d.attr("id","ngf-label-"+b)}for(var f=0;f<b[0].attributes.length;f++){var g=b[0].attributes[f];"type"!==g.name&&"class"!==g.name&&"style"!==g.name&&("id"===g.name?(e(g.value),u.push(c.$observe("id",e))):a.attr(g.name,g.value||"required"!==g.name&&"multiple"!==g.name?g.value:g.name))}}function o(){if(k())return b;var a=angular.element('<input type="file">'),c=angular.element("<label>upload</label>");return c.css("visibility","hidden").css("position","absolute").css("overflow","hidden").css("width","0px").css("height","0px").css("border","none").css("margin","0px").css("padding","0px").attr("tabindex","-1"),n(a,c),g.push({el:b,ref:c}),document.body.appendChild(c.append(a)[0]),a}function p(c){if(b.attr("disabled"))return!1;if(!t("ngfSelectDisabled",a)){var d=q(c);if(null!=d)return d;r(c);try{k()||document.body.contains(x[0])||(g.push({el:b,ref:x.parent()}),document.body.appendChild(x.parent()[0]),x.bind("change",m))}catch(f){}return e(navigator.userAgent)?setTimeout(function(){x[0].click()},0):x[0].click(),!1}}function q(a){var b=a.changedTouches||a.originalEvent&&a.originalEvent.changedTouches;if(b){if("touchstart"===a.type)return w=b[0].clientX,v=b[0].clientY,!0;if("touchend"===a.type){var c=b[0].clientX,d=b[0].clientY;if(Math.abs(c-w)>20||Math.abs(d-v)>20)return a.stopPropagation(),a.preventDefault(),!1}return!0}}function r(b){j.shouldUpdateOn("click",c,a)&&x.val()&&(x.val(null),j.updateModel(d,c,a,l(),null,b,!0))}function s(a){if(x&&!x.attr("__ngf_ie10_Fix_")){if(!x[0].parentNode)return void(x=null);a.preventDefault(),a.stopPropagation(),x.unbind("click");var b=x.clone();return x.replaceWith(b),x=b,x.attr("__ngf_ie10_Fix_","true"),x.bind("change",m),x.bind("click",s),x[0].click(),!1}x.removeAttr("__ngf_ie10_Fix_")}var t=function(a,b){return j.attrGetter(a,c,b)};j.registerModelChangeValidator(d,c,a);var u=[];t("ngfMultiple")&&u.push(a.$watch(t("ngfMultiple"),function(){x.attr("multiple",t("ngfMultiple",a))})),t("ngfCapture")&&u.push(a.$watch(t("ngfCapture"),function(){x.attr("capture",t("ngfCapture",a))})),t("ngfAccept")&&u.push(a.$watch(t("ngfAccept"),function(){x.attr("accept",t("ngfAccept",a))})),u.push(c.$observe("accept",function(){x.attr("accept",t("accept"))}));var v=0,w=0,x=b;k()||(x=o()),x.bind("change",m),k()?b.bind("click",r):b.bind("click touchstart touchend",p),-1!==navigator.appVersion.indexOf("MSIE 10")&&x.bind("click",s),d&&d.$formatters.push(function(a){return(null==a||0===a.length)&&x.val()&&x.val(null),a}),a.$on("$destroy",function(){k()||x.parent().remove(),angular.forEach(u,function(a){a()})}),h(function(){for(var a=0;a<g.length;a++){var b=g[a];document.body.contains(b.el[0])||(g.splice(a,1),b.ref.remove())}}),window.FileAPI&&window.FileAPI.ngfFixIE&&window.FileAPI.ngfFixIE(b,x,m)}var g=[];return{restrict:"AEC",require:"?ngModel",link:function(e,g,h,i){f(e,g,h,i,a,b,c,d)}}}]),function(){function a(a){return"img"===a.tagName.toLowerCase()?"image":"audio"===a.tagName.toLowerCase()?"audio":"video"===a.tagName.toLowerCase()?"video":/./}function b(b,c,d,e,f,g,h,i){function j(a){var g=b.attrGetter("ngfNoObjectUrl",f,d);b.dataUrl(a,g)["finally"](function(){c(function(){var b=(g?a.$ngfDataUrl:a.$ngfBlobUrl)||a.$ngfDataUrl;i?e.css("background-image","url('"+(b||"")+"')"):e.attr("src",b),b?e.removeClass("ng-hide"):e.addClass("ng-hide")})})}c(function(){var c=d.$watch(f[g],function(c){var k=h;if("ngfThumbnail"===g&&(k||(k={width:e[0].naturalWidth||e[0].clientWidth,height:e[0].naturalHeight||e[0].clientHeight}),0===k.width&&window.getComputedStyle)){var l=getComputedStyle(e[0]);l.width&&l.width.indexOf("px")>-1&&l.height&&l.height.indexOf("px")>-1&&(k={width:parseInt(l.width.slice(0,-2)),height:parseInt(l.height.slice(0,-2))})}return angular.isString(c)?(e.removeClass("ng-hide"),i?e.css("background-image","url('"+c+"')"):e.attr("src",c)):void(!c||!c.type||0!==c.type.search(a(e[0]))||i&&0!==c.type.indexOf("image")?e.addClass("ng-hide"):k&&b.isResizeSupported()?(k.resizeIf=function(a,e){return b.attrGetter("ngfResizeIf",f,d,{$width:a,$height:e,$file:c})},b.resize(c,k).then(function(a){j(a)},function(a){throw a})):j(c))});d.$on("$destroy",function(){c()})})}ngFileUpload.service("UploadDataUrl",["UploadBase","$timeout","$q",function(a,b,c){var d=a;return d.base64DataUrl=function(a){if(angular.isArray(a)){var b=c.defer(),e=0;return angular.forEach(a,function(c){d.dataUrl(c,!0)["finally"](function(){if(e++,e===a.length){var c=[];angular.forEach(a,function(a){c.push(a.$ngfDataUrl)}),b.resolve(c,a)}})}),b.promise}return d.dataUrl(a,!0)},d.dataUrl=function(a,e){if(!a)return d.emptyPromise(a,a);if(e&&null!=a.$ngfDataUrl||!e&&null!=a.$ngfBlobUrl)return d.emptyPromise(e?a.$ngfDataUrl:a.$ngfBlobUrl,a);var f=e?a.$$ngfDataUrlPromise:a.$$ngfBlobUrlPromise;if(f)return f;var g=c.defer();return b(function(){if(window.FileReader&&a&&(!window.FileAPI||-1===navigator.userAgent.indexOf("MSIE 8")||a.size<2e4)&&(!window.FileAPI||-1===navigator.userAgent.indexOf("MSIE 9")||a.size<4e6)){var c=window.URL||window.webkitURL;if(c&&c.createObjectURL&&!e){var f;try{f=c.createObjectURL(a)}catch(h){return void b(function(){a.$ngfBlobUrl="",g.reject()})}b(function(){if(a.$ngfBlobUrl=f,f){g.resolve(f,a),d.blobUrls=d.blobUrls||[],d.blobUrlsTotalSize=d.blobUrlsTotalSize||0,d.blobUrls.push({url:f,size:a.size}),d.blobUrlsTotalSize+=a.size||0;for(var b=d.defaults.blobUrlsMaxMemory||268435456,e=d.defaults.blobUrlsMaxQueueSize||200;(d.blobUrlsTotalSize>b||d.blobUrls.length>e)&&d.blobUrls.length>1;){var h=d.blobUrls.splice(0,1)[0];c.revokeObjectURL(h.url),d.blobUrlsTotalSize-=h.size}}})}else{var i=new FileReader;i.onload=function(c){b(function(){a.$ngfDataUrl=c.target.result,g.resolve(c.target.result,a),b(function(){delete a.$ngfDataUrl},1e3)})},i.onerror=function(){b(function(){a.$ngfDataUrl="",g.reject()})},i.readAsDataURL(a)}}else b(function(){a[e?"$ngfDataUrl":"$ngfBlobUrl"]="",g.reject()})}),f=e?a.$$ngfDataUrlPromise=g.promise:a.$$ngfBlobUrlPromise=g.promise,f["finally"](function(){delete a[e?"$$ngfDataUrlPromise":"$$ngfBlobUrlPromise"]}),f},d}]),ngFileUpload.directive("ngfSrc",["Upload","$timeout",function(a,c){return{restrict:"AE",link:function(d,e,f){b(a,c,d,e,f,"ngfSrc",a.attrGetter("ngfResize",f,d),!1)}}}]),ngFileUpload.directive("ngfBackground",["Upload","$timeout",function(a,c){return{restrict:"AE",link:function(d,e,f){b(a,c,d,e,f,"ngfBackground",a.attrGetter("ngfResize",f,d),!0)}}}]),ngFileUpload.directive("ngfThumbnail",["Upload","$timeout",function(a,c){return{restrict:"AE",link:function(d,e,f){var g=a.attrGetter("ngfSize",f,d);b(a,c,d,e,f,"ngfThumbnail",g,a.attrGetter("ngfAsBackground",f,d))}}}]),ngFileUpload.config(["$compileProvider",function(a){a.imgSrcSanitizationWhitelist&&a.imgSrcSanitizationWhitelist(/^\s*(https?|ftp|mailto|tel|webcal|local|file|data|blob):/),a.aHrefSanitizationWhitelist&&a.aHrefSanitizationWhitelist(/^\s*(https?|ftp|mailto|tel|webcal|local|file|data|blob):/)}]),ngFileUpload.filter("ngfDataUrl",["UploadDataUrl","$sce",function(a,b){return function(c,d,e){if(angular.isString(c))return b.trustAsResourceUrl(c);var f=c&&((d?c.$ngfDataUrl:c.$ngfBlobUrl)||c.$ngfDataUrl);return c&&!f?(!c.$ngfDataUrlFilterInProgress&&angular.isObject(c)&&(c.$ngfDataUrlFilterInProgress=!0,a.dataUrl(c,d)),""):(c&&delete c.$ngfDataUrlFilterInProgress,(c&&f?e?b.trustAsResourceUrl(f):f:c)||"")}}])}(),ngFileUpload.service("UploadValidate",["UploadDataUrl","$q","$timeout",function(a,b,c){function d(a){var b="",c=[];if(a.length>2&&"/"===a[0]&&"/"===a[a.length-1])b=a.substring(1,a.length-1);else{var e=a.split(",");if(e.length>1)for(var f=0;f<e.length;f++){var g=d(e[f]);g.regexp?(b+="("+g.regexp+")",f<e.length-1&&(b+="|")):c=c.concat(g.excludes)}else 0===a.indexOf("!")?c.push("^((?!"+d(a.substring(1)).regexp+").)*$"):(0===a.indexOf(".")&&(a="*"+a),b="^"+a.replace(new RegExp("[.\\\\+*?\\[\\^\\]$(){}=!<>|:\\-]","g"),"\\$&")+"$",b=b.replace(/\\\*/g,".*").replace(/\\\?/g,"."))}return{regexp:b,excludes:c}}function e(a,b){null==b||a.$dirty||(a.$setDirty?a.$setDirty():a.$dirty=!0)}var f=a;return f.validatePattern=function(a,b){if(!b)return!0;var c=d(b),e=!0;if(c.regexp&&c.regexp.length){var f=new RegExp(c.regexp,"i");e=null!=a.type&&f.test(a.type)||null!=a.name&&f.test(a.name)}for(var g=c.excludes.length;g--;){var h=new RegExp(c.excludes[g],"i");e=e&&(null==a.type||h.test(a.type))&&(null==a.name||h.test(a.name))}return e},f.ratioToFloat=function(a){var b=a.toString(),c=b.search(/[x:]/i);return b=c>-1?parseFloat(b.substring(0,c))/parseFloat(b.substring(c+1)):parseFloat(b)},f.registerModelChangeValidator=function(a,b,c){a&&a.$formatters.push(function(d){if(a.$dirty){var e=d;d&&!angular.isArray(d)&&(e=[d]),f.validate(e,0,a,b,c).then(function(){f.applyModelValidation(a,e)})}return d})},f.applyModelValidation=function(a,b){e(a,b),angular.forEach(a.$ngfValidations,function(b){a.$setValidity(b.name,b.valid)})},f.getValidationAttr=function(a,b,c,d,e){var g="ngf"+c[0].toUpperCase()+c.substr(1),h=f.attrGetter(g,a,b,{$file:e});if(null==h&&(h=f.attrGetter("ngfValidate",a,b,{$file:e}))){var i=(d||c).split(".");h=h[i[0]],i.length>1&&(h=h&&h[i[1]])}return h},f.validate=function(a,c,d,e,g){function h(b,c,h){if(a){for(var i=a.length,j=null;i--;){var n=a[i];if(n){var o=f.getValidationAttr(e,g,b,c,n);null!=o&&(h(n,o,i)||(-1===k.indexOf(b)?(n.$error=b,(n.$errorMessages=n.$errorMessages||{})[b]=!0,n.$errorParam=o,-1===m.indexOf(n)&&m.push(n),l||a.splice(i,1),j=!1):a.splice(i,1)))}}null!==j&&d.$ngfValidations.push({name:b,valid:j})}}function i(c,h,i,n,o){function p(b,d,e){function f(f){if(f())if(-1===k.indexOf(c)){if(d.$error=c,(d.$errorMessages=d.$errorMessages||{})[c]=!0,d.$errorParam=e,-1===m.indexOf(d)&&m.push(d),!l){var g=a.indexOf(d);g>-1&&a.splice(g,1)}b.resolve(!1)}else{var h=a.indexOf(d);h>-1&&a.splice(h,1),b.resolve(!0)}else b.resolve(!0)}null!=e?n(d,e).then(function(a){f(function(){return!o(a,e)})},function(){f(function(){return j("ngfValidateForce",{$file:d})})}):b.resolve(!0)}var q=[f.emptyPromise(!0)];a&&(a=void 0===a.length?[a]:a,angular.forEach(a,function(a){var d=b.defer();return q.push(d.promise),!i||null!=a.type&&0===a.type.search(i)?void("dimensions"===c&&null!=f.attrGetter("ngfDimensions",e)?f.imageDimensions(a).then(function(b){p(d,a,j("ngfDimensions",{$file:a,$width:b.width,$height:b.height}))},function(){d.resolve(!1)}):"duration"===c&&null!=f.attrGetter("ngfDuration",e)?f.mediaDuration(a).then(function(b){p(d,a,j("ngfDuration",{$file:a,$duration:b}))},function(){d.resolve(!1)}):p(d,a,f.getValidationAttr(e,g,c,h,a))):void d.resolve(!0)}));var r=b.defer();return b.all(q).then(function(a){for(var b=!0,e=0;e<a.length;e++)if(!a[e]){b=!1;break}d.$ngfValidations.push({name:c,valid:b}),r.resolve(b)}),r.promise}d=d||{},d.$ngfValidations=d.$ngfValidations||[],angular.forEach(d.$ngfValidations,function(a){a.valid=!0});var j=function(a,b){return f.attrGetter(a,e,g,b)},k=(f.attrGetter("ngfIgnoreInvalid",e,g)||"").split(" "),l=f.attrGetter("ngfRunAllValidations",e,g);if(null==a||0===a.length)return f.emptyPromise({validFiles:a,invalidFiles:[]});a=void 0===a.length?[a]:a.slice(0);var m=[];h("pattern",null,f.validatePattern),h("minSize","size.min",function(a,b){return a.size+.1>=f.translateScalars(b)}),h("maxSize","size.max",function(a,b){return a.size-.1<=f.translateScalars(b)});var n=0;if(h("maxTotalSize",null,function(b,c){return n+=b.size,n>f.translateScalars(c)?(a.splice(0,a.length),!1):!0}),h("validateFn",null,function(a,b){return b===!0||null===b||""===b}),!a.length)return f.emptyPromise({validFiles:[],invalidFiles:m});var o=b.defer(),p=[];return p.push(i("maxHeight","height.max",/image/,this.imageDimensions,function(a,b){return a.height<=b})),p.push(i("minHeight","height.min",/image/,this.imageDimensions,function(a,b){return a.height>=b})),p.push(i("maxWidth","width.max",/image/,this.imageDimensions,function(a,b){return a.width<=b})),p.push(i("minWidth","width.min",/image/,this.imageDimensions,function(a,b){return a.width>=b})),p.push(i("dimensions",null,/image/,function(a,b){return f.emptyPromise(b)},function(a){return a})),p.push(i("ratio",null,/image/,this.imageDimensions,function(a,b){for(var c=b.toString().split(","),d=!1,e=0;e<c.length;e++)Math.abs(a.width/a.height-f.ratioToFloat(c[e]))<.01&&(d=!0);return d})),p.push(i("maxRatio","ratio.max",/image/,this.imageDimensions,function(a,b){return a.width/a.height-f.ratioToFloat(b)<1e-4})),p.push(i("minRatio","ratio.min",/image/,this.imageDimensions,function(a,b){return a.width/a.height-f.ratioToFloat(b)>-1e-4})),p.push(i("maxDuration","duration.max",/audio|video/,this.mediaDuration,function(a,b){return a<=f.translateScalars(b)})),p.push(i("minDuration","duration.min",/audio|video/,this.mediaDuration,function(a,b){return a>=f.translateScalars(b)})),p.push(i("duration",null,/audio|video/,function(a,b){return f.emptyPromise(b)},function(a){return a})),p.push(i("validateAsyncFn",null,null,function(a,b){return b},function(a){return a===!0||null===a||""===a})),b.all(p).then(function(){if(l)for(var b=0;b<a.length;b++){var d=a[b];d.$error&&a.splice(b--,1)}l=!1,h("maxFiles",null,function(a,b,d){return b>c+d}),o.resolve({validFiles:a,invalidFiles:m})}),o.promise},f.imageDimensions=function(a){if(a.$ngfWidth&&a.$ngfHeight){var d=b.defer();return c(function(){d.resolve({width:a.$ngfWidth,height:a.$ngfHeight})}),d.promise}if(a.$ngfDimensionPromise)return a.$ngfDimensionPromise;var e=b.defer();return c(function(){return 0!==a.type.indexOf("image")?void e.reject("not image"):void f.dataUrl(a).then(function(b){function d(){var b=h[0].naturalWidth||h[0].clientWidth,c=h[0].naturalHeight||h[0].clientHeight;h.remove(),a.$ngfWidth=b,a.$ngfHeight=c,e.resolve({width:b,height:c})}function f(){h.remove(),e.reject("load error")}function g(){c(function(){h[0].parentNode&&(h[0].clientWidth?d():i++>10?f():g())},1e3)}var h=angular.element("<img>").attr("src",b).css("visibility","hidden").css("position","fixed").css("max-width","none !important").css("max-height","none !important");h.on("load",d),h.on("error",f);var i=0;g(),angular.element(document.getElementsByTagName("body")[0]).append(h)},function(){e.reject("load error")})}),a.$ngfDimensionPromise=e.promise,a.$ngfDimensionPromise["finally"](function(){delete a.$ngfDimensionPromise}),a.$ngfDimensionPromise},f.mediaDuration=function(a){if(a.$ngfDuration){var d=b.defer();return c(function(){d.resolve(a.$ngfDuration)}),d.promise}if(a.$ngfDurationPromise)return a.$ngfDurationPromise;var e=b.defer();return c(function(){return 0!==a.type.indexOf("audio")&&0!==a.type.indexOf("video")?void e.reject("not media"):void f.dataUrl(a).then(function(b){function d(){var b=h[0].duration;a.$ngfDuration=b,h.remove(),e.resolve(b)}function f(){h.remove(),e.reject("load error")}function g(){c(function(){h[0].parentNode&&(h[0].duration?d():i>10?f():g())},1e3)}var h=angular.element(0===a.type.indexOf("audio")?"<audio>":"<video>").attr("src",b).css("visibility","none").css("position","fixed");h.on("loadedmetadata",d),h.on("error",f);var i=0;g(),angular.element(document.body).append(h)},function(){e.reject("load error")})}),a.$ngfDurationPromise=e.promise,a.$ngfDurationPromise["finally"](function(){delete a.$ngfDurationPromise}),a.$ngfDurationPromise},f}]),ngFileUpload.service("UploadResize",["UploadValidate","$q",function(a,b){var c=a,d=function(a,b,c,d,e){var f=e?Math.max(c/a,d/b):Math.min(c/a,d/b);return{width:a*f,height:b*f,marginX:a*f-c,marginY:b*f-d}},e=function(a,e,f,g,h,i,j,k){var l=b.defer(),m=document.createElement("canvas"),n=document.createElement("img");return n.setAttribute("style","visibility:hidden;position:fixed;z-index:-100000"),document.body.appendChild(n),n.onload=function(){var a=n.width,b=n.height;if(n.parentNode.removeChild(n),null!=k&&k(a,b)===!1)return void l.reject("resizeIf");try{if(i){var o=c.ratioToFloat(i),p=a/b;o>p?(e=a,f=e/o):(f=b,e=f*o)}e||(e=a),f||(f=b);var q=d(a,b,e,f,j);m.width=Math.min(q.width,e),m.height=Math.min(q.height,f);var r=m.getContext("2d");r.drawImage(n,Math.min(0,-q.marginX/2),Math.min(0,-q.marginY/2),q.width,q.height),l.resolve(m.toDataURL(h||"image/WebP",g||.934))}catch(s){l.reject(s)}},n.onerror=function(){n.parentNode.removeChild(n),l.reject()},n.src=a,l.promise};return c.dataUrltoBlob=function(a,b,c){for(var d=a.split(","),e=d[0].match(/:(.*?);/)[1],f=atob(d[1]),g=f.length,h=new Uint8Array(g);g--;)h[g]=f.charCodeAt(g);var i=new window.Blob([h],{type:e});return i.name=b,i.$ngfOrigSize=c,i},c.isResizeSupported=function(){var a=document.createElement("canvas");return window.atob&&a.getContext&&a.getContext("2d")&&window.Blob},c.isResizeSupported()&&Object.defineProperty(window.Blob.prototype,"name",{get:function(){return this.$ngfName},set:function(a){this.$ngfName=a},configurable:!0}),c.resize=function(a,d){if(0!==a.type.indexOf("image"))return c.emptyPromise(a);var f=b.defer();return c.dataUrl(a,!0).then(function(b){e(b,d.width,d.height,d.quality,d.type||a.type,d.ratio,d.centerCrop,d.resizeIf).then(function(e){if("image/jpeg"===a.type&&d.restoreExif!==!1)try{e=c.restoreExif(b,e)}catch(g){setTimeout(function(){throw g},1)}try{var h=c.dataUrltoBlob(e,a.name,a.size);f.resolve(h)}catch(g){f.reject(g)}},function(b){"resizeIf"===b&&f.resolve(a),f.reject(b)})},function(a){f.reject(a)}),f.promise},c}]),function(){function a(a,c,d,e,f,g,h,i,j,k){function l(){return c.attr("disabled")||s("ngfDropDisabled",a)}function m(b,c,d){if(b){var e;try{e=b&&b.getData&&b.getData("text/html")}catch(f){}q(b.items,b.files,s("ngfAllowDir",a)!==!1,s("multiple")||s("ngfMultiple",a)).then(function(a){a.length?n(a,c):o(d,e).then(function(a){n(a,c)})})}}function n(b,c){i.updateModel(e,d,a,s("ngfChange")||s("ngfDrop"),b,c)}function o(b,c){if(!i.shouldUpdateOn(b,d,a)||"string"!=typeof c)return i.rejectPromise([]);var e=[];c.replace(/<(img src|img [^>]* src) *=\"([^\"]*)\"/gi,function(a,b,c){e.push(c)});var f=[],g=[];if(e.length){angular.forEach(e,function(a){f.push(i.urlToBlob(a).then(function(a){g.push(a)}))});var h=k.defer();return k.all(f).then(function(){h.resolve(g)},function(a){h.reject(a)}),h.promise}return i.emptyPromise()}function p(a,b,c,d){var e=s("ngfDragOverClass",a,{$event:c}),f="dragover";if(angular.isString(e))f=e;else if(e&&(e.delay&&(w=e.delay),e.accept||e.reject)){var g=c.dataTransfer.items;if(null!=g&&g.length)for(var h=e.pattern||s("ngfPattern",a,{$event:c}),j=g.length;j--;){if(!i.validatePattern(g[j],h)){f=e.reject;break}f=e.accept}else f=e.accept}d(f)}function q(b,c,e,f){function g(a,b){var c=k.defer();if(null!=a)if(a.isDirectory){var d=[i.emptyPromise()];if(m){var e={type:"directory"};e.name=e.path=(b||"")+a.name,n.push(e)}var f=a.createReader(),h=[],p=function(){f.readEntries(function(e){try{e.length?(h=h.concat(Array.prototype.slice.call(e||[],0)),p()):(angular.forEach(h.slice(0),function(c){n.length<=j&&l>=o&&d.push(g(c,(b?b:"")+a.name+"/"))}),k.all(d).then(function(){c.resolve()},function(a){c.reject(a)}))}catch(f){c.reject(f)}},function(a){c.reject(a)})};p()}else a.file(function(a){try{a.path=(b?b:"")+a.name,m&&(a=i.rename(a,a.path)),n.push(a),o+=a.size,c.resolve()}catch(d){c.reject(d)}},function(a){c.reject(a)});return c.promise}var j=i.getValidationAttr(d,a,"maxFiles");null==j&&(j=Number.MAX_VALUE);var l=i.getValidationAttr(d,a,"maxTotalSize");null==l&&(l=Number.MAX_VALUE);var m=s("ngfIncludeDir",a),n=[],o=0,p=[i.emptyPromise()];if(b&&b.length>0&&"file:"!==h.location.protocol)for(var q=0;q<b.length;q++){if(b[q].webkitGetAsEntry&&b[q].webkitGetAsEntry()&&b[q].webkitGetAsEntry().isDirectory){var r=b[q].webkitGetAsEntry();if(r.isDirectory&&!e)continue;null!=r&&p.push(g(r))}else{var t=b[q].getAsFile();null!=t&&(n.push(t),o+=t.size)}if(n.length>j||o>l||!f&&n.length>0)break}else if(null!=c)for(var u=0;u<c.length;u++){var v=c.item(u);if((v.type||v.size>0)&&(n.push(v),o+=v.size),n.length>j||o>l||!f&&n.length>0)break}var w=k.defer();return k.all(p).then(function(){if(f||m||!n.length)w.resolve(n);else{for(var a=0;n[a]&&"directory"===n[a].type;)a++;w.resolve([n[a]])}},function(a){w.reject(a)}),w.promise}var r=b(),s=function(a,b,c){return i.attrGetter(a,d,b,c)};if(s("dropAvailable")&&g(function(){a[s("dropAvailable")]?a[s("dropAvailable")].value=r:a[s("dropAvailable")]=r}),!r)return void(s("ngfHideOnDropNotAvailable",a)===!0&&c.css("display","none"));null==s("ngfSelect")&&i.registerModelChangeValidator(e,d,a);var t,u=null,v=f(s("ngfStopPropagation")),w=1;c[0].addEventListener("dragover",function(b){if(!l()&&i.shouldUpdateOn("drop",d,a)){if(b.preventDefault(),v(a)&&b.stopPropagation(),navigator.userAgent.indexOf("Chrome")>-1){var e=b.dataTransfer.effectAllowed;b.dataTransfer.dropEffect="move"===e||"linkMove"===e?"move":"copy"}g.cancel(u),t||(t="C",p(a,d,b,function(d){t=d,c.addClass(t),s("ngfDrag",a,{$isDragging:!0,$class:t,$event:b})}))}},!1),c[0].addEventListener("dragenter",function(b){!l()&&i.shouldUpdateOn("drop",d,a)&&(b.preventDefault(),v(a)&&b.stopPropagation())},!1),c[0].addEventListener("dragleave",function(b){!l()&&i.shouldUpdateOn("drop",d,a)&&(b.preventDefault(),
+v(a)&&b.stopPropagation(),u=g(function(){t&&c.removeClass(t),t=null,s("ngfDrag",a,{$isDragging:!1,$event:b})},w||100))},!1),c[0].addEventListener("drop",function(b){!l()&&i.shouldUpdateOn("drop",d,a)&&(b.preventDefault(),v(a)&&b.stopPropagation(),t&&c.removeClass(t),t=null,m(b.dataTransfer,b,"dropUrl"))},!1),c[0].addEventListener("paste",function(b){navigator.userAgent.toLowerCase().indexOf("firefox")>-1&&s("ngfEnableFirefoxPaste",a)&&b.preventDefault(),!l()&&i.shouldUpdateOn("paste",d,a)&&m(b.clipboardData||b.originalEvent.clipboardData,b,"pasteUrl")},!1),navigator.userAgent.toLowerCase().indexOf("firefox")>-1&&s("ngfEnableFirefoxPaste",a)&&(c.attr("contenteditable",!0),c.on("keypress",function(a){a.metaKey||a.ctrlKey||a.preventDefault()}))}function b(){var a=document.createElement("div");return"draggable"in a&&"ondrop"in a&&!/Edge\/12./i.test(navigator.userAgent)}ngFileUpload.directive("ngfDrop",["$parse","$timeout","$window","Upload","$http","$q",function(b,c,d,e,f,g){return{restrict:"AEC",require:"?ngModel",link:function(h,i,j,k){a(h,i,j,k,b,c,d,e,f,g)}}}]),ngFileUpload.directive("ngfNoFileDrop",function(){return function(a,c){b()&&c.css("display","none")}}),ngFileUpload.directive("ngfDropAvailable",["$parse","$timeout","Upload",function(a,c,d){return function(e,f,g){if(b()){var h=a(d.attrGetter("ngfDropAvailable",g));c(function(){h(e),h.assign&&h.assign(e,!0)})}}}])}(),ngFileUpload.service("UploadExif",["UploadResize","$q",function(a,b){function c(a,b,c,d){switch(b){case 2:return a.transform(-1,0,0,1,c,0);case 3:return a.transform(-1,0,0,-1,c,d);case 4:return a.transform(1,0,0,-1,0,d);case 5:return a.transform(0,1,1,0,0,0);case 6:return a.transform(0,1,-1,0,d,0);case 7:return a.transform(0,-1,-1,0,d,c);case 8:return a.transform(0,-1,1,0,0,c)}}function d(a){for(var b="",c=new Uint8Array(a),d=c.byteLength,e=0;d>e;e++)b+=String.fromCharCode(c[e]);return window.btoa(b)}var e=a;return e.isExifSupported=function(){return window.FileReader&&(new FileReader).readAsArrayBuffer&&e.isResizeSupported()},e.readOrientation=function(a){var c=b.defer(),d=new FileReader,e=a.slice?a.slice(0,65536):a;return d.readAsArrayBuffer(e),d.onerror=function(a){return c.reject(a)},d.onload=function(a){var b={orientation:1},d=new DataView(this.result);if(65496!==d.getUint16(0,!1))return c.resolve(b);for(var e=d.byteLength,f=2;e>f;){var g=d.getUint16(f,!1);if(f+=2,65505===g){if(1165519206!==d.getUint32(f+=2,!1))return c.resolve(b);var h=18761===d.getUint16(f+=6,!1);f+=d.getUint32(f+4,h);var i=d.getUint16(f,h);f+=2;for(var j=0;i>j;j++)if(274===d.getUint16(f+12*j,h)){var k=d.getUint16(f+12*j+8,h);return k>=2&&8>=k&&(d.setUint16(f+12*j+8,1,h),b.fixedArrayBuffer=a.target.result),b.orientation=k,c.resolve(b)}}else{if(65280!==(65280&g))break;f+=d.getUint16(f,!1)}}return c.resolve(b)},c.promise},e.applyExifRotation=function(a){if(0!==a.type.indexOf("image/jpeg"))return e.emptyPromise(a);var f=b.defer();return e.readOrientation(a).then(function(b){return b.orientation<2||b.orientation>8?f.resolve(a):void e.dataUrl(a,!0).then(function(g){var h=document.createElement("canvas"),i=document.createElement("img");i.onload=function(){try{h.width=b.orientation>4?i.height:i.width,h.height=b.orientation>4?i.width:i.height;var g=h.getContext("2d");c(g,b.orientation,i.width,i.height),g.drawImage(i,0,0);var j=h.toDataURL(a.type||"image/WebP",.934);j=e.restoreExif(d(b.fixedArrayBuffer),j);var k=e.dataUrltoBlob(j,a.name);f.resolve(k)}catch(l){return f.reject(l)}},i.onerror=function(){f.reject()},i.src=g},function(a){f.reject(a)})},function(a){f.reject(a)}),f.promise},e.restoreExif=function(a,b){var c={};return c.KEY_STR="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",c.encode64=function(a){var b,c,d,e,f,g="",h="",i="",j=0;do b=a[j++],c=a[j++],h=a[j++],d=b>>2,e=(3&b)<<4|c>>4,f=(15&c)<<2|h>>6,i=63&h,isNaN(c)?f=i=64:isNaN(h)&&(i=64),g=g+this.KEY_STR.charAt(d)+this.KEY_STR.charAt(e)+this.KEY_STR.charAt(f)+this.KEY_STR.charAt(i),b=c=h="",d=e=f=i="";while(j<a.length);return g},c.restore=function(a,b){a.match("data:image/jpeg;base64,")&&(a=a.replace("data:image/jpeg;base64,",""));var c=this.decode64(a),d=this.slice2Segments(c),e=this.exifManipulation(b,d);return"data:image/jpeg;base64,"+this.encode64(e)},c.exifManipulation=function(a,b){var c=this.getExifArray(b),d=this.insertExif(a,c);return new Uint8Array(d)},c.getExifArray=function(a){for(var b,c=0;c<a.length;c++)if(b=a[c],255===b[0]&225===b[1])return b;return[]},c.insertExif=function(a,b){var c=a.replace("data:image/jpeg;base64,",""),d=this.decode64(c),e=d.indexOf(255,3),f=d.slice(0,e),g=d.slice(e),h=f;return h=h.concat(b),h=h.concat(g)},c.slice2Segments=function(a){for(var b=0,c=[];;){if(255===a[b]&218===a[b+1])break;if(255===a[b]&216===a[b+1])b+=2;else{var d=256*a[b+2]+a[b+3],e=b+d+2,f=a.slice(b,e);c.push(f),b=e}if(b>a.length)break}return c},c.decode64=function(a){var b,c,d,e,f,g="",h="",i=0,j=[],k=/[^A-Za-z0-9\+\/\=]/g;k.exec(a)&&console.log("There were invalid base64 characters in the input text.\nValid base64 characters are A-Z, a-z, 0-9, NaNExpect errors in decoding."),a=a.replace(/[^A-Za-z0-9\+\/\=]/g,"");do d=this.KEY_STR.indexOf(a.charAt(i++)),e=this.KEY_STR.indexOf(a.charAt(i++)),f=this.KEY_STR.indexOf(a.charAt(i++)),h=this.KEY_STR.indexOf(a.charAt(i++)),b=d<<2|e>>4,c=(15&e)<<4|f>>2,g=(3&f)<<6|h,j.push(b),64!==f&&j.push(c),64!==h&&j.push(g),b=c=g="",d=e=f=h="";while(i<a.length);return j},c.restore(a,b)},e}]);
\ No newline at end of file
diff --git a/vid-app-common/src/main/webapp/app/vid/icons/collapse-change-managment.svg b/vid-app-common/src/main/webapp/app/vid/icons/collapse-change-managment.svg
new file mode 100644
index 0000000..7a774e1
--- /dev/null
+++ b/vid-app-common/src/main/webapp/app/vid/icons/collapse-change-managment.svg
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<svg width="11px" height="3px" viewBox="0 0 11 3" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
+    <!-- Generator: Sketch 46.2 (44496) - http://www.bohemiancoding.com/sketch -->
+    <title>Shape</title>
+    <desc>Created with Sketch.</desc>
+    <defs></defs>
+    <g id="vid-" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
+        <g id="Change-Managment" transform="translate(-262.000000, -238.000000)" fill="#000000">
+            <g id="fab-copy" transform="translate(234.000000, 230.000000)">
+                <g id="add-copy" transform="translate(24.000000, 0.000000)">
+                    <polygon id="Shape" points="10.2857143 8.71428571 8.71428571 8.71428571 4 8.71428571 4 10.2857143 8.71428571 10.2857143 10.2857143 10.2857143 15 10.2857143 15 8.71428571"></polygon>
+                </g>
+            </g>
+        </g>
+    </g>
+</svg>
\ No newline at end of file
diff --git a/vid-app-common/src/main/webapp/app/vid/icons/expand-change-managment.svg b/vid-app-common/src/main/webapp/app/vid/icons/expand-change-managment.svg
new file mode 100644
index 0000000..7847148
--- /dev/null
+++ b/vid-app-common/src/main/webapp/app/vid/icons/expand-change-managment.svg
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<svg width="11px" height="11px" viewBox="0 0 11 11" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
+    <!-- Generator: Sketch 46.2 (44496) - http://www.bohemiancoding.com/sketch -->
+    <title>add</title>
+    <desc>Created with Sketch.</desc>
+    <defs></defs>
+    <g id="vid-" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
+        <g id="Change-Managment" transform="translate(-238.000000, -234.000000)">
+            <g id="fab-copy" transform="translate(234.000000, 230.000000)">
+                <g id="add">
+                    <polygon id="bounds" points="19 0 0 0 0 19 19 19"></polygon>
+                    <polygon id="Shape" fill="#5A5A5A" points="10.2857143 8.71428571 10.2857143 4 8.71428571 4 8.71428571 8.71428571 4 8.71428571 4 10.2857143 8.71428571 10.2857143 8.71428571 15 10.2857143 15 10.2857143 10.2857143 15 10.2857143 15 8.71428571"></polygon>
+                    <polygon id="Shape" fill="#323943" points="10.2857143 8.71428571 10.2857143 4 8.71428571 4 8.71428571 8.71428571 4 8.71428571 4 10.2857143 8.71428571 10.2857143 8.71428571 15 10.2857143 15 10.2857143 10.2857143 15 10.2857143 15 8.71428571"></polygon>
+                </g>
+            </g>
+        </g>
+    </g>
+</svg>
\ No newline at end of file
diff --git a/vid-app-common/src/main/webapp/app/vid/icons/refresh-change-managment.svg b/vid-app-common/src/main/webapp/app/vid/icons/refresh-change-managment.svg
new file mode 100644
index 0000000..174a52e
--- /dev/null
+++ b/vid-app-common/src/main/webapp/app/vid/icons/refresh-change-managment.svg
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<svg width="36px" height="33px" viewBox="0 0 36 33" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
+    <!-- Generator: Sketch 46.2 (44496) - http://www.bohemiancoding.com/sketch -->
+    <title>Group 4</title>
+    <desc>Created with Sketch.</desc>
+    <defs></defs>
+    <g id="vid-" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
+        <g id="Change-Managment" transform="translate(-1544.000000, -167.000000)" fill="#000000">
+            <g id="Group-4" transform="translate(1539.000000, 161.000000)">
+                <path d="M46.8694358,24.175791 C45.9994856,16.2172262 38.8825787,10.2854851 30.7284339,10.8556784 C24.5237875,11.2895496 19.2775923,15.4204556 17.3664133,21.1365857 L15.9019754,17.1882236 L14.5076414,17.7168536 L16.9050052,24.0765655 L22.9818228,21.7507351 L22.4483333,20.3733764 L18.7132068,21.8122285 C20.3736452,16.5462395 25.1585967,12.7241599 30.8313525,12.3274822 C38.1718767,11.8141827 44.5815219,17.1455631 45.3812187,24.3059932 L46.8694358,24.175791 Z" id="Combined-Shape" transform="translate(30.688539, 17.561891) scale(-1, 1) rotate(-51.000000) translate(-30.688539, -17.561891) "></path>
+                <path d="M31.668351,33.8536511 C30.7984008,25.8950863 23.6814939,19.9633451 15.5273491,20.5335385 C9.32270268,20.9674096 4.07650747,25.0983156 2.16532847,30.8144457 L0.700890606,26.8660837 L-0.69344337,27.3947136 L1.70392039,33.7544255 L7.78073796,31.4285952 L7.24724852,30.0512364 L3.512122,31.4900885 C5.17256042,26.2240996 9.95751192,22.4020199 15.6302677,22.0053422 C22.9707919,21.4920428 29.3804371,26.8234231 30.1801339,33.9838532 L31.668351,33.8536511 Z" id="Combined-Shape-Copy-2" transform="translate(15.487454, 27.239751) scale(-1, 1) rotate(-232.000000) translate(-15.487454, -27.239751) "></path>
+            </g>
+        </g>
+    </g>
+</svg>
\ No newline at end of file
diff --git a/vid-app-common/src/main/webapp/app/vid/images/attach.svg b/vid-app-common/src/main/webapp/app/vid/images/attach.svg
new file mode 100644
index 0000000..ff28c9d
--- /dev/null
+++ b/vid-app-common/src/main/webapp/app/vid/images/attach.svg
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<svg width="14px" height="13px" viewBox="0 0 14 13" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
+    <!-- Generator: Sketch 47.1 (45422) - http://www.bohemiancoding.com/sketch -->
+    <title>Page 1 Copy 2</title>
+    <desc>Created with Sketch.</desc>
+    <defs>
+        <polygon id="path-1" points="0 0 14 0 14 13 0 13"></polygon>
+    </defs>
+    <g id="vid-" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
+        <g id="Change-Managment" transform="translate(-1696.000000, -181.000000)">
+            <g id="Page-1-Copy-2" transform="translate(1696.000000, 181.000000)">
+                <mask id="mask-2" fill="white">
+                    <use xlink:href="#path-1"></use>
+                </mask>
+                <g id="Clip-2"></g>
+                <path d="M1.07738181,11.892665 C2.51371549,13.3691117 4.84984058,13.3691117 6.28634966,11.892665 L13.231757,4.75311054 C14.256081,3.70036026 14.256081,1.98141503 13.231757,0.928484448 C12.2076085,-0.124265836 10.5351892,-0.124265836 9.51104067,0.928484448 L2.56563328,8.06785861 C1.95366989,8.69691251 1.95366989,9.73361642 2.56563328,10.3628506 C3.17759667,10.9917242 4.18613479,10.9917242 4.79809819,10.3628506 L10.9992921,3.9882935 C11.2078403,3.78005124 11.2127514,3.4376685 11.0103422,3.22347646 C10.807933,3.00910412 10.4746769,3.00405582 10.2661288,3.21211779 C10.2624454,3.21590401 10.2589375,3.21969024 10.2552541,3.22347646 L4.05388475,9.59767299 C3.84130245,9.81619214 3.52242901,9.81619214 3.30984671,9.59767299 C3.09726442,9.37933413 3.09726442,9.0513751 3.30984671,8.83285595 L10.2550787,1.69348179 C10.8800215,1.05126625 11.8627762,1.05126625 12.487719,1.69348179 C13.1124865,2.33569732 13.1124865,3.34607797 12.487719,3.9882935 L5.54231162,11.1276677 C4.50518364,12.1937599 2.85854783,12.1937599 1.82141985,11.1276677 C0.78446726,10.0615755 0.78446726,8.36913378 1.82141985,7.30304157 L8.0227892,0.928484448 C8.23098655,0.720061888 8.2355469,0.377679153 8.03261149,0.163667407 C7.82985148,-0.050524636 7.4967708,-0.0550320443 7.28857345,0.153390516 C7.28524089,0.156816146 7.28190833,0.160241776 7.27857577,0.163667407 L1.07738181,6.53804423 C-0.35912727,8.01467119 -0.35912727,10.416038 1.07738181,11.892665" id="Fill-1" fill="#000000" mask="url(#mask-2)"></path>
+            </g>
+        </g>
+    </g>
+</svg>
\ No newline at end of file
diff --git a/vid-app-common/src/main/webapp/app/vid/images/elipsis_menu_icon.svg b/vid-app-common/src/main/webapp/app/vid/images/elipsis_menu_icon.svg
new file mode 100644
index 0000000..984311d
--- /dev/null
+++ b/vid-app-common/src/main/webapp/app/vid/images/elipsis_menu_icon.svg
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Svg Vector Icons : http://www.onlinewebfonts.com/icon -->
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
+<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 1000 1000" enable-background="new 0 0 1000 1000" xml:space="preserve">
+<metadata> Svg Vector Icons : http://www.onlinewebfonts.com/icon </metadata>
+<g><g transform="translate(0.000000,511.000000) scale(0.100000,-0.100000)"><path d="M671,1004.4C51.1,734.4-96.2-88.1,388.7-573c687.4-693.5,1816.7-73.6,1638.8,896.1C1916.9,900,1223.4,1249.9,671,1004.4z"/><path d="M4599.1,1004.4C3979.2,734.4,3831.9-88.1,4316.8-573c687.4-693.5,1816.7-73.6,1638.8,896.1C5845,900,5151.5,1249.9,4599.1,1004.4z"/><path d="M8527.2,1004.4C7907.3,734.4,7760-88.1,8244.9-573c399-399,963.6-399,1362.5,0C10368.5,188.1,9515.4,1434,8527.2,1004.4z"/></g></g>
+</svg>
\ No newline at end of file
diff --git a/vid-app-common/src/main/webapp/app/vid/images/emptyData.svg b/vid-app-common/src/main/webapp/app/vid/images/emptyData.svg
new file mode 100644
index 0000000..9f639aa
--- /dev/null
+++ b/vid-app-common/src/main/webapp/app/vid/images/emptyData.svg
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<svg width="94px" height="88px" viewBox="0 0 94 88" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
+    <!-- Generator: Sketch 47.1 (45422) - http://www.bohemiancoding.com/sketch -->
+    <title>Page 1 Copy 15</title>
+    <desc>Created with Sketch.</desc>
+    <defs>
+        <polygon id="path-1" points="69 88 0 88 0 44.000352 0 0.000704 69 0.000704"></polygon>
+    </defs>
+    <g id="vid-" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
+        <g id="Test-Environments-NO-INFO" transform="translate(-1561.000000, -357.000000)">
+            <g id="Page-1-Copy-15" transform="translate(1561.000000, 357.000000)">
+                <g id="Group-3">
+                    <mask id="mask-2" fill="white">
+                        <use xlink:href="#path-1"></use>
+                    </mask>
+                    <g id="Clip-2"></g>
+                    <path d="M65.4615385,84.480704 L3.53846154,84.480704 L3.53846154,8.800704 L12.3846154,8.800704 L12.3846154,12.320704 C12.3846154,13.292224 13.1754615,14.080704 14.1538462,14.080704 L54.8461538,14.080704 C55.8245385,14.080704 56.6153846,13.292224 56.6153846,12.320704 L56.6153846,8.800704 L65.4615385,8.800704 L65.4615385,84.480704 Z M15.9230769,3.520704 L53.0769231,3.520704 L53.0769231,5.280704 L53.0769231,8.800704 L53.0769231,10.560704 L15.9230769,10.560704 L15.9230769,8.800704 L15.9230769,5.280704 L15.9230769,3.520704 Z M67.2307692,5.280704 L56.6153846,5.280704 L56.6153846,1.760704 C56.6153846,0.787424 55.8245385,0.000704 54.8461538,0.000704 L14.1538462,0.000704 C13.1754615,0.000704 12.3846154,0.787424 12.3846154,1.760704 L12.3846154,5.280704 L1.76923077,5.280704 C0.790846154,5.280704 0,6.067424 0,7.040704 L0,86.240704 C0,87.213984 0.790846154,88.000704 1.76923077,88.000704 L67.2307692,88.000704 C68.2091538,88.000704 69,87.213984 69,86.240704 L69,7.040704 C69,6.067424 68.2091538,5.280704 67.2307692,5.280704 L67.2307692,5.280704 Z" id="Fill-1" fill="#191919" mask="url(#mask-2)"></path>
+                </g>
+                <path d="M90.6,67.2135388 L85.5,77.7785266 L80.4,67.2135388 L80.4,14.8041564 C80.4,11.8917415 82.6882,9.52166257 85.5,9.52166257 C88.3118,9.52166257 90.6,11.8917415 90.6,14.8041564 L90.6,67.2135388 Z M85.5,6 C80.8131,6 77,9.94954458 77,14.8041564 L77,67.6308559 C77,67.9037847 77.0612,68.1731919 77.1785,68.4179474 L83.8,82.1330623 L83.8,85.2391687 C83.8,86.2129084 84.5599,87 85.5,87 C86.4401,87 87.2,86.2129084 87.2,85.2391687 L87.2,82.1330623 L93.8215,68.4179474 C93.9388,68.1731919 94,67.9037847 94,67.6308559 L94,14.8041564 C94,9.94954458 90.1869,6 85.5,6 L85.5,6 Z" id="Fill-4" fill="#191919"></path>
+                <path d="M14,25 C15.104,25 16,25.896 16,27 C16,28.104 15.104,29 14,29 C12.896,29 12,28.104 12,27 C12,25.896 12.896,25 14,25" id="Fill-6" fill="#191919"></path>
+                <path d="M52.2631579,24.1818182 L22.7368421,24.1818182 C21.7763684,24.1818182 21,25.0351818 21,26.0909091 C21,27.1466364 21.7763684,28 22.7368421,28 L52.2631579,28 C53.2236316,28 54,27.1466364 54,26.0909091 C54,25.0351818 53.2236316,24.1818182 52.2631579,24.1818182 L52.2631579,7" id="Fill-8" fill="#191919"></path>
+                <path d="M14,38 C15.104,38 16,38.896 16,40 C16,41.104 15.104,42 14,42 C12.896,42 12,41.104 12,40 C12,38.896 12.896,38 14,38" id="Fill-10" fill="#191919"></path>
+                <path d="M52.2631579,38 L22.7368421,38 C21.7763684,38 21,38.894 21,40 C21,41.106 21.7763684,42 22.7368421,42 L52.2631579,42 C53.2236316,42 54,41.106 54,40 C54,38.894 53.2236316,38 52.2631579,38" id="Fill-12" fill="#191919"></path>
+                <path d="M14,52 C15.104,52 16,52.896 16,54 C16,55.104 15.104,56 14,56 C12.896,56 12,55.104 12,54 C12,52.896 12.896,52 14,52" id="Fill-14" fill="#191919"></path>
+                <path d="M52.2631579,52 L22.7368421,52 C21.7763684,52 21,52.894 21,54 C21,55.106 21.7763684,56 22.7368421,56 L52.2631579,56 C53.2236316,56 54,55.106 54,54 C54,52.894 53.2236316,52 52.2631579,52" id="Fill-16" fill="#191919"></path>
+                <path d="M14,67 C15.104,67 16,67.894 16,69 C16,70.104 15.104,71 14,71 C12.896,71 12,70.104 12,69 C12,67.894 12.896,67 14,67" id="Fill-18" fill="#191919"></path>
+                <path d="M52.2631579,67 L22.7368421,67 C21.7763684,67 21,67.894 21,69 C21,70.106 21.7763684,71 22.7368421,71 L52.2631579,71 C53.2236316,71 54,70.106 54,69 C54,67.894 53.2236316,67 52.2631579,67" id="Fill-20" fill="#191919"></path>
+            </g>
+        </g>
+    </g>
+</svg>
\ No newline at end of file
diff --git a/vid-app-common/src/main/webapp/app/vid/images/icon_noconnection.svg b/vid-app-common/src/main/webapp/app/vid/images/icon_noconnection.svg
new file mode 100644
index 0000000..6966076
--- /dev/null
+++ b/vid-app-common/src/main/webapp/app/vid/images/icon_noconnection.svg
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<svg width="102px" height="83px" viewBox="0 0 102 83" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
+    <!-- Generator: Sketch 47.1 (45422) - http://www.bohemiancoding.com/sketch -->
+    <title>Group 6</title>
+    <desc>Created with Sketch.</desc>
+    <defs></defs>
+    <g id="vid-" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
+        <g id="Test-Environments-ERROR" transform="translate(-770.000000, -360.000000)" fill="#191919">
+            <g id="Page-1-Copy-15" transform="translate(770.000000, 360.000000)">
+                <g id="Group-6">
+                    <path d="M84.3719292,80.6944444 L93.618168,80.6944444 L93.618168,71.4722222 L84.3719292,71.4722222 L84.3719292,80.6944444 Z M82.0603695,69.1666667 L82.0603695,74.9305556 L18.3768996,74.9305556 C9.59297277,74.9305556 2.3115597,67.7833333 2.3115597,58.9069444 L2.3115597,58.6763889 C2.3115597,49.8 9.59297277,42.6527778 18.3768996,42.6527778 L34.6733955,42.6527778 L34.6733955,40.3472222 L18.3768996,40.3472222 C8.32161493,40.3472222 0,48.5319444 0,58.6763889 L0,58.9069444 C0,69.0513889 8.32161493,77.2361111 18.3768996,77.2361111 L82.0603695,77.2361111 L82.0603695,83 L95.9297277,83 L95.9297277,80.6944444 L95.9297277,78.3888889 L95.9297277,73.7777778 L95.9297277,71.4722222 L95.9297277,69.1666667 L82.0603695,69.1666667 Z" id="Fill-3"></path>
+                    <path d="M9.24623881,11.5277778 L18.4924776,11.5277778 L18.4924776,2.30555556 L9.24623881,2.30555556 L9.24623881,11.5277778 Z M83.5628833,5.76388889 L20.8040373,5.76388889 L20.8040373,4.61111111 L20.8040373,2.30555556 L20.8040373,0 L6.93467911,0 L6.93467911,5.76388889 L6.93467911,8.06944444 L6.93467911,13.8333333 L20.8040373,13.8333333 L20.8040373,11.5277778 L20.8040373,9.22222222 L20.8040373,8.06944444 L83.5628833,8.06944444 C92.4623881,8.06944444 99.6282232,15.2166667 99.6282232,24.0930556 L99.6282232,24.3236111 C99.6282232,33.2 92.4623881,40.3472222 83.5628833,40.3472222 L63.5678918,40.3472222 L63.5678918,42.6527778 L83.5628833,42.6527778 C93.733746,42.6527778 101.939783,34.4680556 101.939783,24.3236111 L101.939783,24.0930556 C101.939783,13.9486111 93.618168,5.76388889 83.5628833,5.76388889 L83.5628833,5.76388889 Z" id="Fill-5"></path>
+                </g>
+            </g>
+        </g>
+    </g>
+</svg>
\ No newline at end of file
diff --git a/vid-app-common/src/main/webapp/app/vid/images/refresh.svg b/vid-app-common/src/main/webapp/app/vid/images/refresh.svg
new file mode 100644
index 0000000..4868d06
--- /dev/null
+++ b/vid-app-common/src/main/webapp/app/vid/images/refresh.svg
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<svg width="36px" height="32px" viewBox="0 0 36 32" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
+    <!-- Generator: Sketch 46.2 (44496) - http://www.bohemiancoding.com/sketch -->
+    <title>Page 1</title>
+    <desc>Created with Sketch.</desc>
+    <defs></defs>
+    <g id="vid-" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
+        <g id="Artboard-Copy-2" transform="translate(-127.000000, -48.000000)" fill="#000000">
+            <g id="Page-1" transform="translate(127.000000, 47.000000)">
+                <g id="Group-3" transform="translate(9.000000, 0.338800)">
+                    <path d="M0.7181,3.0151 C7.4501,-1.3179 16.5391,0.4801 21.2271,7.1761 C24.7951,12.2711 24.8861,18.9481 21.6461,24.0301 L25.6361,22.6831 L26.1031,24.1001 L19.6521,26.2391 L17.6351,20.0531 L19.0421,19.6001 L20.2741,23.4091 C23.3211,18.8051 23.2811,12.6811 20.0191,8.0221 C15.7991,1.9951 7.6211,0.3691 1.5531,4.2531 L0.7181,3.0151 Z" id="Fill-1"></path>
+                </g>
+                <g id="Group-6" transform="translate(0.000000, 6.338800)">
+                    <path d="M25.0135,23.7841 C18.2065,27.9991 9.1505,26.0421 4.5795,19.2651 C1.1015,14.1091 1.1275,7.4321 4.4545,2.4071 L0.4415,3.6831 L-0.0005,2.2591 L6.4875,0.2331 L8.3955,6.4531 L6.9825,6.8811 L5.8165,3.0521 C2.6885,7.6021 2.6225,13.7261 5.8035,18.4401 C9.9175,24.5411 18.0655,26.3091 24.2005,22.5311 L25.0135,23.7841 Z" id="Fill-4"></path>
+                </g>
+            </g>
+        </g>
+    </g>
+</svg>
\ No newline at end of file
diff --git a/vid-app-common/src/main/webapp/app/vid/images/search.svg b/vid-app-common/src/main/webapp/app/vid/images/search.svg
new file mode 100644
index 0000000..9dcc590
--- /dev/null
+++ b/vid-app-common/src/main/webapp/app/vid/images/search.svg
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Generator: Adobe Illustrator 21.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0)  -->
+<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
+	 viewBox="0 0 17 17" style="enable-background:new 0 0 17 17;" xml:space="preserve">
+<title>Fill 1</title>
+<desc>Created with Sketch.</desc>
+<g id="vid-">
+	<g id="Artboard-Copy-2" transform="translate(-197.000000, -61.000000)">
+		<path id="Fill-1" d="M204,73.9c-1.6,0-3-0.6-4.2-1.7c-1.1-1.1-1.7-2.6-1.7-4.2s0.6-3,1.7-4.2c1.1-1.1,2.6-1.7,4.2-1.7
+			c1.6,0,3,0.6,4.2,1.7c1.1,1.1,1.7,2.6,1.7,4.2s-0.6,3-1.7,4.2C207,73.3,205.6,73.9,204,73.9 M213.8,77.1l-4.5-4.5
+			c1.1-1.3,1.7-2.9,1.7-4.5c0-1.9-0.7-3.6-2-4.9c-1.3-1.3-3.1-2-4.9-2c-1.9,0-3.6,0.7-4.9,2c-1.3,1.3-2,3.1-2,4.9
+			c0,1.9,0.7,3.6,2,4.9c1.3,1.3,3.1,2,4.9,2c1.7,0,3.3-0.6,4.5-1.7l4.5,4.5c0.1,0.1,0.3,0.2,0.4,0.2c0.1,0,0.3-0.1,0.4-0.2
+			C214.1,77.6,214.1,77.3,213.8,77.1"/>
+	</g>
+</g>
+</svg>
diff --git a/vid-app-common/src/main/webapp/app/vid/images/sort_down.svg b/vid-app-common/src/main/webapp/app/vid/images/sort_down.svg
new file mode 100644
index 0000000..3dfaba1
--- /dev/null
+++ b/vid-app-common/src/main/webapp/app/vid/images/sort_down.svg
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Generator: Adobe Illustrator 21.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0)  -->
+<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
+	 viewBox="0 0 9 13" style="enable-background:new 0 0 9 13;" xml:space="preserve">
+<title>15 copy</title>
+<desc>Created with Sketch.</desc>
+<g id="vid-">
+	<g id="Artboard-Copy-2" transform="translate(-90.000000, -61.000000)">
+		<path id="_x31_5-copy" d="M93.6,61.9v8.2l-2.1-2.1c-0.2-0.2-0.4-0.3-0.6-0.3s-0.5,0.1-0.6,0.3c-0.4,0.4-0.4,0.9,0,1.3l3.6,3.6
+			c0.4,0.4,0.9,0.4,1.3,0l3.6-3.6c0.4-0.4,0.4-0.9,0-1.3c-0.4-0.4-0.9-0.4-1.3,0l-2.1,2.1v-8.2c0-0.5-0.4-0.9-0.9-0.9
+			C94,61,93.6,61.4,93.6,61.9z"/>
+	</g>
+</g>
+</svg>
diff --git a/vid-app-common/src/main/webapp/app/vid/images/sort_up.svg b/vid-app-common/src/main/webapp/app/vid/images/sort_up.svg
new file mode 100644
index 0000000..5f597dd
--- /dev/null
+++ b/vid-app-common/src/main/webapp/app/vid/images/sort_up.svg
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Generator: Adobe Illustrator 21.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0)  -->
+<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
+	 viewBox="0 0 9 13" style="enable-background:new 0 0 9 13;" xml:space="preserve">
+<title>15</title>
+<desc>Created with Sketch.</desc>
+<g id="vid-">
+	<g id="Artboard-Copy-2" transform="translate(-53.000000, -61.000000)">
+		<path id="_x31_5" d="M58.4,72.3v-8.2l2.1,2.1c0.2,0.2,0.4,0.3,0.6,0.3c0.2,0,0.5-0.1,0.6-0.3c0.4-0.4,0.4-0.9,0-1.3l-3.6-3.6
+			c-0.4-0.4-0.9-0.4-1.3,0l-3.6,3.6c-0.4,0.4-0.4,0.9,0,1.3c0.4,0.4,0.9,0.4,1.3,0l2.1-2.1v8.2c0,0.5,0.4,0.9,0.9,0.9
+			C58,73.2,58.4,72.8,58.4,72.3z"/>
+	</g>
+</g>
+</svg>
diff --git a/vid-app-common/src/main/webapp/app/vid/images/sprite.png b/vid-app-common/src/main/webapp/app/vid/images/sprite.png
new file mode 100644
index 0000000..26079b7
--- /dev/null
+++ b/vid-app-common/src/main/webapp/app/vid/images/sprite.png
Binary files differ
diff --git a/vid-app-common/src/main/webapp/app/vid/images/v.svg b/vid-app-common/src/main/webapp/app/vid/images/v.svg
new file mode 100644
index 0000000..b6f77b9
--- /dev/null
+++ b/vid-app-common/src/main/webapp/app/vid/images/v.svg
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<svg width="17px" height="17px" viewBox="0 0 17 17" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
+    <!-- Generator: Sketch 46.2 (44496) - http://www.bohemiancoding.com/sketch -->
+    <title>Combined Shape</title>
+    <desc>Created with Sketch.</desc>
+    <defs></defs>
+    <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
+        <g id="**POPUPS-" transform="translate(-790.000000, -457.000000)" fill="#191919">
+            <g id="popup-medium-2" transform="translate(772.000000, 325.000000)">
+                <path d="M26.5,149 C21.8055796,149 18,145.19442 18,140.5 C18,135.80558 21.8055796,132 26.5,132 C31.1944204,132 35,135.80558 35,140.5 C35,145.19442 31.1944204,149 26.5,149 Z M23.8535534,140.549776 C23.6582912,140.354514 23.3417088,140.354514 23.1464466,140.549776 C22.9511845,140.745038 22.9511845,141.061621 23.1464466,141.256883 L25.7146903,143.825127 C25.9311409,144.041577 26.2895239,144.01447 26.4709545,143.767924 L30.8653572,137.796384 C31.0290275,137.573973 30.9814087,137.260993 30.7589977,137.097322 C30.5365867,136.933652 30.223606,136.981271 30.0599357,137.203682 L26.0103833,142.706606 L23.8535534,140.549776 Z" id="Combined-Shape"></path>
+            </g>
+        </g>
+    </g>
+</svg>
\ No newline at end of file
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/constants/componentConstants.js b/vid-app-common/src/main/webapp/app/vid/scripts/constants/componentConstants.js
index 534cee5..fa9ff1c 100755
--- a/vid-app-common/src/main/webapp/app/vid/scripts/constants/componentConstants.js
+++ b/vid-app-common/src/main/webapp/app/vid/scripts/constants/componentConstants.js
@@ -28,7 +28,9 @@
     CLOUD_REGION_ID : "cloudRegionID",
     COMPONENT_STATUS : "ComponentStatus",
     CREATE_COMPONENT : "createComponent",
-    DELETE_COMPONENT : "deleteComponent",
+    DELETE_RESUME_COMPONENT : "deleteResumeComponent",
+    DELETE:"Delete",
+    RESUME:"Resume",
     ENTITY : "entity",
     GET_COMPONENT_LIST : "getComponentList",
     GET_SUBS : "getSubs",
@@ -43,8 +45,17 @@
 	MODEL_VERSION_1 : "1",
 	MSO_CREATE_REQ : "createInstance",
 	MSO_DELETE_REQ : "deleteInstance",
+	MSO_CHANGE_CONFIG_STATUS_REQ: "changeConfigurationStatus",
+	MSO_CHANGE_PORT_STATUS_REQ: "changePortStatus",
+	MSO_CREATE_ENVIRONMENT: "createEnvironmentInstance",
+	MSO_DEACTIVATE_ENVIRONMENT: "deactivateEnvironmentInstance",
+	MSO_ACTIVATE_ENVIRONMENT: "activateEnvironmentInstance",
+	MSO_ACTIVATE_SERVICE_REQ: "activateServiceInstance",
+	MSO_DEACTIVATE_SERVICE_REQ: "deactivateServiceInstance",
     NAME : "name",
 	NETWORK : "network",
+	CONFIGURATION : "configuration",
+	PORT: "port",
 	NETWORKS : "networks",
 	PRODUCT_NAME_TRINITY : "Trinity",
 	QUERY_SERVICE_INSTANCE : "queryServiceInstance",
@@ -69,8 +80,8 @@
 	VNF_TYPE : "vnfType",
 	VOLUME_GROUP : "volumeGroup",
     IS_PERMITTED: "is-permitted",
-
-
+    RESUME_STATUS: "PendingActivation",
+    PNF : "pnf",
         // IDs
 	CIDR_MASK_1 : "255.255.255.000",
 	//COMPONENT_LIST_NAMED_QUERY_ID : "ed0a0f5b-cf79-4784-88b2-911cd726cd3d",
@@ -95,11 +106,12 @@
 	SUBSCRIBER_NAME_GED12 : "General Electric Division 12",
 	VNF_INSTANCE_ID : "VNF_INSTANCE_ID_12345",
 	VPN_ID_1 : "1a2b3c4d5e6f",
-	
+
 	// PATHS
-	GET_WORKFLOW: "change-management/workflow?vnfs=@vnfs",
+	GET_WORKFLOW: "change-management/get_vnf_workflow_relation",
 	GET_MSO_WORKFLOWS: "change-management/mso",
 	GET_SCHEDULER_CHANGE_MANAGEMENTS: "change-management/scheduler",
+	CANCEL_SCHEDULE_REQUEST: "change-management/scheduler/schedules",
 	ASSIGN : "?r=",
 	AAI_GET_SERVICE_INSTANCE_PATH : "aai_get_service_instance/",
 	AAI_GET_SERVICES : "aai_get_services",
@@ -108,19 +120,31 @@
     AAI_GET_SERVICES_BY_TYPE : "aai_get_models_by_service_type",
 	AAI_GET_TENANTS : "aai_get_tenants/",
 	AAI_SUB_DETAILS_PATH : "aai_sub_details/",
-	AAI_GET_VERSION_BY_INVARIANT_ID:"aai_get_version_by_invariant_id/",
-	AAI_GET_VNF_DATA_PATH: "aai_get_vnf_data/",
-	AAI_GET_VNF_BY_CUSTOMERID_AND_SERVICETYPE: "get_vnf_data_by_globalid_and_service_type/",
-	AAI_SUB_VIEWEDIT_PATH : "aai_sub_viewedit",
+    AAI_GET_VERSION_BY_INVARIANT_ID:"aai_get_version_by_invariant_id/",
+    SEARCH_SERVICE_INSTANCES:"search_service_instances",
+    AAI_GET_VNF_DATA_PATH: "aai_get_vnf_data/",
+    AAI_GET_VNF_BY_CUSTOMERID_AND_SERVICETYPE: "get_vnf_data_by_globalid_and_service_type/",
+    AAI_GET_SERVICES_BY_OWNING_ENTITY_ID: 'aai_get_services_by_owning_entity_id',
+    AAI_SUB_VIEWEDIT_PATH : "aai_sub_viewedit",
 	AAI_GET_VNF_INFO : "aai_get_vnf_information",
+	AAI_GET_PNF_INSTANCE: "aai_get_service_instance_pnfs",
+	AAI_GET_VNF_INSTANCES_LIST: "aai_get_vnf_instances",
+	AAI_GET_PNF_INSTANCES_LIST: "aai_get_pnf_instances",
+	AAI_GET_BY_URI: "aai_get_by_uri/",
+	AAI_GET_CONFIGURATION: "aai_get_configuration/",
+    AAI_GET_TEST_ENVIRONMENTS: "get_operational_environments?operationalEnvironmentType=",
+    GET_CATEGORY_PARAMETERS : "category_parameter",
+	PARAMETER_STANDARDIZATION_FAMILY: "PARAMETER_STANDARDIZATION",
+    TENANT_ISOLATION_FAMILY: "TENANT_ISOLATION",
 	ASDC_GETMODEL_PATH : "asdc/getModel/",
-	CREATE_INSTANCE_PATH : "/models/services/createInstance", 
+	CREATE_INSTANCE_PATH : "/models/services/createInstance", AAI_GET_PNF_BY_NAME : "aai_get_pnfs/pnf/",
 	//1710 scheduler contants
 	POST_CREATE_NEW_VNF_CHANGE:"post_create_new_vnf_change",
 	GET_POLICY:"get_policy",
+	WORKFLOW: "workflow",
 	GET_TIME_SLOTS:"get_time_slots",
 	SUBMIT_VNF_CHANGE_TIMESLOTS:"submit_vnf_change_timeslots",
-	
+
 	FORWARD_SLASH : "/",
 	GET_SYSTEM_PROP_VNF_PROV_STATUS_PATH : "get_system_prop_vnf_prov_status",
 	GET_USER_ID : "getuserID",
@@ -128,15 +152,20 @@
 	INSTANTIATE_PATH : "/instantiate",
 	INVALID_STRING : "/INVALID_STRING/",
 	INVALID_STRING_MSO_CREATE_SVC_INSTANCE : "INVALID_STRING_mso_create_svc_instance",
+	MSO: "mso",
 	MSO_CREATE_NW_INSTANCE : "mso_create_nw_instance",
 	MSO_CREATE_NW_INSTANCE_PATH : "mso_create_nw_instance/",
 	MSO_CREATE_SVC_INSTANCE : "mso_create_svc_instance",
 	MSO_DELETE_SVC_INSTANCE_PATH : "mso_delete_svc_instance/",
-	MSO_ACTIVATE_INSTANCE: "mso/mso_activate_service_instance/@serviceInstanceId",
-	SELECTED_SERVICE_SUB_PATH : "#/instances/subdetails?selectedServiceSubscription=",
-	SELECTED_SUB_PATH : "#/instances/subdetails?selectedSubscriber=",
-	SELECTEDSERVICEINSTANCE_SUB_PATH : "&selectedServiceInstance=",
-	SELECTEDSUBSCRIBER_SUB_PATH : "&selectedSubscriber=",
+    MSO_ACTIVATE_INSTANCE: "mso/mso_activate_service_instance/@serviceInstanceId",
+    MSO_DEACTIVATE_INSTANCE: "mso/mso_deactivate_service_instance/@serviceInstanceId",
+    MSO_CREATE_REALATIONSHIP : "mso_add_relationship",
+	MSO_REMOVE_RELATIONSHIP: "mso_remove_relationship",
+	SELECTED_SERVICE_SUB_PATH : "#/instances/subdetails?",
+	SELECTED_SERVICE_INSTANCE_SUB_PATH : "serviceInstanceIdentifier=",
+	SELECTED_SUBSCRIBER_SUB_PATH : "subscriberId=",
+	OWNING_ENTITY_SUB_PATH : "owningEntity=",
+	PROJECT_SUB_PATH : "project=",
 	SERVICE_TYPE_LIST_PATH : "#/instances/serviceTypes?serviceTypeList=",
 	SERVICE_MODLES_INSTANCES_SUBSCRIBERS_PATH : 'serviceModels.htm#/instances/subscribers',
 	SERVICES_DIST_STATUS_PATH : "rest/models/services?distributionStatus=",
@@ -150,6 +179,12 @@
 	WELCOME_PATH : "welcome.htm",
     IS_PERMITTED_SUB_PATH: "&isPermitted=",
 
+    //Test Environment Urls:
+	OPERATIONAL_ENVIRONMENT_CREATE : "operationalEnvironment/create",
+	OPERATIONAL_ENVIRONMENT_DEACTIVATE : "operationalEnvironment/deactivate?operationalEnvironment=",
+	OPERATIONAL_ENVIRONMENT_ACTIVATE : "operationalEnvironment/activate?operationalEnvironment=",
+	OPERATIONAL_ENVIRONMENT_STATUS : "operationalEnvironment/requestStatus?requestId=",
+
     //Template Urls
 	AAI_GET_SUBS_URL : "app/vid/scripts/view-models/aaiGetSubs.htm",
 	AAI_GET_SUBSCRIBER_URL : "app/vid/scripts/view-models/aaiGetSubscriberList.htm",
@@ -158,9 +193,9 @@
 	CREATE_INSTANCE_SERVICE_MODELS_URL : "app/vid/scripts/view-models/createInstanceServiceModels.htm",
 	INSTANTIATE_URL : "app/vid/scripts/view-models/instantiate.htm",
 	SERVICE_MODELS : "app/vid/scripts/view-models/serviceModels.htm",
-	
-	
-	
+
+
+
 	FULL_NAME_MAP : {
 	    "model-invariant-id" : "Model ID",
 	    "model-version-id" : "Model Version ID"
@@ -174,11 +209,18 @@
 	},
 
 	MANUAL_TASKS: {
-    	"retry": "retry",
-    	"rollback": "rollback",
-    	"abort": "abort",
-    	"skip": "skip"
+        "retry": "retry",
+        "rollback": "rollback",
+        "abort": "abort",
+        "skip": "skip"
+	},
+
+	WORKFLOWS: {
+    	vnfConfigUpdate: "VNF Config Update",
+		vnfInPlace: "VNF In Place Software Update",
+		update: "update",
+		replace: "replace"
 	}
-	
+
     };
 })())
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/constants/fieldConstants.js b/vid-app-common/src/main/webapp/app/vid/scripts/constants/fieldConstants.js
index 9e3f44c..d7f429a 100755
--- a/vid-app-common/src/main/webapp/app/vid/scripts/constants/fieldConstants.js
+++ b/vid-app-common/src/main/webapp/app/vid/scripts/constants/fieldConstants.js
@@ -37,6 +37,10 @@
         SUBSCRIBER_NAME: "subscriberName",
         SUPPRESS_ROLLBACK: "suppressRollback",
         TENANT: "tenant",
+        PROJECT: "project",
+        OWNING_ENTITY : "owningEntity",
+        LINE_OF_BUSINESS : "lineOfBusiness",
+        PLATFORM : "platform",
         VNF_TARGETPROVSTATUS: "target",
 
         AAI_GET_FULL_SUBSCRIBERS: "aai_get_full_subscribers",
@@ -83,7 +87,7 @@
         NETWORKS: "networks",
         OPERATIONAL_STATUS: "operational-status",
         ORCHESTRATION_STATUS: "orchestration-status",
-        PERCENT_PROGRESS: "precentProgress",
+        PERCENT_PROGRESS: "percent-progress",
         PERSONA_MODEL_ID: "persona-model-id",
         PERSONA_MODEL_VERSION: "persona-model-version",
         PERSONA_MODEL_CUSTOMIZATION_ID: "persona-model-customization-id",
@@ -129,7 +133,16 @@
         SUPPLEMENTORY_DATA_FILE: "supplementoryDataFile",
         ZONE_ID: "zone-id",
         ZONE_NAME: "zone-name",
-
+        GENERIC_CONFIGURATION: "configuration",
+        CONFIGURATIONS: "configurations",
+        CONFIGURATION: "configuration",
+        CONFIGURATION_NAME: "configuration-name",
+        CONFIGURATION_TYPE: "configuration-type",
+        CONFIGURATION_ID: "configuration-id",
+        PORT: "l-interface",
+        PORT_ID: "interface-id",
+        PORT_NAME: "interface-name",
+        PORT_MIRRORED: "is-port-mirrored"
     };
 
     var KEY = {
@@ -140,58 +153,62 @@
      * NAME values are displayed on GUI pages.
      */
     var NAME = {
-        AVAILABLE_VOLUME_GROUP: "Available Volume Group",
-        INSTANCE_NAME: "Instance Name",
-        CUSTOMER_ID: "Customer ID",
-        LCP_REGION: "LCP Region",
-        LCP_REGION_TEXT: "Legacy Region",
-        MODEL_INVARIANT_UUID: "Model Invariant UUID",
-        MODEL_NAME: "Model Name",
-        MODEL_VERSION: "Model Version",
-        MODEL_UUID: "Model UUID",
-        MODEL_CUSTOMIZATION_UUID: "Model Customization UUID",
-        MODEL_VNF_TYPE: "NF Type",
-        MODEL_VNF_ROLE: "NF Role",
-        MODEL_VNF_FUNCTION: "NF Function",
-        MODEL_VNF_CODE: "NF Naming Code",
-        MODEL_CUSTOMIZATION_NAME: "Resource Name",
-        PRODUCT_FAMILY: "Product Family",
-        AIC_ZONES: "AIC Zone",
-        RESOURCE_DESCRIPTION: "Resource Description",
-        RESOURCE_NAME: "Resource Name",
-        SERVICE_CATEGORY: "Service Category",
-        SERVICE_DESCRIPTION: "Service Description",
-        SERVICE_INSTANCE_ID: "Service Instance ID",
-        SERVICE_INSTANCE_Id: "Service Instance Id",
-        SERVICE_INSTANCE_NAME: "Service Instance Name",
-        SERVICE_INVARIANT_UUID: "Service Invariant UUID",
-        SERVICE_NAME: "Service Name",
-        SERVICE_TYPE: "Service Type",
-        SERVICE_ROLE: "Service Role",
-        SERVICE_UUID: "Service UUID",
-        SERVICE_VERSION: "Service Version",
-        SUBSCRIBER_NAME: "Subscriber Name",
-        MOBILITY: "Mobility",
-        SUPPRESS_ROLLBACK: "Suppress Rollback on Failure",
-        SDN_C_PRELOAD: "SDN-C Pre-Load",
-        UPLOAD_SUPPLEMENTORY_DATA_FILE: "Upload Supplementary Data file",
-        SUPPLEMENTORY_DATA_FILE: "Supplementory Data file (JSON format)",
-        TENANT: "Tenant",
-        USER_SERVICE_INSTANCE_NAME: "User Service Instance Name",
-        VF_MODULE_DESCRIPTION: "VF Module Description",
-        VF_MODULE_LABEL: "VF Module Label",
-        VF_MODULE_TYPE: "VF Module Type",
-        VNF_ORCHESTRATION_STATUS: "Orchestration Status",
-        VNF_Operational_Status: "Operational Status",
-        VNF_Current_Prov_Status: "Current Prov_Status",
-        VNF_Target_Prov_Status: "Target Prov Status",
-        VNF_VNF_ID: "VNF ID",
-        VNF_VNF_Name: "VNF Name",
-        VNF_VNF_Type: "VNF Type",
-        VNF_Service_ID: "Service ID",
-        VNF_In_Maint: "In Maint",
-        VFMDULE_CUSTOMIZATIONUUID: "VF Module Model Customization UUID",
-        RESOURCE_CUSTOMIZATION_UUID: "Resource Model Customization UUID"
+    AVAILABLE_VOLUME_GROUP: "Available Volume Group",
+    INSTANCE_NAME: "Instance Name",
+    CUSTOMER_ID: "Customer ID",
+    LCP_REGION: "LCP Region",
+    LCP_REGION_TEXT: "Legacy Region",
+    MODEL_INVARIANT_UUID: "Model Invariant UUID",
+    MODEL_NAME: "Model Name",
+    MODEL_VERSION: "Model Version",
+    MODEL_UUID: "Model UUID",
+    MODEL_CUSTOMIZATION_UUID: "Model Customization UUID",
+    MODEL_VNF_TYPE: "NF Type",
+    MODEL_VNF_ROLE: "NF Role",
+    MODEL_VNF_FUNCTION: "NF Function",
+    MODEL_VNF_CODE: "NF Naming Code",
+    MODEL_CUSTOMIZATION_NAME: "Resource Name",
+    PRODUCT_FAMILY: "Product Family",
+    AIC_ZONES: "AIC Zone",
+	RESOURCE_DESCRIPTION : "Resource Description",
+	RESOURCE_NAME : "Resource Name",
+	SERVICE_CATEGORY : "Service Category",
+	SERVICE_DESCRIPTION : "Service Description",
+	SERVICE_INSTANCE_ID : "Service Instance ID",
+	SERVICE_INSTANCE_Id : "Service Instance Id",
+	SERVICE_INSTANCE_NAME : "Service Instance Name",
+	SERVICE_INVARIANT_UUID : "Service Invariant UUID",
+	SERVICE_NAME : "Service Name",
+	SERVICE_TYPE : "Service Type",
+    SERVICE_ROLE: "Service Role",
+	SERVICE_UUID : "Service UUID",
+	SERVICE_VERSION : "Service Version",
+	SUBSCRIBER_NAME : "Subscriber Name",
+	MOBILITY :  "Mobility",
+	SUPPRESS_ROLLBACK : "Suppress Rollback on Failure",
+	SDN_C_PRELOAD : "SDN-C Pre-Load",
+	UPLOAD_SUPPLEMENTORY_DATA_FILE : "Upload Supplementary Data file",
+	SUPPLEMENTORY_DATA_FILE : "Supplementory Data file (JSON format)",
+	TENANT : "Tenant",
+    PROJECT : "Project",
+    OWNING_ENTITY : "Owning Entity",
+    LINE_OF_BUSINESS : "Line Of Business",
+    PLATFORM : "Platform",
+	USER_SERVICE_INSTANCE_NAME : "User Service Instance Name",
+	VF_MODULE_DESCRIPTION : "VF Module Description",
+	VF_MODULE_LABEL : "VF Module Label",
+	VF_MODULE_TYPE : "VF Module Type",
+	VNF_ORCHESTRATION_STATUS : "Orchestration Status",
+	VNF_Operational_Status: "Operational Status",
+	VNF_Current_Prov_Status: "Current Prov_Status",
+	VNF_Target_Prov_Status: "Target Prov Status",
+	VNF_VNF_ID : "VNF ID",
+	VNF_VNF_Name: "VNF Name",
+	VNF_VNF_Type: "VNF Type",
+	VNF_Service_ID: "Service ID",
+	VNF_In_Maint: "In Maint",
+	VFMDULE_CUSTOMIZATIONUUID: "VF Module Model Customization UUID",
+	RESOURCE_CUSTOMIZATION_UUID: "Resource Model Customization UUID"
     };
 
     /*
@@ -211,6 +228,10 @@
         SUBSCRIBER_NAME: "Select Subscriber Name",
         TARGETPROVSTATUS: "Select Target Prov Status",
         TENANT: "Select Tenant Name",
+        PROJECT: "Select Project Name",
+        OWNING_ENTITY: "Select Owning Entity",
+        LINE_OF_BUSINESS : "Select Line Of Business",
+        PLATFORM : "Select Platform",
         TEXT_INPUT: "Enter data",
         SELECT_SERVICE: "Select a service type",
         SELECT_SUB: "Select a subscriber name",
@@ -244,7 +265,11 @@
         SUBMITTING_REQUEST: "Submitting Request",
         SUCCESS_VNF_PROV_STATUS: "Successfully set the VNF's Prov_Status to ",
         UNLOCKED: "Unlocked",
-
+        AAI_ACTIVE: "Active",
+        AAI_INACTIVE: "Inactive",
+        AAI_CREATED: "Created",
+        AAI_ENABLED: "Enabled",
+        AAI_DISABLED: "Disabled"
     };
 
     var STYLE = {
@@ -416,8 +441,8 @@
             id: ID.SUBSCRIBER_NAME,
             type: PARAMETER.SELECT,
             prompt: PROMPT.SUBSCRIBER_NAME,
-		isRequired : true,
-		isSingleOptionAutoSelected : false
+            isRequired: true,
+			isSingleOptionAutoSelected : false
         },
         TENANT_DISABLED: {
             name: NAME.TENANT,
@@ -433,6 +458,38 @@
             isEnabled: true,
             prompt: PROMPT.TENANT,
             isRequired: true
+        },
+        PROJECT: {
+            name: NAME.PROJECT,
+            id: ID.PROJECT,
+            type: PARAMETER.SELECT,
+            isEnabled: true,
+            prompt: PROMPT.PROJECT,
+            isRequired: false
+        },
+        OWNING_ENTITY: {
+            name: NAME.OWNING_ENTITY,
+            id: ID.OWNING_ENTITY,
+            type: PARAMETER.SELECT,
+            isEnabled: true,
+            prompt: PROMPT.OWNING_ENTITY,
+            isRequired: true
+        },
+        LINE_OF_BUSINESS: {
+            name: NAME.LINE_OF_BUSINESS,
+            id: ID.LINE_OF_BUSINESS,
+            type: PARAMETER.MULTI_SELECT,
+            isEnabled: true,
+            prompt: PROMPT.LINE_OF_BUSINESS,
+            isRequired: false
+        },
+        PLATFORM: {
+            name: NAME.PLATFORM,
+            id: ID.PLATFORM,
+            type: PARAMETER.SELECT,
+            isEnabled: true,
+            prompt: PROMPT.PLATFORM,
+            isRequired: true
         }
     };
 
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/constants/parameterConstants.js b/vid-app-common/src/main/webapp/app/vid/scripts/constants/parameterConstants.js
index 693186a..785f3ca 100755
--- a/vid-app-common/src/main/webapp/app/vid/scripts/constants/parameterConstants.js
+++ b/vid-app-common/src/main/webapp/app/vid/scripts/constants/parameterConstants.js
@@ -24,6 +24,7 @@
     return {
 		BOOLEAN : "boolean",
 		SELECT : "select",
+		MULTI_SELECT : "multi_select",
 		STRING : "string",
 		NUMBER : "number",
 		VALID_VALUES : "valid_values",
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/constants/version.json b/vid-app-common/src/main/webapp/app/vid/scripts/constants/version.json
new file mode 100644
index 0000000..5e843e9
--- /dev/null
+++ b/vid-app-common/src/main/webapp/app/vid/scripts/constants/version.json
@@ -0,0 +1 @@
+{"Version": "BUILD_NUMBER"}
\ No newline at end of file
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/constants/vidConfiguration.js b/vid-app-common/src/main/webapp/app/vid/scripts/constants/vidConfiguration.js
index 6ed410a..0b69ed5 100755
--- a/vid-app-common/src/main/webapp/app/vid/scripts/constants/vidConfiguration.js
+++ b/vid-app-common/src/main/webapp/app/vid/scripts/constants/vidConfiguration.js
@@ -64,6 +64,12 @@
 				"orchestrationStatus": "active",
 				"inMaint": false,
 				"operationalStatus": "out-of-service-path"
+			},
+			{
+				"provStatus": "prov",
+				"orchestrationStatus": "activated",
+				"inMaint": false,
+				"operationalStatus": "out-of-service-path"
 			}
 	];
 	/* 
@@ -96,6 +102,11 @@
 	 */
 	var COMPONENT_LIST_NAMED_QUERY_ID = "0367193e-c785-4d5f-9cb8-7bc89dc9ddb7";
 	var MACRO_SERVICES = [];
+
+	var SCHEDULER_CALLBACK_URL = "";
+
+	var SCHEDULER_PORTAL_URL = "";
+
     return {
     	ASDC_MODEL_STATUS : ASDC_MODEL_STATUS,
     	MSO_MAX_POLLS : MSO_MAX_POLLS,
@@ -106,6 +117,8 @@
     	VNF_VALID_STATUS_LIST : vnfValidStatusList,
 		UPLOAD_SUPPLEMENTARY_STATUS_CHECK_ENABLED : UPLOAD_SUPPLEMENTARY_STATUS_CHECK_ENABLED,
     	MACRO_SERVICES : MACRO_SERVICES,
-    	COMPONENT_LIST_NAMED_QUERY_ID : COMPONENT_LIST_NAMED_QUERY_ID
+    	COMPONENT_LIST_NAMED_QUERY_ID : COMPONENT_LIST_NAMED_QUERY_ID,
+        SCHEDULER_CALLBACK_URL: SCHEDULER_CALLBACK_URL,
+        SCHEDULER_PORTAL_URL: SCHEDULER_PORTAL_URL
     };
 })())
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/controller/AddNetworkNodeController.js b/vid-app-common/src/main/webapp/app/vid/scripts/controller/AddNetworkNodeController.js
new file mode 100644
index 0000000..458da3f
--- /dev/null
+++ b/vid-app-common/src/main/webapp/app/vid/scripts/controller/AddNetworkNodeController.js
@@ -0,0 +1,78 @@
+/*-
+* ============LICENSE_START=======================================================
+* VID
+* ================================================================================
+* Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+* ================================================================================
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*      http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+* ============LICENSE_END=========================================================
+*/
+
+/**
+ * The Instantiation (or View/Edit) Controller controls the instantiation/removal of
+ * deployable objects (Services, VNFs, VF-Modules, Networks, and Volume-Groups)
+ */
+
+"use strict";
+
+appDS2.controller("AddNetworkNodeController", ["COMPONENT", "FIELD", "PARAMETER", "DataService", "CreationService", "$scope", "$window", "$location",
+    function (COMPONENT, FIELD, PARAMETER, DataService, CreationService, $scope, $window, $location) {
+
+        $scope.serviceMetadataFields = [];
+        $scope.tenantList = [];
+        $scope.nodeTemplateFields = {};
+        
+        $scope.regexInstanceName = /^([a-z])+([0-9a-z\-_\.]*)$/i;
+        $scope.errorMsg = FIELD.ERROR.INSTANCE_NAME_VALIDATE;
+
+        var handleGetParametersResponse = function(parameters) {
+            $scope.serviceMetadataFields = parameters.summaryList;
+            $scope.tenantList = DataService.getCloudRegionTenantList();
+
+        if(DataService.getPortMirroningConfigFields()){
+            $scope.nodeTemplateFields =DataService.getPortMirroningConfigFields();
+        }else {
+            $scope.nodeTemplateFields = angular.copy(_.keyBy(parameters.userProvidedList, 'id'));
+        }
+
+           $scope.modelName = DataService.getModelInfo(COMPONENT.VNF).modelCustomizationName;
+        };
+
+        CreationService.initializeComponent(COMPONENT.VNF);
+
+        CreationService.getParameters(handleGetParametersResponse);
+
+        $scope.setTenant = function(field)  {
+            $scope.nodeTemplateFields.tenant.optionList = _.filter($scope.tenantList, {'cloudRegionId': field.value, 'isPermitted': true});
+        };
+
+        $scope.cancel = function()  {
+            $window.history.back();
+        };
+
+        $scope.next = function()  {
+            // DataService.setLcpRegion($scope.nodeTemplateFields.lcpRegion.value);
+            // DataService.setModelInstanceName($scope.nodeTemplateFields.instanceName.value);
+            // DataService.setTenant($scope.nodeTemplateFields.tenant.value);
+            // var suppressRollback = ($scope.nodeTemplateFields.suppressRollback.value) ? true : false;
+            // DataService.setSuppressRollback(suppressRollback);
+            DataService.setPortMirroningConfigFields($scope.nodeTemplateFields);
+            $location.path("/serviceProxyConfig");
+        };
+
+        $scope.$on('$routeChangeStart', function (event, next, current) {
+            if(next.$$route.originalPath !=="/serviceProxyConfig"){
+                DataService.setPortMirroningConfigFields(null);
+            }
+        });
+    }]);
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/controller/InstantiationController.js b/vid-app-common/src/main/webapp/app/vid/scripts/controller/InstantiationController.js
index f0653f6..f1dc384 100755
--- a/vid-app-common/src/main/webapp/app/vid/scripts/controller/InstantiationController.js
+++ b/vid-app-common/src/main/webapp/app/vid/scripts/controller/InstantiationController.js
@@ -26,14 +26,18 @@
 	"use strict";
 
 	appDS2.requires.push('ui.tree');
-	
-	appDS2.controller("InstantiationController", function ($scope, $route, $location, $timeout, COMPONENT, VIDCONFIGURATION, FIELD, DataService, PropertyService, UtilityService, VnfService, $http, vidService) {
-		
+
+	appDS2.controller("InstantiationController", function ($scope, $route, $location, $timeout, COMPONENT, VIDCONFIGURATION, FIELD, DataService, PropertyService, UtilityService, VnfService, $http, vidService, AaiService,PnfService, $q) {
+
 		$scope.popup = new Object();
 		$scope.defaultBaseUrl = "";
 		$scope.responseTimeoutMsec = 60000;
 		$scope.properties = UtilityService.getProperties();
-		$scope.isPermitted = $location.search().isPermitted;
+        $scope.resumeStatus = COMPONENT.RESUME_STATUS;
+        //isPermitted - returned as string from url and converted into boolean
+		$scope.isPermitted = $location.search().isPermitted == "true";
+		$scope.STATUS_CONSTANTS = FIELD.STATUS;
+        $scope.pnfs = [];// PNF data init;
 
         $scope.init = function() {
             /*
@@ -63,8 +67,9 @@
 //            DataService.setServiceInstanceId("mmsc-test-service-instance");
 //            DataService.setServiceUuid("XXXX-YYYY-ZZZZ");
 //            DataService.setUserServiceInstanceName("USER_SERVICE_INSTANCE_NAME");
+
         }
-        
+
         //PropertyService.setMsoBaseUrl("testmso");
 
 		$scope.convertModel = function(asdcModel) {
@@ -78,7 +83,23 @@
 			"convertedModel": $scope.convertModel(vidService.getModel()),
 			"instance": vidService.getInstance()
 		};
-		
+
+		preparePnfs();
+
+
+        function preparePnfs(){
+        	var serviceInstance = {
+                globalCustomerId: $location.search().subscriberId,
+                serviceType: $location.search().serviceType,
+                serviceInstanceId: $location.search().serviceInstanceId
+        	};
+
+            _setPnf(serviceInstance).then(function(data){
+                $scope.pnfs = data;
+            });
+		}
+
+
 		$scope.returnVfModules = function (vnfInstance) {
 			
 			var svcModel = $scope.service.convertedModel;
@@ -213,9 +234,10 @@
 			DataService.setServiceUuid($scope.service.model.service.uuid);
 			DataService.setNetworkInstanceId(network.object[FIELD.ID.NETWORK_ID]);
 			
-			$scope.$broadcast(COMPONENT.DELETE_COMPONENT, {
+			$scope.$broadcast(COMPONENT.DELETE_RESUME_COMPONENT, {
 			    componentId : COMPONENT.NETWORK,
-			    callbackFunction : deleteCallbackFunction
+			    callbackFunction : deleteOrResumeCallback,
+				dialogMethod: COMPONENT.DELETE
 			});
 		};
 
@@ -233,14 +255,8 @@
 				}
 			DataService.setMacro($scope.isMacro());
 			DataService.setInventoryItem(serviceInstance);
-			
-			DataService.setModelInfo(COMPONENT.SERVICE, {
-				"modelInvariantId": $scope.service.model.service.invariantUuid,
-				"modelVersion": $scope.service.model.service.version,
-				"modelNameVersionId": $scope.service.model.service.uuid,
-				"modelName": $scope.service.model.service.name,
-				"inputs": ""
-			});
+			setCurrentServiceModelInfoFromScope();
+
 			
 			DataService.setSubscriberName(serviceObject[FIELD.ID.SUBSCRIBER_NAME]);
 			DataService.setServiceType(serviceObject[COMPONENT.SERVICE_TYPE]);
@@ -253,105 +269,150 @@
 			
 			DataService.setServiceUuid($scope.service.model.service.uuid);
 			
-			$scope.$broadcast(COMPONENT.DELETE_COMPONENT, {
+			$scope.$broadcast(COMPONENT.DELETE_RESUME_COMPONENT, {
 			    componentId : COMPONENT.SERVICE,
-			    callbackFunction : deleteServiceInstanceCallbackFunction
+			    callbackFunction : deleteServiceInstanceCallbackFunction,
+                dialogMethod: COMPONENT.DELETE
 			});
 		
 		};
 
+		function populate_popup_vfModule(serviceObject, vfModule, vnf){
+            var serviceInstance = serviceObject.object;
+
+            DataService.setInventoryItem(vfModule.object);
+
+            var svcModel = $scope.service.convertedModel;
+
+            //var vnfModelInvariantUuid = vnf.object[FIELD.ID.MODEL_INVAR_ID];
+            var vnfModelVersionId = vnf.object[FIELD.ID.MODEL_VERSION_ID];
+            var vnfModelCustomizationUuid = vnf.object[FIELD.ID.MODEL_CUSTOMIZATION_ID];;
+            var vfModuleInstanceID = vfModule.object[FIELD.ID.VF_MODULE_ID];
+            if (vfModuleInstanceID == null) {
+                vfModuleInstanceID = "";
+            }
+
+            var vnfModel = null;
+            var vfModuleModel = null;
+
+            DataService.setModelInfo(COMPONENT.VF_MODULE, {
+                "modelInvariantId": "",
+                "modelVersion": "",
+                "modelNameVersionId": "",
+                "modelCustomizationName": "",
+                "customizationUuid": "",
+                "modelName": "",
+                "inputs": ""
+            });
+
+            if ( (!($scope.isObjectEmpty(svcModel))) && ( !($scope.isObjectEmpty(svcModel.vnfs) ) ) ) {
+                if ( (svcModel.isNewFlow) && (vnfModelCustomizationUuid != null ) ) {
+                    vnfModel = svcModel.vnfs[vnfModelCustomizationUuid];
+
+                    var vfModuleCustomizationUuid = vfModule.object[FIELD.ID.MODEL_CUSTOMIZATION_ID];
+                    if ( !($scope.isObjectEmpty(vnfModel.vfModules) ) && UtilityService.hasContents(vfModuleCustomizationUuid) ) {
+
+                        vfModuleModel = vnfModel.vfModules[vfModuleCustomizationUuid];
+
+                    }
+                }
+                else {
+                    // old flow
+                    if (vnfModelVersionId != null ) {
+                        vnfModel = svcModel.vnfs[vnfModelVersionId];
+                    }
+                    //var vfModuleInvariantUuid = vfModule.object[FIELD.ID.MODEL_INVAR_ID];
+                    var vfModuleModelVersionId = vfModule.object[FIELD.ID.MODEL_VERSION_ID];
+                    if ( (!($scope.isObjectEmpty(vnfModel))) && (!($scope.isObjectEmpty(vnfModel.vfModules))) &&
+                        UtilityService.hasContents(vfModuleModelVersionId) ) {
+                        vfModuleModel = vnfModel.vfModules[vfModuleModelVersionId];
+                    }
+                }
+                if ( !($scope.isObjectEmpty(vfModuleModel)) ) {
+                    DataService.setModelInfo(COMPONENT.VF_MODULE, {
+                        "modelInvariantId": vfModuleModel.invariantUuid,
+                        "modelVersion": vfModuleModel.version,
+                        "modelNameVersionId": vfModuleModel.uuid,
+                        "modelCustomizationName": vfModuleModel.modelCustomizationName,
+                        "customizationUuid": vfModuleModel.customizationUuid,
+                        "modelName": vfModuleModel.name,
+                        "inputs": ""
+                    });
+                }
+            }
+
+            DataService.setVnfInstanceId(vnf.object[FIELD.ID.VNF_ID]);
+            DataService.setVfModuleInstanceId(vfModuleInstanceID);
+
+            DataService.setSubscriberName(serviceObject[COMPONENT.SUBSCRIBER_NAME]);
+            DataService.setServiceType(serviceObject[COMPONENT.SERVICE_TYPE]);
+            DataService.setServiceInstanceId(serviceInstance[FIELD.ID.SERVICE_INSTANCE_ID]);
+
+            DataService.setGlobalCustomerId(serviceObject[FIELD.ID.GLOBAL_CUST_ID]);
+            DataService.setServiceInstanceName($scope.service.instance.name);
+
+            DataService.setServiceName($scope.service.model.service.name);
+
+            DataService.setServiceUuid($scope.service.model.service.uuid);
+		}
+
 		$scope.deleteVfModule = function(serviceObject, vfModule, vnf) {
 
 			console.log("Removing VF-Module " + vfModule.name);
-			
-            var serviceInstance = serviceObject.object;
 
-			DataService.setInventoryItem(vfModule.object);
+            populate_popup_vfModule(serviceObject, vfModule, vnf);
 			
-			var svcModel = $scope.service.convertedModel;
-
-			//var vnfModelInvariantUuid = vnf.object[FIELD.ID.MODEL_INVAR_ID];
-			var vnfModelVersionId = vnf.object[FIELD.ID.MODEL_VERSION_ID];
-			var vnfModelCustomizationUuid = vnf.object[FIELD.ID.MODEL_CUSTOMIZATION_ID];;		
-			var vfModuleInstanceID = vfModule.object[FIELD.ID.VF_MODULE_ID];
-			if (vfModuleInstanceID == null) {
-				vfModuleInstanceID = "";
-			}
-			
-			var vnfModel = null;
-			var vfModuleModel = null;
-			
-			DataService.setModelInfo(COMPONENT.VF_MODULE, {
-				"modelInvariantId": "",
-				"modelVersion": "",
-				"modelNameVersionId": "",
-				"modelCustomizationName": "",
-				"customizationUuid": "",
-				"modelName": "",
-				"inputs": ""
-			});
-			
-			if ( (!($scope.isObjectEmpty(svcModel))) && ( !($scope.isObjectEmpty(svcModel.vnfs) ) ) ) {
-				if ( (svcModel.isNewFlow) && (vnfModelCustomizationUuid != null ) ) {
-					vnfModel = svcModel.vnfs[vnfModelCustomizationUuid];
-					
-					var vfModuleCustomizationUuid = vfModule.object[FIELD.ID.MODEL_CUSTOMIZATION_ID];
-					if ( !($scope.isObjectEmpty(vnfModel.vfModules) ) && UtilityService.hasContents(vfModuleCustomizationUuid) ) {
-						
-						vfModuleModel = vnfModel.vfModules[vfModuleCustomizationUuid];
-						
-					}
-				}
-				else {
-					// old flow
-					if (vnfModelVersionId != null ) {
-						vnfModel = svcModel.vnfs[vnfModelVersionId];
-					}
-					//var vfModuleInvariantUuid = vfModule.object[FIELD.ID.MODEL_INVAR_ID];
-					var vfModuleModelVersionId = vfModule.object[FIELD.ID.MODEL_VERSION_ID];
-					if ( (!($scope.isObjectEmpty(vnfModel))) && (!($scope.isObjectEmpty(vnfModel.vfModules))) && 
-							  UtilityService.hasContents(vfModuleModelVersionId) ) {
-						vfModuleModel = vnfModel.vfModules[vfModuleModelVersionId];
-					}
-				}
-				if ( !($scope.isObjectEmpty(vfModuleModel)) ) {
-					DataService.setModelInfo(COMPONENT.VF_MODULE, {
-						"modelInvariantId": vfModuleModel.invariantUuid,
-						"modelVersion": vfModuleModel.version,
-						"modelNameVersionId": vfModuleModel.uuid,
-						"modelCustomizationName": vfModuleModel.modelCustomizationName,
-						"customizationUuid": vfModuleModel.customizationUuid,
-						"modelName": vfModuleModel.name,
-						"inputs": ""
-					});
-				}
-			}
-
-			DataService.setVnfInstanceId(vnf.object[FIELD.ID.VNF_ID]);
-			DataService.setVfModuleInstanceId(vfModuleInstanceID);
-			
-			DataService.setSubscriberName(serviceObject[COMPONENT.SUBSCRIBER_NAME]);
-			DataService.setServiceType(serviceObject[COMPONENT.SERVICE_TYPE]);
-			DataService.setServiceInstanceId(serviceInstance[FIELD.ID.SERVICE_INSTANCE_ID]);
-	
-			DataService.setGlobalCustomerId(serviceObject[FIELD.ID.GLOBAL_CUST_ID]);
-			DataService.setServiceInstanceName($scope.service.instance.name);
-			
-			DataService.setServiceName($scope.service.model.service.name);
-			
-			DataService.setServiceUuid($scope.service.model.service.uuid);
-			
-			$scope.$broadcast(COMPONENT.DELETE_COMPONENT, {
+			$scope.$broadcast(COMPONENT.DELETE_RESUME_COMPONENT, {
 			    componentId : COMPONENT.VF_MODULE,
-			    callbackFunction : deleteCallbackFunction
+			    callbackFunction : deleteOrResumeCallback,
+                dialogMethod: COMPONENT.DELETE
 			});
 			
 			return;
 
 		};
 
-		$scope.deleteVnf = function(serviceObject, vnf) {
+		function setCurrentServiceModelInfoFromScope(){
+            DataService.setModelInfo(COMPONENT.SERVICE, {
+                "modelInvariantId": $scope.service.model.service.invariantUuid,
+                "modelVersion": $scope.service.model.service.version,
+                "modelNameVersionId": $scope.service.model.service.uuid,
+                "modelName": $scope.service.model.service.name,
+                "inputs": ""
+            });
+		};
 
+		function setCurrentVNFModelInfo(vnf){
+            var svcModel = $scope.service.convertedModel;
+            var vnfModel;
+            var vnfModelCustomizationUuid = vnf.object[FIELD.ID.MODEL_CUSTOMIZATION_ID];
+            var vnfModelVersionId = vnf.object[FIELD.ID.MODEL_VERSION_ID];
+            if ( (!($scope.isObjectEmpty(svcModel))) && ( !($scope.isObjectEmpty(svcModel.vnfs) ) ) ) {
+                if ( (svcModel.isNewFlow) && (vnfModelCustomizationUuid != null ) ) {
+                     vnfModel = svcModel.vnfs[vnfModelCustomizationUuid];
+                }
+                else {
+                     vnfModel = svcModel.vnfs[vnfModelVersionId];
+                }
+                if ( !($scope.isObjectEmpty(vnfModel) ) ) {
+
+                    DataService.setModelInfo(COMPONENT.VNF, {
+                        "modelInvariantId": vnfModel.invariantUuid,
+                        "modelVersion": vnfModel.version,
+                        "modelNameVersionId": vnfModel.uuid,
+                        "modelCustomizationName": vnfModel.modelCustomizationName,
+                        "customizationUuid": vnfModel.customizationUuid,
+                        "modelName": vnfModel.name,
+                        "inputs": ""
+                    });
+                }
+            }
+
+
+
+		}
+
+		$scope.deleteVnf = function(serviceObject, vnf) {
 			console.log("Removing VNF " + vnf.name);
 			
 			var serviceInstance = serviceObject.object;
@@ -424,9 +485,10 @@
 			
 			DataService.setServiceUuid($scope.service.model.service.uuid);
 			
-			$scope.$broadcast(COMPONENT.DELETE_COMPONENT, {
+			$scope.$broadcast(COMPONENT.DELETE_RESUME_COMPONENT, {
 			    componentId : COMPONENT.VNF,
-			    callbackFunction : deleteCallbackFunction
+			    callbackFunction : deleteOrResumeCallback,
+                dialogMethod: COMPONENT.DELETE
 			});
 		
 		};
@@ -517,8 +579,9 @@
 			DataService.setVnfInstanceId(vnf.nodeId);
 			DataService.setVolumeGroupInstanceId(volumeGroup.nodeId);
 			
-			$scope.$broadcast(COMPONENT.DELETE_COMPONENT, {
+			$scope.$broadcast(COMPONENT.DELETE_RESUME_COMPONENT, {
 			    componentId : COMPONENT.VOLUME_GROUP,
+                dialogMethod: COMPONENT.DELETE
 			});
 		};
 		
@@ -585,10 +648,11 @@
 			DataService.setVnfInstanceId(vnf.nodeId);
 			DataService.setVolumeGroupInstanceId(volumeGroup.nodeId);
 		
-			$scope.$broadcast(COMPONENT.DELETE_COMPONENT, {
-			    componentId : COMPONENT.VOLUME_GROUP,
-			    callbackFunction : deleteCallbackFunction
-			});
+			$scope.$broadcast(COMPONENT.DELETE_RESUME_COMPONENT, {
+                componentId : COMPONENT.VOLUME_GROUP,
+                callbackFunction : deleteOrResumeCallback,
+                dialogMethod: COMPONENT.DELETE
+            });
 		};
 
 		$scope.describeNetwork = function(serviceObject, networkObject) {
@@ -783,14 +847,8 @@
 				"inputs": "",
 				"displayInputs": netModel.displayInputs
 			});
-			
-			DataService.setModelInfo(COMPONENT.SERVICE, {
-				"modelInvariantId": $scope.service.model.service.invariantUuid, 
-				"modelVersion": $scope.service.model.service.version,
-				"modelNameVersionId": $scope.service.model.service.uuid,
-				"modelName": $scope.service.model.service.name,
-				"inputs": ""
-			});
+			setCurrentServiceModelInfoFromScope();
+
 			
 			$scope.$broadcast(COMPONENT.CREATE_COMPONENT, {
 			    componentId : COMPONENT.NETWORK,
@@ -814,6 +872,8 @@
 			DataService.setServiceInstanceId($scope.service.instance.id);
 			DataService.setServiceName($scope.service.model.service.name);
 			
+			console.log ( "existingVnfs: " );
+			console.log (JSON.stringify ( existingVnfs, null, 4));
 			console.log ( "existingVnfs: " ); console.log (JSON.stringify ( existingVnfs, null, 4));
 			var vnf_type = "";
 			var vnf_role = "";
@@ -833,7 +893,7 @@
 				vnf_code = vnf.nfCode;
 			}
 			DataService.setModelInfo(COMPONENT.VNF, {
-				"modelType": "vnf",
+				"modelType": vnf.isPnf ? "pnf" : "vnf",
 				"modelInvariantId": vnf.invariantUuid,
 				"modelVersion": vnf.version,
 				"modelNameVersionId": vnf.uuid,
@@ -845,23 +905,27 @@
 				"vnfType": vnf_type,
 				"vnfRole": vnf_role,
 				"vnfFunction": vnf_function,
-				"vnfCode": vnf_code
+				"vnfCode": vnf_code,
+				"properties": vnf.properties
 			});
 			
 			DataService.setModelInstanceName($scope.service.model.service.name);
-			
-			DataService.setModelInfo(COMPONENT.SERVICE, {
-				"modelInvariantId": $scope.service.model.service.invariantUuid, 
-				"modelVersion": $scope.service.model.service.version,
-				"modelNameVersionId": $scope.service.model.service.uuid,
-				"modelName": $scope.service.model.service.name,
-				"inputs": ""
-			});
-			
-			$scope.$broadcast(COMPONENT.CREATE_COMPONENT, {
-			    componentId : COMPONENT.VNF,
-			    callbackFunction : createVnfCallbackFunction
-			});		
+			setCurrentServiceModelInfoFromScope();
+
+			if (vnf.isConfig) {
+                DataService.setServiceProxies($scope.service.model.serviceProxies);
+                DataService.setSourceServiceProxies(vnf.sourceNodes);
+                DataService.setCollectorServiceProxies(vnf.collectorNodes);
+                DataService.setConfigurationByPolicy(vnf.isConfigurationByPolicy);
+                $location.path("/addNetworkNode");
+            } else if(vnf.isPnf){
+                $location.path("/pnfSearchAssociation");
+            } else {
+                $scope.$broadcast(COMPONENT.CREATE_COMPONENT, {
+                    componentId: COMPONENT.VNF,
+                    callbackFunction: createVnfCallbackFunction
+                });
+            }
 		};
 
 		$scope.addVfModuleInstance = function(vnfInstance, vfModuleModel) {
@@ -898,20 +962,11 @@
 				availableVolumeGroupList.push({"instance": volumeGroupInstance});
 			});
 			
-			if (vfModuleModel.volumeGroupAllowed) {
-				DataService.setAvailableVolumeGroupList(availableVolumeGroupList);
-			}
-			
-			DataService.setModelInfo(COMPONENT.SERVICE, {
-				"modelInvariantId": $scope.service.model.service.invariantUuid,
-				"modelVersion": $scope.service.model.service.version,
-				"modelNameVersionId": $scope.service.model.service.uuid,
-				"modelName": $scope.service.model.service.name,
-				"inputs": ""
-			});
+			DataService.setAvailableVolumeGroupList(availableVolumeGroupList);
+			setCurrentServiceModelInfoFromScope();
 
 			DataService.setVnfInstanceId(vnfInstance.object[FIELD.ID.VNF_ID]);
-			
+
 			DataService.setModelInfo(COMPONENT.VNF, {
 				"modelInvariantId": vnfModel.invariantUuid,
 				"modelVersion": vnfModel.version,
@@ -954,6 +1009,7 @@
 			DataService.setServiceInstanceName($scope.service.instance.name);
 			DataService.setServiceInstanceId($scope.service.instance.id);
 			DataService.setServiceName($scope.service.model.service.name);
+			setCurrentServiceModelInfoFromScope();
 
 			DataService.setModelInfo(COMPONENT.SERVICE, {
 				"modelInvariantId": $scope.service.model.service.invariantUuid,
@@ -976,7 +1032,7 @@
 			else {
 				vnfModel = svcModel.vnfs[vnfModelVersionId];
 			}
-			
+
 			DataService.setModelInfo(COMPONENT.VNF, {
 				"modelInvariantId": vnfModel.invariantUuid,
 				"modelVersion": vnfModel.version,
@@ -1003,6 +1059,76 @@
 			});
 		};
 
+        $scope.resume = function(serviceObject, vfModule, vnfModel) {
+            populate_popup_vfModule(serviceObject, vfModule, vnfModel);
+			setCurrentVNFModelInfo(vnfModel);
+			DataService.setVfModuleInstanceName(vfModule.object[FIELD.ID.VF_MODULE_NAME]);
+			setCurrentServiceModelInfoFromScope();
+            $scope.$broadcast(COMPONENT.DELETE_RESUME_COMPONENT, {
+                componentId : COMPONENT.VF_MODULE,
+                callbackFunction : deleteOrResumeCallback,
+                dialogMethod: COMPONENT.RESUME
+            });
+        };
+
+		$scope.deleteConfiguration = function (serviceObject, configuration) {
+            console.log("Deleting Configuration " + configuration.name);
+
+            var serviceInstance = serviceObject.object;
+            var svcModel = $scope.service.convertedModel;
+            var configModel;
+            DataService.setInventoryItem(configuration.object);
+            // set model default and override later if found
+            DataService.setModelInfo(COMPONENT.CONFIGURATION, {});
+
+            if ( configuration.object != null ) {
+
+                //var netModelInvariantUuid = network.object[FIELD.ID.MODEL_INVAR_ID];
+                var configModelVersionId = configuration.object[FIELD.ID.MODEL_VERSION_ID]; // model uuid
+                var configModelCustomizationUuid = configuration.object[FIELD.ID.MODEL_CUSTOMIZATION_ID];
+
+                //configurations added to vnfs list, in order to be part of the "Add VNF" drop-down list
+                if ( (!($scope.isObjectEmpty(svcModel))) && ( !($scope.isObjectEmpty(svcModel.vnfs) ) ) ) {
+                    if ( (svcModel.isNewFlow) && (UtilityService.hasContents(configModelCustomizationUuid) ) ) {
+                        configModel = svcModel.vnfs[configModelCustomizationUuid];
+                    }
+                    else {
+
+                        if ( UtilityService.hasContents(configModelVersionId) ) {
+                            configModel = svcModel.vnfs[configModelVersionId];
+                        }
+
+                    }
+                }
+            }
+            if (!($scope.isObjectEmpty(configModel) ) ) {
+                DataService.setModelInfo(COMPONENT.CONFIGURATION, {
+                    "modelInvariantId": configModel.invariantUuid,
+                    "modelVersion": configModel.version,
+                    "modelNameVersionId": configModel.uuid,
+                    "modelCustomizationName": configModel.modelCustomizationName,
+                    "customizationUuid": configModel.customizationUuid,
+                    "modelName": configModel.name,
+                    "inputs": ""
+                });
+            }
+
+            DataService.setSubscriberName(serviceObject[COMPONENT.SUBSCRIBER_NAME]);
+            DataService.setServiceType(serviceObject[COMPONENT.SERVICE_TYPE]);
+            DataService.setServiceInstanceId(serviceInstance[FIELD.ID.SERVICE_INSTANCE_ID]);
+
+            DataService.setGlobalCustomerId(serviceObject[FIELD.ID.GLOBAL_CUST_ID]);
+            DataService.setServiceInstanceName($scope.service.instance.name);
+            DataService.setServiceName($scope.service.model.service.name);
+            DataService.setServiceUuid($scope.service.model.service.uuid);
+            DataService.setConfigurationInstanceId(configuration.object[FIELD.ID.CONFIGURATION_ID]);
+
+            $scope.$broadcast(COMPONENT.DELETE_COMPONENT, {
+                componentId : COMPONENT.CONFIGURATION,
+                callbackFunction : deleteCallbackFunction
+            });
+        };
+
 		$scope.resetProgress = function() {
 			$scope.percentProgress = 0;
 			$scope.progressClass = FIELD.STYLE.PROGRESS_BAR_INFO;
@@ -1055,7 +1181,35 @@
 		$scope.reloadRoute = function() {
 			$route.reload();
 		}
-		
+
+
+
+           		/*
+		Private metthods
+		 */
+
+		/*
+		setPnf
+		* set the controller pnf param using api call
+		* return: void
+		 */
+        function _setPnf(data){ // data is the $scope.service.instance object
+ 		 return PnfService.getPnfs(data)
+                .then(
+					function success(response){
+						return response.data;
+						// * can add here changes on the data that are needed to the view ( filter, ect..)
+					},
+					function error(error){
+						console.error(error);
+					}
+            	);
+        }
+
+        /*
+        Callbaks functions
+
+         */
 		var updateProvStatusVnfCallbackFunction = function(response) {
 			$scope.callbackResults = "";
 			var color = FIELD.ID.COLOR_NONE;
@@ -1112,7 +1266,7 @@
 			
 		};
 		
-		var deleteCallbackFunction = function(response) {
+		var deleteOrResumeCallback = function(response) {
 			$scope.callbackResults = "";
 			var color = FIELD.ID.COLOR_NONE;
 			$scope.callbackStyle = {
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/controller/ServiceModelController.js b/vid-app-common/src/main/webapp/app/vid/scripts/controller/ServiceModelController.js
index 8844d40..967a390 100755
--- a/vid-app-common/src/main/webapp/app/vid/scripts/controller/ServiceModelController.js
+++ b/vid-app-common/src/main/webapp/app/vid/scripts/controller/ServiceModelController.js
@@ -41,14 +41,13 @@
 				$scope.services = [];
 				if (response.data && angular.isArray(response.data.services)) {
 					wholeData = response.data.services;
-					$scope.services = $scope.filterDataWithHigerVersion(wholeData);
+					$scope.services = $scope.filterDataWithHigherVersion(wholeData);
 					$scope.viewPerPage=10;
 					$scope.totalPage=$scope.services.length/$scope.viewPerPage;
 					$scope.sortBy=COMPONENT.NAME;
 					$scope.scrollViewPerPage=2;
 					$scope.currentPage=1;
 					$scope.searchCategory;
-					$scope.searchString="";
 					$scope.currentPageNum=1;
 					$scope.isSpinnerVisible = false;
 					$scope.isProgressVisible = false;
@@ -61,67 +60,35 @@
 			}, function errorCallback(response) {
 				console.log("Error: " + response);
 			});
-		}
-		$scope.isFiltered=function(arr,obj){
-			var filtered = false;
-			if(arr.length>0){
-				for(var i=0;i<arr.length;i++){
-					if((arr[i].name == obj.name) && (obj.invariantUUID == arr[i].invariantUUID)){
-						filtered = true;
-					}
-				}
-			}
-			return filtered;
-		}
-		var wholeData=[];
-		$scope.filterDataWithHigerVersion = function(serviceData){
-			var fiterDataServices = [];
-			for(var i=0;i<serviceData.length;i++){
-				var higherVersion = serviceData[i];
-				if(!$scope.isFiltered(fiterDataServices,serviceData[i])){
-					for(var j=i;j<serviceData.length;j++){
-						if((serviceData[i].invariantUUID.trim() == serviceData[j].invariantUUID.trim()) && (serviceData[i].name.trim() == serviceData[j].name.trim()) && (parseFloat(serviceData[j].version.trim())>=parseFloat(serviceData[i].version.trim()))){
-							var data = $scope.isThisHigher(fiterDataServices,serviceData[j]);
-							if(data.isHigher){
-								fiterDataServices[data.index] = serviceData[j];
-							}
-						}
-					}
-				}
-			}
-			return fiterDataServices;
-		}
+		};
 
-		$scope.isThisHigher = function(arr,obj){
-			var returnObj = {
-					isHigher:false,
-					index:0
-			};
-			if(arr.length>0){
-				var isNotMatched = true;
-				for(var i=0;i<arr.length;i++){
-					if((arr[i].name == obj.name) && (arr[i].invariantUUID == obj.invariantUUID ) && (arr[i].version<obj.version) ){
-						isNotMatched = false;
-						returnObj = {
-								isHigher:true,
-								index:i
-						};
+		var wholeData=[];
+
+		$scope.filterDataWithHigherVersion = function(serviceData){
+			var delimiter = '$$';
+			var fiterDataServices = {};
+			for(var i=0;i<serviceData.length;i++) {
+				var index = serviceData[i].invariantUUID.trim() + delimiter + serviceData[i].name.trim();
+				if(!fiterDataServices[index]) {
+                    var hasPreviousVersion = false;
+                    fiterDataServices[index] = {
+                        service: serviceData[i],
+                        hasPreviousVersion: false
+                    };
+                }
+                else {
+                    fiterDataServices[index].hasPreviousVersion = true;
+                    if(parseFloat(serviceData[i].version.trim())>parseFloat(fiterDataServices[index].service.version.trim())) {
+                        fiterDataServices[index].service = serviceData[i];
 					}
 				}
-				if(isNotMatched && !$scope.isFiltered(arr,obj)){
-					returnObj = {
-							isHigher:true,
-							index:arr.length
-					};
-				}
-			}else{
-				returnObj = {
-						isHigher:true,
-						index:0
-				}
 			}
-			return returnObj;
-		}
+            return Object.keys(fiterDataServices).map(function(key) {
+            	var service = fiterDataServices[key].service;
+            	service.hasPreviousVersion = fiterDataServices[key].hasPreviousVersion;
+                return  service;
+            });
+		};
 
 		$scope.init = function() {
     		var msecs = PropertyService.retrieveMsoMaxPollingIntervalMsec();
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/controller/ServiceProxyConfigController.js b/vid-app-common/src/main/webapp/app/vid/scripts/controller/ServiceProxyConfigController.js
new file mode 100644
index 0000000..6e7ad50
--- /dev/null
+++ b/vid-app-common/src/main/webapp/app/vid/scripts/controller/ServiceProxyConfigController.js
@@ -0,0 +1,342 @@
+/*-
+* ============LICENSE_START=======================================================
+* VID
+* ================================================================================
+* Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+* ================================================================================
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*      http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+* ============LICENSE_END=========================================================
+*/
+
+/**
+ * The Instantiation (or View/Edit) Controller controls the instantiation/removal of
+ * deployable objects (Services, VNFs, VF-Modules, Networks, and Volume-Groups)
+ */
+
+"use strict";
+
+appDS2.controller("ServiceProxyConfigController", ["COMPONENT", "$log", "FIELD", "PARAMETER", "DataService", "CreationService", "$scope", "$window", "$location", "AaiService", "$uibModal", "UtilityService", "$timeout",
+    function (COMPONENT, $log, FIELD, PARAMETER, DataService, CreationService, $scope, $window, $location, AaiService, $uibModal, UtilityService, $timeout) {
+
+        $scope.selectedMetadata = {};
+
+        $scope.serviceMetadataFields = [];
+        $scope.nodeTemplateFields = {};
+
+        $scope.configurationByPolicy = DataService.getConfigurationByPolicy();
+
+        $scope.collectorType = $scope.configurationByPolicy ? 'pnf' : 'vnf'; //default
+        $scope.collectorInstance;
+        $scope.collectorInstanceName = "";
+        $scope.collectorInstanceList = null;
+        $scope.collectorMetadata = [];
+        $scope.collectorNoResults = false;
+
+        $scope.sourceInstance;
+        $scope.sourceInstanceName = "";
+        $scope.sourceInstanceList = null;
+        $scope.sourceMetadata = [];
+        $scope.sourceNoResults = false;
+
+        $scope.errorMsg = FIELD.ERROR.INSTANCE_NAME_VALIDATE;
+
+        $scope.modelName = DataService.getModelInfo(COMPONENT.VNF).modelCustomizationName;
+
+        $scope.serviceTypes = [];
+
+        function init() {
+            loadServiceTypes();
+
+            generateMetadata(sourceServiceProxy);
+            generateMetadata(collectorServiceProxy);
+
+        }
+
+        function setDefaultCollectorServiceType() {
+            const configServiceType = DataService.getServiceType();
+            $scope.collectorServiceType = mustFind($scope.serviceTypes, {"service-type": configServiceType});
+            loadCollectorProxies();
+        }
+
+        function handleGetServiceTypesResponse(response) {
+            $scope.serviceTypes = response.data;
+            setDefaultCollectorServiceType();
+        }
+
+        var handleGetParametersResponse = function(parameters) {
+            $scope.serviceMetadataFields = parameters.summaryList;
+            $scope.nodeTemplateFields =  DataService.getPortMirroningConfigFields();
+        };
+
+        var mustFind = function (collection, predicate) {
+            const result = _.find(collection, predicate);
+            const description = "result for find " + JSON.stringify(predicate);
+            UtilityService.checkUndefined(description, result);
+            $log.debug(description, result);
+            return result;
+        };
+
+
+        $scope.back = function()  {
+            $window.history.back();
+        };
+
+
+        function loadServiceTypes() {
+            const subscriberId = DataService.getGlobalCustomerId();
+            AaiService.getSubscriberServiceTypes(subscriberId)
+                .then(handleGetServiceTypesResponse)
+                .catch(function (error) {
+                    $log.error(error);
+                });
+        }
+
+        var modalInstance;
+
+        $scope.create = function()  {
+            $scope.disableCreate= true;
+            var portMirroringConfigFields = DataService.getPortMirroningConfigFields();
+            portMirroringConfigFields.sourceInstance = mustFind($scope.sourceInstanceList, {'id': $scope.sourceInstance});
+            portMirroringConfigFields.destinationInstance = mustFind($scope.collectorInstanceList, {'id': $scope.collectorInstance});
+
+            var selectedVnfsList;
+
+            if ($scope.configurationByPolicy) {
+                selectedVnfsList = [
+                    portMirroringConfigFields.sourceInstance.properties
+                ];
+            } else {
+                selectedVnfsList = [
+                    portMirroringConfigFields.sourceInstance.properties,
+                    portMirroringConfigFields.destinationInstance.properties
+                ];
+            }
+
+            AaiService.getVnfVersionsByInvariantId(
+                selectedVnfsList.map(function(x) {
+                    return UtilityService.checkUndefined("model-invariant-id", x['model-invariant-id']);
+                })
+                )
+                .then(function (response) {
+                    $log.debug("getVnfVersionsByInvariantId: response", response);
+
+                    selectedVnfsList
+                        .map(function (inOutProperties) {
+                            const model = mustFind(response.data.model, {'model-invariant-id': inOutProperties['model-invariant-id']});
+
+                            const modelVer = mustFind(model["model-vers"]["model-ver"], {'model-version-id': inOutProperties['model-version-id']});
+
+                            inOutProperties['model-version'] = modelVer['model-version'];
+                            inOutProperties['model-name'] = modelVer['model-name'];
+                            UtilityService.checkUndefined("model-version", modelVer);
+                        });
+                })
+
+                .then(function () {
+                    var requestParams = {
+                        configurationModelInfo: DataService.getModelInfo(COMPONENT.VNF),
+                        relatedTopModelsInfo: DataService.getModelInfo(COMPONENT.SERVICE),
+                        portMirroringConfigFields:portMirroringConfigFields,
+                        attuuid: DataService.getLoggedInUserId(),
+                        topServiceInstanceId: DataService.getServiceInstanceId(),
+                        configurationByPolicy: $scope.configurationByPolicy,
+                        callbackFunction: updateViewCallbackFunction
+                    };
+
+                    modalInstance = $uibModal.open({
+                        templateUrl: 'app/vid/scripts/modals/mso-commit/mso-commit.html',
+                        controller : "msoCommitModalController",
+                        backdrop: true,
+                        resolve: {
+                            msoType: function () {
+                                return COMPONENT.MSO_CREATE_REQ;
+                            },
+                            requestParams: function () {
+                                return requestParams;
+                            }
+                        }
+                    });
+                })
+                .catch(function (error) {
+                    $log.error("error while configuration create", error);
+                    $scope.disableCreate= false;
+                });
+        };
+
+        $scope.openMetadataModal = function(name) {
+            $scope.selectedMetadata = $scope[name];
+            modalInstance = $uibModal.open({
+                templateUrl: 'app/vid/scripts/modals/service-metadata/service-metadata.html',
+                backdrop: false,
+                scope : $scope,
+                resolve: {
+                }
+            });
+        };
+
+        $scope.cancel = function()  {
+            modalInstance.dismiss('cancel');
+        };
+
+        var updateViewCallbackFunction = function(response) {
+            $scope.callbackResults = "";
+            var color = FIELD.ID.COLOR_NONE;
+            $scope.callbackStyle = {
+                "background-color" : color
+            };
+
+            /*
+             * This 1/2 delay was only added to visually highlight the status
+             * change. Probably not needed in the real application code.
+             */
+            $timeout(function() {
+                $scope.callbackResults = UtilityService.getCurrentTime()
+                    + FIELD.STATUS.IS_SUCCESSFUL + response.isSuccessful;
+                if (response.isSuccessful) {
+                    color = FIELD.ID.COLOR_8F8;
+                    $window.history.go(-2);
+                } else {
+                    $scope.disableCreate=false;
+                    color = FIELD.ID.COLOR_F88;
+                }
+                $scope.callbackStyle = {
+                    "background-color" : color
+                };
+            }, 500);
+        };
+
+        CreationService.initializeComponent(COMPONENT.VNF);
+        CreationService.initializeComponent(COMPONENT.SERVICE);
+        CreationService.getParameters(handleGetParametersResponse);
+
+        var sourceServiceProxies = DataService.getSourceServiceProxies();
+        var collectorServiceProxies = DataService.getCollectorServiceProxies();
+        var serviceProxiesList = DataService.getServiceProxies();
+
+        var sourceServiceProxy = {
+            serviceList: sourceServiceProxies,
+            instanceListScopePropertyName: "sourceInstanceList",
+            name: "sourceInstanceName",
+            metadata: "sourceMetadata",
+            noResults: "sourceNoResults"
+        };
+
+        var collectorServiceProxy = {
+            serviceList: collectorServiceProxies,
+            instanceListScopePropertyName: "collectorInstanceList",
+            name: "collectorInstanceName",
+            metadata: "collectorMetadata",
+            noResults: "collectorNoResults"
+        };
+
+        $scope.onSourceServiceTypeSelected = function() {
+            clearSourceProxySelection();
+            loadSourceProxies();
+        };
+
+        $scope.onCollectorServiceTypeSelected = function() {
+            clearCollectorProxySelection();
+            loadCollectorProxies();
+        };
+
+        function clearSourceProxySelection() {
+            $scope.sourceInstance = undefined;
+        }
+
+        function clearCollectorProxySelection() {
+            $scope.collectorInstance = undefined;
+        }
+
+        function loadSourceProxies() {
+            var serviceProxy = serviceProxiesList[(sourceServiceProxy.serviceList)[0]];
+            var selectedServiceType = $scope.sourceServiceType['service-type'];
+            loadProxyInstances(sourceServiceProxy, selectedServiceType, serviceProxy);
+        }
+
+        function loadCollectorProxies() {
+            var serviceProxy = serviceProxiesList[(collectorServiceProxy.serviceList)[0]];
+            var selectedServiceType = $scope.collectorServiceType['service-type'];
+            loadProxyInstances(collectorServiceProxy, selectedServiceType, serviceProxy);
+        }
+
+        function loadProxyInstances(service, serviceType, serviceProxy) {
+            $scope[service.instanceListScopePropertyName] = null;
+            // $scope.collectorType = $scope.configurationByPolicy ? 'pnf' : 'vnf';
+            var configNodeTemplateFields = DataService.getPortMirroningConfigFields();
+            if (service.name == "collectorInstanceName" && $scope.configurationByPolicy) {
+                var configurationModel = DataService.getModelInfo(COMPONENT.VNF);
+                AaiService.getPnfInstancesList(
+                    DataService.getGlobalCustomerId(),
+                    serviceType,
+                    serviceProxy.sourceModelUuid,
+                    serviceProxy.sourceModelInvariant,
+                    configNodeTemplateFields.lcpRegion.value,
+                    configurationModel.properties.equip_vendor,
+                    configurationModel.properties.equip_model
+                )
+                    .then(function (response) {
+                        var results = response.results || [];
+                        $scope[service.instanceListScopePropertyName] = results;
+                        $scope[service.noResults] = (results.length === 0);
+                    })
+                    .catch(function (error) {
+                        $scope[service.noResults] = true;
+                        $log.error("No pnf instance found for " + service.name, error);
+                    });
+            } else {
+                AaiService.getVnfInstancesList(
+                    DataService.getGlobalCustomerId(),
+                    serviceType,
+                    serviceProxy.sourceModelUuid,
+                    serviceProxy.sourceModelInvariant,
+                    configNodeTemplateFields.lcpRegion.value
+                )
+                    .then(function (response) {
+                        var results = response.results || [];
+                        $scope[service.instanceListScopePropertyName] = results;
+                        $scope[service.noResults] = (results.length === 0);
+                    })
+                    .catch(function (error) {
+                        $scope[service.noResults] = true;
+                        $log.error("No vnf instance found for " + service.name, error);
+                    });
+            }
+        }
+
+        function generateMetadata(service) {
+            const serviceProxy = serviceProxiesList[(service.serviceList)[0]];
+            $scope[service.name] = serviceProxy.name;
+
+            $scope[service.metadata] = [
+                {"name" :"Name" ,"value" : serviceProxy.name},
+                {"name" :"Version",value : serviceProxy.version},
+                {"name" :"Description", value : serviceProxy.description},
+                {"name" :"Type", value : serviceProxy.type},
+                {"name" :"Invariant UUID", value : serviceProxy.invariantUuid},
+                {"name" :"UUID", value : serviceProxy.uuid},
+                {"name" :"Customization UUID", value : serviceProxy.customizationUuid},
+                {"name" :"Source Model Uuid", value : serviceProxy.sourceModelUuid},
+                {"name" :"Source Model Invariant", value : serviceProxy.sourceModelInvariant},
+                {"name" :"Source Model Name", value : serviceProxy.sourceModelName}
+            ];
+        }
+
+        init();
+        $scope.$on('$routeChangeStart', function (event, next, current) {
+            if(next.$$route.originalPath!=="/addNetworkNode"){
+                DataService.setPortMirroningConfigFields(null);
+            }
+        });
+    }]);
+
+
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/controller/VidApp.js b/vid-app-common/src/main/webapp/app/vid/scripts/controller/VidApp.js
index b611def..6129fd9 100755
--- a/vid-app-common/src/main/webapp/app/vid/scripts/controller/VidApp.js
+++ b/vid-app-common/src/main/webapp/app/vid/scripts/controller/VidApp.js
@@ -20,7 +20,7 @@
 
 (function () {
   'use strict';
-  
+
   appDS2.config(['$routeProvider', '$locationProvider', function ($routeProvider) {
       $routeProvider
         .when('/models/services', {
@@ -32,30 +32,47 @@
           templateUrl: 'app/vid/scripts/view-models/createInstanceServiceModels.htm'
         })
         .when('/instances/services', {
-    		templateUrl : "app/vid/scripts/view-models/aaiGetSubs.htm", 
+    		templateUrl : "app/vid/scripts/view-models/aaiGetSubs.htm",
     		controller : "aaiSubscriberController"
         })
         .when('/instances/subscribers', {
-    		templateUrl : "app/vid/scripts/view-models/aaiGetSubscriberList.htm", 
+    		templateUrl : "app/vid/scripts/view-models/aaiGetSubscriberList.htm",
     		controller : "aaiSubscriberController"
         })
         .when('/instances/serviceTypes', {
-    		templateUrl : "app/vid/scripts/view-models/aaiServiceTypes.htm", 
+    		templateUrl : "app/vid/scripts/view-models/aaiServiceTypes.htm",
     		controller : "aaiSubscriberController"
         })
         .when('/instances/subdetails', {
-    		templateUrl : "app/vid/scripts/view-models/aaiSubDetails.htm", 
+    		templateUrl : "app/vid/scripts/view-models/aaiSubDetails.htm",
     		controller : "aaiSubscriberController"
         })
 	  	.when('/change-management', {
               templateUrl : "app/vid/scripts/view-models/change-management.html",
               controller : "changeManagementController",
 			  controllerAs: 'vm'
-          })
+		})
+		.when('/testEnvironments', {
+              templateUrl : "app/vid/scripts/view-models/testEnvironments.htm",
+              controller : "testEnvironmentsController",
+              controllerAs: 'vm'
+		})
         .when('/instantiate', {
           controller: 'InstantiationController',
           templateUrl: 'app/vid/scripts/view-models/instantiate.htm'
         })
+	    .when('/addNetworkNode', {
+		  controller: 'AddNetworkNodeController',
+		  templateUrl: 'app/vid/scripts/view-models/addNetworkNode.htm'
+		})
+        .when('/pnfSearchAssociation', {
+			controller: 'pnfSearchAssociationController',
+			templateUrl: 'app/vid/scripts/view-models/pnfSearchAssociation.htm'
+         })
+	    .when('/serviceProxyConfig', {
+		  controller: 'ServiceProxyConfigController',
+		  templateUrl: 'app/vid/scripts/view-models/serviceProxyConfig.htm'
+	    })
         .otherwise({
         	redirectTo: '/models/services'
         });
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/controller/aaiSubscriberController.js b/vid-app-common/src/main/webapp/app/vid/scripts/controller/aaiSubscriberController.js
index a86c1b1..d58b83f 100755
--- a/vid-app-common/src/main/webapp/app/vid/scripts/controller/aaiSubscriberController.js
+++ b/vid-app-common/src/main/webapp/app/vid/scripts/controller/aaiSubscriberController.js
@@ -20,8 +20,8 @@
 
 "use strict";
 
-appDS2.controller("aaiSubscriberController", ["COMPONENT", "FIELD", "PARAMETER", "DataService", "PropertyService", "$scope", "$http", "$timeout", "$location", "$log", "$route", "VIDCONFIGURATION", "UtilityService", "vidService", "AaiService", "MsoService",
-    function (COMPONENT, FIELD, PARAMETER, DataService, PropertyService, $scope, $http, $timeout, $location, $log, $route, VIDCONFIGURATION, UtilityService, vidService, AaiService, MsoService) {
+appDS2.controller("aaiSubscriberController", ["COMPONENT", "FIELD", "PARAMETER", "DataService", "PropertyService", "$scope", "$http", "$timeout", "$location", "$log", "$route", "$uibModal", "VIDCONFIGURATION", "UtilityService", "vidService", "AaiService", "MsoService", "OwningEntityService", "$q",
+    function (COMPONENT, FIELD, PARAMETER, DataService, PropertyService, $scope, $http, $timeout, $location, $log, $route, $uibModal, VIDCONFIGURATION, UtilityService, vidService, AaiService, MsoService, OwningEntityService, $q) {
 
         $scope.showVnfDetails = function (vnf) {
             console.log("showVnfDetails");
@@ -121,253 +121,215 @@
 
             DataService.setSubscribers($scope.custSubList);
 
-			if (selectedServicetype !== "" && selectedServicetype !== 'undefined') {
-				$location.path(COMPONENT.CREATE_INSTANCE_PATH);
-			}			
-		};
-		
-		$scope.serviceTypeName="";
-		$scope.getAaiServiceModelsList = function(){
-			var globalCustomerId="";
-             var serviceTypeId = DataService.getGlobalCustomerId();			
-			$scope.serviceTypeList = DataService.getServiceIdList();
-			$scope.createSubscriberName = DataService.getSubscriberName();
-			$scope.status = FIELD.STATUS.FETCHING_SERVICE_CATALOG;
-			$scope.custSubList = DataService.getSubscribers();
-			for(var i=0; i<$scope.serviceTypeList.length;i++){
-						if(parseInt(serviceTypeId) === i ){
-							$scope.serviceTypeName = $scope.serviceTypeList[i].name;
+            if (selectedServicetype !== "" && selectedServicetype !== 'undefined'&& selectedServicetype !== undefined) {
+                $location.path(COMPONENT.CREATE_INSTANCE_PATH);
+            }
+        };
+
+        $scope.serviceTypeName = "";
+        $scope.getAaiServiceModelsList = function () {
+            var globalCustomerId = "";
+            var serviceTypeId = DataService.getGlobalCustomerId();
+            $scope.serviceTypeList = DataService.getServiceIdList();
+            $scope.createSubscriberName = DataService.getSubscriberName();
+            $scope.status = FIELD.STATUS.FETCHING_SERVICE_CATALOG;
+            $scope.custSubList = DataService.getSubscribers();
+            for (var i = 0; i < $scope.serviceTypeList.length; i++) {
+                if (parseInt(serviceTypeId) === i) {
+                    $scope.serviceTypeName = $scope.serviceTypeList[i].name;
                 }
-						}
-					;
-		    for(var i=0; i<$scope.custSubList.length;i++){
-						if($scope.createSubscriberName === $scope.custSubList[i].subscriberName){
-							globalCustomerId = $scope.custSubList[i].globalCustomerId;
-							globalCustId = globalCustomerId;
-						}
-					}
-			;
-			var pathQuery ="";
+            }
+            ;
+            for (var i = 0; i < $scope.custSubList.length; i++) {
+                if ($scope.createSubscriberName === $scope.custSubList[i].subscriberName) {
+                    globalCustomerId = $scope.custSubList[i].globalCustomerId;
+                    globalCustId = globalCustomerId;
+                }
+            }
+            ;
+            var pathQuery = "";
 
-			if(null !== globalCustomerId && "" !== globalCustomerId && undefined !== globalCustomerId
-					&& null !== serviceTypeId && "" !== serviceTypeId && undefined !== serviceTypeId){
-				pathQuery = COMPONENT.SERVICES_PATH +globalCustomerId+"/"+$scope.serviceTypeName;
-			}
+            if (null !== globalCustomerId && "" !== globalCustomerId && undefined !== globalCustomerId
+                && null !== serviceTypeId && "" !== serviceTypeId && undefined !== serviceTypeId) {
+                pathQuery = COMPONENT.SERVICES_PATH + globalCustomerId + "/" + $scope.serviceTypeName;
+            }
 
-			var namedQueryId='6e806bc2-8f9b-4534-bb68-be91267ff6c8';
-			AaiService.getServiceModelsByServiceType(namedQueryId,globalCustomerId,$scope.serviceTypeName,function(response) { // success
-				$scope.services = [];
-				if (angular.isArray(response.data['inventory-response-item']) && response.data['inventory-response-item'].length > 0 && response.data['inventory-response-item'][0]['inventory-response-items']) {
-					wholeData = response.data['inventory-response-item'][0]['inventory-response-items']['inventory-response-item'];
-					$scope.services = $scope.filterDataWithHigerVersion(response.data['inventory-response-item'][0]['inventory-response-items']['inventory-response-item']);
-					$scope.serviceType = response.data['inventory-response-item'][0]['service-subscription']['service-type'];
-					$scope.viewPerPage=10;
-					$scope.totalPage=$scope.services.length/$scope.viewPerPage;
-					$scope.sortBy="name";
-					$scope.scrollViewPerPage=2;
-					$scope.currentPage=1;
-					$scope.searchCategory;
-					$scope.searchString="";
-					$scope.currentPageNum=1;
-					$scope.isSpinnerVisible = false;
-					$scope.isProgressVisible = false;
-				} else {
-					$scope.status = "Failed to get service models from A&AI.";
-					$scope.error = true;
-					$scope.isSpinnerVisible = false;
-				}
-				DataService.setServiceIdList(response);
-			},  function(response) { // failure
-				$scope.showError(FIELD.ERROR.AAI);
-				$scope.errorMsg = FIELD.ERROR.FETCHING_SERVICES+ response.status;
-				$scope.errorDetails = response.data;
-			});
+            var namedQueryId = '6e806bc2-8f9b-4534-bb68-be91267ff6c8';
+            AaiService.getServiceModelsByServiceType(namedQueryId, globalCustomerId, $scope.serviceTypeName, function (response) { // success
+                $scope.services = [];
+                if (angular.isArray(response.data['inventory-response-item']) && response.data['inventory-response-item'].length > 0 && response.data['inventory-response-item'][0]['inventory-response-items']) {
+                    wholeData = response.data['inventory-response-item'][0]['inventory-response-items']['inventory-response-item'];
+                    $scope.services = $scope.filterDataWithHigerVersion(response.data['inventory-response-item'][0]['inventory-response-items']['inventory-response-item']);
+                    $scope.serviceType = response.data['inventory-response-item'][0]['service-subscription']['service-type'];
+                    $scope.viewPerPage = 10;
+                    $scope.totalPage = $scope.services.length / $scope.viewPerPage;
+                    $scope.sortBy = "name";
+                    $scope.scrollViewPerPage = 2;
+                    $scope.currentPage = 1;
+                    $scope.searchCategory;
+                    $scope.searchString = "";
+                    $scope.currentPageNum = 1;
+                    $scope.isSpinnerVisible = false;
+                    $scope.isProgressVisible = false;
+                } else {
+                    $scope.status = "Failed to get service models from ASDC.";
+                    $scope.error = true;
+                    $scope.isSpinnerVisible = false;
+                }
+                DataService.setServiceIdList(response);
+            }, function (response) { // failure
+                $scope.showError(FIELD.ERROR.AAI);
+                $scope.errorMsg = FIELD.ERROR.FETCHING_SERVICES + response.status;
+                $scope.errorDetails = response.data;
+            });
 
-			};
+        };
 
-			var globalCustId;// This value will be assigned only on create new service instance screen-macro
-			$scope.createType = "a la carte";
-		$scope.deployService = function(service,hideServiceFields) {
-			hideServiceFields = hideServiceFields|| false;
-			var temp = service;
-			service.uuid = service['service-instance']['model-version-id'];
+        var globalCustId;// This value will be assigned only on create new service instance screen-macro
+        $scope.createType = "a la carte";
+        $scope.deployService = function (service, hideServiceFields) {
+            hideServiceFields = hideServiceFields || false;
+            var temp = service;
+            service.uuid = service['service-instance']['model-version-id'];
 
-			console.log("Instantiating ASDC service " + service.uuid);
+            console.log("Instantiating ASDC service " + service.uuid);
 
-			$http.get('rest/models/services/' + service.uuid)
-				.then(function successCallback(getServiceResponse) {
-					getServiceResponse.data['service'].serviceTypeName =$scope.serviceTypeName ;
-					getServiceResponse.data['service'].createSubscriberName =$scope.createSubscriberName ;
-					var serviceModel = getServiceResponse.data;
-					DataService.setServiceName(serviceModel.service.name);
+            $http.get('rest/models/services/' + service.uuid)
+                .then(function successCallback(getServiceResponse) {
+                    getServiceResponse.data['service'].serviceTypeName = $scope.serviceTypeName;
+                    getServiceResponse.data['service'].createSubscriberName = $scope.createSubscriberName;
+                    var serviceModel = getServiceResponse.data;
+                    DataService.setServiceName(serviceModel.service.name);
 
-					DataService.setModelInfo(COMPONENT.SERVICE, {
-						"modelInvariantId": serviceModel.service.invariantUuid,
-						"modelVersion": serviceModel.service.version,
-						"modelNameVersionId": serviceModel.service.uuid,
-						"modelName": serviceModel.service.name,
-						"description": serviceModel.service.description,"serviceType": serviceModel.service.serviceType,
+                    DataService.setModelInfo(COMPONENT.SERVICE, {
+                        "modelInvariantId": serviceModel.service.invariantUuid,
+                        "modelVersion": serviceModel.service.version,
+                        "modelNameVersionId": serviceModel.service.uuid,
+                        "modelName": serviceModel.service.name,
+                        "description": serviceModel.service.description,
+                        "serviceType": serviceModel.service.serviceType,
                         "serviceRole": serviceModel.service.serviceRole,
-						"category":serviceModel.service.category,
-						"serviceTypeName":serviceModel.service.serviceTypeName,
-						"createSubscriberName":serviceModel.service.createSubscriberName
-					});
-					DataService.setHideServiceFields(hideServiceFields);
-					if(hideServiceFields){
-						DataService.setServiceType($scope.serviceTypeName);
-						DataService.setGlobalCustomerId(globalCustId);
-					}
+                        "category": serviceModel.service.category,
+                        "serviceTypeName": serviceModel.service.serviceTypeName,
+                        "createSubscriberName": serviceModel.service.createSubscriberName
+                    });
+                    DataService.setHideServiceFields(hideServiceFields);
+                    if (hideServiceFields) {
+                        DataService.setServiceType($scope.serviceTypeName);
+                        DataService.setGlobalCustomerId(globalCustId);
+                    }
 
-					DataService.setALaCarte (true);
-					$scope.createType = "a la carte";
-					var broadcastType = "createComponent";
-					
-					if (UtilityService.arrayContains (VIDCONFIGURATION.MACRO_SERVICES, serviceModel.service.invariantUuid )) {
-						DataService.setALaCarte (false);
-						$scope.createType = "Macro";
-						var convertedAsdcModel = UtilityService.convertModel(serviceModel);
-						
-						//console.log ("display inputs "); 
-						//console.log (JSON.stringify ( convertedAsdcModel.completeDisplayInputs));
-						
-						DataService.setModelInfo(COMPONENT.SERVICE, {
-							"modelInvariantId": serviceModel.service.invariantUuid,
-							"modelVersion": serviceModel.service.version,
-							"modelNameVersionId": serviceModel.service.uuid,
-							"modelName": serviceModel.service.name,
-							"description": serviceModel.service.description,
-							"category":serviceModel.service.category,
-							"serviceEcompNaming": serviceModel.service.serviceEcompNaming,
-							"inputs": serviceModel.service.inputs,
-							"displayInputs": convertedAsdcModel.completeDisplayInputs,
-							"serviceTypeName":serviceModel.service.serviceTypeName,
-							"createSubscriberName":serviceModel.service.createSubscriberName,
-						"serviceType": serviceModel.service.serviceType,
+                    DataService.setALaCarte(true);
+                    $scope.createType = "a la carte";
+                    var broadcastType = "createComponent";
+
+                    if (UtilityService.arrayContains(VIDCONFIGURATION.MACRO_SERVICES, serviceModel.service.invariantUuid)) {
+                        DataService.setALaCarte(false);
+                        $scope.createType = "Macro";
+                        var convertedAsdcModel = UtilityService.convertModel(serviceModel);
+
+                        //console.log ("display inputs ");
+                        //console.log (JSON.stringify ( convertedAsdcModel.completeDisplayInputs));
+
+                        DataService.setModelInfo(COMPONENT.SERVICE, {
+                            "modelInvariantId": serviceModel.service.invariantUuid,
+                            "modelVersion": serviceModel.service.version,
+                            "modelNameVersionId": serviceModel.service.uuid,
+                            "modelName": serviceModel.service.name,
+                            "description": serviceModel.service.description,
+                            "category": serviceModel.service.category,
+                            "serviceEcompNaming": serviceModel.service.serviceEcompNaming,
+                            "inputs": serviceModel.service.inputs,
+                            "displayInputs": convertedAsdcModel.completeDisplayInputs,
+                            "serviceTypeName": serviceModel.service.serviceTypeName,
+                            "createSubscriberName": serviceModel.service.createSubscriberName,
+                            "serviceType": serviceModel.service.serviceType,
                             "serviceRole": serviceModel.service.serviceRole
-                        });}
-					;
+                        });
+                    }
+                    ;
 
-					$scope.$broadcast(broadcastType, {
-					    componentId : COMPONENT.SERVICE,
-					    callbackFunction : function(response) {
-					    	if (response.isSuccessful) {
-								vidService.setModel(serviceModel);
+                    $scope.$broadcast(broadcastType, {
+                        componentId: COMPONENT.SERVICE,
+                        callbackFunction: function (response) {
+                            if (response.isSuccessful) {
+                                vidService.setModel(serviceModel);
 
-								var subscriberId = "Not Found";
-								var serviceType = "Not Found";
+                                var subscriberId = "Not Found";
+                                var serviceType = "Not Found";
 
-								var serviceInstanceId = response.instanceId;
+                                var serviceInstanceId = response.instanceId;
 
-								for (var i = 0; i < response.control.length; i++) {
-									if (response.control[i].id == "subscriberName") {
-										subscriberId = response.control[i].value;
-									} else if (response.control[i].id == "serviceType") {
-										serviceType = response.control[i].value;
-									}
-								}
+                                for (var i = 0; i < response.control.length; i++) {
+                                    if (response.control[i].id == "subscriberName") {
+                                        subscriberId = response.control[i].value;
+                                    } else if (response.control[i].id == "serviceType") {
+                                        serviceType = response.control[i].value;
+                                    }
+                                }
 
 
-								$scope.refreshSubs(subscriberId,serviceType,serviceInstanceId);
+                                $scope.refreshSubs(subscriberId, serviceType, serviceInstanceId);
 
-					    	}
-					    }
-					});
+                            }
+                        }
+                    });
 
-				}, function errorCallback(response) {
-					console.log("Error: " + response);
-				});
-		};
-		$scope.isFiltered=function(arr,obj){
-			var filtered = false;
-			if(arr.length>0){
-				for(var i=0;i<arr.length;i++){
-					if(obj['extra-properties']['extra-property'] && (obj['extra-properties']['extra-property'][2]['property-value'] == arr[i]['extra-properties']['extra-property'][2]['property-value'])
-							&& (obj['extra-properties']['extra-property'][4]['property-value'] == arr[i]['extra-properties']['extra-property'][4]['property-value'])){
-						filtered = true;
-					}
-				}
-			}
-			return filtered;
-		}
-		var wholeData=[];
-		$scope.filterDataWithHigerVersion = function(serviceData){
-			var fiterDataServices = [];
-			for(var i=0;i<serviceData.length;i++){
-				var higherVersion = serviceData[i];
-				if(!$scope.isFiltered(fiterDataServices,serviceData[i])){
-					for(var j=i;j<serviceData.length;j++){
-						if(serviceData[i]['extra-properties']['extra-property'] && serviceData[j]['extra-properties']['extra-property'] && (serviceData[i]['extra-properties']['extra-property'][4]['property-value'] == serviceData[j]['extra-properties']['extra-property'][4]['property-value'])
-								&& (serviceData[i]['extra-properties']['extra-property'][2]['property-value'] == serviceData[j]['extra-properties']['extra-property'][2]['property-value'])
-								&& (parseFloat(serviceData[j]['extra-properties']['extra-property'][6]['property-value'])>=parseFloat(serviceData[i]['extra-properties']['extra-property'][6]['property-value']))){
-							var data = $scope.isThisHigher(fiterDataServices,serviceData[j]);
-							if(data.isHigher){
-								fiterDataServices[data.index] = serviceData[j];
-							}
-						}
-					}
-				}
-			}
-			return fiterDataServices;
-		}
+                }, function errorCallback(response) {
+                    $log.error("Error: ", response);
+                });
+        };
 
-		$scope.isThisHigher = function(arr,obj){
-			var returnObj = {
-					isHigher:false,
-					index:0
-			};
-			if(arr.length>0){
-				var isNotMatched = true;
-				for(var i=0;i<arr.length;i++){
-					if(arr[i]['extra-properties']['extra-property'] && (arr[i]['extra-properties']['extra-property'][2]['property-value'] == obj['extra-properties']['extra-property'][2]['property-value'])
-							&& (arr[i]['extra-properties']['extra-property'][4]['property-value'] == obj['extra-properties']['extra-property'][4]['property-value'] )
-							&& (arr[i]['extra-properties']['extra-property'][6]['property-value'] < obj['extra-properties']['extra-property'][6]['property-value']) ){
-						isNotMatched = false;
-						returnObj = {
-								isHigher:true,
-								index:i
-						};
-					}
-				}
-				if(isNotMatched && !$scope.isFiltered(arr,obj)){
-					returnObj = {
-							isHigher:true,
-							index:arr.length
-					};
-				}
-			}else{
-				returnObj = {
-						isHigher:true,
-						index:0
-				}
-			}
-			return returnObj;
-		}
+        var wholeData=[];
+        //extract all models from service instances properties and filter by the higher model version
+        $scope.filterDataWithHigerVersion = function(serviceData){
 
-		$scope.tableData=[];
-		var oldData=[];
-		$scope.loadPreviousVersionData=function(version,invariantUUID){
-			$scope.tableData =[];
-			oldData=[];
-			for(var i=0;i<wholeData.length;i++){
-				if(wholeData[i]['extra-properties']['extra-property'] && wholeData[i]['extra-properties']['extra-property'][4]['property-value'] == invariantUUID  && version!=wholeData[i]['extra-properties']['extra-property'][6]['property-value']){
-					oldData.push(wholeData[i]);
-				}
-			}
-			$scope.tableData = oldData;
-			$scope.createType = "Previous Version";
-			var broadcastType = "createTableComponent";
-			$scope.componentName = invariantUUID;
-			$scope.$broadcast(broadcastType, {
-			    componentId : COMPONENT.OLDVERSION,
-			    callbackFunction : function(response) {
-			    }
-			});
-		}
-		 $scope.cancelCreateSIType = function(){
-		 		
-				window.location.href = COMPONENT.SERVICE_MODLES_INSTANCES_SUBSCRIBERS_PATH;
-				
-			}
+            //get all service instances & models collected into array. key = model invariant id
+            var servicesByModelInvariant = _.reduce(serviceData, function(result, item) {
+                if (item['extra-properties']['extra-property']) {
+                    var invariantId = item['extra-properties']['extra-property'][4];
+                    if (invariantId) {
+                        (result[invariantId["property-value"]] || (result[invariantId["property-value"]] = [])).push(item);
+                    }
+                }
+                return result;
+            }, {});
+
+            //iterate over the array and get the highest model version for each group of services
+            var filterDataServicesByVersion = [];
+            _.forEach(servicesByModelInvariant, function(items) {
+                var maxVersionItem = _.maxBy(items, function(item) { return parseFloat(item['extra-properties']['extra-property'][6]["property-value"]); });
+                filterDataServicesByVersion.push(maxVersionItem);
+            });
+
+            return filterDataServicesByVersion;
+        };
+
+        $scope.tableData = [];
+        var oldData = [];
+        $scope.loadPreviousVersionData = function (version, invariantUUID) {
+            $scope.tableData = [];
+            oldData = [];
+            for (var i = 0; i < wholeData.length; i++) {
+                if (wholeData[i]['extra-properties']['extra-property'] && wholeData[i]['extra-properties']['extra-property'][4]['property-value'] == invariantUUID && version != wholeData[i]['extra-properties']['extra-property'][6]['property-value']) {
+                    oldData.push(wholeData[i]);
+                }
+            }
+            $scope.tableData = oldData;
+            $scope.createType = "Previous Version";
+            var broadcastType = "createTableComponent";
+            $scope.componentName = invariantUUID;
+            $scope.$broadcast(broadcastType, {
+                componentId: COMPONENT.OLDVERSION,
+                callbackFunction: function (response) {
+                }
+            });
+        }
+        $scope.cancelCreateSIType = function () {
+
+            window.location.href = COMPONENT.SERVICE_MODLES_INSTANCES_SUBSCRIBERS_PATH;
+
+        }
 
         $scope.fetchServices = function () {
             var serviceIdList = [];
@@ -379,7 +341,7 @@
                 $scope.errorMsg = FIELD.ERROR.FETCHING_SERVICES + response.status;
                 $scope.errorDetails = response.data;
             });
-        }
+        };
 
         $scope.refreshSubs = function () {
             $scope.init();
@@ -387,10 +349,20 @@
             $scope.fetchServices();
         };
 
+        $scope.loadOwningEntity = function () {
+            OwningEntityService.getOwningEntityProperties(function (response) {
+                $scope.owningEntities = response.owningEntity;
+                $scope.projects = response.project;
+
+                // working project name: owning-entity-id-val-cp8128
+                // working owning entity name: owning-entity-id-val-cp8128
+            });
+        };
+
         $scope.fetchSubs = function (status) {
             $scope.status = status;
 
-            AaiService.getSubList(function (response) { // sucesss
+            AaiService.getSubList(function (response) {
                 $scope.setProgress(100); // done
                 $scope.status = FIELD.STATUS.DONE;
                 $scope.isSpinnerVisible = false;
@@ -408,16 +380,23 @@
         }
 
 
-        $scope.getSubDetails = function (request) {
+        $scope.getSubDetails = function () {
 
             $scope.init();
-            $scope.selectedSubscriber = $location.search().selectedSubscriber;
-            $scope.selectedServiceInstance = $location.search().selectedServiceInstance;
+            //$scope.selectedSubscriber = $location.search().selectedSubscriber;
+            // $scope.selectedServiceInstance = $location.search().selectedServiceInstance;
             $scope.status = FIELD.STATUS.FETCHING_SUB_DETAILS + $scope.selectedSubscriber;
+            var query = $location.url().replace($location.path(),'');
 
             $scope.displayData = [];
-            AaiService.getSubDetails($scope.selectedSubscriber, $scope.selectedServiceInstance, function (displayData, subscriberName) {
-                $scope.displayData = displayData;
+            AaiService.searchServiceInstances(query).then(function (response) {
+                $scope.displayData = response.displayData;
+                if (response.displayData.length)
+                {
+                    var first = response.displayData[0];
+                    $scope.selectedSubscriberId = first.globalCustomerId;
+                    $scope.selectedSubscriberName = first.subscriberName;
+                }
                 $scope.viewPerPage = 10;
                 $scope.totalPage = $scope.displayData.length / $scope.viewPerPage;
                 $scope.scrollViewPerPage = 2;
@@ -429,13 +408,13 @@
                 $scope.setProgress(100); // done
                 $scope.status = FIELD.STATUS.DONE;
                 $scope.isSpinnerVisible = false;
-                $scope.subscriberName = subscriberName;
-            }, function (response) {
+
+            }).catch(function (response) {
                 $scope.showError(FIELD.ERROR.AAI);
                 $scope.errorMsg = FIELD.ERROR.AAI_FETCHING_CUST_DATA + response.status;
                 $scope.errorDetails = response.data;
             });
-        }
+        };
 
 
         $scope.$on(COMPONENT.MSO_DELETE_REQ, function (event, request) {
@@ -452,7 +431,6 @@
         });
 
         $scope.init = function () {
-
             //PropertyService.setAaiBaseUrl("testaai");
             //PropertyService.setAsdcBaseUrl("testasdc");
 
@@ -529,37 +507,67 @@
             alert(response.statusText);
         }
 
-        $scope.getAsdcModel = function (disData) {
+        function getModelVersionIdForServiceInstance(instance) {
+            if (UtilityService.hasContents(instance.aaiModelVersionId)) {
+                return $q.resolve(instance.aaiModelVersionId);
+            } else {
+                return AaiService.getModelVersionId(instance.globalCustomerId, instance.serviceInstanceId);
+            }
+        }
 
-            console.log("disData");
-            console.log(JSON.stringify(disData, null, 4));
+        $scope.onViewEditClick = function (disData) {
+            $log.debug("disData", disData, null, 4);
 
-            // if ( !(UtilityService.hasContents (disData.aaiModelVersionId)) ) {
-            // 	$scope.errorMsg = FIELD.ERROR.MODEL_VERSION_ID_MISSING;
-            // 	alert($scope.errorMsg);
-            // 	return;
-            // }
+            getModelVersionIdForServiceInstance(disData)
+                .then(getAsdcModelByVersionId, handleErrorGettingModelVersion)
+                .then(navigateToViewEditPage);
 
-            // aaiModelVersionId is the model uuid
-            var pathQuery = COMPONENT.SERVICES_PATH + disData.aaiModelVersionId;
-            $http({
-                method: 'GET',
-                url: pathQuery
-            }).then(function successCallback(response) {
-                vidService.setModel(response.data);
+
+            function navigateToViewEditPage() {
                 window.location.href =
                     COMPONENT.INSTANTIATE_ROOT_PATH + disData.globalCustomerId +
                     COMPONENT.SUBSCRIBERNAME_SUB_PATH + disData.subscriberName +
                     COMPONENT.SERVICETYPE_SUB_PATH + disData.serviceType +
                     COMPONENT.SERVICEINSTANCEID_SUB_PATH + disData.serviceInstanceId +
                     COMPONENT.IS_PERMITTED_SUB_PATH + disData.isPermitted;
+            }
+        };
+
+        function handleErrorGettingModelVersion(err) {
+            $log.error("aaiSubscriber getModelVersionIdForServiceInstance - " + err);
+            $scope.errorMsg = err;
+            alert($scope.errorMsg);
+            return $q.reject();
+        }
+
+        function getAsdcModelByVersionId(aaiModelVersionId) {
+            // aaiModelVersionId is the model uuid
+            var pathQuery = COMPONENT.SERVICES_PATH + aaiModelVersionId;
+            return $http({
+                method: 'GET',
+                url: pathQuery
+            }).then(function successCallback(response) {
+                vidService.setModel(response.data);
                 console.log("aaiSubscriber getAsdcModel DONE!!!!");
             }, function errorCallback(response) {
-                console.log("aaiSubscriber getAsdcModel - No matching model found matching the A&AI model version ID = " + disData.aaiModelVersionId);
-                $scope.errorMsg = FIELD.ERROR.NO_MATCHING_MODEL_AAI + disData.aaiModelVersionId;
+                $log.error("aaiSubscriber getAsdcModel - " + FIELD.ERROR.NO_MATCHING_MODEL_AAI + aaiModelVersionId);
+                $scope.errorMsg = FIELD.ERROR.NO_MATCHING_MODEL_AAI + aaiModelVersionId;
                 alert($scope.errorMsg);
             });
+        }
 
+        function returnMatchingServiceSubscription(serviceSubs, serviceId){
+            var orchStatus;
+            serviceSubs.forEach(function(item){
+                if (item[FIELD.ID.SERVICE_INSTANCES] != null) {
+                    item[FIELD.ID.SERVICE_INSTANCES][FIELD.ID.SERVICE_INSTANCE].forEach(function (service) {
+                        if (service[FIELD.ID.SERVICE_INSTANCE_ID] === serviceId) {
+                            orchStatus = service['orchestration-status']
+                        }
+                    })
+                }
+            });
+            return orchStatus;
         }
 
         $scope.getTenants = function (globalCustomerId) {
@@ -572,10 +580,26 @@
                 });
         }
 
+        $scope.isActivateDeactivateEnabled = function(btnType) {
+            if ($scope.serviceOrchestrationStatus && $scope.service.model.service.serviceType.toLowerCase().indexOf('transport') != -1) {
+                switch (btnType) {
+                    case "activate":
+                        return $scope.serviceOrchestrationStatus === 'Created' ||
+                            $scope.serviceOrchestrationStatus.toLowerCase() === 'pendingdelete' || $scope.serviceOrchestrationStatus.toLowerCase() === 'pending-delete';
+                        break;
+                    case "deactivate":
+                        return $scope.serviceOrchestrationStatus === 'Active';
+                        break;
+                }
+            }
+
+            return false;
+        };
+
         $scope.handleInitialResponseInventoryItems = function (response) {
 
             $scope.inventoryResponseItemList = response.data[FIELD.ID.INVENTORY_RESPONSE_ITEM]; // get data from json
-            console.log($scope.inventoryResponseItemList.toString());
+            $log.debug($scope.inventoryResponseItemList);
 
             $scope.displayData = [];
             $scope.vnfs = [];
@@ -585,8 +609,9 @@
             $scope.subscriberName = "";
             // just look up the subscriber name in A&AI here...
             AaiService.getSubscriberName($scope.globalCustomerId, function (response) {
-                $scope.subscriberName = response;
+                $scope.subscriberName = response.subscriberName;
                 DataService.setSubscriberName($scope.subscriberName);
+                $scope.serviceOrchestrationStatus = returnMatchingServiceSubscription(response.serviceSubscriptions[FIELD.ID.SERVICE_SUBSCRIPTION], $scope.serviceInstanceId);
 
                 angular.forEach($scope.inventoryResponseItemList, function (inventoryResponseItem, key) {
 
@@ -609,12 +634,13 @@
                                 "type": PARAMETER.STRING,
                                 "description": FIELD.PROMPT.VAR_DESCRIPTION_B,
                                 "default": FIELD.PROMPT.DEFAULT_B
-                            },
+                            }
                         },
                         "object": $scope.inventoryResponseItem[FIELD.ID.SERVICE_INSTANCE],
                         "vnfs": [],
-                        "networks": []
-                    }
+                        "networks": [],
+                        "configurations": []
+                    };
 
                     if (inventoryResponseItem[FIELD.ID.INVENTORY_RESPONSE_ITEMS] != null) {
 
@@ -760,6 +786,44 @@
                                     });
                                 }
                             }
+
+                            if (subInventoryResponseItem[FIELD.ID.GENERIC_CONFIGURATION] != null) {
+                                var configObject = subInventoryResponseItem[FIELD.ID.GENERIC_CONFIGURATION];
+                                var config = {
+                                    "id": $scope.counter++,
+                                    "name": configObject[FIELD.ID.CONFIGURATION_NAME],
+                                    "itemType": FIELD.ID.CONFIGURATION,
+                                    "nodeId": configObject[FIELD.ID.CONFIGURATION_ID],
+                                    "nodeType": configObject[FIELD.ID.CONFIGURATION_TYPE],
+                                    "nodeStatus": configObject[FIELD.ID.ORCHESTRATION_STATUS],
+                                    "modelInvariantId": configObject[FIELD.ID.MODEL_INVAR_ID],
+                                    "modelVersionId": configObject[FIELD.ID.MODEL_VERSION_ID],
+                                    "modelCustomizationId": configObject[FIELD.ID.MODEL_CUSTOMIZATION_ID],
+                                    "object": configObject,
+                                    "ports": []
+                                };
+
+                                $scope.allowConfigurationActions = [FIELD.STATUS.AAI_ACTIVE, FIELD.STATUS.AAI_INACTIVE, FIELD.STATUS.AAI_CREATED].indexOf(config.nodeStatus) != -1;
+
+                                if (subInventoryResponseItem[FIELD.ID.INVENTORY_RESPONSE_ITEMS] != null) {
+                                    angular.forEach(subInventoryResponseItem[FIELD.ID.INVENTORY_RESPONSE_ITEMS][FIELD.ID.INVENTORY_RESPONSE_ITEM], function (subSubInventoryResponseItem, key) {
+                                        var port = {};
+                                        var portObject;
+                                        if (subSubInventoryResponseItem[FIELD.ID.PORT] != null) {
+                                            portObject = subSubInventoryResponseItem[FIELD.ID.PORT];
+                                            port = {
+                                                "portId": portObject[FIELD.ID.PORT_ID],
+                                                "portName": portObject[FIELD.ID.PORT_NAME],
+                                                "portStatus": portObject[FIELD.ID.PORT_MIRRORED] === true ? FIELD.STATUS.AAI_ENABLED : FIELD.ID.AAI_DISABLED,
+                                                "object": portObject
+                                            };
+                                            config.ports.push(port);
+                                        }
+                                    });
+                                }
+                                $scope.service.instance[FIELD.ID.CONFIGURATIONS].push(config);
+                            }
+
                         });
                     }
                 });
@@ -901,63 +965,239 @@
             $scope.currentPage--;
         }
 
-        $scope.activateMSOInstance = function() {
-            MsoService.activateInstance($scope.service.instance, $scope.service.model)
-                .then(function(response) {
-                    alert("Activation succeeded");
-                })
-                .catch(function (error) {
-                    $log.error(error);
+        var getAicZoneAndSendToMso = function (msoType, requestParams) {
+            AaiService.getAicZoneForPNF(
+                $scope.service.instance.globalCustomerId,
+                $scope.service.instance.serviceType,
+                $scope.service.instance.serviceInstanceId, function (aicZone) {
+
+                    requestParams.aicZone = aicZone;
+
+                    openMsoModal(msoType, requestParams);
                 });
-            ;
+        };
+
+        var activateDeactivateServiceInstance = function(msoType) {
+            var requestParams = {
+                model: $scope.service.model,
+                instance: $scope.service.instance
+            };
+
+            if (DataService.getLoggedInUserId()) {
+                requestParams.userId = DataService.getLoggedInUserId();
+                getAicZoneAndSendToMso(msoType, requestParams)
+            } else {
+                AaiService.getLoggedInUserID(function (response) {
+                    var userID = response.data;
+                    DataService.setLoggedInUserId(userID);
+                    requestParams.userId = userID;
+
+                    getAicZoneAndSendToMso(msoType, requestParams);
+                });
+            }
+        };
+
+        $scope.activateMSOInstance = function() {
+
+            activateDeactivateServiceInstance(COMPONENT.MSO_ACTIVATE_SERVICE_REQ);
+        };
+
+        $scope.deactivateMSOInstance = function() {
+
+            activateDeactivateServiceInstance(COMPONENT.MSO_DEACTIVATE_SERVICE_REQ);
+        };
+
+        $scope.toggleConfigurationStatus = function (serviceObject, configuration) {
+
+
+            AaiService.getLoggedInUserID(function (response) {
+                    DataService.setLoggedInUserId(response.data);
+                    var requestParams = {
+                        serviceModel: {
+                            "modelType": "service",
+                            "modelInvariantId": serviceObject.model.service.invariantUuid,
+                            "modelVersionId": "uuid",
+                            "modelName": serviceObject.model.service.name,
+                            "modelVersion": serviceObject.model.service.version
+                        },
+                        configurationModel: {
+                            "modelType": "configuration",
+                            "modelInvariantId": configuration.modelInvariantId,
+                            "modelVersionId": configuration.modelVersionId,
+                            "modelCustomizationId": configuration.modelCustomizationId
+                        },
+                        serviceInstanceId: serviceObject.instance.serviceInstanceId,
+                        configurationId: configuration.nodeId,
+                        configStatus: configuration.nodeStatus,
+                        userId: DataService.getLoggedInUserId()
+                    };
+
+                    openMsoModal(COMPONENT.MSO_CHANGE_CONFIG_STATUS_REQ, requestParams);
+             });
+
+        };
+
+        $scope.togglePortStatus = function(serviceObject, configuration, port) {
+
+            var requestParams = {
+                serviceInstanceId: serviceObject.instance.serviceInstanceId,
+                configurationId: configuration.nodeId,
+                portId: port.portId,
+                portStatus: port.portStatus,
+                serviceModel: {
+                    "modelType": "service",
+                    "modelInvariantId": serviceObject.model.service.invariantUuid,
+                    "modelVersionId": "uuid",
+                    "modelName": serviceObject.model.service.name,
+                    "modelVersion": serviceObject.model.service.version
+                },
+                configurationModel: {
+                    "modelType": "configuration",
+                    "modelInvariantId": configuration.modelInvariantId,
+                    "modelVersionId": configuration.modelVersionId,
+                    "modelCustomizationId": configuration.modelCustomizationId
+                },
+                userId: DataService.getLoggedInUserId()
+            };
+
+            openMsoModal(COMPONENT.MSO_CHANGE_PORT_STATUS_REQ, requestParams);
+        };
+
+        $scope.dissociatePnf = function(pnfName) {
+
+            var jobInfo = {
+                status: "confirm",
+                message: "Are you sure you would like to dissociate " + pnfName + " from the service instance?"
+            };
+
+            var modalInstance = $uibModal.open({
+                templateUrl: 'app/vid/scripts/modals/alert-modal/alert-modal.html',
+                controller: 'alertModalController',
+                controllerAs: 'vm',
+                appendTo: angular.element("#pnfs-tree"),
+                resolve: {
+                    jobInfo: function () {
+                        return jobInfo;
+                    }
+                }
+            });
+
+            modalInstance.result.then(function (result) {
+                console.log("This is the result of the alert modal.", result);
+
+                if (result) {
+                    var requestParams = {
+                        pnf: pnfName,
+                        serviceModelInfo: {
+                            invariantUuid: $scope.service.model.service.invariantUuid,
+                            uuid: $scope.service.model.service.uuid,
+                            version: $scope.service.model.service.version,
+                            name: $scope.service.model.service.name
+                        },
+                        serviceInstanceId: $scope.service.instance.serviceInstanceId
+                    };
+
+                    if (DataService.getLoggedInUserId()) {
+                        requestParams.attuuid = DataService.getLoggedInUserId();
+                        openMsoModal(COMPONENT.MSO_REMOVE_RELATIONSHIP, requestParams);
+                    } else {
+                        AaiService.getLoggedInUserID(function (response) {
+                            DataService.setLoggedInUserId(response.data);
+
+                            requestParams.attuuid = response.data;
+                            openMsoModal(COMPONENT.MSO_REMOVE_RELATIONSHIP, requestParams);
+                        });
+                    }
+                }
+            });
+
+
+        };
+
+        var openMsoModal = function (msoType, requestParams) {
+            var modalInstance = $uibModal.open({
+                templateUrl: 'app/vid/scripts/modals/mso-commit/mso-commit.html',
+                controller : "msoCommitModalController",
+                backdrop: false,
+                resolve: {
+                    msoType: function () {
+                        return msoType;
+                    },
+                    requestParams: function() {
+                        requestParams.callbackFunction = updateViewCallbackFunction;
+                        return requestParams;
+                    }
+                }
+            });
+        };
+
+        var updateViewCallbackFunction = function(response) {
+            $scope.callbackResults = "";
+            var color = FIELD.ID.COLOR_NONE;
+            $scope.callbackStyle = {
+                "background-color" : color
+            };
+
+            /*
+             * This 1/2 delay was only added to visually highlight the status
+             * change. Probably not needed in the real application code.
+             */
+            $timeout(function() {
+                $scope.callbackResults = UtilityService.getCurrentTime()
+                    + FIELD.STATUS.IS_SUCCESSFUL + response.isSuccessful;
+                if (response.isSuccessful) {
+                    color = FIELD.ID.COLOR_8F8;
+                    $scope.reloadRoute();
+                } else {
+                    color = FIELD.ID.COLOR_F88;
+                }
+                $scope.callbackStyle = {
+                    "background-color" : color
+                };
+            }, 500);
         };
 
         $scope.nextPage = function () {
             $scope.currentPage++;
+        };
+
+        $scope.serviceInstanceses = [{"sinstance": FIELD.NAME.SERVICE_INSTANCE_Id}, {"sinstance": FIELD.NAME.SERVICE_INSTANCE_NAME}];
+
+        function navigateToSearchResultsPage(globalCustomerId, selectedServiceInstance, selectedProjects, selectedOwningEntities) {
+            var projectQuery = AaiService.getMultipleValueParamQueryString(_.map(selectedProjects, 'id'), COMPONENT.PROJECT_SUB_PATH);
+            var owningEntityQuery = AaiService.getMultipleValueParamQueryString(_.map(selectedOwningEntities, 'id'), COMPONENT.OWNING_ENTITY_SUB_PATH);
+            var globalCustomerIdQuery = globalCustomerId ? COMPONENT.SELECTED_SUBSCRIBER_SUB_PATH + globalCustomerId : null;
+            var serviceInstanceQuery = selectedServiceInstance ? COMPONENT.SELECTED_SERVICE_INSTANCE_SUB_PATH + selectedServiceInstance : null;
+            var query = AaiService.getJoinedQueryString([projectQuery, owningEntityQuery, globalCustomerIdQuery, serviceInstanceQuery]);
+
+            window.location.href = COMPONENT.SELECTED_SERVICE_SUB_PATH + query;
         }
-        $scope.serviceInstanceses = [{"sinstance": FIELD.NAME.SERVICE_INSTANCE_Id}, {"sinstance": FIELD.NAME.SERVICE_INSTANCE_NAME}]
-        $scope.getSubscriberDet = function (selectedCustomer, selectedserviceinstancetype, selectedServiceInstance) {
 
-            var sintype = selectedserviceinstancetype;
-            if (selectedServiceInstance != "" && selectedServiceInstance != undefined) {
-                selectedServiceInstance.trim();
+        $scope.getServiceInstancesSearchResults =
+            function (selectedCustomer, selectedInstanceIdentifierType, selectedServiceInstance, selectedProject, selectedOwningEntity) {
+                var isSelectionValid = UtilityService.hasContents(selectedCustomer) || UtilityService.hasContents(selectedProject)
+                    || UtilityService.hasContents(selectedOwningEntity) || UtilityService.hasContents(selectedServiceInstance);
 
-                // check with A&AI
-                $http.get(COMPONENT.AAI_GET_SERVICE_INSTANCE_PATH + selectedServiceInstance + "/" + sintype + "?r=" + Math.random(), {}, {
-                    timeout: $scope.responseTimeoutMsec
-                }).then(function (response) {
-                    var notFound = true;
-                    if (angular.isArray(response.data[FIELD.ID.RESULT_DATA])) {
-                        var item = [];
-                        var urlParts = [];
-                        item = response.data[FIELD.ID.RESULT_DATA][0];
-                        var url = item[FIELD.ID.RESOURCE_LINK];
-                        var globalCustomerId = "";
-                        var serviceSubscription = "";
-                        // split it and find the customer Id and service-subscription
-                        urlParts = url.split("/");
-                        if (urlParts[7] === FIELD.ID.CUSTOMER) {
-                            globalCustomerId = urlParts[8];
-                        }
-                        if (urlParts[10] === FIELD.ID.SERVICE_SUBSCRIPTION) {
-                            serviceSubscription = urlParts[11];
-                        }
-
-                        if (globalCustomerId !== "") {
-                            notFound = false;
-                            window.location.href = COMPONENT.SELECTED_SERVICE_SUB_PATH + serviceSubscription + COMPONENT.SELECTEDSUBSCRIBER_SUB_PATH + globalCustomerId + COMPONENT.SELECTEDSERVICEINSTANCE_SUB_PATH + selectedServiceInstance;
-                        }
+                if (isSelectionValid) {
+                    if (UtilityService.hasContents(selectedServiceInstance)) {
+                        AaiService
+                            .getGlobalCustomerIdByInstanceIdentifier(selectedServiceInstance, selectedInstanceIdentifierType)
+                            .then(handleCustomerIdResponse);
+                    } else {
+                        navigateToSearchResultsPage(selectedCustomer, null, selectedProject, selectedOwningEntity);
                     }
-                    if (notFound) {
+                } else {
+                    alert(FIELD.ERROR.SELECT);
+                }
+
+                function handleCustomerIdResponse(globalCustomerId) {
+                    if (UtilityService.hasContents(globalCustomerId)) {
+                        navigateToSearchResultsPage(globalCustomerId, selectedServiceInstance, selectedProject, selectedOwningEntity);
+                    } else {
                         alert(FIELD.ERROR.SERVICE_INST_DNE);
                     }
-                }); // add a failure callback...
-            } else if (selectedCustomer != null) {
-                window.location.href = COMPONENT.SELECTED_SUB_PATH + selectedCustomer;
-            } else {
-                alert(FIELD.ERROR.SELECT);
-            }
-        };
+                }
+            };
     }]).directive('restrictInput', function () {
 
     return {
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/controller/change-management.controller.js b/vid-app-common/src/main/webapp/app/vid/scripts/controller/change-management.controller.js
index 662b10e..273f130 100644
--- a/vid-app-common/src/main/webapp/app/vid/scripts/controller/change-management.controller.js
+++ b/vid-app-common/src/main/webapp/app/vid/scripts/controller/change-management.controller.js
@@ -1,12 +1,15 @@
 (function () {
     'use strict';
 
-    appDS2.controller("changeManagementController", ["$uibModal", "changeManagementService", "_", "$log", changeManagementController]);
+    appDS2.controller("changeManagementController", ["$uibModal", "changeManagementService", "_", "$log",  "SchedulerService", "$filter", changeManagementController]);
 
-    function changeManagementController($uibModal, changeManagementService, _, $log) {
+    function changeManagementController($uibModal, changeManagementService, _, $log, SchedulerService, $filter) {
         var vm = this;
 
-        var init = function() {
+        vm.lastTimeUpdated = "";
+
+        vm.init = function() {
+            vm.lastTimeUpdated = $filter('date')(new Date(), "MM/dd/yyyy | HH:mm:ss");
             loadMSOChangeManagements();
             loadSchedulerChangeManagements();
         };
@@ -26,16 +29,16 @@
                 .then(function(response) {
                     vm.pendingChangeManagements = response.data;
                     _.forEach(vm.pendingChangeManagements, function(changeManagement) {
-                        var callbackData = _.filter(changeManagement.scheduleRequest.domainData, {name: "CallbackData"});
+                        var callbackData = _.filter(changeManagement.scheduleRequest.domainData, {name: "WorkflowName"});
                         if(callbackData) {
                             var parsedModel = {};
                             try {
-                                parsedModel = JSON.parse(callbackData[0].value);
+                                parsedModel = callbackData[0].value;
                             } catch(exception) {
                                 $log.error(exception);
                             }
 
-                            changeManagement.workflow = parsedModel.requestType || 'No workflow';
+                            changeManagement.workflow = parsedModel;
                         }
                     });
                 })
@@ -57,10 +60,6 @@
             });
         };
 
-        vm.openScheduler = function() {
-            console.log("function for opening the scheduler app")
-        };
-
         vm.searchChanges = function() {
             console.log("function for searching changes: " + vm.searchChangesTerm)
         };
@@ -74,7 +73,8 @@
                     jobInfo: function () {
                         return jobInfo;
                     }
-                }
+                },
+
             });
 
             modalInstance.result.then(function (result) {
@@ -115,12 +115,12 @@
                 console.log("This is the result of the alert change management modal.", result);
             });
         };
-
-        vm.openPendingModal = function(jobInfo) {
+        vm.openBasicAlertModal = function(jobInfo) {
             var modalInstance = $uibModal.open({
-                templateUrl: 'app/vid/scripts/modals/pending-change-management/pending-change-management.html',
-                controller: 'changeManagementManualTasksController',
+                templateUrl: 'app/vid/scripts/modals/alert-modal/alert-modal.html',
+                controller: 'alertModalController',
                 controllerAs: 'vm',
+                appendTo: angular.element(".jobs-table").eq(0),
                 resolve: {
                     jobInfo: function () {
                         return jobInfo;
@@ -129,10 +129,51 @@
             });
 
             modalInstance.result.then(function (result) {
-                console.log("This is the result of the pending change management modal.", result);
+                console.log("This is the result of the alert change management modal.", result);
             });
         };
+        vm.openPendingModal = function($event, changeManagement) {
+            var modalInstance = $uibModal.open({
+                templateUrl: 'app/vid/scripts/modals/cancel-pending-workflow/cancel-pending-workflow.html',
+                controller: 'cancelPendingWorkflowController',
+                controllerAs: 'vm',
+                backdrop: false,
+                animation: true,
+                appendTo: angular.element($event.currentTarget).parent(),
+                resolve: {
+                    changeManagement: function () {
+                        return changeManagement;
+                    }
+                }
+            });
 
-        init();
+            modalInstance.result.then(function (result) {
+                // send to service
+             if(result){
+                    SchedulerService.cancelScheduleRequest(changeManagement.scheduleRequest.scheduleId,
+                        function(response) {
+
+                            //success popup
+                            var jobInfo= {
+                                status:"success",
+                                message: "Cancel workflow "+changeManagement.scheduleRequest.scheduleName+" succeeded."};
+                            vm.openBasicAlertModal(jobInfo);
+
+                            return response;
+                        }, function(error) {
+
+                            //failed popup
+                            var jobInfo = {
+                                status:"failed",
+                                message: "Cancel workflow "+changeManagement.scheduleRequest.scheduleName+" failed due to an unexpected error."};
+                            vm.openBasicAlertModal(jobInfo);
+
+                        });
+            }});
+
+        };
+
+
+        vm.init();
     }
 })();
\ No newline at end of file
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/controller/deleteResumeDialogController.js b/vid-app-common/src/main/webapp/app/vid/scripts/controller/deleteResumeDialogController.js
new file mode 100644
index 0000000..9715484
--- /dev/null
+++ b/vid-app-common/src/main/webapp/app/vid/scripts/controller/deleteResumeDialogController.js
@@ -0,0 +1,148 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * VID
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+"use strict";
+
+var deleteResumeDialogController = function( COMPONENT, FIELD, $scope, $http, $timeout, $log,
+    DeleteResumeService, CreationService, UtilityService) {
+
+    $scope.isDialogVisible = false;
+    $scope.summaryControl = {};
+    $scope.userProvidedControl = {};
+    
+    var callbackFunction = undefined;
+    var componentId = undefined;
+
+    $scope.$on(COMPONENT.DELETE_RESUME_COMPONENT, function(event, request) {
+
+    $scope.isDataVisible = false;
+	$scope.isSpinnerVisible = false;
+	$scope.isErrorVisible = false;
+	$scope.isDialogVisible = true;
+	$scope.popup.isVisible = true;
+	$scope.isConfirmEnabled = false;
+	$scope.dialogMethod = request.dialogMethod;
+	callbackFunction = request.callbackFunction;
+	componentId = request.componentId;
+
+    DeleteResumeService.initializeComponent(request.componentId);
+
+	$scope.componentName = DeleteResumeService.getComponentDisplayName();
+
+	$scope.summaryControl.setList(DeleteResumeService.getSummaryList());
+
+    DeleteResumeService.getParameters(handleGetParametersResponse);
+
+    });
+    
+    var handleGetParametersResponse = function(parameters, dontshow) {
+		$scope.summaryControl.setList(parameters.summaryList);
+		$scope.userProvidedControl.setList(parameters.userProvidedList);
+
+		$scope.isSpinnerVisible = false;
+		if (dontshow)
+		  $scope.isDataVisible = false;
+		else
+			$scope.isDataVisible = true;
+		$scope.isConfirmEnabled = true;
+	};
+
+	$scope.userParameterChanged = function(id) {
+        DeleteResumeService.updateUserParameterList(id, $scope.userProvidedControl);
+	}
+
+    $scope.confirm = function() {
+    	var requiredFields = $scope.userProvidedControl.getRequiredFields();
+		if (requiredFields === "") {
+			$scope.isErrorVisible = false;
+		} else {
+			showError(FIELD.ERROR.MISSING_DATA, requiredFields);
+			return;
+		}
+
+		
+
+       var  callbackAfterMSO = function(isSuccessful) {
+            if (isSuccessful) {
+                $scope.popup.isVisible = false;
+                runCallback(true);
+            } else {
+                 $scope.isDialogVisible = true;
+            }
+        };
+
+
+		$scope.isDialogVisible = false;
+
+		if ($scope.dialogMethod == COMPONENT.DELETE)
+		{
+
+            var requestDetails = DeleteResumeService.getMsoRequestDetails($scope.userProvidedControl.getList());
+
+            if(DeleteResumeService.isMacro === true){
+            	requestDetails.requestParameters.aLaCarte = false;
+            }
+
+            $scope.$broadcast(COMPONENT.MSO_DELETE_REQ, {
+                url : DeleteResumeService.getMsoUrl(),
+                requestDetails : requestDetails,
+            	componentId: componentId,
+                callbackFunction : callbackAfterMSO
+            });
+		}
+		else
+        if ($scope.dialogMethod == COMPONENT.RESUME)
+        {
+            CreationService.initializeComponent(componentId);
+            CreationService.setInventoryInfo();
+
+            var requestDetails = CreationService.getMsoRequestDetails($scope.userProvidedControl.getList());
+
+
+            $scope.$broadcast(COMPONENT.MSO_CREATE_REQ, {
+                url : CreationService.getMsoUrl(),
+                requestDetails : requestDetails,
+                componentId: componentId,
+                callbackFunction : callbackAfterMSO
+            });
+
+
+        }
+
+    }
+
+    $scope.cancel = function() {
+	$scope.isDialogVisible = false;
+	$scope.popup.isVisible = false;
+	runCallback(false);
+    }
+
+    var runCallback = function(isSuccessful) {
+	if (angular.isFunction(callbackFunction)) {
+	    callbackFunction({
+		isSuccessful : isSuccessful
+	    });
+	}
+    }
+}
+
+appDS2.controller("deleteResumeDialogController", [ "COMPONENT", "FIELD", "$scope", "$http",
+		"$timeout", "$log", "DeleteResumeService","CreationService", "UtilityService",
+    deleteResumeDialogController]);
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/controller/deletionDialogController.js b/vid-app-common/src/main/webapp/app/vid/scripts/controller/deletionDialogController.js
deleted file mode 100755
index 499a1ec..0000000
--- a/vid-app-common/src/main/webapp/app/vid/scripts/controller/deletionDialogController.js
+++ /dev/null
@@ -1,123 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * VID
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *      http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-"use strict";
-
-var deletionDialogController = function( COMPONENT, FIELD, $scope, $http, $timeout, $log,
-	DeletionService, UtilityService) {
-
-    $scope.isDialogVisible = false;
-    $scope.summaryControl = {};
-    $scope.userProvidedControl = {};
-    
-    var callbackFunction = undefined;
-    var componentId = undefined;
-
-    $scope.$on(COMPONENT.DELETE_COMPONENT, function(event, request) {
-
-    $scope.isDataVisible = false;
-	$scope.isSpinnerVisible = false;
-	$scope.isErrorVisible = false;
-	$scope.isDialogVisible = true;
-	$scope.popup.isVisible = true;
-	$scope.isConfirmEnabled = false;
-
-	callbackFunction = request.callbackFunction;
-	componentId = request.componentId;
-
-	DeletionService.initializeComponent(request.componentId);
-
-	$scope.componentName = DeletionService.getComponentDisplayName();
-
-	$scope.summaryControl.setList(DeletionService.getSummaryList());
-	
-	DeletionService.getParameters(handleGetParametersResponse);
-
-    });
-    
-    var handleGetParametersResponse = function(parameters, dontshow) {
-		$scope.summaryControl.setList(parameters.summaryList);
-		$scope.userProvidedControl.setList(parameters.userProvidedList);
-
-		$scope.isSpinnerVisible = false;
-		if (dontshow)
-		  $scope.isDataVisible = false;
-		else
-			$scope.isDataVisible = true;
-		$scope.isConfirmEnabled = true;
-	};
-
-	$scope.userParameterChanged = function(id) {
-		DeletionService.updateUserParameterList(id, $scope.userProvidedControl);
-	}
-
-    $scope.confirm = function() {
-
-    	var requiredFields = $scope.userProvidedControl.getRequiredFields();
-		if (requiredFields === "") {
-			$scope.isErrorVisible = false;
-		} else {
-			showError(FIELD.ERROR.MISSING_DATA, requiredFields);
-			return;
-		}
-
-		
-	var requestDetails = DeletionService.getMsoRequestDetails($scope.userProvidedControl.getList());
-	
-	if(DeletionService.isMacro === true){
-		requestDetails.requestParameters.aLaCarte = false;
-	}
-
-	$scope.isDialogVisible = false;
-
-	$scope.$broadcast(COMPONENT.MSO_DELETE_REQ, {
-	    url : DeletionService.getMsoUrl(),
-	    requestDetails : requestDetails,
-		componentId: componentId,
-	    callbackFunction : function(isSuccessful) {
-		if (isSuccessful) {
-		    $scope.popup.isVisible = false;
-		    runCallback(true);
-		} else {
-		    $scope.isDialogVisible = true;
-		}
-	    }
-	});
-
-    }
-
-    $scope.cancel = function() {
-	$scope.isDialogVisible = false;
-	$scope.popup.isVisible = false;
-	runCallback(false);
-    }
-
-    var runCallback = function(isSuccessful) {
-	if (angular.isFunction(callbackFunction)) {
-	    callbackFunction({
-		isSuccessful : isSuccessful
-	    });
-	}
-    }
-}
-
-appDS2.controller("deletionDialogController", [ "COMPONENT", "FIELD", "$scope", "$http",
-		"$timeout", "$log", "DeletionService", "UtilityService",
-		deletionDialogController ]);
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/controller/msoCommitController.js b/vid-app-common/src/main/webapp/app/vid/scripts/controller/msoCommitController.js
index 65fac28..dd3ba50 100755
--- a/vid-app-common/src/main/webapp/app/vid/scripts/controller/msoCommitController.js
+++ b/vid-app-common/src/main/webapp/app/vid/scripts/controller/msoCommitController.js
@@ -64,25 +64,42 @@
  */
 
 var msoCommitController = function(COMPONENT, FIELD, $scope, $http, $timeout, $window, $log,
-		MsoService, PropertyService, UtilityService, DataService) {
+		MsoService, PropertyService, UtilityService, TestEnvironmentsService) {
 
 	$scope.isViewVisible = false;
 	$scope.progressBarControl = {};
 	$scope.popupWindowControl = {};
-
+    var getRequestStatusFunc = getOrchestrationRequestStatus; //default
 	var _this = this;
 
 	$scope.$on("createInstance", function(event, request) {
-		init(request, COMPONENT.MSO_CREATE_REQ );
+		init(request, COMPONENT.MSO_CREATE_REQ, getOrchestrationRequestStatus );
 		MsoService.createInstance(request, handleInitialResponse);
 	});
 
 	$scope.$on("deleteInstance", function(event, request) {
-		init(request, COMPONENT.MSO_DELETE_REQ);
+        init(request, COMPONENT.MSO_DELETE_REQ, getOrchestrationRequestStatus);
 		MsoService.deleteInstance(request, handleInitialResponse);
 	});
 
-	var init = function(request, msoRequestType ) {
+    $scope.$on(COMPONENT.MSO_CREATE_ENVIRONMENT, function(event, request) {
+        init(request, COMPONENT.MSO_CREATE_ENVIRONMENT, getCloudResourcesRequestStatus);
+        TestEnvironmentsService.createApplicationEnv(request).then(handleInitialResponse);
+    });
+
+    $scope.$on(COMPONENT.MSO_DEACTIVATE_ENVIRONMENT, function(event, request) {
+        init(request, COMPONENT.MSO_DEACTIVATE_ENVIRONMENT, getCloudResourcesRequestStatus);
+        TestEnvironmentsService.deactivateApplicationEnv(request).then(handleInitialResponse)
+    });
+
+    $scope.$on(COMPONENT.MSO_ACTIVATE_ENVIRONMENT, function(event, request) {
+        init(request, COMPONENT.MSO_ACTIVATE_ENVIRONMENT, getCloudResourcesRequestStatus);
+        TestEnvironmentsService.activateApplicationEnv(request).then(handleInitialResponse)
+    });
+
+
+    var init = function(request, msoRequestType, getStatusRequest ) {
+    	getRequestStatusFunc = getStatusRequest;
 		$scope.status = FIELD.STATUS.SUBMITTING_REQUEST;
 		$scope.isSpinnerVisible = true;
 		$scope.isProgressVisible = true;
@@ -109,13 +126,13 @@
 			showError(FIELD.ERROR.SYSTEM_FAILURE, UtilityService
 					.getHttpErrorMessage(response));
 		});
-	}
+	};
 
 	var handleInitialResponse = function(response) {
 		try {
 			updateViewAfterInitialResponse(response);
 			
-			_this.timer = $timeout(getRequestStatus, PropertyService
+			_this.timer = $timeout(getRequestStatusFunc, PropertyService
 					.getMsoMaxPollingIntervalMsec());
 
 			$scope.instanceId = response.data.entity.instanceId;
@@ -133,11 +150,16 @@
 		}
 	}
 
-	var getRequestStatus = function() {
-		MsoService.getOrchestrationRequest(_this.requestId, handleGetResponse);
+	function getOrchestrationRequestStatus() {
+		MsoService.getOrchestrationRequest(_this.requestId, handleGetStatusResponse);
 	}
 
-	var handleGetResponse = function(response) {
+  	function getCloudResourcesRequestStatus() {
+        TestEnvironmentsService.getRequestStatus(_this.requestId, handleGetStatusResponse);
+    }
+
+
+    var handleGetStatusResponse = function(response) {
 		try {
 			if (isUpdateViewAfterGetResponseComplete(response)) {
 				return;
@@ -147,7 +169,7 @@
 				_this.isMsoError = true;
 				showError(FIELD.ERROR.MAX_POLLS_EXCEEDED);
 			} else {
-				_this.timer = $timeout(getRequestStatus, PropertyService
+				_this.timer = $timeout(getRequestStatusFunc, PropertyService
 						.getMsoMaxPollingIntervalMsec());
 			}
 		} catch (error) {
@@ -296,5 +318,5 @@
 }
 
 appDS2.controller("msoCommitController", [ "COMPONENT", "FIELD", "$scope", "$http", "$timeout",
-		"$window", "$log", "MsoService", "PropertyService", "UtilityService",
+		"$window", "$log", "MsoService", "PropertyService", "UtilityService", "TestEnvironmentsService",
 		msoCommitController ]);
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/controller/msoCommitModalController.js b/vid-app-common/src/main/webapp/app/vid/scripts/controller/msoCommitModalController.js
new file mode 100644
index 0000000..148b4cc
--- /dev/null
+++ b/vid-app-common/src/main/webapp/app/vid/scripts/controller/msoCommitModalController.js
@@ -0,0 +1,237 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * VID
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+"use strict";
+
+var msoCommitModalController = function(COMPONENT, FIELD, $scope, $http, $timeout, $window, $log,
+		MsoService, PropertyService, UtilityService, DataService, $uibModalInstance, msoType, requestParams, vidService) {
+
+    $scope.isSpinnerVisible = true;
+    $scope.isProgressVisible = true;
+    $scope.status = FIELD.STATUS.SUBMITTING_REQUEST;
+    $scope.error = "";
+    $scope.log = "";
+    $scope.progressBarControl = {};
+    $scope.isCloseEnabled = false;
+
+    var _this = this;
+    _this.pollAttempts = 0;
+    _this.callbackFunction = requestParams.callbackFunction;
+    _this.isMsoError = false;
+
+
+    if (angular.isFunction($scope.progressBarControl.reset)) {
+        $scope.progressBarControl.reset();
+    }
+    $scope.percentProgress = 2; // Show "a little" progress
+
+
+    /*
+	 * Updates the view and returns "true" if the MSO operation has returned a
+	 * "Complete" status.
+	 */
+    var isUpdateViewAfterGetResponseComplete = function(response) {
+        //console.log("msoCommitController isUpdateViewAfterGetResponseComplete");
+        updateLogFinalResponse(response);
+
+        var requestStatus = UtilityService.checkUndefined(FIELD.ID.REQUEST_STATUS,
+            UtilityService.checkUndefined(FIELD.ID.REQUEST,
+                response.data.entity.request).requestStatus);
+
+        var requestState = requestStatus.requestState;
+        console.log("msoCommitController requestState=" + requestState);
+        // look for "progress" or "pending"
+        var patt1 = /progress/i;
+        var patt2 = /pending/i;
+        var result1 = patt1.test(requestState);
+        var result2 = patt2.test(requestState);
+        if (result1 || result2) {
+            requestState = FIELD.STATUS.IN_PROGRESS;
+        }
+        var statusMessage = requestStatus.statusMessage;
+        console.log("msoCommitController statusMessage=" + statusMessage);
+        if (UtilityService.hasContents(statusMessage)) {
+            $scope.status = requestState + " - " + statusMessage;
+        } else {
+            $scope.status = requestState;
+        }
+        if (UtilityService.hasContents(requestStatus.percentProgress)) {
+            $scope.percentProgress = requestStatus.percentProgress;
+        }
+
+        if ( (requestState.toLowerCase() === FIELD.STATUS.FAILED.toLowerCase()) || (requestState.toLowerCase() === FIELD.STATUS.UNLOCKED.toLowerCase())) {
+            throw {
+                type : FIELD.STATUS.MSO_FAILURE
+            };
+        }
+
+        if (requestState.toLowerCase() === FIELD.STATUS.COMPLETE.toLowerCase()) {
+            $scope.isSpinnerVisible = false;
+            return true;
+        }
+
+        return false;
+    };
+
+    var handleGetResponse = function(response) {
+        try {
+            if (isUpdateViewAfterGetResponseComplete(response)) {
+                return;
+            }
+            if (++_this.pollAttempts > PropertyService.getMsoMaxPolls()) {
+                _this.isMsoError = true;
+                showError(FIELD.ERROR.MAX_POLLS_EXCEEDED);
+            } else {
+                _this.timer = $timeout(getRequestStatus, PropertyService
+                    .getMsoMaxPollingIntervalMsec());
+            }
+        } catch (error) {
+            _this.isMsoError = true;
+            MsoService.showResponseContentError(error, showError);
+        }
+    };
+
+    var showError = function(summary, details) {
+        var message = summary;
+        if (UtilityService.hasContents(details)) {
+            message += " (" + details + ")";
+        }
+        $scope.isSpinnerVisible = false;
+        $scope.isProgressVisible = false;
+        $scope.error = message;
+        $scope.status = FIELD.STATUS.ERROR;
+    };
+
+    var getRequestStatus = function() {
+        MsoService.getOrchestrationRequest(_this.requestId, handleGetResponse);
+    };
+
+    var updateLog = function(response) {
+        $scope.log = MsoService.getFormattedCommonResponse(response)
+            + $scope.log;
+        UtilityService.checkUndefined("entity", response.data.entity);
+        UtilityService.checkUndefined("status", response.data.status);
+        MsoService.checkValidStatus(response);
+    };
+
+    var updateLogFinalResponse = function(response) {
+        $scope.log = MsoService.getFormattedSingleGetOrchestrationRequestResponse(response)
+            + $scope.log;
+        UtilityService.checkUndefined("entity", response.data.entity);
+        UtilityService.checkUndefined("status", response.data.status);
+        MsoService.checkValidStatus(response);
+    };
+
+    var updateViewAfterInitialResponse = function(response) {
+        $scope.isCloseEnabled = true;
+        updateLog(response);
+
+        _this.requestId = UtilityService.checkUndefined(FIELD.ID.REQUEST_ID,
+            UtilityService.checkUndefined(FIELD.ID.REQUEST_REFERENCES,
+                response.data.entity.requestReferences).requestId);
+
+        $scope.percentProgress = 4; // Show "a little more" progress
+        $scope.status = FIELD.STATUS.IN_PROGRESS;
+    };
+
+    var init = function(msoType) {
+        switch(msoType) {
+            case COMPONENT.MSO_CREATE_REQ:
+                return MsoService.createConfigurationInstance(requestParams);
+            case  COMPONENT.MSO_CHANGE_CONFIG_STATUS_REQ:
+                return MsoService.toggleConfigurationStatus(requestParams);
+            case COMPONENT.MSO_CHANGE_PORT_STATUS_REQ:
+                return MsoService.togglePortStatus(requestParams);
+            case COMPONENT.MSO_CREATE_REALATIONSHIP:
+                return MsoService.associatePnf(requestParams);
+            case COMPONENT.MSO_REMOVE_RELATIONSHIP:
+                return MsoService.dissociatePnf(requestParams);
+            case COMPONENT.MSO_ACTIVATE_SERVICE_REQ:
+                return MsoService.activateInstance(requestParams);
+            case COMPONENT.MSO_DEACTIVATE_SERVICE_REQ:
+                return MsoService.deactivateInstance(requestParams);
+        }
+    };
+
+    var successCallbackFunction = function(response) {
+        try {
+            updateViewAfterInitialResponse(response);
+            _this.timer = $timeout(getRequestStatus, PropertyService
+                .getMsoMaxPollingIntervalMsec());
+
+            $scope.instanceId = response.data.entity.instanceId;
+            if ($scope.instanceId == null) {
+                $scope.instanceId = response.data.entity.requestReferences.instanceId;
+            }
+        } catch (error) {
+            if ( response.data != null && response.data.status != null ) {
+                if (response.data.status > 299 || response.data.status < 200 ) {
+                    // MSO returned an error
+                    _this.isMsoError = true;
+                }
+            }
+            MsoService.showResponseContentError(error, showError);
+        }
+    };
+
+    var errorCallbackFunction = function (error) {
+        UtilityService.setHttpErrorHandler(function(error) {
+            $scope.isCloseEnabled = true;
+            _this.isMsoError = true;
+            showError(FIELD.ERROR.SYSTEM_FAILURE, UtilityService
+                .getHttpErrorMessage(error));
+        });
+    };
+
+    $scope.close = function() {
+        $uibModalInstance.dismiss('cancel');
+
+        if (_this.timer !== undefined) {
+            $timeout.cancel(_this.timer);
+        }
+
+        if (angular.isFunction(_this.callbackFunction)) {
+            if ($scope.error === "") {
+                _this.callbackFunction({
+                    isSuccessful : true,
+                    instanceId : $scope.instanceId
+                });
+            } else {
+                _this.callbackFunction({
+                    isSuccessful : false
+                });
+            }
+        }
+    };
+
+    _this.msoRequestType = msoType;
+
+    init(_this.msoRequestType)
+        .then(function (response) {
+            successCallbackFunction(response);
+        })
+        .catch(function (error) {
+            errorCallbackFunction(error);
+        });
+};
+
+appDS2.controller("msoCommitModalController", [ "COMPONENT", "FIELD", "$scope", "$http", "$timeout",
+		"$window", "$log", "MsoService", "PropertyService", "UtilityService", "DataService", "$uibModalInstance", "msoType", "requestParams", "vidService",
+    msoCommitModalController ]);
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/controller/pnfSearchAssociationController.js b/vid-app-common/src/main/webapp/app/vid/scripts/controller/pnfSearchAssociationController.js
new file mode 100644
index 0000000..22a20ab
--- /dev/null
+++ b/vid-app-common/src/main/webapp/app/vid/scripts/controller/pnfSearchAssociationController.js
@@ -0,0 +1,138 @@
+/*-
+* ============LICENSE_START=======================================================
+* VID
+* ================================================================================
+* Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+* ================================================================================
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*      http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+* ============LICENSE_END=========================================================
+*/
+
+/**
+ * The Instantiation (or View/Edit) Controller controls the instantiation/removal of
+ * deployable objects (Services, VNFs, VF-Modules, Networks, and Volume-Groups)
+ */
+
+"use strict";
+
+appDS2.controller("pnfSearchAssociationController", ["COMPONENT", "$log", "FIELD", "PARAMETER", "DataService", "CreationService", "$scope", "$window", "$location", "AaiService", "$uibModal", "UtilityService", "vidService", "$timeout",
+    function (COMPONENT, $log, FIELD, PARAMETER, DataService, CreationService, $scope, $window, $location, AaiService, $uibModal, UtilityService, vidService, $timeout) {
+
+        var requestParams = {};
+
+        $scope.selectedMetadata = {};
+
+        $scope.serviceMetadataFields = [];
+        $scope.nodeTemplateFields = {};
+
+        $scope.pnfInstance= false;
+        $scope.notFound= false;
+
+        $scope.pnfMetadata = [];
+
+        $scope.errorMsg = FIELD.ERROR.INSTANCE_NAME_VALIDATE;
+
+        $scope.modelName = DataService.getModelInfo(COMPONENT.VNF).modelCustomizationName;
+
+        var handleGetParametersResponse = function(parameters) {
+            $scope.serviceMetadataFields = parameters.summaryList;
+            $scope.serviceMetadataFields.forEach(function (t, number) {
+                $scope.serviceMetadataFields[number].key = $scope.serviceMetadataFields[number].name.split(' ').join('')
+            })
+            $scope.nodeTemplateFields = _.keyBy(parameters.userProvidedList, 'id');
+        };
+
+        CreationService.initializeComponent(COMPONENT.VNF);
+
+        CreationService.getParameters(handleGetParametersResponse);
+
+        $scope.back = function()  {
+            $window.history.back();
+        };
+
+        $scope.searchPnf = function(pnfName) {
+            $scope.pnfInstance= false;
+            $scope.notFound=false;
+
+            AaiService.getPnfByName(pnfName)
+                .then(function (response) {
+                    $scope.pnfInstance = response.data;
+                    requestParams.pnf = response.data.pnfName;
+                })
+                .catch(function (error) {
+                    $scope.pnfNameNotFound= pnfName;
+                   $scope.notFound= true;
+                });
+
+        }
+        var modalInstance;
+
+        $scope.associate = function()  {
+
+            requestParams.serviceModelInfo = vidService.getModel().service;
+            requestParams.attuuid = DataService.getLoggedInUserId();
+            requestParams.instanceId = DataService.getServiceInstanceId();
+
+            modalInstance = $uibModal.open({
+                templateUrl: 'app/vid/scripts/modals/mso-commit/mso-commit.html',
+                controller: "msoCommitModalController",
+                backdrop: false,
+                resolve: {
+                    msoType: function () {
+                        return COMPONENT.MSO_CREATE_REALATIONSHIP;
+                    },
+                    requestParams: function () {
+                        requestParams.callbackFunction = updateViewCallbackFunction;
+                        return requestParams;
+                    }
+                }
+            })
+
+
+        };
+
+        var updateViewCallbackFunction = function(response) {
+            $scope.callbackResults = "";
+            var color = FIELD.ID.COLOR_NONE;
+            $scope.callbackStyle = {
+                "background-color" : color
+            };
+
+            /*
+             * This 1/2 delay was only added to visually highlight the status
+             * change. Probably not needed in the real application code.
+             */
+            $timeout(function() {
+                $scope.callbackResults = UtilityService.getCurrentTime()
+                    + FIELD.STATUS.IS_SUCCESSFUL + response.isSuccessful;
+                if (response.isSuccessful) {
+                    color = FIELD.ID.COLOR_8F8;
+                    $scope.back();
+                } else {
+                    color = FIELD.ID.COLOR_F88;
+                }
+                $scope.callbackStyle = {
+                    "background-color" : color
+                };
+            }, 500);
+        };
+
+
+        $scope.cancel = function()  {
+            modalInstance.dismiss('cancel');
+        };
+
+
+    }]);
+
+
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/controller/testEnvironmentsController.js b/vid-app-common/src/main/webapp/app/vid/scripts/controller/testEnvironmentsController.js
new file mode 100644
index 0000000..f5c3a0e
--- /dev/null
+++ b/vid-app-common/src/main/webapp/app/vid/scripts/controller/testEnvironmentsController.js
@@ -0,0 +1,102 @@
+(function () {
+    'use strict';
+
+    appDS2.controller("testEnvironmentsController", ["$uibModal", "TestEnvironmentsService", "$log", "$rootScope", "$scope", "COMPONENT", testEnvironmentsController]);
+
+    function testEnvironmentsController($uibModal, TestEnvironmentsService, $log, $rootScope, $scope, COMPONENT) {
+        var vm = this;
+
+        var toggleValue;
+
+        var init = function() {
+            vm.loadAAIestEnvironments();
+        };
+
+        vm.loadAAIestEnvironments = function() {
+            TestEnvironmentsService.loadAAIestEnvironments("VNF")
+                .then(function(response) {
+                    vm.environments = response.operationalEnvironment;
+                    vm.connectError = false;
+                    if(!vm.environments.length) {
+                        vm.emptyData = true;
+                    }
+                })
+                .catch(function (error) {
+                    vm.connectError = error.message || "Unknown error";
+                    $log.error(error);
+                });
+        };
+
+        function handleEnvActionComplete(result) {
+            if (result.isSuccessful) {
+                vm.loadAAIestEnvironments();
+            }
+            $scope.popup.isVisible = false;
+        }
+
+        vm.onTestEnvActivateClick = function(testEnv) {
+            var modalInstance = $uibModal.open({
+                templateUrl: 'app/vid/scripts/modals/attach-test-env-manifest/attach-test-env-manifest.html',
+                controller: 'attachTestEnvManifestController',
+                controllerAs: 'vm',
+                resolve: {}
+            });
+
+            modalInstance.result.then(function (result) {
+                if (result) {
+
+                    var relatedEcompEnv = _.find(testEnv.relationshipList.relationship, { relatedTo: "operational-environment" });
+
+                    var manifest = result;
+                    var envId = testEnv.operationalEnvironmentId;
+                    var relatedInstanceId =
+                        _.find(relatedEcompEnv.relationshipData, {"relationshipKey": "operational-environment.operational-environment-id"})
+                            .relationshipValue;
+                    var relatedInstanceName =
+                        _.find(relatedEcompEnv.relatedToProperty, {"propertyKey": "operational-environment.operational-name"})
+                            .propertyValue;
+                    var workloadContext = testEnv.workloadContext;
+
+                    $rootScope.$broadcast(COMPONENT.MSO_ACTIVATE_ENVIRONMENT, {
+                        url: COMPONENT.MSO_ACTIVATE_ENVIRONMENT,
+                        envId: envId,
+                        relatedInstanceId: relatedInstanceId,
+                        relatedInstanceName: relatedInstanceName,
+                        workloadContext: workloadContext,
+                        manifest: manifest,
+                        callbackFunction: handleEnvActionComplete
+                    });
+
+                }
+            });
+        };
+
+        vm.onTestEnvDeactivateClick = function(testEnv) {
+            var envId = testEnv.operationalEnvironmentId;
+            $rootScope.$broadcast(COMPONENT.MSO_DEACTIVATE_ENVIRONMENT, {
+                url : COMPONENT.MSO_DEACTIVATE_ENVIRONMENT,
+                envId : envId,
+                callbackFunction: handleEnvActionComplete
+            });
+        };
+
+        vm.isEnvActive = function(testEnv) {
+            return testEnv.operationalEnvironmentStatus==='Activate';
+        };
+
+        vm.getEnvStatus = function (testEnv) {
+            return this.isEnvActive(testEnv) ? "Active" : "Inactive";
+        };
+
+        vm.createNewTestEnvironment = function() {
+            var modalInstance = $uibModal.open({
+                templateUrl: 'app/vid/scripts/modals/new-test-environment/new-test-environment.html',
+                controller: 'newTestEnvironmentModalController',
+                controllerAs: 'vm',
+                resolve: {}
+            });
+        };
+
+        init();
+    }
+})();
\ No newline at end of file
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/directives/messageViewer.js b/vid-app-common/src/main/webapp/app/vid/scripts/directives/messageViewer.js
new file mode 100644
index 0000000..8ff67fa
--- /dev/null
+++ b/vid-app-common/src/main/webapp/app/vid/scripts/directives/messageViewer.js
@@ -0,0 +1,17 @@
+"use strict";
+
+appDS2.directive('messageViewer', function() {
+    return {
+        restrict : "E",
+        templateUrl: 'app/vid/scripts/view-models/messageViewer.htm',
+        scope: {
+            primaryMessage:'@',
+            icon:'@',
+            secondaryMessage:'@',
+            tryAgain:'&'
+        },
+        link: function(scope, elem, attrs) {
+            scope.showTryAgain = angular.isDefined(attrs.tryAgain);
+        }
+    }
+});
\ No newline at end of file
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/directives/parameterBlockDirective.js b/vid-app-common/src/main/webapp/app/vid/scripts/directives/parameterBlockDirective.js
index e57b43e..d36b382 100755
--- a/vid-app-common/src/main/webapp/app/vid/scripts/directives/parameterBlockDirective.js
+++ b/vid-app-common/src/main/webapp/app/vid/scripts/directives/parameterBlockDirective.js
@@ -20,7 +20,7 @@
 
 "use strict";
 
-var parameterBlockDirective = function($log, PARAMETER, UtilityService) {
+var parameterBlockDirective = function($log, PARAMETER, UtilityService, $compile) {
     /*
      * If "IS_SINGLE_OPTION_AUTO_SELECTED" is set to "true" ...
      * 
@@ -221,6 +221,9 @@
                     + additionalStyle + "'>" + getOptionListHtml(parameter)
                     + "</select>";
                 break;
+            case PARAMETER.MULTI_SELECT:
+                return '<multiselect id="' + parameter.id + '"' + attributeString + ' ng-model="multiselectModel.' + parameter.id + '" options="getOptionsList(\'' + parameter.id + '\')" display-prop="name" id-prop="id"></multiselect>';
+                break;
             case PARAMETER.STRING:
             default:
                 var value = "";
@@ -255,9 +258,7 @@
         }
 
         if (UtilityService.hasContents(parameter.prompt)) {
-	    if (!(IS_SINGLE_OPTION_AUTO_SELECTED && parameter.optionList.length === 1) || !(parameter.isSingleOptionAutoSelected && parameter.optionList.length === 1)) {
                 html += "<option value=''>" + parameter.prompt + "</option>";
-            }
         }
 
         for (var i = 0; i < parameter.optionList.length; i++) {
@@ -298,7 +299,7 @@
 
     var getParameter = function(element, expectedId) {
         var id = $(element).attr("parameter-id");
-        if (expectedId !== undefined && expectedId !== id) {
+        if (!id || (expectedId !== undefined && expectedId !== id)) {
             return undefined;
         }
         var parameter = {
@@ -327,14 +328,20 @@
     };
 
     var getRequiredField = function(element) {
-        if ($(element).prop("type") === "text") {
-            $(element).val($(element).val().trim());
+        if($(element).is("multiselect")) {
+            if(!$(element).find(".active").text().trim()) {
+                return '"' + $(element).attr("parameter-name") + '"';
+            }
         }
-        if ($(element).val() === "" || $(element).val() === null) {
-            return '"' + $(element).attr("parameter-name") + '"';
-        } else {
-            return "";
+        else {
+            if ($(element).prop("type") === "text") {
+                $(element).val($(element).val().trim());
+            }
+            if ($(element).val() === "" || $(element).val() === null) {
+                return '"' + $(element).attr("parameter-name") + '"';
+            }
         }
+        return "";
     };
 
     var callback = function(element, scope) {
@@ -354,13 +361,20 @@
         link : function(scope, element, attrs) {
 
             var control = scope.control || {};
+            scope.multiselectModel = {};
 
+            scope.getOptionsList = function (parameterId) {
+                return _.find(scope.parameterList, {'id': parameterId})["optionList"];
+            };
             control.setList = function(parameterList) {
+                scope.parameterList = parameterList;
+                scope.multiselectModel = {};
                 var html = "";
                 for (var i = 0; i < parameterList.length; i++) {
                     html += getParameterHtml(parameterList[i], attrs.editable);
                 }
-                element.html(html);
+                element.replaceWith($compile(element.html(html))(scope));
+
                 element.find("input, select").bind("change", function() {
                     callback(this, scope);
                 });
@@ -390,13 +404,16 @@
                         parameterList.push(parameter);
                     }
                 });
+                angular.forEach(scope.multiselectModel, function(value, key) {
+                    parameterList.push({id: key, value: value});
+                });
                 return parameterList;
             }
 
             control.getRequiredFields = function() {
                 var requiredFields = "";
                 var count = 0;
-                element.find("input, select").each(function() {
+                element.find("input, select, multiselect").each(function() {
                     if ($(this).attr("is-required") === "true") {
                         var requiredField = getRequiredField(this);
                         if (requiredField !== "") {
@@ -418,7 +435,7 @@
     }
 }
 
-appDS2.directive('parameterBlock', [ "$log", "PARAMETER", "UtilityService",
+appDS2.directive('parameterBlock', [ "$log", "PARAMETER", "UtilityService", "$compile",
     parameterBlockDirective ]);
 
 
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/directives/parameterBlockDirective.js.orig b/vid-app-common/src/main/webapp/app/vid/scripts/directives/parameterBlockDirective.js.orig
deleted file mode 100644
index 0e93782..0000000
--- a/vid-app-common/src/main/webapp/app/vid/scripts/directives/parameterBlockDirective.js.orig
+++ /dev/null
@@ -1,507 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * VID
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *      http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-"use strict";
-
-var parameterBlockDirective = function($log, PARAMETER, UtilityService) {
-    /*
-     * If "IS_SINGLE_OPTION_AUTO_SELECTED" is set to "true" ...
-     * 
-     * IF these 3 conditions all exist:
-     * 
-     * 1) The parameter type is PARAMETER.SELECT
-     * 
-     * 2) AND the "prompt" attribute is set to a string.
-     *
-     * 3) AND the optionList" only contains a single entry
-     * 
-     * THEN the "prompt" will not be displayed as an initial select option.
-     */
-
-    var IS_SINGLE_OPTION_AUTO_SELECTED = true;
-
-    /*
-     * Optionally remove "nameStyle" and "valueStyle" "width" entries to set
-     * dynamic sizing.
-     */
-    var tableStyle = "width: auto; margin: 0 auto; border-collapse: collapse; border: none;";
-    var nameStyle = "width: 220px; text-align: left; vertical-align: middle; font-weight: bold; padding: 3px 5px; border: none;";
-    var valueStyle = "width: 400px; text-align: left; vertical-align: middle; padding: 3px 5px; border: none;";
-    var checkboxValueStyle = "width: 400px; text-align: center; vertical-align: middle; padding: 3px 5px; border: none;"
-    var textInputStyle = "height: 25px; padding: 2px 5px;";
-    var checkboxInputStyle = "height: 18px; width: 18px; padding: 2px 5px;";
-    var selectStyle = "height: 25px; padding: 2px; text-align: center;";
-    var requiredLabelStyle = "width: 25px; padding: 5px 10px 10px 5px;";
-
-
-    var getParameterHtml = function(parameter, editable) {
-        var style = valueStyle;
-        var attributeString = "";
-        if (parameter.type === PARAMETER.BOOLEAN) {
-            style = checkboxValueStyle;
-        }
-        if (UtilityService.hasContents(parameter.description)) {
-            attributeString += " title=' " + parameter.description + " '";
-        }
-        var rowstyle='';
-        if(parameter.type == 'file' && !parameter.isVisiblity){
-            rowstyle = ' style="display:none;"';
-        }
-        var html = "<tr"+rowstyle+"><td style='" + nameStyle + "'" + attributeString + ">"
-            + getNameHtml(parameter) + "</td>";
-        if (editable === undefined) {
-            if (UtilityService.hasContents(parameter.value)) {
-                html += "<td data-tests-id='" +  getParameterName(parameter) + "' style='" + style + "'>" + parameter.value;
-            } else {
-                html += "<td data-tests-id='" +  getParameterName(parameter) + "' style='" + style + "'>";
-            }
-        } else {
-            html += "<td style='" + style + "'>" + getValueHtml(parameter);
-        }
-        html += "</td></tr>";
-        return html;
-    };
-
-    var updateParameter = function(parameter, element, editable) {
-        $(element).parent().parent().children("td").first().html(
-            getNameHtml(parameter));
-        if (editable === undefined) {
-            $(element).html(parameter.value);
-        } else {
-            $(element).parent().html(getValueHtml(parameter));
-        }
-    };
-
-    var getNameHtml = function(parameter) {
-        if (parameter.isVisible === false) {
-            return "";
-        }
-        var name = getParameterName(parameter);
-
-        var requiredLabel = "";
-        if (parameter.isRequired) {
-            requiredLabel = "<img src='app/vid/images/asterisk.png' style='"
-                + requiredLabelStyle + "'></img>";
-        }
-        return name + ":" + requiredLabel;
-    };
-
-    var getParameterName = function(parameter) {
-        var name = "";
-        if (UtilityService.hasContents(parameter.name)) {
-            name = parameter.name;
-        } else {
-            name = parameter.id;
-        }
-        return name;
-    }
-
-    var getValueHtml = function(parameter) {
-
-        var textInputPrompt = "Enter data";
-        var attributeString = " data-tests-id='" + parameter.id +"' parameter-id='" + parameter.id + "'";
-        var additionalStyle = "";
-        if (parameter.isEnabled === false) {
-            attributeString += " disabled='disabled'";
-        }
-        if (parameter.isRequired) {
-            attributeString += " is-required='true'";
-        }
-        if (UtilityService.hasContents(parameter.description)) {
-            attributeString += " title=' " + parameter.description + " '";
-        }
-        if (UtilityService.hasContents(parameter.isReadOnly) && (parameter.isReadOnly === true)) {
-            attributeString += " readonly";
-        }
-        if ( (UtilityService.hasContents(parameter.maxLength)) && (UtilityService.hasContents(parameter.minLength)) ) {
-            attributeString += " pattern='.{" + parameter.minLength + "," + parameter.maxLength + "}' required";
-        }
-        else if (UtilityService.hasContents(parameter.maxLength)) {
-            attributeString += " maxlength='" + parameter.maxLength + "'";
-        }
-        else if (UtilityService.hasContents(parameter.minLength)) {
-            attributeString += " pattern='.{" + parameter.minLength + ",}'"
-        }
-        if (parameter.isVisible === false) {
-            additionalStyle = " visibility: hidden;";
-        }
-
-        var name = "";
-        if (UtilityService.hasContents(parameter.name)) {
-            name = parameter.name;
-        } else {
-            name = parameter.id;
-        }
-        attributeString += " parameter-name='" + name + "'";
-
-        if ( parameter.type === PARAMETER.MAP ) {
-            textInputPrompt = "{<key1>: <value1>,\.\.\.,<keyN>: <valueN>}";
-        }
-
-        if ( parameter.type === PARAMETER.LIST ) {
-            textInputPrompt = "[<value1>,\.\.\.,<valueN>]";
-        }
-
-        switch (parameter.type) {
-            case PARAMETER.BOOLEAN:
-                if (parameter.value) {
-                    return "<select" + attributeString + " style='" + selectStyle
-                        + additionalStyle + "'>" + "<option value=true>true</option>"
-                        + "<option value=false>false</option>";
-                    + "</select>";
-                }else{
-                    return "<select" + attributeString + " style='" + selectStyle
-                        + additionalStyle + "'>" + "<option value=false>false</option>"
-                        + "<option value=true>true</option>"
-                        + "</select>";
-                }
-                break;
-            case PARAMETER.CHECKBOX:
-                if (parameter.value) {
-                    return "<input type='checkbox' "+attributeString+ " checked='checked' style='"+checkboxInputStyle+"'"
-                        + " value='true'/>";
-                }else{
-                    return "<input type='checkbox' "+attributeString+ "' style='"+checkboxInputStyle+"'"
-                        + " value='false'/>";
-                }
-                break;
-            case PARAMETER.FILE:
-                return "<input type='file' "+attributeString+ " id='"+parameter.id+"' value='"+parameter.value+"'/>";
-                break;
-            case PARAMETER.NUMBER:
-                var value=parameter.value;
-                var parameterSpec = "<input type='number'" + attributeString + " style='" + textInputStyle + additionalStyle + "'";
-
-                if ( UtilityService.hasContents(parameter.min) ) {
-                    parameterSpec += " min='" + parameter.min + "'";
-                }
-                if ( UtilityService.hasContents(parameter.max) ) {
-                    parameterSpec += " max='" + parameter.max + "'";
-                }
-                if (UtilityService.hasContents(value)) {
-                    parameterSpec += " value='" + value + "'";
-                }
-                parameterSpec += ">";
-
-                /*if(!isNaN(value) && value.toString().index('.') != -1){
-                 //float
-                 return "<input type='text'" + attributeString + " style='"
-                 + textInputStyle + additionalStyle + "' only-integers" + value
-                 + "></input>";
-                 } else {
-                 //integer
-                 return "<input type='text'" + attributeString + " style='"
-                 + textInputStyle + additionalStyle + "'  only-float" + value
-                 + "></input>";
-                 }*/
-                return (parameterSpec);
-                break;
-            case PARAMETER.SELECT:
-                if (UtilityService.hasContents(parameter.prompt)) {
-                    attributeString += " prompt='" + parameter.prompt + "'";
-                }
-                return "<select" + attributeString + " style='" + selectStyle
-                    + additionalStyle + "'>" + getOptionListHtml(parameter)
-                    + "</select>";
-                break;
-            case PARAMETER.STRING:
-            default:
-                var value = "";
-                if (UtilityService.hasContents(parameter.value)) {
-                    value = " value='" + parameter.value + "'";
-                }
-                if (UtilityService.hasContents(parameter.prompt)) {
-                    attributeString += " placeholder='" + parameter.prompt + "'";
-                } else if (textInputPrompt !== "") {
-                    attributeString += " placeholder='" + textInputPrompt + "'";
-                }
-                var finalString = "<input type='text'" + attributeString + " style='"
-                    + textInputStyle + additionalStyle + "'" + value
-                    + ">";
-                return finalString;
-        }
-    };
-
-
-    var getBooleanListHtml = function(parameter){
-        var html = "";
-
-    };
-
-    var getOptionListHtml = function(parameter) {
-
-<<<<<<< HEAD
-	var html = "";
-
-	if (!angular.isArray(parameter.optionList)
-		|| parameter.optionList.length === 0) {
-	    return "";
-	}
-
-	if (UtilityService.hasContents(parameter.prompt)) {
-	    if (!(IS_SINGLE_OPTION_AUTO_SELECTED && parameter.optionList.length === 1) || !(parameter.isSingleOptionAutoSelected && parameter.optionList.length === 1)) {
-		html += "<option value=''>" + parameter.prompt + "</option>";
-	    }
-	}
-
-	for (var i = 0; i < parameter.optionList.length; i++) {
-	    var option = parameter.optionList[i];
-	    var name = option.name;
-	    var value = "";
-	    if (option.id === undefined) {
-		value = option.name;
-	    } else {
-		if (name === undefined) {
-		    name = option.id;
-		}
-		value = option.id;
-	    }
-	    if (option.isDefault === undefined || option.isDefault === false )  {
-	    	html += "<option value='" + value + "'>" + name + "</option>";
-	    }
-	    else {
-	    	html += "<option value='" + value + "' selected>" + name + "</option>";
-	    }
-	}
-	return html;
-=======
-        var html = "";
-
-        if (!angular.isArray(parameter.optionList)
-            || parameter.optionList.length === 0) {
-            return "";
-        }
-
-        if (UtilityService.hasContents(parameter.prompt)) {
-            if (!(IS_SINGLE_OPTION_AUTO_SELECTED && parameter.optionList.length === 1)) {
-                html += "<option value=''>" + parameter.prompt + "</option>";
-            }
-        }
-
-        for (var i = 0; i < parameter.optionList.length; i++) {
-            var option = parameter.optionList[i];
-            var name = option.name;
-            var value = "";
-            if (option.id === undefined) {
-                value = option.name;
-            } else {
-                if (name === undefined) {
-                    name = option.id;
-                }
-                value = option.id;
-            }
-            html += getOptionHtml(option.isPermitted, option.isDataLoading, value, name, parameter);
-        }
-        return html;
->>>>>>> 7e45cad... merge
-    };
-
-    function getOptionHtml(isPermitted, isDefault, value, name, parameter) {
-        var html = "";
-        if (isDefault === undefined || isDefault === false )  {
-            if(isPermitted)
-                html = "<option class='" + parameter.id + "Option' value='" + value + "'>" + name + "</option>";
-            else {
-                html = "<option class='" + parameter.id + "Option' value='" + value + "' disabled>" + name + "</option>";
-            }
-        }
-        else {
-            if(isPermitted)
-                html = "<option class='" + parameter.id + "Option' value='" + value + "'>" + "' selected>"  + name + "</option>";
-            else {
-                html = "<option class='" + parameter.id + "Option' value='" + value + "' disabled>" + "' selected>"  + name + "</option>";
-            }
-        }
-        return html;
-    }
-
-    var getParameter = function(element, expectedId) {
-        var id = $(element).attr("parameter-id");
-        if (expectedId !== undefined && expectedId !== id) {
-            return undefined;
-        }
-        var parameter = {
-            id : id
-        };
-        if ($(element).prop("type") === "checkbox") {
-            parameter.value = $(element).prop("checked");
-        }else if ($(element).prop("type") === "file") {
-            parameter.value = $('#'+id).attr("value");
-
-        } else {
-            if ($(element).prop("type") === "text") {
-                $(element).val($(element).val().trim());
-            }
-            parameter.value = $(element).val();
-        }
-        if ($(element).prop("selectedIndex") === undefined) {
-            parameter.selectedIndex = -1;
-        } else {
-            parameter.selectedIndex = $(element).prop("selectedIndex");
-            if (UtilityService.hasContents($(element).attr("prompt"))) {
-                parameter.selectedIndex--;
-            }
-        }
-        return parameter;
-    };
-
-    var getRequiredField = function(element) {
-        if ($(element).prop("type") === "text") {
-            $(element).val($(element).val().trim());
-        }
-        if ($(element).val() === "" || $(element).val() === null) {
-            return '"' + $(element).attr("parameter-name") + '"';
-        } else {
-            return "";
-        }
-    };
-
-    var callback = function(element, scope) {
-        scope.callback({
-            id : $(element).attr("parameter-id")
-        });
-    };
-
-    return {
-        restrict : "EA",
-        replace  : true,
-        template : "<div><table style='" + tableStyle + "'></table></div>",
-        scope : {
-            control : "=",
-            callback : "&"
-        },
-        link : function(scope, element, attrs) {
-
-            var control = scope.control || {};
-
-            control.setList = function(parameterList) {
-                var html = "";
-                for (var i = 0; i < parameterList.length; i++) {
-                    html += getParameterHtml(parameterList[i], attrs.editable);
-                }
-                element.html(html);
-                element.find("input, select").bind("change", function() {
-                    callback(this, scope);
-                });
-            }
-
-            control.updateList = function(parameterList) {
-                element.find("input, select").each(
-                    function() {
-                        for (var i = 0; i < parameterList.length; i++) {
-                            if (parameterList[i].id === $(this).attr(
-                                    "parameter-id")) {
-                                updateParameter(parameterList[i], this,
-                                    attrs.editable);
-                            }
-                        }
-                    });
-                element.find("input, select").bind("change", function() {
-                    callback(this, scope);
-                });
-            }
-
-            control.getList = function(expectedId) {
-                var parameterList = new Array();
-                element.find("input, select").each(function() {
-                    var parameter = getParameter(this, expectedId);
-                    if (parameter !== undefined) {
-                        parameterList.push(parameter);
-                    }
-                });
-                return parameterList;
-            }
-
-            control.getRequiredFields = function() {
-                var requiredFields = "";
-                var count = 0;
-                element.find("input, select").each(function() {
-                    if ($(this).attr("is-required") === "true") {
-                        var requiredField = getRequiredField(this);
-                        if (requiredField !== "") {
-                            if (++count == 1) {
-                                requiredFields = requiredField;
-                            }
-                        }
-                    }
-                });
-                if (--count <= 0) {
-                    return requiredFields;
-                } else if (count == 1) {
-                    return requiredFields + " and 1 other field";
-                } else {
-                    return requiredFields + " and " + count + " other fields";
-                }
-            }
-        }
-    }
-}
-
-appDS2.directive('parameterBlock', [ "$log", "PARAMETER", "UtilityService",
-    parameterBlockDirective ]);
-
-
-appDS2.directive('onlyIntegers', function () {
-    return  {
-        restrict: 'A',
-        link: function (scope, elm, attrs, ctrl) {
-            elm.on('keydown', function (event) {
-                if(event.shiftKey){event.preventDefault(); return false;}
-                //console.log(event.which);
-                if ([8, 13, 27, 37, 38, 39, 40].indexOf(event.which) > -1) {
-                    // backspace, enter, escape, arrows
-                    return true;
-                } else if (event.which >= 49 && event.which <= 57) {
-                    // numbers
-                    return true;
-                } else if (event.which >= 96 && event.which <= 105) {
-                    // numpad number
-                    return true;
-                }
-                // else if ([110, 190].indexOf(event.which) > -1) {
-                //     // dot and numpad dot
-                //     return true;
-                // }
-                else {
-                    event.preventDefault();
-                    return false;
-                }
-            });
-        }
-    }
-});
-
-appDS2.directive('onlyFloat', function () {
-    return  {
-        restrict: 'A',
-        link: function (scope, elm, attrs, ctrl) {
-            elm.on('keydown', function (event) {
-                if ([110, 190].indexOf(event.which) > -1) {
-                    // dot and numpad dot
-                    event.preventDefault();
-                    return true;
-                }
-                else{
-                    return false;
-                }
-            });
-        }
-    }
-});
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/directives/progressBarDirective.js b/vid-app-common/src/main/webapp/app/vid/scripts/directives/progressBarDirective.js
index ed71436..76585f4 100755
--- a/vid-app-common/src/main/webapp/app/vid/scripts/directives/progressBarDirective.js
+++ b/vid-app-common/src/main/webapp/app/vid/scripts/directives/progressBarDirective.js
@@ -58,7 +58,7 @@
  * called immediately after HTML is rendered. This is due to a timing-related
  * behavior.
  * 
- * 3) The progress bar displays values of "0" and "100" if precentProgress is,
+ * 3) The progress bar displays values of "0" and "100" if percentProgress is,
  * respectively, less than 0 or greater than 100.
  * 
  * CUSTOM STYLING:
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/directives/search.js b/vid-app-common/src/main/webapp/app/vid/scripts/directives/search.js
new file mode 100644
index 0000000..05ae121
--- /dev/null
+++ b/vid-app-common/src/main/webapp/app/vid/scripts/directives/search.js
@@ -0,0 +1,11 @@
+"use strict";
+
+appDS2.directive('searchText', function() {
+    return {
+        restrict : "E",
+        templateUrl: 'app/vid/scripts/view-models/search.htm',
+        scope: {
+            searchString : '='
+        }
+    }
+});
\ No newline at end of file
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/directives/serviceMetadata.js b/vid-app-common/src/main/webapp/app/vid/scripts/directives/serviceMetadata.js
new file mode 100644
index 0000000..1c15f70
--- /dev/null
+++ b/vid-app-common/src/main/webapp/app/vid/scripts/directives/serviceMetadata.js
@@ -0,0 +1,34 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * VID
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+"use strict";
+
+appDS2.directive('serviceMetadata', function() {
+    return {
+        restrict : "E",
+        templateUrl: 'app/vid/scripts/view-models/serviceMetadata.htm',
+        scope: {
+            serviceMetadataFields : '=',
+            titleTxt: '@'
+        },
+        link : function(scope, element, attrs) {
+        }
+    }
+});
\ No newline at end of file
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/modals/alert-change-management/alert-change-management.html b/vid-app-common/src/main/webapp/app/vid/scripts/modals/alert-change-management/alert-change-management.html
index bdc95c9..60596f4 100644
--- a/vid-app-common/src/main/webapp/app/vid/scripts/modals/alert-change-management/alert-change-management.html
+++ b/vid-app-common/src/main/webapp/app/vid/scripts/modals/alert-change-management/alert-change-management.html
@@ -1,4 +1,4 @@
-<link rel="stylesheet" type="text/css" href="app/vid/scripts/modals/new-change-management/new-change-management.css" />
+<link rel="stylesheet" type="text/css" href="app/vid/styles/modal-create-new.css" />
 <link rel="stylesheet" type="text/css" href="app/vid/scripts/modals/alert-change-management/alert-change-management.css" />
 <div class="modal-header">
     <h3 class="modal-title" id="alert-modal-header">On Hold</h3>
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/modals/alert-modal/alert-modal.controller.js b/vid-app-common/src/main/webapp/app/vid/scripts/modals/alert-modal/alert-modal.controller.js
new file mode 100644
index 0000000..6cb3f9c
--- /dev/null
+++ b/vid-app-common/src/main/webapp/app/vid/scripts/modals/alert-modal/alert-modal.controller.js
@@ -0,0 +1,33 @@
+(function () {
+    'use strict';
+
+    appDS2.controller("alertModalController", ["$uibModalInstance", "jobInfo",
+        "$log", alertModalController]);
+
+    function alertModalController($uibModalInstance, jobInfo,  $log) {
+        var vm = this;
+        var init = function() {
+            if (jobInfo) {
+                vm.content = jobInfo.message;
+                vm.mode = jobInfo.status;
+                if (vm.mode == "failed") {
+                    vm.Header = "Failed"
+                } else if (vm.mode == "confirm") {
+                    vm.Header = "Confirm"
+                } else {
+                    vm.Header = "Success"
+                }
+            }
+        };
+
+        vm.close = function () {
+            $uibModalInstance.close();
+        };
+
+        vm.ok = function () {
+            $uibModalInstance.close(true);
+        };
+
+        init();
+    }
+})();
\ No newline at end of file
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/modals/alert-modal/alert-modal.css b/vid-app-common/src/main/webapp/app/vid/scripts/modals/alert-modal/alert-modal.css
new file mode 100644
index 0000000..85382b0
--- /dev/null
+++ b/vid-app-common/src/main/webapp/app/vid/scripts/modals/alert-modal/alert-modal.css
@@ -0,0 +1,15 @@
+.modal-header  {
+    border-bottom-color:  #ffb81c;
+}
+.modal-header.success {
+    border-bottom: 3px solid #4ca90c;
+}
+.modal-header.failed {
+    border-bottom: 3px solid #cf2a2a;
+}
+.modal-header.confirm {
+    border-bottom: 3px solid #009FDB;
+}
+.modal-footer {
+    border-radius: 0 0 6px 6px;
+}
\ No newline at end of file
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/modals/alert-modal/alert-modal.html b/vid-app-common/src/main/webapp/app/vid/scripts/modals/alert-modal/alert-modal.html
new file mode 100644
index 0000000..4fa9d45
--- /dev/null
+++ b/vid-app-common/src/main/webapp/app/vid/scripts/modals/alert-modal/alert-modal.html
@@ -0,0 +1,15 @@
+<link rel="stylesheet" type="text/css" href="app/vid/styles/modals.css">
+<link rel="stylesheet" type="text/css" href="app/vid/scripts/modals/alert-modal/alert-modal.css" />
+<div class="modal-header" ng-class="vm.mode">
+    <span class="modal-title"  id="alert-modal-header">{{vm.Header}}</span>
+    <span id="cancel" ng-click="vm.close()" class="pull-right modal-close" aria-hidden="true">&times;</span>
+</div>
+<div class="modal-body">
+    <span id="failed-modal-content">{{vm.content}}</span>
+</div>
+<div class="modal-footer">
+    <div class="pull-right">
+        <button data-tests-id="ok" id="ok-button" name="ok" class="btn"
+                ng-click="vm.ok()">OK</button>
+    </div>
+</div>
\ No newline at end of file
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/modals/alert-new-scheduler/alert-new-scheduler.controller.js b/vid-app-common/src/main/webapp/app/vid/scripts/modals/alert-new-scheduler/alert-new-scheduler.controller.js
deleted file mode 100644
index 2c5eabe..0000000
--- a/vid-app-common/src/main/webapp/app/vid/scripts/modals/alert-new-scheduler/alert-new-scheduler.controller.js
+++ /dev/null
@@ -1,33 +0,0 @@
-(function () {
-    'use strict';
-
-    appDS2.controller("alertNewSchedulerController", ["$uibModalInstance", "jobInfo", "MsoService", "COMPONENT",
-        "$log", alertNewSchedulerController]);
-
-    function alertNewSchedulerController($uibModalInstance, jobInfo, MsoService, COMPONENT, $log) {
-        var vm = this;
-
-        vm.manualTasks = [];
-        vm.MANUAL_TASKS = COMPONENT.MANUAL_TASKS;
-        var init = function() {
-            if (jobInfo) {
-                vm.content = jobInfo;
-            } else {
-                vm.content = "Successfully";
-            }
-
-          
-
-        };
-
-        
-
-      
-
-        vm.close = function () {
-            $uibModalInstance.close();
-        };
-
-        init();
-    }
-})();
\ No newline at end of file
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/modals/alert-new-scheduler/alert-new-scheduler.css b/vid-app-common/src/main/webapp/app/vid/scripts/modals/alert-new-scheduler/alert-new-scheduler.css
deleted file mode 100644
index 316c2e4..0000000
--- a/vid-app-common/src/main/webapp/app/vid/scripts/modals/alert-new-scheduler/alert-new-scheduler.css
+++ /dev/null
@@ -1,3 +0,0 @@
-.modal-header h3 {
-    border-bottom: 3px solid #ffb81c;
-}
\ No newline at end of file
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/modals/alert-new-scheduler/alert-new-scheduler.html b/vid-app-common/src/main/webapp/app/vid/scripts/modals/alert-new-scheduler/alert-new-scheduler.html
deleted file mode 100644
index e6255cf..0000000
--- a/vid-app-common/src/main/webapp/app/vid/scripts/modals/alert-new-scheduler/alert-new-scheduler.html
+++ /dev/null
@@ -1,12 +0,0 @@
-<link rel="stylesheet" type="text/css" href="app/vid/scripts/modals/new-change-management/new-change-management.css" />
-<link rel="stylesheet" type="text/css" href="app/vid/scripts/modals/alert-change-management/alert-change-management.css" />
-<div class="modal-header">
-    <h3 class="modal-title" id="alert-modal-header">Response From Server</h3>
-    <span id="cancel" ng-click="vm.close()" class="pull-right modal-close" aria-hidden="true">&times;</span>
-</div>
-<div class="modal-body">
-    <span id="alert-modal-content">{{vm.content}}</span>
-</div>
-<div class="modal-footer">
-<!--     <div ng-include="'app/vid/scripts/modals/change-management-manual-tasks-controller/change-management-manual-tasks.html'"></div> -->
-</div>
\ No newline at end of file
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/modals/attach-test-env-manifest/attach-test-env-manifest.controller.js b/vid-app-common/src/main/webapp/app/vid/scripts/modals/attach-test-env-manifest/attach-test-env-manifest.controller.js
new file mode 100644
index 0000000..9302404
--- /dev/null
+++ b/vid-app-common/src/main/webapp/app/vid/scripts/modals/attach-test-env-manifest/attach-test-env-manifest.controller.js
@@ -0,0 +1,58 @@
+(function () {
+    'use strict';
+
+    appDS2.controller("attachTestEnvManifestController", ["$uibModalInstance", "$uibModal", "$log", "$scope",
+        attachTestEnvManifestController]);
+
+    function attachTestEnvManifestController($uibModalInstance, $uibModal, $log, $scope) {
+        var vm = this;
+
+        var init = function () {
+            vm.manifest = "";
+            vm.error="";
+        };
+
+        vm.close = function () {
+            $uibModalInstance.close();
+        };
+
+        vm.submit = function () {
+            $uibModalInstance.close(vm.manifest);
+        };
+
+        vm.isSubmitDisabled = function () {
+            return !(vm.manifest);
+        };
+
+
+
+        /*
+        Must be $scope because we bind to the onchange of the html (cannot attached to vm variable).
+        We use scope because angular doesn't support ng-change on input file
+        https://github.com/angular/angular.js/issues/1375
+        https://stackoverflow.com/questions/17922557/angularjs-how-to-check-for-changes-in-file-input-fields
+         */
+        $scope.selectAttachmentManifest = function (fileInput) {
+            if (fileInput && fileInput.id) {
+                vm.manifest = "";
+                vm.error="";
+                var file = fileInput.files[0];
+                vm.filename=file.name;
+                var fileReader = new FileReader();
+                fileReader.onload = function (load) {
+                    try {
+                        var lines = load.target.result;
+                        vm.manifest = JSON.parse(lines);
+                    } catch (error) {
+                        $log.error(error);
+                        vm.error = "file: " + vm.filename + " is not a valid JSON"
+                    }
+                    $scope.$apply();
+                };
+                fileReader.readAsText(file);
+            }
+        };
+
+        init();
+    }
+})();
\ No newline at end of file
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/modals/attach-test-env-manifest/attach-test-env-manifest.css b/vid-app-common/src/main/webapp/app/vid/scripts/modals/attach-test-env-manifest/attach-test-env-manifest.css
new file mode 100644
index 0000000..ff06add
--- /dev/null
+++ b/vid-app-common/src/main/webapp/app/vid/scripts/modals/attach-test-env-manifest/attach-test-env-manifest.css
@@ -0,0 +1,109 @@
+.modal-header {
+    border: none!important;
+    padding: 10px 20px 0px 20px!important;
+    font-family: "OpenSans-Light";
+    font-size: 22px;
+    color: #000000;
+}
+
+.modal-header h3 {
+    font-family: "OpenSans-Light";
+    color:  #000000;
+    color:  #000000;
+    font-size: 22px;
+    font-weight: 300;
+    line-height: 16px;
+    padding-bottom: 20px;
+    border-bottom: 3px solid #009fdb;
+
+}
+
+.control-label {
+    font-family: "OpenSans-Light";
+    color: #5a5a5a;
+    font-size: 13px;
+    font-weight: 400;
+}
+
+.modal-content {
+    width: 468px;
+    height: 242px;
+    border-radius: 8px;
+    background-color:  #ffffff;
+}
+
+body .modal-body {
+    padding-bottom: 0;
+    padding-top: 0;
+    padding-left: 20px;
+    padding-right: 20px;
+    width: 468px;
+    height: 91px;
+}
+
+.modal-footer {
+    margin-top: 0;
+    background-color: #fff;
+}
+
+
+.modal-close {
+    margin: -60px 5px 0 0;
+    color: #5a5a5a;
+    font-size: 20px;
+    cursor: pointer;
+}
+
+.inputfile {
+    width: 0.1px;
+    height: 0.1px;
+    opacity: 0;
+    overflow: hidden;
+    position: absolute;
+    z-index: -1;
+}
+
+.manifestName{
+    font-family: OpenSans-Semibold;
+    font-size: 12px;
+    color: #191919;
+}
+
+.manifestFileName {
+    width: 389px;
+    height: 37px;
+    background: #FFFFFF;
+    border: 1px solid #D2D2D2;
+    border-radius: 2px;
+    display: inline-block;
+    line-height: 37px;
+    font-weight: normal !important;
+    padding-left: 3px;
+    border-bottom-right-radius: 0;
+    border-top-right-radius: 0;
+}
+
+.elipsisImg {
+    width: 37px;
+    padding: 10px;
+    background: #FFFFFF;
+    border: 1px solid #D2D2D2;
+    display: inline-block;
+    cursor: pointer;
+    vertical-align: top;
+    border-radius: 2px;
+    border-bottom-left-radius: 0;
+    border-top-left-radius: 0;
+}
+
+.labelForImage {
+    vertical-align: top;
+}
+
+.errorLabel {
+    color: red;
+}
+
+
+
+
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/modals/attach-test-env-manifest/attach-test-env-manifest.html b/vid-app-common/src/main/webapp/app/vid/scripts/modals/attach-test-env-manifest/attach-test-env-manifest.html
new file mode 100644
index 0000000..12e0ab3
--- /dev/null
+++ b/vid-app-common/src/main/webapp/app/vid/scripts/modals/attach-test-env-manifest/attach-test-env-manifest.html
@@ -0,0 +1,26 @@
+<link rel="stylesheet" type="text/css" href="app/vid/styles/modal-buttons.css">
+<link rel="stylesheet" type="text/css"
+      href="app/vid/scripts/modals/attach-test-env-manifest/attach-test-env-manifest.css"/>
+<div class="modal-header">
+    <h3 id="modal-title">Attach Manifest</h3>
+    <span ng-click="vm.close()" class="pull-right modal-close" aria-hidden="true">&times;</span>
+</div>
+<form name="Attach Manifest" ng-submit="vm.submit()">
+    <div class="modal-body">
+        <label id="manifestName"  class="manifestName">Manifest Name</label>
+        <input onchange="angular.element(this).scope().selectAttachmentManifest(this)" type="file"
+               id="testEnvManifestFileInput" class="inputfile" accept=".json"/>
+        <label id="manifestFileName"  class="manifestFileName">{{vm.filename}}</label><label for="testEnvManifestFileInput" class="labelForImage" >
+            <span class="icon-browse"></span>
+        </label><label id="errorLabel" class="errorLabel">{{vm.error}}</label>
+
+    </div>
+    <div class="modal-footer">
+        <div class="pull-right">
+            <button type="submit" id="submit" name="submit" class="btn btn-primary"
+                   ng-disabled="vm.isSubmitDisabled()">Attach
+            </button>
+            <button type="button" id="cancel" name="cancel" class="btn btn-white" ng-click="vm.close()">Cancel</button>
+        </div>
+    </div>
+</form>
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/modals/cancel-pending-workflow/cancel-pending-workflow.controller.js b/vid-app-common/src/main/webapp/app/vid/scripts/modals/cancel-pending-workflow/cancel-pending-workflow.controller.js
new file mode 100644
index 0000000..a04e127
--- /dev/null
+++ b/vid-app-common/src/main/webapp/app/vid/scripts/modals/cancel-pending-workflow/cancel-pending-workflow.controller.js
@@ -0,0 +1,29 @@
+(function () {
+    'use strict';
+
+    appDS2.controller("cancelPendingWorkflowController", ["$scope", "$uibModalInstance", "changeManagement",
+        "$log", cancelPendingWorkflowController]);
+
+    function cancelPendingWorkflowController($scope, $uibModalInstance, changeManagement, $log) {
+        var vm = this;
+
+        function init() {
+            if (changeManagement) {
+                vm.workflow = changeManagement;
+            } else {
+                console.log("Pending Workflow is undefined: ", changeManagement);
+                vm.workflow = null;
+            }
+        }
+
+        vm.close = function () {
+            $uibModalInstance.close();
+        };
+
+        vm.ok = function () {
+            $uibModalInstance.close(true);
+        };
+
+        init();
+    }
+})();
\ No newline at end of file
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/modals/cancel-pending-workflow/cancel-pending-workflow.css b/vid-app-common/src/main/webapp/app/vid/scripts/modals/cancel-pending-workflow/cancel-pending-workflow.css
new file mode 100644
index 0000000..daf8653
--- /dev/null
+++ b/vid-app-common/src/main/webapp/app/vid/scripts/modals/cancel-pending-workflow/cancel-pending-workflow.css
@@ -0,0 +1,16 @@
+.modal {
+    position: inherit;
+    text-align: left;
+}
+.modal-dialog {
+    position: absolute;
+    right: 0;
+    display: inline;
+    margin-top: -243px;
+}
+.modal-header {
+    border-bottom-color: #009FDB;
+}
+.modal-content {
+    width: 540px;
+}
\ No newline at end of file
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/modals/cancel-pending-workflow/cancel-pending-workflow.html b/vid-app-common/src/main/webapp/app/vid/scripts/modals/cancel-pending-workflow/cancel-pending-workflow.html
new file mode 100644
index 0000000..6dca76d
--- /dev/null
+++ b/vid-app-common/src/main/webapp/app/vid/scripts/modals/cancel-pending-workflow/cancel-pending-workflow.html
@@ -0,0 +1,14 @@
+<link rel="stylesheet" type="text/css" href="app/vid/styles/modals.css">
+<link rel="stylesheet" type="text/css" href="app/vid/scripts/modals/cancel-pending-workflow/cancel-pending-workflow.css"/>
+<div class="modal-header">
+    <span class="modal-title" id="pending-modal-header">Pending</span>
+    <span id="cancel" ng-click="vm.close()" class="pull-right modal-close" aria-hidden="true">&times;</span>
+</div>
+<div class="modal-body" id="modal-body">
+    Are you sure you want to delete workflow
+    <br/>
+    {{vm.workflow.scheduleRequest.scheduleName}}?
+</div>
+<div class="modal-footer">
+    <button class="btn btn-cancel-workflow" data-tests-id="cancel" ng-click="vm.ok()">Cancel Workflow</button>
+</div>
\ No newline at end of file
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/modals/failed-change-management/failed-change-management.html b/vid-app-common/src/main/webapp/app/vid/scripts/modals/failed-change-management/failed-change-management.html
index 0deaf93..d51620d 100644
--- a/vid-app-common/src/main/webapp/app/vid/scripts/modals/failed-change-management/failed-change-management.html
+++ b/vid-app-common/src/main/webapp/app/vid/scripts/modals/failed-change-management/failed-change-management.html
@@ -1,4 +1,4 @@
-<link rel="stylesheet" type="text/css" href="app/vid/scripts/modals/new-change-management/new-change-management.css" />
+<link rel="stylesheet" type="text/css" href="app/vid/styles/modal-create-new.css" />
 <link rel="stylesheet" type="text/css" href="app/vid/scripts/modals/failed-change-management/failed-change-management.css" />
 <div class="modal-header">
     <h3 class="modal-title" id="failed-modal-header">Failed</h3>
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/modals/in-progress-modal-management/in-progress-change-management.html b/vid-app-common/src/main/webapp/app/vid/scripts/modals/in-progress-modal-management/in-progress-change-management.html
index 9b40db2..615c95c 100644
--- a/vid-app-common/src/main/webapp/app/vid/scripts/modals/in-progress-modal-management/in-progress-change-management.html
+++ b/vid-app-common/src/main/webapp/app/vid/scripts/modals/in-progress-modal-management/in-progress-change-management.html
@@ -1,4 +1,4 @@
-<link rel="stylesheet" type="text/css" href="app/vid/scripts/modals/new-change-management/new-change-management.css" />
+<link rel="stylesheet" type="text/css" href="app/vid/styles/modal-create-new.css" />
 <link rel="stylesheet" type="text/css" href="app/vid/scripts/modals/in-progress-modal-management/in-progress-change-management.css" />
 <div class="modal-header">
     <h3 class="modal-title" id="in-progress-modal-header">In Progress</h3>
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/modals/mso-commit/mso-commit.css b/vid-app-common/src/main/webapp/app/vid/scripts/modals/mso-commit/mso-commit.css
new file mode 100644
index 0000000..6af5a66
--- /dev/null
+++ b/vid-app-common/src/main/webapp/app/vid/scripts/modals/mso-commit/mso-commit.css
@@ -0,0 +1,6 @@
+.modal-dialog .popupContents .log {
+    width: 560px;
+}
+.modal-dialog .cancel-btn {
+    width: 120px;
+}
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/modals/mso-commit/mso-commit.html b/vid-app-common/src/main/webapp/app/vid/scripts/modals/mso-commit/mso-commit.html
new file mode 100644
index 0000000..7698981
--- /dev/null
+++ b/vid-app-common/src/main/webapp/app/vid/scripts/modals/mso-commit/mso-commit.html
@@ -0,0 +1,48 @@
+<!--
+  ============LICENSE_START=======================================================
+  VID
+  ================================================================================
+  Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+  ================================================================================
+  Licensed under the Apache License, Version 2.0 (the "License");
+  you may not use this file except in compliance with the License.
+  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+  ============LICENSE_END=========================================================
+  -->
+<link rel="stylesheet" type="text/css" href="app/vid/scripts/modals/mso-commit/mso-commit.css"/>
+
+<div class="modal-wrapper popupContents" data-tests-id="msoPopup">
+
+    <div class="statusLine">
+        <img src="app/vid/images/spinner.gif"
+             ngx-visible="{{isSpinnerVisible}}"> </img> <label>Status:</label><span
+            class="status" data-tests-id="msoRequestStatus">{{status}}</span>
+    </div>
+
+    <div class="feedback">
+
+        <div progress-bar control="progressBarControl"
+             value="{{percentProgress}}" increases-only="true"
+             ngx-show="{{isProgressVisible}}"></div>
+
+        <div class="error" ng-hide="isProgressVisible">
+            <img src="app/vid/images/error.png"></img>{{error}}
+        </div>
+
+    </div>
+
+    <pre class="log">{{log}}</pre>
+
+    <div class="buttonRow">
+        <button data-tests-id="msoCommitDialogCloseButton" ngx-enabled="{{isCloseEnabled}}" att-button size="small"
+                ng-click="close();">Close</button>
+    </div>
+</div>
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/modals/new-change-management/new-change-management.controller.js b/vid-app-common/src/main/webapp/app/vid/scripts/modals/new-change-management/new-change-management.controller.js
index 14ca43b..f0b85a6 100644
--- a/vid-app-common/src/main/webapp/app/vid/scripts/modals/new-change-management/new-change-management.controller.js
+++ b/vid-app-common/src/main/webapp/app/vid/scripts/modals/new-change-management/new-change-management.controller.js
@@ -1,11 +1,16 @@
 (function () {
     'use strict';
 
-    appDS2.controller("newChangeManagementModalController", ["$uibModalInstance", "$uibModal", "AaiService", "changeManagementService",
-        "$log", "$scope", "_", newChangeManagementModalController]);
+    appDS2.controller("newChangeManagementModalController", ["$uibModalInstance", "$uibModal",'$q', "AaiService", "changeManagementService", "Upload",
+        "$log", "$scope", "_", "COMPONENT", "VIDCONFIGURATION", newChangeManagementModalController]);
 
-    function newChangeManagementModalController($uibModalInstance, $uibModal, AaiService, changeManagementService, $log, $scope, _) {
+    function newChangeManagementModalController($uibModalInstance, $uibModal,$q, AaiService, changeManagementService, Upload, $log, $scope, _, COMPONENT, VIDCONFIGURATION) {
+
         var vm = this;
+        vm.configUpdatePatternError = "Invalid file type. Please select a file with a CSV extension.";
+        vm.configUpdateContentError = "Invalid file structure.";
+
+        vm.softwareVersionRegex = "[-a-zA-Z0-9\.]+";
 
         var init = function () {
             vm.changeManagement = {};
@@ -46,8 +51,8 @@
                                             availableVersions.push(extractVNFModel(vnf, response.data.service, newVNFName));
                                         }
                                     });
-                                    var versions = _.uniqBy(availableVersions, ['modelInfo.modelVersion']);
-                                    newVNFName.availableVersions = _.uniq(versions, response.data.service, true);
+                                    var versions = _.uniqBy(availableVersions, 'modelInfo.modelVersion');
+                                    newVNFName.availableVersions = _.sortBy(_.uniq(versions, response.data.service, true),"modelInfo.modelVersion");
                                 }).catch(function (error) {
                                 $log.error(error);
                             });
@@ -107,23 +112,41 @@
             $uibModalInstance.close();
         };
 
-        vm.schedule = function () {
-            $uibModalInstance.close(vm.changeManagement);
-
-            var modalInstance = $uibModal.open({
-                templateUrl: 'app/vid/scripts/modals/new-scheduler/new-scheduler.html',
-                controller: 'newSchedulerController',
-                controllerAs: 'vm',
-                resolve: {
-                    changeManagement: function () {
-                        return vm.changeManagement;
-                    }
-                }
-            });
-
-            modalInstance.result.then(function (result) {
-                console.log("This is the result of the new change management modal.", result);
+        vm.uploadConfigFile = function (file) {
+            var defer = $q.defer();
+            Upload.upload({
+                url: "change-management/uploadConfigUpdateFile",
+                file: file,
+                transformResponse: [function (data) {
+                    return data;
+                }]
             })
+            .then(function (configUpdateResponse) {
+                vm.changeManagement.configUpdateFile = configUpdateResponse && JSON.parse(configUpdateResponse.data).payload;
+                defer.resolve(true);
+            })
+            .catch(function (error) {
+                defer.resolve(false);
+            });
+            return defer.promise;
+        };
+
+
+        vm.openModal = function () {
+            $scope.widgetParameter = ""; // needed by the scheduler?
+
+            // properties needed by the scheduler so it knows whether to show
+            // policy or sniro related features on the scheduler UI or not.
+            vm.changeManagement.policyYN = "Y";
+            vm.changeManagement.sniroYN = "Y";
+
+            var data = {
+                widgetName: 'Portal-Common-Scheduler',
+                widgetData: vm.changeManagement,
+                widgetParameter: $scope.widgetParameter
+            };
+
+            window.parent.postMessage(data, VIDCONFIGURATION.SCHEDULER_PORTAL_URL);
         };
 
         vm.loadSubscribers = function () {
@@ -165,11 +188,11 @@
                             if (vnfsData[i]) {
                                 const nodeType = vnfsData[i]['node-type'];
                                 if (nodeType === "generic-vnf") {
-                                    _.forEach(vnfsData[i]['related-to'], function (node) {
-                                        if (node['node-type'] === 'vserver') {
-                                            vm.vnfs.push(vnfsData[i]);
-                                        }
-                                    })
+                                    if (_.find(vnfsData[i]['related-to'], function (node) {
+                                            return node['node-type'] === 'vserver'
+                                        }) !== undefined) {
+                                        vm.vnfs.push(vnfsData[i]);
+                                    }
                                 } else if (nodeType === "service-instance") {
                                     vm.serviceInstances.push(vnfsData[i]);
                                 }
@@ -197,63 +220,50 @@
             );
         };
 
+        var fromVNFVersions = [];
+
         vm.loadVNFVersions = function () {
-            vm.fromVNFVersions = [];
+            fromVNFVersions = [];
             vm.serviceInstancesToGetVersions = [];
             var versions = [];
             _.forEach(vm.vnfs, function (vnf) {
                 if (vnf.properties['nf-role'] === vm.changeManagement['vnfType']) {
 
-                vm.serviceInstancesToGetVersions.push(vnf);
+                    vm.serviceInstancesToGetVersions.push({
+                        "model-invariant-id": vnf.properties["model-invariant-id"],
+                        "model-version-id": vnf.properties["model-version-id"] }
+                    );
 
-                versions.push(vnf.properties["model-invariant-id"]);
-
-
+                    versions.push(vnf.properties["model-invariant-id"]);
                 }
             });
 
-            AaiService.getVnfVersionsByInvariantId(versions).then(function (response) {
-                if (response.data) {
-                    var key = response.data.model["0"]["model-invariant-id"];
-                    var value = response.data.model["0"]["model-vers"]["model-ver"]["0"]["model-version"];
-                    var element = {"key": key, "value": value};
-                    vm.fromVNFVersions.push(element);
-                }
-                //TODO promise all and call the new api to get the versions.
-                // vm.fromVNFVersions.push(response.data.model["0"]["model-vers"]["model-ver"]["0"]["model-version"]);
-                // if(vm.serviceInstancesToGetVersions.length > 0){
-                //
-                // var promiseArrOfGetVnfs = preparePromiseArrOfGetVersions('a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb');
-                //
-                // Promise.all(promiseArrOfGetVnfs).then(function (allData) {
-                //     vm.vnfs = _.flattenDeep(_.without(allData, null));
-                //     var filteredVnfs = _.sortedUniqBy(vm.vnfs, function (vnf) {
-                //         return vnf.properties.vnfType;
-                //     });
-                //
-                //     _.forEach(filteredVnfs, function (vnf) {
-                //         vm.vnfTypes.push(vnf.properties.vnfType)
-                //     });
-                //
-                // }).catch(function (error) {
-                //     $log(error);
-                // });
-                // }
-            })
-            // debugger;
+            if (versions.length > 0) {
+                AaiService.getVnfVersionsByInvariantId(versions).then(function (response) {
+                    if (response.data) {
 
+                        $log.debug("getVnfVersionsByInvariantId: response", response);
+
+                        fromVNFVersions = vm.serviceInstancesToGetVersions
+                            .map(function (serviceInstanceToGetVersion) {
+                                const model = _.find(response.data.model, {'model-invariant-id': serviceInstanceToGetVersion['model-invariant-id']});
+                                $log.debug("getVnfVersionsByInvariantId: model for " + serviceInstanceToGetVersion['model-invariant-id'], model);
+
+                                const modelVer = _.find(model["model-vers"]["model-ver"], {'model-version-id': serviceInstanceToGetVersion['model-version-id']});
+                                $log.debug("getVnfVersionsByInvariantId: modelVer for " + serviceInstanceToGetVersion['model-version-id'], modelVer);
+
+                                var modelVersionId = serviceInstanceToGetVersion["model-version-id"];
+                                var modelVersion = modelVer["model-version"];
+
+                                return {"key": modelVersionId, "value": modelVersion};
+                            });
+
+                        vm.fromVNFVersions = _.uniqBy(fromVNFVersions, 'value');
+                    }
+                })
+            }
         };
 
-        // function preparePromiseArrOfGetVersions(serviceInstances) {
-        //     var promiseArr = [];
-        //     for (var i = 0; i < serviceInstances.length; i++) {
-        //         var modelInvariantId = serviceInstances[i].properties["model-invariant-id"];
-        //         promiseArr.push(
-        //             getVnfs(modelInvariantId)
-        //         );
-        //     }
-        //     return promiseArr;
-        // }
 
         function getVnfs(modelInvariantId) {
             return new Promise(function (resolve, reject) {
@@ -281,12 +291,20 @@
             });
         }
 
+        var getVersionNameForId = function(versionId) {
+            var version = _.find(fromVNFVersions, {"key": versionId});
+            return version.value;
+        };
+
         vm.loadVNFNames = function () {
             vm.vnfNames = [];
+            const vnfs = vm.changeManagement.fromVNFVersion ? vm.vnfs : [];
+            _.forEach(vnfs, function (vnf) {
 
-            _.forEach(vm.vnfs, function (vnf) {
+                var selectedVersionNumber = getVersionNameForId(vm.changeManagement.fromVNFVersion);
 
-                if (vnf.properties['nf-role'] === vm.changeManagement.vnfType) {
+                if (vnf.properties['nf-role'] === vm.changeManagement.vnfType &&
+                    selectedVersionNumber === getVersionNameForId(vnf.properties["model-version-id"])) {
                     var vServer = {};
 
                     _.forEach(vnf['related-to'], function (node) {
@@ -295,11 +313,27 @@
                         }
                     });
 
+                    var serviceInstancesIds =
+                        _.filter(vnf['related-to'], {'node-type': 'service-instance'})
+                            .map(function (serviceInstance) { return serviceInstance.id });
+
+                    var serviceInstances = _.filter(vm.serviceInstances, function(serviceInstance) {
+                        return _.includes(serviceInstancesIds, serviceInstance.id);
+                    });
+
+                    // logging only
+                    if (serviceInstancesIds.length === 0) {
+                        $log.error("loadVNFNames: no serviceInstancesIds for vnf", vnf);
+                    } else {
+                        $log.debug("loadVNFNames: serviceInstancesIds", serviceInstancesIds);
+                        $log.debug("loadVNFNames: serviceInstances", serviceInstances);
+                    }
+
                     vm.vnfNames.push({
                         "id": vnf.properties["vnf-id"],
                         "name": vnf.properties["vnf-name"],
                         "invariant-id": vnf.properties["model-invariant-id"],
-                        "service-instance-node": _.filter(vm.serviceInstances, {id: vnf["related-to"][0].id}),
+                        "service-instance-node": serviceInstances,
                         "modelVersionId": vnf.properties["model-version-id"],
                         "properties": vnf.properties,
                         'cloudConfiguration': vServer,
@@ -316,30 +350,32 @@
                 tenantId: ''
             };
 
-            var splitedUrlByDash = _.split(url, '/', 100);
+            /*
+             e.g., in both URLs below -
+               - lcpCloudRegionId == 'rdm5b'
+               - tenantId == '0675e0709bd7444a9e13eba8b40edb3c'
 
-            cloudConfiguration.lcpCloudRegionId = splitedUrlByDash[7];
-            cloudConfiguration.tenantId = splitedUrlByDash[10];
+             "url": "https://aai-conexus-e2e.ecomp.cci.att.com:8443/aai/v10/cloud-infrastructure/cloud-regions/cloud-region/att-aic/rdm5b/tenants/tenant/0675e0709bd7444a9e13eba8b40edb3c/vservers/vserver/932b330d-733e-427d-a519-14eebd261f70"
+             "url": "/aai/v11/cloud-infrastructure/cloud-regions/cloud-region/att-aic/rdm5b/tenants/tenant/0675e0709bd7444a9e13eba8b40edb3c/vservers/vserver/932b330d-733e-427d-a519-14eebd261f70"
+             */
+
+            var cloudRegionMatch = url.match(/\/cloud-regions\/cloud-region\/[^\/]+\/([^\/]+)/);
+            var tenantMatch = url.match(/\/tenants\/tenant\/([^\/]+)/);
+
+            cloudConfiguration.lcpCloudRegionId = cloudRegionMatch[1];
+            cloudConfiguration.tenantId = tenantMatch[1];
 
             return cloudConfiguration;
         };
 
         vm.loadWorkFlows = function () {
-            var vnfs = [];
-            angular.forEach(vm.changeManagement.vnfNames, function (vnfName) {
-                vnfs.push(vnfName.name)
-            });
-
-            //TODO: When we'll have the mappings, use the backend call to get the workflows
-            // changeManagementService.getWorkflows(vnfs)
-            // .then(function(response) {
-            //     vm.workflows = response.data;
-            // })
-            // .catch(function(error) {
-            //     $log.error(error);
-            // });
-
-            vm.workflows = ["Update", "Replace"];
+            changeManagementService.getWorkflows(vm.changeManagement.vnfNames)
+                .then(function(response) {
+                    vm.workflows = response.data.workflows;
+                })
+                .catch(function(error) {
+                    $log.error(error);
+                });
         };
 
         //Must be $scope because we bind to the onchange of the html (cannot attached to vm variable).
@@ -364,6 +400,14 @@
             console.log("Will add version for selected vnf name: " + vnfName.name);
         };
 
+        vm.isConfigUpdate = function () {
+            return vm.changeManagement.workflow === COMPONENT.WORKFLOWS.vnfConfigUpdate;
+        }
+
+        vm.shouldShowVnfInPlaceFields = function () {
+            return vm.changeManagement.workflow === COMPONENT.WORKFLOWS.vnfInPlace;
+        };
+
         init();
     }
 })();
\ No newline at end of file
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/modals/new-change-management/new-change-management.css b/vid-app-common/src/main/webapp/app/vid/scripts/modals/new-change-management/new-change-management.css
deleted file mode 100644
index 9d27098..0000000
--- a/vid-app-common/src/main/webapp/app/vid/scripts/modals/new-change-management/new-change-management.css
+++ /dev/null
@@ -1,130 +0,0 @@
-.btn-white {
-    font-family: "Open Sans";
-    border-radius: 2px;
-    border: 1px solid #d8d8d8;
-    background-color:  #ffffff;
-    width: 94px;
-    height: 30px;
-    color: #5a5a5a;
-    font-size: 13px;
-    font-weight: 400;
-    line-height: 36px;
-    text-align: center;
-    padding: 4px 12px !important;
-}
-
-.btn-primary {
-    font-family: "Open Sans";
-    border-radius: 2px;
-    border: 1px solid #0091c8;
-    background-color:  #009fdb;
-    width: 94px;
-    height: 30px;
-    color:  #ffffff;
-    font-size: 13px;
-    font-weight: 400;
-    line-height: 36px;
-    text-align: center;
-    padding: 4px 12px !important;
-}
-
-.modal-header {
-    border: none!important;
-    padding: 15px 15px 0px 15px!important;
-}
-
-.modal-header h3 {
-    font-family: "Open Sans";
-    color:  #191919;
-    font-size: 22px;
-    font-weight: 300;
-    line-height: 16px;
-    padding-bottom: 20px;
-    border-bottom: 3px solid #009fdb;
-
-}
-
-.control-label {
-    font-family: "Open Sans";
-    color: #5a5a5a;
-    font-size: 13px;
-    font-weight: 400;
-}
-
-.modal-footer {
-    background-color: #eaeaea;
-}
-
-.modal-dialog {
-    width: 587px;
-    border-radius: 8px;
-}
-
-.modal-content {
-    width: 587px;
-    border-radius: 8px;
-    background-color:  #ffffff;
-}
-
-button.dropdown-toggle {
-    text-align: left;
-}
-
-button[disabled].dropdown-toggle {
-    opacity: 1;
-    cursor: not-allowed;
-    background-color: #eee;
-    border: 1px solid #aaa;
-    color: #a0a0a0;
-}
-
-multiselect[disabled] {
-    cursor: not-allowed;
-}
-
-a.item-unselected:before {
-    font-family: "icomoon"!important;
-    content: "\e90c";
-    color: #4ca90c;
-}
-
-.modal-close {
-    margin: -40px 5px 0 0;
-    color: #5a5a5a;
-    font-size: 20px;
-    cursor: pointer;
-}
-
-.vnf-versions-container .table {
-    position: relative;
-    background-color: #f8f8f8;
-    background-clip: padding-box;
-    border-radius: 6px;
-    outline: 0;
-}
-
-.vnf-versions-name {
-    padding-top: 6px;
-    font-family: "Open Sans";
-    position: absolute;
-}
-
-.vnf-versions-select-as-text {
-    font-family: "Open Sans";
-    appearance: none;
-    -webkit-appearance: none;
-    -moz-appearance: none;
-    border: none;
-    overflow:hidden;
-    background-color: #f8f8f8;
-    height: 31px;
-}
-
-.vnf-files-select {
-    z-index: 999;
-    opacity: 0.0;
-    position: absolute;
-    width: 23%;
-    cursor: pointer;
-    height:100%;
-}
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/modals/new-change-management/new-change-management.html b/vid-app-common/src/main/webapp/app/vid/scripts/modals/new-change-management/new-change-management.html
index 71c7eb3..4473ee3 100644
--- a/vid-app-common/src/main/webapp/app/vid/scripts/modals/new-change-management/new-change-management.html
+++ b/vid-app-common/src/main/webapp/app/vid/scripts/modals/new-change-management/new-change-management.html
@@ -1,51 +1,51 @@
-<link rel="stylesheet" type="text/css" href="app/vid/scripts/modals/new-change-management/new-change-management.css" />
+<link rel="stylesheet" type="text/css" href="app/vid/styles/modal-create-new.css" />
 <div class="modal-header">
     <h3 class="modal-title" id="modal-title">New VNF Change</h3>
     <span ng-click="vm.close()" class="pull-right modal-close" aria-hidden="true">&times;</span>
 </div>
-<form name="newChangeManagement" ng-submit="vm.schedule()">
+<form class="form-create" name="newChangeManagement" ng-submit="vm.openModal();vm.close();" novalidate>
     <div class="modal-body">
         <div class="form-group">
             <label class="control-label">Subscriber</label>
             <select class="form-control" ng-model="vm.changeManagement.subscriberId" ng-change="vm.loadServiceTypes()" name="subscriber" id="subscriber" data-tests-id="subscriberName" required>
                 <option value="" disabled>Select subscriber</option>
-                <option data-tests-id="subscriberNameOption" ng-repeat="item in vm.subscribers" ng-value="item['global-customer-id']">{{item['subscriber-name']}}</option>
+                <option data-tests-id="subscriberNameOption" class="subscriberNameOption" ng-repeat="item in vm.subscribers" ng-value="item['global-customer-id']" ng-disabled="!(item['is-permitted'])">{{item['subscriber-name']}}</option>
             </select>
         </div>
         <div class="form-group">
             <label class="control-label">Service type</label>
-            <select class="form-control" ng-model="vm.changeManagement.serviceType" ng-change="vm.loadVNFTypes()" name="serviceType" id="serviceType" ng-options="item['service-type'] for item in vm.serviceTypes" required data-ng-disabled="newChangeManagement.subscriber.$pristine">
+            <select class="form-control" ng-model="vm.changeManagement.serviceType" ng-change="vm.loadVNFTypes()" name="serviceType" id="serviceType" ng-options="item['service-type'] disable when !(item['is-permitted']) for item in vm.serviceTypes" required data-ng-disabled="newChangeManagement.subscriber.$pristine" data-tests-id="serviceType">
                 <option value="" disabled>Select service type</option>
             </select>
         </div>
         <div class="form-group">
-            <label class="control-label">VNF type</label>
+            <label class="control-label">NF Role</label>
             <select class="form-control" ng-model="vm.changeManagement.vnfType" ng-change="vm.loadVNFVersions()" name="vnfType" id="vnfType" ng-options="item for item in vm.vnfTypes" required data-ng-disabled="newChangeManagement.serviceType.$pristine">
-                <option value="" disabled>Select VNF type</option>
+                <option value="" disabled>NF Role</option>
             </select>
         </div>
         <div class="form-group">
-            <label class="control-label">Source Version</label>
+            <label class="control-label">Source VNF Model Version</label>
             <select class="form-control" ng-model="vm.changeManagement.fromVNFVersion" ng-change="vm.loadVNFNames()" name="fromVNFVersion" id="fromVNFVersion" ng-options="item.key as item.value for item in vm.fromVNFVersions" required data-ng-disabled="newChangeManagement.vnfType.$pristine">
-                <option value="" disabled>Select from VNF version</option>
+                <option value="" disabled>Select VNF Model Version</option>
             </select>
         </div>
         <div class="form-group">
-            <label class="control-label">VNF name</label>
+            <label class="control-label">Available VNF</label>
             <multiselect ng-model="vm.changeManagement.vnfNames" ng-change="vm.loadWorkFlows()" name="vnfName" id="vnfName" options="vm.vnfNames" display-prop="name" id-prop="id" required data-ng-disabled="newChangeManagement.fromVNFVersion.$pristine"></multiselect>
         </div>
         <div ng-show="vm.changeManagement.vnfNames && vm.changeManagement.vnfNames.length > 0" class="form-group vnf-versions-container">
             <table class="table table-bordered">
                 <tbody>
                 <tr ng-repeat="vnfName in vm.changeManagement.vnfNames">
-                    <td class="col-md-6"><span class="vnf-versions-name">{{vnfName.name}}</span></td>
-                    <td class="col-md-3">
-                        <select ng-model="vnfName.version" ng-change="vm.selectVersionForVNFName(vnfName)" class="vnf-versions-select-as-text">
-                            <option value="" disabled="" selected="selected">Select Target Version</option>
+                    <td class="col-md-2"><span class="vnf-versions-name">{{vnfName.name}}</span></td>
+                    <td class="col-md-2">
+                        <select ng-model="vnfName.version" ng-change="vm.selectVersionForVNFName(vnfName)" class="vnf-versions-select-as-text" id="{{vnfName['invariant-id']}}-target-version-select">
+                            <option value="" disabled="" selected="selected">Select Target VNF Model Version</option>
                             <option ng-repeat="version in vnfName.availableVersions">{{version.modelInfo.modelVersion}}</option>
                         </select>
                     </td>
-                    <td class="col-md-3 vnf-versions-name">
+                    <td class="col-md-1 vnf-versions-name">
                         <input ng-model="vnfName.filePath" onchange="angular.element(this).scope().selectFileForVNFName(this)" type="file" id="{{vnfName['invariant-id']}}" class="vnf-files-select" />
                         <span class="vnf-versions-name">Select File<span class="caret"></span></span></td>
                 </tr>
@@ -58,6 +58,32 @@
                 <option value="" disabled>Select workflow</option>
             </select>
         </div>
+        <div class="form-group" ng-if="vm.isConfigUpdate()">
+            <label class="control-label">Attach configuration file</label>
+            <div class="file-wrapper">
+                <input id="config-update-input" class="file-input" type="file" ngf-select ng-model="vm.configUpdateFile" ngf-validate-async-fn="vm.uploadConfigFile($file)" name="configUpdateFile"
+                       accept=".csv" ngf-pattern=".csv" required> </input>
+                <label id="config-update-label" class="file-input-label">{{vm.configUpdateFile&&vm.configUpdateFile.name||"Select File"}} </label>
+                <label for="config-update-input"><span class="icon-browse"></span></label>
+            </div>
+            <label id="errorLabel" class="icon-alert error" ng-if="newChangeManagement.configUpdateFile.$error.pattern">{{vm.configUpdatePatternError}}</label>
+            <label id="errorContentLabel" class="icon-alert error" ng-if="newChangeManagement.configUpdateFile.$error.validateAsyncFn">{{vm.configUpdateContentError}}</label>
+        </div>
+        <div ng-if="vm.shouldShowVnfInPlaceFields()">
+            <div class="form-group">
+                <label class="control-label">operations-timeout</label>
+                <input class="form-control" ng-model="vm.changeManagement.operationTimeout" name="operationTimeout" type="text" id="operations-timeout" pattern="[0-9]+" required>
+            </div>
+            <div class="form-group">
+                <label class="control-label">existing-software-version</label>
+                <input class="form-control" ng-model="vm.changeManagement.existingSoftwareVersion" name="existingSoftwareVersion" type="text" id="existing-software-version" pattern="{{vm.softwareVersionRegex}}" required>
+            </div>
+            <div class="form-group">
+                <label class="control-label">new-software-version</label>
+                <input class="form-control" ng-model="vm.changeManagement.newSoftwareVersion" name="newSoftwareVersion" type="text" id="new-software-version" pattern="{{vm.softwareVersionRegex}}" required>
+            </div>
+
+        </div>
     </div>
     <div class="modal-footer">
         <div class="pull-right">
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/modals/new-scheduler/new-scheduler.controller.js b/vid-app-common/src/main/webapp/app/vid/scripts/modals/new-scheduler/new-scheduler.controller.js
deleted file mode 100644
index c8f44c7..0000000
--- a/vid-app-common/src/main/webapp/app/vid/scripts/modals/new-scheduler/new-scheduler.controller.js
+++ /dev/null
@@ -1,455 +0,0 @@
-(function () {
-    'use strict';
-
-    appDS2.controller("newSchedulerController", ["$scope", "$uibModal", "$uibModalInstance", "AaiService", "SchedulerService", "_",
-        "$log", "changeManagement", "$timeout", "$interval", "$filter", "VIDCONFIGURATION", "changeManagementService", newSchedulerController]);
-
-    function newSchedulerController($scope, $uibModal, $uibModalInstance, AaiService, SchedulerService, _, $log, changeManagement, $timeout, $interval, $filter, VIDCONFIGURATION, changeManagementService) {
-        var vm = this;
-        var pollpromise;
-
-        var init = function () {
-            vm.scheduler = {};
-            vm.schedulingInfo = {};
-            var callbackData = extractChangeManagementCallbackDataStr(changeManagement);
-            vm.vnfObject = changeManagement;
-            vm.schedulerObj = {
-                domain: 'ChangeManagement',
-                scheduleId: '',
-                scheduleName: 'VnfUpgrade/DWF',
-                userId: '',
-                domainData: [{
-                    'WorkflowName': vm.scheduler.policy,
-                    'CallbackUrl': 'http://127.0.0.1:8989/scheduler/v1/loopbacktest/vid',
-                    'CallbackData': callbackData
-                }],
-
-                schedulingInfo: {
-                    normalDurationInSeconds: '',
-                    additionalDurationInSeconds: '',
-                    concurrencyLimit: '',
-                    policyId: '',
-                    vnfDetails: [
-                        {
-                            groupId: "",
-                            node: [],
-                            changeWindow: [{
-                                startTime: '',
-                                endTime: ''
-                            }]
-
-                        }
-                    ]
-                },
-
-            }
-            vm.schedulerObj1 = {
-                "domain": "ChangeManagement",
-                "scheduleName": "VnfUpgrade/DWF",
-                "userId": "su7376",
-                "domainData": [
-                    {
-                        "WorkflowName": "HEAT Stack Software Update for vNFs",
-                        "CallbackUrl": "http://127.0.0.1:8989/scheduler/v1/loopbacktest/vid",
-                        "CallbackData": "testing"
-                    }
-                ],
-                "schedulingInfo": {
-                    "normalDurationInSeconds": 60,
-                    "additionalDurationInSeconds": 60,
-                    "concurrencyLimit": 60,
-                    "policyId": "SNIRO_CM_1707.Config_MS_Demo_TimeLimitAndVerticalTopology_zone_localTime.1.xml",
-                    "vnfDetails": [
-                        {
-                            "groupId": "group1",
-                            "node": ["satmo415vbc", "satmo455vbc"],
-                            "changeWindow": [
-                                {
-                                    "startTime": "2017-08-08T16:37:30.521Z",
-                                    "endTime": "2017-08-08T16:37:30.521Z"
-                                }
-                            ]
-                        }
-                    ]
-                }
-            };
-
-
-            vm.format = 'yyyy/MM/dd';
-            vm.todate = new Date();
-            vm.checkboxSelection = 'false';
-            vm.fromDate = '';
-            vm.toDate = '';
-            vm.timeSlots = [];
-
-            vm.changeManagement = {};
-
-            vm.subscribers = [];
-
-            AaiService.getSubscribers(function (response) {
-                vm.subscribers = response;
-            });
-
-            vm.serviceTypes = [];
-            AaiService.getServices(function (response) {
-                vm.serviceTypes = response.data.service;
-            });
-
-            changeManagementService.getWorkflows()
-                .then(function (response) {
-                    vm.workflows = response.data;
-                })
-                .catch(function (error) {
-                    $log.error(error);
-                });
-
-            //TODO: Get the VNF names from backend dynamically
-            vm.vnfNames = [];
-
-            //TODO: Get the VNF types from backend dynamically
-            vm.vnfTypes = [];
-
-            AaiService.getLoggedInUserID(function (response) {
-                vm.userID = response.data;
-            });
-            vm.policys = [];
-
-            var policyName = JSON.stringify({
-                policyName: "SNIRO_1710.*",
-                configAttributes: {
-                    service: "PlacementOptimizationPolicy"
-                }
-            });
-            SchedulerService.getPolicyInfo(policyName, function (response) {
-                vm.policys = response.data.entity;
-            });
-        };
-
-        vm.radioSelections = function (test) {
-            if (vm.checkboxSelection == "true") {
-                vm.fromDate = '';
-                vm.toDate = ''
-            }
-        }
-        vm.close = function () {
-            $uibModalInstance.close();
-        };
-
-
-        function convertToSecs(number) {
-            var totalSecs;
-            if (vm.selectedOption === 'hours') {
-                totalSecs = number * 3600;
-
-            }
-            else if (vm.selectedOption === 'minutes') {
-                totalSecs = number * 60;
-            } else {
-                totalSecs = number;
-            }
-            return totalSecs;
-        }
-
-        vm.submit = function () {
-            vm.schedulingInfo = {
-                scheduleId: vm.schedulerID,
-                approvalDateTime: '2017-08-08T16:37:30.521Z',
-                approvalUserId: "sy6266",
-                approvalStatus: 'Accepted',
-                approvalType: 'Tier 2'
-            };
-
-            var approvalObj = JSON.stringify(vm.schedulingInfo);
-            SchedulerService.getSubmitForapprovedTimeslots(approvalObj, function (response) {
-                if (response.status == 200) {
-                    openConfirmationModal("Successfully Sent for Approval");
-                }
-
-            });
-        };
-
-        vm.reject = function () {
-            vm.schedulingInfo = {
-                scheduleId: vm.schedulerID,
-                approvalDateTime: '2017-08-08T16:37:30.521Z',
-                approvalUserId: "sy6266",
-                approvalStatus: 'Rejected',
-                approvalType: 'Tier 2'
-            }
-
-            var approvalObj = JSON.stringify(vm.schedulingInfo)
-            SchedulerService.getSubmitForapprovedTimeslots(approvalObj, function (response) {
-                if (response.status == 200) {
-                    openConfirmationModal("Successfully sent for Rejection");
-                }
-
-            });
-        };
-
-        vm.schedule = function (myForm) {
-            $scope.$watch('fromDate', validateDates(myForm));
-            $scope.$watch('toDate', validateDates(myForm));
-            if (myForm.$valid) {
-                sendSchedulerReq()
-            }
-        };
-
-
-        function sendSchedulerReq() {
-            var changeWindow = [{
-                startTime: '',
-                endTime: ''
-            }];
-            vm.timeSlots = [];
-            var fromDate = $filter('date')(new Date(vm.fromDate), "yyyy-MM-ddTHH:mmZ", "UTC");
-            var toDate = $filter('date')(new Date(vm.toDate), "yyyy-MM-ddTHH:mmZ", "UTC");
-
-            changeWindow[0].startTime = fromDate;
-            changeWindow[0].endTime = toDate;
-            vm.schedulerObj.userId = vm.userID;
-            vm.schedulerObj.domainData[0].WorkflowName = changeManagement.workflow;
-            vm.schedulerObj.schedulingInfo.normalDurationInSeconds = convertToSecs(vm.scheduler.duration);
-            vm.schedulerObj.schedulingInfo.additionalDurationInSeconds = convertToSecs(vm.scheduler.fallbackDuration);
-            vm.schedulerObj.schedulingInfo.concurrencyLimit = vm.scheduler.concurrency;
-            vm.schedulerObj.schedulingInfo.policyId = vm.scheduler.policy.policyName;
-            vm.schedulerObj.schedulingInfo['vnfDetails'][0].groupId = 'groupId';
-            vm.schedulerObj.schedulingInfo['vnfDetails'][0].node = getVnfData(changeManagement.vnfNames);
-
-            vm.schedulerObj.schedulingInfo['vnfDetails'][0].changeWindow = changeWindow;
-            if (vm.checkboxSelection == "true") {               //When Scheduled now we remove the changeWindow
-                delete vm.schedulerObj.schedulingInfo['vnfDetails'][0].changeWindow;
-            }
-            vm.schedulerObj.schedulingInfo['vnfDetails'][0].changeWindow = changeWindow;
-            delete vm.schedulerObj.schedulingInfo['vnfDetails'][0].changeWindow;
-
-            var requestScheduler = JSON.stringify(vm.schedulerObj);
-            console.log(requestScheduler);
-            SchedulerService.getStatusSchedulerId(requestScheduler, function (response) {
-                vm.schedulerID = response.data.uuid;
-                vm.isSpinnerVisible = true;
-                if (vm.schedulerID) {
-                    var scheduledID = JSON.stringify({scheduleId: vm.schedulerID});
-                    seviceCallToGetTimeSlots();
-                }
-            });
-        }
-
-        function seviceCallToGetTimeSlots() {
-
-            SchedulerService.getTimeSotsForSchedulerId(vm.schedulerID, function (response) {
-                if (vm.checkboxSelection == "false") {
-                    if (response.data.entity.schedule) {
-                        var scheduleColl = JSON.parse(response.data.entity.schedule);
-                        if (scheduleColl.length > 0) {
-                            vm.timeSlots = scheduleColl;
-                            vm.isSpinnerVisible = false;
-                            hasvaluereturnd = false;
-                            $scope.stopPoll();
-                            openConfirmationModal(response.data.entity.scheduleId + " Successfully Returned TimeSlots.");
-                        }
-
-                    }
-                    else {
-                        if (vm.timeSlots.length == 0 && hasthresholdreached == false) {
-                            var polltime = VIDCONFIGURATION.SCHEDULER_POLLING_INTERVAL_MSECS;
-                            pollpromise = poll(polltime, function () {
-                                if (vm.timeSlots.length == 0) {
-                                    hasvaluereturnd = true;
-                                    seviceCallToGetTimeSlots()
-                                }
-                                else {
-                                    hasvaluereturnd = false;
-                                }
-
-                            });
-
-                        } else {
-                            openConfirmationModal("Timeout error.")
-                        }
-                    }
-
-                }
-                else {
-                    if (response.data.entity) {
-                        vm.isSpinnerVisible = false;
-                        openConfirmationModal(response.data.entity.scheduleId + " Successfully Ready for Schedule.")
-                    }
-                }
-
-            });
-
-        }
-
-        function openConfirmationModal(jobInfo) {
-            var modalInstance = $uibModal.open({
-                templateUrl: 'app/vid/scripts/modals/alert-new-scheduler/alert-new-scheduler.html',
-                controller: 'alertNewSchedulerController',
-                controllerAs: 'vm',
-                resolve: {
-                    jobInfo: function () {
-                        return jobInfo;
-                    }
-                }
-            });
-        }
-
-        var hasvaluereturnd = true; // Flag to check
-        var hasthresholdreached = false;
-        var thresholdvalue = VIDCONFIGURATION.SCHEDULER_MAX_POLLS; // interval threshold value
-
-        function poll(interval, callback) {
-            return $interval(function () {
-                if (hasvaluereturnd) {  //check flag before start new call
-                    callback(hasvaluereturnd);
-                }
-
-                thresholdvalue = thresholdvalue - 1;  //Decrease threshold value
-                if (thresholdvalue == 0) {
-                    $scope.stopPoll(); // Stop $interval if it reaches to threshold
-                }
-            }, interval)
-        }
-
-
-// stop interval.
-        $scope.stopPoll = function () {
-            $interval.cancel(pollpromise);
-            thresholdvalue = 0;     //reset all flags.
-            hasvaluereturnd = false;
-            hasthresholdreached = true;
-            vm.isSpinnerVisible = false;
-        }
-
-        function getVnfData(arrColl) {
-            var vnfcolletion = [];
-
-            for (var i = 0; i < arrColl.length; i++) {
-                vnfcolletion.push(arrColl[i].name);
-            }
-
-            return vnfcolletion
-        }
-
-        function validateDates(form) {
-            if (vm.checkboxSelection == "false") {
-
-                if (form.startDate.$error.invalidDate || form.endDate.$error.invalidDate) {
-                    form.startDate.$setValidity("endBeforeStart", true);  //already invalid (per validDate directive)
-                } else {
-                    //depending on whether the user used the date picker or typed it, this will be different (text or date type).
-                    //creating a new date object takes care of that.
-                    var endDate = new Date(vm.toDate);
-                    var startDate = new Date(vm.fromDate);
-                    form.startDate.$setValidity("endBeforeStart", endDate >= startDate);
-                }
-            }
-        }
-
-
-        function extractChangeManagementCallbackDataStr(changeManagement) {
-            var result = {};
-
-            result.requestType = changeManagement.workflow;
-            result.requestDetails = [];
-
-            _.forEach(changeManagement.vnfNames, function (vnf) {
-
-                    var data = {
-                        vnfName: vnf.name,
-                        vnfInstanceId: vnf.id,
-                        modelInfo: {
-                            modelType: 'vnf',
-                            modelInvariantId: vnf.properties['model-invariant-id'],
-                            modelVersionId: vnf.modelVersionId,
-                            modelName: vnf.properties['vnf-name'],
-                            modelVersion: vnf.version,
-                            modelCustomizationName: vnf.properties['model-customization-name'],
-                            modelCustomizationId: vnf.properties['model-customization-id']
-                        },
-                        cloudConfiguration: {
-                            lcpCloudRegionId: vnf.availableVersions[0].cloudConfiguration.lcpCloudRegionId,
-                            tenantId: vnf.availableVersions[0].cloudConfiguration.tenantId
-                        },
-                        requestInfo: {
-                            source: vnf.availableVersions[0].requestInfo.source,
-                            suppressRollback: vnf.availableVersions[0].requestInfo.suppressRollback,
-                            requestorId: vnf.availableVersions[0].requestInfo.requestorId
-                        },
-                        relatedInstanceList: [],
-                        requestParameters: {
-                            usePreload: vnf.availableVersions[0].requestParameters.usePreload
-                        }
-                    };
-
-                    var serviceInstanceId = '';
-                    _.forEach(vnf['service-instance-node'], function (instanceNode) {
-                        if(instanceNode['node-type'] === 'service-instance'){
-                            serviceInstanceId = instanceNode.properties['service-instance-id'];
-                        }
-                    });
-
-
-                    _.forEach(vnf.availableVersions[0].relatedInstanceList, function (related) {
-
-                        var rel = related.relatedInstance;
-
-                        var relatedInstance = {
-                            instanceId: serviceInstanceId,
-                            modelInfo: {
-                                modelType: rel.modelInfo.modelType,
-                                modelInvariantId: rel.modelInfo.modelInvariantId,
-                                modelVersionId: rel.modelInfo.modelVersionId,
-                                modelName: rel.modelInfo.modelName,
-                                modelVersion: rel.modelInfo.modelVersion,
-                                modelCustomizationName: rel.modelInfo.modelCustomizationName,
-                                modelCustomizationId: rel.modelInfo.modelCustomizationId
-                            }
-                        };
-
-                        if (rel.vnfInstanceId)
-                            relatedInstance.instanceId = rel.vnfInstanceId;
-
-                        data.relatedInstanceList.push({relatedInstance: relatedInstance});
-                    });
-
-
-                    result.requestDetails.push(data);
-                }
-            );
-
-
-            // _.forEach(changeManagement.vnfNames, function (vnfName) {
-            //     if (vnfName && vnfName.version) {
-            //         if (vnfName.selectedFile) {
-            //             vnfName.version.requestParameters.userParams = vnfName.selectedFile;
-            //         }
-            //         result.requestDetails.push(vnfName.version)
-            //     }
-            // });
-
-            return JSON.stringify(result);
-        }
-
-        init();
-    };
-
-    appDS2.directive('validDate', function () {
-        return {
-            restrict: 'A',
-            require: 'ngModel',
-            link: function (scope, element, attrs, control) {
-                control.$parsers.push(function (viewValue) {
-                    var newDate = model.$viewValue;
-                    control.$setValidity("invalidDate", true);
-                    if (typeof newDate === "object" || newDate == "") return newDate;  // pass through if we clicked date from popup
-                    if (!newDate.match(/^\d{1,2}\/\d{1,2}\/((\d{2})|(\d{4}))$/))
-                        control.$setValidity("invalidDate", false);
-                    return viewValue;
-                });
-            }
-        };
-    })
-
-
-})();
-
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/modals/new-scheduler/new-scheduler.css b/vid-app-common/src/main/webapp/app/vid/scripts/modals/new-scheduler/new-scheduler.css
deleted file mode 100644
index 8da5c55..0000000
--- a/vid-app-common/src/main/webapp/app/vid/scripts/modals/new-scheduler/new-scheduler.css
+++ /dev/null
@@ -1,145 +0,0 @@
-.btn-white {
-    font-family: OpenSans;
-    border-radius: 2px;
-    border: 1px solid #d8d8d8;
-    background-color:  #ffffff;
-    width: 94px;
-    height: 30px;
-    color: #5a5a5a;
-    font-size: 13px;
-    font-weight: 400;
-    line-height: 36px;
-    text-align: center;
-}
-
-.btn-primary {
-    font-family: OpenSans;
-    border-radius: 2px;
-    border: 1px solid #0091c8;
-    background-color:  #009fdb;
-    width: 94px;
-    height: 30px;
-    color:  #ffffff;
-    font-size: 13px;
-    font-weight: 400;
-    line-height: 36px;
-    text-align: center;
-}
-
-.modal-header {
-    border: none!important;
-    padding: 15px 15px 0px 15px!important;
-}
-
-.modal-header h3 {
-    font-family: OpenSans;
-    color:  #5a5a5a;
-    font-size: 22px;
-    font-weight: 300;
-    line-height: 16px;
-    padding-bottom: 20px;
-    border-bottom: 3px solid #009fdb;
-
-}
-
-.modal-footer {
-    background-color: #eaeaea;
-}
-
-.modal-dialog {
-    width: 587px;
-    border-radius: 8px;
-}
-
-.modal-content {
-    width: 587px;
-    border-radius: 8px;
-    background-color:  #ffffff;
-}
-.label-font{
-	    font-size: 1em;
-}
-.calender-icon{
-	background-image: url(../../../../../app/fusion/external/ebz/images/Calendar.svg); 
-	background-repeat:no-repeat;
-    background-position:98%;
-    border-radius: 6px;
-    border: 1px solid #888;
-    color: #444;
-    font-family: clearview_att_regular;
-    width: 100%;
-    outline: 0;
-    padding: 7px 10px;
-    text-transform: none;
-    z-index: 0;
-    height: 40px;
-    position: relative;
-    
-}
-
-input.calender-icon:focus{
-	background-image: url(../../../../../app/fusion/external/ebz/images/Calendar_blue.svg); 
-	background-repeat:no-repeat;
-}
-
-
-
-.timeslots-content{
-	margin-top: 0px;
-    margin-bottom: 0px;
-    height: 10em;
-}
-.find-block{
-	float:5em;
-}
-.timeslots-block{ 
-/* 	margin-top: 1em; */
-    height: 85px;
- } 
- .policy-combo{
-    background-image: none;
- }
- 
- div[ng-controller=newSchedulerController] .schedulerVisible {
-	visibility: visible;
-}
-div[ng-controller=newSchedulerController] .schedulerHidden {
-	visibility: hidden;
-}
-
-.table {
-    border: 1px solid #eaeaea;
-    box-sizing: border-box;
-    background-color: #ffffff;
-    box-shadow: 0px 2px 7px 0px rgba(34, 31, 31, 0.17);
-    font-family: OpenSans;
-    color: #5a5a5a;
-    font-size: 14px;
-    font-weight: 400;
-}
-.table>thead {
-    background-color: #d2d2d2;
-    font-family: OpenSans;
-    color: #191919;
-    font-size: 13px;
-    font-weight: 600;
-    line-height: 40px;
-}
-
-.table-headline-row {
-    font-family: OpenSans;
-    color: #5a5a5a;
-    font-size: 14px;
-    font-weight: 600;
-    background-color: #eaeaea;
-    box-shadow: 0px 1px 1px 0px rgba(34, 31, 31, 0.19);
-}
-
-.table-bordered{border:1px solid #eaeaea;}
-.table-bordered>tbody>tr>td,
-.table-bordered>tbody>tr>th,
-.table-bordered>tfoot>tr>td,
-.table-bordered>tfoot>tr>th,
-.table-bordered>thead>tr>td,
-.table-bordered>thead>tr>th{border:1px solid #eaeaea;}
-
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/modals/new-scheduler/new-scheduler.html b/vid-app-common/src/main/webapp/app/vid/scripts/modals/new-scheduler/new-scheduler.html
deleted file mode 100644
index 498ff2e..0000000
--- a/vid-app-common/src/main/webapp/app/vid/scripts/modals/new-scheduler/new-scheduler.html
+++ /dev/null
@@ -1,101 +0,0 @@
-<link rel="stylesheet" type="text/css" href="app/vid/scripts/modals/new-scheduler/new-scheduler.css" />
-<div class="modal-header">
-    <h3 class="modal-title" id="modal-title">Scheduler Change</h3>
-</div>
-<form name="newschedulermodalForm" ng-submit="vm.schedule(newschedulermodalForm)">
-    <div class="modal-body">
-   
-	    <div class="form-group" >
-            <label><input type="radio" ng-model="vm.checkboxSelection" ng-change="vm.radioSelections()" value="true">Now</label>
-            <label><input type="radio"  ng-model="vm.checkboxSelection"  ng-change="vm.radioSelections()" value="false">Range</label>
-	     </div>
-<!-- 	   <div class="form-group"> -->
-<!-- 	      <input type="radio"  ng-model="checkboxSelection" value="false"  ><label>Range</label> -->
-<!-- 	     </div> -->
-    
-    	
-        <div class="form-group" >
-            <label class="control-label">From Date</label>
-            <input ng-disabled="(vm.checkboxSelection=='true')? true:false"  valid-date name="startDate" ng-model="vm.fromDate" id="startDate" datetime-picker ng-required="false"  hour="23" minute='59' class="calender-icon"/>
-            
-        </div>
-        <div class="form-group"  >
-            <label class="control-label">To Date</label>
-            <input  ng-disabled="(vm.checkboxSelection=='true')? true:false" valid-date name="endDate" ng-model="vm.toDate" id="endDate" datetime-picker ng-required="false"  hour="23" minute='59' class="calender-icon"  />
-                 <span ng-show="newschedulermodalForm.startDate.$error.endBeforeStart">To date must be on or after From date.</span> 
-			    <span ng-show="newschedulermodalForm.startDate.$error.invalidDate || newschedulermodalForm.endDate.$error.invalidDate">Check dates for validity</span>
-			    <span ng-show="newschedulermodalForm.startDate.$error.required || newschedulermodalForm.endDate.$error.required">A required date is missing</span>
-             </div>  
-             
-        <div class="form-group"  >
-       <label>Please Select Option For Duration and FallBack</label>
-       
-          <select class="form-control" name="selecttime" data-tests-id="timeUnitSelect" ng-model="vm.selectedOption" ng-change="vm.updateMinMax()">
-            <option value="hours">HOURS</option>
-            <option value="minutes">MINUTES</option>
-            <option value="seconds">SECONDS</option>
-          </select>
-        </div>
-        <div class="row">
-        <div class="form-group col-md-6 col-xs-12">
-         <label class="control-label">Duration</label>
-          <input  type="number" style="font-size: 1em;" data-tests-id="durationInput" name="durationinput" ng-model="vm.scheduler.duration" ng-required="true">
-        
-        </div>
-        <div class="form-group col-md-6 col-xs-12"  >
-         <label class="control-label">Fallback Duration</label>
-          <input  type="number" style="font-size: 1em;" name="fallbackinput" data-tests-id="fallbackInput" ng-model="vm.scheduler.fallbackDuration"  ng-required="true">
-         
-         
-        </div>
-          </div>
-         <div class="form-group">
-         <label class="control-label">Concurrency Limit</label>
-          <input  type="number" style="font-size: 1em;" name="input" data-tests-id="concurrencyLimitInput" ng-model="vm.scheduler.concurrency" min="1" max="30" ng-required="true">
-        </div>
-          <div class="form-group">
-            <label class="control-label">Policy</label>
-            <select  class="policy-combo" ng-model="vm.scheduler.policy" id="policy"  ng-options="item.policyName for item in vm.policys">
-                <option value="">Select Policy</option>
-            </select>
-        </div>
-		 <div class="form-group">
-            <button type="submit" id="find" name="Find" ng-disabled="vm.isClicked" class="btn btn-primary find-block">Find</button>
-             <span class="spinner" ng-show="vm.isSpinnerVisible">
-				<img src="app/vid/images/spinner.gif">
-					</img>
-				
-			</span>
-    
-         </div>
-         
-           <div class="form-group" ng-show="(vm.checkboxSelection=='false')? true:false">
-<!--             <label class="control-label">Time Slots</label> -->
-<!--             <textarea rows="10" cols="50" class="timeslots-block" ></textarea> -->
-            <table class="table table-bordered">
-			   <thead class="thead-default">
-			      <tr>
-			         <th>Start Time</th>
-			         <th>End Time</th>
-			      </tr>
-			   </thead>
-			   <tbody>
-			   
-			      <tr class="table-headline-row" ng-repeat="timeslot in vm.timeSlots">
-			         <td>{{timeslot.startTime}}</td>
-			         <td>{{timeslot.finishTime}}</td>
-			      </tr>
-			   </tbody>
-         </table>
-        </div>
-			
-    </div>
-    <div class="modal-footer">
-        <div class="pull-right">
-            <button type="button" id="btn" name="submit" class="btn btn-primary" ng-click="vm.submit()">Schedule</button>
-            <button type="button" id="btn" name="submit" class="btn btn-primary" ng-click="vm.reject()">Reject</button>
-            <button type="button" id="cancel" name="cancel" class="btn btn-white" ng-click="vm.close()">Cancel</button>
-        </div>
-    </div>
-</form>
-
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/modals/new-test-environment/new-test-environment.controller.js b/vid-app-common/src/main/webapp/app/vid/scripts/modals/new-test-environment/new-test-environment.controller.js
new file mode 100644
index 0000000..daec9b2
--- /dev/null
+++ b/vid-app-common/src/main/webapp/app/vid/scripts/modals/new-test-environment/new-test-environment.controller.js
@@ -0,0 +1,65 @@
+(function () {
+    'use strict';
+
+    appDS2.controller("newTestEnvironmentModalController", ["$uibModalInstance", "$uibModal", "AaiService", "TestEnvironmentsService","OwningEntityService",
+        "$log", "$scope", "_", "COMPONENT","$rootScope", newTestEnvironmentsModalController]);
+
+    function newTestEnvironmentsModalController($uibModalInstance, $uibModal, AaiService, TestEnvironmentsService,OwningEntityService, $log, $scope, _, COMPONENT, $rootScope) {
+        var vm = this;
+        vm.newEnvironment = {};
+
+        var init = function () {
+            vm.newEnvironment.operationalEnvironmentType = "VNF";
+            loadCategoryParameters();
+            loadEcompEnvironmentsList();
+        };
+
+        var loadEcompEnvironmentsList = function () {
+            TestEnvironmentsService.loadAAIestEnvironments("ECOMP")
+            .then(function(response) {
+                vm.environments = response.operationalEnvironment;
+            })
+            .catch(function (error) {
+                vm.aaiConnectError = error.message;
+                $log.error(error);
+            });
+        };
+
+        var loadCategoryParameters = function () {
+            OwningEntityService.getOwningEntityProperties(function(response){
+               vm.environmentsTypesList = response["operational-environment-type"].map(function (x){
+                    return x.name;});
+               vm.workloadContextList = response["workload-context"].map(function (x){
+                   return x.name;});
+            },COMPONENT.TENANT_ISOLATION_FAMILY);
+        }
+
+
+        vm.setEcompEnvironment = function (selectedIndex) {
+            var ecompEnvironment = vm.environments[selectedIndex];
+            vm.newEnvironment.ecompInstanceId = ecompEnvironment.operationalEnvironmentId;
+            vm.newEnvironment.ecompInstanceName = ecompEnvironment.operationalEnvironmentName;
+            vm.newEnvironment.tenantContext = ecompEnvironment.tenantContext;
+        };
+
+        vm.close = function () {
+            $uibModalInstance.close();
+        };
+
+        vm.createEnvironment = function () {
+            if($scope.newTestEnvironment.$valid) {
+                vm.newEnvironment.workloadContext = vm.newEnvironment.operationalEnvironmentType + '_' + vm.newEnvironment.workloadContext;
+                var requestDetails = vm.newEnvironment;
+                $rootScope.$broadcast(COMPONENT.MSO_CREATE_ENVIRONMENT, {
+                    url : COMPONENT.OPERATIONAL_ENVIRONMENT_CREATE,
+                    requestDetails : requestDetails
+                });
+                vm.close();
+            }
+        };
+
+
+
+        init();
+    }
+})();
\ No newline at end of file
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/modals/new-test-environment/new-test-environment.html b/vid-app-common/src/main/webapp/app/vid/scripts/modals/new-test-environment/new-test-environment.html
new file mode 100644
index 0000000..cd14a76
--- /dev/null
+++ b/vid-app-common/src/main/webapp/app/vid/scripts/modals/new-test-environment/new-test-environment.html
@@ -0,0 +1,50 @@
+<link rel="stylesheet" type="text/css" href="app/vid/styles/modal-create-new.css" />
+<div class="modal-header">
+    <h3 class="modal-title" id="modal-title">New Test Environment</h3>
+    <span ng-click="vm.close()" class="pull-right modal-close" aria-hidden="true">&times;</span>
+</div>
+<form class="form-create" data-tests-id="test-new-environment-form" name="newTestEnvironment" ng-submit="vm.createEnvironment()">
+    <div class="modal-body">
+        <div class="form-group">
+            <label class="control-label" for="environmentName">Environment Name</label>
+            <input id="environmentName" class="form-control" ng-model="vm.newEnvironment.instanceName" name="instanceName" data-tests-id="environment-name" placeholder="Enter environment name" required>
+        </div>
+        <div class="form-group">
+            <label class="control-label" for="ecompInstanceId">ECOMP Environment ID</label>
+            <select class="form-control" ng-class="{'grayedOut': !selectedIndex, 'connect-error': vm.aaiConnectError}" ng-model="selectedIndex" name="ecompInstanceId" id="ecompInstanceId" data-tests-id="ecomp-instance-id" required ng-change="vm.setEcompEnvironment(selectedIndex)">
+                <option value="" disabled selected hidden>Select environment ID</option>
+                <option data-tests-id="environment-id-option" class="environmentIdOption" ng-repeat="item in vm.environments" ng-value="$index">{{item.operationalEnvironmentId}}</option>
+            </select>
+        </div>
+        <div class="form-group">
+            <label class="control-label" for="ecompInstanceName">ECOMP Environment Name</label>
+            <input id="ecompInstanceName" class="form-control" ng-model="vm.newEnvironment.ecompInstanceName" name="ecompInstanceName" data-tests-id="ecomp-instance-name" required disabled>
+        </div>
+        <div class="form-group">
+            <label class="control-label" for="tenantContext">Select VSP</label>
+            <input id="tenantContext" class="form-control" ng-model="vm.newEnvironment.tenantContext" name="tenantContext" data-tests-id="tenant-context" required disabled>
+        </div>
+        <div class="form-group">
+            <label class="control-label" for="operationalEnvironmentType">Environment Type</label>
+            <select class="form-control" ng-class="{'grayedOut': !vm.newEnvironment.operationalEnvironmentType}"  ng-model="vm.newEnvironment.operationalEnvironmentType" name="operationalEnvironmentType" id="operationalEnvironmentType" data-tests-id="operational-environment-type" required>
+                <option value="" disabled selected hidden>Enter environment type</option>
+                <option data-tests-id="environment-type-option" class="environmentTypeOption" ng-repeat="item in vm.environmentsTypesList" ng-value="item">{{item}}</option>
+            </select>
+        </div>
+        <div class="form-group">
+            <label class="control-label" for="workloadContext">Workload Context</label>
+            <select class="form-control" ng-class="{'grayedOut': !vm.newEnvironment.workloadContext}" ng-model="vm.newEnvironment.workloadContext" name="workloadContext" id="workloadContext" data-tests-id="workload-context" required>
+                <option value="" disabled selected hidden>Select workload context</option>
+                <option data-tests-id="workload-context-option" class="workloadContextOption" ng-repeat="item in vm.workloadContextList" ng-value="item">{{vm.newEnvironment.operationalEnvironmentType + '_' + item}}</option>
+            </select>
+        </div>
+        <div data-tests-id="test-new-environment-error" class="connect-error" ng-if="vm.aaiConnectError">{{vm.aaiConnectError}}</div>
+    </div>
+    <div class="modal-footer">
+        <div class="pull-right">
+            <button data-tests-id="submit-button" type="submit" id="submit" name="submit" class="btn btn-primary" data-ng-disabled="newTestEnvironment.$invalid">Create</button>
+            <button data-tests-id="cancel-button" type="button" id="cancel" name="cancel" class="btn btn-white" ng-click="vm.close()">Cancel</button>
+        </div>
+    </div>
+</form>
+
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/modals/pending-change-management/pending-change-management.html b/vid-app-common/src/main/webapp/app/vid/scripts/modals/pending-change-management/pending-change-management.html
index 911e86c..59c30c5 100644
--- a/vid-app-common/src/main/webapp/app/vid/scripts/modals/pending-change-management/pending-change-management.html
+++ b/vid-app-common/src/main/webapp/app/vid/scripts/modals/pending-change-management/pending-change-management.html
@@ -1,4 +1,4 @@
-<link rel="stylesheet" type="text/css" href="app/vid/scripts/modals/new-change-management/new-change-management.css" />
+<link rel="stylesheet" type="text/css" href="app/vid/styles/modal-create-new.css" />
 <link rel="stylesheet" type="text/css" href="app/vid/scripts/modals/pending-change-management/pending-change-management.css" />
 <div class="modal-header">
     <h3 class="modal-title" id="pending-modal-header">Pending</h3>
@@ -8,5 +8,5 @@
     <span id="pending-modal-content">{{vm.content}}</span>
 </div>
 <div class="modal-footer">
-    <div ng-include="'app/vid/scripts/modals/change-management-manual-tasks-controller/change-management-manual-tasks.html'"></div>
+    <!--<div ng-include="'app/vid/scripts/modals/change-management-manual-tasks-controller/change-management-manual-tasks.html'"></div>-->
 </div>
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/modals/service-metadata/service-metadata.css b/vid-app-common/src/main/webapp/app/vid/scripts/modals/service-metadata/service-metadata.css
new file mode 100644
index 0000000..2c7f3a1
--- /dev/null
+++ b/vid-app-common/src/main/webapp/app/vid/scripts/modals/service-metadata/service-metadata.css
@@ -0,0 +1,37 @@
+.modal-dialog * {
+    font-family: OpenSans-Regular, sans-serif;
+}
+.modal-dialog {
+    width: 540px;
+}
+.modal-dialog service-metadata{
+    background: white;
+}
+.modal-dialog .modal-footer {
+    background: #F8F8F8;
+    border-radius: 0 0 8px 8px;
+}
+.modal-dialog .cancel-btn {
+    width: 120px;
+}
+.modal-dialog .title {
+    font-size: 22px;
+    color: #000000;
+}
+.modal-dialog .top {
+    margin: 15px 20px;
+    border-bottom: 3px solid #009FDB;
+    padding-bottom: 15px;
+}
+.modal-dialog .modal-x {
+    float: right;
+    margin-top: 10px;
+    height: 15px;
+    cursor:pointer;
+}
+.modal-dialog service-metadata label {
+    margin-bottom: 3px;
+}
+.modal-dialog service-metadata .field {
+    margin-top: 11px;
+}
\ No newline at end of file
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/modals/service-metadata/service-metadata.html b/vid-app-common/src/main/webapp/app/vid/scripts/modals/service-metadata/service-metadata.html
new file mode 100644
index 0000000..47ed3e4
--- /dev/null
+++ b/vid-app-common/src/main/webapp/app/vid/scripts/modals/service-metadata/service-metadata.html
@@ -0,0 +1,12 @@
+<link rel="stylesheet" type="text/css" href="app/vid/scripts/modals/service-metadata/service-metadata.css"/>
+<div class="top">
+    <span class="title">{{selectedMetadata[0].value}}</span>
+    <span class="top-btn sprite modal-x" data-ng-click="cancel()"></span>
+</div>
+
+<div class="meatadata-modal-body" id="modal-body">
+    <service-metadata service-metadata-fields="selectedMetadata"></service-metadata>
+</div>
+<div class="modal-footer">
+    <button class="cancel-btn grey" data-tests-id="cancel" data-ng-click="cancel()">Close</button>
+</div>
\ No newline at end of file
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/services/OwningEntityService.js b/vid-app-common/src/main/webapp/app/vid/scripts/services/OwningEntityService.js
new file mode 100644
index 0000000..ef48aa9
--- /dev/null
+++ b/vid-app-common/src/main/webapp/app/vid/scripts/services/OwningEntityService.js
@@ -0,0 +1,40 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * VID
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+"use strict";
+
+var OwningEntityService = function ($http, $log, PropertyService, UtilityService, COMPONENT) {
+    return {
+        getOwningEntityProperties: function ( successCallbackFunction, familyName) {
+            $log.debug("OwningEntityService:getOwningEntityProperties");
+            familyName = familyName || COMPONENT.PARAMETER_STANDARDIZATION_FAMILY;
+            var url = COMPONENT.GET_CATEGORY_PARAMETERS+"?familyName=" + familyName+ "&r=" + Math.random();
+            var config = { timeout: PropertyService.getServerResponseTimeoutMsec() };
+
+            $http.get(url, config)
+                .then(function (response) {
+                    successCallbackFunction(response.data.categoryParameters);
+                }).catch(UtilityService.runHttpErrorHandler);
+        }
+    }
+};
+
+appDS2.factory("OwningEntityService", ["$http", "$log", "PropertyService",
+    "UtilityService", "COMPONENT", "FIELD", OwningEntityService]);
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/services/aaiService.js b/vid-app-common/src/main/webapp/app/vid/scripts/services/aaiService.js
index a10f602..53a941b 100755
--- a/vid-app-common/src/main/webapp/app/vid/scripts/services/aaiService.js
+++ b/vid-app-common/src/main/webapp/app/vid/scripts/services/aaiService.js
@@ -21,6 +21,70 @@
 "use strict";
 
 var AaiService = function ($http, $log, PropertyService, UtilityService, COMPONENT, FIELD, $q) {
+
+    function getServiceInstance(serviceInstanceIdentifier, findBy) {
+        serviceInstanceIdentifier.trim();
+
+        return $http.get(COMPONENT.AAI_GET_SERVICE_INSTANCE_PATH + serviceInstanceIdentifier + "/" + findBy + "?r=" + Math.random(), {}, {
+            timeout: PropertyService.getServerResponseTimeoutMsec()
+        });
+    }
+
+    function getPnfByName(pnfName) {
+        var deferred = $q.defer();
+        var url = COMPONENT.AAI_GET_PNF_BY_NAME+ encodeURIComponent(pnfName)  ;
+        var config = { timeout: PropertyService.getServerResponseTimeoutMsec() };
+
+        $http.get(url, config)
+            .success(function (response) {
+                deferred.resolve({data: response});
+            })
+            .error(function(data, status, headers, config) {
+                deferred.reject({message: data, status: status});
+            });
+
+        return deferred.promise;
+    };
+
+
+    function getGlobalCustomerIdFromServiceInstanceResponse(response) {
+        var globalCustomerId = "";
+        if (angular.isArray(response.data[FIELD.ID.RESULT_DATA])) {
+            var customerIndex = 5;
+            var customerIdIndex = 6;
+            var itemIndex = 0;
+
+            var item = response.data[FIELD.ID.RESULT_DATA][itemIndex];
+            var url = item[FIELD.ID.RESOURCE_LINK];
+            var urlParts = url.split("/");
+            if (urlParts[customerIndex] === FIELD.ID.CUSTOMER) {
+                globalCustomerId = urlParts[customerIdIndex];
+            }
+        }
+        return globalCustomerId;
+    }
+
+    function searchServiceInstances(query) {
+        return $http.get( COMPONENT.SEARCH_SERVICE_INSTANCES  + query, {}, {
+            timeout : PropertyService.getServerResponseTimeoutMsec()
+        }).then(function (response) {
+            var displayData = response.data[FIELD.ID.SERVICE_INSTANCES];
+            if (!displayData.length) {
+                displayData = [{
+                    globalCustomerId 	: null,
+                    subscriberName   	: null,
+                    serviceType 		: FIELD.PROMPT.NO_SERVICE_SUB,
+                    serviceInstanceId 	: FIELD.PROMPT.NO_SERVICE_INSTANCE
+                }];
+            }
+            return {displayData: displayData};
+        })
+    }
+
+    function getJoinedQueryString(queries) {
+        return queries.filter(function (val) {return val;}).join("&");
+    }
+
     return {
         getSubscriberName : function(globalCustomerId,
                                      successCallbackFunction) {
@@ -34,16 +98,16 @@
                     timeout : PropertyService
                         .getServerResponseTimeoutMsec()
                 }).then(function(response) {
-                var subName = "";
+                var result = {};
                 if (response.data) {
-                    subName = response.data[FIELD.ID.SUBNAME];
+                    result.subscriberName = response.data[FIELD.ID.SUBNAME];
+                    result.serviceSubscriptions = response.data[FIELD.ID.SERVICE_SUBSCRIPTIONS];
                 }
-                successCallbackFunction(subName);
+                successCallbackFunction(result);
             })["catch"]
             (UtilityService.runHttpErrorHandler);
         },
 
-
         runNamedQuery : function (namedQueryId, globalCustomerId, serviceType, serviceInstanceId, successCallback, errorCallback) {
 
             var url = COMPONENT.AAI_SUB_VIEWEDIT_PATH +
@@ -86,6 +150,48 @@
             });
         },
 
+        getPNFInformationByServiceTypeAndId : function (globalCustomerId, serviceType, serviceInstanceId, successCallback, errorCallback) {
+
+            var url = COMPONENT.AAI_GET_PNF_INSTANCE +
+                COMPONENT.FORWARD_SLASH + encodeURIComponent(globalCustomerId) +
+                COMPONENT.FORWARD_SLASH + encodeURIComponent(serviceType) +
+                COMPONENT.FORWARD_SLASH + encodeURIComponent(serviceInstanceId);
+            $http.get(url, {}, {
+                timeout : PropertyService.getServerResponseTimeoutMsec()
+            }).then(function(response) {
+                if (response.data != null) {
+                    successCallback(response);
+                } else {
+                    errorCallback(response);
+                }
+            }, function(response) {
+                errorCallback(response);
+            });
+        },
+
+        searchServiceInstances: searchServiceInstances,
+
+        getModelVersionId: function (subscriberId, instanceId) {
+            var globalCustomerIdQuery = COMPONENT.SELECTED_SUBSCRIBER_SUB_PATH + subscriberId;
+            var serviceInstanceQuery = COMPONENT.SELECTED_SERVICE_INSTANCE_SUB_PATH + instanceId;
+
+            var query = "?" + getJoinedQueryString([globalCustomerIdQuery, serviceInstanceQuery]);
+
+            var deferred = $q.defer();
+
+            searchServiceInstances(query).then(function (response) {
+                var displayData = response.displayData;
+                if (displayData[0] && displayData[0].aaiModelVersionId) {
+                    deferred.resolve(displayData[0].aaiModelVersionId);
+                } else {
+                    deferred.reject(FIELD.ERROR.MODEL_VERSION_ID_MISSING);
+                }
+            }).catch(function (err) {
+                deferred.reject(err);
+            });
+
+            return deferred.promise;
+        },
 
         getSubDetails : function(selectedSubscriber, selectedServiceInstance, successCallback, errorCallback) {
             var subscriber;
@@ -124,9 +230,7 @@
                                 }
                             });
                         } else {
-                            if (serviceInstanceId == []) {
-                                serviceInstanceId = [ FIELD.PROMPT.NO_SERVICE_INSTANCE ];
-                            }
+                            serviceInstanceId = [ FIELD.PROMPT.NO_SERVICE_INSTANCE ];
                         }
                         angular.forEach(serviceInstanceId, function(subVal, subKey) {
                             displayData.push({
@@ -145,7 +249,7 @@
                 } else {
                     displayData.push({
                         globalCustomerId 	: selectedSubscriber,
-                        subscriberName   	: selectedSubscriberName,
+                        subscriberName   	: subscriberName,
                         serviceType 		: FIELD.PROMPT.NO_SERVICE_SUB,
                         serviceInstanceId 	: FIELD.PROMPT.NO_SERVICE_INSTANCE
                     });
@@ -178,6 +282,26 @@
             });
         },
 
+        getServiceInstance : getServiceInstance,
+        getPnfByName : getPnfByName,
+
+        getGlobalCustomerIdByInstanceIdentifier : function(serviceInstanceIdentifier, findBy) {
+            serviceInstanceIdentifier.trim();
+
+            return getServiceInstance(serviceInstanceIdentifier, findBy)
+                .then(function (response) {
+                    return getGlobalCustomerIdFromServiceInstanceResponse(response);
+            });
+        },
+
+        getMultipleValueParamQueryString: function(values, paramSubPath) {
+            if (values.length) {
+                return paramSubPath + values.filter(function (val) {return val;}).join("&" + paramSubPath);
+            }
+        },
+
+        getJoinedQueryString: getJoinedQueryString,
+
         getServices2 : function(successCallback, errorCallback ) {
 
             $http.get( FIELD.ID.AAI_GET_SERVICES, {}, {
@@ -252,12 +376,6 @@
                 var lcpCloudRegionTenants = [];
                 var aaiLcpCloudRegionTenants = response.data;
 
-                lcpCloudRegionTenants.push({
-                    "cloudRegionId": "",
-                    "tenantName": FIELD.PROMPT.REGION,
-                    "tenantId": ""
-                });
-
                 for (var i = 0; i < aaiLcpCloudRegionTenants.length; i++) {
                     lcpCloudRegionTenants.push({
                         "cloudRegionId": aaiLcpCloudRegionTenants[i][COMPONENT.CLOUD_REGION_ID],
@@ -267,8 +385,9 @@
                 }
 
                 successCallbackFunction(lcpCloudRegionTenants);
-            })["catch"]
-            (UtilityService.runHttpErrorHandler);
+            }).catch(function(error) {
+                (UtilityService.runHttpErrorHandler(error.data, error.status));
+            })
         },
         getSubscribers : function(successCallbackFunction) {
             $log
@@ -306,7 +425,7 @@
             })["catch"]
             (UtilityService.runHttpErrorHandler);
         },
-        getLoggedInUserID : function(successCallbackFunction) {
+        getLoggedInUserID : function(successCallbackFunction, catchCallbackFunction) {
             $log
                 .debug("AaiService:getLoggedInUserID");
             var url = COMPONENT.GET_USER_ID;
@@ -325,6 +444,9 @@
                     successCallbackFunction([]);
                 }
             },function(failure){console.log("failure")})["catch"]
+                if(catchCallbackFunction) {
+                    catchCallbackFunction();
+                }
             (UtilityService.runHttpErrorHandler);
         },
         getServices : function(successCallbackFunction) {
@@ -459,6 +581,8 @@
             return deferred.promise;
         },
 
+
+
         getSubscriberServiceTypes: function(subscriberUuid) {
             var deferred = $q.defer();
             $log.debug("AaiService:getSubscriberServiceTypes: subscriberUuid: " + subscriberUuid);
@@ -477,6 +601,61 @@
             }
 
             return deferred.promise;
+        },
+        getVnfInstancesList: function(globalSubscriberId, serviceType, modelVersionId ,modelInvariantId, cloudRegionId)  {
+            var deferred = $q.defer();
+            $http.get([COMPONENT.AAI_GET_VNF_INSTANCES_LIST,
+                    globalSubscriberId,
+                    serviceType,
+                    modelVersionId,
+                    modelInvariantId,
+                    cloudRegionId]
+                .join(COMPONENT.FORWARD_SLASH))
+                .success(function (response) {
+                    deferred.resolve(response);
+                }).error(function (data, status) {
+                    deferred.reject({message: data, status: status});
+            });
+            return deferred.promise;
+        },
+        getPnfInstancesList: function (globalCustomerId, serviceType, modelVersionId, modelInvariantId, cloudRegionId, equipVendor, equipModel) {
+            var deferred = $q.defer();
+            $http.get([COMPONENT.AAI_GET_PNF_INSTANCES_LIST,
+                    globalCustomerId, serviceType,
+                    modelVersionId, modelInvariantId,
+                    cloudRegionId,
+                    equipVendor, equipModel
+                ].join(COMPONENT.FORWARD_SLASH))
+                .success(function (response) {
+                    deferred.resolve(response);
+                }).error(function (data, status) {
+                deferred.reject({message: data, status: status});
+            });
+            return deferred.promise;
+        },
+        getByUri: function(uri)  {
+            var deferred = $q.defer();
+
+            $http.get(COMPONENT.AAI_GET_BY_URI + uri)
+                .success(function (response) {
+                    deferred.resolve({data: []});
+                }).error(function (data, status, headers, config) {
+                    deferred.reject({message: data, status: status});
+                });
+
+            return deferred.promise;
+        },
+        getConfiguration: function(configurationId)  {
+            var deferred = $q.defer();
+
+            $http.get(COMPONENT.AAI_GET_CONFIGURATION + configurationId)
+                .success(function (response) {
+                    deferred.resolve({data: []});
+                }).error(function (data, status, headers, config) {
+                deferred.reject({message: data, status: status});
+            });
+
+            return deferred.promise;
         }
     }};
 
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/services/change-management.service.js b/vid-app-common/src/main/webapp/app/vid/scripts/services/change-management.service.js
index f2282d6..fdab656 100644
--- a/vid-app-common/src/main/webapp/app/vid/scripts/services/change-management.service.js
+++ b/vid-app-common/src/main/webapp/app/vid/scripts/services/change-management.service.js
@@ -5,16 +5,20 @@
 
     function changeManagementService($http, $q, COMPONENT, VIDCONFIGURATION) {
         this.getWorkflows = function (vnfs) {
-            var deferred = $q.defer();
-
-            $http.get(COMPONENT.GET_WORKFLOW.replace("@vnfs", vnfs))
-            .success(function (response) {
-                deferred.resolve({data: response});
-            }).error(function (data, status, headers, config) {
-                deferred.reject({message: data, status: status});
+            var requestVnfs = _.map(vnfs, function (vnf) {
+                return {
+                    UUID: vnf["modelVersionId"],
+                    invariantUUID: vnf["invariant-id"]
+                };
             });
-
-            return deferred.promise;
+            var requestDetails = {vnfsDetails: requestVnfs};
+            return $http.post(COMPONENT.GET_WORKFLOW, requestDetails)
+            .success(function (response) {
+                return {data: response};
+            })
+                .catch(function (err) {
+                    return {data: []};
+                });
         };
 
         this.getMSOChangeManagements = function() {
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/services/componentService.js b/vid-app-common/src/main/webapp/app/vid/scripts/services/componentService.js
index ea46dcb..615f25e 100755
--- a/vid-app-common/src/main/webapp/app/vid/scripts/services/componentService.js
+++ b/vid-app-common/src/main/webapp/app/vid/scripts/services/componentService.js
@@ -25,22 +25,26 @@
     var _this = this;
 
     var componentList = [ {
-	id : COMPONENT.NETWORK,
-	displayName : "Network"
+		id : COMPONENT.NETWORK,
+		displayName : "Network"
     }, {
-	id : COMPONENT.SERVICE,
-	displayName : "Service Instance"
-    }, {id : COMPONENT.OLDVERSION,
-	displayName : "Previous Version"
+		id : COMPONENT.SERVICE,
+		displayName : "Service Instance"
+    }, {
+    	id : COMPONENT.OLDVERSION,
+		displayName : "Previous Version"
 	}, {
-	id : COMPONENT.VNF,
-	displayName : "Virtual Network Function"
+		id : COMPONENT.VNF,
+		displayName : "Virtual Network Function"
     }, {
-	id : COMPONENT.VF_MODULE,
-	displayName : "VF Module"
+		id : COMPONENT.VF_MODULE,
+		displayName : "VF Module"
     }, {
-	id : COMPONENT.VOLUME_GROUP,
-	displayName : "Volume Group"
+        id: COMPONENT.VOLUME_GROUP,
+        displayName: "Volume Group"
+    }, {
+        id : COMPONENT.CONFIGURATION,
+        displayName : "Port Mirroring Configuration"
     } ];
 
     var getInventoryInfo = function(suffix, inventoryItem) {
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/services/creationService.js b/vid-app-common/src/main/webapp/app/vid/scripts/services/creationService.js
index e171e28..838ab37 100755
--- a/vid-app-common/src/main/webapp/app/vid/scripts/services/creationService.js
+++ b/vid-app-common/src/main/webapp/app/vid/scripts/services/creationService.js
@@ -30,345 +30,355 @@
  */
 
 var CreationService = function($log, AaiService, AsdcService, DataService,VIDCONFIGURATION,
-		ComponentService, COMPONENT, FIELD, PARAMETER, UtilityService) {
+                               ComponentService, COMPONENT, FIELD, PARAMETER, UtilityService, OwningEntityService) {
 
-	var _this = this;
+    var _this = this;
 
-	var getAsyncOperationList = function() {
-		if (DataService.getLoggedInUserId() == null)
-			getLoggedInUserID();
-		switch (_this.componentId) {
-		case COMPONENT.SERVICE:
-			return [ getSubscribers, getServices,getAicZones ];
-		case COMPONENT.NETWORK:
-			return [ getLcpCloudRegionTenantList ];
-		case COMPONENT.VNF:
-			return [ getLcpCloudRegionTenantList ];
-		case COMPONENT.VF_MODULE:
-			return [ getLcpCloudRegionTenantList ];
-		case COMPONENT.VOLUME_GROUP:
-			return [ getLcpCloudRegionTenantList ];
-		}
-	};
+    var getAsyncOperationList = function() {
+        if (DataService.getLoggedInUserId() == null) {
+            getLoggedInUserID();
+        } else {
+            UtilityService.startNextAsyncOperation();
+        }
+        switch (_this.componentId) {
+            case COMPONENT.SERVICE:
+                return [ getSubscribers, getServices, getAicZones, getOwningEntityProperties ];
+            case COMPONENT.NETWORK:
+                return [ getLcpCloudRegionTenantList, getOwningEntityProperties ];
+            case COMPONENT.VNF:
+                return [ getLcpCloudRegionTenantList, getOwningEntityProperties ];
+            case COMPONENT.VF_MODULE:
+                return [ getLcpCloudRegionTenantList ];
+            case COMPONENT.VOLUME_GROUP:
+                return [ getLcpCloudRegionTenantList ];
+        }
+    };
 
-	/*
-	 * "getSummaryList" and "getUserProvidedList" return parameters that should
-	 * be displayed in the summary and user provided sections, respectively. The
-	 * functions are expected to return lists that are in the format needed by
-	 * the parameter-block directive.
-	 */
+    /*
+     * "getSummaryList" and "getUserProvidedList" return parameters that should
+     * be displayed in the summary and user provided sections, respectively. The
+     * functions are expected to return lists that are in the format needed by
+     * the parameter-block directive.
+     */
 
-	var getSummaryList = function() {
+    var getSummaryList = function() {
 
-		/*
-		 * These placeholders should be removed and their usage in
-		 * "getSummaryList" should be replaced by appropriate code as the
-		 * requirements and interfaces firm up.
-		 */
+        /*
+         * These placeholders should be removed and their usage in
+         * "getSummaryList" should be replaced by appropriate code as the
+         * requirements and interfaces firm up.
+         */
 
-		var PLACEHOLDER_RESOURCE_DESCRIPTION = "Resource Description (PLACEHOLDER)";
-		var PLACEHOLDER_SERVICE_CATEGORY = "Service Category (PLACEHOLDER)";
-		var PLACEHOLDER_VF_MODULE_DESCRIPTION = "VF Module Description (PLACEHOLDER)";
-		var PLACEHOLDER_VF_MODULE_LABEL = "VF Module Label (PLACEHOLDER)";
-		var PLACEHOLDER_VF_MODULE_TYPE = "VF Module Type (PLACEHOLDER)";
+        var PLACEHOLDER_RESOURCE_DESCRIPTION = "Resource Description (PLACEHOLDER)";
+        var PLACEHOLDER_SERVICE_CATEGORY = "Service Category (PLACEHOLDER)";
+        var PLACEHOLDER_VF_MODULE_DESCRIPTION = "VF Module Description (PLACEHOLDER)";
+        var PLACEHOLDER_VF_MODULE_LABEL = "VF Module Label (PLACEHOLDER)";
+        var PLACEHOLDER_VF_MODULE_TYPE = "VF Module Type (PLACEHOLDER)";
 
-		_this.parameterList = new Array();
+        _this.parameterList = new Array();
 
-		/*
-		 * Common fields displayed at the top of all create instance screens.
-		 */
-		if(DataService.getModelInfo(_this.componentId)["serviceTypeName"]==null 
-				|| DataService.getModelInfo(_this.componentId)["serviceTypeName"]==undefined
-				|| DataService.getModelInfo(_this.componentId)["serviceTypeName"]==''){
-			addToList(FIELD.NAME.SERVICE_NAME, DataService.getServiceName());
-		}
+        /*
+         * Common fields displayed at the top of all create instance screens.
+         */
+        if(DataService.getModelInfo(_this.componentId)["serviceTypeName"]==null
+            || DataService.getModelInfo(_this.componentId)["serviceTypeName"]==undefined
+            || DataService.getModelInfo(_this.componentId)["serviceTypeName"]==''){
+            addToList(FIELD.NAME.SERVICE_NAME, DataService.getServiceName());
+        }
 
-		switch (_this.componentId) {
-		case COMPONENT.SERVICE:
-			if ( !DataService.getALaCarte() ) {
-				// for macro instantiation need to add the resource names under the node template list
-				// this field is called modelCustomizationName in the asdc client code
-				var p;
-				var rlist = DataService.getResources();
-				var res;
-				if ( rlist != null ) { 
-					for (var i = 0; i < rlist.length; i++) {
-						res = rlist[i];
-					
-						p = FIELD.NAME.RESOURCE_NAME.concat(" " + (i+1));
-						addToList(p, res.name );
-						p = FIELD.NAME.RESOURCE_DESCRIPTION.concat(" " + (i+1));
-						addToList(p, res.description );
-					}
-				}
-			}
-			if(DataService.getModelInfo(_this.componentId)["createSubscriberName"]!=null && DataService.getModelInfo(_this.componentId)["createSubscriberName"]!=''){
-				addToList(FIELD.NAME.SUBSCRIBER_NAME, DataService
-						.getModelInfo(_this.componentId)["createSubscriberName"]);
-			}
-			if(DataService.getModelInfo(_this.componentId)["serviceTypeName"]!=null && DataService.getModelInfo(_this.componentId)["serviceTypeName"]!=''){
-				addToList(FIELD.NAME.SERVICE_TYPE, DataService
-						.getModelInfo(_this.componentId)["serviceTypeName"]);
-				addToList(FIELD.NAME.SERVICE_NAME, DataService.getServiceName());
-			}
-			addToList(FIELD.NAME.SERVICE_INVARIANT_UUID, DataService
-					.getModelInfo(_this.componentId)[FIELD.ID.MODEL_INVARIANT_ID]);
-			addToList(FIELD.NAME.SERVICE_VERSION, DataService
-					.getModelInfo(_this.componentId)[FIELD.ID.MODEL_VERSION]);
-			addToList(FIELD.NAME.SERVICE_UUID, DataService
-					.getModelInfo(_this.componentId)[FIELD.ID.MODEL_NAME_VERSION_ID]);
-			addToList(FIELD.NAME.SERVICE_DESCRIPTION, DataService
-					.getModelInfo(_this.componentId)[FIELD.ID.DESCRIPTION]);
-			addToList(FIELD.NAME.SERVICE_CATEGORY, DataService
-					.getModelInfo(_this.componentId)[FIELD.ID.CATEGORY]);
-			if (DataService.getModelInfo(_this.componentId)[FIELD.ID.SERVICE_TYPE] != "null") {
-				addToList(FIELD.NAME.SERVICE_TYPE, DataService
-					.getModelInfo(_this.componentId)[FIELD.ID.SERVICE_TYPE]);
-				addToList(FIELD.NAME.SERVICE_ROLE, DataService
-					.getModelInfo(_this.componentId)[FIELD.ID.SERVICE_ROLE]);
-			}
+        switch (_this.componentId) {
+            case COMPONENT.SERVICE:
+                if ( !DataService.getALaCarte() ) {
+                    // for macro instantiation need to add the resource names under the node template list
+                    // this field is called modelCustomizationName in the asdc client code
+                    var p;
+                    var rlist = DataService.getResources();
+                    var res;
+                    if ( rlist != null ) {
+                        for (var i = 0; i < rlist.length; i++) {
+                            res = rlist[i];
 
-			break;
-		case COMPONENT.VF_MODULE:
-			addToList(FIELD.NAME.SUBSCRIBER_NAME, DataService
-					.getSubscriberName());
-			addToList(FIELD.NAME.SERVICE_INSTANCE_NAME, DataService
-					.getServiceInstanceName());
-			addToList(FIELD.NAME.MODEL_NAME, DataService
-					.getModelInfo(_this.componentId)[FIELD.ID.MODEL_NAME]);
-			addToList(FIELD.NAME.MODEL_INVARIANT_UUID, DataService
-					.getModelInfo(_this.componentId)[FIELD.ID.MODEL_INVARIANT_ID]);
-			addToList(FIELD.NAME.MODEL_VERSION, DataService
-					.getModelInfo(_this.componentId)[FIELD.ID.MODEL_VERSION]);
-			addToList(FIELD.NAME.MODEL_UUID, DataService
-					.getModelInfo(_this.componentId)[FIELD.ID.MODEL_NAME_VERSION_ID]);
-			addToList(FIELD.NAME.MODEL_CUSTOMIZATION_UUID, DataService
-					.getModelInfo(_this.componentId)[FIELD.ID.CUSTOMIZATION_UUID]);
-			break;
-		case COMPONENT.VNF:
-			addToList(FIELD.NAME.SUBSCRIBER_NAME, DataService
-					.getSubscriberName());
-			addToList(FIELD.NAME.SERVICE_INSTANCE_NAME, DataService
-					.getServiceInstanceName());
-			addToList(FIELD.NAME.MODEL_NAME, DataService
-					.getModelInfo(_this.componentId)[FIELD.ID.MODEL_NAME]);
-			addToList(FIELD.NAME.MODEL_INVARIANT_UUID, DataService
-					.getModelInfo(_this.componentId)[FIELD.ID.MODEL_INVARIANT_ID]);
-			addToList(FIELD.NAME.MODEL_VERSION, DataService
-					.getModelInfo(_this.componentId)[FIELD.ID.MODEL_VERSION]);
-			addToList(FIELD.NAME.MODEL_UUID, DataService
-					.getModelInfo(_this.componentId)[FIELD.ID.MODEL_NAME_VERSION_ID]);
-			addToList(FIELD.NAME.MODEL_CUSTOMIZATION_UUID, DataService
-					.getModelInfo(_this.componentId)[FIELD.ID.CUSTOMIZATION_UUID]);
-			addToList(FIELD.NAME.MODEL_CUSTOMIZATION_NAME, DataService
-					.getModelInfo(_this.componentId)[FIELD.ID.MODEL_CUSTOMIZATION_NAME]);
-			addToList(FIELD.NAME.MODEL_VNF_TYPE, DataService
-					.getModelInfo(_this.componentId)[COMPONENT.VNF_TYPE]);
-			addToList(FIELD.NAME.MODEL_VNF_ROLE, DataService
-					.getModelInfo(_this.componentId)[COMPONENT.VNF_ROLE]);
-			addToList(FIELD.NAME.MODEL_VNF_FUNCTION, DataService
-					.getModelInfo(_this.componentId)[COMPONENT.VNF_FUNCTION]);
-			addToList(FIELD.NAME.MODEL_VNF_CODE, DataService
-					.getModelInfo(_this.componentId)[COMPONENT.VNF_CODE]);
-			break;
-		case COMPONENT.NETWORK:
-		case COMPONENT.VOLUME_GROUP:
-			addToList(FIELD.NAME.SUBSCRIBER_NAME, DataService
-					.getSubscriberName());
-			addToList(FIELD.NAME.SERVICE_INSTANCE_NAME, DataService
-					.getServiceInstanceName());
-			addToList(FIELD.NAME.MODEL_NAME, DataService
-					.getModelInfo(_this.componentId)[FIELD.ID.MODEL_NAME]);
-			addToList(FIELD.NAME.MODEL_INVARIANT_UUID, DataService
-					.getModelInfo(_this.componentId)[FIELD.ID.MODEL_INVARIANT_ID]);
-			addToList(FIELD.NAME.MODEL_VERSION, DataService
-					.getModelInfo(_this.componentId)[FIELD.ID.MODEL_VERSION]);
-			addToList(FIELD.NAME.MODEL_UUID, DataService
-					.getModelInfo(_this.componentId)[FIELD.ID.MODEL_NAME_VERSION_ID]);
-			addToList(FIELD.NAME.MODEL_CUSTOMIZATION_UUID, DataService
-					.getModelInfo(_this.componentId)[FIELD.ID.CUSTOMIZATION_UUID]);
-			break;
-		}
+                            p = FIELD.NAME.RESOURCE_NAME.concat(" " + (i+1));
+                            addToList(p, res.name );
+                            p = FIELD.NAME.RESOURCE_DESCRIPTION.concat(" " + (i+1));
+                            addToList(p, res.description );
+                        }
+                    }
+                }
+                if(DataService.getModelInfo(_this.componentId)["createSubscriberName"]!=null && DataService.getModelInfo(_this.componentId)["createSubscriberName"]!=''){
+                    addToList(FIELD.NAME.SUBSCRIBER_NAME, DataService
+                        .getModelInfo(_this.componentId)["createSubscriberName"]);
+                }
+                if(DataService.getModelInfo(_this.componentId)["serviceTypeName"]!=null && DataService.getModelInfo(_this.componentId)["serviceTypeName"]!=''){
+                    addToList(FIELD.NAME.SERVICE_TYPE, DataService
+                        .getModelInfo(_this.componentId)["serviceTypeName"]);
+                    addToList(FIELD.NAME.SERVICE_NAME, DataService.getServiceName());
+                }
+                addToList(FIELD.NAME.SERVICE_INVARIANT_UUID, DataService
+                    .getModelInfo(_this.componentId)[FIELD.ID.MODEL_INVARIANT_ID]);
+                addToList(FIELD.NAME.SERVICE_VERSION, DataService
+                    .getModelInfo(_this.componentId)[FIELD.ID.MODEL_VERSION]);
+                addToList(FIELD.NAME.SERVICE_UUID, DataService
+                    .getModelInfo(_this.componentId)[FIELD.ID.MODEL_NAME_VERSION_ID]);
+                addToList(FIELD.NAME.SERVICE_DESCRIPTION, DataService
+                    .getModelInfo(_this.componentId)[FIELD.ID.DESCRIPTION]);
+                addToList(FIELD.NAME.SERVICE_CATEGORY, DataService
+                    .getModelInfo(_this.componentId)[FIELD.ID.CATEGORY]);
+                if (DataService.getModelInfo(_this.componentId)[FIELD.ID.SERVICE_TYPE] != "null") {
+                    addToList(FIELD.NAME.SERVICE_TYPE, DataService
+                        .getModelInfo(_this.componentId)[FIELD.ID.SERVICE_TYPE]);
+                    addToList(FIELD.NAME.SERVICE_ROLE, DataService
+                        .getModelInfo(_this.componentId)[FIELD.ID.SERVICE_ROLE]);
+                }
 
-		return _this.parameterList;
-	};
+                break;
+            case COMPONENT.VF_MODULE:
+                addToList(FIELD.NAME.SUBSCRIBER_NAME, DataService
+                    .getSubscriberName());
+                addToList(FIELD.NAME.SERVICE_INSTANCE_NAME, DataService
+                    .getServiceInstanceName());
+                addToList(FIELD.NAME.MODEL_NAME, DataService
+                    .getModelInfo(_this.componentId)[FIELD.ID.MODEL_NAME]);
+                addToList(FIELD.NAME.MODEL_INVARIANT_UUID, DataService
+                    .getModelInfo(_this.componentId)[FIELD.ID.MODEL_INVARIANT_ID]);
+                addToList(FIELD.NAME.MODEL_VERSION, DataService
+                    .getModelInfo(_this.componentId)[FIELD.ID.MODEL_VERSION]);
+                addToList(FIELD.NAME.MODEL_UUID, DataService
+                    .getModelInfo(_this.componentId)[FIELD.ID.MODEL_NAME_VERSION_ID]);
+                addToList(FIELD.NAME.MODEL_CUSTOMIZATION_UUID, DataService
+                    .getModelInfo(_this.componentId)[FIELD.ID.CUSTOMIZATION_UUID]);
+                break;
+            case COMPONENT.VNF:
+                addToList(FIELD.NAME.SUBSCRIBER_NAME, DataService
+                    .getSubscriberName());
+                addToList(FIELD.NAME.SERVICE_INSTANCE_NAME, DataService
+                    .getServiceInstanceName());
+                addToList(FIELD.NAME.MODEL_NAME, DataService
+                    .getModelInfo(_this.componentId)[FIELD.ID.MODEL_NAME]);
+                addToList(FIELD.NAME.MODEL_INVARIANT_UUID, DataService
+                    .getModelInfo(_this.componentId)[FIELD.ID.MODEL_INVARIANT_ID]);
+                addToList(FIELD.NAME.MODEL_VERSION, DataService
+                    .getModelInfo(_this.componentId)[FIELD.ID.MODEL_VERSION]);
+                addToList(FIELD.NAME.MODEL_UUID, DataService
+                    .getModelInfo(_this.componentId)[FIELD.ID.MODEL_NAME_VERSION_ID]);
+                addToList(FIELD.NAME.MODEL_CUSTOMIZATION_UUID, DataService
+                    .getModelInfo(_this.componentId)[FIELD.ID.CUSTOMIZATION_UUID]);
+                addToList(FIELD.NAME.MODEL_CUSTOMIZATION_NAME, DataService
+                    .getModelInfo(_this.componentId)[FIELD.ID.MODEL_CUSTOMIZATION_NAME]);
+                addToList(FIELD.NAME.MODEL_VNF_TYPE, DataService
+                    .getModelInfo(_this.componentId)[COMPONENT.VNF_TYPE]);
+                addToList(FIELD.NAME.MODEL_VNF_ROLE, DataService
+                    .getModelInfo(_this.componentId)[COMPONENT.VNF_ROLE]);
+                addToList(FIELD.NAME.MODEL_VNF_FUNCTION, DataService
+                    .getModelInfo(_this.componentId)[COMPONENT.VNF_FUNCTION]);
+                addToList(FIELD.NAME.MODEL_VNF_CODE, DataService
+                    .getModelInfo(_this.componentId)[COMPONENT.VNF_CODE]);
+                break;
+            case COMPONENT.NETWORK:
+            case COMPONENT.VOLUME_GROUP:
+                addToList(FIELD.NAME.SUBSCRIBER_NAME, DataService
+                    .getSubscriberName());
+                addToList(FIELD.NAME.SERVICE_INSTANCE_NAME, DataService
+                    .getServiceInstanceName());
+                addToList(FIELD.NAME.MODEL_NAME, DataService
+                    .getModelInfo(_this.componentId)[FIELD.ID.MODEL_NAME]);
+                addToList(FIELD.NAME.MODEL_INVARIANT_UUID, DataService
+                    .getModelInfo(_this.componentId)[FIELD.ID.MODEL_INVARIANT_ID]);
+                addToList(FIELD.NAME.MODEL_VERSION, DataService
+                    .getModelInfo(_this.componentId)[FIELD.ID.MODEL_VERSION]);
+                addToList(FIELD.NAME.MODEL_UUID, DataService
+                    .getModelInfo(_this.componentId)[FIELD.ID.MODEL_NAME_VERSION_ID]);
+                addToList(FIELD.NAME.MODEL_CUSTOMIZATION_UUID, DataService
+                    .getModelInfo(_this.componentId)[FIELD.ID.CUSTOMIZATION_UUID]);
+                break;
+        }
 
-	var getUserProvidedList = function() {
-		var parameterList = [];
-		var isUserProvidedNaming = false;
-		if ( (DataService.getModelInfo(_this.componentId).serviceEcompNaming != null) 
-				&& (DataService.getModelInfo(_this.componentId).serviceEcompNaming === "false") ) {
-			isUserProvidedNaming = true;
-		}
-		
-		var isInTop = DataService.getHideServiceFields() || false;
-		if (_this.componentId === COMPONENT.SERVICE) {	
-			if ( DataService.getALaCarte() ) {
-				parameterList = [ FIELD.PARAMETER.INSTANCE_NAME ];
-				if(!isInTop){
-					parameterList = parameterList.concat([ getSubscribersParameter(),
-						FIELD.PARAMETER.SERVICE_TYPE_DISABLED ]);
-				}
-			}
-			else {
-				// macro
-				
-				if(!isInTop){
-					if (isUserProvidedNaming) {
-						parameterList = [ FIELD.PARAMETER.INSTANCE_NAME ];
+        return _this.parameterList;
+    };
 
-					}
-					parameterList = parameterList.concat([ getSubscribersParameter() ]);
-					parameterList = parameterList.concat([ getServiceId(),
-						FIELD.PARAMETER.SERVICE_TYPE,
-						FIELD.PARAMETER.LCP_REGION,
-						FIELD.PARAMETER.LCP_REGION_TEXT_HIDDEN,
-						FIELD.PARAMETER.TENANT_DISABLED,
-						]);
-					parameterList = parameterList.concat([ getAICZones() ]);
+    var getUserProvidedList = function() {
+        var parameterList = [];
+        var isUserProvidedNaming = false;
+        if ( (DataService.getModelInfo(_this.componentId).serviceEcompNaming != null)
+            && (DataService.getModelInfo(_this.componentId).serviceEcompNaming === "false") ) {
+            isUserProvidedNaming = true;
+        }
+
+        var isInTop = DataService.getHideServiceFields() || false;
+        if (_this.componentId === COMPONENT.SERVICE) {
+            if ( DataService.getALaCarte() ) {
+                parameterList = [ FIELD.PARAMETER.INSTANCE_NAME ];
+                if(!isInTop){
+                    parameterList = parameterList.concat([ getSubscribersParameter(),
+                        FIELD.PARAMETER.SERVICE_TYPE_DISABLED ]);
+                }
+            }
+            else {
+                // macro
+
+                if(!isInTop){
+                    if (isUserProvidedNaming) {
+                        parameterList = [ FIELD.PARAMETER.INSTANCE_NAME ];
+
+                    }
+                    parameterList = parameterList.concat([ getSubscribersParameter() ]);
+                    parameterList = parameterList.concat([ getServiceId(),
+                        FIELD.PARAMETER.SERVICE_TYPE,
+                        FIELD.PARAMETER.LCP_REGION,
+                        FIELD.PARAMETER.LCP_REGION_TEXT_HIDDEN,
+                        FIELD.PARAMETER.TENANT_DISABLED
+                    ]);
+                    parameterList = parameterList.concat([ getAicZonesParameter() ]);
 
 
-				}else{
-					parameterList = parameterList.concat([ getServiceId(),
-						FIELD.PARAMETER.LCP_REGION,
-						FIELD.PARAMETER.LCP_REGION_TEXT_HIDDEN,
-						FIELD.PARAMETER.TENANT_DISABLED ]);
-				}
-			}
-		}
-		else {
-			parameterList = [ FIELD.PARAMETER.INSTANCE_NAME ];
-			switch (_this.componentId) {
-			case COMPONENT.NETWORK:
-			case COMPONENT.VNF:
-				parameterList = parameterList.concat([ getServiceId(),
-						getLcpRegion(), FIELD.PARAMETER.LCP_REGION_TEXT_HIDDEN,
-						FIELD.PARAMETER.TENANT_DISABLED ]);
-				break;
-			case COMPONENT.VF_MODULE:
-				parameterList = parameterList.concat([
-				        getLcpRegion(),
-						FIELD.PARAMETER.LCP_REGION_TEXT_HIDDEN,
-						FIELD.PARAMETER.TENANT_DISABLED
-				]);
-				
-				var availableVolumeGroupList = DataService.getAvailableVolumeGroupList();
-				
-				if (availableVolumeGroupList && availableVolumeGroupList.length > 0) {
-					var availableVolumeGroupNames = [FIELD.STATUS.NONE];
-	
-					for (var i = 0; i < availableVolumeGroupList.length; i++) {
-						availableVolumeGroupNames.push(availableVolumeGroupList[i].instance.name);
-					}
-					
-					parameterList.push(addOptionList(
-							FIELD.PARAMETER.AVAILABLE_VOLUME_GROUP,
-							availableVolumeGroupNames));
-				}
-				break;
-			case COMPONENT.VOLUME_GROUP:
-				parameterList = parameterList.concat([ getLcpRegion(),
-						FIELD.PARAMETER.LCP_REGION_TEXT_HIDDEN,
-						FIELD.PARAMETER.TENANT_DISABLED ]);
-			}
-		}
-		parameterList.push(FIELD.PARAMETER.SUPPRESS_ROLLBACK);
-		if(_this.componentId === COMPONENT.VF_MODULE ){
-			parameterList.push({name: FIELD.NAME.SDN_C_PRELOAD,
-				id: FIELD.ID.SDN_C_PRELOAD,
-				type: "checkbox",
-				isEnabled: true,
-				isRequired: false,
-				hideFieldAndLabel: true
-				}
-			);
-			parameterList.push({name: FIELD.NAME.UPLOAD_SUPPLEMENTORY_DATA_FILE,
-				id: FIELD.ID.UPLOAD_SUPPLEMENTORY_DATA_FILE,
-				type: "checkbox",
-				isEnabled: true,
-				isRequired: false,
-				value:false
-				}
-			);
-			
-			parameterList.push({name: FIELD.NAME.SUPPLEMENTORY_DATA_FILE,
-				id: FIELD.ID.SUPPLEMENTORY_DATA_FILE,
-				type: "file",
-				isRequired: false,
-				isVisiblity: false
-				}
-			);
-		}
-		
-		if( VIDCONFIGURATION.UPLOAD_SUPPLEMENTARY_STATUS_CHECK_ENABLED  && _this.componentId === COMPONENT.VOLUME_GROUP){
-			parameterList.push({name: FIELD.NAME.UPLOAD_SUPPLEMENTORY_DATA_FILE,
-				id: FIELD.ID.UPLOAD_SUPPLEMENTORY_DATA_FILE,
-					type: "checkbox",
-					isEnabled: true,
-					isRequired: false
-					}
-				);
-				
-			parameterList.push({name: FIELD.NAME.SUPPLEMENTORY_DATA_FILE,
-				id: FIELD.ID.SUPPLEMENTORY_DATA_FILE,
-					type: "file",
-					isRequired: false,
-					isVisiblity: false
-					}
-				);
-			}
+                }else{
+                    parameterList = parameterList.concat([ getServiceId(),
+                        FIELD.PARAMETER.LCP_REGION,
+                        FIELD.PARAMETER.LCP_REGION_TEXT_HIDDEN,
+                        FIELD.PARAMETER.TENANT_DISABLED ]);
+                }
+            }
 
-		addArbitraryParameters(parameterList);
+            parameterList = parameterList.concat([ getProjectParameter() ]);
+            parameterList = parameterList.concat([ getOwningEntityParameter() ]);
 
-		return parameterList;
-	};
+        }
+        else {
+            parameterList = [ FIELD.PARAMETER.INSTANCE_NAME ];
+            switch (_this.componentId) {
+                case COMPONENT.NETWORK:
+                case COMPONENT.VNF:
+                    parameterList = parameterList.concat([ getServiceId(),
+                        getLcpRegionParameter(), FIELD.PARAMETER.LCP_REGION_TEXT_HIDDEN,
+                        FIELD.PARAMETER.TENANT_DISABLED ]);
+                    parameterList = parameterList.concat([ getLineOfBusinessParameter() ]);
+                    parameterList = parameterList.concat([ getPlatformParameter() ]);
 
-	var addArbitraryParameters = function(parameterList) {
-		if ( DataService.getModelInfo(_this.componentId).displayInputs != null ) {
-			var inputs = DataService.getModelInfo(_this.componentId).displayInputs;	 
-			for ( var key in inputs) {
-				var parameter = {
-						id : key,
-						type : PARAMETER.STRING,
-						name : ComponentService.getFieldDisplayName(key),
-						value : inputs[key][PARAMETER.DEFAULT],
-						isRequired : inputs[key][PARAMETER.REQUIRED],
-						description : inputs[key][PARAMETER.DESCRIPTION]
-				};
-				if ( DataService.getALaCarte() ) {
-					parameter.name = ComponentService.getFieldDisplayName(inputs[key][PARAMETER.DISPLAY_NAME]);
-				}
-				switch (inputs[key][PARAMETER.TYPE]) {
-					case PARAMETER.INTEGER:
-						parameter.type = PARAMETER.NUMBER;
-						break;
-					case PARAMETER.BOOLEAN:
-						parameter.type = PARAMETER.BOOLEAN;
-						break;
-					case PARAMETER.RANGE:
-						break;
-					case PARAMETER.LIST:
-						parameter.type = PARAMETER.LIST;
-						break;
-					case PARAMETER.MAP:
-						parameter.type = PARAMETER.MAP;
-						break;
-				}
-			
-				if ( UtilityService.hasContents(inputs[key][PARAMETER.CONSTRAINTS]) 
-						&& ( inputs[key][PARAMETER.CONSTRAINTS].length > 0 ) ) {
-					var constraintsArray = inputs[key][PARAMETER.CONSTRAINTS];
-					//console.log ("Calling addConstraintParameters for input name=" + key);
-					addConstraintParameters (parameterList, constraintsArray, key, inputs, parameter);
-				}
-				else {
-					
-					parameterList.push(parameter);
-				}
-			}
-			DataService.setArbitraryParameters (parameterList);
-		}
-	};
+                    break;
+                case COMPONENT.VF_MODULE:
+                    parameterList = parameterList.concat([
+                        getLcpRegionParameter(),
+                        FIELD.PARAMETER.LCP_REGION_TEXT_HIDDEN,
+                        FIELD.PARAMETER.TENANT_DISABLED
+                    ]);
+
+                    var availableVolumeGroupList = DataService.getAvailableVolumeGroupList();
+
+                    if (availableVolumeGroupList && availableVolumeGroupList.length > 0) {
+                        var availableVolumeGroupNames = [FIELD.STATUS.NONE];
+
+                        for (var i = 0; i < availableVolumeGroupList.length; i++) {
+                            availableVolumeGroupNames.push(availableVolumeGroupList[i].instance.name);
+                        }
+
+                        parameterList.push(addOptionList(
+                            FIELD.PARAMETER.AVAILABLE_VOLUME_GROUP,
+                            availableVolumeGroupNames));
+                    }
+                    break;
+                case COMPONENT.VOLUME_GROUP:
+                    parameterList = parameterList.concat([ getLcpRegionParameter(),
+                        FIELD.PARAMETER.LCP_REGION_TEXT_HIDDEN,
+                        FIELD.PARAMETER.TENANT_DISABLED ]);
+            }
+        }
+        parameterList.push(FIELD.PARAMETER.SUPPRESS_ROLLBACK);
+        if(_this.componentId === COMPONENT.VF_MODULE ){
+            parameterList.push({name: FIELD.NAME.SDN_C_PRELOAD,
+                    id: FIELD.ID.SDN_C_PRELOAD,
+                    type: "checkbox",
+                    isEnabled: true,
+                    isRequired: false,
+                    hideFieldAndLabel: true
+                }
+            );
+            parameterList.push({name: FIELD.NAME.UPLOAD_SUPPLEMENTORY_DATA_FILE,
+                    id: FIELD.ID.UPLOAD_SUPPLEMENTORY_DATA_FILE,
+                    type: "checkbox",
+                    isEnabled: true,
+                    isRequired: false,
+                    value:false
+                }
+            );
+
+            parameterList.push({name: FIELD.NAME.SUPPLEMENTORY_DATA_FILE,
+                    id: FIELD.ID.SUPPLEMENTORY_DATA_FILE,
+                    type: "file",
+                    isRequired: false,
+                    isVisiblity: false
+                }
+            );
+        }
+
+        if( VIDCONFIGURATION.UPLOAD_SUPPLEMENTARY_STATUS_CHECK_ENABLED  && _this.componentId === COMPONENT.VOLUME_GROUP){
+            parameterList.push({name: FIELD.NAME.UPLOAD_SUPPLEMENTORY_DATA_FILE,
+                    id: FIELD.ID.UPLOAD_SUPPLEMENTORY_DATA_FILE,
+                    type: "checkbox",
+                    isEnabled: true,
+                    isRequired: false
+                }
+            );
+
+            parameterList.push({name: FIELD.NAME.SUPPLEMENTORY_DATA_FILE,
+                    id: FIELD.ID.SUPPLEMENTORY_DATA_FILE,
+                    type: "file",
+                    isRequired: false,
+                    isVisiblity: false
+                }
+            );
+        }
+
+        addArbitraryParameters(parameterList);
+
+        return parameterList;
+    };
+
+    var addArbitraryParameters = function(parameterList) {
+        if ( DataService.getModelInfo(_this.componentId).displayInputs != null ) {
+            var inputs = DataService.getModelInfo(_this.componentId).displayInputs;
+            for ( var key in inputs) {
+                var parameter = {
+                    id : key,
+                    type : PARAMETER.STRING,
+                    name : ComponentService.getFieldDisplayName(key),
+                    value : inputs[key][PARAMETER.DEFAULT],
+                    isRequired : inputs[key][PARAMETER.REQUIRED],
+                    description : inputs[key][PARAMETER.DESCRIPTION]
+                };
+                if ( DataService.getALaCarte() ) {
+                    parameter.name = ComponentService.getFieldDisplayName(inputs[key][PARAMETER.DISPLAY_NAME]);
+                }
+                switch (inputs[key][PARAMETER.TYPE]) {
+                    case PARAMETER.INTEGER:
+                        parameter.type = PARAMETER.NUMBER;
+                        break;
+                    case PARAMETER.BOOLEAN:
+                        parameter.type = PARAMETER.BOOLEAN;
+                        break;
+                    case PARAMETER.RANGE:
+                        break;
+                    case PARAMETER.LIST:
+                        parameter.type = PARAMETER.LIST;
+                        break;
+                    case PARAMETER.MAP:
+                        parameter.type = PARAMETER.MAP;
+                        break;
+                }
+
+                if ( UtilityService.hasContents(inputs[key][PARAMETER.CONSTRAINTS])
+                    && ( inputs[key][PARAMETER.CONSTRAINTS].length > 0 ) ) {
+                    var constraintsArray = inputs[key][PARAMETER.CONSTRAINTS];
+                    //console.log ("Calling addConstraintParameters for input name=" + key);
+                    addConstraintParameters (parameterList, constraintsArray, key, inputs, parameter);
+                }
+                else {
+
+                    parameterList.push(parameter);
+                }
+            }
+            DataService.setArbitraryParameters (parameterList);
+        }
+    };
 
 	var addConstraintParameters = function(parameterList, constraintsArray, key, inputs, parameter) {
 		// If there are constraints and the operator is "valid_values",
@@ -485,614 +495,697 @@
 			value : value
 		});
 	};
-
-	/*
-	 * The "*Mso*" functions return URL and request details that can be passed
-	 * to the MSO controller. The request details defines the info passed as
-	 * part of the POST body.
-	 */
-
-	var getMsoUrl = function() {
-		switch (_this.componentId) {
-		case COMPONENT.NETWORK:
-			return "mso_create_nw_instance/"
-					+ DataService.getServiceInstanceId();
-		case COMPONENT.SERVICE:
-			return "mso_create_svc_instance";
-		case COMPONENT.VNF:
-			return "mso_create_vnf_instance/"
-					+ DataService.getServiceInstanceId();
-		case COMPONENT.VF_MODULE:
-			return "mso_create_vfmodule_instance/"
-					+ DataService.getServiceInstanceId() + "/vnfs/"
-					+ DataService.getVnfInstanceId();
-		case COMPONENT.VOLUME_GROUP:
-			return "mso_create_volumegroup_instance/"
-					+ DataService.getServiceInstanceId() + "/vnfs/"
-					+ DataService.getVnfInstanceId();
-		}
-	};
-
-	var getMsoRequestDetails = function(parameterList) {
-		console.log("getMsoRequestDetails invoked, parameterList="); console.log(JSON.stringify(parameterList,null,4));
-		//console.log("getMsoRequestDetails invoked, DataService.getArbitraryParameters()="); 
-		//console.log(JSON.stringify(DataService.getArbitraryParameters(),null,4));
-		
-		var modelInfo = DataService.getModelInfo(_this.componentId);
-		var requestorloggedInId = DataService.getLoggedInUserId();
-		if (requestorloggedInId ==  null)
-			requestorloggedInId = "";
-		var isSupRollback = false;
-		if (getValueFromList(FIELD.ID.SUPPRESS_ROLLBACK,parameterList) === "true") {
-			isSupRollback = true;
-		}
-		var requestDetails = {
-			requestInfo : {
-				instanceName : getValueFromList(FIELD.ID.INSTANCE_NAME,
-						parameterList),
-				source : FIELD.ID.VID,
-				suppressRollback : isSupRollback,
-				requestorId: requestorloggedInId
-			},
-			modelInfo : {
-				modelType : _this.componentId,
-				modelInvariantId : modelInfo.modelInvariantId,
-				modelVersionId : modelInfo.modelNameVersionId,
-				modelName : modelInfo.modelName,
-				modelVersion : modelInfo.modelVersion,
-				modelCustomizationId: modelInfo.customizationUuid,
-				modelCustomizationName : modelInfo.modelCustomizationName
-			},
-			requestParameters : {
-				userParams : getArbitraryParameters(parameterList)
-			}
-		};
-		if ( (_this.componentId != COMPONENT.SERVICE) || ( !DataService.getALaCarte() ) ) {
-			// include cloud region for everything but service create alacarte
-			var lcpRegion = getValueFromList(FIELD.ID.LCP_REGION, parameterList);
-			if (lcpRegion === FIELD.KEY.LCP_REGION_TEXT) {
-				lcpRegion = getValueFromList(FIELD.ID.LCP_REGION_TEXT,
-						parameterList);
-			}
-			requestDetails.cloudConfiguration = {
-					lcpCloudRegionId : lcpRegion,
-					tenantId : getValueFromList(FIELD.ID.TENANT, parameterList)
-			};	
-		}
-		switch (_this.componentId) {
-		case COMPONENT.SERVICE:
-			requestDetails.subscriberInfo = {
-				globalSubscriberId : DataService.getGlobalCustomerId(),
-				subscriberName : DataService.getSubscriberName()
-			};
-			var isInTop = DataService.getHideServiceFields() || false;
-			if(isInTop){
-				requestDetails.requestParameters.subscriptionServiceType = DataService.getModelInfo(_this.componentId)["serviceTypeName"];
-			}else{
-			requestDetails.requestParameters.subscriptionServiceType = getValueFromList(
-					FIELD.ID.SERVICE_TYPE, parameterList);
-			}
-			requestDetails.requestParameters.aLaCarte = DataService.getALaCarte();
-			if ( !DataService.getALaCarte() ) {
-				requestDetails.requestInfo.productFamilyId = getValueFromList(
-					FIELD.ID.PRODUCT_FAMILY, parameterList);
-			}
-			var svcModelInfo = {
-					modelType : _this.componentId,
-					modelInvariantId : modelInfo.modelInvariantId,
-					modelVersionId : modelInfo.modelNameVersionId,
-					modelName : modelInfo.modelName,
-					modelVersion : modelInfo.modelVersion
-				};
-				requestDetails.modelInfo = svcModelInfo;
-			break;
-		case COMPONENT.VNF:
-			
-			requestDetails.requestInfo.productFamilyId = getValueFromList(
-					FIELD.ID.PRODUCT_FAMILY, parameterList);
-			break;
-		case COMPONENT.NETWORK:
-			requestDetails.requestInfo.productFamilyId = getValueFromList(
-					FIELD.ID.PRODUCT_FAMILY, parameterList);
-			
-			break;
-		case COMPONENT.VF_MODULE:
-		requestDetails.requestParameters.usePreload = getValueFromList(
-					FIELD.ID.SDN_C_PRELOAD, parameterList);
-			if(_this.componentId == COMPONENT.VF_MODULE &&(requestDetails.requestParameters.usePreload== null || requestDetails.requestParameters.usePreload === '')){
-				requestDetails.requestParameters.usePreload = false;
-			}
-			break;
-		case COMPONENT.VOLUME_GROUP:
-			break;
-		}
-
-		var relatedInstanceList = getRelatedInstanceList(parameterList);
-
-		if (relatedInstanceList !== undefined) {
-			requestDetails.relatedInstanceList = relatedInstanceList;
-		}
-
-		return requestDetails;
-	};
-
-	var getRelatedInstanceList = function(parameterList) {
-		var relatedInstanceList = new Array();
-		switch (_this.componentId) {
-		case COMPONENT.SERVICE:
-			return undefined;
-		case COMPONENT.NETWORK:
-		case COMPONENT.VNF:
-			addRelatedInstance(relatedInstanceList, COMPONENT.SERVICE,
-					DataService.getServiceInstanceId());
-			break;
-		case COMPONENT.VF_MODULE:
-			addRelatedInstance(relatedInstanceList, COMPONENT.SERVICE,
-					DataService.getServiceInstanceId());
-			addRelatedInstance(relatedInstanceList, COMPONENT.VNF, DataService
-					.getVnfInstanceId());
-
-			var availableVolumeGroup = getValueFromList(
-					FIELD.ID.AVAILABLE_VOLUME_GROUP, parameterList);
-			
-			if (UtilityService.hasContents(availableVolumeGroup) && availableVolumeGroup !== "None") {
-				var availableVolumeGroups = DataService.getAvailableVolumeGroupList();
-				
-				for (var i = 0; i < availableVolumeGroups.length; i++) {
-					if (availableVolumeGroups[i].instance.name == availableVolumeGroup) {
-						DataService.setModelInfo(COMPONENT.VOLUME_GROUP, DataService.getModelInfo(COMPONENT.VF_MODULE));
-						DataService.setVolumeGroupInstanceId(availableVolumeGroups[i].instance.object["volume-group-id"]);
-						break;
-					}
-				}
-				
-				addRelatedInstance(relatedInstanceList, COMPONENT.VOLUME_GROUP,
-						DataService.getVolumeGroupInstanceId());
-			}
-			break;
-		case COMPONENT.VOLUME_GROUP:
-			addRelatedInstance(relatedInstanceList, COMPONENT.SERVICE,
-					DataService.getServiceInstanceId());
-			addRelatedInstance(relatedInstanceList, COMPONENT.VNF, DataService
-					.getVnfInstanceId());
-			break;
-		}
-
-		return relatedInstanceList;
-	};
-
-	var addRelatedInstance = function(relatedInstanceList, componentId,
-			instanceId) {
-		var modelInfo = DataService.getModelInfo(componentId);
-		var relatedInstance;
-		if (modelInfo !== undefined) {
-			if (componentId === COMPONENT.SERVICE) {
-				relatedInstance = {
-					"instanceId" : instanceId,
-					"modelInfo" : {
-						"modelType" : componentId,
-						"modelName" : modelInfo.modelName,
-						"modelInvariantId" : modelInfo.modelInvariantId,
-						"modelVersion" : modelInfo.modelVersion,
-						"modelVersionId" : modelInfo.modelNameVersionId,
-						
-					}
-				};
-			}
-			else {
-				relatedInstance = {
-						"instanceId" : instanceId,
-						"modelInfo" : {
-							"modelType" : componentId,
-							"modelName" : modelInfo.modelName,
-							"modelInvariantId" : modelInfo.modelInvariantId,
-							"modelVersion" : modelInfo.modelVersion,
-							"modelVersionId" : modelInfo.modelNameVersionId,
-							"modelCustomizationId": modelInfo.customizationUuid,
-							"modelCustomizationName": modelInfo.modelCustomizationName
-						}
-				}
-			}
-			relatedInstanceList.push({
-				relatedInstance : relatedInstance
-			});
-		}
-	};
-
-	/*
-	 * var getArbitraryParameters = function(parameterList) { var
-	 * arbitraryParameters = new Object(); for (var i = 0; i <
-	 * parameterList.length; i++) { var parameter = parameterList[i]; switch
-	 * (parameter.id) { case FIELD.ID.INSTANCE_NAME: case
-	 * FIELD.ID.PRODUCT_FAMILY: case FIELD.ID.LCP_REGION: case
-	 * FIELD.ID.LCP_REGION_TEXT: case FIELD.ID.SERVICE_TYPE: case
-	 * FIELD.ID.TENANT: case FIELD.ID.SUPPRESS_ROLLBACK: break; default:
-	 * arbitraryParameters[parameter.id] = parameter.value; } } return
-	 * arbitraryParameters; }
-	 */
-	var getArbitraryParameters = function(parameterList) {
-		var arbitraryParameters = new Object();
-		var arbitraryArray = new Array();
-		for (var i = 0; i < parameterList.length; i++) {
-			var parameter = parameterList[i];
-			switch (parameter.id) {
-			case FIELD.ID.AVAILABLE_VOLUME_GROUP:
-				break;
-			case FIELD.ID.INSTANCE_NAME:
-				break;
-			case FIELD.ID.PRODUCT_FAMILY:
-				break;
-			case FIELD.ID.LCP_REGION:
-				break;
-			case FIELD.ID.LCP_REGION_TEXT:
-				break;
-			case FIELD.ID.SERVICE_TYPE:
-				break;
-			case FIELD.ID.TENANT:
-				break;
-			case FIELD.ID.SUPPRESS_ROLLBACK:
-				break;
-			case FIELD.ID.SUBSCRIBER_NAME:
-				break;
-			case FIELD.ID.SDN_C_PRELOAD:
-				break;
-			case FIELD.ID.UPLOAD_SUPPLEMENTORY_DATA_FILE:
-				break;
-			case FIELD.ID.SUPPLEMENTORY_DATA_FILE:
-				arbitraryParameters =  FIELD.PARAMETER.SUPPLEMENTORY_DATA_FILE['value'];
-				arbitraryArray=arbitraryParameters;
-				FIELD.PARAMETER.SUPPLEMENTORY_DATA_FILE['value']=[];
-				break;
-
-			default:
-				if (parameter.value != '') {
-					arbitraryParameters = {
-						name: parameter.id,
-						value: parameter.value
-					}
-					arbitraryArray.push(arbitraryParameters);
-				}
-			}
-		}
-		return (arbitraryArray);
+	var setInventoryInfo = function(){
+        var inventoryItem = DataService.getInventoryItem();
+        var inventoryInfo = ComponentService.getInventoryInfo(
+            _this.componentId, inventoryItem);
 	}
 
-	var getModel = function() {
-		AsdcService.getModel(DataService.getModelId(), function(response) {
-			DataService.setModelInfo(_this.componentId, {
-				modelInvariantId : response.data.invariantUUID,
-				modelNameVersionId : response.data.uuid,
-				modelName : response.data.name,
-				modelVersion : response.data.version,
-				inputs : response.data.inputs
-			});
-			UtilityService.startNextAsyncOperation();
-		});
-	};
+    /*
+     * The "*Mso*" functions return URL and request details that can be passed
+     * to the MSO controller. The request details defines the info passed as
+     * part of the POST body.
+     */
 
-	var getSubscriptionServiceTypeList = function() {
-		AaiService.getSubscriptionServiceTypeList(DataService
-				.getGlobalCustomerId(), function(response) {
-			DataService.setSubscriptionServiceTypeList(response);
-			UtilityService.startNextAsyncOperation();
-		});
-	};
+    var getMsoUrl = function() {
+        switch (_this.componentId) {
+            case COMPONENT.NETWORK:
+                return "mso_create_nw_instance/"
+                    + DataService.getServiceInstanceId();
+            case COMPONENT.SERVICE:
+                return "mso_create_svc_instance";
+            case COMPONENT.VNF:
+                return "mso_create_vnf_instance/"
+                    + DataService.getServiceInstanceId();
+            case COMPONENT.VF_MODULE:
+                return "mso_create_vfmodule_instance/"
+                    + DataService.getServiceInstanceId() + "/vnfs/"
+                    + DataService.getVnfInstanceId();
+            case COMPONENT.VOLUME_GROUP:
+                return "mso_create_volumegroup_instance/"
+                    + DataService.getServiceInstanceId() + "/vnfs/"
+                    + DataService.getVnfInstanceId();
+        }
+    };
 
-	var getLoggedInUserID = function() {
-		AaiService.getLoggedInUserID(function(response) {
-			DataService.setLoggedInUserId(response.data);
-			UtilityService.startNextAsyncOperation();
-		});
-	};
-	
-	var getSubscribers = function() {
-		AaiService.getSubscribers(function(response) {
-			DataService.setSubscribers(response);
-			UtilityService.startNextAsyncOperation();
-		});
-	};
-	var getServices = function() {
-		AaiService.getServices(function(response) {
-			var serviceIdList = [];
-			angular.forEach(response.data, function(value, key) {
-				angular.forEach(value, function(subVal, key) {
-					var newVal = {
-						"id" : subVal[FIELD.ID.SERVICE_ID],
-						"description" : subVal[FIELD.ID.SERVICE_DESCRIPTION],
-						"isPermitted" : subVal[FIELD.ID.IS_PERMITTED],
-					};
-					serviceIdList.push(newVal);
-					DataService.setServiceIdList(serviceIdList);
-				});
-			});
+    var getMsoRequestDetails = function(parameterList) {
+        console.log("getMsoRequestDetails invoked, parameterList="); console.log(JSON.stringify(parameterList,null,4));
+        //console.log("getMsoRequestDetails invoked, DataService.getArbitraryParameters()=");
+        //console.log(JSON.stringify(DataService.getArbitraryParameters(),null,4));
 
-			UtilityService.startNextAsyncOperation();
-		});
-	};
-	var getAicZones = function() {
-		AaiService.getAicZones(function(response) {
-			var serviceIdList = [];
-			angular.forEach(response.data, function(value, key) {
-				angular.forEach(value, function(subVal, key) {
-					var newVal = {
-						"id" : subVal[FIELD.ID.ZONE_ID],
-						"name" : subVal[FIELD.ID.ZONE_NAME],
-					};
-					serviceIdList.push(newVal);
-					DataService.setAicZones(serviceIdList);
-				});
-			});
+        var modelInfo = DataService.getModelInfo(_this.componentId);
+        var requestorloggedInId = DataService.getLoggedInUserId();
+        var owningEntityId = getValueFromList(FIELD.ID.OWNING_ENTITY, parameterList);
+        if (requestorloggedInId ==  null)
+            requestorloggedInId = "";
+        var isSupRollback = false;
+        if (getValueFromList(FIELD.ID.SUPPRESS_ROLLBACK,parameterList) === "true") {
+            isSupRollback = true;
+        }
+        var requestDetails = {
+            requestInfo : {
+                instanceName : getValueFromList(FIELD.ID.INSTANCE_NAME,
+                    parameterList) || DataService.getVfModuleInstanceName(),
+                source : FIELD.ID.VID,
+                suppressRollback : isSupRollback,
+                requestorId: requestorloggedInId
+            },
+            modelInfo : {
+                modelType : _this.componentId,
+                modelInvariantId : modelInfo.modelInvariantId,
+                modelVersionId : modelInfo.modelNameVersionId,
+                modelName : modelInfo.modelName,
+                modelVersion : modelInfo.modelVersion,
+                modelCustomizationId: modelInfo.customizationUuid,
+                modelCustomizationName : modelInfo.modelCustomizationName
+            },
+            requestParameters : {
+                userParams : getArbitraryParameters(parameterList)
+            }
+        };
+        if ( (_this.componentId != COMPONENT.SERVICE) || ( !DataService.getALaCarte() ) ) {
+            // include cloud region for everything but service create alacarte
+            var lcpRegion = getValueFromList(FIELD.ID.LCP_REGION, parameterList);
+            if (lcpRegion === FIELD.KEY.LCP_REGION_TEXT) {
+                lcpRegion = getValueFromList(FIELD.ID.LCP_REGION_TEXT,
+                    parameterList);
+            }
+            requestDetails.cloudConfiguration = {
+                lcpCloudRegionId : lcpRegion,
+                tenantId : getValueFromList(FIELD.ID.TENANT, parameterList)
+            };
+        }
+        switch (_this.componentId) {
+            case COMPONENT.SERVICE:
+                requestDetails.subscriberInfo = {
+                    globalSubscriberId : DataService.getGlobalCustomerId(),
+                    subscriberName : DataService.getSubscriberName()
+                };
+                var isInTop = DataService.getHideServiceFields() || false;
+                if(isInTop){
+                    requestDetails.requestParameters.subscriptionServiceType = DataService.getModelInfo(_this.componentId)["serviceTypeName"];
+                }else{
+                    requestDetails.requestParameters.subscriptionServiceType = getValueFromList(
+                        FIELD.ID.SERVICE_TYPE, parameterList);
+                }
+                requestDetails.requestParameters.aLaCarte = DataService.getALaCarte();
+                if ( !DataService.getALaCarte() ) {
+                    requestDetails.requestInfo.productFamilyId = getValueFromList(
+                        FIELD.ID.PRODUCT_FAMILY, parameterList);
+                }
+                var svcModelInfo = {
+                    modelType : _this.componentId,
+                    modelInvariantId : modelInfo.modelInvariantId,
+                    modelVersionId : modelInfo.modelNameVersionId,
+                    modelName : modelInfo.modelName,
+                    modelVersion : modelInfo.modelVersion
+                };
+                requestDetails.modelInfo = svcModelInfo;
 
-			UtilityService.startNextAsyncOperation();
-		});
+                var selectedProject = getValueFromList(FIELD.ID.PROJECT, parameterList);
 
-	};
+                if (selectedProject) {
+                    requestDetails.project = {
+                        projectName: getValueFromList(FIELD.ID.PROJECT, parameterList)
+                    };
+                }
 
+                requestDetails.owningEntity = {
+                    owningEntityId: owningEntityId,
+                    owningEntityName: getOwningEntityNameById(owningEntityId)
+                };
 
+                break;
+            case COMPONENT.VNF:
 
-	var getLcpCloudRegionTenantList = function() {
-		AaiService.getLcpCloudRegionTenantList(DataService
-				.getGlobalCustomerId(), DataService.getServiceType(), function(
-				response) {
-			DataService.setCloudRegionTenantList(response);
-			UtilityService.startNextAsyncOperation();
-		});
-	};
+                requestDetails.requestInfo.productFamilyId = getValueFromList(
+                    FIELD.ID.PRODUCT_FAMILY, parameterList);
 
-	var internalGetParametersHandler = function() {
-		if (angular.isFunction(_this.getParametersHandler)) {
-			_this.getParametersHandler({
-				summaryList : getSummaryList(),
-				userProvidedList : getUserProvidedList()
-			});
-		}
-	};
+                var lineOfBusiness = getValueFromList(FIELD.ID.LINE_OF_BUSINESS, parameterList);
 
-	var getSubscribersParameter = function() {
-		var subscribers = DataService.getSubscribers();
-		var parameter = FIELD.PARAMETER.SUBSCRIBER_NAME;
-		if ( UtilityService.hasContents(subscribers)) {
-			parameter.optionList = [];
-	
-			for (var i = 0; i < subscribers.length; i++) {
-				parameter.optionList.push({
-					id : subscribers[i][FIELD.ID.GLOBAL_CUSTOMER_ID],
-					name : subscribers[i][FIELD.ID.SUBNAME],
-					isPermitted : subscribers[i][FIELD.ID.IS_PERMITTED]
-				})
-			}
-		}
-		return parameter;
-	};
+                if(lineOfBusiness) {
+                    var lineOfBusinessNamesString = _.map(lineOfBusiness, "name").join(", ");
 
-	var getServiceId = function() {
-		var serviceIdList = DataService.getServiceIdList();
-		//var serviceTypeList = DataService.getSubscriptionServiceTypeList();
-		var parameter = FIELD.PARAMETER.PRODUCT_FAMILY;
-		parameter.optionList = new Array();
-		if ( UtilityService.hasContents(serviceIdList) ) {
-			// load them all
-			for (var i = 0; i < serviceIdList.length; i++) {
-				parameter.optionList.push({
-					id : serviceIdList[i].id,
-					name : serviceIdList[i].description,
-					isPermitted : serviceIdList[i].isPermitted
-				});
-			}
-		}
+                    requestDetails.lineOfBusiness = {
+                        lineOfBusinessName: lineOfBusinessNamesString
+                    }
+                }
 
-		return parameter;
-	};
+                requestDetails.platform = {
+                    platformName: getValueFromList(FIELD.ID.PLATFORM, parameterList)
+                };
 
-	var getAICZones = function() {
-		var aicList = DataService.getAicZones();
-		var parameter = FIELD.PARAMETER.AIC_ZONES;
-		parameter.optionList = new Array();
-		if ( UtilityService.hasContents(aicList) ) {
-			// load them all
-			for (var i = 0; i < aicList.length; i++) {
-				parameter.optionList.push({
-					id : aicList[i].id,
-					name : aicList[i].name,
-					isPermitted : true
+                break;
+            case COMPONENT.NETWORK:
+                requestDetails.requestInfo.productFamilyId = getValueFromList(
+                    FIELD.ID.PRODUCT_FAMILY, parameterList);
+                var lineOfBusiness = getValueFromList(FIELD.ID.LINE_OF_BUSINESS, parameterList);
 
-				});
-			}
-		}
+                if(lineOfBusiness) {
+                    var lineOfBusinessNamesString = _.map(lineOfBusiness, "name").join(", ");
 
-		return parameter;
-	};
+                    requestDetails.lineOfBusiness = {
+                        lineOfBusinessName: lineOfBusinessNamesString
+                    }
+                }
 
+                requestDetails.platform = {
+                    platformName: getValueFromList(FIELD.ID.PLATFORM, parameterList)
+                };
+                break;
+            case COMPONENT.VF_MODULE:
+                requestDetails.requestParameters.usePreload = getValueFromList(
+                    FIELD.ID.SDN_C_PRELOAD, parameterList);
+                if(_this.componentId == COMPONENT.VF_MODULE &&(requestDetails.requestParameters.usePreload== null || requestDetails.requestParameters.usePreload === '')){
+                    requestDetails.requestParameters.usePreload = false;
+                }
+                break;
+            case COMPONENT.VOLUME_GROUP:
+                break;
+        }
 
-	var getLcpRegion = function() {
-		var cloudRegionTenantList = DataService.getCloudRegionTenantList();
-		console.log ( "cloudRegionTenantList=");
-		console.log ( JSON.stringify (cloudRegionTenantList, null, 4 ));
+        var relatedInstanceList = getRelatedInstanceList(parameterList);
 
-		var parameter = FIELD.PARAMETER.LCP_REGION;
-		if ( UtilityService.hasContents (cloudRegionTenantList) ) {
-			parameter.optionList = new Array();
-			for (var i = 0; i < cloudRegionTenantList.length; i++) {
-				for (var j = 0; j < parameter.optionList.length; j++) {
-					if (parameter.optionList[j].id === cloudRegionTenantList[i].cloudRegionId) {
+        if (relatedInstanceList !== undefined) {
+            requestDetails.relatedInstanceList = relatedInstanceList;
+        }
+
+        return requestDetails;
+    };
+
+    var getRelatedInstanceList = function(parameterList) {
+        var relatedInstanceList = new Array();
+        switch (_this.componentId) {
+            case COMPONENT.SERVICE:
+                return undefined;
+            case COMPONENT.NETWORK:
+            case COMPONENT.VNF:
+                addRelatedInstance(relatedInstanceList, COMPONENT.SERVICE,
+                    DataService.getServiceInstanceId());
+                break;
+            case COMPONENT.VF_MODULE:
+                addRelatedInstance(relatedInstanceList, COMPONENT.SERVICE,
+                    DataService.getServiceInstanceId());
+                addRelatedInstance(relatedInstanceList, COMPONENT.VNF, DataService
+                    .getVnfInstanceId());
+
+                var availableVolumeGroup = getValueFromList(
+                    FIELD.ID.AVAILABLE_VOLUME_GROUP, parameterList);
+
+                if (UtilityService.hasContents(availableVolumeGroup) && availableVolumeGroup !== "None") {
+                    var availableVolumeGroups = DataService.getAvailableVolumeGroupList();
+
+                    for (var i = 0; i < availableVolumeGroups.length; i++) {
+                        if (availableVolumeGroups[i].instance.name == availableVolumeGroup) {
+                            DataService.setModelInfo(COMPONENT.VOLUME_GROUP, DataService.getModelInfo(COMPONENT.VF_MODULE));
+                            DataService.setVolumeGroupInstanceId(availableVolumeGroups[i].instance.object["volume-group-id"]);
+                            break;
+                        }
+                    }
+
+                    addRelatedInstance(relatedInstanceList, COMPONENT.VOLUME_GROUP,
+                        DataService.getVolumeGroupInstanceId());
+                }
+                break;
+            case COMPONENT.VOLUME_GROUP:
+                addRelatedInstance(relatedInstanceList, COMPONENT.SERVICE,
+                    DataService.getServiceInstanceId());
+                addRelatedInstance(relatedInstanceList, COMPONENT.VNF, DataService
+                    .getVnfInstanceId());
+                break;
+        }
+
+        return relatedInstanceList;
+    };
+
+    var addRelatedInstance = function(relatedInstanceList, componentId,
+                                      instanceId) {
+        var modelInfo = DataService.getModelInfo(componentId);
+        var relatedInstance;
+        if (modelInfo !== undefined) {
+            if (componentId === COMPONENT.SERVICE) {
+                relatedInstance = {
+                    "instanceId" : instanceId,
+                    "modelInfo" : {
+                        "modelType" : componentId,
+                        "modelName" : modelInfo.modelName,
+                        "modelInvariantId" : modelInfo.modelInvariantId,
+                        "modelVersion" : modelInfo.modelVersion,
+                        "modelVersionId" : modelInfo.modelNameVersionId,
+
+                    }
+                };
+            }
+            else {
+                relatedInstance = {
+                    "instanceId" : instanceId,
+                    "modelInfo" : {
+                        "modelType" : componentId,
+                        "modelName" : modelInfo.modelName,
+                        "modelInvariantId" : modelInfo.modelInvariantId,
+                        "modelVersion" : modelInfo.modelVersion,
+                        "modelVersionId" : modelInfo.modelNameVersionId,
+                        "modelCustomizationId": modelInfo.customizationUuid,
+                        "modelCustomizationName": modelInfo.modelCustomizationName
+                    }
+                }
+            }
+            relatedInstanceList.push({
+                relatedInstance : relatedInstance
+            });
+        }
+    };
+
+    /*
+     * var getArbitraryParameters = function(parameterList) { var
+     * arbitraryParameters = new Object(); for (var i = 0; i <
+     * parameterList.length; i++) { var parameter = parameterList[i]; switch
+     * (parameter.id) { case FIELD.ID.INSTANCE_NAME: case
+     * FIELD.ID.PRODUCT_FAMILY: case FIELD.ID.LCP_REGION: case
+     * FIELD.ID.LCP_REGION_TEXT: case FIELD.ID.SERVICE_TYPE: case
+     * FIELD.ID.TENANT: case FIELD.ID.SUPPRESS_ROLLBACK: break; default:
+     * arbitraryParameters[parameter.id] = parameter.value; } } return
+     * arbitraryParameters; }
+     */
+    var getArbitraryParameters = function(parameterList) {
+        var arbitraryParameters = new Object();
+        var arbitraryArray = new Array();
+        for (var i = 0; i < parameterList.length; i++) {
+            var parameter = parameterList[i];
+            switch (parameter.id) {
+                case FIELD.ID.AVAILABLE_VOLUME_GROUP:
+                case FIELD.ID.INSTANCE_NAME:
+                case FIELD.ID.PRODUCT_FAMILY:
+                case FIELD.ID.LCP_REGION:
+                case FIELD.ID.LCP_REGION_TEXT:
+                case FIELD.ID.SERVICE_TYPE:
+                case FIELD.ID.TENANT:
+                case FIELD.ID.SUPPRESS_ROLLBACK:
+                case FIELD.ID.SUBSCRIBER_NAME:
+                case FIELD.ID.SDN_C_PRELOAD:
+                case FIELD.ID.UPLOAD_SUPPLEMENTORY_DATA_FILE:
+                case FIELD.ID.OWNING_ENTITY:
+                case FIELD.ID.PLATFORM:
+                case FIELD.ID.LINE_OF_BUSINESS:
+                case FIELD.ID.PROJECT:
+                    break;
+                case FIELD.ID.SUPPLEMENTORY_DATA_FILE:
+                    arbitraryParameters =  FIELD.PARAMETER.SUPPLEMENTORY_DATA_FILE['value'];
+                    arbitraryArray=arbitraryParameters;
+                    FIELD.PARAMETER.SUPPLEMENTORY_DATA_FILE['value']=[];
+                    break;
+
+                default:
+                    if (parameter.value != '') {
+                        arbitraryParameters = {
+                            name: parameter.id,
+                            value: parameter.value
+                        }
+                        arbitraryArray.push(arbitraryParameters);
+                    }
+            }
+        }
+        return (arbitraryArray);
+    }
+
+    var getModel = function() {
+        AsdcService.getModel(DataService.getModelId(), function(response) {
+            DataService.setModelInfo(_this.componentId, {
+                modelInvariantId : response.data.invariantUUID,
+                modelNameVersionId : response.data.uuid,
+                modelName : response.data.name,
+                modelVersion : response.data.version,
+                inputs : response.data.inputs
+            });
+            UtilityService.startNextAsyncOperation();
+        });
+    };
+
+    var getSubscriptionServiceTypeList = function() {
+        AaiService.getSubscriptionServiceTypeList(DataService
+            .getGlobalCustomerId(), function(response) {
+            DataService.setSubscriptionServiceTypeList(response);
+            UtilityService.startNextAsyncOperation();
+        });
+    };
+
+    var getLoggedInUserID = function() {
+        AaiService.getLoggedInUserID(function(response) {
+            DataService.setLoggedInUserId(response.data);
+            UtilityService.startNextAsyncOperation();
+        });
+    };
+
+    var getSubscribers = function() {
+        AaiService.getSubscribers(function(response) {
+            DataService.setSubscribers(response);
+            UtilityService.startNextAsyncOperation();
+        });
+    };
+    var getServices = function() {
+        AaiService.getServices(function(response) {
+            var serviceIdList = [];
+            angular.forEach(response.data, function(value, key) {
+                angular.forEach(value, function(subVal, key) {
+                    var newVal = {
+                        "id" : subVal[FIELD.ID.SERVICE_ID],
+                        "description" : subVal[FIELD.ID.SERVICE_DESCRIPTION],
+                        "isPermitted" : subVal[FIELD.ID.IS_PERMITTED],
+                    };
+                    serviceIdList.push(newVal);
+                    DataService.setServiceIdList(serviceIdList);
+                });
+            });
+
+            UtilityService.startNextAsyncOperation();
+        });
+    };
+    var getAicZones = function() {
+        AaiService.getAicZones(function(response) {
+            var serviceIdList = [];
+            angular.forEach(response.data, function(value, key) {
+                angular.forEach(value, function(subVal, key) {
+                    var newVal = {
+                        "id" : subVal[FIELD.ID.ZONE_ID],
+                        "name" : subVal[FIELD.ID.ZONE_NAME],
+                    };
+                    serviceIdList.push(newVal);
+                    DataService.setAicZones(serviceIdList);
+                });
+            });
+
+            UtilityService.startNextAsyncOperation();
+        });
+    };
+
+    var getOwningEntityProperties = function() {
+        OwningEntityService.getOwningEntityProperties(function(owningEntityProperties) {
+            DataService.setOwningEntityProperties(owningEntityProperties);
+            UtilityService.startNextAsyncOperation();
+        });
+
+    };
+
+    var getLcpCloudRegionTenantList = function() {
+        AaiService.getLcpCloudRegionTenantList(DataService
+            .getGlobalCustomerId(), DataService.getServiceType(), function(
+            response) {
+            DataService.setCloudRegionTenantList(response);
+            UtilityService.startNextAsyncOperation();
+        });
+    };
+
+    var internalGetParametersHandler = function() {
+        if (angular.isFunction(_this.getParametersHandler)) {
+            _this.getParametersHandler({
+                summaryList : getSummaryList(),
+                userProvidedList : getUserProvidedList()
+            });
+        }
+    };
+
+    var getSubscribersParameter = function() {
+        var subscribers = DataService.getSubscribers();
+        var parameter = FIELD.PARAMETER.SUBSCRIBER_NAME;
+        if ( UtilityService.hasContents(subscribers)) {
+            parameter.optionList = [];
+
+            for (var i = 0; i < subscribers.length; i++) {
+                parameter.optionList.push({
+                    id : subscribers[i][FIELD.ID.GLOBAL_CUSTOMER_ID],
+                    name : subscribers[i][FIELD.ID.SUBNAME],
+                    isPermitted : subscribers[i][FIELD.ID.IS_PERMITTED]
+                })
+            }
+        }
+        return parameter;
+    };
+
+    var getServiceId = function() {
+        var serviceIdList = DataService.getServiceIdList();
+        //var serviceTypeList = DataService.getSubscriptionServiceTypeList();
+        var parameter = FIELD.PARAMETER.PRODUCT_FAMILY;
+        parameter.optionList = new Array();
+        if ( UtilityService.hasContents(serviceIdList) ) {
+            // load them all
+            for (var i = 0; i < serviceIdList.length; i++) {
+                parameter.optionList.push({
+                    id : serviceIdList[i].id,
+                    name : serviceIdList[i].description,
+                    isPermitted : serviceIdList[i].isPermitted
+                });
+            }
+        }
+
+        return parameter;
+    };
+
+    var getAicZonesParameter = function() {
+        var aicList = DataService.getAicZones();
+        var parameter = FIELD.PARAMETER.AIC_ZONES;
+        parameter.optionList = new Array();
+        if ( UtilityService.hasContents(aicList) ) {
+            // load them all
+            for (var i = 0; i < aicList.length; i++) {
+                parameter.optionList.push({
+                    id : aicList[i].id,
+                    name : aicList[i].name,
+                    isPermitted : true
+
+                });
+            }
+        }
+
+        return parameter;
+    };
+
+    var getProjectParameter = function() {
+        return getOwningEntityParameterWithOptions(FIELD.PARAMETER.PROJECT);
+    };
+
+    var getOwningEntityParameter = function() {
+        return getOwningEntityParameterWithOptions(FIELD.PARAMETER.OWNING_ENTITY);
+    };
+
+    var getLineOfBusinessParameter = function() {
+        return getOwningEntityParameterWithOptions(FIELD.PARAMETER.LINE_OF_BUSINESS);
+    };
+
+    var getPlatformParameter = function() {
+        return getOwningEntityParameterWithOptions(FIELD.PARAMETER.PLATFORM);
+    };
+
+    var getOwningEntityNameById = function (id) {
+        var properties = DataService.getOwningEntityProperties();
+        var parameter = _.find(properties[FIELD.ID.OWNING_ENTITY], {"id": id});
+        return parameter && parameter.name;
+    };
+
+    var getOwningEntityParameterWithOptions = function(parameter) {
+        var properties = DataService.getOwningEntityProperties();
+        if (properties && properties[parameter.id]) {
+            parameter.optionList = _.map(properties[parameter.id], function(parameter) {
+                return {
+                    "id" : parameter.id,
+                    "name" : parameter.name,
+                    "isPermitted": true
+                };
+            });
+        }
+
+        return parameter;
+    };
+
+    var getLcpRegionParameter = function() {
+        var cloudRegionTenantList = DataService.getCloudRegionTenantList();
+        console.log ( "cloudRegionTenantList=");
+        console.log ( JSON.stringify (cloudRegionTenantList, null, 4 ));
+
+        var parameter = FIELD.PARAMETER.LCP_REGION;
+        if ( UtilityService.hasContents (cloudRegionTenantList) ) {
+            parameter.optionList = new Array();
+            for (var i = 0; i < cloudRegionTenantList.length; i++) {
+                for (var j = 0; j < parameter.optionList.length; j++) {
+                    if (parameter.optionList[j].id === cloudRegionTenantList[i].cloudRegionId) {
                         parameter.optionList[j].isPermitted =
-							parameter.optionList[j].isPermitted || cloudRegionTenantList[i].isPermitted;
+                            parameter.optionList[j].isPermitted || cloudRegionTenantList[i].isPermitted;
                         break;
                     }
-				}
-				if (j < parameter.optionList.length) {
-					continue;
-				}
-				parameter.optionList.push({
-					id : cloudRegionTenantList[i].cloudRegionId,
-					isPermitted : cloudRegionTenantList[i].isPermitted
-				});
-			}
-		}
-		return parameter;
-	};
+                }
+                if (j < parameter.optionList.length) {
+                    continue;
+                }
+                parameter.optionList.push({
+                    id : cloudRegionTenantList[i].cloudRegionId,
+                    isPermitted : cloudRegionTenantList[i].isPermitted
+                });
+            }
+        }
+        return parameter;
+    };
 
-	var getTenantList = function(cloudRegionId) {
-		var cloudRegionTenantList = DataService.getCloudRegionTenantList();
-		var parameter = "";
-		if ( UtilityService.hasContents (cloudRegionTenantList) ) {
-			parameter = FIELD.PARAMETER.TENANT_ENABLED;
-			parameter.optionList = new Array();
-			for (var i = 0; i < cloudRegionTenantList.length; i++) {
-				if (cloudRegionTenantList[i].cloudRegionId === cloudRegionId) {
-					parameter.optionList.push({
-						id : cloudRegionTenantList[i].tenantId,
-						name : cloudRegionTenantList[i].tenantName,
+    var getTenantList = function(cloudRegionId) {
+        var cloudRegionTenantList = DataService.getCloudRegionTenantList();
+        var parameter = "";
+        if ( UtilityService.hasContents (cloudRegionTenantList) ) {
+            parameter = FIELD.PARAMETER.TENANT_ENABLED;
+            parameter.optionList = new Array();
+            for (var i = 0; i < cloudRegionTenantList.length; i++) {
+                if (cloudRegionTenantList[i].cloudRegionId === cloudRegionId) {
+                    parameter.optionList.push({
+                        id : cloudRegionTenantList[i].tenantId,
+                        name : cloudRegionTenantList[i].tenantName,
                         isPermitted : cloudRegionTenantList[i].isPermitted
 
                     });
-				}
-			}
-		}
-		return parameter;
+                }
+            }
+        }
+        return parameter;
 
-	};
+    };
 
-	var addOptionList = function(parameter, optionSimpleArray) {
-		var optionList = new Array();
-		if (!angular.isArray(optionSimpleArray)) {
-			return optionList;
-		}
-		for (var i = 0; i < optionSimpleArray.length; i++) {
-			optionList.push({
-				name : optionSimpleArray[i],
+    var addOptionList = function(parameter, optionSimpleArray) {
+        var optionList = new Array();
+        if (!angular.isArray(optionSimpleArray)) {
+            return optionList;
+        }
+        for (var i = 0; i < optionSimpleArray.length; i++) {
+            optionList.push({
+                name : optionSimpleArray[i],
                 isPermitted :true,
-			});
-		}
-		parameter.optionList = optionList;
-		return parameter;
-	};
+            });
+        }
+        parameter.optionList = optionList;
+        return parameter;
+    };
 
-	var getValueFromList = function(id, parameterList) {
-		for (var i = 0; i < parameterList.length; i++) {
-			if (parameterList[i].id === id) {
-				return parameterList[i].value;
-			}
-		}
-	};
-	var updateUserParameterList = function(updatedId, parameterListControl) {
-		console.log ("updateUserParameterList() updatedId=" + updatedId);
-		if (updatedId === FIELD.ID.PRODUCT_FAMILY && DataService.getHideServiceFields()) {
-			var cloudRegionTenantList = new Array();
-			AaiService.getLcpCloudRegionTenantList(DataService.getGlobalCustomerId(), DataService.getServiceType(), function(cloudRegionTenantList) {
-				DataService.setCloudRegionTenantList(cloudRegionTenantList);
-				parameterListControl.updateList([ getLcpRegion() ]);
-			});
-		}else if (updatedId === FIELD.ID.SDN_C_PRELOAD) {
-			var list = parameterListControl.getList(updatedId);
-			if($('input[parameter-id="'+updatedId+'"]').is(':checked')){
-				FIELD.PARAMETER.SDN_C_PRELOAD_CHECKED.value=true;
-				parameterListControl
-				.updateList([ FIELD.PARAMETER.SDN_C_PRELOAD_CHECKED ]);
-			}else{
-				parameterListControl
-				.updateList([ FIELD.PARAMETER.SDN_C_PRELOAD_UNCHECKED ]);
-			}
-		}else if (updatedId === FIELD.ID.UPLOAD_SUPPLEMENTORY_DATA_FILE) {
-			if($('input[parameter-id="'+updatedId+'"]').is(':checked')){
-				$('input[parameter-id="'+FIELD.ID.SUPPLEMENTORY_DATA_FILE+'"]').closest('tr').show();
-				 FIELD.PARAMETER.UPLOAD_SUPPLEMENTORY_DATA_FILE_CHECKED.value=true;
-				parameterListControl
-				.updateList([ FIELD.PARAMETER.UPLOAD_SUPPLEMENTORY_DATA_FILE_CHECKED ]);
-			}else{
-				$('input[parameter-id="'+FIELD.ID.SUPPLEMENTORY_DATA_FILE+'"]').closest('tr').hide();
-				FIELD.PARAMETER.UPLOAD_SUPPLEMENTORY_DATA_FILE_CHECKED.value=false;
-				parameterListControl
-				.updateList([ FIELD.PARAMETER.UPLOAD_SUPPLEMENTORY_DATA_FILE_UNCHECKED ]);
-			}
-		} else if (updatedId === FIELD.ID.SUPPLEMENTORY_DATA_FILE) {
-			var filePath =  $('input[parameter-id="'+updatedId+'"]').val();
-			var arr =filePath.split('.');
-			var fileExt  = arr[arr.length-1];
-			if(fileExt!='' && fileExt.toLowerCase()!='json'){
-				 $('input[parameter-id="'+updatedId+'"]').val('');
-				alert("Invalid file format. Please select *.json format file.");
-				return false;
-			}
-		} else  if (updatedId === FIELD.ID.LCP_REGION) {
-			var list = parameterListControl.getList(updatedId);
-			if (list[0].selectedIndex >= 0) {
-				parameterListControl
-						.updateList([ getTenantList(list[0].value) ]);
-			} else {
-				parameterListControl
-						.updateList([ FIELD.PARAMETER.TENANT_DISABLED ]);
-			}
-			if (list[0].value === FIELD.KEY.LCP_REGION_TEXT) {
-				parameterListControl
-						.updateList([ FIELD.PARAMETER.LCP_REGION_TEXT_VISIBLE ]);
-			} else {
-				parameterListControl
-						.updateList([ FIELD.PARAMETER.LCP_REGION_TEXT_HIDDEN ]);
-			}
-		} else if (updatedId === FIELD.ID.SUBSCRIBER_NAME) {
-			var list = parameterListControl.getList(updatedId);
-			if (list[0].selectedIndex >= 0) {
-				DataService.setGlobalCustomerId(list[0].value);
+    var getValueFromList = function(id, parameterList) {
+        for (var i = 0; i < parameterList.length; i++) {
+            if (parameterList[i].id === id) {
+                return parameterList[i].value;
+            }
+        }
+    };
+    var updateUserParameterList = function(updatedId, parameterListControl) {
+        console.log ("updateUserParameterList() updatedId=" + updatedId);
+        if (updatedId === FIELD.ID.PRODUCT_FAMILY && DataService.getHideServiceFields()) {
+            var cloudRegionTenantList = new Array();
+            AaiService.getLcpCloudRegionTenantList(DataService.getGlobalCustomerId(), DataService.getServiceType(), function(cloudRegionTenantList) {
+                DataService.setCloudRegionTenantList(cloudRegionTenantList);
+                parameterListControl.updateList([ getLcpRegionParameter() ]);
+            });
+        }else if (updatedId === FIELD.ID.SDN_C_PRELOAD) {
+            var list = parameterListControl.getList(updatedId);
+            if($('input[parameter-id="'+updatedId+'"]').is(':checked')){
+                FIELD.PARAMETER.SDN_C_PRELOAD_CHECKED.value=true;
+                parameterListControl
+                    .updateList([ FIELD.PARAMETER.SDN_C_PRELOAD_CHECKED ]);
+            }else{
+                parameterListControl
+                    .updateList([ FIELD.PARAMETER.SDN_C_PRELOAD_UNCHECKED ]);
+            }
+        }else if (updatedId === FIELD.ID.UPLOAD_SUPPLEMENTORY_DATA_FILE) {
+            if($('input[parameter-id="'+updatedId+'"]').is(':checked')){
+                $('input[parameter-id="'+FIELD.ID.SUPPLEMENTORY_DATA_FILE+'"]').closest('tr').show();
+                FIELD.PARAMETER.UPLOAD_SUPPLEMENTORY_DATA_FILE_CHECKED.value=true;
+                parameterListControl
+                    .updateList([ FIELD.PARAMETER.UPLOAD_SUPPLEMENTORY_DATA_FILE_CHECKED ]);
+            }else{
+                $('input[parameter-id="'+FIELD.ID.SUPPLEMENTORY_DATA_FILE+'"]').closest('tr').hide();
+                FIELD.PARAMETER.UPLOAD_SUPPLEMENTORY_DATA_FILE_CHECKED.value=false;
+                parameterListControl
+                    .updateList([ FIELD.PARAMETER.UPLOAD_SUPPLEMENTORY_DATA_FILE_UNCHECKED ]);
+            }
+        } else if (updatedId === FIELD.ID.SUPPLEMENTORY_DATA_FILE) {
+            var filePath =  $('input[parameter-id="'+updatedId+'"]').val();
+            var arr =filePath.split('.');
+            var fileExt  = arr[arr.length-1];
+            if(fileExt!='' && fileExt.toLowerCase()!='json'){
+                $('input[parameter-id="'+updatedId+'"]').val('');
+                alert("Invalid file format. Please select *.json format file.");
+                return false;
+            }
+        } else  if (updatedId === FIELD.ID.LCP_REGION) {
+            var list = parameterListControl.getList(updatedId);
+            if (list[0].selectedIndex >= 0) {
+                parameterListControl
+                    .updateList([ getTenantList(list[0].value) ]);
+            } else {
+                parameterListControl
+                    .updateList([ FIELD.PARAMETER.TENANT_DISABLED ]);
+            }
+            if (list[0].value === FIELD.KEY.LCP_REGION_TEXT) {
+                parameterListControl
+                    .updateList([ FIELD.PARAMETER.LCP_REGION_TEXT_VISIBLE ]);
+            } else {
+                parameterListControl
+                    .updateList([ FIELD.PARAMETER.LCP_REGION_TEXT_HIDDEN ]);
+            }
+        } else if (updatedId === FIELD.ID.SUBSCRIBER_NAME) {
+            var list = parameterListControl.getList(updatedId);
+            if (list[0].selectedIndex >= 0) {
+                DataService.setGlobalCustomerId(list[0].value);
 
-				AaiService.getSubscriptionServiceTypeList(DataService
-						.getGlobalCustomerId(), function(response) {
-					DataService.setSubscriptionServiceTypeList(response);
-					var serviceTypeParameters = FIELD.PARAMETER.SERVICE_TYPE;
-					serviceTypeParameters.optionList = [];
+                AaiService.getSubscriptionServiceTypeList(DataService
+                    .getGlobalCustomerId(), function(response) {
+                    DataService.setSubscriptionServiceTypeList(response);
+                    var serviceTypeParameters = FIELD.PARAMETER.SERVICE_TYPE;
+                    serviceTypeParameters.optionList = [];
 
-					for (var i = 0; i < response.length; i++) {
-						serviceTypeParameters.optionList.push({
-							"id" : response[i].name,
-							"name" : response[i].name,
+                    for (var i = 0; i < response.length; i++) {
+                        serviceTypeParameters.optionList.push({
+                            "id" : response[i].name,
+                            "name" : response[i].name,
                             "isPermitted" :response[i].isPermitted
 
                         });
-					}
-					console.log ( "updateUserParameterList: service type parameters " ); 
-					console.log ( JSON.stringify (serviceTypeParameters, null, 4));
-					parameterListControl.updateList([ serviceTypeParameters ]);
-				});
+                    }
+                    console.log ( "updateUserParameterList: service type parameters " );
+                    console.log ( JSON.stringify (serviceTypeParameters, null, 4));
+                    parameterListControl.updateList([ serviceTypeParameters ]);
+                });
 
-			} 
-		} else if ( updatedId === FIELD.ID.SERVICE_TYPE ) {
-			var list = parameterListControl.getList(updatedId);
-			if (list[0].selectedIndex >= 0) {
+            }
+        } else if ( updatedId === FIELD.ID.SERVICE_TYPE ) {
+            var list = parameterListControl.getList(updatedId);
+            if (list[0].selectedIndex >= 0) {
 
-				DataService.setServiceType(list[0].value);
-				var cloudRegionTenantList = new Array();
-				AaiService.getLcpCloudRegionTenantList(DataService.getGlobalCustomerId(), DataService.getServiceType(), function(cloudRegionTenantList) {
-					DataService.setCloudRegionTenantList(cloudRegionTenantList);
-					parameterListControl.updateList([ getLcpRegion() ]);
-				}); 
-			} else {
-				parameterListControl
-				.updateList([ FIELD.PARAMETER.SERVICE_TYPE_DISABLED ]);
-			}
-		}
+                DataService.setServiceType(list[0].value);
+                var cloudRegionTenantList = new Array();
+                AaiService.getLcpCloudRegionTenantList(DataService.getGlobalCustomerId(), DataService.getServiceType(), function(cloudRegionTenantList) {
+                    DataService.setCloudRegionTenantList(cloudRegionTenantList);
+                    parameterListControl.updateList([ getLcpRegionParameter() ]);
+                });
+            } else {
+                parameterListControl
+                    .updateList([ FIELD.PARAMETER.SERVICE_TYPE_DISABLED ]);
+            }
+        }
 
-	};
+    };
 
-	return {
-		initializeComponent : function(componentId) {
-			_this.componentId = ComponentService.initialize(componentId);
-		},
-		setHttpErrorHandler : function(httpErrorHandler) {
-			_this.httpErrorHandler = httpErrorHandler;
-		},
-		getComponentDisplayName : ComponentService.getComponentDisplayName,
-		getParameters : function(getParametersHandler) {
-			_this.getParametersHandler = getParametersHandler;
-			UtilityService.setHttpErrorHandler(_this.httpErrorHandler);
-			UtilityService.startAsyncOperations(getAsyncOperationList(),
-					internalGetParametersHandler);
-		},
-		updateUserParameterList : updateUserParameterList,
-		getMsoRequestDetails : getMsoRequestDetails,
-		getMsoUrl : getMsoUrl
-	}
+    return {
+        initializeComponent : function(componentId) {
+            _this.componentId = ComponentService.initialize(componentId);
+        },
+        setHttpErrorHandler : function(httpErrorHandler) {
+            _this.httpErrorHandler = httpErrorHandler;
+        },
+        getComponentDisplayName : ComponentService.getComponentDisplayName,
+        getParameters : function(getParametersHandler) {
+            _this.getParametersHandler = getParametersHandler;
+            UtilityService.setHttpErrorHandler(_this.httpErrorHandler);
+            UtilityService.startAsyncOperations(getAsyncOperationList(),
+                internalGetParametersHandler);
+        },
+        updateUserParameterList : updateUserParameterList,
+        getMsoRequestDetails : getMsoRequestDetails,
+        getMsoUrl : getMsoUrl,
+        setInventoryInfo: setInventoryInfo
+    }
 }
 
 appDS2.factory("CreationService", [ "$log", "AaiService", "AsdcService",
-		"DataService","VIDCONFIGURATION", "ComponentService", "COMPONENT", "FIELD", "PARAMETER",
-		"UtilityService", CreationService ]);
+    "DataService","VIDCONFIGURATION", "ComponentService", "COMPONENT", "FIELD", "PARAMETER",
+    "UtilityService", "OwningEntityService", CreationService ]);
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/services/dataService.js b/vid-app-common/src/main/webapp/app/vid/scripts/services/dataService.js
index 2d7fa6c..716854e 100755
--- a/vid-app-common/src/main/webapp/app/vid/scripts/services/dataService.js
+++ b/vid-app-common/src/main/webapp/app/vid/scripts/services/dataService.js
@@ -100,6 +100,12 @@
 		getAicZones : function(){
 			return _this.aicZones;
 		},
+        setAicZoneForPNF: function(aicZone) {
+            _this.aicZone = aicZone;
+        },
+        getAicZoneForPNF : function(){
+            return _this.aicZone;
+        },
 		getServiceInstanceId : function() {
 			return _this.serviceInstanceId;
 		},
@@ -214,6 +220,12 @@
 		setVnfInstanceId : function(vnfInstanceId) {
 			_this.vnfInstanceId = vnfInstanceId;
 		},
+        getVfModuleInstanceName : function() {
+            return _this.vfModuleInstanceName;
+        },
+        setVfModuleInstanceName : function(vfModuleInstanceName) {
+            _this.vfModuleInstanceName = vfModuleInstanceName;
+        },
 		getVolumeGroupInstanceId : function() {
 			return _this.volumeGroupInstanceId;
 		},
@@ -293,8 +305,81 @@
 		},
 		getHideServiceFields:function(){
 			return _this.hideServiceFields;
-		}
+		},
+		getServiceProxies:function(){
+            return _this.serviceProxies;
+        },
+        setServiceProxies:function(serviceProxies){
+             _this.serviceProxies = serviceProxies;
+        },
+        getSourceServiceProxies:function(){
+            return _this.sourceServiceProxies;
+        },
+        setSourceServiceProxies:function(sourceServiceProxies){
+            _this.sourceServiceProxies = sourceServiceProxies;
+        },
+        getCollectorServiceProxies:function(){
+            return _this.collectorServiceProxies;
+        },
+        setCollectorServiceProxies:function(collectorServiceProxies){
+            _this.collectorServiceProxies = collectorServiceProxies;
+        },
+		getConfigurationByPolicy:function() {
+        	return _this.configurationByPolicy;
+		},
+        setConfigurationByPolicy:function (configurationByPolicy) {
+			_this.configurationByPolicy = configurationByPolicy;
+        },
+        getSuppressRollback:function(){
+            return _this.suppressRollback;
+        },
+        setSuppressRollback:function(suppressRollback){
+            _this.suppressRollback = suppressRollback;
+        },
+        getPortMirroningConfigFields:function(){
+            return _this.portMirroningConfigFields;
+        },
+        setPortMirroningConfigFields:function(portMirroningConfigFields){
+            _this.portMirroningConfigFields = portMirroningConfigFields;
+        },
+        getConfigurationInstanceId : function() {
+            return _this.configurationInstanceId;
+        },
+        setConfigurationInstanceId : function(configurationInstanceId) {
+            _this.configurationInstanceId = configurationInstanceId;
+        },
+		getConfigurationStatus: function () {
+			return _this.configurationStatus;
+        },
+        setConfigurationStatus: function (configurationStatus) {
+			_this.configurationStatus = configurationStatus;
+        },
+        getPortStatus: function () {
+            return _this.portStatus;
+        },
+        setPortStatus: function (portStatus) {
+            _this.portStatus = portStatus;
+        },
+        getPortId: function () {
+            return _this.portId;
+        },
+        setPortId: function (portId) {
+            _this.portId = portId;
+        },
+        getPnf: function () {
+            return _this.pnf;
+        },
+        setPnf: function (pnf) {
+            _this.pnf = pnf;
+        },
+        getOwningEntityProperties: function () {
+            return _this.owningEntityProperties;
+        },
+        setOwningEntityProperties: function (properties) {
+            _this.owningEntityProperties = properties;
+        }
+
 	}
-}
+};
 
 appDS2.factory("DataService", [ "$log", DataService ]);
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/services/deleteResumeService.js b/vid-app-common/src/main/webapp/app/vid/scripts/services/deleteResumeService.js
new file mode 100644
index 0000000..90daf35
--- /dev/null
+++ b/vid-app-common/src/main/webapp/app/vid/scripts/services/deleteResumeService.js
@@ -0,0 +1,518 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * VID
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+"use strict";
+
+var DeleteResumeService = function($log, AaiService, AsdcService, DataService,
+	ComponentService, COMPONENT, FIELD, UtilityService) {
+
+    var _this = this;
+
+    var getAsyncOperationList = function() {
+    	if (DataService.getLoggedInUserId() == null)
+			getLoggedInUserID();
+		switch (_this.componentId) {
+		case COMPONENT.SERVICE:
+			return [ getSubscribers, getLcpCloudRegionTenantList ];
+		case COMPONENT.NETWORK:
+			return [ getLcpCloudRegionTenantList ];
+		case COMPONENT.VNF:
+			return [ getLcpCloudRegionTenantList ];
+		case COMPONENT.VF_MODULE:
+			return [ getLcpCloudRegionTenantList ];
+		case COMPONENT.VOLUME_GROUP:
+			return [ getLcpCloudRegionTenantList ];
+		case COMPONENT.CONFIGURATION:
+			return [ getLcpCloudRegionTenantList ];
+		}
+	};
+	
+	var getLcpCloudRegionTenantList = function() {
+		//console.log ( "global customer id: " ); 
+		//console.log ( JSON.stringify (DataService.getGlobalCustomerId()) );
+		
+		//console.log ( "service type: " ); 
+		//console.log ( JSON.stringify (DataService.getServiceType()) );
+		
+		AaiService.getLcpCloudRegionTenantList(DataService
+				.getGlobalCustomerId(), DataService.getServiceType(), function(
+				response) {
+			DataService.setCloudRegionTenantList(response);
+			UtilityService.startNextAsyncOperation();
+		});
+	};
+	
+	var getLoggedInUserID = function() {
+		AaiService.getLoggedInUserID(function(response) {
+			DataService.setLoggedInUserId(response.data);
+			UtilityService.startNextAsyncOperation();
+		});
+	};
+	
+	var getSubscribers = function() {
+		AaiService.getSubscribers(function(response) {
+			DataService.setSubscribers(response);
+			UtilityService.startNextAsyncOperation();
+		});
+	};
+	
+	var internalGetParametersHandler = function() {
+		if (angular.isFunction(_this.getParametersHandler)) {
+				if (_this.componentId == COMPONENT.SERVICE) {
+					if ( DataService.getALaCarte() ) {
+						_this.getParametersHandler({
+							summaryList : getSummaryList(),
+							userProvidedList : getUserProvidedList()
+						}, true);
+					}
+					else {
+						_this.getParametersHandler({
+							summaryList : getSummaryList(),
+							userProvidedList : getUserProvidedList()
+						}, false);
+					}
+			}
+			else {
+				_this.getParametersHandler({
+					summaryList : getSummaryList(),
+					userProvidedList : getUserProvidedList()
+				}, false);
+			}
+		}
+	};
+	
+	var getSubscribersParameter = function() {
+		var subscribers = DataService.getSubscribers();
+		var parameter = FIELD.PARAMETER.SUBSCRIBER_NAME;
+		parameter.optionList = [];
+
+		for (var i = 0; i < subscribers.length; i++) {
+			parameter.optionList.push({
+				id : subscribers[i][FIELD.ID.GLOBAL_CUSTOMER_ID],
+				name : subscribers[i][FIELD.ID.SUBNAME]
+			})
+		}
+		return parameter;
+	};
+	
+	var getServiceId = function() {
+		var serviceIdList = DataService.getServiceIdList();
+		var parameter = FIELD.PARAMETER.PRODUCT_FAMILY;
+		parameter.optionList = new Array();
+		for (var i = 0; i < serviceIdList.length; i++) {
+			parameter.optionList.push({
+				id : serviceIdList[i].id,
+				name : serviceIdList[i].description
+			});
+		}
+		return parameter;
+	};
+	
+	var getUserProvidedList = function() {
+
+		//var parameterList = [ FIELD.PARAMETER.INSTANCE_NAME ];
+
+		var parameterList = [];
+		
+		switch (_this.componentId) {
+		case COMPONENT.SERVICE:
+			if ( DataService.getALaCarte() ) {
+				parameterList = [];
+			}
+			else {
+				parameterList = parameterList.concat ([getLcpRegion(),
+				    FIELD.PARAMETER.LCP_REGION_TEXT_HIDDEN,
+				    FIELD.PARAMETER.TENANT_DISABLED ]);
+			}
+			break;
+		case COMPONENT.NETWORK:
+		case COMPONENT.CONFIGURATION:
+		case COMPONENT.VNF:
+			parameterList = parameterList.concat([ //getServiceId(),
+					getLcpRegion(), FIELD.PARAMETER.LCP_REGION_TEXT_HIDDEN,
+					FIELD.PARAMETER.TENANT_DISABLED ]);
+			break;
+		case COMPONENT.VF_MODULE:
+			parameterList = parameterList.concat([
+			        getLcpRegion(),
+					FIELD.PARAMETER.LCP_REGION_TEXT_HIDDEN,
+					FIELD.PARAMETER.TENANT_DISABLED
+			]);
+			
+			break;
+		case COMPONENT.VOLUME_GROUP:
+			parameterList = parameterList.concat([ getLcpRegion(),
+					FIELD.PARAMETER.LCP_REGION_TEXT_HIDDEN,
+					FIELD.PARAMETER.TENANT_DISABLED ]);
+		}
+
+		//parameterList.push(FIELD.PARAMETER.SUPPRESS_ROLLBACK);
+
+		//addArbitraryParameters(parameterList);
+
+		return parameterList;
+	};
+    var getSummaryList = function() {
+	switch (_this.componentId) {
+	case COMPONENT.CONFIGURATION:
+	case COMPONENT.NETWORK:
+	case COMPONENT.SERVICE:
+	case COMPONENT.VNF:
+	case COMPONENT.VF_MODULE:
+	case COMPONENT.VOLUME_GROUP:
+	    var summaryList = [ {
+		name : FIELD.NAME.SUBSCRIBER_NAME,
+		value : DataService.getSubscriberName()
+	    }, {
+		name : FIELD.NAME.CUSTOMER_ID,
+		value : DataService.getGlobalCustomerId()
+	    }, {
+		name : FIELD.NAME.SERVICE_UUID,
+		value : DataService.getServiceUuid()
+	    }, {
+		name : FIELD.NAME.SERVICE_NAME,
+		value : DataService.getServiceName()
+	   /* }, {
+		name : FIELD.NAME.USER_SERVICE_INSTANCE_NAME,
+		value : DataService.getUserServiceInstanceName()*/
+	    } ];
+
+		_this.parameterList = new Array();
+		
+		addToList(FIELD.NAME.SERVICE_NAME, DataService.getServiceName());
+
+		switch (_this.componentId) {
+		case COMPONENT.SERVICE:
+			addToList(FIELD.NAME.SERVICE_INVARIANT_UUID, DataService
+					.getModelInfo(_this.componentId)[FIELD.ID.MODEL_INVARIANT_ID]);
+			addToList(FIELD.NAME.SERVICE_VERSION, DataService
+					.getModelInfo(_this.componentId)[FIELD.ID.MODEL_VERSION]);
+			addToList(FIELD.NAME.SERVICE_UUID, DataService
+					.getModelInfo(_this.componentId)[FIELD.ID.MODEL_NAME_VERSION_ID]);
+			addToList(FIELD.NAME.SERVICE_DESCRIPTION, DataService
+					.getModelInfo(_this.componentId)[FIELD.ID.DESCRIPTION]);
+			addToList(FIELD.NAME.SERVICE_CATEGORY, DataService
+					.getModelInfo(_this.componentId)[FIELD.ID.CATEGORY]);
+			break;
+		case COMPONENT.VF_MODULE:
+			addToList(FIELD.NAME.SUBSCRIBER_NAME, DataService
+					.getSubscriberName());
+			addToList(FIELD.NAME.SERVICE_INSTANCE_NAME, DataService
+					.getServiceInstanceName());
+			addToList(FIELD.NAME.MODEL_NAME, DataService
+					.getModelInfo(_this.componentId)[FIELD.ID.MODEL_NAME]);
+			addToList(FIELD.NAME.MODEL_INVARIANT_UUID, DataService
+					.getModelInfo(_this.componentId)[FIELD.ID.MODEL_INVARIANT_ID]);
+			addToList(FIELD.NAME.MODEL_VERSION, DataService
+					.getModelInfo(_this.componentId)[FIELD.ID.MODEL_VERSION]);
+			addToList(FIELD.NAME.MODEL_UUID, DataService
+					.getModelInfo(_this.componentId)[FIELD.ID.MODEL_NAME_VERSION_ID]);
+			break;
+		case COMPONENT.CONFIGURATION:
+		case COMPONENT.NETWORK:
+		case COMPONENT.VNF:
+		case COMPONENT.VOLUME_GROUP:
+			addToList(FIELD.NAME.SUBSCRIBER_NAME, DataService
+					.getSubscriberName());
+			addToList(FIELD.NAME.SERVICE_INSTANCE_NAME, DataService
+					.getServiceInstanceName());
+			addToList(FIELD.NAME.MODEL_NAME, DataService
+					.getModelInfo(_this.componentId)[FIELD.ID.MODEL_NAME]);
+			addToList(FIELD.NAME.MODEL_INVARIANT_UUID, DataService
+					.getModelInfo(_this.componentId)[FIELD.ID.MODEL_INVARIANT_ID]);
+			addToList(FIELD.NAME.MODEL_VERSION, DataService
+					.getModelInfo(_this.componentId)[FIELD.ID.MODEL_VERSION]);
+			addToList(FIELD.NAME.MODEL_UUID, DataService
+					.getModelInfo(_this.componentId)[FIELD.ID.MODEL_NAME_VERSION_ID]);
+			break;
+		}
+		
+	    /*var additionalList = ComponentService.getInventoryParameterList(
+		    _this.componentId, DataService.getInventoryItem());*/
+		var additionalList = ComponentService.getDisplayNames(ComponentService
+			    .getInventoryParameterList(_this.componentId, DataService
+				    .getInventoryItem(), true ));
+
+	    return summaryList.concat(ComponentService
+		    .getDisplayNames(additionalList));
+	}
+    };
+
+    var getMsoUrl = function() {
+		switch (_this.componentId) {
+			case COMPONENT.CONFIGURATION:
+				return "mso_delete_configuration/"
+					+ DataService.getServiceInstanceId() + "/configurations/"
+					+ DataService.getConfigurationInstanceId();
+			case COMPONENT.NETWORK:
+				return "mso_delete_nw_instance/"
+					+ DataService.getServiceInstanceId() + "/networks/"
+					+ DataService.getNetworkInstanceId();
+			case COMPONENT.SERVICE:
+				return "mso_delete_svc_instance/"
+					+ DataService.getServiceInstanceId();
+			case COMPONENT.VNF:
+				return "mso_delete_vnf_instance/"
+					+ DataService.getServiceInstanceId() + "/vnfs/"
+					+ DataService.getVnfInstanceId();
+			case COMPONENT.VF_MODULE:
+				return "mso_delete_vfmodule_instance/"
+					+ DataService.getServiceInstanceId() + "/vnfs/"
+					+ DataService.getVnfInstanceId() + "/vfModules/"
+					+ DataService.getVfModuleInstanceId();
+			case COMPONENT.VOLUME_GROUP:
+				return "mso_delete_volumegroup_instance/"
+					+ DataService.getServiceInstanceId() + "/vnfs/"
+					+ DataService.getVnfInstanceId() + "/volumeGroups/"
+					+ DataService.getVolumeGroupInstanceId();
+		}
+    };
+
+	var addToList = function(name, value) {
+		_this.parameterList.push({
+			name : name,
+			value : value
+		});
+	};
+	
+    var getMsoRequestDetails = function(parameterList) {
+    	console.log("getMsoRequestDetails invoked");
+		var inventoryInfo = ComponentService.getInventoryInfo(
+			_this.componentId, DataService.getInventoryItem());
+		var modelInfo = DataService.getModelInfo(_this.componentId);
+		var requestorloggedInId = DataService.getLoggedInUserId();
+		if (requestorloggedInId ==  null)
+			requestorloggedInId = "";
+		var requestDetails = {
+				modelInfo : {
+					modelType : _this.componentId,
+					modelInvariantId : modelInfo.modelInvariantId,
+					modelVersionId : modelInfo.modelNameVersionId,
+					modelName : modelInfo.modelName,
+					modelCustomizationName : modelInfo.modelCustomizationName,
+					modelCustomizationId : modelInfo.customizationUuid,
+					modelVersion : modelInfo.modelVersion
+				},
+				requestInfo : {
+					source : FIELD.ID.VID,
+					requestorId: requestorloggedInId
+				}
+		};
+		
+		switch (_this.componentId) {
+			case COMPONENT.SERVICE:
+				requestDetails.requestParameters = {
+					aLaCarte : DataService.getALaCarte()
+				};
+				if ( !(DataService.getALaCarte()) ) {
+					// for macro delete include cloud config.
+					var lcpRegion = getValueFromList(FIELD.ID.LCP_REGION, parameterList);
+					if (lcpRegion === FIELD.KEY.LCP_REGION_TEXT) {
+						lcpRegion = getValueFromList(FIELD.ID.LCP_REGION_TEXT,
+								parameterList);
+					}
+					requestDetails.cloudConfiguration = {
+						lcpCloudRegionId : lcpRegion,
+						tenantId : getValueFromList(FIELD.ID.TENANT, parameterList)
+					};
+				}
+			    break;
+			case COMPONENT.VNF:
+            case COMPONENT.CONFIGURATION:
+			    console.log("getMsoRequestDetails COMPONENT.VNF");
+				var lcpRegion = getValueFromList(FIELD.ID.LCP_REGION, parameterList);
+				if (lcpRegion === FIELD.KEY.LCP_REGION_TEXT) {
+					lcpRegion = getValueFromList(FIELD.ID.LCP_REGION_TEXT,
+							parameterList);
+				}
+				requestDetails.cloudConfiguration = {
+					lcpCloudRegionId : lcpRegion,
+					tenantId : getValueFromList(FIELD.ID.TENANT, parameterList)
+				};
+	
+				break;
+			case COMPONENT.VF_MODULE:
+			case COMPONENT.NETWORK:
+					var lcpRegion = getValueFromList(FIELD.ID.LCP_REGION, parameterList);
+					if (lcpRegion === FIELD.KEY.LCP_REGION_TEXT) {
+						lcpRegion = getValueFromList(FIELD.ID.LCP_REGION_TEXT,
+								parameterList);
+					}
+					requestDetails.cloudConfiguration = {
+							lcpCloudRegionId : lcpRegion,
+							tenantId : getValueFromList(FIELD.ID.TENANT, parameterList)
+					};	
+					break;
+			case COMPONENT.VOLUME_GROUP:
+				var lcpRegion = getValueFromList(FIELD.ID.LCP_REGION, parameterList);
+				if (lcpRegion === FIELD.KEY.LCP_REGION_TEXT) {
+					lcpRegion = getValueFromList(FIELD.ID.LCP_REGION_TEXT,
+							parameterList);
+				}
+				requestDetails.cloudConfiguration = {
+						lcpCloudRegionId : lcpRegion,
+						tenantId : getValueFromList(FIELD.ID.TENANT, parameterList)
+				};	
+				
+				break;
+			default:
+				requestDetails.cloudConfiguration = {
+					lcpCloudRegionId : DataService.getLcpRegion(),
+					tenantId : DataService.getTenant()
+				};
+		}
+		return requestDetails;
+    }
+    
+    var getLcpRegion = function() {
+		var cloudRegionTenantList = DataService.getCloudRegionTenantList();
+		var parameter = "";
+		if ( UtilityService.hasContents (cloudRegionTenantList) ) {
+			parameter = FIELD.PARAMETER.LCP_REGION;
+			parameter.optionList = new Array();
+			for (var i = 0; i < cloudRegionTenantList.length; i++) {
+				for (var j = 0; j < parameter.optionList.length; j++) {
+					if (parameter.optionList[j].id === cloudRegionTenantList[i].cloudRegionId) {
+                        parameter.optionList[j].isPermitted =
+                            parameter.optionList[j].isPermitted || cloudRegionTenantList[i].isPermitted;
+                        break;
+					}
+				}
+				if (j < parameter.optionList.length) {
+					continue;
+				}
+				parameter.optionList.push({
+					id : cloudRegionTenantList[i].cloudRegionId,
+          isPermitted : cloudRegionTenantList[i].isPermitted
+
+        });
+			}
+		}
+		return parameter;
+	};
+	
+	var getTenantList = function(cloudRegionId) {
+		var parameter = "";
+		var cloudRegionTenantList = DataService.getCloudRegionTenantList();
+		if ( UtilityService.hasContents (cloudRegionTenantList) ) {
+			var parameter = FIELD.PARAMETER.TENANT_ENABLED;
+			parameter.optionList = new Array();
+			for (var i = 0; i < cloudRegionTenantList.length; i++) {
+				if (cloudRegionTenantList[i].cloudRegionId === cloudRegionId) {
+					parameter.optionList.push({
+						id : cloudRegionTenantList[i].tenantId,
+						name : cloudRegionTenantList[i].tenantName,
+                        isPermitted : cloudRegionTenantList[i].isPermitted
+                    });
+				}
+			}
+		}
+		return parameter;
+
+	};
+
+	var addOptionList = function(parameter, optionSimpleArray) {
+		var optionList = new Array();
+		if (!angular.isArray(optionSimpleArray)) {
+			return optionList;
+		}
+		for (var i = 0; i < optionSimpleArray.length; i++) {
+			optionList.push({
+				name : optionSimpleArray[i]
+			});
+		}
+		parameter.optionList = optionList;
+		return parameter;
+	};
+
+    var getValueFromList = function(id, parameterList) {
+		for (var i = 0; i < parameterList.length; i++) {
+			if (parameterList[i].id === id) {
+				return parameterList[i].value;
+			}
+		}
+	};
+
+	var updateUserParameterList = function(updatedId, parameterListControl) {
+		if (updatedId === FIELD.ID.LCP_REGION) {
+			var list = parameterListControl.getList(updatedId);
+			if (list[0].selectedIndex >= 0) {
+				parameterListControl
+						.updateList([ getTenantList(list[0].value) ]);
+			} else {
+				parameterListControl
+						.updateList([ FIELD.PARAMETER.TENANT_DISABLED ]);
+			}
+			if (list[0].value === FIELD.KEY.LCP_REGION_TEXT) {
+				parameterListControl
+						.updateList([ FIELD.PARAMETER.LCP_REGION_TEXT_VISIBLE ]);
+			} else {
+				parameterListControl
+						.updateList([ FIELD.PARAMETER.LCP_REGION_TEXT_HIDDEN ]);
+			}
+		} else if (updatedId === FIELD.ID.SUBSCRIBER_NAME) {
+			var list = parameterListControl.getList(updatedId);
+			if (list[0].selectedIndex >= 0) {
+				DataService.setGlobalCustomerId(list[0].value);
+
+				AaiService.getSubscriptionServiceTypeList(DataService
+						.getGlobalCustomerId(), function(response) {
+					DataService.setSubscriptionServiceTypeList(response);
+					var serviceTypeParameters = FIELD.PARAMETER.SERVICE_TYPE;
+					serviceTypeParameters.optionList = [];
+
+					for (var i = 0; i < response.length; i++) {
+						serviceTypeParameters.optionList.push({
+							"id" : response[i].name,
+							"name" : response[i].name
+						});
+					}
+					parameterListControl.updateList([ serviceTypeParameters ]);
+				});
+
+			} else {
+				parameterListControl
+						.updateList([ FIELD.PARAMETER.SERVICE_TYPE_DISABLED ]);
+			}
+		}
+	};
+
+    return {
+		initializeComponent : function(componentId) {
+			_this.componentId = ComponentService.initialize(componentId);
+		},
+		getComponentDisplayName : ComponentService.getComponentDisplayName,
+		getSummaryList : getSummaryList,
+		getParameters : function(getParametersHandler) {
+			_this.getParametersHandler = getParametersHandler;
+			UtilityService.setHttpErrorHandler(_this.httpErrorHandler);
+			UtilityService.startAsyncOperations(getAsyncOperationList(),
+					internalGetParametersHandler);
+		},
+		updateUserParameterList : updateUserParameterList,
+		getMsoRequestDetails : getMsoRequestDetails,
+		getMsoUrl : getMsoUrl,
+		isMacro : DataService.getMacro()
+    }
+}
+
+appDS2.factory("DeleteResumeService", [ "$log", "AaiService", "AsdcService",
+	"DataService", "ComponentService", "COMPONENT", "FIELD",
+	"UtilityService", DeleteResumeService ]);
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/services/deletionService.js b/vid-app-common/src/main/webapp/app/vid/scripts/services/deletionService.js
deleted file mode 100755
index 7928299..0000000
--- a/vid-app-common/src/main/webapp/app/vid/scripts/services/deletionService.js
+++ /dev/null
@@ -1,508 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * VID
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *      http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-"use strict";
-
-var DeletionService = function($log, AaiService, AsdcService, DataService,
-	ComponentService, COMPONENT, FIELD, UtilityService) {
-
-    var _this = this;
-
-    var getAsyncOperationList = function() {
-    	if (DataService.getLoggedInUserId() == null)
-			getLoggedInUserID();
-		switch (_this.componentId) {
-		case COMPONENT.SERVICE:
-			return [ getSubscribers, getLcpCloudRegionTenantList ];
-		case COMPONENT.NETWORK:
-			return [ getLcpCloudRegionTenantList ];
-		case COMPONENT.VNF:
-			return [ getLcpCloudRegionTenantList ];
-		case COMPONENT.VF_MODULE:
-			return [ getLcpCloudRegionTenantList ];
-		case COMPONENT.VOLUME_GROUP:
-			return [ getLcpCloudRegionTenantList ];
-		}
-	};
-	
-	var getLcpCloudRegionTenantList = function() {
-		//console.log ( "global customer id: " ); 
-		//console.log ( JSON.stringify (DataService.getGlobalCustomerId()) );
-		
-		//console.log ( "service type: " ); 
-		//console.log ( JSON.stringify (DataService.getServiceType()) );
-		
-		AaiService.getLcpCloudRegionTenantList(DataService
-				.getGlobalCustomerId(), DataService.getServiceType(), function(
-				response) {
-			DataService.setCloudRegionTenantList(response);
-			UtilityService.startNextAsyncOperation();
-		});
-	};
-	
-	var getLoggedInUserID = function() {
-		AaiService.getLoggedInUserID(function(response) {
-			DataService.setLoggedInUserId(response.data);
-			UtilityService.startNextAsyncOperation();
-		});
-	};
-	
-	var getSubscribers = function() {
-		AaiService.getSubscribers(function(response) {
-			DataService.setSubscribers(response);
-			UtilityService.startNextAsyncOperation();
-		});
-	};
-	
-	var internalGetParametersHandler = function() {
-		if (angular.isFunction(_this.getParametersHandler)) {
-				if (_this.componentId == COMPONENT.SERVICE) {
-					if ( DataService.getALaCarte() ) {
-						_this.getParametersHandler({
-							summaryList : getSummaryList(),
-							userProvidedList : getUserProvidedList()
-						}, true);
-					}
-					else {
-						_this.getParametersHandler({
-							summaryList : getSummaryList(),
-							userProvidedList : getUserProvidedList()
-						}, false);
-					}
-			}
-			else {
-				_this.getParametersHandler({
-					summaryList : getSummaryList(),
-					userProvidedList : getUserProvidedList()
-				}, false);
-			}
-		}
-	};
-	
-	var getSubscribersParameter = function() {
-		var subscribers = DataService.getSubscribers();
-		var parameter = FIELD.PARAMETER.SUBSCRIBER_NAME;
-		parameter.optionList = [];
-
-		for (var i = 0; i < subscribers.length; i++) {
-			parameter.optionList.push({
-				id : subscribers[i][FIELD.ID.GLOBAL_CUSTOMER_ID],
-				name : subscribers[i][FIELD.ID.SUBNAME]
-			})
-		}
-		return parameter;
-	};
-	
-	var getServiceId = function() {
-		var serviceIdList = DataService.getServiceIdList();
-		var parameter = FIELD.PARAMETER.PRODUCT_FAMILY;
-		parameter.optionList = new Array();
-		for (var i = 0; i < serviceIdList.length; i++) {
-			parameter.optionList.push({
-				id : serviceIdList[i].id,
-				name : serviceIdList[i].description
-			});
-		}
-		return parameter;
-	};
-	
-	var getUserProvidedList = function() {
-
-		//var parameterList = [ FIELD.PARAMETER.INSTANCE_NAME ];
-
-		var parameterList = [];
-		
-		switch (_this.componentId) {
-		case COMPONENT.SERVICE:
-			if ( DataService.getALaCarte() ) {
-				parameterList = [];
-			}
-			else {
-				parameterList = parameterList.concat ([getLcpRegion(),
-				    FIELD.PARAMETER.LCP_REGION_TEXT_HIDDEN,
-				    FIELD.PARAMETER.TENANT_DISABLED ]);
-			}
-			break;
-		case COMPONENT.NETWORK:
-		case COMPONENT.VNF:
-			parameterList = parameterList.concat([ //getServiceId(),
-					getLcpRegion(), FIELD.PARAMETER.LCP_REGION_TEXT_HIDDEN,
-					FIELD.PARAMETER.TENANT_DISABLED ]);
-			break;
-		case COMPONENT.VF_MODULE:
-			parameterList = parameterList.concat([
-			        getLcpRegion(),
-					FIELD.PARAMETER.LCP_REGION_TEXT_HIDDEN,
-					FIELD.PARAMETER.TENANT_DISABLED
-			]);
-			
-			break;
-		case COMPONENT.VOLUME_GROUP:
-			parameterList = parameterList.concat([ getLcpRegion(),
-					FIELD.PARAMETER.LCP_REGION_TEXT_HIDDEN,
-					FIELD.PARAMETER.TENANT_DISABLED ]);
-		}
-
-		//parameterList.push(FIELD.PARAMETER.SUPPRESS_ROLLBACK);
-
-		//addArbitraryParameters(parameterList);
-
-		return parameterList;
-	};
-    var getSummaryList = function() {
-	switch (_this.componentId) {
-	case COMPONENT.NETWORK:
-	case COMPONENT.SERVICE:
-	case COMPONENT.VNF:
-	case COMPONENT.VF_MODULE:
-	case COMPONENT.VOLUME_GROUP:
-	    var summaryList = [ {
-		name : FIELD.NAME.SUBSCRIBER_NAME,
-		value : DataService.getSubscriberName()
-	    }, {
-		name : FIELD.NAME.CUSTOMER_ID,
-		value : DataService.getGlobalCustomerId()
-	    }, {
-		name : FIELD.NAME.SERVICE_UUID,
-		value : DataService.getServiceUuid()
-	    }, {
-		name : FIELD.NAME.SERVICE_NAME,
-		value : DataService.getServiceName()
-	   /* }, {
-		name : FIELD.NAME.USER_SERVICE_INSTANCE_NAME,
-		value : DataService.getUserServiceInstanceName()*/
-	    } ];
-
-		_this.parameterList = new Array();
-		
-		addToList(FIELD.NAME.SERVICE_NAME, DataService.getServiceName());
-
-		switch (_this.componentId) {
-		case COMPONENT.SERVICE:
-			addToList(FIELD.NAME.SERVICE_INVARIANT_UUID, DataService
-					.getModelInfo(_this.componentId)[FIELD.ID.MODEL_INVARIANT_ID]);
-			addToList(FIELD.NAME.SERVICE_VERSION, DataService
-					.getModelInfo(_this.componentId)[FIELD.ID.MODEL_VERSION]);
-			addToList(FIELD.NAME.SERVICE_UUID, DataService
-					.getModelInfo(_this.componentId)[FIELD.ID.MODEL_NAME_VERSION_ID]);
-			addToList(FIELD.NAME.SERVICE_DESCRIPTION, DataService
-					.getModelInfo(_this.componentId)[FIELD.ID.DESCRIPTION]);
-			addToList(FIELD.NAME.SERVICE_CATEGORY, DataService
-					.getModelInfo(_this.componentId)[FIELD.ID.CATEGORY]);
-			break;
-		case COMPONENT.VF_MODULE:
-			addToList(FIELD.NAME.SUBSCRIBER_NAME, DataService
-					.getSubscriberName());
-			addToList(FIELD.NAME.SERVICE_INSTANCE_NAME, DataService
-					.getServiceInstanceName());
-			addToList(FIELD.NAME.MODEL_NAME, DataService
-					.getModelInfo(_this.componentId)[FIELD.ID.MODEL_NAME]);
-			addToList(FIELD.NAME.MODEL_INVARIANT_UUID, DataService
-					.getModelInfo(_this.componentId)[FIELD.ID.MODEL_INVARIANT_ID]);
-			addToList(FIELD.NAME.MODEL_VERSION, DataService
-					.getModelInfo(_this.componentId)[FIELD.ID.MODEL_VERSION]);
-			addToList(FIELD.NAME.MODEL_UUID, DataService
-					.getModelInfo(_this.componentId)[FIELD.ID.MODEL_NAME_VERSION_ID]);
-			break;
-		case COMPONENT.NETWORK:
-		case COMPONENT.VNF:
-		case COMPONENT.VOLUME_GROUP:
-			addToList(FIELD.NAME.SUBSCRIBER_NAME, DataService
-					.getSubscriberName());
-			addToList(FIELD.NAME.SERVICE_INSTANCE_NAME, DataService
-					.getServiceInstanceName());
-			addToList(FIELD.NAME.MODEL_NAME, DataService
-					.getModelInfo(_this.componentId)[FIELD.ID.MODEL_NAME]);
-			addToList(FIELD.NAME.MODEL_INVARIANT_UUID, DataService
-					.getModelInfo(_this.componentId)[FIELD.ID.MODEL_INVARIANT_ID]);
-			addToList(FIELD.NAME.MODEL_VERSION, DataService
-					.getModelInfo(_this.componentId)[FIELD.ID.MODEL_VERSION]);
-			addToList(FIELD.NAME.MODEL_UUID, DataService
-					.getModelInfo(_this.componentId)[FIELD.ID.MODEL_NAME_VERSION_ID]);
-			break;
-		}
-		
-	    /*var additionalList = ComponentService.getInventoryParameterList(
-		    _this.componentId, DataService.getInventoryItem());*/
-		var additionalList = ComponentService.getDisplayNames(ComponentService
-			    .getInventoryParameterList(_this.componentId, DataService
-				    .getInventoryItem(), true ));
-
-	    return summaryList.concat(ComponentService
-		    .getDisplayNames(additionalList));
-	}
-    };
-
-    var getMsoUrl = function() {
-	switch (_this.componentId) {
-	case COMPONENT.NETWORK:
-	    return "mso_delete_nw_instance/"
-		    + DataService.getServiceInstanceId() + "/networks/"
-		    + DataService.getNetworkInstanceId();
-	case COMPONENT.SERVICE:
-	    return "mso_delete_svc_instance/"
-		    + DataService.getServiceInstanceId();
-	case COMPONENT.VNF:
-	    return "mso_delete_vnf_instance/"
-		    + DataService.getServiceInstanceId() + "/vnfs/"
-		    + DataService.getVnfInstanceId();
-	case COMPONENT.VF_MODULE:
-	    return "mso_delete_vfmodule_instance/"
-		    + DataService.getServiceInstanceId() + "/vnfs/"
-		    + DataService.getVnfInstanceId() + "/vfModules/"
-		    + DataService.getVfModuleInstanceId();
-	case COMPONENT.VOLUME_GROUP:
-	    return "mso_delete_volumegroup_instance/"
-		    + DataService.getServiceInstanceId() + "/vnfs/"
-		    + DataService.getVnfInstanceId() + "/volumeGroups/"
-		    + DataService.getVolumeGroupInstanceId();
-	}
-    }
-
-	var addToList = function(name, value) {
-		_this.parameterList.push({
-			name : name,
-			value : value
-		});
-	};
-	
-    var getMsoRequestDetails = function(parameterList) {
-    	console.log("getMsoRequestDetails invoked");
-		var inventoryInfo = ComponentService.getInventoryInfo(
-			_this.componentId, DataService.getInventoryItem());
-		var modelInfo = DataService.getModelInfo(_this.componentId);
-		var requestorloggedInId = DataService.getLoggedInUserId();
-		if (requestorloggedInId ==  null)
-			requestorloggedInId = "";
-		var requestDetails = {
-				modelInfo : {
-					modelType : _this.componentId,
-					modelInvariantId : modelInfo.modelInvariantId,
-					modelVersionId : modelInfo.modelNameVersionId,
-					modelName : modelInfo.modelName,
-					modelCustomizationName : modelInfo.modelCustomizationName,
-					modelCustomizationId : modelInfo.customizationUuid,
-					modelVersion : modelInfo.modelVersion
-				},
-				requestInfo : {
-					source : FIELD.ID.VID,
-					requestorId: requestorloggedInId
-				}
-		};
-		
-		switch (_this.componentId) {
-			case COMPONENT.SERVICE:
-				requestDetails.requestParameters = {
-					aLaCarte : DataService.getALaCarte()
-				};
-				if ( !(DataService.getALaCarte()) ) {
-					// for macro delete include cloud config.
-					var lcpRegion = getValueFromList(FIELD.ID.LCP_REGION, parameterList);
-					if (lcpRegion === FIELD.KEY.LCP_REGION_TEXT) {
-						lcpRegion = getValueFromList(FIELD.ID.LCP_REGION_TEXT,
-								parameterList);
-					}
-					requestDetails.cloudConfiguration = {
-						lcpCloudRegionId : lcpRegion,
-						tenantId : getValueFromList(FIELD.ID.TENANT, parameterList)
-					};
-				}
-			    break;
-			case COMPONENT.VNF:
-			    console.log("getMsoRequestDetails COMPONENT.VNF");
-				var lcpRegion = getValueFromList(FIELD.ID.LCP_REGION, parameterList);
-				if (lcpRegion === FIELD.KEY.LCP_REGION_TEXT) {
-					lcpRegion = getValueFromList(FIELD.ID.LCP_REGION_TEXT,
-							parameterList);
-				}
-				requestDetails.cloudConfiguration = {
-					lcpCloudRegionId : lcpRegion,
-					tenantId : getValueFromList(FIELD.ID.TENANT, parameterList)
-				};
-	
-				break;
-			case COMPONENT.VF_MODULE:
-			case COMPONENT.NETWORK:
-					var lcpRegion = getValueFromList(FIELD.ID.LCP_REGION, parameterList);
-					if (lcpRegion === FIELD.KEY.LCP_REGION_TEXT) {
-						lcpRegion = getValueFromList(FIELD.ID.LCP_REGION_TEXT,
-								parameterList);
-					}
-					requestDetails.cloudConfiguration = {
-							lcpCloudRegionId : lcpRegion,
-							tenantId : getValueFromList(FIELD.ID.TENANT, parameterList)
-					};	
-					break;
-			case COMPONENT.VOLUME_GROUP:
-				var lcpRegion = getValueFromList(FIELD.ID.LCP_REGION, parameterList);
-				if (lcpRegion === FIELD.KEY.LCP_REGION_TEXT) {
-					lcpRegion = getValueFromList(FIELD.ID.LCP_REGION_TEXT,
-							parameterList);
-				}
-				requestDetails.cloudConfiguration = {
-						lcpCloudRegionId : lcpRegion,
-						tenantId : getValueFromList(FIELD.ID.TENANT, parameterList)
-				};	
-				
-				break;
-			default:
-				requestDetails.cloudConfiguration = {
-					lcpCloudRegionId : DataService.getLcpRegion(),
-					tenantId : DataService.getTenant()
-				};
-		}
-		return requestDetails;
-    }
-    
-    var getLcpRegion = function() {
-		var cloudRegionTenantList = DataService.getCloudRegionTenantList();
-		var parameter = "";
-		if ( UtilityService.hasContents (cloudRegionTenantList) ) {
-			parameter = FIELD.PARAMETER.LCP_REGION;
-			parameter.optionList = new Array();
-			for (var i = 0; i < cloudRegionTenantList.length; i++) {
-				for (var j = 0; j < parameter.optionList.length; j++) {
-					if (parameter.optionList[j].id === cloudRegionTenantList[i].cloudRegionId) {
-                        parameter.optionList[j].isPermitted =
-                            parameter.optionList[j].isPermitted || cloudRegionTenantList[i].isPermitted;
-                        break;
-					}
-				}
-				if (j < parameter.optionList.length) {
-					continue;
-				}
-				parameter.optionList.push({
-					id : cloudRegionTenantList[i].cloudRegionId,
-          isPermitted : cloudRegionTenantList[i].isPermitted
-
-        });
-			}
-		}
-		return parameter;
-	};
-	
-	var getTenantList = function(cloudRegionId) {
-		var parameter = "";
-		var cloudRegionTenantList = DataService.getCloudRegionTenantList();
-		if ( UtilityService.hasContents (cloudRegionTenantList) ) {
-			var parameter = FIELD.PARAMETER.TENANT_ENABLED;
-			parameter.optionList = new Array();
-			for (var i = 0; i < cloudRegionTenantList.length; i++) {
-				if (cloudRegionTenantList[i].cloudRegionId === cloudRegionId) {
-					parameter.optionList.push({
-						id : cloudRegionTenantList[i].tenantId,
-						name : cloudRegionTenantList[i].tenantName,
-                        isPermitted : cloudRegionTenantList[i].isPermitted
-                    });
-				}
-			}
-		}
-		return parameter;
-
-	};
-
-	var addOptionList = function(parameter, optionSimpleArray) {
-		var optionList = new Array();
-		if (!angular.isArray(optionSimpleArray)) {
-			return optionList;
-		}
-		for (var i = 0; i < optionSimpleArray.length; i++) {
-			optionList.push({
-				name : optionSimpleArray[i]
-			});
-		}
-		parameter.optionList = optionList;
-		return parameter;
-	};
-
-    var getValueFromList = function(id, parameterList) {
-		for (var i = 0; i < parameterList.length; i++) {
-			if (parameterList[i].id === id) {
-				return parameterList[i].value;
-			}
-		}
-	};
-
-	var updateUserParameterList = function(updatedId, parameterListControl) {
-		if (updatedId === FIELD.ID.LCP_REGION) {
-			var list = parameterListControl.getList(updatedId);
-			if (list[0].selectedIndex >= 0) {
-				parameterListControl
-						.updateList([ getTenantList(list[0].value) ]);
-			} else {
-				parameterListControl
-						.updateList([ FIELD.PARAMETER.TENANT_DISABLED ]);
-			}
-			if (list[0].value === FIELD.KEY.LCP_REGION_TEXT) {
-				parameterListControl
-						.updateList([ FIELD.PARAMETER.LCP_REGION_TEXT_VISIBLE ]);
-			} else {
-				parameterListControl
-						.updateList([ FIELD.PARAMETER.LCP_REGION_TEXT_HIDDEN ]);
-			}
-		} else if (updatedId === FIELD.ID.SUBSCRIBER_NAME) {
-			var list = parameterListControl.getList(updatedId);
-			if (list[0].selectedIndex >= 0) {
-				DataService.setGlobalCustomerId(list[0].value);
-
-				AaiService.getSubscriptionServiceTypeList(DataService
-						.getGlobalCustomerId(), function(response) {
-					DataService.setSubscriptionServiceTypeList(response);
-					var serviceTypeParameters = FIELD.PARAMETER.SERVICE_TYPE;
-					serviceTypeParameters.optionList = [];
-
-					for (var i = 0; i < response.length; i++) {
-						serviceTypeParameters.optionList.push({
-							"id" : response[i].name,
-							"name" : response[i].name
-						});
-					}
-					parameterListControl.updateList([ serviceTypeParameters ]);
-				});
-
-			} else {
-				parameterListControl
-						.updateList([ FIELD.PARAMETER.SERVICE_TYPE_DISABLED ]);
-			}
-		}
-	};
-
-    return {
-	initializeComponent : function(componentId) {
-	    _this.componentId = ComponentService.initialize(componentId);
-	},
-	getComponentDisplayName : ComponentService.getComponentDisplayName,
-	getSummaryList : getSummaryList,
-	getParameters : function(getParametersHandler) {
-		_this.getParametersHandler = getParametersHandler;
-		UtilityService.setHttpErrorHandler(_this.httpErrorHandler);
-		UtilityService.startAsyncOperations(getAsyncOperationList(),
-				internalGetParametersHandler);
-	},
-	updateUserParameterList : updateUserParameterList,
-	getMsoRequestDetails : getMsoRequestDetails,
-	getMsoUrl : getMsoUrl,
-	isMacro : DataService.getMacro()
-    }
-}
-
-appDS2.factory("DeletionService", [ "$log", "AaiService", "AsdcService",
-	"DataService", "ComponentService", "COMPONENT", "FIELD",
-	"UtilityService", DeletionService ]);
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/services/msoService.js b/vid-app-common/src/main/webapp/app/vid/scripts/services/msoService.js
index 68c8503..67211d4 100755
--- a/vid-app-common/src/main/webapp/app/vid/scripts/services/msoService.js
+++ b/vid-app-common/src/main/webapp/app/vid/scripts/services/msoService.js
@@ -20,7 +20,7 @@
 
 "use strict";
 
-var MsoService = function($http, $log, PropertyService, AaiService, UtilityService, COMPONENT, FIELD, $q) {
+var MsoService = function($http, $log, $q, PropertyService, AaiService, UtilityService, COMPONENT, FIELD) {
 
     var _this = this;
 
@@ -55,49 +55,60 @@
         }
     };
 
-    var activateInstance = function(instance, model) {
+    var buildPayloadForServiceActivateDeactivate = function (model, userId, aicZone) {
+        var requestDetails = {
+                "modelInfo": {
+                    "modelType": "service",
+                    "modelInvariantId": model.service.invariantUuid,
+                    "modelVersionId": model.service.uuid,
+                    "modelName": model.service.name,
+                    "modelVersion": model.service.version
+                },
+                "requestInfo": {
+                    "source": "VID",
+                    "requestorId": userId
+                },
+                "requestParameters": {
+                    "userParams": [{
+                        "name": "aic_zone",
+                        "value": aicZone
+                    }]
+                }
+        };
+
+        $log.debug("Service Activate/Deactivate payload", requestDetails);
+
+        return requestDetails;
+
+    };
+
+    var activateInstance = function(requestParams) {
+        var requestDetails = buildPayloadForServiceActivateDeactivate(requestParams.model, requestParams.userId, requestParams.aicZone);
+
+        return sendPostRequest(COMPONENT.MSO_ACTIVATE_INSTANCE.replace('@serviceInstanceId', requestParams.instance.serviceInstanceId),
+            requestDetails);
+    };
+
+    var deactivateInstance = function(requestParams) {
+        var requestDetails = buildPayloadForServiceActivateDeactivate(requestParams.model, requestParams.userId, requestParams.aicZone);
+
+        return sendPostRequest(COMPONENT.MSO_DEACTIVATE_INSTANCE.replace('@serviceInstanceId', requestParams.instance.serviceInstanceId),
+            requestDetails);
+    };
+
+    var sendPostRequest = function(url, requestDetails) {
         var deferred = $q.defer();
-
-        AaiService.getLoggedInUserID(function (response) {
-            var userID = response.data;
-
-            AaiService.getAicZoneForPNF(instance.globalCustomerId, model.service.serviceType, instance.serviceInstanceId, function (aicZone) {
-
-                var requestDetails = {
-                    "modelInstanceId": serviceInstanceId,
-                    "requestDetails": {
-                        "modelInfo": {
-                            "modelType": "service",
-                            "modelInvariantId": model.service.invariantUuid,
-                            "modelVersionId": model.service.uuid,
-                            "modelName": model.service.name,
-                            "modelVersion": model.service.version
-                        },
-                        "requestInfo": {
-                            "source": "VID",
-                            "requestorId": userID
-                        },
-                        "requestParameters": {
-                            "userParams": {
-                                "name": "aic_zone",
-                                "value": aicZone
-                            }
-                        }
-                    }
-                };
-
-                console.log("requestDetails", requestDetails);
-
-                $http.post(COMPONENT.MSO_ACTIVATE_INSTANCE.replace('@serviceInstanceId', requestDetails.modelInstanceId),
-                    requestDetails.requestDetails)
-                    .success(function (response) {
-                        deferred.resolve({data: response});
-                    })
-                    .error(function(data, status, headers, config) {
-                        deferred.reject({message: data, status: status});
-                    });
+        if (url) {
+            $http.post(url, {
+                requestDetails: requestDetails
+            }, {
+                timeout: PropertyService.getServerResponseTimeoutMsec()
+            }).success(function (response) {
+                deferred.resolve({data: response});
+            }).error(function (data, status) {
+                deferred.reject({message: data, status: status});
             });
-        });
+        }
 
         return deferred.promise;
     };
@@ -177,9 +188,12 @@
         getFormattedSingleGetOrchestrationRequestResponse : function (response) {
             UtilityService.checkUndefined(COMPONENT.ENTITY, response.data.entity);
             UtilityService.checkUndefined(COMPONENT.STATUS, response.data.status);
-            checkValidStatus(response);
+            //checkValidStatus(response);
 
             var message = "";
+            if (! (response && response.data && response.data.entity)) {
+                return message;
+            }
             if ( UtilityService.hasContents (response.data.entity.request) ) {
                 var request = response.data.entity.request;
                 message += addListEntry(FIELD.ID.REQUEST_ID, request.requestId) + ",\n";
@@ -201,6 +215,11 @@
                         + "\n\n";
                 }
             }
+            else {
+                if (UtilityService.hasContents(response.data.status) && UtilityService.hasContents(response.data.entity)) {
+                    message = this.getFormattedCommonResponse(response) + "\n";
+                }
+            }
             return message;
         },
         getManualTasks : function(requestId) {
@@ -215,29 +234,37 @@
                 .catch(UtilityService.runHttpErrorHandler);
         },
         completeTask: function(taskId, taskToComplete) {
-            $log.debug("MsoService:completeTask: taskId: "
-                + taskId);
-            AaiService.getLoggedInUserID(function (response) {
-                var attuid = response.data;
-                var source = "VID";
-                var data = {
-                    requestDetails: {
-                        requestInfo: {
-                            source: source,
-                            responseValue: taskToComplete,
-                            requestorId: attuid
+            var promise = new Promise(function (resolve, reject) {
+                $log.debug("MsoService:completeTask: taskId: "
+                    + taskId);
+                AaiService.getLoggedInUserID(function (response) {
+                    var attuid = response.data;
+                    var source = "VID";
+                    var data = {
+                        requestDetails: {
+                            requestInfo: {
+                                source: source,
+                                responseValue: taskToComplete,
+                                requestorId: attuid
+                            }
                         }
-                    }
-                };
+                    };
 
-                return $http.post(
-                    "mso/mso_post_man_task/" + taskId, data,
-                    {
-                        timeout: PropertyService
-                            .getServerResponseTimeoutMsec()
+                    return $http.post(
+                        "mso/mso_post_man_task/" + taskId, data,
+                        {
+                            timeout: PropertyService
+                                .getServerResponseTimeoutMsec()
+                        }).then(function (response) {
+                            resolve(response);
                     })
-                    .catch(UtilityService.runHttpErrorHandler);
+                        .catch(UtilityService.runHttpErrorHandler);
+                }, function () {
+                    reject();
+                });
             });
+
+            return promise;
         },
         showResponseContentError : function(error, showFunction) {
             switch (error.type) {
@@ -251,9 +278,233 @@
                     showFunction(FIELD.ERROR.SYSTEM_FAILURE);
             }
         },
-        activateInstance: activateInstance
+        activateInstance: activateInstance,
+        deactivateInstance: deactivateInstance,
+
+
+        createConfigurationInstance: function(requestParams) {
+
+            const modelInfoOf = function (instance) {
+                const modelInfo = {
+                    "modelType": "vnf",
+                    "modelInvariantId": instance.properties['model-invariant-id'],
+                    "modelVersionId": instance.properties['model-version-id'],
+                    "modelName": instance.properties['model-name'],
+                    "modelVersion": instance.properties['model-version'],
+                    "modelCustomizationId": instance.properties['model-customization-id']
+                };
+
+                $log.debug("model info from instance", instance);
+                $log.debug("model info to model", modelInfo);
+
+                return modelInfo
+            };
+
+            var payload = {
+                "requestDetails": {
+                    "modelInfo": {
+                        "modelType": "configuration",
+                        "modelInvariantId": requestParams.configurationModelInfo.modelInvariantId,
+                        "modelVersionId": requestParams.configurationModelInfo.modelNameVersionId,
+                        "modelName": requestParams.configurationModelInfo.modelName, // "Port Mirroring Configuration"
+                        "modelVersion": requestParams.configurationModelInfo.modelVersion,
+                        "modelCustomizationId": requestParams.configurationModelInfo.customizationUuid,
+                        "modelCustomizationName": requestParams.configurationModelInfo.modelCustomizationName
+                    },
+                    "cloudConfiguration": {
+                        // "tenantId": ????
+                        "lcpCloudRegionId": requestParams.portMirroringConfigFields.lcpRegion.value
+                    },
+                    "requestInfo": {
+                        "instanceName": requestParams.portMirroringConfigFields.instanceName.value,
+                        "source": "VID",
+                        "requestorId": requestParams.attuuid
+                    },
+                    "relatedInstanceList": [
+                        {
+                            "relatedInstance": {
+                                "instanceId": requestParams.topServiceInstanceId,
+                                "modelInfo": {
+                                    "modelType": "service", // relatedTopModelsInfo.modelType
+                                    "modelInvariantId": requestParams.relatedTopModelsInfo.modelInvariantId,
+                                    "modelVersionId": requestParams.relatedTopModelsInfo.modelNameVersionId,
+                                    "modelName": requestParams.relatedTopModelsInfo.modelName,
+                                    "modelVersion": requestParams.relatedTopModelsInfo.modelVersion
+                                }
+                            }
+                        },
+                        {
+                            "relatedInstance": {
+                                "instanceId": requestParams.portMirroringConfigFields.sourceInstance.properties['vnf-id'],
+                                "instanceDirection": "source",
+                                "modelInfo": modelInfoOf(requestParams.portMirroringConfigFields.sourceInstance)
+                            }
+                        },
+                        {
+                            "relatedInstance": {
+                                "instanceId": requestParams.configurationByPolicy ?
+                                    requestParams.portMirroringConfigFields.destinationInstance.properties['pnfName']:
+                                    requestParams.portMirroringConfigFields.destinationInstance.properties['vnf-id'],
+                                "instanceDirection": "destination",
+                                "modelInfo":
+                                    requestParams.configurationByPolicy ?
+                                        {"modelType": "pnf"} :
+                                        modelInfoOf(requestParams.portMirroringConfigFields.destinationInstance)
+                            }
+                        }
+                    ],
+                    "requestParameters": {
+                        "userParams": []
+                    }
+                }
+            };
+
+            $log.debug("payload", payload);
+
+            var deferred = $q.defer();
+            $http.post([
+                'mso','mso_create_configuration_instance',
+                requestParams.topServiceInstanceId,
+                'configurations',''
+            ].join(COMPONENT.FORWARD_SLASH),
+                payload)
+                .success(function (response) {
+                    deferred.resolve({data : response});
+                }).error(function (data, status) {
+                deferred.reject({message: data, status: status});
+            });
+            return deferred.promise;
+        },
+
+        toggleConfigurationStatus: function(requestParams) {
+
+            var requestDetails = {
+                "modelInfo": requestParams.configurationModel,
+                "cloudConfiguration": {
+                    "lcpCloudRegionId": "mdt1"
+                },
+                "requestInfo": {
+                    "source": "VID",
+                    "requestorId": requestParams.userId
+                },
+                "relatedInstanceList": [{
+                    "relatedInstance": {
+                        "instanceId": requestParams.serviceInstanceId,
+                        "modelInfo": requestParams.serviceModel
+                    }
+                }],
+                "requestParameters": {
+                    "userParams": []
+                }
+            };
+
+            var url;
+            switch (requestParams.configStatus) {
+                case FIELD.STATUS.AAI_CREATED:
+                case FIELD.STATUS.AAI_INACTIVE:
+                    url = "mso/mso_activate_configuration/"+requestParams.serviceInstanceId+"/configurations/"+requestParams.configurationId;
+                    break;
+                case FIELD.STATUS.AAI_ACTIVE:
+                    url = "mso/mso_deactivate_configuration/"+requestParams.serviceInstanceId+"/configurations/"+requestParams.configurationId;
+                    break;
+            }
+
+            return sendPostRequest(url, requestDetails);
+        },
+
+        togglePortStatus: function(requestParams) {
+            var requestDetails = {
+                "modelInfo": requestParams.configurationModel,
+                "cloudConfiguration": {
+                    "lcpCloudRegionId": "mdt1"
+                },
+                "requestInfo": {
+                    "source": "VID",
+                    "requestorId": requestParams.userId
+                },
+                "relatedInstanceList": [
+                    {
+                        "relatedInstance": {
+                            "instanceId": requestParams.serviceInstanceId,
+                            "modelInfo": requestParams.serviceModel
+                        }
+                    },
+                    {
+                        "relatedInstance": {
+                            "instanceId": requestParams.portId,
+                            "instanceDirection": "source",
+                            "modelInfo": {
+                                "modelType": "connectionPoint"
+                            }
+                        }
+                    }
+                ]
+            };
+
+            var url;
+            switch (requestParams.portStatus) {
+                case FIELD.STATUS.AAI_ENABLED:
+                    url = "mso/mso_disable_port_configuration/"+requestParams.serviceInstanceId+"/configurations/"+requestParams.configurationId;
+                    break;
+                case FIELD.STATUS.AAI_DISABLED:
+                    url = "mso/mso_enable_port_configuration/"+requestParams.serviceInstanceId+"/configurations/"+requestParams.configurationId;
+                    break;
+            }
+
+            return sendPostRequest(url, requestDetails);
+        },
+
+        buildPayloadForAssociateDissociate: function(serviceModelInfo, attuuid, instanceId, pnf) {
+            var payload = {
+                    "modelInfo": {
+                        "modelType": "service",
+                        "modelInvariantId": serviceModelInfo.invariantUuid,
+                        "modelVersionId": serviceModelInfo.uuid,
+                        "modelName": serviceModelInfo.name,
+                        "modelVersion": serviceModelInfo.version
+                    },
+                    "requestInfo": {
+                        "source": "VID",
+                        "requestorId": attuuid
+                    },
+                    "relatedInstanceList": [
+                        {
+                            "relatedInstance": {
+                                "instanceName": pnf,
+                                "modelInfo": {
+                                    "modelType": "pnf"
+                                }
+                            }
+                        }],
+                    "requestParameters": {
+                        "aLaCarte": true
+                    }
+            };
+
+            $log.debug("payload", payload);
+
+            return payload;
+        },
+        associatePnf: function(requestParams) {
+
+            var payload = this.buildPayloadForAssociateDissociate(requestParams.serviceModelInfo, requestParams.attuuid, requestParams.instanceId, requestParams.pnf);
+            return sendPostRequest([
+                    COMPONENT.MSO, COMPONENT.MSO_CREATE_REALATIONSHIP,
+                    requestParams.instanceId,
+                    ''
+                ].join(COMPONENT.FORWARD_SLASH), payload);
+        },
+        dissociatePnf: function(requestParams) {
+
+            var payload = this.buildPayloadForAssociateDissociate(requestParams.serviceModelInfo, requestParams.attuuid, requestParams.serviceInstanceId, requestParams.pnf);
+
+            return sendPostRequest([
+                COMPONENT.MSO, COMPONENT.MSO_REMOVE_RELATIONSHIP,
+                requestParams.serviceInstanceId,
+                ''
+            ].join(COMPONENT.FORWARD_SLASH), payload);
+        }
     }
 };
 
-appDS2.factory("MsoService", [ "$http", "$log", "PropertyService",
-    "AaiService", "UtilityService", "COMPONENT", "FIELD", "$q", MsoService ]);
+appDS2.factory("MsoService", MsoService );
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/services/pnfService.js b/vid-app-common/src/main/webapp/app/vid/scripts/services/pnfService.js
new file mode 100644
index 0000000..39a2e2d
--- /dev/null
+++ b/vid-app-common/src/main/webapp/app/vid/scripts/services/pnfService.js
@@ -0,0 +1,43 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * VID
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+"use strict";
+
+var PnfService = function ($q, AaiService) {
+    return {
+        getPnfs: function (instance) {
+            var deferred = $q.defer();
+
+            AaiService.getPNFInformationByServiceTypeAndId(
+                instance.globalCustomerId,
+                instance.serviceType,
+                instance.serviceInstanceId,
+                function (response) {
+                    deferred.resolve(response);
+                },
+                function (error) {
+                    deferred.reject(error);
+            });
+            return deferred.promise;
+        }
+    };
+};
+
+appDS2.factory("PnfService", ["$q", "AaiService", PnfService]);
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/services/schedulerService.js b/vid-app-common/src/main/webapp/app/vid/scripts/services/schedulerService.js
index 83cc4dd..cd0c45e 100644
--- a/vid-app-common/src/main/webapp/app/vid/scripts/services/schedulerService.js
+++ b/vid-app-common/src/main/webapp/app/vid/scripts/services/schedulerService.js
@@ -22,81 +22,24 @@
 
 var SchedulerService = function($http, $log, PropertyService, UtilityService, COMPONENT, FIELD) {
     return {
-    
-    	getStatusSchedulerId : function(schedulerInfo,successCallbackFunction) {
-		$log
-		.debug("SchedulerService:getSchedulerStatusAndSchedulerId");
-		var url =   COMPONENT.POST_CREATE_NEW_VNF_CHANGE+COMPONENT.ASSIGN + Math.random();
+        cancelScheduleRequest: function(schedulerID, successCallbackFunction, errorCallbackFunction) {
+            $log.debug("SchedulerService:cancelPendingBySchedulerId");
+            var url =   COMPONENT.CANCEL_SCHEDULE_REQUEST + COMPONENT.FORWARD_SLASH + schedulerID + COMPONENT.ASSIGN;
 
-		$http.post(url,	schedulerInfo,
-				{
-			timeout : PropertyService
-			.getServerResponseTimeoutMsec()
-				}).then(function(response) {
-					if (response.data) {
-						successCallbackFunction(response);
-					} else {
-						successCallbackFunction([]);
-					}
-				})["catch"]
-		(UtilityService.runHttpErrorHandler);
-	},
-
-	getTimeSotsForSchedulerId:function(schedulerID,successCallbackFunction){
-    	$log
-		.debug("SchedulerService:getTimeSlotsForSchedulerID");
-		var url =   COMPONENT.GET_TIME_SLOTS+COMPONENT.FORWARD_SLASH +schedulerID+COMPONENT.ASSIGN;
-
-		$http.get(url,
-				{
-			timeout : PropertyService
-			.getServerResponseTimeoutMsec()
-				}).then(function(response) {
-					if (response.data) {
-						successCallbackFunction(response);
-					} else {
-						successCallbackFunction([]);
-					}
-				})["catch"]
-
-		(UtilityService.runHttpErrorHandler);
-    },
-    getSubmitForapprovedTimeslots: function(ApprovedTimeSlotsObj,successCallbackFunction) {
-		$log
-		.debug("SchedulerService:getSchedulerStatusAndSchedulerId");
-		var url =   COMPONENT.SUBMIT_VNF_CHANGE_TIMESLOTS+COMPONENT.ASSIGN + Math.random();
-
-		$http.post(url,	ApprovedTimeSlotsObj,
-				{
-			timeout : PropertyService
-			.getServerResponseTimeoutMsec()
-				}).then(function(response) {
-					if (response.data) {
-						successCallbackFunction(response);
-					} else {
-						successCallbackFunction([]);
-					}
-				})["catch"]
-		(UtilityService.runHttpErrorHandler);
-	},
-	getPolicyInfo:function(policyName,successCallbackFunction){
-    	$log
-		.debug("SchedulerService:getPolicyInfo");
-		var url =   COMPONENT.GET_POLICY +COMPONENT.ASSIGN + Math.random();
-		
-		$http.post(url,	policyName,
-				{
-			timeout : PropertyService
-			.getServerResponseTimeoutMsec()
-				}).then(function(response) {
-					if (response.data) {
-						successCallbackFunction(response);
-					} else {
-						successCallbackFunction([]);
-					}
-				})["catch"]
-		(UtilityService.runHttpErrorHandler);
-    }
+            $http.delete(url,
+			{
+				timeout : PropertyService
+					.getServerResponseTimeoutMsec()
+			}).then(function(response) {
+                if (response.data) {
+                    successCallbackFunction(response);
+                } else {
+                    successCallbackFunction([]);
+                }
+            }).catch(function(error) {
+            	errorCallbackFunction(error);
+			});
+		}
     }
 }
 
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/services/testEnvironmentsService.js b/vid-app-common/src/main/webapp/app/vid/scripts/services/testEnvironmentsService.js
new file mode 100644
index 0000000..6ae675a
--- /dev/null
+++ b/vid-app-common/src/main/webapp/app/vid/scripts/services/testEnvironmentsService.js
@@ -0,0 +1,79 @@
+(function () {
+    'use strict';
+
+    appDS2.service('TestEnvironmentsService', ['$q', '$http', '$log', 'COMPONENT', 'UtilityService', testEnvironmentsService]);
+
+    function testEnvironmentsService($q, $http, $log, COMPONENT, UtilityService) {
+        this.loadAAIestEnvironments = function(type) {
+            var deferred = $q.defer();
+            $http.get(COMPONENT.AAI_GET_TEST_ENVIRONMENTS + type)
+                .success(function (response) {
+                    if(response.httpCode == 200) {
+                        deferred.resolve({operationalEnvironment: response.t.operationalEnvironment});
+                    }
+                    else {
+                        deferred.reject({message: response.errorMessage, status: response.httpCode});
+                    }
+                })
+                .error(function(data, status, headers, config) {
+                    deferred.reject({message: data, status: status});
+                });
+
+            return deferred.promise;
+        };
+
+        this.createApplicationEnv = function(request) {
+            var deferred = $q.defer();
+
+            $http.post(COMPONENT.OPERATIONAL_ENVIRONMENT_CREATE, JSON.stringify(request.requestDetails))
+                .success(function (response) {
+                    deferred.resolve({data: response});
+                }).error(function (data, status) {
+                deferred.reject({message: data, status: status});
+            });
+
+            return deferred.promise;
+        }
+
+        this.deactivateApplicationEnv = function(request) {
+            var deferred = $q.defer();
+
+            $http.post(COMPONENT.OPERATIONAL_ENVIRONMENT_DEACTIVATE + request.envId, JSON.stringify({}))
+                .success(function (response) {
+                    deferred.resolve({data: response});
+                }).error(function (data, status) {
+                    deferred.reject({message: data, status: status});
+            });
+
+            return deferred.promise;
+        };
+
+        this.activateApplicationEnv = function(request) {
+            var deferred = $q.defer();
+
+            $http.post(COMPONENT.OPERATIONAL_ENVIRONMENT_ACTIVATE + request.envId, JSON.stringify({
+                    "relatedInstanceId": request.relatedInstanceId
+                    , "relatedInstanceName": request.relatedInstanceName
+                    , "workloadContext": request.workloadContext
+                    , "manifest": request.manifest
+                }))
+                .success(function (response) {
+                    deferred.resolve({data: response});
+                }).error(function (response, status) {
+                    UtilityService.runHttpErrorHandler({data:response, status:status});
+                });
+            return deferred.promise;
+        };
+
+        this.getRequestStatus = function(requestId, successCallback) {
+            $http.get(COMPONENT.OPERATIONAL_ENVIRONMENT_STATUS + requestId)
+                .success(function(response) {
+                    successCallback({data: response});
+                } )
+                .catch(UtilityService.runHttpErrorHandler);
+        };
+    }
+
+
+})();
+
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/services/utilityService.js b/vid-app-common/src/main/webapp/app/vid/scripts/services/utilityService.js
index 4e4d123..8577e99 100755
--- a/vid-app-common/src/main/webapp/app/vid/scripts/services/utilityService.js
+++ b/vid-app-common/src/main/webapp/app/vid/scripts/services/utilityService.js
@@ -67,31 +67,31 @@
 
     var _this = this;
     var convertModel = function (serviceModel) {
-		
-		var isNewFlow = false;
-		
-		for (var networkCustomizationName in serviceModel.networks) {
-			var networkModel = serviceModel.networks[networkCustomizationName];
-			if ( networkModel.customizationUuid != null ) {
-				isNewFlow = true;
-				break;
-			}
-		}
-		if ( !isNewFlow ) {
-			for (var vnfCustomizationName in serviceModel.vnfs) {
-				var vnfModel = serviceModel.vnfs[vnfCustomizationName];
-				if ( vnfModel.customizationUuid != null ) {
-					isNewFlow = true;
-					break;
-				}
-			}
-		}
-		if ( isNewFlow ) {
-			return (convertNewModel (serviceModel) );
-		}
-		else {
-			return (convertOldModel (serviceModel) );
-		}
+
+        var isNewFlow = false;
+
+        for (var networkCustomizationName in serviceModel.networks) {
+            var networkModel = serviceModel.networks[networkCustomizationName];
+            if ( networkModel.customizationUuid != null ) {
+                isNewFlow = true;
+                break;
+            }
+        }
+        if ( !isNewFlow ) {
+            for (var vnfCustomizationName in serviceModel.vnfs) {
+                var vnfModel = serviceModel.vnfs[vnfCustomizationName];
+                if ( vnfModel.customizationUuid != null ) {
+                    isNewFlow = true;
+                    break;
+                }
+            }
+        }
+        if ( isNewFlow ) {
+            return (convertNewModel (serviceModel) );
+        }
+        else {
+            return (convertOldModel (serviceModel) );
+        }
     };
     var convertNewModel = function (serviceModel ) {
     	var completeResources = new Array();
@@ -100,6 +100,8 @@
 				"service": serviceModel.service,
 				"networks": {},
 				"vnfs": {},
+				"pnfs": serviceModel.pnfs,
+				"serviceProxies": serviceModel.serviceProxies,
 				"completeDisplayInputs": {},
 				"isNewFlow": true
 			};
@@ -164,9 +166,18 @@
 				
 			}
 		}
-		
-		for (var vnfCustomizationName in serviceModel.vnfs) {
-			var vnfModel = serviceModel.vnfs[vnfCustomizationName];
+
+        _.forEach(serviceModel.configurations, function(element, key) {
+            element.isConfig = true;
+        });
+        _.forEach(serviceModel.pnfs, function(element, key) {
+        	element.isPnf= true;
+        	element.modelCustomizationName= key;
+        });
+        var mergedVnfs = Object.assign(serviceModel.vnfs, serviceModel.configurations, serviceModel.pnfs);
+
+		for (var vnfCustomizationName in mergedVnfs) {
+			var vnfModel = mergedVnfs[vnfCustomizationName];
 			var vnfCustomizationUuid = vnfModel.customizationUuid;
 			convertedAsdcModel.vnfs[vnfModel.customizationUuid] = {
 					"uuid": vnfModel.uuid,
@@ -183,8 +194,13 @@
 					"displayInputs": {},
 					"properties": {},
 					"nfRole": "",
-					"nfType": ""
-			}
+					"nfType": "",
+					"sourceNodes": vnfModel.sourceNodes,
+					"collectorNodes": vnfModel.collectorNodes,
+	                "isConfigurationByPolicy": vnfModel.configurationByPolicy ? vnfModel.configurationByPolicy : false,
+                	"isConfig": vnfModel.isConfig ? vnfModel.isConfig : false,
+                	"isPnf": vnfModel.isPnf ? vnfModel.isPnf : false
+			};
 			
 			resource = {
 					"name": vnfModel.modelCustomizationName,
@@ -278,11 +294,11 @@
 		convertedAsdcModel.completeDisplayInputs = completeDisplayInputs;
 		// Need to collect all the model customization names (node template tag) and descriptions
 		DataService.setResources (completeResources);
-		
-		console.log ("convertedAsdcModel: "); console.log (JSON.stringify ( convertedAsdcModel, null, 4 ));
+
+        $log.debug ("convertedAsdcModel: ", convertedAsdcModel);
 		return (convertedAsdcModel);
     };
-    
+
     var convertOldModel = function (serviceModel ) {
     	
 		var resource = {};
@@ -290,6 +306,8 @@
 				"service": serviceModel.service,
 				"networks": {},
 				"vnfs": {},
+            	"pnfs": serviceModel.pnfs,
+            	"serviceProxies": serviceModel.serviceProxies,
 				"completeDisplayInputs": {},
 				"isNewFlow": false
 			};
@@ -356,9 +374,18 @@
 				convertedAsdcModel.networks[networkModel.uuid].displayInputs=networkModelDisplayInputs;
 			}
 		}
-		
-		for (var vnfCustomizationName in serviceModel.vnfs) {
-			var vnfModel = serviceModel.vnfs[vnfCustomizationName];
+
+        _.forEach(serviceModel.configurations, function(element, key) {
+            element.isConfig = true;
+        });
+        _.forEach(serviceModel.pnfs, function(element, key) {
+            element.isPnf= true;
+            element.modelCustomizationName= key;
+        });
+        var mergedVnfs = Object.assign(serviceModel.vnfs, serviceModel.configurations, serviceModel.pnfs);
+
+		for (var vnfCustomizationName in mergedVnfs) {
+			var vnfModel = mergedVnfs[vnfCustomizationName];
 			convertedAsdcModel.vnfs[vnfModel.uuid] = {
 					"uuid": vnfModel.uuid,
 					"invariantUuid": vnfModel.invariantUuid,
@@ -371,8 +398,13 @@
 					"vfModules": {},
 					"volumeGroups": {},
 					"commands": {},
-					"displayInputs": {}
-			}
+					"displayInputs": {},
+					"sourceNodes": vnfModel.sourceNodes,
+					"collectorNodes": vnfModel.collectorNodes,
+					"isConfigurationByPolicy": vnfModel.configurationByPolicy ? vnfModel.configurationByPolicy : false,
+					"isConfig": vnfModel.isConfig ? vnfModel.isConfig : false,
+                	"isPnf": vnfModel.isPnf ? vnfModel.isPnf : false
+			};
 			resource = {
 					"name": vnfModel.modelCustomizationName,
 					"description": vnfModel.description
@@ -441,203 +473,203 @@
 		convertedAsdcModel.completeDisplayInputs = completeDisplayInputs;
 		// Need to collect all the model customization names (node template tag) and descriptions
 		DataService.setResources (completeResources);
-		console.log ("convertedAsdcModel: "); console.log (JSON.stringify ( convertedAsdcModel, null, 4 ));
+		$log.debug ("convertedAsdcModel: ", convertedAsdcModel);
 		return (convertedAsdcModel);
     };
-    
+
     function hasContents(object) {
-	if (object === undefined || object === null || object === "") {
-	    return false;
-	}
-	return true;
+        if (object === undefined || object === null || object === "") {
+            return false;
+        }
+        return true;
     };
     function isObjectEmpty(o) {
-		var len = 0;
-		if (hasContents(o)){
-			var keys = Object.keys(o);
-			len = keys.length;
-			if ( len == 0 ) {
-				return true;
-			}
-			else {
-				return false;
-			}
-		}
-		else {
-			return true;
-		}
+        var len = 0;
+        if (hasContents(o)){
+            var keys = Object.keys(o);
+            len = keys.length;
+            if ( len == 0 ) {
+                return true;
+            }
+            else {
+                return false;
+            }
+        }
+        else {
+            return true;
+        }
     };
     function padZero(number) {
-	if (number < 10) {
-	    return "0" + number;
-	} else {
-	    return "" + number;
-	}
+        if (number < 10) {
+            return "0" + number;
+        } else {
+            return "" + number;
+        }
     };
 
     var httpErrorHandler = function(response, status) {
-	$log.warn("UtilityService:httpErrorHandler: response:");
-	$log.warn(response);
-	$log.warn("UtilityService:httpErrorHandler: status:");
-	$log.warn(status);
-	if (angular.isFunction(_this.httpErrorHandler)) {
-	    _this.httpErrorHandler(response, status);
-	}
+        $log.warn("UtilityService:httpErrorHandler: response:");
+        $log.warn(response);
+        $log.warn("UtilityService:httpErrorHandler: status:");
+        $log.warn(status);
+        if (angular.isFunction(_this.httpErrorHandler)) {
+            _this.httpErrorHandler(response, status);
+        }
     };
 
     var startNextAsyncOperation = function() {
-	if (_this.asyncOperations.count < _this.asyncOperations.operationList.length) {
-	    _this.asyncOperations.operationList[_this.asyncOperations.count++]
-		    ();
-	} else {
-	    if (angular.isFunction(_this.asyncOperations.callbackFunction)) {
-		_this.asyncOperations.callbackFunction();
-	    }
-	}
+        if (_this.asyncOperations.count < _this.asyncOperations.operationList.length) {
+            _this.asyncOperations.operationList[_this.asyncOperations.count++]
+            ();
+        } else {
+            if (angular.isFunction(_this.asyncOperations.callbackFunction)) {
+                _this.asyncOperations.callbackFunction();
+            }
+        }
     };
 
     return {
-	setProperties : function(properties) {
-	    _this.properties = properties;
-	},
-	getProperties : function() {
-	    return _this.properties;
-	},
-	hasContents : hasContents,
-	checkUndefined : function(name, value) {
-	    if (value === undefined) {
-		throw {
-		    type : "undefinedObject",
-		    message : "undefined object: \"" + name + "\""
-		};
-	    }
-	    return value;
-	},
-	jsonConcat : function (o1, o2) {
-		 for (var key in o2) {
-		  o1[key] = o2[key];
-		 }
-		 return o1;
-   },
-	getCurrentTime : function() {
-	    var time = new Date();
-	    return padZero(time.getMonth() + 1) + "/"
-		    + padZero(time.getDate()) + "/"
-		    + (time.getFullYear() - 2000) + " "
-		    + padZero(time.getHours()) + ":"
-		    + padZero(time.getMinutes()) + ":"
-		    + padZero(time.getSeconds())
-	},
-	getHttpStatusText : function(statusCode) {
-	    var statusMap = {
-		"200" : "OK",
-		"201" : "Created",
-		"202" : "Accepted",
-		"400" : "Bad Request",
-		"401" : "Unauthorized",
-		"404" : "Not Found",
-		"405" : "Method Not Allowed",
-		"409" : "Locked",
-		"500" : "Internal Server Error",
-		"503" : "Service Unavailable",
-		"504" : "Gateway Timeout"
-	    }
+        setProperties : function(properties) {
+            _this.properties = properties;
+        },
+        getProperties : function() {
+            return _this.properties;
+        },
+        hasContents : hasContents,
+        checkUndefined : function(name, value) {
+            if (value === undefined) {
+                throw {
+                    type : "undefinedObject",
+                    message : "undefined object: \"" + name + "\""
+                };
+            }
+            return value;
+        },
+        jsonConcat : function (o1, o2) {
+            for (var key in o2) {
+                o1[key] = o2[key];
+            }
+            return o1;
+        },
+        getCurrentTime : function() {
+            var time = new Date();
+            return padZero(time.getMonth() + 1) + "/"
+                + padZero(time.getDate()) + "/"
+                + (time.getFullYear() - 2000) + " "
+                + padZero(time.getHours()) + ":"
+                + padZero(time.getMinutes()) + ":"
+                + padZero(time.getSeconds())
+        },
+        getHttpStatusText : function(statusCode) {
+            var statusMap = {
+                "200" : "OK",
+                "201" : "Created",
+                "202" : "Accepted",
+                "400" : "Bad Request",
+                "401" : "Unauthorized",
+                "404" : "Not Found",
+                "405" : "Method Not Allowed",
+                "409" : "Locked",
+                "500" : "Internal Server Error",
+                "503" : "Service Unavailable",
+                "504" : "Gateway Timeout"
+            }
 
-	    if (status === undefined) {
-		return "Undefined";
-	    }
+            if (status === undefined) {
+                return "Undefined";
+            }
 
-	    var statusText = statusMap[statusCode];
-	    if (statusText === undefined) {
-		statusText = "Unknown";
-	    }
+            var statusText = statusMap[statusCode];
+            if (statusText === undefined) {
+                statusText = "Unknown";
+            }
 
-	    return statusText + " (" + statusCode + ")";
-	},
-	getHttpErrorMessage : function(response) {
-	    var data = response.data;
-	    if (response.status === 500 && hasContents(data.exception)) {
-		var summary = "exception: " + data.exception;
-		if (hasContents(data.message)) {
-		    summary += " message: " + data.message;
-		}
-		return summary;
-	    }
-	    if (response.status === 0 && response.statusText === "") {
-		/*
-		 * This logic is somewhat "fuzzy". Potential (brainstorming)
-		 * enhancements if users find the message unreliable include:
-		 * 
-		 * A) SERVER TIMEOUT: perhaps a newer version of Angular can
-		 * reliably determine timeouts.
-		 * 
-		 * B) SERVER TIMEOUT: recording start / end times and using that
-		 * to determine if timeout occured
-		 * 
-		 * C) SESSION TIMEOUT "Potentially" examine cookies, although
-		 * that may not be feasible if cookies are set to "httponly".
-		 */
-		if (data === null) {
-		    //return "possible server timeout";
-			return "VID has timed out waiting for a response. To see status, close this popup and the screen will be refreshed automatically";
-		}
-		if (data === "") {
-		    return "Possible reasons include a session timeout or a server issue. "
-			    + "A session timeout might be resolved by refreshing the screen and re-logging in";
-		}
-	    }
-	    var summary = "";
-	    if (response.status !== undefined && response.status > 0) {
-		summary = "status: " + response.status;
-	    }
-	    if (hasContents(response.statusText)) {
-		if (summary !== "") {
-		    summary += " ";
-		}
-		summary += "message: " + response.statusText;
-	    }
-	    return summary;
-	},
-	setHttpErrorHandler : function(httpErrorHandler) {
-	    _this.httpErrorHandler = httpErrorHandler;
-	},
-	runHttpErrorHandler : function(response, status) {
-	    httpErrorHandler(response, status);
-	},
-	startAsyncOperations : function(operationList, callbackFunction) {
-	    for (var i = 0; i < operationList.length; i++) {
-		if (!angular.isFunction(operationList[i])) {
-		    throw "UtilityService:startAsyncOperations: invalid function: index: "
-			    + i;
-		}
-	    }
-	    _this.asyncOperations = {
-		operationList : operationList,
-		callbackFunction : callbackFunction,
-		count : 0
-	    };
-	    startNextAsyncOperation();
-	},
-	startNextAsyncOperation : startNextAsyncOperation,
-	stopAsyncOperations : function() {
-	    _this.asyncOperations.count = _this.asyncOperations.operationList.length;
-	},
-	isObjectEmpty : isObjectEmpty,
-	convertModel : convertModel,
-	convertNewModel : convertNewModel,
-	convertOldModel : convertOldModel,
-	arrayContains : function (a, obj) {
-	    var i = a.length;
-	    if ( i > 0 ) {
-		    while (i--) {
-		       if (a[i] === obj) {
-		           return true;
-		       }
-		    }
-	    }
-	    return false;
-	}
-	}
+            return statusText + " (" + statusCode + ")";
+        },
+        getHttpErrorMessage : function(response) {
+            var data = response.data;
+            if ((response.status >= 400 && response.status < 600) && hasContents(data.exception)) {
+                var summary = "exception: " + data.exception;
+                if (hasContents(data.message)) {
+                    summary += " message: " + data.message;
+                }
+                return summary;
+            }
+            if (response.status === 0 && response.statusText === "") {
+				/*
+				 * This logic is somewhat "fuzzy". Potential (brainstorming)
+				 * enhancements if users find the message unreliable include:
+				 *
+				 * A) SERVER TIMEOUT: perhaps a newer version of Angular can
+				 * reliably determine timeouts.
+				 *
+				 * B) SERVER TIMEOUT: recording start / end times and using that
+				 * to determine if timeout occured
+				 *
+				 * C) SESSION TIMEOUT "Potentially" examine cookies, although
+				 * that may not be feasible if cookies are set to "httponly".
+				 */
+                if (data === null) {
+                    //return "possible server timeout";
+                    return "VID has timed out waiting for a response. To see status, close this popup and the screen will be refreshed automatically";
+                }
+                if (data === "") {
+                    return "Possible reasons include a session timeout or a server issue. "
+                        + "A session timeout might be resolved by refreshing the screen and re-logging in";
+                }
+            }
+            var summary = "";
+            if (response.status !== undefined && response.status > 0) {
+                summary = "status: " + response.status;
+            }
+            if (hasContents(response.statusText)) {
+                if (summary !== "") {
+                    summary += " ";
+                }
+                summary += "message: " + response.statusText;
+            }
+            return summary;
+        },
+        setHttpErrorHandler : function(httpErrorHandler) {
+            _this.httpErrorHandler = httpErrorHandler;
+        },
+        runHttpErrorHandler : function(response, status) {
+            httpErrorHandler(response, status);
+        },
+        startAsyncOperations : function(operationList, callbackFunction) {
+            for (var i = 0; i < operationList.length; i++) {
+                if (!angular.isFunction(operationList[i])) {
+                    throw "UtilityService:startAsyncOperations: invalid function: index: "
+                    + i;
+                }
+            }
+            _this.asyncOperations = {
+                operationList : operationList,
+                callbackFunction : callbackFunction,
+                count : 0
+            };
+            startNextAsyncOperation();
+        },
+        startNextAsyncOperation : startNextAsyncOperation,
+        stopAsyncOperations : function() {
+            _this.asyncOperations.count = _this.asyncOperations.operationList.length;
+        },
+        isObjectEmpty : isObjectEmpty,
+        convertModel : convertModel,
+        convertNewModel : convertNewModel,
+        convertOldModel : convertOldModel,
+        arrayContains : function (a, obj) {
+            var i = a.length;
+            if ( i > 0 ) {
+                while (i--) {
+                    if (a[i] === obj) {
+                        return true;
+                    }
+                }
+            }
+            return false;
+        }
+    }
 }
 
 //app.factory("UtilityService", UtilityService);
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/view-models/aaiGetSubs.htm b/vid-app-common/src/main/webapp/app/vid/scripts/view-models/aaiGetSubs.htm
index c5c5cca..233bab1 100755
--- a/vid-app-common/src/main/webapp/app/vid/scripts/view-models/aaiGetSubs.htm
+++ b/vid-app-common/src/main/webapp/app/vid/scripts/view-models/aaiGetSubs.htm
@@ -39,7 +39,8 @@
         <br>
         Please search by the Subscriber name or enter Service Instance Id or Service Instance Name below:&nbsp;<br><br>
 
-        <table>
+        <table ng-init="loadOwningEntity()">
+
             <tr>
                 <td style="width:30%">
                     <div class="fn-ebz-container">
@@ -51,7 +52,7 @@
                         <!--<select name="selectedCustomer" ng-model="selectedCustomer">-->
                         <!--<option ng-repeat="item in customerList" value="{{item.globalCustomerId}}" ng-disabled="getPermitted(item)">{{item.subscriberName}}</option>-->
                         <!--</select>-->
-                        <select ng-model="selectedCustomer"
+                        <select ng-model="selectedCustomer" id="selectSubscriber"
                                 ng-options="item.globalCustomerId as item.subscriberName for item in customerList | orderBy:'subscriberName'">
                             <option value="">Select a subscriber</option>
                         </select>
@@ -60,8 +61,9 @@
                             class="glyphicon glyphicon-refresh"></span></a>
                     </div>
                 </td>
-
             </tr>
+
+
             <tr>
                 <td style="width:30%">
                     <div class="fn-ebz-container">
@@ -72,8 +74,8 @@
                     </div>
                 </td>
                 <td style="width:60%">
-                    <div class="fn-ebz-container">
-                        <input type="text" style="width: 350px;" name="selectedServiceInstance"
+                    <div class="fn-ebz-container" style="width: 100%;">
+                        <input type="text" name="selectedServiceInstance"
                                ng-model="selectedServiceInstance"
                                data-tests-id="searchForExistingInstancesText"
                                restrict-input="{type : selectedserviceinstancetype}"/>
@@ -81,12 +83,51 @@
                 </td>
 
             </tr>
+
+            <tr>
+                <td style="width:30%">
+                    <div class="fn-ebz-container">
+                        <label class="fn-ebz-text-label">Owning entity Name:</label>
+                    </div>
+                </td>
+                <td style="width:30%" nowrap>
+                    <div class="fn-ebz-container" style="width: 100%;">
+                        <!--<select name="selectedCustomer" ng-model="selectedCustomer">-->
+                        <!--<option ng-repeat="item in customerList" value="{{item.globalCustomerId}}" ng-disabled="getPermitted(item)">{{item.subscriberName}}</option>-->
+                        <!--</select>-->
+                        <multiselect id="selectOwningEntity" ng-model="selectedEntity"
+                                     options="owningEntities"
+                                     display-prop="name" id-prop="id">
+                        </multiselect>
+                    </div>
+                </td>
+            </tr>
+
+            <tr>
+                <td style="width:30%">
+                    <div class="fn-ebz-container">
+                        <label class="fn-ebz-text-label">Project Name:</label>
+                    </div>
+                </td>
+                <td style="width:30%" nowrap>
+                    <div class="fn-ebz-container" style="width: 100%;">
+                        <!--<select name="selectedCustomer" ng-model="selectedCustomer">-->
+                        <!--<option ng-repeat="item in customerList" value="{{item.globalCustomerId}}" ng-disabled="getPermitted(item)">{{item.subscriberName}}</option>-->
+                        <!--</select>-->
+                        <multiselect id="selectProject" ng-model="selectedProject"
+                                     options="projects"
+                                     display-prop="name" id-prop="id">
+                        </multiselect>
+                    </div>
+                </td>
+            </tr>
+
             <tr>
                 <td>
                 <td style="width:30%">
                     <div>
                         <button type="submit" class="btn btn-primary" size="small"
-                                ng-click="getSubscriberDet(selectedCustomer,selectedserviceinstancetype,selectedServiceInstance);">
+                                ng-click="getServiceInstancesSearchResults(selectedCustomer,selectedserviceinstancetype,selectedServiceInstance, selectedProject, selectedEntity);">
                             Submit
                         </button>
                         </a>
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/view-models/aaiGetSubscriberList.htm b/vid-app-common/src/main/webapp/app/vid/scripts/view-models/aaiGetSubscriberList.htm
index 16357dd..6198cb4 100755
--- a/vid-app-common/src/main/webapp/app/vid/scripts/view-models/aaiGetSubscriberList.htm
+++ b/vid-app-common/src/main/webapp/app/vid/scripts/view-models/aaiGetSubscriberList.htm
@@ -18,52 +18,66 @@
   ============LICENSE_END=========================================================
   -->
 
-<link rel="stylesheet" type="text/css" href="app/vid/styles/aaiGetSubs.css" />
-<link rel="stylesheet" type="text/css" href="app/vid/styles/aaiSubDetails.css" />
+<link rel="stylesheet" type="text/css" href="app/vid/styles/aaiGetSubs.css"/>
+<link rel="stylesheet" type="text/css" href="app/vid/styles/aaiSubDetails.css"/>
 <script src="app/vid/scripts/controller/aaiSubscriberController.js"></script>
 <div ng-controller="aaiSubscriberController" ng-cloak>
 
-	<div>
-		<div class="statusLine" ng-class="{true:'aaiVisible', false:'aaiHidden'}[isSpinnerVisible]">
-			<img src="app/vid/images/spinner.gif"></img>
-			<label>Status:</label><span class="status">{{status}}</span>
-		</div>
-		
-		<div ng-if="errorMsg != null"><font color='red'>{{errorMsg}}<pre>{{errorDetails | json}}</pre></font></div>
-		
-		 <h2 class="heading2"><center>Create New Service Instance</center></h2>
-		 
-		<table> 
-			<tr>
-				<td >
-				<div class="fn-ebz-container">	
-					<label  class="fn-ebz-text-label">Subscriber Name:</label>
-				</div>
-				</td>
-				<td style="width:80%" nowrap>
-					<div class="fn-ebz-container" ng-init="autoGetSubs();">
-						<select ng-model="selectedCustomer" data-tests-id="subscriberName">
-							<option value="">Select Subscriber Name</option>
-							<option ng-repeat="item in customerList | orderBy:'subscriberName'" ng-value="item.globalCustomerId" ng-disabled="!item.isPermitted" class="subscriberNameOption">{{item.subscriberName}}</option>
-						</select>
-					  &nbsp;&nbsp;<a class="btn btn-primary" ng-click="refreshSubs();" ><span class="glyphicon glyphicon-refresh"></span></a>
-					</div>
-				</td>
-	 		
-			</tr>
-    		<tr>
-				<td >
-				</td>
-				<td style="width:80%">
-					<div >	
-						<button type="submit" class="btn btn-primary"  size="small" ng-click="getServiceTypes(selectedCustomer);">Submit</button></a>
-						&nbsp;&nbsp;<button type="submit" class="btn btn-primary" size="small" ng-click="cancelCreateSI()">Cancel</button></a>
-					</div>
-				</td>
-			</tr>
-		</table>	
-		
-	
-	</div>
+    <div>
+        <div class="statusLine" ng-class="{true:'aaiVisible', false:'aaiHidden'}[isSpinnerVisible]">
+            <img src="app/vid/images/spinner.gif"></img>
+            <label>Status:</label><span class="status">{{status}}</span>
+        </div>
+
+        <div ng-if="errorMsg != null"><font color='red'>{{errorMsg}}
+            <pre>{{errorDetails | json}}</pre>
+        </font></div>
+
+        <h2 class="heading2">
+            <center>Create New Service Instance</center>
+        </h2>
+
+        <table>
+            <tr>
+                <td>
+                    <div class="fn-ebz-container">
+                        <label class="fn-ebz-text-label">Subscriber Name:</label>
+                    </div>
+                </td>
+                <td style="width:80%" nowrap>
+                    <div class="fn-ebz-container" ng-init="autoGetSubs();">
+                        <select ng-model="selectedCustomer" data-tests-id="subscriberName">
+                            <option value="">Select Subscriber Name</option>
+                            <option ng-repeat="item in customerList | orderBy:'subscriberName'"
+                                    ng-value="item.globalCustomerId" ng-disabled="!item.isPermitted"
+                                    class="subscriberNameOption">{{item.subscriberName}}
+                            </option>
+                        </select>
+                        &nbsp;&nbsp;<a class="btn btn-primary" ng-click="refreshSubs();"><span
+                            class="glyphicon glyphicon-refresh"></span></a>
+                    </div>
+                </td>
+
+            </tr>
+            <tr>
+                <td>
+                </td>
+                <td style="width:80%">
+                    <div>
+                        <button type="submit" class="btn btn-primary" size="small"
+                                ng-click="getServiceTypes(selectedCustomer);">Submit
+                        </button>
+                        </a>
+                        &nbsp;&nbsp;<button type="submit" class="btn btn-primary" size="small"
+                                            ng-click="cancelCreateSI()">Cancel
+                    </button>
+                        </a>
+                    </div>
+                </td>
+            </tr>
+        </table>
+
+
+    </div>
 
 </div>
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/view-models/aaiServiceTypes.htm b/vid-app-common/src/main/webapp/app/vid/scripts/view-models/aaiServiceTypes.htm
index 06a53c3..dc9f0a4 100755
--- a/vid-app-common/src/main/webapp/app/vid/scripts/view-models/aaiServiceTypes.htm
+++ b/vid-app-common/src/main/webapp/app/vid/scripts/view-models/aaiServiceTypes.htm
@@ -31,7 +31,7 @@
 		<div ng-if="errorMsg != null"><font color='red'>{{errorMsg}}<pre>{{errorDetails | json}}</pre></font></div>
 		<h2 class="heading2"><center>Create New Service Instance</center></h2>
 		
-		<table> 
+		<table class="create-instance-service ">
 		
 		<tr>
 				<td >
@@ -69,7 +69,7 @@
 				</td>
 				<td style="width:80%">
 					<div >	
-						<button type="submit" class="btn btn-primary"  size="small" ng-click="getAaiServiceModels(selectedServicetype,createSubscriberName);">Submit</button></a>
+						<button type="submit" class="btn btn-primary"  size="small" ng-click="getAaiServiceModels(selectedServicetype,createSubscriberName);" ng-disabled="!selectedServicetype" ng-class="{'button--inactive': !selectedServicetype}">Submit</button></a>
 						&nbsp;&nbsp;<button type="submit" class="btn btn-primary" size="small" ng-click="cancelCreateSIType()">Cancel</button></a>
 					</div>
 				</td>
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/view-models/aaiSubDetails.htm b/vid-app-common/src/main/webapp/app/vid/scripts/view-models/aaiSubDetails.htm
index 3471fcb..686e33b 100755
--- a/vid-app-common/src/main/webapp/app/vid/scripts/view-models/aaiSubDetails.htm
+++ b/vid-app-common/src/main/webapp/app/vid/scripts/view-models/aaiSubDetails.htm
@@ -27,13 +27,13 @@
 				<label>Status:</label><span class="status">{{status}}</span>
 			</div>
 
-			<div ng-if="errorMsg != null"><font color='red'>{{errorMsg}}<pre>{{errorDetails | json}}</pre></font></div>
+			<div data-tests-id="subDetailsErrMsg" ng-if="errorMsg != null"><font color='red'>{{errorMsg}}<pre>{{errorDetails | json}}</pre></font></div>
 	
-			 <h1 class="heading1"><center>Subscriber Details for {{selectedSubscriber}} ({{selectedSubscriberName}})</center></h1>
+			 <h1 class="heading1"><center>Subscriber Details for {{selectedSubscriberId}} ({{selectedSubscriberName}})</center></h1>
 	     		<br>
 		<div class="fn-ebz-container">
 		         Filter:
-		          <input class="fn-ebz-text" type="text" ng-model="searchString" size="20" style="width: 250px;">
+		          <input class="fn-ebz-text" type="text" ng-model="searchString" size="20" style="width: 250px;" data-tests-id="filter-subscriber-details">
 	    </div>
 			<div ng-init="getSubDetails();">
 				
@@ -54,13 +54,13 @@
 							<tr>
 								 <td att-table-body>
 									<div>
-										<a alt="View/Edit" ng-click="getAsdcModel(disData);" data-tests-id="{{'view/edit-test-data-id-' + disData['serviceInstanceId']}}" ng-bind="disData.isPermitted ? 'View/Edit' : 'View'"></a>
+										<a alt="View/Edit" ng-click="onViewEditClick(disData);" data-tests-id="{{'view/edit-test-data-id-' + disData['serviceInstanceId']}}" ng-bind="disData.isPermitted ? 'View/Edit' : 'View'"></a>
 									</div>
 								</td>
 								<td att-table-body ng-bind="disData['globalCustomerId']"></td>
-								<td att-table-body ng-bind="disData['subscriberName']"></td>
+								<td att-table-body ng-bind="disData['subscriberName']" data-tests-id="{{'subscriber-name-test-data-id-' + $index}}"></td>
 								<td att-table-body ng-bind="disData['serviceType']"></td>
-								<td att-table-body ng-bind="disData['serviceInstanceName']"></td>
+								<td att-table-body ng-bind="disData['serviceInstanceName']" data-tests-id="{{'service-name-test-data-id-' + $index}}"></td>
 								<td att-table-body data-tests-id="{{'instance-id-for-name-' + disData['serviceInstanceName']}}" ng-bind="disData['serviceInstanceId']"></td>
 							</tr>
 						</tbody>
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/view-models/aaiSubViewEdit.htm b/vid-app-common/src/main/webapp/app/vid/scripts/view-models/aaiSubViewEdit.htm
index 40bd148..31621cf 100755
--- a/vid-app-common/src/main/webapp/app/vid/scripts/view-models/aaiSubViewEdit.htm
+++ b/vid-app-common/src/main/webapp/app/vid/scripts/view-models/aaiSubViewEdit.htm
@@ -23,7 +23,7 @@
     <div popup-window class="popupContents" ngx-show="{{popup.isVisible}}"
          ng-cloak>
         <div ng-include="'app/vid/scripts/view-models/creationDialog.htm'"></div>
-        <div ng-include="'app/vid/scripts/view-models/deletionDialog.htm'"></div>
+        <div ng-include="'app/vid/scripts/view-models/deleteResumeDialog.htm'"></div>
         <div ng-include="'app/vid/scripts/view-models/detailsDialog.htm'"></div>
     </div>
 
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/view-models/addNetworkNode.htm b/vid-app-common/src/main/webapp/app/vid/scripts/view-models/addNetworkNode.htm
new file mode 100644
index 0000000..6983477
--- /dev/null
+++ b/vid-app-common/src/main/webapp/app/vid/scripts/view-models/addNetworkNode.htm
@@ -0,0 +1,62 @@
+<!--
+============LICENSE_START=======================================================
+VID
+================================================================================
+Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+================================================================================
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+============LICENSE_END=========================================================
+-->
+<link rel="stylesheet" type="text/css" href="app/vid/styles/networkNode.css"/>
+
+<div class="network-wrapper-config">
+    <div class="head">
+        <div class="title">Config {{modelName}}</div>
+        <div class="btn-wrapper">
+            <button class="cancel-btn grey" data-tests-id="cancelButton" data-ng-click="cancel()">Cancel</button>
+            <button class="next-btn blue" data-tests-id="nextButton" data-ng-disabled="networkNodeForm.$invalid" data-ng-click="next()">Next</button>
+        </div>
+    </div>
+
+    <div class="content-wrapper">
+        <div class="content">
+            <form name="networkNodeForm" class="form-wrapper">
+                <div class="instance-field {{field.id}}" ng-repeat="(key, field) in nodeTemplateFields">
+                    <input id="{{field.id}}" data-tests-id="suppressRollbackInput" ng-if="key === 'suppressRollback'" type="checkbox" ng-model="field.value"/>
+                    <label for="{{field.id}}"class="title" ng-if="key !== 'lineOfBusiness' && key !== 'platform'">
+                        {{field.name}}
+                    </label>
+                    <div class="" ng-if="key === 'instanceName'">
+                        <input data-tests-id="instanceNameInput" name="{{field.id}}" id="{{field.id}}" type="text" required ng-model="field.value" ng-pattern="regexInstanceName">
+                        <span class="error" data-ng-show="!networkNodeForm.instanceName.$error.required && networkNodeForm.instanceName.$dirty && networkNodeForm.instanceName.$invalid">{{errorMsg}}</span>
+                    </div>
+                    <select id="{{field.id}}" data-tests-id="regionDropDown" ng-if="key === 'lcpRegion'" required ng-model="field.value"
+                            placeholder="Choose {{field.name}}"
+                            data-ng-change="setTenant(field)">
+                        <option value="" selected>LCP region</option>
+                        <option data-ng-disabled="!option.isPermitted" ng-repeat="option in field.optionList"
+                                value="{{option.id}}" data-tests-id="{{'region-' + option.id}}">{{option.id}}</option>
+                    </select>
+                    <select id="{{field.id}}" data-tests-id="tenantDropDown" ng-if="key === 'tenant'" required ng-model="field.value"
+                            data-ng-options="option.tenantName for option in field.optionList" placeholder="Choose {{field.name}}"
+                            data-ng-disabled="!field.optionList || !field.optionList.length">
+                        <option value="" selected>Tenant name</option>
+                    </select>
+                </div>
+            </form>
+        </div>
+        <div class="sidebar-right">
+            <service-metadata title-txt="info" service-metadata-fields="serviceMetadataFields"></service-metadata>
+        </div>
+    </div>
+</div>
\ No newline at end of file
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/view-models/change-management.html b/vid-app-common/src/main/webapp/app/vid/scripts/view-models/change-management.html
index 0f42ec8..94a1790 100644
--- a/vid-app-common/src/main/webapp/app/vid/scripts/view-models/change-management.html
+++ b/vid-app-common/src/main/webapp/app/vid/scripts/view-models/change-management.html
@@ -13,63 +13,95 @@
 
         <input type="search" id="change-management-search" class="search-changes" ng-change="vm.searchChanges()" ng-model-options="{debounce: 300}" ng-model="vm.searchChangesTerm" placeholder="Type to search">
     </div>
+    <span class="refresh-cm">
+        Last updated at:
+        <span class="last-time-updated">{{ vm.lastTimeUpdated }}</span>
+        <i class="icon-sync" data-tests-id="refresh-cm" ng-click="vm.init()"></i>
+    </span>
     <div class="jobs-table">
         <div class="row">
             <div class="col-md-12">
                 <uib-tabset active="activeJustified" justified="true">
                     <uib-tab index="0" heading="Active" id="active-tab">
-                        <table class="table table-bordered" id="active-table">
-                            <thead class="thead-default">
-                                <tr>
-                                    <th class="col-md-5">VNF Name</th>
-                                    <th class="col-md-2">Type</th>
-                                    <th class="col-md-2">Flow</th>
-                                    <th class="col-md-2">Start time</th>
-                                    <th>Status</th>
-                                    <th></th>
-                                </tr>
-                            </thead>
-                            <tbody>
+                        <div class="table-wrapper">
+                        <table class="table table-bordered"  data-tests-id="active-table-cm" id="active-table">
+                            <thead class="thead-default" ng-click="collapseInProgress=!collapseInProgress">
                                 <tr class="table-headline-row">
-                                    <th>
+                                    <th >
+                                        <span ng-class="{'collapse-icon':!collapseInProgress,'expand-icon':collapseInProgress }"></span>
                                         <span id="in-progress-table-head">IN PROGRESS</span>
                                     </th>
                                     <th></th>
                                     <th></th>
                                     <th></th>
                                     <th></th>
-                                    <th></th>
                                 </tr>
-                                <tr ng-repeat="changeManagement in vm.changeManagements | changeManagementsByStatuses:{statuses: ['FAILED', 'INPROGRESS', 'PENDING']}">
+                                <tr ng-show="!collapseInProgress">
+                                    <th class="col-md-5">VNF Name</th>
+                                    <th class="col-md-2">Type</th>
+                                    <th class="col-md-2">Flow</th>
+                                    <th class="col-md-2">Start time</th>
+                                    <th>Status</th>
+                                </tr>
+                            </thead>
+                            <tbody ng-show="!collapseInProgress">
+
+                                <tr  data-tests-id="active-table-cm-row" ng-repeat="changeManagement in vm.changeManagements | changeManagementsByStatuses:{statuses: ['FAILED', 'IN_PROGRESS', 'PENDING']}">
                                     <th scope="row">{{changeManagement.instanceReferences.vnfInstanceName || 'No-Instance-Name'}}</th>
                                     <td>{{changeManagement.requestScope}}</td>
                                     <td>{{changeManagement.requestType}}</td>
                                     <td>{{changeManagement.startTime}}</td>
                                     <td class="centered" ng-if="changeManagement.requestStatus.requestState == 'FAILED'"><span class="icon-x" ng-click="vm.openFailedModal({details: changeManagement.requestStatus.statusMessage, job: changeManagement})"></span></td>
-                                    <td class="centered" ng-if="changeManagement.requestStatus.requestState == 'INPROGRESS'"><span class="icon-process" ng-click="vm.openInProgressModal({details: changeManagement.requestStatus.statusMessage, job: changeManagement})"></span></td>
+                                    <td class="centered" ng-if="changeManagement.requestStatus.requestState == 'IN_PROGRESS'"><span class="icon-process" ng-click="vm.openInProgressModal({details: changeManagement.requestStatus.statusMessage, job: changeManagement})"></span></td>
                                     <td class="centered" ng-if="changeManagement.requestStatus.requestState == 'PENDING'"><span class="icon-alert" ng-click="vm.openAlertModal({details: changeManagement.requestStatus.statusMessage, job: changeManagement})"></span></td>
-                                    <td class="centered"><span class="icon-view"></span></td>
-                                </tr>
-                                <tr class="table-headline-row">
-                                    <th>
-                                        <span id="pending-table-head">PENDING</span>
-                                    </th>
-                                    <th></th>
-                                    <th></th>
-                                    <th></th>
-                                    <th></th>
-                                    <th></th>
-                                </tr>
-                                <tr ng-repeat="changeManagement in vm.pendingChangeManagements">
-                                    <th scope="row">{{changeManagement.vnfName}}</th>
-                                    <td>{{changeManagement.scheduleRequest.scheduleName}}</td>
-                                    <td>{{changeManagement.workflow}}</td>
-                                    <td>{{changeManagement.startTime}}</td>
-                                    <td class="centered"><span class="icon-pending" ng-click="vm.openPendingModal({details: 'change management is pending in scheduler and waiting to be deployed'})"></span></td>
-                                    <td class="centered"><span class="icon-view"></span></td>
                                 </tr>
                             </tbody>
                         </table>
+                        </div>
+                        <div class="table-wrapper">
+                        <table class="table table-bordered"  data-tests-id="pending-table-cm" id="pending-table">
+                            <thead ng-click="collapsePending=!collapsePending">
+                            <tr class="table-headline-row">
+                                <th class="col-md-6">
+                                    <span ng-class="{'collapse-icon':!collapsePending,'expand-icon':collapsePending }"></span>
+                                    <span id="pending-table-head">PENDING</span>
+                                </th>
+
+                                <th></th>
+                                <th></th>
+                                <th></th>
+                                <th></th>
+                                <th></th>
+                                <th></th>
+                                <th></th>
+                            </tr>
+                            <tr class="thead-default" ng-show="!collapsePending">
+                                <th class="col-md-2">Schedule ID</th>
+                                <th class="col-md-2">CM ticket</th>
+                                <th class="col-md-1">VNF name</th>
+                                <th class="col-md-1">VNF status</th>
+                                <th class="col-md-2">Workflow</th>
+                                <th class="col-md-2">Start time</th>
+                                <th class="col-md-2">Schedule status</th>
+                                <th class="col-md-1">Status</th>
+                            </tr>
+                            </thead>
+                            <tbody ng-show="!collapsePending">
+
+                                <tr data-tests-id="pending-table-cm-row" ng-repeat="changeManagement in vm.pendingChangeManagements">
+                                    <th scope="row">{{changeManagement.scheduleRequest.scheduleId}}</th>
+                                    <td>{{changeManagement.aotsChangeId}}</td>
+                                    <td>{{changeManagement.vnfName}}</td>
+                                    <td>{{changeManagement.status}}</td>
+                                    <td>{{changeManagement.scheduleRequest.domainData[1].value}}</td>
+                                    <td>{{changeManagement.scheduleRequest.createDateTime }}</td><!--| date:"MM/dd/yyyy HH:mm:ss"-->
+                                    <td>{{changeManagement.scheduleRequest.status}}</td>
+                                    <td class="centered"><span class="cancel-action" ng-class="{'icon-pending':changeManagement.scheduleRequest.status!=='Deleted', 'icon-deleted': changeManagement.scheduleRequest.status=='Deleted'}"
+                                                                ng-click="vm.openPendingModal($event, changeManagement)"></span></td>
+                                </tr>
+                            </tbody>
+                        </table>
+                        </div>
                     </uib-tab>
                     <uib-tab index="1" heading="Finished" id="finished-tab">
                         <table class="table table-bordered" id="finished-table">
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/view-models/createInstanceServiceModels.htm b/vid-app-common/src/main/webapp/app/vid/scripts/view-models/createInstanceServiceModels.htm
index 0f69461..da249c2 100755
--- a/vid-app-common/src/main/webapp/app/vid/scripts/view-models/createInstanceServiceModels.htm
+++ b/vid-app-common/src/main/webapp/app/vid/scripts/view-models/createInstanceServiceModels.htm
@@ -19,6 +19,8 @@
   -->
 
 <link rel="stylesheet" type="text/css" href="app/vid/styles/serviceModels.css" />
+<link rel="stylesheet" type="text/css" href="app/vid/styles/buttons.css" />
+
 <div popup-window class="popupContents" ngx-show="{{popup.isTablePopUpVisible}}" ng-cloak>
 	<div ng-include="'app/vid/scripts/view-models/previousVersion.htm'"/>
 </div>
@@ -36,7 +38,7 @@
 	<br><br>
 	
 	
-	<table> 
+	<table class="create-instance-service ">
 		
 		<tr>
 				<td >
@@ -77,7 +79,7 @@
 	<!-- <h1 class="heading1" style="margin-top:20px;">Browse SDC Service Models</h1> -->
 	<div style="margin-top:30px" ng-init="getAaiServiceModelsList();">
 		
-		<table att-table table-data="services" view-per-page="viewPerPage" current-page="currentPage" search-category="searchCategory" search-string="searchString" total-page="totalPage">
+		<table data-tests-id="services-list" att-table table-data="services" view-per-page="viewPerPage" current-page="currentPage" search-category="searchCategory" search-string="searchString" total-page="totalPage">
 		    <thead  att-table-row type="header">
 				<tr>
 					<th att-table-header key="action">Action</th>
@@ -100,9 +102,10 @@
 	            	<td att-table-body ng-bind="service['extra-properties']['extra-property'][4]['property-value']"></td>
 	            	<td att-table-body ng-bind="service['extra-properties']['extra-property'][6]['property-value']"></td>
 	            	<td att-table-body ng-show="service['extra-properties']['extra-property'][6]['property-value'] > '1.0' ">
-	            		<button type=button ng-click="loadPreviousVersionData(service['extra-properties']['extra-property'][6]['property-value'],service['extra-properties']['extra-property'][4]['property-value'])" att-button btn-type="primary" size="small">
+	            		<div class="clickable-text previous-versions-button"
+						   ng-click="loadPreviousVersionData(service['extra-properties']['extra-property'][6]['property-value'],service['extra-properties']['extra-property'][4]['property-value'])">
 	            			Previous Versions
-	            		</button>
+	            		</div>
 	            	</td>
 	            	<td att-table-body ng-show="service['extra-properties']['extra-property'][6]['property-value'] <= '1.0' ">&nbsp;</td>
 		        </tr>
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/view-models/creationDialog.htm b/vid-app-common/src/main/webapp/app/vid/scripts/view-models/creationDialog.htm
index 4449285..ca13ca2 100755
--- a/vid-app-common/src/main/webapp/app/vid/scripts/view-models/creationDialog.htm
+++ b/vid-app-common/src/main/webapp/app/vid/scripts/view-models/creationDialog.htm
@@ -4,7 +4,7 @@
 		<div class="titleLine">
 			<img src="app/vid/images/spinner.gif"
 				ngx-visible="{{isSpinnerVisible}}"></img>
-			<h3>Create {{componentName}} -- {{createType}}</h3>
+			<h3 data-tests-id="create-modal-title">Create {{componentName}} -- {{createType}}</h3>
 		</div>
 
 		<div class="error" ng-show="isErrorVisible">
@@ -33,7 +33,7 @@
 		<div class="buttonRow">
 			<button data-tests-id="confirmButton" ngx-enabled="{{isConfirmEnabled}}" att-button size="small"
 				ng-click="confirm();">Confirm</button>
-			<button type="button" ng-click="cancel();" att-button
+			<button type="button" data-tests-id="cancelButton" ng-click="cancel();" att-button
 				btn-type="primary" size="small">Cancel</button>
 		</div>
 	</div>
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/view-models/deleteResumeDialog.htm b/vid-app-common/src/main/webapp/app/vid/scripts/view-models/deleteResumeDialog.htm
new file mode 100644
index 0000000..ccd54a6
--- /dev/null
+++ b/vid-app-common/src/main/webapp/app/vid/scripts/view-models/deleteResumeDialog.htm
@@ -0,0 +1,70 @@
+<!--
+  ============LICENSE_START=======================================================
+  VID
+  ================================================================================
+  Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+  ================================================================================
+  Licensed under the Apache License, Version 2.0 (the "License");
+  you may not use this file except in compliance with the License.
+  You may obtain a copy of the License at
+  
+       http://www.apache.org/licenses/LICENSE-2.0
+  
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+  ============LICENSE_END=========================================================
+  -->
+
+<div ng-controller="deleteResumeDialogController">
+
+	<div ng-show="isDialogVisible">
+		<div class="titleLine">
+			<img src="app/vid/images/spinner.gif"
+				ngx-visible="{{isSpinnerVisible}}"></img>
+			<h3>{{dialogMethod}} {{componentName}}</h3>
+		</div>
+
+		<div class="error" ng-show="isErrorVisible">
+			<img src="app/vid/images/error.png"></img>{{error}}
+		</div>
+
+      <parameter-block control="summaryControl"></parameter-block>
+      
+      <div ngx-visible="{{isDataVisible}}">
+		
+        <h4>
+				User Provided Data (<img class="requiredIndicator"
+					src="app/vid/images/asterisk.png" height='10' width='10'></img> indicates required field)
+			</h4>
+			<parameter-block control="userProvidedControl"
+				callback="userParameterChanged(id);" editable></parameter-block>
+
+			<div class="prompt">
+				<p>
+					Enter Data and <span>Confirm</span> to<br />{{dialogMethod}} <span>{{componentName}}</span>
+				</p>
+				<p>
+					<span>Cancel</span> to Return to Previous Page.<br />Data entered
+					will be lost
+				</p>
+			</div>
+        </div>
+
+		<div class="buttonRow">
+			<!-- <button type="button" ng-click="confirm();" att-button
+				btn-type="primary" size="small" class="confirm">Confirm</button>
+			<button type="button" ng-click="cancel();" att-button
+				btn-type="primary" size="small">Cancel</button> --->
+			<button data-tests-id="confirmResumeDeleteButton" ngx-enabled="{{isConfirmEnabled}}" att-button size="small"
+				ng-click="confirm();">Confirm</button>
+			<button type="button" ng-click="cancel();" att-button
+				btn-type="primary" size="small">Cancel</button>
+		</div>
+	</div>
+
+	<div ng-include="'app/vid/scripts/view-models/msoCommit.htm'"></div>
+
+</div>
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/view-models/deletionDialog.htm b/vid-app-common/src/main/webapp/app/vid/scripts/view-models/deletionDialog.htm
deleted file mode 100755
index b4b9316..0000000
--- a/vid-app-common/src/main/webapp/app/vid/scripts/view-models/deletionDialog.htm
+++ /dev/null
@@ -1,70 +0,0 @@
-<!--
-  ============LICENSE_START=======================================================
-  VID
-  ================================================================================
-  Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
-  ================================================================================
-  Licensed under the Apache License, Version 2.0 (the "License");
-  you may not use this file except in compliance with the License.
-  You may obtain a copy of the License at
-  
-       http://www.apache.org/licenses/LICENSE-2.0
-  
-  Unless required by applicable law or agreed to in writing, software
-  distributed under the License is distributed on an "AS IS" BASIS,
-  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  See the License for the specific language governing permissions and
-  limitations under the License.
-  ============LICENSE_END=========================================================
-  -->
-
-<div ng-controller="deletionDialogController">
-
-	<div ng-show="isDialogVisible">
-		<div class="titleLine">
-			<img src="app/vid/images/spinner.gif"
-				ngx-visible="{{isSpinnerVisible}}"></img>
-			<h3>Delete {{componentName}}</h3>
-		</div>
-
-		<div class="error" ng-show="isErrorVisible">
-			<img src="app/vid/images/error.png"></img>{{error}}
-		</div>
-
-      <parameter-block control="summaryControl"></parameter-block>
-      
-      <div ngx-visible="{{isDataVisible}}">
-		
-        <h4>
-				User Provided Data (<img class="requiredIndicator"
-					src="app/vid/images/asterisk.png" height='10' width='10'></img> indicates required field)
-			</h4>
-			<parameter-block control="userProvidedControl"
-				callback="userParameterChanged(id);" editable></parameter-block>
-
-			<div class="prompt">
-				<p>
-					Enter Data and <span>Confirm</span> to<br />Delete <span>{{componentName}}</span>
-				</p>
-				<p>
-					<span>Cancel</span> to Return to Previous Page.<br />Data entered
-					will be lost
-				</p>
-			</div>
-        </div>
-
-		<div class="buttonRow">
-			<!-- <button type="button" ng-click="confirm();" att-button
-				btn-type="primary" size="small" class="confirm">Confirm</button>
-			<button type="button" ng-click="cancel();" att-button
-				btn-type="primary" size="small">Cancel</button> --->
-			<button ngx-enabled="{{isConfirmEnabled}}" att-button size="small"
-				ng-click="confirm();">Confirm</button>
-			<button type="button" ng-click="cancel();" att-button
-				btn-type="primary" size="small">Cancel</button>
-		</div>
-	</div>
-
-	<div ng-include="'app/vid/scripts/view-models/msoCommit.htm'"></div>
-
-</div>
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/view-models/instantiate.htm b/vid-app-common/src/main/webapp/app/vid/scripts/view-models/instantiate.htm
index 71efef1..0740c07 100755
--- a/vid-app-common/src/main/webapp/app/vid/scripts/view-models/instantiate.htm
+++ b/vid-app-common/src/main/webapp/app/vid/scripts/view-models/instantiate.htm
@@ -23,7 +23,7 @@
 	<div popup-window class="popupContents" ngx-show="{{popup.isVisible}}"
 		 ng-cloak>
 		<div ng-include="'app/vid/scripts/view-models/creationDialog.htm'"></div>
-		<div ng-include="'app/vid/scripts/view-models/deletionDialog.htm'"></div>
+		<div ng-include="'app/vid/scripts/view-models/deleteResumeDialog.htm'"></div>
 		<div ng-include="'app/vid/scripts/view-models/detailsDialog.htm'"></div>
 		<div ng-include="'app/vid/scripts/view-models/statusDialog.htm'"></div>
 	</div>
@@ -35,7 +35,7 @@
 
 		<div ng-if="errorMsg != null"><font color='red'>{{errorMsg}}<pre>{{errorDetails | json}}</pre></font></div>
 
-		<h1 class="heading1" style="margin-top: 20px;">{{isPermitted == "true" ? "View/Edit" : "View"}} Service Instance</h1>
+		<h1 class="heading1" style="margin-top: 20px;">{{isPermitted ? "View/Edit" : "View"}} Service Instance</h1>
 		<a class="btn btn-primary btn-xs pull-right" ng-click="reloadRoute();" ><span class="glyphicon glyphicon-refresh"></span></a>
 
 		<br>
@@ -47,7 +47,7 @@
 						{{service.instance.subscriberName}}</th>
 					<th style="text-align: center" width="34%">SERVICE TYPE:
 						{{service.instance.serviceType}}</th>
-					<th style="text-align: center" width="33%">SERVICE INSTANCE
+					<th data-tests-id="service-instanceId-th-id" style="text-align: center" width="33%">SERVICE INSTANCE
 						ID: {{service.instance.serviceInstanceId}}</th>
 				<tr>
 				<tr>
@@ -64,16 +64,16 @@
 			<ol ui-tree-nodes="" ng-model="service"  >
 				<li ng-repeat="aService in [service]" ui-tree-node>
 					<div ui-tree-handle class="tree-node tree-node-content">
-						<a class="btn btn-success btn-xs" ng-if="(aService.instance.vnfs && aService.instance.vnfs.length > 0) || (aService.instance.networks && aService.instance.networks.length > 0)" data-nodrag ng-click="this.toggle()">
+						<a class="btn btn-success btn-xs" ng-if="(aService.instance.vnfs && aService.instance.vnfs.length > 0) ||(aService.instance.pnfs && aService.instance.pnfs.length > 0) || (aService.instance.networks && aService.instance.networks.length > 0)" data-nodrag ng-click="this.toggle()">
 							<span class="glyphicon" ng-class="{'glyphicon-chevron-right': collapsed,'glyphicon-chevron-down': !collapsed}"></span>
 						</a>
-						SERVICE INSTANCE: {{aService.instance.name}}
-						<a ng-if="((isMacro()) ||  (isObjectEmpty(aService.instance.vnfs) && isObjectEmpty(aService.instance.networks))) && isPermitted" data-tests-id="deleteServiceButton" class="pull-right btn btn-danger btn-xs" data-nodrag ng-click="deleteService(aService.instance);">
+						SERVICE INSTANCE: {{aService.instance.name}} | ORCH STATUS: {{serviceOrchestrationStatus}}
+						<a ng-if="((isMacro()) ||  (isObjectEmpty(aService.instance.vnfs) && isObjectEmpty(aService.instance.networks) && isObjectEmpty(aService.instance.pnfs))) && isPermitted" data-tests-id="deleteServiceButton" class="pull-right btn btn-danger btn-xs" data-nodrag ng-click="deleteService(aService.instance);">
 							<span class="glyphicon glyphicon-remove"></span>
 						</a>
-						<div class="pull-right btn-group" ng-if="aService.convertedModel.vnfs && !isObjectEmpty(aService.convertedModel.vnfs) && !aService.convertedModel.isNewFlow && isPermitted">
+						<div class="pull-right btn-group" ng-if="(aService.convertedModel.vnfs||aService.convertedModel.vnfs) &&(!isObjectEmpty(aService.convertedModel.pnfs)||!isObjectEmpty(aService.convertedModel.pnfs))  && !aService.convertedModel.isNewFlow && isPermitted">
 							<button type="button" data-tests-id="addVNFButton" class="btn btn-success btn-xs dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
-								Add VNF<span class="caret"></span>
+								Add node instance<span class="caret"></span>
 							</button>
 							<ul class="dropdown-menu" ng-model="aService.convertedModel.vnfs">
 								<a role="menuitem" ng-repeat="(vnfUuid, vnf) in aService.convertedModel.vnfs" data-tests-id="addVNFOption-{{vnf.modelCustomizationName}}" ng-click="addVnfInstance(vnf, aService.instance.vnfs)">{{vnf.modelCustomizationName}}</a>
@@ -82,7 +82,7 @@
 						</div>
 						<div class="pull-right btn-group" ng-if="aService.convertedModel.vnfs && !isObjectEmpty(aService.convertedModel.vnfs) && aService.convertedModel.isNewFlow && isPermitted">
 							<button type="button" data-tests-id="addVNFButton" class="btn btn-success btn-xs dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
-								Add VNF<span class="caret"></span>
+								Add node instance<span class="caret"></span>
 							</button>
 							<ul class="dropdown-menu" ng-model="aService.convertedModel.vnfs" data-tests-id="addVnfsDropdown">
 								<li role="menuitem" ng-repeat="(vnfUuid, vnf) in aService.convertedModel.vnfs">
@@ -91,21 +91,24 @@
 							</ul>
 						</div>
 						<!--  <div class="pull-right btn-group" ng-if="aService.model.networks && !equals(aService.model.networks, {})">-->
-						<div class="pull-right btn-group" ng-if="aService.convertedModel.networks && (!(isObjectEmpty(aService.convertedModel.networks)))">
+						<div class="pull-right btn-group" ng-if="aService.convertedModel.networks && (!(isObjectEmpty(aService.convertedModel.networks))) && isPermitted">
 							<!--<div class="pull-right btn-group" ng-if="aService.model.networks">-->
 							<button type="button" data-tests-id="addNetworkButton" class="btn btn-success btn-xs dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
 								Add Network<span class="caret"></span>
 							</button>
 							<ul class="dropdown-menu" ng-model="aService.convertedModel.networks">
 								<li ng-repeat="(networkUuid, network) in aService.convertedModel.networks">
-									<a ng-click="addNetworkInstance(network, aService.instance.vnfs)">{{network.modelCustomizationName}}</a>
+									<a data-tests-id="addNetworkOption-{{network.modelCustomizationName}}" ng-click="addNetworkInstance(network, aService.instance.vnfs)">{{network.modelCustomizationName}}</a>
 								</li>
 							</ul>
 						</div>
 						<a class="pull-right btn btn-primary btn-xs" data-nodrag ng-click="describeService(aService.instance)" style="margin-right: 8px;">
 							<span class="glyphicon glyphicon-info-sign"></span>
 						</a>
-						<a data-tests-id="activateButton" class="pull-right btn btn-primary btn-xs" data-nodrag ng-click="activateMSOInstance()" style="margin-right: 8px;">
+						<a data-tests-id="deactivateButton" ng-disabled="!isActivateDeactivateEnabled('deactivate')" class="pull-right btn btn-primary btn-xs" data-nodrag ng-click="deactivateMSOInstance()" style="margin-right: 8px;">
+							Deactivate
+						</a>
+						<a data-tests-id="activateButton" ng-disabled="!isActivateDeactivateEnabled('activate')" class="pull-right btn btn-primary btn-xs" data-nodrag ng-click="activateMSOInstance()" style="margin-right: 8px;">
 							Activate
 						</a>
 					</div>
@@ -180,7 +183,7 @@
 										</a>
 										VFMODULE: {{vfModule.name}} | TYPE: {{vfModule.nodeType}} | ORCH STATUS: {{vfModule.nodeStatus}}
 										<!--  -->
-										<a class="pull-right btn btn-danger btn-xs" ng-if="isPermitted" data-tests-id="deleteVFModuleButton" data-nodrag ng-click="deleteVfModule(aService.instance, vfModule, vnf)">
+										<a class="pull-right btn btn-danger btn-xs" ng-if="isPermitted" data-tests-id="deleteVFModuleButton-{{vfModule.name}}" data-nodrag ng-click="deleteVfModule(aService.instance, vfModule, vnf)">
 											<span class="glyphicon glyphicon-remove"></span>
 										</a>
 										<div class="pull-right btn-group">
@@ -196,6 +199,12 @@
 										<a class="pull-right btn btn-primary btn-xs" data-nodrag ng-click="describeVfModule(aService.instance, vfModule, vnf)" style="margin-right: 8px;">
 											<span class="glyphicon glyphicon-info-sign"></span>
 										</a>
+										<div class="resume" ng-if="isPermitted&&(vfModule.nodeStatus==resumeStatus)">
+											<a data-tests-id="resumeVFModuleButton-{{vfModule.name}}" class="pull-right btn btn-success btn-xs button-margin" ng-click="resume(aService.instance, vfModule, vnf)" >
+												Resume
+											</a>
+										</div>
+
 									</div>
 									<ol ui-tree-nodes="" ng-model="vfModule.volumeGroups" ng-class="{hidden: collapsed}">
 										<li ng-repeat="volumeGroup in vfModule.volumeGroups" ui-tree-node>
@@ -227,6 +236,7 @@
 							</ol>
 						</li>
 					</ol>
+
 					<ol ui-tree-nodes="" ng-model="aService.instance.networks" ng-class="{hidden: collapsed}">
 						<li ng-repeat="network in aService.instance.networks" ui-tree-node>
 							<div ui-tree-handle class="tree-node tree-node-content">
@@ -244,6 +254,49 @@
 							</div>
 						</li>
 					</ol>
+
+
+					<ol ui-tree-nodes="" ng-model="aService.instance.configurations" ng-class="{hidden: collapsed}">
+						<li ng-repeat="configuration in aService.instance.configurations" ui-tree-node>
+							<div ui-tree-handle class="tree-node tree-node-content">
+								<a class="btn btn-success btn-xs" ng-if="(configuration.ports && configuration.ports.length > 0)" data-nodrag ng-click="this.toggle()">
+									<span class="glyphicon" ng-class="{'glyphicon-chevron-right': collapsed,'glyphicon-chevron-down': !collapsed}"></span>
+								</a>
+								CONFIGURATION: {{configuration.name}} | TYPE: {{configuration.nodeType}} | ORCH	STATUS: {{configuration.nodeStatus}}
+
+								<a class="pull-right btn btn-danger btn-xs" ng-if="!isMacro() && isPermitted && configuration.nodeStatus === STATUS_CONSTANTS.AAI_INACTIVE" data-tests-id="deleteConfigurationButton" data-nodrag ng-click="deleteConfiguration(aService.instance, configuration)">
+									<span class="glyphicon glyphicon-remove"></span>
+								</a>
+
+								<a class="pull-right btn btn-primary btn-xs" data-nodrag ng-click="toggleConfigurationStatus(aService, configuration)" ng-if="isPermitted && allowConfigurationActions">
+									{{configuration.nodeStatus === STATUS_CONSTANTS.AAI_ACTIVE ? "Deactivate" : "Activate"}}
+								</a>
+							</div>
+							<ol ui-tree-nodes="" ng-model="configuration.ports" ng-class="{hidden: collapsed}">
+								<li ng-repeat="port in configuration.ports" ui-tree-node>
+									<div ui-tree-handle class="tree-node tree-node-content">
+										PORT: {{port.portName}} | ORCH STATUS: {{port.portStatus}}
+
+										<button type="button" class="pull-right btn btn-primary btn-xs" ng-if="configuration.nodeStatus == STATUS_CONSTANTS.AAI_ACTIVE" ng-click="togglePortStatus(aService, configuration, port)">
+											{{port.portStatus === STATUS_CONSTANTS.AAI_ENABLED ? "Disable" : "Enable"}}
+										</button>
+									</div>
+								</li>
+							</ol>
+						</li>
+					</ol>
+
+					<ol id="pnfs-tree" ui-tree-nodes="" ng-model="pnfs" ng-class="{hidden: collapsed || pnf.length === 0}">
+						<li ng-repeat="pnf in pnfs" ui-tree-node>
+							<div ui-tree-handle class="tree-node tree-node-content">
+								PNF: {{pnf}}
+
+								<a class="dissociate-pnf pull-right btn btn-primary btn-xs" data-nodrag ng-click="dissociatePnf(pnf)" style="margin-right: 8px;">
+									<span>Dissociate</span>
+								</a>
+							</div>
+						</li>
+					</ol>
 				</li>
 			</ol>
 		</div>
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/view-models/messageViewer.htm b/vid-app-common/src/main/webapp/app/vid/scripts/view-models/messageViewer.htm
new file mode 100644
index 0000000..67e9248
--- /dev/null
+++ b/vid-app-common/src/main/webapp/app/vid/scripts/view-models/messageViewer.htm
@@ -0,0 +1,6 @@
+<div class="message-viewer">
+    <div ng-include src="icon"></div>
+    <div class="primaryMessage">{{ primaryMessage }}</div>
+    <div class="secondaryMessage">{{ secondaryMessage }}</div>
+    <button data-tests-id="try-again" class="btn btn-primary" ng-if="showTryAgain" ng-click="tryAgain()">TRY AGAIN</button>
+</div>
\ No newline at end of file
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/view-models/msoCommit.htm b/vid-app-common/src/main/webapp/app/vid/scripts/view-models/msoCommit.htm
index 4826824..25a6cf9 100755
--- a/vid-app-common/src/main/webapp/app/vid/scripts/view-models/msoCommit.htm
+++ b/vid-app-common/src/main/webapp/app/vid/scripts/view-models/msoCommit.htm
@@ -18,8 +18,8 @@
   ============LICENSE_END=========================================================
   -->
 
-<div ng-controller="msoCommitController" ng-show="isViewVisible">
-
+<div ng-controller="msoCommitController" ng-show="isViewVisible" >
+<div ng-if="isViewVisible">
 	<div class="statusLine">
 		<img src="app/vid/images/spinner.gif"
 			ngx-visible="{{isSpinnerVisible}}"> </img> <label>Status:</label><span
@@ -45,3 +45,4 @@
 			ng-click="close();">Close</button>
 	</div>
 </div>
+</div>
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/view-models/pnfSearchAssociation.htm b/vid-app-common/src/main/webapp/app/vid/scripts/view-models/pnfSearchAssociation.htm
new file mode 100644
index 0000000..7c1095e
--- /dev/null
+++ b/vid-app-common/src/main/webapp/app/vid/scripts/view-models/pnfSearchAssociation.htm
@@ -0,0 +1,62 @@
+<!--
+============LICENSE_START=======================================================
+VID
+================================================================================
+Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+================================================================================
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+============LICENSE_END=========================================================
+-->
+<link rel="stylesheet" type="text/css" href="app/vid/styles/networkNode.css"/>
+<link rel="stylesheet" type="text/css" href="app/vid/styles/pnfSearchAssociation.css"/>
+<div ng-controller="pnfSearchAssociationController" class="network-wrapper-config pnf-search-association">
+    <div class="head">
+        <div class="title">PNF Model: {{modelName}}</div>
+        <div class="btn-wrapper">
+            <button class="cancel-btn grey" data-tests-id="back" data-ng-click="back()">Back</button>
+            <button class="create-btn blue" data-tests-id="associatePnf" data-ng-disabled="!pnfInstance" data-ng-click="associate()">Associate</button>
+        </div>
+    </div>
+
+    <div class="content-wrapper">
+        <div class="content">
+      <div class="bold" >Unique name of physical network function:</div>
+                <div class="input-wrapper">
+                    <input data-tests-id="pnfName" type="search" placeholder="Enter PNF name and click Search" data-ng-model="pnfName" ></input>
+                    <div data-tests-id="searchPnf" class="search2-icon search-input" data-ng-click="searchPnf(pnfName)" data-ng-disabled="!pnfName"></div>
+                </div>
+          <div class="result-content margin-search" data-ng-show="pnfInstance">
+                <span ng-show="pnfInstance.pnfName">PNF unique name:</span>
+                <div data-tests-id="pnfInstancePnfName">{{pnfInstance.pnfName}}</div>
+                <span ng-show="pnfInstance.pnfName2" >PNF name:</span>
+                <div data-tests-id="pnfInstancePnfName2">{{pnfInstance.pnfName2}}</div>
+                <span ng-show="pnfInstance.pnfName2Source" >PNF name source:</span>
+                <div data-tests-id="pnfInstancePnfName2Source">{{pnfInstance.pnfName2Source}}</div>
+                <span ng-show="pnfInstance.pnfId">PNF ID:</span>
+                <div data-tests-id="pnfInstancePnfId">{{pnfInstance.pnfId}}</div>
+                <span ng-show="pnfInstance.equipType">Equipment type:</span>
+                <div data-tests-id="pnfInstanceEquipType">{{pnfInstance.equipType}}</div>
+                <span ng-show="pnfInstance.equipVendor">Equipment vendor:</span>
+                <div data-tests-id="pnfInstanceEquipVendor">{{pnfInstance.equipVendor}}</div>
+                <span ng-show="pnfInstance.equipModel">Equipment model:</span>
+                <div data-tests-id="pnfInstanceEquipModel">{{pnfInstance.equipModel}}</div>
+
+            </div>
+            <div class="error-msg margin-search" data-tests-id="pnfNotFoundErrorMessage" data-ng-show="notFound">The specified PNF instance {{pnfNameNotFound}} does not exist in A&AI. <br/>Please note: A&AI is case sensitive</div>
+
+        </div>
+
+    <div class="sidebar-right">
+            <service-metadata title-txt="SERVICE MODEL INFO" service-metadata-fields="serviceMetadataFields"></service-metadata>
+        </div>
+</div>
\ No newline at end of file
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/view-models/search.htm b/vid-app-common/src/main/webapp/app/vid/scripts/view-models/search.htm
new file mode 100644
index 0000000..a0b94fe
--- /dev/null
+++ b/vid-app-common/src/main/webapp/app/vid/scripts/view-models/search.htm
@@ -0,0 +1,5 @@
+<link rel="stylesheet" type="text/css" href="app/vid/styles/search.css"/>
+<div class="search-container">
+    <input type="search" data-tests-id="test-search-input" class="search-input" ng-model="searchString" ng-model-options="{debounce: 300}" placeholder="Type to search">
+    <div class="search-icon" ng-include src="'app/vid/images/search.svg'"></div>
+</div>
\ No newline at end of file
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/view-models/serviceMetadata.htm b/vid-app-common/src/main/webapp/app/vid/scripts/view-models/serviceMetadata.htm
new file mode 100644
index 0000000..27992d4
--- /dev/null
+++ b/vid-app-common/src/main/webapp/app/vid/scripts/view-models/serviceMetadata.htm
@@ -0,0 +1,10 @@
+<link rel="stylesheet" type="text/css" href="app/vid/styles/serviceMetadata.css"/>
+<div class="header-title" ng-if="titleTxt">
+    {{titleTxt}}
+</div>
+<div class="metadata-content">
+    <div class="field" ng-repeat="field in serviceMetadataFields">
+        <label>{{field.name}}</label>
+        <div class="value" data-tests-id="{{'info-test-data-id-' + field.name.split(' ').join('')}}">{{field.value}}</div>
+    </div>
+</div>
\ No newline at end of file
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/view-models/serviceModels.htm b/vid-app-common/src/main/webapp/app/vid/scripts/view-models/serviceModels.htm
index 3cba871..17b87bf 100755
--- a/vid-app-common/src/main/webapp/app/vid/scripts/view-models/serviceModels.htm
+++ b/vid-app-common/src/main/webapp/app/vid/scripts/view-models/serviceModels.htm
@@ -69,8 +69,8 @@
 	            	<td att-table-body ng-bind="service['distributionStatus']"></td>
 	            	<td att-table-body ng-bind="service['lastUpdaterUserId']"></td>
 	            	<td att-table-body ng-bind="service['toscaModelUrl']"></td>
-					<td att-table-body ng-show="service['version'] > '1.0' "><button type=button ng-click="loadPreviousVersionData(service['invariantUUID'],service['name'],service['version'])" att-button btn-type="primary" size="small">Previous Versions</button></td>
-	            	<td att-table-body ng-show="service['version'] <= '1.0' ">&nbsp;</td>
+					<td att-table-body ng-show="service.hasPreviousVersion"><button type=button ng-click="loadPreviousVersionData(service['invariantUUID'],service['name'],service['version'])" att-button btn-type="primary" size="small">Previous Versions</button></td>
+	            	<td att-table-body ng-show="!service.hasPreviousVersion">&nbsp;</td>
 		        </tr>     
 		    </tbody>	  
 		</table>
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/view-models/serviceProxyConfig.htm b/vid-app-common/src/main/webapp/app/vid/scripts/view-models/serviceProxyConfig.htm
new file mode 100644
index 0000000..e2261dc
--- /dev/null
+++ b/vid-app-common/src/main/webapp/app/vid/scripts/view-models/serviceProxyConfig.htm
@@ -0,0 +1,108 @@
+<!--
+============LICENSE_START=======================================================
+VID
+================================================================================
+Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+================================================================================
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+============LICENSE_END=========================================================
+-->
+<link rel="stylesheet" type="text/css" href="app/vid/styles/networkNode.css"/>
+<link rel="stylesheet" type="text/css" href="app/vid/styles/serviceProxyConfig.css"/>
+<div class="service-wrapper-config network-wrapper-config">
+    <div class="head">
+        <div class="title">Config {{modelName}}</div>
+        <div class="btn-wrapper">
+            <button class="cancel-btn grey" data-tests-id="backButton" data-ng-click="back()">Back</button>
+            <button class="create-btn blue" data-tests-id="createButton" data-ng-disabled="proxiesInstanceName.$invalid|| disableCreate" data-ng-click="create()">Create</button>
+        </div>
+    </div>
+
+    <div class="content-wrapper">
+        <div class="content">
+            <div class="diagram">
+                <div class="diagram-img">
+                    <div class="circle service-circle">
+                        <span class="text">Source<br>Service proxy</span>
+                    </div>
+                    <div class="dotted-line" data-ng-class="{'checked': sourceInstance, 'unchecked': !sourceInstance}">
+                        <span class="conn-circle sprite" data-tests-id="sourceInstanceSelectedIcon" data-ng-class="{'valid-large': sourceInstance}"></span>
+                    </div>
+                    <div class="circle config-circle">
+                        <span class="line"></span>
+                    </div>
+                    <div class="dotted-line" data-ng-class="{'checked': collectorInstance, 'unchecked': !collectorInstance}">
+                        <span class="conn-circle sprite" data-tests-id="collectorInstanceSelectedIcon" data-ng-class="{'valid-large': collectorInstance}"></span>
+                    </div>
+                    <div class="circle service-circle">
+                        <span class="text">Collector<br>Service proxy</span>
+                    </div>
+                </div>
+                <div class="element-name-wrapper">
+                    <div class="element-name service" data-ng-click="openMetadataModal('sourceMetadata')">
+                        <span class="label-txt" data-tests-id="sourceInstanceName">{{sourceInstanceName}} <span class="info" data-tests-id="sourceInfoButton">i</span></span>
+
+                    </div>
+                    <div class="element-name config">
+                        <span class="label-txt" data-tests-id="modelName">{{modelName}}</span>
+                    </div>
+                    <div class="element-name  service"  data-ng-click="openMetadataModal('collectorMetadata')">
+                        <span class="label-txt" data-tests-id="collectorInstanceName">{{collectorInstanceName}}<span class="info" data-tests-id="collectorInfoButton">i</span></span>
+
+                    </div>
+                </div>
+            </div>
+            <form name="proxiesInstanceName" class="bottom">
+                <div class="wrapper-list source-vnf">
+                    <div class="title-txt"><b>Source</b> Service Type</div>
+                    <select ng-model="sourceServiceType"
+                            ng-change="onSourceServiceTypeSelected()" name="sourceServiceType" id="sourceServiceType"
+                            ng-options="item['service-type'] disable when !(item['is-permitted']) for item in serviceTypes"
+                            required data-tests-id="sourceServiceType">
+                        <option value="" disabled>Select service type</option>
+                    </select>
+
+                    <div class="title-txt select-vnf-title">VNF providing <b>source</b> requirements</div>
+                    <select ng-model="sourceInstance" name="source" ng-disabled="sourceInstanceList === null" required  data-tests-id="sourceDropDown">
+                        <option value="" selected>Type/Select VNF name</option>
+                        <option ng-repeat="option in sourceInstanceList" data-tests-id="{{'source-' + option.id}}"
+                                value="{{option.id}}">{{option['properties']['vnf-name']}}</option>
+                    </select>
+                    <span class="no-results" data-tests-id="sourceNoResults" ng-show="sourceNoResults">No vnf instances found.</span>
+                </div>
+
+                <div class="wrapper-list collector-{{collectorType}}">
+                    <div class="title-txt ng-hide-keep-block" ng-hide="collectorType==='pnf'"><b>Collector</b> Service Type</div>
+                    <select ng-model="collectorServiceType" ng-hide="collectorType==='pnf'" class="ng-hide-keep-block"
+                            ng-change="onCollectorServiceTypeSelected()" name="collectorServiceType" id="collectorServiceType"
+                            ng-options="item['service-type'] disable when !(item['is-permitted']) for item in serviceTypes"
+                            required data-tests-id="collectorServiceType">
+                        <option value="" disabled>Select service type</option>
+                    </select>
+
+                    <div class="title-txt select-vnf-title">{{collectorType.toUpperCase()}} providing <b>collector</b> requirements</div>
+                    <select ng-model="collectorInstance" name="collector" ng-disabled="collectorInstanceList === null" required data-tests-id="collectorDropDown">
+                        <option value="" selected>Type/Select {{collectorType.toUpperCase()}} name</option>
+                        <option ng-repeat="option in collectorInstanceList" data-tests-id="{{'collector-' + option.id}}"
+                                value="{{option.id}}">{{option['properties'][collectorType=='vnf' ? 'vnf-name' : 'pnfName']}}</option>
+                    </select>
+                    <span class="no-results" data-tests-id="collectorNoResults" ng-show="collectorNoResults">No {{collectorType}} instances found.</span>
+                </div>
+            </form>
+        </div>
+
+        <div class="sidebar-right">
+            <service-metadata title-txt="info" service-metadata-fields="serviceMetadataFields"></service-metadata>
+        </div>
+    </div>
+</div>
\ No newline at end of file
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/view-models/testEnvironments.htm b/vid-app-common/src/main/webapp/app/vid/scripts/view-models/testEnvironments.htm
new file mode 100644
index 0000000..2c445f8
--- /dev/null
+++ b/vid-app-common/src/main/webapp/app/vid/scripts/view-models/testEnvironments.htm
@@ -0,0 +1,82 @@
+<link rel="stylesheet" type="text/css" href="app/vid/styles/testEnvironments.css" />
+<link rel="stylesheet" type="text/css" href="app/vid/styles/buttons.css" />
+<div class="test-environments">
+    <div class="header">
+        <div class="header-left">
+            <span data-tests-id="test-environments-headline" class="headline">Test Environments {{vm.total}}</span>
+            <span class="separator"></span>
+            <div class="button-container" ng-click="vm.createNewTestEnvironment()">
+                <div class="icon-svg" data-tests-id="test-environments-new-button">
+                    <svg xmlns="http://www.w3.org/2000/svg" width="40" height="40" viewBox="0 0 55.47337 55.63023"><path class="icon-filling" d="M27.7367.07843A27.73669,27.73669,0,1,0,55.4734,27.81512,27.73757,27.73757,0,0,0,27.7367.07843ZM40.18824,29.6178H29.53938V40.26666a1.80267,1.80267,0,0,1-3.60535,0V29.6178H15.28516a1.80267,1.80267,0,0,1,0-3.60535H25.934V15.36359a1.80267,1.80267,0,0,1,3.60535,0V26.01245H40.18824a1.80267,1.80267,0,1,1,0,3.60535Z"/></svg>
+                </div>
+                <span class="button-text">Create New</span>
+            </div>
+            <span class="separator"></span>
+        </div>
+        <search-text data-tests-id="test-environments-search" search-string="vm.searchString"></search-text>
+    </div>
+    <div class="error-messages" ng-if="vm.emptyData || vm.connectError">
+        <message-viewer data-tests-id="test-environments-no-data" primary-message="No test environment was created yet" secondary-message="create new to start testing" icon="app/vid/images/emptyData.svg" class="no-data" ng-if="vm.emptyData">
+        </message-viewer>
+        <message-viewer data-tests-id="test-environments-error" primary-message="Something went wrong" secondary-message="{{vm.connectError}}" icon="app/vid/images/icon_noconnection.svg" try-again="vm.loadAAIestEnvironments()" class="connect-error" ng-if="vm.connectError">
+        </message-viewer>
+    </div>
+    <div class="environments-table" ng-if="vm.environments.length">
+        <div class="row">
+            <div class="col-md-12">
+                <button data-tests-id="test-environments-refresh" class="refresh" type="button" ng-click="vm.loadAAIestEnvironments()">
+                    <div ng-include src="'app/vid/images/refresh.svg'"></div>
+                </button>
+            </div>
+        </div>
+
+        <div class="row">
+            <div class="col-md-12 test-environments-table-container">
+                <table data-tests-id="test-environments-table" att-table table-data="vm.environments" search-category="searchCategory" search-string="vm.searchString" class="table table-bordered"  id="environments-table">
+                    <thead att-table-row type="header" class="thead-default">
+                        <tr>
+                            <th att-table-header default-sort="A" key="operationalEnvironmentId">Environment ID</th>
+                            <th att-table-header key="operationalEnvironmentName">Environment Name</th>
+                            <th att-table-header key="relationshipList.relationship[0].relationshipData[0].relationshipValue">ECOMP Environment ID</th>
+                            <th att-table-header key="relationshipList.relationship[0].relatedToProperty[0].propertyValue">ECOMP Environment Name</th>
+                            <th att-table-header key="tenantContext">Tenant Context</th>
+                            <th att-table-header key="operationalEnvironmentType">Environment Type</th>
+                            <th att-table-header key="workloadContext">Workload Context</th>
+                            <th att-table-header sortable="false">Status</th>
+                            <th att-table-header sortable="false">Action</th>
+                            <th att-table-header sortable="false">Attach Manifest</th>
+                        </tr>
+                    </thead>
+                    <tbody att-table-row type="body" row-repeat="environment in vm.environments">
+                        <tr>
+                            <td att-table-body ng-bind="environment.operationalEnvironmentId"></td>
+                            <td att-table-body ng-bind="environment.operationalEnvironmentName"></td>
+                            <td att-table-body ng-bind="environment.relationshipList.relationship[0].relationshipData? environment.relationshipList.relationship[0].relationshipData[0].relationshipValue: ''"></td>
+                            <td att-table-body ng-bind="environment.relationshipList.relationship[0].relatedToProperty? environment.relationshipList.relationship[0].relatedToProperty[0].propertyValue: ''"></td>
+                            <td att-table-body ng-bind="environment.tenantContext"></td>
+                            <td att-table-body ng-bind="environment.operationalEnvironmentType"></td>
+                            <td att-table-body ng-bind="environment.workloadContext"></td>
+                            <td att-table-body ng-bind="vm.getEnvStatus(environment)" id="testEnvStatus-{{environment.operationalEnvironmentId}}"></td>
+                            <td att-table-body>
+                                <button id="testEnvActivate-{{environment.operationalEnvironmentId}}" type="button" class="blue envActionBtn"
+                                        ng-click="vm.onTestEnvActivateClick(environment)" ng-show="!vm.isEnvActive(environment)">Activate</button>
+                                <button id="testEnvDeactivate-{{environment.operationalEnvironmentId}}" type="button" class="blue envActionBtn"
+                                        ng-click="vm.onTestEnvDeactivateClick(environment)" ng-show="vm.isEnvActive(environment)">Deactivate</button>
+                            </td>
+                            <td att-table-body>
+                                <button id="testEnvAttach-{{environment.operationalEnvironmentId}}" class="transparent attach-button"
+                                        ng-click="vm.onTestEnvActivateClick(environment)" ng-show="vm.isEnvActive(environment)">
+                                    <img src="app/vid/images/attach.svg">
+                                </button>
+                            </td>
+                        </tr>
+                    </tbody>
+                </table>
+            </div>
+        </div>
+    </div>
+</div>
+<div popup-window class="popupContents" ngx-show="{{popup.isVisible}}"
+     ng-cloak>
+    <div ng-include="'app/vid/scripts/view-models/msoCommit.htm'"></div>
+</div>
\ No newline at end of file
diff --git a/vid-app-common/src/main/webapp/app/vid/styles/buttons.css b/vid-app-common/src/main/webapp/app/vid/styles/buttons.css
new file mode 100644
index 0000000..7a2a901
--- /dev/null
+++ b/vid-app-common/src/main/webapp/app/vid/styles/buttons.css
@@ -0,0 +1,58 @@
+button {
+    border-radius: 2px;
+    font-size: 14px;
+    line-height: 28px;
+    height: 30px;
+}
+
+button.blue {
+    border: #0091c8 1px solid;
+    background-color: #009fdb;
+    color: white;
+}
+button.blue:hover {
+    background-color: #1ec2ff;
+    border-color: #0091c8;
+}
+button.blue:active {
+    background-color: #0091c7;
+    border-color: #006186;
+}
+button.blue[disabled] {
+    background-color: rgba(5, 104, 174, 0.3);
+    border-color: rgba(4, 113, 168, 0.3);
+}
+
+
+button.transparent {
+    border: 0;
+    background-color: transparent;
+    outline: none;
+}
+button.transparent:hover {
+    background-color: transparent;
+}
+button.transparent:active {
+    background-color: transparent;
+}
+button.transparent[disabled] {
+    background-color: transparent;
+}
+
+.clickable-text {
+    font-size: 12px !important;
+    color: #337ab7; !important;
+    text-decoration: none;
+    text-decoration-line: none !important;
+}
+.clickable-text:hover {
+    color: #23527c !important;
+    text-decoration: none;
+    text-decoration-line: none !important;
+}
+.clickable-text:active {
+    color: #0091c7 !important;
+}
+.clickable-text[disabled] {
+    color: rgba(5, 104, 174, 0.3) !important;
+}
diff --git a/vid-app-common/src/main/webapp/app/vid/styles/change-management-icons.css b/vid-app-common/src/main/webapp/app/vid/styles/change-management-icons.css
index 8c4dbd8..7e9620a 100644
--- a/vid-app-common/src/main/webapp/app/vid/styles/change-management-icons.css
+++ b/vid-app-common/src/main/webapp/app/vid/styles/change-management-icons.css
@@ -51,8 +51,13 @@
     color: #5a5a5a;
 }
 .icon-pending:before {
+     content: "\e905";
+     color: #00aeef;
+     cursor: pointer;
+ }
+.icon-deleted:before {
     content: "\e905";
-    color: #00aeef;
+    color: #cf2a2a;
     cursor: pointer;
 }
 .icon-plus:before {
@@ -80,3 +85,63 @@
     font-size: 12px;
     cursor: pointer;
 }
+.icon-search-in:before {
+    content: "\e90d";
+    color: #009FDB;
+    font-size: 17px;
+    cursor: pointer;
+}
+.expand-icon{
+    margin-right: 10px;
+    position: relative;
+    width: 11px;
+    height: 11px;
+    display: inline-block;
+    cursor: pointer;
+}
+
+/* Vertical line */
+.expand-icon:before{
+    content: "";
+    position: absolute;
+    background-color: #5a5a5a;
+    transition: transform 0.25s ease-out;
+    right: 40%;
+    width: 2px;
+    height: 100%;
+    margin-left: 5px;
+}
+
+/* horizontal line */
+.expand-icon:after{
+    content: "";
+    position: absolute;
+    background-color: #5a5a5a;
+    transition: transform 0.25s ease-out;
+    top: 40%;
+    left: 0;
+    width: 100%;
+    height: 2px;
+}
+.collapse-icon{
+    margin-right: 10px;
+    cursor: pointer;
+    display: inline-block;
+    width: 10px;
+    border-top: 1.6px solid #5a5a5a;
+    padding: 2.6px;
+}
+.icon-search2:before {
+    content: "\e90d";
+    color: #009FDB;
+    font-size: 40px;
+    cursor: pointer;
+}
+.icon-sync:before {
+    content: "\e90f";
+    font-size: 20px;
+    cursor: pointer;
+}
+.icon-sync:hover:before {
+    color: #009FDB;
+}
diff --git a/vid-app-common/src/main/webapp/app/vid/styles/change-management.css b/vid-app-common/src/main/webapp/app/vid/styles/change-management.css
index 68a06ee..7edbea0 100644
--- a/vid-app-common/src/main/webapp/app/vid/styles/change-management.css
+++ b/vid-app-common/src/main/webapp/app/vid/styles/change-management.css
@@ -90,7 +90,7 @@
 }
 
 .jobs-table {
-    background-color: #f8f8f8;
+    background-color: #ffffff;
     padding: 40px;
 }
 
@@ -119,7 +119,7 @@
     border: 1px solid #eaeaea;
     box-sizing: border-box;
     background-color: #ffffff;
-    box-shadow: 0px 2px 7px 0px rgba(34, 31, 31, 0.17);
+   /* box-shadow: 0px 2px 7px 0px rgba(34, 31, 31, 0.17);*/
     font-family: "Open Sans";
     color: #5a5a5a;
     font-size: 14px;
@@ -127,7 +127,7 @@
 }
 
 .table>thead {
-    background-color: #d2d2d2;
+    background-color: #F2F2F2;
     font-family: "Open Sans";
     color: #191919;
     font-size: 13px;
@@ -140,7 +140,7 @@
     color: #00aeef;
     font-size: 14px;
     font-weight: 600;
-    background-color: #eaeaea;
+    background-color: #EAEAEA;
     box-shadow: 0px 1px 1px 0px rgba(34, 31, 31, 0.19);
 }
 
@@ -154,4 +154,24 @@
 
 .centered {
     text-align: center;
+}
+.table-wrapper{
+}
+
+.refresh-cm {
+    float: right;
+    position: relative;
+    right: 45px;
+    top: 50px;
+    z-index: 900;
+    color: #191919;
+    font-size: 14px;
+}
+.refresh-cm .last-time-updated {
+    color: #5A5A5A;
+}
+.refresh-cm i.icon-sync {
+    padding-left: 10px;
+    top: 3px;
+    position: relative;
 }
\ No newline at end of file
diff --git a/vid-app-common/src/main/webapp/app/vid/styles/common.css b/vid-app-common/src/main/webapp/app/vid/styles/common.css
index 8d6fb61..35f2e33 100644
--- a/vid-app-common/src/main/webapp/app/vid/styles/common.css
+++ b/vid-app-common/src/main/webapp/app/vid/styles/common.css
@@ -1,3 +1,116 @@
+@font-face {
+    font-family: OpenSans-Bold;
+    src: url("fonts/OpenSans/OpenSans-Bold.ttf") format('truetype');
+}
+
+@font-face {
+    font-family: OpenSans-BoldItlaic;
+    src: url("fonts/OpenSans/OpenSans-BoldItalic.ttf") format('truetype');
+}
+
+@font-face {
+    font-family: OpenSans-ExtraBold;
+    src: url("fonts/OpenSans/OpenSans-ExtraBold.ttf") format('truetype');
+}
+
+@font-face {
+    font-family: OpenSans-ExtraBoldItalic;
+    src: url("fonts/OpenSans/OpenSans-ExtraBoldItalic.ttf") format('truetype');
+}
+
+@font-face {
+    font-family: OpenSans-Italic;
+    src: url("fonts/OpenSans/OpenSans-Italic.ttf") format('truetype');
+}
+
+@font-face {
+    font-family: OpenSans-Light;
+    src: url("fonts/OpenSans/OpenSans-Light.ttf") format('truetype');
+}
+
+@font-face {
+    font-family: OpenSans-LightItalic;
+    src: url("fonts/OpenSans/OpenSans-LightItalic.ttf") format('truetype');
+}
+
+@font-face {
+    font-family: OpenSans-Regular;
+    src: url("fonts/OpenSans/OpenSans-Regular.ttf") format('truetype');
+}
+
+@font-face {
+    font-family: OpenSans-Semibold;
+    src: url("fonts/OpenSans/OpenSans-Semibold.ttf") format('truetype');
+}
+
+@font-face {
+    font-family: OpenSans-SemiboldItalic;
+    src: url("fonts/OpenSans/OpenSans-SemiboldItalic.ttf") format('truetype');
+}
+
+@font-face {
+    font-family: 'icomoon';
+    src:  url('fonts/icomoon.eot?4cilop');
+    src:  url('fonts/icomoon.eot?4cilop#iefix') format('embedded-opentype'),
+    url('fonts/icomoon.ttf?4cilop') format('truetype'),
+    url('fonts/icomoon.woff?4cilop') format('woff'),
+    url('fonts/icomoon.svg?4cilop#icomoon') format('svg');
+    font-weight: normal;
+    font-style: normal;
+}
+
 html, body {
     font-size:14px;
-}
\ No newline at end of file
+}
+
+.button--inactive {
+    border: none !important;
+}
+
+.modal-body [class^="icon-"],.modal-body [class*=" icon-"] {
+    /* use !important to prevent issues with browser extensions that change fonts */
+    font-family: 'icomoon' !important;
+    speak: none;
+    font-style: normal;
+    font-weight: normal;
+    font-variant: normal;
+    text-transform: none;
+    line-height: 1;
+
+    /* Better Font Rendering =========== */
+    -webkit-font-smoothing: antialiased;
+    -moz-osx-font-smoothing: grayscale;
+}
+
+.icon-browse:before {
+    content: "\e90e";
+    color: #5A5A5A;
+    font-size: 4px;
+    cursor: pointer;
+    width: 37px;
+    height: 37px;
+    line-height: 37px;
+    text-align: center;
+    background: #F2F2F2;
+    border: 1px solid #D2D2D2;
+    display: inline-block;
+    vertical-align: top;
+    border-radius: 2px;
+    border-bottom-left-radius: 0;
+    border-top-left-radius: 0;
+}
+
+.icon-browse:hover::before {
+    background-color: #E6F6FB;
+    color: #009FDB;
+}
+
+.icon-browse:active::before {
+    background-color: #E6F6FB;
+    color: #009FDB;
+}
+
+input:focus:invalid {
+    border-color: Tomato;
+    box-shadow: none;
+}
diff --git a/vid-app-common/src/main/webapp/app/vid/styles/fonts/OpenSans/Apache License.txt b/vid-app-common/src/main/webapp/app/vid/styles/fonts/OpenSans/Apache License.txt
new file mode 100644
index 0000000..989e2c5
--- /dev/null
+++ b/vid-app-common/src/main/webapp/app/vid/styles/fonts/OpenSans/Apache License.txt
@@ -0,0 +1,201 @@
+Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
+
+   APPENDIX: How to apply the Apache License to your work.
+
+      To apply the Apache License to your work, attach the following
+      boilerplate notice, with the fields enclosed by brackets "[]"
+      replaced with your own identifying information. (Don't include
+      the brackets!)  The text should be enclosed in the appropriate
+      comment syntax for the file format. We also recommend that a
+      file or class name and description of purpose be included on the
+      same "printed page" as the copyright notice for easier
+      identification within third-party archives.
+
+   Copyright [yyyy] [name of copyright owner]
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
\ No newline at end of file
diff --git a/vid-app-common/src/main/webapp/app/vid/styles/fonts/OpenSans/OpenSans-Bold.ttf b/vid-app-common/src/main/webapp/app/vid/styles/fonts/OpenSans/OpenSans-Bold.ttf
new file mode 100644
index 0000000..fd79d43
--- /dev/null
+++ b/vid-app-common/src/main/webapp/app/vid/styles/fonts/OpenSans/OpenSans-Bold.ttf
Binary files differ
diff --git a/vid-app-common/src/main/webapp/app/vid/styles/fonts/OpenSans/OpenSans-BoldItalic.ttf b/vid-app-common/src/main/webapp/app/vid/styles/fonts/OpenSans/OpenSans-BoldItalic.ttf
new file mode 100644
index 0000000..9bc8009
--- /dev/null
+++ b/vid-app-common/src/main/webapp/app/vid/styles/fonts/OpenSans/OpenSans-BoldItalic.ttf
Binary files differ
diff --git a/vid-app-common/src/main/webapp/app/vid/styles/fonts/OpenSans/OpenSans-ExtraBold.ttf b/vid-app-common/src/main/webapp/app/vid/styles/fonts/OpenSans/OpenSans-ExtraBold.ttf
new file mode 100644
index 0000000..21f6f84
--- /dev/null
+++ b/vid-app-common/src/main/webapp/app/vid/styles/fonts/OpenSans/OpenSans-ExtraBold.ttf
Binary files differ
diff --git a/vid-app-common/src/main/webapp/app/vid/styles/fonts/OpenSans/OpenSans-ExtraBoldItalic.ttf b/vid-app-common/src/main/webapp/app/vid/styles/fonts/OpenSans/OpenSans-ExtraBoldItalic.ttf
new file mode 100644
index 0000000..31cb688
--- /dev/null
+++ b/vid-app-common/src/main/webapp/app/vid/styles/fonts/OpenSans/OpenSans-ExtraBoldItalic.ttf
Binary files differ
diff --git a/vid-app-common/src/main/webapp/app/vid/styles/fonts/OpenSans/OpenSans-Italic.ttf b/vid-app-common/src/main/webapp/app/vid/styles/fonts/OpenSans/OpenSans-Italic.ttf
new file mode 100644
index 0000000..c90da48
--- /dev/null
+++ b/vid-app-common/src/main/webapp/app/vid/styles/fonts/OpenSans/OpenSans-Italic.ttf
Binary files differ
diff --git a/vid-app-common/src/main/webapp/app/vid/styles/fonts/OpenSans/OpenSans-Light.ttf b/vid-app-common/src/main/webapp/app/vid/styles/fonts/OpenSans/OpenSans-Light.ttf
new file mode 100644
index 0000000..0d38189
--- /dev/null
+++ b/vid-app-common/src/main/webapp/app/vid/styles/fonts/OpenSans/OpenSans-Light.ttf
Binary files differ
diff --git a/vid-app-common/src/main/webapp/app/vid/styles/fonts/OpenSans/OpenSans-LightItalic.ttf b/vid-app-common/src/main/webapp/app/vid/styles/fonts/OpenSans/OpenSans-LightItalic.ttf
new file mode 100644
index 0000000..68299c4
--- /dev/null
+++ b/vid-app-common/src/main/webapp/app/vid/styles/fonts/OpenSans/OpenSans-LightItalic.ttf
Binary files differ
diff --git a/vid-app-common/src/main/webapp/app/vid/styles/fonts/OpenSans/OpenSans-Regular.ttf b/vid-app-common/src/main/webapp/app/vid/styles/fonts/OpenSans/OpenSans-Regular.ttf
new file mode 100644
index 0000000..db43334
--- /dev/null
+++ b/vid-app-common/src/main/webapp/app/vid/styles/fonts/OpenSans/OpenSans-Regular.ttf
Binary files differ
diff --git a/vid-app-common/src/main/webapp/app/vid/styles/fonts/OpenSans/OpenSans-Semibold.ttf b/vid-app-common/src/main/webapp/app/vid/styles/fonts/OpenSans/OpenSans-Semibold.ttf
new file mode 100644
index 0000000..1a7679e
--- /dev/null
+++ b/vid-app-common/src/main/webapp/app/vid/styles/fonts/OpenSans/OpenSans-Semibold.ttf
Binary files differ
diff --git a/vid-app-common/src/main/webapp/app/vid/styles/fonts/OpenSans/OpenSans-SemiboldItalic.ttf b/vid-app-common/src/main/webapp/app/vid/styles/fonts/OpenSans/OpenSans-SemiboldItalic.ttf
new file mode 100644
index 0000000..59b6d16
--- /dev/null
+++ b/vid-app-common/src/main/webapp/app/vid/styles/fonts/OpenSans/OpenSans-SemiboldItalic.ttf
Binary files differ
diff --git a/vid-app-common/src/main/webapp/app/vid/styles/fonts/icomoon.eot b/vid-app-common/src/main/webapp/app/vid/styles/fonts/icomoon.eot
index e57ccc5..9a031a8 100644
--- a/vid-app-common/src/main/webapp/app/vid/styles/fonts/icomoon.eot
+++ b/vid-app-common/src/main/webapp/app/vid/styles/fonts/icomoon.eot
Binary files differ
diff --git a/vid-app-common/src/main/webapp/app/vid/styles/fonts/icomoon.svg b/vid-app-common/src/main/webapp/app/vid/styles/fonts/icomoon.svg
index 5d514c4..3b288d8 100644
--- a/vid-app-common/src/main/webapp/app/vid/styles/fonts/icomoon.svg
+++ b/vid-app-common/src/main/webapp/app/vid/styles/fonts/icomoon.svg
@@ -20,4 +20,7 @@
 <glyph unicode="&#xe90a;" glyph-name="noun_573805_cc-03" d="M512.211 960c-282.886 0-512.211-229.325-512.211-512.211s229.325-512.211 512.211-512.211c282.887 0 512.211 229.325 512.211 512.211v0c-0.017 282.88-229.332 512.195-512.21 512.211h-0.001zM261.202 377.71c-38.703 0-70.079 31.375-70.079 70.079s31.375 70.079 70.079 70.079c38.703 0 70.079-31.375 70.079-70.079v0c0.005-0.298 0.007-0.649 0.007-1.001 0-38.155-30.93-69.085-69.085-69.085-0.352 0-0.703 0.003-1.054 0.008l0.053-0.001zM512.211 377.71c-38.703 0-70.079 31.375-70.079 70.079s31.375 70.079 70.079 70.079c38.703 0 70.079-31.375 70.079-70.079v0c0-0.061 0-0.133 0-0.205 0-38.59-31.284-69.874-69.874-69.874-0.072 0-0.144 0-0.216 0h0.011zM763.221 377.71c-38.703 0-70.079 31.375-70.079 70.079s31.375 70.079 70.079 70.079c38.703 0 70.079-31.375 70.079-70.079v0c0-0.061 0-0.133 0-0.205 0-38.59-31.284-69.874-69.874-69.874-0.072 0-0.144 0-0.217 0h0.011z" />
 <glyph unicode="&#xe90b;" glyph-name="scedular" horiz-adv-x="981" d="M981.333 662.699c0.312 4.17 0.49 9.033 0.49 13.938 0 109.691-88.922 198.613-198.613 198.613-5.353 0-10.656-0.212-15.902-0.627l0.693 0.044h-554.667c-4.553 0.371-9.857 0.583-15.21 0.583-109.691 0-198.613-88.922-198.613-198.613 0-4.905 0.178-9.768 0.527-14.583l-0.038 0.645v-470.699c0-128.811 82.475-256 213.333-256h554.667c130.859 0 213.333 127.189 213.333 256v470.699zM36.352 662.699c0 109.141 66.048 169.301 176.981 169.301h554.667c110.933 0 176.981-60.16 176.981-169.301l-6.315-44.032h-896zM938.667 192c0-109.141-59.733-213.333-170.667-213.333h-554.667c-110.933 0-170.667 104.192-170.667 213.333v384h896v-384zM362.667 405.333h256c11.782 0 21.333-9.551 21.333-21.333s-9.551-21.333-21.333-21.333v0h-256c-11.782 0-21.333 9.551-21.333 21.333s9.551 21.333 21.333 21.333v0zM362.667 234.667h256c11.782 0 21.333-9.551 21.333-21.333s-9.551-21.333-21.333-21.333v0h-256c-11.782 0-21.333 9.551-21.333 21.333s9.551 21.333 21.333 21.333v0zM704 960c11.782 0 21.333-9.551 21.333-21.333v0-170.667c0-11.782-9.551-21.333-21.333-21.333s-21.333 9.551-21.333 21.333v0 170.667c0 11.782 9.551 21.333 21.333 21.333v0zM277.333 960c11.782 0 21.333-9.551 21.333-21.333v0-170.667c0-11.782-9.551-21.333-21.333-21.333s-21.333 9.551-21.333 21.333v0 170.667c0 11.782 9.551 21.333 21.333 21.333v0z" />
 <glyph unicode="&#xe90c;" glyph-name="finished_d" d="M512 960v0c-282.77 0-512-229.23-512-512v0c0-282.77 229.23-512 512-512s512 229.23 512 512c0 282.77-229.23 512-512 512zM473.454 273.993c8.558 13.239 15.067 22.894 21.138 32.768 91.648 149.211 118.126 170.569 209.701 319.781 5.105 9.183 10.457 17.077 16.416 24.459l-0.252-0.322c8.798 10.219 21.751 16.651 36.206 16.651 9.048 0 17.507-2.52 24.715-6.896l-0.212 0.119c13.74-7.345 22.93-21.594 22.93-37.989 0-6.179-1.305-12.053-3.655-17.361l0.108 0.274c-3.479-7.646-7.067-14.1-11.098-20.236l0.346 0.561c-108.251-176.859-151.479-225.646-259.803-402.286-7.527-16.71-24.034-28.132-43.21-28.132-13.809 0-26.235 5.924-34.874 15.369l-0.032 0.036q-107.52 91.502-213.138 184.978c-11.444 7.654-18.878 20.525-18.878 35.132 0 11.575 4.668 22.060 12.224 29.675l-0.003-0.003c9.080 9.371 21.781 15.187 35.84 15.187s26.76-5.816 35.827-15.174l0.013-0.013c46.738-39.643 92.672-80.457 138.971-120.32z" />
+<glyph unicode="&#xe90d;" glyph-name="search2" d="M421.647 182.965c-96.376 0-180.706 36.141-252.988 102.4-66.259 66.259-102.4 156.612-102.4 252.988s36.141 180.706 102.4 252.988c66.259 66.259 156.612 102.4 252.988 102.4s180.706-36.141 252.988-102.4c66.259-66.259 102.4-156.612 102.4-252.988s-36.141-180.706-102.4-252.988c-72.282-66.259-156.612-102.4-252.988-102.4zM1011.953-9.788l-271.059 271.059c66.259 78.306 102.4 174.682 102.4 271.059 0 114.447-42.165 216.847-120.471 295.153s-186.729 120.471-295.153 120.471c-114.447 0-216.847-42.165-295.153-120.471s-120.471-186.729-120.471-295.153c0-114.447 42.165-216.847 120.471-295.153s186.729-120.471 295.153-120.471c102.4 0 198.776 36.141 271.059 102.4l271.059-271.059c6.024-6.024 18.071-12.047 24.094-12.047s18.071 6.024 24.094 12.047c12.047 12.047 12.047 30.118-6.024 42.165z" />
+<glyph unicode="&#xe90e;" glyph-name="browse" horiz-adv-x="3584" d="M796.444 561.778c0-219.932-178.29-398.222-398.222-398.222s-398.222 178.29-398.222 398.222c0 219.932 178.29 398.222 398.222 398.222s398.222-178.29 398.222-398.222zM3584 561.778c0-219.932-178.29-398.222-398.222-398.222s-398.222 178.29-398.222 398.222c0 219.932 178.29 398.222 398.222 398.222s398.222-178.29 398.222-398.222zM2190.222 561.778c0-219.932-178.29-398.222-398.222-398.222s-398.222 178.29-398.222 398.222c0 219.932 178.29 398.222 398.222 398.222s398.222-178.29 398.222-398.222z" />
+<glyph unicode="&#xe90f;" glyph-name="sync" d="M878.933 358.4c21.333-4.267 34.176-29.867 29.867-55.467-21.333-59.733-59.691-115.2-102.357-157.867-81.109-81.067-187.776-123.733-302.976-123.733s-221.867 42.667-294.357 123.733l-123.776 119.467v-157.867c0-25.6-17.067-42.667-42.667-42.667-25.557 0-42.667 17.067-42.667 42.667v268.8c0 4.267 4.267 4.267 4.267 8.533 4.309 0 4.309 4.267 4.309 4.267 0 4.267 4.224 8.533 8.533 8.533 0 4.267 4.224 4.267 4.224 4.267h4.267c0 4.267 4.309 4.267 8.533 4.267h256c25.643 0 42.667-17.067 42.667-42.667s-17.024-42.667-42.667-42.667h-149.333l119.467-110.933c68.309-68.267 153.643-102.4 243.2-102.4 89.643 0 179.2 34.133 238.976 98.133 38.357 34.133 64 81.067 81.024 128 8.533 21.333 34.133 34.133 55.467 25.6zM958.406 831.276c25.6 0 42.667-17.067 42.667-42.667v-260.267c0-4.267 0-8.533-4.267-12.8 0-4.267-4.267-4.267-4.267-8.533-4.267 0-4.267-4.267-4.267-4.267-4.267-4.267-8.533-4.267-12.8-8.533s-12.8-4.267-17.067-4.267h-256c-25.6 0-42.667 17.067-42.667 42.667s17.067 42.667 42.667 42.667h149.333l-119.467 115.2c-34.133 38.4-81.067 64-128 81.067-85.333 29.867-179.2 25.6-260.267-12.8-81.067-42.667-145.067-110.933-174.933-196.267-8.533-21.333-34.133-34.133-55.467-25.6-21.333 4.267-34.133 29.867-25.6 51.2 38.4 110.933 115.2 196.267 217.6 243.2 102.4 51.2 217.6 55.467 328.533 21.333 59.733-21.333 115.2-59.733 157.867-102.4l123.733-119.467v157.867c0 25.6 17.067 42.667 42.667 42.667z" />
 </font></defs></svg>
\ No newline at end of file
diff --git a/vid-app-common/src/main/webapp/app/vid/styles/fonts/icomoon.ttf b/vid-app-common/src/main/webapp/app/vid/styles/fonts/icomoon.ttf
index 7d0e36d..acbb2aa 100644
--- a/vid-app-common/src/main/webapp/app/vid/styles/fonts/icomoon.ttf
+++ b/vid-app-common/src/main/webapp/app/vid/styles/fonts/icomoon.ttf
Binary files differ
diff --git a/vid-app-common/src/main/webapp/app/vid/styles/fonts/icomoon.woff b/vid-app-common/src/main/webapp/app/vid/styles/fonts/icomoon.woff
index b2d2e64..8a7b316 100644
--- a/vid-app-common/src/main/webapp/app/vid/styles/fonts/icomoon.woff
+++ b/vid-app-common/src/main/webapp/app/vid/styles/fonts/icomoon.woff
Binary files differ
diff --git a/vid-app-common/src/main/webapp/app/vid/styles/instantiate.css b/vid-app-common/src/main/webapp/app/vid/styles/instantiate.css
index 13e2cf0..e46a8b9 100755
--- a/vid-app-common/src/main/webapp/app/vid/styles/instantiate.css
+++ b/vid-app-common/src/main/webapp/app/vid/styles/instantiate.css
@@ -59,4 +59,12 @@
 
 div[ng-controller=InstantiationController] .aaiVisible {
 	visibility: visible;
+}
+
+div.resume {
+	display: inline;
+}
+
+a.button-margin {
+	margin-right: 8px;
 }
\ No newline at end of file
diff --git a/vid-app-common/src/main/webapp/app/vid/styles/messageViewer.css b/vid-app-common/src/main/webapp/app/vid/styles/messageViewer.css
new file mode 100644
index 0000000..9514d11
--- /dev/null
+++ b/vid-app-common/src/main/webapp/app/vid/styles/messageViewer.css
@@ -0,0 +1,17 @@
+.message-viewer {
+    text-align: center;
+}
+
+.message-viewer .primaryMessage {
+    font-size: 18px;
+    padding-top: 20px;
+}
+
+.message-viewer .btn-primary {
+    background-color: #009FDB;
+    color: #FFFFFF;
+    border: 1px solid #009FDB;
+    padding: 0px 25px;
+    height: 35px;
+    margin-top: 45px;
+}
\ No newline at end of file
diff --git a/vid-app-common/src/main/webapp/app/vid/styles/modal-buttons.css b/vid-app-common/src/main/webapp/app/vid/styles/modal-buttons.css
new file mode 100644
index 0000000..b5d3d31
--- /dev/null
+++ b/vid-app-common/src/main/webapp/app/vid/styles/modal-buttons.css
@@ -0,0 +1,29 @@
+.modal-footer .btn-white,
+.modal-footer .btn-white:hover {
+    font-family: "OpenSans-Semibold";
+    border-radius: 5px;
+    border: 1px solid #009FDB;
+    background-color:  #FFFFFF;
+    width: 120px;
+    height: 36px;
+    color:  #009FDB;
+    font-size: 13px;
+    line-height: 30px;
+    text-align: center;
+    padding: 4px 12px !important;
+}
+
+.modal-footer .btn-primary,
+.modal-footer .btn-primary:hover{
+    font-family: "OpenSans-Semibold";
+    border-radius: 5px;
+    border: 1px solid #009FDB;
+    background-color:  #009FDB;
+    width: 120px;
+    height: 36px;
+    color:  #FFFFFF;
+    font-size: 13px;
+    line-height: 30px;
+    text-align: center;
+    padding: 4px 12px !important;
+}
diff --git a/vid-app-common/src/main/webapp/app/vid/styles/modal-create-new.css b/vid-app-common/src/main/webapp/app/vid/styles/modal-create-new.css
new file mode 100644
index 0000000..1a293c0
--- /dev/null
+++ b/vid-app-common/src/main/webapp/app/vid/styles/modal-create-new.css
@@ -0,0 +1,196 @@
+.modal-dialog {
+    width: 587px;
+    border-radius: 8px;
+}
+
+.modal-content {
+    width: 587px;
+    border-radius: 8px;
+    background-color:  #ffffff;
+    font-family: "OpenSans-Regular";
+}
+
+.modal-content .modal-body {
+    padding: 15px 35px 5px 35px;
+}
+
+.modal-body .connect-error,
+.modal-body .icon-alert.error {
+    font-family: OpenSans-Regular !important;
+    color: #CF2A2A;
+    font-size: 14px;
+}
+
+.modal-body .icon-alert:before {
+    color: #CF2A2A;
+    cursor: default;
+    font-family: 'icomoon' !important;
+    padding-right: 5px;
+}
+
+.modal-header {
+    border: none!important;
+    padding: 15px 35px 0px 35px!important;
+}
+
+.modal-header h3 {
+    font-family: "OpenSans-Regular";
+    color:  #191919;
+    font-size: 22px;
+    font-weight: 300;
+    line-height: 16px;
+    padding-bottom: 20px;
+    border-bottom: 3px solid #009fdb;
+
+}
+
+.modal-close {
+    margin: -40px 5px 0 0;
+    color: #5a5a5a;
+    font-size: 20px;
+    cursor: pointer;
+}
+
+.form-group .control-label {
+    font-family: OpenSans-Semibold;
+    font-size: 12px;
+    color: #191919;
+}
+
+select {
+    background: url(../images/chevron.png) no-repeat 98% 10px !important;
+}
+
+input::placeholder {
+    text-align: left;
+    font-family: OpenSans-Regular;
+    font-size: 14px;
+    color: #a9a9a9;
+}
+
+.form-group .connect-error {
+    border: 1.5px solid #CF2A2A;
+}
+
+.form-group .grayedOut {
+    font-family: OpenSans-Regular;
+    font-size: 14px;
+    color: #a9a9a9;
+    opacity: 0.54;
+}
+
+.form-group .grayedOut option {
+    font-family: OpenSans-Regular;
+    font-size: 14px;
+    color: #555;
+    opacity: 1;
+}
+
+button.dropdown-toggle {
+    text-align: left;
+}
+
+button[disabled].dropdown-toggle {
+    opacity: 1;
+    cursor: not-allowed;
+    background-color: #eee;
+    border: 1px solid #aaa;
+    color: #a0a0a0;
+}
+
+multiselect[disabled] {
+    cursor: not-allowed;
+}
+
+a.item-unselected:before {
+    font-family: "icomoon"!important;
+    content: "\e90c";
+    color: #4ca90c;
+}
+
+.form-create .modal-footer {
+    margin-top: 0;
+}
+
+.form-create .modal-footer .btn,
+.form-create .modal-footer .btn:hover {
+    font-family: "OpenSans-Semibold";
+    border-radius: 5px;
+    border: 1px solid #009FDB;
+    font-size: 13px;
+    line-height: 30px;
+    text-align: center;
+    padding: 4px 12px !important;
+    width: 120px;
+    height: 36px;
+}
+
+.form-create .modal-footer .btn-white,
+.form-create .modal-footer .btn-white:hover {
+    background-color:  #FFFFFF;
+    color:  #009FDB;
+}
+
+.form-create .modal-footer .btn-primary,
+.form-create .modal-footer .btn-primary:hover{
+    background-color:  #009FDB;
+    color:  #FFFFFF;
+}
+
+.vnf-versions-container .table {
+    position: relative;
+    background-color: #f8f8f8;
+    background-clip: padding-box;
+    border-radius: 6px;
+    outline: 0;
+}
+
+.file-wrapper {
+    display: flex;
+}
+
+.file-input {
+    display: inline-block !important;
+    width: 0.1px;
+}
+
+.file-input-label {
+    width: 389px;
+    height: 37px;
+    background: #FFFFFF;
+    border: 1px solid #D2D2D2;
+    border-radius: 2px;
+    display: inline-block;
+    line-height: 37px;
+    font-weight: normal !important;
+    padding-left: 12px;
+    border-bottom-right-radius: 0;
+    border-top-right-radius: 0;
+    flex: 1;
+}
+
+.vnf-versions-name {
+    padding-top: 6px;
+    font-family: "OpenSans-Regular";
+    position: absolute;
+}
+
+.vnf-versions-select-as-text {
+    font-family: "OpenSans-Regular";
+    appearance: none;
+    -webkit-appearance: none;
+    -moz-appearance: none;
+    border: none;
+    overflow:hidden;
+    background-color: #f8f8f8;
+    height: 31px;
+}
+
+.vnf-files-select {
+    z-index: 999;
+    opacity: 0.0;
+    position: absolute;
+    width: 23%;
+    cursor: pointer;
+    height:100%;
+}
\ No newline at end of file
diff --git a/vid-app-common/src/main/webapp/app/vid/styles/modals.css b/vid-app-common/src/main/webapp/app/vid/styles/modals.css
new file mode 100644
index 0000000..edc89b9
--- /dev/null
+++ b/vid-app-common/src/main/webapp/app/vid/styles/modals.css
@@ -0,0 +1,52 @@
+@font-face {
+    font-family: OpenSans-Light;
+    src: url("fonts/OpenSans/OpenSans-Light.ttf") format('truetype');
+}
+@font-face {
+    font-family: OpenSans-Regular;
+    src: url("fonts/OpenSans/OpenSans-Regular.ttf") format('truetype');
+}
+@font-face {
+    font-family: OpenSans-Semibold;
+    src: url("fonts/OpenSans/OpenSans-Semibold.ttf") format('truetype');
+}
+
+.modal-header * {
+    font-family: OpenSans-Light;
+}
+.modal-body * {
+    font-family: OpenSans-Regular;
+}
+.modal-footer * {
+    font-family: OpenSans-Semibold;
+}
+
+.modal-header {
+    border-bottom: 3px solid;
+    margin: auto;
+    width: 95%;
+    padding: 10px 0;
+    font-size: 22px;
+}
+.modal-header #cancel {
+    cursor: pointer;
+}
+.modal-title {
+    float: left;
+}
+.modal-content {
+    font-size: 15px;
+    border-radius: 0;
+    color: #191919;
+}
+.modal-footer {
+    background-color: #F8F8F8;
+    height: 60px;
+}
+.modal-footer .btn {
+    color: #FFF;
+    background-color: #009FDB;
+    border-color: #009FDB;
+    margin-right: 0;
+    font-size: 13px;
+}
\ No newline at end of file
diff --git a/vid-app-common/src/main/webapp/app/vid/styles/networkNode.css b/vid-app-common/src/main/webapp/app/vid/styles/networkNode.css
new file mode 100644
index 0000000..74fa9fc
--- /dev/null
+++ b/vid-app-common/src/main/webapp/app/vid/styles/networkNode.css
@@ -0,0 +1,271 @@
+@font-face {
+    font-family: OpenSans-Bold;
+    src: url("fonts/OpenSans/OpenSans-Bold.ttf") format('truetype');
+}
+
+@font-face {
+    font-family: OpenSans-BoldItlaic;
+    src: url("fonts/OpenSans/OpenSans-BoldItalic.ttf") format('truetype');
+}
+
+@font-face {
+    font-family: OpenSans-ExtraBold;
+    src: url("fonts/OpenSans/OpenSans-ExtraBold.ttf") format('truetype');
+}
+
+@font-face {
+    font-family: OpenSans-ExtraBoldItalic;
+    src: url("fonts/OpenSans/OpenSans-ExtraBoldItalic.ttf") format('truetype');
+}
+
+@font-face {
+    font-family: OpenSans-Italic;
+    src: url("fonts/OpenSans/OpenSans-Italic.ttf") format('truetype');
+}
+
+@font-face {
+    font-family: OpenSans-Light;
+    src: url("fonts/OpenSans/OpenSans-Light.ttf") format('truetype');
+}
+
+@font-face {
+    font-family: OpenSans-LightItalic;
+    src: url("fonts/OpenSans/OpenSans-LightItalic.ttf") format('truetype');
+}
+
+@font-face {
+    font-family: OpenSans-Regular;
+    src: url("fonts/OpenSans/OpenSans-Regular.ttf") format('truetype');
+}
+
+@font-face {
+    font-family: OpenSans-Semibold;
+    src: url("fonts/OpenSans/OpenSans-Semibold.ttf") format('truetype');
+}
+
+@font-face {
+    font-family: OpenSans-SemiboldItalic;
+    src: url("fonts/OpenSans/OpenSans-SemiboldItalic.ttf") format('truetype');
+}
+
+.templatebody{
+    background-color: white !important;
+}
+.network-wrapper-config * {
+    font-family: OpenSans-Regular, sans-serif;
+}
+.body-content-jsp {
+    margin-top: 35px;
+    margin-left: 201px;
+    margin-right: 0px;
+    background-color: white;
+}
+.temporary-solution {
+    height: 0px;
+}
+.sprite {
+    background: url('../images/sprite.png') no-repeat;
+    display: inline-block;
+}
+.modal-x {
+    background-position: -198px -315px;
+    width: 10px;
+    height: 10px;
+}
+.modal-x:hover{
+    background-position: -198px -338px;
+}
+.sprite.checkbox {
+    background-position: -218px -335px;
+    width: 14px;
+    height: 14px;
+}
+.sprite.checkbox-checked {
+    background-position: -218px -311px;
+}
+.sprite.checkbox-disabled {
+    background-position: -218px -359px;
+}
+button {
+    border-radius: 2px;
+    font-size: 14px;
+    line-height: 28px;
+    height: 30px;
+}
+button.blue {
+    border: #0091c8 1px solid;
+    background-color: #009fdb;
+    color: white;
+}
+button.blue:hover {
+    background-color: #1ec2ff;
+    border-color: #0091c8;
+}
+button.blue:active {
+    background-color: #0091c7;
+    border-color: #006186;
+}
+button.blue[disabled] {
+    background-color: rgba(5, 104, 174, 0.3);
+    border-color: rgba(4, 113, 168, 0.3);
+}
+button.grey {
+    color: #009FDB;
+    background-color: #ffffff;
+    border: 1px solid #009FDB;
+}
+button.grey:hover {
+    background-color: #f8f8f8;
+    border-color: #009fdb;
+}
+button.grey:active {
+    background-color: #d8d8d8;
+    border-color: #5a5a5a;
+}
+button.grey[disabled] {
+    background-color: #f8f8f8;
+    border-color: #d8d8d8;
+    color: #cdcdcd;
+}
+button.white {
+    border: #009fdb 1px solid;
+    background-color: white;
+    color: #009fdb;
+}
+input[type=checkbox] {
+    display: none;
+}
+input[type=checkbox] + label {
+    position: relative;
+    padding-left: 2px;
+    text-indent: 19px;
+    line-height: 15px;
+}
+input[type=checkbox] + label::after {
+    background: url('../images/sprite.png') no-repeat;
+    display: inline-block;
+    background-position: -218px -335px;
+    width: 14px;
+    height: 14px;
+    padding-left: 21px;
+    margin-right: 25px;
+    line-height: 15px;
+    color: #5a5a5a;
+    content: '';
+    position: absolute;
+    left: 0;
+    top: 0;
+}
+input[type=checkbox] + label::after.checkbox {
+    background-position: -218px -335px;
+    width: 14px;
+    height: 14px;
+}
+input[type=checkbox] + label::after.checkbox-checked {
+    background-position: -218px -311px;
+}
+input[type=checkbox] + label::after.checkbox-disabled {
+    background-position: -218px -359px;
+}
+input[type=checkbox]:checked + label::after {
+    background: url('../images/sprite.png') no-repeat;
+    display: inline-block;
+    background-position: -218px -311px;
+}
+input[type=checkbox]:checked + label::after.checkbox {
+    background-position: -218px -335px;
+    width: 14px;
+    height: 14px;
+}
+input[type=checkbox]:checked + label::after.checkbox-checked {
+    background-position: -218px -311px;
+}
+input[type=checkbox]:checked + label::after.checkbox-disabled {
+    background-position: -218px -359px;
+}
+input[type=checkbox]:disabled + label::after {
+    background: url('../images/sprite.png') no-repeat;
+    display: inline-block;
+    background-position: -218px -359px;
+}
+input[type=checkbox]:disabled + label::after.checkbox {
+    background-position: -218px -335px;
+    width: 14px;
+    height: 14px;
+}
+input[type=checkbox]:disabled + label::after.checkbox-checked {
+    background-position: -218px -311px;
+}
+input[type=checkbox]:disabled + label::after.checkbox-disabled {
+    background-position: -218px -359px;
+}
+.network-wrapper-config {
+    width: 100%;
+}
+.network-wrapper-config .head {
+    line-height: 59px;
+    height: 59px;
+    display: flex;
+    background-color: #F8F8F8;
+    border-bottom: 1px solid #D8D8D8;
+}
+.network-wrapper-config .head  .title {
+    font-size: 18px;
+    margin-left: 56px;
+    color: #5A5A5A;
+}
+.network-wrapper-config .head .btn-wrapper {
+    flex: 1;
+    text-align: right;
+    margin-right: 15px;
+}
+.network-wrapper-config .head  .btn-wrapper button {
+    width: 120px;
+}
+.network-wrapper-config .head  .btn-wrapper button.delete-btn{
+    margin-left: 13px;
+}
+.network-wrapper-config .content-wrapper {
+    display: flex;
+}
+.network-wrapper-config .content-wrapper .sidebar-right {
+    width: 25%;
+    min-width: 400px;
+    background-color: #F8F8F8;
+}
+.network-wrapper-config .content-wrapper .content {
+    width: 75%;
+    margin-top: 48px;
+}
+.network-wrapper-config .content-wrapper .content .form-wrapper {
+    width: 640px;
+    margin: 0 auto;
+}
+.network-wrapper-config span.error {
+    color: #cf2a2a;
+}
+.network-wrapper-config .content-wrapper .content .form-wrapper .instance-field .ng-invalid-pattern{
+    border-color: #cf2a2a;
+    color:  #cf2a2a;
+}
+.network-wrapper-config .content-wrapper .content .form-wrapper .instance-field {
+    margin-bottom: 25px;
+}
+.network-wrapper-config .content-wrapper .content .form-wrapper .instance-field label{
+    color: #191919;
+    font-size: 13px;
+}
+
+.network-wrapper-config .content-wrapper .content .form-wrapper .instance-field input,
+.network-wrapper-config .content-wrapper .content .form-wrapper .instance-field select{
+    border-color: #D2D2D2;
+}
+
+.network-wrapper-config .content-wrapper .content .form-wrapper .instance-field.lcpRegionText,
+.network-wrapper-config .content-wrapper .content .form-wrapper .instance-field.productFamily{
+    display: none;
+}
+
+.sidebar-right service-metadata .metadata-content{
+    padding-bottom: 20px;
+}
\ No newline at end of file
diff --git a/vid-app-common/src/main/webapp/app/vid/styles/pnfSearchAssociation.css b/vid-app-common/src/main/webapp/app/vid/styles/pnfSearchAssociation.css
new file mode 100644
index 0000000..5cf16d8
--- /dev/null
+++ b/vid-app-common/src/main/webapp/app/vid/styles/pnfSearchAssociation.css
@@ -0,0 +1,82 @@
+@font-face {
+    font-family: 'icomoon';
+    src:  url('fonts/icomoon.eot?4cilop');
+    src:  url('fonts/icomoon.eot?4cilop#iefix') format('embedded-opentype'),
+    url('fonts/icomoon.ttf?4cilop') format('truetype'),
+    url('fonts/icomoon.woff?4cilop') format('woff'),
+    url('fonts/icomoon.svg?4cilop#icomoon') format('svg');
+    font-weight: normal;
+    font-style: normal;
+}
+
+.pnf-search-association [class^="icon-"],.pnf-search-association [class*=" icon-"] {
+    /* use !important to prevent issues with browser extensions that change fonts */
+    font-family: 'icomoon' !important;
+    speak: none;
+    font-style: normal;
+    font-weight: normal;
+    font-variant: normal;
+    text-transform: none;
+    line-height: 1;
+
+    /* Better Font Rendering =========== */
+    -webkit-font-smoothing: antialiased;
+    -moz-osx-font-smoothing: grayscale;
+}
+
+.search-input{
+    width:40px;
+    margin-left: -30px;
+    z-index: 2;
+    cursor: pointer;
+    display: inline-block;
+    position: absolute;
+    line-height: 40px;
+}
+.content-wrapper{
+     margin-left: 70px;
+     font-family: OpenSans-Semibold;
+ }
+.content-wrapper .content{
+    margin-top: 47px;
+}
+.input-wrapper{
+    margin-top: 6px;
+}
+input[type=search]{
+    /*border: none;*/
+    width: 415px;
+    height: 40px;
+    border: 1px solid #D2D2D2;
+    border-radius: 2px;
+}
+input[type=search]:before {
+/*    content: "\e90d";
+    color: #00aeef;
+    font-size: 50px;
+    cursor: pointer;
+    margin-left: 350px*/
+}
+.error-msg{
+    color: red;
+}
+.bold{
+    font-family: OpenSans-Semibold;
+}
+.margin-search{
+    margin-top: 37px;
+}
+.result-content span{
+    font-family: OpenSans-Semibold;
+}
+.result-content div{
+    margin-bottom: 24px;
+    margin-top: 3px;
+}
+.search2-icon:before {
+    font-family: 'icomoon';
+    content: "\e90d";
+    color: #009FDB;
+    font-size: 17px;
+    cursor: pointer;
+}
\ No newline at end of file
diff --git a/vid-app-common/src/main/webapp/app/vid/styles/search.css b/vid-app-common/src/main/webapp/app/vid/styles/search.css
new file mode 100644
index 0000000..8ab5ea8
--- /dev/null
+++ b/vid-app-common/src/main/webapp/app/vid/styles/search.css
@@ -0,0 +1,37 @@
+.search-container {
+    display: flex;
+    background: #FFFFFF;
+    border: 1px solid #D2D2D2;
+    border-radius: 2px;
+    width: 500px;
+}
+.search-container .search-input,
+.search-container .search-input:focus,
+.search-container .search-input:hover{
+    border: none;
+    padding: 10px;
+    display: inline-block;
+    width: 458px;
+    font-style: italic;
+}
+
+.search-container .search-input::placeholder {
+    text-align: left;
+}
+
+.search-container .search-icon {
+    display: inline-block;
+    margin: auto;
+    width: 16px;
+    height: 16px;
+}
+
+.search-container .search-icon svg path {
+    fill: #5A5A5A;
+}
+
+.search-container .search-icon:hover path {
+    fill: #009FDB;
+}
+
+
diff --git a/vid-app-common/src/main/webapp/app/vid/styles/serviceMetadata.css b/vid-app-common/src/main/webapp/app/vid/styles/serviceMetadata.css
new file mode 100644
index 0000000..c54b6d4
--- /dev/null
+++ b/vid-app-common/src/main/webapp/app/vid/styles/serviceMetadata.css
@@ -0,0 +1,18 @@
+service-metadata {
+    display: block;
+}
+service-metadata .header-title {
+    text-transform: uppercase;
+    font-size: 16px;
+    color: #191919;
+    background: #EAEAEA;
+    line-height: 40px;
+    padding-left: 20px;
+}
+service-metadata .metadata-content {
+    padding-left: 20px;
+}
+service-metadata .field {
+    margin-top: 15px;
+    font-size: 13px;
+}
\ No newline at end of file
diff --git a/vid-app-common/src/main/webapp/app/vid/styles/serviceModels.css b/vid-app-common/src/main/webapp/app/vid/styles/serviceModels.css
index 0a64299..a8dddb6 100755
--- a/vid-app-common/src/main/webapp/app/vid/styles/serviceModels.css
+++ b/vid-app-common/src/main/webapp/app/vid/styles/serviceModels.css
@@ -67,4 +67,8 @@
 
 div[ng-controller=ServiceModelController] .progVisible {
 	visibility: visible;
+}
+
+.previous-versions-button {
+	width: 113px;
 }
\ No newline at end of file
diff --git a/vid-app-common/src/main/webapp/app/vid/styles/serviceProxyConfig.css b/vid-app-common/src/main/webapp/app/vid/styles/serviceProxyConfig.css
new file mode 100644
index 0000000..d1ca37b
--- /dev/null
+++ b/vid-app-common/src/main/webapp/app/vid/styles/serviceProxyConfig.css
@@ -0,0 +1,154 @@
+.diagram  {
+    background: #F8F8F8;
+    padding: 48px 20px;
+    margin: 0px 48px;
+    display: flex;
+    flex-direction: column;
+}
+.diagram  .diagram-img {
+    margin: 0 auto;
+    display: flex;
+    width: 90%;
+}
+.circle {
+    float: left;
+    border: 3px solid;
+    width: 140px;
+    height: 140px;
+    border-radius: 50%;
+    flex: 0 0 140px;
+}
+.circle .text {
+    float: left;
+    width: 100%;
+    padding-top: 37%;
+    text-align: center;
+    font-size: 14px;
+    color: #191919;
+    line-height: 17px;
+}
+.config-circle {
+    border-color: #9063CD;
+    background-color: rgba(144,99,205,0.50);
+}
+.config-circle .line {
+    width: 3px;
+    background-color: #8f61cc;
+    margin: auto;
+    height: 100%;
+    display: block;
+}
+.service-circle {
+    border-color: #71C5E8;
+}
+.service-circle:hover {
+    background: rgba(113, 197, 232, 0.50);
+}
+.dotted-line {
+    border-bottom: 2px dashed #5a5a5a;
+    width: 200px;
+    float: left;
+    height: 70px;
+    flex: 1;
+}
+.dotted-line.unchecked .conn-circle {
+     width: 13px;
+     height: 13px;
+     margin: 54px auto;
+     display: block;
+     border: 15px solid #F8F8F8;
+}
+.dotted-line.unchecked .conn-circle:before {
+    content: "";
+    float: left;
+    background: #767676;
+    width: 13px;
+    height: 13px;
+    border-radius: 50%;
+    position: relative;
+    top: -6px;
+    right: 6px;
+}
+
+.valid-large {
+    background-position: -240px -154px;
+    width: 35px;
+    height: 35px;
+}
+.dotted-line.checked .conn-circle {
+    margin: 52px auto;
+    display: block;
+}
+.element-name {
+    color: #191919;
+    font-size: 14px;
+    width: 100%;
+    text-align: center;
+}
+.element-name.service {
+    flex: 50%;
+}
+.element-name-wrapper{
+    display: flex;
+    margin-top: 30px;
+}
+.element-name-wrapper  .element-name .label-txt {
+    color: #191919;
+    font-size: 14px;
+}
+.element-name-wrapper  .element-name.service .label-txt:hover {
+    color: #009FDB;
+    cursor: pointer;
+    text-align: center;
+}
+.element-name-wrapper  .element-name .info{
+    background: #009FDB;
+    border-radius: 50%;
+    height: 16px;
+    width: 16px;
+    color: white;
+    line-height: 15px;
+    padding-top: 1px;
+    margin-left: 10px;
+    margin-top: 2px;
+    cursor: pointer;
+    display: inline-block;
+}
+.service-wrapper-config .bottom {
+    display: flex;
+    height: 450px;
+    margin: 40px 48px;
+}
+.service-wrapper-config .wrapper-list {
+    flex: 50%;
+    height: 100%;
+}
+.service-wrapper-config .wrapper-list:first-child {
+    border-right: 1px dashed #D8D8D8;
+    margin-right: 50px;
+    padding-right: 50px;
+}
+.service-wrapper-config .title-txt {
+    color: #191919;
+    font-size: 13px;
+    margin-bottom: 10px;
+}
+
+.service-wrapper-config .select-vnf-title {
+    margin-top: 20px;
+}
+
+.ng-hide-keep-block.ng-hide:not(.ng-hide-animate) {
+    display: block!important;
+    visibility: hidden;
+}
+
+.service-wrapper-config select {
+    border-color: #D2D2D2;
+    background-position: 100% 4px;
+}
+.no-results {
+    margin-top: 10px;
+    text-align: center;
+    display: block;
+}
\ No newline at end of file
diff --git a/vid-app-common/src/main/webapp/app/vid/styles/testEnvironments.css b/vid-app-common/src/main/webapp/app/vid/styles/testEnvironments.css
new file mode 100644
index 0000000..4532111
--- /dev/null
+++ b/vid-app-common/src/main/webapp/app/vid/styles/testEnvironments.css
@@ -0,0 +1,215 @@
+.body-content-jsp {
+    margin-top: 35px;
+    min-height: 500px;
+    margin-left: 201px;
+    margin-right: 0px;
+    background-color: #f8f8f8;
+    display: flex;
+    flex-direction: column;
+}
+
+.temporary-solution {
+    display: none;
+}
+
+.body-content-jsp > div.ng-scope {
+    flex: 1;
+    display: flex;
+    flex-direction: column;
+}
+
+.body-content-jsp > div.ng-scope > div {
+    flex: 1;
+    display: flex;
+    flex-direction: column;
+}
+
+.test-environments {
+    background: white;
+    font-family: "OpenSans-Regular";
+    color: #797979;
+    flex:1;
+    display: flex;
+    flex-direction: column;
+}
+
+.test-environments .header {
+    height: 70px;
+    padding: 15px;
+    background: #F8F8F8;
+}
+.test-environments .header .header-left {
+    display: inline-flex;
+    align-items: center;
+}
+
+.test-environments .headline {
+    color: #5A5A5A;
+    font-size: 22px;
+    text-align: left;
+}
+
+.test-environments .separator {
+    height: 40px;
+    border-left: 1px solid #D2D2D2;
+    margin: 0px 20px;
+}
+
+.test-environments .header .button-container {
+    display: flex;
+    align-items: center;
+    cursor: pointer;
+}
+
+.test-environments .error-messages {
+    margin: auto;
+}
+
+.test-environments .error-messages .no-data svg path {
+    fill: #D2D2D2;
+}
+
+.test-environments .error-messages .no-data .secondaryMessage,
+.test-environments .error-messages .connect-error .secondaryMessage {
+    color: #D2D2D2;
+}
+
+.test-environments .error-messages .connect-error svg path {
+    fill: red;
+}
+
+.test-environments .error-messages .connect-error .primaryMessage {
+    color: red;
+}
+
+.test-environments .button-container svg {
+    fill: #009FDB;
+}
+
+.test-environments .button-container .button-text{
+    color: #5A5A5A;
+    padding-left: 10px;
+}
+
+.test-environments .search-container {
+    float: right;
+    margin-right: 40px;
+}
+
+.test-environments .refresh:focus {
+    outline: none;
+}
+
+.test-environments .refresh {
+    float: right;
+    width: 20px;
+    height: 20px;
+    border: none;
+    background: none;
+    padding: 0;
+    margin-bottom: 15px;
+}
+
+.test-environments .refresh svg{
+    height: 20px;
+    width: 20px;
+}
+
+.test-environments .refresh svg path {
+    fill: #5A5A5A;
+}
+
+.test-environments .refresh:hover path {
+    fill: #009FDB;
+}
+
+.test-environments .error {
+    text-align: center;
+    color: red;
+}
+
+.test-environments .environments-table {
+    margin: 40px;
+}
+
+.test-environments .environments-table .tablesorter-default {
+    cursor: default;
+}
+
+.test-environments .environments-table .tablesorter-default thead .tablesorter-header .tablesorter-header-inner {
+    background-image: none;
+    background-size: 8px;
+}
+
+.test-environments .environments-table .tablesorter-default thead .tablesorter-headerAsc .tablesorter-header-inner {
+    background-image: url('../images/sort_down.svg');
+}
+
+.test-environments .environments-table .tablesorter-default thead .tablesorter-headerDesc .tablesorter-header-inner {
+    background-image: url('../images/sort_up.svg');
+}
+
+.test-environments .environments-table .thead-default tr th {
+    background: #EAEAEA;
+    color: #191919;
+    font-size: 13px;
+    font-weight: 600;
+    vertical-align: middle;
+}
+
+.test-environments .environments-table .thead-default tr th .tablesorter-header-inner {
+    padding-right: 10px;
+}
+
+.test-environments .environments-table .thead-default tr th span {
+    white-space: nowrap;
+    overflow: hidden;
+    text-overflow: ellipsis;
+}
+
+.test-environments .environments-table .thead-default tr th:first-child {
+    min-width: 150px;
+}
+
+/*.test-environments .environments-table .thead-default tr th:*/
+
+.test-environments .environments-table .tablesorter-header-inner {
+    padding: 0;
+    width: 100%;
+}
+
+.test-environments .environments-table .tablesorter-default tbody td {
+    background: white;
+    font-size: 14px;
+    padding: 12px 8px;
+}
+
+.test-environments .environments-table .tablesorter-default tbody tr:focus td {
+    background: #E6F6FB;
+}
+
+.test-environments .environments-table .tablesorter-default tbody tr:focus {
+    border: none;
+    outline: none;
+}
+
+.attach-button {
+    margin-left: 35px;
+}
+
+.envActionBtn {
+    width: 94px;
+    height: 30px;
+}
+
+#environments-table {
+    margin-top: 0;
+}
+
+.test-environments-table-container {
+    overflow: auto;
+    max-height: 50vh;
+    width: 98%;
+    margin-left: 15px;
+    padding-left: 0;
+}
diff --git a/vid-app-common/src/main/webapp/app/vid/styles/vidTree.css b/vid-app-common/src/main/webapp/app/vid/styles/vidTree.css
index 1aec73d..7904b36 100755
--- a/vid-app-common/src/main/webapp/app/vid/styles/vidTree.css
+++ b/vid-app-common/src/main/webapp/app/vid/styles/vidTree.css
@@ -64,4 +64,8 @@
     -webkit-box-sizing: border-box;
     -moz-box-sizing: border-box;
     box-sizing: border-box;
+}
+
+.pull-right .dropdown-menu {
+    background-color: transparent;
 }
\ No newline at end of file
diff --git a/vid-app-common/src/main/webapp/test.jsp b/vid-app-common/src/main/webapp/test.jsp
index 1b0c14a..e13cd4b 100755
--- a/vid-app-common/src/main/webapp/test.jsp
+++ b/vid-app-common/src/main/webapp/test.jsp
@@ -3,16 +3,16 @@
 <!-- This is a temporary test page. It will be removed from source control -->
 <body>
 <%@ page import="org.openecomp.portalsdk.core.util.SystemProperties" %>
-<%@ page import="org.openecomp.vid.controller.MsoController" %>
-<%@ page import="org.openecomp.vid.mso.rest.Request" %>
-<%@ page import="org.openecomp.vid.mso.rest.RequestDetails" %>
-<%@ page import="org.openecomp.vid.mso.rest.RelatedModel" %>
-<%@ page import="org.openecomp.vid.domain.mso.SubscriberInfo" %>
-<%@ page import="org.openecomp.vid.domain.mso.Response" %>
-<%@ page import="org.openecomp.vid.domain.mso.ModelInfo" %>
-<%@ page import="org.openecomp.vid.domain.mso.RequestInfo" %>
-<%@ page import="org.openecomp.vid.domain.mso.CloudConfiguration" %>
-<%@ page import="org.openecomp.vid.mso.MsoProperties" %>
+<%@ page import="org.onap.vid.controller.MsoController" %>
+<%@ page import="org.onap.vid.mso.rest.Request" %>
+<%@ page import="org.onap.vid.mso.rest.RequestDetails" %>
+<%@ page import="org.onap.vid.mso.rest.RelatedModel" %>
+<%@ page import="org.onap.vid.domain.mso.SubscriberInfo" %>
+<%@ page import="org.onap.vid.domain.mso.Response" %>
+<%@ page import="org.onap.vid.domain.mso.ModelInfo" %>
+<%@ page import="org.onap.vid.domain.mso.RequestInfo" %>
+<%@ page import="org.onap.vid.domain.mso.CloudConfiguration" %>
+<%@ page import="org.onap.vid.mso.MsoProperties" %>
 <%@ page import="java.net.URI" %>
 <%@ page import="com.sun.jersey.api.client.ClientResponse" %>
   <%
diff --git a/vid-app-common/src/test/java/org/onap/aai/util/JettyObfuscationConversionCommandLineUtilTest.java b/vid-app-common/src/test/java/org/onap/aai/util/JettyObfuscationConversionCommandLineUtilTest.java
new file mode 100644
index 0000000..8e2e223
--- /dev/null
+++ b/vid-app-common/src/test/java/org/onap/aai/util/JettyObfuscationConversionCommandLineUtilTest.java
@@ -0,0 +1,22 @@
+package org.onap.aai.util;
+
+import org.junit.Test;
+import org.onap.vid.aai.util.JettyObfuscationConversionCommandLineUtil;
+
+public class JettyObfuscationConversionCommandLineUtilTest {
+
+	private JettyObfuscationConversionCommandLineUtil createTestSubject() {
+		return new JettyObfuscationConversionCommandLineUtil();
+	}
+
+	
+	@Test
+	public void testMain() throws Exception {
+		String[] args = new String[] { "" };
+
+		// default test
+		JettyObfuscationConversionCommandLineUtil.main(args);
+	}
+
+	
+}
\ No newline at end of file
diff --git a/vid-app-common/src/test/java/org/onap/aai/util/TestSuite.java b/vid-app-common/src/test/java/org/onap/aai/util/TestSuite.java
new file mode 100644
index 0000000..b4faaa2
--- /dev/null
+++ b/vid-app-common/src/test/java/org/onap/aai/util/TestSuite.java
@@ -0,0 +1,11 @@
+package org.onap.aai.util;
+
+import org.junit.runner.RunWith;
+import org.junit.runners.Suite;
+
+@RunWith(Suite.class)
+@Suite.SuiteClasses(
+
+{  JettyObfuscationConversionCommandLineUtilTest.class })
+public class TestSuite { // nothing
+}
diff --git a/vid-app-common/src/test/java/org/onap/ecomp/vid/selenium/FirstClass.java b/vid-app-common/src/test/java/org/onap/ecomp/vid/selenium/FirstClass.java
new file mode 100644
index 0000000..d0da08c
--- /dev/null
+++ b/vid-app-common/src/test/java/org/onap/ecomp/vid/selenium/FirstClass.java
@@ -0,0 +1,606 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * VID
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.ecomp.vid.selenium;
+
+import org.testng.annotations.AfterClass;
+import org.testng.annotations.AfterMethod;
+import org.testng.annotations.AfterSuite;
+import org.testng.annotations.BeforeClass;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.BeforeSuite;
+import org.testng.annotations.BeforeTest;
+import org.testng.annotations.Test;
+
+
+import org.openqa.selenium.By;
+import org.openqa.selenium.WebDriver;
+import org.openqa.selenium.WebElement;
+import org.openqa.selenium.firefox.FirefoxDriver;
+import org.openqa.selenium.ie.InternetExplorerDriver;
+import org.openqa.selenium.support.ui.Select;
+
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.List;
+import java.util.Properties;
+import java.util.concurrent.TimeUnit;
+import org.apache.log4j.Logger;
+import org.testng.Assert;
+import org.testng.asserts.*;
+
+/**
+ * The Class FirstClass.
+ */
+public class FirstClass {
+	
+		/** The login button. */
+		WebElement loginButton;
+		
+		/** The eg. */
+		String eg;
+		
+		/** The login. */
+		WebElement login;
+		
+		/** The pwd. */
+		WebElement pwd;
+		
+		/** The log. */
+		Logger log;
+		
+		/** The errormessage. */
+		WebElement errormessage;
+		
+					
+		/** The driver. */
+		WebDriver driver=new FirefoxDriver();
+		
+		
+		
+		/** The config prop. */
+		private final Properties configProp = new Properties();
+		
+		
+		/**
+		 * Instantiates a new first class.
+		 */
+		private  FirstClass() {
+			// TODO Auto-generated constructor stub
+			//
+			try{
+			//	InputStream input =this.getClass().getClassLoader().getResourceAsStream("objectmap.properties");
+			//FileInputStream input1 = new FileInputStream("objectmap.properties");
+				
+			InputStream input =new FileInputStream("objectconfig.properties");
+			System.out.println("Read all properties from file");
+			configProp.load(input);
+			System.out.println("Read all properties from file completed");
+			}
+			catch(IOException e) {
+				
+				e.printStackTrace();
+			}
+		}
+		
+		
+		/*
+		
+		
+		@BeforeClass
+		public void setUp() {
+			System.out.println("*******************");
+			System.out.println("launching IE browser");
+			System.setProperty("webdriver.ie.driver", driverPath+"IEDriverServer.exe");
+			driver = new InternetExplorerDriver();
+			driver.findElement(By.className());
+			driver.manage().window().maximize();
+			
+
+			 login = driver.findElement(By.xpath("//input[@class='fn-ebz-text ng-pristine ng-valid']"));
+			 pwd = driver.findElement(By.xpath("//input[@class='span3 ng-pristine ng-valid']"));
+			 loginButton = driver.findElement(By.id("loginBtn"));
+		}
+		
+		
+	*/
+		/**
+		 * Sets the up.
+		 */
+		// TODO Auto-generated method stub
+		@BeforeClass
+		public void setUp()
+		{
+			
+						
+			//WebDriver driver=new FirefoxDriver();
+			
+			log = Logger.getLogger(FirstClass.class.getName());
+		
+		
+		
+		// Get url
+		driver.get(configProp.getProperty("baseURL"));
+		driver.manage().window().maximize();
+		
+		
+		 login = driver.findElement(By.xpath(configProp.getProperty("login")));
+		 
+		 pwd = driver.findElement(By.xpath(configProp.getProperty("pwd")));
+		 loginButton = driver.findElement(By.id(configProp.getProperty("loginButton")));
+		}
+		
+		
+		/**
+		 * Empty username password.
+		 */
+		@Test(priority=1)
+		public void emptyUsernamePassword()
+		{
+		
+			
+		//User Name and Password field is empty
+		log.info("-----VID-11 TC-8----Username and password empty");
+		loginButton.click();
+		errormessage=driver.findElement(By.xpath("//*[@id='errorInfo']/span"));
+		String errmsg= errormessage.getText();
+		//System.out.println("Error message is"+errmsg);
+		//String expected = "Invaild username or password, Please try again";
+		
+		//Assert.assertEquals(errmsg,expected);
+
+		Boolean str = driver.getPageSource().contains("Invalid username or password, Please try again");
+		System.out.println(driver.getPageSource().contains("Invalid username or password, Please try again"));
+		
+		if(str==true)
+		{
+			log.info("Error message validated");
+			log.info("VID-11 TC-8 PASSED");
+			
+		}else
+			log.error("Failed validation");
+		
+		}
+
+
+		
+		/**
+		 * Invalid user name.
+		 */
+		@Test(priority=2)
+		public void invalidUserName()
+		{
+		
+		log.info("-----VID-11 TC-6----Invalid Username and Valid Password");
+		
+		
+		login.sendKeys("xxx");
+		pwd.sendKeys("abc123");
+		loginButton.click();
+		try {
+			Thread.sleep(5000);
+		} catch (InterruptedException e) {
+			// TODO Auto-generated catch block
+			e.printStackTrace();
+		}
+		
+		String errmsg= errormessage.getText();
+		String expected = "Invalid username or password, Please try again";
+		Assert.assertEquals(errmsg,expected);
+		//Boolean str1 = driver.getPageSource().contains("Invalid username or password, Please try again");
+		//System.out.print(str1);
+		
+		log.info("VID-11 TC-6 PASSED");
+				
+		}
+		
+		
+		/**
+		 * Invalid password.
+		 */
+		@Test(priority=3)
+		public void invalidPassword()
+		{
+		log.info("-----VID-11 TC-7----Valid Username and Invalid Password");
+		//  Valid user name and Invalid password.
+				login.clear();
+				pwd.clear();
+				login.sendKeys("testuser");
+				pwd.sendKeys("xxx");
+				loginButton.click();
+				driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
+		
+				
+				String errmsg= errormessage.getText();
+				String expected = "Invalid username or password, Please try again";
+				Assert.assertEquals(errmsg,expected);
+				
+				//Boolean str2 = driver.getPageSource().contains("Invaild username or password, Please try again");
+				//System.out.print(str2);
+				
+				log.info("VID-11 TC-7 PASSED");
+		}
+		
+			
+		/**
+		 * Login successful.
+		 */
+		@Test(priority=4)
+		public void loginSuccessful()
+		{
+		log.info("-----VID-11 TC-1----Valid Username and Valid Password");
+		//Login with valid user name and password.
+		login.clear();
+		login.sendKeys("su");
+		pwd.clear();
+		pwd.sendKeys("fusion");
+		
+				
+		loginButton.click();
+		driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
+		
+		try {
+			Thread.sleep(6000);
+		} catch (InterruptedException e) {
+			// TODO Auto-generated catch block
+			e.printStackTrace();
+		}
+		Assert.assertTrue(driver.getPageSource().contains("Search Existing Service Instances"));
+		log.info("VID-11 TC-1 PASSED");
+		
+		}
+		
+		
+		/**
+		 * Verify home page elements left pane.
+		 */
+		@Test(priority=5)
+		public void verifyHomePageElementsLeftPane()
+		
+		{
+			
+			
+			log.info("VID-10 TC 1 ");
+			//VID Home
+			log.info("VID 11 TC-2");
+			driver.findElement(By.xpath("html/body/div[1]/div[1]/div/div/div[2]/div/div/div[1]/div/div/accordion/div/div[1]/a/span")).isDisplayed();
+			//Create New Service Instance
+			driver.findElement(By.xpath("html/body/div[1]/div[1]/div/div/div[2]/div/div/div[1]/div/div/accordion/div/div[2]/a/span")).isDisplayed();
+			
+			//Browse Service Type
+			driver.findElement(By.xpath("html/body/div[1]/div[1]/div/div/div[2]/div/div/div[1]/div/div/accordion/div/div[3]/a/span")).isDisplayed();
+			//View Log		
+			driver.findElement(By.xpath("html/body/div[1]/div[1]/div/div/div[2]/div/div/div[1]/div/div/accordion/div/div[4]/a/span")).isDisplayed();
+			
+			//Profile
+			driver.findElement(By.xpath("html/body/div[1]/div[1]/div/div/div[2]/div/div/div[1]/div/div/accordion/div/div[5]/a/span")).isDisplayed();
+			//Admin
+			driver.findElement(By.xpath("html/body/div[1]/div[1]/div/div/div[2]/div/div/div[1]/div/div/accordion/div/div[6]/a/span")).isDisplayed();
+			//Logout
+			driver.findElement(By.xpath("html/body/div[1]/div[1]/div/div/div[2]/div/div/div[1]/div/div/accordion/div/div[7]/a/span")).isDisplayed();
+			
+			//Infrastructure Subscriber Name
+			driver.findElement(By.xpath(".//*[@id='mContent']/div/div/table/tbody/tr[1]/td[1]/div/label")).isDisplayed();
+			//Infrastructure Subscriber Name Select Drop down
+			driver.findElement(By.xpath(".//*[@id='mContent']/div/div/table/tbody/tr[1]/td[2]/div/select")).isDisplayed();
+			//Infrastructure Service Type
+			driver.findElement(By.xpath(".//*[@id='mContent']/div/div/table/tbody/tr[2]/td[1]/div/label")).isDisplayed();
+			//Infrastructure Service Type Select Drop down
+			driver.findElement(By.xpath(".//*[@id='mContent']/div/div/table/tbody/tr[2]/td[2]/div/select")).isDisplayed();
+			//Submit button 
+			driver.findElement(By.xpath(".//*[@id='mContent']/div/div/table/tbody/tr[3]/td/div/button")).isDisplayed();
+			
+			//Login Snippet Icon
+			driver.findElement(By.xpath(".//*[@class='icon-user-small login-snippet-icon']")).isDisplayed();
+			
+			
+			//String bodyText = driver.findElement(By.tagName("body")).getText();
+			//Assert.assertTrue("Text not found!", bodyText.contains("Search Existing Service Instances"));
+			//Assert.IsTrue(driver.getPageSource.Contains("Search Existing Service Instances"));
+			 
+			log.info("VID-12 TC-1");
+			Assert.assertTrue(driver.getPageSource().contains("Search Existing Service Instances"));
+			Assert.assertTrue(driver.getPageSource().contains("Please search by the Subscriber name or Service Type from below:"));
+			log.info("VID-12 TC-1 PASSED");
+			log.info("VID-10 TC 1 PASSED");
+			log.info("VID-11 TC-2 PASSED");
+		}
+		
+		
+		/**
+		 * Disabled submit button.
+		 */
+		@Test(priority=6)
+		public void disabledSubmitButton()
+		{
+			log.info("VID-12 TC-13");
+			//Assert submit button disabled.
+			Assert.assertFalse(driver.findElement(By.xpath(configProp.getProperty("submitButton"))).isEnabled());
+			log.info("VID-12 TC-13 PASSED");
+
+		} 
+		
+		/**
+		 * Default list box value.
+		 */
+		@Test(priority=7)
+		public void defaultListBoxValue()
+		{
+			log.info("VID-12 TC-2");
+			
+			
+			//WebElement subscribername =driver.findElement(By.xpath(".//*[@id='mContent']/div/div/table/tbody/tr[1]/td[2]/div/select"));
+			
+			Select oSelect = new Select(driver.findElement(By.xpath(configProp.getProperty("subscriberNameDropDown"))));
+			Select iSelect = new Select(driver.findElement(By.xpath(configProp.getProperty("serviceTypeDropDown"))));
+			
+			
+			WebElement ielement=iSelect.getFirstSelectedOption();
+			WebElement oelement=oSelect.getFirstSelectedOption();
+			String defaultsubscribername=oelement.getText();
+			String defaultservicetype=ielement.getText();
+			
+			Assert.assertEquals(defaultsubscribername,"Select Subscriber Name");
+			Assert.assertEquals(defaultservicetype,"Select Service Type");
+			
+		
+			
+			
+		//Verify Select Subscriber Name isDisplayed.
+		//driver.findElement(By.xpath(".//*[@id='mContent']/div/div/table/tbody/tr[1]/td[2]/div/select/option[1]")).isSelected();
+				
+		//Verify Select Service Type isDisplayed.	
+		//driver.findElement(By.xpath(".//*[@id='mContent']/div/div/table/tbody/tr[2]/td[2]/div/select/option[1]")).isSelected();
+			
+			
+			log.info("VID-12 TC-2 PASSED");
+
+		}
+
+
+		
+		/**
+		 * Select subscriber name drop down.
+		 *
+		 * @throws InterruptedException the interrupted exception
+		 */
+		@Test(priority=8)
+		public void selectSubscriberNameDropDown() throws InterruptedException
+		{
+			log.info("------------------VID-10 TC-2,VID-12 TC-11, VID-12 TC-9, VID 12 TC-10,VID-12 TC-6, VID 12 TC-5--------------------");
+			
+			
+			driver.findElement(By.xpath(configProp.getProperty("subscriberNameDropDown")));
+			
+			driver.findElement(By.xpath(configProp.getProperty("serviceTypeDropDown")));
+			Thread.sleep(5000);
+			
+			//Infrastructure Subscriber Name
+			Select oSelect = new Select(driver.findElement(By.xpath(configProp.getProperty("subscriberNameDropDown"))));
+			
+			List <WebElement> elementCount = oSelect.getOptions();
+			log.info("Select Element Count of Service Name");
+			System.out.println(elementCount.size());
+			
+			
+			//Verifying getInfrastructureSubscribersList
+			log.info("VID-29 TC-1");
+			Assert.assertTrue(elementCount.size()>0);
+			log.info("VID-29 TC-1 PASSED");
+			
+			oSelect.selectByIndex(2);
+			String selectedOption = new Select(driver.findElement(By.xpath(configProp.getProperty("subscriberNameDropDown")))).getFirstSelectedOption().getText();
+
+			System.out.println("Service Name selected is " +selectedOption);
+			log.info("VID-10 TC-2 PASSED");
+					
+			//Submit button is clicked
+			driver.findElement(By.xpath(configProp.getProperty("submitButton"))).click();
+			
+			
+			//Verify whether the page header is displayed "Selected Subscriber's Service Instance Details:"
+			driver.findElement(By.xpath(".//*[@id='mContent']/div/div/div/h1")).isDisplayed();
+			//Assert.assertTrue(driver.getPageSource().contains("Selected Subscriber's Service Instance Details:"))
+			
+			
+			//Verify whether the page header is displayed "Global Customer ID"
+			driver.findElement(By.xpath(".//*[@id='mContent']/div/div/div/div/table/thead/tr/th[2]/div")).isDisplayed();
+			Assert.assertTrue(driver.getPageSource().contains("Global Customer ID"));
+			Assert.assertTrue(driver.getPageSource().contains("Subscriber Name"));
+			Assert.assertTrue(driver.getPageSource().contains("Service Type"));
+			Assert.assertTrue(driver.getPageSource().contains("Service Instance ID"));
+			
+			log.info("VID-12 TC-5 PASSED");
+			log.info("VID-12 TC-11 PASSED");
+			
+			WebElement serviceinstancetable =driver.findElement(By.xpath("//table[@class='tablesorter tablesorter-default ng-isolate-scope']"));
+			
+			List<WebElement> rows_table = serviceinstancetable.findElements(By.tagName("tr"));
+			  //To calculate no of rows In table.
+			  int rows_count = rows_table.size();
+			  
+			  //Loop will execute till the last row of table.
+			  for (int row=0; row<rows_count; row++){
+			   //To locate columns(cells) of that specific row.
+			   List<WebElement> Columns_row = rows_table.get(row).findElements(By.tagName("td"));
+			   //To calculate no of columns(cells) In that specific row.
+			   int columns_count = Columns_row.size();
+			   //System.out.println("Number of cells In Row "+row+" are "+columns_count);
+			   
+			   //Loop will execute till the last cell of that specific row.
+			   for (int column=0; column<columns_count; column++){
+			    //To retrieve text from that specific cell.
+			    String celtext = Columns_row.get(column).getText();
+			    //System.out.println("Cell Value Of row number "+row+" and column number "+column+" Is "+celtext);
+			   
+			    
+			    
+			    //log.info("Testing Get column and row value");
+			    List <WebElement> exx= rows_table.get(1).findElements(By.tagName("td"));
+			     eg=Columns_row.get(2).getText();
+			   // System.out.println("Cell value of row 1 and column 2 is" +eg);
+			   }
+			  }
+		
+			  
+			
+			
+			//Verify View/Edit isDisplayed and Click
+			
+			driver.findElement(By.xpath("//a[@alt='View/Edit']")).isDisplayed();
+			
+			driver.findElement(By.xpath(".//*[@id='mContent']/div/div/div/div/table/tbody/tr[1]/td[1]/div/a")).click();
+			
+			log.info("User clicked View/Edit");
+			
+			//Verify the Subscriber Name displayed.	
+			String header= driver.findElement(By.xpath("//h1[@class='heading1 ng-binding']")).getText();
+			//System.out.println(header);
+			
+			
+			if(header.contains(eg))
+			{
+				System.out.println("Header contains the subscriber name");
+			}else
+				System.out.println("Header does not contain the subscriber name");
+			
+			
+			
+			Assert.assertTrue(driver.getPageSource().contains("PerfTest Subscriber00020021"));
+			log.info("VID-12 TC-6 PASSED");
+			
+			
+				
+			driver.navigate().back();
+			//Cancel button isDisplayed
+			driver.findElement(By.xpath("//button[@class='button button--small button--primary']")).isDisplayed();
+			log.info("VID-12 TC-9 PASSED");
+			
+			//Cancel button is clicked
+			driver.findElement(By.xpath("//button[@class='button button--small button--primary']")).click();
+			log.info("Cancel button is clicked");
+			
+			//Verifying VID Home page is displayed
+			Assert.assertTrue(driver.getPageSource().contains("Search Existing Service Instances"));
+			log.info("VID-12 TC-10 PASSED");
+			
+			   }
+		
+		
+		/**
+		 * Refresh subscriber name.
+		 */
+		@Test(priority=9)
+		public void refreshSubscriberName()
+		{
+			log.info("VID-10 TC-4");
+			
+			
+			driver.findElement(By.xpath(configProp.getProperty("refreshButtonSubscriberName"))).isDisplayed();
+			
+			log.info("VID-10 TC-4 PASSED");
+			
+			
+		}
+
+		
+		/**
+		 * Select subscriber type drop down.
+		 *
+		 * @throws InterruptedException the interrupted exception
+		 */
+		@Test(priority=9)
+		public void selectSubscriberTypeDropDown() throws InterruptedException
+		{
+			Thread.sleep(5000);
+			log.info("------------------VID-10 TC-3, VID-12 TC-12,--------------------");
+			//Infrastructure Subscriber Type
+			Select iSelect = new Select(driver.findElement(By.xpath(configProp.getProperty("serviceTypeDropDown"))));
+			
+			List <WebElement> ielementCount = iSelect.getOptions();
+			log.info("Select Element Count of Service type");
+			System.out.println(ielementCount.size());
+			iSelect.selectByIndex(1);
+			
+			log.info("VID-10 TC-3 PASSED");
+			
+						
+			//Submit button is clicked
+			driver.findElement(By.xpath(configProp.getProperty("submitButton"))).click();
+			
+			//Verify whether the page header is displayed "Selected Subscriber's Service Instance Details:"
+			driver.findElement(By.xpath(".//*[@id='mContent']/div/div/div/h1")).isDisplayed();
+			//Assert.assertTrue(driver.getPageSource().contains("Selected Subscriber's Service Instance Details:"))
+			log.info("Page Header: Selected Subscriber's Service Instance Details");
+			
+			
+			//Verify whether the page header is displayed "Global Customer ID"
+			driver.findElement(By.xpath(".//*[@id='mContent']/div/div/div/div/table/thead/tr/th[2]/div")).isDisplayed();
+			
+			//Assert.assertTrue(driver.getPageSource().contains("Global Customer ID"));
+			log.info("Table is displayed");
+			
+			log.info("VID-12 TC-12 PASSED");
+			
+		}
+		
+		
+		
+		/**
+		 * Logout under profile.
+		 */
+		@Test(priority=10)
+		public void logoutUnderProfile()
+		{
+			
+			log.info("-----------VID-11 TC-5---------------------");
+			//driver.findElement(By.partialLinkText("Click here to login")).click();
+			//driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
+			
+		
+			driver.findElement(By.xpath(".//*[@class='icon-user-small login-snippet-icon']")).click();			
+			driver.findElement(By.xpath(".//*[@id='reg-logout-div']/a")).click();
+			//Validate that the user has logged out of VID. Displays "Portal"
+			Assert.assertTrue(driver.getPageSource().contains("Portal"));
+			
+			log.info("VID-11 TC-5 PASSED");
+			
+		}
+
+		
+		
+		/**
+		 * Tear down.
+		 */
+		@AfterClass
+		public void tearDown()
+		{
+			driver.close();
+		
+		}
+		
+		
+		
+	}
+
+
+	
+
diff --git a/vid-app-common/src/test/java/org/onap/ecomp/vid/selenium/LogOutLeftPane.java b/vid-app-common/src/test/java/org/onap/ecomp/vid/selenium/LogOutLeftPane.java
new file mode 100644
index 0000000..fdd5ea3
--- /dev/null
+++ b/vid-app-common/src/test/java/org/onap/ecomp/vid/selenium/LogOutLeftPane.java
@@ -0,0 +1,242 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * VID
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.ecomp.vid.selenium;
+
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.List;
+import java.util.Properties;
+import java.util.concurrent.TimeUnit;
+
+import org.apache.log4j.Logger;
+import org.openqa.selenium.By;
+import org.openqa.selenium.WebDriver;
+import org.openqa.selenium.WebElement;
+import org.openqa.selenium.firefox.FirefoxDriver;
+import org.openqa.selenium.support.ui.Select;
+import org.testng.Assert;
+import org.testng.annotations.BeforeTest;
+import org.testng.annotations.Test;
+
+/**
+ * The Class LogOutLeftPane.
+ */
+@Test(enabled=false)
+public class LogOutLeftPane {
+
+	/** The login button. */
+	WebElement loginButton;
+	
+	/** The login. */
+	WebElement login;
+	
+	/** The pwd. */
+	WebElement pwd;
+	
+	/** The log. */
+	Logger log;
+	
+	/** The errormessage. */
+	WebElement errormessage;
+	
+	/** The driver. */
+	WebDriver driver=new FirefoxDriver();
+	
+	
+	/** The config prop. */
+	private final Properties configProp = new Properties();
+	
+	
+	/**
+	 * Instantiates a new log out left pane.
+	 */
+	private  LogOutLeftPane() {
+		// TODO Auto-generated constructor stub
+		//
+		try{
+		//	InputStream input =this.getClass().getClassLoader().getResourceAsStream("objectmap.properties");
+		//FileInputStream input1 = new FileInputStream("objectmap.properties");
+			
+		InputStream input =new FileInputStream("objectconfig.properties");
+		System.out.println("Read all properties from file");
+		configProp.load(input);
+		System.out.println("Read all properties from file completed");
+		}
+		catch(IOException e) {
+			
+			e.printStackTrace();
+		}
+	}
+	
+	
+	   
+	   
+	/**
+	 * Do before test.
+	 */
+	// TODO Auto-generated method stub
+	@BeforeTest
+	public void doBeforeTest()
+	{
+		//WebDriver driver=new FirefoxDriver();
+		
+		log = Logger.getLogger(LogOutLeftPane.class.getName());
+	
+	
+	
+	// Get url
+	driver.get("http://vid.onap.org:9080/vid/login_external.htm");
+	driver.manage().window().maximize();
+	
+	
+	 login = driver.findElement(By.xpath("//input[@class='fn-ebz-text ng-pristine ng-valid']"));
+	 pwd = driver.findElement(By.xpath("//input[@class='span3 ng-pristine ng-valid']"));
+	 loginButton = driver.findElement(By.id("loginBtn"));
+	}
+	
+	
+	/**
+	 * Expand collapse panel.
+	 *
+	 * @throws InterruptedException the interrupted exception
+	 */
+	@Test(priority=1)
+	public void expandCollapsePanel() throws InterruptedException
+	{
+
+		
+		
+		login.clear();
+		login.sendKeys("su");
+		pwd.clear();
+		pwd.sendKeys("fusion");
+		//driver.findElement(By.partialLinkText("Click here to login")).click();
+		//driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
+		
+		loginButton.click();
+		driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
+		
+		
+		log.info("Clicking Profile link from left pane");
+		Thread.sleep(3000);
+		System.out.println("properties file details --->"+configProp.getProperty("profilelink"));
+		driver.findElement(By.xpath(configProp.getProperty("profilelink"))).click();
+		Thread.sleep(3000);
+		
+		//Verify whether the sub panel is displayed
+		//To verify the following :Search import from webphone and Self 
+		driver.findElement(By.xpath(".//*[@id='panel4']")).isDisplayed();
+		log.info("Expand and collapse passed for Profile link");
+		
+		//For Admin
+		//Verify expand and collapse working for ADMIN
+		log.info("Clicking Admin link from left pane");
+		driver.findElement(By.xpath("html/body/div[1]/div[1]/div/div/div[2]/div/div/div[1]/div/div/accordion/div/div[6]/a/span")).click();
+		//To verify the following: Roles, Roles Functions, Usages
+		driver.findElement(By.xpath(".//*[@id='panel5']")).isDisplayed();
+		
+	
+		log.info("Expand and collapse passed for ADMIN link");
+
+		log.info("VID-11 TC-3 PASSED");
+		
+	}
+	
+	
+	/**
+	 * Drop down list.
+	 *
+	 * @throws InterruptedException the interrupted exception
+	 */
+	@Test(priority=2)
+	public void dropDownList() throws InterruptedException
+	{
+		//VID-12 TC-3
+		log.info("VID-12 TC-3");
+		//driver.findElement(By.xpath(".//*[@id='mContent']/div/div/table/tbody/tr[1]/td[2]/div/select"));
+		
+		//driver.findElement(By.xpath(".//*[@id='mContent']/div/div/table/tbody/tr[2]/td[2]/div/select"));
+		Thread.sleep(5000);
+		
+		//Infrastructure Subscriber Name
+		Select oSelect = new Select(driver.findElement(By.xpath(".//*[@id='mContent']/div/div/table/tbody/tr[1]/td[2]/div/select")));
+		Select iSelect = new Select(driver.findElement(By.xpath(".//*[@id='mContent']/div/div/table/tbody/tr[2]/td[2]/div/select")));
+		
+		List <WebElement> elementCount = oSelect.getOptions();
+		log.info("Subscriber Name Drop Down");
+		System.out.println(elementCount.size());
+		oSelect.selectByIndex(1);
+		log.info("Subscriber name selected");
+		//String selectedOption = new Select(driver.findElement(By.xpath(".//*[@id='mContent']/div/div/table/tbody/tr[1]/td[2]/div/select"))).getFirstSelectedOption().getText();
+		
+		
+		List <WebElement> count = iSelect.getOptions();
+		log.info("Subscriber type drop down");
+		System.out.println(count.size());
+		oSelect.selectByIndex(1);
+		log.info("Subscriber type selected");
+		
+
+				
+		//Submit button is clicked
+		driver.findElement(By.xpath(".//*[@id='mContent']/div/div/table/tbody/tr[3]/td/div/button")).click();
+		
+		
+		//Verify whether the page header is displayed "Selected Subscriber's Service Instance Details:"
+		driver.findElement(By.xpath(".//*[@id='mContent']/div/div/div/h1")).isDisplayed();
+		log.info("VID-12 TC-3 PASSED");
+	}
+	
+	
+	
+	
+	/**
+	 * Logout left pane.
+	 */
+	@Test(priority=3)
+	public void logoutLeftPane()
+	{
+		//To Verify if the logout link redirects to Login page when clicked.
+		
+		
+		/*log.info("----------------VID-11 TC-4----------------");
+		login.clear();
+		login.sendKeys("testuser");
+		pwd.clear();
+		pwd.sendKeys("abc123");
+		//driver.findElement(By.partialLinkText("Click here to login")).click();
+		//driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
+		
+		loginButton.click();
+		driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);*/
+		log.info("----------------VID-11 TC-4----------------");
+		driver.findElement(By.xpath("html/body/div[1]/div[1]/div/div/div[2]/div/div/div[1]/div/div/accordion/div/div[7]/a")).click();
+		//Validate that the user has logged out of VID. Displays "Portal"
+		Assert.assertTrue(driver.getPageSource().contains("Portal"));
+		
+		log.info("VID 11 TC-4 PASSED");
+		
+		driver.close();
+		
+	}
+	
+}
diff --git a/vid-app-common/src/test/java/org/onap/fusion/core/MockApplicationContextTestSuite.java b/vid-app-common/src/test/java/org/onap/fusion/core/MockApplicationContextTestSuite.java
new file mode 100644
index 0000000..bd68549
--- /dev/null
+++ b/vid-app-common/src/test/java/org/onap/fusion/core/MockApplicationContextTestSuite.java
@@ -0,0 +1,177 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * VID
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.fusion.core;
+
+import java.io.IOException;
+
+import org.junit.Before;
+import org.junit.runner.RunWith;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.ComponentScan;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.context.annotation.Profile;
+import org.springframework.test.context.ActiveProfiles;
+import org.springframework.test.context.ContextConfiguration;
+import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
+import org.springframework.test.context.web.AnnotationConfigWebContextLoader;
+import org.springframework.test.context.web.WebAppConfiguration;
+import org.springframework.test.web.servlet.MockMvc;
+import org.springframework.test.web.servlet.setup.MockMvcBuilders;
+import org.springframework.web.context.WebApplicationContext;
+import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
+import org.testng.annotations.Test;
+import org.openecomp.portalsdk.core.conf.AppConfig;
+import org.openecomp.portalsdk.core.objectcache.AbstractCacheManager;
+import org.openecomp.portalsdk.core.util.SystemProperties;
+import org.openecomp.portalsdk.core.util.CacheManager;
+
+/**
+ * 
+ * 
+ * 
+ * In order to write a unit test, 
+ * 1. inherit this class - See SanityTest.java
+ * 2. place the "war" folder on your test class's classpath
+ * 3. run the test with the following VM argument; This is important because when starting the application from Container, the System Properties file (SystemProperties.java) can have the direct path
+ *    but, when running from the Mock Junit container, the path should be prefixed with "classpath" to enable the mock container to search for the file in the classpath  
+ *    -Dcontainer.classpath="classpath:"
+ *
+ */
+
+@RunWith(SpringJUnit4ClassRunner.class)
+@WebAppConfiguration
+@ContextConfiguration(loader = AnnotationConfigWebContextLoader.class, classes = {MockAppConfig.class})
+@ActiveProfiles(value="test")
+@Test(enabled=false)
+public class MockApplicationContextTestSuite {
+		
+	    /** The wac. */
+    	@Autowired
+	    public WebApplicationContext wac;
+
+	    /** The mock mvc. */
+    	private MockMvc mockMvc;
+
+	    /**
+    	 * Setup.
+    	 */
+    	@Before
+	    public void setup() {
+	    	if(mockMvc == null) {
+	    		this.mockMvc = MockMvcBuilders.webAppContextSetup(this.wac).build();
+	    		
+	    	}
+	    }
+	    
+	    /**
+    	 * Gets the bean.
+    	 *
+    	 * @param name the name
+    	 * @return the bean
+    	 */
+    	public Object getBean(String name) {
+			return this.wac.getBean(name);
+		}
+
+
+		/**
+		 * Gets the mock mvc.
+		 *
+		 * @return the mock mvc
+		 */
+		public MockMvc getMockMvc() {
+			return mockMvc;
+		}
+
+		/**
+		 * Sets the mock mvc.
+		 *
+		 * @param mockMvc the new mock mvc
+		 */
+		public void setMockMvc(MockMvc mockMvc) {
+			this.mockMvc = mockMvc;
+		}
+		
+		/**
+		 * Gets the web application context.
+		 *
+		 * @return the web application context
+		 */
+		public WebApplicationContext getWebApplicationContext() {
+			return wac;
+		}
+		
+		
+		
+		
+}
+		
+
+		@Configuration
+		@ComponentScan(basePackages = "org.onap", 
+				 excludeFilters = {
+								 	// the following source configurations should not be scanned; instead of using Exclusion filter, we can use the @Profile annotation to exclude them
+									// see AppConfig class
+									//@ComponentScan.Filter(type = FilterType.REGEX, pattern = "org.onap.portalsdk.core.*AppConfig*")//,
+								 	//@ComponentScan.Filter(type = FilterType.REGEX, pattern = org.onap.*.*AppConfig*")
+								  }
+		    	)
+		@Profile("test")
+		class MockAppConfig extends AppConfig {
+			
+			@Bean 
+		    public SystemProperties systemProperties(){
+		    	return new MockSystemProperties();
+		    }
+			
+			@Bean
+		    public AbstractCacheManager cacheManager() {
+		        return new CacheManager() {
+		        	
+		        	public void configure() throws IOException {
+		        		 
+		        	}
+		        };
+		    }
+			
+			protected String[] tileDefinitions() {
+				return new String[] {"classpath:/WEB-INF/fusion/defs/definitions.xml", "classpath:/WEB-INF/defs/definitions.xml"};
+			}
+			
+			 @Override
+			public void addInterceptors(InterceptorRegistry registry) {
+			    //registry.addInterceptor(new SessionTimeoutInterceptor()).excludePathPatterns(getExcludeUrlPathsForSessionTimeout());
+			    //registry.addInterceptor(resourceInterceptor());
+			}
+			 
+			 public static class MockSystemProperties extends SystemProperties {
+					
+					public MockSystemProperties() {
+					}
+					
+				}
+					
+		}
+		
+		
+
+
diff --git a/vid-app-common/src/test/java/org/onap/fusionapp/controller/NetMapTest.java b/vid-app-common/src/test/java/org/onap/fusionapp/controller/NetMapTest.java
new file mode 100644
index 0000000..7a4c560
--- /dev/null
+++ b/vid-app-common/src/test/java/org/onap/fusionapp/controller/NetMapTest.java
@@ -0,0 +1,49 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * VID
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.fusionapp.controller;
+
+import org.junit.Assert;
+import org.junit.Test;
+import org.springframework.test.web.servlet.ResultActions;
+import org.springframework.test.web.servlet.request.MockMvcRequestBuilders;
+
+import org.onap.fusion.core.MockApplicationContextTestSuite;
+
+/**
+ * The Class NetMapTest.
+ */
+
+public class NetMapTest extends MockApplicationContextTestSuite {
+	
+	/**
+	 * Test get net map.
+	 *
+	 * @throws Exception the exception
+	 */
+//	@Test
+	public void testGetNetMap() throws Exception {
+		ResultActions ra =getMockMvc().perform(MockMvcRequestBuilders.get("/net_map"));
+		//Assert.assertEquals(UrlAccessRestrictedException.class,ra.andReturn().getResolvedException().getClass());
+		Assert.assertEquals("net_map_int",ra.andReturn().getModelAndView().getModel().get("frame_int"));
+	}
+	
+
+}
diff --git a/vid-app-common/src/test/java/org/onap/fusionapp/service/ProfileServiceTest.java b/vid-app-common/src/test/java/org/onap/fusionapp/service/ProfileServiceTest.java
new file mode 100644
index 0000000..212074f
--- /dev/null
+++ b/vid-app-common/src/test/java/org/onap/fusionapp/service/ProfileServiceTest.java
@@ -0,0 +1,75 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * VID
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.fusionapp.service;
+
+import java.util.List;
+
+import org.junit.Assert;
+import org.junit.Test;
+import org.springframework.beans.factory.annotation.Autowired;
+
+import org.onap.fusion.core.MockApplicationContextTestSuite;
+import org.openecomp.portalsdk.core.domain.Profile;
+import org.openecomp.portalsdk.core.domain.User;
+import org.openecomp.portalsdk.core.service.ProfileService;
+import org.openecomp.portalsdk.core.service.UserProfileService;
+
+
+/**
+ * The Class ProfileServiceTest.
+ */
+
+public class ProfileServiceTest extends MockApplicationContextTestSuite {
+	
+	/** The service. */
+	@Autowired
+	ProfileService service;
+	
+	/** The user profile service. */
+	@Autowired
+	UserProfileService userProfileService;
+	
+	/**
+	 * Test find all.
+	 */
+	//@Test
+	public void testFindAll() {
+		try {
+		List<Profile> profiles = service.findAll();
+		Assert.assertTrue(profiles.size() > 0);
+
+		}
+		catch (Exception e) {
+			// TODO: handle exception
+		}
+	}
+
+	/**
+	 * Test find all active.
+	 */
+//	@Test
+	public void testFindAllActive() {
+				
+		List<User> users = userProfileService.findAllActive();
+		List<User> activeUsers = userProfileService.findAllActive();
+		Assert.assertTrue(users.size() - activeUsers.size() >= 0);
+	}
+}
diff --git a/vid-app-common/src/test/java/org/onap/src/main/java/org/vid/dao/FnAppDoaImplTest.java b/vid-app-common/src/test/java/org/onap/src/main/java/org/vid/dao/FnAppDoaImplTest.java
new file mode 100644
index 0000000..e98e7b2
--- /dev/null
+++ b/vid-app-common/src/test/java/org/onap/src/main/java/org/vid/dao/FnAppDoaImplTest.java
@@ -0,0 +1,45 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * VID
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.src.main.java.org.vid.dao;
+
+import java.io.IOException;
+import java.sql.SQLException;
+
+import org.junit.Test;
+
+import org.onap.vid.dao.FnAppDoaImpl;
+
+public class FnAppDoaImplTest {
+	
+	//@Test
+	public void testGetconnection() throws ClassNotFoundException, IOException, SQLException{
+		FnAppDoaImpl impl=new FnAppDoaImpl();
+		impl.getConnection(null,null,null, null);
+		
+	}
+	
+	//@Test
+	public void testProfileCount() throws ClassNotFoundException, IOException, SQLException{
+		FnAppDoaImpl impl=new FnAppDoaImpl();
+		impl.getProfileCount(null,null,null, null);	
+	}
+
+}
diff --git a/vid-app-common/src/test/java/org/onap/vid/RelatedToTest.java b/vid-app-common/src/test/java/org/onap/vid/RelatedToTest.java
new file mode 100644
index 0000000..ca4ac1b
--- /dev/null
+++ b/vid-app-common/src/test/java/org/onap/vid/RelatedToTest.java
@@ -0,0 +1,37 @@
+package org.onap.vid;
+
+import java.util.Map;
+
+import org.junit.Test;
+import org.onap.vid.RelatedTo;
+
+
+public class RelatedToTest {
+
+	private RelatedTo createTestSubject() {
+		return new RelatedTo();
+	}
+
+
+	@Test
+	public void testGetAdditionalProperties() throws Exception {
+		RelatedTo testSubject;
+		Map<String, Object> result;
+
+		// default test
+		testSubject = createTestSubject();
+		result = testSubject.getAdditionalProperties();
+	}
+
+
+	@Test
+	public void testSetAdditionalProperty() throws Exception {
+		RelatedTo testSubject;
+		String name = "";
+		Object value = null;
+
+		// default test
+		testSubject = createTestSubject();
+		testSubject.setAdditionalProperty(name, value);
+	}
+}
\ No newline at end of file
diff --git a/vid-app-common/src/test/java/org/onap/vid/TestSuite.java b/vid-app-common/src/test/java/org/onap/vid/TestSuite.java
new file mode 100644
index 0000000..e70d7fe
--- /dev/null
+++ b/vid-app-common/src/test/java/org/onap/vid/TestSuite.java
@@ -0,0 +1,11 @@
+package org.onap.vid;
+
+import org.junit.runner.RunWith;
+import org.junit.runners.Suite;
+
+@RunWith(Suite.class)
+@Suite.SuiteClasses(
+
+{ RelatedToTest.class, org.onap.vid.aai.TestSuite.class })
+public class TestSuite { // nothing
+}
diff --git a/vid-app-common/src/test/java/org/onap/vid/aai/AaiGetVnfResponseTest.java b/vid-app-common/src/test/java/org/onap/vid/aai/AaiGetVnfResponseTest.java
new file mode 100644
index 0000000..7889d51
--- /dev/null
+++ b/vid-app-common/src/test/java/org/onap/vid/aai/AaiGetVnfResponseTest.java
@@ -0,0 +1,33 @@
+package org.onap.vid.aai;
+
+import java.util.Map;
+
+import org.junit.Test;
+
+public class AaiGetVnfResponseTest {
+
+	private AaiGetVnfResponse createTestSubject() {
+		return new AaiGetVnfResponse();
+	}
+
+	@Test
+	public void testGetAdditionalProperties() throws Exception {
+		AaiGetVnfResponse testSubject;
+		Map<String, Object> result;
+
+		// default test
+		testSubject = createTestSubject();
+		result = testSubject.getAdditionalProperties();
+	}
+
+	@Test
+	public void testSetAdditionalProperty() throws Exception {
+		AaiGetVnfResponse testSubject;
+		String name = "";
+		Object value = null;
+
+		// default test
+		testSubject = createTestSubject();
+		testSubject.setAdditionalProperty(name, value);
+	}
+}
\ No newline at end of file
diff --git a/vid-app-common/src/test/java/org/onap/vid/aai/ServicePropertiesTest.java b/vid-app-common/src/test/java/org/onap/vid/aai/ServicePropertiesTest.java
new file mode 100644
index 0000000..577f528
--- /dev/null
+++ b/vid-app-common/src/test/java/org/onap/vid/aai/ServicePropertiesTest.java
@@ -0,0 +1,34 @@
+package org.onap.vid.aai;
+
+import java.util.Map;
+
+import org.junit.Test;
+import org.onap.vid.aai.model.ServiceProperties;
+
+public class ServicePropertiesTest {
+
+	private ServiceProperties createTestSubject() {
+		return new ServiceProperties();
+	}
+
+	@Test
+	public void testGetAdditionalProperties() throws Exception {
+		ServiceProperties testSubject;
+		Map<String, Object> result;
+
+		// default test
+		testSubject = createTestSubject();
+		result = testSubject.getAdditionalProperties();
+	}
+
+	@Test
+	public void testSetAdditionalProperty() throws Exception {
+		ServiceProperties testSubject;
+		String name = "";
+		Object value = null;
+
+		// default test
+		testSubject = createTestSubject();
+		testSubject.setAdditionalProperty(name, value);
+	}
+}
\ No newline at end of file
diff --git a/vid-app-common/src/test/java/org/onap/vid/aai/SubscriberAaiResponseTest.java b/vid-app-common/src/test/java/org/onap/vid/aai/SubscriberAaiResponseTest.java
new file mode 100644
index 0000000..c01fe27
--- /dev/null
+++ b/vid-app-common/src/test/java/org/onap/vid/aai/SubscriberAaiResponseTest.java
@@ -0,0 +1,22 @@
+package org.onap.vid.aai;
+
+import org.junit.Test;
+import org.onap.vid.model.SubscriberList;
+
+public class SubscriberAaiResponseTest {
+
+	private SubscriberAaiResponse createTestSubject() {
+		return new SubscriberAaiResponse(new SubscriberList(), "", 0);
+	}
+
+	
+	@Test
+	public void testGetSubscriberList() throws Exception {
+		SubscriberAaiResponse testSubject;
+		SubscriberList result;
+
+		// default test
+		testSubject = createTestSubject();
+		result = testSubject.getSubscriberList();
+	}
+}
\ No newline at end of file
diff --git a/vid-app-common/src/test/java/org/onap/vid/aai/SubscriberWithFilterTest.java b/vid-app-common/src/test/java/org/onap/vid/aai/SubscriberWithFilterTest.java
new file mode 100644
index 0000000..c76e5cd
--- /dev/null
+++ b/vid-app-common/src/test/java/org/onap/vid/aai/SubscriberWithFilterTest.java
@@ -0,0 +1,30 @@
+package org.onap.vid.aai;
+
+import org.junit.Test;
+
+public class SubscriberWithFilterTest {
+
+	private SubscriberWithFilter createTestSubject() {
+		return new SubscriberWithFilter();
+	}
+
+	@Test
+	public void testGetIsPermitted() throws Exception {
+		SubscriberWithFilter testSubject;
+		boolean result;
+
+		// default test
+		testSubject = createTestSubject();
+		result = testSubject.getIsPermitted();
+	}
+
+	@Test
+	public void testSetIsPermitted() throws Exception {
+		SubscriberWithFilter testSubject;
+		boolean isPermitted = false;
+
+		// default test
+		testSubject = createTestSubject();
+		testSubject.setIsPermitted(isPermitted);
+	}
+}
\ No newline at end of file
diff --git a/vid-app-common/src/test/java/org/onap/vid/aai/TestSuite.java b/vid-app-common/src/test/java/org/onap/vid/aai/TestSuite.java
new file mode 100644
index 0000000..eac3bdf
--- /dev/null
+++ b/vid-app-common/src/test/java/org/onap/vid/aai/TestSuite.java
@@ -0,0 +1,12 @@
+package org.onap.vid.aai;
+
+import org.junit.runner.RunWith;
+import org.junit.runners.Suite;
+
+@RunWith(Suite.class)
+@Suite.SuiteClasses(
+
+{ SubscriberAaiResponseTest.class, AaiGetVnfResponseTest.class, ServicePropertiesTest.class,
+		SubscriberWithFilterTest.class, VnfResultTest.class, org.onap.vid.aai.model.TestSuite.class })
+public class TestSuite { // nothing
+}
diff --git a/vid-app-common/src/test/java/org/onap/vid/aai/VnfResultTest.java b/vid-app-common/src/test/java/org/onap/vid/aai/VnfResultTest.java
new file mode 100644
index 0000000..2b7a604
--- /dev/null
+++ b/vid-app-common/src/test/java/org/onap/vid/aai/VnfResultTest.java
@@ -0,0 +1,34 @@
+package org.onap.vid.aai;
+
+import java.util.Map;
+
+import org.junit.Test;
+import org.onap.vid.aai.model.VnfResult;
+
+public class VnfResultTest {
+
+	private VnfResult createTestSubject() {
+		return new VnfResult();
+	}
+
+	@Test
+	public void testGetAdditionalProperties() throws Exception {
+		VnfResult testSubject;
+		Map<String, Object> result;
+
+		// default test
+		testSubject = createTestSubject();
+		result = testSubject.getAdditionalProperties();
+	}
+
+	@Test
+	public void testSetAdditionalProperty() throws Exception {
+		VnfResult testSubject;
+		String name = "";
+		Object value = null;
+
+		// default test
+		testSubject = createTestSubject();
+		testSubject.setAdditionalProperty(name, value);
+	}
+}
\ No newline at end of file
diff --git a/vid-app-common/src/test/java/org/onap/vid/aai/model/RelatedToPropertyTest.java b/vid-app-common/src/test/java/org/onap/vid/aai/model/RelatedToPropertyTest.java
new file mode 100644
index 0000000..0d26f56
--- /dev/null
+++ b/vid-app-common/src/test/java/org/onap/vid/aai/model/RelatedToPropertyTest.java
@@ -0,0 +1,55 @@
+package org.onap.vid.aai.model;
+
+import org.junit.Test;
+
+
+public class RelatedToPropertyTest {
+
+	private RelatedToProperty createTestSubject() {
+		return new RelatedToProperty();
+	}
+
+
+	@Test
+	public void testGetPropertyKey() throws Exception {
+		RelatedToProperty testSubject;
+		String result;
+
+		// default test
+		testSubject = createTestSubject();
+		result = testSubject.getPropertyKey();
+	}
+
+
+	@Test
+	public void testSetPropertyKey() throws Exception {
+		RelatedToProperty testSubject;
+		String propertyKey = "";
+
+		// default test
+		testSubject = createTestSubject();
+		testSubject.setPropertyKey(propertyKey);
+	}
+
+
+	@Test
+	public void testGetPropertyValue() throws Exception {
+		RelatedToProperty testSubject;
+		String result;
+
+		// default test
+		testSubject = createTestSubject();
+		result = testSubject.getPropertyValue();
+	}
+
+
+	@Test
+	public void testSetPropertyValue() throws Exception {
+		RelatedToProperty testSubject;
+		String propertyValue = "";
+
+		// default test
+		testSubject = createTestSubject();
+		testSubject.setPropertyValue(propertyValue);
+	}
+}
\ No newline at end of file
diff --git a/vid-app-common/src/test/java/org/onap/vid/aai/model/RelationshipDataTest.java b/vid-app-common/src/test/java/org/onap/vid/aai/model/RelationshipDataTest.java
new file mode 100644
index 0000000..ae5f7c3
--- /dev/null
+++ b/vid-app-common/src/test/java/org/onap/vid/aai/model/RelationshipDataTest.java
@@ -0,0 +1,55 @@
+package org.onap.vid.aai.model;
+
+import org.junit.Test;
+
+
+public class RelationshipDataTest {
+
+	private RelationshipData createTestSubject() {
+		return new RelationshipData();
+	}
+
+
+	@Test
+	public void testGetRelationshipKey() throws Exception {
+		RelationshipData testSubject;
+		String result;
+
+		// default test
+		testSubject = createTestSubject();
+		result = testSubject.getRelationshipKey();
+	}
+
+
+	@Test
+	public void testSetRelationshipKey() throws Exception {
+		RelationshipData testSubject;
+		String relationshipKey = "";
+
+		// default test
+		testSubject = createTestSubject();
+		testSubject.setRelationshipKey(relationshipKey);
+	}
+
+
+	@Test
+	public void testGetRelationshipValue() throws Exception {
+		RelationshipData testSubject;
+		String result;
+
+		// default test
+		testSubject = createTestSubject();
+		result = testSubject.getRelationshipValue();
+	}
+
+
+	@Test
+	public void testSetRelationshipValue() throws Exception {
+		RelationshipData testSubject;
+		String relationshipValue = "";
+
+		// default test
+		testSubject = createTestSubject();
+		testSubject.setRelationshipValue(relationshipValue);
+	}
+}
\ No newline at end of file
diff --git a/vid-app-common/src/test/java/org/onap/vid/aai/model/RelationshipTest.java b/vid-app-common/src/test/java/org/onap/vid/aai/model/RelationshipTest.java
new file mode 100644
index 0000000..893fc51
--- /dev/null
+++ b/vid-app-common/src/test/java/org/onap/vid/aai/model/RelationshipTest.java
@@ -0,0 +1,103 @@
+package org.onap.vid.aai.model;
+
+import java.util.List;
+
+import org.junit.Test;
+import org.onap.vid.aai.model.Relationship;
+import org.onap.vid.aai.model.RelationshipData;
+
+
+public class RelationshipTest {
+
+	private Relationship createTestSubject() {
+		return new Relationship();
+	}
+
+
+	@Test
+	public void testGetRelatedTo() throws Exception {
+		Relationship testSubject;
+		String result;
+
+		// default test
+		testSubject = createTestSubject();
+		result = testSubject.getRelatedTo();
+	}
+
+
+	@Test
+	public void testSetRelatedTo() throws Exception {
+		Relationship testSubject;
+		String relatedTo = "";
+
+		// default test
+		testSubject = createTestSubject();
+		testSubject.setRelatedTo(relatedTo);
+	}
+
+
+	@Test
+	public void testGetRelatedLink() throws Exception {
+		Relationship testSubject;
+		String result;
+
+		// default test
+		testSubject = createTestSubject();
+		result = testSubject.getRelatedLink();
+	}
+
+
+	@Test
+	public void testSetRelatedLink() throws Exception {
+		Relationship testSubject;
+		String relatedLink = "";
+
+		// default test
+		testSubject = createTestSubject();
+		testSubject.setRelatedLink(relatedLink);
+	}
+
+
+	@Test
+	public void testGetRelationDataList() throws Exception {
+		Relationship testSubject;
+		List<RelationshipData> result;
+
+		// default test
+		testSubject = createTestSubject();
+		result = testSubject.getRelationDataList();
+	}
+
+
+	@Test
+	public void testSetRelationDataList() throws Exception {
+		Relationship testSubject;
+		List<RelationshipData> relationDataList = null;
+
+		// default test
+		testSubject = createTestSubject();
+		testSubject.setRelationDataList(relationDataList);
+	}
+
+
+	@Test
+	public void testGetRelatedToPropertyList() throws Exception {
+		Relationship testSubject;
+		List<RelatedToProperty> result;
+
+		// default test
+		testSubject = createTestSubject();
+		result = testSubject.getRelatedToPropertyList();
+	}
+
+
+	@Test
+	public void testSetRelatedToPropertyList() throws Exception {
+		Relationship testSubject;
+		List<RelatedToProperty> relatedToPropertyList = null;
+
+		// default test
+		testSubject = createTestSubject();
+		testSubject.setRelatedToPropertyList(relatedToPropertyList);
+	}
+}
\ No newline at end of file
diff --git a/vid-app-common/src/test/java/org/onap/vid/aai/model/ServiceRelationshipsTest.java b/vid-app-common/src/test/java/org/onap/vid/aai/model/ServiceRelationshipsTest.java
new file mode 100644
index 0000000..e8bcf5f
--- /dev/null
+++ b/vid-app-common/src/test/java/org/onap/vid/aai/model/ServiceRelationshipsTest.java
@@ -0,0 +1,165 @@
+package org.onap.vid.aai.model;
+
+import org.junit.Test;
+
+
+public class ServiceRelationshipsTest {
+
+	private ServiceRelationships createTestSubject() {
+		return new ServiceRelationships();
+	}
+
+
+	@Test
+	public void testGetServiceInstanceId() throws Exception {
+		ServiceRelationships testSubject;
+		String result;
+
+		// default test
+		testSubject = createTestSubject();
+		result = testSubject.getServiceInstanceId();
+	}
+
+
+	@Test
+	public void testSetServiceInstanceId() throws Exception {
+		ServiceRelationships testSubject;
+		String serviceInstanceId = "";
+
+		// default test
+		testSubject = createTestSubject();
+		testSubject.setServiceInstanceId(serviceInstanceId);
+	}
+
+
+	@Test
+	public void testGetServiceInstanceName() throws Exception {
+		ServiceRelationships testSubject;
+		String result;
+
+		// default test
+		testSubject = createTestSubject();
+		result = testSubject.getServiceInstanceName();
+	}
+
+
+	@Test
+	public void testSetServiceInstanceName() throws Exception {
+		ServiceRelationships testSubject;
+		String serviceInstanceName = "";
+
+		// default test
+		testSubject = createTestSubject();
+		testSubject.setServiceInstanceName(serviceInstanceName);
+	}
+
+
+	@Test
+	public void testGetModelInvariantId() throws Exception {
+		ServiceRelationships testSubject;
+		String result;
+
+		// default test
+		testSubject = createTestSubject();
+		result = testSubject.getModelInvariantId();
+	}
+
+
+	@Test
+	public void testSetModelInvariantId() throws Exception {
+		ServiceRelationships testSubject;
+		String modelInvariantId = "";
+
+		// default test
+		testSubject = createTestSubject();
+		testSubject.setModelInvariantId(modelInvariantId);
+	}
+
+
+	@Test
+	public void testGetModelVersionId() throws Exception {
+		ServiceRelationships testSubject;
+		String result;
+
+		// default test
+		testSubject = createTestSubject();
+		result = testSubject.getModelVersionId();
+	}
+
+
+	@Test
+	public void testSetModelVersionId() throws Exception {
+		ServiceRelationships testSubject;
+		String modelVersionId = "";
+
+		// default test
+		testSubject = createTestSubject();
+		testSubject.setModelVersionId(modelVersionId);
+	}
+
+
+	@Test
+	public void testGetResourceVersion() throws Exception {
+		ServiceRelationships testSubject;
+		String result;
+
+		// default test
+		testSubject = createTestSubject();
+		result = testSubject.getResourceVersion();
+	}
+
+
+	@Test
+	public void testSetResourceVersion() throws Exception {
+		ServiceRelationships testSubject;
+		String resourceVersion = "";
+
+		// default test
+		testSubject = createTestSubject();
+		testSubject.setResourceVersion(resourceVersion);
+	}
+
+
+	@Test
+	public void testGetOrchestrationStatus() throws Exception {
+		ServiceRelationships testSubject;
+		String result;
+
+		// default test
+		testSubject = createTestSubject();
+		result = testSubject.getOrchestrationStatus();
+	}
+
+
+	@Test
+	public void testSetOrchestrationStatus() throws Exception {
+		ServiceRelationships testSubject;
+		String orchestrationStatus = "";
+
+		// default test
+		testSubject = createTestSubject();
+		testSubject.setOrchestrationStatus(orchestrationStatus);
+	}
+
+
+	@Test
+	public void testGetRelationshipList() throws Exception {
+		ServiceRelationships testSubject;
+		RelationshipList result;
+
+		// default test
+		testSubject = createTestSubject();
+		result = testSubject.getRelationshipList();
+	}
+
+
+	@Test
+	public void testSetRelationshipList() throws Exception {
+		ServiceRelationships testSubject;
+		RelationshipList relationshipList = null;
+
+		// default test
+		testSubject = createTestSubject();
+		testSubject.setRelationshipList(relationshipList);
+	}
+}
\ No newline at end of file
diff --git a/vid-app-common/src/test/java/org/onap/vid/aai/model/TestSuite.java b/vid-app-common/src/test/java/org/onap/vid/aai/model/TestSuite.java
new file mode 100644
index 0000000..8d5f62e
--- /dev/null
+++ b/vid-app-common/src/test/java/org/onap/vid/aai/model/TestSuite.java
@@ -0,0 +1,11 @@
+package org.onap.vid.aai.model;
+
+import org.junit.runner.RunWith;
+import org.junit.runners.Suite;
+
+@RunWith(Suite.class)
+@Suite.SuiteClasses(
+
+{ ServiceRelationshipsTest.class, RelationshipTest.class, RelatedToPropertyTest.class, RelationshipDataTest.class })
+public class TestSuite { // nothing
+}
diff --git a/vid-app-common/src/test/java/org/onap/vid/asdc/beans/ArtifactTest.java b/vid-app-common/src/test/java/org/onap/vid/asdc/beans/ArtifactTest.java
new file mode 100644
index 0000000..0494412
--- /dev/null
+++ b/vid-app-common/src/test/java/org/onap/vid/asdc/beans/ArtifactTest.java
@@ -0,0 +1,277 @@
+package org.onap.vid.asdc.beans;
+
+import org.junit.Test;
+
+
+public class ArtifactTest {
+
+	private Artifact createTestSubject() {
+		return new Artifact();
+	}
+
+
+	@Test
+	public void testGetArtifactName() throws Exception {
+		Artifact testSubject;
+		String result;
+
+		// default test
+		testSubject = createTestSubject();
+		result = testSubject.getArtifactName();
+	}
+
+
+	@Test
+	public void testGetArtifactType() throws Exception {
+		Artifact testSubject;
+		String result;
+
+		// default test
+		testSubject = createTestSubject();
+		result = testSubject.getArtifactType();
+	}
+
+
+	@Test
+	public void testGetArtifactGroupType() throws Exception {
+		Artifact testSubject;
+		String result;
+
+		// default test
+		testSubject = createTestSubject();
+		result = testSubject.getArtifactGroupType();
+	}
+
+
+	@Test
+	public void testGetArtifactLabel() throws Exception {
+		Artifact testSubject;
+		String result;
+
+		// default test
+		testSubject = createTestSubject();
+		result = testSubject.getArtifactLabel();
+	}
+
+	
+	@Test
+	public void testGetArtifactURL() throws Exception {
+		Artifact testSubject;
+		String result;
+
+		// default test
+		testSubject = createTestSubject();
+		result = testSubject.getArtifactURL();
+	}
+
+	
+	@Test
+	public void testGetArtifactDescription() throws Exception {
+		Artifact testSubject;
+		String result;
+
+		// default test
+		testSubject = createTestSubject();
+		result = testSubject.getArtifactDescription();
+	}
+
+	
+	@Test
+	public void testGetArtifactTimeout() throws Exception {
+		Artifact testSubject;
+		int result;
+
+		// default test
+		testSubject = createTestSubject();
+		result = testSubject.getArtifactTimeout();
+	}
+
+	
+	@Test
+	public void testGetArtifactChecksum() throws Exception {
+		Artifact testSubject;
+		String result;
+
+		// default test
+		testSubject = createTestSubject();
+		result = testSubject.getArtifactChecksum();
+	}
+
+	
+	@Test
+	public void testGetArtifactUUID() throws Exception {
+		Artifact testSubject;
+		String result;
+
+		// default test
+		testSubject = createTestSubject();
+		result = testSubject.getArtifactUUID();
+	}
+
+	
+	@Test
+	public void testGetArtifactVersion() throws Exception {
+		Artifact testSubject;
+		String result;
+
+		// default test
+		testSubject = createTestSubject();
+		result = testSubject.getArtifactVersion();
+	}
+
+	
+	@Test
+	public void testGetGeneratedFromUUID() throws Exception {
+		Artifact testSubject;
+		String result;
+
+		// default test
+		testSubject = createTestSubject();
+		result = testSubject.getGeneratedFromUUID();
+	}
+
+	
+	@Test
+	public void testSetArtifactName() throws Exception {
+		Artifact testSubject;
+		String artifactName = "";
+
+		// default test
+		testSubject = createTestSubject();
+		testSubject.setArtifactName(artifactName);
+	}
+
+	
+	@Test
+	public void testSetArtifactType() throws Exception {
+		Artifact testSubject;
+		String artifactType = "";
+
+		// default test
+		testSubject = createTestSubject();
+		testSubject.setArtifactType(artifactType);
+	}
+
+	
+	@Test
+	public void testSetArtifactGroupType() throws Exception {
+		Artifact testSubject;
+		String artifactGroupType = "";
+
+		// default test
+		testSubject = createTestSubject();
+		testSubject.setArtifactGroupType(artifactGroupType);
+	}
+
+	
+	@Test
+	public void testSetArtifactLabel() throws Exception {
+		Artifact testSubject;
+		String artifactLabel = "";
+
+		// default test
+		testSubject = createTestSubject();
+		testSubject.setArtifactLabel(artifactLabel);
+	}
+
+	
+	@Test
+	public void testSetArtifactURL() throws Exception {
+		Artifact testSubject;
+		String artifactURL = "";
+
+		// default test
+		testSubject = createTestSubject();
+		testSubject.setArtifactURL(artifactURL);
+	}
+
+	
+	@Test
+	public void testSetArtifactDescription() throws Exception {
+		Artifact testSubject;
+		String artifactDescription = "";
+
+		// default test
+		testSubject = createTestSubject();
+		testSubject.setArtifactDescription(artifactDescription);
+	}
+
+	
+	@Test
+	public void testSetArtifactTimeout() throws Exception {
+		Artifact testSubject;
+		int artifactTimeout = 0;
+
+		// default test
+		testSubject = createTestSubject();
+		testSubject.setArtifactTimeout(artifactTimeout);
+	}
+
+	
+	@Test
+	public void testSetArtifactChecksum() throws Exception {
+		Artifact testSubject;
+		String artifactChecksum = "";
+
+		// default test
+		testSubject = createTestSubject();
+		testSubject.setArtifactChecksum(artifactChecksum);
+	}
+
+	
+	@Test
+	public void testSetArtifactUUID() throws Exception {
+		Artifact testSubject;
+		String artifactUUID = "";
+
+		// default test
+		testSubject = createTestSubject();
+		testSubject.setArtifactUUID(artifactUUID);
+	}
+
+	
+	@Test
+	public void testSetArtifactVersion() throws Exception {
+		Artifact testSubject;
+		String artifactVersion = "";
+
+		// default test
+		testSubject = createTestSubject();
+		testSubject.setArtifactVersion(artifactVersion);
+	}
+
+	
+	@Test
+	public void testSetGeneratedFromUUID() throws Exception {
+		Artifact testSubject;
+		String generatedFromUUID = "";
+
+		// default test
+		testSubject = createTestSubject();
+		testSubject.setGeneratedFromUUID(generatedFromUUID);
+	}
+
+	
+	@Test
+	public void testHashCode() throws Exception {
+		Artifact testSubject;
+		int result;
+
+		// default test
+		testSubject = createTestSubject();
+		testSubject.setArtifactUUID("48a52540-8772-4368-9cdb-1f124ea5c931");
+		result = testSubject.hashCode();
+	}
+
+	
+	@Test
+	public void testEquals() throws Exception {
+		Artifact testSubject;
+		Object o = null;
+		boolean result;
+
+		// default test
+		testSubject = createTestSubject();
+		result = testSubject.equals(o);
+	}
+}
\ No newline at end of file
diff --git a/vid-app-common/src/test/java/org/onap/vid/asdc/beans/ResourceTest.java b/vid-app-common/src/test/java/org/onap/vid/asdc/beans/ResourceTest.java
new file mode 100644
index 0000000..af42409
--- /dev/null
+++ b/vid-app-common/src/test/java/org/onap/vid/asdc/beans/ResourceTest.java
@@ -0,0 +1,391 @@
+package org.onap.vid.asdc.beans;
+
+import java.util.Collection;
+
+import org.junit.Test;
+import org.onap.vid.asdc.beans.Resource.LifecycleState;
+import org.onap.vid.asdc.beans.Resource.Type;
+
+
+public class ResourceTest {
+
+	private Resource createTestSubject() {
+		return new Resource();
+	}
+
+
+	@Test
+	public void testGetUuid() throws Exception {
+		Resource testSubject;
+		String result;
+
+		// default test
+		testSubject = createTestSubject();
+		result = testSubject.getUuid();
+	}
+
+
+	@Test
+	public void testGetInvariantUUID() throws Exception {
+		Resource testSubject;
+		String result;
+
+		// default test
+		testSubject = createTestSubject();
+		result = testSubject.getInvariantUUID();
+	}
+
+
+	@Test
+	public void testGetName() throws Exception {
+		Resource testSubject;
+		String result;
+
+		// default test
+		testSubject = createTestSubject();
+		result = testSubject.getName();
+	}
+
+
+	@Test
+	public void testGetDescription() throws Exception {
+		Resource testSubject;
+		String result;
+
+		// default test
+		testSubject = createTestSubject();
+		result = testSubject.getDescription();
+	}
+
+
+	@Test
+	public void testGetVersion() throws Exception {
+		Resource testSubject;
+		String result;
+
+		// default test
+		testSubject = createTestSubject();
+		result = testSubject.getVersion();
+	}
+
+
+	@Test
+	public void testGetToscaModelURL() throws Exception {
+		Resource testSubject;
+		String result;
+
+		// default test
+		testSubject = createTestSubject();
+		result = testSubject.getToscaModelURL();
+	}
+
+
+	@Test
+	public void testGetCategory() throws Exception {
+		Resource testSubject;
+		String result;
+
+		// default test
+		testSubject = createTestSubject();
+		result = testSubject.getCategory();
+	}
+
+
+	@Test
+	public void testGetSubCategory() throws Exception {
+		Resource testSubject;
+		String result;
+
+		// default test
+		testSubject = createTestSubject();
+		result = testSubject.getSubCategory();
+	}
+
+
+	@Test
+	public void testGetResourceType() throws Exception {
+		Resource testSubject;
+		Type result;
+
+		// default test
+		testSubject = createTestSubject();
+		result = testSubject.getResourceType();
+	}
+
+
+	@Test
+	public void testGetLifecycleState() throws Exception {
+		Resource testSubject;
+		LifecycleState result;
+
+		// default test
+		testSubject = createTestSubject();
+		result = testSubject.getLifecycleState();
+	}
+
+
+	@Test
+	public void testGetLastUpdaterUserId() throws Exception {
+		Resource testSubject;
+		String result;
+
+		// default test
+		testSubject = createTestSubject();
+		result = testSubject.getLastUpdaterUserId();
+	}
+
+	
+	@Test
+	public void testGetLastUpdaterFullName() throws Exception {
+		Resource testSubject;
+		String result;
+
+		// default test
+		testSubject = createTestSubject();
+		result = testSubject.getLastUpdaterFullName();
+	}
+
+
+	@Test
+	public void testGetToscaModel() throws Exception {
+		Resource testSubject;
+		String result;
+
+		// default test
+		testSubject = createTestSubject();
+		result = testSubject.getToscaModel();
+	}
+
+
+	@Test
+	public void testGetToscaResourceName() throws Exception {
+		Resource testSubject;
+		String result;
+
+		// default test
+		testSubject = createTestSubject();
+		result = testSubject.getToscaResourceName();
+	}
+
+
+	@Test
+	public void testGetArtifacts() throws Exception {
+		Resource testSubject;
+		Collection<Artifact> result;
+
+		// default test
+		testSubject = createTestSubject();
+		result = testSubject.getArtifacts();
+	}
+
+
+	@Test
+	public void testGetResources() throws Exception {
+		Resource testSubject;
+		Collection<SubResource> result;
+
+		// default test
+		testSubject = createTestSubject();
+		result = testSubject.getResources();
+	}
+
+
+	@Test
+	public void testSetUuid() throws Exception {
+		Resource testSubject;
+		String uuid = "";
+
+		// default test
+		testSubject = createTestSubject();
+		testSubject.setUuid(uuid);
+	}
+
+
+	@Test
+	public void testSetInvariantUUID() throws Exception {
+		Resource testSubject;
+		String invariantUUID = "";
+
+		// default test
+		testSubject = createTestSubject();
+		testSubject.setInvariantUUID(invariantUUID);
+	}
+
+
+	@Test
+	public void testSetName() throws Exception {
+		Resource testSubject;
+		String name = "";
+
+		// default test
+		testSubject = createTestSubject();
+		testSubject.setName(name);
+	}
+
+
+	@Test
+	public void testSetDescription() throws Exception {
+		Resource testSubject;
+		String description = "";
+
+		// default test
+		testSubject = createTestSubject();
+		testSubject.setDescription(description);
+	}
+
+
+	@Test
+	public void testSetVersion() throws Exception {
+		Resource testSubject;
+		String version = "";
+
+		// default test
+		testSubject = createTestSubject();
+		testSubject.setVersion(version);
+	}
+
+
+	@Test
+	public void testSetToscaModelURL() throws Exception {
+		Resource testSubject;
+		String toscaModelURL = "";
+
+		// default test
+		testSubject = createTestSubject();
+		testSubject.setToscaModelURL(toscaModelURL);
+	}
+
+
+	@Test
+	public void testSetCategory() throws Exception {
+		Resource testSubject;
+		String category = "";
+
+		// default test
+		testSubject = createTestSubject();
+		testSubject.setCategory(category);
+	}
+
+
+	@Test
+	public void testSetSubCategory() throws Exception {
+		Resource testSubject;
+		String subCategory = "";
+
+		// default test
+		testSubject = createTestSubject();
+		testSubject.setSubCategory(subCategory);
+	}
+
+
+	@Test
+	public void testSetResourceType() throws Exception {
+		Resource testSubject;
+		Type resourceType = null;
+
+		// default test
+		testSubject = createTestSubject();
+		testSubject.setResourceType(resourceType);
+	}
+
+
+	@Test
+	public void testSetLifecycleState() throws Exception {
+		Resource testSubject;
+		LifecycleState lifecycleState = null;
+
+		// default test
+		testSubject = createTestSubject();
+		testSubject.setLifecycleState(lifecycleState);
+	}
+
+
+	@Test
+	public void testSetLastUpdaterUserId() throws Exception {
+		Resource testSubject;
+		String lastUpdaterUserId = "";
+
+		// default test
+		testSubject = createTestSubject();
+		testSubject.setLastUpdaterUserId(lastUpdaterUserId);
+	}
+
+
+	@Test
+	public void testSetLastUpdaterFullName() throws Exception {
+		Resource testSubject;
+		String lastUpdaterFullName = "";
+
+		// default test
+		testSubject = createTestSubject();
+		testSubject.setLastUpdaterFullName(lastUpdaterFullName);
+	}
+
+
+	@Test
+	public void testSetToscaModel() throws Exception {
+		Resource testSubject;
+		String toscaModel = "";
+
+		// default test
+		testSubject = createTestSubject();
+		testSubject.setToscaModel(toscaModel);
+	}
+
+
+	@Test
+	public void testSetToscaResourceName() throws Exception {
+		Resource testSubject;
+		String toscaResourceName = "";
+
+		// default test
+		testSubject = createTestSubject();
+		testSubject.setToscaResourceName(toscaResourceName);
+	}
+
+
+	@Test
+	public void testSetArtifacts() throws Exception {
+		Resource testSubject;
+		Collection<Artifact> artifacts = null;
+
+		// default test
+		testSubject = createTestSubject();
+		testSubject.setArtifacts(artifacts);
+	}
+
+
+	@Test
+	public void testSetResources() throws Exception {
+		Resource testSubject;
+		Collection<SubResource> resources = null;
+
+		// default test
+		testSubject = createTestSubject();
+		testSubject.setResources(resources);
+	}
+
+
+	@Test
+	public void testHashCode() throws Exception {
+		Resource testSubject;
+		int result;
+
+		// default test
+		testSubject = createTestSubject();
+		testSubject.setUuid("cb49608f-5a24-4789-b0f7-2595473cb997");
+		result = testSubject.hashCode();
+	}
+
+
+	@Test
+	public void testEquals() throws Exception {
+		Resource testSubject;
+		Object o = null;
+		boolean result;
+
+		// default test
+		testSubject = createTestSubject();
+		result = testSubject.equals(o);
+	}
+}
\ No newline at end of file
diff --git a/vid-app-common/src/test/java/org/onap/vid/asdc/beans/SubResourceTest.java b/vid-app-common/src/test/java/org/onap/vid/asdc/beans/SubResourceTest.java
new file mode 100644
index 0000000..e1672b7
--- /dev/null
+++ b/vid-app-common/src/test/java/org/onap/vid/asdc/beans/SubResourceTest.java
@@ -0,0 +1,167 @@
+package org.onap.vid.asdc.beans;
+
+import java.util.Collection;
+
+import org.junit.Test;
+
+
+public class SubResourceTest {
+
+	private SubResource createTestSubject() {
+		return new SubResource();
+	}
+
+
+	@Test
+	public void testGetResourceInstanceName() throws Exception {
+		SubResource testSubject;
+		String result;
+
+		// default test
+		testSubject = createTestSubject();
+		result = testSubject.getResourceInstanceName();
+	}
+
+
+	@Test
+	public void testGetResourceName() throws Exception {
+		SubResource testSubject;
+		String result;
+
+		// default test
+		testSubject = createTestSubject();
+		result = testSubject.getResourceName();
+	}
+
+
+	@Test
+	public void testGetResourceInvariantUUID() throws Exception {
+		SubResource testSubject;
+		String result;
+
+		// default test
+		testSubject = createTestSubject();
+		result = testSubject.getResourceInvariantUUID();
+	}
+
+
+	@Test
+	public void testGetResourceVersion() throws Exception {
+		SubResource testSubject;
+		String result;
+
+		// default test
+		testSubject = createTestSubject();
+		result = testSubject.getResourceVersion();
+	}
+
+
+	@Test
+	public void testGetResoucreType() throws Exception {
+		SubResource testSubject;
+		String result;
+
+		// default test
+		testSubject = createTestSubject();
+		result = testSubject.getResoucreType();
+	}
+
+
+	@Test
+	public void testGetResourceUUID() throws Exception {
+		SubResource testSubject;
+		String result;
+
+		// default test
+		testSubject = createTestSubject();
+		result = testSubject.getResourceUUID();
+	}
+
+
+	@Test
+	public void testGetArtifacts() throws Exception {
+		SubResource testSubject;
+		Collection<Artifact> result;
+
+		// default test
+		testSubject = createTestSubject();
+		result = testSubject.getArtifacts();
+	}
+
+
+	@Test
+	public void testSetResourceInstanceName() throws Exception {
+		SubResource testSubject;
+		String resourceInstanceName = "";
+
+		// default test
+		testSubject = createTestSubject();
+		testSubject.setResourceInstanceName(resourceInstanceName);
+	}
+
+
+	@Test
+	public void testSetResourceName() throws Exception {
+		SubResource testSubject;
+		String resourceName = "";
+
+		// default test
+		testSubject = createTestSubject();
+		testSubject.setResourceName(resourceName);
+	}
+
+
+	@Test
+	public void testSetResourceInvariantUUID() throws Exception {
+		SubResource testSubject;
+		String resourceInvariantUUID = "";
+
+		// default test
+		testSubject = createTestSubject();
+		testSubject.setResourceInvariantUUID(resourceInvariantUUID);
+	}
+
+
+	@Test
+	public void testSetResourceVersion() throws Exception {
+		SubResource testSubject;
+		String resourceVersion = "";
+
+		// default test
+		testSubject = createTestSubject();
+		testSubject.setResourceVersion(resourceVersion);
+	}
+
+
+	@Test
+	public void testSetResoucreType() throws Exception {
+		SubResource testSubject;
+		String resourceType = "";
+
+		// default test
+		testSubject = createTestSubject();
+		testSubject.setResoucreType(resourceType);
+	}
+
+
+	@Test
+	public void testSetResourceUUID() throws Exception {
+		SubResource testSubject;
+		String resourceUUID = "";
+
+		// default test
+		testSubject = createTestSubject();
+		testSubject.setResourceUUID(resourceUUID);
+	}
+
+
+	@Test
+	public void testSetArtifacts() throws Exception {
+		SubResource testSubject;
+		Collection<Artifact> artifacts = null;
+
+		// default test
+		testSubject = createTestSubject();
+		testSubject.setArtifacts(artifacts);
+	}
+}
\ No newline at end of file
diff --git a/vid-app-common/src/test/java/org/onap/vid/asdc/beans/TestSuite.java b/vid-app-common/src/test/java/org/onap/vid/asdc/beans/TestSuite.java
new file mode 100644
index 0000000..6f0d47a
--- /dev/null
+++ b/vid-app-common/src/test/java/org/onap/vid/asdc/beans/TestSuite.java
@@ -0,0 +1,11 @@
+package org.onap.vid.asdc.beans;
+
+import org.junit.runner.RunWith;
+import org.junit.runners.Suite;
+
+@RunWith(Suite.class)
+@Suite.SuiteClasses(
+
+{ ArtifactTest.class, ResourceTest.class, SubResourceTest.class })
+public class TestSuite { // nothing
+}
diff --git a/vid-app-common/src/test/java/org/onap/vid/asdc/beans/tosca/CapabilityTest.java b/vid-app-common/src/test/java/org/onap/vid/asdc/beans/tosca/CapabilityTest.java
new file mode 100644
index 0000000..7609e36
--- /dev/null
+++ b/vid-app-common/src/test/java/org/onap/vid/asdc/beans/tosca/CapabilityTest.java
@@ -0,0 +1,124 @@
+package org.onap.vid.asdc.beans.tosca;
+
+import java.util.Collection;
+import java.util.Map;
+
+import org.junit.Test;
+
+
+public class CapabilityTest {
+
+	private Capability createTestSubject() {
+		return new Capability();
+	}
+
+	
+	@Test
+	public void testGetType() throws Exception {
+		Capability testSubject;
+		String result;
+
+		// default test
+		testSubject = createTestSubject();
+		result = testSubject.getType();
+	}
+
+	
+	@Test
+	public void testGetDescription() throws Exception {
+		Capability testSubject;
+		String result;
+
+		// default test
+		testSubject = createTestSubject();
+		result = testSubject.getDescription();
+	}
+
+	
+	@Test
+	public void testGetOccurrences() throws Exception {
+		Capability testSubject;
+		Collection<String> result;
+
+		// default test
+		testSubject = createTestSubject();
+		result = testSubject.getOccurrences();
+	}
+
+	
+	@Test
+	public void testGetProperties() throws Exception {
+		Capability testSubject;
+		Map<String, Property> result;
+
+		// default test
+		testSubject = createTestSubject();
+		result = testSubject.getProperties();
+	}
+
+	
+	@Test
+	public void testGetValid_source_types() throws Exception {
+		Capability testSubject;
+		Collection<String> result;
+
+		// default test
+		testSubject = createTestSubject();
+		result = testSubject.getValid_source_types();
+	}
+
+	
+	@Test
+	public void testSetType() throws Exception {
+		Capability testSubject;
+		String type = "";
+
+		// default test
+		testSubject = createTestSubject();
+		testSubject.setType(type);
+	}
+
+	
+	@Test
+	public void testSetDescription() throws Exception {
+		Capability testSubject;
+		String description = "";
+
+		// default test
+		testSubject = createTestSubject();
+		testSubject.setDescription(description);
+	}
+
+	
+	@Test
+	public void testSetOccurrences() throws Exception {
+		Capability testSubject;
+		Collection<String> occurrences = null;
+
+		// default test
+		testSubject = createTestSubject();
+		testSubject.setOccurrences(occurrences);
+	}
+
+	
+	@Test
+	public void testSetProperties() throws Exception {
+		Capability testSubject;
+		Map<String, Property> properties = null;
+
+		// default test
+		testSubject = createTestSubject();
+		testSubject.setProperties(properties);
+	}
+
+	
+	@Test
+	public void testSetValid_source_types() throws Exception {
+		Capability testSubject;
+		Collection<String> valid_source_types = null;
+
+		// default test
+		testSubject = createTestSubject();
+		testSubject.setValid_source_types(valid_source_types);
+	}
+}
\ No newline at end of file
diff --git a/vid-app-common/src/test/java/org/onap/vid/asdc/beans/tosca/ConstraintTest.java b/vid-app-common/src/test/java/org/onap/vid/asdc/beans/tosca/ConstraintTest.java
new file mode 100644
index 0000000..ebba7d1
--- /dev/null
+++ b/vid-app-common/src/test/java/org/onap/vid/asdc/beans/tosca/ConstraintTest.java
@@ -0,0 +1,221 @@
+package org.onap.vid.asdc.beans.tosca;
+
+import java.util.List;
+
+import org.junit.Test;
+
+public class ConstraintTest {
+
+	private Constraint createTestSubject() {
+		return new Constraint();
+	}
+
+	
+	@Test
+	public void testGetvalid_values() throws Exception {
+		Constraint testSubject;
+		List<Object> result;
+
+		// default test
+		testSubject = createTestSubject();
+		result = testSubject.getvalid_values();
+	}
+
+	
+	@Test
+	public void testGetEqual() throws Exception {
+		Constraint testSubject;
+		Object result;
+
+		// default test
+		testSubject = createTestSubject();
+		result = testSubject.getEqual();
+	}
+
+	
+	@Test
+	public void testGetGreater_than() throws Exception {
+		Constraint testSubject;
+		Object result;
+
+		// default test
+		testSubject = createTestSubject();
+		result = testSubject.getGreater_than();
+	}
+
+	
+	@Test
+	public void testGetGreater_or_equal() throws Exception {
+		Constraint testSubject;
+		Object result;
+
+		// default test
+		testSubject = createTestSubject();
+		result = testSubject.getGreater_or_equal();
+	}
+
+	
+	@Test
+	public void testGetLess_than() throws Exception {
+		Constraint testSubject;
+		Object result;
+
+		// default test
+		testSubject = createTestSubject();
+		result = testSubject.getLess_than();
+	}
+
+	
+	@Test
+	public void testGetLess_or_equal() throws Exception {
+		Constraint testSubject;
+		Object result;
+
+		// default test
+		testSubject = createTestSubject();
+		result = testSubject.getLess_or_equal();
+	}
+
+	
+	@Test
+	public void testGetIn_range() throws Exception {
+		Constraint testSubject;
+		List<Object> result;
+
+		// default test
+		testSubject = createTestSubject();
+		result = testSubject.getIn_range();
+	}
+
+	
+	@Test
+	public void testGetLength() throws Exception {
+		Constraint testSubject;
+		Object result;
+
+		// default test
+		testSubject = createTestSubject();
+		result = testSubject.getLength();
+	}
+
+	
+	@Test
+	public void testGetMin_length() throws Exception {
+		Constraint testSubject;
+		Object result;
+
+		// default test
+		testSubject = createTestSubject();
+		result = testSubject.getMin_length();
+	}
+
+	
+	@Test
+	public void testGetMax_length() throws Exception {
+		Constraint testSubject;
+		Object result;
+
+		// default test
+		testSubject = createTestSubject();
+		result = testSubject.getMax_length();
+	}
+
+	
+	@Test
+	public void testSetvalid_values() throws Exception {
+		Constraint testSubject;
+		List<Object> vlist = null;
+
+		// default test
+		testSubject = createTestSubject();
+		testSubject.setvalid_values(vlist);
+	}
+
+	
+	@Test
+	public void testSetEqual() throws Exception {
+		Constraint testSubject;
+		Object e = null;
+
+		// default test
+		testSubject = createTestSubject();
+		testSubject.setEqual(e);
+	}
+
+	
+	@Test
+	public void testSetGreater_than() throws Exception {
+		Constraint testSubject;
+		Object e = null;
+
+		// default test
+		testSubject = createTestSubject();
+		testSubject.setGreater_than(e);
+	}
+
+	
+	@Test
+	public void testSetLess_than() throws Exception {
+		Constraint testSubject;
+		Object e = null;
+
+		// default test
+		testSubject = createTestSubject();
+		testSubject.setLess_than(e);
+	}
+
+	
+	@Test
+	public void testSetIn_range() throws Exception {
+		Constraint testSubject;
+		List<Object> e = null;
+
+		// default test
+		testSubject = createTestSubject();
+		testSubject.setIn_range(e);
+	}
+
+	
+	@Test
+	public void testSetLength() throws Exception {
+		Constraint testSubject;
+		Object e = null;
+
+		// default test
+		testSubject = createTestSubject();
+		testSubject.setLength(e);
+	}
+
+	
+	@Test
+	public void testSetMin_length() throws Exception {
+		Constraint testSubject;
+		Object e = null;
+
+		// default test
+		testSubject = createTestSubject();
+		testSubject.setMin_length(e);
+	}
+
+	
+	@Test
+	public void testSetMax_length() throws Exception {
+		Constraint testSubject;
+		Object e = null;
+
+		// default test
+		testSubject = createTestSubject();
+		testSubject.setMax_length(e);
+	}
+
+	
+	@Test
+	public void testToString() throws Exception {
+		Constraint testSubject;
+		String result;
+
+		// default test
+		testSubject = createTestSubject();
+		result = testSubject.toString();
+	}
+}
\ No newline at end of file
diff --git a/vid-app-common/src/test/java/org/onap/vid/asdc/beans/tosca/GroupTest.java b/vid-app-common/src/test/java/org/onap/vid/asdc/beans/tosca/GroupTest.java
new file mode 100644
index 0000000..3692a15
--- /dev/null
+++ b/vid-app-common/src/test/java/org/onap/vid/asdc/beans/tosca/GroupTest.java
@@ -0,0 +1,124 @@
+package org.onap.vid.asdc.beans.tosca;
+
+import java.util.Collection;
+import java.util.Map;
+
+import org.junit.Test;
+
+
+public class GroupTest {
+
+	private Group createTestSubject() {
+		return new Group();
+	}
+
+	
+	@Test
+	public void testGetMetadata() throws Exception {
+		Group testSubject;
+		ToscaMetadata result;
+
+		// default test
+		testSubject = createTestSubject();
+		result = testSubject.getMetadata();
+	}
+
+	
+	@Test
+	public void testSetMetadata() throws Exception {
+		Group testSubject;
+		ToscaMetadata metadata = null;
+
+		// default test
+		testSubject = createTestSubject();
+		testSubject.setMetadata(metadata);
+	}
+
+	
+	@Test
+	public void testGetMembers() throws Exception {
+		Group testSubject;
+		Collection<String> result;
+
+		// default test
+		testSubject = createTestSubject();
+		result = testSubject.getMembers();
+	}
+
+	
+	@Test
+	public void testSetMembers() throws Exception {
+		Group testSubject;
+		Collection<String> members = null;
+
+		// default test
+		testSubject = createTestSubject();
+		testSubject.setMembers(members);
+	}
+
+	
+	@Test
+	public void testGetType() throws Exception {
+		Group testSubject;
+		String result;
+
+		// default test
+		testSubject = createTestSubject();
+		result = testSubject.getType();
+	}
+
+	
+	@Test
+	public void testSetType() throws Exception {
+		Group testSubject;
+		String type = "";
+
+		// default test
+		testSubject = createTestSubject();
+		testSubject.setType(type);
+	}
+
+	
+	@Test
+	public void testGetvf_module_type() throws Exception {
+		Group testSubject;
+		String result;
+
+		// default test
+		testSubject = createTestSubject();
+		result = testSubject.getvf_module_type();
+	}
+
+	
+	@Test
+	public void testSetvf_module_type() throws Exception {
+		Group testSubject;
+		String vf_module_type = "";
+
+		// default test
+		testSubject = createTestSubject();
+		testSubject.setvf_module_type(vf_module_type);
+	}
+
+	
+	@Test
+	public void testGetProperties() throws Exception {
+		Group testSubject;
+		Map<String, Object> result;
+
+		// default test
+		testSubject = createTestSubject();
+		result = testSubject.getProperties();
+	}
+
+	
+	@Test
+	public void testSetProperties() throws Exception {
+		Group testSubject;
+		Map<String, Object> properties = null;
+
+		// default test
+		testSubject = createTestSubject();
+		testSubject.setProperties(properties);
+	}
+}
\ No newline at end of file
diff --git a/vid-app-common/src/test/java/org/onap/vid/asdc/beans/tosca/NodeTemplateTest.java b/vid-app-common/src/test/java/org/onap/vid/asdc/beans/tosca/NodeTemplateTest.java
new file mode 100644
index 0000000..678a510
--- /dev/null
+++ b/vid-app-common/src/test/java/org/onap/vid/asdc/beans/tosca/NodeTemplateTest.java
@@ -0,0 +1,92 @@
+package org.onap.vid.asdc.beans.tosca;
+
+import java.util.Map;
+
+import org.junit.Test;
+
+public class NodeTemplateTest {
+
+	private NodeTemplate createTestSubject() {
+		return new NodeTemplate();
+	}
+
+	@Test
+	public void testGetType() throws Exception {
+		NodeTemplate testSubject;
+		String result;
+
+		// default test
+		testSubject = createTestSubject();
+		result = testSubject.getType();
+	}
+
+	@Test
+	public void testSetType() throws Exception {
+		NodeTemplate testSubject;
+		String type = "";
+
+		// default test
+		testSubject = createTestSubject();
+		testSubject.setType(type);
+	}
+
+	@Test
+	public void testGetMetadata() throws Exception {
+		NodeTemplate testSubject;
+		ToscaMetadata result;
+
+		// default test
+		testSubject = createTestSubject();
+		result = testSubject.getMetadata();
+	}
+
+	@Test
+	public void testSetMetadata() throws Exception {
+		NodeTemplate testSubject;
+		ToscaMetadata metadata = null;
+
+		// default test
+		testSubject = createTestSubject();
+		testSubject.setMetadata(metadata);
+	}
+
+	@Test
+	public void testGetProperties() throws Exception {
+		NodeTemplate testSubject;
+		Map<String, Object> result;
+
+		// default test
+		testSubject = createTestSubject();
+		result = testSubject.getProperties();
+	}
+
+	@Test
+	public void testSetProperties() throws Exception {
+		NodeTemplate testSubject;
+		Map<String, Object> properties = null;
+
+		// default test
+		testSubject = createTestSubject();
+		testSubject.setProperties(properties);
+	}
+
+	@Test
+	public void testGetRequirements() throws Exception {
+		NodeTemplate testSubject;
+		Object result;
+
+		// default test
+		testSubject = createTestSubject();
+		result = testSubject.getRequirements();
+	}
+
+	@Test
+	public void testSetRequirements() throws Exception {
+		NodeTemplate testSubject;
+		Object requirements = null;
+
+		// default test
+		testSubject = createTestSubject();
+		testSubject.setRequirements(requirements);
+	}
+}
\ No newline at end of file
diff --git a/vid-app-common/src/test/java/org/onap/vid/asdc/beans/tosca/TestSuite.java b/vid-app-common/src/test/java/org/onap/vid/asdc/beans/tosca/TestSuite.java
new file mode 100644
index 0000000..d94d339
--- /dev/null
+++ b/vid-app-common/src/test/java/org/onap/vid/asdc/beans/tosca/TestSuite.java
@@ -0,0 +1,12 @@
+package org.onap.vid.asdc.beans.tosca;
+
+import org.junit.runner.RunWith;
+import org.junit.runners.Suite;
+
+@RunWith(Suite.class)
+@Suite.SuiteClasses(
+
+{ GroupTest.class, TopologyTemplateTest.class, ToscaModelTest.class, CapabilityTest.class, ToscaMetadataTest.class,
+		ConstraintTest.class, NodeTemplateTest.class })
+public class TestSuite { // nothing
+}
diff --git a/vid-app-common/src/test/java/org/onap/vid/asdc/beans/tosca/TopologyTemplateTest.java b/vid-app-common/src/test/java/org/onap/vid/asdc/beans/tosca/TopologyTemplateTest.java
new file mode 100644
index 0000000..8392d92
--- /dev/null
+++ b/vid-app-common/src/test/java/org/onap/vid/asdc/beans/tosca/TopologyTemplateTest.java
@@ -0,0 +1,101 @@
+package org.onap.vid.asdc.beans.tosca;
+
+import java.util.Map;
+
+import org.junit.Test;
+
+
+public class TopologyTemplateTest {
+
+	private TopologyTemplate createTestSubject() {
+		return new TopologyTemplate();
+	}
+
+	
+	@Test
+	public void testGetsubstitution_mappings() throws Exception {
+		TopologyTemplate testSubject;
+		SubstitutionMappings result;
+
+		// default test
+		testSubject = createTestSubject();
+		result = testSubject.getsubstitution_mappings();
+	}
+
+	
+	@Test
+	public void testSetsubstitution_mappings() throws Exception {
+		TopologyTemplate testSubject;
+		SubstitutionMappings substitution_mappings = null;
+
+		// default test
+		testSubject = createTestSubject();
+		testSubject.setsubstitution_mappings(substitution_mappings);
+	}
+
+	
+	@Test
+	public void testGetInputs() throws Exception {
+		TopologyTemplate testSubject;
+		Map<String, Input> result;
+
+		// default test
+		testSubject = createTestSubject();
+		result = testSubject.getInputs();
+	}
+
+	
+	@Test
+	public void testSetInputs() throws Exception {
+		TopologyTemplate testSubject;
+		Map<String, Input> inputs = null;
+
+		// default test
+		testSubject = createTestSubject();
+		testSubject.setInputs(inputs);
+	}
+
+	
+	@Test
+	public void testGetnode_templates() throws Exception {
+		TopologyTemplate testSubject;
+		Map<String, NodeTemplate> result;
+
+		// default test
+		testSubject = createTestSubject();
+		result = testSubject.getnode_templates();
+	}
+
+	
+	@Test
+	public void testSetnode_templates() throws Exception {
+		TopologyTemplate testSubject;
+		Map<String, NodeTemplate> node_templates = null;
+
+		// default test
+		testSubject = createTestSubject();
+		testSubject.setnode_templates(node_templates);
+	}
+
+	
+	@Test
+	public void testGetGroups() throws Exception {
+		TopologyTemplate testSubject;
+		Map<String, Group> result;
+
+		// default test
+		testSubject = createTestSubject();
+		result = testSubject.getGroups();
+	}
+
+	
+	@Test
+	public void testSetGroups() throws Exception {
+		TopologyTemplate testSubject;
+		Map<String, Group> groups = null;
+
+		// default test
+		testSubject = createTestSubject();
+		testSubject.setGroups(groups);
+	}
+}
\ No newline at end of file
diff --git a/vid-app-common/src/test/java/org/onap/vid/asdc/beans/tosca/ToscaMetadataTest.java b/vid-app-common/src/test/java/org/onap/vid/asdc/beans/tosca/ToscaMetadataTest.java
new file mode 100644
index 0000000..2c91d96
--- /dev/null
+++ b/vid-app-common/src/test/java/org/onap/vid/asdc/beans/tosca/ToscaMetadataTest.java
@@ -0,0 +1,443 @@
+package org.onap.vid.asdc.beans.tosca;
+
+import org.junit.Test;
+
+public class ToscaMetadataTest {
+
+	private ToscaMetadata createTestSubject() {
+		return new ToscaMetadata();
+	}
+
+	@Test
+	public void testGetType() throws Exception {
+		ToscaMetadata testSubject;
+		String result;
+
+		// default test
+		testSubject = createTestSubject();
+		result = testSubject.getType();
+	}
+
+	@Test
+	public void testGetInvariantUUID() throws Exception {
+		ToscaMetadata testSubject;
+		String result;
+
+		// default test
+		testSubject = createTestSubject();
+		result = testSubject.getInvariantUUID();
+	}
+
+	@Test
+	public void testGetCustomizationUUID() throws Exception {
+		ToscaMetadata testSubject;
+		String result;
+
+		// default test
+		testSubject = createTestSubject();
+		result = testSubject.getCustomizationUUID();
+	}
+
+	@Test
+	public void testGetUUID() throws Exception {
+		ToscaMetadata testSubject;
+		String result;
+
+		// default test
+		testSubject = createTestSubject();
+		result = testSubject.getUUID();
+	}
+
+	@Test
+	public void testGetVersion() throws Exception {
+		ToscaMetadata testSubject;
+		String result;
+
+		// default test
+		testSubject = createTestSubject();
+		result = testSubject.getVersion();
+	}
+
+	@Test
+	public void testGetName() throws Exception {
+		ToscaMetadata testSubject;
+		String result;
+
+		// default test
+		testSubject = createTestSubject();
+		result = testSubject.getName();
+	}
+
+	@Test
+	public void testGetDescription() throws Exception {
+		ToscaMetadata testSubject;
+		String result;
+
+		// default test
+		testSubject = createTestSubject();
+		result = testSubject.getDescription();
+	}
+
+	@Test
+	public void testGetCategory() throws Exception {
+		ToscaMetadata testSubject;
+		String result;
+
+		// default test
+		testSubject = createTestSubject();
+		result = testSubject.getCategory();
+	}
+
+	@Test
+	public void testGetSubcategory() throws Exception {
+		ToscaMetadata testSubject;
+		String result;
+
+		// default test
+		testSubject = createTestSubject();
+		result = testSubject.getSubcategory();
+	}
+
+	@Test
+	public void testGetResourceVendor() throws Exception {
+		ToscaMetadata testSubject;
+		String result;
+
+		// default test
+		testSubject = createTestSubject();
+		result = testSubject.getResourceVendor();
+	}
+
+	@Test
+	public void testGetResourceVendorRelease() throws Exception {
+		ToscaMetadata testSubject;
+		String result;
+
+		// default test
+		testSubject = createTestSubject();
+		result = testSubject.getResourceVendorRelease();
+	}
+
+	@Test
+	public void testGetServiceEcompNaming() throws Exception {
+		ToscaMetadata testSubject;
+		String result;
+
+		// default test
+		testSubject = createTestSubject();
+		result = testSubject.getServiceEcompNaming();
+	}
+
+	@Test
+	public void testGetNamingPolicy() throws Exception {
+		ToscaMetadata testSubject;
+		String result;
+
+		// default test
+		testSubject = createTestSubject();
+		result = testSubject.getNamingPolicy();
+	}
+
+	@Test
+	public void testIsServiceHoming() throws Exception {
+		ToscaMetadata testSubject;
+		boolean result;
+
+		// default test
+		testSubject = createTestSubject();
+		result = testSubject.isServiceHoming();
+	}
+
+	@Test
+	public void testIsEcompGeneratedNaming() throws Exception {
+		ToscaMetadata testSubject;
+		boolean result;
+
+		// default test
+		testSubject = createTestSubject();
+		result = testSubject.isEcompGeneratedNaming();
+	}
+
+	@Test
+	public void testSetType() throws Exception {
+		ToscaMetadata testSubject;
+		String type = "";
+
+		// default test
+		testSubject = createTestSubject();
+		testSubject.setType(type);
+	}
+
+	@Test
+	public void testSetInvariantUUID() throws Exception {
+		ToscaMetadata testSubject;
+		String invariantUUID = "";
+
+		// default test
+		testSubject = createTestSubject();
+		testSubject.setInvariantUUID(invariantUUID);
+	}
+
+	@Test
+	public void testSetNamingPolicy() throws Exception {
+		ToscaMetadata testSubject;
+		String namingPolicy = "";
+
+		// default test
+		testSubject = createTestSubject();
+		testSubject.setNamingPolicy(namingPolicy);
+	}
+
+	@Test
+	public void testSetUUID() throws Exception {
+		ToscaMetadata testSubject;
+		String uuid = "";
+
+		// default test
+		testSubject = createTestSubject();
+		testSubject.setUUID(uuid);
+	}
+
+	@Test
+	public void testSetCustomizationUUID() throws Exception {
+		ToscaMetadata testSubject;
+		String u = "";
+
+		// default test
+		testSubject = createTestSubject();
+		testSubject.setCustomizationUUID(u);
+	}
+
+	@Test
+	public void testSetVersion() throws Exception {
+		ToscaMetadata testSubject;
+		String version = "";
+
+		// default test
+		testSubject = createTestSubject();
+		testSubject.setVersion(version);
+	}
+
+	@Test
+	public void testSetName() throws Exception {
+		ToscaMetadata testSubject;
+		String name = "";
+
+		// default test
+		testSubject = createTestSubject();
+		testSubject.setName(name);
+	}
+
+	@Test
+	public void testSetDescription() throws Exception {
+		ToscaMetadata testSubject;
+		String description = "";
+
+		// default test
+		testSubject = createTestSubject();
+		testSubject.setDescription(description);
+	}
+
+	@Test
+	public void testSetCategory() throws Exception {
+		ToscaMetadata testSubject;
+		String category = "";
+
+		// default test
+		testSubject = createTestSubject();
+		testSubject.setCategory(category);
+	}
+
+	@Test
+	public void testSetServiceEcompNaming() throws Exception {
+		ToscaMetadata testSubject;
+		String serviceEcompNaming = "";
+
+		// default test
+		testSubject = createTestSubject();
+		testSubject.setServiceEcompNaming(serviceEcompNaming);
+	}
+
+	@Test
+	public void testSetServiceHoming() throws Exception {
+		ToscaMetadata testSubject;
+		boolean serviceHoming = false;
+
+		// default test
+		testSubject = createTestSubject();
+		testSubject.setServiceHoming(serviceHoming);
+	}
+
+	@Test
+	public void testSetEcompGeneratedNaming() throws Exception {
+		ToscaMetadata testSubject;
+		boolean ecompGeneratedNaming = false;
+
+		// default test
+		testSubject = createTestSubject();
+		testSubject.setEcompGeneratedNaming(ecompGeneratedNaming);
+	}
+
+	@Test
+	public void testGettemplate_name() throws Exception {
+		ToscaMetadata testSubject;
+		String result;
+
+		// default test
+		testSubject = createTestSubject();
+		result = testSubject.gettemplate_name();
+	}
+
+	@Test
+	public void testSettemplate_name() throws Exception {
+		ToscaMetadata testSubject;
+		String template_name = "";
+
+		// default test
+		testSubject = createTestSubject();
+		testSubject.settemplate_name(template_name);
+	}
+
+	
+	@Test
+	public void testSetSubcategory() throws Exception {
+		ToscaMetadata testSubject;
+		String subcategory = "";
+
+		// default test
+		testSubject = createTestSubject();
+		testSubject.setSubcategory(subcategory);
+	}
+
+	
+	@Test
+	public void testSetResourceVendor() throws Exception {
+		ToscaMetadata testSubject;
+		String resourceVendor = "";
+
+		// default test
+		testSubject = createTestSubject();
+		testSubject.setResourceVendor(resourceVendor);
+	}
+
+	
+	@Test
+	public void testSetResourceVendorRelease() throws Exception {
+		ToscaMetadata testSubject;
+		String resourceVendorRelease = "";
+
+		// default test
+		testSubject = createTestSubject();
+		testSubject.setResourceVendorRelease(resourceVendorRelease);
+	}
+
+	
+	@Test
+	public void testGetVfModuleModelName() throws Exception {
+		ToscaMetadata testSubject;
+		String result;
+
+		// default test
+		testSubject = createTestSubject();
+		result = testSubject.getVfModuleModelName();
+	}
+
+	
+	@Test
+	public void testSetVfModuleModelName() throws Exception {
+		ToscaMetadata testSubject;
+		String vfModuleModelName = "";
+
+		// default test
+		testSubject = createTestSubject();
+		testSubject.setVfModuleModelName(vfModuleModelName);
+	}
+
+	
+	@Test
+	public void testGetVfModuleModelInvariantUUID() throws Exception {
+		ToscaMetadata testSubject;
+		String result;
+
+		// default test
+		testSubject = createTestSubject();
+		result = testSubject.getVfModuleModelInvariantUUID();
+	}
+
+	
+	@Test
+	public void testSetVfModuleModelInvariantUUID() throws Exception {
+		ToscaMetadata testSubject;
+		String vfModuleModelInvariantUUID = "";
+
+		// default test
+		testSubject = createTestSubject();
+		testSubject.setVfModuleModelInvariantUUID(vfModuleModelInvariantUUID);
+	}
+
+	
+	@Test
+	public void testGetVfModuleModelUUID() throws Exception {
+		ToscaMetadata testSubject;
+		String result;
+
+		// default test
+		testSubject = createTestSubject();
+		result = testSubject.getVfModuleModelUUID();
+	}
+
+	
+	@Test
+	public void testSetVfModuleModelUUID() throws Exception {
+		ToscaMetadata testSubject;
+		String vfModuleModelUUID = "";
+
+		// default test
+		testSubject = createTestSubject();
+		testSubject.setVfModuleModelUUID(vfModuleModelUUID);
+	}
+
+	
+	@Test
+	public void testGetVfModuleModelVersion() throws Exception {
+		ToscaMetadata testSubject;
+		String result;
+
+		// default test
+		testSubject = createTestSubject();
+		result = testSubject.getVfModuleModelVersion();
+	}
+
+	
+	@Test
+	public void testSetVfModuleModelVersion() throws Exception {
+		ToscaMetadata testSubject;
+		String vfModuleModelVersion = "";
+
+		// default test
+		testSubject = createTestSubject();
+		testSubject.setVfModuleModelVersion(vfModuleModelVersion);
+	}
+
+	
+	@Test
+	public void testSetVfModuleModelCustomizationUUID() throws Exception {
+		ToscaMetadata testSubject;
+		String u = "";
+
+		// default test
+		testSubject = createTestSubject();
+		testSubject.setVfModuleModelCustomizationUUID(u);
+	}
+
+	
+	@Test
+	public void testGetVfModuleModelCustomizationUUID() throws Exception {
+		ToscaMetadata testSubject;
+		String result;
+
+		// default test
+		testSubject = createTestSubject();
+		result = testSubject.getVfModuleModelCustomizationUUID();
+	}
+}
\ No newline at end of file
diff --git a/vid-app-common/src/test/java/org/onap/vid/asdc/beans/tosca/ToscaModelTest.java b/vid-app-common/src/test/java/org/onap/vid/asdc/beans/tosca/ToscaModelTest.java
new file mode 100644
index 0000000..ee54637
--- /dev/null
+++ b/vid-app-common/src/test/java/org/onap/vid/asdc/beans/tosca/ToscaModelTest.java
@@ -0,0 +1,146 @@
+package org.onap.vid.asdc.beans.tosca;
+
+import java.util.Collection;
+import java.util.Map;
+
+import org.junit.Test;
+
+
+public class ToscaModelTest {
+
+	private ToscaModel createTestSubject() {
+		return new ToscaModel();
+	}
+
+	
+	@Test
+	public void testGetMetadata() throws Exception {
+		ToscaModel testSubject;
+		ToscaMetadata result;
+
+		// default test
+		testSubject = createTestSubject();
+		result = testSubject.getMetadata();
+	}
+
+	
+	@Test
+	public void testSetMetadata() throws Exception {
+		ToscaModel testSubject;
+		ToscaMetadata metadata = null;
+
+		// default test
+		testSubject = createTestSubject();
+		testSubject.setMetadata(metadata);
+	}
+
+	
+	@Test
+	public void testGettosca_definitions_version() throws Exception {
+		ToscaModel testSubject;
+		String result;
+
+		// default test
+		testSubject = createTestSubject();
+		result = testSubject.gettosca_definitions_version();
+	}
+
+	
+	@Test
+	public void testSettosca_definitions_version() throws Exception {
+		ToscaModel testSubject;
+		String tosca_definitions_version = "";
+
+		// default test
+		testSubject = createTestSubject();
+		testSubject.settosca_definitions_version(tosca_definitions_version);
+	}
+
+	
+	@Test
+	public void testGettopology_template() throws Exception {
+		ToscaModel testSubject;
+		TopologyTemplate result;
+
+		// default test
+		testSubject = createTestSubject();
+		result = testSubject.gettopology_template();
+	}
+
+	
+	@Test
+	public void testSettopology_template() throws Exception {
+		ToscaModel testSubject;
+		TopologyTemplate topology_template = null;
+
+		// default test
+		testSubject = createTestSubject();
+		testSubject.settopology_template(topology_template);
+	}
+
+	
+	@Test
+	public void testGetDescription() throws Exception {
+		ToscaModel testSubject;
+		String result;
+
+		// default test
+		testSubject = createTestSubject();
+		result = testSubject.getDescription();
+	}
+
+	
+	@Test
+	public void testSetDescription() throws Exception {
+		ToscaModel testSubject;
+		String description = "";
+
+		// default test
+		testSubject = createTestSubject();
+		testSubject.setDescription(description);
+	}
+
+	
+	@Test
+	public void testGetImports() throws Exception {
+		ToscaModel testSubject;
+		Collection<Map<String, Map<String, String>>> result;
+
+		// default test
+		testSubject = createTestSubject();
+		result = testSubject.getImports();
+	}
+
+	
+	@Test
+	public void testSetImports() throws Exception {
+		ToscaModel testSubject;
+		Collection<Map<String, Map<String, String>>> imports = null;
+
+		// default test
+		testSubject = createTestSubject();
+		testSubject.setImports(imports);
+	}
+
+	
+	@Test
+	public void testGetnode_types() throws Exception {
+		ToscaModel testSubject;
+		Map<String, Object> result;
+
+		// default test
+		testSubject = createTestSubject();
+		result = testSubject.getnode_types();
+	}
+
+	
+	@Test
+	public void testSetnode_types() throws Exception {
+		ToscaModel testSubject;
+		Map<String, Object> node_types = null;
+
+		// default test
+		testSubject = createTestSubject();
+		testSubject.setnode_types(node_types);
+	}
+}
\ No newline at end of file
diff --git a/vid-app-common/src/test/java/org/onap/vid/asdc/parser/ToscaParserImpl2Test.java b/vid-app-common/src/test/java/org/onap/vid/asdc/parser/ToscaParserImpl2Test.java
new file mode 100644
index 0000000..99f8ef3
--- /dev/null
+++ b/vid-app-common/src/test/java/org/onap/vid/asdc/parser/ToscaParserImpl2Test.java
@@ -0,0 +1,154 @@
+package org.onap.vid.asdc.parser;
+
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.databind.SerializationFeature;
+import com.google.common.collect.ImmutableList;
+import org.apache.log4j.Logger;
+import org.junit.Assert;
+import org.onap.vid.controller.WebConfig;
+import org.onap.vid.model.VfModule;
+import org.onap.vid.model.VolumeGroup;
+import org.onap.vid.properties.AsdcClientConfiguration;
+import org.openecomp.portalsdk.core.util.SystemProperties;
+import org.openecomp.sdc.tosca.parser.api.ISdcCsarHelper;
+import org.openecomp.sdc.toscaparser.api.Group;
+import org.openecomp.sdc.toscaparser.api.NodeTemplate;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.test.context.ContextConfiguration;
+import org.springframework.test.context.testng.AbstractTestNGSpringContextTests;
+import org.springframework.test.context.web.WebAppConfiguration;
+import org.springframework.web.context.WebApplicationContext;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
+
+import java.util.ArrayList;
+import java.util.LinkedHashMap;
+import java.util.Map;
+
+import static org.hamcrest.Matchers.*;
+import static org.junit.Assert.assertThat;
+import static org.mockito.Mockito.*;
+
+@Test
+@ContextConfiguration(classes = { WebConfig.class, AsdcClientConfiguration.class, SystemProperties.class })
+@WebAppConfiguration
+public class ToscaParserImpl2Test extends AbstractTestNGSpringContextTests {
+
+    private final String myUUID = "myUUID";
+    private static final Logger log = Logger.getLogger(ToscaParserImpl2Test.class);
+
+    @Autowired
+    private ToscaParserImpl2 toscaParserImpl2;
+
+    @Autowired
+    private WebApplicationContext wac;
+
+    @BeforeMethod
+    private void verifyWiring() {
+        Assert.assertNotNull(wac);
+        Assert.assertNotNull(toscaParserImpl2);
+    }
+
+    @Test
+    public void testGetNFModuleFromVf() throws Exception {
+        ISdcCsarHelper csarHelper = getMockedSdcCsarHelper();
+
+        Map<String, VfModule> vfModulesFromVF = toscaParserImpl2.getVfModulesFromVF(csarHelper, myUUID);
+
+        assertThat(vfModulesFromVF, allOf(
+                aMapWithSize(2),
+                hasKey("withoutVol"),
+                hasKey("withVol")
+        ));
+
+        verify(csarHelper, only()).getVfModulesByVf(anyString());
+    }
+
+    @Test
+    public void testGetVolumeGroupsFromVF() throws Exception {
+        ISdcCsarHelper csarHelper = getMockedSdcCsarHelper();
+
+        Map<String, VolumeGroup> volumeGroupsFromVF = toscaParserImpl2.getVolumeGroupsFromVF(csarHelper, myUUID);
+
+        assertThat(volumeGroupsFromVF, allOf(
+                aMapWithSize(1),
+                hasKey("withVol")
+        ));
+
+        verify(csarHelper, only()).getVfModulesByVf(anyString());
+    }
+
+    private ISdcCsarHelper getMockedSdcCsarHelper() {
+        ISdcCsarHelper csarHelper = mock(ISdcCsarHelper.class);
+
+//        ThreadLocalsHolder.setCollector(new ExceptionCollector("c:\\temp\\foo"));
+
+        Group withVol = createMinimalGroup("withVol", true);
+        Group withoutVol = createMinimalGroup("withoutVol", false);
+
+        when(csarHelper.getVfModulesByVf(myUUID))
+                .thenReturn(ImmutableList.of(withVol, withoutVol));
+
+        return csarHelper;
+    }
+
+    private static Group createMinimalGroup(String name, boolean isVolumeGroup) {
+        LinkedHashMap<String, Object>
+                templates,
+                properties,
+                metadata,
+                customDef,
+                vfModule,
+                vfModuleProperties,
+                volumeGroup;
+
+        templates = new LinkedHashMap<>();
+        templates.put("type", "org.onap.groups.VfModule");
+
+        properties = addNewNamedMap(templates, "properties");
+        properties.put("volume_group", isVolumeGroup);
+
+        metadata = addNewNamedMap(templates, "metadata");
+
+        ArrayList<NodeTemplate> memberNodes = new ArrayList<>();
+
+        customDef = new LinkedHashMap<>();
+        vfModule = addNewNamedMap(customDef, "org.onap.groups.VfModule");
+        vfModuleProperties = addNewNamedMap(vfModule, "properties");
+//        vfModule.put("derived_from", "tosca.groups.Root");
+//        vfModule.put("description", "Grouped all heat resources which are in the same VF Module");
+
+        volumeGroup = addNewNamedMap(vfModuleProperties, "volume_group");
+//        volumeGroup.put("description", "volume_group");
+        volumeGroup.put("type", "boolean");
+        volumeGroup.put("default", false);
+        volumeGroup.put("required", true);
+
+
+        Group group = new Group(
+                name,
+                templates,
+                memberNodes,
+                customDef
+        );
+
+        try {
+            log.info(String.format("Built a group: %s",
+                    (new com.fasterxml.jackson.databind.ObjectMapper())
+                            .configure(SerializationFeature.FAIL_ON_EMPTY_BEANS, false)
+                            .writeValueAsString(group)
+            ));
+        } catch (JsonProcessingException e) {
+            throw new RuntimeException(e);
+        }
+
+        return group;
+    }
+
+    private static LinkedHashMap<String, Object> addNewNamedMap(LinkedHashMap<String, Object> root, String key) {
+        LinkedHashMap<String, Object> properties = new LinkedHashMap<>();
+        root.put(key, properties);
+        return properties;
+    }
+
+}
diff --git a/vid-app-common/src/test/java/org/onap/vid/bl/AaiServiceTest.java b/vid-app-common/src/test/java/org/onap/vid/bl/AaiServiceTest.java
new file mode 100644
index 0000000..b64f5e5
--- /dev/null
+++ b/vid-app-common/src/test/java/org/onap/vid/bl/AaiServiceTest.java
@@ -0,0 +1,143 @@
+package org.onap.vid.bl;
+
+import org.mockito.InjectMocks;
+import org.mockito.Mock;
+import org.mockito.Mockito;
+import org.mockito.MockitoAnnotations;
+import org.onap.vid.aai.AaiClientInterface;
+import org.onap.vid.aai.AaiResponse;
+import org.onap.vid.aai.model.*;
+import org.onap.vid.aai.model.AaiGetPnfs.Pnf;
+import org.onap.vid.aai.model.AaiGetTenatns.GetTenantsResponse;
+import org.onap.vid.roles.Role;
+import org.onap.vid.roles.RoleValidator;
+import org.onap.vid.services.AaiServiceImpl;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.DataProvider;
+import org.testng.annotations.Test;
+
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.List;
+
+import static org.hamcrest.Matchers.arrayWithSize;
+import static org.hamcrest.Matchers.equalTo;
+import static org.testng.Assert.assertEquals;
+import static org.testng.Assert.assertNotNull;
+import static org.hamcrest.MatcherAssert.assertThat;
+
+public class AaiServiceTest {
+
+    @InjectMocks
+    private AaiServiceImpl aaiService;
+
+    @Mock
+    private AaiClientInterface aaiClientInterface;
+
+
+
+    @BeforeMethod
+    public void initMocks(){
+        MockitoAnnotations.initMocks(this);
+    }
+
+    @Test
+    public void testGetSpecificPnf(){
+        Pnf pnf = new Pnf();
+        pnf.setPnfId("11111");
+        AaiResponse<Pnf> aaiResponse = new AaiResponse<>(pnf, "aaaa", 200);
+        Mockito.doReturn(aaiResponse).when(aaiClientInterface).getSpecificPnf(Mockito.anyString());
+        AaiResponse<Pnf> specificPnf = aaiService.getSpecificPnf("1345667");
+        assertNotNull(specificPnf);
+        pnf = specificPnf.getT();
+        assertNotNull(pnf);
+        assertEquals("11111",pnf.getPnfId());
+        assertEquals("aaaa",specificPnf.getErrorMessage());
+        assertEquals(200,specificPnf.getHttpCode());
+    }
+
+    @Test
+    public void testGetAssociatedPnfs(){
+        ServiceRelationships serviceRelationships = createServiceRelationships();
+        AaiResponse<ServiceRelationships> aaiResponse = new AaiResponse<>(serviceRelationships, null, 200);
+        Mockito.doReturn(aaiResponse).when(aaiClientInterface).getServiceInstance(Mockito.anyString(), Mockito.anyString(), Mockito.anyString());
+
+        LogicalLinkResponse logicalLinkResponse = createLogicalLinkResponse();
+        AaiResponse<LogicalLinkResponse> aaiResponse1 = new AaiResponse<>(logicalLinkResponse, null, 200);
+        Mockito.doReturn(aaiResponse1).when(aaiClientInterface).getLogicalLink("SANITY6758cce9%3ALAG1992%7CSANITY6785cce9%3ALAG1961");
+
+        List<String> pnfList = aaiService.getServiceInstanceAssociatedPnfs("123", "456", "789");
+        assertNotNull(pnfList);
+        assertEquals(1, pnfList.size());
+        assertEquals("SANITY6785cce9", pnfList.get(0));
+    }
+
+    private ServiceRelationships createServiceRelationships() {
+        ServiceRelationships serviceRelationships = new ServiceRelationships();
+        serviceRelationships.setServiceInstanceName("test service");
+
+        RelationshipData logicalLinksRelationshipData = new RelationshipData();
+        logicalLinksRelationshipData.setRelationshipKey("logical-link.link-name");
+        logicalLinksRelationshipData.setRelationshipValue("SANITY6758cce9:LAG1992|SANITY6785cce9:LAG1961");
+
+        Relationship logicalLinksRelationship = new Relationship();
+        logicalLinksRelationship.setRelatedTo("logical-link");
+        logicalLinksRelationship.setRelationDataList(Arrays.asList(logicalLinksRelationshipData));
+
+        RelationshipList logicalLinksRelationshipsList = new RelationshipList();
+        logicalLinksRelationshipsList.setRelationship(Arrays.asList(logicalLinksRelationship));
+
+        serviceRelationships.setRelationshipList(logicalLinksRelationshipsList);
+        return serviceRelationships;
+    }
+
+    private LogicalLinkResponse createLogicalLinkResponse() {
+        LogicalLinkResponse logicalLinkResponse = new LogicalLinkResponse();
+        logicalLinkResponse.setLinkName("SANITY6758cce9:LAG1992|SANITY6785cce9:LAG1961");
+
+        RelationshipData lagInterfaceRelationshipData = new RelationshipData();
+        lagInterfaceRelationshipData.setRelationshipKey("pnf.pnf-name");
+        lagInterfaceRelationshipData.setRelationshipValue("SANITY6785cce9");
+
+        Relationship lagInterfaceRelationship = new Relationship();
+        lagInterfaceRelationship.setRelatedTo("lag-interface");
+        lagInterfaceRelationship.setRelationDataList(Arrays.asList(lagInterfaceRelationshipData));
+
+        RelationshipList lagInterfaceRelationshipsList = new RelationshipList();
+        lagInterfaceRelationshipsList.setRelationship(Arrays.asList(lagInterfaceRelationship));
+
+        logicalLinkResponse.setRelationshipList(lagInterfaceRelationshipsList);
+
+        return logicalLinkResponse;
+    }
+
+    @DataProvider
+    public static Object[][] getTenantsData() {
+        return new Object[][] {
+                {"customer1", "serviceType1", "tenant1", "customer1", "serviceType1", "tenant1", "id-1", true},
+                {"customer1", "serviceType1", "TeNant1", "customer1", "serviceType1", "tenant1", "id-1", true},
+                {"customer1", "serviceType1", "TENANT1", "customer1", "serviceType1", "tenant1", "id-1", true},
+                {"customer1", "serviceType1", "tenant2", "customer1", "serviceType1", "tenant1", "tenant2", false},
+                {"customer1", "serviceType1", null, "customer1", "serviceType1", "tenant1", "tenant2", true},
+                {"customer2", "serviceType1", "tenant1", "customer1", "serviceType1", "tenant1", "id-1", false},
+                {"customer1", "serviceType2", "tenant1", "customer1", "serviceType1", "tenant1", "id-1", false},
+                {"customer2", "serviceType1", null, "customer1", "serviceType1", "tenant1", "id-1", false},
+                {"customer1", "serviceType2", null, "customer1", "serviceType1", "tenant1", "id-1", false},
+        };
+    }
+
+    @Test(dataProvider = "getTenantsData")
+    public void testGetTenants(String userGlobalCustomerId, String userServiceType, String userTenantName, String serviceGlobalCustomerId,
+                               String serviceServiceType, String serviceTenantName, String serviceTenantId, boolean expectedIsPermitted) {
+        GetTenantsResponse[] getTenantsResponses = new GetTenantsResponse[] {new GetTenantsResponse(null, serviceTenantName, serviceTenantId, false)};
+        AaiResponse<GetTenantsResponse[]> aaiResponse = new AaiResponse<>(getTenantsResponses, null, 200);
+        Mockito.doReturn(aaiResponse).when(aaiClientInterface).getTenants(serviceGlobalCustomerId, serviceServiceType);
+        Role role = new Role(null, userGlobalCustomerId, userServiceType, userTenantName);
+        RoleValidator roleValidator = new RoleValidator(Collections.singletonList(role));
+        AaiResponse<GetTenantsResponse[]> actualTenants = aaiService.getTenants(serviceGlobalCustomerId, serviceServiceType, roleValidator);
+
+        assertThat(actualTenants.getT(), arrayWithSize(1));
+        assertThat(actualTenants.getT()[0].tenantName, equalTo(serviceTenantName));
+        assertThat(actualTenants.getT()[0].isPermitted, equalTo(expectedIsPermitted));
+    }
+}
diff --git a/vid-app-common/src/test/java/org/onap/vid/client/FakeHttpSessionTest.java b/vid-app-common/src/test/java/org/onap/vid/client/FakeHttpSessionTest.java
new file mode 100644
index 0000000..74cfbcf
--- /dev/null
+++ b/vid-app-common/src/test/java/org/onap/vid/client/FakeHttpSessionTest.java
@@ -0,0 +1,206 @@
+package org.onap.vid.client;
+
+import java.util.Enumeration;
+
+import javax.servlet.ServletContext;
+import javax.servlet.http.HttpSessionContext;
+
+import org.junit.Test;
+
+
+public class FakeHttpSessionTest {
+
+	private FakeHttpSession createTestSubject() {
+		return new FakeHttpSession();
+	}
+
+
+	@Test
+	public void testGetCreationTime() throws Exception {
+		FakeHttpSession testSubject;
+		long result;
+
+		// default test
+		testSubject = createTestSubject();
+		result = testSubject.getCreationTime();
+	}
+
+
+	@Test
+	public void testGetId() throws Exception {
+		FakeHttpSession testSubject;
+		String result;
+
+		// default test
+		testSubject = createTestSubject();
+		result = testSubject.getId();
+	}
+
+
+	@Test
+	public void testGetLastAccessedTime() throws Exception {
+		FakeHttpSession testSubject;
+		long result;
+
+		// default test
+		testSubject = createTestSubject();
+		result = testSubject.getLastAccessedTime();
+	}
+
+
+	@Test
+	public void testGetServletContext() throws Exception {
+		FakeHttpSession testSubject;
+		ServletContext result;
+
+		// default test
+		testSubject = createTestSubject();
+		result = testSubject.getServletContext();
+	}
+
+
+	@Test
+	public void testSetMaxInactiveInterval() throws Exception {
+		FakeHttpSession testSubject;
+		int maxInactiveInterval = 0;
+
+		// default test
+		testSubject = createTestSubject();
+		testSubject.setMaxInactiveInterval(maxInactiveInterval);
+	}
+
+
+	@Test
+	public void testGetMaxInactiveInterval() throws Exception {
+		FakeHttpSession testSubject;
+		int result;
+
+		// default test
+		testSubject = createTestSubject();
+		result = testSubject.getMaxInactiveInterval();
+	}
+
+
+	@Test
+	public void testGetSessionContext() throws Exception {
+		FakeHttpSession testSubject;
+		HttpSessionContext result;
+
+		// default test
+		testSubject = createTestSubject();
+		result = testSubject.getSessionContext();
+	}
+
+
+	@Test
+	public void testGetAttribute() throws Exception {
+		FakeHttpSession testSubject;
+		String name = "";
+		Object result;
+
+		// default test
+		testSubject = createTestSubject();
+		result = testSubject.getAttribute(name);
+	}
+
+
+	@Test
+	public void testGetValue() throws Exception {
+		FakeHttpSession testSubject;
+		String name = "";
+		Object result;
+
+		// default test
+		testSubject = createTestSubject();
+		result = testSubject.getValue(name);
+	}
+
+
+	@Test
+	public void testGetAttributeNames() throws Exception {
+		FakeHttpSession testSubject;
+		Enumeration<String> result;
+
+		// default test
+		testSubject = createTestSubject();
+		result = testSubject.getAttributeNames();
+	}
+
+
+	@Test
+	public void testGetValueNames() throws Exception {
+		FakeHttpSession testSubject;
+		String[] result;
+
+		// default test
+		testSubject = createTestSubject();
+		result = testSubject.getValueNames();
+	}
+
+
+	@Test
+	public void testSetAttribute() throws Exception {
+		FakeHttpSession testSubject;
+		String name = "";
+		Object value = null;
+
+		// default test
+		testSubject = createTestSubject();
+		testSubject.setAttribute(name, value);
+	}
+
+
+	@Test
+	public void testPutValue() throws Exception {
+		FakeHttpSession testSubject;
+		String name = "";
+		Object value = null;
+
+		// default test
+		testSubject = createTestSubject();
+		testSubject.putValue(name, value);
+	}
+
+
+	@Test
+	public void testRemoveAttribute() throws Exception {
+		FakeHttpSession testSubject;
+		String name = "";
+
+		// default test
+		testSubject = createTestSubject();
+		testSubject.removeAttribute(name);
+	}
+
+
+	@Test
+	public void testRemoveValue() throws Exception {
+		FakeHttpSession testSubject;
+		String name = "";
+
+		// default test
+		testSubject = createTestSubject();
+		testSubject.removeValue(name);
+	}
+
+
+	@Test
+	public void testInvalidate() throws Exception {
+		FakeHttpSession testSubject;
+
+		// default test
+		testSubject = createTestSubject();
+		testSubject.invalidate();
+	}
+
+
+	@Test
+	public void testIsNew() throws Exception {
+		FakeHttpSession testSubject;
+		boolean result;
+
+		// default test
+		testSubject = createTestSubject();
+		result = testSubject.isNew();
+	}
+}
\ No newline at end of file
diff --git a/vid-app-common/src/test/java/org/onap/vid/client/TestSuite.java b/vid-app-common/src/test/java/org/onap/vid/client/TestSuite.java
new file mode 100644
index 0000000..434dd5c
--- /dev/null
+++ b/vid-app-common/src/test/java/org/onap/vid/client/TestSuite.java
@@ -0,0 +1,11 @@
+package org.onap.vid.client;
+
+import org.junit.runner.RunWith;
+import org.junit.runners.Suite;
+
+@RunWith(Suite.class)
+@Suite.SuiteClasses(
+
+{ FakeHttpSessionTest.class })
+public class TestSuite { // nothing
+}
diff --git a/vid-app-common/src/test/java/org/onap/vid/controller/AaiControllerTest.java b/vid-app-common/src/test/java/org/onap/vid/controller/AaiControllerTest.java
new file mode 100644
index 0000000..548c480
--- /dev/null
+++ b/vid-app-common/src/test/java/org/onap/vid/controller/AaiControllerTest.java
@@ -0,0 +1,51 @@
+package org.onap.vid.controller;
+
+import javax.servlet.http.HttpServletRequest;
+
+import org.json.simple.JSONObject;
+import org.junit.Test;
+import org.springframework.http.ResponseEntity;
+import org.springframework.web.servlet.ModelAndView;
+
+public class AaiControllerTest {
+
+	private AaiController createTestSubject() {
+		return new AaiController();
+	}
+
+	@Test
+	public void testWelcome() throws Exception {
+		AaiController testSubject;
+		HttpServletRequest request = null;
+		ModelAndView result;
+
+		// default test
+		testSubject = createTestSubject();
+		result = testSubject.welcome(request);
+	}
+
+
+	@Test
+	public void testGetTargetProvStatus() throws Exception {
+		AaiController testSubject;
+		ResponseEntity<String> result;
+
+		// default test
+		testSubject = createTestSubject();
+		result = testSubject.getTargetProvStatus();
+	}
+
+	@Test
+	public void testViewEditGetTenantsFromServiceType() throws Exception {
+		AaiController testSubject;
+		HttpServletRequest request = null;
+		String globalCustomerId = "";
+		String serviceType = "";
+		ResponseEntity<String> result;
+
+		// default test
+		testSubject = createTestSubject();
+		result = testSubject.viewEditGetTenantsFromServiceType(request, globalCustomerId, serviceType);
+	}
+
+}
\ No newline at end of file
diff --git a/vid-app-common/src/test/java/org/onap/vid/controller/HealthCheckControllerTest.java b/vid-app-common/src/test/java/org/onap/vid/controller/HealthCheckControllerTest.java
new file mode 100644
index 0000000..ddbe4e8
--- /dev/null
+++ b/vid-app-common/src/test/java/org/onap/vid/controller/HealthCheckControllerTest.java
@@ -0,0 +1,47 @@
+package org.onap.vid.controller;
+
+import org.junit.Test;
+import org.onap.vid.controller.HealthCheckController.HealthStatus;
+
+public class HealthCheckControllerTest {
+
+	private HealthCheckController createTestSubject() {
+		return new HealthCheckController();
+	}
+
+	@Test
+	public void testGetProfileCount() throws Exception {
+		HealthCheckController testSubject;
+		String driver = "";
+		String URL = "";
+		String username = "";
+		String password = "";
+		int result;
+
+		// default test
+		testSubject = createTestSubject();
+		result = testSubject.getProfileCount(driver, URL, username, password);
+	}
+
+	@Test
+	public void testGethealthCheckStatusforIDNS() throws Exception {
+		HealthCheckController testSubject;
+		HealthStatus result;
+
+		// default test
+		testSubject = createTestSubject();
+		result = testSubject.gethealthCheckStatusforIDNS();
+	}
+
+	@Test
+	public void testGetHealthCheck() throws Exception {
+		HealthCheckController testSubject;
+		String UserAgent = "";
+		String ECOMPRequestID = "";
+		HealthStatus result;
+
+		// default test
+		testSubject = createTestSubject();
+		result = testSubject.getHealthCheck(UserAgent, ECOMPRequestID);
+	}
+}
\ No newline at end of file
diff --git a/vid-app-common/src/test/java/org/onap/vid/controller/LocalWebConfig.java b/vid-app-common/src/test/java/org/onap/vid/controller/LocalWebConfig.java
new file mode 100644
index 0000000..9b6a3e7
--- /dev/null
+++ b/vid-app-common/src/test/java/org/onap/vid/controller/LocalWebConfig.java
@@ -0,0 +1,70 @@
+package org.onap.vid.controller;
+
+import com.fasterxml.jackson.databind.ObjectMapper;
+import org.apache.commons.io.IOUtils;
+import org.json.JSONObject;
+import org.json.JSONTokener;
+import org.onap.vid.aai.AaiClient;
+import org.onap.vid.aai.AaiClientInterface;
+import org.onap.vid.asdc.AsdcClient;
+import org.onap.vid.asdc.local.LocalAsdcClient;
+import org.onap.vid.asdc.parser.ToscaParserImpl2;
+import org.onap.vid.controller.VidController;
+import org.onap.vid.services.AaiService;
+import org.onap.vid.services.AaiServiceImpl;
+import org.onap.vid.services.VidService;
+import org.onap.vid.services.VidServiceImpl;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+
+import java.io.IOException;
+import java.io.InputStream;
+
+@Configuration
+public class LocalWebConfig {
+
+    /**
+     * Gets the object mapper.
+     *
+     * @return the object mapper
+     */
+    @Bean
+    public ObjectMapper getObjectMapper() {
+        return new ObjectMapper();
+    }
+
+
+    @Bean
+    public VidService vidService(AsdcClient asdcClient) {
+        return new VidServiceImpl(asdcClient);
+    }
+
+    @Bean
+    public AaiService getAaiService() {
+        return new AaiServiceImpl();
+    }
+
+    @Bean
+    public AaiClientInterface getAaiClientInterface() {
+        return new AaiClient();
+    }
+
+    @Bean
+    public AsdcClient asdcClient() throws IOException {
+
+
+        final InputStream asdcServicesFile = VidController.class.getClassLoader().getResourceAsStream("sdcservices.json");
+
+        final JSONTokener jsonTokener = new JSONTokener(IOUtils.toString(asdcServicesFile));
+        final JSONObject sdcServicesCatalog = new JSONObject(jsonTokener);
+
+        return new LocalAsdcClient.Builder().catalog(sdcServicesCatalog).build();
+
+    }
+
+    @Bean
+    public ToscaParserImpl2 getToscaParser() {
+        return new ToscaParserImpl2();
+    }
+
+}
diff --git a/vid-app-common/src/test/java/org/onap/vid/controller/MsoControllerTest.java b/vid-app-common/src/test/java/org/onap/vid/controller/MsoControllerTest.java
new file mode 100644
index 0000000..6ca6a9f
--- /dev/null
+++ b/vid-app-common/src/test/java/org/onap/vid/controller/MsoControllerTest.java
@@ -0,0 +1,109 @@
+package org.onap.vid.controller;
+
+import org.apache.commons.lang.StringEscapeUtils;
+import org.openecomp.portalsdk.core.util.SystemProperties;
+import org.onap.vid.controller.MsoConfig;
+import org.onap.vid.controller.MsoController;
+import org.onap.vid.domain.mso.RequestInfo;
+import org.onap.vid.factories.MsoRequestFactory;
+import org.onap.vid.mso.rest.Request;
+import org.onap.vid.mso.rest.RequestDetails;
+import org.onap.vid.mso.rest.Task;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.ResponseEntity;
+import org.springframework.test.context.ContextConfiguration;
+import org.springframework.test.context.testng.AbstractTestNGSpringContextTests;
+import org.springframework.test.context.web.WebAppConfiguration;
+import org.testng.Assert;
+import org.testng.Assert.*;
+import org.testng.annotations.Test;
+
+import java.util.List;
+
+
+@WebAppConfiguration
+@ContextConfiguration(classes = {SystemProperties.class, MsoConfig.class})
+public class MsoControllerTest extends AbstractTestNGSpringContextTests {
+
+    @Autowired
+    MsoRequestFactory msoRequestFactory;
+
+    @Test(enabled = false)
+    public void testInstanceCreationNew() throws Exception {
+
+        RequestDetails requestDetails = msoRequestFactory.createMsoRequest("msoRequest.json");
+        MsoController msoController = new MsoController(null);
+        //TODO: make ths test to really test something
+        //ResponseEntity<String> responseEntityNew = msoController.createSvcInstanceNew(null, requestDetails);
+        ResponseEntity<String> responseEntity = msoController.createSvcInstance(null, requestDetails);
+        //Assert.assertEquals(responseEntityNew, responseEntity);
+
+    }
+
+    @Test(enabled = false)
+    public void testInstanceCreationLocalWithRest() throws Exception {
+
+        RequestDetails requestDetails = msoRequestFactory.createMsoRequest("msoRequest.json");
+        MsoController msoController = new MsoController(null);
+        ResponseEntity<String> responseEntityNew = msoController.createSvcInstance(null, requestDetails);
+        //TODO: make ths test to really test something
+//        ResponseEntity<String> responseEntityRest = msoController.createSvcInstanceNewRest(null, requestDetails);
+//
+//        Assert.assertEquals(responseEntityNew.getBody(), responseEntityRest.getBody());
+
+    }
+
+    @Test(enabled = false)
+    public void testInstanceCreation() throws Exception {
+
+        RequestDetails requestDetails = msoRequestFactory.createMsoRequest("msoRequest.json");
+        MsoController msoController = new MsoController(null);
+        ResponseEntity<String> responseEntity = msoController.createSvcInstance(null, requestDetails);
+
+
+        Assert.assertEquals(responseEntity.getBody(), "{ \"status\": 200, \"entity\": {\n" +
+                "  \"requestReferences\": {\n" +
+                "    \"instanceId\": \"ba00de9b-3c3e-4b0a-a1ad-0c5489e711fb\",\n" +
+                "    \"requestId\": \"311cc766-b673-4a50-b9c5-471f68914586\"\n" +
+                "  }\n" +
+                "}}");
+
+    }
+
+    @Test(enabled = false)
+    public void testGetOrchestrationRequestsForDashboard() throws Exception {
+        MsoController msoController = new MsoController(null);
+        List<Request> orchestrationRequestsForDashboard = msoController.getOrchestrationRequestsForDashboard();
+
+        Assert.assertEquals(orchestrationRequestsForDashboard.size(), 2);
+    }
+
+    @Test(enabled = false)
+    public void testGetManualTasksByRequestId() throws Exception {
+        MsoController msoController = new MsoController(null);
+        List<Task> orchestrationRequestsForDashboard = msoController.getManualTasksByRequestId("za1234d1-5a33-55df-13ab-12abad84e335");
+
+        Assert. assertEquals(orchestrationRequestsForDashboard.get(0).getTaskId(), "daf4dd84-b77a-42da-a051-3239b7a9392c");
+    }
+
+
+    public void testCompleteManualTask() throws Exception { // TODO not done yet
+        RequestInfo requestInfo = new RequestInfo();
+        requestInfo.setResponseValue("rollback");
+        requestInfo.setRequestorId("abc");
+        requestInfo.setSource("VID");
+        RequestDetails requestDetails = new RequestDetails();
+        requestDetails.setRequestInfo(requestInfo);
+        MsoController msoController = new MsoController(null);
+        ResponseEntity<String> responseEntity = msoController.manualTaskComplete("daf4dd84-b77a-42da-a051-3239b7a9392c", requestDetails);
+        String assertString = "{ \\\"status\\\": 200, \\\"entity\\\": {\\n\" +\n" +
+                "                \"  \\\"taskRequestReference\\\": {\\n\" +\n" +
+                "                \"     \\\"taskId\\\": \\\"daf4dd84-b77a-42da-a051-3239b7a9392c\\\"\\n\" +\n" +
+                "                \"      }\\n\" +\n" +
+                "                \"}\\n\" +\n" +
+                "                \"}";
+        Assert.assertEquals(responseEntity.getBody(), StringEscapeUtils.unescapeJava(assertString));
+    }
+
+
+}
diff --git a/vid-app-common/src/test/java/org/onap/vid/controller/PromiseEcompRequestIdFilterTest.java b/vid-app-common/src/test/java/org/onap/vid/controller/PromiseEcompRequestIdFilterTest.java
new file mode 100644
index 0000000..245d8bb
--- /dev/null
+++ b/vid-app-common/src/test/java/org/onap/vid/controller/PromiseEcompRequestIdFilterTest.java
@@ -0,0 +1,168 @@
+package org.onap.vid.controller;
+
+import com.google.common.collect.ImmutableMap;
+import org.mockito.ArgumentCaptor;
+import org.mockito.Mockito;
+import org.mockito.stubbing.Answer;
+import org.openecomp.portalsdk.core.web.support.UserUtils;
+import org.onap.vid.controller.filter.PromiseEcompRequestIdFilter;
+import org.springframework.mock.web.MockHttpServletResponse;
+import org.testng.annotations.Test;
+
+import javax.servlet.FilterChain;
+import javax.servlet.ServletException;
+import javax.servlet.ServletRequest;
+import javax.servlet.ServletResponse;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.util.*;
+import java.util.function.Function;
+
+import static org.hamcrest.CoreMatchers.is;
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.Matchers.*;
+import static org.mockito.Matchers.any;
+import static org.mockito.Matchers.argThat;
+import static org.openecomp.portalsdk.core.util.SystemProperties.ECOMP_REQUEST_ID;
+
+@Test
+public class PromiseEcompRequestIdFilterTest {
+
+    private final String anotherHeader = "ANDREI_RUBLEV";
+    private final String anotherValue = "foo value";
+    private final String mixedCaseHeader = "x-ecomp-REQUESTID";
+
+    @Test
+    public void givenRequestIdHeader_headerValueNotChanged() throws IOException, ServletException {
+
+        final String someTxId = "863850e2-8545-4efd-94b8-afba5f52b3d5";
+
+        final ImmutableMap<String, String> incomingRequestHeaders = ImmutableMap.of(
+                anotherHeader, anotherValue,
+                ECOMP_REQUEST_ID, someTxId
+        );
+
+        buildRequestThenRunThroughFilterAndAssertResultRequestHeaders(incomingRequestHeaders, specificTxId(someTxId));
+    }
+
+    @Test
+    public void givenMixedCaseRequestIdHeader_headerValueNotChanged() throws IOException, ServletException {
+
+        final String someTxId = "729bbd8d-b0c2-4809-a794-dcccd9cda2c0";
+
+        final ImmutableMap<String, String> incomingRequestHeaders = ImmutableMap.of(
+                mixedCaseHeader, someTxId,
+                anotherHeader, anotherValue
+        );
+
+        buildRequestThenRunThroughFilterAndAssertResultRequestHeaders(incomingRequestHeaders, specificTxId(someTxId));
+    }
+
+    @Test
+    public void givenNoRequestIdHeader_headerValueWasGenerated() throws IOException, ServletException {
+
+        final ImmutableMap<String, String> incomingRequestHeaders = ImmutableMap.of(
+                anotherHeader, anotherValue
+        );
+
+        buildRequestThenRunThroughFilterAndAssertResultRequestHeaders(incomingRequestHeaders, UserUtils::getRequestId);
+    }
+
+    
+    private void buildRequestThenRunThroughFilterAndAssertResultRequestHeaders(
+            ImmutableMap<String, String> originalRequestHeaders,
+            Function<HttpServletRequest, String> txIdExtractor
+    ) throws IOException, ServletException {
+        HttpServletRequest servletRequest = createMockedHttpServletRequest(originalRequestHeaders);
+        HttpServletResponse servletResponse = createMockedHttpServletResponse();
+
+        final FilterChain capturingFilterChain = Mockito.mock(FilterChain.class);
+
+        //////////////////
+        //
+        // doFilter() is the function under test
+        //
+        new PromiseEcompRequestIdFilter().doFilter(servletRequest, servletResponse, capturingFilterChain);
+        //
+        //////////////////
+
+        final ServletRequest capturedServletRequest = extractCapturedServletRequest(capturingFilterChain);
+        final ServletResponse capturedServletResponse = extractCapturedServletResponse(capturingFilterChain);
+        final String expectedTxId = txIdExtractor.apply((HttpServletRequest) capturedServletRequest);
+
+        assertRequestObjectHeaders(capturedServletRequest, expectedTxId);
+        assertResponseObjectHeaders(capturedServletResponse, expectedTxId);
+    }
+
+
+    private void assertRequestObjectHeaders(ServletRequest request, String expectedTxId) {
+        /*
+        Assert that:
+        - Two headers are in place
+        - Direct value extraction is as expected
+        - UserUtils.getRequestId() returns correct and valid value
+         */
+        final HttpServletRequest httpServletRequest = (HttpServletRequest) request;
+
+        assertThat(Collections.list(httpServletRequest.getHeaderNames()),
+                containsInAnyOrder(equalToIgnoringCase(ECOMP_REQUEST_ID), equalToIgnoringCase(anotherHeader)));
+
+        assertThat(httpServletRequest.getHeader(anotherHeader), is(anotherValue));
+
+        assertThat(httpServletRequest.getHeader(ECOMP_REQUEST_ID), is(expectedTxId));
+        assertThat(httpServletRequest.getHeader(mixedCaseHeader), is(expectedTxId));
+
+        assertThat(UserUtils.getRequestId(httpServletRequest), is(expectedTxId));
+        assertThat(UserUtils.getRequestId(httpServletRequest), is(not(emptyOrNullString())));
+    }
+
+    private void assertResponseObjectHeaders(ServletResponse response, String txId) {
+        final String REQUEST_ID_HEADER_NAME_IN_RESPONSE = mixedCaseHeader + "-echo";
+        final HttpServletResponse httpServletResponse = (HttpServletResponse) response;
+
+        assertThat("header " + REQUEST_ID_HEADER_NAME_IN_RESPONSE.toLowerCase() + " in response must be provided",
+                httpServletResponse.getHeader(REQUEST_ID_HEADER_NAME_IN_RESPONSE), is(txId));
+    }
+
+
+
+    private HttpServletRequest createMockedHttpServletRequest(Map<String, String> requestHeaders) {
+        HttpServletRequest servletRequest = Mockito.mock(HttpServletRequest.class);
+        requestHeaders.forEach((k, v) -> {
+            Mockito.when(servletRequest.getHeader(argThat(equalToIgnoringCase(k)))).thenReturn(v);
+            Mockito.when(servletRequest.getHeaders(argThat(equalToIgnoringCase(k)))).then(returnEnumerationAnswer(v));
+        });
+        Mockito.when(servletRequest.getHeaderNames()).then(returnEnumerationAnswer(requestHeaders.keySet()));
+        return servletRequest;
+    }
+
+    private HttpServletResponse createMockedHttpServletResponse() {
+        return new MockHttpServletResponse();
+    }
+
+    private static Answer<Enumeration<String>> returnEnumerationAnswer(String ... items) {
+        return returnEnumerationAnswer(Arrays.asList(items));
+    }
+
+    private static Answer<Enumeration<String>> returnEnumerationAnswer(Collection<String> items) {
+        return invocation -> Collections.enumeration(items);
+    }
+
+    private Function<HttpServletRequest, String> specificTxId(String someTxId) {
+        return r -> someTxId;
+    }
+
+    private ServletRequest extractCapturedServletRequest(FilterChain capturingFilterChain) throws IOException, ServletException {
+        ArgumentCaptor<ServletRequest> captor = ArgumentCaptor.forClass(ServletRequest.class);
+        Mockito.verify(capturingFilterChain).doFilter(captor.capture(), any());
+        return captor.getValue();
+    }
+
+    private ServletResponse extractCapturedServletResponse(FilterChain capturingFilterChain) throws IOException, ServletException {
+        ArgumentCaptor<ServletResponse> captor = ArgumentCaptor.forClass(ServletResponse.class);
+        Mockito.verify(capturingFilterChain).doFilter(any(), captor.capture());
+        return captor.getValue();
+    }
+
+}
diff --git a/vid-app-common/src/test/java/org/onap/vid/controller/PropertyControllerTest.java b/vid-app-common/src/test/java/org/onap/vid/controller/PropertyControllerTest.java
new file mode 100644
index 0000000..e9c2e61
--- /dev/null
+++ b/vid-app-common/src/test/java/org/onap/vid/controller/PropertyControllerTest.java
@@ -0,0 +1,39 @@
+package org.onap.vid.controller;
+
+import javax.servlet.http.HttpServletRequest;
+
+import org.junit.Test;
+import org.springframework.http.ResponseEntity;
+import org.springframework.web.servlet.ModelAndView;
+
+public class PropertyControllerTest {
+
+	private PropertyController createTestSubject() {
+		return new PropertyController();
+	}
+
+	@Test
+	public void testWelcome() throws Exception {
+		PropertyController testSubject;
+		HttpServletRequest request = null;
+		ModelAndView result;
+
+		// default test
+		testSubject = createTestSubject();
+		result = testSubject.welcome(request);
+	}
+
+
+	@Test
+	public void testGetProperty() throws Exception {
+		PropertyController testSubject;
+		String name = "";
+		String defaultvalue = "";
+		HttpServletRequest request = null;
+		ResponseEntity<String> result;
+
+		// default test
+		testSubject = createTestSubject();
+		result = testSubject.getProperty(name, defaultvalue, request);
+	}
+}
\ No newline at end of file
diff --git a/vid-app-common/src/test/java/org/onap/vid/controller/ToscaParserMockHelper.java b/vid-app-common/src/test/java/org/onap/vid/controller/ToscaParserMockHelper.java
new file mode 100644
index 0000000..36a1791
--- /dev/null
+++ b/vid-app-common/src/test/java/org/onap/vid/controller/ToscaParserMockHelper.java
@@ -0,0 +1,42 @@
+package org.onap.vid.controller;
+
+import org.onap.vid.model.NewServiceModel;
+
+/**
+ * Created by moriya1 on 04/07/2017.
+ */
+public class ToscaParserMockHelper {
+
+    private String uuid;
+    private String filePath;
+    private NewServiceModel newServiceModel;
+
+    public ToscaParserMockHelper(String uuid, String filePath) {
+        this.uuid = uuid;
+        this.filePath = filePath;
+    }
+
+    public String getUuid() {
+        return uuid;
+    }
+
+    public void setUuid(String uuid) {
+        this.uuid = uuid;
+    }
+
+    public String getFilePath() {
+        return filePath;
+    }
+
+    public void setFilePath(String filePath) {
+        this.filePath = filePath;
+    }
+
+    public NewServiceModel getNewServiceModel() {
+        return newServiceModel;
+    }
+
+    public void setNewServiceModel(NewServiceModel newServiceModel) {
+        this.newServiceModel = newServiceModel;
+    }
+}
diff --git a/vid-app-common/src/test/java/org/onap/vid/controller/VidControllerTest.java b/vid-app-common/src/test/java/org/onap/vid/controller/VidControllerTest.java
new file mode 100644
index 0000000..b443e1f
--- /dev/null
+++ b/vid-app-common/src/test/java/org/onap/vid/controller/VidControllerTest.java
@@ -0,0 +1,187 @@
+package org.onap.vid.controller;
+
+import com.fasterxml.jackson.databind.ObjectMapper;
+import net.javacrumbs.jsonunit.JsonAssert;
+import org.apache.commons.io.IOUtils;
+import org.onap.vid.asdc.AsdcCatalogException;
+import org.onap.vid.asdc.AsdcClient;
+import org.onap.vid.asdc.parser.ToscaParserImpl2;
+import org.onap.vid.model.*;
+import org.openecomp.portalsdk.core.util.SystemProperties;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.mock.web.MockServletContext;
+import org.springframework.test.context.ContextConfiguration;
+import org.springframework.test.context.testng.AbstractTestNGSpringContextTests;
+import org.springframework.test.context.web.WebAppConfiguration;
+import org.testng.Assert;
+import org.testng.annotations.Test;
+
+import static org.onap.vid.testUtils.TestUtils.assertJsonStringEqualsIgnoreNulls;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.nio.file.Path;
+import java.util.Map;
+import java.util.UUID;
+
+//import org.junit.Assert;
+//import org.junit.Ignore;
+//import org.junit.Test;
+//import org.junit.runner.RunWith;
+//import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
+
+@ContextConfiguration(classes = {LocalWebConfig.class, SystemProperties.class})
+//@RunWith(SpringJUnit4ClassRunner.class)
+@WebAppConfiguration
+
+public class VidControllerTest extends AbstractTestNGSpringContextTests {
+
+    @Autowired
+    MockServletContext context;
+    @Autowired
+    private AsdcClient asdcClient;
+    private ToscaParserImpl2 p2 = new ToscaParserImpl2();
+    private ObjectMapper om = new ObjectMapper();
+
+
+    @Test
+    public void assertEqualsBetweenServices() throws Exception {
+        for (ToscaParserMockHelper mockHelper : getExpectedServiceModel()) {
+            Service expectedService = mockHelper.getNewServiceModel().getService();
+            Service actualService = p2.makeServiceModel(getCsarPath(mockHelper.getUuid()), getServiceByUuid(mockHelper.getUuid())).getService();
+            assertJsonStringEqualsIgnoreNulls(om.writeValueAsString(expectedService), om.writeValueAsString(actualService));
+        }
+    }
+
+//    @Test
+//    public void assertEqualBetweenObjects() throws Exception {
+//        for (ToscaParserMockHelper mockHelper : getExpectedServiceModel()) {
+//            final Path csarPath = getCsarPath(mockHelper.getUuid());
+//            System.out.println("Comparing for csar " + csarPath);
+//            ServiceModel actualServiceModel = p2.makeServiceModel(csarPath, getServiceByUuid(mockHelper.getUuid()));
+//            assertJsonStringEqualsIgnoreNulls(om.writeValueAsString(mockHelper.getNewServiceModel()), om.writeValueAsString(actualServiceModel));
+//        }
+//    }
+
+//    @Test
+//    public void assertEqualsBetweenNetworkNodes() throws Exception {
+//        for (ToscaParserMockHelper mockHelper : getExpectedServiceModel()) {
+//            Map<String, Network> expectedNetworksMap = mockHelper.getNewServiceModel().getNetworks();
+//            Map<String, Network> actualNetworksMap = p2.makeServiceModel(getCsarPath(mockHelper.getUuid()), getServiceByUuid(mockHelper.getUuid())).getNetworks();
+//            for (Map.Entry<String, Network> entry : expectedNetworksMap.entrySet()) {
+//                Network expectedNetwork = entry.getValue();
+//                Network actualNetwork = actualNetworksMap.get(entry.getKey());
+//                Assert.assertEquals(expectedNetwork.getModelCustomizationName(), actualNetwork.getModelCustomizationName());
+//                verifyBaseNodeProperties(expectedNetwork, actualNetwork);
+//                compareProperties(expectedNetwork.getProperties(), actualNetwork.getProperties());
+//            }
+//        }
+//    }
+
+    //Because we are not supporting the old flow, the JSON are different by definition.
+    @Test
+    public void assertEqualsBetweenVnfsOfTosca() throws Exception {
+        for (ToscaParserMockHelper mockHelper : getExpectedServiceModel()) {
+            Map<String, VNF> expectedVnfsMap = mockHelper.getNewServiceModel().getVnfs();
+            Map<String, VNF> actualVnfsMap = p2.makeServiceModel(getCsarPath(mockHelper.getUuid()), getServiceByUuid(mockHelper.getUuid())).getVnfs();
+            for (Map.Entry<String, VNF> entry : expectedVnfsMap.entrySet()) {
+                VNF expectedVnf = entry.getValue();
+                VNF actualVnf = actualVnfsMap.get(entry.getKey());
+                verifyBaseNodeProperties(expectedVnf, actualVnf);
+                Assert.assertEquals(expectedVnf.getModelCustomizationName(), actualVnf.getModelCustomizationName());
+                compareProperties(expectedVnf.getProperties(), actualVnf.getProperties());
+                assertJsonStringEqualsIgnoreNulls(om.writeValueAsString(expectedVnf), om.writeValueAsString(actualVnf));
+            }
+        }
+    }
+
+    @Test
+    public void assertEqualsBetweenVolumeGroups() throws Exception {
+        for (ToscaParserMockHelper mockHelper : getExpectedServiceModel()) {
+            Map<String, VolumeGroup> actualVolumeGroups = p2.makeServiceModel(getCsarPath(mockHelper.getUuid()), getServiceByUuid(mockHelper.getUuid())).getVolumeGroups();
+            Map<String, VolumeGroup> expectedVolumeGroups = mockHelper.getNewServiceModel().getVolumeGroups();
+            JsonAssert.assertJsonEquals(actualVolumeGroups, expectedVolumeGroups);
+        }
+    }
+
+    @Test
+    public void assertEqualsBetweenVfModules() throws Exception {
+        for (ToscaParserMockHelper mockHelper : getExpectedServiceModel()) {
+            Map<String, VfModule> actualVfModules = p2.makeServiceModel(getCsarPath(mockHelper.getUuid()), getServiceByUuid(mockHelper.getUuid())).getVfModules();
+            Map<String, VfModule> expectedVfModules = mockHelper.getNewServiceModel().getVfModules();
+            JsonAssert.assertJsonEquals(actualVfModules, expectedVfModules);
+        }
+    }
+
+    @Test
+    public void assertEqualsBetweenPolicyConfigurationNodes() throws Exception {
+        for (ToscaParserMockHelper mockHelper : getExpectedServiceModel()) {
+            Map<String, PortMirroringConfig> actualConfigurations = p2.makeServiceModel(getCsarPath(mockHelper.getUuid()), getServiceByUuid(mockHelper.getUuid())).getConfigurations();
+            Map<String, PortMirroringConfig> expectedConfigurations = mockHelper.getNewServiceModel().getConfigurations();
+            JsonAssert.assertJsonEquals(actualConfigurations, expectedConfigurations);
+        }
+    }
+
+    @Test
+    public void assertEqualsBetweenServiceProxyNodes() throws Exception {
+        for (ToscaParserMockHelper mockHelper : getExpectedServiceModel()) {
+            Map<String, ServiceProxy> actualServiceProxies = p2.makeServiceModel(getCsarPath(mockHelper.getUuid()), getServiceByUuid(mockHelper.getUuid())).getServiceProxies();
+            Map<String, ServiceProxy> expectedServiceProxies = mockHelper.getNewServiceModel().getServiceProxies();
+            JsonAssert.assertJsonEquals(actualServiceProxies, expectedServiceProxies);
+        }
+    }
+
+    private void verifyBaseNodeProperties(Node expectedNode, Node actualNode) {
+        Assert.assertEquals(expectedNode.getName(), actualNode.getName());
+        Assert.assertEquals(expectedNode.getCustomizationUuid(), actualNode.getCustomizationUuid());
+        Assert.assertEquals(expectedNode.getDescription(), actualNode.getDescription());
+        Assert.assertEquals(expectedNode.getInvariantUuid(), actualNode.getInvariantUuid());
+        Assert.assertEquals(expectedNode.getUuid(), actualNode.getUuid());
+        Assert.assertEquals(expectedNode.getVersion(), actualNode.getVersion());
+    }
+
+    private void compareProperties(Map<String, String> expectedProperties, Map<String, String> actualProperties) {
+        for (Map.Entry<String, String> property : expectedProperties.entrySet()) {
+            String expectedValue = property.getValue();
+            String key = property.getKey();
+            String actualValue = actualProperties.get(key);
+            Assert.assertEquals(expectedValue, actualValue);
+        }
+    }
+
+    private ToscaParserMockHelper[] getExpectedServiceModel() throws IOException {
+        ToscaParserMockHelper[] mockHelpers = {
+                new ToscaParserMockHelper(Constants.vlUuid, Constants.vlFilePath),
+                new ToscaParserMockHelper(Constants.vfUuid, Constants.vfFilePath),
+                new ToscaParserMockHelper(Constants.configurationUuid, Constants.configurationFilePath),
+        };
+        for (ToscaParserMockHelper mockHelper : mockHelpers) {
+            InputStream jsonFile = VidControllerTest.class.getClassLoader().getResourceAsStream(mockHelper.getFilePath());
+            String expectedJsonAsString = IOUtils.toString(jsonFile);
+            NewServiceModel newServiceModel1 = om.readValue(expectedJsonAsString, NewServiceModel.class);
+            mockHelper.setNewServiceModel(newServiceModel1);
+        }
+        return mockHelpers;
+    }
+
+    private Path getCsarPath(String uuid) throws AsdcCatalogException {
+        return asdcClient.getServiceToscaModel(UUID.fromString(uuid));
+    }
+
+    private org.onap.vid.asdc.beans.Service getServiceByUuid(String uuid) throws AsdcCatalogException {
+        return asdcClient.getService(UUID.fromString(uuid));
+    }
+
+    public class Constants {
+        public static final String configurationUuid = "ee6d61be-4841-4f98-8f23-5de9da846ca7";
+        public static final String configurationFilePath = "policy-configuration-csar.JSON";
+        static final String vfUuid = "48a52540-8772-4368-9cdb-1f124ea5c931";
+        static final String vlUuid = "cb49608f-5a24-4789-b0f7-2595473cb997";
+        //        public static final String PNFUuid = "68101369-6f08-4e99-9a28-fa6327d344f3";
+        static final String vfFilePath = "vf-csar.JSON";
+        static final String vlFilePath = "vl-csar.JSON";
+//        public static final String PNFFilePath = "/Users/Oren/Git/Att/vid_internal/vid-app-common/src/main/resources/pnf.csar";
+
+    }
+
+}
\ No newline at end of file
diff --git a/vid-app-common/src/test/java/org/onap/vid/controller/ViewEditSubControllerTest.java b/vid-app-common/src/test/java/org/onap/vid/controller/ViewEditSubControllerTest.java
new file mode 100644
index 0000000..061b359
--- /dev/null
+++ b/vid-app-common/src/test/java/org/onap/vid/controller/ViewEditSubControllerTest.java
@@ -0,0 +1,45 @@
+//package org.onap.vid.controller;
+//
+//import javax.servlet.http.HttpServletRequest;
+//
+//import org.junit.Test;
+//import org.springframework.web.servlet.ModelAndView;
+//
+//public class ViewEditSubControllerTest {
+//
+//	private ViewEditSubController createTestSubject() {
+//		return new ViewEditSubController();
+//	}
+//
+//	@Test
+//	public void testWelcome() throws Exception {
+//		ViewEditSubController testSubject;
+//		HttpServletRequest request = null;
+//		ModelAndView result;
+//
+//		// default test
+//		testSubject = createTestSubject();
+//		result = testSubject.welcome(request);
+//	}
+//
+//
+//	@Test
+//	public void testGetViewName() throws Exception {
+//		ViewEditSubController testSubject;
+//		String result;
+//
+//		// default test
+//		testSubject = createTestSubject();
+//		result = testSubject.getViewName();
+//	}
+//
+//	@Test
+//	public void testSetViewName() throws Exception {
+//		ViewEditSubController testSubject;
+//		String viewName = "";
+//
+//		// default test
+//		testSubject = createTestSubject();
+//		testSubject.setViewName(viewName);
+//	}
+//}
\ No newline at end of file
diff --git a/vid-app-common/src/test/java/org/onap/vid/integrationTest/AaiIntegrationTest.java b/vid-app-common/src/test/java/org/onap/vid/integrationTest/AaiIntegrationTest.java
new file mode 100644
index 0000000..eaad6cc
--- /dev/null
+++ b/vid-app-common/src/test/java/org/onap/vid/integrationTest/AaiIntegrationTest.java
@@ -0,0 +1,43 @@
+package org.onap.vid.integrationTest;
+
+import org.openecomp.portalsdk.core.util.SystemProperties;
+import org.onap.vid.aai.AaiClient;
+import org.onap.vid.aai.AaiClientInterface;
+import org.onap.vid.aai.AaiResponse;
+import org.onap.vid.aai.model.GetServiceModelsByDistributionStatusResponse;
+import org.onap.vid.aai.model.Result;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.mock.web.MockServletContext;
+import org.springframework.test.context.ContextConfiguration;
+import org.springframework.test.context.testng.AbstractTestNGSpringContextTests;
+import org.springframework.test.context.web.WebAppConfiguration;
+import org.testng.Assert;
+import org.testng.annotations.Test;
+
+
+@ContextConfiguration(classes = {SystemProperties.class})
+
+
+@WebAppConfiguration
+public class AaiIntegrationTest extends AbstractTestNGSpringContextTests {
+
+
+    @Autowired
+    MockServletContext servletContext;
+
+
+    @Test
+    public void testGetServiceModelsFromAai() throws Exception {
+        AaiClientInterface aaiClient = new AaiClient(servletContext);
+        AaiResponse<GetServiceModelsByDistributionStatusResponse> serviceModelsByDistributionStatusResponse = aaiClient.getServiceModelsByDistributionStatus();
+        GetServiceModelsByDistributionStatusResponse response = serviceModelsByDistributionStatusResponse.getT();
+        for(Result result: response.getResults()){
+            Assert.assertNotNull(result.getModel().getModelInvariantId());
+            Assert.assertNotNull(result.getModel().getModelVers().getModelVer().get(0).getModelVersionId());
+            Assert.assertNotNull(result.getModel().getModelVers().getModelVer().get(0).getModelName());
+            Assert.assertNotNull(result.getModel().getModelVers().getModelVer().get(0).getModelVersion());
+        }
+    }
+
+
+}
diff --git a/vid-app-common/src/test/java/org/onap/vid/model/ModelUtilTest.java b/vid-app-common/src/test/java/org/onap/vid/model/ModelUtilTest.java
new file mode 100644
index 0000000..af69b53
--- /dev/null
+++ b/vid-app-common/src/test/java/org/onap/vid/model/ModelUtilTest.java
@@ -0,0 +1,48 @@
+package org.onap.vid.model;
+
+import org.junit.Assert;
+import org.junit.Test;
+
+
+public class ModelUtilTest {
+
+	private ModelUtil createTestSubject() {
+		return new ModelUtil();
+	}
+
+	
+	@Test
+	public void testGetTags() throws Exception {
+		String[] namespaces;
+		String constantValue = "test";
+		String[] result;
+
+		// test 1
+		namespaces = null;
+		result = ModelUtil.getTags(namespaces, constantValue);
+		Assert.assertNull(result);
+
+		// test 2
+		namespaces = new String[] { "" };
+		result = ModelUtil.getTags(namespaces, constantValue);
+		Assert.assertArrayEquals(new String[] { constantValue }, result);
+	}
+
+	
+	@Test
+	public void testIsType() throws Exception {
+		String type = "a";
+		String[] tags;
+		boolean result;
+
+		// test 1
+		tags = null;
+		result = ModelUtil.isType(type, tags);
+		Assert.assertEquals(false, result);
+
+		// test 2
+		tags = new String[] { "a" };
+		result = ModelUtil.isType(type, tags);
+		Assert.assertEquals(true, result);
+	}
+}
\ No newline at end of file
diff --git a/vid-app-common/src/test/java/org/onap/vid/model/NewNodeTest.java b/vid-app-common/src/test/java/org/onap/vid/model/NewNodeTest.java
new file mode 100644
index 0000000..853ad73
--- /dev/null
+++ b/vid-app-common/src/test/java/org/onap/vid/model/NewNodeTest.java
@@ -0,0 +1,212 @@
+package org.onap.vid.model;
+
+import java.util.Map;
+
+import org.junit.Test;
+import org.onap.vid.asdc.beans.tosca.Input;
+
+
+public class NewNodeTest {
+
+	private NewNode createTestSubject() {
+		return new NewNode();
+	}
+
+	
+	@Test
+	public void testGetUuid() throws Exception {
+		NewNode testSubject;
+		String result;
+
+		// default test
+		testSubject = createTestSubject();
+		result = testSubject.getUuid();
+	}
+
+	
+	@Test
+	public void testGetInvariantUuid() throws Exception {
+		NewNode testSubject;
+		String result;
+
+		// default test
+		testSubject = createTestSubject();
+		result = testSubject.getInvariantUuid();
+	}
+
+	
+	@Test
+	public void testGetDescription() throws Exception {
+		NewNode testSubject;
+		String result;
+
+		// default test
+		testSubject = createTestSubject();
+		result = testSubject.getDescription();
+	}
+
+	
+	@Test
+	public void testGetName() throws Exception {
+		NewNode testSubject;
+		String result;
+
+		// default test
+		testSubject = createTestSubject();
+		result = testSubject.getName();
+	}
+
+	
+	@Test
+	public void testGetVersion() throws Exception {
+		NewNode testSubject;
+		String result;
+
+		// default test
+		testSubject = createTestSubject();
+		result = testSubject.getVersion();
+	}
+
+	
+	@Test
+	public void testGetCustomizationUuid() throws Exception {
+		NewNode testSubject;
+		String result;
+
+		// default test
+		testSubject = createTestSubject();
+		result = testSubject.getCustomizationUuid();
+	}
+
+	
+	@Test
+	public void testGetInputs() throws Exception {
+		NewNode testSubject;
+		Map<String, Input> result;
+
+		// default test
+		testSubject = createTestSubject();
+		result = testSubject.getInputs();
+	}
+
+	
+	@Test
+	public void testGetCommands() throws Exception {
+		NewNode testSubject;
+		Map<String, CommandProperty> result;
+
+		// default test
+		testSubject = createTestSubject();
+		result = testSubject.getCommands();
+	}
+
+
+	@Test
+	public void testGetProperties() throws Exception {
+		NewNode testSubject;
+		Map<String, String> result;
+
+		// default test
+		testSubject = createTestSubject();
+		result = testSubject.getProperties();
+	}
+
+	
+	@Test
+	public void testSetUuid() throws Exception {
+		NewNode testSubject;
+		String uuid = "";
+
+		// default test
+		testSubject = createTestSubject();
+		testSubject.setUuid(uuid);
+	}
+
+	
+	@Test
+	public void testSetInvariantUuid() throws Exception {
+		NewNode testSubject;
+		String invariantUuid = "";
+
+		// default test
+		testSubject = createTestSubject();
+		testSubject.setInvariantUuid(invariantUuid);
+	}
+
+	
+	@Test
+	public void testSetDescription() throws Exception {
+		NewNode testSubject;
+		String description = "";
+
+		// default test
+		testSubject = createTestSubject();
+		testSubject.setDescription(description);
+	}
+
+	
+	@Test
+	public void testSetName() throws Exception {
+		NewNode testSubject;
+		String name = "";
+
+		// default test
+		testSubject = createTestSubject();
+		testSubject.setName(name);
+	}
+
+	
+	@Test
+	public void testSetVersion() throws Exception {
+		NewNode testSubject;
+		String version = "";
+
+		// default test
+		testSubject = createTestSubject();
+		testSubject.setVersion(version);
+	}
+
+	
+	@Test
+	public void testSetCustomizationUuid() throws Exception {
+		NewNode testSubject;
+		String u = "";
+
+		// default test
+		testSubject = createTestSubject();
+		testSubject.setCustomizationUuid(u);
+	}
+
+	
+	@Test
+	public void testSetInputs() throws Exception {
+		NewNode testSubject;
+		Map<String, Input> inputs = null;
+
+		// default test
+		testSubject = createTestSubject();
+		testSubject.setInputs(inputs);
+	}
+
+	
+	@Test
+	public void testSetCommands() throws Exception {
+		NewNode testSubject;
+		Map<String, CommandProperty> m = null;
+
+		// default test
+		testSubject = createTestSubject();
+		testSubject.setCommands(m);
+	}
+
+	
+	@Test
+	public void testSetProperties() throws Exception {
+		NewNode testSubject;
+		Map<String, String> p = null;
+
+		// default test
+		testSubject = createTestSubject();
+		testSubject.setProperties(p);
+	}
+}
\ No newline at end of file
diff --git a/vid-app-common/src/test/java/org/onap/vid/model/NewServiceTest.java b/vid-app-common/src/test/java/org/onap/vid/model/NewServiceTest.java
new file mode 100644
index 0000000..ec688bd
--- /dev/null
+++ b/vid-app-common/src/test/java/org/onap/vid/model/NewServiceTest.java
@@ -0,0 +1,235 @@
+package org.onap.vid.model;
+
+import java.util.Map;
+
+import org.junit.Test;
+import org.onap.vid.asdc.beans.tosca.Input;
+
+public class NewServiceTest {
+
+	private NewService createTestSubject() {
+		return new NewService();
+	}
+
+	
+	@Test
+	public void testGetUuid() throws Exception {
+		NewService testSubject;
+		String result;
+
+		// default test
+		testSubject = createTestSubject();
+		result = testSubject.getUuid();
+	}
+
+	
+	@Test
+	public void testGetInvariantUuid() throws Exception {
+		NewService testSubject;
+		String result;
+
+		// default test
+		testSubject = createTestSubject();
+		result = testSubject.getInvariantUuid();
+	}
+
+	
+	@Test
+	public void testGetName() throws Exception {
+		NewService testSubject;
+		String result;
+
+		// default test
+		testSubject = createTestSubject();
+		result = testSubject.getName();
+	}
+
+	
+	@Test
+	public void testGetVersion() throws Exception {
+		NewService testSubject;
+		String result;
+
+		// default test
+		testSubject = createTestSubject();
+		result = testSubject.getVersion();
+	}
+
+	
+	@Test
+	public void testGetToscaModelURL() throws Exception {
+		NewService testSubject;
+		String result;
+
+		// default test
+		testSubject = createTestSubject();
+		result = testSubject.getToscaModelURL();
+	}
+
+	
+	@Test
+	public void testGetCategory() throws Exception {
+		NewService testSubject;
+		String result;
+
+		// default test
+		testSubject = createTestSubject();
+		result = testSubject.getCategory();
+	}
+
+	
+	@Test
+	public void testGetDescription() throws Exception {
+		NewService testSubject;
+		String result;
+
+		// default test
+		testSubject = createTestSubject();
+		result = testSubject.getDescription();
+	}
+
+	
+	@Test
+	public void testGetInputs() throws Exception {
+		NewService testSubject;
+		Map<String, Input> result;
+
+		// default test
+		testSubject = createTestSubject();
+		result = testSubject.getInputs();
+	}
+
+	
+	@Test
+	public void testGetServiceEcompNaming() throws Exception {
+		NewService testSubject;
+		String result;
+
+		// default test
+		testSubject = createTestSubject();
+		result = testSubject.getServiceEcompNaming();
+	}
+
+	
+	@Test
+	public void testSetUuid() throws Exception {
+		NewService testSubject;
+		String uuid = "";
+
+		// default test
+		testSubject = createTestSubject();
+		testSubject.setUuid(uuid);
+	}
+
+	
+	@Test
+	public void testSetInvariantUuid() throws Exception {
+		NewService testSubject;
+		String invariantUuid = "";
+
+		// default test
+		testSubject = createTestSubject();
+		testSubject.setInvariantUuid(invariantUuid);
+	}
+
+	
+	@Test
+	public void testSetName() throws Exception {
+		NewService testSubject;
+		String name = "";
+
+		// default test
+		testSubject = createTestSubject();
+		testSubject.setName(name);
+	}
+
+	
+	@Test
+	public void testSetVersion() throws Exception {
+		NewService testSubject;
+		String version = "";
+
+		// default test
+		testSubject = createTestSubject();
+		testSubject.setVersion(version);
+	}
+
+	
+	@Test
+	public void testSetToscaModelURL() throws Exception {
+		NewService testSubject;
+		String toscaModelURL = "";
+
+		// default test
+		testSubject = createTestSubject();
+		testSubject.setToscaModelURL(toscaModelURL);
+	}
+
+	
+	@Test
+	public void testSetCategory() throws Exception {
+		NewService testSubject;
+		String category = "";
+
+		// default test
+		testSubject = createTestSubject();
+		testSubject.setCategory(category);
+	}
+
+	
+	@Test
+	public void testSetDescription() throws Exception {
+		NewService testSubject;
+		String description = "";
+
+		// default test
+		testSubject = createTestSubject();
+		testSubject.setDescription(description);
+	}
+
+	
+	@Test
+	public void testSetInputs() throws Exception {
+		NewService testSubject;
+		Map<String, Input> inputs = null;
+
+		// default test
+		testSubject = createTestSubject();
+		testSubject.setInputs(inputs);
+	}
+
+	
+	@Test
+	public void testSetServiceEcompNaming() throws Exception {
+		NewService testSubject;
+		String serviceEcompNaming = "";
+
+		// default test
+		testSubject = createTestSubject();
+		testSubject.setServiceEcompNaming(serviceEcompNaming);
+	}
+
+	
+	@Test
+	public void testHashCode() throws Exception {
+		NewService testSubject;
+		int result;
+
+		// default test
+		testSubject = createTestSubject();
+		testSubject.setUuid("cb49608f-5a24-4789-b0f7-2595473cb997");
+		result = testSubject.hashCode();
+	}
+
+	
+	@Test
+	public void testEquals() throws Exception {
+		NewService testSubject;
+		Object o = null;
+		boolean result;
+
+		// default test
+		testSubject = createTestSubject();
+		result = testSubject.equals(o);
+	}
+}
\ No newline at end of file
diff --git a/vid-app-common/src/test/java/org/onap/vid/model/NewVNFTest.java b/vid-app-common/src/test/java/org/onap/vid/model/NewVNFTest.java
new file mode 100644
index 0000000..6546e08
--- /dev/null
+++ b/vid-app-common/src/test/java/org/onap/vid/model/NewVNFTest.java
@@ -0,0 +1,88 @@
+package org.onap.vid.model;
+
+import java.util.Map;
+
+import org.junit.Test;
+
+public class NewVNFTest {
+
+	private NewVNF createTestSubject() {
+		return new NewVNF();
+	}
+
+	
+	@Test
+	public void testGetModelCustomizationName() throws Exception {
+		NewVNF testSubject;
+		String result;
+
+		// default test
+		testSubject = createTestSubject();
+		result = testSubject.getModelCustomizationName();
+	}
+
+	
+	@Test
+	public void testGetVfModules() throws Exception {
+		NewVNF testSubject;
+		Map<String, VfModule> result;
+
+		// default test
+		testSubject = createTestSubject();
+		result = testSubject.getVfModules();
+	}
+
+	
+	@Test
+	public void testSetVfModules() throws Exception {
+		NewVNF testSubject;
+		Map<String, VfModule> vfModules = null;
+
+		// default test
+		testSubject = createTestSubject();
+		testSubject.setVfModules(vfModules);
+	}
+
+	
+	@Test
+	public void testGetVolumeGroups() throws Exception {
+		NewVNF testSubject;
+		Map<String, VolumeGroup> result;
+
+		// default test
+		testSubject = createTestSubject();
+		result = testSubject.getVolumeGroups();
+	}
+
+	
+	@Test
+	public void testSetVolumeGroups() throws Exception {
+		NewVNF testSubject;
+		Map<String, VolumeGroup> volumeGroups = null;
+
+		// default test
+		testSubject = createTestSubject();
+		testSubject.setVolumeGroups(volumeGroups);
+	}
+
+	
+	@Test
+	public void testSetModelCustomizationName() throws Exception {
+		NewVNF testSubject;
+		String modelCustomizationName = "";
+
+		// default test
+		testSubject = createTestSubject();
+		testSubject.setModelCustomizationName(modelCustomizationName);
+	}
+
+	
+	@Test
+	public void testNormalizeName() throws Exception {
+		String originalName = "";
+		String result;
+
+		// default test
+		result = NewVNF.normalizeName(originalName);
+	}
+}
\ No newline at end of file
diff --git a/vid-app-common/src/test/java/org/onap/vid/model/ServiceModelTest.java b/vid-app-common/src/test/java/org/onap/vid/model/ServiceModelTest.java
new file mode 100644
index 0000000..27aa468
--- /dev/null
+++ b/vid-app-common/src/test/java/org/onap/vid/model/ServiceModelTest.java
@@ -0,0 +1,123 @@
+package org.onap.vid.model;
+
+import java.util.Map;
+
+import org.junit.Test;
+import org.onap.vid.asdc.beans.tosca.ToscaModel;
+import org.onap.vid.model.Service;
+
+public class ServiceModelTest {
+
+	private ServiceModel createTestSubject() {
+		return new ServiceModel();
+	}
+
+	@Test
+	public void testGetService() throws Exception {
+		ServiceModel testSubject;
+		Service result;
+
+		// default test
+		testSubject = createTestSubject();
+		result = testSubject.getService();
+	}
+
+	@Test
+	public void testGetVnfs() throws Exception {
+		ServiceModel testSubject;
+		Map<String, VNF> result;
+
+		// default test
+		testSubject = createTestSubject();
+		result = testSubject.getVnfs();
+	}
+
+	@Test
+	public void testGetNetworks() throws Exception {
+		ServiceModel testSubject;
+		Map<String, Network> result;
+
+		// default test
+		testSubject = createTestSubject();
+		result = testSubject.getNetworks();
+	}
+
+	@Test
+	public void testSetService() throws Exception {
+		ServiceModel testSubject;
+		Service service = null;
+
+		// default test
+		testSubject = createTestSubject();
+		testSubject.setService(service);
+	}
+
+	@Test
+	public void testSetVnfs() throws Exception {
+		ServiceModel testSubject;
+		Map<String, VNF> vnfs = null;
+
+		// default test
+		testSubject = createTestSubject();
+		testSubject.setVnfs(vnfs);
+	}
+
+	@Test
+	public void testSetNetworks() throws Exception {
+		ServiceModel testSubject;
+		Map<String, Network> networks = null;
+
+		// default test
+		testSubject = createTestSubject();
+		testSubject.setNetworks(networks);
+	}
+
+	@Test
+	public void testGetVfModules() throws Exception {
+		ServiceModel testSubject;
+		Map<String, VfModule> result;
+
+		// default test
+		testSubject = createTestSubject();
+		result = testSubject.getVfModules();
+	}
+
+	@Test
+	public void testGetVolumeGroups() throws Exception {
+		ServiceModel testSubject;
+		Map<String, VolumeGroup> result;
+
+		// default test
+		testSubject = createTestSubject();
+		result = testSubject.getVolumeGroups();
+	}
+
+	@Test
+	public void testSetVfModules() throws Exception {
+		ServiceModel testSubject;
+		Map<String, VfModule> vfModules = null;
+
+		// default test
+		testSubject = createTestSubject();
+		testSubject.setVfModules(vfModules);
+	}
+
+	@Test
+	public void testSetVolumeGroups() throws Exception {
+		ServiceModel testSubject;
+		Map<String, VolumeGroup> volumeGroups = null;
+
+		// default test
+		testSubject = createTestSubject();
+		testSubject.setVolumeGroups(volumeGroups);
+	}
+
+	@Test
+	public void testAssociateGroups() throws Exception {
+		ServiceModel testSubject;
+
+		// default test
+		testSubject = createTestSubject();
+		testSubject.associateGroups();
+	}
+}
\ No newline at end of file
diff --git a/vid-app-common/src/test/java/org/onap/vid/model/TestSuite.java b/vid-app-common/src/test/java/org/onap/vid/model/TestSuite.java
new file mode 100644
index 0000000..f634fbc
--- /dev/null
+++ b/vid-app-common/src/test/java/org/onap/vid/model/TestSuite.java
@@ -0,0 +1,12 @@
+package org.onap.vid.model;
+
+import org.junit.runner.RunWith;
+import org.junit.runners.Suite;
+
+@RunWith(Suite.class)
+@Suite.SuiteClasses(
+
+{ ModelUtilTest.class, NewServiceTest.class, VolumeGroupTest.class, NewNodeTest.class, ServiceModelTest.class,
+		WorkflowTest.class, NewVNFTest.class })
+public class TestSuite { // nothing
+}
diff --git a/vid-app-common/src/test/java/org/onap/vid/model/VolumeGroupTest.java b/vid-app-common/src/test/java/org/onap/vid/model/VolumeGroupTest.java
new file mode 100644
index 0000000..05e517e
--- /dev/null
+++ b/vid-app-common/src/test/java/org/onap/vid/model/VolumeGroupTest.java
@@ -0,0 +1,169 @@
+package org.onap.vid.model;
+
+import org.junit.Test;
+import org.onap.vid.asdc.beans.tosca.Group;
+
+
+public class VolumeGroupTest {
+
+	private VolumeGroup createTestSubject() {
+		return new VolumeGroup();
+	}
+
+	
+	@Test
+	public void testGetUuid() throws Exception {
+		VolumeGroup testSubject;
+		String result;
+
+		// default test
+		testSubject = createTestSubject();
+		result = testSubject.getUuid();
+	}
+
+	
+	@Test
+	public void testGetCustomizationUuid() throws Exception {
+		VolumeGroup testSubject;
+		String result;
+
+		// default test
+		testSubject = createTestSubject();
+		result = testSubject.getCustomizationUuid();
+	}
+
+	
+	@Test
+	public void testGetModelCustomizationName() throws Exception {
+		VolumeGroup testSubject;
+		String result;
+
+		// default test
+		testSubject = createTestSubject();
+		result = testSubject.getModelCustomizationName();
+	}
+
+	
+	@Test
+	public void testGetInvariantUuid() throws Exception {
+		VolumeGroup testSubject;
+		String result;
+
+		// default test
+		testSubject = createTestSubject();
+		result = testSubject.getInvariantUuid();
+	}
+
+	
+	@Test
+	public void testGetDescription() throws Exception {
+		VolumeGroup testSubject;
+		String result;
+
+		// default test
+		testSubject = createTestSubject();
+		result = testSubject.getDescription();
+	}
+
+	
+	@Test
+	public void testGetName() throws Exception {
+		VolumeGroup testSubject;
+		String result;
+
+		// default test
+		testSubject = createTestSubject();
+		result = testSubject.getName();
+	}
+
+	
+	@Test
+	public void testGetVersion() throws Exception {
+		VolumeGroup testSubject;
+		String result;
+
+		// default test
+		testSubject = createTestSubject();
+		result = testSubject.getVersion();
+	}
+
+	
+	@Test
+	public void testSetUuid() throws Exception {
+		VolumeGroup testSubject;
+		String uuid = "";
+
+		// default test
+		testSubject = createTestSubject();
+		testSubject.setUuid(uuid);
+	}
+
+	
+	@Test
+	public void testSetInvariantUuid() throws Exception {
+		VolumeGroup testSubject;
+		String invariantUuid = "";
+
+		// default test
+		testSubject = createTestSubject();
+		testSubject.setInvariantUuid(invariantUuid);
+	}
+
+	
+	@Test
+	public void testSetDescription() throws Exception {
+		VolumeGroup testSubject;
+		String description = "";
+
+		// default test
+		testSubject = createTestSubject();
+		testSubject.setDescription(description);
+	}
+
+	
+	@Test
+	public void testSetName() throws Exception {
+		VolumeGroup testSubject;
+		String name = "";
+
+		// default test
+		testSubject = createTestSubject();
+		testSubject.setName(name);
+	}
+
+	
+	@Test
+	public void testSetVersion() throws Exception {
+		VolumeGroup testSubject;
+		String version = "";
+
+		// default test
+		testSubject = createTestSubject();
+		testSubject.setVersion(version);
+	}
+
+	
+	@Test
+	public void testSetCustomizationUuid() throws Exception {
+		VolumeGroup testSubject;
+		String u = "";
+
+		// default test
+		testSubject = createTestSubject();
+		testSubject.setCustomizationUuid(u);
+	}
+
+	
+	@Test
+	public void testSetModelCustomizationName() throws Exception {
+		VolumeGroup testSubject;
+		String u = "";
+
+		// default test
+		testSubject = createTestSubject();
+		testSubject.setModelCustomizationName(u);
+	}
+
+	
+
+}
\ No newline at end of file
diff --git a/vid-app-common/src/test/java/org/onap/vid/model/WorkflowTest.java b/vid-app-common/src/test/java/org/onap/vid/model/WorkflowTest.java
new file mode 100644
index 0000000..8cfc65a
--- /dev/null
+++ b/vid-app-common/src/test/java/org/onap/vid/model/WorkflowTest.java
@@ -0,0 +1,72 @@
+package org.onap.vid.model;
+
+import java.util.Collection;
+
+import org.junit.Test;
+
+public class WorkflowTest {
+
+	private Workflow createTestSubject() {
+		return new Workflow();
+	}
+
+	@Test
+	public void testGetId() throws Exception {
+		Workflow testSubject;
+		int result;
+
+		// default test
+		testSubject = createTestSubject();
+		result = testSubject.getId();
+	}
+
+	@Test
+	public void testGetWorkflowName() throws Exception {
+		Workflow testSubject;
+		String result;
+
+		// default test
+		testSubject = createTestSubject();
+		result = testSubject.getWorkflowName();
+	}
+
+	@Test
+	public void testGetVnfNames() throws Exception {
+		Workflow testSubject;
+		Collection<String> result;
+
+		// default test
+		testSubject = createTestSubject();
+		result = testSubject.getVnfNames();
+	}
+
+	@Test
+	public void testSetId() throws Exception {
+		Workflow testSubject;
+		int id = 0;
+
+		// default test
+		testSubject = createTestSubject();
+		testSubject.setId(id);
+	}
+
+	@Test
+	public void testSetWorkflowName() throws Exception {
+		Workflow testSubject;
+		String workflowName = "";
+
+		// default test
+		testSubject = createTestSubject();
+		testSubject.setWorkflowName(workflowName);
+	}
+
+	@Test
+	public void testSetVnfName() throws Exception {
+		Workflow testSubject;
+		Collection<String> vnfNames = null;
+
+		// default test
+		testSubject = createTestSubject();
+		testSubject.setVnfName(vnfNames);
+	}
+}
\ No newline at end of file
diff --git a/vid-app-common/src/test/java/org/onap/vid/model/oeModel.java b/vid-app-common/src/test/java/org/onap/vid/model/oeModel.java
new file mode 100644
index 0000000..9d350cb
--- /dev/null
+++ b/vid-app-common/src/test/java/org/onap/vid/model/oeModel.java
@@ -0,0 +1,10 @@
+package org.onap.vid.model;
+
+import java.util.List;
+import java.util.Map;
+
+public class oeModel {
+    public Map<String,List<Map<String,String>>> categoryParameters;
+}
+
+
diff --git a/vid-app-common/src/test/java/org/onap/vid/mso/MsoBusinessLogicTest.java b/vid-app-common/src/test/java/org/onap/vid/mso/MsoBusinessLogicTest.java
new file mode 100644
index 0000000..4a06857
--- /dev/null
+++ b/vid-app-common/src/test/java/org/onap/vid/mso/MsoBusinessLogicTest.java
@@ -0,0 +1,71 @@
+package org.onap.vid.mso;
+
+import com.fasterxml.jackson.databind.ObjectMapper;
+import org.mockito.InjectMocks;
+import org.mockito.Mock;
+import org.mockito.Mockito;
+import org.mockito.MockitoAnnotations;
+import org.openecomp.portalsdk.core.util.SystemProperties;
+import org.onap.vid.controller.MsoConfig;
+import org.onap.vid.mso.MsoBusinessLogicImpl;
+import org.onap.vid.mso.MsoInterface;
+import org.onap.vid.mso.MsoResponseWrapper;
+import org.onap.vid.mso.rest.RequestDetails;
+import org.springframework.test.context.ContextConfiguration;
+import org.springframework.test.context.testng.AbstractTestNGSpringContextTests;
+import org.springframework.test.context.web.WebAppConfiguration;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
+
+import java.net.URL;
+
+import static org.testng.Assert.assertEquals;
+import static org.testng.Assert.assertNotNull;
+
+@Test
+@ContextConfiguration(classes = { SystemProperties.class, MsoConfig.class })
+@WebAppConfiguration
+public class MsoBusinessLogicTest extends AbstractTestNGSpringContextTests {
+
+    @InjectMocks
+    private MsoBusinessLogicImpl msoBusinessLogic;
+
+    @Mock
+    private MsoInterface msoClient;
+
+    @BeforeMethod
+    public void initMocks(){
+        MockitoAnnotations.initMocks(this);
+    }
+
+    @Test
+    public void testCreateInstance() throws Exception {
+        String instanceId = "3f93c7cb-2fd0-4557-9514-e189b7b04f9d";
+        final RequestDetails requestDetails = setRequestDetails("mso_request_create_configuration.json");
+        Mockito.doReturn(getOkResponse(instanceId)).when(msoClient).createConfigurationInstance(requestDetails, "/serviceInstances/v6/3f93c7cb-2fd0-4557-9514-e189b7b04f9d/configurations");
+        final MsoResponseWrapper msoResponseWrapper = msoBusinessLogic.createConfigurationInstance(requestDetails, instanceId);
+
+        assertNotNull(msoResponseWrapper);
+        assertEquals(202, msoResponseWrapper.getStatus());
+    }
+
+    private MsoResponseWrapper getOkResponse(String instanceId){
+        MsoResponseWrapper responseWrapper = new MsoResponseWrapper();
+        String entity = " \"body\": {\n" +
+                "      \"requestReferences\": {\n" +
+                "        \"instanceId\": \""+instanceId+"\",\n" +
+                "        \"requestId\": \"b6dc9806-b094-42f7-9386-a48de8218ce8\"\n" +
+                "      }";
+        responseWrapper.setEntity(entity);
+        responseWrapper.setStatus(202);
+        return responseWrapper;
+    }
+
+    private RequestDetails setRequestDetails(String bodyFileName)throws Exception {
+        final URL resource = this.getClass().getResource("/payload_jsons/" + bodyFileName);
+        ObjectMapper mapper = new ObjectMapper();
+        RequestDetails requestDetails = mapper.readValue(resource, RequestDetails.class);
+        return requestDetails;
+
+    }
+}
diff --git a/vid-app-common/src/test/java/org/onap/vid/mso/MsoOperationalEnvironmentTest.java b/vid-app-common/src/test/java/org/onap/vid/mso/MsoOperationalEnvironmentTest.java
new file mode 100644
index 0000000..fcf246c
--- /dev/null
+++ b/vid-app-common/src/test/java/org/onap/vid/mso/MsoOperationalEnvironmentTest.java
@@ -0,0 +1,215 @@
+package org.onap.vid.mso;
+
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.databind.SerializationFeature;
+import com.google.common.collect.ImmutableList;
+import com.google.common.collect.ImmutableListMultimap;
+import org.apache.commons.io.IOUtils;
+import org.openecomp.portalsdk.core.util.SystemProperties;
+import org.onap.vid.changeManagement.RequestDetailsWrapper;
+import org.onap.vid.controller.MsoConfig;
+import org.onap.vid.controller.OperationalEnvironmentController;
+import org.onap.vid.controller.OperationalEnvironmentController.*;
+import org.onap.vid.controller.WebConfig;
+import org.onap.vid.mso.MsoBusinessLogic;
+import org.onap.vid.mso.model.OperationalEnvironmentActivateInfo;
+import org.onap.vid.mso.model.OperationalEnvironmentDeactivateInfo;
+import org.onap.vid.mso.rest.OperationalEnvironment.OperationEnvironmentRequestDetails;
+import org.onap.vid.mso.rest.RequestDetails;
+import org.onap.vid.properties.AsdcClientConfiguration;
+import org.skyscreamer.jsonassert.JSONAssert;
+import org.skyscreamer.jsonassert.JSONCompareMode;
+import org.springframework.test.context.ContextConfiguration;
+import org.springframework.test.context.testng.AbstractTestNGSpringContextTests;
+import org.springframework.test.context.web.WebAppConfiguration;
+import org.testng.annotations.DataProvider;
+import org.testng.annotations.Test;
+
+import javax.inject.Inject;
+import java.io.IOException;
+import java.net.URL;
+import java.util.HashMap;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+
+@Test
+@ContextConfiguration(classes = { WebConfig.class, AsdcClientConfiguration.class, SystemProperties.class, MsoConfig.class })
+@WebAppConfiguration
+public class MsoOperationalEnvironmentTest extends AbstractTestNGSpringContextTests {
+
+    @Inject
+    private MsoBusinessLogic msoBusinessLogic;
+
+    @Test(dataProvider = "getOperationalEnvironmentActivationPermutations")
+    public void testJsonResultOfOperationalEnvironmentActivationRequestDetails(HashMap<String, String> permutation) throws IOException {
+
+        // Convert 'manifest' to model
+        final OperationalEnvironmentManifest manifest = new ObjectMapper().readerFor(OperationalEnvironmentManifest.class).readValue(permutation.get("<manifest>"));
+
+        // build OperationalEnvironmentActivateInfo
+        OperationalEnvironmentActivateInfo inputUnderTest = createOperationalEnvironmentActivateInfo("<instanceId>", permutation.get("<userId>"), manifest, permutation.get("<relatedInstanceId>"), permutation.get("<relatedInstanceName>"), permutation.get("<workloadContext>"));
+
+        // transform to RequestDetails, and serialize to json
+        //   -> actually, the function "msoBusinessLogic.createOperationalEnvironmentActivationRequestDetails"
+        //      is the code under test here
+        final RequestDetailsWrapper<RequestDetails> operationalEnvironmentActivationRequestDetails = msoBusinessLogic.createOperationalEnvironmentActivationRequestDetails(inputUnderTest);
+
+        String expected = buildExpectation("payload_jsons/activateOperationalEnvironmentsPayloadToMso.json", permutation);
+
+        assertThatExpectationIsLikeObject(expected, operationalEnvironmentActivationRequestDetails);
+    }
+
+    @DataProvider
+    private Object[][] getOperationalEnvironmentActivationPermutations() throws IOException {
+        final String manifest = "" +
+                "{" +
+                "  \"serviceModelList\": [" +
+                "    {" +
+                "      \"serviceModelVersionId\": \"uuid2\"," +
+                "      \"recoveryAction\": \"retry\"" +
+                "    }" +
+                "  ]" +
+                "}";
+
+
+        final ImmutableListMultimap<String, String> options = ImmutableListMultimap.<String, String>builder()
+                .putAll("<instanceId>", "instanceId")
+                .putAll("<userId>", "1", "0198adb8-87fd-46ef-94ae-258816629c8b")
+                .putAll("<relatedInstanceId>", "relatedInstanceId", "2744cf56-4f00-4e48-917b-c3bd3b1f8984")
+                .putAll("<relatedInstanceName>", "relatedInstanceName", "Brooklynn Puanani")
+                .putAll("<workloadContext>", "workloadContext", "VNF_E2E-extreme")
+                .putAll("<manifest>", manifest)
+                .build();
+
+        List<HashMap<String, String>> permutations = permuteOptions(options);
+
+        return permutations.stream().map(m -> new Object[] { m }).collect(Collectors.toList()).toArray(new Object[0][0]);
+    }
+
+    @Test(dataProvider = "getOperationalEnvironmentCreationPermutations")
+    public void testJsonResultOfOperationalEnvironmentCreationRequestDetails(HashMap<String, String> permutation) throws IOException {
+
+        // build OperationalEnvironmentCreateBody
+        OperationalEnvironmentController.OperationalEnvironmentCreateBody inputUnderTest = createOperationalEnvironmentCreateBody(permutation.get("<instanceName>"), permutation.get("<ecompInstanceId>"), permutation.get("<ecompInstanceName>"), permutation.get("<operationalEnvType>"), permutation.get("<tenantContext>"), permutation.get("<workloadContext>"));
+
+        // transform to RequestDetails, and serialize to json
+        //   -> actually, the function "msoBusinessLogic.createOperationalEnvironmentActivationRequestDetails"
+        //      is the code under test here
+        final RequestDetailsWrapper<OperationEnvironmentRequestDetails> operationalEnvironmentCreationRequestDetails = msoBusinessLogic.convertParametersToRequestDetails(inputUnderTest, permutation.get("<userId>"));
+
+        String expected = buildExpectation("payload_jsons/createOperationalEnvironmentsPayloadToMso.json", permutation);
+
+        assertThatExpectationIsLikeObject(expected, operationalEnvironmentCreationRequestDetails);
+    }
+
+    @DataProvider
+    private Object[][] getOperationalEnvironmentCreationPermutations() throws IOException {
+
+        final ImmutableListMultimap<String, String> options = ImmutableListMultimap.<String, String>builder()
+                // instanceName, ecompInstanceId, ecompInstanceName, operationalEnvType, tenantContext, workloadContext
+                .putAll("<userId>", "1", "ceb60bba-7c18-49cd-a8f6-83ff2e1430b0", "Storm Landebert")
+                .putAll("<instanceName>", "instanceName", "Slavica Hadrien")
+                .putAll("<ecompInstanceId>", "ecompInstanceId", "58ec6753-957f-4124-8f92-c1c0bd2464a4")
+                .putAll("<ecompInstanceName>", "ecompInstanceName", "Bente Keelin")
+                .putAll("<operationalEnvType>", "operationalEnvType", "VNF")
+                .putAll("<tenantContext>", "tenantContext", "Production")
+                .putAll("<workloadContext>", "workloadContext", "E2E-extreme")
+                .build();
+
+        List<HashMap<String, String>> permutations = permuteOptions(options);
+
+        return permutations.stream().map(m -> new Object[] { m }).collect(Collectors.toList()).toArray(new Object[0][0]);
+    }
+
+    @Test(dataProvider = "getOperationalEnvironmentDeactivationPermutations")
+    public void testJsonResultOfOperationalEnvironmentDeactivationRequestDetails(HashMap<String, String> permutation) throws IOException {
+
+        OperationalEnvironmentDeactivateInfo inputUnderTest = createOperationalEnvironmentDeactivateInfo("operationalEnvId>", permutation.get("<userId>"));
+
+        final RequestDetailsWrapper<RequestDetails> operationalEnvironmentDeactivationRequestDetails = msoBusinessLogic.createOperationalEnvironmentDeactivationRequestDetails(inputUnderTest);
+
+        String expected = buildExpectation("payload_jsons/deactivateOperationalEnvironmentsPayloadToMso.json", permutation);
+
+        assertThatExpectationIsLikeObject(expected, operationalEnvironmentDeactivationRequestDetails);
+    }
+
+    @DataProvider
+    private Object[][] getOperationalEnvironmentDeactivationPermutations() throws IOException {
+
+        final ImmutableListMultimap<String, String> options = ImmutableListMultimap.<String, String>builder()
+                .putAll("<userId>", "instanceName", "Slavica Hadrien")
+                .build();
+
+        List<HashMap<String, String>> permutations = permuteOptions(options);
+
+        return permutations.stream().map(m -> new Object[] { m }).collect(Collectors.toList()).toArray(new Object[0][0]);
+    }
+
+    private List<HashMap<String, String>> permuteOptions(ImmutableListMultimap<String, String> options) {
+        // try any value, where the other keys are on the default one (index zero)
+        // result it's not the whole world of permutations, but rather a skim set, which its
+        // size is as the number of unique values in "options"
+
+        HashMap<String, String> baseMutation = new HashMap<>();
+        for (String key : options.keySet()) {
+            baseMutation.put(key, options.get(key).get(0));
+        }
+
+        List<HashMap<String, String>> res = new LinkedList<>();
+        res.add(baseMutation);
+
+        for (String key : options.keySet()) {
+            final ImmutableList<String> entry = options.get(key);
+            for (String value : entry.subList(1, entry.size())) { // skip the first option at index zero
+                HashMap<String, String> mutation = new HashMap<>();
+                mutation.putAll(baseMutation);
+                mutation.put(key, value);
+                res.add(mutation);
+            }
+        }
+        return res;
+    }
+
+    private void assertThatExpectationIsLikeObject(String expected, Object requestDetails) throws JsonProcessingException {
+        final String requestDetailsAsString = new ObjectMapper().enable(SerializationFeature.INDENT_OUTPUT).writeValueAsString(requestDetails);
+
+        // assert for exact match
+        try {
+            JSONAssert.assertEquals("built mso request is not ok", expected, requestDetailsAsString, JSONCompareMode.STRICT);
+        } catch (AssertionError | Exception e) {
+            System.out.println("requestDetailsAsString: \n" + requestDetailsAsString);
+            System.out.println("expected: \n" + expected);
+            throw e;
+        }
+    }
+
+    private String buildExpectation(String modelFileName, HashMap<String, String> permutation) throws IOException {
+        // load expected result, and populate it with current input 'permutation' values
+        final URL resource = this.getClass().getResource("/" + modelFileName);
+        String expected = IOUtils.toString(resource, "UTF-8");
+
+        for (Map.Entry<String, String> stringStringEntry : permutation.entrySet()) {
+            expected = expected.replaceAll(stringStringEntry.getKey(), stringStringEntry.getValue());
+        }
+        return expected;
+    }
+
+
+
+    private OperationalEnvironmentActivateInfo createOperationalEnvironmentActivateInfo(String operationalEnvId, String userId, OperationalEnvironmentManifest manifest, String relatedInstanceId, String relatedInstanceName, String workloadContext) {
+        OperationalEnvironmentController.OperationalEnvironmentActivateBody body = new OperationalEnvironmentController.OperationalEnvironmentActivateBody(relatedInstanceId, relatedInstanceName, workloadContext, manifest);
+        return new OperationalEnvironmentActivateInfo(body, userId, operationalEnvId);
+    }
+
+    private OperationalEnvironmentDeactivateInfo createOperationalEnvironmentDeactivateInfo(String operationalEnvId, String userId) {
+        return new OperationalEnvironmentDeactivateInfo(userId, operationalEnvId);
+    }
+
+    private OperationalEnvironmentController.OperationalEnvironmentCreateBody createOperationalEnvironmentCreateBody(String instanceName, String ecompInstanceId, String ecompInstanceName, String operationalEnvType, String tenantContext, String workloadContext) {
+        return new OperationalEnvironmentController.OperationalEnvironmentCreateBody(instanceName, ecompInstanceId, ecompInstanceName, operationalEnvType, tenantContext, workloadContext);
+    }
+
+}
diff --git a/vid-app-common/src/test/java/org/onap/vid/mso/MsoUtilTest.java b/vid-app-common/src/test/java/org/onap/vid/mso/MsoUtilTest.java
new file mode 100644
index 0000000..3356fdd
--- /dev/null
+++ b/vid-app-common/src/test/java/org/onap/vid/mso/MsoUtilTest.java
@@ -0,0 +1,53 @@
+package org.onap.vid.mso;
+
+import org.apache.poi.hssf.record.formula.functions.T;
+import org.glassfish.jersey.client.ClientResponse;
+import org.junit.Assert;
+import org.junit.Test;
+
+public class MsoUtilTest {
+
+	private MsoUtil createTestSubject() {
+		return new MsoUtil();
+	}
+
+	@Test
+	public void testWrapResponse() throws Exception {
+		String body = "";
+		int statusCode = 0;
+		MsoResponseWrapper result;
+
+		// default test
+		result = MsoUtil.wrapResponse(body, statusCode);
+	}
+
+
+	@Test
+	public void testWrapResponse_2() throws Exception {
+		RestObject<String> rs = null;
+		MsoResponseWrapper result;
+
+		// test 1
+		result = MsoUtil.wrapResponse(rs);
+		Assert.assertNotNull(result);
+	}
+
+	@Test
+	public void testConvertPojoToString() throws Exception {
+		T t = null;
+		String result;
+
+		// test 1
+		t = null;
+		result = MsoUtil.convertPojoToString(t);
+		Assert.assertEquals("", result);
+	}
+
+	@Test
+	public void testMain() throws Exception {
+		String[] args = new String[] { "" };
+
+		// default test
+		MsoUtil.main(args);
+	}
+}
\ No newline at end of file
diff --git a/vid-app-common/src/test/java/org/onap/vid/mso/RestMsoImplementationTest.java b/vid-app-common/src/test/java/org/onap/vid/mso/RestMsoImplementationTest.java
new file mode 100644
index 0000000..a3fa7bc
--- /dev/null
+++ b/vid-app-common/src/test/java/org/onap/vid/mso/RestMsoImplementationTest.java
@@ -0,0 +1,20 @@
+package org.onap.vid.mso;
+
+import org.junit.Test;
+
+public class RestMsoImplementationTest {
+
+	private RestMsoImplementation createTestSubject() {
+		return new RestMsoImplementation();
+	}	
+
+//	@Test
+//	public void testInitMsoClient() throws Exception {
+//		RestMsoImplementation testSubject;
+//
+//		// default test
+//		testSubject = createTestSubject();
+//		testSubject.initMsoClient();
+//	}
+
+}
\ No newline at end of file
diff --git a/vid-app-common/src/test/java/org/onap/vid/mso/rest/AsyncRequestStatusTest.java b/vid-app-common/src/test/java/org/onap/vid/mso/rest/AsyncRequestStatusTest.java
new file mode 100644
index 0000000..ba93958
--- /dev/null
+++ b/vid-app-common/src/test/java/org/onap/vid/mso/rest/AsyncRequestStatusTest.java
@@ -0,0 +1,91 @@
+package org.onap.vid.mso.rest;
+
+import org.junit.Test;
+import org.onap.vid.domain.mso.InstanceIds;
+import org.onap.vid.domain.mso.RequestStatus;
+
+
+public class AsyncRequestStatusTest {
+
+	private AsyncRequestStatus createTestSubject() {
+		return new AsyncRequestStatus();
+	}
+
+	
+	@Test
+	public void testGetInstanceIds() throws Exception {
+		AsyncRequestStatus testSubject;
+		InstanceIds result;
+
+		// default test
+		testSubject = createTestSubject();
+		result = testSubject.getInstanceIds();
+	}
+
+	
+	@Test
+	public void testSetInstanceIds() throws Exception {
+		AsyncRequestStatus testSubject;
+		InstanceIds instanceIds = null;
+
+		// default test
+		testSubject = createTestSubject();
+		testSubject.setInstanceIds(instanceIds);
+	}
+
+	
+	@Test
+	public void testGetRequestStatus() throws Exception {
+		AsyncRequestStatus testSubject;
+		RequestStatus result;
+
+		// default test
+		testSubject = createTestSubject();
+		result = testSubject.getRequestStatus();
+	}
+
+	
+	@Test
+	public void testSetRequestStatus() throws Exception {
+		AsyncRequestStatus testSubject;
+		RequestStatus requestStatus = null;
+
+		// default test
+		testSubject = createTestSubject();
+		testSubject.setRequestStatus(requestStatus);
+	}
+
+	
+	@Test
+	public void testToString() throws Exception {
+		AsyncRequestStatus testSubject;
+		String result;
+
+		// default test
+		testSubject = createTestSubject();
+		result = testSubject.toString();
+	}
+
+	
+	@Test
+	public void testHashCode() throws Exception {
+		AsyncRequestStatus testSubject;
+		int result;
+
+		// default test
+		testSubject = createTestSubject();
+		result = testSubject.hashCode();
+	}
+
+	
+	@Test
+	public void testEquals() throws Exception {
+		AsyncRequestStatus testSubject;
+		Object other = null;
+		boolean result;
+
+		// default test
+		testSubject = createTestSubject();
+		result = testSubject.equals(other);
+	}
+}
\ No newline at end of file
diff --git a/vid-app-common/src/test/java/org/onap/vid/mso/rest/MsoRestClientTest.java b/vid-app-common/src/test/java/org/onap/vid/mso/rest/MsoRestClientTest.java
new file mode 100644
index 0000000..ef26105
--- /dev/null
+++ b/vid-app-common/src/test/java/org/onap/vid/mso/rest/MsoRestClientTest.java
@@ -0,0 +1,78 @@
+//package org.onap.vid.mso.rest;
+//
+//import com.fasterxml.jackson.databind.ObjectMapper;
+//import org.json.JSONObject;
+//import org.junit.Assert;
+//import org.openecomp.portalsdk.core.util.SystemProperties;
+//import org.onap.vid.changeManagement.RequestDetails;
+//import org.onap.vid.controller.LocalWebConfig;
+//import org.onap.vid.domain.mso.CloudConfiguration;
+//import org.onap.vid.domain.mso.ModelInfo;
+//import org.onap.vid.domain.mso.RequestInfo;
+//import org.onap.vid.domain.mso.RequestParameters;
+//import org.onap.vid.mso.MsoBusinessLogic;
+//import org.onap.vid.mso.MsoBusinessLogicImpl;
+//import org.onap.vid.mso.rest.MsoRestClientNew;
+//import org.springframework.test.context.ContextConfiguration;
+//import org.springframework.test.context.web.WebAppConfiguration;
+//import org.testng.annotations.Test;
+//
+//
+//@ContextConfiguration(classes = {LocalWebConfig.class, SystemProperties.class})
+//@WebAppConfiguration
+//public class MsoRestClientTest {
+//
+//
+//    private MsoBusinessLogic msoBusinessLogic = new MsoBusinessLogicImpl(new MsoRestClientNew());
+//    private ObjectMapper om = new ObjectMapper();
+//
+//    @Test
+//    public void createInPlaceMsoRequest() {
+//        String result = null;
+//        try {
+//            RequestDetails requestDetails = generateMockMsoRequest();
+//            result = om.writeValueAsString(msoBusinessLogic.generateInPlaceMsoRequest(requestDetails));
+//
+//        } catch (Exception e) {
+//            e.printStackTrace();
+//
+//        }
+//        if (result == null) {
+//            Assert.fail("Failed to create mso request");
+//        }
+//        JSONObject jsonObj = new JSONObject(result);
+//        Assert.assertNotNull(jsonObj.getJSONObject("requestDetails"));
+//
+//
+//    }
+//
+//    private RequestDetails generateMockMsoRequest() {
+//        RequestDetails requestDetails = new RequestDetails();
+//        requestDetails.setVnfInstanceId("vnf-instance-id");
+//        requestDetails.setVnfName("vnf-name");
+//        CloudConfiguration cloudConfiguration = new CloudConfiguration();
+//        cloudConfiguration.setTenantId("tenant-id");
+//        cloudConfiguration.setLcpCloudRegionId("lcp-region");
+//        requestDetails.setCloudConfiguration(cloudConfiguration);
+//        ModelInfo modelInfo = new ModelInfo();
+//        modelInfo.setModelInvariantId("model-invarient-id");
+//        modelInfo.setModelCustomizationName("modelCustomizationName");
+//        requestDetails.setModelInfo(modelInfo);
+//        RequestInfo requestInfo = new RequestInfo();
+//        requestInfo.setRequestorId("ok883e");
+//        requestInfo.setSource("VID");
+//        requestDetails.setRequestInfo(requestInfo);
+//        RequestParameters requestParameters = new RequestParameters();
+//        requestParameters.setSubscriptionServiceType("subscriber-service-type");
+//        requestParameters.setAdditionalProperty("a", 1);
+//        requestParameters.setAdditionalProperty("b", 2);
+//        requestParameters.setAdditionalProperty("c", 3);
+//        requestParameters.setAdditionalProperty("d", 4);
+//        String payload = "{\"existing-software-version\": \"3.1\",\"new-software-version\": \"3.2\", \"operations-timeout\": \"3600\"}";
+//        requestParameters.setAdditionalProperty("payload", payload);
+//
+//        requestDetails.setRequestParameters(requestParameters);
+//        return requestDetails;
+//    }
+//
+//}
diff --git a/vid-app-common/src/test/java/org/onap/vid/mso/rest/OutgoingRequestId.java b/vid-app-common/src/test/java/org/onap/vid/mso/rest/OutgoingRequestId.java
new file mode 100644
index 0000000..51071a8
--- /dev/null
+++ b/vid-app-common/src/test/java/org/onap/vid/mso/rest/OutgoingRequestId.java
@@ -0,0 +1,280 @@
+package org.onap.vid.mso.rest;
+
+import com.google.common.collect.ImmutableList;
+import com.google.common.collect.ImmutableMap;
+import org.apache.commons.lang3.reflect.FieldUtils;
+import org.mockito.*;
+import org.mockito.invocation.InvocationOnMock;
+import org.mockito.stubbing.Answer;
+import org.onap.vid.aai.util.AAIRestInterface;
+import org.onap.vid.asdc.rest.RestfulAsdcClient;
+import org.onap.vid.changeManagement.RequestDetailsWrapper;
+import org.onap.vid.controller.filter.PromiseEcompRequestIdFilter;
+import org.onap.vid.mso.RestMsoImplementation;
+import org.onap.vid.mso.RestObject;
+import org.springframework.mock.web.MockHttpServletRequest;
+import org.springframework.web.context.request.RequestContextHolder;
+import org.springframework.web.context.request.ServletRequestAttributes;
+import org.testng.annotations.BeforeClass;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.DataProvider;
+import org.testng.annotations.Test;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.ws.rs.client.Client;
+import javax.ws.rs.client.Invocation;
+import javax.ws.rs.client.WebTarget;
+import javax.ws.rs.core.GenericType;
+import javax.ws.rs.core.MultivaluedMap;
+import javax.ws.rs.core.Response;
+import java.io.ByteArrayInputStream;
+import java.io.InputStream;
+import java.io.Serializable;
+import java.util.List;
+import java.util.Set;
+import java.util.function.Consumer;
+import java.util.stream.Collectors;
+import java.util.stream.Stream;
+
+import static java.util.UUID.randomUUID;
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.Matchers.*;
+import static org.mockito.Matchers.any;
+import static org.mockito.Mockito.*;
+
+
+public class OutgoingRequestId {
+
+
+    @InjectMocks
+    private RestMsoImplementation restMsoImplementation;
+
+    @InjectMocks
+    private AAIRestInterface aaiRestInterface;
+
+    private RestfulAsdcClient restfulAsdcClient = new RestfulAsdcClient.Builder(mock(Client.class), null).build();
+
+    @Captor
+    private ArgumentCaptor<MultivaluedMap<String, Object>> multivaluedMapArgumentCaptor;
+
+    @BeforeClass
+    public void initMocks() {
+        MockitoAnnotations.initMocks(this);
+    }
+
+    @BeforeMethod
+    private void putRequestInSpringContext() {
+        RequestContextHolder.setRequestAttributes(new ServletRequestAttributes((HttpServletRequest) PromiseEcompRequestIdFilter.wrapIfNeeded(new MockHttpServletRequest())));
+    }
+
+    @DataProvider
+    public Object[][] sdcMethods() {
+        return Stream.<ThrowingConsumer<RestfulAsdcClient>>of(
+
+                client -> client.getResource(randomUUID()),
+                client -> client.getResourceArtifact(randomUUID(), randomUUID()),
+                RestfulAsdcClient::getResources,
+                client -> client.getResources(ImmutableMap.of()),
+                client -> client.getResourceToscaModel(randomUUID()),
+                client -> client.getService(randomUUID()),
+                client -> client.getServiceArtifact(randomUUID(), randomUUID()),
+                RestfulAsdcClient::getServices,
+                client -> client.getServices(ImmutableMap.of()),
+                client -> client.getServiceToscaModel(randomUUID())
+
+        ).map(l -> ImmutableList.of(l).toArray()).collect(Collectors.toList()).toArray(new Object[][]{});
+    }
+
+    @Test(dataProvider = "sdcMethods")
+    public void sdc(Consumer<RestfulAsdcClient> f) throws Exception {
+        final Mocks mocks = setAndGetMocksInsideRestImpl(restfulAsdcClient);
+
+        f.accept(restfulAsdcClient);
+
+        verifyRequestIdHeaderWasAdded(mocks.getFakeBuilder());
+    }
+
+    @DataProvider
+    public Object[][] msoMethods() {
+        return Stream.<ThrowingConsumer<RestMsoImplementation>>of(
+
+                client -> client.Get(new Object(), "whatever source id", "/any path", new RestObject<>()),
+                client -> client.GetForObject("whatever source id", "/any path", Object.class),
+                client -> client.Post(new Object(), "some payload", "whatever source id", "/any path", new RestObject<>()),
+                client -> client.PostForObject("some payload", "whatever source id", "/any path", Object.class),
+                client -> client.Put(Object.class, new RequestDetailsWrapper(), "whatever source id", "/any path", new RestObject<>())
+
+        ).map(l -> ImmutableList.of(l).toArray()).collect(Collectors.toList()).toArray(new Object[][]{});
+    }
+
+    @Test(dataProvider = "msoMethods")
+    public void mso(Consumer<RestMsoImplementation> f) throws Exception {
+        final Mocks mocks = setAndGetMocksInsideRestImpl(restMsoImplementation.getClass());
+
+        f.accept(restMsoImplementation);
+
+        verifyRequestIdHeaderWasAdded(mocks.getFakeBuilder());
+    }
+
+    @DataProvider
+    public Object[][] aaiMethods() {
+        return Stream.<ThrowingConsumer<AAIRestInterface>>of(
+
+                client -> client.RestGet("from app id", "some transId", "/any path", false),
+                client -> client.Delete("whatever source id", "some transId", "/any path"),
+                client -> client.RestPost("from app id", "some transId", "/any path", "some payload", false),
+                client -> client.RestPut("from app id", "some transId", "/any path", "some payload", false)
+
+        ).map(l -> ImmutableList.of(l).toArray()).collect(Collectors.toList()).toArray(new Object[][]{});
+    }
+
+    @Test(dataProvider = "aaiMethods")
+    public void aai(Consumer<AAIRestInterface> f) throws Exception {
+        final Mocks mocks = setAndGetMocksInsideRestImpl(aaiRestInterface.getClass());
+
+        f.accept(aaiRestInterface);
+
+        verifyRequestIdHeaderWasAdded(mocks.getFakeBuilder());
+    }
+
+//    @Test(dataProvider = "schedulerMethods")
+//    public void scheduler(Consumer<AAIRestInterface> f) throws Exception {
+//
+//        This test os not feasible in the wat acheduler is implemented today,
+//        as Scheduler's client is rewritten in every call.
+//
+//        :-(
+//
+//    }
+
+    private void verifyRequestIdHeaderWasAdded(Invocation.Builder fakeBuilder) {
+        final String requestIdHeader = "x-ecomp-requestid";
+        final String uuidRegex = "[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}";
+
+        // Checks that the builder was called with either one of header("x-ecomp-requestid", uuid)
+        // or the plural brother: headers(Map.of("x-ecomp-requestid", Set.of(uuid))
+
+        Object requestId;
+        // The 'verify()' will capture the request id. If no match -- AssertionError will
+        // catch for a second chance -- another 'verify()'.
+        try {
+            ArgumentCaptor<Object> argumentCaptor = ArgumentCaptor.forClass(Object.class);
+            Mockito.verify(fakeBuilder)
+                    .header(
+                            Matchers.argThat(equalToIgnoringCase(requestIdHeader)),
+                            argumentCaptor.capture()
+                    );
+            requestId = argumentCaptor.getValue();
+
+        } catch (AssertionError e) {
+            Mockito.verify(fakeBuilder).headers(multivaluedMapArgumentCaptor.capture());
+
+            final MultivaluedMap<String, Object> headersMap = multivaluedMapArgumentCaptor.getValue();
+            final String thisRequestIdHeader = getFromSetCaseInsensitive(headersMap.keySet(), requestIdHeader);
+
+            assertThat(headersMap.keySet(), hasItem(thisRequestIdHeader));
+            requestId = headersMap.getFirst(thisRequestIdHeader);
+        }
+
+        assertThat("header '" + requestIdHeader + "' should be a uuid", requestId,
+                allOf(instanceOf(String.class), hasToString(matchesPattern(uuidRegex))));
+    }
+
+    private String getFromSetCaseInsensitive(Set<String> set, String key) {
+        return set.stream()
+                .filter(anotherString -> anotherString.equalsIgnoreCase(key))
+                .findFirst()
+                .orElse(key);
+    }
+
+    private Mocks setAndGetMocksInsideRestImpl(Class<?> clazz) throws IllegalAccessException {
+        Mocks mocks = new Mocks();
+        Client fakeClient = mocks.getFakeClient();
+
+        FieldUtils.writeStaticField(clazz, "client", fakeClient, true);
+
+        return mocks;
+    }
+
+    private Mocks setAndGetMocksInsideRestImpl(Object instance) throws IllegalAccessException {
+        Mocks mocks = new Mocks();
+        Client fakeClient = mocks.getFakeClient();
+
+        FieldUtils.writeField(instance, "client", fakeClient, true);
+
+        return mocks;
+    }
+
+    private static class Mocks {
+        private final Client fakeClient;
+        private final Invocation.Builder fakeBuilder;
+
+        Client getFakeClient() {
+            return fakeClient;
+        }
+
+        Invocation.Builder getFakeBuilder() {
+            return fakeBuilder;
+        }
+
+        Mocks() {
+            final MockSettings mockSettings = withSettings().defaultAnswer(new TriesToReturnMockByType());
+
+            fakeClient = mock(Client.class, mockSettings);
+            fakeBuilder = mock(Invocation.Builder.class, mockSettings);
+            final WebTarget fakeWebTarget = mock(WebTarget.class, mockSettings);
+            final Response fakeResponse = mock(Response.class, mockSettings);
+
+            TriesToReturnMockByType.setAvailableMocks(
+                    fakeClient,
+                    fakeWebTarget,
+                    fakeBuilder,
+                    fakeResponse
+            );
+
+            Mockito.when(fakeBuilder.get(any(Class.class))).thenReturn(null);
+            Mockito.when(fakeBuilder.get(eq(InputStream.class))).thenReturn(new ByteArrayInputStream(new byte[]{}));
+            Mockito.when(fakeBuilder.get(any(GenericType.class))).thenReturn(null);
+
+            Mockito.when(fakeResponse.getStatus()).thenReturn(200);
+        }
+    }
+
+    @FunctionalInterface
+    public interface ThrowingConsumer<T> extends Consumer<T> {
+        @Override
+        default void accept(T t) {
+            try {
+                acceptThrows(t);
+            } catch (Exception e) {
+                throw new RuntimeException(e);
+            }
+        }
+
+        void acceptThrows(T t) throws Exception;
+    }
+
+    /*
+   inspired out from newer Mockito version
+    returns a mock from given list if it's a matching return-type
+     */
+    public static class TriesToReturnMockByType implements Answer<Object>, Serializable {
+        private final Answer<Object> defaultReturn = RETURNS_DEFAULTS;
+        private static List<Object> availableMocks = ImmutableList.of();
+
+        static void setAvailableMocks(Object... mocks) {
+            availableMocks = ImmutableList.copyOf(mocks);
+        }
+
+        public Object answer(InvocationOnMock invocation) throws Throwable {
+            Class<?> methodReturnType = invocation.getMethod().getReturnType();
+
+            return availableMocks.stream()
+                    .filter(mock -> methodReturnType.isAssignableFrom(mock.getClass()))
+                    //.peek(m -> System.out.println("found a mock: " + m.getClass().getName()))
+                    .findFirst()
+                    .orElse(defaultReturn.answer(invocation));
+        }
+    }
+
+}
diff --git a/vid-app-common/src/test/java/org/onap/vid/mso/rest/RelatedInstanceTest.java b/vid-app-common/src/test/java/org/onap/vid/mso/rest/RelatedInstanceTest.java
new file mode 100644
index 0000000..4b35430
--- /dev/null
+++ b/vid-app-common/src/test/java/org/onap/vid/mso/rest/RelatedInstanceTest.java
@@ -0,0 +1,93 @@
+package org.onap.vid.mso.rest;
+
+import java.util.Map;
+
+import org.junit.Test;
+import org.onap.vid.domain.mso.ModelInfo;
+
+
+public class RelatedInstanceTest {
+
+	private RelatedInstance createTestSubject() {
+		return new RelatedInstance();
+	}
+
+	
+	@Test
+	public void testGetModelInfo() throws Exception {
+		RelatedInstance testSubject;
+		ModelInfo result;
+
+		// default test
+		testSubject = createTestSubject();
+		result = testSubject.getModelInfo();
+	}
+
+	
+	@Test
+	public void testSetModelInfo() throws Exception {
+		RelatedInstance testSubject;
+		ModelInfo modelInfo = null;
+
+		// default test
+		testSubject = createTestSubject();
+		testSubject.setModelInfo(modelInfo);
+	}
+
+	
+	@Test
+	public void testToString() throws Exception {
+		RelatedInstance testSubject;
+		String result;
+
+		// default test
+		testSubject = createTestSubject();
+		result = testSubject.toString();
+	}
+
+	
+	@Test
+	public void testGetAdditionalProperties() throws Exception {
+		RelatedInstance testSubject;
+		Map<String, Object> result;
+
+		// default test
+		testSubject = createTestSubject();
+		result = testSubject.getAdditionalProperties();
+	}
+
+	
+	@Test
+	public void testSetAdditionalProperty() throws Exception {
+		RelatedInstance testSubject;
+		String name = "";
+		Object value = null;
+
+		// default test
+		testSubject = createTestSubject();
+		testSubject.setAdditionalProperty(name, value);
+	}
+
+	
+	@Test
+	public void testHashCode() throws Exception {
+		RelatedInstance testSubject;
+		int result;
+
+		// default test
+		testSubject = createTestSubject();
+		result = testSubject.hashCode();
+	}
+
+	
+	@Test
+	public void testEquals() throws Exception {
+		RelatedInstance testSubject;
+		Object other = null;
+		boolean result;
+
+		// default test
+		testSubject = createTestSubject();
+		result = testSubject.equals(other);
+	}
+}
\ No newline at end of file
diff --git a/vid-app-common/src/test/java/org/onap/vid/mso/rest/RelatedModelTest.java b/vid-app-common/src/test/java/org/onap/vid/mso/rest/RelatedModelTest.java
new file mode 100644
index 0000000..91d61bd
--- /dev/null
+++ b/vid-app-common/src/test/java/org/onap/vid/mso/rest/RelatedModelTest.java
@@ -0,0 +1,93 @@
+package org.onap.vid.mso.rest;
+
+import java.util.Map;
+
+import org.junit.Test;
+import org.onap.vid.domain.mso.ModelInfo;
+
+
+public class RelatedModelTest {
+
+	private RelatedModel createTestSubject() {
+		return new RelatedModel();
+	}
+
+	
+	@Test
+	public void testGetModelInfo() throws Exception {
+		RelatedModel testSubject;
+		ModelInfo result;
+
+		// default test
+		testSubject = createTestSubject();
+		result = testSubject.getModelInfo();
+	}
+
+	
+	@Test
+	public void testSetModelInfo() throws Exception {
+		RelatedModel testSubject;
+		ModelInfo modelInfo = null;
+
+		// default test
+		testSubject = createTestSubject();
+		testSubject.setModelInfo(modelInfo);
+	}
+
+	
+	@Test
+	public void testToString() throws Exception {
+		RelatedModel testSubject;
+		String result;
+
+		// default test
+		testSubject = createTestSubject();
+		result = testSubject.toString();
+	}
+
+	
+	@Test
+	public void testGetAdditionalProperties() throws Exception {
+		RelatedModel testSubject;
+		Map<String, Object> result;
+
+		// default test
+		testSubject = createTestSubject();
+		result = testSubject.getAdditionalProperties();
+	}
+
+	
+	@Test
+	public void testSetAdditionalProperty() throws Exception {
+		RelatedModel testSubject;
+		String name = "";
+		Object value = null;
+
+		// default test
+		testSubject = createTestSubject();
+		testSubject.setAdditionalProperty(name, value);
+	}
+
+	
+	@Test
+	public void testHashCode() throws Exception {
+		RelatedModel testSubject;
+		int result;
+
+		// default test
+		testSubject = createTestSubject();
+		result = testSubject.hashCode();
+	}
+
+	
+	@Test
+	public void testEquals() throws Exception {
+		RelatedModel testSubject;
+		Object other = null;
+		boolean result;
+
+		// default test
+		testSubject = createTestSubject();
+		result = testSubject.equals(other);
+	}
+}
\ No newline at end of file
diff --git a/vid-app-common/src/test/java/org/onap/vid/mso/rest/RequestDetailsTest.java b/vid-app-common/src/test/java/org/onap/vid/mso/rest/RequestDetailsTest.java
new file mode 100644
index 0000000..153e165
--- /dev/null
+++ b/vid-app-common/src/test/java/org/onap/vid/mso/rest/RequestDetailsTest.java
@@ -0,0 +1,182 @@
+package org.onap.vid.mso.rest;
+
+import java.util.List;
+import java.util.Map;
+
+import org.junit.Test;
+import org.onap.vid.domain.mso.*;
+
+
+public class RequestDetailsTest {
+
+	private RequestDetails createTestSubject() {
+		return new RequestDetails();
+	}
+
+	
+	@Test
+	public void testGetCloudConfiguration() throws Exception {
+		RequestDetails testSubject;
+		CloudConfiguration result;
+
+		// default test
+		testSubject = createTestSubject();
+		result = testSubject.getCloudConfiguration();
+	}
+
+	
+	@Test
+	public void testSetCloudConfiguration() throws Exception {
+		RequestDetails testSubject;
+		CloudConfiguration cloudConfiguration = null;
+
+		// default test
+		testSubject = createTestSubject();
+		testSubject.setCloudConfiguration(cloudConfiguration);
+	}
+
+	
+	@Test
+	public void testGetModelInfo() throws Exception {
+		RequestDetails testSubject;
+		ModelInfo result;
+
+		// default test
+		testSubject = createTestSubject();
+		result = testSubject.getModelInfo();
+	}
+
+	
+	@Test
+	public void testSetModelInfo() throws Exception {
+		RequestDetails testSubject;
+		ModelInfo modelInfo = null;
+
+		// default test
+		testSubject = createTestSubject();
+		testSubject.setModelInfo(modelInfo);
+	}
+
+	
+	@Test
+	public void testGetRelatedInstanceList() throws Exception {
+		RequestDetails testSubject;
+		List<RelatedModel> result;
+
+		// default test
+		testSubject = createTestSubject();
+		result = testSubject.getRelatedInstanceList();
+	}
+
+	
+	@Test
+	public void testSetRelatedInstanceList() throws Exception {
+		RequestDetails testSubject;
+		List<RelatedModel> relatedInstanceList = null;
+
+		// default test
+		testSubject = createTestSubject();
+		testSubject.setRelatedInstanceList(relatedInstanceList);
+	}
+
+	
+	@Test
+	public void testGetRequestInfo() throws Exception {
+		RequestDetails testSubject;
+		RequestInfo result;
+
+		// default test
+		testSubject = createTestSubject();
+		result = testSubject.getRequestInfo();
+	}
+
+	
+	@Test
+	public void testSetRequestInfo() throws Exception {
+		RequestDetails testSubject;
+		RequestInfo requestInfo = null;
+
+		// default test
+		testSubject = createTestSubject();
+		testSubject.setRequestInfo(requestInfo);
+	}
+
+	
+	@Test
+	public void testGetSubscriberInfo() throws Exception {
+		RequestDetails testSubject;
+		SubscriberInfo result;
+
+		// default test
+		testSubject = createTestSubject();
+		result = testSubject.getSubscriberInfo();
+	}
+
+	
+	@Test
+	public void testSetSubscriberInfo() throws Exception {
+		RequestDetails testSubject;
+		SubscriberInfo subscriberInfo = null;
+
+		// default test
+		testSubject = createTestSubject();
+		testSubject.setSubscriberInfo(subscriberInfo);
+	}
+
+	
+	@Test
+	public void testToString() throws Exception {
+		RequestDetails testSubject;
+		String result;
+
+		// default test
+		testSubject = createTestSubject();
+		result = testSubject.toString();
+	}
+
+	
+	@Test
+	public void testGetAdditionalProperties() throws Exception {
+		RequestDetails testSubject;
+		Map<String, Object> result;
+
+		// default test
+		testSubject = createTestSubject();
+		result = testSubject.getAdditionalProperties();
+	}
+
+	
+	@Test
+	public void testSetAdditionalProperty() throws Exception {
+		RequestDetails testSubject;
+		String name = "";
+		Object value = null;
+
+		// default test
+		testSubject = createTestSubject();
+		testSubject.setAdditionalProperty(name, value);
+	}
+
+	
+	@Test
+	public void testHashCode() throws Exception {
+		RequestDetails testSubject;
+		int result;
+
+		// default test
+		testSubject = createTestSubject();
+		result = testSubject.hashCode();
+	}
+
+	
+	@Test
+	public void testEquals() throws Exception {
+		RequestDetails testSubject;
+		Object other = null;
+		boolean result;
+
+		// default test
+		testSubject = createTestSubject();
+		result = testSubject.equals(other);
+	}
+}
\ No newline at end of file
diff --git a/vid-app-common/src/test/java/org/onap/vid/mso/rest/TestSuite.java b/vid-app-common/src/test/java/org/onap/vid/mso/rest/TestSuite.java
new file mode 100644
index 0000000..72633da
--- /dev/null
+++ b/vid-app-common/src/test/java/org/onap/vid/mso/rest/TestSuite.java
@@ -0,0 +1,12 @@
+package org.onap.vid.mso.rest;
+
+import org.junit.runner.RunWith;
+import org.junit.runners.Suite;
+
+@RunWith(Suite.class)
+@Suite.SuiteClasses(
+
+{ RelatedModelTest.class, AsyncRequestStatusTest.class, RequestDetailsTest.class, 
+		RelatedInstanceTest.class })
+public class TestSuite { // nothing
+}
diff --git a/vid-app-common/src/test/java/org/onap/vid/policy/PolicyResponseWrapperTest.java b/vid-app-common/src/test/java/org/onap/vid/policy/PolicyResponseWrapperTest.java
new file mode 100644
index 0000000..4e2676c
--- /dev/null
+++ b/vid-app-common/src/test/java/org/onap/vid/policy/PolicyResponseWrapperTest.java
@@ -0,0 +1,70 @@
+package org.onap.vid.policy;
+
+import org.junit.Test;
+
+public class PolicyResponseWrapperTest {
+
+	private PolicyResponseWrapper createTestSubject() {
+		return new PolicyResponseWrapper();
+	}
+
+	@Test
+	public void testGetEntity() throws Exception {
+		PolicyResponseWrapper testSubject;
+		String result;
+
+		// default test
+		testSubject = createTestSubject();
+		result = testSubject.getEntity();
+	}
+
+	@Test
+	public void testGetStatus() throws Exception {
+		PolicyResponseWrapper testSubject;
+		int result;
+
+		// default test
+		testSubject = createTestSubject();
+		result = testSubject.getStatus();
+	}
+
+	@Test
+	public void testSetStatus() throws Exception {
+		PolicyResponseWrapper testSubject;
+		int v = 0;
+
+		// default test
+		testSubject = createTestSubject();
+		testSubject.setStatus(v);
+	}
+
+	@Test
+	public void testSetEntity() throws Exception {
+		PolicyResponseWrapper testSubject;
+		String v = "";
+
+		// default test
+		testSubject = createTestSubject();
+		testSubject.setEntity(v);
+	}
+
+	@Test
+	public void testToString() throws Exception {
+		PolicyResponseWrapper testSubject;
+		String result;
+
+		// default test
+		testSubject = createTestSubject();
+		result = testSubject.toString();
+	}
+
+	@Test
+	public void testGetResponse() throws Exception {
+		PolicyResponseWrapper testSubject;
+		String result;
+
+		// default test
+		testSubject = createTestSubject();
+		result = testSubject.getResponse();
+	}
+}
\ No newline at end of file
diff --git a/vid-app-common/src/test/java/org/onap/vid/policy/PolicyRestIntTest.java b/vid-app-common/src/test/java/org/onap/vid/policy/PolicyRestIntTest.java
new file mode 100644
index 0000000..b94d21b
--- /dev/null
+++ b/vid-app-common/src/test/java/org/onap/vid/policy/PolicyRestIntTest.java
@@ -0,0 +1,22 @@
+package org.onap.vid.policy;
+
+import org.junit.Test;
+import org.onap.vid.policy.rest.RequestDetails;
+
+public class PolicyRestIntTest {
+
+	private PolicyRestInt createTestSubject() {
+		return new PolicyRestInt();
+	}
+
+	@Test
+	public void testLogRequest() throws Exception {
+		PolicyRestInt testSubject;
+		RequestDetails r = null;
+
+		// test 1
+		testSubject = createTestSubject();
+		r = null;
+		testSubject.logRequest(r);
+	}
+}
\ No newline at end of file
diff --git a/vid-app-common/src/test/java/org/onap/vid/policy/PolicyRestInterfaceTest.java b/vid-app-common/src/test/java/org/onap/vid/policy/PolicyRestInterfaceTest.java
new file mode 100644
index 0000000..04f6890
--- /dev/null
+++ b/vid-app-common/src/test/java/org/onap/vid/policy/PolicyRestInterfaceTest.java
@@ -0,0 +1,24 @@
+package org.onap.vid.policy;
+
+import org.apache.poi.hssf.record.formula.functions.T;
+import org.json.simple.JSONObject;
+import org.junit.Test;
+import org.onap.vid.policy.rest.RequestDetails;
+
+public class PolicyRestInterfaceTest {
+
+	private PolicyRestInterface createTestSubject() {
+		return new PolicyRestInterface();
+	}
+
+
+	@Test
+	public void testLogRequest() throws Exception {
+		PolicyRestInterface testSubject;
+		RequestDetails r = null;
+
+		// default test
+		testSubject = createTestSubject();
+		testSubject.logRequest(r);
+	}
+}
\ No newline at end of file
diff --git a/vid-app-common/src/test/java/org/onap/vid/policy/PolicyUtilTest.java b/vid-app-common/src/test/java/org/onap/vid/policy/PolicyUtilTest.java
new file mode 100644
index 0000000..566d17c
--- /dev/null
+++ b/vid-app-common/src/test/java/org/onap/vid/policy/PolicyUtilTest.java
@@ -0,0 +1,54 @@
+package org.onap.vid.policy;
+
+import org.apache.poi.hssf.record.formula.functions.T;
+import org.glassfish.jersey.client.ClientResponse;
+import org.junit.Assert;
+import org.junit.Test;
+
+public class PolicyUtilTest {
+
+	private PolicyUtil createTestSubject() {
+		return new PolicyUtil();
+	}
+
+	@Test
+	public void testWrapResponse() throws Exception {
+		String body = "";
+		int statusCode = 0;
+		PolicyResponseWrapper result;
+
+		// default test
+		result = PolicyUtil.wrapResponse(body, statusCode);
+	}
+
+
+	@Test
+	public void testWrapResponse_2() throws Exception {
+		RestObject<String> rs = null;
+		PolicyResponseWrapper result;
+
+		// test 1
+		rs = null;
+		result = PolicyUtil.wrapResponse(rs);
+		Assert.assertNotNull(result);
+	}
+
+	@Test
+	public void testConvertPojoToString() throws Exception {
+		T t = null;
+		String result;
+
+		// test 1
+		t = null;
+		result = PolicyUtil.convertPojoToString(t);
+		Assert.assertEquals("", result);
+	}
+
+	@Test
+	public void testMain() throws Exception {
+		String[] args = new String[] { "" };
+
+		// default test
+		PolicyUtil.main(args);
+	}
+}
\ No newline at end of file
diff --git a/vid-app-common/src/test/java/org/onap/vid/policy/RestObjectTest.java b/vid-app-common/src/test/java/org/onap/vid/policy/RestObjectTest.java
new file mode 100644
index 0000000..7665d99
--- /dev/null
+++ b/vid-app-common/src/test/java/org/onap/vid/policy/RestObjectTest.java
@@ -0,0 +1,50 @@
+package org.onap.vid.policy;
+
+import org.apache.poi.hssf.record.formula.functions.T;
+import org.junit.Test;
+
+public class RestObjectTest {
+
+	private RestObject createTestSubject() {
+		return new RestObject();
+	}
+
+	@Test
+	public void testSet() throws Exception {
+		RestObject testSubject;
+		T t = null;
+
+		// default test
+		testSubject = createTestSubject();
+		testSubject.set(t);
+	}
+
+	@Test
+	public void testGet() throws Exception {
+		RestObject testSubject;
+
+		// default test
+		testSubject = createTestSubject();
+		testSubject.get();
+	}
+
+	@Test
+	public void testSetStatusCode() throws Exception {
+		RestObject testSubject;
+		int v = 0;
+
+		// default test
+		testSubject = createTestSubject();
+		testSubject.setStatusCode(v);
+	}
+
+	@Test
+	public void testGetStatusCode() throws Exception {
+		RestObject testSubject;
+		int result;
+
+		// default test
+		testSubject = createTestSubject();
+		result = testSubject.getStatusCode();
+	}
+}
\ No newline at end of file
diff --git a/vid-app-common/src/test/java/org/onap/vid/policy/TestSuite.java b/vid-app-common/src/test/java/org/onap/vid/policy/TestSuite.java
new file mode 100644
index 0000000..6d2a790
--- /dev/null
+++ b/vid-app-common/src/test/java/org/onap/vid/policy/TestSuite.java
@@ -0,0 +1,12 @@
+package org.onap.vid.policy;
+
+import org.junit.runner.RunWith;
+import org.junit.runners.Suite;
+
+@RunWith(Suite.class)
+@Suite.SuiteClasses(
+
+{ RestObjectTest.class, PolicyResponseWrapperTest.class, PolicyRestIntTest.class, PolicyUtilTest.class,
+		PolicyRestInterfaceTest.class, org.onap.vid.policy.rest.TestSuite.class })
+public class TestSuite { // nothing
+}
diff --git a/vid-app-common/src/test/java/org/onap/vid/policy/rest/RequestDetailsTest.java b/vid-app-common/src/test/java/org/onap/vid/policy/rest/RequestDetailsTest.java
new file mode 100644
index 0000000..3c17a66
--- /dev/null
+++ b/vid-app-common/src/test/java/org/onap/vid/policy/rest/RequestDetailsTest.java
@@ -0,0 +1,33 @@
+package org.onap.vid.policy.rest;
+
+import org.junit.Test;
+
+
+public class RequestDetailsTest {
+
+	private RequestDetails createTestSubject() {
+		return new RequestDetails();
+	}
+
+
+	@Test
+	public void testGetPolicyName() throws Exception {
+		RequestDetails testSubject;
+		String result;
+
+		// default test
+		testSubject = createTestSubject();
+		result = testSubject.getPolicyName();
+	}
+
+
+	@Test
+	public void testSetPolicyName() throws Exception {
+		RequestDetails testSubject;
+		String policyName = "";
+
+		// default test
+		testSubject = createTestSubject();
+		testSubject.setPolicyName(policyName);
+	}
+}
\ No newline at end of file
diff --git a/vid-app-common/src/test/java/org/onap/vid/policy/rest/TestSuite.java b/vid-app-common/src/test/java/org/onap/vid/policy/rest/TestSuite.java
new file mode 100644
index 0000000..0a8dfff
--- /dev/null
+++ b/vid-app-common/src/test/java/org/onap/vid/policy/rest/TestSuite.java
@@ -0,0 +1,11 @@
+package org.onap.vid.policy.rest;
+
+import org.junit.runner.RunWith;
+import org.junit.runners.Suite;
+
+@RunWith(Suite.class)
+@Suite.SuiteClasses(
+
+{ RequestDetailsTest.class })
+public class TestSuite { // nothing
+}
diff --git a/vid-app-common/src/test/java/org/onap/vid/properties/TestSuite.java b/vid-app-common/src/test/java/org/onap/vid/properties/TestSuite.java
new file mode 100644
index 0000000..747c1ed
--- /dev/null
+++ b/vid-app-common/src/test/java/org/onap/vid/properties/TestSuite.java
@@ -0,0 +1,11 @@
+package org.onap.vid.properties;
+
+import org.junit.runner.RunWith;
+import org.junit.runners.Suite;
+
+@RunWith(Suite.class)
+@Suite.SuiteClasses(
+
+{ VidPropertiesTest.class })
+public class TestSuite { // nothing
+}
diff --git a/vid-app-common/src/test/java/org/onap/vid/properties/VidPropertiesTest.java b/vid-app-common/src/test/java/org/onap/vid/properties/VidPropertiesTest.java
new file mode 100644
index 0000000..f256ba0
--- /dev/null
+++ b/vid-app-common/src/test/java/org/onap/vid/properties/VidPropertiesTest.java
@@ -0,0 +1,31 @@
+package org.onap.vid.properties;
+
+import org.junit.Test;
+
+
+public class VidPropertiesTest {
+
+	private VidProperties createTestSubject() {
+		return new VidProperties();
+	}
+
+
+	@Test
+	public void testGetAsdcModelNamespace() throws Exception {
+		String result;
+
+		// default test
+		result = VidProperties.getAsdcModelNamespace();
+	}
+
+
+	@Test
+	public void testGetPropertyWithDefault() throws Exception {
+		String propName = "";
+		String defaultValue = "";
+		String result;
+
+		// default test
+		result = VidProperties.getPropertyWithDefault(propName, defaultValue);
+	}
+}
\ No newline at end of file
diff --git a/vid-app-common/src/test/java/org/onap/vid/roles/RoleProviderTest.java b/vid-app-common/src/test/java/org/onap/vid/roles/RoleProviderTest.java
new file mode 100644
index 0000000..b023bc2
--- /dev/null
+++ b/vid-app-common/src/test/java/org/onap/vid/roles/RoleProviderTest.java
@@ -0,0 +1,50 @@
+package org.onap.vid.roles;
+
+import java.util.List;
+
+import javax.servlet.http.HttpServletRequest;
+
+import org.junit.Test;
+
+
+public class RoleProviderTest {
+
+	private RoleProvider createTestSubject() {
+		return new RoleProvider();
+	}
+
+	
+	@Test
+	public void testExtractRoleFromSession() throws Exception {
+		HttpServletRequest request = null;
+		List<String> result;
+
+		// default test
+		result = RoleProvider.extractRoleFromSession(request);
+	}
+
+	
+//	@Test
+//	public void testGetUserRoles() throws Exception {
+//		RoleProvider testSubject;
+//		HttpServletRequest request = null;
+//		List<Role> result;
+//
+//		// default test
+//		testSubject = createTestSubject();
+//		result = testSubject.getUserRoles(request);
+//	}
+
+	
+	@Test
+	public void testSplitRole() throws Exception {
+		RoleProvider testSubject;
+		String roleAsString = "";
+		String[] result;
+
+		// default test
+		testSubject = createTestSubject();
+		//TODO:fix result = testSubject.splitRole(roleAsString);
+	}
+
+}
\ No newline at end of file
diff --git a/vid-app-common/src/test/java/org/onap/vid/roles/RoleValidatorTest.java b/vid-app-common/src/test/java/org/onap/vid/roles/RoleValidatorTest.java
new file mode 100644
index 0000000..7a1b09a
--- /dev/null
+++ b/vid-app-common/src/test/java/org/onap/vid/roles/RoleValidatorTest.java
@@ -0,0 +1,58 @@
+package org.onap.vid.roles;
+
+import org.junit.Test;
+import org.onap.vid.mso.rest.RequestDetails;
+
+public class RoleValidatorTest {
+
+	private RoleValidator createTestSubject() {
+		return new RoleValidator(null);
+	}
+
+//	@Test
+//	public void testIsSubscriberPermitted() throws Exception {
+//		RoleValidator testSubject;
+//		String subscriberName = "";
+//		boolean result;
+//
+//		// default test
+//		testSubject = createTestSubject();
+//		result = testSubject.isSubscriberPermitted(subscriberName);
+//	}
+//
+//	@Test
+//	public void testIsServicePermitted() throws Exception {
+//		RoleValidator testSubject;
+//		String subscriberName = "";
+//		String serviceType = "";
+//		boolean result;
+//
+//		// default test
+//		testSubject = createTestSubject();
+//		result = testSubject.isServicePermitted(subscriberName, serviceType);
+//	}
+
+	@Test
+	public void testIsMsoRequestValid() throws Exception {
+		RoleValidator testSubject;
+		RequestDetails mso_request = null;
+		boolean result;
+
+		// default test
+		testSubject = createTestSubject();
+		result = testSubject.isMsoRequestValid(mso_request);
+	}
+
+//	@Test
+//	public void testIsTenantPermitted() throws Exception {
+//		RoleValidator testSubject;
+//		String globalCustomerId = "";
+//		String serviceType = "";
+//		String tenant = "";
+//		boolean result;
+//
+//		// default test
+//		testSubject = createTestSubject();
+//		result = testSubject.isTenantPermitted(globalCustomerId, serviceType, tenant);
+//	}
+}
\ No newline at end of file
diff --git a/vid-app-common/src/test/java/org/onap/vid/roles/TestSuite.java b/vid-app-common/src/test/java/org/onap/vid/roles/TestSuite.java
new file mode 100644
index 0000000..7966eaa
--- /dev/null
+++ b/vid-app-common/src/test/java/org/onap/vid/roles/TestSuite.java
@@ -0,0 +1,11 @@
+package org.onap.vid.roles;
+
+import org.junit.runner.RunWith;
+import org.junit.runners.Suite;
+
+@RunWith(Suite.class)
+@Suite.SuiteClasses(
+
+{ RoleValidatorTest.class, RoleProviderTest.class })
+public class TestSuite { // nothing
+}
diff --git a/vid-app-common/src/test/java/org/onap/vid/scheduler/RestObjects/GetTimeSlotsRestObjectTest.java b/vid-app-common/src/test/java/org/onap/vid/scheduler/RestObjects/GetTimeSlotsRestObjectTest.java
new file mode 100644
index 0000000..5bb525e
--- /dev/null
+++ b/vid-app-common/src/test/java/org/onap/vid/scheduler/RestObjects/GetTimeSlotsRestObjectTest.java
@@ -0,0 +1,33 @@
+//package org.onap.vid.scheduler.RestObjects;
+//
+//import org.junit.Test;
+//
+//
+//public class GetTimeSlotsRestObjectTest {
+//
+//	private GetTimeSlotsRestObject createTestSubject() {
+//		return new GetTimeSlotsRestObject();
+//	}
+//
+//
+//	@Test
+//	public void testSetUUID() throws Exception {
+//		GetTimeSlotsRestObject testSubject;
+//		String uuid = "";
+//
+//		// default test
+//		testSubject = createTestSubject();
+//		testSubject.setUUID(uuid);
+//	}
+//
+//
+//	@Test
+//	public void testGetUUID() throws Exception {
+//		GetTimeSlotsRestObject testSubject;
+//		String result;
+//
+//		// default test
+//		testSubject = createTestSubject();
+//		result = testSubject.getUUID();
+//	}
+//}
\ No newline at end of file
diff --git a/vid-app-common/src/test/java/org/onap/vid/scheduler/RestObjects/PostCreateNewVnfRestObjectTest.java b/vid-app-common/src/test/java/org/onap/vid/scheduler/RestObjects/PostCreateNewVnfRestObjectTest.java
new file mode 100644
index 0000000..8750d58
--- /dev/null
+++ b/vid-app-common/src/test/java/org/onap/vid/scheduler/RestObjects/PostCreateNewVnfRestObjectTest.java
@@ -0,0 +1,33 @@
+//package org.onap.vid.scheduler.RestObjects;
+//
+//import org.junit.Test;
+//
+//
+//public class PostCreateNewVnfRestObjectTest {
+//
+//	private PostCreateNewVnfRestObject createTestSubject() {
+//		return new PostCreateNewVnfRestObject();
+//	}
+//
+//
+//	@Test
+//	public void testSetUUID() throws Exception {
+//		PostCreateNewVnfRestObject testSubject;
+//		String uuid = "";
+//
+//		// default test
+//		testSubject = createTestSubject();
+//		testSubject.setUUID(uuid);
+//	}
+//
+//
+//	@Test
+//	public void testGetUUID() throws Exception {
+//		PostCreateNewVnfRestObject testSubject;
+//		String result;
+//
+//		// default test
+//		testSubject = createTestSubject();
+//		result = testSubject.getUUID();
+//	}
+//}
\ No newline at end of file
diff --git a/vid-app-common/src/test/java/org/onap/vid/scheduler/RestObjects/PostSubmitVnfChangeRestObjectTest.java b/vid-app-common/src/test/java/org/onap/vid/scheduler/RestObjects/PostSubmitVnfChangeRestObjectTest.java
new file mode 100644
index 0000000..9c78d23
--- /dev/null
+++ b/vid-app-common/src/test/java/org/onap/vid/scheduler/RestObjects/PostSubmitVnfChangeRestObjectTest.java
@@ -0,0 +1,33 @@
+//package org.onap.vid.scheduler.RestObjects;
+//
+//import org.junit.Test;
+//
+//
+//public class PostSubmitVnfChangeRestObjectTest {
+//
+//	private PostSubmitVnfChangeRestObject createTestSubject() {
+//		return new PostSubmitVnfChangeRestObject();
+//	}
+//
+//
+//	@Test
+//	public void testSetUUID() throws Exception {
+//		PostSubmitVnfChangeRestObject testSubject;
+//		String uuid = "";
+//
+//		// default test
+//		testSubject = createTestSubject();
+//		testSubject.setUUID(uuid);
+//	}
+//
+//
+//	@Test
+//	public void testGetUUID() throws Exception {
+//		PostSubmitVnfChangeRestObject testSubject;
+//		String result;
+//
+//		// default test
+//		testSubject = createTestSubject();
+//		result = testSubject.getUUID();
+//	}
+//}
\ No newline at end of file
diff --git a/vid-app-common/src/test/java/org/onap/vid/scheduler/RestObjects/RestObjectTest.java b/vid-app-common/src/test/java/org/onap/vid/scheduler/RestObjects/RestObjectTest.java
new file mode 100644
index 0000000..b8924d8
--- /dev/null
+++ b/vid-app-common/src/test/java/org/onap/vid/scheduler/RestObjects/RestObjectTest.java
@@ -0,0 +1,55 @@
+package org.onap.vid.scheduler.RestObjects;
+
+import org.apache.poi.hssf.record.formula.functions.T;
+import org.junit.Test;
+
+
+public class RestObjectTest {
+
+	private RestObject createTestSubject() {
+		return new RestObject();
+	}
+
+
+	@Test
+	public void testSet() throws Exception {
+		RestObject testSubject;
+		T t = null;
+
+		// default test
+		testSubject = createTestSubject();
+		testSubject.set(t);
+	}
+
+
+	@Test
+	public void testGet() throws Exception {
+		RestObject testSubject;
+
+		// default test
+		testSubject = createTestSubject();
+		testSubject.get();
+	}
+
+
+	@Test
+	public void testSetStatusCode() throws Exception {
+		RestObject testSubject;
+		int v = 0;
+
+		// default test
+		testSubject = createTestSubject();
+		testSubject.setStatusCode(v);
+	}
+
+
+	@Test
+	public void testGetStatusCode() throws Exception {
+		RestObject testSubject;
+		int result;
+
+		// default test
+		testSubject = createTestSubject();
+		result = testSubject.getStatusCode();
+	}
+}
\ No newline at end of file
diff --git a/vid-app-common/src/test/java/org/onap/vid/scheduler/SchedulerResponseWrappers/PostCreateNewVnfWrapperTest.java b/vid-app-common/src/test/java/org/onap/vid/scheduler/SchedulerResponseWrappers/PostCreateNewVnfWrapperTest.java
new file mode 100644
index 0000000..b0b051a
--- /dev/null
+++ b/vid-app-common/src/test/java/org/onap/vid/scheduler/SchedulerResponseWrappers/PostCreateNewVnfWrapperTest.java
@@ -0,0 +1,55 @@
+//package org.onap.vid.scheduler.SchedulerResponseWrappers;
+//
+//import org.junit.Test;
+//
+//
+//public class PostCreateNewVnfWrapperTest {
+//
+//	private PostCreateNewVnfWrapper createTestSubject() {
+//		return new PostCreateNewVnfWrapper();
+//	}
+//
+//
+//	@Test
+//	public void testGetUuid() throws Exception {
+//		PostCreateNewVnfWrapper testSubject;
+//		String result;
+//
+//		// default test
+//		testSubject = createTestSubject();
+//		result = testSubject.getUuid();
+//	}
+//
+//
+//	@Test
+//	public void testSetUuid() throws Exception {
+//		PostCreateNewVnfWrapper testSubject;
+//		String v = "";
+//
+//		// default test
+//		testSubject = createTestSubject();
+//		testSubject.setUuid(v);
+//	}
+//
+//
+//	@Test
+//	public void testToString() throws Exception {
+//		PostCreateNewVnfWrapper testSubject;
+//		String result;
+//
+//		// default test
+//		testSubject = createTestSubject();
+//		result = testSubject.toString();
+//	}
+//
+//
+//	@Test
+//	public void testGetResponse() throws Exception {
+//		PostCreateNewVnfWrapper testSubject;
+//		String result;
+//
+//		// default test
+//		testSubject = createTestSubject();
+//		result = testSubject.getResponse();
+//	}
+//}
\ No newline at end of file
diff --git a/vid-app-common/src/test/java/org/onap/vid/scheduler/SchedulerResponseWrappers/PostSubmitVnfChangeTimeSlotsWrapperTest.java b/vid-app-common/src/test/java/org/onap/vid/scheduler/SchedulerResponseWrappers/PostSubmitVnfChangeTimeSlotsWrapperTest.java
new file mode 100644
index 0000000..871d899
--- /dev/null
+++ b/vid-app-common/src/test/java/org/onap/vid/scheduler/SchedulerResponseWrappers/PostSubmitVnfChangeTimeSlotsWrapperTest.java
@@ -0,0 +1,55 @@
+//package org.onap.vid.scheduler.SchedulerResponseWrappers;
+//
+//import org.junit.Test;
+//
+//
+//public class PostSubmitVnfChangeTimeSlotsWrapperTest {
+//
+//	private PostSubmitVnfChangeTimeSlotsWrapper createTestSubject() {
+//		return new PostSubmitVnfChangeTimeSlotsWrapper();
+//	}
+//
+//
+//	@Test
+//	public void testGetUuid() throws Exception {
+//		PostSubmitVnfChangeTimeSlotsWrapper testSubject;
+//		String result;
+//
+//		// default test
+//		testSubject = createTestSubject();
+//		result = testSubject.getUuid();
+//	}
+//
+//
+//	@Test
+//	public void testSetUuid() throws Exception {
+//		PostSubmitVnfChangeTimeSlotsWrapper testSubject;
+//		String v = "";
+//
+//		// default test
+//		testSubject = createTestSubject();
+//		testSubject.setUuid(v);
+//	}
+//
+//
+//	@Test
+//	public void testToString() throws Exception {
+//		PostSubmitVnfChangeTimeSlotsWrapper testSubject;
+//		String result;
+//
+//		// default test
+//		testSubject = createTestSubject();
+//		result = testSubject.toString();
+//	}
+//
+//
+//	@Test
+//	public void testGetResponse() throws Exception {
+//		PostSubmitVnfChangeTimeSlotsWrapper testSubject;
+//		String result;
+//
+//		// default test
+//		testSubject = createTestSubject();
+//		result = testSubject.getResponse();
+//	}
+//}
\ No newline at end of file
diff --git a/vid-app-common/src/test/java/org/onap/vid/scheduler/SchedulerResponseWrappers/SchedulerResponseWrapperTest.java b/vid-app-common/src/test/java/org/onap/vid/scheduler/SchedulerResponseWrappers/SchedulerResponseWrapperTest.java
new file mode 100644
index 0000000..495fb8a
--- /dev/null
+++ b/vid-app-common/src/test/java/org/onap/vid/scheduler/SchedulerResponseWrappers/SchedulerResponseWrapperTest.java
@@ -0,0 +1,77 @@
+//package org.onap.vid.scheduler.SchedulerResponseWrappers;
+//
+//import org.junit.Test;
+//
+//
+//public class SchedulerResponseWrapperTest {
+//
+//	private SchedulerResponseWrapper createTestSubject() {
+//		return new SchedulerResponseWrapper();
+//	}
+//
+//	
+//	@Test
+//	public void testGetEntity() throws Exception {
+//		SchedulerResponseWrapper testSubject;
+//		String result;
+//
+//		// default test
+//		testSubject = createTestSubject();
+//		result = testSubject.getEntity();
+//	}
+//
+//	
+//	@Test
+//	public void testGetStatus() throws Exception {
+//		SchedulerResponseWrapper testSubject;
+//		int result;
+//
+//		// default test
+//		testSubject = createTestSubject();
+//		result = testSubject.getStatus();
+//	}
+//
+//	
+//	@Test
+//	public void testSetStatus() throws Exception {
+//		SchedulerResponseWrapper testSubject;
+//		int v = 0;
+//
+//		// default test
+//		testSubject = createTestSubject();
+//		testSubject.setStatus(v);
+//	}
+//
+//	
+//	@Test
+//	public void testSetEntity() throws Exception {
+//		SchedulerResponseWrapper testSubject;
+//		String v = "";
+//
+//		// default test
+//		testSubject = createTestSubject();
+//		testSubject.setEntity(v);
+//	}
+//
+//	
+//	@Test
+//	public void testToString() throws Exception {
+//		SchedulerResponseWrapper testSubject;
+//		String result;
+//
+//		// default test
+//		testSubject = createTestSubject();
+//		result = testSubject.toString();
+//	}
+//
+//	
+//	@Test
+//	public void testGetResponse() throws Exception {
+//		SchedulerResponseWrapper testSubject;
+//		String result;
+//
+//		// default test
+//		testSubject = createTestSubject();
+//		result = testSubject.getResponse();
+//	}
+//}
\ No newline at end of file
diff --git a/vid-app-common/src/test/java/org/onap/vid/scheduler/SchedulerRestInterfaceTest.java b/vid-app-common/src/test/java/org/onap/vid/scheduler/SchedulerRestInterfaceTest.java
new file mode 100644
index 0000000..5f861df
--- /dev/null
+++ b/vid-app-common/src/test/java/org/onap/vid/scheduler/SchedulerRestInterfaceTest.java
@@ -0,0 +1,26 @@
+package org.onap.vid.scheduler;
+
+import org.apache.poi.hssf.record.formula.functions.T;
+import org.json.simple.JSONObject;
+import org.junit.Test;
+
+public class SchedulerRestInterfaceTest {
+
+	private SchedulerRestInterface createTestSubject() {
+		return new SchedulerRestInterface();
+	}
+
+
+	
+	@Test
+	public void testLogRequest() throws Exception {
+		SchedulerRestInterface testSubject;
+		JSONObject requestDetails = null;
+
+		// default test
+		testSubject = createTestSubject();
+		testSubject.logRequest(requestDetails);
+	}
+
+
+}
\ No newline at end of file
diff --git a/vid-app-common/src/test/java/org/onap/vid/scheduler/rest/RequestDetailsTest.java b/vid-app-common/src/test/java/org/onap/vid/scheduler/rest/RequestDetailsTest.java
new file mode 100644
index 0000000..aa634f9
--- /dev/null
+++ b/vid-app-common/src/test/java/org/onap/vid/scheduler/rest/RequestDetailsTest.java
@@ -0,0 +1,34 @@
+package org.onap.vid.scheduler.rest;
+
+import org.junit.Test;
+import org.onap.vid.mso.rest.RequestDetails;
+
+
+public class RequestDetailsTest {
+
+	private RequestDetails createTestSubject() {
+		return new RequestDetails();
+	}
+
+
+	/*@Test
+	public void testGetDomain() throws Exception {
+		RequestDetails testSubject;
+		String result;
+
+		// default test
+		testSubject = createTestSubject();
+		result = testSubject.getDomain();
+	}
+
+
+	@Test
+	public void testSetDomain() throws Exception {
+		RequestDetails testSubject;
+		String domain = "";
+
+		// default test
+		testSubject = createTestSubject();
+		testSubject.setDomain(domain);
+	}*/
+}
\ No newline at end of file
diff --git a/vid-app-common/src/test/java/org/onap/vid/scheduler/rest/TestSuite.java b/vid-app-common/src/test/java/org/onap/vid/scheduler/rest/TestSuite.java
new file mode 100644
index 0000000..2bdeeb3
--- /dev/null
+++ b/vid-app-common/src/test/java/org/onap/vid/scheduler/rest/TestSuite.java
@@ -0,0 +1,11 @@
+package org.onap.vid.scheduler.rest;
+
+import org.junit.runner.RunWith;
+import org.junit.runners.Suite;
+
+@RunWith(Suite.class)
+@Suite.SuiteClasses(
+
+{ RequestDetailsTest.class })
+public class TestSuite { // nothing
+}
diff --git a/vid-app-common/src/test/java/org/onap/vid/selenium/FirstClass.java b/vid-app-common/src/test/java/org/onap/vid/selenium/FirstClass.java
new file mode 100644
index 0000000..e3ccdd9
--- /dev/null
+++ b/vid-app-common/src/test/java/org/onap/vid/selenium/FirstClass.java
@@ -0,0 +1,605 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * VID
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.vid.selenium;
+
+import org.testng.annotations.AfterClass;
+import org.testng.annotations.AfterMethod;
+import org.testng.annotations.AfterSuite;
+import org.testng.annotations.BeforeClass;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.BeforeSuite;
+import org.testng.annotations.BeforeTest;
+import org.testng.annotations.Test;
+
+
+import org.openqa.selenium.By;
+import org.openqa.selenium.WebDriver;
+import org.openqa.selenium.WebElement;
+import org.openqa.selenium.firefox.FirefoxDriver;
+import org.openqa.selenium.support.ui.Select;
+
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.List;
+import java.util.Properties;
+import java.util.concurrent.TimeUnit;
+import org.apache.log4j.Logger;
+import org.testng.Assert;
+import org.testng.asserts.*;
+
+/**
+ * The Class FirstClass.
+ */
+public class FirstClass {
+	
+		/** The login button. */
+		WebElement loginButton;
+		
+		/** The eg. */
+		String eg;
+		
+		/** The login. */
+		WebElement login;
+		
+		/** The pwd. */
+		WebElement pwd;
+		
+		/** The log. */
+		Logger log;
+		
+		/** The errormessage. */
+		WebElement errormessage;
+		
+					
+		/** The driver. */
+		WebDriver driver=new FirefoxDriver();
+		
+		
+		
+		/** The config prop. */
+		private final Properties configProp = new Properties();
+		
+		
+		/**
+		 * Instantiates a new first class.
+		 */
+		private  FirstClass() {
+			// TODO Auto-generated constructor stub
+			//
+			try{
+			//	InputStream input =this.getClass().getClassLoader().getResourceAsStream("objectmap.properties");
+			//FileInputStream input1 = new FileInputStream("objectmap.properties");
+				
+			InputStream input =new FileInputStream("objectconfig.properties");
+			System.out.println("Read all properties from file");
+			configProp.load(input);
+			System.out.println("Read all properties from file completed");
+			}
+			catch(IOException e) {
+				
+				e.printStackTrace();
+			}
+		}
+		
+		
+		/*
+		
+		
+		@BeforeClass
+		public void setUp() {
+			System.out.println("*******************");
+			System.out.println("launching IE browser");
+			System.setProperty("webdriver.ie.driver", driverPath+"IEDriverServer.exe");
+			driver = new InternetExplorerDriver();
+			driver.findElement(By.className());
+			driver.manage().window().maximize();
+			
+
+			 login = driver.findElement(By.xpath("//input[@class='fn-ebz-text ng-pristine ng-valid']"));
+			 pwd = driver.findElement(By.xpath("//input[@class='span3 ng-pristine ng-valid']"));
+			 loginButton = driver.findElement(By.id("loginBtn"));
+		}
+		
+		
+	*/
+		/**
+		 * Sets the up.
+		 */
+		// TODO Auto-generated method stub
+		@BeforeClass
+		public void setUp()
+		{
+			
+						
+			//WebDriver driver=new FirefoxDriver();
+			
+			log = Logger.getLogger(FirstClass.class.getName());
+		
+		
+		
+		// Get url
+		driver.get(configProp.getProperty("baseURL"));
+		driver.manage().window().maximize();
+		
+		
+		 login = driver.findElement(By.xpath(configProp.getProperty("login")));
+		 
+		 pwd = driver.findElement(By.xpath(configProp.getProperty("pwd")));
+		 loginButton = driver.findElement(By.id(configProp.getProperty("loginButton")));
+		}
+		
+		
+		/**
+		 * Empty username password.
+		 */
+		@Test(priority=1)
+		public void emptyUsernamePassword()
+		{
+		
+			
+		//User Name and Password field is empty
+		log.info("-----VID-11 TC-8----Username and password empty");
+		loginButton.click();
+		errormessage=driver.findElement(By.xpath("//*[@id='errorInfo']/span"));
+		String errmsg= errormessage.getText();
+		//System.out.println("Error message is"+errmsg);
+		//String expected = "Invaild username or password, Please try again";
+		
+		//Assert.assertEquals(errmsg,expected);
+
+		Boolean str = driver.getPageSource().contains("Invalid username or password, Please try again");
+		System.out.println(driver.getPageSource().contains("Invalid username or password, Please try again"));
+		
+		if(str==true)
+		{
+			log.info("Error message validated");
+			log.info("VID-11 TC-8 PASSED");
+			
+		}else
+			log.error("Failed validation");
+		
+		}
+
+
+		
+		/**
+		 * Invalid user name.
+		 */
+		@Test(priority=2)
+		public void invalidUserName()
+		{
+		
+		log.info("-----VID-11 TC-6----Invalid Username and Valid Password");
+		
+		
+		login.sendKeys("xxx");
+		pwd.sendKeys("abc123");
+		loginButton.click();
+		try {
+			Thread.sleep(5000);
+		} catch (InterruptedException e) {
+			// TODO Auto-generated catch block
+			e.printStackTrace();
+		}
+		
+		String errmsg= errormessage.getText();
+		String expected = "Invalid username or password, Please try again";
+		Assert.assertEquals(errmsg,expected);
+		//Boolean str1 = driver.getPageSource().contains("Invalid username or password, Please try again");
+		//System.out.print(str1);
+		
+		log.info("VID-11 TC-6 PASSED");
+				
+		}
+		
+		
+		/**
+		 * Invalid password.
+		 */
+		@Test(priority=3)
+		public void invalidPassword()
+		{
+		log.info("-----VID-11 TC-7----Valid Username and Invalid Password");
+		//  Valid user name and Invalid password.
+				login.clear();
+				pwd.clear();
+				login.sendKeys("testuser");
+				pwd.sendKeys("xxx");
+				loginButton.click();
+				driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
+		
+				
+				String errmsg= errormessage.getText();
+				String expected = "Invalid username or password, Please try again";
+				Assert.assertEquals(errmsg,expected);
+				
+				//Boolean str2 = driver.getPageSource().contains("Invaild username or password, Please try again");
+				//System.out.print(str2);
+				
+				log.info("VID-11 TC-7 PASSED");
+		}
+		
+			
+		/**
+		 * Login successful.
+		 */
+		@Test(priority=4)
+		public void loginSuccessful()
+		{
+		log.info("-----VID-11 TC-1----Valid Username and Valid Password");
+		//Login with valid user name and password.
+		login.clear();
+		login.sendKeys("su");
+		pwd.clear();
+		pwd.sendKeys("fusion");
+		
+				
+		loginButton.click();
+		driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
+		
+		try {
+			Thread.sleep(6000);
+		} catch (InterruptedException e) {
+			// TODO Auto-generated catch block
+			e.printStackTrace();
+		}
+		Assert.assertTrue(driver.getPageSource().contains("Search Existing Service Instances"));
+		log.info("VID-11 TC-1 PASSED");
+		
+		}
+		
+		
+		/**
+		 * Verify home page elements left pane.
+		 */
+		@Test(priority=5)
+		public void verifyHomePageElementsLeftPane()
+		
+		{
+			
+			
+			log.info("VID-10 TC 1 ");
+			//VID Home
+			log.info("VID 11 TC-2");
+			driver.findElement(By.xpath("html/body/div[1]/div[1]/div/div/div[2]/div/div/div[1]/div/div/accordion/div/div[1]/a/span")).isDisplayed();
+			//Create New Service Instance
+			driver.findElement(By.xpath("html/body/div[1]/div[1]/div/div/div[2]/div/div/div[1]/div/div/accordion/div/div[2]/a/span")).isDisplayed();
+			
+			//Browse Service Type
+			driver.findElement(By.xpath("html/body/div[1]/div[1]/div/div/div[2]/div/div/div[1]/div/div/accordion/div/div[3]/a/span")).isDisplayed();
+			//View Log		
+			driver.findElement(By.xpath("html/body/div[1]/div[1]/div/div/div[2]/div/div/div[1]/div/div/accordion/div/div[4]/a/span")).isDisplayed();
+			
+			//Profile
+			driver.findElement(By.xpath("html/body/div[1]/div[1]/div/div/div[2]/div/div/div[1]/div/div/accordion/div/div[5]/a/span")).isDisplayed();
+			//Admin
+			driver.findElement(By.xpath("html/body/div[1]/div[1]/div/div/div[2]/div/div/div[1]/div/div/accordion/div/div[6]/a/span")).isDisplayed();
+			//Logout
+			driver.findElement(By.xpath("html/body/div[1]/div[1]/div/div/div[2]/div/div/div[1]/div/div/accordion/div/div[7]/a/span")).isDisplayed();
+			
+			//Infrastructure Subscriber Name
+			driver.findElement(By.xpath(".//*[@id='mContent']/div/div/table/tbody/tr[1]/td[1]/div/label")).isDisplayed();
+			//Infrastructure Subscriber Name Select Drop down
+			driver.findElement(By.xpath(".//*[@id='mContent']/div/div/table/tbody/tr[1]/td[2]/div/select")).isDisplayed();
+			//Infrastructure Service Type
+			driver.findElement(By.xpath(".//*[@id='mContent']/div/div/table/tbody/tr[2]/td[1]/div/label")).isDisplayed();
+			//Infrastructure Service Type Select Drop down
+			driver.findElement(By.xpath(".//*[@id='mContent']/div/div/table/tbody/tr[2]/td[2]/div/select")).isDisplayed();
+			//Submit button 
+			driver.findElement(By.xpath(".//*[@id='mContent']/div/div/table/tbody/tr[3]/td/div/button")).isDisplayed();
+			
+			//Login Snippet Icon
+			driver.findElement(By.xpath(".//*[@class='icon-user-small login-snippet-icon']")).isDisplayed();
+			
+			
+			//String bodyText = driver.findElement(By.tagName("body")).getText();
+			//Assert.assertTrue("Text not found!", bodyText.contains("Search Existing Service Instances"));
+			//Assert.IsTrue(driver.getPageSource.Contains("Search Existing Service Instances"));
+			 
+			log.info("VID-12 TC-1");
+			Assert.assertTrue(driver.getPageSource().contains("Search Existing Service Instances"));
+			Assert.assertTrue(driver.getPageSource().contains("Please search by the Subscriber name or Service Type from below:"));
+			log.info("VID-12 TC-1 PASSED");
+			log.info("VID-10 TC 1 PASSED");
+			log.info("VID-11 TC-2 PASSED");
+		}
+		
+		
+		/**
+		 * Disabled submit button.
+		 */
+		@Test(priority=6)
+		public void disabledSubmitButton()
+		{
+			log.info("VID-12 TC-13");
+			//Assert submit button disabled.
+			Assert.assertFalse(driver.findElement(By.xpath(configProp.getProperty("submitButton"))).isEnabled());
+			log.info("VID-12 TC-13 PASSED");
+
+		} 
+		
+		/**
+		 * Default list box value.
+		 */
+		@Test(priority=7)
+		public void defaultListBoxValue()
+		{
+			log.info("VID-12 TC-2");
+			
+			
+			//WebElement subscribername =driver.findElement(By.xpath(".//*[@id='mContent']/div/div/table/tbody/tr[1]/td[2]/div/select"));
+			
+			Select oSelect = new Select(driver.findElement(By.xpath(configProp.getProperty("subscriberNameDropDown"))));
+			Select iSelect = new Select(driver.findElement(By.xpath(configProp.getProperty("serviceTypeDropDown"))));
+			
+			
+			WebElement ielement=iSelect.getFirstSelectedOption();
+			WebElement oelement=oSelect.getFirstSelectedOption();
+			String defaultsubscribername=oelement.getText();
+			String defaultservicetype=ielement.getText();
+			
+			Assert.assertEquals(defaultsubscribername,"Select Subscriber Name");
+			Assert.assertEquals(defaultservicetype,"Select Service Type");
+			
+		
+			
+			
+		//Verify Select Subscriber Name isDisplayed.
+		//driver.findElement(By.xpath(".//*[@id='mContent']/div/div/table/tbody/tr[1]/td[2]/div/select/option[1]")).isSelected();
+				
+		//Verify Select Service Type isDisplayed.	
+		//driver.findElement(By.xpath(".//*[@id='mContent']/div/div/table/tbody/tr[2]/td[2]/div/select/option[1]")).isSelected();
+			
+			
+			log.info("VID-12 TC-2 PASSED");
+
+		}
+
+
+		
+		/**
+		 * Select subscriber name drop down.
+		 *
+		 * @throws InterruptedException the interrupted exception
+		 */
+		@Test(priority=8)
+		public void selectSubscriberNameDropDown() throws InterruptedException
+		{
+			log.info("------------------VID-10 TC-2,VID-12 TC-11, VID-12 TC-9, VID 12 TC-10,VID-12 TC-6, VID 12 TC-5--------------------");
+			
+			
+			driver.findElement(By.xpath(configProp.getProperty("subscriberNameDropDown")));
+			
+			driver.findElement(By.xpath(configProp.getProperty("serviceTypeDropDown")));
+			Thread.sleep(5000);
+			
+			//Infrastructure Subscriber Name
+			Select oSelect = new Select(driver.findElement(By.xpath(configProp.getProperty("subscriberNameDropDown"))));
+			
+			List <WebElement> elementCount = oSelect.getOptions();
+			log.info("Select Element Count of Service Name");
+			System.out.println(elementCount.size());
+			
+			
+			//Verifying getInfrastructureSubscribersList
+			log.info("VID-29 TC-1");
+			Assert.assertTrue(elementCount.size()>0);
+			log.info("VID-29 TC-1 PASSED");
+			
+			oSelect.selectByIndex(2);
+			String selectedOption = new Select(driver.findElement(By.xpath(configProp.getProperty("subscriberNameDropDown")))).getFirstSelectedOption().getText();
+
+			System.out.println("Service Name selected is " +selectedOption);
+			log.info("VID-10 TC-2 PASSED");
+					
+			//Submit button is clicked
+			driver.findElement(By.xpath(configProp.getProperty("submitButton"))).click();
+			
+			
+			//Verify whether the page header is displayed "Selected Subscriber's Service Instance Details:"
+			driver.findElement(By.xpath(".//*[@id='mContent']/div/div/div/h1")).isDisplayed();
+			//Assert.assertTrue(driver.getPageSource().contains("Selected Subscriber's Service Instance Details:"))
+			
+			
+			//Verify whether the page header is displayed "Global Customer ID"
+			driver.findElement(By.xpath(".//*[@id='mContent']/div/div/div/div/table/thead/tr/th[2]/div")).isDisplayed();
+			Assert.assertTrue(driver.getPageSource().contains("Global Customer ID"));
+			Assert.assertTrue(driver.getPageSource().contains("Subscriber Name"));
+			Assert.assertTrue(driver.getPageSource().contains("Service Type"));
+			Assert.assertTrue(driver.getPageSource().contains("Service Instance ID"));
+			
+			log.info("VID-12 TC-5 PASSED");
+			log.info("VID-12 TC-11 PASSED");
+			
+			WebElement serviceinstancetable =driver.findElement(By.xpath("//table[@class='tablesorter tablesorter-default ng-isolate-scope']"));
+			
+			List<WebElement> rows_table = serviceinstancetable.findElements(By.tagName("tr"));
+			  //To calculate no of rows In table.
+			  int rows_count = rows_table.size();
+			  
+			  //Loop will execute till the last row of table.
+			  for (int row=0; row<rows_count; row++){
+			   //To locate columns(cells) of that specific row.
+			   List<WebElement> Columns_row = rows_table.get(row).findElements(By.tagName("td"));
+			   //To calculate no of columns(cells) In that specific row.
+			   int columns_count = Columns_row.size();
+			   //System.out.println("Number of cells In Row "+row+" are "+columns_count);
+			   
+			   //Loop will execute till the last cell of that specific row.
+			   for (int column=0; column<columns_count; column++){
+			    //To retrieve text from that specific cell.
+			    String celtext = Columns_row.get(column).getText();
+			    //System.out.println("Cell Value Of row number "+row+" and column number "+column+" Is "+celtext);
+			   
+			    
+			    
+			    //log.info("Testing Get column and row value");
+			    List <WebElement> exx= rows_table.get(1).findElements(By.tagName("td"));
+			     eg=Columns_row.get(2).getText();
+			   // System.out.println("Cell value of row 1 and column 2 is" +eg);
+			   }
+			  }
+		
+			  
+			
+			
+			//Verify View/Edit isDisplayed and Click
+			
+			driver.findElement(By.xpath("//a[@alt='View/Edit']")).isDisplayed();
+			
+			driver.findElement(By.xpath(".//*[@id='mContent']/div/div/div/div/table/tbody/tr[1]/td[1]/div/a")).click();
+			
+			log.info("User clicked View/Edit");
+			
+			//Verify the Subscriber Name displayed.	
+			String header= driver.findElement(By.xpath("//h1[@class='heading1 ng-binding']")).getText();
+			//System.out.println(header);
+			
+			
+			if(header.contains(eg))
+			{
+				System.out.println("Header contains the subscriber name");
+			}else
+				System.out.println("Header does not contain the subscriber name");
+			
+			
+			
+			Assert.assertTrue(driver.getPageSource().contains("PerfTest Subscriber00020021"));
+			log.info("VID-12 TC-6 PASSED");
+			
+			
+				
+			driver.navigate().back();
+			//Cancel button isDisplayed
+			driver.findElement(By.xpath("//button[@class='button button--small button--primary']")).isDisplayed();
+			log.info("VID-12 TC-9 PASSED");
+			
+			//Cancel button is clicked
+			driver.findElement(By.xpath("//button[@class='button button--small button--primary']")).click();
+			log.info("Cancel button is clicked");
+			
+			//Verifying VID Home page is displayed
+			Assert.assertTrue(driver.getPageSource().contains("Search Existing Service Instances"));
+			log.info("VID-12 TC-10 PASSED");
+			
+			   }
+		
+		
+		/**
+		 * Refresh subscriber name.
+		 */
+		@Test(priority=9)
+		public void refreshSubscriberName()
+		{
+			log.info("VID-10 TC-4");
+			
+			
+			driver.findElement(By.xpath(configProp.getProperty("refreshButtonSubscriberName"))).isDisplayed();
+			
+			log.info("VID-10 TC-4 PASSED");
+			
+			
+		}
+
+		
+		/**
+		 * Select subscriber type drop down.
+		 *
+		 * @throws InterruptedException the interrupted exception
+		 */
+		@Test(priority=9)
+		public void selectSubscriberTypeDropDown() throws InterruptedException
+		{
+			Thread.sleep(5000);
+			log.info("------------------VID-10 TC-3, VID-12 TC-12,--------------------");
+			//Infrastructure Subscriber Type
+			Select iSelect = new Select(driver.findElement(By.xpath(configProp.getProperty("serviceTypeDropDown"))));
+			
+			List <WebElement> ielementCount = iSelect.getOptions();
+			log.info("Select Element Count of Service type");
+			System.out.println(ielementCount.size());
+			iSelect.selectByIndex(1);
+			
+			log.info("VID-10 TC-3 PASSED");
+			
+						
+			//Submit button is clicked
+			driver.findElement(By.xpath(configProp.getProperty("submitButton"))).click();
+			
+			//Verify whether the page header is displayed "Selected Subscriber's Service Instance Details:"
+			driver.findElement(By.xpath(".//*[@id='mContent']/div/div/div/h1")).isDisplayed();
+			//Assert.assertTrue(driver.getPageSource().contains("Selected Subscriber's Service Instance Details:"))
+			log.info("Page Header: Selected Subscriber's Service Instance Details");
+			
+			
+			//Verify whether the page header is displayed "Global Customer ID"
+			driver.findElement(By.xpath(".//*[@id='mContent']/div/div/div/div/table/thead/tr/th[2]/div")).isDisplayed();
+			
+			//Assert.assertTrue(driver.getPageSource().contains("Global Customer ID"));
+			log.info("Table is displayed");
+			
+			log.info("VID-12 TC-12 PASSED");
+			
+		}
+		
+		
+		
+		/**
+		 * Logout under profile.
+		 */
+		@Test(priority=10)
+		public void logoutUnderProfile()
+		{
+			
+			log.info("-----------VID-11 TC-5---------------------");
+			//driver.findElement(By.partialLinkText("Click here to login")).click();
+			//driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
+			
+		
+			driver.findElement(By.xpath(".//*[@class='icon-user-small login-snippet-icon']")).click();			
+			driver.findElement(By.xpath(".//*[@id='reg-logout-div']/a")).click();
+			//Validate that the user has logged out of VID. Displays "Portal"
+			Assert.assertTrue(driver.getPageSource().contains("Portal"));
+			
+			log.info("VID-11 TC-5 PASSED");
+			
+		}
+
+		
+		
+		/**
+		 * Tear down.
+		 */
+		@AfterClass
+		public void tearDown()
+		{
+			driver.close();
+		
+		}
+		
+		
+		
+	}
+
+
+	
+
diff --git a/vid-app-common/src/test/java/org/onap/vid/selenium/LogOutLeftPane.java b/vid-app-common/src/test/java/org/onap/vid/selenium/LogOutLeftPane.java
new file mode 100644
index 0000000..19c6b19
--- /dev/null
+++ b/vid-app-common/src/test/java/org/onap/vid/selenium/LogOutLeftPane.java
@@ -0,0 +1,242 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * VID
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.vid.selenium;
+
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.List;
+import java.util.Properties;
+import java.util.concurrent.TimeUnit;
+
+import org.apache.log4j.Logger;
+import org.openqa.selenium.By;
+import org.openqa.selenium.WebDriver;
+import org.openqa.selenium.WebElement;
+import org.openqa.selenium.firefox.FirefoxDriver;
+import org.openqa.selenium.support.ui.Select;
+import org.testng.Assert;
+import org.testng.annotations.BeforeTest;
+import org.testng.annotations.Test;
+
+/**
+ * The Class LogOutLeftPane.
+ */
+@Test(enabled=false)
+public class LogOutLeftPane {
+
+	/** The login button. */
+	WebElement loginButton;
+	
+	/** The login. */
+	WebElement login;
+	
+	/** The pwd. */
+	WebElement pwd;
+	
+	/** The log. */
+	Logger log;
+	
+	/** The errormessage. */
+	WebElement errormessage;
+	
+	/** The driver. */
+	WebDriver driver=new FirefoxDriver();
+	
+	
+	/** The config prop. */
+	private final Properties configProp = new Properties();
+	
+	
+	/**
+	 * Instantiates a new log out left pane.
+	 */
+	private  LogOutLeftPane() {
+		// TODO Auto-generated constructor stub
+		//
+		try{
+		//	InputStream input =this.getClass().getClassLoader().getResourceAsStream("objectmap.properties");
+		//FileInputStream input1 = new FileInputStream("objectmap.properties");
+			
+		InputStream input =new FileInputStream("objectconfig.properties");
+		System.out.println("Read all properties from file");
+		configProp.load(input);
+		System.out.println("Read all properties from file completed");
+		}
+		catch(IOException e) {
+			
+			e.printStackTrace();
+		}
+	}
+	
+	
+	   
+	   
+	/**
+	 * Do before test.
+	 */
+	// TODO Auto-generated method stub
+	@BeforeTest
+	public void doBeforeTest()
+	{
+		//WebDriver driver=new FirefoxDriver();
+		
+		log = Logger.getLogger(LogOutLeftPane.class.getName());
+	
+	
+	
+	// Get url
+	driver.get("http://vid.onap.org:9080/vid/login_external.htm");
+	driver.manage().window().maximize();
+	
+	
+	 login = driver.findElement(By.xpath("//input[@class='fn-ebz-text ng-pristine ng-valid']"));
+	 pwd = driver.findElement(By.xpath("//input[@class='span3 ng-pristine ng-valid']"));
+	 loginButton = driver.findElement(By.id("loginBtn"));
+	}
+	
+	
+	/**
+	 * Expand collapse panel.
+	 *
+	 * @throws InterruptedException the interrupted exception
+	 */
+	@Test(priority=1)
+	public void expandCollapsePanel() throws InterruptedException
+	{
+
+		
+		
+		login.clear();
+		login.sendKeys("su");
+		pwd.clear();
+		pwd.sendKeys("fusion");
+		//driver.findElement(By.partialLinkText("Click here to login")).click();
+		//driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
+		
+		loginButton.click();
+		driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
+		
+		
+		log.info("Clicking Profile link from left pane");
+		Thread.sleep(3000);
+		System.out.println("properties file details --->"+configProp.getProperty("profilelink"));
+		driver.findElement(By.xpath(configProp.getProperty("profilelink"))).click();
+		Thread.sleep(3000);
+		
+		//Verify whether the sub panel is displayed
+		//To verify the following :Search import from webphone and Self 
+		driver.findElement(By.xpath(".//*[@id='panel4']")).isDisplayed();
+		log.info("Expand and collapse passed for Profile link");
+		
+		//For Admin
+		//Verify expand and collapse working for ADMIN
+		log.info("Clicking Admin link from left pane");
+		driver.findElement(By.xpath("html/body/div[1]/div[1]/div/div/div[2]/div/div/div[1]/div/div/accordion/div/div[6]/a/span")).click();
+		//To verify the following: Roles, Roles Functions, Usages
+		driver.findElement(By.xpath(".//*[@id='panel5']")).isDisplayed();
+		
+	
+		log.info("Expand and collapse passed for ADMIN link");
+
+		log.info("VID-11 TC-3 PASSED");
+		
+	}
+	
+	
+	/**
+	 * Drop down list.
+	 *
+	 * @throws InterruptedException the interrupted exception
+	 */
+	@Test(priority=2)
+	public void dropDownList() throws InterruptedException
+	{
+		//VID-12 TC-3
+		log.info("VID-12 TC-3");
+		//driver.findElement(By.xpath(".//*[@id='mContent']/div/div/table/tbody/tr[1]/td[2]/div/select"));
+		
+		//driver.findElement(By.xpath(".//*[@id='mContent']/div/div/table/tbody/tr[2]/td[2]/div/select"));
+		Thread.sleep(5000);
+		
+		//Infrastructure Subscriber Name
+		Select oSelect = new Select(driver.findElement(By.xpath(".//*[@id='mContent']/div/div/table/tbody/tr[1]/td[2]/div/select")));
+		Select iSelect = new Select(driver.findElement(By.xpath(".//*[@id='mContent']/div/div/table/tbody/tr[2]/td[2]/div/select")));
+		
+		List <WebElement> elementCount = oSelect.getOptions();
+		log.info("Subscriber Name Drop Down");
+		System.out.println(elementCount.size());
+		oSelect.selectByIndex(1);
+		log.info("Subscriber name selected");
+		//String selectedOption = new Select(driver.findElement(By.xpath(".//*[@id='mContent']/div/div/table/tbody/tr[1]/td[2]/div/select"))).getFirstSelectedOption().getText();
+		
+		
+		List <WebElement> count = iSelect.getOptions();
+		log.info("Subscriber type drop down");
+		System.out.println(count.size());
+		oSelect.selectByIndex(1);
+		log.info("Subscriber type selected");
+		
+
+				
+		//Submit button is clicked
+		driver.findElement(By.xpath(".//*[@id='mContent']/div/div/table/tbody/tr[3]/td/div/button")).click();
+		
+		
+		//Verify whether the page header is displayed "Selected Subscriber's Service Instance Details:"
+		driver.findElement(By.xpath(".//*[@id='mContent']/div/div/div/h1")).isDisplayed();
+		log.info("VID-12 TC-3 PASSED");
+	}
+	
+	
+	
+	
+	/**
+	 * Logout left pane.
+	 */
+	@Test(priority=3)
+	public void logoutLeftPane()
+	{
+		//To Verify if the logout link redirects to Login page when clicked.
+		
+		
+		/*log.info("----------------VID-11 TC-4----------------");
+		login.clear();
+		login.sendKeys("testuser");
+		pwd.clear();
+		pwd.sendKeys("abc123");
+		//driver.findElement(By.partialLinkText("Click here to login")).click();
+		//driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
+		
+		loginButton.click();
+		driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);*/
+		log.info("----------------VID-11 TC-4----------------");
+		driver.findElement(By.xpath("html/body/div[1]/div[1]/div/div/div[2]/div/div/div[1]/div/div/accordion/div/div[7]/a")).click();
+		//Validate that the user has logged out of VID. Displays "Portal"
+		Assert.assertTrue(driver.getPageSource().contains("Portal"));
+		
+		log.info("VID 11 TC-4 PASSED");
+		
+		driver.close();
+		
+	}
+	
+}
diff --git a/vid-app-common/src/test/java/org/onap/vid/services/ChangeManagementServiceImplTest.java b/vid-app-common/src/test/java/org/onap/vid/services/ChangeManagementServiceImplTest.java
new file mode 100644
index 0000000..e73838c
--- /dev/null
+++ b/vid-app-common/src/test/java/org/onap/vid/services/ChangeManagementServiceImplTest.java
@@ -0,0 +1,69 @@
+package org.onap.vid.services;
+
+import static org.junit.Assert.*;
+import java.util.*;
+
+import org.json.simple.JSONArray;
+import org.junit.Assert;
+import org.junit.Test;
+import org.onap.vid.changeManagement.ChangeManagementRequest;
+import org.onap.vid.changeManagement.RequestDetails;
+import org.onap.vid.mso.rest.Request;
+import org.springframework.http.ResponseEntity;
+
+public class ChangeManagementServiceImplTest {
+
+	/*TODO: fix private ChangeManagementServiceImpl createTestSubject() {
+		return new ChangeManagementServiceImpl();
+	}*/
+
+	
+	/*@Test
+	public void testGetMSOChangeManagements() throws Exception {
+		ChangeManagementServiceImpl testSubject;
+		Collection<Request> result;
+
+		// default test
+		testSubject = createTestSubject();
+		result = testSubject.getMSOChangeManagements();
+	}
+
+	
+	@Test
+	public void testFindRequestByVnfName() throws Exception {
+	ChangeManagementServiceImpl testSubject;List<RequestDetails> requests = null;
+	String vnfName = "";
+	RequestDetails result;
+	
+	// test 1
+	testSubject=createTestSubject();requests = null;
+	result=Deencapsulation.invoke(testSubject, "findRequestByVnfName", new Object[]{List<RequestDetails>.class, vnfName});
+	Assert.assertEquals(null, result);
+	}*/
+/*
+	
+	@Test
+	public void testDoChangeManagement() throws Exception {
+		ChangeManagementServiceImpl testSubject;
+		ChangeManagementRequest request = null;
+		String vnfName = "";
+		ResponseEntity<String> result;
+
+		// test 1
+		testSubject = createTestSubject();
+		request = null;
+		result = testSubject.doChangeManagement(request, vnfName);
+		Assert.assertEquals(null, result);
+	}
+
+	
+	@Test
+	public void testGetSchedulerChangeManagements() throws Exception {
+		ChangeManagementServiceImpl testSubject;
+		JSONArray result;
+
+		// default test
+		testSubject = createTestSubject();
+		result = testSubject.getSchedulerChangeManagements();
+	}*/
+}
\ No newline at end of file
diff --git a/vid-app-common/src/test/java/org/onap/vid/services/ChangeManagementServiceTest.java b/vid-app-common/src/test/java/org/onap/vid/services/ChangeManagementServiceTest.java
new file mode 100644
index 0000000..f3df4c6
--- /dev/null
+++ b/vid-app-common/src/test/java/org/onap/vid/services/ChangeManagementServiceTest.java
@@ -0,0 +1,29 @@
+package org.onap.vid.services;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.onap.vid.changeManagement.ChangeManagementRequest;
+import org.onap.vid.changeManagement.ChangeManagementResponse;
+import org.springframework.http.ResponseEntity;
+
+import junit.framework.Assert;
+
+import static org.junit.Assert.*;
+
+
+public class ChangeManagementServiceTest {
+    @Before
+    public void setUp() throws Exception {
+    }
+
+    @After
+    public void tearDown() throws Exception {
+    }
+
+    @Test
+    public void doChangeManagement_requestTypeIsUpdateVnfNotFound_doUpdateAndReturnNull() throws Exception {
+
+     }
+
+}
\ No newline at end of file
diff --git a/vid-app-common/src/test/java/org/onap/vid/services/ChangeManagementServiceUnitTest.java b/vid-app-common/src/test/java/org/onap/vid/services/ChangeManagementServiceUnitTest.java
new file mode 100644
index 0000000..f692bdc
--- /dev/null
+++ b/vid-app-common/src/test/java/org/onap/vid/services/ChangeManagementServiceUnitTest.java
@@ -0,0 +1,107 @@
+package org.onap.vid.services;
+
+import com.fasterxml.jackson.databind.ObjectMapper;
+import org.apache.commons.io.IOUtils;
+import org.mockito.ArgumentCaptor;
+import org.openecomp.portalsdk.core.util.SystemProperties;
+import org.onap.vid.changeManagement.ChangeManagementRequest;
+import org.onap.vid.controller.MsoConfig;
+import org.onap.vid.controller.WebConfig;
+import org.onap.vid.model.RequestReferencesContainer;
+import org.onap.vid.mso.RestObject;
+import org.onap.vid.mso.rest.MsoRestClientNew;
+import org.onap.vid.mso.rest.RequestDetails;
+import org.onap.vid.properties.AsdcClientConfiguration;
+import org.onap.vid.services.ChangeManagementService;
+import org.onap.vid.services.ChangeManagementServiceImpl;
+import org.onap.vid.testUtils.RegExMatcher;
+import org.skyscreamer.jsonassert.JSONAssert;
+import org.skyscreamer.jsonassert.JSONCompareMode;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.test.context.ContextConfiguration;
+import org.springframework.test.context.testng.AbstractTestNGSpringContextTests;
+import org.springframework.test.context.web.WebAppConfiguration;
+import org.testng.annotations.Test;
+
+import javax.inject.Inject;
+import java.net.URL;
+
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.core.IsEqual.equalTo;
+import static org.hamcrest.core.IsInstanceOf.instanceOf;
+import static org.mockito.Matchers.anyObject;
+import static org.mockito.Matchers.anyString;
+import static org.mockito.Mockito.*;
+
+
+@Test
+@ContextConfiguration(classes = {WebConfig.class, AsdcClientConfiguration.class, SystemProperties.class, ChangeManagementServiceUnitTest.TestMsoConfig.class})
+@WebAppConfiguration
+public class ChangeManagementServiceUnitTest extends AbstractTestNGSpringContextTests {
+
+    private ObjectMapper objectMapper = new ObjectMapper();
+    @Inject
+    private ChangeManagementService changeManagementService;
+    @Inject
+    private MsoRestClientNew restClientUnderTest;
+
+   // @Test
+    void testInPlaceSoftwareUpdateRequest() throws Exception {
+
+
+        doReturn(new RestObject<RequestReferencesContainer>()).when(restClientUnderTest).PostForObject(anyObject(), anyString(), anyString(), anyObject());
+
+        URL requestJsonUrl = this.getClass().getResource("/services/change_management_software_update_request.json");
+        ChangeManagementRequest changeManagementRequest = objectMapper.readValue(requestJsonUrl, ChangeManagementRequest.class);
+        changeManagementService.doChangeManagement(changeManagementRequest, "vidVnf");
+
+        ArgumentCaptor<String> endpointCaptor = ArgumentCaptor.forClass(String.class);
+        ArgumentCaptor<String> sourceIdCaptor = ArgumentCaptor.forClass(String.class);
+        ArgumentCaptor<Object> requestCaptor = ArgumentCaptor.forClass(Object.class);
+        ArgumentCaptor<Class> responseTypeCaptor = ArgumentCaptor.forClass(Class.class);
+        verify(restClientUnderTest).PostForObject(requestCaptor.capture(), sourceIdCaptor.capture(), endpointCaptor.capture(), responseTypeCaptor.capture());
+
+        org.onap.vid.changeManagement.RequestDetails expectedRequest = changeManagementRequest.getRequestDetails().get(0);
+
+        String serviceInstanceId = expectedRequest.getRelatedInstList().get(0).getRelatedInstance().instanceId;
+        ;
+        String vnfInstanceId = expectedRequest.getVnfInstanceId();
+        String regEx = String.format("/serviceInstances/v[0-9]+/%s/vnfs/%s/inPlaceSoftwareUpdate", serviceInstanceId, vnfInstanceId);
+        assertThat(endpointCaptor.getValue(), RegExMatcher.matchesRegEx(regEx));
+        assertThat(requestCaptor.getValue(), instanceOf(RequestDetails.class));
+        RequestDetails actualRequest = ((RequestDetails) requestCaptor.getValue());
+
+        assertThat(actualRequest.getCloudConfiguration().getTenantId(), equalTo(expectedRequest.getCloudConfiguration().getTenantId()));
+        assertThat(actualRequest.getCloudConfiguration().getLcpCloudRegionId(), equalTo(expectedRequest.getCloudConfiguration().getLcpCloudRegionId()));
+        assertThat(actualRequest.getRequestInfo(), equalTo(expectedRequest.getRequestInfo()));
+        assertThat(actualRequest.getRequestParameters(), equalTo(expectedRequest.getRequestParameters()));
+
+        URL expectedMsoRequestUrl = this.getClass().getResource("/services/change_management_software_update_expected_mso_request.json");
+        String expectedMsoRequestString = IOUtils.toString(expectedMsoRequestUrl, "UTF-8");
+        String actualRequestString = objectMapper.writeValueAsString(actualRequest);
+        try {
+            JSONAssert.assertEquals("built mso request is not ok", expectedMsoRequestString, actualRequestString, JSONCompareMode.NON_EXTENSIBLE);
+        } catch (AssertionError | Exception e) {
+            System.out.println("requestDetailsAsString: \n" + actualRequestString);
+            System.out.println("expected: \n" + expectedMsoRequestString);
+            throw e;
+        }
+
+    }
+
+    @Configuration
+    public static class TestMsoConfig extends MsoConfig {
+
+        @Override
+        public MsoRestClientNew getMsoClient() {
+            MsoRestClientNew spyClient = spy(new MsoRestClientNew());
+            return spyClient;
+        }
+
+        @Bean
+        public ChangeManagementService getChangeManagementService() {
+            return new ChangeManagementServiceImpl(null, getMsoBusinessLogic());
+        }
+    }
+}
diff --git a/vid-app-common/src/test/java/org/onap/vid/services/CsvServiceTest.java b/vid-app-common/src/test/java/org/onap/vid/services/CsvServiceTest.java
new file mode 100644
index 0000000..051a1cf
--- /dev/null
+++ b/vid-app-common/src/test/java/org/onap/vid/services/CsvServiceTest.java
@@ -0,0 +1,80 @@
+//package org.onap.vid.services;
+//import org.apache.commons.io.IOUtils;
+//import org.onap.vid.services.CsvServiceImpl;
+//import org.skyscreamer.jsonassert.JSONAssert;
+//import org.skyscreamer.jsonassert.JSONCompareMode;
+//import org.testng.Assert;
+//import org.testng.annotations.DataProvider;
+//import org.testng.annotations.Test;
+//import org.json.JSONObject;
+//
+//import javax.ws.rs.BadRequestException;
+//import java.io.IOException;
+//import java.lang.reflect.Method;
+//import java.net.URL;
+//import java.util.List;
+//
+//@Test
+//public class CsvServiceTest {
+//
+//    private CsvServiceImpl csvService = new CsvServiceImpl();
+//    private final static String CSV_FOLDER = "csv_files/{CSV_FILE}";
+//    private final static String VALID_CSV = "csv_to_json.csv";
+//    private final static String ONE_LINE_CSV = "one_line.csv";
+//    private final static String EMPTY_CSV = "empty_file.csv";
+//    private final static String MISSING_CONTENT_CSV = "missing_content.csv";
+//    private final static String MISSING_VALUES_CSV = "missing_values.csv";
+//
+//
+///*
+//    @Test
+//    public void parseValidCsv() throws IllegalAccessException, IOException, InstantiationException {
+//        String expectedJson = getExpectation("vnfConfigUpdatePayload.json");
+//        readAndParse(VALID_CSV,16,expectedJson);
+//
+//    }*/
+//
+//    private String getExpectation(String modelFileName) throws IOException {
+//        // load expected result
+//        final URL resource = this.getClass().getResource("/" + modelFileName);
+//        String expected = IOUtils.toString(resource, "UTF-8");
+//        return expected;
+//    }
+///*
+//    @Test
+//    public void parseOneLineCsv() throws IllegalAccessException, IOException, InstantiationException {
+//        String expectedJson ="{\"payload\":{\"request-parameters\":{\"vnf-name\":\"ibcx0099v\"}}}";
+//        readAndParse(ONE_LINE_CSV,1,expectedJson);
+//    }*/
+//
+//    @DataProvider
+//    public static Object[][] invalidFiles(Method test) {
+//        return new Object[][]{
+//                {MISSING_CONTENT_CSV}, {MISSING_VALUES_CSV}
+//        };
+//    }
+///*
+//    @Test(dataProvider = "invalidFiles", expectedExceptions = {BadRequestException.class}, expectedExceptionsMessageRegExp = "Invalid csv file")
+//    public void parseMissingContentCsv(String invalidFile) throws IllegalAccessException, IOException, InstantiationException {
+//        readAndParse(invalidFile, 2, null);
+//    }
+//
+//
+//    @Test
+//    public void parseEmptyCsv() throws IllegalAccessException, IOException, InstantiationException {
+//        String expectedJson ="{}";
+//        readAndParse(EMPTY_CSV,0,expectedJson);
+//    }
+//
+//    private void readAndParse(String fileName, int expectedNumRows, String expectedJson) throws IllegalAccessException, IOException, InstantiationException {
+//        final URL resource = CsvServiceTest.class.getClassLoader().getResource(CSV_FOLDER.replaceFirst("\\{CSV_FILE\\}", fileName));
+//        Assert.assertNotNull(resource, "The csv file was not found");
+//        List<String[]> content = csvService.readCsv(resource.getPath());
+//        Assert.assertEquals(content.size(), expectedNumRows, "The number of non-empty lines in file is wrong");
+//        JSONObject json = csvService.convertCsvToJson (content);
+//        JSONAssert.assertEquals(expectedJson, json, JSONCompareMode.STRICT);
+//
+//    }*/
+//
+//
+//}
diff --git a/vid-app-common/src/test/java/org/onap/vid/services/TestSuite.java b/vid-app-common/src/test/java/org/onap/vid/services/TestSuite.java
new file mode 100644
index 0000000..e434324
--- /dev/null
+++ b/vid-app-common/src/test/java/org/onap/vid/services/TestSuite.java
@@ -0,0 +1,11 @@
+package org.onap.vid.services;
+
+import org.junit.runner.RunWith;
+import org.junit.runners.Suite;
+
+@RunWith(Suite.class)
+@Suite.SuiteClasses(
+
+{ ChangeManagementServiceImplTest.class, ChangeManagementServiceTest.class })
+public class TestSuite { // nothing
+}
diff --git a/vid-app-common/src/test/java/org/onap/vid/testUtils/IntersectionTest.java b/vid-app-common/src/test/java/org/onap/vid/testUtils/IntersectionTest.java
new file mode 100644
index 0000000..c766d26
--- /dev/null
+++ b/vid-app-common/src/test/java/org/onap/vid/testUtils/IntersectionTest.java
@@ -0,0 +1,101 @@
+package org.onap.vid.testUtils;
+
+import org.junit.Assert;
+import org.junit.Test;
+import org.onap.vid.utils.Intersection;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * Created by moriya1 on 10/10/2017.
+ */
+public class IntersectionTest {
+
+    @Test
+    public void testFourArrays(){
+        List<String> l1 = new ArrayList<String>();
+        l1.add("1");
+        l1.add("2");
+
+        List<String> l2 = new ArrayList<String>();
+        l2.add("2");
+        l2.add("3");
+
+        List<String> l3 = new ArrayList<String>();
+        l3.add("2");
+        l3.add("4");
+
+        List<String> l4 = new ArrayList<String>();
+        l4.add("2");
+        l4.add("5");
+
+        List<List<String>> all = new ArrayList<>();
+        all.add(l1);
+        all.add(l2);
+        all.add(l3);
+        all.add(l4);
+        Intersection<String> m = new Intersection<>();
+        List<String> ans = m.intersectMultipileArray(all);
+        Assert.assertEquals(1,ans.size());
+        Assert.assertEquals(ans.get(0),"2");
+
+    }
+
+
+
+    @Test
+    public void testTwoArrays(){
+        List<String> l1 = new ArrayList<String>();
+        l1.add("1");
+        l1.add("2");
+
+        List<String> l2 = new ArrayList<String>();
+        l2.add("2");
+        l2.add("3");
+
+        List<List<String>> all = new ArrayList<>();
+        all.add(l1);
+        all.add(l2);
+        Intersection<String> m = new Intersection<>();
+        List<String> l3 = m.intersectMultipileArray(all);
+        Assert.assertEquals(l3.size(),1);
+        Assert.assertEquals(l3.get(0),"2");
+
+    }
+
+
+    @Test
+    public void testNoIntersection(){
+        List<String> l1 = new ArrayList<String>();
+        l1.add("1");
+        l1.add("2");
+
+        List<String> l2 = new ArrayList<String>();
+        l2.add("3");
+        l2.add("4");
+
+        List<List<String>> all = new ArrayList<>();
+        all.add(l1);
+        all.add(l2);
+        Intersection<String> m = new Intersection<>();
+        List<String> l3 = m.intersectMultipileArray(all);
+        Assert.assertEquals(l3.size(),0);
+
+    }
+
+    @Test
+    public void testOneArrays(){
+        List<String> l1 = new ArrayList<String>();
+        l1.add("1");
+        l1.add("2");
+        List<List<String>> all = new ArrayList<>();
+        all.add(l1);
+        Intersection<String> m = new Intersection<>();
+        List<String> l3 = m.intersectMultipileArray(all);
+        Assert.assertEquals(l3.size(),2);
+        Assert.assertEquals(l3.get(0),"1");
+        Assert.assertEquals(l3.get(1),"2");
+
+    }
+}
diff --git a/vid-app-common/src/test/java/org/onap/vid/testUtils/RegExMatcher.java b/vid-app-common/src/test/java/org/onap/vid/testUtils/RegExMatcher.java
new file mode 100644
index 0000000..c88c8a8
--- /dev/null
+++ b/vid-app-common/src/test/java/org/onap/vid/testUtils/RegExMatcher.java
@@ -0,0 +1,29 @@
+package org.onap.vid.testUtils;
+
+import org.hamcrest.Description;
+import org.hamcrest.TypeSafeMatcher;
+
+public class RegExMatcher extends TypeSafeMatcher<String> {
+
+    private final String regEx;
+
+    public RegExMatcher(String regEx) {
+        this.regEx = regEx;
+    }
+
+
+    @Override
+    public void describeTo(Description description) {
+        description.appendText("matches regEx="+regEx);
+    }
+
+
+    @Override
+    protected boolean matchesSafely(String item) {
+        return item.matches(regEx);
+    }
+
+    public static RegExMatcher matchesRegEx(final String regEx) {
+        return new RegExMatcher(regEx);
+    }
+}
diff --git a/vid-app-common/src/test/java/org/onap/vid/testUtils/TestUtils.java b/vid-app-common/src/test/java/org/onap/vid/testUtils/TestUtils.java
new file mode 100644
index 0000000..73a79cd
--- /dev/null
+++ b/vid-app-common/src/test/java/org/onap/vid/testUtils/TestUtils.java
@@ -0,0 +1,68 @@
+package org.onap.vid.testUtils;
+
+import org.json.JSONArray;
+import org.json.JSONObject;
+import org.junit.Assert;
+
+import java.util.Iterator;
+
+import static fj.parser.Parser.fail;
+
+/**
+ * Created by Oren on 6/7/17.
+ */
+public class TestUtils {
+
+    /**
+     * The method compares between two jsons. the function assert that the actual object does not reduce or change the functionallity/parsing of the expected json.
+     * This means that if the expected JSON has a key which is null or the JSON doesn't have a key which contained in the expected JSON the assert will succeed and the will pass.
+     * For example : For JSON expected = {a:null} and actual {a:3} the test will pass
+     * Other example : For JSON expected = {a:3} and actual {a:null} the test will fail
+     *
+     * @param expected JSON
+     * @param actual JSON
+     */
+    public static void assertJsonStringEqualsIgnoreNulls(String expected, String actual) {
+        if (expected == null || expected == JSONObject.NULL) {return;}
+
+        JSONObject expectedJSON = new JSONObject(expected);
+        JSONObject actualJSON = new JSONObject(actual);
+        Iterator<?> keys = expectedJSON.keys();
+
+        while( keys.hasNext() ) {
+            String key = (String)keys.next();
+            Object expectedValue = expectedJSON.get(key);
+            if (expectedValue == JSONObject.NULL){
+                continue;
+            }
+
+            Object actualValue = actualJSON.get(key);
+
+            if (expectedValue instanceof JSONObject) {
+                String expectedVal = expectedValue.toString();
+                String actualVal = actualValue.toString();
+                assertJsonStringEqualsIgnoreNulls(expectedVal, actualVal);
+            }
+            else if (expectedValue instanceof JSONArray) {
+                if (actualValue instanceof JSONArray) {
+                    JSONArray expectedJSONArray = (JSONArray)expectedValue;
+                    JSONArray actualJSONArray = (JSONArray)actualValue;
+                    for (int i = 0; i < expectedJSONArray.length(); i++) {
+                        String expectedItem = expectedJSONArray.get(i).toString();
+                        String actualItem = actualJSONArray.get(i).toString();
+                        if (expectedValue instanceof JSONObject)
+                            assertJsonStringEqualsIgnoreNulls(expectedItem, actualItem);
+                    }
+                }
+                else {
+                    fail("expected: " + expectedValue + " got:" + actualValue);
+                }
+            }
+            else {
+                Assert.assertEquals(expectedValue, actualValue);
+            }
+        }
+    }
+
+
+}
diff --git a/vid-app-common/src/test/java/org/opencomp/vid/controller/MsoControllerTest.java b/vid-app-common/src/test/java/org/opencomp/vid/controller/MsoControllerTest.java
deleted file mode 100644
index 731668d..0000000
--- a/vid-app-common/src/test/java/org/opencomp/vid/controller/MsoControllerTest.java
+++ /dev/null
@@ -1,112 +0,0 @@
-package org.opencomp.vid.controller;
-
-import com.fasterxml.jackson.databind.ObjectMapper;
-import com.fasterxml.jackson.databind.SerializationFeature;
-import org.apache.commons.lang.StringEscapeUtils;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.openecomp.portalsdk.core.util.SystemProperties;
-import org.openecomp.vid.controller.MsoConfig;
-import org.openecomp.vid.controller.MsoController;
-import org.openecomp.vid.domain.mso.RequestInfo;
-import org.openecomp.vid.factories.MsoRequestFactory;
-import org.openecomp.vid.mso.rest.*;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.http.ResponseEntity;
-import org.springframework.test.context.ContextConfiguration;
-import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
-import org.springframework.test.context.web.WebAppConfiguration;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import static org.junit.Assert.assertEquals;
-
-@RunWith(SpringJUnit4ClassRunner.class)
-@WebAppConfiguration
-@ContextConfiguration(classes = {SystemProperties.class , MsoConfig.class})
-public class MsoControllerTest {
-
-    @Autowired
-    MsoRequestFactory msoRequestFactory;
-
-    //@Test
-    public void testInstanceCreationNew() throws Exception {
-
-        RequestDetails requestDetails = msoRequestFactory.createMsoRequest("msoRequest.json");
-        MsoController msoController = new MsoController();
-        ResponseEntity<String> responseEntityNew = msoController.createSvcInstanceNew(null, requestDetails);
-        ResponseEntity<String> responseEntity = msoController.createSvcInstance(null, requestDetails);
-        assertEquals(responseEntityNew, responseEntity);
-
-    }
-
-    //@Test
-    public void testInstanceCreationLocalWithRest() throws Exception {
-
-        RequestDetails requestDetails = msoRequestFactory.createMsoRequest("msoRequest.json");
-        MsoController msoController = new MsoController();
-        ResponseEntity<String> responseEntityNew = msoController.createSvcInstance(null, requestDetails);
-        ResponseEntity<String> responseEntityRest = msoController.createSvcInstanceNewRest(null, requestDetails);
-
-        assertEquals(responseEntityNew.getBody(), responseEntityRest.getBody());
-
-    }
-
-    //@Test
-    public void testInstanceCreation() throws Exception {
-
-        RequestDetails requestDetails = msoRequestFactory.createMsoRequest("msoRequest.json");
-        MsoController msoController = new MsoController();
-        ResponseEntity<String> responseEntity = msoController.createSvcInstance(null, requestDetails);
-
-
-        assertEquals(responseEntity.getBody(), "{ \"status\": 200, \"entity\": {\n" +
-                "  \"requestReferences\": {\n" +
-                "    \"instanceId\": \"ba00de9b-3c3e-4b0a-a1ad-0c5489e711fb\",\n" +
-                "    \"requestId\": \"311cc766-b673-4a50-b9c5-471f68914586\"\n" +
-                "  }\n" +
-                "}}");
-
-    }
-
-    @Test
-    public void testGetOrchestrationRequestsForDashboard() throws Exception{
-        MsoController msoController = new MsoController();
-        List<Request> orchestrationRequestsForDashboard = msoController.getOrchestrationRequestsForDashboard();
-
-        assertEquals(orchestrationRequestsForDashboard.size() , 2);
-    }
-
-    @Test
-    public void testGetManualTasksByRequestId() throws Exception{
-        MsoController msoController = new MsoController();
-        List<Task> orchestrationRequestsForDashboard = msoController.getManualTasksByRequestId("za1234d1-5a33-55df-13ab-12abad84e335");
-
-        assertEquals(orchestrationRequestsForDashboard.get(0).getTaskId() , "daf4dd84-b77a-42da-a051-3239b7a9392c");
-    }
-
-
-    public void testCompleteManualTask() throws Exception{ // TODO not done yet
-        RequestInfo requestInfo = new RequestInfo();
-        requestInfo.setResponseValue("rollback");
-        requestInfo.setRequestorId("abc");
-        requestInfo.setSource("VID");
-        RequestDetails requestDetails = new RequestDetails();
-        requestDetails.setRequestInfo(requestInfo);
-        MsoController msoController = new MsoController();
-        ResponseEntity<String> responseEntity = msoController.manualTaskComplete("daf4dd84-b77a-42da-a051-3239b7a9392c" , requestDetails);
-        String assertString = "{ \\\"status\\\": 200, \\\"entity\\\": {\\n\" +\n" +
-                "                \"  \\\"taskRequestReference\\\": {\\n\" +\n" +
-                "                \"     \\\"taskId\\\": \\\"daf4dd84-b77a-42da-a051-3239b7a9392c\\\"\\n\" +\n" +
-                "                \"      }\\n\" +\n" +
-                "                \"}\\n\" +\n" +
-                "                \"}";
-        assertEquals(responseEntity.getBody() , StringEscapeUtils.unescapeJava(assertString));
-    }
-
-
-
-
-
-}
diff --git a/vid-app-common/src/test/java/org/opencomp/vid/controller/ToscaParserMockHelper.java b/vid-app-common/src/test/java/org/opencomp/vid/controller/ToscaParserMockHelper.java
deleted file mode 100644
index a9a902b..0000000
--- a/vid-app-common/src/test/java/org/opencomp/vid/controller/ToscaParserMockHelper.java
+++ /dev/null
@@ -1,42 +0,0 @@
-package org.opencomp.vid.controller;
-
-import org.openecomp.vid.model.NewServiceModel;
-
-/**
- * Created by moriya1 on 04/07/2017.
- */
-public class ToscaParserMockHelper {
-
-    private String uuid;
-    private String filePath;
-    private NewServiceModel newServiceModel;
-
-    public ToscaParserMockHelper(String uuid, String filePath) {
-        this.uuid = uuid;
-        this.filePath = filePath;
-    }
-
-    public String getUuid() {
-        return uuid;
-    }
-
-    public void setUuid(String uuid) {
-        this.uuid = uuid;
-    }
-
-    public String getFilePath() {
-        return filePath;
-    }
-
-    public void setFilePath(String filePath) {
-        this.filePath = filePath;
-    }
-
-    public NewServiceModel getNewServiceModel() {
-        return newServiceModel;
-    }
-
-    public void setNewServiceModel(NewServiceModel newServiceModel) {
-        this.newServiceModel = newServiceModel;
-    }
-}
diff --git a/vid-app-common/src/test/java/org/opencomp/vid/controller/VidControllerTest.java b/vid-app-common/src/test/java/org/opencomp/vid/controller/VidControllerTest.java
deleted file mode 100644
index 8596cf3..0000000
--- a/vid-app-common/src/test/java/org/opencomp/vid/controller/VidControllerTest.java
+++ /dev/null
@@ -1,201 +0,0 @@
-package org.opencomp.vid.controller;
-
-import net.javacrumbs.jsonunit.JsonAssert;
-import org.apache.commons.io.IOUtils;
-import org.codehaus.jackson.map.ObjectMapper;
-import org.junit.Assert;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.openecomp.portalsdk.core.util.SystemProperties;
-import org.openecomp.sdc.tosca.parser.api.ISdcCsarHelper;
-import org.openecomp.sdc.tosca.parser.exceptions.SdcToscaParserException;
-import org.openecomp.sdc.tosca.parser.impl.SdcToscaParserFactory;
-import org.openecomp.sdc.tosca.parser.impl.SdcTypes;
-import org.openecomp.vid.aai.AaiClient;
-import org.openecomp.vid.aai.AaiResponse;
-import org.openecomp.vid.asdc.AsdcCatalogException;
-import org.openecomp.vid.asdc.AsdcClient;
-import org.openecomp.vid.asdc.parser.ToscaParserImpl2;
-import org.openecomp.vid.controller.WebConfig;
-import org.openecomp.vid.model.*;
-import org.openecomp.vid.properties.AsdcClientConfiguration;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.test.context.ContextConfiguration;
-import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
-import org.springframework.test.context.web.WebAppConfiguration;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.nio.file.Path;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.UUID;
-
-import javax.servlet.ServletContext;
-
-import static org.opencomp.vid.testUtils.TestUtils.assertJsonStringEqualsIgnoreNulls;
-
-@RunWith(SpringJUnit4ClassRunner.class)
-@ContextConfiguration(classes = {WebConfig.class, AsdcClientConfiguration.class,SystemProperties.class })
-@WebAppConfiguration
-
-public class VidControllerTest {
-
-	@Autowired
-	private AsdcClient asdcClient;
-	
-    @Autowired
-    ServletContext context;
-    public class Constants{
-        public static final String vfUuid = "48a52540-8772-4368-9cdb-1f124ea5c931";
-        public static final String vlUuid = "68101369-6f08-4e99-9a28-fa6327d344f3";
-        public static final String PNFUuid = "73e1322a-8a9a-49dc-9558-b0c5c5770e4a";
-        public static final String vfFilePath = "vf-csar.JSON";
-        public static final String vlFilePath = "vl-csar.JSON";
-        public static final String PNFFilePath = "/vid_internal/vid-app-common/src/main/resources/pnf.csar";
-    }
-
-    private ToscaParserImpl2 p2 = new ToscaParserImpl2();
-    private ObjectMapper om = new ObjectMapper();
-
-    
-    @Test
-    public void test() {
-    	AaiClient client = new AaiClient(context);
-    	AaiResponse<?> response = client.getVNFData();
-    	 try {
-			System.out.println(new ObjectMapper().writeValueAsString(response));
-		} catch (IOException e) {
-			// TODO Auto-generated catch block
-			e.printStackTrace();
-		}
-    }
-    
-    @Test
-    public void checkPNFFieldsExist() throws SdcToscaParserException, AsdcCatalogException {
-        String serviceRoleString = "serviceRole";
-        String serviceTypeString = "serviceType";
-
-        SdcToscaParserFactory factory = SdcToscaParserFactory.getInstance();
-        ISdcCsarHelper sdcCsarHelper = factory.getSdcCsarHelper(getCsarPath(Constants.PNFUuid).toString());
-        List<org.openecomp.sdc.toscaparser.api.NodeTemplate> pnfs = sdcCsarHelper.getServiceNodeTemplateBySdcType(SdcTypes.PNF);
-        Assert.assertEquals(sdcCsarHelper.getServiceMetadata().getValue(serviceTypeString).toLowerCase(),"transport");
-        Assert.assertEquals(sdcCsarHelper.getServiceMetadata().getValue(serviceRoleString).toLowerCase(),"pnf");
-        Assert.assertTrue(pnfs.size()>0);
-
-    }
-
-
-    @Test
-    public void assertEqualsBetweenServices() throws Exception {
-        for (ToscaParserMockHelper mockHelper: getExpectedServiceModel()) {
-            Service expectedService = mockHelper.getNewServiceModel().getService();
-            Service actualService = p2.makeServiceModel(getCsarPath(mockHelper.getUuid()), getServiceByUuid(mockHelper.getUuid())).getService();
-            JsonAssert.assertJsonEquals(expectedService, actualService);
-        }
-    }
-
-    //@Test
-  	// bug in SDC tosca filterNodeTemplatePropertiesByValue
-	public void assertEqualBetweenObjects() throws Exception {
-		for (ToscaParserMockHelper mockHelper: getExpectedServiceModel()) {
-			ServiceModel actualServiceModel = p2.makeServiceModel(getCsarPath(mockHelper.getUuid()), getServiceByUuid(mockHelper.getUuid()));
-			JsonAssert.assertJsonEquals(mockHelper.getNewServiceModel(), actualServiceModel);
-			/*java.lang.AssertionError: JSON documents are different:
-			Different keys found in node "networks.ExtVL 0.commands". Expected [exVL_naming#naming_policy, network_role, network_scope], got [network_role, network_scope]. Missing: "networks.ExtVL 0.commands.exVL_naming#naming_policy"
-			Different keys found in node "networks.ExtVL 0.inputs". Expected [exVL_naming#naming_policy, network_role, network_scope], got [network_role, network_scope]. Missing: "networks.ExtVL 0.inputs.exVL_naming#naming_policy"*/
-		}
-	}
-
-	@Test
-	public void assertEqualsBetweenNetworkNodes() throws Exception {
-		for (ToscaParserMockHelper mockHelper: getExpectedServiceModel()) {
-			Map<String, Network> expectedNetworksMap = mockHelper.getNewServiceModel().getNetworks();
-			Map<String, Network> actualNetworksMap = p2.makeServiceModel(getCsarPath(mockHelper.getUuid()), getServiceByUuid(mockHelper.getUuid())).getNetworks();
-			for (Map.Entry<String, Network> entry : expectedNetworksMap.entrySet()) {
-				Network expectedNetwork = entry.getValue();
-				Network actualNetwork = actualNetworksMap.get(entry.getKey());
-				Assert.assertEquals(expectedNetwork.getModelCustomizationName(), actualNetwork.getModelCustomizationName());
-				verifyBaseNodeProperties(expectedNetwork, actualNetwork);
-				compareProperties(expectedNetwork.getProperties(), actualNetwork.getProperties());
-			}
-		}
-	}
-
-	//Because we are not supporting the old flow, the JSON are different by definition.
-	@Test
-	public void assertEqualsBetweenVnfsOfTosca() throws Exception {
-		for (ToscaParserMockHelper mockHelper: getExpectedServiceModel()) {
-			Map<String, VNF> expectedVnfsMap = mockHelper.getNewServiceModel().getVnfs();
-			Map<String, VNF> actualVnfsMap = p2.makeServiceModel(getCsarPath(mockHelper.getUuid()), getServiceByUuid(mockHelper.getUuid())).getVnfs();
-			for (Map.Entry<String, VNF> entry : expectedVnfsMap.entrySet()) {
-				VNF expectedVnf = entry.getValue();
-				VNF actualVnf = actualVnfsMap.get(entry.getKey());
-				verifyBaseNodeProperties(expectedVnf, actualVnf);
-				Assert.assertEquals(expectedVnf.getModelCustomizationName(), actualVnf.getModelCustomizationName());
-				compareProperties(expectedVnf.getProperties(), actualVnf.getProperties());
-				assertJsonStringEqualsIgnoreNulls(om.writeValueAsString(expectedVnf), om.writeValueAsString(actualVnf));
-			}
-		}
-	}
-
-	@Test
-	public void assertEqualsBetweenVolumeGroups() throws Exception {
-		for (ToscaParserMockHelper mockHelper: getExpectedServiceModel()) {
-			Path cSarPath = getCsarPath(mockHelper.getUuid());
-			Map<String, VolumeGroup> actualVolumeGroups = new HashMap<>();
-			if(cSarPath != null) {
-				actualVolumeGroups = p2.makeServiceModel(cSarPath, getServiceByUuid(mockHelper.getUuid())).getVolumeGroups();
-			}
-			Map<String, VolumeGroup> expectedVolumeGroups = mockHelper.getNewServiceModel().getVolumeGroups();
-			JsonAssert.assertJsonEquals(actualVolumeGroups, expectedVolumeGroups);
-		}
-	}
-
-	@Test
-	public void assertEqualsBetweenVfModules() throws Exception {
-		for (ToscaParserMockHelper mockHelper: getExpectedServiceModel()) {
-			Map<String, VfModule> actualVfModules = p2.makeServiceModel(getCsarPath(mockHelper.getUuid()), getServiceByUuid(mockHelper.getUuid())).getVfModules();
-			Map<String, VfModule> expectedVfModules = mockHelper.getNewServiceModel().getVfModules();
-			JsonAssert.assertJsonEquals(actualVfModules, expectedVfModules);
-		}
-	}
-
-	private void verifyBaseNodeProperties(Node expectedNode, Node actualNode) {
-		Assert.assertEquals(expectedNode.getName(), actualNode.getName());
-		Assert.assertEquals(expectedNode.getCustomizationUuid(), actualNode.getCustomizationUuid());
-		Assert.assertEquals(expectedNode.getDescription(), actualNode.getDescription());
-		Assert.assertEquals(expectedNode.getInvariantUuid(), actualNode.getInvariantUuid());
-		Assert.assertEquals(expectedNode.getUuid(), actualNode.getUuid());
-		Assert.assertEquals(expectedNode.getVersion(), actualNode.getVersion());
-	}
-
-	private void compareProperties(Map<String, String> expectedProperties, Map<String, String> actualProperties) {
-		for (Map.Entry<String, String> property : expectedProperties.entrySet()) {
-			String expectedValue = property.getValue();
-			String key = property.getKey();
-			String actualValue = actualProperties.get(key);
-			Assert.assertEquals(expectedValue, actualValue);
-		}
-	}
-
-	private ToscaParserMockHelper[] getExpectedServiceModel() throws IOException {
-		ToscaParserMockHelper[] mockHelpers = {new ToscaParserMockHelper(Constants.vlUuid, Constants.vlFilePath), new ToscaParserMockHelper(Constants.vfUuid, Constants.vfFilePath)};
-		for(ToscaParserMockHelper mockHelper: mockHelpers) {
-			InputStream jsonFile = VidControllerTest.class.getClassLoader().getResourceAsStream(mockHelper.getFilePath());
-			String expectedJsonAsString = IOUtils.toString(jsonFile).toString();
-			NewServiceModel newServiceModel1 = om.readValue(expectedJsonAsString, NewServiceModel.class);
-			mockHelper.setNewServiceModel(newServiceModel1);
-		}
-		return mockHelpers;
-	}
-
-	private Path getCsarPath(String uuid) throws AsdcCatalogException {
-		return asdcClient.getServiceToscaModel(UUID.fromString(uuid));
-	}
-
-	private org.openecomp.vid.asdc.beans.Service getServiceByUuid(String uuid) throws AsdcCatalogException {
-		return asdcClient.getService(UUID.fromString(uuid));
-	}
-}
\ No newline at end of file
diff --git a/vid-app-common/src/test/java/org/opencomp/vid/testUtils/TestUtils.java b/vid-app-common/src/test/java/org/opencomp/vid/testUtils/TestUtils.java
deleted file mode 100644
index 29115e0..0000000
--- a/vid-app-common/src/test/java/org/opencomp/vid/testUtils/TestUtils.java
+++ /dev/null
@@ -1,65 +0,0 @@
-package org.opencomp.vid.testUtils;
-
-import org.json.JSONArray;
-import org.json.JSONObject;
-import org.junit.Assert;
-
-import java.util.Iterator;
-
-import static fj.parser.Parser.fail;
-
-/**
- * Created by Oren on 6/7/17.
- */
-public class TestUtils {
-
-    /**
-     * The method compares between two jsons. the function assert that the actual object does not reduce or change the functionallity/parsing of the expected json.
-     * This means that if the expected JSON has a key which is null or the JSON doesn't have a key which contained in the expected JSON the assert will succeed and the will pass.
-     * For example : For JSON expected = {a:null} and actual {a:3} the test will pass
-     * Other example : For JSON expected = {a:3} and actual {a:null} the test will fail
-     *
-     * @param expected JSON
-     * @param actual JSON
-     */
-    public static void assertJsonStringEqualsIgnoreNulls(String expected, String actual) {
-        if (expected == null || expected == JSONObject.NULL) {return;}
-
-        JSONObject expectedJSON = new JSONObject(expected);
-        JSONObject actualJSON = new JSONObject(actual);
-        Iterator<?> keys = expectedJSON.keys();
-
-        while( keys.hasNext() ) {
-            String key = (String)keys.next();
-            Object expectedValue = expectedJSON.get(key);
-            if (expectedValue == JSONObject.NULL){
-                continue;
-            }
-
-            Object actualValue = actualJSON.get(key);
-
-            if (expectedValue instanceof JSONObject) {
-                String expectedVal = expectedValue.toString();
-                String actualVal = actualValue.toString();
-                assertJsonStringEqualsIgnoreNulls(expectedVal, actualVal);
-            }
-            else if (expectedValue instanceof JSONArray) {
-                if (actualValue instanceof JSONArray) {
-                    JSONArray expectedJSONArray = (JSONArray)expectedValue;
-                    JSONArray actualJSONArray = (JSONArray)expectedValue;
-                    for (int i = 0; i < expectedJSONArray.length(); i++) {
-                        String expectedItem = expectedJSONArray.getJSONObject(i).toString();
-                        String actualItem = actualJSONArray.getJSONObject(i).toString();
-                        assertJsonStringEqualsIgnoreNulls(expectedItem, actualItem);
-                    }
-                }
-                else {
-                    fail("expected: " + expectedValue + " got:" + actualValue);
-                }
-            }
-            else {
-                Assert.assertEquals(expectedValue, actualValue);
-            }
-        }
-    }
-}
diff --git a/vid-app-common/src/test/java/org/openecomp/aai/util/JettyObfuscationConversionCommandLineUtilTest.java b/vid-app-common/src/test/java/org/openecomp/aai/util/JettyObfuscationConversionCommandLineUtilTest.java
deleted file mode 100644
index f72a282..0000000
--- a/vid-app-common/src/test/java/org/openecomp/aai/util/JettyObfuscationConversionCommandLineUtilTest.java
+++ /dev/null
@@ -1,21 +0,0 @@
-package org.openecomp.aai.util;
-
-import org.junit.Test;
-
-public class JettyObfuscationConversionCommandLineUtilTest {
-
-	private JettyObfuscationConversionCommandLineUtil createTestSubject() {
-		return new JettyObfuscationConversionCommandLineUtil();
-	}
-
-	
-	@Test
-	public void testMain() throws Exception {
-		String[] args = new String[] { "" };
-
-		// default test
-		JettyObfuscationConversionCommandLineUtil.main(args);
-	}
-
-	
-}
\ No newline at end of file
diff --git a/vid-app-common/src/test/java/org/openecomp/aai/util/TestSuite.java b/vid-app-common/src/test/java/org/openecomp/aai/util/TestSuite.java
deleted file mode 100644
index f7d57ad..0000000
--- a/vid-app-common/src/test/java/org/openecomp/aai/util/TestSuite.java
+++ /dev/null
@@ -1,11 +0,0 @@
-package org.openecomp.aai.util;
-
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-
-@RunWith(Suite.class)
-@Suite.SuiteClasses(
-
-{  JettyObfuscationConversionCommandLineUtilTest.class })
-public class TestSuite { // nothing
-}
diff --git a/vid-app-common/src/test/java/org/openecomp/ecomp/vid/selenium/FirstClass.java b/vid-app-common/src/test/java/org/openecomp/ecomp/vid/selenium/FirstClass.java
deleted file mode 100755
index ed06994..0000000
--- a/vid-app-common/src/test/java/org/openecomp/ecomp/vid/selenium/FirstClass.java
+++ /dev/null
@@ -1,606 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * VID
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *      http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.ecomp.vid.selenium;
-
-import org.testng.annotations.AfterClass;
-import org.testng.annotations.AfterMethod;
-import org.testng.annotations.AfterSuite;
-import org.testng.annotations.BeforeClass;
-import org.testng.annotations.BeforeMethod;
-import org.testng.annotations.BeforeSuite;
-import org.testng.annotations.BeforeTest;
-import org.testng.annotations.Test;
-
-
-import org.openqa.selenium.By;
-import org.openqa.selenium.WebDriver;
-import org.openqa.selenium.WebElement;
-import org.openqa.selenium.firefox.FirefoxDriver;
-import org.openqa.selenium.ie.InternetExplorerDriver;
-import org.openqa.selenium.support.ui.Select;
-
-import java.io.FileInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.List;
-import java.util.Properties;
-import java.util.concurrent.TimeUnit;
-import org.apache.log4j.Logger;
-import org.testng.Assert;
-import org.testng.asserts.*;
-
-/**
- * The Class FirstClass.
- */
-public class FirstClass {
-	
-		/** The login button. */
-		WebElement loginButton;
-		
-		/** The eg. */
-		String eg;
-		
-		/** The login. */
-		WebElement login;
-		
-		/** The pwd. */
-		WebElement pwd;
-		
-		/** The log. */
-		Logger log;
-		
-		/** The errormessage. */
-		WebElement errormessage;
-		
-					
-		/** The driver. */
-		WebDriver driver=new FirefoxDriver();
-		
-		
-		
-		/** The config prop. */
-		private final Properties configProp = new Properties();
-		
-		
-		/**
-		 * Instantiates a new first class.
-		 */
-		private  FirstClass() {
-			// TODO Auto-generated constructor stub
-			//
-			try{
-			//	InputStream input =this.getClass().getClassLoader().getResourceAsStream("objectmap.properties");
-			//FileInputStream input1 = new FileInputStream("objectmap.properties");
-				
-			InputStream input =new FileInputStream("objectconfig.properties");
-			System.out.println("Read all properties from file");
-			configProp.load(input);
-			System.out.println("Read all properties from file completed");
-			}
-			catch(IOException e) {
-				
-				e.printStackTrace();
-			}
-		}
-		
-		
-		/*
-		
-		
-		@BeforeClass
-		public void setUp() {
-			System.out.println("*******************");
-			System.out.println("launching IE browser");
-			System.setProperty("webdriver.ie.driver", driverPath+"IEDriverServer.exe");
-			driver = new InternetExplorerDriver();
-			driver.findElement(By.className());
-			driver.manage().window().maximize();
-			
-
-			 login = driver.findElement(By.xpath("//input[@class='fn-ebz-text ng-pristine ng-valid']"));
-			 pwd = driver.findElement(By.xpath("//input[@class='span3 ng-pristine ng-valid']"));
-			 loginButton = driver.findElement(By.id("loginBtn"));
-		}
-		
-		
-	*/
-		/**
-		 * Sets the up.
-		 */
-		// TODO Auto-generated method stub
-		@BeforeClass
-		public void setUp()
-		{
-			
-						
-			//WebDriver driver=new FirefoxDriver();
-			
-			log = Logger.getLogger(FirstClass.class.getName());
-		
-		
-		
-		// Get url
-		driver.get(configProp.getProperty("baseURL"));
-		driver.manage().window().maximize();
-		
-		
-		 login = driver.findElement(By.xpath(configProp.getProperty("login")));
-		 
-		 pwd = driver.findElement(By.xpath(configProp.getProperty("pwd")));
-		 loginButton = driver.findElement(By.id(configProp.getProperty("loginButton")));
-		}
-		
-		
-		/**
-		 * Empty username password.
-		 */
-		@Test(priority=1)
-		public void emptyUsernamePassword()
-		{
-		
-			
-		//User Name and Password field is empty
-		log.info("-----VID-11 TC-8----Username and password empty");
-		loginButton.click();
-		errormessage=driver.findElement(By.xpath("//*[@id='errorInfo']/span"));
-		String errmsg= errormessage.getText();
-		//System.out.println("Error message is"+errmsg);
-		//String expected = "Invaild username or password, Please try again";
-		
-		//Assert.assertEquals(errmsg,expected);
-
-		Boolean str = driver.getPageSource().contains("Invalid username or password, Please try again");
-		System.out.println(driver.getPageSource().contains("Invalid username or password, Please try again"));
-		
-		if(str==true)
-		{
-			log.info("Error message validated");
-			log.info("VID-11 TC-8 PASSED");
-			
-		}else
-			log.error("Failed validation");
-		
-		}
-
-
-		
-		/**
-		 * Invalid user name.
-		 */
-		@Test(priority=2)
-		public void invalidUserName()
-		{
-		
-		log.info("-----VID-11 TC-6----Invalid Username and Valid Password");
-		
-		
-		login.sendKeys("xxx");
-		pwd.sendKeys("abc123");
-		loginButton.click();
-		try {
-			Thread.sleep(5000);
-		} catch (InterruptedException e) {
-			// TODO Auto-generated catch block
-			e.printStackTrace();
-		}
-		
-		String errmsg= errormessage.getText();
-		String expected = "Invalid username or password, Please try again";
-		Assert.assertEquals(errmsg,expected);
-		//Boolean str1 = driver.getPageSource().contains("Invalid username or password, Please try again");
-		//System.out.print(str1);
-		
-		log.info("VID-11 TC-6 PASSED");
-				
-		}
-		
-		
-		/**
-		 * Invalid password.
-		 */
-		@Test(priority=3)
-		public void invalidPassword()
-		{
-		log.info("-----VID-11 TC-7----Valid Username and Invalid Password");
-		//  Valid user name and Invalid password.
-				login.clear();
-				pwd.clear();
-				login.sendKeys("testuser");
-				pwd.sendKeys("xxx");
-				loginButton.click();
-				driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
-		
-				
-				String errmsg= errormessage.getText();
-				String expected = "Invalid username or password, Please try again";
-				Assert.assertEquals(errmsg,expected);
-				
-				//Boolean str2 = driver.getPageSource().contains("Invaild username or password, Please try again");
-				//System.out.print(str2);
-				
-				log.info("VID-11 TC-7 PASSED");
-		}
-		
-			
-		/**
-		 * Login successful.
-		 */
-		@Test(priority=4)
-		public void loginSuccessful()
-		{
-		log.info("-----VID-11 TC-1----Valid Username and Valid Password");
-		//Login with valid user name and password.
-		login.clear();
-		login.sendKeys("su");
-		pwd.clear();
-		pwd.sendKeys("fusion");
-		
-				
-		loginButton.click();
-		driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
-		
-		try {
-			Thread.sleep(6000);
-		} catch (InterruptedException e) {
-			// TODO Auto-generated catch block
-			e.printStackTrace();
-		}
-		Assert.assertTrue(driver.getPageSource().contains("Search Existing Service Instances"));
-		log.info("VID-11 TC-1 PASSED");
-		
-		}
-		
-		
-		/**
-		 * Verify home page elements left pane.
-		 */
-		@Test(priority=5)
-		public void verifyHomePageElementsLeftPane()
-		
-		{
-			
-			
-			log.info("VID-10 TC 1 ");
-			//VID Home
-			log.info("VID 11 TC-2");
-			driver.findElement(By.xpath("html/body/div[1]/div[1]/div/div/div[2]/div/div/div[1]/div/div/accordion/div/div[1]/a/span")).isDisplayed();
-			//Create New Service Instance
-			driver.findElement(By.xpath("html/body/div[1]/div[1]/div/div/div[2]/div/div/div[1]/div/div/accordion/div/div[2]/a/span")).isDisplayed();
-			
-			//Browse Service Type
-			driver.findElement(By.xpath("html/body/div[1]/div[1]/div/div/div[2]/div/div/div[1]/div/div/accordion/div/div[3]/a/span")).isDisplayed();
-			//View Log		
-			driver.findElement(By.xpath("html/body/div[1]/div[1]/div/div/div[2]/div/div/div[1]/div/div/accordion/div/div[4]/a/span")).isDisplayed();
-			
-			//Profile
-			driver.findElement(By.xpath("html/body/div[1]/div[1]/div/div/div[2]/div/div/div[1]/div/div/accordion/div/div[5]/a/span")).isDisplayed();
-			//Admin
-			driver.findElement(By.xpath("html/body/div[1]/div[1]/div/div/div[2]/div/div/div[1]/div/div/accordion/div/div[6]/a/span")).isDisplayed();
-			//Logout
-			driver.findElement(By.xpath("html/body/div[1]/div[1]/div/div/div[2]/div/div/div[1]/div/div/accordion/div/div[7]/a/span")).isDisplayed();
-			
-			//Infrastructure Subscriber Name
-			driver.findElement(By.xpath(".//*[@id='mContent']/div/div/table/tbody/tr[1]/td[1]/div/label")).isDisplayed();
-			//Infrastructure Subscriber Name Select Drop down
-			driver.findElement(By.xpath(".//*[@id='mContent']/div/div/table/tbody/tr[1]/td[2]/div/select")).isDisplayed();
-			//Infrastructure Service Type
-			driver.findElement(By.xpath(".//*[@id='mContent']/div/div/table/tbody/tr[2]/td[1]/div/label")).isDisplayed();
-			//Infrastructure Service Type Select Drop down
-			driver.findElement(By.xpath(".//*[@id='mContent']/div/div/table/tbody/tr[2]/td[2]/div/select")).isDisplayed();
-			//Submit button 
-			driver.findElement(By.xpath(".//*[@id='mContent']/div/div/table/tbody/tr[3]/td/div/button")).isDisplayed();
-			
-			//Login Snippet Icon
-			driver.findElement(By.xpath(".//*[@class='icon-user-small login-snippet-icon']")).isDisplayed();
-			
-			
-			//String bodyText = driver.findElement(By.tagName("body")).getText();
-			//Assert.assertTrue("Text not found!", bodyText.contains("Search Existing Service Instances"));
-			//Assert.IsTrue(driver.getPageSource.Contains("Search Existing Service Instances"));
-			 
-			log.info("VID-12 TC-1");
-			Assert.assertTrue(driver.getPageSource().contains("Search Existing Service Instances"));
-			Assert.assertTrue(driver.getPageSource().contains("Please search by the Subscriber name or Service Type from below:"));
-			log.info("VID-12 TC-1 PASSED");
-			log.info("VID-10 TC 1 PASSED");
-			log.info("VID-11 TC-2 PASSED");
-		}
-		
-		
-		/**
-		 * Disabled submit button.
-		 */
-		@Test(priority=6)
-		public void disabledSubmitButton()
-		{
-			log.info("VID-12 TC-13");
-			//Assert submit button disabled.
-			Assert.assertFalse(driver.findElement(By.xpath(configProp.getProperty("submitButton"))).isEnabled());
-			log.info("VID-12 TC-13 PASSED");
-
-		} 
-		
-		/**
-		 * Default list box value.
-		 */
-		@Test(priority=7)
-		public void defaultListBoxValue()
-		{
-			log.info("VID-12 TC-2");
-			
-			
-			//WebElement subscribername =driver.findElement(By.xpath(".//*[@id='mContent']/div/div/table/tbody/tr[1]/td[2]/div/select"));
-			
-			Select oSelect = new Select(driver.findElement(By.xpath(configProp.getProperty("subscriberNameDropDown"))));
-			Select iSelect = new Select(driver.findElement(By.xpath(configProp.getProperty("serviceTypeDropDown"))));
-			
-			
-			WebElement ielement=iSelect.getFirstSelectedOption();
-			WebElement oelement=oSelect.getFirstSelectedOption();
-			String defaultsubscribername=oelement.getText();
-			String defaultservicetype=ielement.getText();
-			
-			Assert.assertEquals(defaultsubscribername,"Select Subscriber Name");
-			Assert.assertEquals(defaultservicetype,"Select Service Type");
-			
-		
-			
-			
-		//Verify Select Subscriber Name isDisplayed.
-		//driver.findElement(By.xpath(".//*[@id='mContent']/div/div/table/tbody/tr[1]/td[2]/div/select/option[1]")).isSelected();
-				
-		//Verify Select Service Type isDisplayed.	
-		//driver.findElement(By.xpath(".//*[@id='mContent']/div/div/table/tbody/tr[2]/td[2]/div/select/option[1]")).isSelected();
-			
-			
-			log.info("VID-12 TC-2 PASSED");
-
-		}
-
-
-		
-		/**
-		 * Select subscriber name drop down.
-		 *
-		 * @throws InterruptedException the interrupted exception
-		 */
-		@Test(priority=8)
-		public void selectSubscriberNameDropDown() throws InterruptedException
-		{
-			log.info("------------------VID-10 TC-2,VID-12 TC-11, VID-12 TC-9, VID 12 TC-10,VID-12 TC-6, VID 12 TC-5--------------------");
-			
-			
-			driver.findElement(By.xpath(configProp.getProperty("subscriberNameDropDown")));
-			
-			driver.findElement(By.xpath(configProp.getProperty("serviceTypeDropDown")));
-			Thread.sleep(5000);
-			
-			//Infrastructure Subscriber Name
-			Select oSelect = new Select(driver.findElement(By.xpath(configProp.getProperty("subscriberNameDropDown"))));
-			
-			List <WebElement> elementCount = oSelect.getOptions();
-			log.info("Select Element Count of Service Name");
-			System.out.println(elementCount.size());
-			
-			
-			//Verifying getInfrastructureSubscribersList
-			log.info("VID-29 TC-1");
-			Assert.assertTrue(elementCount.size()>0);
-			log.info("VID-29 TC-1 PASSED");
-			
-			oSelect.selectByIndex(2);
-			String selectedOption = new Select(driver.findElement(By.xpath(configProp.getProperty("subscriberNameDropDown")))).getFirstSelectedOption().getText();
-
-			System.out.println("Service Name selected is " +selectedOption);
-			log.info("VID-10 TC-2 PASSED");
-					
-			//Submit button is clicked
-			driver.findElement(By.xpath(configProp.getProperty("submitButton"))).click();
-			
-			
-			//Verify whether the page header is displayed "Selected Subscriber's Service Instance Details:"
-			driver.findElement(By.xpath(".//*[@id='mContent']/div/div/div/h1")).isDisplayed();
-			//Assert.assertTrue(driver.getPageSource().contains("Selected Subscriber's Service Instance Details:"))
-			
-			
-			//Verify whether the page header is displayed "Global Customer ID"
-			driver.findElement(By.xpath(".//*[@id='mContent']/div/div/div/div/table/thead/tr/th[2]/div")).isDisplayed();
-			Assert.assertTrue(driver.getPageSource().contains("Global Customer ID"));
-			Assert.assertTrue(driver.getPageSource().contains("Subscriber Name"));
-			Assert.assertTrue(driver.getPageSource().contains("Service Type"));
-			Assert.assertTrue(driver.getPageSource().contains("Service Instance ID"));
-			
-			log.info("VID-12 TC-5 PASSED");
-			log.info("VID-12 TC-11 PASSED");
-			
-			WebElement serviceinstancetable =driver.findElement(By.xpath("//table[@class='tablesorter tablesorter-default ng-isolate-scope']"));
-			
-			List<WebElement> rows_table = serviceinstancetable.findElements(By.tagName("tr"));
-			  //To calculate no of rows In table.
-			  int rows_count = rows_table.size();
-			  
-			  //Loop will execute till the last row of table.
-			  for (int row=0; row<rows_count; row++){
-			   //To locate columns(cells) of that specific row.
-			   List<WebElement> Columns_row = rows_table.get(row).findElements(By.tagName("td"));
-			   //To calculate no of columns(cells) In that specific row.
-			   int columns_count = Columns_row.size();
-			   //System.out.println("Number of cells In Row "+row+" are "+columns_count);
-			   
-			   //Loop will execute till the last cell of that specific row.
-			   for (int column=0; column<columns_count; column++){
-			    //To retrieve text from that specific cell.
-			    String celtext = Columns_row.get(column).getText();
-			    //System.out.println("Cell Value Of row number "+row+" and column number "+column+" Is "+celtext);
-			   
-			    
-			    
-			    //log.info("Testing Get column and row value");
-			    List <WebElement> exx= rows_table.get(1).findElements(By.tagName("td"));
-			     eg=Columns_row.get(2).getText();
-			   // System.out.println("Cell value of row 1 and column 2 is" +eg);
-			   }
-			  }
-		
-			  
-			
-			
-			//Verify View/Edit isDisplayed and Click
-			
-			driver.findElement(By.xpath("//a[@alt='View/Edit']")).isDisplayed();
-			
-			driver.findElement(By.xpath(".//*[@id='mContent']/div/div/div/div/table/tbody/tr[1]/td[1]/div/a")).click();
-			
-			log.info("User clicked View/Edit");
-			
-			//Verify the Subscriber Name displayed.	
-			String header= driver.findElement(By.xpath("//h1[@class='heading1 ng-binding']")).getText();
-			//System.out.println(header);
-			
-			
-			if(header.contains(eg))
-			{
-				System.out.println("Header contains the subscriber name");
-			}else
-				System.out.println("Header does not contain the subscriber name");
-			
-			
-			
-			Assert.assertTrue(driver.getPageSource().contains("PerfTest Subscriber00020021"));
-			log.info("VID-12 TC-6 PASSED");
-			
-			
-				
-			driver.navigate().back();
-			//Cancel button isDisplayed
-			driver.findElement(By.xpath("//button[@class='button button--small button--primary']")).isDisplayed();
-			log.info("VID-12 TC-9 PASSED");
-			
-			//Cancel button is clicked
-			driver.findElement(By.xpath("//button[@class='button button--small button--primary']")).click();
-			log.info("Cancel button is clicked");
-			
-			//Verifying VID Home page is displayed
-			Assert.assertTrue(driver.getPageSource().contains("Search Existing Service Instances"));
-			log.info("VID-12 TC-10 PASSED");
-			
-			   }
-		
-		
-		/**
-		 * Refresh subscriber name.
-		 */
-		@Test(priority=9)
-		public void refreshSubscriberName()
-		{
-			log.info("VID-10 TC-4");
-			
-			
-			driver.findElement(By.xpath(configProp.getProperty("refreshButtonSubscriberName"))).isDisplayed();
-			
-			log.info("VID-10 TC-4 PASSED");
-			
-			
-		}
-
-		
-		/**
-		 * Select subscriber type drop down.
-		 *
-		 * @throws InterruptedException the interrupted exception
-		 */
-		@Test(priority=9)
-		public void selectSubscriberTypeDropDown() throws InterruptedException
-		{
-			Thread.sleep(5000);
-			log.info("------------------VID-10 TC-3, VID-12 TC-12,--------------------");
-			//Infrastructure Subscriber Type
-			Select iSelect = new Select(driver.findElement(By.xpath(configProp.getProperty("serviceTypeDropDown"))));
-			
-			List <WebElement> ielementCount = iSelect.getOptions();
-			log.info("Select Element Count of Service type");
-			System.out.println(ielementCount.size());
-			iSelect.selectByIndex(1);
-			
-			log.info("VID-10 TC-3 PASSED");
-			
-						
-			//Submit button is clicked
-			driver.findElement(By.xpath(configProp.getProperty("submitButton"))).click();
-			
-			//Verify whether the page header is displayed "Selected Subscriber's Service Instance Details:"
-			driver.findElement(By.xpath(".//*[@id='mContent']/div/div/div/h1")).isDisplayed();
-			//Assert.assertTrue(driver.getPageSource().contains("Selected Subscriber's Service Instance Details:"))
-			log.info("Page Header: Selected Subscriber's Service Instance Details");
-			
-			
-			//Verify whether the page header is displayed "Global Customer ID"
-			driver.findElement(By.xpath(".//*[@id='mContent']/div/div/div/div/table/thead/tr/th[2]/div")).isDisplayed();
-			
-			//Assert.assertTrue(driver.getPageSource().contains("Global Customer ID"));
-			log.info("Table is displayed");
-			
-			log.info("VID-12 TC-12 PASSED");
-			
-		}
-		
-		
-		
-		/**
-		 * Logout under profile.
-		 */
-		@Test(priority=10)
-		public void logoutUnderProfile()
-		{
-			
-			log.info("-----------VID-11 TC-5---------------------");
-			//driver.findElement(By.partialLinkText("Click here to login")).click();
-			//driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
-			
-		
-			driver.findElement(By.xpath(".//*[@class='icon-user-small login-snippet-icon']")).click();			
-			driver.findElement(By.xpath(".//*[@id='reg-logout-div']/a")).click();
-			//Validate that the user has logged out of VID. Displays "Portal"
-			Assert.assertTrue(driver.getPageSource().contains("Portal"));
-			
-			log.info("VID-11 TC-5 PASSED");
-			
-		}
-
-		
-		
-		/**
-		 * Tear down.
-		 */
-		@AfterClass
-		public void tearDown()
-		{
-			driver.close();
-		
-		}
-		
-		
-		
-	}
-
-
-	
-
diff --git a/vid-app-common/src/test/java/org/openecomp/ecomp/vid/selenium/LogOutLeftPane.java b/vid-app-common/src/test/java/org/openecomp/ecomp/vid/selenium/LogOutLeftPane.java
deleted file mode 100755
index 55aed8f..0000000
--- a/vid-app-common/src/test/java/org/openecomp/ecomp/vid/selenium/LogOutLeftPane.java
+++ /dev/null
@@ -1,242 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * VID
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *      http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.ecomp.vid.selenium;
-
-import java.io.FileInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.List;
-import java.util.Properties;
-import java.util.concurrent.TimeUnit;
-
-import org.apache.log4j.Logger;
-import org.openqa.selenium.By;
-import org.openqa.selenium.WebDriver;
-import org.openqa.selenium.WebElement;
-import org.openqa.selenium.firefox.FirefoxDriver;
-import org.openqa.selenium.support.ui.Select;
-import org.testng.Assert;
-import org.testng.annotations.BeforeTest;
-import org.testng.annotations.Test;
-
-/**
- * The Class LogOutLeftPane.
- */
-@Test(enabled=false)
-public class LogOutLeftPane {
-
-	/** The login button. */
-	WebElement loginButton;
-	
-	/** The login. */
-	WebElement login;
-	
-	/** The pwd. */
-	WebElement pwd;
-	
-	/** The log. */
-	Logger log;
-	
-	/** The errormessage. */
-	WebElement errormessage;
-	
-	/** The driver. */
-	WebDriver driver=new FirefoxDriver();
-	
-	
-	/** The config prop. */
-	private final Properties configProp = new Properties();
-	
-	
-	/**
-	 * Instantiates a new log out left pane.
-	 */
-	private  LogOutLeftPane() {
-		// TODO Auto-generated constructor stub
-		//
-		try{
-		//	InputStream input =this.getClass().getClassLoader().getResourceAsStream("objectmap.properties");
-		//FileInputStream input1 = new FileInputStream("objectmap.properties");
-			
-		InputStream input =new FileInputStream("objectconfig.properties");
-		System.out.println("Read all properties from file");
-		configProp.load(input);
-		System.out.println("Read all properties from file completed");
-		}
-		catch(IOException e) {
-			
-			e.printStackTrace();
-		}
-	}
-	
-	
-	   
-	   
-	/**
-	 * Do before test.
-	 */
-	// TODO Auto-generated method stub
-	@BeforeTest
-	public void doBeforeTest()
-	{
-		//WebDriver driver=new FirefoxDriver();
-		
-		log = Logger.getLogger(LogOutLeftPane.class.getName());
-	
-	
-	
-	// Get url
-	driver.get("http://vid.onap.org:9080/vid/login_external.htm");
-	driver.manage().window().maximize();
-	
-	
-	 login = driver.findElement(By.xpath("//input[@class='fn-ebz-text ng-pristine ng-valid']"));
-	 pwd = driver.findElement(By.xpath("//input[@class='span3 ng-pristine ng-valid']"));
-	 loginButton = driver.findElement(By.id("loginBtn"));
-	}
-	
-	
-	/**
-	 * Expand collapse panel.
-	 *
-	 * @throws InterruptedException the interrupted exception
-	 */
-	@Test(priority=1)
-	public void expandCollapsePanel() throws InterruptedException
-	{
-
-		
-		
-		login.clear();
-		login.sendKeys("su");
-		pwd.clear();
-		pwd.sendKeys("fusion");
-		//driver.findElement(By.partialLinkText("Click here to login")).click();
-		//driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
-		
-		loginButton.click();
-		driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
-		
-		
-		log.info("Clicking Profile link from left pane");
-		Thread.sleep(3000);
-		System.out.println("properties file details --->"+configProp.getProperty("profilelink"));
-		driver.findElement(By.xpath(configProp.getProperty("profilelink"))).click();
-		Thread.sleep(3000);
-		
-		//Verify whether the sub panel is displayed
-		//To verify the following :Search import from webphone and Self 
-		driver.findElement(By.xpath(".//*[@id='panel4']")).isDisplayed();
-		log.info("Expand and collapse passed for Profile link");
-		
-		//For Admin
-		//Verify expand and collapse working for ADMIN
-		log.info("Clicking Admin link from left pane");
-		driver.findElement(By.xpath("html/body/div[1]/div[1]/div/div/div[2]/div/div/div[1]/div/div/accordion/div/div[6]/a/span")).click();
-		//To verify the following: Roles, Roles Functions, Usages
-		driver.findElement(By.xpath(".//*[@id='panel5']")).isDisplayed();
-		
-	
-		log.info("Expand and collapse passed for ADMIN link");
-
-		log.info("VID-11 TC-3 PASSED");
-		
-	}
-	
-	
-	/**
-	 * Drop down list.
-	 *
-	 * @throws InterruptedException the interrupted exception
-	 */
-	@Test(priority=2)
-	public void dropDownList() throws InterruptedException
-	{
-		//VID-12 TC-3
-		log.info("VID-12 TC-3");
-		//driver.findElement(By.xpath(".//*[@id='mContent']/div/div/table/tbody/tr[1]/td[2]/div/select"));
-		
-		//driver.findElement(By.xpath(".//*[@id='mContent']/div/div/table/tbody/tr[2]/td[2]/div/select"));
-		Thread.sleep(5000);
-		
-		//Infrastructure Subscriber Name
-		Select oSelect = new Select(driver.findElement(By.xpath(".//*[@id='mContent']/div/div/table/tbody/tr[1]/td[2]/div/select")));
-		Select iSelect = new Select(driver.findElement(By.xpath(".//*[@id='mContent']/div/div/table/tbody/tr[2]/td[2]/div/select")));
-		
-		List <WebElement> elementCount = oSelect.getOptions();
-		log.info("Subscriber Name Drop Down");
-		System.out.println(elementCount.size());
-		oSelect.selectByIndex(1);
-		log.info("Subscriber name selected");
-		//String selectedOption = new Select(driver.findElement(By.xpath(".//*[@id='mContent']/div/div/table/tbody/tr[1]/td[2]/div/select"))).getFirstSelectedOption().getText();
-		
-		
-		List <WebElement> count = iSelect.getOptions();
-		log.info("Subscriber type drop down");
-		System.out.println(count.size());
-		oSelect.selectByIndex(1);
-		log.info("Subscriber type selected");
-		
-
-				
-		//Submit button is clicked
-		driver.findElement(By.xpath(".//*[@id='mContent']/div/div/table/tbody/tr[3]/td/div/button")).click();
-		
-		
-		//Verify whether the page header is displayed "Selected Subscriber's Service Instance Details:"
-		driver.findElement(By.xpath(".//*[@id='mContent']/div/div/div/h1")).isDisplayed();
-		log.info("VID-12 TC-3 PASSED");
-	}
-	
-	
-	
-	
-	/**
-	 * Logout left pane.
-	 */
-	@Test(priority=3)
-	public void logoutLeftPane()
-	{
-		//To Verify if the logout link redirects to Login page when clicked.
-		
-		
-		/*log.info("----------------VID-11 TC-4----------------");
-		login.clear();
-		login.sendKeys("testuser");
-		pwd.clear();
-		pwd.sendKeys("abc123");
-		//driver.findElement(By.partialLinkText("Click here to login")).click();
-		//driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
-		
-		loginButton.click();
-		driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);*/
-		log.info("----------------VID-11 TC-4----------------");
-		driver.findElement(By.xpath("html/body/div[1]/div[1]/div/div/div[2]/div/div/div[1]/div/div/accordion/div/div[7]/a")).click();
-		//Validate that the user has logged out of VID. Displays "Portal"
-		Assert.assertTrue(driver.getPageSource().contains("Portal"));
-		
-		log.info("VID 11 TC-4 PASSED");
-		
-		driver.close();
-		
-	}
-	
-}
diff --git a/vid-app-common/src/test/java/org/openecomp/fusion/core/MockApplicationContextTestSuite.java b/vid-app-common/src/test/java/org/openecomp/fusion/core/MockApplicationContextTestSuite.java
deleted file mode 100755
index 2f5828b..0000000
--- a/vid-app-common/src/test/java/org/openecomp/fusion/core/MockApplicationContextTestSuite.java
+++ /dev/null
@@ -1,177 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * VID
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *      http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.fusion.core;
-
-import java.io.IOException;
-
-import org.junit.Before;
-import org.junit.runner.RunWith;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.ComponentScan;
-import org.springframework.context.annotation.Configuration;
-import org.springframework.context.annotation.Profile;
-import org.springframework.test.context.ActiveProfiles;
-import org.springframework.test.context.ContextConfiguration;
-import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
-import org.springframework.test.context.web.AnnotationConfigWebContextLoader;
-import org.springframework.test.context.web.WebAppConfiguration;
-import org.springframework.test.web.servlet.MockMvc;
-import org.springframework.test.web.servlet.setup.MockMvcBuilders;
-import org.springframework.web.context.WebApplicationContext;
-import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
-import org.testng.annotations.Test;
-import org.openecomp.portalsdk.core.conf.AppConfig;
-import org.openecomp.portalsdk.core.objectcache.AbstractCacheManager;
-import org.openecomp.portalsdk.core.util.SystemProperties;
-import org.openecomp.portalsdk.core.util.CacheManager;
-
-/**
- * 
- * 
- * 
- * In order to write a unit test, 
- * 1. inherit this class - See SanityTest.java
- * 2. place the "war" folder on your test class's classpath
- * 3. run the test with the following VM argument; This is important because when starting the application from Container, the System Properties file (SystemProperties.java) can have the direct path
- *    but, when running from the Mock Junit container, the path should be prefixed with "classpath" to enable the mock container to search for the file in the classpath  
- *    -Dcontainer.classpath="classpath:"
- *
- */
-
-@RunWith(SpringJUnit4ClassRunner.class)
-@WebAppConfiguration
-@ContextConfiguration(loader = AnnotationConfigWebContextLoader.class, classes = {MockAppConfig.class})
-@ActiveProfiles(value="test")
-@Test(enabled=false)
-public class MockApplicationContextTestSuite {
-		
-	    /** The wac. */
-    	@Autowired
-	    public WebApplicationContext wac;
-
-	    /** The mock mvc. */
-    	private MockMvc mockMvc;
-
-	    /**
-    	 * Setup.
-    	 */
-    	@Before
-	    public void setup() {
-	    	if(mockMvc == null) {
-	    		this.mockMvc = MockMvcBuilders.webAppContextSetup(this.wac).build();
-	    		
-	    	}
-	    }
-	    
-	    /**
-    	 * Gets the bean.
-    	 *
-    	 * @param name the name
-    	 * @return the bean
-    	 */
-    	public Object getBean(String name) {
-			return this.wac.getBean(name);
-		}
-
-
-		/**
-		 * Gets the mock mvc.
-		 *
-		 * @return the mock mvc
-		 */
-		public MockMvc getMockMvc() {
-			return mockMvc;
-		}
-
-		/**
-		 * Sets the mock mvc.
-		 *
-		 * @param mockMvc the new mock mvc
-		 */
-		public void setMockMvc(MockMvc mockMvc) {
-			this.mockMvc = mockMvc;
-		}
-		
-		/**
-		 * Gets the web application context.
-		 *
-		 * @return the web application context
-		 */
-		public WebApplicationContext getWebApplicationContext() {
-			return wac;
-		}
-		
-		
-		
-		
-}
-		
-
-		@Configuration
-		@ComponentScan(basePackages = "org.openecomp", 
-				 excludeFilters = {
-								 	// the following source configurations should not be scanned; instead of using Exclusion filter, we can use the @Profile annotation to exclude them
-									// see AppConfig class
-									//@ComponentScan.Filter(type = FilterType.REGEX, pattern = "org.openecomp.portalsdk.core.*AppConfig*")//,
-								 	//@ComponentScan.Filter(type = FilterType.REGEX, pattern = org.openecomp.*.*AppConfig*")
-								  }
-		    	)
-		@Profile("test")
-		class MockAppConfig extends AppConfig {
-			
-			@Bean 
-		    public SystemProperties systemProperties(){
-		    	return new MockSystemProperties();
-		    }
-			
-			@Bean
-		    public AbstractCacheManager cacheManager() {
-		        return new CacheManager() {
-		        	
-		        	public void configure() throws IOException {
-		        		 
-		        	}
-		        };
-		    }
-			
-			protected String[] tileDefinitions() {
-				return new String[] {"classpath:/WEB-INF/fusion/defs/definitions.xml", "classpath:/WEB-INF/defs/definitions.xml"};
-			}
-			
-			 @Override
-			public void addInterceptors(InterceptorRegistry registry) {
-			    //registry.addInterceptor(new SessionTimeoutInterceptor()).excludePathPatterns(getExcludeUrlPathsForSessionTimeout());
-			    //registry.addInterceptor(resourceInterceptor());
-			}
-			 
-			 public static class MockSystemProperties extends SystemProperties {
-					
-					public MockSystemProperties() {
-					}
-					
-				}
-					
-		}
-		
-		
-
-
diff --git a/vid-app-common/src/test/java/org/openecomp/fusionapp/controller/NetMapTest.java b/vid-app-common/src/test/java/org/openecomp/fusionapp/controller/NetMapTest.java
deleted file mode 100755
index 0078cc6..0000000
--- a/vid-app-common/src/test/java/org/openecomp/fusionapp/controller/NetMapTest.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * VID
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *      http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.fusionapp.controller;
-
-import org.junit.Assert;
-import org.junit.Test;
-import org.springframework.test.web.servlet.ResultActions;
-import org.springframework.test.web.servlet.request.MockMvcRequestBuilders;
-
-import org.openecomp.fusion.core.MockApplicationContextTestSuite;
-
-/**
- * The Class NetMapTest.
- */
-
-public class NetMapTest extends MockApplicationContextTestSuite {
-	
-	/**
-	 * Test get net map.
-	 *
-	 * @throws Exception the exception
-	 */
-//	@Test
-	public void testGetNetMap() throws Exception {
-		ResultActions ra =getMockMvc().perform(MockMvcRequestBuilders.get("/net_map"));
-		//Assert.assertEquals(UrlAccessRestrictedException.class,ra.andReturn().getResolvedException().getClass());
-		Assert.assertEquals("net_map_int",ra.andReturn().getModelAndView().getModel().get("frame_int"));
-	}
-	
-
-}
diff --git a/vid-app-common/src/test/java/org/openecomp/fusionapp/service/ProfileServiceTest.java b/vid-app-common/src/test/java/org/openecomp/fusionapp/service/ProfileServiceTest.java
deleted file mode 100755
index f8afbf8..0000000
--- a/vid-app-common/src/test/java/org/openecomp/fusionapp/service/ProfileServiceTest.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * VID
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *      http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.fusionapp.service;
-
-import java.util.List;
-
-import org.junit.Assert;
-import org.junit.Test;
-import org.springframework.beans.factory.annotation.Autowired;
-
-import org.openecomp.fusion.core.MockApplicationContextTestSuite;
-import org.openecomp.portalsdk.core.domain.Profile;
-import org.openecomp.portalsdk.core.domain.User;
-import org.openecomp.portalsdk.core.service.ProfileService;
-import org.openecomp.portalsdk.core.service.UserProfileService;
-
-
-/**
- * The Class ProfileServiceTest.
- */
-
-public class ProfileServiceTest extends MockApplicationContextTestSuite {
-	
-	/** The service. */
-	@Autowired
-	ProfileService service;
-	
-	/** The user profile service. */
-	@Autowired
-	UserProfileService userProfileService;
-	
-	/**
-	 * Test find all.
-	 */
-	//@Test
-	public void testFindAll() {
-		try {
-		List<Profile> profiles = service.findAll();
-		Assert.assertTrue(profiles.size() > 0);
-
-		}
-		catch (Exception e) {
-			// TODO: handle exception
-		}
-	}
-
-	/**
-	 * Test find all active.
-	 */
-//	@Test
-	public void testFindAllActive() {
-				
-		List<User> users = userProfileService.findAllActive();
-		List<User> activeUsers = userProfileService.findAllActive();
-		Assert.assertTrue(users.size() - activeUsers.size() >= 0);
-	}
-}
diff --git a/vid-app-common/src/test/java/org/openecomp/src/main/java/org/vid/dao/FnAppDoaImplTest.java b/vid-app-common/src/test/java/org/openecomp/src/main/java/org/vid/dao/FnAppDoaImplTest.java
deleted file mode 100755
index 3ac91c2..0000000
--- a/vid-app-common/src/test/java/org/openecomp/src/main/java/org/vid/dao/FnAppDoaImplTest.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * VID
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *      http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.src.main.java.org.vid.dao;
-
-import java.io.IOException;
-import java.sql.SQLException;
-
-import org.junit.Test;
-
-import org.openecomp.vid.dao.FnAppDoaImpl;
-
-public class FnAppDoaImplTest {
-	
-	//@Test
-	public void testGetconnection() throws ClassNotFoundException, IOException, SQLException{
-		FnAppDoaImpl impl=new FnAppDoaImpl();
-		impl.getConnection(null,null,null, null);
-		
-	}
-	
-	//@Test
-	public void testProfileCount() throws ClassNotFoundException, IOException, SQLException{
-		FnAppDoaImpl impl=new FnAppDoaImpl();
-		impl.getProfileCount(null,null,null, null);	
-	}
-
-}
diff --git a/vid-app-common/src/test/java/org/openecomp/vid/RelatedToTest.java b/vid-app-common/src/test/java/org/openecomp/vid/RelatedToTest.java
deleted file mode 100644
index 9d49300..0000000
--- a/vid-app-common/src/test/java/org/openecomp/vid/RelatedToTest.java
+++ /dev/null
@@ -1,36 +0,0 @@
-package org.openecomp.vid;
-
-import java.util.Map;
-
-import org.junit.Test;
-
-
-public class RelatedToTest {
-
-	private RelatedTo createTestSubject() {
-		return new RelatedTo();
-	}
-
-
-	@Test
-	public void testGetAdditionalProperties() throws Exception {
-		RelatedTo testSubject;
-		Map<String, Object> result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.getAdditionalProperties();
-	}
-
-
-	@Test
-	public void testSetAdditionalProperty() throws Exception {
-		RelatedTo testSubject;
-		String name = "";
-		Object value = null;
-
-		// default test
-		testSubject = createTestSubject();
-		testSubject.setAdditionalProperty(name, value);
-	}
-}
\ No newline at end of file
diff --git a/vid-app-common/src/test/java/org/openecomp/vid/TestSuite.java b/vid-app-common/src/test/java/org/openecomp/vid/TestSuite.java
deleted file mode 100644
index 6e8b196..0000000
--- a/vid-app-common/src/test/java/org/openecomp/vid/TestSuite.java
+++ /dev/null
@@ -1,11 +0,0 @@
-package org.openecomp.vid;
-
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-
-@RunWith(Suite.class)
-@Suite.SuiteClasses(
-
-{ RelatedToTest.class, org.openecomp.vid.aai.TestSuite.class })
-public class TestSuite { // nothing
-}
diff --git a/vid-app-common/src/test/java/org/openecomp/vid/aai/AaiGetVnfResponseTest.java b/vid-app-common/src/test/java/org/openecomp/vid/aai/AaiGetVnfResponseTest.java
deleted file mode 100644
index b959709..0000000
--- a/vid-app-common/src/test/java/org/openecomp/vid/aai/AaiGetVnfResponseTest.java
+++ /dev/null
@@ -1,33 +0,0 @@
-package org.openecomp.vid.aai;
-
-import java.util.Map;
-
-import org.junit.Test;
-
-public class AaiGetVnfResponseTest {
-
-	private AaiGetVnfResponse createTestSubject() {
-		return new AaiGetVnfResponse();
-	}
-
-	@Test
-	public void testGetAdditionalProperties() throws Exception {
-		AaiGetVnfResponse testSubject;
-		Map<String, Object> result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.getAdditionalProperties();
-	}
-
-	@Test
-	public void testSetAdditionalProperty() throws Exception {
-		AaiGetVnfResponse testSubject;
-		String name = "";
-		Object value = null;
-
-		// default test
-		testSubject = createTestSubject();
-		testSubject.setAdditionalProperty(name, value);
-	}
-}
\ No newline at end of file
diff --git a/vid-app-common/src/test/java/org/openecomp/vid/aai/ServicePropertiesTest.java b/vid-app-common/src/test/java/org/openecomp/vid/aai/ServicePropertiesTest.java
deleted file mode 100644
index d3c50af..0000000
--- a/vid-app-common/src/test/java/org/openecomp/vid/aai/ServicePropertiesTest.java
+++ /dev/null
@@ -1,33 +0,0 @@
-package org.openecomp.vid.aai;
-
-import java.util.Map;
-
-import org.junit.Test;
-
-public class ServicePropertiesTest {
-
-	private ServiceProperties createTestSubject() {
-		return new ServiceProperties();
-	}
-
-	@Test
-	public void testGetAdditionalProperties() throws Exception {
-		ServiceProperties testSubject;
-		Map<String, Object> result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.getAdditionalProperties();
-	}
-
-	@Test
-	public void testSetAdditionalProperty() throws Exception {
-		ServiceProperties testSubject;
-		String name = "";
-		Object value = null;
-
-		// default test
-		testSubject = createTestSubject();
-		testSubject.setAdditionalProperty(name, value);
-	}
-}
\ No newline at end of file
diff --git a/vid-app-common/src/test/java/org/openecomp/vid/aai/SubscriberAaiResponseTest.java b/vid-app-common/src/test/java/org/openecomp/vid/aai/SubscriberAaiResponseTest.java
deleted file mode 100644
index 2695401..0000000
--- a/vid-app-common/src/test/java/org/openecomp/vid/aai/SubscriberAaiResponseTest.java
+++ /dev/null
@@ -1,22 +0,0 @@
-package org.openecomp.vid.aai;
-
-import org.junit.Test;
-import org.openecomp.vid.model.SubscriberList;
-
-public class SubscriberAaiResponseTest {
-
-	private SubscriberAaiResponse createTestSubject() {
-		return new SubscriberAaiResponse(new SubscriberList(), "", 0);
-	}
-
-	
-	@Test
-	public void testGetSubscriberList() throws Exception {
-		SubscriberAaiResponse testSubject;
-		SubscriberList result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.getSubscriberList();
-	}
-}
\ No newline at end of file
diff --git a/vid-app-common/src/test/java/org/openecomp/vid/aai/SubscriberWithFilterTest.java b/vid-app-common/src/test/java/org/openecomp/vid/aai/SubscriberWithFilterTest.java
deleted file mode 100644
index 7fca7c9..0000000
--- a/vid-app-common/src/test/java/org/openecomp/vid/aai/SubscriberWithFilterTest.java
+++ /dev/null
@@ -1,30 +0,0 @@
-package org.openecomp.vid.aai;
-
-import org.junit.Test;
-
-public class SubscriberWithFilterTest {
-
-	private SubscriberWithFilter createTestSubject() {
-		return new SubscriberWithFilter();
-	}
-
-	@Test
-	public void testGetIsPermitted() throws Exception {
-		SubscriberWithFilter testSubject;
-		boolean result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.getIsPermitted();
-	}
-
-	@Test
-	public void testSetIsPermitted() throws Exception {
-		SubscriberWithFilter testSubject;
-		boolean isPermitted = false;
-
-		// default test
-		testSubject = createTestSubject();
-		testSubject.setIsPermitted(isPermitted);
-	}
-}
\ No newline at end of file
diff --git a/vid-app-common/src/test/java/org/openecomp/vid/aai/TestSuite.java b/vid-app-common/src/test/java/org/openecomp/vid/aai/TestSuite.java
deleted file mode 100644
index 0629d78..0000000
--- a/vid-app-common/src/test/java/org/openecomp/vid/aai/TestSuite.java
+++ /dev/null
@@ -1,12 +0,0 @@
-package org.openecomp.vid.aai;
-
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-
-@RunWith(Suite.class)
-@Suite.SuiteClasses(
-
-{ SubscriberAaiResponseTest.class, AaiGetVnfResponseTest.class, ServicePropertiesTest.class,
-		SubscriberWithFilterTest.class, VnfResultTest.class, org.openecomp.vid.aai.model.TestSuite.class })
-public class TestSuite { // nothing
-}
diff --git a/vid-app-common/src/test/java/org/openecomp/vid/aai/VnfResultTest.java b/vid-app-common/src/test/java/org/openecomp/vid/aai/VnfResultTest.java
deleted file mode 100644
index 6efa05a..0000000
--- a/vid-app-common/src/test/java/org/openecomp/vid/aai/VnfResultTest.java
+++ /dev/null
@@ -1,33 +0,0 @@
-package org.openecomp.vid.aai;
-
-import java.util.Map;
-
-import org.junit.Test;
-
-public class VnfResultTest {
-
-	private VnfResult createTestSubject() {
-		return new VnfResult();
-	}
-
-	@Test
-	public void testGetAdditionalProperties() throws Exception {
-		VnfResult testSubject;
-		Map<String, Object> result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.getAdditionalProperties();
-	}
-
-	@Test
-	public void testSetAdditionalProperty() throws Exception {
-		VnfResult testSubject;
-		String name = "";
-		Object value = null;
-
-		// default test
-		testSubject = createTestSubject();
-		testSubject.setAdditionalProperty(name, value);
-	}
-}
\ No newline at end of file
diff --git a/vid-app-common/src/test/java/org/openecomp/vid/aai/model/RelatedToPropertyTest.java b/vid-app-common/src/test/java/org/openecomp/vid/aai/model/RelatedToPropertyTest.java
deleted file mode 100644
index 08a8717..0000000
--- a/vid-app-common/src/test/java/org/openecomp/vid/aai/model/RelatedToPropertyTest.java
+++ /dev/null
@@ -1,55 +0,0 @@
-package org.openecomp.vid.aai.model;
-
-import org.junit.Test;
-
-
-public class RelatedToPropertyTest {
-
-	private RelatedToProperty createTestSubject() {
-		return new RelatedToProperty();
-	}
-
-
-	@Test
-	public void testGetPropertyKey() throws Exception {
-		RelatedToProperty testSubject;
-		String result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.getPropertyKey();
-	}
-
-
-	@Test
-	public void testSetPropertyKey() throws Exception {
-		RelatedToProperty testSubject;
-		String propertyKey = "";
-
-		// default test
-		testSubject = createTestSubject();
-		testSubject.setPropertyKey(propertyKey);
-	}
-
-
-	@Test
-	public void testGetPropertyValue() throws Exception {
-		RelatedToProperty testSubject;
-		String result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.getPropertyValue();
-	}
-
-
-	@Test
-	public void testSetPropertyValue() throws Exception {
-		RelatedToProperty testSubject;
-		String propertyValue = "";
-
-		// default test
-		testSubject = createTestSubject();
-		testSubject.setPropertyValue(propertyValue);
-	}
-}
\ No newline at end of file
diff --git a/vid-app-common/src/test/java/org/openecomp/vid/aai/model/RelationshipDataTest.java b/vid-app-common/src/test/java/org/openecomp/vid/aai/model/RelationshipDataTest.java
deleted file mode 100644
index 4df27cc..0000000
--- a/vid-app-common/src/test/java/org/openecomp/vid/aai/model/RelationshipDataTest.java
+++ /dev/null
@@ -1,55 +0,0 @@
-package org.openecomp.vid.aai.model;
-
-import org.junit.Test;
-
-
-public class RelationshipDataTest {
-
-	private RelationshipData createTestSubject() {
-		return new RelationshipData();
-	}
-
-
-	@Test
-	public void testGetRelationshipKey() throws Exception {
-		RelationshipData testSubject;
-		String result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.getRelationshipKey();
-	}
-
-
-	@Test
-	public void testSetRelationshipKey() throws Exception {
-		RelationshipData testSubject;
-		String relationshipKey = "";
-
-		// default test
-		testSubject = createTestSubject();
-		testSubject.setRelationshipKey(relationshipKey);
-	}
-
-
-	@Test
-	public void testGetRelationshipValue() throws Exception {
-		RelationshipData testSubject;
-		String result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.getRelationshipValue();
-	}
-
-
-	@Test
-	public void testSetRelationshipValue() throws Exception {
-		RelationshipData testSubject;
-		String relationshipValue = "";
-
-		// default test
-		testSubject = createTestSubject();
-		testSubject.setRelationshipValue(relationshipValue);
-	}
-}
\ No newline at end of file
diff --git a/vid-app-common/src/test/java/org/openecomp/vid/aai/model/RelationshipTest.java b/vid-app-common/src/test/java/org/openecomp/vid/aai/model/RelationshipTest.java
deleted file mode 100644
index 4f5e335..0000000
--- a/vid-app-common/src/test/java/org/openecomp/vid/aai/model/RelationshipTest.java
+++ /dev/null
@@ -1,101 +0,0 @@
-package org.openecomp.vid.aai.model;
-
-import java.util.List;
-
-import org.junit.Test;
-
-
-public class RelationshipTest {
-
-	private Relationship createTestSubject() {
-		return new Relationship();
-	}
-
-
-	@Test
-	public void testGetRelatedTo() throws Exception {
-		Relationship testSubject;
-		String result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.getRelatedTo();
-	}
-
-
-	@Test
-	public void testSetRelatedTo() throws Exception {
-		Relationship testSubject;
-		String relatedTo = "";
-
-		// default test
-		testSubject = createTestSubject();
-		testSubject.setRelatedTo(relatedTo);
-	}
-
-
-	@Test
-	public void testGetRelatedLink() throws Exception {
-		Relationship testSubject;
-		String result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.getRelatedLink();
-	}
-
-
-	@Test
-	public void testSetRelatedLink() throws Exception {
-		Relationship testSubject;
-		String relatedLink = "";
-
-		// default test
-		testSubject = createTestSubject();
-		testSubject.setRelatedLink(relatedLink);
-	}
-
-
-	@Test
-	public void testGetRelationDataList() throws Exception {
-		Relationship testSubject;
-		List<RelationshipData> result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.getRelationDataList();
-	}
-
-
-	@Test
-	public void testSetRelationDataList() throws Exception {
-		Relationship testSubject;
-		List<RelationshipData> relationDataList = null;
-
-		// default test
-		testSubject = createTestSubject();
-		testSubject.setRelationDataList(relationDataList);
-	}
-
-
-	@Test
-	public void testGetRelatedToPropertyList() throws Exception {
-		Relationship testSubject;
-		List<RelatedToProperty> result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.getRelatedToPropertyList();
-	}
-
-
-	@Test
-	public void testSetRelatedToPropertyList() throws Exception {
-		Relationship testSubject;
-		List<RelatedToProperty> relatedToPropertyList = null;
-
-		// default test
-		testSubject = createTestSubject();
-		testSubject.setRelatedToPropertyList(relatedToPropertyList);
-	}
-}
\ No newline at end of file
diff --git a/vid-app-common/src/test/java/org/openecomp/vid/aai/model/ServiceRelationshipsTest.java b/vid-app-common/src/test/java/org/openecomp/vid/aai/model/ServiceRelationshipsTest.java
deleted file mode 100644
index c67e3f8..0000000
--- a/vid-app-common/src/test/java/org/openecomp/vid/aai/model/ServiceRelationshipsTest.java
+++ /dev/null
@@ -1,165 +0,0 @@
-package org.openecomp.vid.aai.model;
-
-import org.junit.Test;
-
-
-public class ServiceRelationshipsTest {
-
-	private ServiceRelationships createTestSubject() {
-		return new ServiceRelationships();
-	}
-
-
-	@Test
-	public void testGetServiceInstanceId() throws Exception {
-		ServiceRelationships testSubject;
-		String result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.getServiceInstanceId();
-	}
-
-
-	@Test
-	public void testSetServiceInstanceId() throws Exception {
-		ServiceRelationships testSubject;
-		String serviceInstanceId = "";
-
-		// default test
-		testSubject = createTestSubject();
-		testSubject.setServiceInstanceId(serviceInstanceId);
-	}
-
-
-	@Test
-	public void testGetServiceInstanceName() throws Exception {
-		ServiceRelationships testSubject;
-		String result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.getServiceInstanceName();
-	}
-
-
-	@Test
-	public void testSetServiceInstanceName() throws Exception {
-		ServiceRelationships testSubject;
-		String serviceInstanceName = "";
-
-		// default test
-		testSubject = createTestSubject();
-		testSubject.setServiceInstanceName(serviceInstanceName);
-	}
-
-
-	@Test
-	public void testGetModelInvariantId() throws Exception {
-		ServiceRelationships testSubject;
-		String result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.getModelInvariantId();
-	}
-
-
-	@Test
-	public void testSetModelInvariantId() throws Exception {
-		ServiceRelationships testSubject;
-		String modelInvariantId = "";
-
-		// default test
-		testSubject = createTestSubject();
-		testSubject.setModelInvariantId(modelInvariantId);
-	}
-
-
-	@Test
-	public void testGetModelVersionId() throws Exception {
-		ServiceRelationships testSubject;
-		String result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.getModelVersionId();
-	}
-
-
-	@Test
-	public void testSetModelVersionId() throws Exception {
-		ServiceRelationships testSubject;
-		String modelVersionId = "";
-
-		// default test
-		testSubject = createTestSubject();
-		testSubject.setModelVersionId(modelVersionId);
-	}
-
-
-	@Test
-	public void testGetResourceVersion() throws Exception {
-		ServiceRelationships testSubject;
-		String result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.getResourceVersion();
-	}
-
-
-	@Test
-	public void testSetResourceVersion() throws Exception {
-		ServiceRelationships testSubject;
-		String resourceVersion = "";
-
-		// default test
-		testSubject = createTestSubject();
-		testSubject.setResourceVersion(resourceVersion);
-	}
-
-
-	@Test
-	public void testGetOrchestrationStatus() throws Exception {
-		ServiceRelationships testSubject;
-		String result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.getOrchestrationStatus();
-	}
-
-
-	@Test
-	public void testSetOrchestrationStatus() throws Exception {
-		ServiceRelationships testSubject;
-		String orchestrationStatus = "";
-
-		// default test
-		testSubject = createTestSubject();
-		testSubject.setOrchestrationStatus(orchestrationStatus);
-	}
-
-
-	@Test
-	public void testGetRelationshipList() throws Exception {
-		ServiceRelationships testSubject;
-		RelationshipList result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.getRelationshipList();
-	}
-
-
-	@Test
-	public void testSetRelationshipList() throws Exception {
-		ServiceRelationships testSubject;
-		RelationshipList relationshipList = null;
-
-		// default test
-		testSubject = createTestSubject();
-		testSubject.setRelationshipList(relationshipList);
-	}
-}
\ No newline at end of file
diff --git a/vid-app-common/src/test/java/org/openecomp/vid/aai/model/TestSuite.java b/vid-app-common/src/test/java/org/openecomp/vid/aai/model/TestSuite.java
deleted file mode 100644
index 34ca70b..0000000
--- a/vid-app-common/src/test/java/org/openecomp/vid/aai/model/TestSuite.java
+++ /dev/null
@@ -1,11 +0,0 @@
-package org.openecomp.vid.aai.model;
-
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-
-@RunWith(Suite.class)
-@Suite.SuiteClasses(
-
-{ ServiceRelationshipsTest.class, RelationshipTest.class, RelatedToPropertyTest.class, RelationshipDataTest.class })
-public class TestSuite { // nothing
-}
diff --git a/vid-app-common/src/test/java/org/openecomp/vid/asdc/beans/ArtifactTest.java b/vid-app-common/src/test/java/org/openecomp/vid/asdc/beans/ArtifactTest.java
deleted file mode 100644
index 8251ca0..0000000
--- a/vid-app-common/src/test/java/org/openecomp/vid/asdc/beans/ArtifactTest.java
+++ /dev/null
@@ -1,277 +0,0 @@
-package org.openecomp.vid.asdc.beans;
-
-import org.junit.Test;
-
-
-public class ArtifactTest {
-
-	private Artifact createTestSubject() {
-		return new Artifact();
-	}
-
-
-	@Test
-	public void testGetArtifactName() throws Exception {
-		Artifact testSubject;
-		String result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.getArtifactName();
-	}
-
-
-	@Test
-	public void testGetArtifactType() throws Exception {
-		Artifact testSubject;
-		String result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.getArtifactType();
-	}
-
-
-	@Test
-	public void testGetArtifactGroupType() throws Exception {
-		Artifact testSubject;
-		String result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.getArtifactGroupType();
-	}
-
-
-	@Test
-	public void testGetArtifactLabel() throws Exception {
-		Artifact testSubject;
-		String result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.getArtifactLabel();
-	}
-
-	
-	@Test
-	public void testGetArtifactURL() throws Exception {
-		Artifact testSubject;
-		String result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.getArtifactURL();
-	}
-
-	
-	@Test
-	public void testGetArtifactDescription() throws Exception {
-		Artifact testSubject;
-		String result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.getArtifactDescription();
-	}
-
-	
-	@Test
-	public void testGetArtifactTimeout() throws Exception {
-		Artifact testSubject;
-		int result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.getArtifactTimeout();
-	}
-
-	
-	@Test
-	public void testGetArtifactChecksum() throws Exception {
-		Artifact testSubject;
-		String result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.getArtifactChecksum();
-	}
-
-	
-	@Test
-	public void testGetArtifactUUID() throws Exception {
-		Artifact testSubject;
-		String result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.getArtifactUUID();
-	}
-
-	
-	@Test
-	public void testGetArtifactVersion() throws Exception {
-		Artifact testSubject;
-		String result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.getArtifactVersion();
-	}
-
-	
-	@Test
-	public void testGetGeneratedFromUUID() throws Exception {
-		Artifact testSubject;
-		String result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.getGeneratedFromUUID();
-	}
-
-	
-	@Test
-	public void testSetArtifactName() throws Exception {
-		Artifact testSubject;
-		String artifactName = "";
-
-		// default test
-		testSubject = createTestSubject();
-		testSubject.setArtifactName(artifactName);
-	}
-
-	
-	@Test
-	public void testSetArtifactType() throws Exception {
-		Artifact testSubject;
-		String artifactType = "";
-
-		// default test
-		testSubject = createTestSubject();
-		testSubject.setArtifactType(artifactType);
-	}
-
-	
-	@Test
-	public void testSetArtifactGroupType() throws Exception {
-		Artifact testSubject;
-		String artifactGroupType = "";
-
-		// default test
-		testSubject = createTestSubject();
-		testSubject.setArtifactGroupType(artifactGroupType);
-	}
-
-	
-	@Test
-	public void testSetArtifactLabel() throws Exception {
-		Artifact testSubject;
-		String artifactLabel = "";
-
-		// default test
-		testSubject = createTestSubject();
-		testSubject.setArtifactLabel(artifactLabel);
-	}
-
-	
-	@Test
-	public void testSetArtifactURL() throws Exception {
-		Artifact testSubject;
-		String artifactURL = "";
-
-		// default test
-		testSubject = createTestSubject();
-		testSubject.setArtifactURL(artifactURL);
-	}
-
-	
-	@Test
-	public void testSetArtifactDescription() throws Exception {
-		Artifact testSubject;
-		String artifactDescription = "";
-
-		// default test
-		testSubject = createTestSubject();
-		testSubject.setArtifactDescription(artifactDescription);
-	}
-
-	
-	@Test
-	public void testSetArtifactTimeout() throws Exception {
-		Artifact testSubject;
-		int artifactTimeout = 0;
-
-		// default test
-		testSubject = createTestSubject();
-		testSubject.setArtifactTimeout(artifactTimeout);
-	}
-
-	
-	@Test
-	public void testSetArtifactChecksum() throws Exception {
-		Artifact testSubject;
-		String artifactChecksum = "";
-
-		// default test
-		testSubject = createTestSubject();
-		testSubject.setArtifactChecksum(artifactChecksum);
-	}
-
-	
-	@Test
-	public void testSetArtifactUUID() throws Exception {
-		Artifact testSubject;
-		String artifactUUID = "";
-
-		// default test
-		testSubject = createTestSubject();
-		testSubject.setArtifactUUID(artifactUUID);
-	}
-
-	
-	@Test
-	public void testSetArtifactVersion() throws Exception {
-		Artifact testSubject;
-		String artifactVersion = "";
-
-		// default test
-		testSubject = createTestSubject();
-		testSubject.setArtifactVersion(artifactVersion);
-	}
-
-	
-	@Test
-	public void testSetGeneratedFromUUID() throws Exception {
-		Artifact testSubject;
-		String generatedFromUUID = "";
-
-		// default test
-		testSubject = createTestSubject();
-		testSubject.setGeneratedFromUUID(generatedFromUUID);
-	}
-
-	
-	@Test
-	public void testHashCode() throws Exception {
-		Artifact testSubject;
-		int result;
-
-		// default test
-		testSubject = createTestSubject();
-		testSubject.setArtifactUUID("48a52540-8772-4368-9cdb-1f124ea5c931");
-		result = testSubject.hashCode();
-	}
-
-	
-	@Test
-	public void testEquals() throws Exception {
-		Artifact testSubject;
-		Object o = null;
-		boolean result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.equals(o);
-	}
-}
\ No newline at end of file
diff --git a/vid-app-common/src/test/java/org/openecomp/vid/asdc/beans/ResourceTest.java b/vid-app-common/src/test/java/org/openecomp/vid/asdc/beans/ResourceTest.java
deleted file mode 100644
index b730560..0000000
--- a/vid-app-common/src/test/java/org/openecomp/vid/asdc/beans/ResourceTest.java
+++ /dev/null
@@ -1,391 +0,0 @@
-package org.openecomp.vid.asdc.beans;
-
-import java.util.Collection;
-
-import org.junit.Test;
-import org.openecomp.vid.asdc.beans.Resource.LifecycleState;
-import org.openecomp.vid.asdc.beans.Resource.Type;
-
-
-public class ResourceTest {
-
-	private Resource createTestSubject() {
-		return new Resource();
-	}
-
-
-	@Test
-	public void testGetUuid() throws Exception {
-		Resource testSubject;
-		String result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.getUuid();
-	}
-
-
-	@Test
-	public void testGetInvariantUUID() throws Exception {
-		Resource testSubject;
-		String result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.getInvariantUUID();
-	}
-
-
-	@Test
-	public void testGetName() throws Exception {
-		Resource testSubject;
-		String result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.getName();
-	}
-
-
-	@Test
-	public void testGetDescription() throws Exception {
-		Resource testSubject;
-		String result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.getDescription();
-	}
-
-
-	@Test
-	public void testGetVersion() throws Exception {
-		Resource testSubject;
-		String result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.getVersion();
-	}
-
-
-	@Test
-	public void testGetToscaModelURL() throws Exception {
-		Resource testSubject;
-		String result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.getToscaModelURL();
-	}
-
-
-	@Test
-	public void testGetCategory() throws Exception {
-		Resource testSubject;
-		String result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.getCategory();
-	}
-
-
-	@Test
-	public void testGetSubCategory() throws Exception {
-		Resource testSubject;
-		String result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.getSubCategory();
-	}
-
-
-	@Test
-	public void testGetResourceType() throws Exception {
-		Resource testSubject;
-		Type result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.getResourceType();
-	}
-
-
-	@Test
-	public void testGetLifecycleState() throws Exception {
-		Resource testSubject;
-		LifecycleState result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.getLifecycleState();
-	}
-
-
-	@Test
-	public void testGetLastUpdaterUserId() throws Exception {
-		Resource testSubject;
-		String result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.getLastUpdaterUserId();
-	}
-
-	
-	@Test
-	public void testGetLastUpdaterFullName() throws Exception {
-		Resource testSubject;
-		String result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.getLastUpdaterFullName();
-	}
-
-
-	@Test
-	public void testGetToscaModel() throws Exception {
-		Resource testSubject;
-		String result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.getToscaModel();
-	}
-
-
-	@Test
-	public void testGetToscaResourceName() throws Exception {
-		Resource testSubject;
-		String result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.getToscaResourceName();
-	}
-
-
-	@Test
-	public void testGetArtifacts() throws Exception {
-		Resource testSubject;
-		Collection<Artifact> result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.getArtifacts();
-	}
-
-
-	@Test
-	public void testGetResources() throws Exception {
-		Resource testSubject;
-		Collection<SubResource> result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.getResources();
-	}
-
-
-	@Test
-	public void testSetUuid() throws Exception {
-		Resource testSubject;
-		String uuid = "";
-
-		// default test
-		testSubject = createTestSubject();
-		testSubject.setUuid(uuid);
-	}
-
-
-	@Test
-	public void testSetInvariantUUID() throws Exception {
-		Resource testSubject;
-		String invariantUUID = "";
-
-		// default test
-		testSubject = createTestSubject();
-		testSubject.setInvariantUUID(invariantUUID);
-	}
-
-
-	@Test
-	public void testSetName() throws Exception {
-		Resource testSubject;
-		String name = "";
-
-		// default test
-		testSubject = createTestSubject();
-		testSubject.setName(name);
-	}
-
-
-	@Test
-	public void testSetDescription() throws Exception {
-		Resource testSubject;
-		String description = "";
-
-		// default test
-		testSubject = createTestSubject();
-		testSubject.setDescription(description);
-	}
-
-
-	@Test
-	public void testSetVersion() throws Exception {
-		Resource testSubject;
-		String version = "";
-
-		// default test
-		testSubject = createTestSubject();
-		testSubject.setVersion(version);
-	}
-
-
-	@Test
-	public void testSetToscaModelURL() throws Exception {
-		Resource testSubject;
-		String toscaModelURL = "";
-
-		// default test
-		testSubject = createTestSubject();
-		testSubject.setToscaModelURL(toscaModelURL);
-	}
-
-
-	@Test
-	public void testSetCategory() throws Exception {
-		Resource testSubject;
-		String category = "";
-
-		// default test
-		testSubject = createTestSubject();
-		testSubject.setCategory(category);
-	}
-
-
-	@Test
-	public void testSetSubCategory() throws Exception {
-		Resource testSubject;
-		String subCategory = "";
-
-		// default test
-		testSubject = createTestSubject();
-		testSubject.setSubCategory(subCategory);
-	}
-
-
-	@Test
-	public void testSetResourceType() throws Exception {
-		Resource testSubject;
-		Type resourceType = null;
-
-		// default test
-		testSubject = createTestSubject();
-		testSubject.setResourceType(resourceType);
-	}
-
-
-	@Test
-	public void testSetLifecycleState() throws Exception {
-		Resource testSubject;
-		LifecycleState lifecycleState = null;
-
-		// default test
-		testSubject = createTestSubject();
-		testSubject.setLifecycleState(lifecycleState);
-	}
-
-
-	@Test
-	public void testSetLastUpdaterUserId() throws Exception {
-		Resource testSubject;
-		String lastUpdaterUserId = "";
-
-		// default test
-		testSubject = createTestSubject();
-		testSubject.setLastUpdaterUserId(lastUpdaterUserId);
-	}
-
-
-	@Test
-	public void testSetLastUpdaterFullName() throws Exception {
-		Resource testSubject;
-		String lastUpdaterFullName = "";
-
-		// default test
-		testSubject = createTestSubject();
-		testSubject.setLastUpdaterFullName(lastUpdaterFullName);
-	}
-
-
-	@Test
-	public void testSetToscaModel() throws Exception {
-		Resource testSubject;
-		String toscaModel = "";
-
-		// default test
-		testSubject = createTestSubject();
-		testSubject.setToscaModel(toscaModel);
-	}
-
-
-	@Test
-	public void testSetToscaResourceName() throws Exception {
-		Resource testSubject;
-		String toscaResourceName = "";
-
-		// default test
-		testSubject = createTestSubject();
-		testSubject.setToscaResourceName(toscaResourceName);
-	}
-
-
-	@Test
-	public void testSetArtifacts() throws Exception {
-		Resource testSubject;
-		Collection<Artifact> artifacts = null;
-
-		// default test
-		testSubject = createTestSubject();
-		testSubject.setArtifacts(artifacts);
-	}
-
-
-	@Test
-	public void testSetResources() throws Exception {
-		Resource testSubject;
-		Collection<SubResource> resources = null;
-
-		// default test
-		testSubject = createTestSubject();
-		testSubject.setResources(resources);
-	}
-
-
-	@Test
-	public void testHashCode() throws Exception {
-		Resource testSubject;
-		int result;
-
-		// default test
-		testSubject = createTestSubject();
-		testSubject.setUuid("cb49608f-5a24-4789-b0f7-2595473cb997");
-		result = testSubject.hashCode();
-	}
-
-
-	@Test
-	public void testEquals() throws Exception {
-		Resource testSubject;
-		Object o = null;
-		boolean result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.equals(o);
-	}
-}
\ No newline at end of file
diff --git a/vid-app-common/src/test/java/org/openecomp/vid/asdc/beans/SubResourceTest.java b/vid-app-common/src/test/java/org/openecomp/vid/asdc/beans/SubResourceTest.java
deleted file mode 100644
index 75b0e98..0000000
--- a/vid-app-common/src/test/java/org/openecomp/vid/asdc/beans/SubResourceTest.java
+++ /dev/null
@@ -1,167 +0,0 @@
-package org.openecomp.vid.asdc.beans;
-
-import java.util.Collection;
-
-import org.junit.Test;
-
-
-public class SubResourceTest {
-
-	private SubResource createTestSubject() {
-		return new SubResource();
-	}
-
-
-	@Test
-	public void testGetResourceInstanceName() throws Exception {
-		SubResource testSubject;
-		String result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.getResourceInstanceName();
-	}
-
-
-	@Test
-	public void testGetResourceName() throws Exception {
-		SubResource testSubject;
-		String result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.getResourceName();
-	}
-
-
-	@Test
-	public void testGetResourceInvariantUUID() throws Exception {
-		SubResource testSubject;
-		String result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.getResourceInvariantUUID();
-	}
-
-
-	@Test
-	public void testGetResourceVersion() throws Exception {
-		SubResource testSubject;
-		String result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.getResourceVersion();
-	}
-
-
-	@Test
-	public void testGetResoucreType() throws Exception {
-		SubResource testSubject;
-		String result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.getResoucreType();
-	}
-
-
-	@Test
-	public void testGetResourceUUID() throws Exception {
-		SubResource testSubject;
-		String result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.getResourceUUID();
-	}
-
-
-	@Test
-	public void testGetArtifacts() throws Exception {
-		SubResource testSubject;
-		Collection<Artifact> result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.getArtifacts();
-	}
-
-
-	@Test
-	public void testSetResourceInstanceName() throws Exception {
-		SubResource testSubject;
-		String resourceInstanceName = "";
-
-		// default test
-		testSubject = createTestSubject();
-		testSubject.setResourceInstanceName(resourceInstanceName);
-	}
-
-
-	@Test
-	public void testSetResourceName() throws Exception {
-		SubResource testSubject;
-		String resourceName = "";
-
-		// default test
-		testSubject = createTestSubject();
-		testSubject.setResourceName(resourceName);
-	}
-
-
-	@Test
-	public void testSetResourceInvariantUUID() throws Exception {
-		SubResource testSubject;
-		String resourceInvariantUUID = "";
-
-		// default test
-		testSubject = createTestSubject();
-		testSubject.setResourceInvariantUUID(resourceInvariantUUID);
-	}
-
-
-	@Test
-	public void testSetResourceVersion() throws Exception {
-		SubResource testSubject;
-		String resourceVersion = "";
-
-		// default test
-		testSubject = createTestSubject();
-		testSubject.setResourceVersion(resourceVersion);
-	}
-
-
-	@Test
-	public void testSetResoucreType() throws Exception {
-		SubResource testSubject;
-		String resourceType = "";
-
-		// default test
-		testSubject = createTestSubject();
-		testSubject.setResoucreType(resourceType);
-	}
-
-
-	@Test
-	public void testSetResourceUUID() throws Exception {
-		SubResource testSubject;
-		String resourceUUID = "";
-
-		// default test
-		testSubject = createTestSubject();
-		testSubject.setResourceUUID(resourceUUID);
-	}
-
-
-	@Test
-	public void testSetArtifacts() throws Exception {
-		SubResource testSubject;
-		Collection<Artifact> artifacts = null;
-
-		// default test
-		testSubject = createTestSubject();
-		testSubject.setArtifacts(artifacts);
-	}
-}
\ No newline at end of file
diff --git a/vid-app-common/src/test/java/org/openecomp/vid/asdc/beans/TestSuite.java b/vid-app-common/src/test/java/org/openecomp/vid/asdc/beans/TestSuite.java
deleted file mode 100644
index 861c5c3..0000000
--- a/vid-app-common/src/test/java/org/openecomp/vid/asdc/beans/TestSuite.java
+++ /dev/null
@@ -1,11 +0,0 @@
-package org.openecomp.vid.asdc.beans;
-
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-
-@RunWith(Suite.class)
-@Suite.SuiteClasses(
-
-{ ArtifactTest.class, ResourceTest.class, SubResourceTest.class })
-public class TestSuite { // nothing
-}
diff --git a/vid-app-common/src/test/java/org/openecomp/vid/asdc/beans/tosca/CapabilityTest.java b/vid-app-common/src/test/java/org/openecomp/vid/asdc/beans/tosca/CapabilityTest.java
deleted file mode 100644
index 4eed93b..0000000
--- a/vid-app-common/src/test/java/org/openecomp/vid/asdc/beans/tosca/CapabilityTest.java
+++ /dev/null
@@ -1,124 +0,0 @@
-package org.openecomp.vid.asdc.beans.tosca;
-
-import java.util.Collection;
-import java.util.Map;
-
-import org.junit.Test;
-
-
-public class CapabilityTest {
-
-	private Capability createTestSubject() {
-		return new Capability();
-	}
-
-	
-	@Test
-	public void testGetType() throws Exception {
-		Capability testSubject;
-		String result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.getType();
-	}
-
-	
-	@Test
-	public void testGetDescription() throws Exception {
-		Capability testSubject;
-		String result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.getDescription();
-	}
-
-	
-	@Test
-	public void testGetOccurrences() throws Exception {
-		Capability testSubject;
-		Collection<String> result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.getOccurrences();
-	}
-
-	
-	@Test
-	public void testGetProperties() throws Exception {
-		Capability testSubject;
-		Map<String, Property> result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.getProperties();
-	}
-
-	
-	@Test
-	public void testGetValid_source_types() throws Exception {
-		Capability testSubject;
-		Collection<String> result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.getValid_source_types();
-	}
-
-	
-	@Test
-	public void testSetType() throws Exception {
-		Capability testSubject;
-		String type = "";
-
-		// default test
-		testSubject = createTestSubject();
-		testSubject.setType(type);
-	}
-
-	
-	@Test
-	public void testSetDescription() throws Exception {
-		Capability testSubject;
-		String description = "";
-
-		// default test
-		testSubject = createTestSubject();
-		testSubject.setDescription(description);
-	}
-
-	
-	@Test
-	public void testSetOccurrences() throws Exception {
-		Capability testSubject;
-		Collection<String> occurrences = null;
-
-		// default test
-		testSubject = createTestSubject();
-		testSubject.setOccurrences(occurrences);
-	}
-
-	
-	@Test
-	public void testSetProperties() throws Exception {
-		Capability testSubject;
-		Map<String, Property> properties = null;
-
-		// default test
-		testSubject = createTestSubject();
-		testSubject.setProperties(properties);
-	}
-
-	
-	@Test
-	public void testSetValid_source_types() throws Exception {
-		Capability testSubject;
-		Collection<String> valid_source_types = null;
-
-		// default test
-		testSubject = createTestSubject();
-		testSubject.setValid_source_types(valid_source_types);
-	}
-}
\ No newline at end of file
diff --git a/vid-app-common/src/test/java/org/openecomp/vid/asdc/beans/tosca/ConstraintTest.java b/vid-app-common/src/test/java/org/openecomp/vid/asdc/beans/tosca/ConstraintTest.java
deleted file mode 100644
index fb416f7..0000000
--- a/vid-app-common/src/test/java/org/openecomp/vid/asdc/beans/tosca/ConstraintTest.java
+++ /dev/null
@@ -1,221 +0,0 @@
-package org.openecomp.vid.asdc.beans.tosca;
-
-import java.util.List;
-
-import org.junit.Test;
-
-public class ConstraintTest {
-
-	private Constraint createTestSubject() {
-		return new Constraint();
-	}
-
-	
-	@Test
-	public void testGetvalid_values() throws Exception {
-		Constraint testSubject;
-		List<Object> result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.getvalid_values();
-	}
-
-	
-	@Test
-	public void testGetEqual() throws Exception {
-		Constraint testSubject;
-		Object result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.getEqual();
-	}
-
-	
-	@Test
-	public void testGetGreater_than() throws Exception {
-		Constraint testSubject;
-		Object result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.getGreater_than();
-	}
-
-	
-	@Test
-	public void testGetGreater_or_equal() throws Exception {
-		Constraint testSubject;
-		Object result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.getGreater_or_equal();
-	}
-
-	
-	@Test
-	public void testGetLess_than() throws Exception {
-		Constraint testSubject;
-		Object result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.getLess_than();
-	}
-
-	
-	@Test
-	public void testGetLess_or_equal() throws Exception {
-		Constraint testSubject;
-		Object result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.getLess_or_equal();
-	}
-
-	
-	@Test
-	public void testGetIn_range() throws Exception {
-		Constraint testSubject;
-		List<Object> result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.getIn_range();
-	}
-
-	
-	@Test
-	public void testGetLength() throws Exception {
-		Constraint testSubject;
-		Object result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.getLength();
-	}
-
-	
-	@Test
-	public void testGetMin_length() throws Exception {
-		Constraint testSubject;
-		Object result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.getMin_length();
-	}
-
-	
-	@Test
-	public void testGetMax_length() throws Exception {
-		Constraint testSubject;
-		Object result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.getMax_length();
-	}
-
-	
-	@Test
-	public void testSetvalid_values() throws Exception {
-		Constraint testSubject;
-		List<Object> vlist = null;
-
-		// default test
-		testSubject = createTestSubject();
-		testSubject.setvalid_values(vlist);
-	}
-
-	
-	@Test
-	public void testSetEqual() throws Exception {
-		Constraint testSubject;
-		Object e = null;
-
-		// default test
-		testSubject = createTestSubject();
-		testSubject.setEqual(e);
-	}
-
-	
-	@Test
-	public void testSetGreater_than() throws Exception {
-		Constraint testSubject;
-		Object e = null;
-
-		// default test
-		testSubject = createTestSubject();
-		testSubject.setGreater_than(e);
-	}
-
-	
-	@Test
-	public void testSetLess_than() throws Exception {
-		Constraint testSubject;
-		Object e = null;
-
-		// default test
-		testSubject = createTestSubject();
-		testSubject.setLess_than(e);
-	}
-
-	
-	@Test
-	public void testSetIn_range() throws Exception {
-		Constraint testSubject;
-		List<Object> e = null;
-
-		// default test
-		testSubject = createTestSubject();
-		testSubject.setIn_range(e);
-	}
-
-	
-	@Test
-	public void testSetLength() throws Exception {
-		Constraint testSubject;
-		Object e = null;
-
-		// default test
-		testSubject = createTestSubject();
-		testSubject.setLength(e);
-	}
-
-	
-	@Test
-	public void testSetMin_length() throws Exception {
-		Constraint testSubject;
-		Object e = null;
-
-		// default test
-		testSubject = createTestSubject();
-		testSubject.setMin_length(e);
-	}
-
-	
-	@Test
-	public void testSetMax_length() throws Exception {
-		Constraint testSubject;
-		Object e = null;
-
-		// default test
-		testSubject = createTestSubject();
-		testSubject.setMax_length(e);
-	}
-
-	
-	@Test
-	public void testToString() throws Exception {
-		Constraint testSubject;
-		String result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.toString();
-	}
-}
\ No newline at end of file
diff --git a/vid-app-common/src/test/java/org/openecomp/vid/asdc/beans/tosca/GroupTest.java b/vid-app-common/src/test/java/org/openecomp/vid/asdc/beans/tosca/GroupTest.java
deleted file mode 100644
index d3a1e4b..0000000
--- a/vid-app-common/src/test/java/org/openecomp/vid/asdc/beans/tosca/GroupTest.java
+++ /dev/null
@@ -1,124 +0,0 @@
-package org.openecomp.vid.asdc.beans.tosca;
-
-import java.util.Collection;
-import java.util.Map;
-
-import org.junit.Test;
-
-
-public class GroupTest {
-
-	private Group createTestSubject() {
-		return new Group();
-	}
-
-	
-	@Test
-	public void testGetMetadata() throws Exception {
-		Group testSubject;
-		ToscaMetadata result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.getMetadata();
-	}
-
-	
-	@Test
-	public void testSetMetadata() throws Exception {
-		Group testSubject;
-		ToscaMetadata metadata = null;
-
-		// default test
-		testSubject = createTestSubject();
-		testSubject.setMetadata(metadata);
-	}
-
-	
-	@Test
-	public void testGetMembers() throws Exception {
-		Group testSubject;
-		Collection<String> result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.getMembers();
-	}
-
-	
-	@Test
-	public void testSetMembers() throws Exception {
-		Group testSubject;
-		Collection<String> members = null;
-
-		// default test
-		testSubject = createTestSubject();
-		testSubject.setMembers(members);
-	}
-
-	
-	@Test
-	public void testGetType() throws Exception {
-		Group testSubject;
-		String result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.getType();
-	}
-
-	
-	@Test
-	public void testSetType() throws Exception {
-		Group testSubject;
-		String type = "";
-
-		// default test
-		testSubject = createTestSubject();
-		testSubject.setType(type);
-	}
-
-	
-	@Test
-	public void testGetvf_module_type() throws Exception {
-		Group testSubject;
-		String result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.getvf_module_type();
-	}
-
-	
-	@Test
-	public void testSetvf_module_type() throws Exception {
-		Group testSubject;
-		String vf_module_type = "";
-
-		// default test
-		testSubject = createTestSubject();
-		testSubject.setvf_module_type(vf_module_type);
-	}
-
-	
-	@Test
-	public void testGetProperties() throws Exception {
-		Group testSubject;
-		Map<String, Object> result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.getProperties();
-	}
-
-	
-	@Test
-	public void testSetProperties() throws Exception {
-		Group testSubject;
-		Map<String, Object> properties = null;
-
-		// default test
-		testSubject = createTestSubject();
-		testSubject.setProperties(properties);
-	}
-}
\ No newline at end of file
diff --git a/vid-app-common/src/test/java/org/openecomp/vid/asdc/beans/tosca/NodeTemplateTest.java b/vid-app-common/src/test/java/org/openecomp/vid/asdc/beans/tosca/NodeTemplateTest.java
deleted file mode 100644
index 8917780..0000000
--- a/vid-app-common/src/test/java/org/openecomp/vid/asdc/beans/tosca/NodeTemplateTest.java
+++ /dev/null
@@ -1,92 +0,0 @@
-package org.openecomp.vid.asdc.beans.tosca;
-
-import java.util.Map;
-
-import org.junit.Test;
-
-public class NodeTemplateTest {
-
-	private NodeTemplate createTestSubject() {
-		return new NodeTemplate();
-	}
-
-	@Test
-	public void testGetType() throws Exception {
-		NodeTemplate testSubject;
-		String result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.getType();
-	}
-
-	@Test
-	public void testSetType() throws Exception {
-		NodeTemplate testSubject;
-		String type = "";
-
-		// default test
-		testSubject = createTestSubject();
-		testSubject.setType(type);
-	}
-
-	@Test
-	public void testGetMetadata() throws Exception {
-		NodeTemplate testSubject;
-		ToscaMetadata result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.getMetadata();
-	}
-
-	@Test
-	public void testSetMetadata() throws Exception {
-		NodeTemplate testSubject;
-		ToscaMetadata metadata = null;
-
-		// default test
-		testSubject = createTestSubject();
-		testSubject.setMetadata(metadata);
-	}
-
-	@Test
-	public void testGetProperties() throws Exception {
-		NodeTemplate testSubject;
-		Map<String, Object> result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.getProperties();
-	}
-
-	@Test
-	public void testSetProperties() throws Exception {
-		NodeTemplate testSubject;
-		Map<String, Object> properties = null;
-
-		// default test
-		testSubject = createTestSubject();
-		testSubject.setProperties(properties);
-	}
-
-	@Test
-	public void testGetRequirements() throws Exception {
-		NodeTemplate testSubject;
-		Object result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.getRequirements();
-	}
-
-	@Test
-	public void testSetRequirements() throws Exception {
-		NodeTemplate testSubject;
-		Object requirements = null;
-
-		// default test
-		testSubject = createTestSubject();
-		testSubject.setRequirements(requirements);
-	}
-}
\ No newline at end of file
diff --git a/vid-app-common/src/test/java/org/openecomp/vid/asdc/beans/tosca/TestSuite.java b/vid-app-common/src/test/java/org/openecomp/vid/asdc/beans/tosca/TestSuite.java
deleted file mode 100644
index 40e0868..0000000
--- a/vid-app-common/src/test/java/org/openecomp/vid/asdc/beans/tosca/TestSuite.java
+++ /dev/null
@@ -1,12 +0,0 @@
-package org.openecomp.vid.asdc.beans.tosca;
-
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-
-@RunWith(Suite.class)
-@Suite.SuiteClasses(
-
-{ GroupTest.class, TopologyTemplateTest.class, ToscaModelTest.class, CapabilityTest.class, ToscaMetadataTest.class,
-		ConstraintTest.class, NodeTemplateTest.class })
-public class TestSuite { // nothing
-}
diff --git a/vid-app-common/src/test/java/org/openecomp/vid/asdc/beans/tosca/TopologyTemplateTest.java b/vid-app-common/src/test/java/org/openecomp/vid/asdc/beans/tosca/TopologyTemplateTest.java
deleted file mode 100644
index a3b96c2..0000000
--- a/vid-app-common/src/test/java/org/openecomp/vid/asdc/beans/tosca/TopologyTemplateTest.java
+++ /dev/null
@@ -1,101 +0,0 @@
-package org.openecomp.vid.asdc.beans.tosca;
-
-import java.util.Map;
-
-import org.junit.Test;
-
-
-public class TopologyTemplateTest {
-
-	private TopologyTemplate createTestSubject() {
-		return new TopologyTemplate();
-	}
-
-	
-	@Test
-	public void testGetsubstitution_mappings() throws Exception {
-		TopologyTemplate testSubject;
-		SubstitutionMappings result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.getsubstitution_mappings();
-	}
-
-	
-	@Test
-	public void testSetsubstitution_mappings() throws Exception {
-		TopologyTemplate testSubject;
-		SubstitutionMappings substitution_mappings = null;
-
-		// default test
-		testSubject = createTestSubject();
-		testSubject.setsubstitution_mappings(substitution_mappings);
-	}
-
-	
-	@Test
-	public void testGetInputs() throws Exception {
-		TopologyTemplate testSubject;
-		Map<String, Input> result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.getInputs();
-	}
-
-	
-	@Test
-	public void testSetInputs() throws Exception {
-		TopologyTemplate testSubject;
-		Map<String, Input> inputs = null;
-
-		// default test
-		testSubject = createTestSubject();
-		testSubject.setInputs(inputs);
-	}
-
-	
-	@Test
-	public void testGetnode_templates() throws Exception {
-		TopologyTemplate testSubject;
-		Map<String, NodeTemplate> result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.getnode_templates();
-	}
-
-	
-	@Test
-	public void testSetnode_templates() throws Exception {
-		TopologyTemplate testSubject;
-		Map<String, NodeTemplate> node_templates = null;
-
-		// default test
-		testSubject = createTestSubject();
-		testSubject.setnode_templates(node_templates);
-	}
-
-	
-	@Test
-	public void testGetGroups() throws Exception {
-		TopologyTemplate testSubject;
-		Map<String, Group> result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.getGroups();
-	}
-
-	
-	@Test
-	public void testSetGroups() throws Exception {
-		TopologyTemplate testSubject;
-		Map<String, Group> groups = null;
-
-		// default test
-		testSubject = createTestSubject();
-		testSubject.setGroups(groups);
-	}
-}
\ No newline at end of file
diff --git a/vid-app-common/src/test/java/org/openecomp/vid/asdc/beans/tosca/ToscaMetadataTest.java b/vid-app-common/src/test/java/org/openecomp/vid/asdc/beans/tosca/ToscaMetadataTest.java
deleted file mode 100644
index 4c6fed5..0000000
--- a/vid-app-common/src/test/java/org/openecomp/vid/asdc/beans/tosca/ToscaMetadataTest.java
+++ /dev/null
@@ -1,443 +0,0 @@
-package org.openecomp.vid.asdc.beans.tosca;
-
-import org.junit.Test;
-
-public class ToscaMetadataTest {
-
-	private ToscaMetadata createTestSubject() {
-		return new ToscaMetadata();
-	}
-
-	@Test
-	public void testGetType() throws Exception {
-		ToscaMetadata testSubject;
-		String result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.getType();
-	}
-
-	@Test
-	public void testGetInvariantUUID() throws Exception {
-		ToscaMetadata testSubject;
-		String result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.getInvariantUUID();
-	}
-
-	@Test
-	public void testGetCustomizationUUID() throws Exception {
-		ToscaMetadata testSubject;
-		String result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.getCustomizationUUID();
-	}
-
-	@Test
-	public void testGetUUID() throws Exception {
-		ToscaMetadata testSubject;
-		String result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.getUUID();
-	}
-
-	@Test
-	public void testGetVersion() throws Exception {
-		ToscaMetadata testSubject;
-		String result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.getVersion();
-	}
-
-	@Test
-	public void testGetName() throws Exception {
-		ToscaMetadata testSubject;
-		String result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.getName();
-	}
-
-	@Test
-	public void testGetDescription() throws Exception {
-		ToscaMetadata testSubject;
-		String result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.getDescription();
-	}
-
-	@Test
-	public void testGetCategory() throws Exception {
-		ToscaMetadata testSubject;
-		String result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.getCategory();
-	}
-
-	@Test
-	public void testGetSubcategory() throws Exception {
-		ToscaMetadata testSubject;
-		String result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.getSubcategory();
-	}
-
-	@Test
-	public void testGetResourceVendor() throws Exception {
-		ToscaMetadata testSubject;
-		String result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.getResourceVendor();
-	}
-
-	@Test
-	public void testGetResourceVendorRelease() throws Exception {
-		ToscaMetadata testSubject;
-		String result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.getResourceVendorRelease();
-	}
-
-	@Test
-	public void testGetServiceEcompNaming() throws Exception {
-		ToscaMetadata testSubject;
-		String result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.getServiceEcompNaming();
-	}
-
-	@Test
-	public void testGetNamingPolicy() throws Exception {
-		ToscaMetadata testSubject;
-		String result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.getNamingPolicy();
-	}
-
-	@Test
-	public void testIsServiceHoming() throws Exception {
-		ToscaMetadata testSubject;
-		boolean result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.isServiceHoming();
-	}
-
-	@Test
-	public void testIsEcompGeneratedNaming() throws Exception {
-		ToscaMetadata testSubject;
-		boolean result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.isEcompGeneratedNaming();
-	}
-
-	@Test
-	public void testSetType() throws Exception {
-		ToscaMetadata testSubject;
-		String type = "";
-
-		// default test
-		testSubject = createTestSubject();
-		testSubject.setType(type);
-	}
-
-	@Test
-	public void testSetInvariantUUID() throws Exception {
-		ToscaMetadata testSubject;
-		String invariantUUID = "";
-
-		// default test
-		testSubject = createTestSubject();
-		testSubject.setInvariantUUID(invariantUUID);
-	}
-
-	@Test
-	public void testSetNamingPolicy() throws Exception {
-		ToscaMetadata testSubject;
-		String namingPolicy = "";
-
-		// default test
-		testSubject = createTestSubject();
-		testSubject.setNamingPolicy(namingPolicy);
-	}
-
-	@Test
-	public void testSetUUID() throws Exception {
-		ToscaMetadata testSubject;
-		String uuid = "";
-
-		// default test
-		testSubject = createTestSubject();
-		testSubject.setUUID(uuid);
-	}
-
-	@Test
-	public void testSetCustomizationUUID() throws Exception {
-		ToscaMetadata testSubject;
-		String u = "";
-
-		// default test
-		testSubject = createTestSubject();
-		testSubject.setCustomizationUUID(u);
-	}
-
-	@Test
-	public void testSetVersion() throws Exception {
-		ToscaMetadata testSubject;
-		String version = "";
-
-		// default test
-		testSubject = createTestSubject();
-		testSubject.setVersion(version);
-	}
-
-	@Test
-	public void testSetName() throws Exception {
-		ToscaMetadata testSubject;
-		String name = "";
-
-		// default test
-		testSubject = createTestSubject();
-		testSubject.setName(name);
-	}
-
-	@Test
-	public void testSetDescription() throws Exception {
-		ToscaMetadata testSubject;
-		String description = "";
-
-		// default test
-		testSubject = createTestSubject();
-		testSubject.setDescription(description);
-	}
-
-	@Test
-	public void testSetCategory() throws Exception {
-		ToscaMetadata testSubject;
-		String category = "";
-
-		// default test
-		testSubject = createTestSubject();
-		testSubject.setCategory(category);
-	}
-
-	@Test
-	public void testSetServiceEcompNaming() throws Exception {
-		ToscaMetadata testSubject;
-		String serviceEcompNaming = "";
-
-		// default test
-		testSubject = createTestSubject();
-		testSubject.setServiceEcompNaming(serviceEcompNaming);
-	}
-
-	@Test
-	public void testSetServiceHoming() throws Exception {
-		ToscaMetadata testSubject;
-		boolean serviceHoming = false;
-
-		// default test
-		testSubject = createTestSubject();
-		testSubject.setServiceHoming(serviceHoming);
-	}
-
-	@Test
-	public void testSetEcompGeneratedNaming() throws Exception {
-		ToscaMetadata testSubject;
-		boolean ecompGeneratedNaming = false;
-
-		// default test
-		testSubject = createTestSubject();
-		testSubject.setEcompGeneratedNaming(ecompGeneratedNaming);
-	}
-
-	@Test
-	public void testGettemplate_name() throws Exception {
-		ToscaMetadata testSubject;
-		String result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.gettemplate_name();
-	}
-
-	@Test
-	public void testSettemplate_name() throws Exception {
-		ToscaMetadata testSubject;
-		String template_name = "";
-
-		// default test
-		testSubject = createTestSubject();
-		testSubject.settemplate_name(template_name);
-	}
-
-	
-	@Test
-	public void testSetSubcategory() throws Exception {
-		ToscaMetadata testSubject;
-		String subcategory = "";
-
-		// default test
-		testSubject = createTestSubject();
-		testSubject.setSubcategory(subcategory);
-	}
-
-	
-	@Test
-	public void testSetResourceVendor() throws Exception {
-		ToscaMetadata testSubject;
-		String resourceVendor = "";
-
-		// default test
-		testSubject = createTestSubject();
-		testSubject.setResourceVendor(resourceVendor);
-	}
-
-	
-	@Test
-	public void testSetResourceVendorRelease() throws Exception {
-		ToscaMetadata testSubject;
-		String resourceVendorRelease = "";
-
-		// default test
-		testSubject = createTestSubject();
-		testSubject.setResourceVendorRelease(resourceVendorRelease);
-	}
-
-	
-	@Test
-	public void testGetVfModuleModelName() throws Exception {
-		ToscaMetadata testSubject;
-		String result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.getVfModuleModelName();
-	}
-
-	
-	@Test
-	public void testSetVfModuleModelName() throws Exception {
-		ToscaMetadata testSubject;
-		String vfModuleModelName = "";
-
-		// default test
-		testSubject = createTestSubject();
-		testSubject.setVfModuleModelName(vfModuleModelName);
-	}
-
-	
-	@Test
-	public void testGetVfModuleModelInvariantUUID() throws Exception {
-		ToscaMetadata testSubject;
-		String result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.getVfModuleModelInvariantUUID();
-	}
-
-	
-	@Test
-	public void testSetVfModuleModelInvariantUUID() throws Exception {
-		ToscaMetadata testSubject;
-		String vfModuleModelInvariantUUID = "";
-
-		// default test
-		testSubject = createTestSubject();
-		testSubject.setVfModuleModelInvariantUUID(vfModuleModelInvariantUUID);
-	}
-
-	
-	@Test
-	public void testGetVfModuleModelUUID() throws Exception {
-		ToscaMetadata testSubject;
-		String result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.getVfModuleModelUUID();
-	}
-
-	
-	@Test
-	public void testSetVfModuleModelUUID() throws Exception {
-		ToscaMetadata testSubject;
-		String vfModuleModelUUID = "";
-
-		// default test
-		testSubject = createTestSubject();
-		testSubject.setVfModuleModelUUID(vfModuleModelUUID);
-	}
-
-	
-	@Test
-	public void testGetVfModuleModelVersion() throws Exception {
-		ToscaMetadata testSubject;
-		String result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.getVfModuleModelVersion();
-	}
-
-	
-	@Test
-	public void testSetVfModuleModelVersion() throws Exception {
-		ToscaMetadata testSubject;
-		String vfModuleModelVersion = "";
-
-		// default test
-		testSubject = createTestSubject();
-		testSubject.setVfModuleModelVersion(vfModuleModelVersion);
-	}
-
-	
-	@Test
-	public void testSetVfModuleModelCustomizationUUID() throws Exception {
-		ToscaMetadata testSubject;
-		String u = "";
-
-		// default test
-		testSubject = createTestSubject();
-		testSubject.setVfModuleModelCustomizationUUID(u);
-	}
-
-	
-	@Test
-	public void testGetVfModuleModelCustomizationUUID() throws Exception {
-		ToscaMetadata testSubject;
-		String result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.getVfModuleModelCustomizationUUID();
-	}
-}
\ No newline at end of file
diff --git a/vid-app-common/src/test/java/org/openecomp/vid/asdc/beans/tosca/ToscaModelTest.java b/vid-app-common/src/test/java/org/openecomp/vid/asdc/beans/tosca/ToscaModelTest.java
deleted file mode 100644
index 6fb6f89..0000000
--- a/vid-app-common/src/test/java/org/openecomp/vid/asdc/beans/tosca/ToscaModelTest.java
+++ /dev/null
@@ -1,146 +0,0 @@
-package org.openecomp.vid.asdc.beans.tosca;
-
-import java.util.Collection;
-import java.util.Map;
-
-import org.junit.Test;
-
-
-public class ToscaModelTest {
-
-	private ToscaModel createTestSubject() {
-		return new ToscaModel();
-	}
-
-	
-	@Test
-	public void testGetMetadata() throws Exception {
-		ToscaModel testSubject;
-		ToscaMetadata result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.getMetadata();
-	}
-
-	
-	@Test
-	public void testSetMetadata() throws Exception {
-		ToscaModel testSubject;
-		ToscaMetadata metadata = null;
-
-		// default test
-		testSubject = createTestSubject();
-		testSubject.setMetadata(metadata);
-	}
-
-	
-	@Test
-	public void testGettosca_definitions_version() throws Exception {
-		ToscaModel testSubject;
-		String result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.gettosca_definitions_version();
-	}
-
-	
-	@Test
-	public void testSettosca_definitions_version() throws Exception {
-		ToscaModel testSubject;
-		String tosca_definitions_version = "";
-
-		// default test
-		testSubject = createTestSubject();
-		testSubject.settosca_definitions_version(tosca_definitions_version);
-	}
-
-	
-	@Test
-	public void testGettopology_template() throws Exception {
-		ToscaModel testSubject;
-		TopologyTemplate result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.gettopology_template();
-	}
-
-	
-	@Test
-	public void testSettopology_template() throws Exception {
-		ToscaModel testSubject;
-		TopologyTemplate topology_template = null;
-
-		// default test
-		testSubject = createTestSubject();
-		testSubject.settopology_template(topology_template);
-	}
-
-	
-	@Test
-	public void testGetDescription() throws Exception {
-		ToscaModel testSubject;
-		String result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.getDescription();
-	}
-
-	
-	@Test
-	public void testSetDescription() throws Exception {
-		ToscaModel testSubject;
-		String description = "";
-
-		// default test
-		testSubject = createTestSubject();
-		testSubject.setDescription(description);
-	}
-
-	
-	@Test
-	public void testGetImports() throws Exception {
-		ToscaModel testSubject;
-		Collection<Map<String, Map<String, String>>> result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.getImports();
-	}
-
-	
-	@Test
-	public void testSetImports() throws Exception {
-		ToscaModel testSubject;
-		Collection<Map<String, Map<String, String>>> imports = null;
-
-		// default test
-		testSubject = createTestSubject();
-		testSubject.setImports(imports);
-	}
-
-	
-	@Test
-	public void testGetnode_types() throws Exception {
-		ToscaModel testSubject;
-		Map<String, Object> result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.getnode_types();
-	}
-
-	
-	@Test
-	public void testSetnode_types() throws Exception {
-		ToscaModel testSubject;
-		Map<String, Object> node_types = null;
-
-		// default test
-		testSubject = createTestSubject();
-		testSubject.setnode_types(node_types);
-	}
-}
\ No newline at end of file
diff --git a/vid-app-common/src/test/java/org/openecomp/vid/client/FakeHttpSessionTest.java b/vid-app-common/src/test/java/org/openecomp/vid/client/FakeHttpSessionTest.java
deleted file mode 100644
index f285585..0000000
--- a/vid-app-common/src/test/java/org/openecomp/vid/client/FakeHttpSessionTest.java
+++ /dev/null
@@ -1,206 +0,0 @@
-package org.openecomp.vid.client;
-
-import java.util.Enumeration;
-
-import javax.servlet.ServletContext;
-import javax.servlet.http.HttpSessionContext;
-
-import org.junit.Test;
-
-
-public class FakeHttpSessionTest {
-
-	private FakeHttpSession createTestSubject() {
-		return new FakeHttpSession();
-	}
-
-
-	@Test
-	public void testGetCreationTime() throws Exception {
-		FakeHttpSession testSubject;
-		long result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.getCreationTime();
-	}
-
-
-	@Test
-	public void testGetId() throws Exception {
-		FakeHttpSession testSubject;
-		String result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.getId();
-	}
-
-
-	@Test
-	public void testGetLastAccessedTime() throws Exception {
-		FakeHttpSession testSubject;
-		long result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.getLastAccessedTime();
-	}
-
-
-	@Test
-	public void testGetServletContext() throws Exception {
-		FakeHttpSession testSubject;
-		ServletContext result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.getServletContext();
-	}
-
-
-	@Test
-	public void testSetMaxInactiveInterval() throws Exception {
-		FakeHttpSession testSubject;
-		int maxInactiveInterval = 0;
-
-		// default test
-		testSubject = createTestSubject();
-		testSubject.setMaxInactiveInterval(maxInactiveInterval);
-	}
-
-
-	@Test
-	public void testGetMaxInactiveInterval() throws Exception {
-		FakeHttpSession testSubject;
-		int result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.getMaxInactiveInterval();
-	}
-
-
-	@Test
-	public void testGetSessionContext() throws Exception {
-		FakeHttpSession testSubject;
-		HttpSessionContext result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.getSessionContext();
-	}
-
-
-	@Test
-	public void testGetAttribute() throws Exception {
-		FakeHttpSession testSubject;
-		String name = "";
-		Object result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.getAttribute(name);
-	}
-
-
-	@Test
-	public void testGetValue() throws Exception {
-		FakeHttpSession testSubject;
-		String name = "";
-		Object result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.getValue(name);
-	}
-
-
-	@Test
-	public void testGetAttributeNames() throws Exception {
-		FakeHttpSession testSubject;
-		Enumeration<String> result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.getAttributeNames();
-	}
-
-
-	@Test
-	public void testGetValueNames() throws Exception {
-		FakeHttpSession testSubject;
-		String[] result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.getValueNames();
-	}
-
-
-	@Test
-	public void testSetAttribute() throws Exception {
-		FakeHttpSession testSubject;
-		String name = "";
-		Object value = null;
-
-		// default test
-		testSubject = createTestSubject();
-		testSubject.setAttribute(name, value);
-	}
-
-
-	@Test
-	public void testPutValue() throws Exception {
-		FakeHttpSession testSubject;
-		String name = "";
-		Object value = null;
-
-		// default test
-		testSubject = createTestSubject();
-		testSubject.putValue(name, value);
-	}
-
-
-	@Test
-	public void testRemoveAttribute() throws Exception {
-		FakeHttpSession testSubject;
-		String name = "";
-
-		// default test
-		testSubject = createTestSubject();
-		testSubject.removeAttribute(name);
-	}
-
-
-	@Test
-	public void testRemoveValue() throws Exception {
-		FakeHttpSession testSubject;
-		String name = "";
-
-		// default test
-		testSubject = createTestSubject();
-		testSubject.removeValue(name);
-	}
-
-
-	@Test
-	public void testInvalidate() throws Exception {
-		FakeHttpSession testSubject;
-
-		// default test
-		testSubject = createTestSubject();
-		testSubject.invalidate();
-	}
-
-
-	@Test
-	public void testIsNew() throws Exception {
-		FakeHttpSession testSubject;
-		boolean result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.isNew();
-	}
-}
\ No newline at end of file
diff --git a/vid-app-common/src/test/java/org/openecomp/vid/client/TestSuite.java b/vid-app-common/src/test/java/org/openecomp/vid/client/TestSuite.java
deleted file mode 100644
index dbbd569..0000000
--- a/vid-app-common/src/test/java/org/openecomp/vid/client/TestSuite.java
+++ /dev/null
@@ -1,11 +0,0 @@
-package org.openecomp.vid.client;
-
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-
-@RunWith(Suite.class)
-@Suite.SuiteClasses(
-
-{ FakeHttpSessionTest.class })
-public class TestSuite { // nothing
-}
diff --git a/vid-app-common/src/test/java/org/openecomp/vid/controller/AaiControllerTest.java b/vid-app-common/src/test/java/org/openecomp/vid/controller/AaiControllerTest.java
deleted file mode 100644
index e342940..0000000
--- a/vid-app-common/src/test/java/org/openecomp/vid/controller/AaiControllerTest.java
+++ /dev/null
@@ -1,88 +0,0 @@
-package org.openecomp.vid.controller;
-
-import javax.servlet.http.HttpServletRequest;
-
-import org.json.simple.JSONObject;
-import org.junit.Test;
-import org.springframework.http.ResponseEntity;
-import org.springframework.web.servlet.ModelAndView;
-
-public class AaiControllerTest {
-
-	private AaiController createTestSubject() {
-		return new AaiController();
-	}
-
-	@Test
-	public void testParseCustomerObjectForTenants() throws Exception {
-		JSONObject jsonObject = null;
-		String result;
-
-		// default test
-		result = AaiController.parseCustomerObjectForTenants(jsonObject);
-	}
-
-	@Test
-	public void testParseServiceSubscriptionObjectForTenants() throws Exception {
-		JSONObject jsonObject = null;
-		String result;
-
-		// default test
-		result = AaiController.parseServiceSubscriptionObjectForTenants(jsonObject);
-	}
-
-	@Test
-	public void testWelcome() throws Exception {
-		AaiController testSubject;
-		HttpServletRequest request = null;
-		ModelAndView result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.welcome(request);
-	}
-
-	@Test
-	public void testGetViewName() throws Exception {
-		AaiController testSubject;
-		String result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.getViewName();
-	}
-
-	@Test
-	public void testSetViewName() throws Exception {
-		AaiController testSubject;
-		String viewName = "";
-
-		// default test
-		testSubject = createTestSubject();
-		testSubject.setViewName(viewName);
-	}
-
-	@Test
-	public void testGetTargetProvStatus() throws Exception {
-		AaiController testSubject;
-		ResponseEntity<String> result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.getTargetProvStatus();
-	}
-
-	@Test
-	public void testViewEditGetTenantsFromServiceType() throws Exception {
-		AaiController testSubject;
-		HttpServletRequest request = null;
-		String globalCustomerId = "";
-		String serviceType = "";
-		ResponseEntity<String> result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.viewEditGetTenantsFromServiceType(request, globalCustomerId, serviceType);
-	}
-
-}
\ No newline at end of file
diff --git a/vid-app-common/src/test/java/org/openecomp/vid/controller/HealthCheckControllerTest.java b/vid-app-common/src/test/java/org/openecomp/vid/controller/HealthCheckControllerTest.java
deleted file mode 100644
index 045ad9a..0000000
--- a/vid-app-common/src/test/java/org/openecomp/vid/controller/HealthCheckControllerTest.java
+++ /dev/null
@@ -1,47 +0,0 @@
-package org.openecomp.vid.controller;
-
-import org.junit.Test;
-import org.openecomp.vid.controller.HealthCheckController.HealthStatus;
-
-public class HealthCheckControllerTest {
-
-	private HealthCheckController createTestSubject() {
-		return new HealthCheckController();
-	}
-
-	@Test
-	public void testGetProfileCount() throws Exception {
-		HealthCheckController testSubject;
-		String driver = "";
-		String URL = "";
-		String username = "";
-		String password = "";
-		int result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.getProfileCount(driver, URL, username, password);
-	}
-
-	@Test
-	public void testGethealthCheckStatusforIDNS() throws Exception {
-		HealthCheckController testSubject;
-		HealthStatus result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.gethealthCheckStatusforIDNS();
-	}
-
-	@Test
-	public void testGetHealthCheck() throws Exception {
-		HealthCheckController testSubject;
-		String UserAgent = "";
-		String ECOMPRequestID = "";
-		HealthStatus result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.getHealthCheck(UserAgent, ECOMPRequestID);
-	}
-}
\ No newline at end of file
diff --git a/vid-app-common/src/test/java/org/openecomp/vid/controller/PropertyControllerTest.java b/vid-app-common/src/test/java/org/openecomp/vid/controller/PropertyControllerTest.java
deleted file mode 100644
index cf7ada4..0000000
--- a/vid-app-common/src/test/java/org/openecomp/vid/controller/PropertyControllerTest.java
+++ /dev/null
@@ -1,58 +0,0 @@
-package org.openecomp.vid.controller;
-
-import javax.servlet.http.HttpServletRequest;
-
-import org.junit.Test;
-import org.springframework.http.ResponseEntity;
-import org.springframework.web.servlet.ModelAndView;
-
-public class PropertyControllerTest {
-
-	private PropertyController createTestSubject() {
-		return new PropertyController();
-	}
-
-	@Test
-	public void testWelcome() throws Exception {
-		PropertyController testSubject;
-		HttpServletRequest request = null;
-		ModelAndView result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.welcome(request);
-	}
-
-	@Test
-	public void testGetViewName() throws Exception {
-		PropertyController testSubject;
-		String result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.getViewName();
-	}
-
-	@Test
-	public void testSetViewName() throws Exception {
-		PropertyController testSubject;
-		String _viewName = "";
-
-		// default test
-		testSubject = createTestSubject();
-		testSubject.setViewName(_viewName);
-	}
-
-	@Test
-	public void testGetProperty() throws Exception {
-		PropertyController testSubject;
-		String name = "";
-		String defaultvalue = "";
-		HttpServletRequest request = null;
-		ResponseEntity<String> result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.getProperty(name, defaultvalue, request);
-	}
-}
\ No newline at end of file
diff --git a/vid-app-common/src/test/java/org/openecomp/vid/controller/TestSuite.java b/vid-app-common/src/test/java/org/openecomp/vid/controller/TestSuite.java
deleted file mode 100644
index c1b1464..0000000
--- a/vid-app-common/src/test/java/org/openecomp/vid/controller/TestSuite.java
+++ /dev/null
@@ -1,12 +0,0 @@
-package org.openecomp.vid.controller;
-
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-
-@RunWith(Suite.class)
-@Suite.SuiteClasses(
-
-{ HealthCheckControllerTest.class, PropertyControllerTest.class, AaiControllerTest.class,
-		ViewEditSubControllerTest.class })
-public class TestSuite { // nothing
-}
diff --git a/vid-app-common/src/test/java/org/openecomp/vid/controller/ViewEditSubControllerTest.java b/vid-app-common/src/test/java/org/openecomp/vid/controller/ViewEditSubControllerTest.java
deleted file mode 100644
index 2b234ee..0000000
--- a/vid-app-common/src/test/java/org/openecomp/vid/controller/ViewEditSubControllerTest.java
+++ /dev/null
@@ -1,45 +0,0 @@
-package org.openecomp.vid.controller;
-
-import javax.servlet.http.HttpServletRequest;
-
-import org.junit.Test;
-import org.springframework.web.servlet.ModelAndView;
-
-public class ViewEditSubControllerTest {
-
-	private ViewEditSubController createTestSubject() {
-		return new ViewEditSubController();
-	}
-
-	@Test
-	public void testWelcome() throws Exception {
-		ViewEditSubController testSubject;
-		HttpServletRequest request = null;
-		ModelAndView result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.welcome(request);
-	}
-
-
-	@Test
-	public void testGetViewName() throws Exception {
-		ViewEditSubController testSubject;
-		String result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.getViewName();
-	}
-
-	@Test
-	public void testSetViewName() throws Exception {
-		ViewEditSubController testSubject;
-		String viewName = "";
-
-		// default test
-		testSubject = createTestSubject();
-		testSubject.setViewName(viewName);
-	}
-}
\ No newline at end of file
diff --git a/vid-app-common/src/test/java/org/openecomp/vid/model/ModelUtilTest.java b/vid-app-common/src/test/java/org/openecomp/vid/model/ModelUtilTest.java
deleted file mode 100644
index 8a9f4de..0000000
--- a/vid-app-common/src/test/java/org/openecomp/vid/model/ModelUtilTest.java
+++ /dev/null
@@ -1,48 +0,0 @@
-package org.openecomp.vid.model;
-
-import org.junit.Assert;
-import org.junit.Test;
-
-
-public class ModelUtilTest {
-
-	private ModelUtil createTestSubject() {
-		return new ModelUtil();
-	}
-
-	
-	@Test
-	public void testGetTags() throws Exception {
-		String[] namespaces;
-		String constantValue = "test";
-		String[] result;
-
-		// test 1
-		namespaces = null;
-		result = ModelUtil.getTags(namespaces, constantValue);
-		Assert.assertNull(result);
-
-		// test 2
-		namespaces = new String[] { "" };
-		result = ModelUtil.getTags(namespaces, constantValue);
-		Assert.assertArrayEquals(new String[] { constantValue }, result);
-	}
-
-	
-	@Test
-	public void testIsType() throws Exception {
-		String type = "a";
-		String[] tags;
-		boolean result;
-
-		// test 1
-		tags = null;
-		result = ModelUtil.isType(type, tags);
-		Assert.assertEquals(false, result);
-
-		// test 2
-		tags = new String[] { "a" };
-		result = ModelUtil.isType(type, tags);
-		Assert.assertEquals(true, result);
-	}
-}
\ No newline at end of file
diff --git a/vid-app-common/src/test/java/org/openecomp/vid/model/NewNodeTest.java b/vid-app-common/src/test/java/org/openecomp/vid/model/NewNodeTest.java
deleted file mode 100644
index fb75c74..0000000
--- a/vid-app-common/src/test/java/org/openecomp/vid/model/NewNodeTest.java
+++ /dev/null
@@ -1,212 +0,0 @@
-package org.openecomp.vid.model;
-
-import java.util.Map;
-
-import org.junit.Test;
-import org.openecomp.vid.asdc.beans.tosca.Input;
-
-
-public class NewNodeTest {
-
-	private NewNode createTestSubject() {
-		return new NewNode();
-	}
-
-	
-	@Test
-	public void testGetUuid() throws Exception {
-		NewNode testSubject;
-		String result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.getUuid();
-	}
-
-	
-	@Test
-	public void testGetInvariantUuid() throws Exception {
-		NewNode testSubject;
-		String result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.getInvariantUuid();
-	}
-
-	
-	@Test
-	public void testGetDescription() throws Exception {
-		NewNode testSubject;
-		String result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.getDescription();
-	}
-
-	
-	@Test
-	public void testGetName() throws Exception {
-		NewNode testSubject;
-		String result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.getName();
-	}
-
-	
-	@Test
-	public void testGetVersion() throws Exception {
-		NewNode testSubject;
-		String result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.getVersion();
-	}
-
-	
-	@Test
-	public void testGetCustomizationUuid() throws Exception {
-		NewNode testSubject;
-		String result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.getCustomizationUuid();
-	}
-
-	
-	@Test
-	public void testGetInputs() throws Exception {
-		NewNode testSubject;
-		Map<String, Input> result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.getInputs();
-	}
-
-	
-	@Test
-	public void testGetCommands() throws Exception {
-		NewNode testSubject;
-		Map<String, CommandProperty> result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.getCommands();
-	}
-
-
-	@Test
-	public void testGetProperties() throws Exception {
-		NewNode testSubject;
-		Map<String, String> result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.getProperties();
-	}
-
-	
-	@Test
-	public void testSetUuid() throws Exception {
-		NewNode testSubject;
-		String uuid = "";
-
-		// default test
-		testSubject = createTestSubject();
-		testSubject.setUuid(uuid);
-	}
-
-	
-	@Test
-	public void testSetInvariantUuid() throws Exception {
-		NewNode testSubject;
-		String invariantUuid = "";
-
-		// default test
-		testSubject = createTestSubject();
-		testSubject.setInvariantUuid(invariantUuid);
-	}
-
-	
-	@Test
-	public void testSetDescription() throws Exception {
-		NewNode testSubject;
-		String description = "";
-
-		// default test
-		testSubject = createTestSubject();
-		testSubject.setDescription(description);
-	}
-
-	
-	@Test
-	public void testSetName() throws Exception {
-		NewNode testSubject;
-		String name = "";
-
-		// default test
-		testSubject = createTestSubject();
-		testSubject.setName(name);
-	}
-
-	
-	@Test
-	public void testSetVersion() throws Exception {
-		NewNode testSubject;
-		String version = "";
-
-		// default test
-		testSubject = createTestSubject();
-		testSubject.setVersion(version);
-	}
-
-	
-	@Test
-	public void testSetCustomizationUuid() throws Exception {
-		NewNode testSubject;
-		String u = "";
-
-		// default test
-		testSubject = createTestSubject();
-		testSubject.setCustomizationUuid(u);
-	}
-
-	
-	@Test
-	public void testSetInputs() throws Exception {
-		NewNode testSubject;
-		Map<String, Input> inputs = null;
-
-		// default test
-		testSubject = createTestSubject();
-		testSubject.setInputs(inputs);
-	}
-
-	
-	@Test
-	public void testSetCommands() throws Exception {
-		NewNode testSubject;
-		Map<String, CommandProperty> m = null;
-
-		// default test
-		testSubject = createTestSubject();
-		testSubject.setCommands(m);
-	}
-
-	
-	@Test
-	public void testSetProperties() throws Exception {
-		NewNode testSubject;
-		Map<String, String> p = null;
-
-		// default test
-		testSubject = createTestSubject();
-		testSubject.setProperties(p);
-	}
-}
\ No newline at end of file
diff --git a/vid-app-common/src/test/java/org/openecomp/vid/model/NewServiceTest.java b/vid-app-common/src/test/java/org/openecomp/vid/model/NewServiceTest.java
deleted file mode 100644
index f789142..0000000
--- a/vid-app-common/src/test/java/org/openecomp/vid/model/NewServiceTest.java
+++ /dev/null
@@ -1,235 +0,0 @@
-package org.openecomp.vid.model;
-
-import java.util.Map;
-
-import org.junit.Test;
-import org.openecomp.vid.asdc.beans.tosca.Input;
-
-public class NewServiceTest {
-
-	private NewService createTestSubject() {
-		return new NewService();
-	}
-
-	
-	@Test
-	public void testGetUuid() throws Exception {
-		NewService testSubject;
-		String result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.getUuid();
-	}
-
-	
-	@Test
-	public void testGetInvariantUuid() throws Exception {
-		NewService testSubject;
-		String result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.getInvariantUuid();
-	}
-
-	
-	@Test
-	public void testGetName() throws Exception {
-		NewService testSubject;
-		String result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.getName();
-	}
-
-	
-	@Test
-	public void testGetVersion() throws Exception {
-		NewService testSubject;
-		String result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.getVersion();
-	}
-
-	
-	@Test
-	public void testGetToscaModelURL() throws Exception {
-		NewService testSubject;
-		String result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.getToscaModelURL();
-	}
-
-	
-	@Test
-	public void testGetCategory() throws Exception {
-		NewService testSubject;
-		String result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.getCategory();
-	}
-
-	
-	@Test
-	public void testGetDescription() throws Exception {
-		NewService testSubject;
-		String result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.getDescription();
-	}
-
-	
-	@Test
-	public void testGetInputs() throws Exception {
-		NewService testSubject;
-		Map<String, Input> result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.getInputs();
-	}
-
-	
-	@Test
-	public void testGetServiceEcompNaming() throws Exception {
-		NewService testSubject;
-		String result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.getServiceEcompNaming();
-	}
-
-	
-	@Test
-	public void testSetUuid() throws Exception {
-		NewService testSubject;
-		String uuid = "";
-
-		// default test
-		testSubject = createTestSubject();
-		testSubject.setUuid(uuid);
-	}
-
-	
-	@Test
-	public void testSetInvariantUuid() throws Exception {
-		NewService testSubject;
-		String invariantUuid = "";
-
-		// default test
-		testSubject = createTestSubject();
-		testSubject.setInvariantUuid(invariantUuid);
-	}
-
-	
-	@Test
-	public void testSetName() throws Exception {
-		NewService testSubject;
-		String name = "";
-
-		// default test
-		testSubject = createTestSubject();
-		testSubject.setName(name);
-	}
-
-	
-	@Test
-	public void testSetVersion() throws Exception {
-		NewService testSubject;
-		String version = "";
-
-		// default test
-		testSubject = createTestSubject();
-		testSubject.setVersion(version);
-	}
-
-	
-	@Test
-	public void testSetToscaModelURL() throws Exception {
-		NewService testSubject;
-		String toscaModelURL = "";
-
-		// default test
-		testSubject = createTestSubject();
-		testSubject.setToscaModelURL(toscaModelURL);
-	}
-
-	
-	@Test
-	public void testSetCategory() throws Exception {
-		NewService testSubject;
-		String category = "";
-
-		// default test
-		testSubject = createTestSubject();
-		testSubject.setCategory(category);
-	}
-
-	
-	@Test
-	public void testSetDescription() throws Exception {
-		NewService testSubject;
-		String description = "";
-
-		// default test
-		testSubject = createTestSubject();
-		testSubject.setDescription(description);
-	}
-
-	
-	@Test
-	public void testSetInputs() throws Exception {
-		NewService testSubject;
-		Map<String, Input> inputs = null;
-
-		// default test
-		testSubject = createTestSubject();
-		testSubject.setInputs(inputs);
-	}
-
-	
-	@Test
-	public void testSetServiceEcompNaming() throws Exception {
-		NewService testSubject;
-		String serviceEcompNaming = "";
-
-		// default test
-		testSubject = createTestSubject();
-		testSubject.setServiceEcompNaming(serviceEcompNaming);
-	}
-
-	
-	@Test
-	public void testHashCode() throws Exception {
-		NewService testSubject;
-		int result;
-
-		// default test
-		testSubject = createTestSubject();
-		testSubject.setUuid("cb49608f-5a24-4789-b0f7-2595473cb997");
-		result = testSubject.hashCode();
-	}
-
-	
-	@Test
-	public void testEquals() throws Exception {
-		NewService testSubject;
-		Object o = null;
-		boolean result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.equals(o);
-	}
-}
\ No newline at end of file
diff --git a/vid-app-common/src/test/java/org/openecomp/vid/model/NewVNFTest.java b/vid-app-common/src/test/java/org/openecomp/vid/model/NewVNFTest.java
deleted file mode 100644
index 5f4f90b..0000000
--- a/vid-app-common/src/test/java/org/openecomp/vid/model/NewVNFTest.java
+++ /dev/null
@@ -1,88 +0,0 @@
-package org.openecomp.vid.model;
-
-import java.util.Map;
-
-import org.junit.Test;
-
-public class NewVNFTest {
-
-	private NewVNF createTestSubject() {
-		return new NewVNF();
-	}
-
-	
-	@Test
-	public void testGetModelCustomizationName() throws Exception {
-		NewVNF testSubject;
-		String result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.getModelCustomizationName();
-	}
-
-	
-	@Test
-	public void testGetVfModules() throws Exception {
-		NewVNF testSubject;
-		Map<String, VfModule> result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.getVfModules();
-	}
-
-	
-	@Test
-	public void testSetVfModules() throws Exception {
-		NewVNF testSubject;
-		Map<String, VfModule> vfModules = null;
-
-		// default test
-		testSubject = createTestSubject();
-		testSubject.setVfModules(vfModules);
-	}
-
-	
-	@Test
-	public void testGetVolumeGroups() throws Exception {
-		NewVNF testSubject;
-		Map<String, VolumeGroup> result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.getVolumeGroups();
-	}
-
-	
-	@Test
-	public void testSetVolumeGroups() throws Exception {
-		NewVNF testSubject;
-		Map<String, VolumeGroup> volumeGroups = null;
-
-		// default test
-		testSubject = createTestSubject();
-		testSubject.setVolumeGroups(volumeGroups);
-	}
-
-	
-	@Test
-	public void testSetModelCustomizationName() throws Exception {
-		NewVNF testSubject;
-		String modelCustomizationName = "";
-
-		// default test
-		testSubject = createTestSubject();
-		testSubject.setModelCustomizationName(modelCustomizationName);
-	}
-
-	
-	@Test
-	public void testNormalizeName() throws Exception {
-		String originalName = "";
-		String result;
-
-		// default test
-		result = NewVNF.normalizeName(originalName);
-	}
-}
\ No newline at end of file
diff --git a/vid-app-common/src/test/java/org/openecomp/vid/model/ServiceModelTest.java b/vid-app-common/src/test/java/org/openecomp/vid/model/ServiceModelTest.java
deleted file mode 100644
index 45f4920..0000000
--- a/vid-app-common/src/test/java/org/openecomp/vid/model/ServiceModelTest.java
+++ /dev/null
@@ -1,123 +0,0 @@
-package org.openecomp.vid.model;
-
-import java.util.Map;
-
-import org.junit.Test;
-import org.openecomp.vid.asdc.beans.tosca.ToscaModel;
-import org.openecomp.vid.model.Service;
-
-public class ServiceModelTest {
-
-	private ServiceModel createTestSubject() {
-		return new ServiceModel();
-	}
-
-	@Test
-	public void testGetService() throws Exception {
-		ServiceModel testSubject;
-		Service result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.getService();
-	}
-
-	@Test
-	public void testGetVnfs() throws Exception {
-		ServiceModel testSubject;
-		Map<String, VNF> result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.getVnfs();
-	}
-
-	@Test
-	public void testGetNetworks() throws Exception {
-		ServiceModel testSubject;
-		Map<String, Network> result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.getNetworks();
-	}
-
-	@Test
-	public void testSetService() throws Exception {
-		ServiceModel testSubject;
-		Service service = null;
-
-		// default test
-		testSubject = createTestSubject();
-		testSubject.setService(service);
-	}
-
-	@Test
-	public void testSetVnfs() throws Exception {
-		ServiceModel testSubject;
-		Map<String, VNF> vnfs = null;
-
-		// default test
-		testSubject = createTestSubject();
-		testSubject.setVnfs(vnfs);
-	}
-
-	@Test
-	public void testSetNetworks() throws Exception {
-		ServiceModel testSubject;
-		Map<String, Network> networks = null;
-
-		// default test
-		testSubject = createTestSubject();
-		testSubject.setNetworks(networks);
-	}
-
-	@Test
-	public void testGetVfModules() throws Exception {
-		ServiceModel testSubject;
-		Map<String, VfModule> result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.getVfModules();
-	}
-
-	@Test
-	public void testGetVolumeGroups() throws Exception {
-		ServiceModel testSubject;
-		Map<String, VolumeGroup> result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.getVolumeGroups();
-	}
-
-	@Test
-	public void testSetVfModules() throws Exception {
-		ServiceModel testSubject;
-		Map<String, VfModule> vfModules = null;
-
-		// default test
-		testSubject = createTestSubject();
-		testSubject.setVfModules(vfModules);
-	}
-
-	@Test
-	public void testSetVolumeGroups() throws Exception {
-		ServiceModel testSubject;
-		Map<String, VolumeGroup> volumeGroups = null;
-
-		// default test
-		testSubject = createTestSubject();
-		testSubject.setVolumeGroups(volumeGroups);
-	}
-
-	@Test
-	public void testAssociateGroups() throws Exception {
-		ServiceModel testSubject;
-
-		// default test
-		testSubject = createTestSubject();
-		testSubject.associateGroups();
-	}
-}
\ No newline at end of file
diff --git a/vid-app-common/src/test/java/org/openecomp/vid/model/TestSuite.java b/vid-app-common/src/test/java/org/openecomp/vid/model/TestSuite.java
deleted file mode 100644
index 3d7f57b..0000000
--- a/vid-app-common/src/test/java/org/openecomp/vid/model/TestSuite.java
+++ /dev/null
@@ -1,12 +0,0 @@
-package org.openecomp.vid.model;
-
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-
-@RunWith(Suite.class)
-@Suite.SuiteClasses(
-
-{ ModelUtilTest.class, NewServiceTest.class, VolumeGroupTest.class, NewNodeTest.class, ServiceModelTest.class,
-		WorkflowTest.class, NewVNFTest.class })
-public class TestSuite { // nothing
-}
diff --git a/vid-app-common/src/test/java/org/openecomp/vid/model/VolumeGroupTest.java b/vid-app-common/src/test/java/org/openecomp/vid/model/VolumeGroupTest.java
deleted file mode 100644
index 038290b..0000000
--- a/vid-app-common/src/test/java/org/openecomp/vid/model/VolumeGroupTest.java
+++ /dev/null
@@ -1,169 +0,0 @@
-package org.openecomp.vid.model;
-
-import org.junit.Test;
-import org.openecomp.vid.asdc.beans.tosca.Group;
-
-
-public class VolumeGroupTest {
-
-	private VolumeGroup createTestSubject() {
-		return new VolumeGroup();
-	}
-
-	
-	@Test
-	public void testGetUuid() throws Exception {
-		VolumeGroup testSubject;
-		String result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.getUuid();
-	}
-
-	
-	@Test
-	public void testGetCustomizationUuid() throws Exception {
-		VolumeGroup testSubject;
-		String result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.getCustomizationUuid();
-	}
-
-	
-	@Test
-	public void testGetModelCustomizationName() throws Exception {
-		VolumeGroup testSubject;
-		String result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.getModelCustomizationName();
-	}
-
-	
-	@Test
-	public void testGetInvariantUuid() throws Exception {
-		VolumeGroup testSubject;
-		String result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.getInvariantUuid();
-	}
-
-	
-	@Test
-	public void testGetDescription() throws Exception {
-		VolumeGroup testSubject;
-		String result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.getDescription();
-	}
-
-	
-	@Test
-	public void testGetName() throws Exception {
-		VolumeGroup testSubject;
-		String result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.getName();
-	}
-
-	
-	@Test
-	public void testGetVersion() throws Exception {
-		VolumeGroup testSubject;
-		String result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.getVersion();
-	}
-
-	
-	@Test
-	public void testSetUuid() throws Exception {
-		VolumeGroup testSubject;
-		String uuid = "";
-
-		// default test
-		testSubject = createTestSubject();
-		testSubject.setUuid(uuid);
-	}
-
-	
-	@Test
-	public void testSetInvariantUuid() throws Exception {
-		VolumeGroup testSubject;
-		String invariantUuid = "";
-
-		// default test
-		testSubject = createTestSubject();
-		testSubject.setInvariantUuid(invariantUuid);
-	}
-
-	
-	@Test
-	public void testSetDescription() throws Exception {
-		VolumeGroup testSubject;
-		String description = "";
-
-		// default test
-		testSubject = createTestSubject();
-		testSubject.setDescription(description);
-	}
-
-	
-	@Test
-	public void testSetName() throws Exception {
-		VolumeGroup testSubject;
-		String name = "";
-
-		// default test
-		testSubject = createTestSubject();
-		testSubject.setName(name);
-	}
-
-	
-	@Test
-	public void testSetVersion() throws Exception {
-		VolumeGroup testSubject;
-		String version = "";
-
-		// default test
-		testSubject = createTestSubject();
-		testSubject.setVersion(version);
-	}
-
-	
-	@Test
-	public void testSetCustomizationUuid() throws Exception {
-		VolumeGroup testSubject;
-		String u = "";
-
-		// default test
-		testSubject = createTestSubject();
-		testSubject.setCustomizationUuid(u);
-	}
-
-	
-	@Test
-	public void testSetModelCustomizationName() throws Exception {
-		VolumeGroup testSubject;
-		String u = "";
-
-		// default test
-		testSubject = createTestSubject();
-		testSubject.setModelCustomizationName(u);
-	}
-
-	
-
-}
\ No newline at end of file
diff --git a/vid-app-common/src/test/java/org/openecomp/vid/model/WorkflowTest.java b/vid-app-common/src/test/java/org/openecomp/vid/model/WorkflowTest.java
deleted file mode 100644
index 5f8ec7d..0000000
--- a/vid-app-common/src/test/java/org/openecomp/vid/model/WorkflowTest.java
+++ /dev/null
@@ -1,72 +0,0 @@
-package org.openecomp.vid.model;
-
-import java.util.Collection;
-
-import org.junit.Test;
-
-public class WorkflowTest {
-
-	private Workflow createTestSubject() {
-		return new Workflow();
-	}
-
-	@Test
-	public void testGetId() throws Exception {
-		Workflow testSubject;
-		int result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.getId();
-	}
-
-	@Test
-	public void testGetWorkflowName() throws Exception {
-		Workflow testSubject;
-		String result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.getWorkflowName();
-	}
-
-	@Test
-	public void testGetVnfNames() throws Exception {
-		Workflow testSubject;
-		Collection<String> result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.getVnfNames();
-	}
-
-	@Test
-	public void testSetId() throws Exception {
-		Workflow testSubject;
-		int id = 0;
-
-		// default test
-		testSubject = createTestSubject();
-		testSubject.setId(id);
-	}
-
-	@Test
-	public void testSetWorkflowName() throws Exception {
-		Workflow testSubject;
-		String workflowName = "";
-
-		// default test
-		testSubject = createTestSubject();
-		testSubject.setWorkflowName(workflowName);
-	}
-
-	@Test
-	public void testSetVnfName() throws Exception {
-		Workflow testSubject;
-		Collection<String> vnfNames = null;
-
-		// default test
-		testSubject = createTestSubject();
-		testSubject.setVnfName(vnfNames);
-	}
-}
\ No newline at end of file
diff --git a/vid-app-common/src/test/java/org/openecomp/vid/mso/MsoLocalClientNewTest.java b/vid-app-common/src/test/java/org/openecomp/vid/mso/MsoLocalClientNewTest.java
deleted file mode 100644
index 6e40973..0000000
--- a/vid-app-common/src/test/java/org/openecomp/vid/mso/MsoLocalClientNewTest.java
+++ /dev/null
@@ -1,169 +0,0 @@
-package org.openecomp.vid.mso;
-
-import org.junit.Test;
-import org.openecomp.vid.changeManagement.RequestDetails;
-
-public class MsoLocalClientNewTest {
-
-	private MsoLocalClientNew createTestSubject() {
-		return new MsoLocalClientNew();
-	}
-
-	@Test
-	public void testCreateSvcInstance() throws Exception {
-		MsoLocalClientNew testSubject;
-		RequestDetails requestDetails = null;
-		String endpoint = "";
-		MsoResponseWrapper result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.createSvcInstance(requestDetails, endpoint);
-	}
-
-	@Test
-	public void testCreateInstance() throws Exception {
-		MsoLocalClientNew testSubject;
-		RequestDetails request = null;
-		String path = "";
-		MsoResponseWrapper result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.createInstance(request, path);
-	}
-
-	@Test
-	public void testCreateVnf() throws Exception {
-		MsoLocalClientNew testSubject;
-		RequestDetails requestDetails = null;
-		String endpoint = "";
-		MsoResponseWrapper result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.createVnf(requestDetails, endpoint);
-	}
-
-	@Test
-	public void testCreateNwInstance() throws Exception {
-		MsoLocalClientNew testSubject;
-		RequestDetails requestDetails = null;
-		String endpoint = "";
-		MsoResponseWrapper result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.createNwInstance(requestDetails, endpoint);
-	}
-
-	@Test
-	public void testCreateVolumeGroupInstance() throws Exception {
-		MsoLocalClientNew testSubject;
-		RequestDetails requestDetails = null;
-		String path = "";
-		MsoResponseWrapper result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.createVolumeGroupInstance(requestDetails, path);
-	}
-
-	@Test
-	public void testCreateVfModuleInstance() throws Exception {
-		MsoLocalClientNew testSubject;
-		RequestDetails requestDetails = null;
-		String endpoint = "";
-		MsoResponseWrapper result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.createVfModuleInstance(requestDetails, endpoint);
-	}
-
-	@Test
-	public void testDeleteSvcInstance() throws Exception {
-		MsoLocalClientNew testSubject;
-		RequestDetails requestDetails = null;
-		String endpoint = "";
-		MsoResponseWrapper result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.deleteSvcInstance(requestDetails, endpoint);
-	}
-
-	@Test
-	public void testDeleteVnf() throws Exception {
-		MsoLocalClientNew testSubject;
-		RequestDetails requestDetails = null;
-		String endpoint = "";
-		MsoResponseWrapper result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.deleteVnf(requestDetails, endpoint);
-	}
-
-	@Test
-	public void testDeleteVfModule() throws Exception {
-		MsoLocalClientNew testSubject;
-		RequestDetails requestDetails = null;
-		String endpoint = "";
-		MsoResponseWrapper result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.deleteVfModule(requestDetails, endpoint);
-	}
-
-	@Test
-	public void testDeleteVolumeGroupInstance() throws Exception {
-		MsoLocalClientNew testSubject;
-		RequestDetails requestDetails = null;
-		String endpoint = "";
-		MsoResponseWrapper result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.deleteVolumeGroupInstance(requestDetails, endpoint);
-	}
-
-	@Test
-	public void testDeleteNwInstance() throws Exception {
-		MsoLocalClientNew testSubject;
-		RequestDetails requestDetails = null;
-		String endpoint = "";
-		MsoResponseWrapper result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.deleteNwInstance(requestDetails, endpoint);
-	}
-
-	@Test
-	public void testGetOrchestrationRequest() throws Exception {
-		MsoLocalClientNew testSubject;
-		String t = "";
-		String sourceId = "";
-		String endpoint = "";
-		RestObject restObject = null;
-
-		// default test
-		testSubject = createTestSubject();
-		testSubject.getOrchestrationRequest(t, sourceId, endpoint, restObject);
-	}
-
-
-	@Test
-	public void testUpdateVnf() throws Exception {
-		MsoLocalClientNew testSubject;
-		RequestDetails requestDetails = null;
-		String vnf_endpoint = "";
-		MsoResponseWrapper result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.updateVnf(requestDetails, vnf_endpoint);
-	}
-}
\ No newline at end of file
diff --git a/vid-app-common/src/test/java/org/openecomp/vid/mso/MsoRestIntTest.java b/vid-app-common/src/test/java/org/openecomp/vid/mso/MsoRestIntTest.java
deleted file mode 100644
index e32e487..0000000
--- a/vid-app-common/src/test/java/org/openecomp/vid/mso/MsoRestIntTest.java
+++ /dev/null
@@ -1,22 +0,0 @@
-package org.openecomp.vid.mso;
-
-import org.junit.Test;
-import org.openecomp.vid.mso.rest.RequestDetails;
-
-public class MsoRestIntTest {
-
-	private MsoRestInt createTestSubject() {
-		return new MsoRestInt();
-	}
-
-	@Test
-	public void testLogRequest() throws Exception {
-		MsoRestInt testSubject;
-		RequestDetails r = null;
-
-		// test 1
-		testSubject = createTestSubject();
-		r = null;
-		testSubject.logRequest(r);
-	}
-}
\ No newline at end of file
diff --git a/vid-app-common/src/test/java/org/openecomp/vid/mso/MsoRestInterfaceTest.java b/vid-app-common/src/test/java/org/openecomp/vid/mso/MsoRestInterfaceTest.java
deleted file mode 100644
index 9c96e11..0000000
--- a/vid-app-common/src/test/java/org/openecomp/vid/mso/MsoRestInterfaceTest.java
+++ /dev/null
@@ -1,21 +0,0 @@
-package org.openecomp.vid.mso;
-
-import org.apache.poi.hssf.record.formula.functions.T;
-import org.junit.Test;
-
-public class MsoRestInterfaceTest {
-
-	private MsoRestInterface createTestSubject() {
-		return new MsoRestInterface();
-	}
-
-	@Test
-	public void testInitMsoClient() throws Exception {
-		MsoRestInterface testSubject;
-
-		// default test
-		testSubject = createTestSubject();
-		testSubject.initMsoClient();
-	}
-
-}
\ No newline at end of file
diff --git a/vid-app-common/src/test/java/org/openecomp/vid/mso/MsoUtilTest.java b/vid-app-common/src/test/java/org/openecomp/vid/mso/MsoUtilTest.java
deleted file mode 100644
index 6a9816e..0000000
--- a/vid-app-common/src/test/java/org/openecomp/vid/mso/MsoUtilTest.java
+++ /dev/null
@@ -1,53 +0,0 @@
-package org.openecomp.vid.mso;
-
-import org.apache.poi.hssf.record.formula.functions.T;
-import org.glassfish.jersey.client.ClientResponse;
-import org.junit.Assert;
-import org.junit.Test;
-
-public class MsoUtilTest {
-
-	private MsoUtil createTestSubject() {
-		return new MsoUtil();
-	}
-
-	@Test
-	public void testWrapResponse() throws Exception {
-		String body = "";
-		int statusCode = 0;
-		MsoResponseWrapper result;
-
-		// default test
-		result = MsoUtil.wrapResponse(body, statusCode);
-	}
-
-
-	@Test
-	public void testWrapResponse_2() throws Exception {
-		RestObject<String> rs = null;
-		MsoResponseWrapper result;
-
-		// test 1
-		result = MsoUtil.wrapResponse(rs);
-		Assert.assertNotNull(result);
-	}
-
-	@Test
-	public void testConvertPojoToString() throws Exception {
-		T t = null;
-		String result;
-
-		// test 1
-		t = null;
-		result = MsoUtil.convertPojoToString(t);
-		Assert.assertEquals("", result);
-	}
-
-	@Test
-	public void testMain() throws Exception {
-		String[] args = new String[] { "" };
-
-		// default test
-		MsoUtil.main(args);
-	}
-}
\ No newline at end of file
diff --git a/vid-app-common/src/test/java/org/openecomp/vid/mso/RestMsoImplementationTest.java b/vid-app-common/src/test/java/org/openecomp/vid/mso/RestMsoImplementationTest.java
deleted file mode 100644
index 1f1e339..0000000
--- a/vid-app-common/src/test/java/org/openecomp/vid/mso/RestMsoImplementationTest.java
+++ /dev/null
@@ -1,44 +0,0 @@
-package org.openecomp.vid.mso;
-
-import org.apache.poi.hssf.record.formula.functions.T;
-import org.junit.Test;
-import org.openecomp.vid.changeManagement.RequestDetails;
-import org.openecomp.vid.changeManagement.RequestDetailsWrapper;
-
-public class RestMsoImplementationTest {
-
-	private RestMsoImplementation createTestSubject() {
-		return new RestMsoImplementation();
-	}	
-
-	@Test
-	public void testInitMsoClient() throws Exception {
-		RestMsoImplementation testSubject;
-
-		// default test
-		testSubject = createTestSubject();
-		testSubject.initMsoClient();
-	}
-
-	@Test
-	public void testLogRequest() throws Exception {
-		RestMsoImplementation testSubject;
-		RequestDetails r = null;
-
-		// test 1
-		testSubject = createTestSubject();
-		r = null;
-		testSubject.logRequest(r);
-	}
-
-	@Test
-	public void testLogRequest_1() throws Exception {
-		RestMsoImplementation testSubject;
-		RequestDetails r = null;
-
-		// test 1
-		testSubject = createTestSubject();
-		r = null;
-		testSubject.logRequest(r);
-	}
-}
\ No newline at end of file
diff --git a/vid-app-common/src/test/java/org/openecomp/vid/mso/TestSuite.java b/vid-app-common/src/test/java/org/openecomp/vid/mso/TestSuite.java
deleted file mode 100644
index aa30935..0000000
--- a/vid-app-common/src/test/java/org/openecomp/vid/mso/TestSuite.java
+++ /dev/null
@@ -1,12 +0,0 @@
-package org.openecomp.vid.mso;
-
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-
-@RunWith(Suite.class)
-@Suite.SuiteClasses(
-
-{ MsoRestIntTest.class, MsoUtilTest.class, MsoRestInterfaceTest.class, MsoLocalClientNewTest.class,
-		RestMsoImplementationTest.class, org.openecomp.vid.mso.rest.TestSuite.class })
-public class TestSuite { // nothing
-}
diff --git a/vid-app-common/src/test/java/org/openecomp/vid/mso/rest/AsyncRequestStatusTest.java b/vid-app-common/src/test/java/org/openecomp/vid/mso/rest/AsyncRequestStatusTest.java
deleted file mode 100644
index 663d1f5..0000000
--- a/vid-app-common/src/test/java/org/openecomp/vid/mso/rest/AsyncRequestStatusTest.java
+++ /dev/null
@@ -1,91 +0,0 @@
-package org.openecomp.vid.mso.rest;
-
-import org.junit.Test;
-import org.openecomp.vid.domain.mso.InstanceIds;
-import org.openecomp.vid.domain.mso.RequestStatus;
-
-
-public class AsyncRequestStatusTest {
-
-	private AsyncRequestStatus createTestSubject() {
-		return new AsyncRequestStatus();
-	}
-
-	
-	@Test
-	public void testGetInstanceIds() throws Exception {
-		AsyncRequestStatus testSubject;
-		InstanceIds result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.getInstanceIds();
-	}
-
-	
-	@Test
-	public void testSetInstanceIds() throws Exception {
-		AsyncRequestStatus testSubject;
-		InstanceIds instanceIds = null;
-
-		// default test
-		testSubject = createTestSubject();
-		testSubject.setInstanceIds(instanceIds);
-	}
-
-	
-	@Test
-	public void testGetRequestStatus() throws Exception {
-		AsyncRequestStatus testSubject;
-		RequestStatus result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.getRequestStatus();
-	}
-
-	
-	@Test
-	public void testSetRequestStatus() throws Exception {
-		AsyncRequestStatus testSubject;
-		RequestStatus requestStatus = null;
-
-		// default test
-		testSubject = createTestSubject();
-		testSubject.setRequestStatus(requestStatus);
-	}
-
-	
-	@Test
-	public void testToString() throws Exception {
-		AsyncRequestStatus testSubject;
-		String result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.toString();
-	}
-
-	
-	@Test
-	public void testHashCode() throws Exception {
-		AsyncRequestStatus testSubject;
-		int result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.hashCode();
-	}
-
-	
-	@Test
-	public void testEquals() throws Exception {
-		AsyncRequestStatus testSubject;
-		Object other = null;
-		boolean result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.equals(other);
-	}
-}
\ No newline at end of file
diff --git a/vid-app-common/src/test/java/org/openecomp/vid/mso/rest/RelatedInstanceTest.java b/vid-app-common/src/test/java/org/openecomp/vid/mso/rest/RelatedInstanceTest.java
deleted file mode 100644
index b3bee44..0000000
--- a/vid-app-common/src/test/java/org/openecomp/vid/mso/rest/RelatedInstanceTest.java
+++ /dev/null
@@ -1,93 +0,0 @@
-package org.openecomp.vid.mso.rest;
-
-import java.util.Map;
-
-import org.junit.Test;
-import org.openecomp.vid.domain.mso.ModelInfo;
-
-
-public class RelatedInstanceTest {
-
-	private RelatedInstance createTestSubject() {
-		return new RelatedInstance();
-	}
-
-	
-	@Test
-	public void testGetModelInfo() throws Exception {
-		RelatedInstance testSubject;
-		ModelInfo result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.getModelInfo();
-	}
-
-	
-	@Test
-	public void testSetModelInfo() throws Exception {
-		RelatedInstance testSubject;
-		ModelInfo modelInfo = null;
-
-		// default test
-		testSubject = createTestSubject();
-		testSubject.setModelInfo(modelInfo);
-	}
-
-	
-	@Test
-	public void testToString() throws Exception {
-		RelatedInstance testSubject;
-		String result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.toString();
-	}
-
-	
-	@Test
-	public void testGetAdditionalProperties() throws Exception {
-		RelatedInstance testSubject;
-		Map<String, Object> result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.getAdditionalProperties();
-	}
-
-	
-	@Test
-	public void testSetAdditionalProperty() throws Exception {
-		RelatedInstance testSubject;
-		String name = "";
-		Object value = null;
-
-		// default test
-		testSubject = createTestSubject();
-		testSubject.setAdditionalProperty(name, value);
-	}
-
-	
-	@Test
-	public void testHashCode() throws Exception {
-		RelatedInstance testSubject;
-		int result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.hashCode();
-	}
-
-	
-	@Test
-	public void testEquals() throws Exception {
-		RelatedInstance testSubject;
-		Object other = null;
-		boolean result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.equals(other);
-	}
-}
\ No newline at end of file
diff --git a/vid-app-common/src/test/java/org/openecomp/vid/mso/rest/RelatedModelTest.java b/vid-app-common/src/test/java/org/openecomp/vid/mso/rest/RelatedModelTest.java
deleted file mode 100644
index b08ff89..0000000
--- a/vid-app-common/src/test/java/org/openecomp/vid/mso/rest/RelatedModelTest.java
+++ /dev/null
@@ -1,93 +0,0 @@
-package org.openecomp.vid.mso.rest;
-
-import java.util.Map;
-
-import org.junit.Test;
-import org.openecomp.vid.domain.mso.ModelInfo;
-
-
-public class RelatedModelTest {
-
-	private RelatedModel createTestSubject() {
-		return new RelatedModel();
-	}
-
-	
-	@Test
-	public void testGetModelInfo() throws Exception {
-		RelatedModel testSubject;
-		ModelInfo result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.getModelInfo();
-	}
-
-	
-	@Test
-	public void testSetModelInfo() throws Exception {
-		RelatedModel testSubject;
-		ModelInfo modelInfo = null;
-
-		// default test
-		testSubject = createTestSubject();
-		testSubject.setModelInfo(modelInfo);
-	}
-
-	
-	@Test
-	public void testToString() throws Exception {
-		RelatedModel testSubject;
-		String result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.toString();
-	}
-
-	
-	@Test
-	public void testGetAdditionalProperties() throws Exception {
-		RelatedModel testSubject;
-		Map<String, Object> result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.getAdditionalProperties();
-	}
-
-	
-	@Test
-	public void testSetAdditionalProperty() throws Exception {
-		RelatedModel testSubject;
-		String name = "";
-		Object value = null;
-
-		// default test
-		testSubject = createTestSubject();
-		testSubject.setAdditionalProperty(name, value);
-	}
-
-	
-	@Test
-	public void testHashCode() throws Exception {
-		RelatedModel testSubject;
-		int result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.hashCode();
-	}
-
-	
-	@Test
-	public void testEquals() throws Exception {
-		RelatedModel testSubject;
-		Object other = null;
-		boolean result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.equals(other);
-	}
-}
\ No newline at end of file
diff --git a/vid-app-common/src/test/java/org/openecomp/vid/mso/rest/RequestDetailsTest.java b/vid-app-common/src/test/java/org/openecomp/vid/mso/rest/RequestDetailsTest.java
deleted file mode 100644
index 41fbc7a..0000000
--- a/vid-app-common/src/test/java/org/openecomp/vid/mso/rest/RequestDetailsTest.java
+++ /dev/null
@@ -1,182 +0,0 @@
-package org.openecomp.vid.mso.rest;
-
-import java.util.List;
-import java.util.Map;
-
-import org.junit.Test;
-import org.openecomp.vid.domain.mso.*;
-
-
-public class RequestDetailsTest {
-
-	private RequestDetails createTestSubject() {
-		return new RequestDetails();
-	}
-
-	
-	@Test
-	public void testGetCloudConfiguration() throws Exception {
-		RequestDetails testSubject;
-		CloudConfiguration result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.getCloudConfiguration();
-	}
-
-	
-	@Test
-	public void testSetCloudConfiguration() throws Exception {
-		RequestDetails testSubject;
-		CloudConfiguration cloudConfiguration = null;
-
-		// default test
-		testSubject = createTestSubject();
-		testSubject.setCloudConfiguration(cloudConfiguration);
-	}
-
-	
-	@Test
-	public void testGetModelInfo() throws Exception {
-		RequestDetails testSubject;
-		ModelInfo result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.getModelInfo();
-	}
-
-	
-	@Test
-	public void testSetModelInfo() throws Exception {
-		RequestDetails testSubject;
-		ModelInfo modelInfo = null;
-
-		// default test
-		testSubject = createTestSubject();
-		testSubject.setModelInfo(modelInfo);
-	}
-
-	
-	@Test
-	public void testGetRelatedInstanceList() throws Exception {
-		RequestDetails testSubject;
-		List<RelatedModel> result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.getRelatedInstanceList();
-	}
-
-	
-	@Test
-	public void testSetRelatedInstanceList() throws Exception {
-		RequestDetails testSubject;
-		List<RelatedModel> relatedInstanceList = null;
-
-		// default test
-		testSubject = createTestSubject();
-		testSubject.setRelatedInstanceList(relatedInstanceList);
-	}
-
-	
-	@Test
-	public void testGetRequestInfo() throws Exception {
-		RequestDetails testSubject;
-		RequestInfo result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.getRequestInfo();
-	}
-
-	
-	@Test
-	public void testSetRequestInfo() throws Exception {
-		RequestDetails testSubject;
-		RequestInfo requestInfo = null;
-
-		// default test
-		testSubject = createTestSubject();
-		testSubject.setRequestInfo(requestInfo);
-	}
-
-	
-	@Test
-	public void testGetSubscriberInfo() throws Exception {
-		RequestDetails testSubject;
-		SubscriberInfo result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.getSubscriberInfo();
-	}
-
-	
-	@Test
-	public void testSetSubscriberInfo() throws Exception {
-		RequestDetails testSubject;
-		SubscriberInfo subscriberInfo = null;
-
-		// default test
-		testSubject = createTestSubject();
-		testSubject.setSubscriberInfo(subscriberInfo);
-	}
-
-	
-	@Test
-	public void testToString() throws Exception {
-		RequestDetails testSubject;
-		String result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.toString();
-	}
-
-	
-	@Test
-	public void testGetAdditionalProperties() throws Exception {
-		RequestDetails testSubject;
-		Map<String, Object> result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.getAdditionalProperties();
-	}
-
-	
-	@Test
-	public void testSetAdditionalProperty() throws Exception {
-		RequestDetails testSubject;
-		String name = "";
-		Object value = null;
-
-		// default test
-		testSubject = createTestSubject();
-		testSubject.setAdditionalProperty(name, value);
-	}
-
-	
-	@Test
-	public void testHashCode() throws Exception {
-		RequestDetails testSubject;
-		int result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.hashCode();
-	}
-
-	
-	@Test
-	public void testEquals() throws Exception {
-		RequestDetails testSubject;
-		Object other = null;
-		boolean result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.equals(other);
-	}
-}
\ No newline at end of file
diff --git a/vid-app-common/src/test/java/org/openecomp/vid/mso/rest/TestSuite.java b/vid-app-common/src/test/java/org/openecomp/vid/mso/rest/TestSuite.java
deleted file mode 100644
index ef86682..0000000
--- a/vid-app-common/src/test/java/org/openecomp/vid/mso/rest/TestSuite.java
+++ /dev/null
@@ -1,12 +0,0 @@
-package org.openecomp.vid.mso.rest;
-
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-
-@RunWith(Suite.class)
-@Suite.SuiteClasses(
-
-{ RelatedModelTest.class, AsyncRequestStatusTest.class, RequestDetailsTest.class, 
-		RelatedInstanceTest.class })
-public class TestSuite { // nothing
-}
diff --git a/vid-app-common/src/test/java/org/openecomp/vid/policy/PolicyResponseWrapperTest.java b/vid-app-common/src/test/java/org/openecomp/vid/policy/PolicyResponseWrapperTest.java
deleted file mode 100644
index 21a3372..0000000
--- a/vid-app-common/src/test/java/org/openecomp/vid/policy/PolicyResponseWrapperTest.java
+++ /dev/null
@@ -1,70 +0,0 @@
-package org.openecomp.vid.policy;
-
-import org.junit.Test;
-
-public class PolicyResponseWrapperTest {
-
-	private PolicyResponseWrapper createTestSubject() {
-		return new PolicyResponseWrapper();
-	}
-
-	@Test
-	public void testGetEntity() throws Exception {
-		PolicyResponseWrapper testSubject;
-		String result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.getEntity();
-	}
-
-	@Test
-	public void testGetStatus() throws Exception {
-		PolicyResponseWrapper testSubject;
-		int result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.getStatus();
-	}
-
-	@Test
-	public void testSetStatus() throws Exception {
-		PolicyResponseWrapper testSubject;
-		int v = 0;
-
-		// default test
-		testSubject = createTestSubject();
-		testSubject.setStatus(v);
-	}
-
-	@Test
-	public void testSetEntity() throws Exception {
-		PolicyResponseWrapper testSubject;
-		String v = "";
-
-		// default test
-		testSubject = createTestSubject();
-		testSubject.setEntity(v);
-	}
-
-	@Test
-	public void testToString() throws Exception {
-		PolicyResponseWrapper testSubject;
-		String result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.toString();
-	}
-
-	@Test
-	public void testGetResponse() throws Exception {
-		PolicyResponseWrapper testSubject;
-		String result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.getResponse();
-	}
-}
\ No newline at end of file
diff --git a/vid-app-common/src/test/java/org/openecomp/vid/policy/PolicyRestIntTest.java b/vid-app-common/src/test/java/org/openecomp/vid/policy/PolicyRestIntTest.java
deleted file mode 100644
index 5418165..0000000
--- a/vid-app-common/src/test/java/org/openecomp/vid/policy/PolicyRestIntTest.java
+++ /dev/null
@@ -1,22 +0,0 @@
-package org.openecomp.vid.policy;
-
-import org.junit.Test;
-import org.openecomp.vid.policy.rest.RequestDetails;
-
-public class PolicyRestIntTest {
-
-	private PolicyRestInt createTestSubject() {
-		return new PolicyRestInt();
-	}
-
-	@Test
-	public void testLogRequest() throws Exception {
-		PolicyRestInt testSubject;
-		RequestDetails r = null;
-
-		// test 1
-		testSubject = createTestSubject();
-		r = null;
-		testSubject.logRequest(r);
-	}
-}
\ No newline at end of file
diff --git a/vid-app-common/src/test/java/org/openecomp/vid/policy/PolicyRestInterfaceTest.java b/vid-app-common/src/test/java/org/openecomp/vid/policy/PolicyRestInterfaceTest.java
deleted file mode 100644
index 29e1362..0000000
--- a/vid-app-common/src/test/java/org/openecomp/vid/policy/PolicyRestInterfaceTest.java
+++ /dev/null
@@ -1,24 +0,0 @@
-package org.openecomp.vid.policy;
-
-import org.apache.poi.hssf.record.formula.functions.T;
-import org.json.simple.JSONObject;
-import org.junit.Test;
-import org.openecomp.vid.policy.rest.RequestDetails;
-
-public class PolicyRestInterfaceTest {
-
-	private PolicyRestInterface createTestSubject() {
-		return new PolicyRestInterface();
-	}
-
-
-	@Test
-	public void testLogRequest() throws Exception {
-		PolicyRestInterface testSubject;
-		RequestDetails r = null;
-
-		// default test
-		testSubject = createTestSubject();
-		testSubject.logRequest(r);
-	}
-}
\ No newline at end of file
diff --git a/vid-app-common/src/test/java/org/openecomp/vid/policy/PolicyUtilTest.java b/vid-app-common/src/test/java/org/openecomp/vid/policy/PolicyUtilTest.java
deleted file mode 100644
index b7f88ac..0000000
--- a/vid-app-common/src/test/java/org/openecomp/vid/policy/PolicyUtilTest.java
+++ /dev/null
@@ -1,54 +0,0 @@
-package org.openecomp.vid.policy;
-
-import org.apache.poi.hssf.record.formula.functions.T;
-import org.glassfish.jersey.client.ClientResponse;
-import org.junit.Assert;
-import org.junit.Test;
-
-public class PolicyUtilTest {
-
-	private PolicyUtil createTestSubject() {
-		return new PolicyUtil();
-	}
-
-	@Test
-	public void testWrapResponse() throws Exception {
-		String body = "";
-		int statusCode = 0;
-		PolicyResponseWrapper result;
-
-		// default test
-		result = PolicyUtil.wrapResponse(body, statusCode);
-	}
-
-
-	@Test
-	public void testWrapResponse_2() throws Exception {
-		RestObject<String> rs = null;
-		PolicyResponseWrapper result;
-
-		// test 1
-		rs = null;
-		result = PolicyUtil.wrapResponse(rs);
-		Assert.assertNotNull(result);
-	}
-
-	@Test
-	public void testConvertPojoToString() throws Exception {
-		T t = null;
-		String result;
-
-		// test 1
-		t = null;
-		result = PolicyUtil.convertPojoToString(t);
-		Assert.assertEquals("", result);
-	}
-
-	@Test
-	public void testMain() throws Exception {
-		String[] args = new String[] { "" };
-
-		// default test
-		PolicyUtil.main(args);
-	}
-}
\ No newline at end of file
diff --git a/vid-app-common/src/test/java/org/openecomp/vid/policy/RestObjectTest.java b/vid-app-common/src/test/java/org/openecomp/vid/policy/RestObjectTest.java
deleted file mode 100644
index a961a1a..0000000
--- a/vid-app-common/src/test/java/org/openecomp/vid/policy/RestObjectTest.java
+++ /dev/null
@@ -1,50 +0,0 @@
-package org.openecomp.vid.policy;
-
-import org.apache.poi.hssf.record.formula.functions.T;
-import org.junit.Test;
-
-public class RestObjectTest {
-
-	private RestObject createTestSubject() {
-		return new RestObject();
-	}
-
-	@Test
-	public void testSet() throws Exception {
-		RestObject testSubject;
-		T t = null;
-
-		// default test
-		testSubject = createTestSubject();
-		testSubject.set(t);
-	}
-
-	@Test
-	public void testGet() throws Exception {
-		RestObject testSubject;
-
-		// default test
-		testSubject = createTestSubject();
-		testSubject.get();
-	}
-
-	@Test
-	public void testSetStatusCode() throws Exception {
-		RestObject testSubject;
-		int v = 0;
-
-		// default test
-		testSubject = createTestSubject();
-		testSubject.setStatusCode(v);
-	}
-
-	@Test
-	public void testGetStatusCode() throws Exception {
-		RestObject testSubject;
-		int result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.getStatusCode();
-	}
-}
\ No newline at end of file
diff --git a/vid-app-common/src/test/java/org/openecomp/vid/policy/TestSuite.java b/vid-app-common/src/test/java/org/openecomp/vid/policy/TestSuite.java
deleted file mode 100644
index 7d0b4eb..0000000
--- a/vid-app-common/src/test/java/org/openecomp/vid/policy/TestSuite.java
+++ /dev/null
@@ -1,12 +0,0 @@
-package org.openecomp.vid.policy;
-
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-
-@RunWith(Suite.class)
-@Suite.SuiteClasses(
-
-{ RestObjectTest.class, PolicyResponseWrapperTest.class, PolicyRestIntTest.class, PolicyUtilTest.class,
-		PolicyRestInterfaceTest.class, org.openecomp.vid.policy.rest.TestSuite.class })
-public class TestSuite { // nothing
-}
diff --git a/vid-app-common/src/test/java/org/openecomp/vid/policy/rest/RequestDetailsTest.java b/vid-app-common/src/test/java/org/openecomp/vid/policy/rest/RequestDetailsTest.java
deleted file mode 100644
index 7057755..0000000
--- a/vid-app-common/src/test/java/org/openecomp/vid/policy/rest/RequestDetailsTest.java
+++ /dev/null
@@ -1,33 +0,0 @@
-package org.openecomp.vid.policy.rest;
-
-import org.junit.Test;
-
-
-public class RequestDetailsTest {
-
-	private RequestDetails createTestSubject() {
-		return new RequestDetails();
-	}
-
-
-	@Test
-	public void testGetPolicyName() throws Exception {
-		RequestDetails testSubject;
-		String result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.getPolicyName();
-	}
-
-
-	@Test
-	public void testSetPolicyName() throws Exception {
-		RequestDetails testSubject;
-		String policyName = "";
-
-		// default test
-		testSubject = createTestSubject();
-		testSubject.setPolicyName(policyName);
-	}
-}
\ No newline at end of file
diff --git a/vid-app-common/src/test/java/org/openecomp/vid/policy/rest/TestSuite.java b/vid-app-common/src/test/java/org/openecomp/vid/policy/rest/TestSuite.java
deleted file mode 100644
index 9b491c8..0000000
--- a/vid-app-common/src/test/java/org/openecomp/vid/policy/rest/TestSuite.java
+++ /dev/null
@@ -1,11 +0,0 @@
-package org.openecomp.vid.policy.rest;
-
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-
-@RunWith(Suite.class)
-@Suite.SuiteClasses(
-
-{ RequestDetailsTest.class })
-public class TestSuite { // nothing
-}
diff --git a/vid-app-common/src/test/java/org/openecomp/vid/properties/TestSuite.java b/vid-app-common/src/test/java/org/openecomp/vid/properties/TestSuite.java
deleted file mode 100644
index b299308..0000000
--- a/vid-app-common/src/test/java/org/openecomp/vid/properties/TestSuite.java
+++ /dev/null
@@ -1,11 +0,0 @@
-package org.openecomp.vid.properties;
-
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-
-@RunWith(Suite.class)
-@Suite.SuiteClasses(
-
-{ VidPropertiesTest.class })
-public class TestSuite { // nothing
-}
diff --git a/vid-app-common/src/test/java/org/openecomp/vid/properties/VidPropertiesTest.java b/vid-app-common/src/test/java/org/openecomp/vid/properties/VidPropertiesTest.java
deleted file mode 100644
index 7d318c7..0000000
--- a/vid-app-common/src/test/java/org/openecomp/vid/properties/VidPropertiesTest.java
+++ /dev/null
@@ -1,31 +0,0 @@
-package org.openecomp.vid.properties;
-
-import org.junit.Test;
-
-
-public class VidPropertiesTest {
-
-	private VidProperties createTestSubject() {
-		return new VidProperties();
-	}
-
-
-	@Test
-	public void testGetAsdcModelNamespace() throws Exception {
-		String result;
-
-		// default test
-		result = VidProperties.getAsdcModelNamespace();
-	}
-
-
-	@Test
-	public void testGetPropertyWithDefault() throws Exception {
-		String propName = "";
-		String defaultValue = "";
-		String result;
-
-		// default test
-		result = VidProperties.getPropertyWithDefault(propName, defaultValue);
-	}
-}
\ No newline at end of file
diff --git a/vid-app-common/src/test/java/org/openecomp/vid/roles/RoleProviderTest.java b/vid-app-common/src/test/java/org/openecomp/vid/roles/RoleProviderTest.java
deleted file mode 100644
index 97f9c47..0000000
--- a/vid-app-common/src/test/java/org/openecomp/vid/roles/RoleProviderTest.java
+++ /dev/null
@@ -1,50 +0,0 @@
-package org.openecomp.vid.roles;
-
-import java.util.List;
-
-import javax.servlet.http.HttpServletRequest;
-
-import org.junit.Test;
-
-
-public class RoleProviderTest {
-
-	private RoleProvider createTestSubject() {
-		return new RoleProvider();
-	}
-
-	
-	@Test
-	public void testExtractRoleFromSession() throws Exception {
-		HttpServletRequest request = null;
-		List<String> result;
-
-		// default test
-		result = RoleProvider.extractRoleFromSession(request);
-	}
-
-	
-	@Test
-	public void testGetUserRoles() throws Exception {
-		RoleProvider testSubject;
-		HttpServletRequest request = null;
-		List<Role> result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.getUserRoles(request);
-	}
-
-	
-	@Test
-	public void testSplitRole() throws Exception {
-		RoleProvider testSubject;
-		String roleAsString = "";
-		String[] result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.splitRole(roleAsString);
-	}
-
-}
\ No newline at end of file
diff --git a/vid-app-common/src/test/java/org/openecomp/vid/roles/RoleValidatorTest.java b/vid-app-common/src/test/java/org/openecomp/vid/roles/RoleValidatorTest.java
deleted file mode 100644
index fc050ba..0000000
--- a/vid-app-common/src/test/java/org/openecomp/vid/roles/RoleValidatorTest.java
+++ /dev/null
@@ -1,58 +0,0 @@
-package org.openecomp.vid.roles;
-
-import org.junit.Test;
-import org.openecomp.vid.mso.rest.RequestDetails;
-
-public class RoleValidatorTest {
-
-	private RoleValidator createTestSubject() {
-		return new RoleValidator(null);
-	}
-
-	@Test
-	public void testIsSubscriberPermitted() throws Exception {
-		RoleValidator testSubject;
-		String subscriberName = "";
-		boolean result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.isSubscriberPermitted(subscriberName);
-	}
-
-	@Test
-	public void testIsServicePermitted() throws Exception {
-		RoleValidator testSubject;
-		String subscriberName = "";
-		String serviceType = "";
-		boolean result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.isServicePermitted(subscriberName, serviceType);
-	}
-
-	@Test
-	public void testIsMsoRequestValid() throws Exception {
-		RoleValidator testSubject;
-		RequestDetails mso_request = null;
-		boolean result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.isMsoRequestValid(mso_request);
-	}
-
-	@Test
-	public void testIsTenantPermitted() throws Exception {
-		RoleValidator testSubject;
-		String globalCustomerId = "";
-		String serviceType = "";
-		String tenant = "";
-		boolean result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.isTenantPermitted(globalCustomerId, serviceType, tenant);
-	}
-}
\ No newline at end of file
diff --git a/vid-app-common/src/test/java/org/openecomp/vid/roles/TestSuite.java b/vid-app-common/src/test/java/org/openecomp/vid/roles/TestSuite.java
deleted file mode 100644
index df87ac0..0000000
--- a/vid-app-common/src/test/java/org/openecomp/vid/roles/TestSuite.java
+++ /dev/null
@@ -1,11 +0,0 @@
-package org.openecomp.vid.roles;
-
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-
-@RunWith(Suite.class)
-@Suite.SuiteClasses(
-
-{ RoleValidatorTest.class, RoleProviderTest.class })
-public class TestSuite { // nothing
-}
diff --git a/vid-app-common/src/test/java/org/openecomp/vid/scheduler/RestObjects/GetTimeSlotsRestObjectTest.java b/vid-app-common/src/test/java/org/openecomp/vid/scheduler/RestObjects/GetTimeSlotsRestObjectTest.java
deleted file mode 100644
index 9041bdb..0000000
--- a/vid-app-common/src/test/java/org/openecomp/vid/scheduler/RestObjects/GetTimeSlotsRestObjectTest.java
+++ /dev/null
@@ -1,33 +0,0 @@
-package org.openecomp.vid.scheduler.RestObjects;
-
-import org.junit.Test;
-
-
-public class GetTimeSlotsRestObjectTest {
-
-	private GetTimeSlotsRestObject createTestSubject() {
-		return new GetTimeSlotsRestObject();
-	}
-
-
-	@Test
-	public void testSetUUID() throws Exception {
-		GetTimeSlotsRestObject testSubject;
-		String uuid = "";
-
-		// default test
-		testSubject = createTestSubject();
-		testSubject.setUUID(uuid);
-	}
-
-
-	@Test
-	public void testGetUUID() throws Exception {
-		GetTimeSlotsRestObject testSubject;
-		String result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.getUUID();
-	}
-}
\ No newline at end of file
diff --git a/vid-app-common/src/test/java/org/openecomp/vid/scheduler/RestObjects/PostCreateNewVnfRestObjectTest.java b/vid-app-common/src/test/java/org/openecomp/vid/scheduler/RestObjects/PostCreateNewVnfRestObjectTest.java
deleted file mode 100644
index 79e9788..0000000
--- a/vid-app-common/src/test/java/org/openecomp/vid/scheduler/RestObjects/PostCreateNewVnfRestObjectTest.java
+++ /dev/null
@@ -1,33 +0,0 @@
-package org.openecomp.vid.scheduler.RestObjects;
-
-import org.junit.Test;
-
-
-public class PostCreateNewVnfRestObjectTest {
-
-	private PostCreateNewVnfRestObject createTestSubject() {
-		return new PostCreateNewVnfRestObject();
-	}
-
-
-	@Test
-	public void testSetUUID() throws Exception {
-		PostCreateNewVnfRestObject testSubject;
-		String uuid = "";
-
-		// default test
-		testSubject = createTestSubject();
-		testSubject.setUUID(uuid);
-	}
-
-
-	@Test
-	public void testGetUUID() throws Exception {
-		PostCreateNewVnfRestObject testSubject;
-		String result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.getUUID();
-	}
-}
\ No newline at end of file
diff --git a/vid-app-common/src/test/java/org/openecomp/vid/scheduler/RestObjects/PostSubmitVnfChangeRestObjectTest.java b/vid-app-common/src/test/java/org/openecomp/vid/scheduler/RestObjects/PostSubmitVnfChangeRestObjectTest.java
deleted file mode 100644
index dd2e6f7..0000000
--- a/vid-app-common/src/test/java/org/openecomp/vid/scheduler/RestObjects/PostSubmitVnfChangeRestObjectTest.java
+++ /dev/null
@@ -1,33 +0,0 @@
-package org.openecomp.vid.scheduler.RestObjects;
-
-import org.junit.Test;
-
-
-public class PostSubmitVnfChangeRestObjectTest {
-
-	private PostSubmitVnfChangeRestObject createTestSubject() {
-		return new PostSubmitVnfChangeRestObject();
-	}
-
-
-	@Test
-	public void testSetUUID() throws Exception {
-		PostSubmitVnfChangeRestObject testSubject;
-		String uuid = "";
-
-		// default test
-		testSubject = createTestSubject();
-		testSubject.setUUID(uuid);
-	}
-
-
-	@Test
-	public void testGetUUID() throws Exception {
-		PostSubmitVnfChangeRestObject testSubject;
-		String result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.getUUID();
-	}
-}
\ No newline at end of file
diff --git a/vid-app-common/src/test/java/org/openecomp/vid/scheduler/RestObjects/RestObjectTest.java b/vid-app-common/src/test/java/org/openecomp/vid/scheduler/RestObjects/RestObjectTest.java
deleted file mode 100644
index 5ab609a..0000000
--- a/vid-app-common/src/test/java/org/openecomp/vid/scheduler/RestObjects/RestObjectTest.java
+++ /dev/null
@@ -1,55 +0,0 @@
-package org.openecomp.vid.scheduler.RestObjects;
-
-import org.apache.poi.hssf.record.formula.functions.T;
-import org.junit.Test;
-
-
-public class RestObjectTest {
-
-	private RestObject createTestSubject() {
-		return new RestObject();
-	}
-
-
-	@Test
-	public void testSet() throws Exception {
-		RestObject testSubject;
-		T t = null;
-
-		// default test
-		testSubject = createTestSubject();
-		testSubject.set(t);
-	}
-
-
-	@Test
-	public void testGet() throws Exception {
-		RestObject testSubject;
-
-		// default test
-		testSubject = createTestSubject();
-		testSubject.get();
-	}
-
-
-	@Test
-	public void testSetStatusCode() throws Exception {
-		RestObject testSubject;
-		int v = 0;
-
-		// default test
-		testSubject = createTestSubject();
-		testSubject.setStatusCode(v);
-	}
-
-
-	@Test
-	public void testGetStatusCode() throws Exception {
-		RestObject testSubject;
-		int result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.getStatusCode();
-	}
-}
\ No newline at end of file
diff --git a/vid-app-common/src/test/java/org/openecomp/vid/scheduler/RestObjects/TestSuite.java b/vid-app-common/src/test/java/org/openecomp/vid/scheduler/RestObjects/TestSuite.java
deleted file mode 100644
index 8e53214..0000000
--- a/vid-app-common/src/test/java/org/openecomp/vid/scheduler/RestObjects/TestSuite.java
+++ /dev/null
@@ -1,12 +0,0 @@
-package org.openecomp.vid.scheduler.RestObjects;
-
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-
-@RunWith(Suite.class)
-@Suite.SuiteClasses(
-
-{ RestObjectTest.class, GetTimeSlotsRestObjectTest.class, PostSubmitVnfChangeRestObjectTest.class,
-		PostCreateNewVnfRestObjectTest.class })
-public class TestSuite { // nothing
-}
diff --git a/vid-app-common/src/test/java/org/openecomp/vid/scheduler/SchedulerResponseWrappers/PostCreateNewVnfWrapperTest.java b/vid-app-common/src/test/java/org/openecomp/vid/scheduler/SchedulerResponseWrappers/PostCreateNewVnfWrapperTest.java
deleted file mode 100644
index 16675dd..0000000
--- a/vid-app-common/src/test/java/org/openecomp/vid/scheduler/SchedulerResponseWrappers/PostCreateNewVnfWrapperTest.java
+++ /dev/null
@@ -1,55 +0,0 @@
-package org.openecomp.vid.scheduler.SchedulerResponseWrappers;
-
-import org.junit.Test;
-
-
-public class PostCreateNewVnfWrapperTest {
-
-	private PostCreateNewVnfWrapper createTestSubject() {
-		return new PostCreateNewVnfWrapper();
-	}
-
-
-	@Test
-	public void testGetUuid() throws Exception {
-		PostCreateNewVnfWrapper testSubject;
-		String result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.getUuid();
-	}
-
-
-	@Test
-	public void testSetUuid() throws Exception {
-		PostCreateNewVnfWrapper testSubject;
-		String v = "";
-
-		// default test
-		testSubject = createTestSubject();
-		testSubject.setUuid(v);
-	}
-
-
-	@Test
-	public void testToString() throws Exception {
-		PostCreateNewVnfWrapper testSubject;
-		String result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.toString();
-	}
-
-
-	@Test
-	public void testGetResponse() throws Exception {
-		PostCreateNewVnfWrapper testSubject;
-		String result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.getResponse();
-	}
-}
\ No newline at end of file
diff --git a/vid-app-common/src/test/java/org/openecomp/vid/scheduler/SchedulerResponseWrappers/PostSubmitVnfChangeTimeSlotsWrapperTest.java b/vid-app-common/src/test/java/org/openecomp/vid/scheduler/SchedulerResponseWrappers/PostSubmitVnfChangeTimeSlotsWrapperTest.java
deleted file mode 100644
index ffe03bf..0000000
--- a/vid-app-common/src/test/java/org/openecomp/vid/scheduler/SchedulerResponseWrappers/PostSubmitVnfChangeTimeSlotsWrapperTest.java
+++ /dev/null
@@ -1,55 +0,0 @@
-package org.openecomp.vid.scheduler.SchedulerResponseWrappers;
-
-import org.junit.Test;
-
-
-public class PostSubmitVnfChangeTimeSlotsWrapperTest {
-
-	private PostSubmitVnfChangeTimeSlotsWrapper createTestSubject() {
-		return new PostSubmitVnfChangeTimeSlotsWrapper();
-	}
-
-
-	@Test
-	public void testGetUuid() throws Exception {
-		PostSubmitVnfChangeTimeSlotsWrapper testSubject;
-		String result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.getUuid();
-	}
-
-
-	@Test
-	public void testSetUuid() throws Exception {
-		PostSubmitVnfChangeTimeSlotsWrapper testSubject;
-		String v = "";
-
-		// default test
-		testSubject = createTestSubject();
-		testSubject.setUuid(v);
-	}
-
-
-	@Test
-	public void testToString() throws Exception {
-		PostSubmitVnfChangeTimeSlotsWrapper testSubject;
-		String result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.toString();
-	}
-
-
-	@Test
-	public void testGetResponse() throws Exception {
-		PostSubmitVnfChangeTimeSlotsWrapper testSubject;
-		String result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.getResponse();
-	}
-}
\ No newline at end of file
diff --git a/vid-app-common/src/test/java/org/openecomp/vid/scheduler/SchedulerResponseWrappers/SchedulerResponseWrapperTest.java b/vid-app-common/src/test/java/org/openecomp/vid/scheduler/SchedulerResponseWrappers/SchedulerResponseWrapperTest.java
deleted file mode 100644
index c0fcb59..0000000
--- a/vid-app-common/src/test/java/org/openecomp/vid/scheduler/SchedulerResponseWrappers/SchedulerResponseWrapperTest.java
+++ /dev/null
@@ -1,77 +0,0 @@
-package org.openecomp.vid.scheduler.SchedulerResponseWrappers;
-
-import org.junit.Test;
-
-
-public class SchedulerResponseWrapperTest {
-
-	private SchedulerResponseWrapper createTestSubject() {
-		return new SchedulerResponseWrapper();
-	}
-
-	
-	@Test
-	public void testGetEntity() throws Exception {
-		SchedulerResponseWrapper testSubject;
-		String result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.getEntity();
-	}
-
-	
-	@Test
-	public void testGetStatus() throws Exception {
-		SchedulerResponseWrapper testSubject;
-		int result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.getStatus();
-	}
-
-	
-	@Test
-	public void testSetStatus() throws Exception {
-		SchedulerResponseWrapper testSubject;
-		int v = 0;
-
-		// default test
-		testSubject = createTestSubject();
-		testSubject.setStatus(v);
-	}
-
-	
-	@Test
-	public void testSetEntity() throws Exception {
-		SchedulerResponseWrapper testSubject;
-		String v = "";
-
-		// default test
-		testSubject = createTestSubject();
-		testSubject.setEntity(v);
-	}
-
-	
-	@Test
-	public void testToString() throws Exception {
-		SchedulerResponseWrapper testSubject;
-		String result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.toString();
-	}
-
-	
-	@Test
-	public void testGetResponse() throws Exception {
-		SchedulerResponseWrapper testSubject;
-		String result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.getResponse();
-	}
-}
\ No newline at end of file
diff --git a/vid-app-common/src/test/java/org/openecomp/vid/scheduler/SchedulerResponseWrappers/TestSuite.java b/vid-app-common/src/test/java/org/openecomp/vid/scheduler/SchedulerResponseWrappers/TestSuite.java
deleted file mode 100644
index a85a9f3..0000000
--- a/vid-app-common/src/test/java/org/openecomp/vid/scheduler/SchedulerResponseWrappers/TestSuite.java
+++ /dev/null
@@ -1,12 +0,0 @@
-package org.openecomp.vid.scheduler.SchedulerResponseWrappers;
-
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-
-@RunWith(Suite.class)
-@Suite.SuiteClasses(
-
-{ PostSubmitVnfChangeTimeSlotsWrapperTest.class, PostCreateNewVnfWrapperTest.class,
-		SchedulerResponseWrapperTest.class })
-public class TestSuite { // nothing
-}
diff --git a/vid-app-common/src/test/java/org/openecomp/vid/scheduler/SchedulerRestInterfaceTest.java b/vid-app-common/src/test/java/org/openecomp/vid/scheduler/SchedulerRestInterfaceTest.java
deleted file mode 100644
index 9dba924..0000000
--- a/vid-app-common/src/test/java/org/openecomp/vid/scheduler/SchedulerRestInterfaceTest.java
+++ /dev/null
@@ -1,26 +0,0 @@
-package org.openecomp.vid.scheduler;
-
-import org.apache.poi.hssf.record.formula.functions.T;
-import org.json.simple.JSONObject;
-import org.junit.Test;
-
-public class SchedulerRestInterfaceTest {
-
-	private SchedulerRestInterface createTestSubject() {
-		return new SchedulerRestInterface();
-	}
-
-
-	
-	@Test
-	public void testLogRequest() throws Exception {
-		SchedulerRestInterface testSubject;
-		JSONObject requestDetails = null;
-
-		// default test
-		testSubject = createTestSubject();
-		testSubject.logRequest(requestDetails);
-	}
-
-
-}
\ No newline at end of file
diff --git a/vid-app-common/src/test/java/org/openecomp/vid/scheduler/TestSuite.java b/vid-app-common/src/test/java/org/openecomp/vid/scheduler/TestSuite.java
deleted file mode 100644
index 61ab05d..0000000
--- a/vid-app-common/src/test/java/org/openecomp/vid/scheduler/TestSuite.java
+++ /dev/null
@@ -1,11 +0,0 @@
-package org.openecomp.vid.scheduler;
-
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-
-@RunWith(Suite.class)
-@Suite.SuiteClasses(
-
-{ SchedulerRestInterfaceTest.class, org.openecomp.vid.scheduler.RestObjects.TestSuite.class })
-public class TestSuite { // nothing
-}
diff --git a/vid-app-common/src/test/java/org/openecomp/vid/scheduler/rest/RequestDetailsTest.java b/vid-app-common/src/test/java/org/openecomp/vid/scheduler/rest/RequestDetailsTest.java
deleted file mode 100644
index 190b8c5..0000000
--- a/vid-app-common/src/test/java/org/openecomp/vid/scheduler/rest/RequestDetailsTest.java
+++ /dev/null
@@ -1,33 +0,0 @@
-package org.openecomp.vid.scheduler.rest;
-
-import org.junit.Test;
-
-
-public class RequestDetailsTest {
-
-	private RequestDetails createTestSubject() {
-		return new RequestDetails();
-	}
-
-
-	@Test
-	public void testGetDomain() throws Exception {
-		RequestDetails testSubject;
-		String result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.getDomain();
-	}
-
-
-	@Test
-	public void testSetDomain() throws Exception {
-		RequestDetails testSubject;
-		String domain = "";
-
-		// default test
-		testSubject = createTestSubject();
-		testSubject.setDomain(domain);
-	}
-}
\ No newline at end of file
diff --git a/vid-app-common/src/test/java/org/openecomp/vid/scheduler/rest/TestSuite.java b/vid-app-common/src/test/java/org/openecomp/vid/scheduler/rest/TestSuite.java
deleted file mode 100644
index 714d0b0..0000000
--- a/vid-app-common/src/test/java/org/openecomp/vid/scheduler/rest/TestSuite.java
+++ /dev/null
@@ -1,11 +0,0 @@
-package org.openecomp.vid.scheduler.rest;
-
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-
-@RunWith(Suite.class)
-@Suite.SuiteClasses(
-
-{ RequestDetailsTest.class })
-public class TestSuite { // nothing
-}
diff --git a/vid-app-common/src/test/java/org/openecomp/vid/services/ChangeManagementServiceImplTest.java b/vid-app-common/src/test/java/org/openecomp/vid/services/ChangeManagementServiceImplTest.java
deleted file mode 100644
index bd1e72b..0000000
--- a/vid-app-common/src/test/java/org/openecomp/vid/services/ChangeManagementServiceImplTest.java
+++ /dev/null
@@ -1,69 +0,0 @@
-package org.openecomp.vid.services;
-
-import static org.junit.Assert.*;
-import java.util.*;
-
-import org.json.simple.JSONArray;
-import org.junit.Assert;
-import org.junit.Test;
-import org.openecomp.vid.changeManagement.ChangeManagementRequest;
-import org.openecomp.vid.changeManagement.RequestDetails;
-import org.openecomp.vid.mso.rest.Request;
-import org.springframework.http.ResponseEntity;
-
-public class ChangeManagementServiceImplTest {
-
-	private ChangeManagementServiceImpl createTestSubject() {
-		return new ChangeManagementServiceImpl();
-	}
-
-	
-	/*@Test
-	public void testGetMSOChangeManagements() throws Exception {
-		ChangeManagementServiceImpl testSubject;
-		Collection<Request> result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.getMSOChangeManagements();
-	}
-
-	
-	@Test
-	public void testFindRequestByVnfName() throws Exception {
-	ChangeManagementServiceImpl testSubject;List<RequestDetails> requests = null;
-	String vnfName = "";
-	RequestDetails result;
-	
-	// test 1
-	testSubject=createTestSubject();requests = null;
-	result=Deencapsulation.invoke(testSubject, "findRequestByVnfName", new Object[]{List<RequestDetails>.class, vnfName});
-	Assert.assertEquals(null, result);
-	}*/
-
-	
-	@Test
-	public void testDoChangeManagement() throws Exception {
-		ChangeManagementServiceImpl testSubject;
-		ChangeManagementRequest request = null;
-		String vnfName = "";
-		ResponseEntity<String> result;
-
-		// test 1
-		testSubject = createTestSubject();
-		request = null;
-		result = testSubject.doChangeManagement(request, vnfName);
-		Assert.assertEquals(null, result);
-	}
-
-	
-	@Test
-	public void testGetSchedulerChangeManagements() throws Exception {
-		ChangeManagementServiceImpl testSubject;
-		JSONArray result;
-
-		// default test
-		testSubject = createTestSubject();
-		result = testSubject.getSchedulerChangeManagements();
-	}
-}
\ No newline at end of file
diff --git a/vid-app-common/src/test/java/org/openecomp/vid/services/ChangeManagementServiceTest.java b/vid-app-common/src/test/java/org/openecomp/vid/services/ChangeManagementServiceTest.java
deleted file mode 100644
index f770ab2..0000000
--- a/vid-app-common/src/test/java/org/openecomp/vid/services/ChangeManagementServiceTest.java
+++ /dev/null
@@ -1,29 +0,0 @@
-package org.openecomp.vid.services;
-
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-import org.openecomp.vid.changeManagement.ChangeManagementRequest;
-import org.openecomp.vid.changeManagement.ChangeManagementResponse;
-import org.springframework.http.ResponseEntity;
-
-import junit.framework.Assert;
-
-import static org.junit.Assert.*;
-
-
-public class ChangeManagementServiceTest {
-    @Before
-    public void setUp() throws Exception {
-    }
-
-    @After
-    public void tearDown() throws Exception {
-    }
-
-    @Test
-    public void doChangeManagement_requestTypeIsUpdateVnfNotFound_doUpdateAndReturnNull() throws Exception {
-
-     }
-
-}
\ No newline at end of file
diff --git a/vid-app-common/src/test/java/org/openecomp/vid/services/TestSuite.java b/vid-app-common/src/test/java/org/openecomp/vid/services/TestSuite.java
deleted file mode 100644
index c6c5eb1..0000000
--- a/vid-app-common/src/test/java/org/openecomp/vid/services/TestSuite.java
+++ /dev/null
@@ -1,11 +0,0 @@
-package org.openecomp.vid.services;
-
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-
-@RunWith(Suite.class)
-@Suite.SuiteClasses(
-
-{ ChangeManagementServiceImplTest.class, ChangeManagementServiceTest.class })
-public class TestSuite { // nothing
-}
diff --git a/vid-app-common/src/test/resources/WEB-INF/conf/system.properties b/vid-app-common/src/test/resources/WEB-INF/conf/system.properties
index 9da6303..a67f578 100644
--- a/vid-app-common/src/test/resources/WEB-INF/conf/system.properties
+++ b/vid-app-common/src/test/resources/WEB-INF/conf/system.properties
@@ -79,7 +79,18 @@
 #aai.oldserver.url=https://mtanjv9aaas40.aic.cip.att.com:8443/aai/servers/v3/
 #ist servers
 aai.server.url.base=https://aai-ext1.test.att.com:8443/aai/
-aai.server.url=https://aai-ext1.test.att.com:8443/aai/v11/
+#aai.server.url=https://aai-ext1.test.att.com:8443/aai/v12/
+aai.server.url=http://localhost:8080/vidSimulator/aai/v12/
+#aai.server.url=http://localhost:1080/aai
+#aai.server.url=https://aai-int2.test.att.com:8443/aai/v12/
+
+
+
+
+
+
+
+
 aai.oldserver.url.base=https://aai-ext1.test.att.com:8443/aai/servers/
 aai.oldserver.url=https://aai-ext1.test.att.com:8443/aai/servers/v3/
 aai.truststore.filename=tomcat_keystore
@@ -88,7 +99,6 @@
 aai.keystore.passwd.x=OBF:1i9a1u2a1unz1lr61wn51wn11lss1unz1u301i6o
 aai.use.client.cert=false
 aai.vnf.provstatus=PREPROV,NVTPROV,PROV,CAPPED
-aai_get_version_by_invariant_id="service-design-and-creation/models?depth=2&model-invariant-id="
 
 #Cron Schedules have 6 required fields and 1 optional field:
 # Seconds Minutes Hours Day-of-Month Month Day-of-Week Year
@@ -136,16 +146,20 @@
 mso.server.url=http://vm1.mso.simpledemo.openecomp.org:8080
 mso.polling.interval.msecs=10000
 mso.max.polls=10
-mso.user.name=InfraPortalClient
-mso.password.x=OBF:1ih71i271vny1yf41ymf1ylz1yf21vn41hzj1icz
-mso.restapi.svc.instance=/ecomp/mso/infra/serviceInstances/v4
-mso.restapi.vnf.instance=/ecomp/mso/infra/serviceInstances/v4/<service_instance_id>/vnfs
-mso.restapi.network.instance=/ecomp/mso/infra/serviceInstances/v4/<service_instance_id>/networks
-mso.restapi.vf.module.instance=/ecomp/mso/infra/serviceInstances/v4/<service_instance_id>/vnfs/<vnf_instance_id>/vfModules
-mso.restapi.volume.group.instance=/ecomp/mso/infra/serviceInstances/v4/<service_instance_id>/vnfs/<vnf_instance_id>/volumeGroups
-mso.restapi.get.orc.req=/ecomp/mso/infra/orchestrationRequests/v4
-mso.restapi.get.orc.reqs=/ecomp/mso/infra/orchestrationRequests/v4?
+mso.user.name=infraportal
+mso.password.x=OBF:1ghz1kfx1j1w1m7w1i271e8q1eas1hzj1m4i1iyy1kch1gdz
+mso.restapi.svc.instance=/serviceInstances/v5
+mso.restapi.vnf.instance=/serviceInstances/v5/<service_instance_id>/vnfs
+mso.restapi.vnf.changemanagement.instance=/serviceInstances/v5/<service_instance_id>/vnfs/<vnf_instance_id>/<request_type>
+mso.restapi.network.instance=/serviceInstances/v5/<service_instance_id>/networks
+mso.restapi.vf.module.instance=/serviceInstances/v5/<service_instance_id>/vnfs/<vnf_instance_id>/vfModules
+mso.restapi.volume.group.instance=/serviceInstances/v5/<service_instance_id>/vnfs/<vnf_instance_id>/volumeGroups
+mso.restapi.get.orc.req=/orchestrationRequests/v5
+mso.restapi.get.orc.reqs=/orchestrationRequests/v5?
 mso.restapi.get.man.tasks=/tasks/v1
+mso.restapi.configurations=/serviceInstances/v6/<service_instance_id>/configurations
+mso.restapi.configuration.instance=${mso.restapi.configurations}<configuration_id>
+
 vid.truststore.filename=/opt/app/vid/etc/vid_keystore.jks
 mso.dme2.client.timeout=30000
 mso.dme2.client.read.timeout=120000
diff --git a/vid-app-common/src/test/resources/WEB-INF/jsp/searchexistingsi.jsp b/vid-app-common/src/test/resources/WEB-INF/jsp/searchexistingsi.jsp
index 2c7dd9f..76fe13e 100644
--- a/vid-app-common/src/test/resources/WEB-INF/jsp/searchexistingsi.jsp
+++ b/vid-app-common/src/test/resources/WEB-INF/jsp/searchexistingsi.jsp
@@ -12,7 +12,7 @@
 <script src="app/vid/test/testAaiData.js"></script>
 
 <script src="app/vid/scripts/controller/creationDialogController.js"></script>
-<script src="app/vid/scripts/controller/deletionDialogController.js"></script>
+<script src="app/vid/scripts/controller/deleteResumeDialogController.js"></script>
 <script src="app/vid/scripts/controller/detailsDialogController.js"></script>
 <script src="app/vid/scripts/controller/statusDialogController.js"></script>
 <script src="app/vid/scripts/controller/msoCommitController.js"></script>
@@ -21,7 +21,7 @@
 <script src="app/vid/scripts/services/asdcService.js"></script>
 <script src="app/vid/scripts/services/creationService.js"></script>
 <script src="app/vid/scripts/services/dataService.js"></script>
-<script src="app/vid/scripts/services/deletionService.js"></script>
+<script src="app/vid/scripts/services/deleteResumeService.js"></script>
 <script src="app/vid/scripts/services/detailsService.js"></script>
 <script src="app/vid/scripts/services/statusService.js"></script>
 <script src="app/vid/scripts/services/componentService.js"></script>
@@ -43,7 +43,7 @@
 <link rel="stylesheet" type="text/css" href="app/vid/styles/angular-ui-tree.css" />
 <link rel="stylesheet" type="text/css" href="app/vid/styles/vidTree.css" />
 
-<%@ page import="org.openecomp.vid.mso.*"%>
+<%@ page import="org.onap.vid.mso.*"%>
 <%@ page import="org.openecomp.portalsdk.core.util.SystemProperties"%>
 <%
 	String properties = "{msoMaxPolls:" + SystemProperties.getProperty(MsoProperties.MSO_MAX_POLLS)
diff --git a/vid-app-common/src/test/resources/WEB-INF/jsp/serviceModels.jsp b/vid-app-common/src/test/resources/WEB-INF/jsp/serviceModels.jsp
index 9fdf75d..2adaf44 100644
--- a/vid-app-common/src/test/resources/WEB-INF/jsp/serviceModels.jsp
+++ b/vid-app-common/src/test/resources/WEB-INF/jsp/serviceModels.jsp
@@ -1,3 +1,4 @@
+<link rel="stylesheet" type="text/css" href="app/vid/external/bootstrap/css/bootstrap.min.css" />
 <link rel="stylesheet" type="text/css" href="app/vid/styles/aaiGetSubs.css" />
 <link rel="stylesheet" type="text/css" href="app/vid/styles/aaiSubDetails.css" />
 <link rel="stylesheet" type="text/css" href="app/vid/styles/aaiSubViewEdit.css" />
@@ -6,18 +7,20 @@
 <link rel="stylesheet" type="text/css" href="app/vid/styles/instantiate.css" />
 <link rel="stylesheet" type="text/css" href="app/vid/styles/vidTree.css" />
 <link rel="stylesheet" type="text/css" href="app/vid/styles/dialogs.css" />
-<link rel="stylesheet" type="text/css" href="app/vid/external/bootstrap/css/bootstrap.min.css" />
+<link rel="stylesheet" type="text/css" href="app/vid/styles/angularjs-datetime-picker.css"></link>
+<link rel="stylesheet" type="text/css" href="app/vid/styles/common.css" />
 
 	
 	<script>
 	
 	var appDS2 = app;
 </script>
+
 	<script src="app/vid/scripts/controller/VidApp.js"></script>
 	
 <!-- Latest compiled and minified JavaScript -->
 
-<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
+<script src="app/vid/external/bootstrap/js/bootstrap.min.js"></script>
 
 <script src="app/vid/external/multiselect/angular-bootstrap-multiselect.min.js"></script>
 
@@ -32,28 +35,45 @@
 <script src="app/vid/scripts/filters/date.filter.js"></script>
 <script src="app/vid/scripts/modals/change-management-manual-tasks-controller/change-management-manual-tasks.controller.js"></script>
 <script src="app/vid/scripts/modals/new-change-management/new-change-management.controller.js"></script>
+<script src="app/vid/scripts/modals/alert-modal/alert-modal.controller.js"></script>
+<script src="app/vid/scripts/modals/new-test-environment/new-test-environment.controller.js"></script>
+
+<script src="app/vid/scripts/modals/alert-modal/alert-modal.controller.js"></script>
 <script src="app/vid/scripts/controller/aaiSubscriberController.js"></script>
 <script src="app/vid/scripts/controller/creationDialogController.js"></script>
-<script src="app/vid/scripts/controller/deletionDialogController.js"></script>
+<script src="app/vid/scripts/controller/deleteResumeDialogController.js"></script>
 <script src="app/vid/scripts/controller/detailsDialogController.js"></script>
 <script src="app/vid/scripts/controller/statusDialogController.js"></script>
 <script src="app/vid/scripts/controller/InstantiationController.js"></script>
 <script src="app/vid/scripts/controller/msoCommitController.js"></script>
+<script src="app/vid/scripts/controller/pnfSearchAssociationController.js"></script>
 <script src="app/vid/scripts/controller/ServiceModelController.js"></script>
 <script src="app/vid/scripts/controller/previousVersionDialogController.js"></script>
 <script src="app/vid/scripts/controller/previousVersionContoller.js"></script>
+<script src="app/vid/scripts/controller/AddNetworkNodeController.js"></script>
 <script src="app/vid/scripts/controller/change-management.controller.js"></script>
+<script src="app/vid/scripts/controller/testEnvironmentsController.js"></script>
+<script src="app/vid/scripts/controller/ServiceProxyConfigController.js"></script>
+
+<script src="app/vid/scripts/directives/angularjs-datetime-picker.js"></script>
+<script src="app/vid/scripts/controller/ServiceProxyConfigController.js"></script>
+
+<script src="app/vid/scripts/directives/angularjs-datetime-picker.js"></script>
+<script src="app/vid/scripts/controller/msoCommitModalController.js"></script>
+
 
 <script src="app/vid/scripts/directives/extensionsDirective.js"></script>
 <script src="app/vid/scripts/directives/parameterBlockDirective.js"></script>
 <script src="app/vid/scripts/directives/popupWindowDirective.js"></script>
 <script src="app/vid/scripts/directives/progressBarDirective.js"></script>
+<script src="app/vid/scripts/directives/serviceMetadata.js"></script>
 <script src="app/vid/scripts/services/aaiService.js"></script>
+<script src="app/vid/scripts/services/schedulerService.js"></script>
 <script src="app/vid/scripts/services/asdcService.js"></script>
 <script src="app/vid/scripts/services/componentService.js"></script>
 <script src="app/vid/scripts/services/creationService.js"></script>
 <script src="app/vid/scripts/services/dataService.js"></script>
-<script src="app/vid/scripts/services/deletionService.js"></script>
+<script src="app/vid/scripts/services/deleteResumeService.js"></script>
 <script src="app/vid/scripts/services/detailsService.js"></script>
 <script src="app/vid/scripts/services/statusService.js"></script>
 <script src="app/vid/scripts/services/msoService.js"></script>
@@ -61,8 +81,12 @@
 <script src="app/vid/scripts/services/utilityService.js"></script>
 <script src="app/vid/scripts/services/vnfService.js"></script>
 <script src="app/vid/scripts/services/change-management.service.js"></script>
+<script src="app/vid/scripts/modals/cancel-pending-workflow/cancel-pending-workflow.controller.js"></script>
+<script src="app/vid/scripts/services/OwningEntityService.js"></script>
+<script src="app/vid/scripts/services/testEnvironmentsService.js"></script>
 
-<%@ page import="org.openecomp.vid.mso.*"%>
+
+<%@ page import="org.onap.vid.mso.*"%>
 <%@ page import="org.openecomp.portalsdk.core.util.SystemProperties"%>
 <%
 	String properties = "{msoMaxPolls:" + SystemProperties.getProperty(MsoProperties.MSO_MAX_POLLS)
@@ -75,18 +99,20 @@
 	<div ng-view></div>
 </div>
 <!--  Temporary solution for footer overlapping the men after talking to EComp SDK developer on 06/16/2016 -->
-<br>
-<br>
-<br>
-<br>
-<br>
-<br>
-<br>
-<br>
-<br>
-<br>
-<br>
-<br>
-<br>
-<br>
-<br>
+<div class="temporary-solution">
+	<br>
+	<br>
+	<br>
+	<br>
+	<br>
+	<br>
+	<br>
+	<br>
+	<br>
+	<br>
+	<br>
+	<br>
+	<br>
+	<br>
+	<br>
+</div>
diff --git a/vid-app-common/src/test/resources/WEB-INF/jsp/testMso.jsp b/vid-app-common/src/test/resources/WEB-INF/jsp/testMso.jsp
index abcc8e2..7113089 100644
--- a/vid-app-common/src/test/resources/WEB-INF/jsp/testMso.jsp
+++ b/vid-app-common/src/test/resources/WEB-INF/jsp/testMso.jsp
@@ -31,7 +31,7 @@
 	Consider / investigate replacing this approach with an alternative
 	REST / Angular mechanism.
 -->
-<%@ page import="org.openecomp.vid.mso.*"%>
+<%@ page import="org.onap.vid.mso.*"%>
 <%@ page import="org.openecomp.portalsdk.core.util.SystemProperties"%>
 <%
 	String properties = "{msoMaxPolls:" + SystemProperties.getProperty(MsoProperties.MSO_MAX_POLLS)
diff --git a/vid-app-common/src/test/resources/WEB-INF/jsp/testViewEdit.jsp b/vid-app-common/src/test/resources/WEB-INF/jsp/testViewEdit.jsp
index 031fedf..105ff0b 100644
--- a/vid-app-common/src/test/resources/WEB-INF/jsp/testViewEdit.jsp
+++ b/vid-app-common/src/test/resources/WEB-INF/jsp/testViewEdit.jsp
@@ -7,7 +7,7 @@
 <link rel="stylesheet" type="text/css" href="app/vid/styles/dialogs.css" />
 
 <script src="app/vid/scripts/controller/creationDialogController.js"></script>
-<script src="app/vid/scripts/controller/deletionDialogController.js"></script>
+<script src="app/vid/scripts/controller/deleteResumeDialogController.js"></script>
 <script src="app/vid/scripts/controller/detailsDialogController.js"></script>
 <script src="app/vid/scripts/controller/statusDialogController.js"></script>
 <script src="app/vid/scripts/controller/msoCommitController.js"></script>
@@ -16,7 +16,7 @@
 <script src="app/vid/scripts/services/asdcService.js"></script>
 <script src="app/vid/scripts/services/creationService.js"></script>
 <script src="app/vid/scripts/services/dataService.js"></script>
-<script src="app/vid/scripts/services/deletionService.js"></script>
+<script src="app/vid/scripts/services/deleteResumeService.js"></script>
 <script src="app/vid/scripts/services/detailsService.js"></script>
 <script src="app/vid/scripts/services/statusService.js"></script>
 <script src="app/vid/scripts/services/componentService.js"></script>
@@ -40,7 +40,7 @@
 	Consider / investigate replacing this approach with an alternative
 	REST / Angular mechanism.
 -->
-<%@ page import="org.openecomp.vid.mso.*"%>
+<%@ page import="org.onap.vid.mso.*"%>
 <%@ page import="org.openecomp.portalsdk.core.util.SystemProperties"%>
 <%
 	String properties = "{msoMaxPolls:" + SystemProperties.getProperty(MsoProperties.MSO_MAX_POLLS)
@@ -54,7 +54,7 @@
 	<div popup-window class="popupContents" ngx-show="{{popup.isVisible}}"
 		ng-cloak>
 		<div ng-include="'app/vid/scripts/view-models/creationDialog.htm'"></div>
-		<div ng-include="'app/vid/scripts/view-models/deletionDialog.htm'"></div>
+		<div ng-include="'app/vid/scripts/view-models/deleteResumeDialog.htm'"></div>
 		<div ng-include="'app/vid/scripts/view-models/detailsDialog.htm'"
 			onload="autoStartTest();"></div>
 	</div>
diff --git a/vid-app-common/src/test/resources/asdc.properties b/vid-app-common/src/test/resources/asdc.properties
index 8352ff2..b40aa9a 100644
--- a/vid-app-common/src/test/resources/asdc.properties
+++ b/vid-app-common/src/test/resources/asdc.properties
@@ -1,4 +1,4 @@
-asdc.client.type=REST
+asdc.client.type=LOCAL
 
 asdc.client.rest.protocol=http
 asdc.client.rest.host=c2.vm1.sdc.simpledemo.openecomp.org
diff --git a/vid-app-common/src/test/resources/csv_files/csv_to_json.csv b/vid-app-common/src/test/resources/csv_files/csv_to_json.csv
new file mode 100644
index 0000000..02229ca
--- /dev/null
+++ b/vid-app-common/src/test/resources/csv_files/csv_to_json.csv
@@ -0,0 +1,99 @@
+﻿payload,request-parameters,,,vnf-name,ibcx0099v
+payload,request-parameters,[vm],,vm-name,ibcx0001vm001
+payload,request-parameters,[vm],[vnfc],vnfc-name,ibcx0001vm001dbg001
+payload,request-parameters,[vm],[vnfc],vnfc-function-code,dbg
+payload,request-parameters,[vm],[vnfc],vnfc-type,DBE-VM #1
+payload,request-parameters,[vm],[vnfc],group-notation,ibcx0001vm001dbg001pair
+payload,request-parameters,[vm],[vnfc],ipaddress-v4-oam-vip,135.21.166.39
+payload,request-parameters,[vm],,vm-name,ibcx0001vm002
+payload,request-parameters,[vm],[vnfc],vnfc-name,ibcx0001vm002dbg001
+payload,request-parameters,[vm],[vnfc],vnfc-function-code,dbg
+payload,request-parameters,[vm],[vnfc],vnfc-type,DBE-VM #1
+payload,request-parameters,[vm],[vnfc],group-notation,ibcx0001vm001dbg001pair
+,,,,,
+payload,request-parameters,,,template-name,vdbe_template1
+payload,configuration,,,configuration-string,"   <configuration xmlns=""http://xml.juniper.net/xnm/1.1/xnm"" 
+    xmlns:a=""http://xml.juniper.net/junos/15.1X49/junos"" >
+            <version>15.1X49-D50.3</version>
+            <groups>
+                <name>node0</name>
+                <system>
+                    <host-name>$node0_hostname</host-name>
+                    <backup-router>
+                        <address>$node0_backup_router_address</address>
+                        <destination>0.0.0.0/0</destination>
+             </backup-router>
+                </system>
+     </groups>
+    </configuration>"
+payload,configuration,,,configuration-json,"{
+   ""version"": ""15.1X49-D50.3"",
+   ""groups"": {
+      ""name"": ""node0"",
+      ""system"": {
+         ""host-name"": ""$node0_hostname"",
+         ""backup-router"": {
+            ""address"": ""$node0_backup_router_address"",
+            ""destination"": ""0.0.0.0/0""
+         }
+      }
+   }
+}"
+,,,,,
+,,,,,
+,,,,,
+,,,,,
+,,,,,
+payload,configuration-parameters,nat_source_sp_v6rogerssnat_address1,2001:1890:fc45:f025:135:25:246:c806/128
+,,,,,
+,,,,,
+,,,,,
+,,,,,
+,,,,,
+,,,,,
+,,,,,
+,,,,,
+,,,,,
+,,,,,
+,,,,,
+,,,,,
+,,,,,
+,,,,,
+,,,,,
+,,,,,
+,,,,,
+,,,,,
+,,,,,
+,,,,,
+,,,,,
+,,,,,
+,,,,,
+,,,,,
+,,,,,
+,,,,,
+,,,,,
+,,,,,
+,,,,,
+,,,,,
+,,,,,
+,,,,,
+,,,,,
+,,,,,
+,,,,,
+,,,,,
+,,,,,
+,,,,,
+,,,,,
+,,,,,
+,,,,,
+,,,,,
+,,,,,
+,,,,,
+,,,,,
+,,,,,
+,,,,,
+,,,,,
+,,,,,
+,,,,,
+,,,,,
+,,,,,
diff --git a/vid-app-common/src/test/resources/csv_files/empty_file.csv b/vid-app-common/src/test/resources/csv_files/empty_file.csv
new file mode 100644
index 0000000..8a4b14f
--- /dev/null
+++ b/vid-app-common/src/test/resources/csv_files/empty_file.csv
@@ -0,0 +1,18 @@
+,,,,,
+,,,,,
+,,,,,
+,,,,,
+,,,,,
+,,,,,
+,,,,,
+,,,,,
+,,,,,
+,,,,,
+,,,,,
+,,,,,
+,,,,,
+,,,,,
+,,,,,
+,,,,,
+,,,,,
+,,,,,
\ No newline at end of file
diff --git a/vid-app-common/src/test/resources/csv_files/missing_content.csv b/vid-app-common/src/test/resources/csv_files/missing_content.csv
new file mode 100644
index 0000000..9b9e14d
--- /dev/null
+++ b/vid-app-common/src/test/resources/csv_files/missing_content.csv
@@ -0,0 +1,2 @@
+payload,request-parameters,,,ibcx0099v
+payload,request-parameters,,aa,vv
\ No newline at end of file
diff --git a/vid-app-common/src/test/resources/csv_files/missing_values.csv b/vid-app-common/src/test/resources/csv_files/missing_values.csv
new file mode 100644
index 0000000..0e914f0
--- /dev/null
+++ b/vid-app-common/src/test/resources/csv_files/missing_values.csv
@@ -0,0 +1,2 @@
+payload,,,,,
+payload,request-parameters,,aa,vv
diff --git a/vid-app-common/src/test/resources/csv_files/one_line.csv b/vid-app-common/src/test/resources/csv_files/one_line.csv
new file mode 100644
index 0000000..315e939
--- /dev/null
+++ b/vid-app-common/src/test/resources/csv_files/one_line.csv
@@ -0,0 +1 @@
+payload,request-parameters,,,vnf-name,ibcx0099v
\ No newline at end of file
diff --git a/vid-app-common/src/test/resources/mso.properties b/vid-app-common/src/test/resources/mso.properties
index 8f2bb01..fcd20bd 100644
--- a/vid-app-common/src/test/resources/mso.properties
+++ b/vid-app-common/src/test/resources/mso.properties
@@ -8,6 +8,7 @@
 mso.restapi.network.instance=/serviceInstances/v3/<service_instance_id>/networks
 mso.restapi.vf.module.instance=/serviceInstances/v3/<service_instance_id>/vnfs/<vnf_instance_id>/vfModules
 mso.restapi.volume.group.instance=/serviceInstances/v3/<service_instance_id>/vnfs/<vnf_instance_id>/volumeGroups
+mso.restapi.configurations=/serviceInstances/v6/<service_instance_id>/configurations
 mso.restapi.get.orc.req=/orchestrationRequests/v3
 mso.restapi.get.orc.reqs=/orchestrationRequests/v3?
 mso.restapi.get.man.tasks=/tasks/v1
diff --git a/vid-app-common/src/test/resources/objectconfig.properties b/vid-app-common/src/test/resources/objectconfig.properties
index 312e5bc..0093129 100755
--- a/vid-app-common/src/test/resources/objectconfig.properties
+++ b/vid-app-common/src/test/resources/objectconfig.properties
@@ -14,3 +14,5 @@
 serviceTypeDropDown=.//*[@id='mContent']/div/div/table/tbody/tr[2]/td[2]/div/select
 submitButton=.//*[@id='mContent']/div/div/table/tbody/tr[3]/td/div/button
 
+test.loginId=2222
+test.loginPassword=2222
diff --git a/vid-app-common/src/test/resources/payload_jsons/activateOperationalEnvironmentsPayloadToMso.json b/vid-app-common/src/test/resources/payload_jsons/activateOperationalEnvironmentsPayloadToMso.json
new file mode 100644
index 0000000..400a55f
--- /dev/null
+++ b/vid-app-common/src/test/resources/payload_jsons/activateOperationalEnvironmentsPayloadToMso.json
@@ -0,0 +1,23 @@
+{
+  "requestDetails": {
+    "requestInfo": {
+      "resourceType": "operationalEnvironment",
+      "source": "VID",
+      "requestorId": "<userId>"
+    },
+    "relatedInstanceList": [
+      {
+        "relatedInstance": {
+          "resourceType": "operationalEnvironment",
+          "instanceId": "<relatedInstanceId>",
+          "instanceName": "<relatedInstanceName>"
+        }
+      }
+    ],
+    "requestParameters": {
+      "operationalEnvironmentType": "VNF",
+      "workloadContext": "<workloadContext>",
+      "manifest": <manifest>
+    }
+  }
+}
\ No newline at end of file
diff --git a/vid-app-common/src/test/resources/payload_jsons/createOperationalEnvironmentsPayloadToMso.json b/vid-app-common/src/test/resources/payload_jsons/createOperationalEnvironmentsPayloadToMso.json
new file mode 100644
index 0000000..bdfdb4e
--- /dev/null
+++ b/vid-app-common/src/test/resources/payload_jsons/createOperationalEnvironmentsPayloadToMso.json
@@ -0,0 +1,24 @@
+{
+  "requestDetails": {
+    "requestInfo": {
+      "resourceType": "operationalEnvironment",
+      "instanceName": "<instanceName>",
+      "source": "VID",
+      "requestorId": "<userId>"
+    },
+    "relatedInstanceList": [
+      {
+        "relatedInstance": {
+          "resourceType": "operationalEnvironment",
+          "instanceId": "<ecompInstanceId>",
+          "instanceName": "<ecompInstanceName>"
+        }
+      }
+    ],
+    "requestParameters": {
+      "operationalEnvironmentType": "<operationalEnvType>",
+      "tenantContext": "<tenantContext>",
+      "workloadContext": "<workloadContext>"
+    }
+  }
+}
\ No newline at end of file
diff --git a/vid-app-common/src/test/resources/payload_jsons/deactivateOperationalEnvironmentsPayloadToMso.json b/vid-app-common/src/test/resources/payload_jsons/deactivateOperationalEnvironmentsPayloadToMso.json
new file mode 100644
index 0000000..b9ff151
--- /dev/null
+++ b/vid-app-common/src/test/resources/payload_jsons/deactivateOperationalEnvironmentsPayloadToMso.json
@@ -0,0 +1,12 @@
+{
+  "requestDetails": {
+    "requestInfo": {
+      "resourceType": "operationalEnvironment",
+      "source": "VID",
+      "requestorId": "<userId>"
+    },
+    "requestParameters": {
+      "operationalEnvironmentType": "VNF"
+    }
+  }
+}
\ No newline at end of file
diff --git a/vid-app-common/src/test/resources/payload_jsons/mso_request_create_configuration.json b/vid-app-common/src/test/resources/payload_jsons/mso_request_create_configuration.json
new file mode 100644
index 0000000..e0942ba
--- /dev/null
+++ b/vid-app-common/src/test/resources/payload_jsons/mso_request_create_configuration.json
@@ -0,0 +1,62 @@
+
+{
+  "requestDetails": {
+    "modelInfo": {
+      "modelType": "configuration",
+      "modelInvariantId": "c30a024e-a6c6-4670-b73c-3df64eb57ff6",
+      "modelVersionId": "f58d039d-4cfc-40ec-bd75-1f05f0458a6c",
+      "modelName": "Port Mirroring Configuration By Policy",
+      "modelVersion": "1.0",
+      "modelCustomizationId": "4b7ebace-bad6-4526-9be6-bf248e20fc5f",
+      "modelCustomizationName": "Port Mirroring Configuration By Policy 1"
+    },
+    "cloudConfiguration": {
+      "lcpCloudRegionId": "AAIAIC25"
+    },
+    "requestInfo": {
+      "instanceName":"test_sssdad",
+      "source": "VID",
+      "requestorId": "1"
+    },
+    "relatedInstanceList": [
+      {
+        "relatedInstance": {
+          "instanceId": "c187e9fe-40c3-4862-b73e-84ff056205f6 ",
+          "modelInfo": {
+            "modelType": "service",
+            "modelInvariantId": "b7d923c9-6175-41f1-91ba-4565c4953408",
+            "modelVersionId": "ee6d61be-4841-4f98-8f23-5de9da846ca7",
+            "modelName": "ServiceContainerMultiplepProbes",
+            "modelVersion": "1.0"
+          }
+        }
+      },
+      {
+        "relatedInstance": {
+          "instanceId": "9be14a4f-7367-4cf9-96a1-f08f10f485a7",
+          "instanceDirection": "source",
+          "modelInfo": {
+            "modelType": "vnf",
+            "modelInvariantId": "a7eac2b3-8444-40ee-92e3-b3359b32445c",
+            "modelVersionId": "2a2ea15f-07c6-4b89-bfca-e8aba39a34d6",
+            "modelName": "vmmeService2",
+            "modelVersion": "1.0",
+            "modelCustomizationId": "060be63d-5f9c-4fd0-8ef7-830d5e8eca17"
+          }
+        }
+      },
+      {
+        "relatedInstance": {
+          "instanceId": "AS-pnf2-10219--as988q",
+          "instanceDirection": "destination",
+          "modelInfo": {
+            "modelType": "pnf"
+          }
+        }
+      }
+    ],
+    "requestParameters": {
+      "userParams": []
+    }
+  }
+}
\ No newline at end of file
diff --git a/vid-app-common/src/test/resources/policy-configuration-csar.JSON b/vid-app-common/src/test/resources/policy-configuration-csar.JSON
new file mode 100644
index 0000000..8e9b46e
--- /dev/null
+++ b/vid-app-common/src/test/resources/policy-configuration-csar.JSON
@@ -0,0 +1,168 @@
+{
+  "service": {
+    "uuid": "ee6d61be-4841-4f98-8f23-5de9da846ca7",
+    "invariantUuid": "b7d923c9-6175-41f1-91ba-4565c4953408",
+    "name": "ServiceContainerMultiplepProbes",
+    "version": "1.0",
+    "toscaModelURL": null,
+    "category": "Network L1-3",
+    "serviceType": "portMirroring",
+    "serviceRole": "pProbe",
+    "description": "sdfsdfsdf",
+    "serviceEcompNaming": "true",
+    "inputs": {}
+  },
+  "vnfs": {},
+  "networks": {},
+  "configurations": {
+    "Port Mirroring Configuration By Policy 1": {
+      "uuid": "f58d039d-4cfc-40ec-bd75-1f05f0458a6c",
+      "invariantUuid": "c30a024e-a6c6-4670-b73c-3df64eb57ff6",
+      "description": "A port mirroring configuration by policy object",
+      "name": "Port Mirroring Configuration By Policy",
+      "version": "1.0",
+      "customizationUuid": "4b7ebace-bad6-4526-9be6-bf248e20fc5f",
+      "inputs": {},
+      "commands": {},
+      "properties": {
+        "collector_node": "pprobeservice_proxy 5",
+        "policy_name": "policy2",
+        "equip_vendor": "Cisco",
+        "equip_model": "Nexus 3048-TP"
+      },
+      "type": "Configuration",
+      "modelCustomizationName": "Port Mirroring Configuration By Policy 1",
+      "sourceNodes": [
+        "vmmeservice2_proxy 2",
+        "vmmeservice2_proxy 3",
+        "vmmeservice_proxy 1"
+      ],
+      "collectorNodes": [
+        "pprobeservice_proxy 5"
+      ],
+      "configurationByPolicy": true
+    },
+    "Port Mirroring Configuration By Policy 0": {
+      "uuid": "f58d039d-4cfc-40ec-bd75-1f05f0458a6c",
+      "invariantUuid": "c30a024e-a6c6-4670-b73c-3df64eb57ff6",
+      "description": "A port mirroring configuration by policy object",
+      "name": "Port Mirroring Configuration By Policy",
+      "version": "1.0",
+      "customizationUuid": "08a181aa-72eb-435f-9593-e88a3ad0a86b",
+      "inputs": {},
+      "commands": {},
+      "properties": {
+        "collector_node": "pprobeservice_proxy 4",
+        "policy_name": "policy1",
+        "equip_vendor": "Cisco",
+        "equip_model": "Nexus 3048-TP"
+      },
+      "type": "Configuration",
+      "modelCustomizationName": "Port Mirroring Configuration By Policy 0",
+      "sourceNodes": [
+        "vmmeservice2_proxy 2",
+        "vmmeservice_proxy 1",
+        "vmmeservice_proxy 0"
+      ],
+      "collectorNodes": [
+        "pprobeservice_proxy 4"
+      ],
+      "configurationByPolicy": true
+    }
+  },
+  "serviceProxies": {
+    "vmmeservice_proxy 0": {
+      "uuid": "a32fee17-5b59-4c34-ba6f-6dd2f1c61fee",
+      "invariantUuid": "2933b574-d28d-45ea-bf22-4df2907e4a10",
+      "description": "A Proxy for Service vmmeService",
+      "name": "vmmeService Service Proxy",
+      "version": "1.0",
+      "customizationUuid": "d7cfe338-eeda-4217-ba13-f24b0811fb17",
+      "inputs": {},
+      "commands": {},
+      "properties": {},
+      "type": "Service Proxy",
+      "sourceModelUuid": "c3e6c9bd-b24d-458e-aa99-e0cadf70c5e5",
+      "sourceModelInvariant": "dd8a805d-3946-4f11-9831-e26cd6aec9a3",
+      "sourceModelName": "vmmeService"
+    },
+    "vmmeservice_proxy 1": {
+      "uuid": "a32fee17-5b59-4c34-ba6f-6dd2f1c61fee",
+      "invariantUuid": "2933b574-d28d-45ea-bf22-4df2907e4a10",
+      "description": "A Proxy for Service vmmeService",
+      "name": "vmmeService Service Proxy",
+      "version": "1.0",
+      "customizationUuid": "7a69f133-564c-4eb6-b93e-0a8281967efb",
+      "inputs": {},
+      "commands": {},
+      "properties": {},
+      "type": "Service Proxy",
+      "sourceModelUuid": "c3e6c9bd-b24d-458e-aa99-e0cadf70c5e5",
+      "sourceModelInvariant": "dd8a805d-3946-4f11-9831-e26cd6aec9a3",
+      "sourceModelName": "vmmeService"
+    },
+    "vmmeservice2_proxy 3": {
+      "uuid": "a32fee17-5b59-4c34-ba6f-6dd2f1c61fee",
+      "invariantUuid": "2933b574-d28d-45ea-bf22-4df2907e4a10",
+      "description": "A Proxy for Service vmmeService2",
+      "name": "vmmeService2 Service Proxy",
+      "version": "1.0",
+      "customizationUuid": "9d81c21f-e29c-44f6-b5f6-caa974ee078a",
+      "inputs": {},
+      "commands": {},
+      "properties": {},
+      "type": "Service Proxy",
+      "sourceModelUuid": "2a2ea15f-07c6-4b89-bfca-e8aba39a34d6",
+      "sourceModelInvariant": "a7eac2b3-8444-40ee-92e3-b3359b32445c",
+      "sourceModelName": "vmmeService2"
+    },
+    "pprobeservice_proxy 4": {
+      "uuid": "a32fee17-5b59-4c34-ba6f-6dd2f1c61fee",
+      "invariantUuid": "2933b574-d28d-45ea-bf22-4df2907e4a10",
+      "description": "A Proxy for Service pProbeService",
+      "name": "pProbeService Service Proxy",
+      "version": "1.0",
+      "customizationUuid": "271efa3b-276e-4536-976a-cc9c9c014f1e",
+      "inputs": {},
+      "commands": {},
+      "properties": {},
+      "type": "Service Proxy",
+      "sourceModelUuid": "8a84e59b-45fe-4851-8ff1-34225a0b32c3",
+      "sourceModelInvariant": "83b458fd-5dd3-419b-a9e3-7335814a0911",
+      "sourceModelName": "pProbeService"
+    },
+    "pprobeservice_proxy 5": {
+      "uuid": "a32fee17-5b59-4c34-ba6f-6dd2f1c61fee",
+      "invariantUuid": "2933b574-d28d-45ea-bf22-4df2907e4a10",
+      "description": "A Proxy for Service pProbeService",
+      "name": "pProbeService Service Proxy",
+      "version": "1.0",
+      "customizationUuid": "d64623ae-5935-4afd-803e-c86e94d8e740",
+      "inputs": {},
+      "commands": {},
+      "properties": {},
+      "type": "Service Proxy",
+      "sourceModelUuid": "8a84e59b-45fe-4851-8ff1-34225a0b32c3",
+      "sourceModelInvariant": "83b458fd-5dd3-419b-a9e3-7335814a0911",
+      "sourceModelName": "pProbeService"
+    },
+    "vmmeservice2_proxy 2": {
+      "uuid": "a32fee17-5b59-4c34-ba6f-6dd2f1c61fee",
+      "invariantUuid": "2933b574-d28d-45ea-bf22-4df2907e4a10",
+      "description": "A Proxy for Service vmmeService2",
+      "name": "vmmeService2 Service Proxy",
+      "version": "1.0",
+      "customizationUuid": "060be63d-5f9c-4fd0-8ef7-830d5e8eca17",
+      "inputs": {},
+      "commands": {},
+      "properties": {},
+      "type": "Service Proxy",
+      "sourceModelUuid": "2a2ea15f-07c6-4b89-bfca-e8aba39a34d6",
+      "sourceModelInvariant": "a7eac2b3-8444-40ee-92e3-b3359b32445c",
+      "sourceModelName": "vmmeService2"
+    }
+  },
+  "vfModules": {},
+  "volumeGroups": {},
+  "pnfs": {}
+}
\ No newline at end of file
diff --git a/vid-app-common/src/test/resources/services/change_management_software_update_expected_mso_request.json b/vid-app-common/src/test/resources/services/change_management_software_update_expected_mso_request.json
new file mode 100644
index 0000000..3ac1cf5
--- /dev/null
+++ b/vid-app-common/src/test/resources/services/change_management_software_update_expected_mso_request.json
@@ -0,0 +1,15 @@
+{
+  "requestDetails": {
+    "cloudConfiguration": {
+      "lcpCloudRegionId": "mdt1",
+      "tenantId": "88a6ca3ee0394ade9403f075db23167e"
+    },
+    "requestInfo": {
+      "source": "VID",
+      "requestorId": "az2016"
+    },
+    "requestParameters": {
+      "payload": "{\"existing-software-version\": \"3.1\",\"new-software-version\": \"3.2\", \"operations-timeout\": \"3600\"}"
+    }
+  }
+}
\ No newline at end of file
diff --git a/vid-app-common/src/test/resources/services/change_management_software_update_request.json b/vid-app-common/src/test/resources/services/change_management_software_update_request.json
new file mode 100644
index 0000000..1b697d6
--- /dev/null
+++ b/vid-app-common/src/test/resources/services/change_management_software_update_request.json
@@ -0,0 +1,26 @@
+{ "requestDetails": [
+    {
+      "cloudConfiguration": {
+        "lcpCloudRegionId": "mdt1",
+        "tenantId": "88a6ca3ee0394ade9403f075db23167e"
+      },
+      "requestInfo": {
+        "source": "VID",
+        "requestorId": "az2016"
+      },
+      "requestParameters": {
+        "payload": "{\"existing-software-version\": \"3.1\",\"new-software-version\": \"3.2\", \"operations-timeout\": \"3600\"}"
+      },
+      "vnfName": "vidVnf",
+      "vnfInstanceId": "abe59ceb-6909-4a2c-ad6a-c46d90b18f0b",
+      "relatedInstanceList": [
+        {
+          "relatedInstance": {
+            "instanceId": "166b2c5b-6746-4613-bd38-faf46f7afb73"
+          }
+        }
+      ]
+    }
+  ],
+  "requestType": "VNF In Place Software Update"
+}
\ No newline at end of file
diff --git a/vid-app-common/src/test/resources/vf-csar.JSON b/vid-app-common/src/test/resources/vf-csar.JSON
index 097b319..e919241 100644
--- a/vid-app-common/src/test/resources/vf-csar.JSON
+++ b/vid-app-common/src/test/resources/vf-csar.JSON
@@ -4,8 +4,8 @@
   "service": {
     "category": "Mobility",
     "description": "Bla bla",
-    "serviceRole":"null",
-    "serviceType":"null",
+    "serviceRole":null,
+    "serviceType":null,
     
     "inputs": {
       "greatdefect0_availability_zone_max_count": {
@@ -41,10 +41,13 @@
     "serviceEcompNaming": "true",
     "toscaModelURL": null,
     "uuid": "48a52540-8772-4368-9cdb-1f124ea5c931",
-    "version": "0.1"
+    "version": "1.0",
+    "instantiationType" : null
   },
   "vfModules": {
     "greatdefect0..Greatdefect..base_ixla..module-0": {
+
+
       "commands": {
       },
       "customizationUuid": "316e323d-611d-4007-a647-b1d2ecdaee9e",
@@ -100,6 +103,8 @@
           "inputName": "greatdefect0_vf_module_id"
         }
       },
+      "type":"VF",
+
       "customizationUuid": "9123ced3-fbcd-42f7-b103-5965c54bbd66",
       "description": "checl-IdanWithSecondFix",
       "inputs": {
@@ -146,11 +151,47 @@
       "uuid": "3b25707a-d345-4a80-8744-73adf8f2e67b",
       "version": "3.0",
       "vfModules": {
+        "greatdefect0..Greatdefect..module_1_ixla..module-2": {
+          "uuid": "6f09e053-56a6-4fbb-8299-e1de616825cc",
+          "invariantUuid": "e0297a51-c670-452e-b31c-c5b37c6ad40f",
+          "customizationUuid": "1106fca3-235a-4f92-8d5a-960a7336b32f",
+          "description": null,
+          "name": "Greatdefect..module_1_ixla..module-2",
+          "version": "3",
+          "volumeGroupAllowed": false,
+          "commands": {},
+          "modelCustomizationName": "Greatdefect..module_1_ixla..module-2"
+        },
+        "greatdefect0..Greatdefect..base_ixla..module-0": {
+          "uuid": "01166434-ef34-4969-aaf2-626203d72e48",
+          "invariantUuid": "80ff85fb-cb11-42cb-9737-e47095d42756",
+          "customizationUuid": "316e323d-611d-4007-a647-b1d2ecdaee9e",
+          "description": null,
+          "name": "Greatdefect..base_ixla..module-0",
+          "version": "3",
+          "volumeGroupAllowed": false,
+          "commands": {},
+          "modelCustomizationName": "Greatdefect..base_ixla..module-0"
+        },
+        "greatdefect0..Greatdefect..module_2_ixla..module-1": {
+          "uuid": "dea8e41f-c996-4557-b521-263210d96baa",
+          "invariantUuid": "23befc6e-aa97-4004-b215-4979c3f84913",
+          "customizationUuid": "b52c1fda-fbbf-4de3-ad9b-190d4a14990c",
+          "description": null,
+          "name": "Greatdefect..module_2_ixla..module-1",
+          "version": "3",
+          "volumeGroupAllowed": false,
+          "commands": {},
+          "modelCustomizationName": "Greatdefect..module_2_ixla..module-1"
+        }
       },
       "volumeGroups": {
       }
     }
   },
-  "volumeGroups": {
-  }
+  "volumeGroups": {},
+  "configurations":{},
+  "serviceProxies":{},
+  "pnfs":{}
+
 }
diff --git a/vid-app-common/src/test/resources/vl-csar.JSON b/vid-app-common/src/test/resources/vl-csar.JSON
index 78f6a63..ff7eb47 100644
--- a/vid-app-common/src/test/resources/vl-csar.JSON
+++ b/vid-app-common/src/test/resources/vl-csar.JSON
@@ -1,12 +1,8 @@
 {
     "networks": {
         "ExtVL 0": {
+            "type": "VL",
             "commands": {
-                "exVL_naming#naming_policy": {
-                    "command": "get_input",
-                    "displayName": "exVL_naming#naming_policy",
-                    "inputName": "extvl0_exVL_naming_naming_policy"
-                },
                 "network_role": {
                     "command": "get_input",
                     "displayName": "network_role",
@@ -16,20 +12,16 @@
                     "command": "get_input",
                     "displayName": "network_scope",
                     "inputName": "extvl0_network_scope"
+                },
+                "exVL_naming#naming_policy": {
+                    "command": "get_input",
+                    "displayName": "exVL_naming#naming_policy",
+                    "inputName": "extvl0_exVL_naming_naming_policy"
                 }
             },
             "customizationUuid": "664f8aa7-3989-46ac-81c0-dd72a8a63f26",
             "description": "ECOMP generic virtual link (network) base type for all other service-level and global networks",
             "inputs": {
-                "exVL_naming#naming_policy": {
-                    "constraints": [
-                    ],
-                    "default": null,
-                    "description": "Reference to naming policy that ECOMP will use when the name is auto-generated",
-                    "entry_schema": null,
-                    "required": true,
-                    "type": "string"
-                },
                 "network_role": {
                     "constraints": [
                     ],
@@ -47,13 +39,22 @@
                     "entry_schema": null,
                     "required": true,
                     "type": "string"
+                },
+                "exVL_naming#naming_policy": {
+                    "constraints": [
+                    ],
+                    "default": null,
+                    "description": "Reference to naming policy that ECOMP will use when the name is auto-generated",
+                    "entry_schema": null,
+                    "required": true,
+                    "type": "string"
                 }
             },
             "invariantUuid": "379f816b-a7aa-422f-be30-17114ff50b7c",
             "modelCustomizationName": "ExtVL 0",
             "name": "ExtVL",
             "properties": {
-                "exVL_naming": "{naming_policy={get_input=extvl0_exVL_naming_naming_policy}}",
+                "exVL_naming": "{naming_policy=get_input:extvl0_exVL_naming_naming_policy}",
                 "network_role": "get_input:extvl0_network_role",
                 "network_scope": "get_input:extvl0_network_scope"
             },
@@ -64,8 +65,8 @@
     "service": {
         "category": "Network L1-3",
         "description": "dsfg",
-          "serviceRole":"null",
-    	"serviceType":"null",
+        "serviceRole": null,
+        "serviceType": null,
         "inputs": {
             "extvl0_exVL_naming_naming_policy": {
                 "constraints": [
@@ -100,12 +101,19 @@
         "serviceEcompNaming": "true",
         "toscaModelURL": null,
         "uuid": "68101369-6f08-4e99-9a28-fa6327d344f3",
-        "version": "0.1"
+        "version": "1.0",
+        "instantiationType" : "ClientConfig"
     },
     "vfModules": {
     },
     "vnfs": {
     },
     "volumeGroups": {
+    },
+    "configurations": {
+    },
+    "serviceProxies": {
+    },
+    "pnfs": {
     }
-}
+}
\ No newline at end of file
diff --git a/vid-app-common/src/test/resources/vnfConfigUpdatePayload.json b/vid-app-common/src/test/resources/vnfConfigUpdatePayload.json
new file mode 100644
index 0000000..cb2bf30
--- /dev/null
+++ b/vid-app-common/src/test/resources/vnfConfigUpdatePayload.json
@@ -0,0 +1,40 @@
+{
+    "payload":{
+        "request-parameters":{
+            "vm":[
+                {
+                    "vnfc":[
+                        {
+                            "ipaddress-v4-oam-vip":"135.21.166.39",
+                            "vnfc-name":"ibcx0001vm001dbg001",
+                            "vnfc-function-code":"dbg",
+                            "vnfc-type":"DBE-VM #1",
+                            "group-notation":"ibcx0001vm001dbg001pair"
+                        }
+                    ],
+                    "vm-name":"ibcx0001vm001"
+                },
+                {
+                    "vnfc":[
+                        {
+                            "vnfc-name":"ibcx0001vm002dbg001",
+                            "vnfc-function-code":"dbg",
+                            "vnfc-type":"DBE-VM #1",
+                            "group-notation":"ibcx0001vm001dbg001pair"
+                        }
+                    ],
+                    "vm-name":"ibcx0001vm002"
+                }
+            ],
+            "vnf-name":"ibcx0099v",
+            "template-name":"vdbe_template1"
+        },
+        "configuration":{
+            "configuration-json":"{\n   \"version\": \"15.1X49-D50.3\",\n   \"groups\": {\n      \"name\": \"node0\",\n      \"system\": {\n         \"host-name\": \"$node0_hostname\",\n         \"backup-router\": {\n            \"address\": \"$node0_backup_router_address\",\n            \"destination\": \"0.0.0.0/0\"\n         }\n      }\n   }\n}",
+            "configuration-string": "   <configuration xmlns=\"http://xml.juniper.net/xnm/1.1/xnm\" \n    xmlns:a=\"http://xml.juniper.net/junos/15.1X49/junos\" >\n            <version>15.1X49-D50.3<\/version>\n            <groups>\n                <name>node0<\/name>\n                <system>\n                    <host-name>$node0_hostname<\/host-name>\n                    <backup-router>\n                        <address>$node0_backup_router_address<\/address>\n                        <destination>0.0.0.0/0<\/destination>\n             <\/backup-router>\n                <\/system>\n     <\/groups>\n    <\/configuration>"
+        },
+        "configuration-parameters":{
+            "nat_source_sp_v6rogerssnat_address1":"2001:1890:fc45:f025:135:25:246:c806/128"
+        }
+    }
+}
\ No newline at end of file
