diff --git a/vid-app-common/src/main/java/org/openecomp/vid/RelatedTo.java b/vid-app-common/src/main/java/org/onap/vid/RelatedTo.java
similarity index 86%
rename from vid-app-common/src/main/java/org/openecomp/vid/RelatedTo.java
rename to vid-app-common/src/main/java/org/onap/vid/RelatedTo.java
index 48ca497..738f620 100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/RelatedTo.java
+++ b/vid-app-common/src/main/java/org/onap/vid/RelatedTo.java
@@ -1,4 +1,4 @@
-package org.openecomp.vid;
+package org.onap.vid;
 
 import com.fasterxml.jackson.annotation.*;
 import org.codehaus.jackson.annotate.JsonProperty;
@@ -10,6 +10,7 @@
 @JsonPropertyOrder({
         "id",
         "node-type",
+        "relationship-label",
         "url"
 })
 public class RelatedTo {
@@ -18,6 +19,8 @@
     public String id;
     @JsonProperty("node-type")
     public String nodeType;
+    @JsonProperty("relationship-label")
+    public String relationshipLabel;
     @JsonProperty("url")
     public String url;
     @JsonIgnore
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/openecomp/vid/aai/ServiceInstance.java b/vid-app-common/src/main/java/org/onap/vid/aai/ServiceInstance.java
similarity index 95%
rename from vid-app-common/src/main/java/org/openecomp/vid/aai/ServiceInstance.java
rename to vid-app-common/src/main/java/org/onap/vid/aai/ServiceInstance.java
index 45f7947..26f4a21 100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/aai/ServiceInstance.java
+++ b/vid-app-common/src/main/java/org/onap/vid/aai/ServiceInstance.java
@@ -1,4 +1,4 @@
-package org.openecomp.vid.aai;
+package org.onap.vid.aai;
 
 import org.codehaus.jackson.annotate.JsonIgnoreProperties;
 import org.codehaus.jackson.annotate.JsonProperty;
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/aai/ServiceInstances.java b/vid-app-common/src/main/java/org/onap/vid/aai/ServiceInstances.java
similarity index 90%
rename from vid-app-common/src/main/java/org/openecomp/vid/aai/ServiceInstances.java
rename to vid-app-common/src/main/java/org/onap/vid/aai/ServiceInstances.java
index 063317e..c92a47a 100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/aai/ServiceInstances.java
+++ b/vid-app-common/src/main/java/org/onap/vid/aai/ServiceInstances.java
@@ -1,4 +1,4 @@
-package org.openecomp.vid.aai;
+package org.onap.vid.aai;
 
 import org.codehaus.jackson.annotate.JsonIgnoreProperties;
 import org.codehaus.jackson.annotate.JsonProperty;
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/openecomp/vid/aai/ServiceSubscription.java b/vid-app-common/src/main/java/org/onap/vid/aai/ServiceSubscription.java
similarity index 93%
rename from vid-app-common/src/main/java/org/openecomp/vid/aai/ServiceSubscription.java
rename to vid-app-common/src/main/java/org/onap/vid/aai/ServiceSubscription.java
index 6a178d9..5dc9d52 100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/aai/ServiceSubscription.java
+++ b/vid-app-common/src/main/java/org/onap/vid/aai/ServiceSubscription.java
@@ -1,4 +1,4 @@
-package org.openecomp.vid.aai;
+package org.onap.vid.aai;
 
 import org.codehaus.jackson.annotate.JsonIgnoreProperties;
 import org.codehaus.jackson.annotate.JsonProperty;
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/aai/ServiceSubscriptions.java b/vid-app-common/src/main/java/org/onap/vid/aai/ServiceSubscriptions.java
similarity index 91%
rename from vid-app-common/src/main/java/org/openecomp/vid/aai/ServiceSubscriptions.java
rename to vid-app-common/src/main/java/org/onap/vid/aai/ServiceSubscriptions.java
index eaadba2..686dc7d 100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/aai/ServiceSubscriptions.java
+++ b/vid-app-common/src/main/java/org/onap/vid/aai/ServiceSubscriptions.java
@@ -1,4 +1,4 @@
-package org.openecomp.vid.aai;
+package org.onap.vid.aai;
 
 import org.codehaus.jackson.annotate.JsonIgnoreProperties;
 import org.codehaus.jackson.annotate.JsonProperty;
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/aai/Services.java b/vid-app-common/src/main/java/org/onap/vid/aai/Services.java
similarity index 94%
rename from vid-app-common/src/main/java/org/openecomp/vid/aai/Services.java
rename to vid-app-common/src/main/java/org/onap/vid/aai/Services.java
index e8148a9..fe70de5 100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/aai/Services.java
+++ b/vid-app-common/src/main/java/org/onap/vid/aai/Services.java
@@ -1,4 +1,4 @@
-package org.openecomp.vid.aai;
+package org.onap.vid.aai;
 
 import org.codehaus.jackson.annotate.JsonIgnoreProperties;
 import org.codehaus.jackson.annotate.JsonProperty;
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/aai/SubscriberAaiResponse.java b/vid-app-common/src/main/java/org/onap/vid/aai/SubscriberAaiResponse.java
similarity index 78%
rename from vid-app-common/src/main/java/org/openecomp/vid/aai/SubscriberAaiResponse.java
rename to vid-app-common/src/main/java/org/onap/vid/aai/SubscriberAaiResponse.java
index 53304e9..2dad75f 100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/aai/SubscriberAaiResponse.java
+++ b/vid-app-common/src/main/java/org/onap/vid/aai/SubscriberAaiResponse.java
@@ -1,7 +1,7 @@
-package org.openecomp.vid.aai;
+package org.onap.vid.aai;
 
-import org.openecomp.vid.model.ProxyResponse;
-import org.openecomp.vid.model.SubscriberList;
+import org.onap.vid.model.ProxyResponse;
+import org.onap.vid.model.SubscriberList;
 
 /**
  * Created by Oren on 7/5/17.
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/aai/SubscriberData.java b/vid-app-common/src/main/java/org/onap/vid/aai/SubscriberData.java
similarity index 69%
rename from vid-app-common/src/main/java/org/openecomp/vid/aai/SubscriberData.java
rename to vid-app-common/src/main/java/org/onap/vid/aai/SubscriberData.java
index efaa478..1c93d97 100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/aai/SubscriberData.java
+++ b/vid-app-common/src/main/java/org/onap/vid/aai/SubscriberData.java
@@ -1,4 +1,4 @@
-package org.openecomp.vid.aai;
+package org.onap.vid.aai;
 
 /**
  * Created by Oren on 7/10/17.
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/aai/SubscriberFilteredResults.java b/vid-app-common/src/main/java/org/onap/vid/aai/SubscriberFilteredResults.java
similarity index 80%
rename from vid-app-common/src/main/java/org/openecomp/vid/aai/SubscriberFilteredResults.java
rename to vid-app-common/src/main/java/org/onap/vid/aai/SubscriberFilteredResults.java
index c2afee3..2db9819 100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/aai/SubscriberFilteredResults.java
+++ b/vid-app-common/src/main/java/org/onap/vid/aai/SubscriberFilteredResults.java
@@ -1,8 +1,8 @@
-package org.openecomp.vid.aai;
+package org.onap.vid.aai;
 
-import org.openecomp.vid.model.ProxyResponse;
-import org.openecomp.vid.model.SubscriberList;
-import org.openecomp.vid.roles.RoleValidator;
+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.
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/aai/SubscriberListWithFilterData.java b/vid-app-common/src/main/java/org/onap/vid/aai/SubscriberListWithFilterData.java
similarity index 86%
rename from vid-app-common/src/main/java/org/openecomp/vid/aai/SubscriberListWithFilterData.java
rename to vid-app-common/src/main/java/org/onap/vid/aai/SubscriberListWithFilterData.java
index 75f505f..0d4b4b7 100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/aai/SubscriberListWithFilterData.java
+++ b/vid-app-common/src/main/java/org/onap/vid/aai/SubscriberListWithFilterData.java
@@ -1,8 +1,8 @@
-package org.openecomp.vid.aai;
+package org.onap.vid.aai;
 
-import org.openecomp.vid.model.Subscriber;
-import org.openecomp.vid.model.SubscriberList;
-import org.openecomp.vid.roles.RoleValidator;
+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;
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/aai/SubscriberWithFilter.java b/vid-app-common/src/main/java/org/onap/vid/aai/SubscriberWithFilter.java
similarity index 83%
rename from vid-app-common/src/main/java/org/openecomp/vid/aai/SubscriberWithFilter.java
rename to vid-app-common/src/main/java/org/onap/vid/aai/SubscriberWithFilter.java
index abd9c0f..aaaa144 100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/aai/SubscriberWithFilter.java
+++ b/vid-app-common/src/main/java/org/onap/vid/aai/SubscriberWithFilter.java
@@ -1,7 +1,7 @@
-package org.openecomp.vid.aai;
+package org.onap.vid.aai;
 
 import org.codehaus.jackson.annotate.JsonProperty;
-import org.openecomp.vid.model.Subscriber;
+import org.onap.vid.model.Subscriber;
 
 /**
  * Created by Oren on 7/5/17.
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/aai/exceptions/InvalidAAIResponseException.java b/vid-app-common/src/main/java/org/onap/vid/aai/exceptions/InvalidAAIResponseException.java
similarity index 70%
rename from vid-app-common/src/main/java/org/openecomp/vid/aai/exceptions/InvalidAAIResponseException.java
rename to vid-app-common/src/main/java/org/onap/vid/aai/exceptions/InvalidAAIResponseException.java
index f84c09a..e629648 100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/aai/exceptions/InvalidAAIResponseException.java
+++ b/vid-app-common/src/main/java/org/onap/vid/aai/exceptions/InvalidAAIResponseException.java
@@ -1,4 +1,4 @@
-package org.openecomp.vid.aai.exceptions;
+package org.onap.vid.aai.exceptions;
 
 /**
  * Created by Oren on 7/4/17.
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/ecomp/aai/model/AaiAICZones/AicZones.java b/vid-app-common/src/main/java/org/onap/vid/aai/model/AaiGetAicZone/AicZones.java
similarity index 76%
rename from vid-app-common/src/main/java/org/ecomp/aai/model/AaiAICZones/AicZones.java
rename to vid-app-common/src/main/java/org/onap/vid/aai/model/AaiGetAicZone/AicZones.java
index ee8bcf0..c30aaeb 100644
--- a/vid-app-common/src/main/java/org/ecomp/aai/model/AaiAICZones/AicZones.java
+++ b/vid-app-common/src/main/java/org/onap/vid/aai/model/AaiGetAicZone/AicZones.java
@@ -1,4 +1,4 @@
-package org.ecomp.aai.model.AaiAICZones;
+package org.onap.vid.aai.model.AaiGetAicZone;
 
 import java.util.List;
 
diff --git a/vid-app-common/src/main/java/org/ecomp/aai/model/AaiAICZones/Zone.java b/vid-app-common/src/main/java/org/onap/vid/aai/model/AaiGetAicZone/Zone.java
similarity index 86%
rename from vid-app-common/src/main/java/org/ecomp/aai/model/AaiAICZones/Zone.java
rename to vid-app-common/src/main/java/org/onap/vid/aai/model/AaiGetAicZone/Zone.java
index 00d387c..89400f2 100644
--- a/vid-app-common/src/main/java/org/ecomp/aai/model/AaiAICZones/Zone.java
+++ b/vid-app-common/src/main/java/org/onap/vid/aai/model/AaiGetAicZone/Zone.java
@@ -1,4 +1,4 @@
-package org.ecomp.aai.model.AaiAICZones;
+package org.onap.vid.aai.model.AaiGetAicZone;
 
 import org.codehaus.jackson.annotate.JsonIgnoreProperties;
 import org.codehaus.jackson.annotate.JsonProperty;
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/openecomp/vid/aai/model/AaiGetServicesRequestModel/GetServicesAAIRespone.java b/vid-app-common/src/main/java/org/onap/vid/aai/model/AaiGetServicesRequestModel/GetServicesAAIRespone.java
similarity index 79%
rename from vid-app-common/src/main/java/org/openecomp/vid/aai/model/AaiGetServicesRequestModel/GetServicesAAIRespone.java
rename to vid-app-common/src/main/java/org/onap/vid/aai/model/AaiGetServicesRequestModel/GetServicesAAIRespone.java
index 27c38ce..d3dd7d2 100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/aai/model/AaiGetServicesRequestModel/GetServicesAAIRespone.java
+++ b/vid-app-common/src/main/java/org/onap/vid/aai/model/AaiGetServicesRequestModel/GetServicesAAIRespone.java
@@ -1,4 +1,4 @@
-package org.openecomp.vid.aai.model.AaiGetServicesRequestModel;
+package org.onap.vid.aai.model.AaiGetServicesRequestModel;
 
 import org.codehaus.jackson.annotate.JsonIgnoreProperties;
 import org.codehaus.jackson.annotate.JsonProperty;
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/onap/vid/aai/model/AaiGetServicesRequestModel/Service.java
similarity index 88%
rename from vid-app-common/src/main/java/org/openecomp/vid/aai/model/AaiGetServicesRequestModel/Service.java
rename to vid-app-common/src/main/java/org/onap/vid/aai/model/AaiGetServicesRequestModel/Service.java
index 977e57e..367287e 100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/aai/model/AaiGetServicesRequestModel/Service.java
+++ b/vid-app-common/src/main/java/org/onap/vid/aai/model/AaiGetServicesRequestModel/Service.java
@@ -1,4 +1,4 @@
-package org.openecomp.vid.aai.model.AaiGetServicesRequestModel;
+package org.onap.vid.aai.model.AaiGetServicesRequestModel;
 
 import org.codehaus.jackson.annotate.JsonIgnoreProperties;
 import org.codehaus.jackson.annotate.JsonProperty;
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/openecomp/vid/aai/VnfResult.java b/vid-app-common/src/main/java/org/onap/vid/aai/model/PnfResult.java
similarity index 66%
copy from vid-app-common/src/main/java/org/openecomp/vid/aai/VnfResult.java
copy to vid-app-common/src/main/java/org/onap/vid/aai/model/PnfResult.java
index b8294e5..a727d8f 100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/aai/VnfResult.java
+++ b/vid-app-common/src/main/java/org/onap/vid/aai/model/PnfResult.java
@@ -1,8 +1,12 @@
-package org.openecomp.vid.aai;
+package org.onap.vid.aai.model;
 
-import com.fasterxml.jackson.annotation.*;
+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.openecomp.vid.RelatedTo;
+import org.onap.vid.RelatedTo;
 
 import java.util.HashMap;
 import java.util.List;
@@ -17,7 +21,7 @@
         "properties",
         "related-to"
 })
-public class VnfResult {
+public class PnfResult {
 
     @JsonProperty("id")
     public String id;
@@ -26,9 +30,10 @@
     @JsonProperty("url")
     public String url;
     @JsonProperty("properties")
-    public ServiceProperties properties;
+    public PnfProperties properties;
     @JsonProperty("related-to")
-    public List<RelatedTo> relatedTo = null;
+    public List<RelatedTo> relatedTo;
+
     @JsonIgnore
     private Map<String, Object> additionalProperties = new HashMap<String, Object>();
 
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/openecomp/vid/aai/model/RelatedToProperty.java b/vid-app-common/src/main/java/org/onap/vid/aai/model/RelatedToProperty.java
similarity index 92%
rename from vid-app-common/src/main/java/org/openecomp/vid/aai/model/RelatedToProperty.java
rename to vid-app-common/src/main/java/org/onap/vid/aai/model/RelatedToProperty.java
index c9f28ed..38003ae 100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/aai/model/RelatedToProperty.java
+++ b/vid-app-common/src/main/java/org/onap/vid/aai/model/RelatedToProperty.java
@@ -1,9 +1,10 @@
-package org.openecomp.vid.aai.model;
+package org.onap.vid.aai.model;
+
 
 import org.codehaus.jackson.annotate.JsonProperty;
 
 public class RelatedToProperty {
-	
+
 	public String getPropertyKey() {
 		return propertyKey;
 	}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/aai/model/Relationship.java b/vid-app-common/src/main/java/org/onap/vid/aai/model/Relationship.java
similarity index 79%
rename from vid-app-common/src/main/java/org/openecomp/vid/aai/model/Relationship.java
rename to vid-app-common/src/main/java/org/onap/vid/aai/model/Relationship.java
index 7960941..c80d5b6 100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/aai/model/Relationship.java
+++ b/vid-app-common/src/main/java/org/onap/vid/aai/model/Relationship.java
@@ -1,8 +1,11 @@
-package org.openecomp.vid.aai.model;
+package org.onap.vid.aai.model;
+
+import org.codehaus.jackson.annotate.JsonProperty;
 
 import java.util.List;
 
-import org.codehaus.jackson.annotate.JsonProperty;
+
+
 
 public class Relationship {
 	
@@ -11,6 +14,9 @@
 	
 	@JsonProperty("related-link")
 	public String relatedLink;
+
+	@JsonProperty("relationship-label")
+	public String relationshipLabel;
 	
 	@JsonProperty("relationship-data")
 	public List<RelationshipData> relationshipData;
@@ -51,5 +57,11 @@
 		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/openecomp/vid/aai/model/RelationshipData.java b/vid-app-common/src/main/java/org/onap/vid/aai/model/RelationshipData.java
similarity index 76%
rename from vid-app-common/src/main/java/org/openecomp/vid/aai/model/RelationshipData.java
rename to vid-app-common/src/main/java/org/onap/vid/aai/model/RelationshipData.java
index 21af2f5..5d2d409 100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/aai/model/RelationshipData.java
+++ b/vid-app-common/src/main/java/org/onap/vid/aai/model/RelationshipData.java
@@ -1,21 +1,22 @@
-package org.openecomp.vid.aai.model;
+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;
 	}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/aai/model/RelationshipList.java b/vid-app-common/src/main/java/org/onap/vid/aai/model/RelationshipList.java
similarity index 79%
rename from vid-app-common/src/main/java/org/openecomp/vid/aai/model/RelationshipList.java
rename to vid-app-common/src/main/java/org/onap/vid/aai/model/RelationshipList.java
index cdb7af4..43194fc 100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/aai/model/RelationshipList.java
+++ b/vid-app-common/src/main/java/org/onap/vid/aai/model/RelationshipList.java
@@ -1,16 +1,18 @@
-package org.openecomp.vid.aai.model;
-
-import java.util.List;
+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;
 	}
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/openecomp/vid/aai/model/ServiceInstance.java b/vid-app-common/src/main/java/org/onap/vid/aai/model/ServiceInstance.java
similarity index 93%
rename from vid-app-common/src/main/java/org/openecomp/vid/aai/model/ServiceInstance.java
rename to vid-app-common/src/main/java/org/onap/vid/aai/model/ServiceInstance.java
index 9fe4c06..381f9bc 100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/aai/model/ServiceInstance.java
+++ b/vid-app-common/src/main/java/org/onap/vid/aai/model/ServiceInstance.java
@@ -1,4 +1,4 @@
-package org.openecomp.vid.aai.model;
+package org.onap.vid.aai.model;
 
 import org.codehaus.jackson.annotate.JsonProperty;
 
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/aai/model/ServiceInstances.java b/vid-app-common/src/main/java/org/onap/vid/aai/model/ServiceInstances.java
similarity index 83%
rename from vid-app-common/src/main/java/org/openecomp/vid/aai/model/ServiceInstances.java
rename to vid-app-common/src/main/java/org/onap/vid/aai/model/ServiceInstances.java
index 163ed04..0fced4c 100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/aai/model/ServiceInstances.java
+++ b/vid-app-common/src/main/java/org/onap/vid/aai/model/ServiceInstances.java
@@ -1,4 +1,4 @@
-package org.openecomp.vid.aai.model;
+package org.onap.vid.aai.model;
 
 import java.util.List;
 
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/aai/ServiceProperties.java b/vid-app-common/src/main/java/org/onap/vid/aai/model/ServiceProperties.java
similarity index 62%
rename from vid-app-common/src/main/java/org/openecomp/vid/aai/ServiceProperties.java
rename to vid-app-common/src/main/java/org/onap/vid/aai/model/ServiceProperties.java
index 113f113..a76bcf8 100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/aai/ServiceProperties.java
+++ b/vid-app-common/src/main/java/org/onap/vid/aai/model/ServiceProperties.java
@@ -1,12 +1,14 @@
-package org.openecomp.vid.aai;
+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",
@@ -33,46 +35,67 @@
 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>();
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/aai/model/ServiceRelationships.java b/vid-app-common/src/main/java/org/onap/vid/aai/model/ServiceRelationships.java
similarity index 86%
rename from vid-app-common/src/main/java/org/openecomp/vid/aai/model/ServiceRelationships.java
rename to vid-app-common/src/main/java/org/onap/vid/aai/model/ServiceRelationships.java
index 9bedd85..b8abc84 100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/aai/model/ServiceRelationships.java
+++ b/vid-app-common/src/main/java/org/onap/vid/aai/model/ServiceRelationships.java
@@ -1,4 +1,4 @@
-package org.openecomp.vid.aai.model;
+package org.onap.vid.aai.model;
 
 import org.codehaus.jackson.annotate.JsonProperty;
 
@@ -10,6 +10,18 @@
 	@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;
 	
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/aai/model/ServiceSubscription.java b/vid-app-common/src/main/java/org/onap/vid/aai/model/ServiceSubscription.java
similarity index 89%
rename from vid-app-common/src/main/java/org/openecomp/vid/aai/model/ServiceSubscription.java
rename to vid-app-common/src/main/java/org/onap/vid/aai/model/ServiceSubscription.java
index 02ddfd1..91582e8 100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/aai/model/ServiceSubscription.java
+++ b/vid-app-common/src/main/java/org/onap/vid/aai/model/ServiceSubscription.java
@@ -1,4 +1,4 @@
-package org.openecomp.vid.aai.model;
+package org.onap.vid.aai.model;
 
 import org.codehaus.jackson.annotate.JsonProperty;
 
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/aai/model/Services.java b/vid-app-common/src/main/java/org/onap/vid/aai/model/Services.java
similarity index 92%
rename from vid-app-common/src/main/java/org/openecomp/vid/aai/model/Services.java
rename to vid-app-common/src/main/java/org/onap/vid/aai/model/Services.java
index 6e7b890..3ba4b22 100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/aai/model/Services.java
+++ b/vid-app-common/src/main/java/org/onap/vid/aai/model/Services.java
@@ -1,4 +1,4 @@
-package org.openecomp.vid.aai.model;
+package org.onap.vid.aai.model;
 
 import java.util.List;
 
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/aai/VnfResult.java b/vid-app-common/src/main/java/org/onap/vid/aai/model/VnfResult.java
similarity index 84%
rename from vid-app-common/src/main/java/org/openecomp/vid/aai/VnfResult.java
rename to vid-app-common/src/main/java/org/onap/vid/aai/model/VnfResult.java
index b8294e5..e4f2284 100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/aai/VnfResult.java
+++ b/vid-app-common/src/main/java/org/onap/vid/aai/model/VnfResult.java
@@ -1,8 +1,8 @@
-package org.openecomp.vid.aai;
+package org.onap.vid.aai.model;
 
 import com.fasterxml.jackson.annotation.*;
 import org.codehaus.jackson.annotate.JsonProperty;
-import org.openecomp.vid.RelatedTo;
+import org.onap.vid.RelatedTo;
 
 import java.util.HashMap;
 import java.util.List;
@@ -21,6 +21,7 @@
 
     @JsonProperty("id")
     public String id;
+    @com.fasterxml.jackson.annotation.JsonProperty("node-type")
     @JsonProperty("node-type")
     public String nodeType;
     @JsonProperty("url")
@@ -28,6 +29,7 @@
     @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>();
diff --git a/vid-app-common/src/main/java/org/openecomp/aai/util/AAIProperties.java b/vid-app-common/src/main/java/org/onap/vid/aai/util/AAIProperties.java
old mode 100755
new mode 100644
similarity index 98%
rename from vid-app-common/src/main/java/org/openecomp/aai/util/AAIProperties.java
rename to vid-app-common/src/main/java/org/onap/vid/aai/util/AAIProperties.java
index 9716ba8..254584c
--- a/vid-app-common/src/main/java/org/openecomp/aai/util/AAIProperties.java
+++ b/vid-app-common/src/main/java/org/onap/vid/aai/util/AAIProperties.java
@@ -1,68 +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.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";
-	
-}
+/*-
+ * ============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/openecomp/aai/util/CustomJacksonJaxBJsonProvider.java b/vid-app-common/src/main/java/org/onap/vid/aai/util/CustomJacksonJaxBJsonProvider.java
old mode 100755
new mode 100644
similarity index 98%
rename from vid-app-common/src/main/java/org/openecomp/aai/util/CustomJacksonJaxBJsonProvider.java
rename to vid-app-common/src/main/java/org/onap/vid/aai/util/CustomJacksonJaxBJsonProvider.java
index 1ed0792..996341a
--- a/vid-app-common/src/main/java/org/openecomp/aai/util/CustomJacksonJaxBJsonProvider.java
+++ b/vid-app-common/src/main/java/org/onap/vid/aai/util/CustomJacksonJaxBJsonProvider.java
@@ -1,73 +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.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;
-	    }
-}
+/*-
+ * ============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/openecomp/aai/util/HttpsAuthClient.java b/vid-app-common/src/main/java/org/onap/vid/aai/util/HttpsAuthClient.java
old mode 100755
new mode 100644
similarity index 81%
rename from vid-app-common/src/main/java/org/openecomp/aai/util/HttpsAuthClient.java
rename to vid-app-common/src/main/java/org/onap/vid/aai/util/HttpsAuthClient.java
index 3323b3f..0cf32cd
--- a/vid-app-common/src/main/java/org/openecomp/aai/util/HttpsAuthClient.java
+++ b/vid-app-common/src/main/java/org/onap/vid/aai/util/HttpsAuthClient.java
@@ -1,140 +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.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;
-		}
-	}
-}  
+/*-
+ * ============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/openecomp/aai/util/HttpsComponentsClient.java b/vid-app-common/src/main/java/org/onap/vid/aai/util/HttpsComponentsClient.java
old mode 100755
new mode 100644
similarity index 98%
rename from vid-app-common/src/main/java/org/openecomp/aai/util/HttpsComponentsClient.java
rename to vid-app-common/src/main/java/org/onap/vid/aai/util/HttpsComponentsClient.java
index a041c65..54d7f46
--- a/vid-app-common/src/main/java/org/openecomp/aai/util/HttpsComponentsClient.java
+++ b/vid-app-common/src/main/java/org/onap/vid/aai/util/HttpsComponentsClient.java
@@ -1,99 +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.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;
-	}
-
-
-	
-}  
+/*-
+ * ============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/openecomp/aai/util/JettyObfuscationConversionCommandLineUtil.java b/vid-app-common/src/main/java/org/onap/vid/aai/util/JettyObfuscationConversionCommandLineUtil.java
old mode 100755
new mode 100644
similarity index 98%
rename from vid-app-common/src/main/java/org/openecomp/aai/util/JettyObfuscationConversionCommandLineUtil.java
rename to vid-app-common/src/main/java/org/onap/vid/aai/util/JettyObfuscationConversionCommandLineUtil.java
index e31b0c1..8a3ba88
--- a/vid-app-common/src/main/java/org/openecomp/aai/util/JettyObfuscationConversionCommandLineUtil.java
+++ b/vid-app-common/src/main/java/org/onap/vid/aai/util/JettyObfuscationConversionCommandLineUtil.java
@@ -1,78 +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.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");
-	}
-}
+/*-
+ * ============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/openecomp/vid/asdc/AsdcCatalogException.java b/vid-app-common/src/main/java/org/onap/vid/asdc/AsdcCatalogException.java
old mode 100755
new mode 100644
similarity index 97%
rename from vid-app-common/src/main/java/org/openecomp/vid/asdc/AsdcCatalogException.java
rename to vid-app-common/src/main/java/org/onap/vid/asdc/AsdcCatalogException.java
index c807872..01883d5
--- a/vid-app-common/src/main/java/org/openecomp/vid/asdc/AsdcCatalogException.java
+++ b/vid-app-common/src/main/java/org/onap/vid/asdc/AsdcCatalogException.java
@@ -1,58 +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.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);
-	}
-}
+/*-
+ * ============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/openecomp/vid/asdc/AsdcClient.java b/vid-app-common/src/main/java/org/onap/vid/asdc/AsdcClient.java
old mode 100755
new mode 100644
similarity index 95%
rename from vid-app-common/src/main/java/org/openecomp/vid/asdc/AsdcClient.java
rename to vid-app-common/src/main/java/org/onap/vid/asdc/AsdcClient.java
index 314ea03..970ec95
--- a/vid-app-common/src/main/java/org/openecomp/vid/asdc/AsdcClient.java
+++ b/vid-app-common/src/main/java/org/onap/vid/asdc/AsdcClient.java
@@ -1,129 +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.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
-}
+/*-
+ * ============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/openecomp/vid/asdc/beans/Artifact.java b/vid-app-common/src/main/java/org/onap/vid/asdc/beans/Artifact.java
old mode 100755
new mode 100644
similarity index 99%
rename from vid-app-common/src/main/java/org/openecomp/vid/asdc/beans/Artifact.java
rename to vid-app-common/src/main/java/org/onap/vid/asdc/beans/Artifact.java
index 4974d44..c7e093f
--- a/vid-app-common/src/main/java/org/openecomp/vid/asdc/beans/Artifact.java
+++ b/vid-app-common/src/main/java/org/onap/vid/asdc/beans/Artifact.java
@@ -1,314 +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.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()));
-	}
-}
+/*-
+ * ============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/openecomp/vid/asdc/beans/Resource.java b/vid-app-common/src/main/java/org/onap/vid/asdc/beans/Resource.java
old mode 100755
new mode 100644
similarity index 99%
rename from vid-app-common/src/main/java/org/openecomp/vid/asdc/beans/Resource.java
rename to vid-app-common/src/main/java/org/onap/vid/asdc/beans/Resource.java
index 000aae1..6b5aa53
--- a/vid-app-common/src/main/java/org/openecomp/vid/asdc/beans/Resource.java
+++ b/vid-app-common/src/main/java/org/onap/vid/asdc/beans/Resource.java
@@ -1,429 +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.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()));
-	}
-}
+/*-
+ * ============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/openecomp/vid/asdc/beans/SecureService.java b/vid-app-common/src/main/java/org/onap/vid/asdc/beans/SecureService.java
similarity index 76%
rename from vid-app-common/src/main/java/org/openecomp/vid/asdc/beans/SecureService.java
rename to vid-app-common/src/main/java/org/onap/vid/asdc/beans/SecureService.java
index 1372472..b81a438 100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/asdc/beans/SecureService.java
+++ b/vid-app-common/src/main/java/org/onap/vid/asdc/beans/SecureService.java
@@ -1,4 +1,4 @@
-package org.openecomp.vid.asdc.beans;
+package org.onap.vid.asdc.beans;
 
 /**
  * Created by Oren on 6/27/17.
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/asdc/beans/SecureServices.java b/vid-app-common/src/main/java/org/onap/vid/asdc/beans/SecureServices.java
similarity index 79%
rename from vid-app-common/src/main/java/org/openecomp/vid/asdc/beans/SecureServices.java
rename to vid-app-common/src/main/java/org/onap/vid/asdc/beans/SecureServices.java
index 0fcd792..a6aa3de 100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/asdc/beans/SecureServices.java
+++ b/vid-app-common/src/main/java/org/onap/vid/asdc/beans/SecureServices.java
@@ -1,4 +1,4 @@
-package org.openecomp.vid.asdc.beans;
+package org.onap.vid.asdc.beans;
 
 import java.util.Collection;
 import java.util.List;
@@ -9,8 +9,7 @@
 public class SecureServices {
 
     private Collection<Service> services;
-    //Disable roles until AAF integration finishes
-    private boolean isReadOnly = false;
+    private boolean isReadOnly = true;
 
     public void setServices(Collection<Service> services) {
         this.services = services;
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/asdc/beans/Service.java b/vid-app-common/src/main/java/org/onap/vid/asdc/beans/Service.java
old mode 100755
new mode 100644
similarity index 96%
rename from vid-app-common/src/main/java/org/openecomp/vid/asdc/beans/Service.java
rename to vid-app-common/src/main/java/org/onap/vid/asdc/beans/Service.java
index 2a83cbe..5f59b89
--- a/vid-app-common/src/main/java/org/openecomp/vid/asdc/beans/Service.java
+++ b/vid-app-common/src/main/java/org/onap/vid/asdc/beans/Service.java
@@ -1,351 +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.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()));
-	}
-}
+/*-
+ * ============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/openecomp/vid/asdc/beans/SubResource.java b/vid-app-common/src/main/java/org/onap/vid/asdc/beans/SubResource.java
old mode 100755
new mode 100644
similarity index 98%
rename from vid-app-common/src/main/java/org/openecomp/vid/asdc/beans/SubResource.java
rename to vid-app-common/src/main/java/org/onap/vid/asdc/beans/SubResource.java
index cd3ec7f..5f7811d
--- a/vid-app-common/src/main/java/org/openecomp/vid/asdc/beans/SubResource.java
+++ b/vid-app-common/src/main/java/org/onap/vid/asdc/beans/SubResource.java
@@ -1,175 +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.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;
-	}
-}
+/*-
+ * ============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/openecomp/vid/asdc/beans/tosca/Capability.java b/vid-app-common/src/main/java/org/onap/vid/asdc/beans/tosca/Capability.java
old mode 100755
new mode 100644
similarity index 98%
rename from vid-app-common/src/main/java/org/openecomp/vid/asdc/beans/tosca/Capability.java
rename to vid-app-common/src/main/java/org/onap/vid/asdc/beans/tosca/Capability.java
index 0d3f17a..7aa1343
--- a/vid-app-common/src/main/java/org/openecomp/vid/asdc/beans/tosca/Capability.java
+++ b/vid-app-common/src/main/java/org/onap/vid/asdc/beans/tosca/Capability.java
@@ -1,140 +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.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;
-	}
-}
+/*-
+ * ============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/openecomp/vid/asdc/beans/tosca/Constraint.java b/vid-app-common/src/main/java/org/onap/vid/asdc/beans/tosca/Constraint.java
old mode 100755
new mode 100644
similarity index 98%
rename from vid-app-common/src/main/java/org/openecomp/vid/asdc/beans/tosca/Constraint.java
rename to vid-app-common/src/main/java/org/onap/vid/asdc/beans/tosca/Constraint.java
index a91f383..118776c
--- a/vid-app-common/src/main/java/org/openecomp/vid/asdc/beans/tosca/Constraint.java
+++ b/vid-app-common/src/main/java/org/onap/vid/asdc/beans/tosca/Constraint.java
@@ -1,199 +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.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;
-	}
-}
+/*-
+ * ============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/openecomp/vid/asdc/beans/tosca/Group.java b/vid-app-common/src/main/java/org/onap/vid/asdc/beans/tosca/Group.java
old mode 100755
new mode 100644
similarity index 98%
rename from vid-app-common/src/main/java/org/openecomp/vid/asdc/beans/tosca/Group.java
rename to vid-app-common/src/main/java/org/onap/vid/asdc/beans/tosca/Group.java
index 4d31faa..2685b22
--- a/vid-app-common/src/main/java/org/openecomp/vid/asdc/beans/tosca/Group.java
+++ b/vid-app-common/src/main/java/org/onap/vid/asdc/beans/tosca/Group.java
@@ -1,135 +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.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;
-	}
-}
+/*-
+ * ============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/openecomp/vid/asdc/beans/tosca/Import.java b/vid-app-common/src/main/java/org/onap/vid/asdc/beans/tosca/Import.java
old mode 100755
new mode 100644
similarity index 96%
rename from vid-app-common/src/main/java/org/openecomp/vid/asdc/beans/tosca/Import.java
rename to vid-app-common/src/main/java/org/onap/vid/asdc/beans/tosca/Import.java
index d64a580..dcd66e6
--- a/vid-app-common/src/main/java/org/openecomp/vid/asdc/beans/tosca/Import.java
+++ b/vid-app-common/src/main/java/org/onap/vid/asdc/beans/tosca/Import.java
@@ -1,48 +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.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;
-	}
-}
+/*-
+ * ============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/openecomp/vid/asdc/beans/tosca/Input.java b/vid-app-common/src/main/java/org/onap/vid/asdc/beans/tosca/Input.java
old mode 100755
new mode 100644
similarity index 98%
rename from vid-app-common/src/main/java/org/openecomp/vid/asdc/beans/tosca/Input.java
rename to vid-app-common/src/main/java/org/onap/vid/asdc/beans/tosca/Input.java
index e5eec01..e485a65
--- a/vid-app-common/src/main/java/org/openecomp/vid/asdc/beans/tosca/Input.java
+++ b/vid-app-common/src/main/java/org/onap/vid/asdc/beans/tosca/Input.java
@@ -1,168 +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.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;
-	}
-}
+/*-
+ * ============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/openecomp/vid/asdc/beans/tosca/NodeTemplate.java b/vid-app-common/src/main/java/org/onap/vid/asdc/beans/tosca/NodeTemplate.java
old mode 100755
new mode 100644
similarity index 98%
rename from vid-app-common/src/main/java/org/openecomp/vid/asdc/beans/tosca/NodeTemplate.java
rename to vid-app-common/src/main/java/org/onap/vid/asdc/beans/tosca/NodeTemplate.java
index 97740b3..28210b2
--- a/vid-app-common/src/main/java/org/openecomp/vid/asdc/beans/tosca/NodeTemplate.java
+++ b/vid-app-common/src/main/java/org/onap/vid/asdc/beans/tosca/NodeTemplate.java
@@ -1,117 +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.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;
-	}
-}
+/*-
+ * ============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/openecomp/vid/asdc/beans/tosca/Property.java b/vid-app-common/src/main/java/org/onap/vid/asdc/beans/tosca/Property.java
old mode 100755
new mode 100644
similarity index 98%
rename from vid-app-common/src/main/java/org/openecomp/vid/asdc/beans/tosca/Property.java
rename to vid-app-common/src/main/java/org/onap/vid/asdc/beans/tosca/Property.java
index 16b921e..107f5c8
--- a/vid-app-common/src/main/java/org/openecomp/vid/asdc/beans/tosca/Property.java
+++ b/vid-app-common/src/main/java/org/onap/vid/asdc/beans/tosca/Property.java
@@ -1,157 +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.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;
-	}
-	
-	
-}
+/*-
+ * ============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/openecomp/vid/asdc/beans/tosca/Requirement.java b/vid-app-common/src/main/java/org/onap/vid/asdc/beans/tosca/Requirement.java
old mode 100755
new mode 100644
similarity index 98%
rename from vid-app-common/src/main/java/org/openecomp/vid/asdc/beans/tosca/Requirement.java
rename to vid-app-common/src/main/java/org/onap/vid/asdc/beans/tosca/Requirement.java
index acb2509..0c2f884
--- a/vid-app-common/src/main/java/org/openecomp/vid/asdc/beans/tosca/Requirement.java
+++ b/vid-app-common/src/main/java/org/onap/vid/asdc/beans/tosca/Requirement.java
@@ -1,120 +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.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;
-	}
-	
-	
-}
+/*-
+ * ============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/openecomp/vid/asdc/beans/tosca/Schema.java b/vid-app-common/src/main/java/org/onap/vid/asdc/beans/tosca/Schema.java
old mode 100755
new mode 100644
similarity index 96%
rename from vid-app-common/src/main/java/org/openecomp/vid/asdc/beans/tosca/Schema.java
rename to vid-app-common/src/main/java/org/onap/vid/asdc/beans/tosca/Schema.java
index f77c1b4..7bf3477
--- a/vid-app-common/src/main/java/org/openecomp/vid/asdc/beans/tosca/Schema.java
+++ b/vid-app-common/src/main/java/org/onap/vid/asdc/beans/tosca/Schema.java
@@ -1,53 +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.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;
-	}
-}
+/*-
+ * ============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/openecomp/vid/asdc/beans/tosca/SubstitutionMappings.java b/vid-app-common/src/main/java/org/onap/vid/asdc/beans/tosca/SubstitutionMappings.java
old mode 100755
new mode 100644
similarity index 97%
rename from vid-app-common/src/main/java/org/openecomp/vid/asdc/beans/tosca/SubstitutionMappings.java
rename to vid-app-common/src/main/java/org/onap/vid/asdc/beans/tosca/SubstitutionMappings.java
index f59f246..70779c5
--- a/vid-app-common/src/main/java/org/openecomp/vid/asdc/beans/tosca/SubstitutionMappings.java
+++ b/vid-app-common/src/main/java/org/onap/vid/asdc/beans/tosca/SubstitutionMappings.java
@@ -1,101 +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.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;
-	}
-}
+/*-
+ * ============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/openecomp/vid/asdc/beans/tosca/TopologyTemplate.java b/vid-app-common/src/main/java/org/onap/vid/asdc/beans/tosca/TopologyTemplate.java
old mode 100755
new mode 100644
similarity index 98%
rename from vid-app-common/src/main/java/org/openecomp/vid/asdc/beans/tosca/TopologyTemplate.java
rename to vid-app-common/src/main/java/org/onap/vid/asdc/beans/tosca/TopologyTemplate.java
index 25b2c2c..7083071
--- a/vid-app-common/src/main/java/org/openecomp/vid/asdc/beans/tosca/TopologyTemplate.java
+++ b/vid-app-common/src/main/java/org/onap/vid/asdc/beans/tosca/TopologyTemplate.java
@@ -1,124 +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.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;
-	}
-}
+/*-
+ * ============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/openecomp/vid/asdc/beans/tosca/ToscaCsar.java b/vid-app-common/src/main/java/org/onap/vid/asdc/beans/tosca/ToscaCsar.java
old mode 100755
new mode 100644
similarity index 97%
rename from vid-app-common/src/main/java/org/openecomp/vid/asdc/beans/tosca/ToscaCsar.java
rename to vid-app-common/src/main/java/org/onap/vid/asdc/beans/tosca/ToscaCsar.java
index 9e9e1d0..6785835
--- a/vid-app-common/src/main/java/org/openecomp/vid/asdc/beans/tosca/ToscaCsar.java
+++ b/vid-app-common/src/main/java/org/onap/vid/asdc/beans/tosca/ToscaCsar.java
@@ -1,101 +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.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; }
-}
+/*-
+ * ============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/openecomp/vid/asdc/beans/tosca/ToscaMeta.java b/vid-app-common/src/main/java/org/onap/vid/asdc/beans/tosca/ToscaMeta.java
old mode 100755
new mode 100644
similarity index 97%
rename from vid-app-common/src/main/java/org/openecomp/vid/asdc/beans/tosca/ToscaMeta.java
rename to vid-app-common/src/main/java/org/onap/vid/asdc/beans/tosca/ToscaMeta.java
index a5295c4..a7a6c62
--- a/vid-app-common/src/main/java/org/openecomp/vid/asdc/beans/tosca/ToscaMeta.java
+++ b/vid-app-common/src/main/java/org/onap/vid/asdc/beans/tosca/ToscaMeta.java
@@ -1,124 +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.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;
-		}
-	}
-}
+/*-
+ * ============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/openecomp/vid/asdc/beans/tosca/ToscaMetadata.java b/vid-app-common/src/main/java/org/onap/vid/asdc/beans/tosca/ToscaMetadata.java
old mode 100755
new mode 100644
similarity index 99%
rename from vid-app-common/src/main/java/org/openecomp/vid/asdc/beans/tosca/ToscaMetadata.java
rename to vid-app-common/src/main/java/org/onap/vid/asdc/beans/tosca/ToscaMetadata.java
index d42c1f1..32e9fba
--- a/vid-app-common/src/main/java/org/openecomp/vid/asdc/beans/tosca/ToscaMetadata.java
+++ b/vid-app-common/src/main/java/org/onap/vid/asdc/beans/tosca/ToscaMetadata.java
@@ -1,461 +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.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;
-	}
-}
+/*-
+ * ============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/openecomp/vid/asdc/beans/tosca/ToscaModel.java b/vid-app-common/src/main/java/org/onap/vid/asdc/beans/tosca/ToscaModel.java
old mode 100755
new mode 100644
similarity index 98%
rename from vid-app-common/src/main/java/org/openecomp/vid/asdc/beans/tosca/ToscaModel.java
rename to vid-app-common/src/main/java/org/onap/vid/asdc/beans/tosca/ToscaModel.java
index 77fbe91..972d366
--- a/vid-app-common/src/main/java/org/openecomp/vid/asdc/beans/tosca/ToscaModel.java
+++ b/vid-app-common/src/main/java/org/onap/vid/asdc/beans/tosca/ToscaModel.java
@@ -1,166 +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.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;
-	}
-}
+/*-
+ * ============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/openecomp/vid/asdc/local/LocalAsdcClient.java b/vid-app-common/src/main/java/org/onap/vid/asdc/local/LocalAsdcClient.java
similarity index 91%
rename from vid-app-common/src/main/java/org/openecomp/vid/asdc/local/LocalAsdcClient.java
rename to vid-app-common/src/main/java/org/onap/vid/asdc/local/LocalAsdcClient.java
index 696e189..3c04e5c 100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/asdc/local/LocalAsdcClient.java
+++ b/vid-app-common/src/main/java/org/onap/vid/asdc/local/LocalAsdcClient.java
@@ -1,18 +1,18 @@
-package org.openecomp.vid.asdc.local;
+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.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.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;
@@ -22,7 +22,10 @@
 import java.nio.file.Path;
 import java.nio.file.Paths;
 import java.nio.file.StandardCopyOption;
-import java.util.*;
+import java.util.Collection;
+import java.util.LinkedList;
+import java.util.Map;
+import java.util.UUID;
 import java.util.zip.ZipFile;
 
 /**
@@ -42,66 +45,11 @@
     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) {
+    public LocalAsdcClient(org.onap.vid.asdc.local.LocalAsdcClient.Builder builder) {
         catalog = builder.catalog;
         mapper = builder.mapper;
     }
@@ -203,7 +151,7 @@
         JSONObject serviceJsonObject = null;
         final JSONArray categoryJsonArray = getCatalog().getJSONArray("services");
 
-        for (int i = 0; i < categoryJsonArray.length() ; i++) {
+        for (int i = 0; i < categoryJsonArray.length(); i++) {
             JSONObject jsonServiceObject = categoryJsonArray.getJSONObject(i);
             if (jsonServiceObject.get("uuid").equals(uuid.toString())) {
                 serviceJsonObject = jsonServiceObject;
@@ -264,7 +212,7 @@
      * @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")
+        final JSONArray artifacts = getCatalog().getJSONObject("resources")
                 .getJSONObject(resourceUuid.toString())
                 .getJSONArray("artifacts");
 
@@ -323,7 +271,7 @@
 
         final JSONArray categoryJsonArray = getCatalog().getJSONArray("services");
 
-        for (int i = 0; i < categoryJsonArray.length() ; i++) {
+        for (int i = 0; i < categoryJsonArray.length(); i++) {
 
             JSONObject jsonServiceObject = categoryJsonArray.getJSONObject(i);
             if (jsonServiceObject.get("uuid").equals(serviceUuid.toString())) {
@@ -331,11 +279,9 @@
                 break;
             }
         }
-
-        if (toscaModelURL==null){
+        if (toscaModelURL == null) {
             return null;
         }
-        
         final InputStream toscaModelStream = getClass().getClassLoader().getResourceAsStream(toscaModelURL);
 
         ClassLoader classLoader = getClass().getClassLoader();
@@ -390,4 +336,59 @@
         }
     }
 
+    /**
+     * 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/openecomp/vid/asdc/memory/InMemoryAsdcClient.java b/vid-app-common/src/main/java/org/onap/vid/asdc/memory/InMemoryAsdcClient.java
old mode 100755
new mode 100644
similarity index 95%
rename from vid-app-common/src/main/java/org/openecomp/vid/asdc/memory/InMemoryAsdcClient.java
rename to vid-app-common/src/main/java/org/onap/vid/asdc/memory/InMemoryAsdcClient.java
index 2b783d4..a7b934e
--- a/vid-app-common/src/main/java/org/openecomp/vid/asdc/memory/InMemoryAsdcClient.java
+++ b/vid-app-common/src/main/java/org/onap/vid/asdc/memory/InMemoryAsdcClient.java
@@ -1,372 +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.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);
-		}
-	}
-
-}
+/*-
+ * ============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/openecomp/vid/asdc/parser/ToscaParserImpl.java b/vid-app-common/src/main/java/org/onap/vid/asdc/parser/ToscaParserImpl.java
similarity index 87%
rename from vid-app-common/src/main/java/org/openecomp/vid/asdc/parser/ToscaParserImpl.java
rename to vid-app-common/src/main/java/org/onap/vid/asdc/parser/ToscaParserImpl.java
index bea5da8..12881b6 100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/asdc/parser/ToscaParserImpl.java
+++ b/vid-app-common/src/main/java/org/onap/vid/asdc/parser/ToscaParserImpl.java
@@ -1,4 +1,4 @@
-package org.openecomp.vid.asdc.parser;
+package org.onap.vid.asdc.parser;
 
 import java.io.IOException;
 import java.io.InputStream;
@@ -13,20 +13,21 @@
 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.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.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;
@@ -44,7 +45,7 @@
 	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);
@@ -73,7 +74,7 @@
 								LOG.debug("fname = " + fname);
 								final InputStream toscaChildEntryYamlStream = csar
 										.getInputStream(csar.getEntry("Definitions/" + fname));
-								
+
 								final ToscaModel childModel = yaml.loadAs(toscaChildEntryYamlStream, ToscaModel.class);
 								csarBuilder.addVnf(childModel);
 							}
@@ -89,15 +90,15 @@
 			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;
+		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();
@@ -107,7 +108,7 @@
 		populateVnfsAndNetwork(methodName, isNewFlow, vnfs, networks, asdcServiceToscaModel, serviceModel);
 
 		// If we see customization uuid under vnf or network, follow 1702 flow
-		if (isNewFlow) {
+		if (isNewFlow.getValue()) {
 			return (getCustomizedServices(asdcServiceToscaModel, serviceModel));
 		} else {
 			VNF vnf = null;
@@ -145,9 +146,9 @@
 		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 {
+	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
@@ -164,7 +165,7 @@
 				LOG.debug(EELFLoggerDelegate.debugLogger,
 						dateFormat.format(new Date()) + methodName + " VNF commands: " + vnf.getCommands());
 				vnfs.put(modelCustomizationName, vnf);
-				isNewFlow = isNewFlow(vnf);
+				isNewFlow.setValue(isNewFlow(vnf));
 			}
 			// Networks
 			if (type.startsWith(networkTag)) {
@@ -173,7 +174,7 @@
 				final Network network = new Network();
 				network.extractNetwork(modelCustomizationName, nodeTemplate);
 //				populateNodeVersionIfMissing(nodeTemplate, network, service);
-				isNewFlow = isNewFlow(network);
+				isNewFlow.setValue(isNewFlow(network));
 				networks.put(modelCustomizationName, network);
 
 			}
@@ -201,7 +202,7 @@
 			node.setVersion(service.getVersion());
 		}
 	}
-	
+
 	private ServiceModel getCustomizedServices(ToscaModel asdcServiceToscaModel, ServiceModel serviceModel) {
 		String methodName = "asdcServiceToscaModel";
 		LOG.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + methodName + " start");
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/openecomp/vid/asdc/rest/RestfulAsdcClient.java b/vid-app-common/src/main/java/org/onap/vid/asdc/rest/RestfulAsdcClient.java
old mode 100755
new mode 100644
similarity index 88%
rename from vid-app-common/src/main/java/org/openecomp/vid/asdc/rest/RestfulAsdcClient.java
rename to vid-app-common/src/main/java/org/onap/vid/asdc/rest/RestfulAsdcClient.java
index 67375aa..a8dc287
--- a/vid-app-common/src/main/java/org/openecomp/vid/asdc/rest/RestfulAsdcClient.java
+++ b/vid-app-common/src/main/java/org/onap/vid/asdc/rest/RestfulAsdcClient.java
@@ -1,467 +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.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);
-    }
-}
+/*-
+ * ============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/openecomp/vid/changeManagement/ChangeManagementRequest.java b/vid-app-common/src/main/java/org/onap/vid/changeManagement/ChangeManagementRequest.java
similarity index 72%
rename from vid-app-common/src/main/java/org/openecomp/vid/changeManagement/ChangeManagementRequest.java
rename to vid-app-common/src/main/java/org/onap/vid/changeManagement/ChangeManagementRequest.java
index adcb546..ec375b6 100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/changeManagement/ChangeManagementRequest.java
+++ b/vid-app-common/src/main/java/org/onap/vid/changeManagement/ChangeManagementRequest.java
@@ -1,4 +1,4 @@
-package org.openecomp.vid.changeManagement;
+package org.onap.vid.changeManagement;
 
 import java.util.List;
 import java.util.HashMap;
@@ -15,8 +15,18 @@
 })
 
 public class ChangeManagementRequest {
-	
-    public 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;
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/changeManagement/ChangeManagementResponse.java b/vid-app-common/src/main/java/org/onap/vid/changeManagement/ChangeManagementResponse.java
similarity index 88%
rename from vid-app-common/src/main/java/org/openecomp/vid/changeManagement/ChangeManagementResponse.java
rename to vid-app-common/src/main/java/org/onap/vid/changeManagement/ChangeManagementResponse.java
index 10ba035..05d6e04 100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/changeManagement/ChangeManagementResponse.java
+++ b/vid-app-common/src/main/java/org/onap/vid/changeManagement/ChangeManagementResponse.java
@@ -1,4 +1,4 @@
-package org.openecomp.vid.changeManagement;
+package org.onap.vid.changeManagement;
 
 import java.util.ArrayList;
 import java.util.List;
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/changeManagement/CloudConfiguration.java b/vid-app-common/src/main/java/org/onap/vid/changeManagement/CloudConfiguration.java
similarity index 96%
rename from vid-app-common/src/main/java/org/openecomp/vid/changeManagement/CloudConfiguration.java
rename to vid-app-common/src/main/java/org/onap/vid/changeManagement/CloudConfiguration.java
index a5debc6..43d6a6a 100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/changeManagement/CloudConfiguration.java
+++ b/vid-app-common/src/main/java/org/onap/vid/changeManagement/CloudConfiguration.java
@@ -1,4 +1,4 @@
-package org.openecomp.vid.changeManagement;
+package org.onap.vid.changeManagement;
 
 import java.util.HashMap;
 import java.util.Map;
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/changeManagement/CmResponse.java b/vid-app-common/src/main/java/org/onap/vid/changeManagement/CmResponse.java
similarity index 88%
rename from vid-app-common/src/main/java/org/openecomp/vid/changeManagement/CmResponse.java
rename to vid-app-common/src/main/java/org/onap/vid/changeManagement/CmResponse.java
index 70e09d8..8aba012 100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/changeManagement/CmResponse.java
+++ b/vid-app-common/src/main/java/org/onap/vid/changeManagement/CmResponse.java
@@ -1,4 +1,4 @@
-package org.openecomp.vid.changeManagement;
+package org.onap.vid.changeManagement;
 
 public class CmResponse {
 	
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/openecomp/vid/changeManagement/LeanCloudConfiguration.java b/vid-app-common/src/main/java/org/onap/vid/changeManagement/LeanCloudConfiguration.java
similarity index 69%
rename from vid-app-common/src/main/java/org/openecomp/vid/changeManagement/LeanCloudConfiguration.java
rename to vid-app-common/src/main/java/org/onap/vid/changeManagement/LeanCloudConfiguration.java
index 663ff8c..6011c7e 100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/changeManagement/LeanCloudConfiguration.java
+++ b/vid-app-common/src/main/java/org/onap/vid/changeManagement/LeanCloudConfiguration.java
@@ -1,4 +1,4 @@
-package org.openecomp.vid.changeManagement;
+package org.onap.vid.changeManagement;
 
 /**
  * Created by Oren on 9/5/17.
@@ -8,7 +8,7 @@
     public LeanCloudConfiguration() {
     }
 
-    public LeanCloudConfiguration(org.openecomp.vid.domain.mso.CloudConfiguration cloudConfiguration) {
+    public LeanCloudConfiguration(org.onap.vid.domain.mso.CloudConfiguration cloudConfiguration) {
         this.tenantId = cloudConfiguration.getTenantId();
         this.lcpCloudRegionId = cloudConfiguration.getLcpCloudRegionId();
 
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/changeManagement/ModelInfo.java b/vid-app-common/src/main/java/org/onap/vid/changeManagement/ModelInfo.java
similarity index 96%
rename from vid-app-common/src/main/java/org/openecomp/vid/changeManagement/ModelInfo.java
rename to vid-app-common/src/main/java/org/onap/vid/changeManagement/ModelInfo.java
index 517628c..8f44a4b 100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/changeManagement/ModelInfo.java
+++ b/vid-app-common/src/main/java/org/onap/vid/changeManagement/ModelInfo.java
@@ -1,4 +1,4 @@
-package org.openecomp.vid.changeManagement;
+package org.onap.vid.changeManagement;
 import java.util.HashMap;
 import java.util.Map;
 import com.fasterxml.jackson.annotation.JsonAnyGetter;
@@ -24,7 +24,7 @@
 
 	}
 
-	public ModelInfo(org.openecomp.vid.domain.mso.ModelInfo modelInfo){
+	public ModelInfo(org.onap.vid.domain.mso.ModelInfo modelInfo){
 		this.setModelType(modelInfo.getModelType().toString());
 		this.setModelInvariantId(modelInfo.getModelInvariantId());
 		this.setModelVersionId(modelInfo.getModelNameVersionId());
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/changeManagement/ModelInfoOfRelatedInstance.java b/vid-app-common/src/main/java/org/onap/vid/changeManagement/ModelInfoOfRelatedInstance.java
similarity index 98%
rename from vid-app-common/src/main/java/org/openecomp/vid/changeManagement/ModelInfoOfRelatedInstance.java
rename to vid-app-common/src/main/java/org/onap/vid/changeManagement/ModelInfoOfRelatedInstance.java
index c60ed2f..7e87609 100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/changeManagement/ModelInfoOfRelatedInstance.java
+++ b/vid-app-common/src/main/java/org/onap/vid/changeManagement/ModelInfoOfRelatedInstance.java
@@ -1,4 +1,4 @@
-package org.openecomp.vid.changeManagement;
+package org.onap.vid.changeManagement;
 
 import java.util.HashMap;
 import java.util.Map;
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/changeManagement/MsoRequestDetails.java b/vid-app-common/src/main/java/org/onap/vid/changeManagement/MsoRequestDetails.java
similarity index 83%
rename from vid-app-common/src/main/java/org/openecomp/vid/changeManagement/MsoRequestDetails.java
rename to vid-app-common/src/main/java/org/onap/vid/changeManagement/MsoRequestDetails.java
index 9e442f2..913fa07 100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/changeManagement/MsoRequestDetails.java
+++ b/vid-app-common/src/main/java/org/onap/vid/changeManagement/MsoRequestDetails.java
@@ -1,4 +1,4 @@
-package org.openecomp.vid.changeManagement;
+package org.onap.vid.changeManagement;
 
 
 import java.util.ArrayList;
@@ -17,13 +17,14 @@
 
     public List<RelatedInstanceList> relatedInstanceList;
 
-    public RequestParameters requestParameters;
+    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/openecomp/vid/changeManagement/RelatedInstance.java b/vid-app-common/src/main/java/org/onap/vid/changeManagement/RelatedInstance.java
similarity index 91%
rename from vid-app-common/src/main/java/org/openecomp/vid/changeManagement/RelatedInstance.java
rename to vid-app-common/src/main/java/org/onap/vid/changeManagement/RelatedInstance.java
index 49368c2..c29aee4 100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/changeManagement/RelatedInstance.java
+++ b/vid-app-common/src/main/java/org/onap/vid/changeManagement/RelatedInstance.java
@@ -1,4 +1,4 @@
-package org.openecomp.vid.changeManagement;
+package org.onap.vid.changeManagement;
 
 import com.fasterxml.jackson.annotation.*;
 
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/changeManagement/RelatedInstanceList.java b/vid-app-common/src/main/java/org/onap/vid/changeManagement/RelatedInstanceList.java
similarity index 91%
rename from vid-app-common/src/main/java/org/openecomp/vid/changeManagement/RelatedInstanceList.java
rename to vid-app-common/src/main/java/org/onap/vid/changeManagement/RelatedInstanceList.java
index 21a41c3..b3e67a0 100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/changeManagement/RelatedInstanceList.java
+++ b/vid-app-common/src/main/java/org/onap/vid/changeManagement/RelatedInstanceList.java
@@ -1,4 +1,4 @@
-package org.openecomp.vid.changeManagement;
+package org.onap.vid.changeManagement;
 
 import com.fasterxml.jackson.annotation.*;
 
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/changeManagement/RequestDetails.java b/vid-app-common/src/main/java/org/onap/vid/changeManagement/RequestDetails.java
similarity index 89%
rename from vid-app-common/src/main/java/org/openecomp/vid/changeManagement/RequestDetails.java
rename to vid-app-common/src/main/java/org/onap/vid/changeManagement/RequestDetails.java
index 94e4c44..36452f6 100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/changeManagement/RequestDetails.java
+++ b/vid-app-common/src/main/java/org/onap/vid/changeManagement/RequestDetails.java
@@ -1,4 +1,4 @@
-package org.openecomp.vid.changeManagement;
+package org.onap.vid.changeManagement;
 
 import com.fasterxml.jackson.annotation.*;
 
@@ -13,7 +13,7 @@
 "vnfName",
 "vnfInstanceId"
 })
-public class RequestDetails extends org.openecomp.vid.mso.rest.RequestDetails{
+public class RequestDetails extends org.onap.vid.mso.rest.RequestDetails{
 
 	@JsonProperty("vnfName")
     private String vnfName;
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/openecomp/vid/changeManagement/RequestInfo.java b/vid-app-common/src/main/java/org/onap/vid/changeManagement/RequestInfo.java
similarity index 97%
rename from vid-app-common/src/main/java/org/openecomp/vid/changeManagement/RequestInfo.java
rename to vid-app-common/src/main/java/org/onap/vid/changeManagement/RequestInfo.java
index a7236c4..4aa3724 100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/changeManagement/RequestInfo.java
+++ b/vid-app-common/src/main/java/org/onap/vid/changeManagement/RequestInfo.java
@@ -1,4 +1,4 @@
-package org.openecomp.vid.changeManagement;
+package org.onap.vid.changeManagement;
 
 import java.util.HashMap;
 import java.util.Map;
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/changeManagement/UpdateRequestInfo.java b/vid-app-common/src/main/java/org/onap/vid/changeManagement/UpdateRequestInfo.java
similarity index 70%
rename from vid-app-common/src/main/java/org/openecomp/vid/changeManagement/UpdateRequestInfo.java
rename to vid-app-common/src/main/java/org/onap/vid/changeManagement/UpdateRequestInfo.java
index ab81894..024e9c3 100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/changeManagement/UpdateRequestInfo.java
+++ b/vid-app-common/src/main/java/org/onap/vid/changeManagement/UpdateRequestInfo.java
@@ -1,6 +1,6 @@
-package org.openecomp.vid.changeManagement;
+package org.onap.vid.changeManagement;
 
-import org.openecomp.vid.domain.mso.*;
+import org.onap.vid.domain.mso.*;
 
 /**
  * Created by Oren on 9/5/17.
@@ -11,7 +11,7 @@
     }
 
 
-    public UpdateRequestInfo(org.openecomp.vid.domain.mso.RequestInfo requestInfo) {
+    public UpdateRequestInfo(org.onap.vid.domain.mso.RequestInfo requestInfo) {
         this.requestorId = requestInfo.getRequestorId();
         this.suppressRollback = requestInfo.getSuppressRollback();
         this.source = requestInfo.getSource();
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/openecomp/vid/client/FakeHttpSession.java b/vid-app-common/src/main/java/org/onap/vid/client/FakeHttpSession.java
similarity index 99%
rename from vid-app-common/src/main/java/org/openecomp/vid/client/FakeHttpSession.java
rename to vid-app-common/src/main/java/org/onap/vid/client/FakeHttpSession.java
index 226e6c4..69ce11f 100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/client/FakeHttpSession.java
+++ b/vid-app-common/src/main/java/org/onap/vid/client/FakeHttpSession.java
@@ -1,4 +1,4 @@
-package org.openecomp.vid.client;
+package org.onap.vid.client;
 
 import org.apache.commons.io.IOUtils;
 import org.json.JSONArray;
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/client/HttpBasicClient.java b/vid-app-common/src/main/java/org/onap/vid/client/HttpBasicClient.java
old mode 100755
new mode 100644
similarity index 94%
rename from vid-app-common/src/main/java/org/openecomp/vid/client/HttpBasicClient.java
rename to vid-app-common/src/main/java/org/onap/vid/client/HttpBasicClient.java
index ef2ade9..d0a34ce
--- a/vid-app-common/src/main/java/org/openecomp/vid/client/HttpBasicClient.java
+++ b/vid-app-common/src/main/java/org/onap/vid/client/HttpBasicClient.java
@@ -1,67 +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.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);
-	}	
-}  
+/*-
+ * ============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/openecomp/vid/client/HttpsBasicClient.java b/vid-app-common/src/main/java/org/onap/vid/client/HttpsBasicClient.java
old mode 100755
new mode 100644
similarity index 96%
rename from vid-app-common/src/main/java/org/openecomp/vid/client/HttpsBasicClient.java
rename to vid-app-common/src/main/java/org/onap/vid/client/HttpsBasicClient.java
index 676a7e7..28a4d0f
--- a/vid-app-common/src/main/java/org/openecomp/vid/client/HttpsBasicClient.java
+++ b/vid-app-common/src/main/java/org/onap/vid/client/HttpsBasicClient.java
@@ -1,143 +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.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;
-	}
-}  
+/*-
+ * ============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/openecomp/vid/controller/AaiController.java b/vid-app-common/src/main/java/org/onap/vid/controller/AaiController.java
old mode 100755
new mode 100644
similarity index 62%
rename from vid-app-common/src/main/java/org/openecomp/vid/controller/AaiController.java
rename to vid-app-common/src/main/java/org/onap/vid/controller/AaiController.java
index a8bdf39..1719ff6
--- a/vid-app-common/src/main/java/org/openecomp/vid/controller/AaiController.java
+++ b/vid-app-common/src/main/java/org/onap/vid/controller/AaiController.java
@@ -1,952 +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.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 + "\"" +
-                "        }" +
-                "    }" +
-                "}";
-
-    }
-}
-
+/*-
+ * ============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/openecomp/vid/controller/HealthCheckController.java b/vid-app-common/src/main/java/org/onap/vid/controller/HealthCheckController.java
old mode 100755
new mode 100644
similarity index 81%
rename from vid-app-common/src/main/java/org/openecomp/vid/controller/HealthCheckController.java
rename to vid-app-common/src/main/java/org/onap/vid/controller/HealthCheckController.java
index abef8d6..2368649
--- a/vid-app-common/src/main/java/org/openecomp/vid/controller/HealthCheckController.java
+++ b/vid-app-common/src/main/java/org/onap/vid/controller/HealthCheckController.java
@@ -1,196 +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.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;
-		}
-}
-
+/*-
+ * ============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/openecomp/vid/controller/PolicyController.java b/vid-app-common/src/main/java/org/onap/vid/controller/PolicyController.java
similarity index 79%
rename from vid-app-common/src/main/java/org/openecomp/vid/controller/PolicyController.java
rename to vid-app-common/src/main/java/org/onap/vid/controller/PolicyController.java
index 83e177a..4e9ec25 100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/controller/PolicyController.java
+++ b/vid-app-common/src/main/java/org/onap/vid/controller/PolicyController.java
@@ -18,21 +18,12 @@
  * ============LICENSE_END=========================================================
  */
 
-package  org.openecomp.vid.controller;
-
-import java.util.UUID;
-
-import javax.servlet.http.HttpServletRequest;
+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.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.onap.vid.policy.*;
 import org.springframework.http.HttpStatus;
 import org.springframework.http.ResponseEntity;
 import org.springframework.web.bind.annotation.RequestBody;
@@ -40,6 +31,9 @@
 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.
  */
@@ -48,18 +42,18 @@
 public class PolicyController extends RestrictedBaseController{	
 		
 	/** The logger. */
-	static EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(PolicyController.class);
+	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());
+		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());
+		LOGGER.debug("$$$$$$$$$$$$$$$$$$$$$$ " + new ResponseEntity<String>(policyResWrapper.getResponse(), HttpStatus.OK).toString());
 		
 		return ( new ResponseEntity<String>(policyResWrapper.getResponse(), HttpStatus.valueOf(policyResWrapper.getStatus())) );		
 	}
@@ -67,7 +61,7 @@
 	protected static PolicyResponseWrapper getPolicyConfig(JSONObject request, String path) throws Exception {
 		String methodName = "getPolicyConfig";
 		String uuid = UUID.randomUUID().toString();
-		logger.debug(  "starting getPolicyConfig ");
+		LOGGER.debug(  "starting getPolicyConfig ");
 		
 		try {
 			//STARTING REST API CALL AS AN FACTORY INSTACE
@@ -79,10 +73,10 @@
 			restController.<String>Post(str, request, uuid, path, restObjStr );
 			PolicyResponseWrapper policyRespWrapper = PolicyUtil.wrapResponse (restObjStr);
 			
-			logger.debug( "<== " + methodName + " w=" + policyRespWrapper.getResponse());
+			LOGGER.debug( "<== " + methodName + " w=" + policyRespWrapper.getResponse());
 			return policyRespWrapper;
 		} catch (Exception e) {
-			logger.debug(  "EXCEPTION in getPolicyConfig <== " + "." + methodName + e.toString());
+			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/onap/vid/controller/PropertyController.java
old mode 100755
new mode 100644
similarity index 64%
rename from vid-app-common/src/main/java/org/openecomp/vid/controller/PropertyController.java
rename to vid-app-common/src/main/java/org/onap/vid/controller/PropertyController.java
index 9008076..2d282ed
--- a/vid-app-common/src/main/java/org/openecomp/vid/controller/PropertyController.java
+++ b/vid-app-common/src/main/java/org/onap/vid/controller/PropertyController.java
@@ -1,122 +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.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 );
-	}
-
-}
+/*-
+ * ============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/openecomp/vid/controller/VidController.java b/vid-app-common/src/main/java/org/onap/vid/controller/VidController.java
old mode 100755
new mode 100644
similarity index 61%
rename from vid-app-common/src/main/java/org/openecomp/vid/controller/VidController.java
rename to vid-app-common/src/main/java/org/onap/vid/controller/VidController.java
index f21036e..c93d802
--- a/vid-app-common/src/main/java/org/openecomp/vid/controller/VidController.java
+++ b/vid-app-common/src/main/java/org/onap/vid/controller/VidController.java
@@ -1,119 +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.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");
-	}
-}
+/*-
+ * ============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/openecomp/vid/controller/ViewLogController.java b/vid-app-common/src/main/java/org/onap/vid/controller/ViewLogController.java
old mode 100755
new mode 100644
similarity index 80%
rename from vid-app-common/src/main/java/org/openecomp/vid/controller/ViewLogController.java
rename to vid-app-common/src/main/java/org/onap/vid/controller/ViewLogController.java
index 31e6498..4a87df1
--- a/vid-app-common/src/main/java/org/openecomp/vid/controller/ViewLogController.java
+++ b/vid-app-common/src/main/java/org/onap/vid/controller/ViewLogController.java
@@ -1,84 +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.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;
-	}
-
-
-}
+/*-
+ * ============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/openecomp/vid/controller/WebConfig.java b/vid-app-common/src/main/java/org/onap/vid/controller/WebConfig.java
similarity index 84%
rename from vid-app-common/src/main/java/org/openecomp/vid/controller/WebConfig.java
rename to vid-app-common/src/main/java/org/onap/vid/controller/WebConfig.java
index 1e13d0e..2838e7f 100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/controller/WebConfig.java
+++ b/vid-app-common/src/main/java/org/onap/vid/controller/WebConfig.java
@@ -1,22 +1,22 @@
-package org.openecomp.vid.controller;
+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.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.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;
 
@@ -46,6 +46,7 @@
 
 
 
+
     @Bean
     public VidService vidService(AsdcClient asdcClient) {
         return new VidServiceImpl(asdcClient);
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/openecomp/vid/controller/test/TestAaiController.java b/vid-app-common/src/main/java/org/onap/vid/controller/test/TestAaiController.java
old mode 100755
new mode 100644
similarity index 87%
rename from vid-app-common/src/main/java/org/openecomp/vid/controller/test/TestAaiController.java
rename to vid-app-common/src/main/java/org/onap/vid/controller/test/TestAaiController.java
index 7901741..29e7a4d
--- a/vid-app-common/src/main/java/org/openecomp/vid/controller/test/TestAaiController.java
+++ b/vid-app-common/src/main/java/org/onap/vid/controller/test/TestAaiController.java
@@ -1,93 +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.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();
-
-	}
-
-}
+/*-
+ * ============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/openecomp/vid/controller/test/TestAsdcController.java b/vid-app-common/src/main/java/org/onap/vid/controller/test/TestAsdcController.java
old mode 100755
new mode 100644
similarity index 69%
rename from vid-app-common/src/main/java/org/openecomp/vid/controller/test/TestAsdcController.java
rename to vid-app-common/src/main/java/org/onap/vid/controller/test/TestAsdcController.java
index 84a56b3..2b289b9
--- a/vid-app-common/src/main/java/org/openecomp/vid/controller/test/TestAsdcController.java
+++ b/vid-app-common/src/main/java/org/onap/vid/controller/test/TestAsdcController.java
@@ -1,112 +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.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();
-
-	}
-
-}
+/*-
+ * ============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/openecomp/vid/controller/test/TestMsoController.java b/vid-app-common/src/main/java/org/onap/vid/controller/test/TestMsoController.java
old mode 100755
new mode 100644
similarity index 71%
rename from vid-app-common/src/main/java/org/openecomp/vid/controller/test/TestMsoController.java
rename to vid-app-common/src/main/java/org/onap/vid/controller/test/TestMsoController.java
index 02c29f6..9d6a3de
--- a/vid-app-common/src/main/java/org/openecomp/vid/controller/test/TestMsoController.java
+++ b/vid-app-common/src/main/java/org/onap/vid/controller/test/TestMsoController.java
@@ -1,729 +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.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\"" +
-		"               }" +
-		"            }" +
-		"         }" +
-		"      ]" +
-		"   }" +
-		"}";
-}
+/*-
+ * ============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/openecomp/vid/controller/test/TestPageController.java b/vid-app-common/src/main/java/org/onap/vid/controller/test/TestPageController.java
old mode 100755
new mode 100644
similarity index 94%
rename from vid-app-common/src/main/java/org/openecomp/vid/controller/test/TestPageController.java
rename to vid-app-common/src/main/java/org/onap/vid/controller/test/TestPageController.java
index 92f86f0..48ccdf8
--- a/vid-app-common/src/main/java/org/openecomp/vid/controller/test/TestPageController.java
+++ b/vid-app-common/src/main/java/org/onap/vid/controller/test/TestPageController.java
@@ -1,57 +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.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());
-	}
-
-}
+/*-
+ * ============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/openecomp/vid/dao/FnAppDoaImpl.java b/vid-app-common/src/main/java/org/onap/vid/dao/FnAppDoaImpl.java
old mode 100755
new mode 100644
similarity index 98%
rename from vid-app-common/src/main/java/org/openecomp/vid/dao/FnAppDoaImpl.java
rename to vid-app-common/src/main/java/org/onap/vid/dao/FnAppDoaImpl.java
index 6d2810a..c27d17e
--- a/vid-app-common/src/main/java/org/openecomp/vid/dao/FnAppDoaImpl.java
+++ b/vid-app-common/src/main/java/org/onap/vid/dao/FnAppDoaImpl.java
@@ -1,112 +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.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);
-				}
-			}
-		}
-}
+/*-
+ * ============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/openecomp/vid/dao/ProfileDao.java b/vid-app-common/src/main/java/org/onap/vid/dao/ProfileDao.java
old mode 100755
new mode 100644
similarity index 97%
rename from vid-app-common/src/main/java/org/openecomp/vid/dao/ProfileDao.java
rename to vid-app-common/src/main/java/org/onap/vid/dao/ProfileDao.java
index 256a4bd..e6a8a4e
--- a/vid-app-common/src/main/java/org/openecomp/vid/dao/ProfileDao.java
+++ b/vid-app-common/src/main/java/org/onap/vid/dao/ProfileDao.java
@@ -1,45 +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.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);
-}
+/*-
+ * ============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/openecomp/vid/exceptions/VidServiceUnavailableException.java b/vid-app-common/src/main/java/org/onap/vid/exceptions/VidServiceUnavailableException.java
old mode 100755
new mode 100644
similarity index 97%
rename from vid-app-common/src/main/java/org/openecomp/vid/exceptions/VidServiceUnavailableException.java
rename to vid-app-common/src/main/java/org/onap/vid/exceptions/VidServiceUnavailableException.java
index fcd897f..622b34c
--- a/vid-app-common/src/main/java/org/openecomp/vid/exceptions/VidServiceUnavailableException.java
+++ b/vid-app-common/src/main/java/org/onap/vid/exceptions/VidServiceUnavailableException.java
@@ -1,69 +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.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);
-	}
-}
+/*-
+ * ============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/openecomp/vid/factories/MsoRequestFactory.java b/vid-app-common/src/main/java/org/onap/vid/factories/MsoRequestFactory.java
similarity index 67%
rename from vid-app-common/src/main/java/org/openecomp/vid/factories/MsoRequestFactory.java
rename to vid-app-common/src/main/java/org/onap/vid/factories/MsoRequestFactory.java
index 9cc9c5f..22bfa47 100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/factories/MsoRequestFactory.java
+++ b/vid-app-common/src/main/java/org/onap/vid/factories/MsoRequestFactory.java
@@ -1,6 +1,6 @@
-package org.openecomp.vid.factories;
+package org.onap.vid.factories;
 
-import org.openecomp.vid.mso.rest.RequestDetails;
+import org.onap.vid.mso.rest.RequestDetails;
 
 /**
  * Created by pickjonathan on 19/06/2017.
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/openecomp/vid/model/CommandProperty.java b/vid-app-common/src/main/java/org/onap/vid/model/CommandProperty.java
old mode 100755
new mode 100644
similarity index 98%
rename from vid-app-common/src/main/java/org/openecomp/vid/model/CommandProperty.java
rename to vid-app-common/src/main/java/org/onap/vid/model/CommandProperty.java
index 740f9d7..4f5ee17
--- a/vid-app-common/src/main/java/org/openecomp/vid/model/CommandProperty.java
+++ b/vid-app-common/src/main/java/org/onap/vid/model/CommandProperty.java
@@ -1,93 +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.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;
-	}
-}
+/*-
+ * ============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/openecomp/vid/model/ExceptionResponse.java b/vid-app-common/src/main/java/org/onap/vid/model/ExceptionResponse.java
old mode 100755
new mode 100644
similarity index 74%
rename from vid-app-common/src/main/java/org/openecomp/vid/model/ExceptionResponse.java
rename to vid-app-common/src/main/java/org/onap/vid/model/ExceptionResponse.java
index 686971d..444a4ba
--- a/vid-app-common/src/main/java/org/openecomp/vid/model/ExceptionResponse.java
+++ b/vid-app-common/src/main/java/org/onap/vid/model/ExceptionResponse.java
@@ -1,70 +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.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;
-	}
-
-}
+/*-
+ * ============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/openecomp/vid/model/ModelConstants.java b/vid-app-common/src/main/java/org/onap/vid/model/ModelConstants.java
old mode 100755
new mode 100644
similarity index 95%
rename from vid-app-common/src/main/java/org/openecomp/vid/model/ModelConstants.java
rename to vid-app-common/src/main/java/org/onap/vid/model/ModelConstants.java
index af5f0db..cb1a5f9
--- a/vid-app-common/src/main/java/org/openecomp/vid/model/ModelConstants.java
+++ b/vid-app-common/src/main/java/org/onap/vid/model/ModelConstants.java
@@ -1,42 +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.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";
-	
-}
+/*-
+ * ============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/openecomp/vid/model/ModelUtil.java b/vid-app-common/src/main/java/org/onap/vid/model/ModelUtil.java
similarity index 96%
rename from vid-app-common/src/main/java/org/openecomp/vid/model/ModelUtil.java
rename to vid-app-common/src/main/java/org/onap/vid/model/ModelUtil.java
index f020818..897c6e7 100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/model/ModelUtil.java
+++ b/vid-app-common/src/main/java/org/onap/vid/model/ModelUtil.java
@@ -1,7 +1,7 @@
 /**
  * 
  */
-package org.openecomp.vid.model;
+package org.onap.vid.model;
 
 /**
  * The Class ModelUtil.
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/openecomp/vid/model/Network.java b/vid-app-common/src/main/java/org/onap/vid/model/Network.java
old mode 100755
new mode 100644
similarity index 95%
rename from vid-app-common/src/main/java/org/openecomp/vid/model/Network.java
rename to vid-app-common/src/main/java/org/onap/vid/model/Network.java
index e763496..ef342e4
--- a/vid-app-common/src/main/java/org/openecomp/vid/model/Network.java
+++ b/vid-app-common/src/main/java/org/onap/vid/model/Network.java
@@ -1,62 +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.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);
-		
-	}
-}
+/*-
+ * ============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/openecomp/vid/model/NewNetwork.java b/vid-app-common/src/main/java/org/onap/vid/model/NewNetwork.java
similarity index 94%
rename from vid-app-common/src/main/java/org/openecomp/vid/model/NewNetwork.java
rename to vid-app-common/src/main/java/org/onap/vid/model/NewNetwork.java
index 48e3a55..9f1ffd3 100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/model/NewNetwork.java
+++ b/vid-app-common/src/main/java/org/onap/vid/model/NewNetwork.java
@@ -18,9 +18,9 @@
  * ============LICENSE_END=========================================================
  */
 
-package org.openecomp.vid.model;
+package org.onap.vid.model;
 
-import org.openecomp.vid.asdc.beans.tosca.NodeTemplate;
+import org.onap.vid.asdc.beans.tosca.NodeTemplate;
 
 /**
  * The Class Network.
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/model/NewNode.java b/vid-app-common/src/main/java/org/onap/vid/model/NewNode.java
similarity index 97%
rename from vid-app-common/src/main/java/org/openecomp/vid/model/NewNode.java
rename to vid-app-common/src/main/java/org/onap/vid/model/NewNode.java
index 681131f..89a808b 100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/model/NewNode.java
+++ b/vid-app-common/src/main/java/org/onap/vid/model/NewNode.java
@@ -1,4 +1,4 @@
-package org.openecomp.vid.model;
+package org.onap.vid.model;
 
 import java.text.DateFormat;
 import java.text.SimpleDateFormat;
@@ -6,7 +6,7 @@
 import java.util.Map;
 
 import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
-import org.openecomp.vid.asdc.beans.tosca.Input;
+import org.onap.vid.asdc.beans.tosca.Input;
 
 
 public class NewNode {
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/model/NewService.java b/vid-app-common/src/main/java/org/onap/vid/model/NewService.java
similarity index 98%
rename from vid-app-common/src/main/java/org/openecomp/vid/model/NewService.java
rename to vid-app-common/src/main/java/org/onap/vid/model/NewService.java
index 1dcf022..1346c0d 100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/model/NewService.java
+++ b/vid-app-common/src/main/java/org/onap/vid/model/NewService.java
@@ -18,12 +18,12 @@
  * ============LICENSE_END=========================================================
  */
 
-package org.openecomp.vid.model;
+package org.onap.vid.model;
 
 import java.util.Map;
 import java.util.UUID;
 
-import org.openecomp.vid.asdc.beans.tosca.Input;
+import org.onap.vid.asdc.beans.tosca.Input;
 
 /**
  * The Class Service.
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/model/NewServiceModel.java b/vid-app-common/src/main/java/org/onap/vid/model/NewServiceModel.java
similarity index 92%
rename from vid-app-common/src/main/java/org/openecomp/vid/model/NewServiceModel.java
rename to vid-app-common/src/main/java/org/onap/vid/model/NewServiceModel.java
index 6fda979..e343b6d 100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/model/NewServiceModel.java
+++ b/vid-app-common/src/main/java/org/onap/vid/model/NewServiceModel.java
@@ -18,7 +18,7 @@
  * ============LICENSE_END=========================================================
  */
 
-package org.openecomp.vid.model;
+package org.onap.vid.model;
 
 import java.text.DateFormat;
 import java.text.SimpleDateFormat;
@@ -26,13 +26,14 @@
 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.onap.vid.asdc.beans.tosca.Group;
+import org.onap.vid.asdc.beans.tosca.ToscaModel;
 import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
-import org.openecomp.vid.properties.VidProperties;
+import org.onap.vid.properties.VidProperties;
 /**
  * The Class ServiceModel.
  */
+
 public class NewServiceModel {
 
 	/** The Constant LOG. */
@@ -59,6 +60,13 @@
 	 * 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.
 	 */
@@ -133,11 +141,22 @@
 	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;
 	}
@@ -149,6 +168,16 @@
 	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.
 	 *
@@ -156,7 +185,7 @@
 	 * @param asdcServiceMetadata the asdc service metadata
 	 * @return the service
 	 */
-	public static Service extractService(ToscaModel serviceToscaModel, org.openecomp.vid.asdc.beans.Service asdcServiceMetadata) {
+	public static Service extractService(ToscaModel serviceToscaModel, org.onap.vid.asdc.beans.Service asdcServiceMetadata) {
 		
 		final Service service = new Service();
 		
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/model/NewVNF.java b/vid-app-common/src/main/java/org/onap/vid/model/NewVNF.java
similarity index 96%
rename from vid-app-common/src/main/java/org/openecomp/vid/model/NewVNF.java
rename to vid-app-common/src/main/java/org/onap/vid/model/NewVNF.java
index e84f963..8e8c89f 100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/model/NewVNF.java
+++ b/vid-app-common/src/main/java/org/onap/vid/model/NewVNF.java
@@ -1,4 +1,4 @@
-package org.openecomp.vid.model;
+package org.onap.vid.model;
 
 import java.text.DateFormat;
 import java.text.SimpleDateFormat;
@@ -7,7 +7,7 @@
 import java.util.regex.Pattern;
 
 import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
-import org.openecomp.vid.asdc.beans.tosca.NodeTemplate;
+import org.onap.vid.asdc.beans.tosca.NodeTemplate;
 
 public class NewVNF extends NewNode {
 	
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/model/Node.java b/vid-app-common/src/main/java/org/onap/vid/model/Node.java
old mode 100755
new mode 100644
similarity index 94%
rename from vid-app-common/src/main/java/org/openecomp/vid/model/Node.java
rename to vid-app-common/src/main/java/org/onap/vid/model/Node.java
index 1352653..7623a38
--- a/vid-app-common/src/main/java/org/openecomp/vid/model/Node.java
+++ b/vid-app-common/src/main/java/org/onap/vid/model/Node.java
@@ -1,301 +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.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());
-		}
-	}
-
-}
+/*-
+ * ============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/openecomp/vid/model/Resource.java b/vid-app-common/src/main/java/org/onap/vid/model/Resource.java
old mode 100755
new mode 100644
similarity index 96%
rename from vid-app-common/src/main/java/org/openecomp/vid/model/Resource.java
rename to vid-app-common/src/main/java/org/onap/vid/model/Resource.java
index 4dcc975..184f9ee
--- a/vid-app-common/src/main/java/org/openecomp/vid/model/Resource.java
+++ b/vid-app-common/src/main/java/org/onap/vid/model/Resource.java
@@ -1,28 +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.openecomp.vid.model;
-
-/**
- * The Class Resource.
- */
-public class Resource {
-
-}
+/*-
+ * ============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/openecomp/vid/model/Result.java b/vid-app-common/src/main/java/org/onap/vid/model/Result.java
old mode 100755
new mode 100644
similarity index 97%
rename from vid-app-common/src/main/java/org/openecomp/vid/model/Result.java
rename to vid-app-common/src/main/java/org/onap/vid/model/Result.java
index d8bf6eb..c972bcc
--- a/vid-app-common/src/main/java/org/openecomp/vid/model/Result.java
+++ b/vid-app-common/src/main/java/org/onap/vid/model/Result.java
@@ -1,58 +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.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;
-	}
-	
-}
+/*-
+ * ============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/openecomp/vid/model/Service.java b/vid-app-common/src/main/java/org/onap/vid/model/Service.java
old mode 100755
new mode 100644
similarity index 94%
rename from vid-app-common/src/main/java/org/openecomp/vid/model/Service.java
rename to vid-app-common/src/main/java/org/onap/vid/model/Service.java
index c6269b9..b0597c6
--- a/vid-app-common/src/main/java/org/openecomp/vid/model/Service.java
+++ b/vid-app-common/src/main/java/org/onap/vid/model/Service.java
@@ -1,276 +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.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;
-			}
-		}
-	}*/
-}
+/*-
+ * ============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/openecomp/vid/model/ServiceModel.java b/vid-app-common/src/main/java/org/onap/vid/model/ServiceModel.java
old mode 100755
new mode 100644
similarity index 83%
rename from vid-app-common/src/main/java/org/openecomp/vid/model/ServiceModel.java
rename to vid-app-common/src/main/java/org/onap/vid/model/ServiceModel.java
index e879fd4..dab18d5
--- a/vid-app-common/src/main/java/org/openecomp/vid/model/ServiceModel.java
+++ b/vid-app-common/src/main/java/org/onap/vid/model/ServiceModel.java
@@ -1,261 +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.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));
-									}
-								}	
-							}
-						}
-					}
-				}
-			}
-		}
-		
-	}
-}
+/*-
+ * ============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/openecomp/vid/model/Subscriber.java b/vid-app-common/src/main/java/org/onap/vid/model/Subscriber.java
similarity index 92%
rename from vid-app-common/src/main/java/org/openecomp/vid/model/Subscriber.java
rename to vid-app-common/src/main/java/org/onap/vid/model/Subscriber.java
index c5db6fd..70711b8 100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/model/Subscriber.java
+++ b/vid-app-common/src/main/java/org/onap/vid/model/Subscriber.java
@@ -1,4 +1,4 @@
-package org.openecomp.vid.model;
+package org.onap.vid.model;
 
 
 import org.codehaus.jackson.annotate.JsonProperty;
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/model/SubscriberList.java b/vid-app-common/src/main/java/org/onap/vid/model/SubscriberList.java
similarity index 85%
rename from vid-app-common/src/main/java/org/openecomp/vid/model/SubscriberList.java
rename to vid-app-common/src/main/java/org/onap/vid/model/SubscriberList.java
index 7f593e4..5f93597 100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/model/SubscriberList.java
+++ b/vid-app-common/src/main/java/org/onap/vid/model/SubscriberList.java
@@ -1,4 +1,4 @@
-package org.openecomp.vid.model;
+package org.onap.vid.model;
 
 import org.openecomp.portalsdk.core.web.support.UserUtils;
 
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/model/VNF.java b/vid-app-common/src/main/java/org/onap/vid/model/VNF.java
old mode 100755
new mode 100644
similarity index 94%
rename from vid-app-common/src/main/java/org/openecomp/vid/model/VNF.java
rename to vid-app-common/src/main/java/org/onap/vid/model/VNF.java
index 62e101e..e558e95
--- a/vid-app-common/src/main/java/org/openecomp/vid/model/VNF.java
+++ b/vid-app-common/src/main/java/org/onap/vid/model/VNF.java
@@ -1,165 +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.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);
-		}
-		
-	}
-}
+/*-
+ * ============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/openecomp/vid/model/VersionByInvariantIdsRequest.java b/vid-app-common/src/main/java/org/onap/vid/model/VersionByInvariantIdsRequest.java
similarity index 81%
rename from vid-app-common/src/main/java/org/openecomp/vid/model/VersionByInvariantIdsRequest.java
rename to vid-app-common/src/main/java/org/onap/vid/model/VersionByInvariantIdsRequest.java
index 7c86165..907f493 100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/model/VersionByInvariantIdsRequest.java
+++ b/vid-app-common/src/main/java/org/onap/vid/model/VersionByInvariantIdsRequest.java
@@ -1,4 +1,4 @@
-package org.openecomp.vid.model;
+package org.onap.vid.model;
 
 import java.util.List;
 
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/model/VfModule.java b/vid-app-common/src/main/java/org/onap/vid/model/VfModule.java
old mode 100755
new mode 100644
similarity index 98%
rename from vid-app-common/src/main/java/org/openecomp/vid/model/VfModule.java
rename to vid-app-common/src/main/java/org/onap/vid/model/VfModule.java
index 3f6f1da..ac19587
--- a/vid-app-common/src/main/java/org/openecomp/vid/model/VfModule.java
+++ b/vid-app-common/src/main/java/org/onap/vid/model/VfModule.java
@@ -1,308 +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.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;
-	}
-}
+/*-
+ * ============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/openecomp/vid/model/VolumeGroup.java b/vid-app-common/src/main/java/org/onap/vid/model/VolumeGroup.java
old mode 100755
new mode 100644
similarity index 97%
rename from vid-app-common/src/main/java/org/openecomp/vid/model/VolumeGroup.java
rename to vid-app-common/src/main/java/org/onap/vid/model/VolumeGroup.java
index baa5351..969c287
--- a/vid-app-common/src/main/java/org/openecomp/vid/model/VolumeGroup.java
+++ b/vid-app-common/src/main/java/org/onap/vid/model/VolumeGroup.java
@@ -1,196 +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.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;
-	}
-
-}
+/*-
+ * ============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/openecomp/vid/model/Workflow.java b/vid-app-common/src/main/java/org/onap/vid/model/Workflow.java
similarity index 96%
rename from vid-app-common/src/main/java/org/openecomp/vid/model/Workflow.java
rename to vid-app-common/src/main/java/org/onap/vid/model/Workflow.java
index 6032ec5..346138d 100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/model/Workflow.java
+++ b/vid-app-common/src/main/java/org/onap/vid/model/Workflow.java
@@ -1,4 +1,4 @@
-package org.openecomp.vid.model;
+package org.onap.vid.model;
 
 
 import java.util.Collection;
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/openecomp/vid/mso/MsoInterface.java b/vid-app-common/src/main/java/org/onap/vid/mso/MsoInterface.java
similarity index 65%
rename from vid-app-common/src/main/java/org/openecomp/vid/mso/MsoInterface.java
rename to vid-app-common/src/main/java/org/onap/vid/mso/MsoInterface.java
index cdeb1bb..2d09630 100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/mso/MsoInterface.java
+++ b/vid-app-common/src/main/java/org/onap/vid/mso/MsoInterface.java
@@ -1,10 +1,7 @@
-package org.openecomp.vid.mso;
+package org.onap.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;
+import org.onap.vid.changeManagement.RequestDetailsWrapper;
+import org.onap.vid.mso.rest.RequestDetails;
 
 /**
  * Created by pickjonathan on 21/06/2017.
@@ -47,6 +44,8 @@
      */
     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;
@@ -65,11 +64,22 @@
 
     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 updateVnf(org.onap.vid.changeManagement.RequestDetails requestDetails, String vnf_endpoint)  throws Exception;
 
-	MsoResponseWrapper replaceVnf(org.openecomp.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;
 
-    void activateServiceInstance(RequestDetails requestDetails, String t, String sourceId, String endpoint, RestObject<String> restObject) 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/openecomp/vid/mso/MsoProperties.java b/vid-app-common/src/main/java/org/onap/vid/mso/MsoProperties.java
old mode 100755
new mode 100644
similarity index 80%
rename from vid-app-common/src/main/java/org/openecomp/vid/mso/MsoProperties.java
rename to vid-app-common/src/main/java/org/onap/vid/mso/MsoProperties.java
index 0eed0e1..607d841
--- a/vid-app-common/src/main/java/org/openecomp/vid/mso/MsoProperties.java
+++ b/vid-app-common/src/main/java/org/onap/vid/mso/MsoProperties.java
@@ -1,105 +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.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");
-	
-}
+/*-
+ * ============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/openecomp/vid/mso/MsoResponseWrapper.java b/vid-app-common/src/main/java/org/onap/vid/mso/MsoResponseWrapper.java
old mode 100755
new mode 100644
similarity index 78%
rename from vid-app-common/src/main/java/org/openecomp/vid/mso/MsoResponseWrapper.java
rename to vid-app-common/src/main/java/org/onap/vid/mso/MsoResponseWrapper.java
index d5a4a87..b890114
--- a/vid-app-common/src/main/java/org/openecomp/vid/mso/MsoResponseWrapper.java
+++ b/vid-app-common/src/main/java/org/onap/vid/mso/MsoResponseWrapper.java
@@ -1,107 +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.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());
-    }
-    
-}
+/*-
+ * ============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/openecomp/vid/mso/MsoUtil.java b/vid-app-common/src/main/java/org/onap/vid/mso/MsoUtil.java
old mode 100755
new mode 100644
similarity index 85%
rename from vid-app-common/src/main/java/org/openecomp/vid/mso/MsoUtil.java
rename to vid-app-common/src/main/java/org/onap/vid/mso/MsoUtil.java
index 2c0148b..eae705a
--- a/vid-app-common/src/main/java/org/openecomp/vid/mso/MsoUtil.java
+++ b/vid-app-common/src/main/java/org/onap/vid/mso/MsoUtil.java
@@ -1,125 +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.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
-
-	}
-}
+/*-
+ * ============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/openecomp/vid/mso/rest/AsyncRequestStatus.java b/vid-app-common/src/main/java/org/onap/vid/mso/rest/AsyncRequestStatus.java
old mode 100755
new mode 100644
similarity index 94%
rename from vid-app-common/src/main/java/org/openecomp/vid/mso/rest/AsyncRequestStatus.java
rename to vid-app-common/src/main/java/org/onap/vid/mso/rest/AsyncRequestStatus.java
index 1395f9a..f47e16f
--- a/vid-app-common/src/main/java/org/openecomp/vid/mso/rest/AsyncRequestStatus.java
+++ b/vid-app-common/src/main/java/org/onap/vid/mso/rest/AsyncRequestStatus.java
@@ -1,123 +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.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();
-    }
-}
+/*-
+ * ============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/openecomp/vid/mso/rest/MsoRestClientNew.java b/vid-app-common/src/main/java/org/onap/vid/mso/rest/MsoRestClientNew.java
similarity index 63%
rename from vid-app-common/src/main/java/org/openecomp/vid/mso/rest/MsoRestClientNew.java
rename to vid-app-common/src/main/java/org/onap/vid/mso/rest/MsoRestClientNew.java
index 1beeafb..9bb5403 100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/mso/rest/MsoRestClientNew.java
+++ b/vid-app-common/src/main/java/org/onap/vid/mso/rest/MsoRestClientNew.java
@@ -1,9 +1,11 @@
-package org.openecomp.vid.mso.rest;
+package org.onap.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 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;
@@ -15,17 +17,14 @@
 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";
-
+    /**
+     * The logger.
+     */
+    EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(MsoRestClientNew.class);
 
     @Override
     public MsoResponseWrapper createSvcInstance(RequestDetails requestDetails, String endpoint) throws Exception {
@@ -70,6 +69,14 @@
     }
 
     @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");
@@ -174,7 +181,7 @@
 
     }
 
-    public MsoResponseWrapper getOrchestrationRequestsForDashboard(String t, String sourceId, String endpoint, RestObject restObject) throws Exception{
+    public MsoResponseWrapper getOrchestrationRequestsForDashboard(String t, String sourceId, String endpoint, RestObject restObject) throws Exception {
         String methodName = "getOrchestrationRequestsForDashboard";
         logger.debug(dateFormat.format(new Date()) + "<== " + methodName + " start");
 
@@ -185,25 +192,25 @@
 
             return w;
 
-        } catch (Exception e){
+        } 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{
+    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);
+            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){
+        } 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;
@@ -211,14 +218,13 @@
     }
 
 
-
     @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);
+            Post(t, requestDetails, sourceId, endpoint, restObject);
             MsoResponseWrapper w = MsoUtil.wrapResponse(restObject);
 
             logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " w=" + w.getResponse());
@@ -232,38 +238,97 @@
     }
 
     @Override
-    public MsoResponseWrapper replaceVnf(org.openecomp.vid.changeManagement.RequestDetails requestDetails, String endpoint) throws Exception {
+    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);
     }
 
-    public MsoResponseWrapper replaceInstance(org.openecomp.vid.changeManagement.RequestDetails request, String path) throws Exception {
+    @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 + "]");
 
+
+            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);
+            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());
+            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
+                // TODO
             }
             return msoResponseWrapperObject;
 
@@ -276,29 +341,25 @@
     }
 
     @Override
-    public MsoResponseWrapper updateVnf(org.openecomp.vid.changeManagement.RequestDetails requestDetails, String endpoint) throws Exception {
+    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);;
+        wrapper.requestDetails = new MsoRequestDetails(requestDetails);
         return updateInstance(requestDetails, endpoint);
     }
 
-    public MsoResponseWrapper updateInstance(org.openecomp.vid.changeManagement.RequestDetails request, String path) throws Exception {
+    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);
 
@@ -313,12 +374,12 @@
 
     }
 
-    public void activateServiceInstance(RequestDetails requestDetails, String t, String sourceId, String endpoint, RestObject<String> restObject) throws Exception{
+    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);
+            Post(t, requestDetails, sourceId, endpoint, restObject);
             MsoResponseWrapper w = MsoUtil.wrapResponse(restObject);
 
             logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " w =" + w.getResponse());
@@ -330,4 +391,45 @@
         }
     }
 
+    @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/openecomp/vid/mso/rest/RelatedInstance.java b/vid-app-common/src/main/java/org/onap/vid/mso/rest/RelatedInstance.java
old mode 100755
new mode 100644
similarity index 92%
rename from vid-app-common/src/main/java/org/openecomp/vid/mso/rest/RelatedInstance.java
rename to vid-app-common/src/main/java/org/onap/vid/mso/rest/RelatedInstance.java
index b68f7c1..b7f1203
--- a/vid-app-common/src/main/java/org/openecomp/vid/mso/rest/RelatedInstance.java
+++ b/vid-app-common/src/main/java/org/onap/vid/mso/rest/RelatedInstance.java
@@ -1,125 +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.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();
-    }
-
-}
+/*-
+ * ============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/openecomp/vid/mso/rest/RelatedModel.java b/vid-app-common/src/main/java/org/onap/vid/mso/rest/RelatedModel.java
old mode 100755
new mode 100644
similarity index 92%
rename from vid-app-common/src/main/java/org/openecomp/vid/mso/rest/RelatedModel.java
rename to vid-app-common/src/main/java/org/onap/vid/mso/rest/RelatedModel.java
index 427d71d..39722e1
--- a/vid-app-common/src/main/java/org/openecomp/vid/mso/rest/RelatedModel.java
+++ b/vid-app-common/src/main/java/org/onap/vid/mso/rest/RelatedModel.java
@@ -1,125 +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.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();
-    }
-
-}
+/*-
+ * ============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/openecomp/vid/mso/rest/Request.java b/vid-app-common/src/main/java/org/onap/vid/mso/rest/Request.java
old mode 100755
new mode 100644
similarity index 88%
rename from vid-app-common/src/main/java/org/openecomp/vid/mso/rest/Request.java
rename to vid-app-common/src/main/java/org/onap/vid/mso/rest/Request.java
index c8f7b8b..b1a84ab
--- a/vid-app-common/src/main/java/org/openecomp/vid/mso/rest/Request.java
+++ b/vid-app-common/src/main/java/org/onap/vid/mso/rest/Request.java
@@ -1,140 +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.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();
-    }
-}
+/*-
+ * ============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/openecomp/vid/mso/rest/RequestDetails.java b/vid-app-common/src/main/java/org/onap/vid/mso/rest/RequestDetails.java
old mode 100755
new mode 100644
similarity index 91%
rename from vid-app-common/src/main/java/org/openecomp/vid/mso/rest/RequestDetails.java
rename to vid-app-common/src/main/java/org/onap/vid/mso/rest/RequestDetails.java
index 0cf697e..1e05989
--- a/vid-app-common/src/main/java/org/openecomp/vid/mso/rest/RequestDetails.java
+++ b/vid-app-common/src/main/java/org/onap/vid/mso/rest/RequestDetails.java
@@ -1,232 +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.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();
-    }
-
-}
+/*-
+ * ============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/openecomp/vid/mso/rest/RequestList.java b/vid-app-common/src/main/java/org/onap/vid/mso/rest/RequestList.java
old mode 100755
new mode 100644
similarity index 98%
rename from vid-app-common/src/main/java/org/openecomp/vid/mso/rest/RequestList.java
rename to vid-app-common/src/main/java/org/onap/vid/mso/rest/RequestList.java
index 8a57c74..8f8272c
--- a/vid-app-common/src/main/java/org/openecomp/vid/mso/rest/RequestList.java
+++ b/vid-app-common/src/main/java/org/onap/vid/mso/rest/RequestList.java
@@ -1,137 +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.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();
-    }
-
-}
+/*-
+ * ============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/openecomp/vid/mso/rest/RequestWrapper.java b/vid-app-common/src/main/java/org/onap/vid/mso/rest/RequestWrapper.java
similarity index 93%
rename from vid-app-common/src/main/java/org/openecomp/vid/mso/rest/RequestWrapper.java
rename to vid-app-common/src/main/java/org/onap/vid/mso/rest/RequestWrapper.java
index b0e9fa1..c93d0e5 100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/mso/rest/RequestWrapper.java
+++ b/vid-app-common/src/main/java/org/onap/vid/mso/rest/RequestWrapper.java
@@ -1,4 +1,4 @@
-package org.openecomp.vid.mso.rest;
+package org.onap.vid.mso.rest;
 
 import com.fasterxml.jackson.annotation.JsonProperty;
 
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/mso/rest/Response.java b/vid-app-common/src/main/java/org/onap/vid/mso/rest/Response.java
similarity index 95%
rename from vid-app-common/src/main/java/org/openecomp/vid/mso/rest/Response.java
rename to vid-app-common/src/main/java/org/onap/vid/mso/rest/Response.java
index ee3a8bf..ee074f3 100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/mso/rest/Response.java
+++ b/vid-app-common/src/main/java/org/onap/vid/mso/rest/Response.java
@@ -1,4 +1,4 @@
-package org.openecomp.vid.mso.rest;
+package org.onap.vid.mso.rest;
 
 import com.fasterxml.jackson.annotation.JsonProperty;
 
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/openecomp/vid/mso/rest/Task.java b/vid-app-common/src/main/java/org/onap/vid/mso/rest/Task.java
similarity index 98%
rename from vid-app-common/src/main/java/org/openecomp/vid/mso/rest/Task.java
rename to vid-app-common/src/main/java/org/onap/vid/mso/rest/Task.java
index 8d72890..79aaaea 100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/mso/rest/Task.java
+++ b/vid-app-common/src/main/java/org/onap/vid/mso/rest/Task.java
@@ -1,4 +1,4 @@
-package org.openecomp.vid.mso.rest;
+package org.onap.vid.mso.rest;
 
 import java.util.List;
 
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/mso/rest/TaskList.java b/vid-app-common/src/main/java/org/onap/vid/mso/rest/TaskList.java
similarity index 87%
rename from vid-app-common/src/main/java/org/openecomp/vid/mso/rest/TaskList.java
rename to vid-app-common/src/main/java/org/onap/vid/mso/rest/TaskList.java
index 7232364..bbff333 100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/mso/rest/TaskList.java
+++ b/vid-app-common/src/main/java/org/onap/vid/mso/rest/TaskList.java
@@ -1,4 +1,4 @@
-package org.openecomp.vid.mso.rest;
+package org.onap.vid.mso.rest;
 
 import java.util.List;
 
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/policy/PolicyProperties.java b/vid-app-common/src/main/java/org/onap/vid/policy/PolicyProperties.java
similarity index 95%
rename from vid-app-common/src/main/java/org/openecomp/vid/policy/PolicyProperties.java
rename to vid-app-common/src/main/java/org/onap/vid/policy/PolicyProperties.java
index d273aa6..2afb2d4 100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/policy/PolicyProperties.java
+++ b/vid-app-common/src/main/java/org/onap/vid/policy/PolicyProperties.java
@@ -1,4 +1,4 @@
-package org.openecomp.vid.policy;
+package org.onap.vid.policy;
 
 import org.openecomp.portalsdk.core.util.SystemProperties;
 
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/policy/PolicyResponseWrapper.java b/vid-app-common/src/main/java/org/onap/vid/policy/PolicyResponseWrapper.java
similarity index 97%
rename from vid-app-common/src/main/java/org/openecomp/vid/policy/PolicyResponseWrapper.java
rename to vid-app-common/src/main/java/org/onap/vid/policy/PolicyResponseWrapper.java
index 02ca0f0..d5a4d12 100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/policy/PolicyResponseWrapper.java
+++ b/vid-app-common/src/main/java/org/onap/vid/policy/PolicyResponseWrapper.java
@@ -1,4 +1,4 @@
-package org.openecomp.vid.policy;
+package org.onap.vid.policy;
 
 import com.fasterxml.jackson.annotation.JsonInclude;
 import com.fasterxml.jackson.annotation.JsonProperty;
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/policy/PolicyRestInt.java b/vid-app-common/src/main/java/org/onap/vid/policy/PolicyRestInt.java
similarity index 92%
rename from vid-app-common/src/main/java/org/openecomp/vid/policy/PolicyRestInt.java
rename to vid-app-common/src/main/java/org/onap/vid/policy/PolicyRestInt.java
index 7c075a5..b58fe28 100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/policy/PolicyRestInt.java
+++ b/vid-app-common/src/main/java/org/onap/vid/policy/PolicyRestInt.java
@@ -18,21 +18,20 @@
  * ============LICENSE_END=========================================================
  */
 
-package org.openecomp.vid.policy;
+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;
 
-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);
+	private static final EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(PolicyRestInt.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/policy/PolicyRestInterface.java b/vid-app-common/src/main/java/org/onap/vid/policy/PolicyRestInterface.java
similarity index 97%
rename from vid-app-common/src/main/java/org/openecomp/vid/policy/PolicyRestInterface.java
rename to vid-app-common/src/main/java/org/onap/vid/policy/PolicyRestInterface.java
index d6a59da..875586d 100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/policy/PolicyRestInterface.java
+++ b/vid-app-common/src/main/java/org/onap/vid/policy/PolicyRestInterface.java
@@ -1,28 +1,27 @@
-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;
+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.openecomp.vid.client.HttpBasicClient;
-import org.openecomp.vid.policy.rest.RequestDetails;
+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. */
-	EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(PolicyRestInterface.class);
+	private static final EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(PolicyRestInterface.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/policy/PolicyRestInterfaceFactory.java b/vid-app-common/src/main/java/org/onap/vid/policy/PolicyRestInterfaceFactory.java
similarity index 85%
rename from vid-app-common/src/main/java/org/openecomp/vid/policy/PolicyRestInterfaceFactory.java
rename to vid-app-common/src/main/java/org/onap/vid/policy/PolicyRestInterfaceFactory.java
index 1570875..40cb854 100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/policy/PolicyRestInterfaceFactory.java
+++ b/vid-app-common/src/main/java/org/onap/vid/policy/PolicyRestInterfaceFactory.java
@@ -1,5 +1,5 @@
 
-package org.openecomp.vid.policy;
+package org.onap.vid.policy;
 
 public class PolicyRestInterfaceFactory {
 
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/policy/PolicyRestInterfaceIfc.java b/vid-app-common/src/main/java/org/onap/vid/policy/PolicyRestInterfaceIfc.java
similarity index 93%
rename from vid-app-common/src/main/java/org/openecomp/vid/policy/PolicyRestInterfaceIfc.java
rename to vid-app-common/src/main/java/org/onap/vid/policy/PolicyRestInterfaceIfc.java
index f56924b..59b0ad3 100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/policy/PolicyRestInterfaceIfc.java
+++ b/vid-app-common/src/main/java/org/onap/vid/policy/PolicyRestInterfaceIfc.java
@@ -1,8 +1,8 @@
 
-package org.openecomp.vid.policy;
+package org.onap.vid.policy;
 
 import org.json.simple.JSONObject;
-import org.openecomp.vid.policy.rest.RequestDetails;
+import org.onap.vid.policy.rest.RequestDetails;
 
 public interface PolicyRestInterfaceIfc {	
 	/**
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/policy/PolicyUtil.java b/vid-app-common/src/main/java/org/onap/vid/policy/PolicyUtil.java
similarity index 91%
rename from vid-app-common/src/main/java/org/openecomp/vid/policy/PolicyUtil.java
rename to vid-app-common/src/main/java/org/onap/vid/policy/PolicyUtil.java
index ceda7c4..6083528 100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/policy/PolicyUtil.java
+++ b/vid-app-common/src/main/java/org/onap/vid/policy/PolicyUtil.java
@@ -1,4 +1,4 @@
-package org.openecomp.vid.policy;
+package org.onap.vid.policy;
 
 import java.text.DateFormat;
 import java.text.SimpleDateFormat;
@@ -6,9 +6,9 @@
 
 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 org.onap.vid.policy.PolicyResponseWrapper;
+import org.onap.vid.policy.PolicyUtil;
+import org.onap.vid.policy.RestObject;
 
 import com.fasterxml.jackson.databind.ObjectMapper;
 
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/policy/RestObject.java b/vid-app-common/src/main/java/org/onap/vid/policy/RestObject.java
similarity index 97%
rename from vid-app-common/src/main/java/org/openecomp/vid/policy/RestObject.java
rename to vid-app-common/src/main/java/org/onap/vid/policy/RestObject.java
index de085f2..81b354e 100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/policy/RestObject.java
+++ b/vid-app-common/src/main/java/org/onap/vid/policy/RestObject.java
@@ -18,7 +18,7 @@
  * ============LICENSE_END=========================================================
  */
 
-package org.openecomp.vid.policy;
+package org.onap.vid.policy;
 
 /**
  * The Class RestObject.
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/policy/rest/RequestDetails.java b/vid-app-common/src/main/java/org/onap/vid/policy/rest/RequestDetails.java
similarity index 98%
rename from vid-app-common/src/main/java/org/openecomp/vid/policy/rest/RequestDetails.java
rename to vid-app-common/src/main/java/org/onap/vid/policy/rest/RequestDetails.java
index 93e80d6..81e2f2d 100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/policy/rest/RequestDetails.java
+++ b/vid-app-common/src/main/java/org/onap/vid/policy/rest/RequestDetails.java
@@ -18,7 +18,7 @@
  * ============LICENSE_END=========================================================
  */
 
-package org.openecomp.vid.policy.rest;
+package org.onap.vid.policy.rest;
 
 import com.fasterxml.jackson.annotation.JsonInclude;
 import com.fasterxml.jackson.annotation.JsonProperty;
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/properties/AsdcClientConfiguration.java b/vid-app-common/src/main/java/org/onap/vid/properties/AsdcClientConfiguration.java
old mode 100755
new mode 100644
similarity index 98%
rename from vid-app-common/src/main/java/org/openecomp/vid/properties/AsdcClientConfiguration.java
rename to vid-app-common/src/main/java/org/onap/vid/properties/AsdcClientConfiguration.java
index 232023b..c767967
--- a/vid-app-common/src/main/java/org/openecomp/vid/properties/AsdcClientConfiguration.java
+++ b/vid-app-common/src/main/java/org/onap/vid/properties/AsdcClientConfiguration.java
@@ -1,124 +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.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
-	}
-}
+/*-
+ * ============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/openecomp/vid/properties/MsoClientConfiguration.java b/vid-app-common/src/main/java/org/onap/vid/properties/MsoClientConfiguration.java
similarity index 70%
rename from vid-app-common/src/main/java/org/openecomp/vid/properties/MsoClientConfiguration.java
rename to vid-app-common/src/main/java/org/onap/vid/properties/MsoClientConfiguration.java
index f7a331a..ca58a95 100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/properties/MsoClientConfiguration.java
+++ b/vid-app-common/src/main/java/org/onap/vid/properties/MsoClientConfiguration.java
@@ -1,4 +1,4 @@
-package org.openecomp.vid.properties;
+package org.onap.vid.properties;
 
 /**
  * Created by pickjonathan on 20/06/2017.
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/properties/VidProperties.java b/vid-app-common/src/main/java/org/onap/vid/properties/VidProperties.java
old mode 100755
new mode 100644
similarity index 95%
rename from vid-app-common/src/main/java/org/openecomp/vid/properties/VidProperties.java
rename to vid-app-common/src/main/java/org/onap/vid/properties/VidProperties.java
index 141b9b2..9108ae1
--- a/vid-app-common/src/main/java/org/openecomp/vid/properties/VidProperties.java
+++ b/vid-app-common/src/main/java/org/onap/vid/properties/VidProperties.java
@@ -1,93 +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.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);
-	}
-}
+/*-
+ * ============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/openecomp/vid/roles/Role.java b/vid-app-common/src/main/java/org/onap/vid/roles/Role.java
similarity index 80%
rename from vid-app-common/src/main/java/org/openecomp/vid/roles/Role.java
rename to vid-app-common/src/main/java/org/onap/vid/roles/Role.java
index f818e48..902da5b 100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/roles/Role.java
+++ b/vid-app-common/src/main/java/org/onap/vid/roles/Role.java
@@ -1,4 +1,4 @@
-package org.openecomp.vid.roles;
+package org.onap.vid.roles;
 
 /**
  * Created by Oren on 7/1/17.
@@ -14,9 +14,9 @@
 
     private String tenant;
 
-    public Role(EcompRole ecompRole, String serviceName, String serviceType, String tenant) {
+    public Role(EcompRole ecompRole, String subscribeName, String serviceType, String tenant) {
         this.ecompRole = ecompRole;
-        this.subscribeName = serviceName;
+        this.subscribeName = subscribeName;
         this.serviceType = serviceType;
         this.tenant = 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/openecomp/vid/roles/RoleValidator.java b/vid-app-common/src/main/java/org/onap/vid/roles/RoleValidator.java
similarity index 82%
rename from vid-app-common/src/main/java/org/openecomp/vid/roles/RoleValidator.java
rename to vid-app-common/src/main/java/org/onap/vid/roles/RoleValidator.java
index 9031524..f4f17fa 100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/roles/RoleValidator.java
+++ b/vid-app-common/src/main/java/org/onap/vid/roles/RoleValidator.java
@@ -1,6 +1,6 @@
-package org.openecomp.vid.roles;
+package org.onap.vid.roles;
 
-import org.openecomp.vid.mso.rest.RequestDetails;
+import org.onap.vid.mso.rest.RequestDetails;
 
 import java.util.List;
 import java.util.Map;
@@ -10,8 +10,6 @@
  */
 public class RoleValidator {
 
-	//Disable roles until AAF integration finishes
-	private boolean disableRoles = true;
     private List<Role> userRoles;
 
     public RoleValidator(List<Role> roles) {
@@ -19,8 +17,6 @@
     }
 
     public boolean isSubscriberPermitted(String subscriberName) {
-    	if(this.disableRoles) return true;
-    	
         for (Role role : userRoles) {
             if (role.getSubscribeName().equals(subscriberName))
                 return true;
@@ -29,8 +25,6 @@
     }
 
     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;
@@ -39,8 +33,6 @@
     }
 
     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");
@@ -52,13 +44,11 @@
 //        return false;
     }
 
-    public boolean isTenantPermitted(String globalCustomerId, String serviceType, String tenant) {
-    	if(this.disableRoles) return true;
-    	
+    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().equals(tenant))) {
+                    && (role.getTenant() == null || role.getTenant().equalsIgnoreCase(tenantName))) {
                 return true;
             }
         }
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/scheduler/RestObject.java b/vid-app-common/src/main/java/org/onap/vid/scheduler/RestObject.java
similarity index 97%
rename from vid-app-common/src/main/java/org/openecomp/vid/scheduler/RestObject.java
rename to vid-app-common/src/main/java/org/onap/vid/scheduler/RestObject.java
index 57b3683..4accb55 100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/scheduler/RestObject.java
+++ b/vid-app-common/src/main/java/org/onap/vid/scheduler/RestObject.java
@@ -18,7 +18,7 @@
  * ============LICENSE_END=========================================================
  */
 
-package org.openecomp.vid.scheduler;
+package org.onap.vid.scheduler;
 
 
 public class RestObject<T> {
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/scheduler/RestObjects/RestObject.java b/vid-app-common/src/main/java/org/onap/vid/scheduler/RestObjects/RestObject.java
similarity index 96%
rename from vid-app-common/src/main/java/org/openecomp/vid/scheduler/RestObjects/RestObject.java
rename to vid-app-common/src/main/java/org/onap/vid/scheduler/RestObjects/RestObject.java
index 2d0eec7..ff1ffb4 100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/scheduler/RestObjects/RestObject.java
+++ b/vid-app-common/src/main/java/org/onap/vid/scheduler/RestObjects/RestObject.java
@@ -18,7 +18,7 @@
  * ============LICENSE_END=========================================================
  */
 
-package org.openecomp.vid.scheduler.RestObjects;
+package org.onap.vid.scheduler.RestObjects;
 
 
 public class RestObject<T> {
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/openecomp/vid/scheduler/SchedulerRestInterface.java b/vid-app-common/src/main/java/org/onap/vid/scheduler/SchedulerRestInterface.java
similarity index 85%
rename from vid-app-common/src/main/java/org/openecomp/vid/scheduler/SchedulerRestInterface.java
rename to vid-app-common/src/main/java/org/onap/vid/scheduler/SchedulerRestInterface.java
index 5f529f3..2077e7a 100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/scheduler/SchedulerRestInterface.java
+++ b/vid-app-common/src/main/java/org/onap/vid/scheduler/SchedulerRestInterface.java
@@ -1,4 +1,4 @@
-package org.openecomp.vid.scheduler;
+package org.onap.vid.scheduler;
 
 import java.util.Collections;
 import javax.ws.rs.client.Client;
@@ -12,12 +12,15 @@
 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.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 {
 
@@ -84,7 +87,7 @@
 	}
 		
 	@SuppressWarnings("unchecked")
-	public <T> void Get (T t, String sourceId, String path, org.openecomp.vid.scheduler.RestObject<T> restObject ) throws Exception {
+	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;
@@ -98,7 +101,8 @@
 			 .request()
 	         .accept("application/json")
 	         .headers(commonHeaders)
-	         .get();
+			 .header(requestIdHeaderKey, getHttpServletRequest().getHeader(requestIdHeaderKey))
+			 .get();
 				
 		int status = cres.getStatus();
 		restObject.setStatusCode (status);
@@ -131,7 +135,8 @@
             	 .request()
                  .accept("application/json")
 	        	 .headers(commonHeaders)
-                 .post(Entity.entity(requestDetails, MediaType.APPLICATION_JSON));
+				 .header(requestIdHeaderKey, getHttpServletRequest().getHeader(requestIdHeaderKey))
+				 .post(Entity.entity(requestDetails, MediaType.APPLICATION_JSON));
             
             try {
 	   			t = (T) cres.readEntity(t.getClass());
@@ -164,7 +169,7 @@
 	public void logRequest(JSONObject requestDetails) {}
 
 	@SuppressWarnings("unchecked")
-   	public <T> void Delete(T t, JSONObject requestDetails, String sourceID, String path, RestObject<T> restObject) {
+   	public <T> void Delete(T t, String sourceID, String path, org.onap.vid.scheduler.RestObject<T> restObject) {
 	 
 		String url="";
 		Response cres = null;
@@ -178,8 +183,9 @@
 					 .request()
 			         .accept("application/json")
 	        		 .headers(commonHeaders)
+					 .header(requestIdHeaderKey, getHttpServletRequest().getHeader(requestIdHeaderKey))
 			         //.entity(r)
-			         .build("DELETE", Entity.entity(requestDetails, MediaType.APPLICATION_JSON)).invoke();
+			         .delete();
 			       //  .method("DELETE", Entity.entity(r, MediaType.APPLICATION_JSON));
 			         //.delete(Entity.entity(r, MediaType.APPLICATION_JSON));
 			
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/scheduler/SchedulerRestInterfaceFactory.java b/vid-app-common/src/main/java/org/onap/vid/scheduler/SchedulerRestInterfaceFactory.java
similarity index 85%
rename from vid-app-common/src/main/java/org/openecomp/vid/scheduler/SchedulerRestInterfaceFactory.java
rename to vid-app-common/src/main/java/org/onap/vid/scheduler/SchedulerRestInterfaceFactory.java
index bf7bd88..1c3bea9 100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/scheduler/SchedulerRestInterfaceFactory.java
+++ b/vid-app-common/src/main/java/org/onap/vid/scheduler/SchedulerRestInterfaceFactory.java
@@ -1,5 +1,5 @@
 
-package org.openecomp.vid.scheduler;
+package org.onap.vid.scheduler;
 
 public class SchedulerRestInterfaceFactory {
 
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/openecomp/vid/services/VidServiceImpl.java b/vid-app-common/src/main/java/org/onap/vid/services/VidServiceImpl.java
similarity index 63%
rename from vid-app-common/src/main/java/org/openecomp/vid/services/VidServiceImpl.java
rename to vid-app-common/src/main/java/org/onap/vid/services/VidServiceImpl.java
index f647af4..8196643 100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/services/VidServiceImpl.java
+++ b/vid-app-common/src/main/java/org/onap/vid/services/VidServiceImpl.java
@@ -1,20 +1,20 @@
-package org.openecomp.vid.services;
+package org.onap.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.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.text.DateFormat;
-import java.text.SimpleDateFormat;
-import java.util.*;
+import java.util.Collection;
+import java.util.Map;
+import java.util.UUID;
 
 /**
  * The Class VidController.
@@ -28,7 +28,6 @@
     /**
      * The Constant dateFormat.
      */
-    private final static DateFormat dateFormat = new SimpleDateFormat("HH:mm:ss:SSSS");
     protected final AsdcClient asdcClient;
     @Autowired
     private ToscaParserImpl2 toscaParser;
@@ -61,17 +60,20 @@
         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);
-            }
+            return getServiceModel(uuid, serviceCsar, tosca, asdcServiceMetadata);
         } catch (Exception e) {
-            e.printStackTrace();
+            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/openecomp/vid/services/WorkflowService.java b/vid-app-common/src/main/java/org/onap/vid/services/WorkflowService.java
similarity index 70%
rename from vid-app-common/src/main/java/org/openecomp/vid/services/WorkflowService.java
rename to vid-app-common/src/main/java/org/onap/vid/services/WorkflowService.java
index 7f43433..ea13908 100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/services/WorkflowService.java
+++ b/vid-app-common/src/main/java/org/onap/vid/services/WorkflowService.java
@@ -1,6 +1,6 @@
-package org.openecomp.vid.services;
+package org.onap.vid.services;
 
-import org.openecomp.vid.model.Workflow;
+import org.onap.vid.model.Workflow;
 import java.util.Collection;
 
 public interface WorkflowService {
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/services/WorkflowServiceImpl.java b/vid-app-common/src/main/java/org/onap/vid/services/WorkflowServiceImpl.java
similarity index 94%
rename from vid-app-common/src/main/java/org/openecomp/vid/services/WorkflowServiceImpl.java
rename to vid-app-common/src/main/java/org/onap/vid/services/WorkflowServiceImpl.java
index deb5060..037c49c 100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/services/WorkflowServiceImpl.java
+++ b/vid-app-common/src/main/java/org/onap/vid/services/WorkflowServiceImpl.java
@@ -1,6 +1,6 @@
-package org.openecomp.vid.services;
+package org.onap.vid.services;
 
-import org.openecomp.vid.model.Workflow;
+import org.onap.vid.model.Workflow;
 import org.springframework.stereotype.Service;
 
 import java.util.ArrayList;
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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/java/org/openecomp/vid/model/Resource.java b/vid-app-common/src/main/webapp/app/vid/scripts/directives/serviceMetadata.js
old mode 100755
new mode 100644
similarity index 73%
copy from vid-app-common/src/main/java/org/openecomp/vid/model/Resource.java
copy to vid-app-common/src/main/webapp/app/vid/scripts/directives/serviceMetadata.js
index 4dcc975..1c15f70
--- a/vid-app-common/src/main/java/org/openecomp/vid/model/Resource.java
+++ b/vid-app-common/src/main/webapp/app/vid/scripts/directives/serviceMetadata.js
@@ -1,28 +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=========================================================
- */
-
-package org.openecomp.vid.model;
-
-/**
- * The Class Resource.
- */
-public class Resource {
-
-}
+/*-
+ * ============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/deletionService.js b/vid-app-common/src/main/webapp/app/vid/scripts/services/deleteResumeService.js
old mode 100755
new mode 100644
similarity index 87%
rename from vid-app-common/src/main/webapp/app/vid/scripts/services/deletionService.js
rename to vid-app-common/src/main/webapp/app/vid/scripts/services/deleteResumeService.js
index 7928299..90daf35
--- a/vid-app-common/src/main/webapp/app/vid/scripts/services/deletionService.js
+++ b/vid-app-common/src/main/webapp/app/vid/scripts/services/deleteResumeService.js
@@ -1,508 +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 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 ]);
+/*-
+ * ============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/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/deletionDialog.htm b/vid-app-common/src/main/webapp/app/vid/scripts/view-models/deleteResumeDialog.htm
old mode 100755
new mode 100644
similarity index 88%
rename from vid-app-common/src/main/webapp/app/vid/scripts/view-models/deletionDialog.htm
rename to vid-app-common/src/main/webapp/app/vid/scripts/view-models/deleteResumeDialog.htm
index b4b9316..ccd54a6
--- 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/deleteResumeDialog.htm
@@ -1,70 +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="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>
+<!--
+  ============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/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" %>
   <%
