summaryrefslogtreecommitdiffstats
path: root/adapters/mso-vfc-adapter/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'adapters/mso-vfc-adapter/src/main')
-rw-r--r--adapters/mso-vfc-adapter/src/main/java/org/openecomp/mso/adapters/vfc/VfcManager.java10
-rw-r--r--adapters/mso-vfc-adapter/src/main/java/org/openecomp/mso/adapters/vfc/model/CustomerModel.java69
-rw-r--r--adapters/mso-vfc-adapter/src/main/java/org/openecomp/mso/adapters/vfc/model/NsCreateReq.java35
3 files changed, 104 insertions, 10 deletions
diff --git a/adapters/mso-vfc-adapter/src/main/java/org/openecomp/mso/adapters/vfc/VfcManager.java b/adapters/mso-vfc-adapter/src/main/java/org/openecomp/mso/adapters/vfc/VfcManager.java
index 78ec50f9f0..03d427b467 100644
--- a/adapters/mso-vfc-adapter/src/main/java/org/openecomp/mso/adapters/vfc/VfcManager.java
+++ b/adapters/mso-vfc-adapter/src/main/java/org/openecomp/mso/adapters/vfc/VfcManager.java
@@ -28,6 +28,7 @@ import org.openecomp.mso.adapters.vfc.constant.CommonConstant.Step;
import org.openecomp.mso.adapters.vfc.constant.DriverExceptionID;
import org.openecomp.mso.adapters.vfc.constant.HttpCode;
import org.openecomp.mso.adapters.vfc.exceptions.ApplicationException;
+import org.openecomp.mso.adapters.vfc.model.CustomerModel;
import org.openecomp.mso.adapters.vfc.model.NSResourceInputParameter;
import org.openecomp.mso.adapters.vfc.model.NsCreateReq;
import org.openecomp.mso.adapters.vfc.model.NsInstantiateReq;
@@ -85,9 +86,9 @@ public class VfcManager {
public RestfulResponse createNs(NSResourceInputParameter segInput) throws ApplicationException {
// Step1: get service template by node type
- String nsdId = segInput.getNsOperationKey().getNodeTemplateUUID();
+ String csarId = segInput.getNsOperationKey().getNodeTemplateUUID();
// nsdId for NFVO is "id" in the response, while for SDNO is "servcice template id"
- LOGGER.info("serviceTemplateId is {}, id is {}", nsdId);
+ LOGGER.info("serviceTemplateId is {}, id is {}", csarId);
LOGGER.info("create ns -> begin");
// Step2: Prepare url and method type
@@ -96,9 +97,12 @@ public class VfcManager {
// Step3: Prepare restful parameters and options
NsCreateReq oRequest = new NsCreateReq();
- oRequest.setNsdId(nsdId);
+ oRequest.setCsarId(csarId);
oRequest.setNsName(segInput.getNsServiceName());
oRequest.setDescription(segInput.getNsServiceDescription());
+ CustomerModel context = new CustomerModel();
+ context.setGlobalCustomerId(segInput.getNsOperationKey().getGlobalSubscriberId());
+ context.setServiceType(segInput.getNsOperationKey().getServiceType());
String createReq = JsonUtil.marshal(oRequest);
// Step4: Call NFVO or SDNO lcm to create ns
diff --git a/adapters/mso-vfc-adapter/src/main/java/org/openecomp/mso/adapters/vfc/model/CustomerModel.java b/adapters/mso-vfc-adapter/src/main/java/org/openecomp/mso/adapters/vfc/model/CustomerModel.java
new file mode 100644
index 0000000000..fa0347bf48
--- /dev/null
+++ b/adapters/mso-vfc-adapter/src/main/java/org/openecomp/mso/adapters/vfc/model/CustomerModel.java
@@ -0,0 +1,69 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2017 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.openecomp.mso.adapters.vfc.model;
+
+/**
+ * The Customer Model
+ * <br>
+ * <p>
+ * </p>
+ *
+ * @author
+ * @version ONAP Amsterdam Release 2017-10-12
+ */
+public class CustomerModel {
+
+ String globalCustomerId;
+
+ String serviceType;
+
+
+ /**
+ * @return Returns the globalCustomerId.
+ */
+ public String getGlobalCustomerId() {
+ return globalCustomerId;
+ }
+
+
+ /**
+ * @param globalCustomerId The globalCustomerId to set.
+ */
+ public void setGlobalCustomerId(String globalCustomerId) {
+ this.globalCustomerId = globalCustomerId;
+ }
+
+
+ /**
+ * @return Returns the serviceType.
+ */
+ public String getServiceType() {
+ return serviceType;
+ }
+
+
+ /**
+ * @param serviceType The serviceType to set.
+ */
+ public void setServiceType(String serviceType) {
+ this.serviceType = serviceType;
+ }
+
+}
diff --git a/adapters/mso-vfc-adapter/src/main/java/org/openecomp/mso/adapters/vfc/model/NsCreateReq.java b/adapters/mso-vfc-adapter/src/main/java/org/openecomp/mso/adapters/vfc/model/NsCreateReq.java
index 848ecf3114..3887624be0 100644
--- a/adapters/mso-vfc-adapter/src/main/java/org/openecomp/mso/adapters/vfc/model/NsCreateReq.java
+++ b/adapters/mso-vfc-adapter/src/main/java/org/openecomp/mso/adapters/vfc/model/NsCreateReq.java
@@ -29,24 +29,45 @@ package org.openecomp.mso.adapters.vfc.model;
*/
public class NsCreateReq {
- String nsdId;
+ CustomerModel context;
+
+ String csarId;
String nsName;
String description;
+
+
+ /**
+ * @return Returns the context.
+ */
+ public CustomerModel getContext() {
+ return context;
+ }
+
+
+
+ /**
+ * @param context The context to set.
+ */
+ public void setContext(CustomerModel context) {
+ this.context = context;
+ }
+
/**
- * @return Returns the nsdId.
+ * @return Returns the csarId.
*/
- public String getNsdId() {
- return nsdId;
+ public String getCsarId() {
+ return csarId;
}
+
/**
- * @param nsdId The nsdId to set.
+ * @param csarId The csarId to set.
*/
- public void setNsdId(String nsdId) {
- this.nsdId = nsdId;
+ public void setCsarId(String csarId) {
+ this.csarId = csarId;
}
/**