diff options
41 files changed, 916 insertions, 128 deletions
diff --git a/adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/consts/NssmfAdapterConsts.java b/adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/consts/NssmfAdapterConsts.java index e762bc04e8..28789f2a98 100644 --- a/adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/consts/NssmfAdapterConsts.java +++ b/adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/consts/NssmfAdapterConsts.java @@ -50,7 +50,7 @@ public class NssmfAdapterConsts { private final static String EXTERNAL_TN_DEALLOCATE_URL = "/api/rest/provMns/{apiVersion}/tn/NSS/SliceProfiles/{sliceProfileId}"; - private final static String EXTERNAL_AN_DEALLOCATE_URL = "/ObjectManagement/NSS/SliceProfiles/{SliceProfileId}"; + private final static String EXTERNAL_AN_DEALLOCATE_URL = "/ObjectManagement/NSS/SliceProfiles/{sliceProfileId}"; private final static String INTERNAL_DEALLOCATE_URL = "/onap/so/infra/3gppservices/{apiVersion}/deAllocate"; diff --git a/adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/manager/impl/external/ExternalAnNssmfManager.java b/adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/manager/impl/external/ExternalAnNssmfManager.java index 0d2f2dfdeb..ef979a660f 100644 --- a/adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/manager/impl/external/ExternalAnNssmfManager.java +++ b/adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/manager/impl/external/ExternalAnNssmfManager.java @@ -41,7 +41,9 @@ public class ExternalAnNssmfManager extends ExternalNssmfManager { @Override protected String doWrapExtAllocateReqBody(NssmfAdapterNBIRequest nbiRequest) throws ApplicationException { - return marshal(nbiRequest.getAllocateAnNssi().getSliceProfile()); + Map<String, Object> request = new HashMap<>(); + request.put("attributeListIn", nbiRequest.getAllocateAnNssi().getSliceProfile()); + return marshal(request); } @Override diff --git a/adapters/mso-nssmf-adapter/src/test/java/org/onap/so/adapters/nssmf/NssmfAdapterRestTest.java b/adapters/mso-nssmf-adapter/src/test/java/org/onap/so/adapters/nssmf/NssmfAdapterRestTest.java index a9c732e6e3..67cd913b3e 100644 --- a/adapters/mso-nssmf-adapter/src/test/java/org/onap/so/adapters/nssmf/NssmfAdapterRestTest.java +++ b/adapters/mso-nssmf-adapter/src/test/java/org/onap/so/adapters/nssmf/NssmfAdapterRestTest.java @@ -54,7 +54,7 @@ import org.onap.so.beans.nsmf.NssiAllocateRequest; import org.onap.so.beans.nsmf.NssiDeAllocateRequest; import org.onap.so.beans.nsmf.NssiResponse; import org.onap.so.beans.nsmf.PerfReq; -import org.onap.so.beans.nsmf.PerfReqEmbbList; +import org.onap.so.beans.nsmf.PerfReqEmbb; import org.onap.so.db.request.data.repository.ResourceOperationStatusRepository; import org.springframework.http.ResponseEntity; import org.springframework.test.context.junit4.SpringRunner; @@ -289,7 +289,7 @@ public class NssmfAdapterRestTest { assertEquals(all.getAllocateCnNssi().getSliceProfile().getResourceSharingLevel(), NON_SHARED); assertNotNull(all.getAllocateCnNssi().getSliceProfile().getPerfReq()); assertNotNull(all.getAllocateCnNssi().getSliceProfile().getPerfReq().getPerfReqEmbbList()); - PerfReqEmbbList embb = + PerfReqEmbb embb = all.getAllocateCnNssi().getSliceProfile().getPerfReq().getPerfReqEmbbList().iterator().next(); assertNotNull(embb); assertEquals(embb.getActivityFactor(), 50); @@ -302,9 +302,9 @@ public class NssmfAdapterRestTest { List<String> plmn = new LinkedList<>(); plmn.add("460-00"); plmn.add("460-01"); - PerfReqEmbbList embb = new PerfReqEmbbList(); + PerfReqEmbb embb = new PerfReqEmbb(); embb.setActivityFactor(50); - List<PerfReqEmbbList> embbList = new LinkedList<>(); + List<PerfReqEmbb> embbList = new LinkedList<>(); embbList.add(embb); PerfReq perfReq = new PerfReq(); perfReq.setPerfReqEmbbList(embbList); diff --git a/adapters/mso-nssmf-adapter/src/test/java/org/onap/so/adapters/nssmf/service/impl/NssmfManagerServiceImplTest.java b/adapters/mso-nssmf-adapter/src/test/java/org/onap/so/adapters/nssmf/service/impl/NssmfManagerServiceImplTest.java index 3108ade5a6..4a659e1ca3 100644 --- a/adapters/mso-nssmf-adapter/src/test/java/org/onap/so/adapters/nssmf/service/impl/NssmfManagerServiceImplTest.java +++ b/adapters/mso-nssmf-adapter/src/test/java/org/onap/so/adapters/nssmf/service/impl/NssmfManagerServiceImplTest.java @@ -191,9 +191,9 @@ public class NssmfManagerServiceImplTest { List<String> plmn = new LinkedList<>(); plmn.add("460-00"); plmn.add("460-01"); - PerfReqEmbbList embb = new PerfReqEmbbList(); + PerfReqEmbb embb = new PerfReqEmbb(); embb.setActivityFactor(50); - List<PerfReqEmbbList> embbList = new LinkedList<>(); + List<PerfReqEmbb> embbList = new LinkedList<>(); embbList.add(embb); PerfReq perfReq = new PerfReq(); perfReq.setPerfReqEmbbList(embbList); diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/generalobjects/RequestContext.java b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/generalobjects/RequestContext.java index 0193469d93..12abec0b77 100644 --- a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/generalobjects/RequestContext.java +++ b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/generalobjects/RequestContext.java @@ -57,6 +57,16 @@ public class RequestContext implements Serializable { private List<Map<String, String>> configurationParameters = new ArrayList<>(); @JsonProperty("application-id") private String applicationId; + @JsonProperty("is-helm") + private Boolean isHelm; + + public Boolean getIsHelm() { + return isHelm; + } + + public void setIsHelm(Boolean isHelm) { + this.isHelm = isHelm; + } public String getServiceURI() { return serviceURI; diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetup.java b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetup.java index a371839244..5a8244266b 100644 --- a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetup.java +++ b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetup.java @@ -193,6 +193,12 @@ public class BBInputSetup implements JavaDelegate { execution.setVariable(GBB_INPUT_VAR_NAME, outputBB); execution.setVariable(LOOKUP_KEY_MAP_VAR_NAME, lookupKeyMap); + if (outputBB.getRequestContext().getIsHelm()) { + execution.setVariable("isHelm", true); + } else { + execution.setVariable("isHelm", false); + } + BuildingBlockExecution gBuildingBlockExecution = new DelegateExecutionImpl(execution); execution.setVariable("gBuildingBlockExecution", gBuildingBlockExecution); execution.setVariable("RetryCount", 1); @@ -431,7 +437,8 @@ public class BBInputSetup implements JavaDelegate { protected void mapCatalogInstanceGroup(InstanceGroup instanceGroup, ModelInfo modelInfo, Service service) { // @TODO: this will populate the instanceGroup model info. - // Dependent on MSO-5821 653458 US - MSO - Enhance Catalog DB Schema & Adapter to support VNF Groups + // Dependent on MSO-5821 653458 US - MSO - Enhance Catalog DB Schema & Adapter + // to support VNF Groups } protected void populateConfiguration(BBInputSetupParameter parameter) { @@ -613,6 +620,10 @@ public class BBInputSetup implements JavaDelegate { parameter.getServiceModel().getCurrentService(), vnfModelCustomizationUUID); } } + if (vfModule.getModelInfoVfModule() != null && vfModule.getModelInfoVfModule().getModelName() != null + && vfModule.getModelInfoVfModule().getModelName().contains("helm")) { + parameter.setIsHelm(true); + } } else { logger.debug("Related VNF instance Id not found: {}", parameter.getLookupKeyMap().get(ResourceKey.GENERIC_VNF_ID)); @@ -1018,7 +1029,6 @@ public class BBInputSetup implements JavaDelegate { if (requestDetails.getOwningEntity() != null) owningEntity = mapperLayer.mapRequestOwningEntity(requestDetails.getOwningEntity()); - Service service = bbInputSetupUtils.getCatalogServiceByModelUUID(requestDetails.getModelInfo().getModelVersionId()); if (service == null) { @@ -1094,6 +1104,7 @@ public class BBInputSetup implements JavaDelegate { RequestContext requestContext = mapperLayer.mapRequestContext(parameter.getRequestDetails()); requestContext.setAction(parameter.getRequestAction()); requestContext.setMsoRequestId(parameter.getExecuteBB().getRequestId()); + requestContext.setIsHelm(parameter.getIsHelm()); org.onap.aai.domain.yang.CloudRegion aaiCloudRegion = bbInputSetupUtils.getCloudRegion(parameter.getRequestDetails().getCloudConfiguration()); CloudRegion cloudRegion = diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetupParameter.java b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetupParameter.java index 36ac0969ee..1290f2aeef 100644 --- a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetupParameter.java +++ b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetupParameter.java @@ -45,6 +45,7 @@ public class BBInputSetupParameter { private String applicationId; private boolean isReplace; private ServiceModel serviceModel; + private boolean isHelm; private BBInputSetupParameter(Builder builder) { this.cloudConfiguration = builder.cloudConfiguration; @@ -74,6 +75,7 @@ public class BBInputSetupParameter { this.applicationId = builder.applicationId; this.isReplace = builder.isReplace; this.serviceModel = builder.serviceModel; + this.isHelm = builder.isHelm; } @@ -331,6 +333,15 @@ public class BBInputSetupParameter { this.serviceModel = serviceModel; } + protected boolean getIsHelm() { + return isHelm; + } + + + protected void setIsHelm(boolean isHelm) { + this.isHelm = isHelm; + } + public static class Builder { private CloudConfiguration cloudConfiguration; private ConfigurationResourceKeys configurationResourceKeys; @@ -359,6 +370,7 @@ public class BBInputSetupParameter { private String applicationId; private boolean isReplace; private ServiceModel serviceModel; + private boolean isHelm; public Builder setCloudConfiguration(CloudConfiguration cloudConfiguration) { this.cloudConfiguration = cloudConfiguration; @@ -495,6 +507,15 @@ public class BBInputSetupParameter { return this; } + protected boolean getIsHelm() { + return isHelm; + } + + + protected void setIsHelm(boolean isHelm) { + this.isHelm = isHelm; + } + public BBInputSetupParameter build() { return new BBInputSetupParameter(this); } diff --git a/bpmn/MSOCommonBPMN/src/test/resources/__files/ExecuteBuildingBlock/GeneralBuildingBlockCMExpected.json b/bpmn/MSOCommonBPMN/src/test/resources/__files/ExecuteBuildingBlock/GeneralBuildingBlockCMExpected.json index fe33308d78..7662b995e4 100644 --- a/bpmn/MSOCommonBPMN/src/test/resources/__files/ExecuteBuildingBlock/GeneralBuildingBlockCMExpected.json +++ b/bpmn/MSOCommonBPMN/src/test/resources/__files/ExecuteBuildingBlock/GeneralBuildingBlockCMExpected.json @@ -8,7 +8,8 @@ "userParams": [], "aLaCarte": true }, - "configurationParameters": [] + "configurationParameters": [], + "is-helm": false }, "orchContext": { "is-rollback-enabled": false diff --git a/bpmn/MSOCommonBPMN/src/test/resources/__files/ExecuteBuildingBlock/GeneralBuildingBlockExpected.json b/bpmn/MSOCommonBPMN/src/test/resources/__files/ExecuteBuildingBlock/GeneralBuildingBlockExpected.json index b18cad0620..2f26913ffc 100644 --- a/bpmn/MSOCommonBPMN/src/test/resources/__files/ExecuteBuildingBlock/GeneralBuildingBlockExpected.json +++ b/bpmn/MSOCommonBPMN/src/test/resources/__files/ExecuteBuildingBlock/GeneralBuildingBlockExpected.json @@ -33,7 +33,8 @@ "availability-zone":"$.vnf-topology.vnf-resource-assignments.availability-zones.availability-zone[0]", "xtz-123":"$.vnf-topology.vnf-resource-assignments.availability-zones.availability-zone[0]" } - ] + ], + "is-helm": false }, "orchContext": { "is-rollback-enabled": false diff --git a/bpmn/MSOCommonBPMN/src/test/resources/__files/ExecuteBuildingBlock/GeneralBuildingBlockExpectedWUserParamsInfo.json b/bpmn/MSOCommonBPMN/src/test/resources/__files/ExecuteBuildingBlock/GeneralBuildingBlockExpectedWUserParamsInfo.json index f07f060b06..0137d42009 100644 --- a/bpmn/MSOCommonBPMN/src/test/resources/__files/ExecuteBuildingBlock/GeneralBuildingBlockExpectedWUserParamsInfo.json +++ b/bpmn/MSOCommonBPMN/src/test/resources/__files/ExecuteBuildingBlock/GeneralBuildingBlockExpectedWUserParamsInfo.json @@ -43,7 +43,8 @@ "availability-zone":"$.vnf-topology.vnf-resource-assignments.availability-zones.availability-zone[0]", "xtz-123":"$.vnf-topology.vnf-resource-assignments.availability-zones.availability-zone[0]" } - ] + ], + "is-helm": false }, "orchContext": { "is-rollback-enabled": false diff --git a/bpmn/MSOCommonBPMN/src/test/resources/__files/ExecuteBuildingBlock/GeneralBuildingBlockInstanceGroupExpected.json b/bpmn/MSOCommonBPMN/src/test/resources/__files/ExecuteBuildingBlock/GeneralBuildingBlockInstanceGroupExpected.json index f55717fc91..d8294c0a17 100644 --- a/bpmn/MSOCommonBPMN/src/test/resources/__files/ExecuteBuildingBlock/GeneralBuildingBlockInstanceGroupExpected.json +++ b/bpmn/MSOCommonBPMN/src/test/resources/__files/ExecuteBuildingBlock/GeneralBuildingBlockInstanceGroupExpected.json @@ -14,7 +14,8 @@ "requestParameters": { }, - "configurationParameters": [] + "configurationParameters": [], + "is-helm": false }, "orchContext": { "is-rollback-enabled": true diff --git a/bpmn/MSOCommonBPMN/src/test/resources/__files/ExecuteBuildingBlock/GeneralBuildingBlockWithVnf.json b/bpmn/MSOCommonBPMN/src/test/resources/__files/ExecuteBuildingBlock/GeneralBuildingBlockWithVnf.json index ca2b76e4bf..e7fa4debeb 100644 --- a/bpmn/MSOCommonBPMN/src/test/resources/__files/ExecuteBuildingBlock/GeneralBuildingBlockWithVnf.json +++ b/bpmn/MSOCommonBPMN/src/test/resources/__files/ExecuteBuildingBlock/GeneralBuildingBlockWithVnf.json @@ -33,7 +33,8 @@ "availability-zone":"$.vnf-topology.vnf-resource-assignments.availability-zones.availability-zone[0]", "xtz-123":"$.vnf-topology.vnf-resource-assignments.availability-zones.availability-zone[0]" } - ] + ], + "is-helm": false }, "orchContext": { "is-rollback-enabled": false diff --git a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/CreateVfModuleBB.bpmn b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/CreateVfModuleBB.bpmn index 61c870b956..7638f34a59 100644 --- a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/CreateVfModuleBB.bpmn +++ b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/CreateVfModuleBB.bpmn @@ -1,29 +1,26 @@ <?xml version="1.0" encoding="UTF-8"?> -<bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" id="Definitions_1" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="3.1.2"> +<bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" id="Definitions_1" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="1.10.0"> <bpmn:process id="CreateVfModuleBB" name="CreateVfModuleBB" isExecutable="true"> <bpmn:startEvent id="CreateVfModuleBB_Start"> <bpmn:outgoing>SequenceFlow_1xr6chl</bpmn:outgoing> </bpmn:startEvent> <bpmn:serviceTask id="QueryVfModule" name=" SDNC Get (vf module) " camunda:expression="${SDNCQueryTasks.queryVfModule(InjectExecution.execute(execution, execution.getVariable("gBuildingBlockExecution")))}"> <bpmn:incoming>SequenceFlow_1s4rpyp</bpmn:incoming> - <bpmn:outgoing>SequenceFlow_15hn8si</bpmn:outgoing> + <bpmn:outgoing>SequenceFlow_1ig2ix4</bpmn:outgoing> </bpmn:serviceTask> <bpmn:sequenceFlow id="SequenceFlow_1xr6chl" sourceRef="CreateVfModuleBB_Start" targetRef="QueryVnf" /> <bpmn:endEvent id="CreateVfModuleBB_End"> <bpmn:incoming>SequenceFlow_1vbwdaw</bpmn:incoming> </bpmn:endEvent> <bpmn:serviceTask id="CreateVfModule" name="Prepare Request" camunda:expression="${VnfAdapterCreateTasks.createVfModule(InjectExecution.execute(execution, execution.getVariable("gBuildingBlockExecution")))}"> - <bpmn:incoming>SequenceFlow_15hn8si</bpmn:incoming> - <bpmn:outgoing>SequenceFlow_16g4dz0</bpmn:outgoing> + <bpmn:incoming>NoHelm</bpmn:incoming> + <bpmn:outgoing>SequenceFlow_0dehck5</bpmn:outgoing> </bpmn:serviceTask> - <bpmn:sequenceFlow id="SequenceFlow_15hn8si" sourceRef="QueryVfModule" targetRef="CreateVfModule" /> <bpmn:sequenceFlow id="SequenceFlow_1s4rpyp" sourceRef="QueryVnf" targetRef="QueryVfModule" /> <bpmn:serviceTask id="QueryVnf" name=" SDNC Get (vnf) " camunda:expression="${SDNCQueryTasks.queryVnf(InjectExecution.execute(execution, execution.getVariable("gBuildingBlockExecution")))}"> <bpmn:incoming>SequenceFlow_1xr6chl</bpmn:incoming> <bpmn:outgoing>SequenceFlow_1s4rpyp</bpmn:outgoing> </bpmn:serviceTask> - <bpmn:sequenceFlow id="SequenceFlow_16g4dz0" sourceRef="CreateVfModule" targetRef="VnfAdapter" /> - <bpmn:sequenceFlow id="SequenceFlow_0ecr393" sourceRef="VnfAdapter" targetRef="ServiceTask_01zrt6x" /> <bpmn:callActivity id="VnfAdapter" name="Vnf Adapter" calledElement="VnfAdapter"> <bpmn:extensionElements> <camunda:in source="gBuildingBlockExecution" target="gBuildingBlockExecution" /> @@ -35,8 +32,8 @@ <camunda:out source="oamManagementV6Address" target="oamManagementV6Address" /> <camunda:out source="contrailNetworkPolicyFqdnList" target="contrailNetworkPolicyFqdnList" /> </bpmn:extensionElements> - <bpmn:incoming>SequenceFlow_16g4dz0</bpmn:incoming> - <bpmn:outgoing>SequenceFlow_0ecr393</bpmn:outgoing> + <bpmn:incoming>SequenceFlow_0dehck5</bpmn:incoming> + <bpmn:outgoing>SequenceFlow_0uetprw</bpmn:outgoing> </bpmn:callActivity> <bpmn:serviceTask id="UpdateVfModuleStatus" name=" AAI Update (vf module) " camunda:expression="${AAIUpdateTasks.updateOrchestrationStatusCreatedVfModule(InjectExecution.execute(execution, execution.getVariable("gBuildingBlockExecution")))}"> <bpmn:incoming>SequenceFlow_0rds4rj</bpmn:incoming> @@ -80,7 +77,8 @@ </bpmn:serviceTask> <bpmn:sequenceFlow id="SequenceFlow_15do1tu" sourceRef="UpdateVfModuleContrailServiceInstanceFqdn" targetRef="UpdateVfModuleHeatStackId" /> <bpmn:serviceTask id="ServiceTask_01zrt6x" name=" Create Cloud Variable " camunda:expression="${CreateVFModule.createInventoryVariable(InjectExecution.execute(execution, execution.getVariable("gBuildingBlockExecution")))}"> - <bpmn:incoming>SequenceFlow_0ecr393</bpmn:incoming> + <bpmn:incoming>SequenceFlow_1mg8eym</bpmn:incoming> + <bpmn:incoming>SequenceFlow_0uetprw</bpmn:incoming> <bpmn:outgoing>SequenceFlow_1io8r33</bpmn:outgoing> </bpmn:serviceTask> <bpmn:sequenceFlow id="SequenceFlow_1io8r33" sourceRef="ServiceTask_01zrt6x" targetRef="ServiceTask_00d84m7" /> @@ -89,6 +87,23 @@ <bpmn:outgoing>SequenceFlow_1yn8o6d</bpmn:outgoing> </bpmn:serviceTask> <bpmn:sequenceFlow id="SequenceFlow_1yn8o6d" sourceRef="ServiceTask_00d84m7" targetRef="CreateNetworkPolicies" /> + <bpmn:exclusiveGateway id="CheckIfIsHelm" name="Check If Is Helm"> + <bpmn:incoming>SequenceFlow_1ig2ix4</bpmn:incoming> + <bpmn:outgoing>YesHelm</bpmn:outgoing> + <bpmn:outgoing>NoHelm</bpmn:outgoing> + </bpmn:exclusiveGateway> + <bpmn:serviceTask id="CnfAdapter" name="Cnf Adapter" camunda:expression="${CnfAdapterCreateTasks.createInstance(InjectExecution.execute(execution, execution.getVariable("gBuildingBlockExecution")))}"> + <bpmn:incoming>YesHelm</bpmn:incoming> + <bpmn:outgoing>SequenceFlow_1mg8eym</bpmn:outgoing> + </bpmn:serviceTask> + <bpmn:sequenceFlow id="YesHelm" name="Yes Helm" sourceRef="CheckIfIsHelm" targetRef="CnfAdapter"> + <bpmn:conditionExpression xsi:type="bpmn:tFormalExpression"><![CDATA[${execution.getVariable("isHelm")}]]></bpmn:conditionExpression> + </bpmn:sequenceFlow> + <bpmn:sequenceFlow id="SequenceFlow_1mg8eym" sourceRef="CnfAdapter" targetRef="ServiceTask_01zrt6x" /> + <bpmn:sequenceFlow id="SequenceFlow_1ig2ix4" sourceRef="QueryVfModule" targetRef="CheckIfIsHelm" /> + <bpmn:sequenceFlow id="NoHelm" name="No Helm" sourceRef="CheckIfIsHelm" targetRef="CreateVfModule" /> + <bpmn:sequenceFlow id="SequenceFlow_0dehck5" sourceRef="CreateVfModule" targetRef="VnfAdapter" /> + <bpmn:sequenceFlow id="SequenceFlow_0uetprw" sourceRef="VnfAdapter" targetRef="ServiceTask_01zrt6x" /> </bpmn:process> <bpmndi:BPMNDiagram id="BPMNDiagram_1"> <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="CreateVfModuleBB"> @@ -102,31 +117,24 @@ <dc:Bounds x="513" y="66" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="SequenceFlow_1xr6chl_di" bpmnElement="SequenceFlow_1xr6chl"> - <di:waypoint x="192" y="106" /> - <di:waypoint x="313" y="106" /> + <di:waypoint xsi:type="dc:Point" x="192" y="106" /> + <di:waypoint xsi:type="dc:Point" x="313" y="106" /> <bpmndi:BPMNLabel> <dc:Bounds x="156" y="91" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="EndEvent_0qdq7wj_di" bpmnElement="CreateVfModuleBB_End"> - <dc:Bounds x="1215" y="293" width="36" height="36" /> + <dc:Bounds x="1300" y="450" width="36" height="36" /> <bpmndi:BPMNLabel> - <dc:Bounds x="1136" y="333" width="0" height="0" /> + <dc:Bounds x="1176" y="446" width="90" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="ServiceTask_1dgenhy_di" bpmnElement="CreateVfModule"> - <dc:Bounds x="709" y="66" width="100" height="80" /> + <dc:Bounds x="794" y="66" width="100" height="80" /> </bpmndi:BPMNShape> - <bpmndi:BPMNEdge id="SequenceFlow_15hn8si_di" bpmnElement="SequenceFlow_15hn8si"> - <di:waypoint x="613" y="106" /> - <di:waypoint x="709" y="106" /> - <bpmndi:BPMNLabel> - <dc:Bounds x="519" y="91" width="90" height="0" /> - </bpmndi:BPMNLabel> - </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="SequenceFlow_1s4rpyp_di" bpmnElement="SequenceFlow_1s4rpyp"> - <di:waypoint x="413" y="106" /> - <di:waypoint x="513" y="106" /> + <di:waypoint xsi:type="dc:Point" x="413" y="106" /> + <di:waypoint xsi:type="dc:Point" x="513" y="106" /> <bpmndi:BPMNLabel> <dc:Bounds x="321" y="91" width="90" height="0" /> </bpmndi:BPMNLabel> @@ -134,124 +142,166 @@ <bpmndi:BPMNShape id="ServiceTask_1frb5h2_di" bpmnElement="QueryVnf"> <dc:Bounds x="313" y="66" width="100" height="80" /> </bpmndi:BPMNShape> - <bpmndi:BPMNEdge id="SequenceFlow_16g4dz0_di" bpmnElement="SequenceFlow_16g4dz0"> - <di:waypoint x="809" y="106" /> - <di:waypoint x="887" y="106" /> - <bpmndi:BPMNLabel> - <dc:Bounds x="751" y="91" width="0" height="0" /> - </bpmndi:BPMNLabel> - </bpmndi:BPMNEdge> - <bpmndi:BPMNEdge id="SequenceFlow_0ecr393_di" bpmnElement="SequenceFlow_0ecr393"> - <di:waypoint x="987" y="107" /> - <di:waypoint x="1091" y="107" /> - <di:waypoint x="1091" y="209" /> - <di:waypoint x="680" y="209" /> - <bpmndi:BPMNLabel> - <dc:Bounds x="534" y="194" width="0" height="0" /> - </bpmndi:BPMNLabel> - </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="CallActivity_1i1pfzb_di" bpmnElement="VnfAdapter"> - <dc:Bounds x="887" y="66" width="100" height="80" /> + <dc:Bounds x="959" y="66" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="ServiceTask_0fpfn71_di" bpmnElement="UpdateVfModuleStatus"> - <dc:Bounds x="1039" y="271" width="100" height="80" /> + <dc:Bounds x="1124" y="428" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="ServiceTask_04k1b85_di" bpmnElement="UpdateVfModuleHeatStackId"> - <dc:Bounds x="874" y="271" width="100" height="80" /> + <dc:Bounds x="959" y="428" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="SubProcess_1getwnf_di" bpmnElement="SubProcess_1getwnf" isExpanded="true"> - <dc:Bounds x="233" y="439" width="231" height="135" /> + <dc:Bounds x="202" y="556" width="231" height="135" /> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="StartEvent_1c8o652_di" bpmnElement="StartEvent_1c8o652"> - <dc:Bounds x="272" y="497" width="36" height="36" /> + <dc:Bounds x="241" y="614" width="36" height="36" /> <bpmndi:BPMNLabel> - <dc:Bounds x="148" y="533" width="0" height="0" /> + <dc:Bounds x="72" y="606" width="90" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="EndEvent_1emam1w_di" bpmnElement="EndEvent_1emam1w"> - <dc:Bounds x="409" y="497" width="36" height="36" /> + <dc:Bounds x="378" y="614" width="36" height="36" /> <bpmndi:BPMNLabel> - <dc:Bounds x="285" y="533" width="0" height="0" /> + <dc:Bounds x="209" y="606" width="90" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="SequenceFlow_0gcots6_di" bpmnElement="SequenceFlow_0gcots6"> - <di:waypoint x="308" y="515" /> - <di:waypoint x="409" y="515" /> + <di:waypoint xsi:type="dc:Point" x="277" y="632" /> + <di:waypoint xsi:type="dc:Point" x="378" y="632" /> <bpmndi:BPMNLabel> - <dc:Bounds x="262" y="494" width="0" height="0" /> + <dc:Bounds x="186" y="567" width="90" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="SequenceFlow_0rds4rj_di" bpmnElement="SequenceFlow_0rds4rj"> - <di:waypoint x="974" y="311" /> - <di:waypoint x="1039" y="311" /> + <di:waypoint xsi:type="dc:Point" x="1059" y="468" /> + <di:waypoint xsi:type="dc:Point" x="1124" y="468" /> <bpmndi:BPMNLabel> - <dc:Bounds x="910" y="296" width="0" height="0" /> + <dc:Bounds x="950" y="409" width="90" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="SequenceFlow_1vbwdaw_di" bpmnElement="SequenceFlow_1vbwdaw"> - <di:waypoint x="1139" y="311" /> - <di:waypoint x="1180" y="311" /> - <di:waypoint x="1180" y="311" /> - <di:waypoint x="1215" y="311" /> + <di:waypoint xsi:type="dc:Point" x="1224" y="468" /> + <di:waypoint xsi:type="dc:Point" x="1265" y="468" /> + <di:waypoint xsi:type="dc:Point" x="1265" y="468" /> + <di:waypoint xsi:type="dc:Point" x="1300" y="468" /> <bpmndi:BPMNLabel> - <dc:Bounds x="1098" y="311" width="0" height="0" /> + <dc:Bounds x="1138" y="424" width="90" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="ServiceTask_1v8zx4s_di" bpmnElement="CreateNetworkPolicies"> - <dc:Bounds x="239" y="271" width="100" height="80" /> + <dc:Bounds x="324" y="428" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="SequenceFlow_0xqhep5_di" bpmnElement="SequenceFlow_0xqhep5"> - <di:waypoint x="339" y="311" /> - <di:waypoint x="392" y="311" /> + <di:waypoint xsi:type="dc:Point" x="424" y="468" /> + <di:waypoint xsi:type="dc:Point" x="477" y="468" /> <bpmndi:BPMNLabel> - <dc:Bounds x="269" y="296" width="0" height="0" /> + <dc:Bounds x="309" y="409" width="90" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="ServiceTask_015ayw5_di" bpmnElement="UpdateVnfIpv4OamAddress"> - <dc:Bounds x="392" y="271" width="100" height="80" /> + <dc:Bounds x="477" y="428" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="SequenceFlow_1yo6mvv_di" bpmnElement="SequenceFlow_1yo6mvv"> - <di:waypoint x="492" y="311" /> - <di:waypoint x="561" y="311" /> + <di:waypoint xsi:type="dc:Point" x="577" y="468" /> + <di:waypoint xsi:type="dc:Point" x="646" y="468" /> <bpmndi:BPMNLabel> - <dc:Bounds x="430" y="296" width="0" height="0" /> + <dc:Bounds x="470" y="409" width="90" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="ServiceTask_0mlfsc9_di" bpmnElement="UpdateVnfManagementV6Address"> - <dc:Bounds x="561" y="271" width="100" height="80" /> + <dc:Bounds x="646" y="428" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="SequenceFlow_1i03uy2_di" bpmnElement="SequenceFlow_1i03uy2"> - <di:waypoint x="661" y="311" /> - <di:waypoint x="709" y="311" /> + <di:waypoint xsi:type="dc:Point" x="746" y="468" /> + <di:waypoint xsi:type="dc:Point" x="794" y="468" /> <bpmndi:BPMNLabel> - <dc:Bounds x="588" y="296" width="0" height="0" /> + <dc:Bounds x="628" y="409" width="90" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="ServiceTask_0wctnhw_di" bpmnElement="UpdateVfModuleContrailServiceInstanceFqdn"> - <dc:Bounds x="709" y="271" width="100" height="80" /> + <dc:Bounds x="794" y="428" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="SequenceFlow_15do1tu_di" bpmnElement="SequenceFlow_15do1tu"> - <di:waypoint x="809" y="311" /> - <di:waypoint x="874" y="311" /> + <di:waypoint xsi:type="dc:Point" x="894" y="468" /> + <di:waypoint xsi:type="dc:Point" x="959" y="468" /> <bpmndi:BPMNLabel> - <dc:Bounds x="745" y="286" width="0" height="0" /> + <dc:Bounds x="785" y="399" width="90" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="ServiceTask_01zrt6x_di" bpmnElement="ServiceTask_01zrt6x"> - <dc:Bounds x="580" y="169" width="100" height="80" /> + <dc:Bounds x="665" y="326" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="SequenceFlow_1io8r33_di" bpmnElement="SequenceFlow_1io8r33"> - <di:waypoint x="580" y="209" /> - <di:waypoint x="478" y="209" /> + <di:waypoint xsi:type="dc:Point" x="665" y="366" /> + <di:waypoint xsi:type="dc:Point" x="563" y="366" /> + <bpmndi:BPMNLabel> + <dc:Bounds x="569" y="297" width="90" height="20" /> + </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="ServiceTask_00d84m7_di" bpmnElement="ServiceTask_00d84m7"> - <dc:Bounds x="378" y="169" width="100" height="80" /> + <dc:Bounds x="463" y="326" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="SequenceFlow_1yn8o6d_di" bpmnElement="SequenceFlow_1yn8o6d"> - <di:waypoint x="378" y="209" /> - <di:waypoint x="170" y="209" /> - <di:waypoint x="170" y="306" /> - <di:waypoint x="239" y="306" /> + <di:waypoint xsi:type="dc:Point" x="463" y="366" /> + <di:waypoint xsi:type="dc:Point" x="255" y="366" /> + <di:waypoint xsi:type="dc:Point" x="255" y="463" /> + <di:waypoint xsi:type="dc:Point" x="324" y="463" /> + <bpmndi:BPMNLabel> + <dc:Bounds x="225" y="361" width="90" height="20" /> + </bpmndi:BPMNLabel> + </bpmndi:BPMNEdge> + <bpmndi:BPMNShape id="ExclusiveGateway_1g3vemz_di" bpmnElement="CheckIfIsHelm" isMarkerVisible="true"> + <dc:Bounds x="690.2114427860697" y="81.35572139303483" width="50" height="50" /> + <bpmndi:BPMNLabel> + <dc:Bounds x="673" y="48" width="84" height="12" /> + </bpmndi:BPMNLabel> + </bpmndi:BPMNShape> + <bpmndi:BPMNShape id="ServiceTask_0tag50w_di" bpmnElement="CnfAdapter"> + <dc:Bounds x="665" y="166" width="100" height="80" /> + </bpmndi:BPMNShape> + <bpmndi:BPMNEdge id="SequenceFlow_0q1janp_di" bpmnElement="YesHelm"> + <di:waypoint xsi:type="dc:Point" x="715" y="131" /> + <di:waypoint xsi:type="dc:Point" x="715" y="166" /> + <bpmndi:BPMNLabel> + <dc:Bounds x="730" y="136" width="0" height="12" /> + </bpmndi:BPMNLabel> + </bpmndi:BPMNEdge> + <bpmndi:BPMNEdge id="SequenceFlow_1mg8eym_di" bpmnElement="SequenceFlow_1mg8eym"> + <di:waypoint xsi:type="dc:Point" x="715" y="246" /> + <di:waypoint xsi:type="dc:Point" x="715" y="326" /> + <bpmndi:BPMNLabel> + <dc:Bounds x="846" y="291.5" width="0" height="12" /> + </bpmndi:BPMNLabel> + </bpmndi:BPMNEdge> + <bpmndi:BPMNEdge id="SequenceFlow_1ig2ix4_di" bpmnElement="SequenceFlow_1ig2ix4"> + <di:waypoint xsi:type="dc:Point" x="613" y="106" /> + <di:waypoint xsi:type="dc:Point" x="691" y="106" /> + <bpmndi:BPMNLabel> + <dc:Bounds x="652" y="85" width="0" height="12" /> + </bpmndi:BPMNLabel> + </bpmndi:BPMNEdge> + <bpmndi:BPMNEdge id="SequenceFlow_1g7zahc_di" bpmnElement="NoHelm"> + <di:waypoint xsi:type="dc:Point" x="740" y="106" /> + <di:waypoint xsi:type="dc:Point" x="794" y="106" /> + <bpmndi:BPMNLabel> + <dc:Bounds x="767" y="85" width="0" height="12" /> + </bpmndi:BPMNLabel> + </bpmndi:BPMNEdge> + <bpmndi:BPMNEdge id="SequenceFlow_0dehck5_di" bpmnElement="SequenceFlow_0dehck5"> + <di:waypoint xsi:type="dc:Point" x="894" y="106" /> + <di:waypoint xsi:type="dc:Point" x="959" y="106" /> + <bpmndi:BPMNLabel> + <dc:Bounds x="926.5" y="85" width="0" height="12" /> + </bpmndi:BPMNLabel> + </bpmndi:BPMNEdge> + <bpmndi:BPMNEdge id="SequenceFlow_0uetprw_di" bpmnElement="SequenceFlow_0uetprw"> + <di:waypoint xsi:type="dc:Point" x="1009" y="146" /> + <di:waypoint xsi:type="dc:Point" x="1009" y="366" /> + <di:waypoint xsi:type="dc:Point" x="765" y="366" /> + <bpmndi:BPMNLabel> + <dc:Bounds x="1024" y="228" width="0" height="12" /> + </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> </bpmndi:BPMNPlane> </bpmndi:BPMNDiagram> diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoAllocateNSSI.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoAllocateNSSI.groovy index 081dddab99..88edd79d6d 100644 --- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoAllocateNSSI.groovy +++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoAllocateNSSI.groovy @@ -15,8 +15,8 @@ import org.onap.so.beans.nsmf.NetworkType import org.onap.so.beans.nsmf.NsiInfo import org.onap.so.beans.nsmf.NssiAllocateRequest import org.onap.so.beans.nsmf.PerfReq -import org.onap.so.beans.nsmf.PerfReqEmbbList -import org.onap.so.beans.nsmf.PerfReqUrllcList +import org.onap.so.beans.nsmf.PerfReqEmbb +import org.onap.so.beans.nsmf.PerfReqUrllc import org.onap.so.beans.nsmf.ResourceSharingLevel import org.onap.so.beans.nsmf.SliceTaskParams import org.onap.so.beans.nsmf.TnSliceProfile @@ -411,20 +411,20 @@ class DoAllocateNSSI extends org.onap.so.bpmn.common.scripts.AbstractServiceTask execution.setVariable("esrInfo",esrInfo) - PerfReqEmbbList perfReqEmbb = new PerfReqEmbbList() + PerfReqEmbb perfReqEmbb = new PerfReqEmbb() perfReqEmbb.setActivityFactor(sliceProfileCn.get("activityFactor")) perfReqEmbb.setAreaTrafficCapDL(sliceProfileCn.get("areaTrafficCapDL")) perfReqEmbb.setAreaTrafficCapUL(sliceProfileCn.get("areaTrafficCapUL")) perfReqEmbb.setExpDataRateDL(sliceProfileCn.get("expDataRateDL")) perfReqEmbb.setExpDataRateUL(sliceProfileCn.get("expDataRateUL")) - List<PerfReqEmbbList> listPerfReqEmbbList = new ArrayList<>() + List<PerfReqEmbb> listPerfReqEmbbList = new ArrayList<>() listPerfReqEmbbList.add(perfReqEmbb) PerfReq perfReq = new PerfReq() perfReq.setPerfReqEmbbList(listPerfReqEmbbList) - PerfReqUrllcList perfReqUrllc = new PerfReqUrllcList() + PerfReqUrllc perfReqUrllc = new PerfReqUrllc() perfReqUrllc.setConnDensity(0) perfReqUrllc.setTrafficDensity(0) perfReqUrllc.setExpDataRate(0) @@ -436,7 +436,7 @@ class DoAllocateNSSI extends org.onap.so.bpmn.common.scripts.AbstractServiceTask perfReqUrllc.setPayloadSize("0") perfReqUrllc.setServiceAreaDimension("") - List<PerfReqUrllcList> perfReqUrllcList = new ArrayList<>() + List<PerfReqUrllc> perfReqUrllcList = new ArrayList<>() perfReqUrllcList.add(perfReqUrllc) perfReq.setPerfReqUrllcList(perfReqUrllcList) @@ -558,20 +558,20 @@ class DoAllocateNSSI extends org.onap.so.bpmn.common.scripts.AbstractServiceTask execution.setVariable("esrInfo",esrInfo) - PerfReqEmbbList perfReqEmbb = new PerfReqEmbbList() + PerfReqEmbb perfReqEmbb = new PerfReqEmbb() perfReqEmbb.setActivityFactor(sliceProfileCn.get("activityFactor")) perfReqEmbb.setAreaTrafficCapDL(sliceProfileCn.get("areaTrafficCapDL")) perfReqEmbb.setAreaTrafficCapUL(sliceProfileCn.get("areaTrafficCapUL")) perfReqEmbb.setExpDataRateDL(sliceProfileCn.get("expDataRateDL")) perfReqEmbb.setExpDataRateUL(sliceProfileCn.get("expDataRateUL")) - List<PerfReqEmbbList> listPerfReqEmbbList = new ArrayList<>() + List<PerfReqEmbb> listPerfReqEmbbList = new ArrayList<>() listPerfReqEmbbList.add(perfReqEmbb) PerfReq perfReq = new PerfReq() perfReq.setPerfReqEmbbList(listPerfReqEmbbList) - PerfReqUrllcList perfReqUrllc = new PerfReqUrllcList() + PerfReqUrllc perfReqUrllc = new PerfReqUrllc() perfReqUrllc.setConnDensity(0) perfReqUrllc.setTrafficDensity(0) perfReqUrllc.setExpDataRate(0) @@ -583,7 +583,7 @@ class DoAllocateNSSI extends org.onap.so.bpmn.common.scripts.AbstractServiceTask perfReqUrllc.setPayloadSize("0") perfReqUrllc.setServiceAreaDimension("") - List<PerfReqUrllcList> perfReqUrllcList = new ArrayList<>() + List<PerfReqUrllc> perfReqUrllcList = new ArrayList<>() perfReqUrllcList.add(perfReqUrllc) perfReq.setPerfReqUrllcList(perfReqUrllcList) diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/cnf/tasks/CnfAdapterCreateTasks.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/cnf/tasks/CnfAdapterCreateTasks.java new file mode 100644 index 0000000000..93d30512b6 --- /dev/null +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/cnf/tasks/CnfAdapterCreateTasks.java @@ -0,0 +1,121 @@ +/*- + * ============LICENSE_START======================================================= + * ONAP - SO + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Modifications Copyright (c) 2019 Samsung + * ================================================================================ + * 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.bpmn.infrastructure.adapter.cnf.tasks; + +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; +import org.onap.so.bpmn.common.BuildingBlockExecution; +import org.onap.so.bpmn.servicedecomposition.bbobjects.CloudRegion; +import org.onap.so.bpmn.servicedecomposition.bbobjects.GenericVnf; +import org.onap.so.bpmn.servicedecomposition.bbobjects.ServiceInstance; +import org.onap.so.bpmn.servicedecomposition.bbobjects.VfModule; +import org.onap.so.bpmn.servicedecomposition.entities.GeneralBuildingBlock; +import org.onap.so.bpmn.servicedecomposition.entities.ResourceKey; +import org.onap.so.bpmn.servicedecomposition.generalobjects.RequestContext; +import org.onap.so.bpmn.servicedecomposition.tasks.ExtractPojosForBB; +import org.onap.so.client.adapter.cnf.CnfAdapterClient; +import org.onap.so.client.adapter.cnf.entities.InstanceRequest; +import org.onap.so.client.adapter.cnf.entities.InstanceResponse; +import org.onap.so.client.adapter.vnf.mapper.AttributeNameValue; +import org.onap.so.client.adapter.vnf.mapper.Attributes; +import org.onap.so.client.adapter.vnf.mapper.VnfAdapterVfModuleObjectMapper; +import org.onap.so.client.exception.ExceptionBuilder; +import org.onap.so.openstack.utils.MsoMulticloudUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.databind.JsonMappingException; +import com.fasterxml.jackson.databind.ObjectMapper; + +@Component +public class CnfAdapterCreateTasks { + private static final Logger logger = LoggerFactory.getLogger(CnfAdapterCreateTasks.class); + public static final String SDNCQUERY_RESPONSE = "SDNCQueryResponse_"; + + @Autowired + private ExtractPojosForBB extractPojosForBB; + @Autowired + private ExceptionBuilder exceptionUtil; + @Autowired + private CnfAdapterClient cnfAdapterClient; + @Autowired + private VnfAdapterVfModuleObjectMapper vfModuleMapper; + + private ObjectMapper mapper = new ObjectMapper(); + + /** + * This method is used for creating the request for an Instance in Multicloud K8s Plugin. + * + * @param execution + * @return + */ + public void createInstance(BuildingBlockExecution execution) { + try { + GeneralBuildingBlock gBBInput = execution.getGeneralBuildingBlock(); + ServiceInstance serviceInstance = + gBBInput.getCustomer().getServiceSubscription().getServiceInstances().get(0); + GenericVnf genericVnf = extractPojosForBB.extractByKey(execution, ResourceKey.GENERIC_VNF_ID); + VfModule vfModule = extractPojosForBB.extractByKey(execution, ResourceKey.VF_MODULE_ID); + RequestContext requestContext = gBBInput.getRequestContext(); + CloudRegion cloudRegion = gBBInput.getCloudRegion(); + String sdncVfModuleQueryResponse = execution.getVariable(SDNCQUERY_RESPONSE + vfModule.getVfModuleId()); + String sdncVnfQueryResponse = execution.getVariable(SDNCQUERY_RESPONSE + genericVnf.getVnfId()); + Map<String, Object> paramsMap = vfModuleMapper.buildVfModuleParamsMap(requestContext, serviceInstance, + genericVnf, vfModule, sdncVnfQueryResponse, sdncVfModuleQueryResponse); + Map<String, String> sdncDirectives = getSdncDirectives(paramsMap); + InstanceRequest createInstanceRequest = createInstanceRequest(vfModule, cloudRegion, sdncDirectives); + InstanceResponse response = cnfAdapterClient.createVfModule(createInstanceRequest); + execution.setVariable("heatStackId", response.getId()); + } catch (Exception ex) { + logger.error("Exception occurred", ex); + exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex); + } + } + + protected Map<String, String> getSdncDirectives(Map<String, Object> paramsMap) + throws JsonParseException, JsonMappingException, IOException { + Map<String, String> sdncDirectivesMap = new HashMap<>(); + String sdncDirectivesString = (String) paramsMap.get(MsoMulticloudUtils.SDNC_DIRECTIVES); + Attributes sdncDirectives = mapper.readValue(sdncDirectivesString, Attributes.class); + for (AttributeNameValue nameVal : sdncDirectives.getAttributes()) { + sdncDirectivesMap.put(nameVal.getAttributeName(), (String) nameVal.getAttributeValue()); + } + return sdncDirectivesMap; + } + + protected InstanceRequest createInstanceRequest(VfModule vfModule, CloudRegion cloudRegion, + Map<String, String> sdncDirectives) { + InstanceRequest request = new InstanceRequest(); + request.setRbName(vfModule.getModelInfoVfModule().getModelInvariantUUID()); + request.setRbVersion(vfModule.getModelInfoVfModule().getModelUUID()); + request.setCloudRegion(cloudRegion.getLcpCloudRegionId()); + request.setReleaseName(vfModule.getVfModuleId()); + request.setProfileName(sdncDirectives.get("k8s-rb-profile-name")); + request.setOverrideValues(sdncDirectives); + return request; + } + +} diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/adapter/cnf/CnfAdapterClient.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/adapter/cnf/CnfAdapterClient.java new file mode 100644 index 0000000000..f44c15ac54 --- /dev/null +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/adapter/cnf/CnfAdapterClient.java @@ -0,0 +1,97 @@ +/*- + * ============LICENSE_START======================================================= + * ONAP - SO + * ================================================================================ + * Copyright (C) 2017 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.so.client.adapter.cnf; + +import java.util.ArrayList; +import java.util.List; +import javax.persistence.EntityNotFoundException; +import javax.ws.rs.core.UriBuilder; +import org.apache.http.HttpStatus; +import org.onap.so.client.adapter.cnf.entities.InstanceRequest; +import org.onap.so.client.adapter.cnf.entities.InstanceResponse; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.core.env.Environment; +import org.springframework.http.HttpEntity; +import org.springframework.http.HttpHeaders; +import org.springframework.http.HttpMethod; +import org.springframework.http.ResponseEntity; +import org.springframework.retry.annotation.Backoff; +import org.springframework.retry.annotation.Retryable; +import org.springframework.stereotype.Component; +import org.springframework.web.client.HttpClientErrorException; +import org.springframework.web.client.HttpServerErrorException; +import org.springframework.web.client.RestTemplate; + +@Component +public class CnfAdapterClient { + + private static final Logger logger = LoggerFactory.getLogger(CnfAdapterClient.class); + + @Autowired + private RestTemplate restTemplate; + + @Autowired + private Environment env; + + private static final String INSTANCE_CREATE_PATH = "/api/multicloud-k8s/v1/v1/instance"; + + @Retryable(value = {HttpServerErrorException.class}, maxAttempts = 3, backoff = @Backoff(delay = 3000)) + public InstanceResponse createVfModule(InstanceRequest request) throws CnfAdapterClientException { + try { + // String uri = env.getRequiredProperty("mso.cnf.adapter.endpoint"); //TODO: This needs to be added as well + // for configuration + String uri = "https://localhost:32780"; // TODO: What is the correct uri? + String endpoint = UriBuilder.fromUri(uri).path(INSTANCE_CREATE_PATH).build().toString(); + HttpEntity<?> entity = getHttpEntity(request); + ResponseEntity<InstanceResponse> result = + restTemplate.exchange(endpoint, HttpMethod.POST, entity, InstanceResponse.class); + return result.getBody(); + } catch (HttpClientErrorException e) { + logger.error("Error Calling CNF Adapter, e"); + if (HttpStatus.SC_NOT_FOUND == e.getStatusCode().value()) { + throw new EntityNotFoundException(e.getResponseBodyAsString()); + } + throw e; + } + } + + protected HttpHeaders getHttpHeaders() { + HttpHeaders headers = new HttpHeaders(); + List<org.springframework.http.MediaType> acceptableMediaTypes = new ArrayList<>(); + acceptableMediaTypes.add(org.springframework.http.MediaType.APPLICATION_JSON); + headers.setAccept(acceptableMediaTypes); + /* + * try { String userCredentials = CryptoUtils.decrypt(env.getRequiredProperty("mso.cnf.adapter.auth"), + * env.getRequiredProperty("mso.msoKey")); if (userCredentials != null) { headers.add(HttpHeaders.AUTHORIZATION, + * "Basic " + DatatypeConverter.printBase64Binary(userCredentials.getBytes())); } } catch + * (GeneralSecurityException e) { logger.error("Security exception", e); } + */ + return headers; + } + + protected HttpEntity<?> getHttpEntity(InstanceRequest request) { + HttpHeaders headers = getHttpHeaders(); + return new HttpEntity<>(request, headers); + } + +} diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/adapter/cnf/CnfAdapterClientException.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/adapter/cnf/CnfAdapterClientException.java new file mode 100644 index 0000000000..d716070ffa --- /dev/null +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/adapter/cnf/CnfAdapterClientException.java @@ -0,0 +1,34 @@ +/*- + * ============LICENSE_START======================================================= + * ONAP - SO + * ================================================================================ + * Copyright (C) 2017 - 2018 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.so.client.adapter.cnf; + +public class CnfAdapterClientException extends Exception { + + /** + * + */ + private static final long serialVersionUID = -7154784472485852602L; + + public CnfAdapterClientException(String message) { + super(message); + } + +} diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/adapter/cnf/entities/GVK.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/adapter/cnf/entities/GVK.java new file mode 100644 index 0000000000..3ed6894fcf --- /dev/null +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/adapter/cnf/entities/GVK.java @@ -0,0 +1,49 @@ + +package org.onap.so.client.adapter.cnf.entities; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonPropertyOrder({"Group", "Version", "Kind"}) +public class GVK { + + @JsonProperty("Group") + private String group; + @JsonProperty("Version") + private String version; + @JsonProperty("Kind") + private String kind; + + @JsonProperty("Group") + public String getGroup() { + return group; + } + + @JsonProperty("Group") + public void setGroup(String group) { + this.group = group; + } + + @JsonProperty("Version") + public String getVersion() { + return version; + } + + @JsonProperty("Version") + public void setVersion(String version) { + this.version = version; + } + + @JsonProperty("Kind") + public String getKind() { + return kind; + } + + @JsonProperty("Kind") + public void setKind(String kind) { + this.kind = kind; + } + +} diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/adapter/cnf/entities/InstanceRequest.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/adapter/cnf/entities/InstanceRequest.java new file mode 100644 index 0000000000..e4058097ab --- /dev/null +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/adapter/cnf/entities/InstanceRequest.java @@ -0,0 +1,95 @@ + +package org.onap.so.client.adapter.cnf.entities; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonPropertyOrder({"rb-name", "rb-version", "profile-name", "release-name", "cloud-region", "labels", + "override-values"}) +public class InstanceRequest { + + @JsonProperty("rb-name") + private String rbName; + @JsonProperty("rb-version") + private String rbVersion; + @JsonProperty("profile-name") + private String profileName; + @JsonProperty("release-name") + private String releaseName; + @JsonProperty("cloud-region") + private String cloudRegion; + @JsonProperty("labels") + private Labels labels; + @JsonProperty(value = "override-values") + private Map<String, String> overrideValues; + + @JsonProperty("rb-name") + public String getRbName() { + return rbName; + } + + @JsonProperty("rb-name") + public void setRbName(String rbName) { + this.rbName = rbName; + } + + @JsonProperty("rb-version") + public String getRbVersion() { + return rbVersion; + } + + @JsonProperty("rb-version") + public void setRbVersion(String rbVersion) { + this.rbVersion = rbVersion; + } + + @JsonProperty("profile-name") + public String getProfileName() { + return profileName; + } + + @JsonProperty("profile-name") + public void setProfileName(String profileName) { + this.profileName = profileName; + } + + @JsonProperty("cloud-region") + public String getCloudRegion() { + return cloudRegion; + } + + @JsonProperty("cloud-region") + public void setCloudRegion(String cloudRegion) { + this.cloudRegion = cloudRegion; + } + + @JsonProperty("labels") + public Labels getLabels() { + return labels; + } + + @JsonProperty("labels") + public void setLabels(Labels labels) { + this.labels = labels; + } + + public String getReleaseName() { + return releaseName; + } + + public void setReleaseName(String releaseName) { + this.releaseName = releaseName; + } + + public Map<String, String> getOverrideValues() { + return overrideValues; + } + + public void setOverrideValues(Map<String, String> overrideValues) { + this.overrideValues = overrideValues; + } + +} diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/adapter/cnf/entities/InstanceResponse.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/adapter/cnf/entities/InstanceResponse.java new file mode 100644 index 0000000000..e38bcc2664 --- /dev/null +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/adapter/cnf/entities/InstanceResponse.java @@ -0,0 +1,62 @@ + +package org.onap.so.client.adapter.cnf.entities; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonPropertyOrder({"id", "request", "namespace", "resources"}) +public class InstanceResponse { + + @JsonProperty("id") + private String id; + @JsonProperty("request") + private InstanceRequest request; + @JsonProperty("namespace") + private String namespace; + @JsonProperty("resources") + private List<Resource> resources = null; + + @JsonProperty("id") + public String getId() { + return id; + } + + @JsonProperty("id") + public void setId(String id) { + this.id = id; + } + + @JsonProperty("request") + public InstanceRequest getRequest() { + return request; + } + + @JsonProperty("request") + public void setRequest(InstanceRequest request) { + this.request = request; + } + + @JsonProperty("namespace") + public String getNamespace() { + return namespace; + } + + @JsonProperty("namespace") + public void setNamespace(String namespace) { + this.namespace = namespace; + } + + @JsonProperty("resources") + public List<Resource> getResources() { + return resources; + } + + @JsonProperty("resources") + public void setResources(List<Resource> resources) { + this.resources = resources; + } + +} diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/adapter/cnf/entities/Labels.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/adapter/cnf/entities/Labels.java new file mode 100644 index 0000000000..1df2e59459 --- /dev/null +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/adapter/cnf/entities/Labels.java @@ -0,0 +1,25 @@ + +package org.onap.so.client.adapter.cnf.entities; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonPropertyOrder({"testCaseName"}) +public class Labels { + + @JsonProperty("testCaseName") + private String testCaseName; + + @JsonProperty("testCaseName") + public String getTestCaseName() { + return testCaseName; + } + + @JsonProperty("testCaseName") + public void setTestCaseName(String testCaseName) { + this.testCaseName = testCaseName; + } + +} diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/adapter/cnf/entities/Resource.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/adapter/cnf/entities/Resource.java new file mode 100644 index 0000000000..bde495aaa2 --- /dev/null +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/adapter/cnf/entities/Resource.java @@ -0,0 +1,37 @@ + +package org.onap.so.client.adapter.cnf.entities; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonPropertyOrder({"GVK", "Name"}) +public class Resource { + + @JsonProperty("GVK") + private GVK gVK; + @JsonProperty("Name") + private String name; + + @JsonProperty("GVK") + public GVK getGVK() { + return gVK; + } + + @JsonProperty("GVK") + public void setGVK(GVK gVK) { + this.gVK = gVK; + } + + @JsonProperty("Name") + public String getName() { + return name; + } + + @JsonProperty("Name") + public void setName(String name) { + this.name = name; + } + +} diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/adapter/vnf/mapper/Attributes.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/adapter/vnf/mapper/Attributes.java new file mode 100644 index 0000000000..6d79c20616 --- /dev/null +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/adapter/vnf/mapper/Attributes.java @@ -0,0 +1,23 @@ +package org.onap.so.client.adapter.vnf.mapper; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +public class Attributes implements Serializable { + + private static final long serialVersionUID = -5782985934617532582L; + + @JsonProperty("attributes") + private List<AttributeNameValue> attributes = new ArrayList<>(); + + public List<AttributeNameValue> getAttributes() { + return attributes; + } + + public void setAttributes(List<AttributeNameValue> attributes) { + this.attributes = attributes; + } + +} diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/adapter/vnf/mapper/VnfAdapterVfModuleObjectMapper.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/adapter/vnf/mapper/VnfAdapterVfModuleObjectMapper.java index bc618e17de..59da22f8e1 100644 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/adapter/vnf/mapper/VnfAdapterVfModuleObjectMapper.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/adapter/vnf/mapper/VnfAdapterVfModuleObjectMapper.java @@ -178,7 +178,7 @@ public class VnfAdapterVfModuleObjectMapper { return msoRequest; } - private Map<String, Object> buildVfModuleParamsMap(RequestContext requestContext, ServiceInstance serviceInstance, + public Map<String, Object> buildVfModuleParamsMap(RequestContext requestContext, ServiceInstance serviceInstance, GenericVnf genericVnf, VfModule vfModule, String sdncVnfQueryResponse, String sdncVfModuleQueryResponse) throws IOException, MissingValueTagException { diff --git a/common/src/main/java/org/onap/so/beans/nsmf/AnPerfReq.java b/common/src/main/java/org/onap/so/beans/nsmf/AnPerfReq.java new file mode 100644 index 0000000000..418f8a5065 --- /dev/null +++ b/common/src/main/java/org/onap/so/beans/nsmf/AnPerfReq.java @@ -0,0 +1,47 @@ +/*- + * ============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.beans.nsmf; + +import com.fasterxml.jackson.annotation.JsonInclude; + +@JsonInclude(JsonInclude.Include.NON_NULL) +public class AnPerfReq { + + private PerfReqEmbb perfReqEmbb; + + private PerfReqUrllc perfReqUrllc; + + public PerfReqEmbb getPerfReqEmbb() { + return perfReqEmbb; + } + + public void setPerfReqEmbb(PerfReqEmbb perfReqEmbb) { + this.perfReqEmbb = perfReqEmbb; + } + + public PerfReqUrllc getPerfReqUrllc() { + return perfReqUrllc; + } + + public void setPerfReqUrllc(PerfReqUrllc perfReqUrllc) { + this.perfReqUrllc = perfReqUrllc; + } +} diff --git a/common/src/main/java/org/onap/so/beans/nsmf/AnSliceProfile.java b/common/src/main/java/org/onap/so/beans/nsmf/AnSliceProfile.java index 653f9ac495..26c3c0012a 100644 --- a/common/src/main/java/org/onap/so/beans/nsmf/AnSliceProfile.java +++ b/common/src/main/java/org/onap/so/beans/nsmf/AnSliceProfile.java @@ -21,7 +21,6 @@ package org.onap.so.beans.nsmf; import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; import lombok.Data; import java.util.List; @@ -33,17 +32,17 @@ public class AnSliceProfile { private String sliceProfileId; - private List<String> coverageAreaTAList; + private List<Integer> coverageAreaTAList; @JsonInclude(JsonInclude.Include.NON_DEFAULT) private int latency; private List<String> pLMNIdList; - private PerfReq perfReq; + private AnPerfReq perfReq; @JsonInclude(JsonInclude.Include.NON_DEFAULT) - private int maxNumberofUEs; + private long maxNumberofUEs; private UeMobilityLevel uEMobilityLevel; diff --git a/common/src/main/java/org/onap/so/beans/nsmf/NssmfAdapterNBIRequest.java b/common/src/main/java/org/onap/so/beans/nsmf/NssmfAdapterNBIRequest.java index 7061ec2ff3..a44dbd636f 100644 --- a/common/src/main/java/org/onap/so/beans/nsmf/NssmfAdapterNBIRequest.java +++ b/common/src/main/java/org/onap/so/beans/nsmf/NssmfAdapterNBIRequest.java @@ -24,15 +24,14 @@ import lombok.Data; import java.io.Serializable; +@JsonInclude(JsonInclude.Include.NON_NULL) @Data public class NssmfAdapterNBIRequest implements Serializable { private static final long serialVersionUID = -454145891489457960L; - @JsonInclude(JsonInclude.Include.NON_NULL) private EsrInfo esrInfo; - @JsonInclude(JsonInclude.Include.NON_NULL) private ServiceInfo serviceInfo; private AllocateCnNssi allocateCnNssi; diff --git a/common/src/main/java/org/onap/so/beans/nsmf/PerfReq.java b/common/src/main/java/org/onap/so/beans/nsmf/PerfReq.java index 4aabc3f26f..c67f193a02 100644 --- a/common/src/main/java/org/onap/so/beans/nsmf/PerfReq.java +++ b/common/src/main/java/org/onap/so/beans/nsmf/PerfReq.java @@ -26,23 +26,23 @@ import java.util.List; @JsonInclude(JsonInclude.Include.NON_NULL) public class PerfReq { - private List<PerfReqEmbbList> perfReqEmbbList; + private List<PerfReqEmbb> perfReqEmbbList; - private List<PerfReqUrllcList> perfReqUrllcList; + private List<PerfReqUrllc> perfReqUrllcList; - public List<PerfReqEmbbList> getPerfReqEmbbList() { + public List<PerfReqEmbb> getPerfReqEmbbList() { return perfReqEmbbList; } - public void setPerfReqEmbbList(List<PerfReqEmbbList> perfReqEmbbList) { + public void setPerfReqEmbbList(List<PerfReqEmbb> perfReqEmbbList) { this.perfReqEmbbList = perfReqEmbbList; } - public List<PerfReqUrllcList> getPerfReqUrllcList() { + public List<PerfReqUrllc> getPerfReqUrllcList() { return perfReqUrllcList; } - public void setPerfReqUrllcList(List<PerfReqUrllcList> perfReqUrllcList) { + public void setPerfReqUrllcList(List<PerfReqUrllc> perfReqUrllcList) { this.perfReqUrllcList = perfReqUrllcList; } } diff --git a/common/src/main/java/org/onap/so/beans/nsmf/PerfReqEmbbList.java b/common/src/main/java/org/onap/so/beans/nsmf/PerfReqEmbb.java index 9e9fcaa19e..bce0d56f9a 100644 --- a/common/src/main/java/org/onap/so/beans/nsmf/PerfReqEmbbList.java +++ b/common/src/main/java/org/onap/so/beans/nsmf/PerfReqEmbb.java @@ -23,7 +23,7 @@ package org.onap.so.beans.nsmf; import com.fasterxml.jackson.annotation.JsonInclude; @JsonInclude(JsonInclude.Include.NON_NULL) -public class PerfReqEmbbList { +public class PerfReqEmbb { @JsonInclude(JsonInclude.Include.NON_DEFAULT) private int expDataRateDL; @@ -38,6 +38,9 @@ public class PerfReqEmbbList { private int areaTrafficCapUL; @JsonInclude(JsonInclude.Include.NON_DEFAULT) + private int overallUserDensity; + + @JsonInclude(JsonInclude.Include.NON_DEFAULT) private int activityFactor; public int getExpDataRateDL() { @@ -72,6 +75,14 @@ public class PerfReqEmbbList { this.areaTrafficCapUL = areaTrafficCapUL; } + public int getOverallUserDensity() { + return overallUserDensity; + } + + public void setOverallUserDensity(int overallUserDensity) { + this.overallUserDensity = overallUserDensity; + } + public int getActivityFactor() { return activityFactor; } diff --git a/common/src/main/java/org/onap/so/beans/nsmf/PerfReqUrllcList.java b/common/src/main/java/org/onap/so/beans/nsmf/PerfReqUrllc.java index 00f0a917aa..0b05d39bab 100644 --- a/common/src/main/java/org/onap/so/beans/nsmf/PerfReqUrllcList.java +++ b/common/src/main/java/org/onap/so/beans/nsmf/PerfReqUrllc.java @@ -23,7 +23,7 @@ package org.onap.so.beans.nsmf; import com.fasterxml.jackson.annotation.JsonInclude; @JsonInclude(JsonInclude.Include.NON_NULL) -public class PerfReqUrllcList { +public class PerfReqUrllc { @JsonInclude(JsonInclude.Include.NON_DEFAULT) private int e2eLatency; diff --git a/releases/1.7.1.cnf.yaml b/releases/1.7.1.cnf.yaml new file mode 100644 index 0000000000..b986786e5d --- /dev/null +++ b/releases/1.7.1.cnf.yaml @@ -0,0 +1,9 @@ +--- +distribution_type: 'container' +container_release_tag: '1.7.1' +project: 'so' +log_dir: 'so-maven-docker-stage-master/437/' +ref: '96f7bcf737cc10a3258b5c8cf11b5cc5fd1ee65c' +containers: + - name: 'so/mso-cnf-adapter' + version: '1.7.1-20200827T0421'
\ No newline at end of file diff --git a/so-monitoring/so-monitoring-service/pom.xml b/so-monitoring/so-monitoring-service/pom.xml index 6671ac56d4..4a0f6cbe1d 100644 --- a/so-monitoring/so-monitoring-service/pom.xml +++ b/so-monitoring/so-monitoring-service/pom.xml @@ -104,6 +104,24 @@ </executions> </plugin> </plugins> + <resources> + <resource> + <directory>src/main/resources</directory> + <filtering>true</filtering> + <excludes> + <exclude>**/*.p12</exclude> + <exclude>**/*.jks</exclude> + </excludes> + </resource> + <resource> + <directory>src/main/resources</directory> + <filtering>false</filtering> + <includes> + <include>**/*.p12</include> + <include>**/*.jks</include> + </includes> + </resource> + </resources> </build> </project> diff --git a/so-monitoring/so-monitoring-service/src/main/resources/application.yaml b/so-monitoring/so-monitoring-service/src/main/resources/application.yaml index dbccb76979..ef0b6aa786 100644 --- a/so-monitoring/so-monitoring-service/src/main/resources/application.yaml +++ b/so-monitoring/so-monitoring-service/src/main/resources/application.yaml @@ -1,8 +1,12 @@ server: + ssl: + keyStore: classpath:org.onap.so.p12 + keyStorePassword: 6IxlmmPs:HqNhzVP#VFuSs,% + trustStore: classpath:org.onap.so.trust.jks + trustStorePassword: 72z0TFN&xfSR;;&NrIP^QB,^ port: 9091 tomcat: max-threads: 50 -ssl-enable: false camunda: rest: api: @@ -19,3 +23,9 @@ mso: spring: main: allow-bean-definition-overriding: true + security: + usercredentials: + - + username: gui + password: '$2a$10$ndkDhATUid4a3g0JJVRv2esX4rtB.vzCn7iBhKyR1qZ/wDdvNzjTS' + role: GUI-Client diff --git a/so-monitoring/so-monitoring-service/src/main/resources/org.onap.so.p12 b/so-monitoring/so-monitoring-service/src/main/resources/org.onap.so.p12 Binary files differnew file mode 100644 index 0000000000..8fa921a884 --- /dev/null +++ b/so-monitoring/so-monitoring-service/src/main/resources/org.onap.so.p12 diff --git a/so-monitoring/so-monitoring-service/src/main/resources/org.onap.so.trust.jks b/so-monitoring/so-monitoring-service/src/main/resources/org.onap.so.trust.jks Binary files differnew file mode 100644 index 0000000000..39c310e27e --- /dev/null +++ b/so-monitoring/so-monitoring-service/src/main/resources/org.onap.so.trust.jks diff --git a/so-monitoring/so-monitoring-ui/pom.xml b/so-monitoring/so-monitoring-ui/pom.xml index 71480416d3..574d78287a 100644 --- a/so-monitoring/so-monitoring-ui/pom.xml +++ b/so-monitoring/so-monitoring-ui/pom.xml @@ -49,7 +49,7 @@ </goals> <phase>generate-resources</phase> <configuration> - <nodeVersion>v10.15.3</nodeVersion> + <nodeVersion>v10.19.0</nodeVersion> <yarnVersion>v1.7.0</yarnVersion> </configuration> </execution> diff --git a/so-monitoring/so-monitoring-ui/src/main/frontend/angular.json b/so-monitoring/so-monitoring-ui/src/main/frontend/angular.json index b58ee265d0..45feb6007c 100644 --- a/so-monitoring/so-monitoring-ui/src/main/frontend/angular.json +++ b/so-monitoring/so-monitoring-ui/src/main/frontend/angular.json @@ -55,7 +55,9 @@ "serve": { "builder": "@angular-devkit/build-angular:dev-server", "options": { - "browserTarget": "ONAP-SO-Monitor:build" + "browserTarget": "ONAP-SO-Monitor:build", + "sslKey": "src/app/ssl/localhost.key", + "sslCert": "src/app/ssl/localhost.crt" }, "configurations": { "production": { diff --git a/so-monitoring/so-monitoring-ui/src/main/frontend/package.json b/so-monitoring/so-monitoring-ui/src/main/frontend/package.json index c793264e99..fcbeabed69 100644 --- a/so-monitoring/so-monitoring-ui/src/main/frontend/package.json +++ b/so-monitoring/so-monitoring-ui/src/main/frontend/package.json @@ -3,7 +3,7 @@ "version": "0.0.0", "scripts": { "ng": "ng", - "start": "ng serve", + "start": "ng serve --ssl", "build": "ng build", "test": "ng test", "lint": "ng lint", diff --git a/so-monitoring/so-monitoring-ui/src/main/frontend/src/app/ssl/localhost.crt b/so-monitoring/so-monitoring-ui/src/main/frontend/src/app/ssl/localhost.crt new file mode 100644 index 0000000000..7995c0e2c3 --- /dev/null +++ b/so-monitoring/so-monitoring-ui/src/main/frontend/src/app/ssl/localhost.crt @@ -0,0 +1,23 @@ +-----BEGIN CERTIFICATE----- +MIID5jCCAs6gAwIBAgIUPVNQnCGr+uu048oN/oILqbk+DKwwDQYJKoZIhvcNAQEL +BQAwgZ8xCzAJBgNVBAYTAkdCMQ8wDQYDVQQIDAZMb25kb24xDzANBgNVBAcMBkxv +bmRvbjEYMBYGA1UECgwPTXkgT3JnYW5pc2F0aW9uMR8wHQYDVQQLDBZNeSBPcmdh +bmlzYXRpb25hbCBVbml0MR8wHQYJKoZIhvcNAQkBFhBlbWFpbEBkb21haW4uY29t +MRIwEAYDVQQDDAlsb2NhbGhvc3QwHhcNMjAwODA3MTIyMjM2WhcNMzAwNTA3MTIy +MjM2WjCBnzELMAkGA1UEBhMCR0IxDzANBgNVBAgMBkxvbmRvbjEPMA0GA1UEBwwG +TG9uZG9uMRgwFgYDVQQKDA9NeSBPcmdhbmlzYXRpb24xHzAdBgNVBAsMFk15IE9y +Z2FuaXNhdGlvbmFsIFVuaXQxHzAdBgkqhkiG9w0BCQEWEGVtYWlsQGRvbWFpbi5j +b20xEjAQBgNVBAMMCWxvY2FsaG9zdDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCC +AQoCggEBAKCtMRhrl1o1obijVfREsIatq/fEiFETCtSx3mJVKjZjYNHFn2/OjvXo +ncABnhKiFND8XiLYEgzDw9rtX3l2RVe9gQm2zNUvKPcmO+D4Dsn6QJu8HS7uDU8m +gaXRiEUHsjD+jvEF/sUKjD565XRGd9qCyDpdtjra2W7CGZdzTrdepMRJhxMmA0fB +t3JsV/52WMCqU6drSxT8hH7PvXh4nwr9DQ2fvUZarRptiW2Dg9zSqO+6M3XWCvUI +jdm4Q0jxXY2jCLsh1oTo3dIYdHedB4LORXAPIRsLdJ1/ofl9NdyL20kG4ONIdJXv +5mTuPGBATGOWEJvD8TTxrZtEMx9GNTsCAwEAAaMYMBYwFAYDVR0RBA0wC4IJbG9j +YWxob3N0MA0GCSqGSIb3DQEBCwUAA4IBAQAIDUoitU/11f9ApfPXwtuDaPeX20sc +gSfq/MLQ9LttSi/SpAjebSlp12JNkZvxuV+2cPmc92NWv8WXqfyP+0BDhlGTm1qp +Hc/wRB9ASG/7Z1imAh+zpNXFe0fV0HpUqJx33ywiXLoMTTaSvwPSF4VEki8g9h2R +8zVXjsaE0ybi4eUIKG+ZJ2EBaVgLMEm+osVMnkTEWIeR3XN66Ko2SegvOrAjfOyz +CIqkDvPhowYkKVV4LSsFIgz+YKOVMxaEcHbrxciYKymmWQ/9I/ek8TUs8C4z6cKs +n+9nvYisfFpZ6tpMU+cgYkGezOCV5+nAri+SHoAfAOMXVPLACT39sOF9 +-----END CERTIFICATE----- diff --git a/so-monitoring/so-monitoring-ui/src/main/frontend/src/app/ssl/localhost.key b/so-monitoring/so-monitoring-ui/src/main/frontend/src/app/ssl/localhost.key new file mode 100644 index 0000000000..85e6b7e09d --- /dev/null +++ b/so-monitoring/so-monitoring-ui/src/main/frontend/src/app/ssl/localhost.key @@ -0,0 +1,28 @@ +-----BEGIN PRIVATE KEY----- +MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCgrTEYa5daNaG4 +o1X0RLCGrav3xIhREwrUsd5iVSo2Y2DRxZ9vzo716J3AAZ4SohTQ/F4i2BIMw8Pa +7V95dkVXvYEJtszVLyj3Jjvg+A7J+kCbvB0u7g1PJoGl0YhFB7Iw/o7xBf7FCow+ +euV0Rnfagsg6XbY62tluwhmXc063XqTESYcTJgNHwbdybFf+dljAqlOna0sU/IR+ +z714eJ8K/Q0Nn71GWq0abYltg4Pc0qjvujN11gr1CI3ZuENI8V2Nowi7IdaE6N3S +GHR3nQeCzkVwDyEbC3Sdf6H5fTXci9tJBuDjSHSV7+Zk7jxgQExjlhCbw/E08a2b +RDMfRjU7AgMBAAECggEAByszAY/rVM8HxCEleJyH87pT7d4K5vMejJbTATgjhgGx +FCrpDif9IOOcBjEMSHCK1TgtSwiw5XjmiCIHHHg2Z8/ArhpF0U0lWsGN8l+e6UwN +DeW6t5lPZrSlHCzZE5tgS+dPoVlPIKNz1mXNTv7F4i3rmQ8NTlrtUI/AbI1seanh +Ofb2yhHkkiHYIUridCDTuhk9hMmypHB9THA7SFRB7C9/zO8T95I2D1QQ5ZO5xKGg +rDAMacSeQMnuKNcyuF4RYoh0T4PmM1NFGH1F1+QKTAt5CU0rkZtMHZ9YuYPYCC1S +f1YrPQSJ5mFstaF9kWDp1rnR2J8Od/KU5ZSOgmvMoQKBgQDUithsDxnGEOQCKXfX +e6/kgaL7mB5Q/Pgeyiy5lyBjTLZcbFeaDzkRBR3zL5v8xbNZ4IsJqkaxJavrIwr4 +R2+WvuznEaeLhFds0ze57kDyV/uunsQwBSJSXYohCRiq1gc7nqpamSSpFFI9Ls81 +JmXSPdyosRWESjCTCrQffZFKhQKBgQDBh4VZ9lSAGfASKjkqGLncAEHcnCbavQoy +2DlHEhA+gZDvR2CSsunIxlQerZC78KcTA+oex54Ovi+NG8Rx6qyyywxiGjm0e1yG +B2z060CTO9PlMhs81kXJkUDxR4tHyMNtLaFKICJ9J6wZXBnYZcMU+Do7OhlRVoaL +qrNwhonsvwKBgCCTq3pckim+mwQN0RWRGrOefxmrBjKJo4osmNBVbpxpvKXL4V12 +qduG+kE08ea7crL67LStiapLSN+AfoTxhhQH7Y25MgH7Zd8DPM5dy0yZ2bS5Fv75 +Onp/ZdWMbGB6757eweOjB3B28ef4zb+qw/6GhtTAV7jwGiPfhx4wg911AoGBAIAP +1H82UK4/+6uZgyBHIl3hUbPRJKjkJOaGTEiqPFOQWz7rJY2NlMQF8U4nnjmvQm+D +zJ23i/DHiyG9+R1EpCjf0f7sybiTVSNfsIrVTXLgSRRGNt3oEGAUnTvMEu9ae284 +nZ02bHwTD3/sgTHADPpIVAgzJuO69Odg+sKAVK5zAoGAVn6bUm+QVuELmn8CNT+y +XsSks5gu0MDwuSbUwjuNjSGMEab2lwyIgY8CduopyJWLPgkVtALiuXxp6OzPNCE4 +pC/5HNaqawCQ7Kgbk6MjRwY551HQRgMG7wf9iFBP8sfdWG30vYFmiYWN4oUEDi5j +ytwU+extcKSRxj/O1op3KDI= +-----END PRIVATE KEY----- diff --git a/so-monitoring/so-monitoring-ui/src/main/frontend/src/environments/environment.ts b/so-monitoring/so-monitoring-ui/src/main/frontend/src/environments/environment.ts index f0c63fe582..bf2f31d5c9 100644 --- a/so-monitoring/so-monitoring-ui/src/main/frontend/src/environments/environment.ts +++ b/so-monitoring/so-monitoring-ui/src/main/frontend/src/environments/environment.ts @@ -24,5 +24,5 @@ SPDX-License-Identifier: Apache-2.0 export const environment = { production: false, - soMonitoringBackendURL: 'http://so-monitoring:30224/so/monitoring/' + soMonitoringBackendURL: 'https://so-monitoring:30224/so/monitoring/' }; |