diff --git a/src/main/java/org/onap/clamp/clds/client/DcaeDispatcherServices.java b/src/main/java/org/onap/clamp/clds/client/DcaeDispatcherServices.java
index e2a4c2f..0f46595 100644
--- a/src/main/java/org/onap/clamp/clds/client/DcaeDispatcherServices.java
+++ b/src/main/java/org/onap/clamp/clds/client/DcaeDispatcherServices.java
@@ -99,7 +99,7 @@
         Date startTime = new Date();
         LoggingUtils.setTargetContext("DCAE", "getOperationStatus");
         try {
-            String responseStr = dcaeHttpConnectionManager.doGeneralHttpQuery(statusUrl, "GET", null, null, "DCAE");
+            String responseStr = dcaeHttpConnectionManager.doGeneralHttpQuery(statusUrl, "GET", null, null, "DCAE", null, null);
             JSONObject jsonObj = parseResponse(responseStr);
             String operationType = (String) jsonObj.get("operationType");
             String status = (String) jsonObj.get(DCAE_STATUS_FIELD);
@@ -190,7 +190,7 @@
         String nodeAttr) throws IOException, ParseException {
         Date startTime = new Date();
         try {
-            String responseStr = dcaeHttpConnectionManager.doGeneralHttpQuery(url, requestMethod, payload, contentType, "DCAE");
+            String responseStr = dcaeHttpConnectionManager.doGeneralHttpQuery(url, requestMethod, payload, contentType, "DCAE", null, null);
             JSONObject jsonObj = parseResponse(responseStr);
             JSONObject linksObj = (JSONObject) jsonObj.get(node);
             String statusUrl = (String) linksObj.get(nodeAttr);
diff --git a/src/main/java/org/onap/clamp/clds/client/DcaeInventoryServices.java b/src/main/java/org/onap/clamp/clds/client/DcaeInventoryServices.java
index 63fdc61..d8bfeea 100644
--- a/src/main/java/org/onap/clamp/clds/client/DcaeInventoryServices.java
+++ b/src/main/java/org/onap/clamp/clds/client/DcaeInventoryServices.java
@@ -207,7 +207,7 @@
         }
         for (int i = 0; i < retryLimit; i++) {
             metricsLogger.info("Attempt n°" + i + " to contact DCAE inventory");
-            String response = httpConnectionManager.doGeneralHttpQuery(fullUrl, "GET", null, null, "DCAE");
+            String response = httpConnectionManager.doGeneralHttpQuery(fullUrl, "GET", null, null, "DCAE", null, null);
             int totalCount = getTotalCountFromDcaeInventoryResponse(response);
             metricsLogger.info("getDcaeInformation complete: totalCount returned=" + totalCount);
             if (totalCount > 0) {
diff --git a/src/main/java/org/onap/clamp/clds/sdc/controller/installer/BlueprintParser.java b/src/main/java/org/onap/clamp/clds/sdc/controller/installer/BlueprintParser.java
index c8de4c5..7447fba 100644
--- a/src/main/java/org/onap/clamp/clds/sdc/controller/installer/BlueprintParser.java
+++ b/src/main/java/org/onap/clamp/clds/sdc/controller/installer/BlueprintParser.java
@@ -27,6 +27,7 @@
 import com.google.gson.JsonArray;
 import com.google.gson.JsonElement;
 import com.google.gson.JsonObject;
+import com.google.gson.JsonParser;
 
 import java.util.Collections;
 import java.util.HashSet;
@@ -51,6 +52,8 @@
     private static final String TYPE = "type";
     private static final String PROPERTIES = "properties";
     private static final String NAME = "name";
+    private static final String POLICYID = "policy_id";
+    private static final String POLICY_TYPEID = "policy_type_id";
     private static final String RELATIONSHIPS = "relationships";
     private static final String CLAMP_NODE_RELATIONSHIPS_GETS_INPUT_FROM = "clamp_node.relationships.gets_input_from";
     private static final String TARGET = "target";
@@ -85,7 +88,7 @@
             }
         }
         String msName = theBiggestMicroServiceKey.toLowerCase().contains(HOLMES_PREFIX) ? HOLMES : TCA;
-        return Collections.singletonList(new MicroService(msName, "", ""));
+        return Collections.singletonList(new MicroService(msName, "", "", "", ""));
     }
 
     String getName(Entry<String, JsonElement> entry) {
@@ -114,10 +117,30 @@
         return "";
     }
 
+    String getModelType(Entry<String, JsonElement> entry) {
+        JsonObject ob = entry.getValue().getAsJsonObject();
+        if (ob.has(PROPERTIES)) {
+            JsonObject properties = ob.get(PROPERTIES).getAsJsonObject();
+            if (properties.has(POLICYID)) {
+                JsonObject policyIdObj = properties.get(POLICYID).getAsJsonObject();
+                if (policyIdObj.has(POLICY_TYPEID)) {
+                   return policyIdObj.get(POLICY_TYPEID).getAsString();
+                }
+            }
+        }
+        return "";
+    }
+
+    String getBlueprintName(Entry<String, JsonElement> entry) {
+        return entry.getKey();
+    }
+
     MicroService getNodeRepresentation(Entry<String, JsonElement> entry) {
         String name = getName(entry);
         String getInputFrom = getInput(entry);
-        return new MicroService(name, getInputFrom, "");
+        String modelType = getModelType(entry);
+        String blueprintName = getBlueprintName(entry);
+        return new MicroService(name, modelType, getInputFrom, "", blueprintName);
     }
 
     private String getTarget(JsonObject elementObject) {
diff --git a/src/main/java/org/onap/clamp/clds/sdc/controller/installer/MicroService.java b/src/main/java/org/onap/clamp/clds/sdc/controller/installer/MicroService.java
index 198bf0e..a785f41 100644
--- a/src/main/java/org/onap/clamp/clds/sdc/controller/installer/MicroService.java
+++ b/src/main/java/org/onap/clamp/clds/sdc/controller/installer/MicroService.java
@@ -27,27 +27,39 @@
 
 public class MicroService {
     private final String name;
+    private final String modelType;
+    private final String blueprintName;
     private final String inputFrom;
     private String mappedNameJpa;
 
-    public MicroService(String name, String inputFrom, String mappedNameJpa) {
+    public MicroService(String name, String modelType, String inputFrom, String mappedNameJpa, String blueprintName) {
         this.name = name;
         this.inputFrom = inputFrom;
         this.mappedNameJpa = mappedNameJpa;
+        this.modelType =  modelType;
+        this.blueprintName = blueprintName;
     }
 
     public String getName() {
         return name;
     }
 
+    public String getModelType() {
+        return modelType;
+    }
+
     public String getInputFrom() {
         return inputFrom;
     }
 
+    public String getBlueprintName() {
+        return blueprintName;
+    }
+
     @Override
     public String toString() {
-        return "MicroService{" + "name='" + name + '\'' + ", inputFrom='" + inputFrom + '\'' + ", mappedNameJpa='"
-            + mappedNameJpa + '\'' + '}';
+        return "MicroService{" + "name='" + name + '\'' + ", modelType='" + modelType + '\'' + ", inputFrom='" + inputFrom + '\'' + ", mappedNameJpa='"
+            + mappedNameJpa + '\'' + ", blueprintName='" + blueprintName + '\'' + '}';
     }
 
     public String getMappedNameJpa() {
@@ -67,11 +79,11 @@
             return false;
         }
         MicroService that = (MicroService) o;
-        return name.equals(that.name) && inputFrom.equals(that.inputFrom) && mappedNameJpa.equals(that.mappedNameJpa);
+        return name.equals(that.name) && modelType.equals(that.modelType) && inputFrom.equals(that.inputFrom) && mappedNameJpa.equals(that.mappedNameJpa) && blueprintName.equals(that.blueprintName);
     }
 
     @Override
     public int hashCode() {
-        return Objects.hash(name, inputFrom, mappedNameJpa);
+        return Objects.hash(name, modelType, inputFrom, mappedNameJpa, blueprintName);
     }
 }
diff --git a/src/main/java/org/onap/clamp/loop/CsarInstallerImpl.java b/src/main/java/org/onap/clamp/loop/CsarInstallerImpl.java
index fed2c65..05d5c48 100644
--- a/src/main/java/org/onap/clamp/loop/CsarInstallerImpl.java
+++ b/src/main/java/org/onap/clamp/loop/CsarInstallerImpl.java
@@ -163,8 +163,8 @@
                 Policy.generatePolicyName(microService.getName(), csar.getSdcNotification().getServiceName(),
                     csar.getSdcNotification().getServiceVersion(),
                     blueprintArtifact.getResourceAttached().getResourceInstanceName(),
-                    blueprintArtifact.getBlueprintArtifactName()),
-                csar.getPolicyModelYaml().orElse(""), false, new HashSet<>(Arrays.asList(newLoop)));
+                    blueprintArtifact.getBlueprintArtifactName()), microService.getModelType(),
+                csar.getPolicyModelYaml().orElse(""), false, new HashSet<>(Arrays.asList(newLoop)), microService.getBlueprintName());
 
             newSet.add(microServicePolicy);
             microService.setMappedNameJpa(microServicePolicy.getName());
diff --git a/src/main/java/org/onap/clamp/loop/Loop.java b/src/main/java/org/onap/clamp/loop/Loop.java
index 6dc73e9..cc04ce5 100644
--- a/src/main/java/org/onap/clamp/loop/Loop.java
+++ b/src/main/java/org/onap/clamp/loop/Loop.java
@@ -183,7 +183,7 @@
         this.operationalPolicies = operationalPolicies;
     }
 
-    Set<MicroServicePolicy> getMicroServicePolicies() {
+    public Set<MicroServicePolicy> getMicroServicePolicies() {
         return microServicePolicies;
     }
 
diff --git a/src/main/java/org/onap/clamp/operation/LoopOperation.java b/src/main/java/org/onap/clamp/operation/LoopOperation.java
index af615af..bdb4b3f 100644
--- a/src/main/java/org/onap/clamp/operation/LoopOperation.java
+++ b/src/main/java/org/onap/clamp/operation/LoopOperation.java
@@ -31,6 +31,7 @@
 import com.google.gson.JsonObject;
 import com.google.gson.JsonPrimitive;
 
+import java.io.IOException;
 import java.lang.reflect.Array;
 import java.util.Collection;
 import java.util.Date;
@@ -40,12 +41,15 @@
 
 import org.apache.camel.Exchange;
 import org.onap.clamp.clds.client.DcaeDispatcherServices;
+import org.onap.clamp.clds.config.ClampProperties;
 import org.onap.clamp.clds.util.LoggingUtils;
 import org.onap.clamp.clds.util.ONAPLogConstants;
 import org.onap.clamp.exception.OperationException;
 import org.onap.clamp.loop.Loop;
 import org.onap.clamp.loop.LoopService;
 import org.onap.clamp.loop.LoopState;
+import org.onap.clamp.policy.PolicyOperation;
+import org.onap.clamp.util.HttpConnectionManager;
 import org.slf4j.event.Level;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.http.HttpStatus;
@@ -63,14 +67,17 @@
     private final DcaeDispatcherServices dcaeDispatcherServices;
     private final LoopService loopService;
     private LoggingUtils util = new LoggingUtils(logger);
+    private PolicyOperation policyOp;
 
     @Autowired
     private HttpServletRequest request;
 
     @Autowired
-    public LoopOperation(LoopService loopService, DcaeDispatcherServices dcaeDispatcherServices) {
+    public LoopOperation(LoopService loopService, DcaeDispatcherServices dcaeDispatcherServices, 
+            ClampProperties refProp, HttpConnectionManager httpConnectionManager, PolicyOperation policyOp) {
         this.loopService = loopService;
         this.dcaeDispatcherServices = dcaeDispatcherServices;
+        this.policyOp =  policyOp;
     }
 
     /**
@@ -209,4 +216,159 @@
         // otherwise take it as a string
         return new JsonPrimitive(String.valueOf(o));
     }
+
+    /**
+     * Submit the Ms policies.
+     *
+     * @param loopName the loop name
+     * @return the updated loop
+     * @throws IOException IO exception
+     * @throws Exceptions during the operation
+     */
+    public Loop submitMsPolicies (String loopName) throws OperationException, IOException {
+        util.entering(request, "LoopOperation: delete microservice policies");
+        Date startTime = new Date();
+        Loop loop = loopService.getLoop(loopName);
+
+        if (loop == null) {
+            String msg = "Submit MS policies exception: Not able to find closed loop:" + loopName;
+            util.exiting(HttpStatus.INTERNAL_SERVER_ERROR.toString(), msg, Level.INFO,
+                ONAPLogConstants.ResponseStatus.ERROR);
+            throw new OperationException(msg);
+        }
+
+        // verify the current closed loop state
+        if (loop.getLastComputedState() != LoopState.SUBMITTED && loop.getLastComputedState() != LoopState.DESIGN) {
+            String msg = "Submit MS policies exception: This closed loop is in state:" + loop.getLastComputedState() 
+                + ". It could be deleted only when it is in SUBMITTED state.";
+            util.exiting(HttpStatus.CONFLICT.toString(), msg, Level.INFO,
+                ONAPLogConstants.ResponseStatus.ERROR);
+            throw new OperationException(msg);
+        }
+
+        // Establish the api call to Policy to create the ms services
+        policyOp.createMsPolicy(loop.getMicroServicePolicies());
+
+        // audit log
+        LoggingUtils.setTimeContext(startTime, new Date());
+        auditLogger.info("Deletion of MS policies completed");
+        util.exiting(HttpStatus.OK.toString(), "Successful", Level.INFO, ONAPLogConstants.ResponseStatus.COMPLETED);
+        return  loop;
+    }
+
+    
+    /**
+     * Delete the Ms policies.
+     *
+     * @param loopName the loop name
+     * @return the updated loop
+     * @throws IOException IO exception
+     * @throws Exceptions during the operation
+     */
+    public Loop deleteMsPolicies (Exchange camelExchange, String loopName) throws OperationException, IOException {
+        util.entering(request, "LoopOperation: delete microservice policies");
+        Date startTime = new Date();
+        Loop loop = loopService.getLoop(loopName);
+
+        if (loop == null) {
+            String msg = "Delete MS policies exception: Not able to find closed loop:" + loopName;
+            util.exiting(HttpStatus.INTERNAL_SERVER_ERROR.toString(), msg, Level.INFO,
+                ONAPLogConstants.ResponseStatus.ERROR);
+            throw new OperationException(msg);
+        }
+
+        // verify the current closed loop state
+        if (loop.getLastComputedState() != LoopState.SUBMITTED) {
+            String msg = "Delete MS policies exception: This closed loop is in state:" + loop.getLastComputedState() 
+                + ". It could be deleted only when it is in SUBMITTED state.";
+            util.exiting(HttpStatus.CONFLICT.toString(), msg, Level.INFO,
+                ONAPLogConstants.ResponseStatus.ERROR);
+            throw new OperationException(msg);
+        }
+
+        // Establish the api call to Policy to create the ms services
+        policyOp.deleteMsPolicy(loop.getMicroServicePolicies());
+
+        // audit log
+        LoggingUtils.setTimeContext(startTime, new Date());
+        auditLogger.info("Deletion of MS policies completed");
+        util.exiting(HttpStatus.OK.toString(), "Successful", Level.INFO, ONAPLogConstants.ResponseStatus.COMPLETED);
+        return  loop;
+    }
+
+    /**
+     * Delete the operational policy.
+     *
+     * @param loopName the loop name
+     * @return the updated loop
+     * @throws Exceptions during the operation
+     */
+    public Loop deleteOpPolicy (Exchange camelExchange, String loopName) throws OperationException {
+        util.entering(request, "LoopOperation: delete guard policy");
+        Date startTime = new Date();
+        Loop loop = loopService.getLoop(loopName);
+
+        if (loop == null) {
+            String msg = "Delete guard policy exception: Not able to find closed loop:" + loopName;
+            util.exiting(HttpStatus.INTERNAL_SERVER_ERROR.toString(), msg, Level.INFO,
+                ONAPLogConstants.ResponseStatus.ERROR);
+            throw new OperationException(msg);
+        }
+
+        // verify the current closed loop state
+        if (loop.getLastComputedState() != LoopState.SUBMITTED) {
+            String msg = "Delete MS policies exception: This closed loop is in state:" + loop.getLastComputedState() 
+                + ". It could be deleted only when it is in SUBMITTED state.";
+            util.exiting(HttpStatus.CONFLICT.toString(), msg, Level.INFO,
+                ONAPLogConstants.ResponseStatus.ERROR);
+            throw new OperationException(msg);
+        }
+
+        // Establish the api call to Policy to delete operational policy
+        //client.deleteOpPolicy();
+
+        // audit log
+        LoggingUtils.setTimeContext(startTime, new Date());
+        auditLogger.info("Deletion of Guard policy completed");
+        util.exiting(HttpStatus.OK.toString(), "Successful", Level.INFO, ONAPLogConstants.ResponseStatus.COMPLETED);
+        return  loop;
+    }
+
+    /**
+     * Delete the Guard policy.
+     *
+     * @param loopName the loop name
+     * @return the updated loop
+     * @throws Exceptions during the operation
+     */
+    public Loop deleteGuardPolicy (Exchange camelExchange, String loopName) throws OperationException {
+        util.entering(request, "LoopOperation: delete operational policy");
+        Date startTime = new Date();
+        Loop loop = loopService.getLoop(loopName);
+
+        if (loop == null) {
+            String msg = "Delete operational policy exception: Not able to find closed loop:" + loopName;
+            util.exiting(HttpStatus.INTERNAL_SERVER_ERROR.toString(), msg, Level.INFO,
+                ONAPLogConstants.ResponseStatus.ERROR);
+            throw new OperationException(msg);
+        }
+
+        // verify the current closed loop state
+        if (loop.getLastComputedState() != LoopState.SUBMITTED) {
+            String msg = "Delete MS policies exception: This closed loop is in state:" + loop.getLastComputedState() 
+                + ". It could be deleted only when it is in SUBMITTED state.";
+            util.exiting(HttpStatus.CONFLICT.toString(), msg, Level.INFO,
+                ONAPLogConstants.ResponseStatus.ERROR);
+            throw new OperationException(msg);
+        }
+
+        // Establish the api call to Policy to delete Guard policy
+        //client.deleteOpPolicy();
+
+        // audit log
+        LoggingUtils.setTimeContext(startTime, new Date());
+        auditLogger.info("Deletion of operational policy completed");
+        util.exiting(HttpStatus.OK.toString(), "Successful", Level.INFO, ONAPLogConstants.ResponseStatus.COMPLETED);
+        return  loop;
+    }
 }
diff --git a/src/main/java/org/onap/clamp/policy/PolicyOperation.java b/src/main/java/org/onap/clamp/policy/PolicyOperation.java
new file mode 100644
index 0000000..592338c
--- /dev/null
+++ b/src/main/java/org/onap/clamp/policy/PolicyOperation.java
@@ -0,0 +1,131 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP CLAMP
+ * ================================================================================
+ * Copyright (C) 2019 AT&T Intellectual Property. All rights
+ *                             reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF 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.clamp.policy;
+
+import java.io.IOException;
+import java.util.Set;
+
+import org.onap.clamp.clds.config.ClampProperties;
+import org.onap.clamp.policy.microservice.MicroServicePolicy;
+import org.onap.clamp.util.HttpConnectionManager;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import com.att.eelf.configuration.EELFLogger;
+import com.att.eelf.configuration.EELFManager;
+import com.google.gson.JsonArray;
+import com.google.gson.JsonObject;
+
+@Component
+public class PolicyOperation {
+    protected static final EELFLogger logger = EELFManager.getInstance().getLogger(PolicyOperation.class);
+    protected static final EELFLogger metricsLogger = EELFManager.getInstance().getMetricsLogger();
+    public static final String POLICY_MSTYPE_PROPERTY_NAME = "policy.ms.type";
+    public static final String POLICY_ONAPNAME_PROPERTY_NAME = "policy.onap.name";
+    public static final String POLICY_BASENAME_PREFIX_PROPERTY_NAME = "policy.base.policyNamePrefix";
+    public static final String POLICY_OP_NAME_PREFIX_PROPERTY_NAME = "policy.op.policyNamePrefix";
+    public static final String POLICY_MS_NAME_PREFIX_PROPERTY_NAME = "policy.ms.policyNamePrefix";
+    public static final String POLICY_OP_TYPE_PROPERTY_NAME = "policy.op.type";
+    public static final String POLICY_GUARD_SUFFIX = "_Guard";
+    public static final String POLICY_URL_PROPERTY_NAME = "clamp.config.policy.url";
+    public static final String POLICY_URL_SUFFIX = "/versions/1.0.0/policies";
+    public static final String POLICY_USER_NAME = "clamp.config.policy.userName";
+    public static final String POLICY_PASSWORD = "clamp.config.policy.password";
+
+    public static final String TOSCA_DEF_VERSION = "tosca_definitions_version";
+    public static final String TOSCA_DEF_VERSION_VALUE = "tosca_simple_yaml_1_0_0";
+    public static final String TEMPLATE = "topology_template";
+    public static final String POLICIES = "policies";
+    public static final String MS_TYPE = "type";
+    public static final String MS_VERSION = "version";
+    public static final String MS_VERSION_VALUE = "1.0.0";
+    public static final String MS_METADATA = "metadata";
+    public static final String MS_POLICY_ID = "policy_id";
+    public static final String MS_PROPERTIES = "properties";
+    public static final String MS_policy = "tca_policy";
+
+    private final ClampProperties refProp;
+    private final HttpConnectionManager httpConnectionManager;
+
+    @Autowired
+    public PolicyOperation(ClampProperties refProp, HttpConnectionManager httpConnectionManager) {
+        this.refProp = refProp;
+        this.httpConnectionManager = httpConnectionManager;
+    }
+
+    public void createMsPolicy(Set<MicroServicePolicy> policyList) throws IOException {
+        // Get policy first? if exist delete???
+        // push pdp group
+        for (MicroServicePolicy msPolicy:policyList) {
+            JsonObject payload = createMsPolicyPayload(msPolicy);
+            String policyType = msPolicy.getModelType();
+            String url = refProp.getStringValue(POLICY_URL_PROPERTY_NAME) + policyType + POLICY_URL_SUFFIX;
+            String userName = refProp.getStringValue(POLICY_USER_NAME);
+            String encodedPass = refProp.getStringValue(POLICY_PASSWORD);
+            httpConnectionManager.doGeneralHttpQuery(url, "POST", payload.toString(), "application/json", "POLICY", userName, encodedPass);
+        }
+    }
+
+    public void deleteMsPolicy(Set<MicroServicePolicy> policyList) throws IOException {
+        for (MicroServicePolicy msPolicy:policyList) {
+            String policyType = msPolicy.getModelType();
+            String url = refProp.getStringValue(POLICY_URL_PROPERTY_NAME) + policyType + POLICY_URL_SUFFIX + "/" + msPolicy.getName();
+            String userName = refProp.getStringValue(POLICY_USER_NAME);
+            String encodedPass = refProp.getStringValue(POLICY_PASSWORD);
+            httpConnectionManager.doGeneralHttpQuery(url, "POST", null, null, "POLICY", userName, encodedPass);
+        }
+    }
+
+    private JsonObject createMsPolicyPayload(MicroServicePolicy microService) {
+        JsonObject policyConfig = new JsonObject();
+        policyConfig.add(MS_policy, microService.getProperties());
+
+        JsonObject properties = new JsonObject();
+        properties.add(MS_policy, policyConfig);
+
+        JsonObject msPolicy = new JsonObject();
+        msPolicy.addProperty(MS_TYPE, microService.getModelType());
+        msPolicy.addProperty(MS_VERSION, MS_VERSION_VALUE);
+        JsonObject metaData = new JsonObject();
+        metaData.addProperty(MS_POLICY_ID, microService.getName());
+        msPolicy.add(MS_METADATA, metaData);
+        msPolicy.add(MS_PROPERTIES, properties);
+
+        JsonObject msPolicyWithName = new JsonObject();
+        msPolicyWithName.add(microService.getName(), msPolicy);
+
+        JsonArray policyArray = new JsonArray();
+        policyArray.add(msPolicyWithName);
+
+        JsonObject template =  new JsonObject();
+        template.add(POLICIES, policyArray);
+
+        JsonObject configPolicy = new JsonObject();
+        configPolicy.addProperty(TOSCA_DEF_VERSION, TOSCA_DEF_VERSION_VALUE);
+        configPolicy.add(TEMPLATE, template);
+
+        return configPolicy;
+    }
+
+}
diff --git a/src/main/java/org/onap/clamp/policy/microservice/MicroServicePolicy.java b/src/main/java/org/onap/clamp/policy/microservice/MicroServicePolicy.java
index 3962a3d..c2c60c9 100644
--- a/src/main/java/org/onap/clamp/policy/microservice/MicroServicePolicy.java
+++ b/src/main/java/org/onap/clamp/policy/microservice/MicroServicePolicy.java
@@ -60,6 +60,14 @@
     private String name;
 
     @Expose
+    @Column(nullable = false, name = "model_type")
+    private String modelType;
+
+    @Expose
+    @Column(nullable = false, name = "blueprint_name")
+    private String blueprintName;
+
+    @Expose
     @Type(type = "json")
     @Column(columnDefinition = "json", name = "properties")
     private JsonObject properties;
@@ -86,34 +94,42 @@
     /**
      * The constructor.
      * @param name The name of the MicroService
+     * @param type The model type of the MicroService
+     * @param blueprintName The name in the blueprint
      * @param policyTosca The policy Tosca of the MicroService
      * @param shared The flag indicate whether the MicroService is shared
      * @param usedByLoops The list of loops that uses this MicroService
      */
-    public MicroServicePolicy(String name, String policyTosca, Boolean shared, Set<Loop> usedByLoops) {
+    public MicroServicePolicy(String name, String modelType, String policyTosca, Boolean shared, Set<Loop> usedByLoops, String blueprintName) {
         this.name = name;
+        this.modelType = modelType;
         this.policyTosca = policyTosca;
         this.shared = shared;
         this.jsonRepresentation = JsonUtils.GSON_JPA_MODEL
             .fromJson(new ToscaYamlToJsonConvertor(null).parseToscaYaml(policyTosca), JsonObject.class);
         this.usedByLoops = usedByLoops;
+        this.blueprintName = blueprintName;
     }
 
     /**
      * The constructor.
      * @param name The name of the MicroService
+     * @param type The model type of the MicroService
+     * @param blueprintName The name in the blueprint
      * @param policyTosca The policy Tosca of the MicroService
      * @param shared The flag indicate whether the MicroService is shared
      * @param jsonRepresentation The UI representation in json format
      * @param usedByLoops The list of loops that uses this MicroService
      */
-    public MicroServicePolicy(String name, String policyTosca, Boolean shared, JsonObject jsonRepresentation,
-        Set<Loop> usedByLoops) {
+    public MicroServicePolicy(String name, String modelType, String policyTosca, Boolean shared, JsonObject jsonRepresentation,
+        Set<Loop> usedByLoops, String blueprintName) {
         this.name = name;
+        this.modelType = modelType;
         this.policyTosca = policyTosca;
         this.shared = shared;
         this.usedByLoops = usedByLoops;
         this.jsonRepresentation = jsonRepresentation;
+        this.blueprintName = blueprintName;
     }
 
     @Override
@@ -121,6 +137,14 @@
         return name;
     }
 
+    public String getModelType() {
+        return modelType;
+    }
+
+    public String getBlueprintName() {
+        return blueprintName;
+    }
+
     public JsonObject getProperties() {
         return properties;
     }
diff --git a/src/main/java/org/onap/clamp/policy/microservice/MicroservicePolicyService.java b/src/main/java/org/onap/clamp/policy/microservice/MicroservicePolicyService.java
index f473d16..f95ad3b 100644
--- a/src/main/java/org/onap/clamp/policy/microservice/MicroservicePolicyService.java
+++ b/src/main/java/org/onap/clamp/policy/microservice/MicroservicePolicyService.java
@@ -66,8 +66,8 @@
     @Transactional
     public MicroServicePolicy getAndUpdateMicroServicePolicy(Loop loop, MicroServicePolicy policy) {
         return repository.findById(policy.getName()).map(p -> updateMicroservicePolicyProperties(p, policy, loop))
-            .orElse(new MicroServicePolicy(policy.getName(), policy.getPolicyTosca(), policy.getShared(),
-                policy.getJsonRepresentation(), Sets.newHashSet(loop)));
+            .orElse(new MicroServicePolicy(policy.getName(), policy.getModelType(), policy.getPolicyTosca(), policy.getShared(),
+                policy.getJsonRepresentation(), Sets.newHashSet(loop), policy.getBlueprintName()));
     }
 
     private MicroServicePolicy updateMicroservicePolicyProperties(MicroServicePolicy oldPolicy,
diff --git a/src/main/java/org/onap/clamp/util/HttpConnectionManager.java b/src/main/java/org/onap/clamp/util/HttpConnectionManager.java
index 9443301..4e97f29 100644
--- a/src/main/java/org/onap/clamp/util/HttpConnectionManager.java
+++ b/src/main/java/org/onap/clamp/util/HttpConnectionManager.java
@@ -27,17 +27,22 @@
 import com.att.eelf.configuration.EELFLogger;
 import com.att.eelf.configuration.EELFManager;
 
+import sun.misc.BASE64Encoder;
+
 import java.io.BufferedReader;
 import java.io.DataOutputStream;
 import java.io.IOException;
 import java.io.InputStreamReader;
 import java.net.HttpURLConnection;
 import java.net.URL;
+import java.security.GeneralSecurityException;
 
 import javax.net.ssl.HttpsURLConnection;
 import javax.ws.rs.BadRequestException;
 
+import org.apache.commons.codec.DecoderException;
 import org.apache.commons.io.IOUtils;
+import org.onap.clamp.clds.util.CryptoUtils;
 import org.onap.clamp.clds.util.LoggingUtils;
 import org.springframework.stereotype.Component;
 
@@ -50,13 +55,15 @@
     protected static final EELFLogger metricsLogger = EELFManager.getInstance().getMetricsLogger();
     private static final String REQUEST_FAILED_LOG = "Request Failed - response payload=";
 
-    private String doHttpsQuery(URL url, String requestMethod, String payload, String contentType, String target) throws IOException {
+    private String doHttpsQuery(URL url, String requestMethod, String payload, String contentType, String target, String userName, String password) throws IOException {
         LoggingUtils utils = new LoggingUtils(logger);
         logger.info("Using HTTPS URL:" + url.toString());
         HttpsURLConnection secureConnection = (HttpsURLConnection) url.openConnection();
         secureConnection = utils.invokeHttps(secureConnection, target, requestMethod);
         secureConnection.setRequestMethod(requestMethod);
-        secureConnection.setRequestProperty("X-ECOMP-RequestID", LoggingUtils.getRequestId());
+        if (userName != null && password != null) {
+            secureConnection.setRequestProperty("Authorization", "Basic " + generateBasicAuth(userName, password));
+        }
         if (payload != null && contentType != null) {
             secureConnection.setRequestProperty("Content-Type", contentType);
             secureConnection.setDoOutput(true);
@@ -84,12 +91,15 @@
         }
     }
 
-    private String doHttpQuery(URL url, String requestMethod, String payload, String contentType, String target) throws IOException {
+    private String doHttpQuery(URL url, String requestMethod, String payload, String contentType, String target, String userName, String password) throws IOException {
         LoggingUtils utils = new LoggingUtils(logger);
         logger.info("Using HTTP URL:" + url);
         HttpURLConnection connection = (HttpURLConnection) url.openConnection();
         connection = utils.invoke(connection, target, requestMethod);
         connection.setRequestMethod(requestMethod);
+        if (userName != null && password != null) {
+            connection.setRequestProperty("Authorization", "Basic " + generateBasicAuth(userName, password));
+        }
         if (payload != null && contentType != null) {
             connection.setRequestProperty("Content-Type", contentType);
             connection.setDoOutput(true);
@@ -134,13 +144,27 @@
      * @throws IOException
      *         In case of issue with the streams
      */
-    public String doGeneralHttpQuery(String url, String requestMethod, String payload, String contentType, String target)
+    public String doGeneralHttpQuery(String url, String requestMethod, String payload, String contentType, String target, String userName, String password)
         throws IOException {
         URL urlObj = new URL(url);
         if (url.contains("https://")) { // Support for HTTPS
-            return doHttpsQuery(urlObj, requestMethod, payload, contentType, target);
+            return doHttpsQuery(urlObj, requestMethod, payload, contentType, target, userName, password);
         } else { // Support for HTTP
-            return doHttpQuery(urlObj, requestMethod, payload, contentType, target);
+            return doHttpQuery(urlObj, requestMethod, payload, contentType, target, userName, password);
         }
     }
+
+    private String generateBasicAuth(String userName, String encodedPassword) {
+        String password = "";
+        try {
+            password = CryptoUtils.decrypt(encodedPassword);
+        } catch (GeneralSecurityException e) {
+            logger.error("Unable to decrypt the password", e);
+        } catch (DecoderException e) {
+            logger.error("Exception caught when decoding the HEX String Key for encryption", e);
+        }
+        BASE64Encoder enc = new sun.misc.BASE64Encoder();
+        String userpassword = userName + ":" + password;
+        return enc.encode( userpassword.getBytes() );
+    }
 }
diff --git a/src/main/resources/META-INF/resources/designer/scripts/CldsModelService.js b/src/main/resources/META-INF/resources/designer/scripts/CldsModelService.js
index a71e6ca..90cdc0d 100644
--- a/src/main/resources/META-INF/resources/designer/scripts/CldsModelService.js
+++ b/src/main/resources/META-INF/resources/designer/scripts/CldsModelService.js
@@ -96,7 +96,7 @@
 		    var def = $q.defer();
 		    var sets = [];
 		    var svcAction = uiAction.toLowerCase();
-		    var svcUrl = "/restservices/clds/v2/loop/" + "action/" + svcAction + "/" + modelName;
+		    var svcUrl = "/restservices/clds/v2/loop/" + svcAction + "/" + modelName;
 
 			$http.put(svcUrl).success(
 				function(data) {
diff --git a/src/main/resources/application-noaaf.properties b/src/main/resources/application-noaaf.properties
index 632856e..f54cbe0 100644
--- a/src/main/resources/application-noaaf.properties
+++ b/src/main/resources/application-noaaf.properties
@@ -135,6 +135,9 @@
 #
 #
 # Configuration Settings for Policy Engine Components
+clamp.config.policy.url=http://localhost:8085/
+clamp.config.policy.userName=test
+clamp.config.policy.password=test
 clamp.config.policy.pdpUrl1=http://policy.api.simpledemo.onap.org:8081/pdp/ , testpdp, alpha123
 clamp.config.policy.pdpUrl2=http://policy.api.simpledemo.onap.org:8081/pdp/ , testpdp, alpha123
 clamp.config.policy.papUrl=http://policy.api.simpledemo.onap.org:8081/pap/ , testpap, alpha123
diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties
index 91c02ef..5b47d32 100644
--- a/src/main/resources/application.properties
+++ b/src/main/resources/application.properties
@@ -150,6 +150,9 @@
 #
 #
 # Configuration Settings for Policy Engine Components
+clamp.config.policy.url=http://policy.api.simpledemo.onap.org:8081/pdp/
+clamp.config.policy.userName=test
+clamp.config.policy.password=test
 clamp.config.policy.pdpUrl1=http://policy.api.simpledemo.onap.org:8081/pdp/ , testpdp, alpha123
 clamp.config.policy.pdpUrl2=http://policy.api.simpledemo.onap.org:8081/pdp/ , testpdp, alpha123
 clamp.config.policy.papUrl=http://policy.api.simpledemo.onap.org:8081/pap/ , testpap, alpha123
diff --git a/src/main/resources/clds/camel/rest/clamp-api-v2.xml b/src/main/resources/clds/camel/rest/clamp-api-v2.xml
index c5828b2..f339d5d 100644
--- a/src/main/resources/clds/camel/rest/clamp-api-v2.xml
+++ b/src/main/resources/clds/camel/rest/clamp-api-v2.xml
@@ -71,6 +71,24 @@
                 <to uri="bean:org.onap.clamp.operation.LoopOperation?method=unDeployLoop(${header.loopName})" />
             </route>
         </put>
+        <put uri="/v2/loop/submit/{loopName}">
+            <route>
+                <to uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'cl','','update')" />
+                <to uri="bean:org.onap.clamp.operation.LoopOperation?method=submitMsPolicies(${header.loopName})" />
+                <!-- <to uri="bean:org.onap.clamp.operation.LoopOperation?method=submitOpPolicy(${header.loopName})" />-->
+                <!--<to uri="bean:org.onap.clamp.operation.LoopOperation?method=submitGuardPolicy(${header.loopName})" /> -->
+            </route>
+        </put>
+        <put uri="/v2/loop/delete/{loopName}"
+            outType="org.onap.clamp.loop.Loop"
+            produces="application/json">
+            <route>
+                <to uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'cl','','update')" />
+                <to uri="bean:org.onap.clamp.operation.LoopOperation?method=deleteMsPolicies(${header.loopName})" />
+                <to uri="bean:org.onap.clamp.operation.LoopOperation?method=deleteOpPolicy(${header.loopName})" />
+                <to uri="bean:org.onap.clamp.operation.LoopOperation?method=deleteGuardPolicy(${header.loopName})" />
+            </route>
+        </put>
     </rest>
 </rests>
 
