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;
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
// 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
--- /dev/null
+/*-\r
+ * ============LICENSE_START=======================================================\r
+ * ONAP - SO\r
+ * ================================================================================\r
+ * Copyright (C) 2017 Huawei Technologies Co., Ltd. All rights reserved.\r
+ * ================================================================================\r
+ * Licensed under the Apache License, Version 2.0 (the "License");\r
+ * you may not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ * \r
+ * http://www.apache.org/licenses/LICENSE-2.0\r
+ * \r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an "AS IS" BASIS,\r
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+ * ============LICENSE_END=========================================================\r
+ */\r
+package org.openecomp.mso.adapters.vfc.model;\r
+\r
+/**\r
+ * The Customer Model\r
+ * <br>\r
+ * <p>\r
+ * </p>\r
+ * \r
+ * @author\r
+ * @version ONAP Amsterdam Release 2017-10-12\r
+ */\r
+public class CustomerModel {\r
+ \r
+ String globalCustomerId;\r
+\r
+ String serviceType;\r
+\r
+ \r
+ /**\r
+ * @return Returns the globalCustomerId.\r
+ */\r
+ public String getGlobalCustomerId() {\r
+ return globalCustomerId;\r
+ }\r
+\r
+ \r
+ /**\r
+ * @param globalCustomerId The globalCustomerId to set.\r
+ */\r
+ public void setGlobalCustomerId(String globalCustomerId) {\r
+ this.globalCustomerId = globalCustomerId;\r
+ }\r
+\r
+ \r
+ /**\r
+ * @return Returns the serviceType.\r
+ */\r
+ public String getServiceType() {\r
+ return serviceType;\r
+ }\r
+\r
+ \r
+ /**\r
+ * @param serviceType The serviceType to set.\r
+ */\r
+ public void setServiceType(String serviceType) {\r
+ this.serviceType = serviceType;\r
+ }\r
+ \r
+}\r
*/
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;
}
/**