From: zm330 Date: Mon, 12 Oct 2020 11:27:18 +0000 (+0800) Subject: Update NSMF Allocate workflow and fix health check issue X-Git-Tag: 1.7.4~9^2 X-Git-Url: https://gerrit.onap.org/r/gitweb?a=commitdiff_plain;h=869f628d4ba4533a1bf4098b5184dd89c9a0695b;p=so.git Update NSMF Allocate workflow and fix health check issue Issue-ID: SO-2963 Signed-off-by: zm330 Change-Id: I07d5e7aada2e028914067c2f20a3a44eb4450e83 --- diff --git a/adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/config/WebSecurityConfig.java b/adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/config/WebSecurityConfig.java deleted file mode 100644 index dfb2b61978..0000000000 --- a/adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/config/WebSecurityConfig.java +++ /dev/null @@ -1,37 +0,0 @@ -/*- - * ============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.nssmf.config; - -import org.springframework.context.annotation.Configuration; -import org.springframework.security.config.annotation.web.builders.HttpSecurity; -import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; -import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter; - -@EnableWebSecurity -@Configuration -public class WebSecurityConfig extends WebSecurityConfigurerAdapter { - - @Override - protected void configure(HttpSecurity http) throws Exception { - http.csrf().disable(); - } - -} diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateSliceServiceOption.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateSliceServiceOption.groovy index 8993127dbc..1d5232f3c5 100644 --- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateSliceServiceOption.groovy +++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateSliceServiceOption.groovy @@ -95,7 +95,7 @@ class DoCreateSliceServiceOption extends AbstractServiceTaskProcessor{ List nsstInfos = new ArrayList<>() ServiceDecomposition nstServiceDecomposition = execution.getVariable("nstServiceDecomposition") as ServiceDecomposition - //todo: + List allottedResources = nstServiceDecomposition.getAllottedResources() for (AllottedResource allottedResource : allottedResources) { TemplateInfo nsstInfo = new TemplateInfo() @@ -150,9 +150,6 @@ class DoCreateSliceServiceOption extends AbstractServiceTaskProcessor{ execution.setVariable("nsstServiceDecompositions", nsstServiceDecompositions) - - - int num = execution.getVariable("maxNsstIndex") as Integer int index = execution.getVariable("currentNsstIndex") as Integer @@ -180,8 +177,6 @@ class DoCreateSliceServiceOption extends AbstractServiceTaskProcessor{ List subnetCapabilities = new ArrayList<>() - - for (ServiceDecomposition serviceDecomposition : nsstServiceDecompositions) { SubnetCapability subnetCapability = new SubnetCapability() handleByType(execution, serviceDecomposition, sliceParams, subnetCapability) @@ -206,7 +201,6 @@ class DoCreateSliceServiceOption extends AbstractServiceTaskProcessor{ sliceParams.tnBHSliceTaskInfo.NSSTInfo.UUID = modelInfo.getModelUuid() sliceParams.tnBHSliceTaskInfo.NSSTInfo.invariantUUID = modelInfo.getModelInvariantUuid() sliceParams.tnBHSliceTaskInfo.NSSTInfo.name = modelInfo.getModelName() - break case SubnetType.TN_MH: sliceParams.tnMHSliceTaskInfo.vendor = vendor @@ -215,7 +209,6 @@ class DoCreateSliceServiceOption extends AbstractServiceTaskProcessor{ sliceParams.tnMHSliceTaskInfo.NSSTInfo.UUID = modelInfo.getModelUuid() sliceParams.tnMHSliceTaskInfo.NSSTInfo.invariantUUID = modelInfo.getModelInvariantUuid() sliceParams.tnMHSliceTaskInfo.NSSTInfo.name = modelInfo.getModelName() - break case SubnetType.AN_NF: sliceParams.anSliceTaskInfo.vendor = vendor @@ -236,9 +229,6 @@ class DoCreateSliceServiceOption extends AbstractServiceTaskProcessor{ default: subnetType = null break - - //todo - } if (null == subnetType) { def msg = "Get subnetType failed, modelUUId=" + modelInfo.getModelUuid() @@ -297,17 +287,16 @@ class DoCreateSliceServiceOption extends AbstractServiceTaskProcessor{ private static String buildQuerySubnetCapRequest(String vendor, SubnetType subnetType) { NssmfAdapterNBIRequest request = new NssmfAdapterNBIRequest() - List subnetTypes = new ArrayList<>() - subnetTypes.add(subnetType.subnetType) +// List subnetTypes = new ArrayList<>() +// subnetTypes.add(subnetType.subnetType) Map paramMap = new HashMap() - paramMap.put("subnetTypes", subnetTypes) + paramMap.put("subnetType", subnetType.subnetType) request.setSubnetCapabilityQuery(objectMapper.writeValueAsString(paramMap)) EsrInfo esrInfo = new EsrInfo() esrInfo.setVendor(vendor) esrInfo.setNetworkType(subnetType.networkType) - request.setEsrInfo(esrInfo) String strRequest = objectMapper.writeValueAsString(request) @@ -320,7 +309,8 @@ class DoCreateSliceServiceOption extends AbstractServiceTaskProcessor{ * prepare select nsi request * @param execution */ - public void preNSIRequest(DelegateExecution execution, boolean preferReuse) { + public void preNSIRequest(DelegateExecution execution) { + boolean preferReuse = execution.getVariable("needQuerySliceProfile") ? false : true String urlString = UrnPropertiesReader.getVariable("mso.oof.endpoint", execution) logger.debug( "get NSI option OOF Url: " + urlString) @@ -378,8 +368,9 @@ class DoCreateSliceServiceOption extends AbstractServiceTaskProcessor{ if (isSharable && solution.get("existingNSI")) { //sharedNSISolution processSharedNSI(solution, sliceTaskParams) + execution.setVariable("needQuerySliceProfile", true) } - else if(solution.containsKey("newNSISolution")) { + else { processNewNSI(solution, sliceTaskParams) } } @@ -395,6 +386,7 @@ class DoCreateSliceServiceOption extends AbstractServiceTaskProcessor{ String nsiName = sharedNSISolution.get("NSIName") sliceParams.setSuggestNsiId(nsiId) sliceParams.setSuggestNsiName(nsiName) + } private void processNewNSI(Map solution, SliceTaskParamsAdapter sliceParams) { diff --git a/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoCreateSliceServiceOption.bpmn b/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoCreateSliceServiceOption.bpmn index 1bda596c6a..7699e804b4 100644 --- a/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoCreateSliceServiceOption.bpmn +++ b/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoCreateSliceServiceOption.bpmn @@ -160,10 +160,11 @@ dcso.processNSIResp(execution) SequenceFlow_1iawj3m + SequenceFlow_1e7iqkm SequenceFlow_14o0fxe import org.onap.so.bpmn.infrastructure.scripts.* def dcso = new DoCreateSliceServiceOption() -dcso.preNSIRequest(execution,true) +dcso.preNSIRequest(execution) SequenceFlow_1iawj3m @@ -190,7 +191,7 @@ dcso.handleNssiSelect(execution) - SequenceFlow_1h3kdce + SequenceFlow_0vfe8hp SequenceFlow_0il5j01 SequenceFlow_0euwvgf SequenceFlow_05250mp @@ -198,7 +199,7 @@ dcso.handleNssiSelect(execution) - + @@ -216,212 +217,234 @@ dcso.handleNssiSelect(execution) + + SequenceFlow_1h3kdce + SequenceFlow_0vfe8hp + SequenceFlow_1e7iqkm + + + + #{execution.getVariable("needQuerySliceProfile") == true} + - + - + - + - - + + - - + + - + - + - + - + - - + + - + - + - + - + - + - + - + - + - - + + - - + + - + - + - + - - + + - - - - + + + + - - + + - + - - + + - + - + - + - + - + - - + + - - + + - - + + - + - + - - + + - - - + + + - - + + - - - + + + - + - - - + + + - - + + - - - + + + - - + + - - + + - - + + - - + + - + - + - - + + - + - + - - + + - - + + + + + + + + + + + + + + +