diff --git a/adapters/mso-cnf-adapter/pom.xml b/adapters/mso-cnf-adapter/pom.xml
index fb25157..0928da0 100644
--- a/adapters/mso-cnf-adapter/pom.xml
+++ b/adapters/mso-cnf-adapter/pom.xml
@@ -110,11 +110,11 @@
       <groupId>org.springframework.boot</groupId>
       <artifactId>spring-boot-starter-data-jpa</artifactId>
     </dependency>
-    <!--  <dependency>
+    <dependency>
       <groupId>org.springframework.boot</groupId>
       <artifactId>spring-boot-starter-test</artifactId>
       <scope>test</scope>
-    </dependency> -->
+    </dependency>
     <!--  <dependency>
       <groupId>org.onap.so</groupId>
       <artifactId>mso-requests-db</artifactId>
diff --git a/adapters/mso-cnf-adapter/src/main/java/org/onap/so/adapters/cnf/exceptions/ApplicationException.java b/adapters/mso-cnf-adapter/src/main/java/org/onap/so/adapters/cnf/exceptions/ApplicationException.java
new file mode 100644
index 0000000..c950cf6
--- /dev/null
+++ b/adapters/mso-cnf-adapter/src/main/java/org/onap/so/adapters/cnf/exceptions/ApplicationException.java
@@ -0,0 +1,66 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2020 Huawei Technologies Co., Ltd. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF 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.so.adapters.cnf.exceptions;
+
+import static org.onap.so.adapters.cnf.util.CNfAdapterUtil.marshal;
+import org.onap.so.adapters.cnf.model.ErrorResponse;
+import org.springframework.http.ResponseEntity;
+
+public class ApplicationException extends Exception {
+
+    private static final long serialVersionUID = 1L;
+
+    private int errorCode;
+
+    private String errorMsg;
+
+    public ApplicationException(int errorCode, String errorMsg) {
+        this.errorCode = errorCode;
+        this.errorMsg = errorMsg;
+    }
+
+    public int getErrorCode() {
+        return errorCode;
+    }
+
+    public void setErrorCode(int errorCode) {
+        this.errorCode = errorCode;
+    }
+
+    public String getErrorMsg() {
+        return errorMsg;
+    }
+
+    public void setErrorMsg(String errorMsg) {
+        this.errorMsg = errorMsg;
+    }
+
+    public ResponseEntity buildErrorResponse() {
+        String message;
+        try {
+            ErrorResponse err = new ErrorResponse(errorCode, errorMsg);
+            message = marshal(err);
+        } catch (ApplicationException e) {
+            return ResponseEntity.status(500).body("Internal Server Error");
+        }
+        return ResponseEntity.status(errorCode).body(message);
+    }
+}
diff --git a/adapters/mso-cnf-adapter/src/main/java/org/onap/so/adapters/cnf/model/BpmnInstanceRequest.java b/adapters/mso-cnf-adapter/src/main/java/org/onap/so/adapters/cnf/model/BpmnInstanceRequest.java
new file mode 100644
index 0000000..2e76d51
--- /dev/null
+++ b/adapters/mso-cnf-adapter/src/main/java/org/onap/so/adapters/cnf/model/BpmnInstanceRequest.java
@@ -0,0 +1,87 @@
+package org.onap.so.adapters.cnf.model;
+
+import java.util.Map;
+import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+@JsonIgnoreProperties(value = "true")
+public class BpmnInstanceRequest {
+
+    @JsonProperty(value = "modelInvariantId")
+    private String modelInvariantId;
+
+    @JsonProperty(value = "modelVersionId")
+    private String modelVersionId;
+
+    @JsonProperty(value = "k8sRBProfileName")
+    private String k8sRBProfileName;
+
+    @JsonProperty(value = "cloudRegionId")
+    private String cloudRegionId;
+
+    @JsonProperty(value = "vfModuleUUID")
+    private String vfModuleUUID;
+
+    @JsonProperty(value = "labels")
+    private Map<String, String> labels;
+
+    @JsonProperty(value = "overrideValues")
+    private Map<String, String> overrideValues;
+
+    public String getModelInvariantId() {
+        return modelInvariantId;
+    }
+
+    public void setModelInvariantId(String modelInvariantId) {
+        this.modelInvariantId = modelInvariantId;
+    }
+
+    public String getModelVersionId() {
+        return modelVersionId;
+    }
+
+    public void setModelVersionId(String modelVersionId) {
+        this.modelVersionId = modelVersionId;
+    }
+
+    public String getK8sRBProfileName() {
+        return k8sRBProfileName;
+    }
+
+    public void setK8sRBProfileName(String k8sRBProfileName) {
+        this.k8sRBProfileName = k8sRBProfileName;
+    }
+
+    public String getCloudRegionId() {
+        return cloudRegionId;
+    }
+
+    public void setCloudRegionId(String cloudRegionId) {
+        this.cloudRegionId = cloudRegionId;
+    }
+
+    public String getVfModuleUUID() {
+        return vfModuleUUID;
+    }
+
+    public void setVfModuleUUID(String vfModuleUUID) {
+        this.vfModuleUUID = vfModuleUUID;
+    }
+
+    public Map<String, String> getLabels() {
+        return labels;
+    }
+
+    public void setLabels(Map<String, String> labels) {
+        this.labels = labels;
+    }
+
+    public Map<String, String> getOverrideValues() {
+        return overrideValues;
+    }
+
+    public void setOverrideValues(Map<String, String> overrideValues) {
+        this.overrideValues = overrideValues;
+    }
+
+}
diff --git a/adapters/mso-cnf-adapter/src/main/java/org/onap/so/adapters/cnf/model/ErrorResponse.java b/adapters/mso-cnf-adapter/src/main/java/org/onap/so/adapters/cnf/model/ErrorResponse.java
new file mode 100644
index 0000000..135adcc
--- /dev/null
+++ b/adapters/mso-cnf-adapter/src/main/java/org/onap/so/adapters/cnf/model/ErrorResponse.java
@@ -0,0 +1,63 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2020 Huawei Technologies Co., Ltd. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF 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.so.adapters.cnf.model;
+
+public class ErrorResponse {
+
+    private int status;
+
+    private String error;
+
+    private String message;
+
+    public ErrorResponse(int status, String message) {
+        this.status = status;
+        this.message = message;
+        this.error = "Bad Request";
+    }
+
+    public int getStatus() {
+        return status;
+    }
+
+    public void setStatus(int status) {
+        this.status = status;
+    }
+
+    public String getError() {
+        if (status == 500) {
+            this.error = "Internal Server Error";
+        }
+        return error;
+    }
+
+    public void setError(String error) {
+        this.error = error;
+    }
+
+    public String getMessage() {
+        return message;
+    }
+
+    public void setMessage(String message) {
+        this.message = message;
+    }
+}
diff --git a/adapters/mso-cnf-adapter/src/main/java/org/onap/so/adapters/cnf/model/InstanceEntity.java b/adapters/mso-cnf-adapter/src/main/java/org/onap/so/adapters/cnf/model/MulticloudInstanceRequest.java
similarity index 84%
rename from adapters/mso-cnf-adapter/src/main/java/org/onap/so/adapters/cnf/model/InstanceEntity.java
rename to adapters/mso-cnf-adapter/src/main/java/org/onap/so/adapters/cnf/model/MulticloudInstanceRequest.java
index 04f2f9d..b1719cb 100644
--- a/adapters/mso-cnf-adapter/src/main/java/org/onap/so/adapters/cnf/model/InstanceEntity.java
+++ b/adapters/mso-cnf-adapter/src/main/java/org/onap/so/adapters/cnf/model/MulticloudInstanceRequest.java
@@ -5,7 +5,7 @@
 import com.fasterxml.jackson.annotation.JsonProperty;
 
 @JsonIgnoreProperties(value = "true")
-public class InstanceEntity {
+public class MulticloudInstanceRequest {
 
     @JsonProperty(value = "cloud-region")
     private String cloudRegion;
@@ -25,6 +25,9 @@
     @JsonProperty(value = "override-values")
     private Map<String, String> overrideValues;
 
+    @JsonProperty(value = "release-name")
+    private String vfModuleUuid;
+
     public String getCloudRegion() {
         return cloudRegion;
     }
@@ -73,4 +76,12 @@
         this.overrideValues = overrideValues;
     }
 
+    public String getVfModuleUuid() {
+        return vfModuleUuid;
+    }
+
+    public void setVfModuleUuid(String vfModuleUuid) {
+        this.vfModuleUuid = vfModuleUuid;
+    }
+
 }
diff --git a/adapters/mso-cnf-adapter/src/main/java/org/onap/so/adapters/cnf/rest/CnfAdapterRest.java b/adapters/mso-cnf-adapter/src/main/java/org/onap/so/adapters/cnf/rest/CnfAdapterRest.java
index 952edef..b6d50da 100644
--- a/adapters/mso-cnf-adapter/src/main/java/org/onap/so/adapters/cnf/rest/CnfAdapterRest.java
+++ b/adapters/mso-cnf-adapter/src/main/java/org/onap/so/adapters/cnf/rest/CnfAdapterRest.java
@@ -1,27 +1,39 @@
 package org.onap.so.adapters.cnf.rest;
 
+import java.io.File;
+import org.apache.http.HttpEntity;
 import org.apache.http.client.methods.CloseableHttpResponse;
+import org.apache.http.client.methods.HttpDelete;
 import org.apache.http.client.methods.HttpGet;
 import org.apache.http.client.methods.HttpPost;
+import org.apache.http.client.methods.HttpPut;
 import org.apache.http.entity.ContentType;
 import org.apache.http.entity.StringEntity;
+import org.apache.http.entity.mime.HttpMultipartMode;
+import org.apache.http.entity.mime.MultipartEntityBuilder;
+import org.apache.http.entity.mime.content.FileBody;
 import org.apache.http.impl.client.CloseableHttpClient;
 import org.apache.http.impl.client.HttpClients;
 import org.apache.http.util.EntityUtils;
+import org.onap.so.adapters.cnf.model.BpmnInstanceRequest;
 import org.onap.so.adapters.cnf.model.ConfigTemplateEntity;
 import org.onap.so.adapters.cnf.model.ConfigurationEntity;
+import org.onap.so.adapters.cnf.model.ConfigurationRollbackEntity;
 import org.onap.so.adapters.cnf.model.ConnectivityInfo;
-import org.onap.so.adapters.cnf.model.InstanceEntity;
+import org.onap.so.adapters.cnf.model.MulticloudInstanceRequest;
 import org.onap.so.adapters.cnf.model.ProfileEntity;
 import org.onap.so.adapters.cnf.model.ResourceBundleEntity;
+import org.onap.so.adapters.cnf.model.Tag;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 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.ResponseBody;
 import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.multipart.MultipartFile;
 import com.fasterxml.jackson.databind.ObjectMapper;
 import com.fasterxml.jackson.databind.SerializationFeature;
 
@@ -32,14 +44,14 @@
     private final CloseableHttpClient httpClient = HttpClients.createDefault();
 
     @ResponseBody
-    @RequestMapping(value = {"/api/multicloud-k8s/v1/healthcheck"}, method = RequestMethod.GET,
+    @RequestMapping(value = {"/api/cnf-adapter/v1/healthcheck"}, method = RequestMethod.GET,
             produces = "application/json")
     public String healthCheck() throws Exception {
 
         logger.info("health check called.");
 
         // TODO
-        HttpGet req = new HttpGet("https://localhost:32780/api/multicloud-k8s/v1/healthcheck");
+        HttpGet req = new HttpGet("http://172.17.0.2:31770/v1/healthcheck");
         try (CloseableHttpResponse response = httpClient.execute(req)) {
             logger.info("response:" + response.getEntity());
             return EntityUtils.toString(response.getEntity());
@@ -47,7 +59,7 @@
     }
 
     @ResponseBody
-    @RequestMapping(value = {"/api/multicloud-k8s/v1/v1/rb/definition"}, method = RequestMethod.POST,
+    @RequestMapping(value = {"/api/cnf-adapter/v1/v1/rb/definition"}, method = RequestMethod.POST,
             produces = "application/json")
     public String createRB(@RequestBody ResourceBundleEntity rB) throws Exception {
 
@@ -55,7 +67,7 @@
 
         // TODO
         // Below URL should be changed as appropriate multicloud URL.
-        HttpPost post = new HttpPost("https://localhost:32780/api/multicloud-k8s/v1/v1/rb/definition");
+        HttpPost post = new HttpPost("http://172.17.0.2:31770/v1/rb/definition");
         ObjectMapper objectMapper = new ObjectMapper();
         objectMapper.configure(SerializationFeature.FAIL_ON_EMPTY_BEANS, false);
         String requestBody = objectMapper.writeValueAsString(rB);
@@ -70,8 +82,8 @@
     }
 
     @ResponseBody
-    @RequestMapping(value = {"/api/multicloud-k8s/v1/v1/rb/definition/{rb-name}/{rb-version}"},
-            method = RequestMethod.GET, produces = "application/json")
+    @RequestMapping(value = {"/api/cnf-adapter/v1/v1/rb/definition/{rb-name}/{rb-version}"}, method = RequestMethod.GET,
+            produces = "application/json")
     public String getRB(@PathVariable("rb-name") String rbName, @PathVariable("rb-version") String rbVersion)
             throws Exception {
 
@@ -79,8 +91,7 @@
 
         // TODO
         // Below URL should be changed as appropriate multicloud URL.
-        HttpGet req = new HttpGet(
-                "https://localhost:32780/api/multicloud-k8s/v1/v1/rb/definition/" + rbName + "/" + rbVersion);
+        HttpGet req = new HttpGet("http://172.17.0.2:31770/v1/rb/definition/" + rbName + "/" + rbVersion);
         try (CloseableHttpResponse response = httpClient.execute(req)) {
             logger.info("response:" + response.getEntity());
             return EntityUtils.toString(response.getEntity());
@@ -88,7 +99,93 @@
     }
 
     @ResponseBody
-    @RequestMapping(value = {"/api/multicloud-k8s/v1/v1/rb/definition/{rb-name}/{rb-version}/profile"},
+    @RequestMapping(value = {"/api/cnf-adapter/v1/v1/rb/definition/{rb-name}/{rb-version}"},
+            method = RequestMethod.DELETE, produces = "application/json")
+    public String deleteRB(@PathVariable("rb-name") String rbName, @PathVariable("rb-version") String rbVersion)
+            throws Exception {
+
+        logger.info("delete RB called.");
+
+        // TODO
+        // Below URL should be changed as appropriate multicloud URL.
+        HttpDelete req = new HttpDelete("http://172.17.0.2:31770/v1/rb/definition/" + rbName + "/" + rbVersion);
+
+        try (CloseableHttpResponse response = httpClient.execute(req)) {
+            logger.info("response:" + response.getEntity());
+            return EntityUtils.toString(response.getEntity());
+        }
+
+    }
+
+    @ResponseBody
+    @RequestMapping(value = {"/api/cnf-adapter/v1/v1/rb/definition/{rb-name}"}, method = RequestMethod.GET,
+            produces = "application/json")
+    public String getListOfRB(@PathVariable("rb-name") String rbName) throws Exception {
+
+        logger.info("getListOfRB called.");
+
+        // TODO
+        // Below URL should be changed as appropriate multicloud URL.
+        HttpGet req = new HttpGet("http://172.17.0.2:31770/v1/rb/definition/" + rbName);
+
+        try (CloseableHttpResponse response = httpClient.execute(req)) {
+            logger.info("response:" + response.getEntity());
+            return EntityUtils.toString(response.getEntity());
+        }
+
+    }
+
+    @ResponseBody
+    @RequestMapping(value = {"/api/cnf-adapter/v1/v1/rb/definition"}, method = RequestMethod.GET,
+            produces = "application/json")
+    public String getListOfRBWithoutUsingRBName() throws Exception {
+
+        logger.info("getListOfRBWithoutUsingRBName called.");
+
+        // TODO
+        // Below URL should be changed as appropriate multicloud URL.
+        HttpGet req = new HttpGet("http://172.17.0.2:31770/v1/rb/definition");
+
+        try (CloseableHttpResponse response = httpClient.execute(req)) {
+            logger.info("response:" + response.getEntity());
+            return EntityUtils.toString(response.getEntity());
+        }
+
+    }
+
+    @ResponseBody
+    @RequestMapping(value = {"/api/cnf-adapter/v1/v1/rb/definition/{rb-name}/{rb-version}/content"},
+            method = RequestMethod.POST, produces = "multipart/form-data")
+    public String uploadArtifactForRB(@RequestParam("file") MultipartFile file, @PathVariable("rb-name") String rbName,
+            @PathVariable("rb-version") String rbVersion) throws Exception {
+
+        logger.info("Upload  Artifact For RB called.");
+
+        File convFile = new File(file.getOriginalFilename());
+        file.transferTo(convFile);
+        FileBody fileBody = new FileBody(convFile, ContentType.DEFAULT_BINARY);
+        MultipartEntityBuilder builder = MultipartEntityBuilder.create();
+        builder.setMode(HttpMultipartMode.BROWSER_COMPATIBLE);
+        builder.addPart("file", fileBody);
+        HttpEntity entity = builder.build();
+
+        // TODO
+        // Below URL should be changed as appropriate multicloud URL.
+        HttpPost post =
+                new HttpPost("http://172.17.0.2:31770/v1/rb/definition/" + rbName + "/" + rbVersion + "/content");
+        post.setHeader("Content-Type", "multipart/form-data");
+        logger.info(String.valueOf(post));
+        post.setEntity(entity);
+
+        try (CloseableHttpClient httpClient = HttpClients.createDefault();
+                CloseableHttpResponse response = httpClient.execute(post)) {
+            logger.info("response:" + response.getEntity());
+            return EntityUtils.toString(response.getEntity());
+        }
+    }
+
+    @ResponseBody
+    @RequestMapping(value = {"/api/cnf-adapter/v1/v1/rb/definition/{rb-name}/{rb-version}/profile"},
             method = RequestMethod.POST, produces = "application/json")
     public String createProfile(@RequestBody ProfileEntity fE, @PathVariable("rb-name") String rbName,
             @PathVariable("rb-version") String rbVersion) throws Exception {
@@ -97,8 +194,8 @@
 
         // TODO
         // Below URL should be changed as appropriate multicloud URL.
-        HttpPost post = new HttpPost("http://localhost:32780/api/multicloud-k8s/v1/v1/rb/definition/" + rbName + "/"
-                + rbVersion + "/profile");
+        HttpPost post =
+                new HttpPost("http://172.17.0.2:31770/v1/rb/definition/" + rbName + "/" + rbVersion + "/profile");
         ObjectMapper objectMapper = new ObjectMapper();
         String requestBody = objectMapper.writeValueAsString(fE);
         StringEntity requestEntity = new StringEntity(requestBody, ContentType.APPLICATION_JSON);
@@ -112,7 +209,7 @@
     }
 
     @ResponseBody
-    @RequestMapping(value = {"/api/multicloud-k8s/v1/v1/rb/definition/{rb-name}/{rb-version}/profile/{pr-name}"},
+    @RequestMapping(value = {"/api/cnf-adapter/v1/v1/rb/definition/{rb-name}/{rb-version}/profile/{pr-name}"},
             method = RequestMethod.GET, produces = "application/json")
     public String getProfile(@PathVariable("rb-name") String rbName, @PathVariable("rb-version") String rbVersion,
             @PathVariable("pr-name") String prName) throws Exception {
@@ -121,8 +218,8 @@
 
         // TODO
         // Below URL should be changed as appropriate multicloud URL.
-        HttpGet req = new HttpGet("https://localhost:32780/api/multicloud-k8s/v1/v1/rb/definition/" + rbName + "/"
-                + rbVersion + "/profile/" + prName);
+        HttpGet req = new HttpGet(
+                "http://172.17.0.2:31770/v1/rb/definition/" + rbName + "/" + rbVersion + "/profile/" + prName);
 
         try (CloseableHttpResponse response = httpClient.execute(req)) {
             logger.info("response:" + response.getEntity());
@@ -131,18 +228,130 @@
     }
 
     @ResponseBody
-    @RequestMapping(value = {"/api/multicloud-k8s/v1/v1/instance"}, method = RequestMethod.POST,
+    @RequestMapping(value = {"/api/cnf-adapter/v1/v1/rb/definition/{rb-name}/{rb-version}/profile"},
+            method = RequestMethod.GET, produces = "application/json")
+    public String getListOfProfile(@PathVariable("rb-name") String rbName, @PathVariable("rb-version") String rbVersion)
+            throws Exception {
+
+        logger.info("getListOfProfile called.");
+
+        // TODO
+        // Below URL should be changed as appropriate multicloud URL.
+        HttpGet req = new HttpGet("http://172.17.0.2:31770/v1/rb/definition/" + rbName + "/" + rbVersion + "/profile");
+
+        try (CloseableHttpResponse response = httpClient.execute(req)) {
+            logger.info("response:" + response.getEntity());
+            return EntityUtils.toString(response.getEntity());
+        }
+    }
+
+    @ResponseBody
+    @RequestMapping(value = {"/api/cnf-adapter/v1/v1/rb/definition/{rb-name}/{rb-version}/profile/{pr-name}"},
+            method = RequestMethod.DELETE, produces = "application/json")
+    public String deleteProfile(@PathVariable("rb-name") String rbName, @PathVariable("rb-version") String rbVersion,
+            @PathVariable("pr-name") String prName) throws Exception {
+
+        logger.info("delete Profile called.");
+
+        // TODO
+        // Below URL should be changed as appropriate multicloud URL.
+        HttpDelete req = new HttpDelete(
+                "http://172.17.0.2:31770/v1/rb/definition/" + rbName + "/" + rbVersion + "/profile/" + prName);
+
+        try (CloseableHttpResponse response = httpClient.execute(req)) {
+            logger.info("response:" + response.getEntity());
+            return EntityUtils.toString(response.getEntity());
+        }
+
+    }
+
+    @ResponseBody
+    @RequestMapping(value = {"/api/cnf-adapter/v1/v1/rb/definition/{rb-name}/{rb-version}/profile/{pr-name}/content"},
+            method = RequestMethod.POST, produces = "multipart/form-data")
+    public String uploadArtifactForProfile(@RequestParam("file") MultipartFile file,
+            @PathVariable("rb-name") String rbName, @PathVariable("rb-version") String rbVersion,
+            @PathVariable("pr-name") String prName) throws Exception {
+
+        logger.info("Upload  Artifact For Profile called.");
+
+        File convFile = new File(file.getOriginalFilename());
+        file.transferTo(convFile);
+        FileBody fileBody = new FileBody(convFile, ContentType.DEFAULT_BINARY);
+        MultipartEntityBuilder builder = MultipartEntityBuilder.create();
+        builder.setMode(HttpMultipartMode.BROWSER_COMPATIBLE);
+        builder.addPart("file", fileBody);
+        HttpEntity entity = builder.build();
+
+        // TODO
+        // Below URL should be changed as appropriate multicloud URL.
+        HttpPost post = new HttpPost("http://172.17.0.2:31770/v1/rb/definition/" + rbName + "/" + rbVersion
+                + "/profile/" + prName + "/content");
+        post.setHeader("Content-Type", "multipart/form-data");
+
+        logger.info(String.valueOf(post));
+        post.setEntity(entity);
+
+        try (CloseableHttpClient httpClient = HttpClients.createDefault();
+                CloseableHttpResponse response = httpClient.execute(post)) {
+            logger.info("response:" + response.getEntity());
+            return EntityUtils.toString(response.getEntity());
+        }
+    }
+
+    @ResponseBody
+    @RequestMapping(value = {"/api/cnf-adapter/v1/v1/instance"}, method = RequestMethod.POST,
             produces = "application/json")
-    public String createInstance(@RequestBody InstanceEntity iE) throws Exception {
+    public String createInstance(@RequestBody BpmnInstanceRequest bpmnInstanceRequest) throws Exception {
+
+        logger.info("create Instance called.");
+
+        MulticloudInstanceRequest multicloudInstanceRequest = new MulticloudInstanceRequest();
+
+        if (bpmnInstanceRequest.getK8sRBProfileName() != null) {
+            multicloudInstanceRequest.setCloudRegion(bpmnInstanceRequest.getCloudRegionId());
+            multicloudInstanceRequest.setLabels(bpmnInstanceRequest.getLabels());
+            multicloudInstanceRequest.setOverrideValues(bpmnInstanceRequest.getOverrideValues());
+            multicloudInstanceRequest.setProfileName(bpmnInstanceRequest.getK8sRBProfileName());
+            multicloudInstanceRequest.setRbName(bpmnInstanceRequest.getModelInvariantId());
+            multicloudInstanceRequest.setRbVersion(bpmnInstanceRequest.getModelVersionId());
+            multicloudInstanceRequest.setVfModuleUuid(bpmnInstanceRequest.getVfModuleUUID());
+        } else {
+
+            logger.info("K8sRBProfileName is required");
+            return "K8sRBProfileName is required";
+        }
+
+        // TODO
+        // Below URL should be changed as appropriate multicloud URL.
+        HttpPost post = new HttpPost("http://172.17.0.2:31770/v1/instance");
+        ObjectMapper objectMapper = new ObjectMapper();
+
+        String requestBody = objectMapper.writeValueAsString(multicloudInstanceRequest);
+        StringEntity requestEntity = new StringEntity(requestBody, ContentType.APPLICATION_JSON);
+        post.setEntity(requestEntity);
+
+        try (CloseableHttpClient httpClient = HttpClients.createDefault();
+                CloseableHttpResponse response = httpClient.execute(post)) {
+            logger.info("response:" + response.getEntity());
+            return EntityUtils.toString(response.getEntity());
+        }
+    }
+
+    // This api is not enabled in multicloud project ,but this is required in
+    // future.
+    @ResponseBody
+    @RequestMapping(value = {"/api/cnf-adapter/v1/v1/instance/{vnfInstanceId}"}, method = RequestMethod.PUT,
+            produces = "application/json")
+    public String updateInstance(@RequestBody MulticloudInstanceRequest iE,
+            @PathVariable("vnfInstanceId") String instanceId) throws Exception {
 
         logger.info("create Instance called.");
 
         // TODO
         // Below URL should be changed as appropriate multicloud URL.
-        HttpPost post = new HttpPost("https://localhost:32780/api/multicloud-k8s/v1/v1/instance");
+        HttpPut post = new HttpPut("http://172.17.0.2:31770/v1/instance/" + instanceId);
         ObjectMapper objectMapper = new ObjectMapper();
 
-        objectMapper.configure(SerializationFeature.FAIL_ON_EMPTY_BEANS, false);
         String requestBody = objectMapper.writeValueAsString(iE);
         StringEntity requestEntity = new StringEntity(requestBody, ContentType.APPLICATION_JSON);
         post.setEntity(requestEntity);
@@ -155,14 +364,15 @@
     }
 
     @ResponseBody
-    @RequestMapping(value = {"/api/multicloud-k8s/v1/v1/instance/{instID}"}, method = RequestMethod.GET,
+    @RequestMapping(value = {"/api/cnf-adapter/v1/v1/instance/{instID}"}, method = RequestMethod.GET,
             produces = "application/json")
     public String getInstance(@PathVariable("instID") String instanceId) throws Exception {
 
         logger.info("get Instance called.");
+
         // TODO
         // Below URL should be changed as appropriate multicloud URL.
-        HttpGet req = new HttpGet("https://localhost:32780/api/multicloud-k8s/v1/v1/instance/" + instanceId);
+        HttpGet req = new HttpGet("http://172.17.0.2:31770/v1/instance/" + instanceId);
 
         try (CloseableHttpResponse response = httpClient.execute(req)) {
             logger.info("response:" + response.getEntity());
@@ -171,8 +381,62 @@
     }
 
     @ResponseBody
-    @RequestMapping(
-            value = {"/api/multicloud-k8s/v1/v1/definition/{rb-name}/{rb-version}/profile/{profile-name}/config"},
+    @RequestMapping(value = {"/api/cnf-adapter/v1/v1/instance/{instID}/status"}, method = RequestMethod.GET,
+            produces = "application/json")
+    public String getInstanceStatus(@PathVariable("instID") String instanceId) throws Exception {
+
+        logger.info("getInstanceStatus called.");
+
+        // TODO
+        // Below URL should be changed as appropriate multicloud URL.
+        HttpGet req = new HttpGet("http://172.17.0.2:31770/v1/instance/" + instanceId + "/status");
+
+        try (CloseableHttpResponse response = httpClient.execute(req)) {
+            logger.info("response:" + response.getEntity());
+            return EntityUtils.toString(response.getEntity());
+        }
+    }
+
+    @RequestMapping(value = {"/api/cnf-adapter/v1/v1/instance"}, method = RequestMethod.GET,
+            produces = "application/json")
+    public String getInstanceBasedOnRBNameOrRBVersionOrProfileName(
+            @RequestParam(value = "rb-name", required = false) String rbName,
+            @RequestParam(value = "rb-version", required = false) String rbVersion,
+            @RequestParam(value = "profile-name", required = false) String profileName) throws Exception {
+
+        logger.info("getInstanceBasedOnRBNameOrRBVersionOrProfileName called.");
+
+        // TODO
+        // Below URL should be changed as appropriate multicloud URL.
+        HttpGet req = new HttpGet("http://172.17.0.2:31770/v1/instance?rb-name=" + rbName + "&rb-version=" + rbVersion
+                + "&profile-name=" + profileName);
+
+        try (CloseableHttpResponse response = httpClient.execute(req)) {
+            logger.info("response:" + response.getEntity());
+            return EntityUtils.toString(response.getEntity());
+        }
+    }
+
+    @ResponseBody
+    @RequestMapping(value = {"/api/cnf-adapter/v1/v1/instance/{instID}"}, method = RequestMethod.DELETE,
+            produces = "application/json")
+    public String deleteInstance(@PathVariable("instID") String instanceID) throws Exception {
+
+        logger.info("delete Instance called.");
+
+        // TODO
+        // Below URL should be changed as appropriate multicloud URL.
+        HttpDelete req = new HttpDelete("http://172.17.0.2:31770/v1/instance/" + instanceID);
+
+        try (CloseableHttpResponse response = httpClient.execute(req)) {
+            logger.info("response:" + response.getEntity());
+            return EntityUtils.toString(response.getEntity());
+        }
+
+    }
+
+    @ResponseBody
+    @RequestMapping(value = {"/api/cnf-adapter/v1/v1/definition/{rb-name}/{rb-version}/profile/{profile-name}/config"},
             method = RequestMethod.POST, produces = "application/json")
     public String createConfiguration(@RequestBody ConfigurationEntity cE, @PathVariable("rb-name") String rbName,
             @PathVariable("rb-version") String rbVersion, @PathVariable("profile-name") String prName)
@@ -182,8 +446,8 @@
 
         // TODO
         // Below URL should be changed as appropriate multicloud URL.
-        HttpPost post = new HttpPost("https://localhost:32780/api/multicloud-k8s/v1/v1/definition/" + rbName + "/"
-                + rbVersion + "/profile/" + prName + "/config");
+        HttpPost post = new HttpPost(
+                "http://172.17.0.2:31770/v1/definition/" + rbName + "/" + rbVersion + "/profile/" + prName + "/config");
         ObjectMapper objectMapper = new ObjectMapper();
         String requestBody = objectMapper.writeValueAsString(cE);
         StringEntity requestEntity = new StringEntity(requestBody, ContentType.APPLICATION_JSON);
@@ -198,7 +462,7 @@
 
     @ResponseBody
     @RequestMapping(value = {
-            "/api/multicloud-k8s/v1/v1/definition/{rb-name}/{rb-version}/profile/{profile-name}/config/{cfg-name}"},
+            "/api/cnf-adapter/v1/v1/definition/{rb-name}/{rb-version}/profile/{profile-name}/config/{cfg-name}"},
             method = RequestMethod.GET, produces = "application/json")
     public String getConfiguration(@PathVariable("rb-name") String rbName, @PathVariable("rb-version") String rbVersion,
             @PathVariable("profile-name") String prName, @PathVariable("cfg-name") String cfgName) throws Exception {
@@ -207,8 +471,8 @@
 
         // TODO
         // Below URL should be changed as appropriate multicloud URL.
-        HttpGet req = new HttpGet("https://localhost:32780/api/multicloud-k8s/v1/v1/definition/" + rbName + "/"
-                + rbVersion + "/profile/" + prName + "/config/" + cfgName);
+        HttpGet req = new HttpGet("http://172.17.0.2:31770/v1/definition/" + rbName + "/" + rbVersion + "/profile/"
+                + prName + "/config/" + cfgName);
 
         try (CloseableHttpResponse response = httpClient.execute(req)) {
             logger.info("response:" + response.getEntity());
@@ -217,7 +481,79 @@
     }
 
     @ResponseBody
-    @RequestMapping(value = {"/api/multicloud-k8s/v1/v1/connectivity-info"}, method = RequestMethod.POST,
+    @RequestMapping(value = {
+            "/api/cnf-adapter/v1/v1/definition/{rb-name}/{rb-version}/profile/{profile-name}/config/{cfg-name}"},
+            method = RequestMethod.DELETE, produces = "application/json")
+    public String deleteConfiguration(@PathVariable("rb-name") String rbName,
+            @PathVariable("rb-version") String rbVersion, @PathVariable("profile-name") String prName,
+            @PathVariable("cfg-name") String cfgName) throws Exception {
+
+        logger.info("delete Configuration called.");
+
+        // TODO
+        // Below URL should be changed as appropriate multicloud URL.
+        HttpDelete req = new HttpDelete("http://172.17.0.2:31770/v1/definition/" + rbName + "/" + rbVersion
+                + "/profile/" + prName + "/config/" + cfgName);
+
+        try (CloseableHttpResponse response = httpClient.execute(req)) {
+            logger.info("response:" + response.getEntity());
+            return EntityUtils.toString(response.getEntity());
+        }
+
+    }
+
+    @ResponseBody
+    @RequestMapping(value = {
+            "/api/cnf-adapter/v1/v1/definition/{rb-name}/{rb-version}/profile/{profile-name}/config/{cfg-name}"},
+            method = RequestMethod.PUT, produces = "application/json")
+    public String updateConfiguration(@RequestBody ConfigurationEntity cE, @PathVariable("rb-name") String rbName,
+            @PathVariable("rb-version") String rbVersion, @PathVariable("profile-name") String prName,
+            @PathVariable("cfg-name") String cfgName) throws Exception {
+
+        logger.info("update Configuration called.");
+
+        // TODO
+        // Below URL should be changed as appropriate multicloud URL.
+        HttpPut post = new HttpPut("http://172.17.0.2:31770/v1/definition/" + rbName + "/" + rbVersion + "/profile/"
+                + prName + "/config/" + cfgName);
+        ObjectMapper objectMapper = new ObjectMapper();
+        String requestBody = objectMapper.writeValueAsString(cE);
+        StringEntity requestEntity = new StringEntity(requestBody, ContentType.APPLICATION_JSON);
+        post.setEntity(requestEntity);
+
+        try (CloseableHttpClient httpClient = HttpClients.createDefault();
+                CloseableHttpResponse response = httpClient.execute(post)) {
+            logger.info("response:" + response.getEntity());
+            return EntityUtils.toString(response.getEntity());
+        }
+    }
+
+    @ResponseBody
+    @RequestMapping(value = {"/api/cnf-adapter/v1/v1/definition/{rb-name}/{rb-version}/profile/{profile-name}/tagit"},
+            method = RequestMethod.POST, produces = "application/json")
+    public String tagConfigurationValue(@RequestBody Tag tag, @PathVariable("rb-name") String rbName,
+            @PathVariable("rb-version") String rbVersion, @PathVariable("pr-name") String prName) throws Exception {
+        logger.info("Tag Configuration called.");
+
+        // TODO
+        // Below URL should be changed as appropriate multicloud URL.
+        HttpPost post = new HttpPost("http://172.17.0.2:31770/v1/definition/" + rbName + "/" + rbVersion + "/profile/"
+                + prName + "/config/tagit");
+
+        ObjectMapper objectMapper = new ObjectMapper();
+        String requestBody = objectMapper.writeValueAsString(tag);
+        StringEntity requestEntity = new StringEntity(requestBody, ContentType.APPLICATION_JSON);
+        post.setEntity(requestEntity);
+
+        try (CloseableHttpClient httpClient = HttpClients.createDefault();
+                CloseableHttpResponse response = httpClient.execute(post)) {
+            logger.info("response:" + response.getEntity());
+            return EntityUtils.toString(response.getEntity());
+        }
+    }
+
+    @ResponseBody
+    @RequestMapping(value = {"/api/cnf-adapter/v1/v1/connectivity-info"}, method = RequestMethod.POST,
             produces = "application/json")
     public String createConnectivityInfo(@RequestBody ConnectivityInfo cIE) throws Exception {
 
@@ -225,7 +561,7 @@
 
         // TODO
         // Below URL should be changed as appropriate multicloud URL.
-        HttpPost post = new HttpPost("https://localhost:32780/api/multicloud-k8s/v1/v1/connectivity-info");
+        HttpPost post = new HttpPost("http://172.17.0.2:31770/v1/connectivity-info");
         ObjectMapper objectMapper = new ObjectMapper();
         String requestBody = objectMapper.writeValueAsString(cIE);
         StringEntity requestEntity = new StringEntity(requestBody, ContentType.APPLICATION_JSON);
@@ -239,7 +575,7 @@
     }
 
     @ResponseBody
-    @RequestMapping(value = {"/api/multicloud-k8s/v1/v1/connectivity-info/{connname}"}, method = RequestMethod.GET,
+    @RequestMapping(value = {"/api/cnf-adapter/v1/v1/connectivity-info/{connname}"}, method = RequestMethod.GET,
             produces = "application/json")
     public String getConnectivityInfo(@PathVariable("connname") String connName) throws Exception {
 
@@ -247,7 +583,7 @@
 
         // TODO
         // Below URL should be changed as appropriate multicloud URL.
-        HttpGet req = new HttpGet("https://localhost:32780/api/multicloud-k8s/v1/v1/connectivity-info/" + connName);
+        HttpGet req = new HttpGet("http://172.17.0.2:31770/v1/connectivity-info/" + connName);
 
         try (CloseableHttpResponse response = httpClient.execute(req)) {
             logger.info("response:" + response.getEntity());
@@ -256,7 +592,25 @@
     }
 
     @ResponseBody
-    @RequestMapping(value = {"/api/multicloud-k8s/v1/v1/rb/definition/{rb-name}/{rb-version}/config-template"},
+    @RequestMapping(value = {"/api/cnf-adapter/v1/v1/connectivity-info/{connname}"}, method = RequestMethod.DELETE,
+            produces = "application/json")
+    public String deleteConnectivityInfo(@PathVariable("connname") String connName) throws Exception {
+
+        logger.info("delete Connectivity Info called.");
+
+        // TODO
+        // Below URL should be changed as appropriate multicloud URL.
+        HttpDelete req = new HttpDelete("http://172.17.0.2:31770/v1/connectivity-info/" + connName);
+
+        try (CloseableHttpResponse response = httpClient.execute(req)) {
+            logger.info("response:" + response.getEntity());
+            return EntityUtils.toString(response.getEntity());
+        }
+
+    }
+
+    @ResponseBody
+    @RequestMapping(value = {"/api/cnf-adapter/v1/v1/rb/definition/{rb-name}/{rb-version}/config-template"},
             method = RequestMethod.POST, produces = "application/json")
     public String createConfigTemplate(@RequestBody ConfigTemplateEntity tE, @PathVariable("rb-name") String rbName,
             @PathVariable("rb-version") String rbVersion) throws Exception {
@@ -265,8 +619,8 @@
 
         // TODO
         // Below URL should be changed as appropriate multicloud URL.
-        HttpPost post = new HttpPost("http://localhost:32780/api/multicloud-k8s/v1/v1/rb/definition/" + rbName + "/"
-                + rbVersion + "/config-template");
+        HttpPost post = new HttpPost(
+                "http://172.17.0.2:31770/v1/rb/definition/" + rbName + "/" + rbVersion + "/config-template");
         ObjectMapper objectMapper = new ObjectMapper();
         String requestBody = objectMapper.writeValueAsString(tE);
         StringEntity requestEntity = new StringEntity(requestBody, ContentType.APPLICATION_JSON);
@@ -280,7 +634,7 @@
     }
 
     @ResponseBody
-    @RequestMapping(value = {"/api/multicloud-k8s/v1/v1/rb/definition/{rb-name}/{rb-version}/config-template/{tname}"},
+    @RequestMapping(value = {"/api/cnf-adapter/v1/v1/rb/definition/{rb-name}/{rb-version}/config-template/{tname}"},
             method = RequestMethod.GET, produces = "application/json")
     public String getConfigTemplate(@PathVariable("rb-name") String rbName,
             @PathVariable("rb-version") String rbVersion, @PathVariable("tname") String tName) throws Exception {
@@ -289,8 +643,8 @@
 
         // TODO
         // Below URL should be changed as appropriate multicloud URL.
-        HttpGet req = new HttpGet("https://localhost:32780/api/multicloud-k8s/v1/v1/rb/definition/" + rbName + "/"
-                + rbVersion + "/config-template/" + tName);
+        HttpGet req = new HttpGet(
+                "http://172.17.0.2:31770/v1/rb/definition/" + rbName + "/" + rbVersion + "/config-template/" + tName);
 
         try (CloseableHttpResponse response = httpClient.execute(req)) {
             logger.info("response:" + response.getEntity());
@@ -298,4 +652,83 @@
         }
     }
 
+    @ResponseBody
+    @RequestMapping(value = {"/api/cnf-adapter/v1/v1/rb/definition/{rb-name}/{rb-version}/config-template/{tname}"},
+            method = RequestMethod.DELETE, produces = "application/json")
+    public String deleteTemplate(@PathVariable("rb-name") String rbName, @PathVariable("rb-version") String rbVersion,
+            @PathVariable("tname") String tName) throws Exception {
+
+        logger.info("deleteTemplate called.");
+
+        // TODO
+        // Below URL should be changed as appropriate multicloud URL.
+        HttpDelete req = new HttpDelete(
+                "http://172.17.0.2:31770/v1/rb/definition/" + rbName + "/" + rbVersion + "/config-template/" + tName);
+
+        try (CloseableHttpResponse response = httpClient.execute(req)) {
+            logger.info("response:" + response.getEntity());
+            return EntityUtils.toString(response.getEntity());
+        }
+
+    }
+
+    @ResponseBody
+    @RequestMapping(
+            value = {"/api/cnf-adapter/v1/v1/rb/definition/{rb-name}/{rb-version}/config-template/{tname}/content"},
+            method = RequestMethod.POST, produces = "multipart/form-data")
+    public String uploadTarFileForTemplate(@RequestParam("file") MultipartFile file,
+            @PathVariable("rb-name") String rbName, @PathVariable("rb-version") String rbVersion,
+            @PathVariable("tname") String tName) throws Exception {
+
+        logger.info("uploadTarFileForTemplate called.");
+
+        File convFile = new File(file.getOriginalFilename());
+        file.transferTo(convFile);
+        FileBody fileBody = new FileBody(convFile, ContentType.DEFAULT_BINARY);
+        MultipartEntityBuilder builder = MultipartEntityBuilder.create();
+        builder.setMode(HttpMultipartMode.BROWSER_COMPATIBLE);
+        builder.addPart("file", fileBody);
+        HttpEntity entity = builder.build();
+
+        // TODO
+        // Below URL should be changed as appropriate multicloud URL.
+        HttpPost post = new HttpPost("http://172.17.0.2:31770/v1/rb/definition/" + rbName + "/" + rbVersion
+                + "/config-template/" + tName + "/content");
+        post.setHeader("Content-Type", "multipart/form-data");
+
+        logger.info(String.valueOf(post));
+        post.setEntity(entity);
+
+        try (CloseableHttpClient httpClient = HttpClients.createDefault();
+                CloseableHttpResponse response = httpClient.execute(post)) {
+            logger.info("response:" + response.getEntity());
+            return EntityUtils.toString(response.getEntity());
+        }
+    }
+
+    @ResponseBody
+    @RequestMapping(value = {"/api/cnf-adapter/v1/v1/definition/{rbName}/{rbVersion}/profile/{prName}/config/rollback"},
+            method = RequestMethod.DELETE, produces = "application/json")
+    public String rollbackConfiguration(@RequestBody ConfigurationRollbackEntity rE,
+            @PathVariable("rbName") String rbName, @PathVariable("rbVersion") String rbVersion,
+            @PathVariable("prName") String prName) throws Exception {
+        logger.info("rollbackConfiguration called.");
+
+        // TODO
+        // Below URL should be changed as appropriate multicloud URL.
+        HttpPost post = new HttpPost("http://172.17.0.2:31770/v1/definition/" + rbName + "/" + rbVersion + "/profile/"
+                + prName + "/config/rollback");
+
+        ObjectMapper objectMapper = new ObjectMapper();
+        String requestBody = objectMapper.writeValueAsString(rE);
+        StringEntity requestEntity = new StringEntity(requestBody, ContentType.APPLICATION_JSON);
+        post.setEntity(requestEntity);
+
+        try (CloseableHttpClient httpClient = HttpClients.createDefault();
+                CloseableHttpResponse response = httpClient.execute(post)) {
+            logger.info("response:" + response.getEntity());
+            return EntityUtils.toString(response.getEntity());
+        }
+    }
+
 }
diff --git a/adapters/mso-cnf-adapter/src/main/java/org/onap/so/adapters/cnf/util/CNfAdapterUtil.java b/adapters/mso-cnf-adapter/src/main/java/org/onap/so/adapters/cnf/util/CNfAdapterUtil.java
new file mode 100644
index 0000000..25e506c
--- /dev/null
+++ b/adapters/mso-cnf-adapter/src/main/java/org/onap/so/adapters/cnf/util/CNfAdapterUtil.java
@@ -0,0 +1,94 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2020 Huawei Technologies Co., Ltd. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF 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.so.adapters.cnf.util;
+
+import com.fasterxml.jackson.databind.ObjectMapper;
+import java.io.IOException;
+import org.onap.so.adapters.cnf.exceptions.ApplicationException;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.onap.logging.filter.base.ErrorCode;
+import static org.onap.so.logger.LoggingAnchor.THREE;
+import static org.onap.so.logger.MessageEnum.RA_NS_EXC;
+
+public class CNfAdapterUtil {
+
+    private static final Logger LOGGER = LoggerFactory.getLogger(CNfAdapterUtil.class);
+
+    public static final int BAD_REQUEST = 400;
+
+    private static final String UNMARSHAL_FAIL_MSG = "Failed to unmarshal json";
+
+    private static final String MARSHAL_FAIL_MSG = "Failed to marshal object";
+
+    private static final ObjectMapper MAPPER = new ObjectMapper();
+
+    public static class StatusDesc {
+
+        public static final String ALLOCATE_NSS_SUCCESS = "Allocating nss is " + "successful";
+
+        public static final String CREATE_NSS_SUCCESS = "Creating nss is " + "successful";
+
+        public static final String DEALLOCATE_NSS_SUCCESS = "Deallocate nss " + "is successful";
+
+        public static final String ACTIVATE_NSS_SUCCESS = "Activate nss " + "is successful";
+
+        public static final String DEACTIVATE_NSS_SUCCESS = "Deactivate nss " + "is successful";
+
+        public static final String QUERY_JOB_STATUS_FAILED = "Query job " + "status failed";
+
+        public static final String QUERY_JOB_STATUS_SUCCESS = "Query job " + "status is successful";
+
+        private StatusDesc() {
+
+        }
+    }
+
+    private CNfAdapterUtil() {
+
+    }
+
+    public static void assertObjectNotNull(Object object) throws ApplicationException {
+        if (null == object) {
+            LOGGER.error("Object is null.");
+            throw new ApplicationException(BAD_REQUEST, "An object is null.");
+        }
+    }
+
+    public static <T> T unMarshal(String jsonstr, Class<T> type) throws ApplicationException {
+        try {
+            return MAPPER.readValue(jsonstr, type);
+        } catch (IOException e) {
+            LOGGER.error(THREE, RA_NS_EXC.toString(), ErrorCode.BusinessProcessError.getValue(), UNMARSHAL_FAIL_MSG, e);
+            throw new ApplicationException(BAD_REQUEST, UNMARSHAL_FAIL_MSG);
+        }
+    }
+
+    public static String marshal(Object srcObj) throws ApplicationException {
+        try {
+            return MAPPER.writerWithDefaultPrettyPrinter().writeValueAsString(srcObj);
+        } catch (IOException e) {
+            LOGGER.error(THREE, RA_NS_EXC.toString(), ErrorCode.BusinessProcessError.getValue(), MARSHAL_FAIL_MSG, e);
+            throw new ApplicationException(BAD_REQUEST, MARSHAL_FAIL_MSG);
+        }
+    }
+
+}
diff --git a/adapters/mso-cnf-adapter/src/test/java/org/onap/so/adapters/cnf/CnfAdapterRestTest.java b/adapters/mso-cnf-adapter/src/test/java/org/onap/so/adapters/cnf/CnfAdapterRestTest.java
new file mode 100644
index 0000000..38a1091
--- /dev/null
+++ b/adapters/mso-cnf-adapter/src/test/java/org/onap/so/adapters/cnf/CnfAdapterRestTest.java
@@ -0,0 +1,62 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2020 Huawei Technologies Co., Ltd. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF 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.so.adapters.cnf;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import java.util.HashMap;
+import java.util.Map;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.InjectMocks;
+import org.onap.so.adapters.cnf.model.BpmnInstanceRequest;
+import org.onap.so.adapters.cnf.rest.CnfAdapterRest;
+import org.springframework.test.context.junit4.SpringRunner;
+
+@RunWith(SpringRunner.class)
+public class CnfAdapterRestTest {
+
+    @InjectMocks
+    CnfAdapterRest cnfAdapterRest;
+
+    @Test
+    public void createInstanceTest() throws Exception {
+
+        Map<String, String> labels = new HashMap<String, String>();
+        labels.put("custom-label-1", "label1");
+        Map<String, String> overrideValues = new HashMap<String, String>();
+        labels.put("image.tag", "latest");
+        labels.put("dcae_collector_ip", "1.2.3.4");
+        BpmnInstanceRequest bpmnInstanceRequest = new BpmnInstanceRequest();
+        bpmnInstanceRequest.setCloudRegionId("v1");
+        bpmnInstanceRequest.setLabels(labels);
+        bpmnInstanceRequest.setModelInvariantId("krd");
+        bpmnInstanceRequest.setModelVersionId("p1");
+        bpmnInstanceRequest.setOverrideValues(overrideValues);
+        bpmnInstanceRequest.setVfModuleUUID("20200824");
+
+        String mockedResponse = "K8sRBProfileName is required";
+        String actualResponse = cnfAdapterRest.createInstance(bpmnInstanceRequest);
+        assertNotNull(actualResponse);
+        assertEquals(mockedResponse, actualResponse);
+    }
+
+}
